From b93bf162b84388170f2726119484ecf9c9729f4e Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Fri, 9 Aug 2024 00:23:51 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc latest, Speakeasy CLI 1.358.0 --- .eslintrc.cjs | 28 + .eslintrc.yml | 17 - .gitignore | 16 + .npmignore | 9 + .speakeasy/gen.lock | 260 +- CONTRIBUTING.md | 26 + README.md | 251 +- RELEASES.md | 12 +- RUNTIMES.md | 22 + USAGE.md | 13 +- docs/lib/utils/retryconfig.md | 24 + .../operations/abortmultipartresponse.md | 11 - docs/sdk/models/operations/actionssummary.md | 13 +- .../models/operations/activateuserresponse.md | 11 - .../operations/addgroupmembersrequest.md | 4 +- .../operations/addgroupmembersresponse.md | 11 - .../models/operations/admingetuserresponse.md | 11 - .../operations/adminlistbadgesresponse.md | 11 - .../operations/adminlistusersresponse.md | 11 - .../operations/anonymizeuserresponse.md | 11 - .../batchpresignmultipartpartsresponse.md | 11 - .../operations/bookmarktopicresponse.md | 10 - .../operations/changepasswordrequest.md | 4 +- .../operations/changepasswordresponse.md | 10 - .../completeexternaluploadresponse.md | 11 - .../operations/completemultipartresponse.md | 11 - .../models/operations/createbackupresponse.md | 11 - .../models/operations/createbadgeresponse.md | 11 - .../operations/createcategoryrequestbody.md | 24 +- .../operations/createcategoryresponse.md | 11 - .../models/operations/creategroupresponse.md | 11 - .../models/operations/createinviteresponse.md | 11 - .../createmultipartuploadresponse.md | 11 - .../operations/createtaggrouppermissions.md | 7 + .../operations/createtaggroupresponse.md | 11 - .../operations/createtopicpostpmresponse.md | 11 - .../operations/createtopictimerrequest.md | 4 +- .../operations/createtopictimerresponse.md | 11 - .../operations/createuploadrequestbody.md | 12 +- .../models/operations/createuploadresponse.md | 11 - .../models/operations/createuserresponse.md | 11 - .../operations/deactivateuserresponse.md | 11 - .../models/operations/deletebadgeresponse.md | 10 - .../models/operations/deletegroupresponse.md | 11 - .../models/operations/deletepostrequest.md | 4 +- .../models/operations/deletepostresponse.md | 10 - .../models/operations/deleteuserrequest.md | 4 +- .../models/operations/deleteuserresponse.md | 11 - .../operations/downloadbackupresponse.md | 10 - .../models/operations/{file.md => filet.md} | 2 +- .../generatepresignedputresponse.md | 11 - .../models/operations/getbackupsresponse.md | 11 - .../models/operations/getcategoryresponse.md | 11 - .../sdk/models/operations/getgroupresponse.md | 11 - .../operations/getnotificationsresponse.md | 11 - docs/sdk/models/operations/getpostresponse.md | 11 - .../models/operations/getpostresponsebody.md | 61 + docs/sdk/models/operations/getsiteresponse.md | 11 - .../models/operations/gettaggroupresponse.md | 11 - docs/sdk/models/operations/gettagresponse.md | 11 - .../gettopicbyexternalidresponse.md | 10 - .../sdk/models/operations/gettopicresponse.md | 11 - .../operations/getuseremailsresponse.md | 11 - .../operations/getuserexternalidresponse.md | 11 - ...etuseridentiyproviderexternalidresponse.md | 11 - docs/sdk/models/operations/getuserresponse.md | 11 - .../getusersentprivatemessagesresponse.md | 11 - .../models/operations/invitetotopicrequest.md | 4 +- .../operations/invitetotopicresponse.md | 11 - .../operations/listcategoriesresponse.md | 11 - .../operations/listcategorytopicsresponse.md | 11 - .../operations/listgroupmembersresponse.md | 11 - .../models/operations/listgroupsresponse.md | 11 - .../operations/listlatesttopicsresponse.md | 11 - .../models/operations/listpostsresponse.md | 11 - .../operations/listtaggroupsresponse.md | 11 - .../sdk/models/operations/listtagsresponse.md | 11 - .../operations/listtoptopicsresponse.md | 11 - .../operations/listuseractionsresponse.md | 11 - .../operations/listuserbadgesresponse.md | 11 - .../listuserprivatemessagesresponse.md | 11 - .../operations/listuserspublicrequest.md | 6 +- .../operations/listuserspublicresponse.md | 11 - docs/sdk/models/operations/lockpostrequest.md | 4 +- .../sdk/models/operations/lockpostresponse.md | 11 - .../models/operations/logoutuserresponse.md | 11 - .../marknotificationsasreadresponse.md | 11 - .../performpostactionactionssummary.md | 11 + .../operations/performpostactionresponse.md | 11 - .../performpostactionresponsebody.md | 98 +- docs/sdk/models/operations/permissions.md | 7 +- .../models/operations/postrepliesresponse.md | 11 - .../operations/refreshgravatarresponse.md | 11 - .../operations/removegroupmembersrequest.md | 4 +- .../operations/removegroupmembersresponse.md | 11 - .../models/operations/removetopicresponse.md | 10 - docs/sdk/models/operations/searchresponse.md | 11 - .../senddownloadbackupemailresponse.md | 10 - .../sendpasswordresetemailresponse.md | 11 - .../operations/setnotificationlevelrequest.md | 4 +- .../setnotificationlevelresponse.md | 11 - .../models/operations/silenceuserrequest.md | 4 +- .../models/operations/silenceuserresponse.md | 11 - .../models/operations/suspenduserrequest.md | 4 +- .../models/operations/suspenduserresponse.md | 11 - docs/sdk/models/operations/taggroup.md | 16 +- .../models/operations/{typet.md => type.md} | 2 +- .../models/operations/updateavatarrequest.md | 4 +- .../models/operations/updateavatarresponse.md | 11 - .../models/operations/updatebadgerequest.md | 4 +- .../models/operations/updatebadgeresponse.md | 11 - .../operations/updatecategorypermissions.md | 10 + .../operations/updatecategoryrequest.md | 4 +- .../operations/updatecategoryrequestbody.md | 24 +- .../operations/updatecategoryresponse.md | 11 - .../models/operations/updateemailrequest.md | 4 +- .../models/operations/updateemailresponse.md | 10 - .../models/operations/updategrouprequest.md | 4 +- .../models/operations/updategroupresponse.md | 11 - .../models/operations/updatepostrequest.md | 4 +- .../models/operations/updatepostresponse.md | 11 - .../operations/updatetaggrouprequest.md | 4 +- .../operations/updatetaggroupresponse.md | 11 - .../models/operations/updatetopicrequest.md | 4 +- .../models/operations/updatetopicresponse.md | 11 - .../operations/updatetopicstatusrequest.md | 4 +- .../operations/updatetopicstatusresponse.md | 11 - .../operations/updatetopictimestamprequest.md | 4 +- .../updatetopictimestampresponse.md | 11 - .../operations/updateusernamerequest.md | 4 +- .../operations/updateusernameresponse.md | 10 - .../models/operations/updateuserrequest.md | 4 +- .../models/operations/updateuserresponse.md | 11 - docs/sdks/admin/README.md | 274 +- docs/sdks/backups/README.md | 97 +- docs/sdks/badges/README.md | 127 +- docs/sdks/categories/README.md | 172 +- docs/sdks/groups/README.md | 249 +- docs/sdks/invites/README.md | 75 +- docs/sdks/notifications/README.md | 44 +- docs/sdks/posts/README.md | 237 +- docs/sdks/privatemessages/README.md | 73 +- docs/sdks/search/README.md | 24 +- docs/sdks/site/README.md | 21 +- docs/sdks/tags/README.md | 145 +- docs/sdks/topics/README.md | 427 +-- docs/sdks/uploads/README.md | 176 +- docs/sdks/users/README.md | 702 ++-- gen.yaml | 14 +- jest.config.js | 8 - jsr.json | 27 + package-lock.json | 3118 ----------------- package.json | 51 +- src/core.ts | 13 + src/funcs/adminActivateUser.ts | 111 + src/funcs/adminAdminGetUser.ts | 111 + src/funcs/adminAdminListUsers.ts | 124 + src/funcs/adminAnonymizeUser.ts | 111 + src/funcs/adminDeactivateUser.ts | 111 + src/funcs/adminDeleteUser.ts | 114 + src/funcs/adminLogOutUser.ts | 111 + src/funcs/adminRefreshGravatar.ts | 114 + src/funcs/adminSilenceUser.ts | 114 + src/funcs/adminSuspendUser.ts | 114 + src/funcs/backupsCreateBackup.ts | 106 + src/funcs/backupsDownloadBackup.ts | 125 + src/funcs/backupsGetBackups.ts | 89 + src/funcs/backupsSendDownloadBackupEmail.ts | 119 + src/funcs/badgesAdminListBadges.ts | 88 + src/funcs/badgesCreateBadge.ts | 106 + src/funcs/badgesDeleteBadge.ts | 112 + src/funcs/badgesListUserBadges.ts | 114 + src/funcs/badgesUpdateBadge.ts | 114 + src/funcs/categoriesCreateCategory.ts | 106 + src/funcs/categoriesGetCategory.ts | 111 + src/funcs/categoriesGetSite.ts | 91 + src/funcs/categoriesListCategories.ts | 112 + src/funcs/categoriesListCategoryTopics.ts | 114 + src/funcs/categoriesUpdateCategory.ts | 114 + src/funcs/groupsAddGroupMembers.ts | 114 + src/funcs/groupsCreateGroup.ts | 106 + src/funcs/groupsDeleteGroup.ts | 111 + src/funcs/groupsGetGroup.ts | 111 + src/funcs/groupsListGroupMembers.ts | 111 + src/funcs/groupsListGroups.ts | 88 + src/funcs/groupsRemoveGroupMembers.ts | 114 + src/funcs/groupsUpdateGroup.ts | 114 + src/funcs/invitesCreateInvite.ts | 120 + src/funcs/invitesInviteToTopic.ts | 126 + src/funcs/notificationsGetNotifications.ts | 88 + .../notificationsMarkNotificationsAsRead.ts | 111 + src/funcs/postsCreateTopicPostPM.ts | 106 + src/funcs/postsDeletePost.ts | 115 + src/funcs/postsGetPost.ts | 119 + src/funcs/postsListPosts.ts | 127 + src/funcs/postsLockPost.ts | 126 + src/funcs/postsPerformPostAction.ts | 120 + src/funcs/postsPostReplies.ts | 112 + src/funcs/postsUpdatePost.ts | 114 + src/funcs/privateMessagesCreateTopicPostPM.ts | 106 + ...ivateMessagesGetUserSentPrivateMessages.ts | 118 + .../privateMessagesListUserPrivateMessages.ts | 118 + src/funcs/searchSearch.ts | 115 + src/funcs/siteGetSite.ts | 91 + src/funcs/tagsCreateTagGroup.ts | 106 + src/funcs/tagsGetTag.ts | 111 + src/funcs/tagsGetTagGroup.ts | 111 + src/funcs/tagsListTagGroups.ts | 88 + src/funcs/tagsListTags.ts | 88 + src/funcs/tagsUpdateTagGroup.ts | 114 + src/funcs/topicsBookmarkTopic.ts | 124 + src/funcs/topicsCreateTopicPostPM.ts | 106 + src/funcs/topicsCreateTopicTimer.ts | 126 + src/funcs/topicsGetTopic.ts | 123 + src/funcs/topicsGetTopicByExternalId.ts | 115 + src/funcs/topicsInviteToTopic.ts | 126 + src/funcs/topicsListLatestTopics.ts | 130 + src/funcs/topicsListTopTopics.ts | 127 + src/funcs/topicsRemoveTopic.ts | 124 + src/funcs/topicsSetNotificationLevel.ts | 126 + src/funcs/topicsUpdateTopic.ts | 126 + src/funcs/topicsUpdateTopicStatus.ts | 126 + src/funcs/topicsUpdateTopicTimestamp.ts | 126 + src/funcs/uploadsAbortMultipart.ts | 121 + .../uploadsBatchPresignMultipartParts.ts | 137 + src/funcs/uploadsCompleteExternalUpload.ts | 131 + src/funcs/uploadsCompleteMultipart.ts | 123 + src/funcs/uploadsCreateMultipartUpload.ts | 125 + src/funcs/uploadsCreateUpload.ts | 125 + src/funcs/uploadsGeneratePresignedPut.ts | 130 + src/funcs/usersActivateUser.ts | 111 + src/funcs/usersAdminGetUser.ts | 111 + src/funcs/usersAdminListUsers.ts | 124 + src/funcs/usersAnonymizeUser.ts | 111 + src/funcs/usersChangePassword.ts | 115 + src/funcs/usersCreateUser.ts | 120 + src/funcs/usersDeactivateUser.ts | 111 + src/funcs/usersDeleteUser.ts | 114 + src/funcs/usersGetUser.ts | 126 + src/funcs/usersGetUserEmails.ts | 114 + src/funcs/usersGetUserExternalId.ts | 126 + .../usersGetUserIdentiyProviderExternalId.ts | 138 + src/funcs/usersListUserActions.ts | 118 + src/funcs/usersListUserBadges.ts | 114 + src/funcs/usersListUsersPublic.ts | 121 + src/funcs/usersLogOutUser.ts | 111 + src/funcs/usersRefreshGravatar.ts | 114 + src/funcs/usersSendPasswordResetEmail.ts | 111 + src/funcs/usersSilenceUser.ts | 114 + src/funcs/usersSuspendUser.ts | 114 + src/funcs/usersUpdateAvatar.ts | 117 + src/funcs/usersUpdateEmail.ts | 118 + src/funcs/usersUpdateUser.ts | 129 + src/funcs/usersUpdateUsername.ts | 118 + src/hooks/hooks.ts | 103 + src/hooks/index.ts | 6 + src/hooks/registration.ts | 14 + src/hooks/types.ts | 89 + src/index.ts | 5 +- src/internal/utils/contenttype.ts | 33 - src/internal/utils/headers.ts | 138 - src/internal/utils/index.ts | 12 - src/internal/utils/pathparams.ts | 79 - src/internal/utils/queryparams.ts | 248 -- src/internal/utils/requestbody.ts | 357 -- src/internal/utils/retries.ts | 182 - src/internal/utils/security.ts | 259 -- src/internal/utils/utils.ts | 367 -- src/lib/base64.ts | 37 + src/lib/config.ts | 64 + src/lib/dlv.ts | 53 + src/lib/encodings.ts | 449 +++ src/lib/http.ts | 323 ++ src/lib/is-plain-object.ts | 43 + src/lib/matchers.ts | 308 ++ src/lib/primitives.ts | 40 + src/lib/retries.ts | 187 + src/lib/schemas.ts | 74 + src/lib/sdks.ts | 261 ++ src/lib/security.ts | 170 + src/lib/url.ts | 33 + src/sdk/admin.ts | 699 +--- src/sdk/backups.ts | 248 +- src/sdk/badges.ts | 334 +- src/sdk/categories.ts | 406 +-- src/sdk/groups.ts | 548 +-- src/sdk/index.ts | 4 +- src/sdk/invites.ts | 177 +- src/sdk/models/errors/httpclienterrors.ts | 62 + src/sdk/models/errors/index.ts | 5 +- src/sdk/models/errors/sdkerror.ts | 42 +- src/sdk/models/errors/sdkvalidationerror.ts | 95 + src/sdk/models/operations/abortmultipart.ts | 117 +- src/sdk/models/operations/activateuser.ts | 103 +- src/sdk/models/operations/addgroupmembers.ts | 181 +- src/sdk/models/operations/admingetuser.ts | 1435 +++++--- src/sdk/models/operations/adminlistbadges.ts | 591 +++- src/sdk/models/operations/adminlistusers.ts | 472 ++- src/sdk/models/operations/anonymizeuser.ts | 109 +- .../operations/batchpresignmultipartparts.ts | 169 +- src/sdk/models/operations/bookmarktopic.ts | 89 +- src/sdk/models/operations/changepassword.ts | 123 +- .../operations/completeexternalupload.ts | 253 +- .../models/operations/completemultipart.ts | 233 +- src/sdk/models/operations/createbackup.ts | 117 +- src/sdk/models/operations/createbadge.ts | 401 ++- src/sdk/models/operations/createcategory.ts | 914 +++-- src/sdk/models/operations/creategroup.ts | 627 ++-- src/sdk/models/operations/createinvite.ts | 348 +- .../operations/createmultipartupload.ts | 253 +- src/sdk/models/operations/createtaggroup.ts | 237 +- .../models/operations/createtopicpostpm.ts | 694 ++-- src/sdk/models/operations/createtopictimer.ts | 271 +- src/sdk/models/operations/createupload.ts | 327 +- src/sdk/models/operations/createuser.ts | 296 +- src/sdk/models/operations/deactivateuser.ts | 103 +- src/sdk/models/operations/deletebadge.ts | 64 +- src/sdk/models/operations/deletegroup.ts | 103 +- src/sdk/models/operations/deletepost.ts | 128 +- src/sdk/models/operations/deleteuser.ts | 206 +- src/sdk/models/operations/downloadbackup.ts | 69 +- .../models/operations/generatepresignedput.ts | 305 +- src/sdk/models/operations/getbackups.ts | 93 +- src/sdk/models/operations/getcategory.ts | 778 ++-- src/sdk/models/operations/getgroup.ts | 869 +++-- src/sdk/models/operations/getnotifications.ts | 311 +- src/sdk/models/operations/getpost.ts | 464 ++- src/sdk/models/operations/getsite.ts | 2125 +++++++---- src/sdk/models/operations/gettag.ts | 806 +++-- src/sdk/models/operations/gettaggroup.ts | 264 +- src/sdk/models/operations/gettopic.ts | 2165 ++++++++---- .../models/operations/gettopicbyexternalid.ts | 77 +- src/sdk/models/operations/getuser.ts | 1992 +++++++---- src/sdk/models/operations/getuseremails.ts | 140 +- .../models/operations/getuserexternalid.ts | 2042 +++++++---- .../getuseridentiyproviderexternalid.ts | 2061 +++++++---- .../operations/getusersentprivatemessages.ts | 754 ++-- src/sdk/models/operations/index.ts | 172 +- src/sdk/models/operations/invitetotopic.ts | 269 +- src/sdk/models/operations/listcategories.ts | 572 ++- .../models/operations/listcategorytopics.ts | 611 +++- src/sdk/models/operations/listgroupmembers.ts | 375 +- src/sdk/models/operations/listgroups.ts | 465 ++- src/sdk/models/operations/listlatesttopics.ts | 779 ++-- src/sdk/models/operations/listposts.ts | 740 ++-- src/sdk/models/operations/listtaggroups.ts | 215 +- src/sdk/models/operations/listtags.ts | 196 +- src/sdk/models/operations/listtoptopics.ts | 782 +++-- src/sdk/models/operations/listuseractions.ts | 375 +- src/sdk/models/operations/listuserbadges.ts | 554 ++- .../operations/listuserprivatemessages.ts | 841 +++-- src/sdk/models/operations/listuserspublic.ts | 507 ++- src/sdk/models/operations/lockpost.ts | 177 +- src/sdk/models/operations/logoutuser.ts | 100 +- .../operations/marknotificationsasread.ts | 108 +- .../models/operations/performpostaction.ts | 750 ++-- src/sdk/models/operations/postreplies.ts | 632 ++-- src/sdk/models/operations/refreshgravatar.ts | 126 +- .../models/operations/removegroupmembers.ts | 193 +- src/sdk/models/operations/removetopic.ts | 89 +- src/sdk/models/operations/search.ts | 321 +- .../operations/senddownloadbackupemail.ts | 64 +- .../operations/sendpasswordresetemail.ts | 123 +- .../models/operations/setnotificationlevel.ts | 226 +- src/sdk/models/operations/silenceuser.ts | 347 +- src/sdk/models/operations/suspenduser.ts | 349 +- src/sdk/models/operations/updateavatar.ts | 216 +- src/sdk/models/operations/updatebadge.ts | 465 ++- src/sdk/models/operations/updatecategory.ts | 1000 ++++-- src/sdk/models/operations/updateemail.ts | 117 +- src/sdk/models/operations/updategroup.ts | 394 ++- src/sdk/models/operations/updatepost.ts | 741 ++-- src/sdk/models/operations/updatetaggroup.ts | 333 +- src/sdk/models/operations/updatetopic.ts | 335 +- .../models/operations/updatetopicstatus.ts | 274 +- .../models/operations/updatetopictimestamp.ts | 181 +- src/sdk/models/operations/updateuser.ts | 267 +- src/sdk/models/operations/updateusername.ts | 129 +- src/sdk/notifications.ts | 150 +- src/sdk/posts.ts | 571 +-- src/sdk/privatemessages.ts | 222 +- src/sdk/sdk.ts | 271 +- src/sdk/search.ts | 84 +- src/sdk/site.ts | 73 +- src/sdk/tags.ts | 394 +-- src/sdk/topics.ts | 936 +---- src/sdk/types/blobs.ts | 31 + src/sdk/types/enums.ts | 16 + src/sdk/types/fp.ts | 50 + src/sdk/types/index.ts | 10 +- src/sdk/types/operations.ts | 99 + src/sdk/types/rfcdate.ts | 68 +- src/sdk/uploads.ts | 544 +-- src/sdk/users.ts | 1670 +-------- tsconfig.json | 55 +- 395 files changed, 44768 insertions(+), 26373 deletions(-) create mode 100644 .eslintrc.cjs delete mode 100644 .eslintrc.yml create mode 100644 .npmignore create mode 100644 CONTRIBUTING.md create mode 100644 RUNTIMES.md create mode 100644 docs/lib/utils/retryconfig.md delete mode 100644 docs/sdk/models/operations/abortmultipartresponse.md delete mode 100644 docs/sdk/models/operations/activateuserresponse.md delete mode 100644 docs/sdk/models/operations/addgroupmembersresponse.md delete mode 100644 docs/sdk/models/operations/admingetuserresponse.md delete mode 100644 docs/sdk/models/operations/adminlistbadgesresponse.md delete mode 100644 docs/sdk/models/operations/adminlistusersresponse.md delete mode 100644 docs/sdk/models/operations/anonymizeuserresponse.md delete mode 100644 docs/sdk/models/operations/batchpresignmultipartpartsresponse.md delete mode 100644 docs/sdk/models/operations/bookmarktopicresponse.md delete mode 100644 docs/sdk/models/operations/changepasswordresponse.md delete mode 100644 docs/sdk/models/operations/completeexternaluploadresponse.md delete mode 100644 docs/sdk/models/operations/completemultipartresponse.md delete mode 100644 docs/sdk/models/operations/createbackupresponse.md delete mode 100644 docs/sdk/models/operations/createbadgeresponse.md delete mode 100644 docs/sdk/models/operations/createcategoryresponse.md delete mode 100644 docs/sdk/models/operations/creategroupresponse.md delete mode 100644 docs/sdk/models/operations/createinviteresponse.md delete mode 100644 docs/sdk/models/operations/createmultipartuploadresponse.md create mode 100644 docs/sdk/models/operations/createtaggrouppermissions.md delete mode 100644 docs/sdk/models/operations/createtaggroupresponse.md delete mode 100644 docs/sdk/models/operations/createtopicpostpmresponse.md delete mode 100644 docs/sdk/models/operations/createtopictimerresponse.md delete mode 100644 docs/sdk/models/operations/createuploadresponse.md delete mode 100644 docs/sdk/models/operations/createuserresponse.md delete mode 100644 docs/sdk/models/operations/deactivateuserresponse.md delete mode 100644 docs/sdk/models/operations/deletebadgeresponse.md delete mode 100644 docs/sdk/models/operations/deletegroupresponse.md delete mode 100644 docs/sdk/models/operations/deletepostresponse.md delete mode 100644 docs/sdk/models/operations/deleteuserresponse.md delete mode 100644 docs/sdk/models/operations/downloadbackupresponse.md rename docs/sdk/models/operations/{file.md => filet.md} (97%) delete mode 100644 docs/sdk/models/operations/generatepresignedputresponse.md delete mode 100644 docs/sdk/models/operations/getbackupsresponse.md delete mode 100644 docs/sdk/models/operations/getcategoryresponse.md delete mode 100644 docs/sdk/models/operations/getgroupresponse.md delete mode 100644 docs/sdk/models/operations/getnotificationsresponse.md delete mode 100644 docs/sdk/models/operations/getpostresponse.md create mode 100644 docs/sdk/models/operations/getpostresponsebody.md delete mode 100644 docs/sdk/models/operations/getsiteresponse.md delete mode 100644 docs/sdk/models/operations/gettaggroupresponse.md delete mode 100644 docs/sdk/models/operations/gettagresponse.md delete mode 100644 docs/sdk/models/operations/gettopicbyexternalidresponse.md delete mode 100644 docs/sdk/models/operations/gettopicresponse.md delete mode 100644 docs/sdk/models/operations/getuseremailsresponse.md delete mode 100644 docs/sdk/models/operations/getuserexternalidresponse.md delete mode 100644 docs/sdk/models/operations/getuseridentiyproviderexternalidresponse.md delete mode 100644 docs/sdk/models/operations/getuserresponse.md delete mode 100644 docs/sdk/models/operations/getusersentprivatemessagesresponse.md delete mode 100644 docs/sdk/models/operations/invitetotopicresponse.md delete mode 100644 docs/sdk/models/operations/listcategoriesresponse.md delete mode 100644 docs/sdk/models/operations/listcategorytopicsresponse.md delete mode 100644 docs/sdk/models/operations/listgroupmembersresponse.md delete mode 100644 docs/sdk/models/operations/listgroupsresponse.md delete mode 100644 docs/sdk/models/operations/listlatesttopicsresponse.md delete mode 100644 docs/sdk/models/operations/listpostsresponse.md delete mode 100644 docs/sdk/models/operations/listtaggroupsresponse.md delete mode 100644 docs/sdk/models/operations/listtagsresponse.md delete mode 100644 docs/sdk/models/operations/listtoptopicsresponse.md delete mode 100644 docs/sdk/models/operations/listuseractionsresponse.md delete mode 100644 docs/sdk/models/operations/listuserbadgesresponse.md delete mode 100644 docs/sdk/models/operations/listuserprivatemessagesresponse.md delete mode 100644 docs/sdk/models/operations/listuserspublicresponse.md delete mode 100644 docs/sdk/models/operations/lockpostresponse.md delete mode 100644 docs/sdk/models/operations/logoutuserresponse.md delete mode 100644 docs/sdk/models/operations/marknotificationsasreadresponse.md create mode 100644 docs/sdk/models/operations/performpostactionactionssummary.md delete mode 100644 docs/sdk/models/operations/performpostactionresponse.md delete mode 100644 docs/sdk/models/operations/postrepliesresponse.md delete mode 100644 docs/sdk/models/operations/refreshgravatarresponse.md delete mode 100644 docs/sdk/models/operations/removegroupmembersresponse.md delete mode 100644 docs/sdk/models/operations/removetopicresponse.md delete mode 100644 docs/sdk/models/operations/searchresponse.md delete mode 100644 docs/sdk/models/operations/senddownloadbackupemailresponse.md delete mode 100644 docs/sdk/models/operations/sendpasswordresetemailresponse.md delete mode 100644 docs/sdk/models/operations/setnotificationlevelresponse.md delete mode 100644 docs/sdk/models/operations/silenceuserresponse.md delete mode 100644 docs/sdk/models/operations/suspenduserresponse.md rename docs/sdk/models/operations/{typet.md => type.md} (97%) delete mode 100644 docs/sdk/models/operations/updateavatarresponse.md delete mode 100644 docs/sdk/models/operations/updatebadgeresponse.md create mode 100644 docs/sdk/models/operations/updatecategorypermissions.md delete mode 100644 docs/sdk/models/operations/updatecategoryresponse.md delete mode 100644 docs/sdk/models/operations/updateemailresponse.md delete mode 100644 docs/sdk/models/operations/updategroupresponse.md delete mode 100644 docs/sdk/models/operations/updatepostresponse.md delete mode 100644 docs/sdk/models/operations/updatetaggroupresponse.md delete mode 100644 docs/sdk/models/operations/updatetopicresponse.md delete mode 100644 docs/sdk/models/operations/updatetopicstatusresponse.md delete mode 100644 docs/sdk/models/operations/updatetopictimestampresponse.md delete mode 100644 docs/sdk/models/operations/updateusernameresponse.md delete mode 100644 docs/sdk/models/operations/updateuserresponse.md delete mode 100644 jest.config.js create mode 100644 jsr.json delete mode 100644 package-lock.json create mode 100644 src/core.ts create mode 100644 src/funcs/adminActivateUser.ts create mode 100644 src/funcs/adminAdminGetUser.ts create mode 100644 src/funcs/adminAdminListUsers.ts create mode 100644 src/funcs/adminAnonymizeUser.ts create mode 100644 src/funcs/adminDeactivateUser.ts create mode 100644 src/funcs/adminDeleteUser.ts create mode 100644 src/funcs/adminLogOutUser.ts create mode 100644 src/funcs/adminRefreshGravatar.ts create mode 100644 src/funcs/adminSilenceUser.ts create mode 100644 src/funcs/adminSuspendUser.ts create mode 100644 src/funcs/backupsCreateBackup.ts create mode 100644 src/funcs/backupsDownloadBackup.ts create mode 100644 src/funcs/backupsGetBackups.ts create mode 100644 src/funcs/backupsSendDownloadBackupEmail.ts create mode 100644 src/funcs/badgesAdminListBadges.ts create mode 100644 src/funcs/badgesCreateBadge.ts create mode 100644 src/funcs/badgesDeleteBadge.ts create mode 100644 src/funcs/badgesListUserBadges.ts create mode 100644 src/funcs/badgesUpdateBadge.ts create mode 100644 src/funcs/categoriesCreateCategory.ts create mode 100644 src/funcs/categoriesGetCategory.ts create mode 100644 src/funcs/categoriesGetSite.ts create mode 100644 src/funcs/categoriesListCategories.ts create mode 100644 src/funcs/categoriesListCategoryTopics.ts create mode 100644 src/funcs/categoriesUpdateCategory.ts create mode 100644 src/funcs/groupsAddGroupMembers.ts create mode 100644 src/funcs/groupsCreateGroup.ts create mode 100644 src/funcs/groupsDeleteGroup.ts create mode 100644 src/funcs/groupsGetGroup.ts create mode 100644 src/funcs/groupsListGroupMembers.ts create mode 100644 src/funcs/groupsListGroups.ts create mode 100644 src/funcs/groupsRemoveGroupMembers.ts create mode 100644 src/funcs/groupsUpdateGroup.ts create mode 100644 src/funcs/invitesCreateInvite.ts create mode 100644 src/funcs/invitesInviteToTopic.ts create mode 100644 src/funcs/notificationsGetNotifications.ts create mode 100644 src/funcs/notificationsMarkNotificationsAsRead.ts create mode 100644 src/funcs/postsCreateTopicPostPM.ts create mode 100644 src/funcs/postsDeletePost.ts create mode 100644 src/funcs/postsGetPost.ts create mode 100644 src/funcs/postsListPosts.ts create mode 100644 src/funcs/postsLockPost.ts create mode 100644 src/funcs/postsPerformPostAction.ts create mode 100644 src/funcs/postsPostReplies.ts create mode 100644 src/funcs/postsUpdatePost.ts create mode 100644 src/funcs/privateMessagesCreateTopicPostPM.ts create mode 100644 src/funcs/privateMessagesGetUserSentPrivateMessages.ts create mode 100644 src/funcs/privateMessagesListUserPrivateMessages.ts create mode 100644 src/funcs/searchSearch.ts create mode 100644 src/funcs/siteGetSite.ts create mode 100644 src/funcs/tagsCreateTagGroup.ts create mode 100644 src/funcs/tagsGetTag.ts create mode 100644 src/funcs/tagsGetTagGroup.ts create mode 100644 src/funcs/tagsListTagGroups.ts create mode 100644 src/funcs/tagsListTags.ts create mode 100644 src/funcs/tagsUpdateTagGroup.ts create mode 100644 src/funcs/topicsBookmarkTopic.ts create mode 100644 src/funcs/topicsCreateTopicPostPM.ts create mode 100644 src/funcs/topicsCreateTopicTimer.ts create mode 100644 src/funcs/topicsGetTopic.ts create mode 100644 src/funcs/topicsGetTopicByExternalId.ts create mode 100644 src/funcs/topicsInviteToTopic.ts create mode 100644 src/funcs/topicsListLatestTopics.ts create mode 100644 src/funcs/topicsListTopTopics.ts create mode 100644 src/funcs/topicsRemoveTopic.ts create mode 100644 src/funcs/topicsSetNotificationLevel.ts create mode 100644 src/funcs/topicsUpdateTopic.ts create mode 100644 src/funcs/topicsUpdateTopicStatus.ts create mode 100644 src/funcs/topicsUpdateTopicTimestamp.ts create mode 100644 src/funcs/uploadsAbortMultipart.ts create mode 100644 src/funcs/uploadsBatchPresignMultipartParts.ts create mode 100644 src/funcs/uploadsCompleteExternalUpload.ts create mode 100644 src/funcs/uploadsCompleteMultipart.ts create mode 100644 src/funcs/uploadsCreateMultipartUpload.ts create mode 100644 src/funcs/uploadsCreateUpload.ts create mode 100644 src/funcs/uploadsGeneratePresignedPut.ts create mode 100644 src/funcs/usersActivateUser.ts create mode 100644 src/funcs/usersAdminGetUser.ts create mode 100644 src/funcs/usersAdminListUsers.ts create mode 100644 src/funcs/usersAnonymizeUser.ts create mode 100644 src/funcs/usersChangePassword.ts create mode 100644 src/funcs/usersCreateUser.ts create mode 100644 src/funcs/usersDeactivateUser.ts create mode 100644 src/funcs/usersDeleteUser.ts create mode 100644 src/funcs/usersGetUser.ts create mode 100644 src/funcs/usersGetUserEmails.ts create mode 100644 src/funcs/usersGetUserExternalId.ts create mode 100644 src/funcs/usersGetUserIdentiyProviderExternalId.ts create mode 100644 src/funcs/usersListUserActions.ts create mode 100644 src/funcs/usersListUserBadges.ts create mode 100644 src/funcs/usersListUsersPublic.ts create mode 100644 src/funcs/usersLogOutUser.ts create mode 100644 src/funcs/usersRefreshGravatar.ts create mode 100644 src/funcs/usersSendPasswordResetEmail.ts create mode 100644 src/funcs/usersSilenceUser.ts create mode 100644 src/funcs/usersSuspendUser.ts create mode 100644 src/funcs/usersUpdateAvatar.ts create mode 100644 src/funcs/usersUpdateEmail.ts create mode 100644 src/funcs/usersUpdateUser.ts create mode 100644 src/funcs/usersUpdateUsername.ts create mode 100644 src/hooks/hooks.ts create mode 100644 src/hooks/index.ts create mode 100644 src/hooks/registration.ts create mode 100644 src/hooks/types.ts delete mode 100644 src/internal/utils/contenttype.ts delete mode 100644 src/internal/utils/headers.ts delete mode 100644 src/internal/utils/index.ts delete mode 100644 src/internal/utils/pathparams.ts delete mode 100644 src/internal/utils/queryparams.ts delete mode 100644 src/internal/utils/requestbody.ts delete mode 100644 src/internal/utils/retries.ts delete mode 100644 src/internal/utils/security.ts delete mode 100644 src/internal/utils/utils.ts create mode 100644 src/lib/base64.ts create mode 100644 src/lib/config.ts create mode 100644 src/lib/dlv.ts create mode 100644 src/lib/encodings.ts create mode 100644 src/lib/http.ts create mode 100644 src/lib/is-plain-object.ts create mode 100644 src/lib/matchers.ts create mode 100644 src/lib/primitives.ts create mode 100644 src/lib/retries.ts create mode 100644 src/lib/schemas.ts create mode 100644 src/lib/sdks.ts create mode 100644 src/lib/security.ts create mode 100644 src/lib/url.ts create mode 100644 src/sdk/models/errors/httpclienterrors.ts create mode 100644 src/sdk/models/errors/sdkvalidationerror.ts create mode 100644 src/sdk/types/blobs.ts create mode 100644 src/sdk/types/enums.ts create mode 100644 src/sdk/types/fp.ts create mode 100644 src/sdk/types/operations.ts diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 0000000..4d160bd --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,28 @@ +/* eslint-env node */ +module.exports = { + root: true, + extends: [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "plugin:import/recommended", + "plugin:import/typescript", + ], + parser: "@typescript-eslint/parser", + plugins: ["@typescript-eslint"], + settings: { + "import/resolver": { + typescript: true, + node: true, + }, + }, + rules: { + // Handled by typescript compiler + "@typescript-eslint/no-unused-vars": "off", + "@typescript-eslint/ban-types": "off", + "@typescript-eslint/no-namespace": "off", + "@typescript-eslint/no-explicit-any": "off", + "import/no-named-as-default-member": "off", + + "import/no-default-export": "error", + }, +}; diff --git a/.eslintrc.yml b/.eslintrc.yml deleted file mode 100644 index 565e624..0000000 --- a/.eslintrc.yml +++ /dev/null @@ -1,17 +0,0 @@ -env: - browser: true - es2021: true - node: true -extends: - - eslint:recommended - - plugin:@typescript-eslint/recommended -overrides: [] -parser: "@typescript-eslint/parser" -parserOptions: - ecmaVersion: latest - sourceType: module -plugins: - - "@typescript-eslint" -rules: - "@typescript-eslint/no-explicit-any": "off" - "no-prototype-builtins": "off" diff --git a/.gitignore b/.gitignore index 1eae0cf..06cb118 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,18 @@ +/models +/sdk/models/errors +/sdk/types +/node_modules +/lib +/sdk +/funcs +/hooks +/index.* +/core.* +/cjs +/esm +/dist +/.tsbuildinfo +/.tshy +/.tshy-* dist/ node_modules/ diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..3ef05d1 --- /dev/null +++ b/.npmignore @@ -0,0 +1,9 @@ +**/* +!/**/*.ts +!/**/*.js +!/**/*.map + +/.eslintrc.js +/cjs +/.tshy +/.tshy-* diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 0b2e085..2e71a3a 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -3,21 +3,131 @@ id: 599a9576-4665-431e-be1e-44cc13ef28aa management: docChecksum: dd4d04e62622de8f631720b5be68964d docVersion: latest - speakeasyVersion: 1.346.0 - generationVersion: 2.379.3 - releaseVersion: 0.4.10 - configChecksum: 240e038948a2a629d8d91a2085f29d6b + speakeasyVersion: 1.358.0 + generationVersion: 2.390.6 + releaseVersion: 0.5.0 + configChecksum: 76366dee2b6c919409101b279e0d2575 repoURL: https://github.com/LukeHagar/discoursejs.git repoSubDirectory: . installationURL: https://github.com/LukeHagar/discoursejs published: true features: typescript: - core: 3.4.14 + additionalDependencies: 0.1.0 + additionalProperties: 0.1.1 + constsAndDefaults: 0.1.6 + core: 3.12.3 + defaultEnabledRetries: 0.1.0 deprecations: 2.81.1 + envVarSecurityUsage: 0.1.1 flattening: 2.81.1 - globalServerURLs: 2.82.2 + globalSecurityCallbacks: 0.1.0 + globalServerURLs: 2.82.4 + nullables: 0.1.0 + responseFormat: 0.2.3 + retries: 2.83.0 + sdkHooks: 0.1.0 generatedFiles: + - src/funcs/backupsCreateBackup.ts + - src/funcs/backupsDownloadBackup.ts + - src/funcs/backupsGetBackups.ts + - src/funcs/backupsSendDownloadBackupEmail.ts + - src/funcs/badgesAdminListBadges.ts + - src/funcs/badgesCreateBadge.ts + - src/funcs/badgesDeleteBadge.ts + - src/funcs/badgesListUserBadges.ts + - src/funcs/badgesUpdateBadge.ts + - src/funcs/groupsAddGroupMembers.ts + - src/funcs/groupsCreateGroup.ts + - src/funcs/groupsDeleteGroup.ts + - src/funcs/groupsGetGroup.ts + - src/funcs/groupsListGroupMembers.ts + - src/funcs/groupsListGroups.ts + - src/funcs/groupsRemoveGroupMembers.ts + - src/funcs/groupsUpdateGroup.ts + - src/funcs/usersActivateUser.ts + - src/funcs/usersAdminGetUser.ts + - src/funcs/usersAdminListUsers.ts + - src/funcs/usersAnonymizeUser.ts + - src/funcs/usersChangePassword.ts + - src/funcs/usersCreateUser.ts + - src/funcs/usersDeactivateUser.ts + - src/funcs/usersDeleteUser.ts + - src/funcs/usersGetUser.ts + - src/funcs/usersGetUserEmails.ts + - src/funcs/usersGetUserExternalId.ts + - src/funcs/usersGetUserIdentiyProviderExternalId.ts + - src/funcs/usersListUserActions.ts + - src/funcs/usersListUserBadges.ts + - src/funcs/usersListUsersPublic.ts + - src/funcs/usersLogOutUser.ts + - src/funcs/usersRefreshGravatar.ts + - src/funcs/usersSendPasswordResetEmail.ts + - src/funcs/usersSilenceUser.ts + - src/funcs/usersSuspendUser.ts + - src/funcs/usersUpdateAvatar.ts + - src/funcs/usersUpdateEmail.ts + - src/funcs/usersUpdateUser.ts + - src/funcs/usersUpdateUsername.ts + - src/funcs/adminActivateUser.ts + - src/funcs/adminAdminGetUser.ts + - src/funcs/adminAdminListUsers.ts + - src/funcs/adminAnonymizeUser.ts + - src/funcs/adminDeactivateUser.ts + - src/funcs/adminDeleteUser.ts + - src/funcs/adminLogOutUser.ts + - src/funcs/adminRefreshGravatar.ts + - src/funcs/adminSilenceUser.ts + - src/funcs/adminSuspendUser.ts + - src/funcs/categoriesCreateCategory.ts + - src/funcs/categoriesGetCategory.ts + - src/funcs/categoriesGetSite.ts + - src/funcs/categoriesListCategories.ts + - src/funcs/categoriesListCategoryTopics.ts + - src/funcs/categoriesUpdateCategory.ts + - src/funcs/invitesCreateInvite.ts + - src/funcs/invitesInviteToTopic.ts + - src/funcs/topicsBookmarkTopic.ts + - src/funcs/topicsCreateTopicPostPM.ts + - src/funcs/topicsCreateTopicTimer.ts + - src/funcs/topicsGetTopic.ts + - src/funcs/topicsGetTopicByExternalId.ts + - src/funcs/topicsInviteToTopic.ts + - src/funcs/topicsListLatestTopics.ts + - src/funcs/topicsListTopTopics.ts + - src/funcs/topicsRemoveTopic.ts + - src/funcs/topicsSetNotificationLevel.ts + - src/funcs/topicsUpdateTopic.ts + - src/funcs/topicsUpdateTopicStatus.ts + - src/funcs/topicsUpdateTopicTimestamp.ts + - src/funcs/notificationsGetNotifications.ts + - src/funcs/notificationsMarkNotificationsAsRead.ts + - src/funcs/postsCreateTopicPostPM.ts + - src/funcs/postsDeletePost.ts + - src/funcs/postsGetPost.ts + - src/funcs/postsListPosts.ts + - src/funcs/postsLockPost.ts + - src/funcs/postsPerformPostAction.ts + - src/funcs/postsPostReplies.ts + - src/funcs/postsUpdatePost.ts + - src/funcs/privateMessagesCreateTopicPostPM.ts + - src/funcs/privateMessagesGetUserSentPrivateMessages.ts + - src/funcs/privateMessagesListUserPrivateMessages.ts + - src/funcs/searchSearch.ts + - src/funcs/siteGetSite.ts + - src/funcs/tagsCreateTagGroup.ts + - src/funcs/tagsGetTag.ts + - src/funcs/tagsGetTagGroup.ts + - src/funcs/tagsListTagGroups.ts + - src/funcs/tagsListTags.ts + - src/funcs/tagsUpdateTagGroup.ts + - src/funcs/uploadsAbortMultipart.ts + - src/funcs/uploadsBatchPresignMultipartParts.ts + - src/funcs/uploadsCompleteExternalUpload.ts + - src/funcs/uploadsCompleteMultipart.ts + - src/funcs/uploadsCreateMultipartUpload.ts + - src/funcs/uploadsCreateUpload.ts + - src/funcs/uploadsGeneratePresignedPut.ts - src/sdk/backups.ts - src/sdk/badges.ts - src/sdk/groups.ts @@ -34,23 +144,35 @@ generatedFiles: - src/sdk/tags.ts - src/sdk/uploads.ts - src/sdk/sdk.ts - - .eslintrc.yml - - jest.config.js - - package-lock.json + - .eslintrc.cjs + - .npmignore + - RUNTIMES.md + - jsr.json - package.json + - src/core.ts - src/index.ts - - src/internal/utils/contenttype.ts - - src/internal/utils/headers.ts - - src/internal/utils/index.ts - - src/internal/utils/pathparams.ts - - src/internal/utils/queryparams.ts - - src/internal/utils/requestbody.ts - - src/internal/utils/retries.ts - - src/internal/utils/security.ts - - src/internal/utils/utils.ts + - src/lib/base64.ts + - src/lib/config.ts + - src/lib/dlv.ts + - src/lib/encodings.ts + - src/lib/http.ts + - src/lib/is-plain-object.ts + - src/lib/matchers.ts + - src/lib/primitives.ts + - src/lib/retries.ts + - src/lib/schemas.ts + - src/lib/sdks.ts + - src/lib/security.ts + - src/lib/url.ts - src/sdk/index.ts + - src/sdk/models/errors/httpclienterrors.ts - src/sdk/models/errors/sdkerror.ts + - src/sdk/models/errors/sdkvalidationerror.ts + - src/sdk/types/blobs.ts + - src/sdk/types/enums.ts + - src/sdk/types/fp.ts - src/sdk/types/index.ts + - src/sdk/types/operations.ts - src/sdk/types/rfcdate.ts - tsconfig.json - src/sdk/models/operations/createbackup.ts @@ -142,81 +264,63 @@ generatedFiles: - src/sdk/models/operations/index.ts - docs/sdk/models/operations/createbackuprequestbody.md - docs/sdk/models/operations/createbackupresponsebody.md - - docs/sdk/models/operations/createbackupresponse.md - docs/sdk/models/operations/downloadbackuprequest.md - - docs/sdk/models/operations/downloadbackupresponse.md - docs/sdk/models/operations/responsebody.md - - docs/sdk/models/operations/getbackupsresponse.md - docs/sdk/models/operations/senddownloadbackupemailrequest.md - - docs/sdk/models/operations/senddownloadbackupemailresponse.md - docs/sdk/models/operations/triggers.md - docs/sdk/models/operations/adminbadges.md - docs/sdk/models/operations/badgegroupings.md - docs/sdk/models/operations/badgetypes.md - docs/sdk/models/operations/badges.md - docs/sdk/models/operations/adminlistbadgesresponsebody.md - - docs/sdk/models/operations/adminlistbadgesresponse.md - docs/sdk/models/operations/createbadgerequestbody.md - docs/sdk/models/operations/badge.md - docs/sdk/models/operations/createbadgebadgetypes.md - docs/sdk/models/operations/createbadgeresponsebody.md - - docs/sdk/models/operations/createbadgeresponse.md - docs/sdk/models/operations/deletebadgerequest.md - - docs/sdk/models/operations/deletebadgeresponse.md - docs/sdk/models/operations/listuserbadgesrequest.md - docs/sdk/models/operations/listuserbadgesbadgetypes.md - docs/sdk/models/operations/listuserbadgesbadges.md - docs/sdk/models/operations/grantedbies.md - docs/sdk/models/operations/userbadges.md - docs/sdk/models/operations/listuserbadgesresponsebody.md - - docs/sdk/models/operations/listuserbadgesresponse.md - docs/sdk/models/operations/updatebadgerequestbody.md - docs/sdk/models/operations/updatebadgerequest.md - docs/sdk/models/operations/updatebadgebadge.md - docs/sdk/models/operations/updatebadgebadgetypes.md - docs/sdk/models/operations/updatebadgeresponsebody.md - - docs/sdk/models/operations/updatebadgeresponse.md - docs/sdk/models/operations/addgroupmembersrequestbody.md - docs/sdk/models/operations/addgroupmembersrequest.md - docs/sdk/models/operations/addgroupmembersresponsebody.md - - docs/sdk/models/operations/addgroupmembersresponse.md - docs/sdk/models/operations/group.md - docs/sdk/models/operations/creategrouprequestbody.md - docs/sdk/models/operations/basicgroup.md - docs/sdk/models/operations/creategroupresponsebody.md - - docs/sdk/models/operations/creategroupresponse.md - docs/sdk/models/operations/deletegrouprequest.md - docs/sdk/models/operations/deletegroupresponsebody.md - - docs/sdk/models/operations/deletegroupresponse.md - docs/sdk/models/operations/getgrouprequest.md - docs/sdk/models/operations/extras.md - docs/sdk/models/operations/imapupdatedby.md - docs/sdk/models/operations/smtpupdatedby.md - docs/sdk/models/operations/getgroupgroup.md - docs/sdk/models/operations/getgroupresponsebody.md - - docs/sdk/models/operations/getgroupresponse.md - docs/sdk/models/operations/listgroupmembersrequest.md - docs/sdk/models/operations/members.md - docs/sdk/models/operations/meta.md - docs/sdk/models/operations/owners.md - docs/sdk/models/operations/listgroupmembersresponsebody.md - - docs/sdk/models/operations/listgroupmembersresponse.md - docs/sdk/models/operations/listgroupsextras.md - docs/sdk/models/operations/groups.md - docs/sdk/models/operations/listgroupsresponsebody.md - - docs/sdk/models/operations/listgroupsresponse.md - docs/sdk/models/operations/removegroupmembersrequestbody.md - docs/sdk/models/operations/removegroupmembersrequest.md - docs/sdk/models/operations/removegroupmembersresponsebody.md - - docs/sdk/models/operations/removegroupmembersresponse.md - docs/sdk/models/operations/updategroupgroup.md - docs/sdk/models/operations/updategrouprequestbody.md - docs/sdk/models/operations/updategrouprequest.md - docs/sdk/models/operations/updategroupresponsebody.md - - docs/sdk/models/operations/updategroupresponse.md - docs/sdk/models/operations/activateuserrequest.md - docs/sdk/models/operations/activateuserresponsebody.md - - docs/sdk/models/operations/activateuserresponse.md - docs/sdk/models/operations/admingetuserrequest.md - docs/sdk/models/operations/approvedby.md - docs/sdk/models/operations/admingetuserexternalids.md @@ -225,31 +329,24 @@ generatedFiles: - docs/sdk/models/operations/admingetuserpenaltycounts.md - docs/sdk/models/operations/tl3requirements.md - docs/sdk/models/operations/admingetuserresponsebody.md - - docs/sdk/models/operations/admingetuserresponse.md - docs/sdk/models/operations/queryparamasc.md - docs/sdk/models/operations/flag.md - docs/sdk/models/operations/queryparamorder.md - docs/sdk/models/operations/adminlistusersrequest.md - docs/sdk/models/operations/adminlistusersresponsebody.md - - docs/sdk/models/operations/adminlistusersresponse.md - docs/sdk/models/operations/anonymizeuserrequest.md - docs/sdk/models/operations/anonymizeuserresponsebody.md - - docs/sdk/models/operations/anonymizeuserresponse.md - docs/sdk/models/operations/changepasswordrequestbody.md - docs/sdk/models/operations/changepasswordrequest.md - - docs/sdk/models/operations/changepasswordresponse.md - docs/sdk/models/operations/externalids.md - docs/sdk/models/operations/createuserrequestbody.md - docs/sdk/models/operations/createuserrequest.md - docs/sdk/models/operations/createuserresponsebody.md - - docs/sdk/models/operations/createuserresponse.md - docs/sdk/models/operations/deactivateuserrequest.md - docs/sdk/models/operations/deactivateuserresponsebody.md - - docs/sdk/models/operations/deactivateuserresponse.md - docs/sdk/models/operations/deleteuserrequestbody.md - docs/sdk/models/operations/deleteuserrequest.md - docs/sdk/models/operations/deleteuserresponsebody.md - - docs/sdk/models/operations/deleteuserresponse.md - docs/sdk/models/operations/getuserrequest.md - docs/sdk/models/operations/getusercustomfields.md - docs/sdk/models/operations/groupusers.md @@ -260,10 +357,8 @@ generatedFiles: - docs/sdk/models/operations/useroption.md - docs/sdk/models/operations/user.md - docs/sdk/models/operations/getuserresponsebody.md - - docs/sdk/models/operations/getuserresponse.md - docs/sdk/models/operations/getuseremailsrequest.md - docs/sdk/models/operations/getuseremailsresponsebody.md - - docs/sdk/models/operations/getuseremailsresponse.md - docs/sdk/models/operations/getuserexternalidrequest.md - docs/sdk/models/operations/getuserexternalidcustomfields.md - docs/sdk/models/operations/getuserexternalidgroupusers.md @@ -274,7 +369,6 @@ generatedFiles: - docs/sdk/models/operations/getuserexternaliduseroption.md - docs/sdk/models/operations/getuserexternaliduser.md - docs/sdk/models/operations/getuserexternalidresponsebody.md - - docs/sdk/models/operations/getuserexternalidresponse.md - docs/sdk/models/operations/getuseridentiyproviderexternalidrequest.md - docs/sdk/models/operations/getuseridentiyproviderexternalidcustomfields.md - docs/sdk/models/operations/getuseridentiyproviderexternalidgroupusers.md @@ -285,11 +379,9 @@ generatedFiles: - docs/sdk/models/operations/getuseridentiyproviderexternaliduseroption.md - docs/sdk/models/operations/getuseridentiyproviderexternaliduser.md - docs/sdk/models/operations/getuseridentiyproviderexternalidresponsebody.md - - docs/sdk/models/operations/getuseridentiyproviderexternalidresponse.md - docs/sdk/models/operations/listuseractionsrequest.md - docs/sdk/models/operations/useractions.md - docs/sdk/models/operations/listuseractionsresponsebody.md - - docs/sdk/models/operations/listuseractionsresponse.md - docs/sdk/models/operations/asc.md - docs/sdk/models/operations/order.md - docs/sdk/models/operations/period.md @@ -298,59 +390,48 @@ generatedFiles: - docs/sdk/models/operations/directoryitems.md - docs/sdk/models/operations/listuserspublicmeta.md - docs/sdk/models/operations/listuserspublicresponsebody.md - - docs/sdk/models/operations/listuserspublicresponse.md - docs/sdk/models/operations/logoutuserrequest.md - docs/sdk/models/operations/logoutuserresponsebody.md - - docs/sdk/models/operations/logoutuserresponse.md - docs/sdk/models/operations/refreshgravatarrequest.md - docs/sdk/models/operations/refreshgravatarresponsebody.md - - docs/sdk/models/operations/refreshgravatarresponse.md - docs/sdk/models/operations/sendpasswordresetemailrequestbody.md - docs/sdk/models/operations/sendpasswordresetemailresponsebody.md - - docs/sdk/models/operations/sendpasswordresetemailresponse.md - docs/sdk/models/operations/silenceuserrequestbody.md - docs/sdk/models/operations/silenceuserrequest.md - docs/sdk/models/operations/silencedby.md - docs/sdk/models/operations/silence.md - docs/sdk/models/operations/silenceuserresponsebody.md - - docs/sdk/models/operations/silenceuserresponse.md - docs/sdk/models/operations/suspenduserrequestbody.md - docs/sdk/models/operations/suspenduserrequest.md - docs/sdk/models/operations/suspendedby.md - docs/sdk/models/operations/suspension.md - docs/sdk/models/operations/suspenduserresponsebody.md - - docs/sdk/models/operations/suspenduserresponse.md - docs/sdk/models/operations/updateavatartype.md - docs/sdk/models/operations/updateavatarrequestbody.md - docs/sdk/models/operations/updateavatarrequest.md - docs/sdk/models/operations/updateavatarresponsebody.md - - docs/sdk/models/operations/updateavatarresponse.md - docs/sdk/models/operations/updateemailrequestbody.md - docs/sdk/models/operations/updateemailrequest.md - - docs/sdk/models/operations/updateemailresponse.md - docs/sdk/models/operations/updateuserexternalids.md - docs/sdk/models/operations/updateuserrequestbody.md - docs/sdk/models/operations/updateuserrequest.md - docs/sdk/models/operations/updateuseruser.md - docs/sdk/models/operations/updateuserresponsebody.md - - docs/sdk/models/operations/updateuserresponse.md - docs/sdk/models/operations/updateusernamerequestbody.md - docs/sdk/models/operations/updateusernamerequest.md - - docs/sdk/models/operations/updateusernameresponse.md + - docs/sdk/models/operations/permissions.md - docs/sdk/models/operations/createcategoryrequestbody.md - docs/sdk/models/operations/customfields.md - docs/sdk/models/operations/grouppermissions.md - docs/sdk/models/operations/requiredtaggroups.md - docs/sdk/models/operations/category.md - docs/sdk/models/operations/createcategoryresponsebody.md - - docs/sdk/models/operations/createcategoryresponse.md - docs/sdk/models/operations/getcategoryrequest.md - docs/sdk/models/operations/getcategorycustomfields.md - docs/sdk/models/operations/getcategorygrouppermissions.md - docs/sdk/models/operations/getcategoryrequiredtaggroups.md - docs/sdk/models/operations/getcategorycategory.md - docs/sdk/models/operations/getcategoryresponsebody.md - - docs/sdk/models/operations/getcategoryresponse.md - docs/sdk/models/operations/archetypes.md - docs/sdk/models/operations/getsiterequiredtaggroups.md - docs/sdk/models/operations/getsitecategories.md @@ -370,19 +451,17 @@ generatedFiles: - docs/sdk/models/operations/userthemes.md - docs/sdk/models/operations/usertips.md - docs/sdk/models/operations/getsiteresponsebody.md - - docs/sdk/models/operations/getsiteresponse.md - docs/sdk/models/operations/listcategoriesrequest.md - docs/sdk/models/operations/categories.md - docs/sdk/models/operations/categorylist.md - docs/sdk/models/operations/listcategoriesresponsebody.md - - docs/sdk/models/operations/listcategoriesresponse.md - docs/sdk/models/operations/listcategorytopicsrequest.md - docs/sdk/models/operations/listcategorytopicsposters.md - docs/sdk/models/operations/topics.md - docs/sdk/models/operations/topiclist.md - docs/sdk/models/operations/users.md - docs/sdk/models/operations/listcategorytopicsresponsebody.md - - docs/sdk/models/operations/listcategorytopicsresponse.md + - docs/sdk/models/operations/updatecategorypermissions.md - docs/sdk/models/operations/updatecategoryrequestbody.md - docs/sdk/models/operations/updatecategoryrequest.md - docs/sdk/models/operations/updatecategorycustomfields.md @@ -390,26 +469,20 @@ generatedFiles: - docs/sdk/models/operations/updatecategoryrequiredtaggroups.md - docs/sdk/models/operations/updatecategorycategory.md - docs/sdk/models/operations/updatecategoryresponsebody.md - - docs/sdk/models/operations/updatecategoryresponse.md - docs/sdk/models/operations/createinviterequestbody.md - docs/sdk/models/operations/createinviterequest.md - docs/sdk/models/operations/createinviteresponsebody.md - - docs/sdk/models/operations/createinviteresponse.md - docs/sdk/models/operations/invitetotopicrequestbody.md - docs/sdk/models/operations/invitetotopicrequest.md - docs/sdk/models/operations/invitetotopicuser.md - docs/sdk/models/operations/invitetotopicresponsebody.md - - docs/sdk/models/operations/invitetotopicresponse.md - docs/sdk/models/operations/bookmarktopicrequest.md - - docs/sdk/models/operations/bookmarktopicresponse.md - docs/sdk/models/operations/createtopicpostpmrequestbody.md - docs/sdk/models/operations/createtopicpostpmactionssummary.md - docs/sdk/models/operations/createtopicpostpmresponsebody.md - - docs/sdk/models/operations/createtopicpostpmresponse.md - docs/sdk/models/operations/createtopictimerrequestbody.md - docs/sdk/models/operations/createtopictimerrequest.md - docs/sdk/models/operations/createtopictimerresponsebody.md - - docs/sdk/models/operations/createtopictimerresponse.md - docs/sdk/models/operations/gettopicrequest.md - docs/sdk/models/operations/gettopicactionssummary.md - docs/sdk/models/operations/createdby.md @@ -426,92 +499,75 @@ generatedFiles: - docs/sdk/models/operations/suggestedtopics.md - docs/sdk/models/operations/tagsdescriptions.md - docs/sdk/models/operations/gettopicresponsebody.md - - docs/sdk/models/operations/gettopicresponse.md - docs/sdk/models/operations/gettopicbyexternalidrequest.md - - docs/sdk/models/operations/gettopicbyexternalidresponse.md - docs/sdk/models/operations/listlatesttopicsrequest.md - docs/sdk/models/operations/listlatesttopicsposters.md - docs/sdk/models/operations/listlatesttopicstopics.md - docs/sdk/models/operations/listlatesttopicstopiclist.md - docs/sdk/models/operations/listlatesttopicsusers.md - docs/sdk/models/operations/listlatesttopicsresponsebody.md - - docs/sdk/models/operations/listlatesttopicsresponse.md - docs/sdk/models/operations/listtoptopicsrequest.md - docs/sdk/models/operations/listtoptopicsposters.md - docs/sdk/models/operations/listtoptopicstopics.md - docs/sdk/models/operations/listtoptopicstopiclist.md - docs/sdk/models/operations/listtoptopicsusers.md - docs/sdk/models/operations/listtoptopicsresponsebody.md - - docs/sdk/models/operations/listtoptopicsresponse.md - docs/sdk/models/operations/removetopicrequest.md - - docs/sdk/models/operations/removetopicresponse.md - docs/sdk/models/operations/notificationlevel.md - docs/sdk/models/operations/setnotificationlevelrequestbody.md - docs/sdk/models/operations/setnotificationlevelrequest.md - docs/sdk/models/operations/setnotificationlevelresponsebody.md - - docs/sdk/models/operations/setnotificationlevelresponse.md - docs/sdk/models/operations/topic.md - docs/sdk/models/operations/updatetopicrequestbody.md - docs/sdk/models/operations/updatetopicrequest.md - docs/sdk/models/operations/basictopic.md - docs/sdk/models/operations/updatetopicresponsebody.md - - docs/sdk/models/operations/updatetopicresponse.md - docs/sdk/models/operations/enabled.md - docs/sdk/models/operations/status.md - docs/sdk/models/operations/updatetopicstatusrequestbody.md - docs/sdk/models/operations/updatetopicstatusrequest.md - docs/sdk/models/operations/updatetopicstatusresponsebody.md - - docs/sdk/models/operations/updatetopicstatusresponse.md - docs/sdk/models/operations/updatetopictimestamprequestbody.md - docs/sdk/models/operations/updatetopictimestamprequest.md - docs/sdk/models/operations/updatetopictimestampresponsebody.md - - docs/sdk/models/operations/updatetopictimestampresponse.md - docs/sdk/models/operations/data.md - docs/sdk/models/operations/notifications.md - docs/sdk/models/operations/getnotificationsresponsebody.md - - docs/sdk/models/operations/getnotificationsresponse.md - docs/sdk/models/operations/marknotificationsasreadrequestbody.md - docs/sdk/models/operations/marknotificationsasreadresponsebody.md - - docs/sdk/models/operations/marknotificationsasreadresponse.md - docs/sdk/models/operations/deletepostrequestbody.md - docs/sdk/models/operations/deletepostrequest.md - - docs/sdk/models/operations/deletepostresponse.md - docs/sdk/models/operations/getpostrequest.md - - docs/sdk/models/operations/getpostresponse.md + - docs/sdk/models/operations/actionssummary.md + - docs/sdk/models/operations/getpostresponsebody.md - docs/sdk/models/operations/listpostsrequest.md - docs/sdk/models/operations/listpostsactionssummary.md - docs/sdk/models/operations/latestposts.md - docs/sdk/models/operations/listpostsresponsebody.md - - docs/sdk/models/operations/listpostsresponse.md - docs/sdk/models/operations/lockpostrequestbody.md - docs/sdk/models/operations/lockpostrequest.md - docs/sdk/models/operations/lockpostresponsebody.md - - docs/sdk/models/operations/lockpostresponse.md - docs/sdk/models/operations/performpostactionrequestbody.md - docs/sdk/models/operations/performpostactionrequest.md - - docs/sdk/models/operations/actionssummary.md + - docs/sdk/models/operations/performpostactionactionssummary.md - docs/sdk/models/operations/notice.md - docs/sdk/models/operations/performpostactionresponsebody.md - - docs/sdk/models/operations/performpostactionresponse.md - docs/sdk/models/operations/postrepliesrequest.md - docs/sdk/models/operations/postrepliesactionssummary.md - docs/sdk/models/operations/replytouser.md - docs/sdk/models/operations/postrepliesresponsebody.md - - docs/sdk/models/operations/postrepliesresponse.md - docs/sdk/models/operations/post.md - docs/sdk/models/operations/updatepostrequestbody.md - docs/sdk/models/operations/updatepostrequest.md - docs/sdk/models/operations/updatepostactionssummary.md - docs/sdk/models/operations/updatepostpost.md - docs/sdk/models/operations/updatepostresponsebody.md - - docs/sdk/models/operations/updatepostresponse.md - docs/sdk/models/operations/getusersentprivatemessagesrequest.md - docs/sdk/models/operations/getusersentprivatemessagesposters.md - docs/sdk/models/operations/getusersentprivatemessagestopics.md - docs/sdk/models/operations/getusersentprivatemessagestopiclist.md - docs/sdk/models/operations/getusersentprivatemessagesusers.md - docs/sdk/models/operations/getusersentprivatemessagesresponsebody.md - - docs/sdk/models/operations/getusersentprivatemessagesresponse.md - docs/sdk/models/operations/listuserprivatemessagesrequest.md - docs/sdk/models/operations/listuserprivatemessagesparticipants.md - docs/sdk/models/operations/listuserprivatemessagesposters.md @@ -519,16 +575,13 @@ generatedFiles: - docs/sdk/models/operations/listuserprivatemessagestopiclist.md - docs/sdk/models/operations/listuserprivatemessagesusers.md - docs/sdk/models/operations/listuserprivatemessagesresponsebody.md - - docs/sdk/models/operations/listuserprivatemessagesresponse.md - docs/sdk/models/operations/searchrequest.md - docs/sdk/models/operations/groupedsearchresult.md - docs/sdk/models/operations/searchresponsebody.md - - docs/sdk/models/operations/searchresponse.md - docs/sdk/models/operations/createtaggrouprequestbody.md - - docs/sdk/models/operations/permissions.md + - docs/sdk/models/operations/createtaggrouppermissions.md - docs/sdk/models/operations/taggroup.md - docs/sdk/models/operations/createtaggroupresponsebody.md - - docs/sdk/models/operations/createtaggroupresponse.md - docs/sdk/models/operations/gettagrequest.md - docs/sdk/models/operations/gettagtags.md - docs/sdk/models/operations/gettagposters.md @@ -536,56 +589,45 @@ generatedFiles: - docs/sdk/models/operations/gettagtopiclist.md - docs/sdk/models/operations/gettagusers.md - docs/sdk/models/operations/gettagresponsebody.md - - docs/sdk/models/operations/gettagresponse.md - docs/sdk/models/operations/gettaggrouprequest.md - docs/sdk/models/operations/gettaggrouppermissions.md - docs/sdk/models/operations/gettaggrouptaggroup.md - docs/sdk/models/operations/gettaggroupresponsebody.md - - docs/sdk/models/operations/gettaggroupresponse.md - docs/sdk/models/operations/listtaggroupspermissions.md - docs/sdk/models/operations/taggroups.md - docs/sdk/models/operations/listtaggroupsresponsebody.md - - docs/sdk/models/operations/listtaggroupsresponse.md - docs/sdk/models/operations/listtagsextras.md - docs/sdk/models/operations/tags.md - docs/sdk/models/operations/listtagsresponsebody.md - - docs/sdk/models/operations/listtagsresponse.md - docs/sdk/models/operations/updatetaggrouprequestbody.md - docs/sdk/models/operations/updatetaggrouprequest.md - docs/sdk/models/operations/updatetaggrouppermissions.md - docs/sdk/models/operations/updatetaggrouptaggroup.md - docs/sdk/models/operations/updatetaggroupresponsebody.md - - docs/sdk/models/operations/updatetaggroupresponse.md - docs/sdk/models/operations/abortmultipartrequestbody.md - docs/sdk/models/operations/abortmultipartresponsebody.md - - docs/sdk/models/operations/abortmultipartresponse.md - docs/sdk/models/operations/batchpresignmultipartpartsrequestbody.md - docs/sdk/models/operations/presignedurls.md - docs/sdk/models/operations/batchpresignmultipartpartsresponsebody.md - - docs/sdk/models/operations/batchpresignmultipartpartsresponse.md - docs/sdk/models/operations/completeexternaluploadrequestbody.md - docs/sdk/models/operations/completeexternaluploadresponsebody.md - - docs/sdk/models/operations/completeexternaluploadresponse.md - docs/sdk/models/operations/completemultipartrequestbody.md - docs/sdk/models/operations/completemultipartresponsebody.md - - docs/sdk/models/operations/completemultipartresponse.md - docs/sdk/models/operations/metadata.md - docs/sdk/models/operations/uploadtype.md - docs/sdk/models/operations/createmultipartuploadrequestbody.md - docs/sdk/models/operations/createmultipartuploadresponsebody.md - - docs/sdk/models/operations/createmultipartuploadresponse.md - - docs/sdk/models/operations/file.md - - docs/sdk/models/operations/typet.md + - docs/sdk/models/operations/filet.md + - docs/sdk/models/operations/type.md - docs/sdk/models/operations/createuploadrequestbody.md - docs/sdk/models/operations/createuploadresponsebody.md - - docs/sdk/models/operations/createuploadresponse.md - docs/sdk/models/operations/generatepresignedputmetadata.md - docs/sdk/models/operations/generatepresignedputtype.md - docs/sdk/models/operations/generatepresignedputrequestbody.md - docs/sdk/models/operations/signedheaders.md - docs/sdk/models/operations/generatepresignedputresponsebody.md - - docs/sdk/models/operations/generatepresignedputresponse.md - docs/sdks/sdk/README.md + - docs/lib/utils/retryconfig.md - docs/sdks/backups/README.md - docs/sdks/badges/README.md - docs/sdks/groups/README.md @@ -603,3 +645,7 @@ generatedFiles: - docs/sdks/uploads/README.md - USAGE.md - .gitattributes + - src/hooks/hooks.ts + - src/hooks/types.ts + - src/hooks/index.ts + - CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..d585717 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,26 @@ +# Contributing to This Repository + +Thank you for your interest in contributing to this repository. Please note that this repository contains generated code. As such, we do not accept direct changes or pull requests. Instead, we encourage you to follow the guidelines below to report issues and suggest improvements. + +## How to Report Issues + +If you encounter any bugs or have suggestions for improvements, please open an issue on GitHub. When reporting an issue, please provide as much detail as possible to help us reproduce the problem. This includes: + +- A clear and descriptive title +- Steps to reproduce the issue +- Expected and actual behavior +- Any relevant logs, screenshots, or error messages +- Information about your environment (e.g., operating system, software versions) + - For example can be collected using the `npx envinfo` command from your terminal if you have Node.js installed + +## Issue Triage and Upstream Fixes + +We will review and triage issues as quickly as possible. Our goal is to address bugs and incorporate improvements in the upstream source code. Fixes will be included in the next generation of the generated code. + +## Contact + +If you have any questions or need further assistance, please feel free to reach out by opening an issue. + +Thank you for your understanding and cooperation! + +The Maintainers diff --git a/README.md b/README.md index a313002..4cff033 100644 --- a/README.md +++ b/README.md @@ -16,10 +16,25 @@ npm add @lukehagar/discoursejs ``` +### PNPM + +```bash +pnpm add @lukehagar/discoursejs +``` + +### Bun + +```bash +bun add @lukehagar/discoursejs +``` + ### Yarn ```bash -yarn add @lukehagar/discoursejs +yarn add @lukehagar/discoursejs zod + +# Note that Yarn does not install peer dependencies automatically. You will need +# to install zod as shown above. ``` @@ -31,16 +46,13 @@ yarn add @lukehagar/discoursejs ```typescript import { SDK } from "@lukehagar/discoursejs"; +const sdk = new SDK(); + async function run() { - const sdk = new SDK(); + const result = await sdk.backups.createBackup(); - const res = await sdk.backups.createBackup({ - withUploads: false, - }); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result); } run(); @@ -200,35 +212,42 @@ run(); ## Error Handling -Handling errors in this SDK should largely match your expectations. All operations return a response object or throw an error. If Error objects are specified in your OpenAPI Spec, the SDK will throw the appropriate Error type. +All SDK methods return a response object or throw an error. If Error objects are specified in your OpenAPI Spec, the SDK will throw the appropriate Error type. | Error Object | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4xx-5xx | */* | -Example +Validation errors can also occur when either method arguments or data returned from the server do not match the expected format. The `SDKValidationError` that is thrown as a result will capture the raw value that failed validation in an attribute called `rawValue`. Additionally, a `pretty()` method is available on this error that can be used to log a nicely formatted string since validation errors can list many issues and the plain error string may be difficult read when debugging. + ```typescript import { SDK } from "@lukehagar/discoursejs"; +import { SDKValidationError } from "@lukehagar/discoursejs/sdk/models/errors"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); - - let res; + let result; try { - res = await sdk.backups.createBackup({ - withUploads: false, - }); + result = await sdk.backups.createBackup(); } catch (err) { - if (err instanceof errors.SDKError) { - console.error(err); // handle exception - throw err; + switch (true) { + case err instanceof SDKValidationError: { + // Validation errors can be pretty-printed + console.error(err.pretty()); + // Raw value may also be inspected + console.error(err.rawValue); + return; + } + default: { + throw err; + } } } - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result); } run(); @@ -241,29 +260,24 @@ run(); ### Select Server by Index -You can override the default server globally by passing a server index to the `serverIdx: number` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers: +You can override the default server globally by passing a server index to the `serverIdx` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers: | # | Server | Variables | | - | ------ | --------- | | 0 | `https://{defaultHost}` | `defaultHost` (default is `discourse.example.com`) | -#### Example - ```typescript import { SDK } from "@lukehagar/discoursejs"; +const sdk = new SDK({ + serverIdx: 0, +}); + async function run() { - const sdk = new SDK({ - serverIdx: 0, - }); + const result = await sdk.backups.createBackup(); - const res = await sdk.backups.createBackup({ - withUploads: false, - }); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result); } run(); @@ -277,22 +291,20 @@ Some of the server options above contain variables. If you want to set the value ### Override Server URL Per-Client -The default server can also be overridden globally by passing a URL to the `serverURL: str` optional parameter when initializing the SDK client instance. For example: +The default server can also be overridden globally by passing a URL to the `serverURL` optional parameter when initializing the SDK client instance. For example: + ```typescript import { SDK } from "@lukehagar/discoursejs"; +const sdk = new SDK({ + serverURL: "https://{defaultHost}", +}); + async function run() { - const sdk = new SDK({ - serverURL: "https://{defaultHost}", - }); + const result = await sdk.backups.createBackup(); - const res = await sdk.backups.createBackup({ - withUploads: false, - }); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result); } run(); @@ -303,22 +315,151 @@ run(); ## Custom HTTP Client -The Typescript SDK makes API calls using the [axios](https://axios-http.com/docs/intro) HTTP library. In order to provide a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration, you can initialize the SDK client with a custom `AxiosInstance` object. +The TypeScript SDK makes API calls using an `HTTPClient` that wraps the native +[Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API). This +client is a thin wrapper around `fetch` and provides the ability to attach hooks +around the request lifecycle that can be used to modify the request or handle +errors and response. -For example, you could specify a header for every request that your sdk makes as follows: +The `HTTPClient` constructor takes an optional `fetcher` argument that can be +used to integrate a third-party HTTP client or when writing tests to mock out +the HTTP client and feed in fixtures. + +The following example shows how to use the `"beforeRequest"` hook to to add a +custom header and a timeout to requests and how to use the `"requestError"` hook +to log errors: ```typescript -import { @lukehagar/discoursejs } from "SDK"; -import axios from "axios"; +import { SDK } from "@lukehagar/discoursejs"; +import { HTTPClient } from "@lukehagar/discoursejs/lib/http"; -const httpClient = axios.create({ - headers: {'x-custom-header': 'someValue'} -}) +const httpClient = new HTTPClient({ + // fetcher takes a function that has the same signature as native `fetch`. + fetcher: (request) => { + return fetch(request); + } +}); -const sdk = new SDK({defaultClient: httpClient}); +httpClient.addHook("beforeRequest", (request) => { + const nextRequest = new Request(request, { + signal: request.signal || AbortSignal.timeout(5000) + }); + + nextRequest.headers.set("x-custom-header", "custom value"); + + return nextRequest; +}); + +httpClient.addHook("requestError", (error, request) => { + console.group("Request Error"); + console.log("Reason:", `${error}`); + console.log("Endpoint:", `${request.method} ${request.url}`); + console.groupEnd(); +}); + +const sdk = new SDK({ httpClient }); ``` + +## Requirements + +For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md). + + + +## File uploads + +Certain SDK methods accept files as part of a multi-part request. It is possible and typically recommended to upload files as a stream rather than reading the entire contents into memory. This avoids excessive memory consumption and potentially crashing with out-of-memory errors when working with very large files. The following example demonstrates how to attach a file stream to a request. + +> [!TIP] +> +> Depending on your JavaScript runtime, there are convenient utilities that return a handle to a file without reading the entire contents into memory: +> +> - **Node.js v20+:** Since v20, Node.js comes with a native `openAsBlob` function in [`node:fs`](https://nodejs.org/docs/latest-v20.x/api/fs.html#fsopenasblobpath-options). +> - **Bun:** The native [`Bun.file`](https://bun.sh/docs/api/file-io#reading-files-bun-file) function produces a file handle that can be used for streaming file uploads. +> - **Browsers:** All supported browsers return an instance to a [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File) when reading the value from an `` element. +> - **Node.js v18:** A file stream can be created using the `fileFrom` helper from [`fetch-blob/from.js`](https://www.npmjs.com/package/fetch-blob). + +```typescript +import { SDK } from "@lukehagar/discoursejs"; + +const sdk = new SDK(); + +async function run() { + const result = await sdk.uploads.createUpload(); + + // Handle the result + console.log(result); +} + +run(); + +``` + + + +## Retries + +Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK. + +To change the default retry strategy for a single API call, simply provide a retryConfig object to the call: +```typescript +import { SDK } from "@lukehagar/discoursejs"; + +const sdk = new SDK(); + +async function run() { + const result = await sdk.backups.createBackup({ + retries: { + strategy: "backoff", + backoff: { + initialInterval: 1, + maxInterval: 50, + exponent: 1.1, + maxElapsedTime: 100, + }, + retryConnectionErrors: false, + }, + }); + + // Handle the result + console.log(result); +} + +run(); + +``` + +If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization: +```typescript +import { SDK } from "@lukehagar/discoursejs"; + +const sdk = new SDK({ + retryConfig: { + strategy: "backoff", + backoff: { + initialInterval: 1, + maxInterval: 50, + exponent: 1.1, + maxElapsedTime: 100, + }, + retryConnectionErrors: false, + }, +}); + +async function run() { + const result = await sdk.backups.createBackup(); + + // Handle the result + console.log(result); +} + +run(); + +``` + + # Development diff --git a/RELEASES.md b/RELEASES.md index f8972c7..69cf3bb 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -168,4 +168,14 @@ Based on: ### Generated - [typescript v0.4.10] . ### Releases -- [NPM v0.4.10] https://www.npmjs.com/package/@lukehagar/discoursejs/v/0.4.10 - . \ No newline at end of file +- [NPM v0.4.10] https://www.npmjs.com/package/@lukehagar/discoursejs/v/0.4.10 - . + +## 2024-08-09 00:22:32 +### Changes +Based on: +- OpenAPI Doc latest +- Speakeasy CLI 1.358.0 (2.390.6) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.5.0] . +### Releases +- [NPM v0.5.0] https://www.npmjs.com/package/@lukehagar/discoursejs/v/0.5.0 - . \ No newline at end of file diff --git a/RUNTIMES.md b/RUNTIMES.md new file mode 100644 index 0000000..d08a0c0 --- /dev/null +++ b/RUNTIMES.md @@ -0,0 +1,22 @@ +# Supported JavaScript runtimes + +This SDK is intended to be used in JavaScript runtimes that support the following features: + +* [Web Fetch API][web-fetch] +* [Web Streams API][web-streams] and in particular `ReadableStream` +* [Async iterables][async-iter] using `Symbol.asyncIterator` + +[web-fetch]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API +[web-streams]: https://developer.mozilla.org/en-US/docs/Web/API/Streams_API +[async-iter]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_async_iterator_and_async_iterable_protocols + +Runtime environments that are explicitly supported are: + +- Evergreen browsers which include: Chrome, Safari, Edge, Firefox +- Node.js active and maintenance LTS releases + - Currently, this is v18 and v20 +- Bun v1 and above +- Deno v1.39 + - Note that Deno does not currently have native support for streaming file uploads backed by the filesystem ([issue link][deno-file-streaming]) + +[deno-file-streaming]: https://github.com/denoland/deno/issues/11018 diff --git a/USAGE.md b/USAGE.md index acb239a..5e7d16e 100644 --- a/USAGE.md +++ b/USAGE.md @@ -2,16 +2,13 @@ ```typescript import { SDK } from "@lukehagar/discoursejs"; +const sdk = new SDK(); + async function run() { - const sdk = new SDK(); + const result = await sdk.backups.createBackup(); - const res = await sdk.backups.createBackup({ - withUploads: false, - }); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result); } run(); diff --git a/docs/lib/utils/retryconfig.md b/docs/lib/utils/retryconfig.md new file mode 100644 index 0000000..08f95f4 --- /dev/null +++ b/docs/lib/utils/retryconfig.md @@ -0,0 +1,24 @@ +# RetryConfig + +Allows customizing the default retry configuration. It is only permitted in methods that accept retry policies. + +## Fields + +| Name | Type | Description | Example | +| ------------------------- | ----------------------------------- | ------------------------------------------------------------------------------------------ | ----------- | +| `strategy` | `"backoff" | "none"` | The retry strategy to use. | `"backoff"` | +| `backoff` | [BackoffStrategy](#backoffstrategy) | When strategy is "backoff", this configurates for the backoff parameters. | | +| `retryConnectionErrors` | `*boolean*` | When strategy is "backoff", this determines whether or not to retry on connection errors. | `true` | + +## BackoffStrategy + +The backoff strategy allows retrying a request with an exponential backoff between each retry. + +### Fields + +| Name | Type | Description | Example | +| ------------------ | ------------ | ----------------------------------------- | -------- | +| `initialInterval` | `*number*` | The initial interval in milliseconds. | `500` | +| `maxInterval` | `*number*` | The maximum interval in milliseconds. | `60000` | +| `exponent` | `*number*` | The exponent to use for the backoff. | `1.5` | +| `maxElapsedTime` | `*number*` | The maximum elapsed time in milliseconds. | `300000` | \ No newline at end of file diff --git a/docs/sdk/models/operations/abortmultipartresponse.md b/docs/sdk/models/operations/abortmultipartresponse.md deleted file mode 100644 index 07ed722..0000000 --- a/docs/sdk/models/operations/abortmultipartresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# AbortMultipartResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.AbortMultipartResponseBody](../../../sdk/models/operations/abortmultipartresponsebody.md) | :heavy_minus_sign: | external upload initialized | \ No newline at end of file diff --git a/docs/sdk/models/operations/actionssummary.md b/docs/sdk/models/operations/actionssummary.md index 4f643dc..156d29b 100644 --- a/docs/sdk/models/operations/actionssummary.md +++ b/docs/sdk/models/operations/actionssummary.md @@ -3,9 +3,10 @@ ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `acted` | *boolean* | :heavy_minus_sign: | N/A | -| `canUndo` | *boolean* | :heavy_minus_sign: | N/A | -| `count` | *number* | :heavy_minus_sign: | N/A | -| `id` | *number* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| `acted` | *boolean* | :heavy_minus_sign: | N/A | +| `canAct` | *boolean* | :heavy_minus_sign: | N/A | +| `canUndo` | *boolean* | :heavy_minus_sign: | N/A | +| `count` | *number* | :heavy_minus_sign: | N/A | +| `id` | *number* | :heavy_check_mark: | `2`: like, `3`, `4`, `6`, `7`, `8`: flag | \ No newline at end of file diff --git a/docs/sdk/models/operations/activateuserresponse.md b/docs/sdk/models/operations/activateuserresponse.md deleted file mode 100644 index 1d06e5c..0000000 --- a/docs/sdk/models/operations/activateuserresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ActivateUserResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.ActivateUserResponseBody](../../../sdk/models/operations/activateuserresponsebody.md) | :heavy_minus_sign: | response | \ No newline at end of file diff --git a/docs/sdk/models/operations/addgroupmembersrequest.md b/docs/sdk/models/operations/addgroupmembersrequest.md index 54e8ec2..716992a 100644 --- a/docs/sdk/models/operations/addgroupmembersrequest.md +++ b/docs/sdk/models/operations/addgroupmembersrequest.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -| `id` | *number* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.AddGroupMembersRequestBody](../../../sdk/models/operations/addgroupmembersrequestbody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `requestBody` | [operations.AddGroupMembersRequestBody](../../../sdk/models/operations/addgroupmembersrequestbody.md) | :heavy_minus_sign: | N/A | +| `id` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/addgroupmembersresponse.md b/docs/sdk/models/operations/addgroupmembersresponse.md deleted file mode 100644 index f2deae5..0000000 --- a/docs/sdk/models/operations/addgroupmembersresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# AddGroupMembersResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.AddGroupMembersResponseBody](../../../sdk/models/operations/addgroupmembersresponsebody.md) | :heavy_minus_sign: | success response | \ No newline at end of file diff --git a/docs/sdk/models/operations/admingetuserresponse.md b/docs/sdk/models/operations/admingetuserresponse.md deleted file mode 100644 index 37b8ba8..0000000 --- a/docs/sdk/models/operations/admingetuserresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdminGetUserResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.AdminGetUserResponseBody](../../../sdk/models/operations/admingetuserresponsebody.md) | :heavy_minus_sign: | response | \ No newline at end of file diff --git a/docs/sdk/models/operations/adminlistbadgesresponse.md b/docs/sdk/models/operations/adminlistbadgesresponse.md deleted file mode 100644 index a127881..0000000 --- a/docs/sdk/models/operations/adminlistbadgesresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdminListBadgesResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.AdminListBadgesResponseBody](../../../sdk/models/operations/adminlistbadgesresponsebody.md) | :heavy_minus_sign: | success response | \ No newline at end of file diff --git a/docs/sdk/models/operations/adminlistusersresponse.md b/docs/sdk/models/operations/adminlistusersresponse.md deleted file mode 100644 index 021275b..0000000 --- a/docs/sdk/models/operations/adminlistusersresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# AdminListUsersResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `responseBodies` | [operations.AdminListUsersResponseBody](../../../sdk/models/operations/adminlistusersresponsebody.md)[] | :heavy_minus_sign: | response | \ No newline at end of file diff --git a/docs/sdk/models/operations/anonymizeuserresponse.md b/docs/sdk/models/operations/anonymizeuserresponse.md deleted file mode 100644 index 8230e22..0000000 --- a/docs/sdk/models/operations/anonymizeuserresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# AnonymizeUserResponse - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.AnonymizeUserResponseBody](../../../sdk/models/operations/anonymizeuserresponsebody.md) | :heavy_minus_sign: | response | \ No newline at end of file diff --git a/docs/sdk/models/operations/batchpresignmultipartpartsresponse.md b/docs/sdk/models/operations/batchpresignmultipartpartsresponse.md deleted file mode 100644 index a9ca20e..0000000 --- a/docs/sdk/models/operations/batchpresignmultipartpartsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# BatchPresignMultipartPartsResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.BatchPresignMultipartPartsResponseBody](../../../sdk/models/operations/batchpresignmultipartpartsresponsebody.md) | :heavy_minus_sign: | external upload initialized | \ No newline at end of file diff --git a/docs/sdk/models/operations/bookmarktopicresponse.md b/docs/sdk/models/operations/bookmarktopicresponse.md deleted file mode 100644 index 1ce4a92..0000000 --- a/docs/sdk/models/operations/bookmarktopicresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# BookmarkTopicResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/sdk/models/operations/changepasswordrequest.md b/docs/sdk/models/operations/changepasswordrequest.md index 79749b0..b12d333 100644 --- a/docs/sdk/models/operations/changepasswordrequest.md +++ b/docs/sdk/models/operations/changepasswordrequest.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -| `token` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.ChangePasswordRequestBody](../../../sdk/models/operations/changepasswordrequestbody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `requestBody` | [operations.ChangePasswordRequestBody](../../../sdk/models/operations/changepasswordrequestbody.md) | :heavy_minus_sign: | N/A | +| `token` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/changepasswordresponse.md b/docs/sdk/models/operations/changepasswordresponse.md deleted file mode 100644 index 6056773..0000000 --- a/docs/sdk/models/operations/changepasswordresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# ChangePasswordResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/sdk/models/operations/completeexternaluploadresponse.md b/docs/sdk/models/operations/completeexternaluploadresponse.md deleted file mode 100644 index d73ec93..0000000 --- a/docs/sdk/models/operations/completeexternaluploadresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# CompleteExternalUploadResponse - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.CompleteExternalUploadResponseBody](../../../sdk/models/operations/completeexternaluploadresponsebody.md) | :heavy_minus_sign: | external upload initialized | \ No newline at end of file diff --git a/docs/sdk/models/operations/completemultipartresponse.md b/docs/sdk/models/operations/completemultipartresponse.md deleted file mode 100644 index 13be7e2..0000000 --- a/docs/sdk/models/operations/completemultipartresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# CompleteMultipartResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.CompleteMultipartResponseBody](../../../sdk/models/operations/completemultipartresponsebody.md) | :heavy_minus_sign: | external upload initialized | \ No newline at end of file diff --git a/docs/sdk/models/operations/createbackupresponse.md b/docs/sdk/models/operations/createbackupresponse.md deleted file mode 100644 index f422d86..0000000 --- a/docs/sdk/models/operations/createbackupresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreateBackupResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.CreateBackupResponseBody](../../../sdk/models/operations/createbackupresponsebody.md) | :heavy_minus_sign: | success response | \ No newline at end of file diff --git a/docs/sdk/models/operations/createbadgeresponse.md b/docs/sdk/models/operations/createbadgeresponse.md deleted file mode 100644 index 50eca0f..0000000 --- a/docs/sdk/models/operations/createbadgeresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreateBadgeResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.CreateBadgeResponseBody](../../../sdk/models/operations/createbadgeresponsebody.md) | :heavy_minus_sign: | success response | \ No newline at end of file diff --git a/docs/sdk/models/operations/createcategoryrequestbody.md b/docs/sdk/models/operations/createcategoryrequestbody.md index da7aceb..b4d4917 100644 --- a/docs/sdk/models/operations/createcategoryrequestbody.md +++ b/docs/sdk/models/operations/createcategoryrequestbody.md @@ -3,15 +3,15 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------- | --------------------------- | --------------------------- | --------------------------- | --------------------------- | -| `allowBadges` | *boolean* | :heavy_minus_sign: | N/A | | -| `color` | *string* | :heavy_minus_sign: | N/A | 49d9e9 | -| `formTemplateIds` | *any*[] | :heavy_minus_sign: | N/A | | -| `name` | *string* | :heavy_check_mark: | N/A | | -| `parentCategoryId` | *number* | :heavy_minus_sign: | N/A | | -| `permissions` | Record | :heavy_minus_sign: | N/A | | -| `searchPriority` | *number* | :heavy_minus_sign: | N/A | | -| `slug` | *string* | :heavy_minus_sign: | N/A | | -| `textColor` | *string* | :heavy_minus_sign: | N/A | f0fcfd | -| `topicFeaturedLinksAllowed` | *boolean* | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `allowBadges` | *boolean* | :heavy_minus_sign: | N/A | | +| `color` | *string* | :heavy_minus_sign: | N/A | 49d9e9 | +| `formTemplateIds` | *any*[] | :heavy_minus_sign: | N/A | | +| `name` | *string* | :heavy_check_mark: | N/A | | +| `parentCategoryId` | *number* | :heavy_minus_sign: | N/A | | +| `permissions` | [operations.Permissions](../../../sdk/models/operations/permissions.md) | :heavy_minus_sign: | N/A | | +| `searchPriority` | *number* | :heavy_minus_sign: | N/A | | +| `slug` | *string* | :heavy_minus_sign: | N/A | | +| `textColor` | *string* | :heavy_minus_sign: | N/A | f0fcfd | +| `topicFeaturedLinksAllowed` | *boolean* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/sdk/models/operations/createcategoryresponse.md b/docs/sdk/models/operations/createcategoryresponse.md deleted file mode 100644 index dc71f27..0000000 --- a/docs/sdk/models/operations/createcategoryresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreateCategoryResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.CreateCategoryResponseBody](../../../sdk/models/operations/createcategoryresponsebody.md) | :heavy_minus_sign: | success response | \ No newline at end of file diff --git a/docs/sdk/models/operations/creategroupresponse.md b/docs/sdk/models/operations/creategroupresponse.md deleted file mode 100644 index cbedf5d..0000000 --- a/docs/sdk/models/operations/creategroupresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreateGroupResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.CreateGroupResponseBody](../../../sdk/models/operations/creategroupresponsebody.md) | :heavy_minus_sign: | group created | \ No newline at end of file diff --git a/docs/sdk/models/operations/createinviteresponse.md b/docs/sdk/models/operations/createinviteresponse.md deleted file mode 100644 index 17c1b7a..0000000 --- a/docs/sdk/models/operations/createinviteresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreateInviteResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.CreateInviteResponseBody](../../../sdk/models/operations/createinviteresponsebody.md) | :heavy_minus_sign: | success response | \ No newline at end of file diff --git a/docs/sdk/models/operations/createmultipartuploadresponse.md b/docs/sdk/models/operations/createmultipartuploadresponse.md deleted file mode 100644 index 227f405..0000000 --- a/docs/sdk/models/operations/createmultipartuploadresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreateMultipartUploadResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.CreateMultipartUploadResponseBody](../../../sdk/models/operations/createmultipartuploadresponsebody.md) | :heavy_minus_sign: | external upload initialized | \ No newline at end of file diff --git a/docs/sdk/models/operations/createtaggrouppermissions.md b/docs/sdk/models/operations/createtaggrouppermissions.md new file mode 100644 index 0000000..712e530 --- /dev/null +++ b/docs/sdk/models/operations/createtaggrouppermissions.md @@ -0,0 +1,7 @@ +# CreateTagGroupPermissions + + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/sdk/models/operations/createtaggroupresponse.md b/docs/sdk/models/operations/createtaggroupresponse.md deleted file mode 100644 index 52f2968..0000000 --- a/docs/sdk/models/operations/createtaggroupresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreateTagGroupResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.CreateTagGroupResponseBody](../../../sdk/models/operations/createtaggroupresponsebody.md) | :heavy_minus_sign: | tag group created | \ No newline at end of file diff --git a/docs/sdk/models/operations/createtopicpostpmresponse.md b/docs/sdk/models/operations/createtopicpostpmresponse.md deleted file mode 100644 index c6e5818..0000000 --- a/docs/sdk/models/operations/createtopicpostpmresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreateTopicPostPMResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.CreateTopicPostPMResponseBody](../../../sdk/models/operations/createtopicpostpmresponsebody.md) | :heavy_minus_sign: | post created | \ No newline at end of file diff --git a/docs/sdk/models/operations/createtopictimerrequest.md b/docs/sdk/models/operations/createtopictimerrequest.md index 6863876..d08d010 100644 --- a/docs/sdk/models/operations/createtopictimerrequest.md +++ b/docs/sdk/models/operations/createtopictimerrequest.md @@ -7,5 +7,5 @@ | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | | `apiKey` | *string* | :heavy_check_mark: | N/A | | `apiUsername` | *string* | :heavy_check_mark: | N/A | -| `id` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.CreateTopicTimerRequestBody](../../../sdk/models/operations/createtopictimerrequestbody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `requestBody` | [operations.CreateTopicTimerRequestBody](../../../sdk/models/operations/createtopictimerrequestbody.md) | :heavy_minus_sign: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/createtopictimerresponse.md b/docs/sdk/models/operations/createtopictimerresponse.md deleted file mode 100644 index f0a9adb..0000000 --- a/docs/sdk/models/operations/createtopictimerresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreateTopicTimerResponse - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.CreateTopicTimerResponseBody](../../../sdk/models/operations/createtopictimerresponsebody.md) | :heavy_minus_sign: | topic updated | \ No newline at end of file diff --git a/docs/sdk/models/operations/createuploadrequestbody.md b/docs/sdk/models/operations/createuploadrequestbody.md index a0dfbfd..4b7c46f 100644 --- a/docs/sdk/models/operations/createuploadrequestbody.md +++ b/docs/sdk/models/operations/createuploadrequestbody.md @@ -3,9 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | -| `file` | [operations.File](../../../sdk/models/operations/file.md) | :heavy_minus_sign: | N/A | -| `synchronous` | *boolean* | :heavy_minus_sign: | Use this flag to return an id and url | -| `type` | [operations.TypeT](../../../sdk/models/operations/typet.md) | :heavy_check_mark: | N/A | -| `userId` | *number* | :heavy_minus_sign: | required if uploading an avatar | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | [operations.Type](../../../sdk/models/operations/type.md) | :heavy_check_mark: | N/A | +| `file` | [File](https://developer.mozilla.org/en-US/docs/Web/API/File) \| [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) \| [operations.FileT](../../../sdk/models/operations/filet.md) | :heavy_minus_sign: | N/A | +| `synchronous` | *boolean* | :heavy_minus_sign: | Use this flag to return an id and url | +| `userId` | *number* | :heavy_minus_sign: | required if uploading an avatar | \ No newline at end of file diff --git a/docs/sdk/models/operations/createuploadresponse.md b/docs/sdk/models/operations/createuploadresponse.md deleted file mode 100644 index 574dfe7..0000000 --- a/docs/sdk/models/operations/createuploadresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreateUploadResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.CreateUploadResponseBody](../../../sdk/models/operations/createuploadresponsebody.md) | :heavy_minus_sign: | file uploaded | \ No newline at end of file diff --git a/docs/sdk/models/operations/createuserresponse.md b/docs/sdk/models/operations/createuserresponse.md deleted file mode 100644 index 5df68ad..0000000 --- a/docs/sdk/models/operations/createuserresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# CreateUserResponse - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.CreateUserResponseBody](../../../sdk/models/operations/createuserresponsebody.md) | :heavy_minus_sign: | user created | \ No newline at end of file diff --git a/docs/sdk/models/operations/deactivateuserresponse.md b/docs/sdk/models/operations/deactivateuserresponse.md deleted file mode 100644 index 6fa70e4..0000000 --- a/docs/sdk/models/operations/deactivateuserresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# DeactivateUserResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.DeactivateUserResponseBody](../../../sdk/models/operations/deactivateuserresponsebody.md) | :heavy_minus_sign: | response | \ No newline at end of file diff --git a/docs/sdk/models/operations/deletebadgeresponse.md b/docs/sdk/models/operations/deletebadgeresponse.md deleted file mode 100644 index b04e7ce..0000000 --- a/docs/sdk/models/operations/deletebadgeresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# DeleteBadgeResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/sdk/models/operations/deletegroupresponse.md b/docs/sdk/models/operations/deletegroupresponse.md deleted file mode 100644 index 8489218..0000000 --- a/docs/sdk/models/operations/deletegroupresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# DeleteGroupResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.DeleteGroupResponseBody](../../../sdk/models/operations/deletegroupresponsebody.md) | :heavy_minus_sign: | response | \ No newline at end of file diff --git a/docs/sdk/models/operations/deletepostrequest.md b/docs/sdk/models/operations/deletepostrequest.md index 98f5c2f..025d0e2 100644 --- a/docs/sdk/models/operations/deletepostrequest.md +++ b/docs/sdk/models/operations/deletepostrequest.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | -| `id` | *number* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.DeletePostRequestBody](../../../sdk/models/operations/deletepostrequestbody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `requestBody` | [operations.DeletePostRequestBody](../../../sdk/models/operations/deletepostrequestbody.md) | :heavy_minus_sign: | N/A | +| `id` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/deletepostresponse.md b/docs/sdk/models/operations/deletepostresponse.md deleted file mode 100644 index 6289c23..0000000 --- a/docs/sdk/models/operations/deletepostresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# DeletePostResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/sdk/models/operations/deleteuserrequest.md b/docs/sdk/models/operations/deleteuserrequest.md index 54e5527..17a918c 100644 --- a/docs/sdk/models/operations/deleteuserrequest.md +++ b/docs/sdk/models/operations/deleteuserrequest.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | -| `id` | *number* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.DeleteUserRequestBody](../../../sdk/models/operations/deleteuserrequestbody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `requestBody` | [operations.DeleteUserRequestBody](../../../sdk/models/operations/deleteuserrequestbody.md) | :heavy_minus_sign: | N/A | +| `id` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/deleteuserresponse.md b/docs/sdk/models/operations/deleteuserresponse.md deleted file mode 100644 index 071fdb4..0000000 --- a/docs/sdk/models/operations/deleteuserresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# DeleteUserResponse - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.DeleteUserResponseBody](../../../sdk/models/operations/deleteuserresponsebody.md) | :heavy_minus_sign: | response | \ No newline at end of file diff --git a/docs/sdk/models/operations/downloadbackupresponse.md b/docs/sdk/models/operations/downloadbackupresponse.md deleted file mode 100644 index 5bc0df9..0000000 --- a/docs/sdk/models/operations/downloadbackupresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# DownloadBackupResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/sdk/models/operations/file.md b/docs/sdk/models/operations/filet.md similarity index 97% rename from docs/sdk/models/operations/file.md rename to docs/sdk/models/operations/filet.md index 89a9dac..5cbbe63 100644 --- a/docs/sdk/models/operations/file.md +++ b/docs/sdk/models/operations/filet.md @@ -1,4 +1,4 @@ -# File +# FileT ## Fields diff --git a/docs/sdk/models/operations/generatepresignedputresponse.md b/docs/sdk/models/operations/generatepresignedputresponse.md deleted file mode 100644 index e6eb2df..0000000 --- a/docs/sdk/models/operations/generatepresignedputresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GeneratePresignedPutResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.GeneratePresignedPutResponseBody](../../../sdk/models/operations/generatepresignedputresponsebody.md) | :heavy_minus_sign: | external upload initialized | \ No newline at end of file diff --git a/docs/sdk/models/operations/getbackupsresponse.md b/docs/sdk/models/operations/getbackupsresponse.md deleted file mode 100644 index bd5fc92..0000000 --- a/docs/sdk/models/operations/getbackupsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetBackupsResponse - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `responseBodies` | [operations.ResponseBody](../../../sdk/models/operations/responsebody.md)[] | :heavy_minus_sign: | success response | \ No newline at end of file diff --git a/docs/sdk/models/operations/getcategoryresponse.md b/docs/sdk/models/operations/getcategoryresponse.md deleted file mode 100644 index 805c0e2..0000000 --- a/docs/sdk/models/operations/getcategoryresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetCategoryResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.GetCategoryResponseBody](../../../sdk/models/operations/getcategoryresponsebody.md) | :heavy_minus_sign: | response | \ No newline at end of file diff --git a/docs/sdk/models/operations/getgroupresponse.md b/docs/sdk/models/operations/getgroupresponse.md deleted file mode 100644 index 33b3e09..0000000 --- a/docs/sdk/models/operations/getgroupresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetGroupResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.GetGroupResponseBody](../../../sdk/models/operations/getgroupresponsebody.md) | :heavy_minus_sign: | success response | \ No newline at end of file diff --git a/docs/sdk/models/operations/getnotificationsresponse.md b/docs/sdk/models/operations/getnotificationsresponse.md deleted file mode 100644 index f32879a..0000000 --- a/docs/sdk/models/operations/getnotificationsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetNotificationsResponse - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.GetNotificationsResponseBody](../../../sdk/models/operations/getnotificationsresponsebody.md) | :heavy_minus_sign: | notifications | \ No newline at end of file diff --git a/docs/sdk/models/operations/getpostresponse.md b/docs/sdk/models/operations/getpostresponse.md deleted file mode 100644 index 2bc86f6..0000000 --- a/docs/sdk/models/operations/getpostresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetPostResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | Record | :heavy_minus_sign: | single post | \ No newline at end of file diff --git a/docs/sdk/models/operations/getpostresponsebody.md b/docs/sdk/models/operations/getpostresponsebody.md new file mode 100644 index 0000000..9aef84e --- /dev/null +++ b/docs/sdk/models/operations/getpostresponsebody.md @@ -0,0 +1,61 @@ +# GetPostResponseBody + +single post + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `additionalProperties` | Record | :heavy_minus_sign: | N/A | +| `actionsSummary` | [operations.ActionsSummary](../../../sdk/models/operations/actionssummary.md)[] | :heavy_check_mark: | N/A | +| `admin` | *boolean* | :heavy_check_mark: | N/A | +| `avatarTemplate` | *string* | :heavy_check_mark: | N/A | +| `bookmarked` | *boolean* | :heavy_check_mark: | N/A | +| `canDelete` | *boolean* | :heavy_check_mark: | N/A | +| `canEdit` | *boolean* | :heavy_check_mark: | N/A | +| `canRecover` | *boolean* | :heavy_check_mark: | N/A | +| `canSeeHiddenPost` | *boolean* | :heavy_minus_sign: | N/A | +| `canViewEditHistory` | *boolean* | :heavy_check_mark: | N/A | +| `canWiki` | *boolean* | :heavy_check_mark: | N/A | +| `cooked` | *string* | :heavy_check_mark: | N/A | +| `createdAt` | *string* | :heavy_check_mark: | N/A | +| `deletedAt` | *string* | :heavy_check_mark: | N/A | +| `displayUsername` | *string* | :heavy_minus_sign: | N/A | +| `editReason` | *string* | :heavy_check_mark: | N/A | +| `flairBgColor` | *string* | :heavy_check_mark: | N/A | +| `flairColor` | *string* | :heavy_check_mark: | N/A | +| `flairGroupId` | *string* | :heavy_minus_sign: | N/A | +| `flairName` | *string* | :heavy_check_mark: | N/A | +| `flairUrl` | *string* | :heavy_check_mark: | N/A | +| `hidden` | *boolean* | :heavy_check_mark: | N/A | +| `id` | *number* | :heavy_check_mark: | N/A | +| `incomingLinkCount` | *number* | :heavy_check_mark: | N/A | +| `mentionedUsers` | *any*[] | :heavy_minus_sign: | N/A | +| `moderator` | *boolean* | :heavy_check_mark: | N/A | +| `name` | *string* | :heavy_minus_sign: | N/A | +| `postNumber` | *number* | :heavy_check_mark: | N/A | +| `postType` | *number* | :heavy_check_mark: | N/A | +| `primaryGroupName` | *string* | :heavy_check_mark: | N/A | +| `quoteCount` | *number* | :heavy_check_mark: | N/A | +| `raw` | *string* | :heavy_check_mark: | N/A | +| `readersCount` | *number* | :heavy_check_mark: | N/A | +| `reads` | *number* | :heavy_check_mark: | N/A | +| `replyCount` | *number* | :heavy_check_mark: | N/A | +| `replyToPostNumber` | *string* | :heavy_check_mark: | N/A | +| `reviewableId` | *string* | :heavy_check_mark: | N/A | +| `reviewableScoreCount` | *number* | :heavy_check_mark: | N/A | +| `reviewableScorePendingCount` | *number* | :heavy_check_mark: | N/A | +| `score` | *number* | :heavy_check_mark: | N/A | +| `staff` | *boolean* | :heavy_check_mark: | N/A | +| `topicId` | *number* | :heavy_check_mark: | N/A | +| `topicSlug` | *string* | :heavy_check_mark: | N/A | +| `trustLevel` | *number* | :heavy_check_mark: | N/A | +| `updatedAt` | *string* | :heavy_check_mark: | N/A | +| `userDeleted` | *boolean* | :heavy_check_mark: | N/A | +| `userId` | *number* | :heavy_check_mark: | N/A | +| `userTitle` | *string* | :heavy_check_mark: | N/A | +| `username` | *string* | :heavy_check_mark: | N/A | +| `version` | *number* | :heavy_check_mark: | N/A | +| `wiki` | *boolean* | :heavy_check_mark: | N/A | +| `yours` | *boolean* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/getsiteresponse.md b/docs/sdk/models/operations/getsiteresponse.md deleted file mode 100644 index c8b1d15..0000000 --- a/docs/sdk/models/operations/getsiteresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetSiteResponse - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.GetSiteResponseBody](../../../sdk/models/operations/getsiteresponsebody.md) | :heavy_minus_sign: | success response | \ No newline at end of file diff --git a/docs/sdk/models/operations/gettaggroupresponse.md b/docs/sdk/models/operations/gettaggroupresponse.md deleted file mode 100644 index cb06084..0000000 --- a/docs/sdk/models/operations/gettaggroupresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetTagGroupResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.GetTagGroupResponseBody](../../../sdk/models/operations/gettaggroupresponsebody.md) | :heavy_minus_sign: | notifications | \ No newline at end of file diff --git a/docs/sdk/models/operations/gettagresponse.md b/docs/sdk/models/operations/gettagresponse.md deleted file mode 100644 index b54e54a..0000000 --- a/docs/sdk/models/operations/gettagresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetTagResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.GetTagResponseBody](../../../sdk/models/operations/gettagresponsebody.md) | :heavy_minus_sign: | notifications | \ No newline at end of file diff --git a/docs/sdk/models/operations/gettopicbyexternalidresponse.md b/docs/sdk/models/operations/gettopicbyexternalidresponse.md deleted file mode 100644 index c07c9a9..0000000 --- a/docs/sdk/models/operations/gettopicbyexternalidresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# GetTopicByExternalIdResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/sdk/models/operations/gettopicresponse.md b/docs/sdk/models/operations/gettopicresponse.md deleted file mode 100644 index 4334a73..0000000 --- a/docs/sdk/models/operations/gettopicresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetTopicResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.GetTopicResponseBody](../../../sdk/models/operations/gettopicresponsebody.md) | :heavy_minus_sign: | specific posts | \ No newline at end of file diff --git a/docs/sdk/models/operations/getuseremailsresponse.md b/docs/sdk/models/operations/getuseremailsresponse.md deleted file mode 100644 index 7937233..0000000 --- a/docs/sdk/models/operations/getuseremailsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetUserEmailsResponse - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.GetUserEmailsResponseBody](../../../sdk/models/operations/getuseremailsresponsebody.md) | :heavy_minus_sign: | success response | \ No newline at end of file diff --git a/docs/sdk/models/operations/getuserexternalidresponse.md b/docs/sdk/models/operations/getuserexternalidresponse.md deleted file mode 100644 index f7817b9..0000000 --- a/docs/sdk/models/operations/getuserexternalidresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetUserExternalIdResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.GetUserExternalIdResponseBody](../../../sdk/models/operations/getuserexternalidresponsebody.md) | :heavy_minus_sign: | user response | \ No newline at end of file diff --git a/docs/sdk/models/operations/getuseridentiyproviderexternalidresponse.md b/docs/sdk/models/operations/getuseridentiyproviderexternalidresponse.md deleted file mode 100644 index dfec60b..0000000 --- a/docs/sdk/models/operations/getuseridentiyproviderexternalidresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetUserIdentiyProviderExternalIdResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.GetUserIdentiyProviderExternalIdResponseBody](../../../sdk/models/operations/getuseridentiyproviderexternalidresponsebody.md) | :heavy_minus_sign: | user response | \ No newline at end of file diff --git a/docs/sdk/models/operations/getuserresponse.md b/docs/sdk/models/operations/getuserresponse.md deleted file mode 100644 index 1ca7f7c..0000000 --- a/docs/sdk/models/operations/getuserresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetUserResponse - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.GetUserResponseBody](../../../sdk/models/operations/getuserresponsebody.md) | :heavy_minus_sign: | user response | \ No newline at end of file diff --git a/docs/sdk/models/operations/getusersentprivatemessagesresponse.md b/docs/sdk/models/operations/getusersentprivatemessagesresponse.md deleted file mode 100644 index 6cdf145..0000000 --- a/docs/sdk/models/operations/getusersentprivatemessagesresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# GetUserSentPrivateMessagesResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.GetUserSentPrivateMessagesResponseBody](../../../sdk/models/operations/getusersentprivatemessagesresponsebody.md) | :heavy_minus_sign: | private messages | \ No newline at end of file diff --git a/docs/sdk/models/operations/invitetotopicrequest.md b/docs/sdk/models/operations/invitetotopicrequest.md index c68ca51..a4240cb 100644 --- a/docs/sdk/models/operations/invitetotopicrequest.md +++ b/docs/sdk/models/operations/invitetotopicrequest.md @@ -7,5 +7,5 @@ | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | | `apiKey` | *string* | :heavy_check_mark: | N/A | | `apiUsername` | *string* | :heavy_check_mark: | N/A | -| `id` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.InviteToTopicRequestBody](../../../sdk/models/operations/invitetotopicrequestbody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `requestBody` | [operations.InviteToTopicRequestBody](../../../sdk/models/operations/invitetotopicrequestbody.md) | :heavy_minus_sign: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/invitetotopicresponse.md b/docs/sdk/models/operations/invitetotopicresponse.md deleted file mode 100644 index df0f9f6..0000000 --- a/docs/sdk/models/operations/invitetotopicresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# InviteToTopicResponse - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.InviteToTopicResponseBody](../../../sdk/models/operations/invitetotopicresponsebody.md) | :heavy_minus_sign: | topic updated | \ No newline at end of file diff --git a/docs/sdk/models/operations/listcategoriesresponse.md b/docs/sdk/models/operations/listcategoriesresponse.md deleted file mode 100644 index 34211cb..0000000 --- a/docs/sdk/models/operations/listcategoriesresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListCategoriesResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.ListCategoriesResponseBody](../../../sdk/models/operations/listcategoriesresponsebody.md) | :heavy_minus_sign: | success response | \ No newline at end of file diff --git a/docs/sdk/models/operations/listcategorytopicsresponse.md b/docs/sdk/models/operations/listcategorytopicsresponse.md deleted file mode 100644 index be95896..0000000 --- a/docs/sdk/models/operations/listcategorytopicsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListCategoryTopicsResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.ListCategoryTopicsResponseBody](../../../sdk/models/operations/listcategorytopicsresponsebody.md) | :heavy_minus_sign: | success response | \ No newline at end of file diff --git a/docs/sdk/models/operations/listgroupmembersresponse.md b/docs/sdk/models/operations/listgroupmembersresponse.md deleted file mode 100644 index 641c366..0000000 --- a/docs/sdk/models/operations/listgroupmembersresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListGroupMembersResponse - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.ListGroupMembersResponseBody](../../../sdk/models/operations/listgroupmembersresponsebody.md) | :heavy_minus_sign: | success response | \ No newline at end of file diff --git a/docs/sdk/models/operations/listgroupsresponse.md b/docs/sdk/models/operations/listgroupsresponse.md deleted file mode 100644 index 67c18ba..0000000 --- a/docs/sdk/models/operations/listgroupsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListGroupsResponse - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.ListGroupsResponseBody](../../../sdk/models/operations/listgroupsresponsebody.md) | :heavy_minus_sign: | response | \ No newline at end of file diff --git a/docs/sdk/models/operations/listlatesttopicsresponse.md b/docs/sdk/models/operations/listlatesttopicsresponse.md deleted file mode 100644 index 8956175..0000000 --- a/docs/sdk/models/operations/listlatesttopicsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListLatestTopicsResponse - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.ListLatestTopicsResponseBody](../../../sdk/models/operations/listlatesttopicsresponsebody.md) | :heavy_minus_sign: | topic updated | \ No newline at end of file diff --git a/docs/sdk/models/operations/listpostsresponse.md b/docs/sdk/models/operations/listpostsresponse.md deleted file mode 100644 index 560047a..0000000 --- a/docs/sdk/models/operations/listpostsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListPostsResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.ListPostsResponseBody](../../../sdk/models/operations/listpostsresponsebody.md) | :heavy_minus_sign: | latest posts | \ No newline at end of file diff --git a/docs/sdk/models/operations/listtaggroupsresponse.md b/docs/sdk/models/operations/listtaggroupsresponse.md deleted file mode 100644 index 130ba20..0000000 --- a/docs/sdk/models/operations/listtaggroupsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListTagGroupsResponse - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.ListTagGroupsResponseBody](../../../sdk/models/operations/listtaggroupsresponsebody.md) | :heavy_minus_sign: | tags | \ No newline at end of file diff --git a/docs/sdk/models/operations/listtagsresponse.md b/docs/sdk/models/operations/listtagsresponse.md deleted file mode 100644 index 6e6aadf..0000000 --- a/docs/sdk/models/operations/listtagsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListTagsResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.ListTagsResponseBody](../../../sdk/models/operations/listtagsresponsebody.md) | :heavy_minus_sign: | notifications | \ No newline at end of file diff --git a/docs/sdk/models/operations/listtoptopicsresponse.md b/docs/sdk/models/operations/listtoptopicsresponse.md deleted file mode 100644 index f853567..0000000 --- a/docs/sdk/models/operations/listtoptopicsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListTopTopicsResponse - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.ListTopTopicsResponseBody](../../../sdk/models/operations/listtoptopicsresponsebody.md) | :heavy_minus_sign: | response | \ No newline at end of file diff --git a/docs/sdk/models/operations/listuseractionsresponse.md b/docs/sdk/models/operations/listuseractionsresponse.md deleted file mode 100644 index 4ad6b3a..0000000 --- a/docs/sdk/models/operations/listuseractionsresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListUserActionsResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.ListUserActionsResponseBody](../../../sdk/models/operations/listuseractionsresponsebody.md) | :heavy_minus_sign: | response | \ No newline at end of file diff --git a/docs/sdk/models/operations/listuserbadgesresponse.md b/docs/sdk/models/operations/listuserbadgesresponse.md deleted file mode 100644 index a927d45..0000000 --- a/docs/sdk/models/operations/listuserbadgesresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListUserBadgesResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.ListUserBadgesResponseBody](../../../sdk/models/operations/listuserbadgesresponsebody.md) | :heavy_minus_sign: | success response | \ No newline at end of file diff --git a/docs/sdk/models/operations/listuserprivatemessagesresponse.md b/docs/sdk/models/operations/listuserprivatemessagesresponse.md deleted file mode 100644 index ed11680..0000000 --- a/docs/sdk/models/operations/listuserprivatemessagesresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListUserPrivateMessagesResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.ListUserPrivateMessagesResponseBody](../../../sdk/models/operations/listuserprivatemessagesresponsebody.md) | :heavy_minus_sign: | private messages | \ No newline at end of file diff --git a/docs/sdk/models/operations/listuserspublicrequest.md b/docs/sdk/models/operations/listuserspublicrequest.md index 458445c..3871a5f 100644 --- a/docs/sdk/models/operations/listuserspublicrequest.md +++ b/docs/sdk/models/operations/listuserspublicrequest.md @@ -5,7 +5,7 @@ | Field | Type | Required | Description | | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | -| `order` | [operations.Order](../../../sdk/models/operations/order.md) | :heavy_check_mark: | N/A | -| `period` | [operations.Period](../../../sdk/models/operations/period.md) | :heavy_check_mark: | N/A | | `asc` | [operations.Asc](../../../sdk/models/operations/asc.md) | :heavy_minus_sign: | N/A | -| `page` | *number* | :heavy_minus_sign: | N/A | \ No newline at end of file +| `order` | [operations.Order](../../../sdk/models/operations/order.md) | :heavy_check_mark: | N/A | +| `page` | *number* | :heavy_minus_sign: | N/A | +| `period` | [operations.Period](../../../sdk/models/operations/period.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/listuserspublicresponse.md b/docs/sdk/models/operations/listuserspublicresponse.md deleted file mode 100644 index 134a55f..0000000 --- a/docs/sdk/models/operations/listuserspublicresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# ListUsersPublicResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.ListUsersPublicResponseBody](../../../sdk/models/operations/listuserspublicresponsebody.md) | :heavy_minus_sign: | directory items response | \ No newline at end of file diff --git a/docs/sdk/models/operations/lockpostrequest.md b/docs/sdk/models/operations/lockpostrequest.md index d5cf0d9..d278992 100644 --- a/docs/sdk/models/operations/lockpostrequest.md +++ b/docs/sdk/models/operations/lockpostrequest.md @@ -7,5 +7,5 @@ | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | | `apiKey` | *string* | :heavy_check_mark: | N/A | | `apiUsername` | *string* | :heavy_check_mark: | N/A | -| `id` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.LockPostRequestBody](../../../sdk/models/operations/lockpostrequestbody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `requestBody` | [operations.LockPostRequestBody](../../../sdk/models/operations/lockpostrequestbody.md) | :heavy_minus_sign: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/lockpostresponse.md b/docs/sdk/models/operations/lockpostresponse.md deleted file mode 100644 index 1a9b093..0000000 --- a/docs/sdk/models/operations/lockpostresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# LockPostResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.LockPostResponseBody](../../../sdk/models/operations/lockpostresponsebody.md) | :heavy_minus_sign: | post updated | \ No newline at end of file diff --git a/docs/sdk/models/operations/logoutuserresponse.md b/docs/sdk/models/operations/logoutuserresponse.md deleted file mode 100644 index 9a85258..0000000 --- a/docs/sdk/models/operations/logoutuserresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# LogOutUserResponse - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.LogOutUserResponseBody](../../../sdk/models/operations/logoutuserresponsebody.md) | :heavy_minus_sign: | response | \ No newline at end of file diff --git a/docs/sdk/models/operations/marknotificationsasreadresponse.md b/docs/sdk/models/operations/marknotificationsasreadresponse.md deleted file mode 100644 index 673d31c..0000000 --- a/docs/sdk/models/operations/marknotificationsasreadresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# MarkNotificationsAsReadResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.MarkNotificationsAsReadResponseBody](../../../sdk/models/operations/marknotificationsasreadresponsebody.md) | :heavy_minus_sign: | notifications marked read | \ No newline at end of file diff --git a/docs/sdk/models/operations/performpostactionactionssummary.md b/docs/sdk/models/operations/performpostactionactionssummary.md new file mode 100644 index 0000000..2f0d89c --- /dev/null +++ b/docs/sdk/models/operations/performpostactionactionssummary.md @@ -0,0 +1,11 @@ +# PerformPostActionActionsSummary + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `acted` | *boolean* | :heavy_minus_sign: | N/A | +| `canUndo` | *boolean* | :heavy_minus_sign: | N/A | +| `count` | *number* | :heavy_minus_sign: | N/A | +| `id` | *number* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/performpostactionresponse.md b/docs/sdk/models/operations/performpostactionresponse.md deleted file mode 100644 index 6666812..0000000 --- a/docs/sdk/models/operations/performpostactionresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# PerformPostActionResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.PerformPostActionResponseBody](../../../sdk/models/operations/performpostactionresponsebody.md) | :heavy_minus_sign: | post updated | \ No newline at end of file diff --git a/docs/sdk/models/operations/performpostactionresponsebody.md b/docs/sdk/models/operations/performpostactionresponsebody.md index ff40ab5..a906861 100644 --- a/docs/sdk/models/operations/performpostactionresponsebody.md +++ b/docs/sdk/models/operations/performpostactionresponsebody.md @@ -5,52 +5,52 @@ post updated ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | -| `actionsSummary` | [operations.ActionsSummary](../../../sdk/models/operations/actionssummary.md)[] | :heavy_minus_sign: | N/A | -| `admin` | *boolean* | :heavy_minus_sign: | N/A | -| `avatarTemplate` | *string* | :heavy_minus_sign: | N/A | -| `canDelete` | *boolean* | :heavy_minus_sign: | N/A | -| `canEdit` | *boolean* | :heavy_minus_sign: | N/A | -| `canRecover` | *boolean* | :heavy_minus_sign: | N/A | -| `canViewEditHistory` | *boolean* | :heavy_minus_sign: | N/A | -| `canWiki` | *boolean* | :heavy_minus_sign: | N/A | -| `cooked` | *string* | :heavy_minus_sign: | N/A | -| `createdAt` | *string* | :heavy_minus_sign: | N/A | -| `deletedAt` | *string* | :heavy_minus_sign: | N/A | -| `displayUsername` | *string* | :heavy_minus_sign: | N/A | -| `editReason` | *string* | :heavy_minus_sign: | N/A | -| `flairBgColor` | *string* | :heavy_minus_sign: | N/A | -| `flairColor` | *string* | :heavy_minus_sign: | N/A | -| `flairName` | *string* | :heavy_minus_sign: | N/A | -| `flairUrl` | *string* | :heavy_minus_sign: | N/A | -| `hidden` | *boolean* | :heavy_minus_sign: | N/A | -| `id` | *number* | :heavy_minus_sign: | N/A | -| `incomingLinkCount` | *number* | :heavy_minus_sign: | N/A | -| `moderator` | *boolean* | :heavy_minus_sign: | N/A | -| `name` | *string* | :heavy_minus_sign: | N/A | -| `notice` | [operations.Notice](../../../sdk/models/operations/notice.md) | :heavy_minus_sign: | N/A | -| `postNumber` | *number* | :heavy_minus_sign: | N/A | -| `postType` | *number* | :heavy_minus_sign: | N/A | -| `primaryGroupName` | *string* | :heavy_minus_sign: | N/A | -| `quoteCount` | *number* | :heavy_minus_sign: | N/A | -| `readersCount` | *number* | :heavy_minus_sign: | N/A | -| `reads` | *number* | :heavy_minus_sign: | N/A | -| `replyCount` | *number* | :heavy_minus_sign: | N/A | -| `replyToPostNumber` | *string* | :heavy_minus_sign: | N/A | -| `reviewableId` | *string* | :heavy_minus_sign: | N/A | -| `reviewableScoreCount` | *number* | :heavy_minus_sign: | N/A | -| `reviewableScorePendingCount` | *number* | :heavy_minus_sign: | N/A | -| `score` | *number* | :heavy_minus_sign: | N/A | -| `staff` | *boolean* | :heavy_minus_sign: | N/A | -| `topicId` | *number* | :heavy_minus_sign: | N/A | -| `topicSlug` | *string* | :heavy_minus_sign: | N/A | -| `trustLevel` | *number* | :heavy_minus_sign: | N/A | -| `updatedAt` | *string* | :heavy_minus_sign: | N/A | -| `userDeleted` | *boolean* | :heavy_minus_sign: | N/A | -| `userId` | *number* | :heavy_minus_sign: | N/A | -| `userTitle` | *string* | :heavy_minus_sign: | N/A | -| `username` | *string* | :heavy_minus_sign: | N/A | -| `version` | *number* | :heavy_minus_sign: | N/A | -| `wiki` | *boolean* | :heavy_minus_sign: | N/A | -| `yours` | *boolean* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | +| `actionsSummary` | [operations.PerformPostActionActionsSummary](../../../sdk/models/operations/performpostactionactionssummary.md)[] | :heavy_minus_sign: | N/A | +| `admin` | *boolean* | :heavy_minus_sign: | N/A | +| `avatarTemplate` | *string* | :heavy_minus_sign: | N/A | +| `canDelete` | *boolean* | :heavy_minus_sign: | N/A | +| `canEdit` | *boolean* | :heavy_minus_sign: | N/A | +| `canRecover` | *boolean* | :heavy_minus_sign: | N/A | +| `canViewEditHistory` | *boolean* | :heavy_minus_sign: | N/A | +| `canWiki` | *boolean* | :heavy_minus_sign: | N/A | +| `cooked` | *string* | :heavy_minus_sign: | N/A | +| `createdAt` | *string* | :heavy_minus_sign: | N/A | +| `deletedAt` | *string* | :heavy_minus_sign: | N/A | +| `displayUsername` | *string* | :heavy_minus_sign: | N/A | +| `editReason` | *string* | :heavy_minus_sign: | N/A | +| `flairBgColor` | *string* | :heavy_minus_sign: | N/A | +| `flairColor` | *string* | :heavy_minus_sign: | N/A | +| `flairName` | *string* | :heavy_minus_sign: | N/A | +| `flairUrl` | *string* | :heavy_minus_sign: | N/A | +| `hidden` | *boolean* | :heavy_minus_sign: | N/A | +| `id` | *number* | :heavy_minus_sign: | N/A | +| `incomingLinkCount` | *number* | :heavy_minus_sign: | N/A | +| `moderator` | *boolean* | :heavy_minus_sign: | N/A | +| `name` | *string* | :heavy_minus_sign: | N/A | +| `notice` | [operations.Notice](../../../sdk/models/operations/notice.md) | :heavy_minus_sign: | N/A | +| `postNumber` | *number* | :heavy_minus_sign: | N/A | +| `postType` | *number* | :heavy_minus_sign: | N/A | +| `primaryGroupName` | *string* | :heavy_minus_sign: | N/A | +| `quoteCount` | *number* | :heavy_minus_sign: | N/A | +| `readersCount` | *number* | :heavy_minus_sign: | N/A | +| `reads` | *number* | :heavy_minus_sign: | N/A | +| `replyCount` | *number* | :heavy_minus_sign: | N/A | +| `replyToPostNumber` | *string* | :heavy_minus_sign: | N/A | +| `reviewableId` | *string* | :heavy_minus_sign: | N/A | +| `reviewableScoreCount` | *number* | :heavy_minus_sign: | N/A | +| `reviewableScorePendingCount` | *number* | :heavy_minus_sign: | N/A | +| `score` | *number* | :heavy_minus_sign: | N/A | +| `staff` | *boolean* | :heavy_minus_sign: | N/A | +| `topicId` | *number* | :heavy_minus_sign: | N/A | +| `topicSlug` | *string* | :heavy_minus_sign: | N/A | +| `trustLevel` | *number* | :heavy_minus_sign: | N/A | +| `updatedAt` | *string* | :heavy_minus_sign: | N/A | +| `userDeleted` | *boolean* | :heavy_minus_sign: | N/A | +| `userId` | *number* | :heavy_minus_sign: | N/A | +| `userTitle` | *string* | :heavy_minus_sign: | N/A | +| `username` | *string* | :heavy_minus_sign: | N/A | +| `version` | *number* | :heavy_minus_sign: | N/A | +| `wiki` | *boolean* | :heavy_minus_sign: | N/A | +| `yours` | *boolean* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/permissions.md b/docs/sdk/models/operations/permissions.md index 819e052..da73706 100644 --- a/docs/sdk/models/operations/permissions.md +++ b/docs/sdk/models/operations/permissions.md @@ -3,5 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `additionalProperties` | Record | :heavy_minus_sign: | N/A | | +| `everyone` | *number* | :heavy_minus_sign: | N/A | 1 | +| `staff` | *number* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/sdk/models/operations/postrepliesresponse.md b/docs/sdk/models/operations/postrepliesresponse.md deleted file mode 100644 index 550a255..0000000 --- a/docs/sdk/models/operations/postrepliesresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# PostRepliesResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `responseBodies` | [operations.PostRepliesResponseBody](../../../sdk/models/operations/postrepliesresponsebody.md)[] | :heavy_minus_sign: | post replies | \ No newline at end of file diff --git a/docs/sdk/models/operations/refreshgravatarresponse.md b/docs/sdk/models/operations/refreshgravatarresponse.md deleted file mode 100644 index 2b5f2eb..0000000 --- a/docs/sdk/models/operations/refreshgravatarresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# RefreshGravatarResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.RefreshGravatarResponseBody](../../../sdk/models/operations/refreshgravatarresponsebody.md) | :heavy_minus_sign: | response | \ No newline at end of file diff --git a/docs/sdk/models/operations/removegroupmembersrequest.md b/docs/sdk/models/operations/removegroupmembersrequest.md index 7693ba5..9bea709 100644 --- a/docs/sdk/models/operations/removegroupmembersrequest.md +++ b/docs/sdk/models/operations/removegroupmembersrequest.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | -| `id` | *number* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.RemoveGroupMembersRequestBody](../../../sdk/models/operations/removegroupmembersrequestbody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `requestBody` | [operations.RemoveGroupMembersRequestBody](../../../sdk/models/operations/removegroupmembersrequestbody.md) | :heavy_minus_sign: | N/A | +| `id` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/removegroupmembersresponse.md b/docs/sdk/models/operations/removegroupmembersresponse.md deleted file mode 100644 index 91d7b4a..0000000 --- a/docs/sdk/models/operations/removegroupmembersresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# RemoveGroupMembersResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.RemoveGroupMembersResponseBody](../../../sdk/models/operations/removegroupmembersresponsebody.md) | :heavy_minus_sign: | success response | \ No newline at end of file diff --git a/docs/sdk/models/operations/removetopicresponse.md b/docs/sdk/models/operations/removetopicresponse.md deleted file mode 100644 index 6920832..0000000 --- a/docs/sdk/models/operations/removetopicresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# RemoveTopicResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/sdk/models/operations/searchresponse.md b/docs/sdk/models/operations/searchresponse.md deleted file mode 100644 index acf47a7..0000000 --- a/docs/sdk/models/operations/searchresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# SearchResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.SearchResponseBody](../../../sdk/models/operations/searchresponsebody.md) | :heavy_minus_sign: | success response | \ No newline at end of file diff --git a/docs/sdk/models/operations/senddownloadbackupemailresponse.md b/docs/sdk/models/operations/senddownloadbackupemailresponse.md deleted file mode 100644 index 8929e40..0000000 --- a/docs/sdk/models/operations/senddownloadbackupemailresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# SendDownloadBackupEmailResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/sdk/models/operations/sendpasswordresetemailresponse.md b/docs/sdk/models/operations/sendpasswordresetemailresponse.md deleted file mode 100644 index 02b1b98..0000000 --- a/docs/sdk/models/operations/sendpasswordresetemailresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# SendPasswordResetEmailResponse - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.SendPasswordResetEmailResponseBody](../../../sdk/models/operations/sendpasswordresetemailresponsebody.md) | :heavy_minus_sign: | success response | \ No newline at end of file diff --git a/docs/sdk/models/operations/setnotificationlevelrequest.md b/docs/sdk/models/operations/setnotificationlevelrequest.md index 9dd0e2b..589b26a 100644 --- a/docs/sdk/models/operations/setnotificationlevelrequest.md +++ b/docs/sdk/models/operations/setnotificationlevelrequest.md @@ -7,5 +7,5 @@ | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | | `apiKey` | *string* | :heavy_check_mark: | N/A | | `apiUsername` | *string* | :heavy_check_mark: | N/A | -| `id` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.SetNotificationLevelRequestBody](../../../sdk/models/operations/setnotificationlevelrequestbody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `requestBody` | [operations.SetNotificationLevelRequestBody](../../../sdk/models/operations/setnotificationlevelrequestbody.md) | :heavy_minus_sign: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/setnotificationlevelresponse.md b/docs/sdk/models/operations/setnotificationlevelresponse.md deleted file mode 100644 index b759155..0000000 --- a/docs/sdk/models/operations/setnotificationlevelresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# SetNotificationLevelResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.SetNotificationLevelResponseBody](../../../sdk/models/operations/setnotificationlevelresponsebody.md) | :heavy_minus_sign: | topic updated | \ No newline at end of file diff --git a/docs/sdk/models/operations/silenceuserrequest.md b/docs/sdk/models/operations/silenceuserrequest.md index d2a51e3..31c67d5 100644 --- a/docs/sdk/models/operations/silenceuserrequest.md +++ b/docs/sdk/models/operations/silenceuserrequest.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `id` | *number* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.SilenceUserRequestBody](../../../sdk/models/operations/silenceuserrequestbody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `requestBody` | [operations.SilenceUserRequestBody](../../../sdk/models/operations/silenceuserrequestbody.md) | :heavy_minus_sign: | N/A | +| `id` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/silenceuserresponse.md b/docs/sdk/models/operations/silenceuserresponse.md deleted file mode 100644 index a2f59ed..0000000 --- a/docs/sdk/models/operations/silenceuserresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# SilenceUserResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.SilenceUserResponseBody](../../../sdk/models/operations/silenceuserresponsebody.md) | :heavy_minus_sign: | response | \ No newline at end of file diff --git a/docs/sdk/models/operations/suspenduserrequest.md b/docs/sdk/models/operations/suspenduserrequest.md index 05381d8..4eaab76 100644 --- a/docs/sdk/models/operations/suspenduserrequest.md +++ b/docs/sdk/models/operations/suspenduserrequest.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `id` | *number* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.SuspendUserRequestBody](../../../sdk/models/operations/suspenduserrequestbody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `requestBody` | [operations.SuspendUserRequestBody](../../../sdk/models/operations/suspenduserrequestbody.md) | :heavy_minus_sign: | N/A | +| `id` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/suspenduserresponse.md b/docs/sdk/models/operations/suspenduserresponse.md deleted file mode 100644 index 2820ac1..0000000 --- a/docs/sdk/models/operations/suspenduserresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# SuspendUserResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.SuspendUserResponseBody](../../../sdk/models/operations/suspenduserresponsebody.md) | :heavy_minus_sign: | response | \ No newline at end of file diff --git a/docs/sdk/models/operations/taggroup.md b/docs/sdk/models/operations/taggroup.md index dca414f..87ad23e 100644 --- a/docs/sdk/models/operations/taggroup.md +++ b/docs/sdk/models/operations/taggroup.md @@ -3,11 +3,11 @@ ## Fields -| Field | Type | Required | Description | -| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| `id` | *number* | :heavy_check_mark: | N/A | -| `name` | *string* | :heavy_check_mark: | N/A | -| `onePerTopic` | *boolean* | :heavy_check_mark: | N/A | -| `parentTagName` | *any*[] | :heavy_check_mark: | N/A | -| `permissions` | [operations.Permissions](../../../sdk/models/operations/permissions.md) | :heavy_check_mark: | N/A | -| `tagNames` | *any*[] | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `id` | *number* | :heavy_check_mark: | N/A | +| `name` | *string* | :heavy_check_mark: | N/A | +| `onePerTopic` | *boolean* | :heavy_check_mark: | N/A | +| `parentTagName` | *any*[] | :heavy_check_mark: | N/A | +| `permissions` | [operations.CreateTagGroupPermissions](../../../sdk/models/operations/createtaggrouppermissions.md) | :heavy_check_mark: | N/A | +| `tagNames` | *any*[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/typet.md b/docs/sdk/models/operations/type.md similarity index 97% rename from docs/sdk/models/operations/typet.md rename to docs/sdk/models/operations/type.md index cd1900d..b3702c0 100644 --- a/docs/sdk/models/operations/typet.md +++ b/docs/sdk/models/operations/type.md @@ -1,4 +1,4 @@ -# TypeT +# Type ## Values diff --git a/docs/sdk/models/operations/updateavatarrequest.md b/docs/sdk/models/operations/updateavatarrequest.md index 69a0ae0..71f58fb 100644 --- a/docs/sdk/models/operations/updateavatarrequest.md +++ b/docs/sdk/models/operations/updateavatarrequest.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `username` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.UpdateAvatarRequestBody](../../../sdk/models/operations/updateavatarrequestbody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `requestBody` | [operations.UpdateAvatarRequestBody](../../../sdk/models/operations/updateavatarrequestbody.md) | :heavy_minus_sign: | N/A | +| `username` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/updateavatarresponse.md b/docs/sdk/models/operations/updateavatarresponse.md deleted file mode 100644 index 784083e..0000000 --- a/docs/sdk/models/operations/updateavatarresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdateAvatarResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.UpdateAvatarResponseBody](../../../sdk/models/operations/updateavatarresponsebody.md) | :heavy_minus_sign: | avatar updated | \ No newline at end of file diff --git a/docs/sdk/models/operations/updatebadgerequest.md b/docs/sdk/models/operations/updatebadgerequest.md index 0bf7776..c0b3b5b 100644 --- a/docs/sdk/models/operations/updatebadgerequest.md +++ b/docs/sdk/models/operations/updatebadgerequest.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `id` | *number* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.UpdateBadgeRequestBody](../../../sdk/models/operations/updatebadgerequestbody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `requestBody` | [operations.UpdateBadgeRequestBody](../../../sdk/models/operations/updatebadgerequestbody.md) | :heavy_minus_sign: | N/A | +| `id` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/updatebadgeresponse.md b/docs/sdk/models/operations/updatebadgeresponse.md deleted file mode 100644 index a8bef5e..0000000 --- a/docs/sdk/models/operations/updatebadgeresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdateBadgeResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.UpdateBadgeResponseBody](../../../sdk/models/operations/updatebadgeresponsebody.md) | :heavy_minus_sign: | success response | \ No newline at end of file diff --git a/docs/sdk/models/operations/updatecategorypermissions.md b/docs/sdk/models/operations/updatecategorypermissions.md new file mode 100644 index 0000000..4515ec6 --- /dev/null +++ b/docs/sdk/models/operations/updatecategorypermissions.md @@ -0,0 +1,10 @@ +# UpdateCategoryPermissions + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `additionalProperties` | Record | :heavy_minus_sign: | N/A | | +| `everyone` | *number* | :heavy_minus_sign: | N/A | 1 | +| `staff` | *number* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/sdk/models/operations/updatecategoryrequest.md b/docs/sdk/models/operations/updatecategoryrequest.md index 68b6307..37a2944 100644 --- a/docs/sdk/models/operations/updatecategoryrequest.md +++ b/docs/sdk/models/operations/updatecategoryrequest.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -| `id` | *number* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.UpdateCategoryRequestBody](../../../sdk/models/operations/updatecategoryrequestbody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `requestBody` | [operations.UpdateCategoryRequestBody](../../../sdk/models/operations/updatecategoryrequestbody.md) | :heavy_minus_sign: | N/A | +| `id` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/updatecategoryrequestbody.md b/docs/sdk/models/operations/updatecategoryrequestbody.md index 594e70b..39c48f7 100644 --- a/docs/sdk/models/operations/updatecategoryrequestbody.md +++ b/docs/sdk/models/operations/updatecategoryrequestbody.md @@ -3,15 +3,15 @@ ## Fields -| Field | Type | Required | Description | Example | -| --------------------------- | --------------------------- | --------------------------- | --------------------------- | --------------------------- | -| `allowBadges` | *boolean* | :heavy_minus_sign: | N/A | | -| `color` | *string* | :heavy_minus_sign: | N/A | 49d9e9 | -| `formTemplateIds` | *any*[] | :heavy_minus_sign: | N/A | | -| `name` | *string* | :heavy_check_mark: | N/A | | -| `parentCategoryId` | *number* | :heavy_minus_sign: | N/A | | -| `permissions` | Record | :heavy_minus_sign: | N/A | | -| `searchPriority` | *number* | :heavy_minus_sign: | N/A | | -| `slug` | *string* | :heavy_minus_sign: | N/A | | -| `textColor` | *string* | :heavy_minus_sign: | N/A | f0fcfd | -| `topicFeaturedLinksAllowed` | *boolean* | :heavy_minus_sign: | N/A | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `allowBadges` | *boolean* | :heavy_minus_sign: | N/A | | +| `color` | *string* | :heavy_minus_sign: | N/A | 49d9e9 | +| `formTemplateIds` | *any*[] | :heavy_minus_sign: | N/A | | +| `name` | *string* | :heavy_check_mark: | N/A | | +| `parentCategoryId` | *number* | :heavy_minus_sign: | N/A | | +| `permissions` | [operations.UpdateCategoryPermissions](../../../sdk/models/operations/updatecategorypermissions.md) | :heavy_minus_sign: | N/A | | +| `searchPriority` | *number* | :heavy_minus_sign: | N/A | | +| `slug` | *string* | :heavy_minus_sign: | N/A | | +| `textColor` | *string* | :heavy_minus_sign: | N/A | f0fcfd | +| `topicFeaturedLinksAllowed` | *boolean* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/sdk/models/operations/updatecategoryresponse.md b/docs/sdk/models/operations/updatecategoryresponse.md deleted file mode 100644 index 460d3fb..0000000 --- a/docs/sdk/models/operations/updatecategoryresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdateCategoryResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.UpdateCategoryResponseBody](../../../sdk/models/operations/updatecategoryresponsebody.md) | :heavy_minus_sign: | success response | \ No newline at end of file diff --git a/docs/sdk/models/operations/updateemailrequest.md b/docs/sdk/models/operations/updateemailrequest.md index b0d533f..8b5a70e 100644 --- a/docs/sdk/models/operations/updateemailrequest.md +++ b/docs/sdk/models/operations/updateemailrequest.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `username` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.UpdateEmailRequestBody](../../../sdk/models/operations/updateemailrequestbody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `requestBody` | [operations.UpdateEmailRequestBody](../../../sdk/models/operations/updateemailrequestbody.md) | :heavy_minus_sign: | N/A | +| `username` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/updateemailresponse.md b/docs/sdk/models/operations/updateemailresponse.md deleted file mode 100644 index 3d89ae0..0000000 --- a/docs/sdk/models/operations/updateemailresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# UpdateEmailResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/sdk/models/operations/updategrouprequest.md b/docs/sdk/models/operations/updategrouprequest.md index 0098087..9139f72 100644 --- a/docs/sdk/models/operations/updategrouprequest.md +++ b/docs/sdk/models/operations/updategrouprequest.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `id` | *number* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.UpdateGroupRequestBody](../../../sdk/models/operations/updategrouprequestbody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `requestBody` | [operations.UpdateGroupRequestBody](../../../sdk/models/operations/updategrouprequestbody.md) | :heavy_minus_sign: | N/A | +| `id` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/updategroupresponse.md b/docs/sdk/models/operations/updategroupresponse.md deleted file mode 100644 index 25f357c..0000000 --- a/docs/sdk/models/operations/updategroupresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdateGroupResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.UpdateGroupResponseBody](../../../sdk/models/operations/updategroupresponsebody.md) | :heavy_minus_sign: | success response | \ No newline at end of file diff --git a/docs/sdk/models/operations/updatepostrequest.md b/docs/sdk/models/operations/updatepostrequest.md index 7e250f2..0d5dded 100644 --- a/docs/sdk/models/operations/updatepostrequest.md +++ b/docs/sdk/models/operations/updatepostrequest.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.UpdatePostRequestBody](../../../sdk/models/operations/updatepostrequestbody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `requestBody` | [operations.UpdatePostRequestBody](../../../sdk/models/operations/updatepostrequestbody.md) | :heavy_minus_sign: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/updatepostresponse.md b/docs/sdk/models/operations/updatepostresponse.md deleted file mode 100644 index 2daad6f..0000000 --- a/docs/sdk/models/operations/updatepostresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdatePostResponse - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.UpdatePostResponseBody](../../../sdk/models/operations/updatepostresponsebody.md) | :heavy_minus_sign: | post updated | \ No newline at end of file diff --git a/docs/sdk/models/operations/updatetaggrouprequest.md b/docs/sdk/models/operations/updatetaggrouprequest.md index a8be61d..4c7898f 100644 --- a/docs/sdk/models/operations/updatetaggrouprequest.md +++ b/docs/sdk/models/operations/updatetaggrouprequest.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.UpdateTagGroupRequestBody](../../../sdk/models/operations/updatetaggrouprequestbody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `requestBody` | [operations.UpdateTagGroupRequestBody](../../../sdk/models/operations/updatetaggrouprequestbody.md) | :heavy_minus_sign: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/updatetaggroupresponse.md b/docs/sdk/models/operations/updatetaggroupresponse.md deleted file mode 100644 index 1a837ad..0000000 --- a/docs/sdk/models/operations/updatetaggroupresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdateTagGroupResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.UpdateTagGroupResponseBody](../../../sdk/models/operations/updatetaggroupresponsebody.md) | :heavy_minus_sign: | Tag group updated | \ No newline at end of file diff --git a/docs/sdk/models/operations/updatetopicrequest.md b/docs/sdk/models/operations/updatetopicrequest.md index 1639c9b..97e63ee 100644 --- a/docs/sdk/models/operations/updatetopicrequest.md +++ b/docs/sdk/models/operations/updatetopicrequest.md @@ -7,5 +7,5 @@ | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | | `apiKey` | *string* | :heavy_check_mark: | N/A | | `apiUsername` | *string* | :heavy_check_mark: | N/A | -| `id` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.UpdateTopicRequestBody](../../../sdk/models/operations/updatetopicrequestbody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `requestBody` | [operations.UpdateTopicRequestBody](../../../sdk/models/operations/updatetopicrequestbody.md) | :heavy_minus_sign: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/updatetopicresponse.md b/docs/sdk/models/operations/updatetopicresponse.md deleted file mode 100644 index d94b788..0000000 --- a/docs/sdk/models/operations/updatetopicresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdateTopicResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.UpdateTopicResponseBody](../../../sdk/models/operations/updatetopicresponsebody.md) | :heavy_minus_sign: | topic updated | \ No newline at end of file diff --git a/docs/sdk/models/operations/updatetopicstatusrequest.md b/docs/sdk/models/operations/updatetopicstatusrequest.md index c97f982..55f1b26 100644 --- a/docs/sdk/models/operations/updatetopicstatusrequest.md +++ b/docs/sdk/models/operations/updatetopicstatusrequest.md @@ -7,5 +7,5 @@ | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | | `apiKey` | *string* | :heavy_check_mark: | N/A | | `apiUsername` | *string* | :heavy_check_mark: | N/A | -| `id` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.UpdateTopicStatusRequestBody](../../../sdk/models/operations/updatetopicstatusrequestbody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `requestBody` | [operations.UpdateTopicStatusRequestBody](../../../sdk/models/operations/updatetopicstatusrequestbody.md) | :heavy_minus_sign: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/updatetopicstatusresponse.md b/docs/sdk/models/operations/updatetopicstatusresponse.md deleted file mode 100644 index d0cf3f3..0000000 --- a/docs/sdk/models/operations/updatetopicstatusresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdateTopicStatusResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.UpdateTopicStatusResponseBody](../../../sdk/models/operations/updatetopicstatusresponsebody.md) | :heavy_minus_sign: | topic updated | \ No newline at end of file diff --git a/docs/sdk/models/operations/updatetopictimestamprequest.md b/docs/sdk/models/operations/updatetopictimestamprequest.md index 4d19312..ac17a3d 100644 --- a/docs/sdk/models/operations/updatetopictimestamprequest.md +++ b/docs/sdk/models/operations/updatetopictimestamprequest.md @@ -7,5 +7,5 @@ | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | | `apiKey` | *string* | :heavy_check_mark: | N/A | | `apiUsername` | *string* | :heavy_check_mark: | N/A | -| `id` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.UpdateTopicTimestampRequestBody](../../../sdk/models/operations/updatetopictimestamprequestbody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `requestBody` | [operations.UpdateTopicTimestampRequestBody](../../../sdk/models/operations/updatetopictimestamprequestbody.md) | :heavy_minus_sign: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/updatetopictimestampresponse.md b/docs/sdk/models/operations/updatetopictimestampresponse.md deleted file mode 100644 index c6239df..0000000 --- a/docs/sdk/models/operations/updatetopictimestampresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdateTopicTimestampResponse - - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.UpdateTopicTimestampResponseBody](../../../sdk/models/operations/updatetopictimestampresponsebody.md) | :heavy_minus_sign: | topic updated | \ No newline at end of file diff --git a/docs/sdk/models/operations/updateusernamerequest.md b/docs/sdk/models/operations/updateusernamerequest.md index 1296f9c..2e5dc69 100644 --- a/docs/sdk/models/operations/updateusernamerequest.md +++ b/docs/sdk/models/operations/updateusernamerequest.md @@ -5,5 +5,5 @@ | Field | Type | Required | Description | | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -| `username` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.UpdateUsernameRequestBody](../../../sdk/models/operations/updateusernamerequestbody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `requestBody` | [operations.UpdateUsernameRequestBody](../../../sdk/models/operations/updateusernamerequestbody.md) | :heavy_minus_sign: | N/A | +| `username` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/updateusernameresponse.md b/docs/sdk/models/operations/updateusernameresponse.md deleted file mode 100644 index 9582808..0000000 --- a/docs/sdk/models/operations/updateusernameresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# UpdateUsernameResponse - - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/sdk/models/operations/updateuserrequest.md b/docs/sdk/models/operations/updateuserrequest.md index 31febd8..ead8cae 100644 --- a/docs/sdk/models/operations/updateuserrequest.md +++ b/docs/sdk/models/operations/updateuserrequest.md @@ -7,5 +7,5 @@ | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | | `apiKey` | *string* | :heavy_check_mark: | N/A | | `apiUsername` | *string* | :heavy_check_mark: | N/A | -| `username` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.UpdateUserRequestBody](../../../sdk/models/operations/updateuserrequestbody.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `requestBody` | [operations.UpdateUserRequestBody](../../../sdk/models/operations/updateuserrequestbody.md) | :heavy_minus_sign: | N/A | +| `username` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/updateuserresponse.md b/docs/sdk/models/operations/updateuserresponse.md deleted file mode 100644 index 36f079b..0000000 --- a/docs/sdk/models/operations/updateuserresponse.md +++ /dev/null @@ -1,11 +0,0 @@ -# UpdateUserResponse - - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `contentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | -| `statusCode` | *number* | :heavy_check_mark: | HTTP response status code for this operation | -| `rawResponse` | [AxiosResponse](https://axios-http.com/docs/res_schema) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `object` | [operations.UpdateUserResponseBody](../../../sdk/models/operations/updateuserresponsebody.md) | :heavy_minus_sign: | user updated | \ No newline at end of file diff --git a/docs/sdks/admin/README.md b/docs/sdks/admin/README.md index 49ffa19..0091ef1 100644 --- a/docs/sdks/admin/README.md +++ b/docs/sdks/admin/README.md @@ -22,17 +22,14 @@ Activate a user ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { ActivateUserRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: number = 203554; + const result = await sdk.admin.activateUser(203554); - const res = await sdk.admin.activateUser(id); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -40,15 +37,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `id` | *number* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *number* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.ActivateUserResponse](../../sdk/models/operations/activateuserresponse.md)>** +**Promise\<[operations.ActivateUserResponseBody](../../sdk/models/operations/activateuserresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -63,17 +62,14 @@ Get a user by id ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { AdminGetUserRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: number = 386776; + const result = await sdk.admin.adminGetUser(386776); - const res = await sdk.admin.adminGetUser(id); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -81,15 +77,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `id` | *number* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *number* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.AdminGetUserResponse](../../sdk/models/operations/admingetuserresponse.md)>** +**Promise\<[operations.AdminGetUserResponseBody](../../sdk/models/operations/admingetuserresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -104,18 +102,16 @@ Get a list of users ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { Flag, QueryParamAsc, QueryParamOrder } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); - - const res = await sdk.admin.adminListUsers({ - flag: Flag.New, + const result = await sdk.admin.adminListUsers({ + flag: "new", }); - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -123,15 +119,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `request` | [operations.AdminListUsersRequest](../../sdk/models/operations/adminlistusersrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.AdminListUsersRequest](../../sdk/models/operations/adminlistusersrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.AdminListUsersResponse](../../sdk/models/operations/adminlistusersresponse.md)>** +**Promise\<[operations.AdminListUsersResponseBody[]](../../models/.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -146,17 +144,14 @@ Anonymize a user ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { AnonymizeUserRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: number = 418778; + const result = await sdk.admin.anonymizeUser(418778); - const res = await sdk.admin.anonymizeUser(id); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -164,15 +159,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `id` | *number* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *number* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.AnonymizeUserResponse](../../sdk/models/operations/anonymizeuserresponse.md)>** +**Promise\<[operations.AnonymizeUserResponseBody](../../sdk/models/operations/anonymizeuserresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -187,17 +184,14 @@ Deactivate a user ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { DeactivateUserRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: number = 143950; + const result = await sdk.admin.deactivateUser(143950); - const res = await sdk.admin.deactivateUser(id); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -205,15 +199,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `id` | *number* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *number* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.DeactivateUserResponse](../../sdk/models/operations/deactivateuserresponse.md)>** +**Promise\<[operations.DeactivateUserResponseBody](../../sdk/models/operations/deactivateuserresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -228,18 +224,14 @@ Delete a user ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { DeleteUserRequest, DeleteUserRequestBody } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: number = 251343; -const requestBody: DeleteUserRequestBody = {}; + const result = await sdk.admin.deleteUser(251343); - const res = await sdk.admin.deleteUser(id, requestBody); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -247,16 +239,18 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `id` | *number* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.DeleteUserRequestBody](../../sdk/models/operations/deleteuserrequestbody.md) | :heavy_minus_sign: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *number* | :heavy_check_mark: | N/A | +| `requestBody` | [operations.DeleteUserRequestBody](../../sdk/models/operations/deleteuserrequestbody.md) | :heavy_minus_sign: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.DeleteUserResponse](../../sdk/models/operations/deleteuserresponse.md)>** +**Promise\<[operations.DeleteUserResponseBody](../../sdk/models/operations/deleteuserresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -271,17 +265,14 @@ Log a user out ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { LogOutUserRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: number = 379568; + const result = await sdk.admin.logOutUser(379568); - const res = await sdk.admin.logOutUser(id); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -289,15 +280,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `id` | *number* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *number* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.LogOutUserResponse](../../sdk/models/operations/logoutuserresponse.md)>** +**Promise\<[operations.LogOutUserResponseBody](../../sdk/models/operations/logoutuserresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -312,17 +305,14 @@ Refresh gravatar ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { RefreshGravatarRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const username: string = ""; + const result = await sdk.admin.refreshGravatar(""); - const res = await sdk.admin.refreshGravatar(username); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -330,15 +320,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `username` | *string* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `username` | *string* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.RefreshGravatarResponse](../../sdk/models/operations/refreshgravatarresponse.md)>** +**Promise\<[operations.RefreshGravatarResponseBody](../../sdk/models/operations/refreshgravatarresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -353,21 +345,17 @@ Silence a user ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { SilenceUserRequest, SilenceUserRequestBody } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: number = 606247; -const requestBody: SilenceUserRequestBody = { - postAction: "delete", - silencedTill: "2022-06-01T08:00:00.000Z", -}; + const result = await sdk.admin.silenceUser(606247, { + postAction: "delete", + silencedTill: "2022-06-01T08:00:00.000Z", + }); - const res = await sdk.admin.silenceUser(id, requestBody); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -375,16 +363,18 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `id` | *number* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.SilenceUserRequestBody](../../sdk/models/operations/silenceuserrequestbody.md) | :heavy_minus_sign: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *number* | :heavy_check_mark: | N/A | +| `requestBody` | [operations.SilenceUserRequestBody](../../sdk/models/operations/silenceuserrequestbody.md) | :heavy_minus_sign: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.SilenceUserResponse](../../sdk/models/operations/silenceuserresponse.md)>** +**Promise\<[operations.SilenceUserResponseBody](../../sdk/models/operations/silenceuserresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -399,22 +389,18 @@ Suspend a user ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { SuspendUserRequest, SuspendUserRequestBody } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: number = 970832; -const requestBody: SuspendUserRequestBody = { - postAction: "delete", - reason: "", - suspendUntil: "2121-02-22", -}; + const result = await sdk.admin.suspendUser(970832, { + postAction: "delete", + reason: "", + suspendUntil: "2121-02-22", + }); - const res = await sdk.admin.suspendUser(id, requestBody); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -422,16 +408,18 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `id` | *number* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.SuspendUserRequestBody](../../sdk/models/operations/suspenduserrequestbody.md) | :heavy_minus_sign: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *number* | :heavy_check_mark: | N/A | +| `requestBody` | [operations.SuspendUserRequestBody](../../sdk/models/operations/suspenduserrequestbody.md) | :heavy_minus_sign: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.SuspendUserResponse](../../sdk/models/operations/suspenduserresponse.md)>** +**Promise\<[operations.SuspendUserResponseBody](../../sdk/models/operations/suspenduserresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/backups/README.md b/docs/sdks/backups/README.md index c10ec1b..cb671fb 100644 --- a/docs/sdks/backups/README.md +++ b/docs/sdks/backups/README.md @@ -17,16 +17,13 @@ Create backup ```typescript import { SDK } from "@lukehagar/discoursejs"; +const sdk = new SDK(); + async function run() { - const sdk = new SDK(); + const result = await sdk.backups.createBackup(); - const res = await sdk.backups.createBackup({ - withUploads: false, - }); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -34,15 +31,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `request` | [operations.CreateBackupRequestBody](../../sdk/models/operations/createbackuprequestbody.md) | :heavy_check_mark: | The request object to use for the request. | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateBackupRequestBody](../../sdk/models/operations/createbackuprequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.CreateBackupResponse](../../sdk/models/operations/createbackupresponse.md)>** +**Promise\<[operations.CreateBackupResponseBody](../../sdk/models/operations/createbackupresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -57,18 +56,13 @@ Download backup ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { DownloadBackupRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const filename: string = ""; -const token: string = ""; + await sdk.backups.downloadBackup("", ""); - const res = await sdk.backups.downloadBackup(filename, token); - - if (res.statusCode == 200) { - // handle response - } + } run(); @@ -76,16 +70,18 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `filename` | *string* | :heavy_check_mark: | N/A | -| `token` | *string* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `filename` | *string* | :heavy_check_mark: | N/A | +| `token` | *string* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.DownloadBackupResponse](../../sdk/models/operations/downloadbackupresponse.md)>** +**Promise\** ### Errors | Error Object | Status Code | Content Type | @@ -101,14 +97,13 @@ List backups ```typescript import { SDK } from "@lukehagar/discoursejs"; +const sdk = new SDK(); + async function run() { - const sdk = new SDK(); + const result = await sdk.backups.getBackups(); - const res = await sdk.backups.getBackups(); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -116,14 +111,16 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.GetBackupsResponse](../../sdk/models/operations/getbackupsresponse.md)>** +**Promise\<[operations.ResponseBody[]](../../models/.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -138,17 +135,13 @@ Send download backup email ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { SendDownloadBackupEmailRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const filename: string = ""; + await sdk.backups.sendDownloadBackupEmail(""); - const res = await sdk.backups.sendDownloadBackupEmail(filename); - - if (res.statusCode == 200) { - // handle response - } + } run(); @@ -156,15 +149,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `filename` | *string* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `filename` | *string* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.SendDownloadBackupEmailResponse](../../sdk/models/operations/senddownloadbackupemailresponse.md)>** +**Promise\** ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/badges/README.md b/docs/sdks/badges/README.md index b631f51..f57d608 100644 --- a/docs/sdks/badges/README.md +++ b/docs/sdks/badges/README.md @@ -18,14 +18,13 @@ List badges ```typescript import { SDK } from "@lukehagar/discoursejs"; +const sdk = new SDK(); + async function run() { - const sdk = new SDK(); + const result = await sdk.badges.adminListBadges(); - const res = await sdk.badges.adminListBadges(); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -33,14 +32,16 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.AdminListBadgesResponse](../../sdk/models/operations/adminlistbadgesresponse.md)>** +**Promise\<[operations.AdminListBadgesResponseBody](../../sdk/models/operations/adminlistbadgesresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -56,17 +57,13 @@ Create badge ```typescript import { SDK } from "@lukehagar/discoursejs"; +const sdk = new SDK(); + async function run() { - const sdk = new SDK(); + const result = await sdk.badges.createBadge(); - const res = await sdk.badges.createBadge({ - badgeTypeId: 190613, - name: "", - }); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -74,15 +71,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateBadgeRequestBody](../../sdk/models/operations/createbadgerequestbody.md) | :heavy_check_mark: | The request object to use for the request. | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateBadgeRequestBody](../../sdk/models/operations/createbadgerequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.CreateBadgeResponse](../../sdk/models/operations/createbadgeresponse.md)>** +**Promise\<[operations.CreateBadgeResponseBody](../../sdk/models/operations/createbadgeresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -97,17 +96,13 @@ Delete badge ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { DeleteBadgeRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: number = 32345; + await sdk.badges.deleteBadge(32345); - const res = await sdk.badges.deleteBadge(id); - - if (res.statusCode == 200) { - // handle response - } + } run(); @@ -115,15 +110,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `id` | *number* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *number* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.DeleteBadgeResponse](../../sdk/models/operations/deletebadgeresponse.md)>** +**Promise\** ### Errors | Error Object | Status Code | Content Type | @@ -138,17 +135,14 @@ List badges for a user ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { ListUserBadgesRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const username: string = ""; + const result = await sdk.badges.listUserBadges(""); - const res = await sdk.badges.listUserBadges(username); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -156,15 +150,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `username` | *string* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `username` | *string* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.ListUserBadgesResponse](../../sdk/models/operations/listuserbadgesresponse.md)>** +**Promise\<[operations.ListUserBadgesResponseBody](../../sdk/models/operations/listuserbadgesresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -179,21 +175,14 @@ Update badge ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { UpdateBadgeRequest, UpdateBadgeRequestBody } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: number = 280628; -const requestBody: UpdateBadgeRequestBody = { - badgeTypeId: 568845, - name: "", -}; + const result = await sdk.badges.updateBadge(280628); - const res = await sdk.badges.updateBadge(id, requestBody); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -201,16 +190,18 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `id` | *number* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.UpdateBadgeRequestBody](../../sdk/models/operations/updatebadgerequestbody.md) | :heavy_minus_sign: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *number* | :heavy_check_mark: | N/A | +| `requestBody` | [operations.UpdateBadgeRequestBody](../../sdk/models/operations/updatebadgerequestbody.md) | :heavy_minus_sign: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.UpdateBadgeResponse](../../sdk/models/operations/updatebadgeresponse.md)>** +**Promise\<[operations.UpdateBadgeResponseBody](../../sdk/models/operations/updatebadgeresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/categories/README.md b/docs/sdks/categories/README.md index fdbc481..d62b2ce 100644 --- a/docs/sdks/categories/README.md +++ b/docs/sdks/categories/README.md @@ -19,24 +19,20 @@ Creates a category ```typescript import { SDK } from "@lukehagar/discoursejs"; -async function run() { - const sdk = new SDK(); +const sdk = new SDK(); - const res = await sdk.categories.createCategory({ +async function run() { + const result = await sdk.categories.createCategory({ color: "49d9e9", - formTemplateIds: [ - "", - ], name: "", permissions: { - "key": "", + everyone: 1, }, textColor: "f0fcfd", }); - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -44,15 +40,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateCategoryRequestBody](../../sdk/models/operations/createcategoryrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateCategoryRequestBody](../../sdk/models/operations/createcategoryrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.CreateCategoryResponse](../../sdk/models/operations/createcategoryresponse.md)>** +**Promise\<[operations.CreateCategoryResponseBody](../../sdk/models/operations/createcategoryresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -67,17 +65,14 @@ Show category ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { GetCategoryRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: number = 39147; + const result = await sdk.categories.getCategory(39147); - const res = await sdk.categories.getCategory(id); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -85,15 +80,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `id` | *number* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *number* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.GetCategoryResponse](../../sdk/models/operations/getcategoryresponse.md)>** +**Promise\<[operations.GetCategoryResponseBody](../../sdk/models/operations/getcategoryresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -109,14 +106,13 @@ Can be used to fetch all categories and subcategories ```typescript import { SDK } from "@lukehagar/discoursejs"; +const sdk = new SDK(); + async function run() { - const sdk = new SDK(); + const result = await sdk.categories.getSite(); - const res = await sdk.categories.getSite(); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -124,14 +120,16 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.GetSiteResponse](../../sdk/models/operations/getsiteresponse.md)>** +**Promise\<[operations.GetSiteResponseBody](../../sdk/models/operations/getsiteresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -146,17 +144,14 @@ Retrieves a list of categories ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { ListCategoriesRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const includeSubcategories: boolean = false; + const result = await sdk.categories.listCategories(); - const res = await sdk.categories.listCategories(includeSubcategories); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -164,15 +159,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `includeSubcategories` | *boolean* | :heavy_minus_sign: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `includeSubcategories` | *boolean* | :heavy_minus_sign: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.ListCategoriesResponse](../../sdk/models/operations/listcategoriesresponse.md)>** +**Promise\<[operations.ListCategoriesResponseBody](../../sdk/models/operations/listcategoriesresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -187,18 +184,14 @@ List topics ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { ListCategoryTopicsRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: number = 394133; -const slug: string = ""; + const result = await sdk.categories.listCategoryTopics(394133, ""); - const res = await sdk.categories.listCategoryTopics(id, slug); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -206,16 +199,18 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `id` | *number* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *number* | :heavy_check_mark: | N/A | +| `slug` | *string* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.ListCategoryTopicsResponse](../../sdk/models/operations/listcategorytopicsresponse.md)>** +**Promise\<[operations.ListCategoryTopicsResponseBody](../../sdk/models/operations/listcategorytopicsresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -230,28 +225,21 @@ Updates a category ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { UpdateCategoryRequest, UpdateCategoryRequestBody } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: number = 353500; -const requestBody: UpdateCategoryRequestBody = { - color: "49d9e9", - formTemplateIds: [ - "", - ], - name: "", - permissions: { - "key": "", - }, - textColor: "f0fcfd", -}; + const result = await sdk.categories.updateCategory(353500, { + color: "49d9e9", + name: "", + permissions: { + everyone: 1, + }, + textColor: "f0fcfd", + }); - const res = await sdk.categories.updateCategory(id, requestBody); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -259,16 +247,18 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `id` | *number* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.UpdateCategoryRequestBody](../../sdk/models/operations/updatecategoryrequestbody.md) | :heavy_minus_sign: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *number* | :heavy_check_mark: | N/A | +| `requestBody` | [operations.UpdateCategoryRequestBody](../../sdk/models/operations/updatecategoryrequestbody.md) | :heavy_minus_sign: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.UpdateCategoryResponse](../../sdk/models/operations/updatecategoryresponse.md)>** +**Promise\<[operations.UpdateCategoryResponseBody](../../sdk/models/operations/updatecategoryresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/groups/README.md b/docs/sdks/groups/README.md index 1ad388a..41f1996 100644 --- a/docs/sdks/groups/README.md +++ b/docs/sdks/groups/README.md @@ -20,20 +20,16 @@ Add group members ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { AddGroupMembersRequest, AddGroupMembersRequestBody } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: number = 985975; -const requestBody: AddGroupMembersRequestBody = { - usernames: "username1,username2", -}; + const result = await sdk.groups.addGroupMembers(985975, { + usernames: "username1,username2", + }); - const res = await sdk.groups.addGroupMembers(id, requestBody); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -41,16 +37,18 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `id` | *number* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.AddGroupMembersRequestBody](../../sdk/models/operations/addgroupmembersrequestbody.md) | :heavy_minus_sign: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *number* | :heavy_check_mark: | N/A | +| `requestBody` | [operations.AddGroupMembersRequestBody](../../sdk/models/operations/addgroupmembersrequestbody.md) | :heavy_minus_sign: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.AddGroupMembersResponse](../../sdk/models/operations/addgroupmembersresponse.md)>** +**Promise\<[operations.AddGroupMembersResponseBody](../../sdk/models/operations/addgroupmembersresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -66,33 +64,13 @@ Create a group ```typescript import { SDK } from "@lukehagar/discoursejs"; +const sdk = new SDK(); + async function run() { - const sdk = new SDK(); + const result = await sdk.groups.createGroup(); - const res = await sdk.groups.createGroup({ - group: { - mutedCategoryIds: [ - 385163, - ], - name: "", - regularCategoryIds: [ - 723588, - ], - trackingCategoryIds: [ - 835377, - ], - watchingCategoryIds: [ - 370420, - ], - watchingFirstPostCategoryIds: [ - 831661, - ], - }, - }); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -100,15 +78,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateGroupRequestBody](../../sdk/models/operations/creategrouprequestbody.md) | :heavy_check_mark: | The request object to use for the request. | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateGroupRequestBody](../../sdk/models/operations/creategrouprequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.CreateGroupResponse](../../sdk/models/operations/creategroupresponse.md)>** +**Promise\<[operations.CreateGroupResponseBody](../../sdk/models/operations/creategroupresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -123,17 +103,14 @@ Delete a group ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { DeleteGroupRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: number = 21302; + const result = await sdk.groups.deleteGroup(21302); - const res = await sdk.groups.deleteGroup(id); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -141,15 +118,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `id` | *number* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *number* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.DeleteGroupResponse](../../sdk/models/operations/deletegroupresponse.md)>** +**Promise\<[operations.DeleteGroupResponseBody](../../sdk/models/operations/deletegroupresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -164,17 +143,14 @@ Get a group ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { GetGroupRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: string = "name"; + const result = await sdk.groups.getGroup("name"); - const res = await sdk.groups.getGroup(id); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -182,15 +158,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `id` | *string* | :heavy_check_mark: | Use group name instead of id | name | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *string* | :heavy_check_mark: | Use group name instead of id | [object Object] | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | +| `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. | | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | | ### Response -**Promise<[operations.GetGroupResponse](../../sdk/models/operations/getgroupresponse.md)>** +**Promise\<[operations.GetGroupResponseBody](../../sdk/models/operations/getgroupresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -205,17 +183,14 @@ List group members ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { ListGroupMembersRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: string = "name"; + const result = await sdk.groups.listGroupMembers("name"); - const res = await sdk.groups.listGroupMembers(id); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -223,15 +198,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `id` | *string* | :heavy_check_mark: | Use group name instead of id | name | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | | +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *string* | :heavy_check_mark: | Use group name instead of id | [object Object] | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | +| `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. | | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | | ### Response -**Promise<[operations.ListGroupMembersResponse](../../sdk/models/operations/listgroupmembersresponse.md)>** +**Promise\<[operations.ListGroupMembersResponseBody](../../sdk/models/operations/listgroupmembersresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -247,14 +224,13 @@ List groups ```typescript import { SDK } from "@lukehagar/discoursejs"; +const sdk = new SDK(); + async function run() { - const sdk = new SDK(); + const result = await sdk.groups.listGroups(); - const res = await sdk.groups.listGroups(); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -262,14 +238,16 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.ListGroupsResponse](../../sdk/models/operations/listgroupsresponse.md)>** +**Promise\<[operations.ListGroupsResponseBody](../../sdk/models/operations/listgroupsresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -284,20 +262,16 @@ Remove group members ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { RemoveGroupMembersRequest, RemoveGroupMembersRequestBody } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: number = 649523; -const requestBody: RemoveGroupMembersRequestBody = { - usernames: "username1,username2", -}; + const result = await sdk.groups.removeGroupMembers(649523, { + usernames: "username1,username2", + }); - const res = await sdk.groups.removeGroupMembers(id, requestBody); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -305,16 +279,18 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -| `id` | *number* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.RemoveGroupMembersRequestBody](../../sdk/models/operations/removegroupmembersrequestbody.md) | :heavy_minus_sign: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *number* | :heavy_check_mark: | N/A | +| `requestBody` | [operations.RemoveGroupMembersRequestBody](../../sdk/models/operations/removegroupmembersrequestbody.md) | :heavy_minus_sign: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.RemoveGroupMembersResponse](../../sdk/models/operations/removegroupmembersresponse.md)>** +**Promise\<[operations.RemoveGroupMembersResponseBody](../../sdk/models/operations/removegroupmembersresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -329,37 +305,14 @@ Update a group ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { UpdateGroupGroup, UpdateGroupRequest, UpdateGroupRequestBody } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: number = 438471; -const requestBody: UpdateGroupRequestBody = { - group: { - mutedCategoryIds: [ - 244551, - ], - name: "", - regularCategoryIds: [ - 750192, - ], - trackingCategoryIds: [ - 733973, - ], - watchingCategoryIds: [ - 485153, - ], - watchingFirstPostCategoryIds: [ - 710652, - ], - }, -}; + const result = await sdk.groups.updateGroup(438471); - const res = await sdk.groups.updateGroup(id, requestBody); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -367,16 +320,18 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `id` | *number* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.UpdateGroupRequestBody](../../sdk/models/operations/updategrouprequestbody.md) | :heavy_minus_sign: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *number* | :heavy_check_mark: | N/A | +| `requestBody` | [operations.UpdateGroupRequestBody](../../sdk/models/operations/updategrouprequestbody.md) | :heavy_minus_sign: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.UpdateGroupResponse](../../sdk/models/operations/updategroupresponse.md)>** +**Promise\<[operations.UpdateGroupResponseBody](../../sdk/models/operations/updategroupresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/invites/README.md b/docs/sdks/invites/README.md index a59c541..74b5f94 100644 --- a/docs/sdks/invites/README.md +++ b/docs/sdks/invites/README.md @@ -14,24 +14,19 @@ Create an invite ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { CreateInviteRequest, CreateInviteRequestBody } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const apiKey: string = ""; -const apiUsername: string = ""; -const requestBody: CreateInviteRequestBody = { - email: "not-a-user-yet@example.com", - groupIds: "42,43", - groupNames: "foo,bar", - maxRedemptionsAllowed: 5, -}; + const result = await sdk.invites.createInvite("", "", { + email: "not-a-user-yet@example.com", + groupIds: "42,43", + groupNames: "foo,bar", + maxRedemptionsAllowed: 5, + }); - const res = await sdk.invites.createInvite(apiKey, apiUsername, requestBody); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -39,17 +34,19 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `apiKey` | *string* | :heavy_check_mark: | N/A | -| `apiUsername` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.CreateInviteRequestBody](../../sdk/models/operations/createinviterequestbody.md) | :heavy_minus_sign: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `apiKey` | *string* | :heavy_check_mark: | N/A | +| `apiUsername` | *string* | :heavy_check_mark: | N/A | +| `requestBody` | [operations.CreateInviteRequestBody](../../sdk/models/operations/createinviterequestbody.md) | :heavy_minus_sign: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.CreateInviteResponse](../../sdk/models/operations/createinviteresponse.md)>** +**Promise\<[operations.CreateInviteResponseBody](../../sdk/models/operations/createinviteresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -64,20 +61,14 @@ Invite to topic ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { InviteToTopicRequest, InviteToTopicRequestBody } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const apiKey: string = ""; -const apiUsername: string = ""; -const id: string = ""; -const requestBody: InviteToTopicRequestBody = {}; + const result = await sdk.invites.inviteToTopic("", "", ""); - const res = await sdk.invites.inviteToTopic(apiKey, apiUsername, id, requestBody); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -85,18 +76,20 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| `apiKey` | *string* | :heavy_check_mark: | N/A | -| `apiUsername` | *string* | :heavy_check_mark: | N/A | -| `id` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.InviteToTopicRequestBody](../../sdk/models/operations/invitetotopicrequestbody.md) | :heavy_minus_sign: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `apiKey` | *string* | :heavy_check_mark: | N/A | +| `apiUsername` | *string* | :heavy_check_mark: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | +| `requestBody` | [operations.InviteToTopicRequestBody](../../sdk/models/operations/invitetotopicrequestbody.md) | :heavy_minus_sign: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.InviteToTopicResponse](../../sdk/models/operations/invitetotopicresponse.md)>** +**Promise\<[operations.InviteToTopicResponseBody](../../sdk/models/operations/invitetotopicresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/notifications/README.md b/docs/sdks/notifications/README.md index 9a2a39c..1d6bf2d 100644 --- a/docs/sdks/notifications/README.md +++ b/docs/sdks/notifications/README.md @@ -15,14 +15,13 @@ Get the notifications that belong to the current user ```typescript import { SDK } from "@lukehagar/discoursejs"; +const sdk = new SDK(); + async function run() { - const sdk = new SDK(); + const result = await sdk.notifications.getNotifications(); - const res = await sdk.notifications.getNotifications(); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -30,14 +29,16 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.GetNotificationsResponse](../../sdk/models/operations/getnotificationsresponse.md)>** +**Promise\<[operations.GetNotificationsResponseBody](../../sdk/models/operations/getnotificationsresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -53,14 +54,13 @@ Mark notifications as read ```typescript import { SDK } from "@lukehagar/discoursejs"; +const sdk = new SDK(); + async function run() { - const sdk = new SDK(); + const result = await sdk.notifications.markNotificationsAsRead(); - const res = await sdk.notifications.markNotificationsAsRead({}); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -68,15 +68,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.MarkNotificationsAsReadRequestBody](../../sdk/models/operations/marknotificationsasreadrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.MarkNotificationsAsReadRequestBody](../../sdk/models/operations/marknotificationsasreadrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.MarkNotificationsAsReadResponse](../../sdk/models/operations/marknotificationsasreadresponse.md)>** +**Promise\<[operations.MarkNotificationsAsReadResponseBody](../../sdk/models/operations/marknotificationsasreadresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/posts/README.md b/docs/sdks/posts/README.md index 02b3197..2bdc7a6 100644 --- a/docs/sdks/posts/README.md +++ b/docs/sdks/posts/README.md @@ -21,18 +21,17 @@ Creates a new topic, a new post, or a private message ```typescript import { SDK } from "@lukehagar/discoursejs"; -async function run() { - const sdk = new SDK(); +const sdk = new SDK(); - const res = await sdk.posts.createTopicPostPM({ +async function run() { + const result = await sdk.posts.createTopicPostPM({ archetype: "private_message", raw: "", targetRecipients: "blake,sam", }); - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -40,15 +39,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateTopicPostPMRequestBody](../../sdk/models/operations/createtopicpostpmrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateTopicPostPMRequestBody](../../sdk/models/operations/createtopicpostpmrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.CreateTopicPostPMResponse](../../sdk/models/operations/createtopicpostpmresponse.md)>** +**Promise\<[operations.CreateTopicPostPMResponseBody](../../sdk/models/operations/createtopicpostpmresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -63,20 +64,15 @@ delete a single post ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { DeletePostRequest, DeletePostRequestBody } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: number = 188146; -const requestBody: DeletePostRequestBody = { - forceDestroy: true, -}; + await sdk.posts.deletePost(188146, { + forceDestroy: true, + }); - const res = await sdk.posts.deletePost(id, requestBody); - - if (res.statusCode == 200) { - // handle response - } + } run(); @@ -84,16 +80,18 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `id` | *number* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.DeletePostRequestBody](../../sdk/models/operations/deletepostrequestbody.md) | :heavy_minus_sign: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *number* | :heavy_check_mark: | N/A | +| `requestBody` | [operations.DeletePostRequestBody](../../sdk/models/operations/deletepostrequestbody.md) | :heavy_minus_sign: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.DeletePostResponse](../../sdk/models/operations/deletepostresponse.md)>** +**Promise\** ### Errors | Error Object | Status Code | Content Type | @@ -113,17 +111,14 @@ refer to various different flag types. ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { GetPostRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: string = ""; + const result = await sdk.posts.getPost(""); - const res = await sdk.posts.getPost(id); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -131,15 +126,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `id` | *string* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *string* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.GetPostResponse](../../sdk/models/operations/getpostresponse.md)>** +**Promise\<[operations.GetPostResponseBody](../../sdk/models/operations/getpostresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -154,19 +151,14 @@ List latest posts across topics ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { ListPostsRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const apiKey: string = ""; -const apiUsername: string = ""; -const before: string = ""; + const result = await sdk.posts.listPosts("", ""); - const res = await sdk.posts.listPosts(apiKey, apiUsername, before); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -174,17 +166,19 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `apiKey` | *string* | :heavy_check_mark: | N/A | -| `apiUsername` | *string* | :heavy_check_mark: | N/A | -| `before` | *string* | :heavy_minus_sign: | Load posts with an id lower than this value. Useful for pagination. | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `apiKey` | *string* | :heavy_check_mark: | N/A | +| `apiUsername` | *string* | :heavy_check_mark: | N/A | +| `before` | *string* | :heavy_minus_sign: | Load posts with an id lower than this value. Useful for pagination. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.ListPostsResponse](../../sdk/models/operations/listpostsresponse.md)>** +**Promise\<[operations.ListPostsResponseBody](../../sdk/models/operations/listpostsresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -199,22 +193,14 @@ Lock a post from being edited ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { LockPostRequest, LockPostRequestBody } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const apiKey: string = ""; -const apiUsername: string = ""; -const id: string = ""; -const requestBody: LockPostRequestBody = { - locked: "", -}; + const result = await sdk.posts.lockPost("", "", ""); - const res = await sdk.posts.lockPost(apiKey, apiUsername, id, requestBody); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -222,18 +208,20 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `apiKey` | *string* | :heavy_check_mark: | N/A | -| `apiUsername` | *string* | :heavy_check_mark: | N/A | -| `id` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.LockPostRequestBody](../../sdk/models/operations/lockpostrequestbody.md) | :heavy_minus_sign: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `apiKey` | *string* | :heavy_check_mark: | N/A | +| `apiUsername` | *string* | :heavy_check_mark: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | +| `requestBody` | [operations.LockPostRequestBody](../../sdk/models/operations/lockpostrequestbody.md) | :heavy_minus_sign: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.LockPostResponse](../../sdk/models/operations/lockpostresponse.md)>** +**Promise\<[operations.LockPostResponseBody](../../sdk/models/operations/lockpostresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -248,22 +236,14 @@ Like a post and other actions ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { PerformPostActionRequest, PerformPostActionRequestBody } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const apiKey: string = ""; -const apiUsername: string = ""; -const requestBody: PerformPostActionRequestBody = { - id: 315075, - postActionTypeId: 159481, -}; + const result = await sdk.posts.performPostAction("", ""); - const res = await sdk.posts.performPostAction(apiKey, apiUsername, requestBody); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -271,17 +251,19 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | -| `apiKey` | *string* | :heavy_check_mark: | N/A | -| `apiUsername` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.PerformPostActionRequestBody](../../sdk/models/operations/performpostactionrequestbody.md) | :heavy_minus_sign: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `apiKey` | *string* | :heavy_check_mark: | N/A | +| `apiUsername` | *string* | :heavy_check_mark: | N/A | +| `requestBody` | [operations.PerformPostActionRequestBody](../../sdk/models/operations/performpostactionrequestbody.md) | :heavy_minus_sign: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.PerformPostActionResponse](../../sdk/models/operations/performpostactionresponse.md)>** +**Promise\<[operations.PerformPostActionResponseBody](../../sdk/models/operations/performpostactionresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -296,17 +278,14 @@ List replies to a post ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { PostRepliesRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: string = ""; + const result = await sdk.posts.postReplies(""); - const res = await sdk.posts.postReplies(id); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -314,15 +293,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `id` | *string* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *string* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.PostRepliesResponse](../../sdk/models/operations/postrepliesresponse.md)>** +**Promise\<[operations.PostRepliesResponseBody[]](../../models/.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -337,22 +318,14 @@ Update a single post ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { Post, UpdatePostRequest, UpdatePostRequestBody } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: string = ""; -const requestBody: UpdatePostRequestBody = { - post: { - raw: "", - }, -}; + const result = await sdk.posts.updatePost(""); - const res = await sdk.posts.updatePost(id, requestBody); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -360,16 +333,18 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.UpdatePostRequestBody](../../sdk/models/operations/updatepostrequestbody.md) | :heavy_minus_sign: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *string* | :heavy_check_mark: | N/A | +| `requestBody` | [operations.UpdatePostRequestBody](../../sdk/models/operations/updatepostrequestbody.md) | :heavy_minus_sign: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.UpdatePostResponse](../../sdk/models/operations/updatepostresponse.md)>** +**Promise\<[operations.UpdatePostResponseBody](../../sdk/models/operations/updatepostresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/privatemessages/README.md b/docs/sdks/privatemessages/README.md index b44cd8b..321ae8d 100644 --- a/docs/sdks/privatemessages/README.md +++ b/docs/sdks/privatemessages/README.md @@ -16,18 +16,17 @@ Creates a new topic, a new post, or a private message ```typescript import { SDK } from "@lukehagar/discoursejs"; -async function run() { - const sdk = new SDK(); +const sdk = new SDK(); - const res = await sdk.privateMessages.createTopicPostPM({ +async function run() { + const result = await sdk.privateMessages.createTopicPostPM({ archetype: "private_message", raw: "", targetRecipients: "blake,sam", }); - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -35,15 +34,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateTopicPostPMRequestBody](../../sdk/models/operations/createtopicpostpmrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateTopicPostPMRequestBody](../../sdk/models/operations/createtopicpostpmrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.CreateTopicPostPMResponse](../../sdk/models/operations/createtopicpostpmresponse.md)>** +**Promise\<[operations.CreateTopicPostPMResponseBody](../../sdk/models/operations/createtopicpostpmresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -58,17 +59,14 @@ Get a list of private messages sent for a user ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { GetUserSentPrivateMessagesRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const username: string = ""; + const result = await sdk.privateMessages.getUserSentPrivateMessages(""); - const res = await sdk.privateMessages.getUserSentPrivateMessages(username); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -76,15 +74,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `username` | *string* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `username` | *string* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.GetUserSentPrivateMessagesResponse](../../sdk/models/operations/getusersentprivatemessagesresponse.md)>** +**Promise\<[operations.GetUserSentPrivateMessagesResponseBody](../../sdk/models/operations/getusersentprivatemessagesresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -99,17 +99,14 @@ Get a list of private messages for a user ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { ListUserPrivateMessagesRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const username: string = ""; + const result = await sdk.privateMessages.listUserPrivateMessages(""); - const res = await sdk.privateMessages.listUserPrivateMessages(username); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -117,15 +114,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `username` | *string* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `username` | *string* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.ListUserPrivateMessagesResponse](../../sdk/models/operations/listuserprivatemessagesresponse.md)>** +**Promise\<[operations.ListUserPrivateMessagesResponseBody](../../sdk/models/operations/listuserprivatemessagesresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/search/README.md b/docs/sdks/search/README.md index 7a3c267..dc20db1 100644 --- a/docs/sdks/search/README.md +++ b/docs/sdks/search/README.md @@ -13,18 +13,14 @@ Search for a term ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { SearchRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const page: number = 1; -const q: string = "api @blake #support tags:api after:2021-06-04 in:unseen in:open order:latest_topic"; + const result = await sdk.search.search(1, "api @blake #support tags:api after:2021-06-04 in:unseen in:open order:latest_topic"); - const res = await sdk.search.search(page, q); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -34,14 +30,16 @@ run(); | Parameter | Type | Required | Description | Example | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `page` | *number* | :heavy_minus_sign: | N/A | 1 | -| `q` | *string* | :heavy_minus_sign: | The query string needs to be url encoded and is made up of the following options:
- Search term. This is just a string. Usually it would be the first item in the query.
- `@`: Use the `@` followed by the username to specify posts by this user.
- `#`: Use the `#` followed by the category slug to search within this category.
- `tags:`: `api,solved` or for posts that have all the specified tags `api+solved`.
- `before:`: `yyyy-mm-dd`
- `after:`: `yyyy-mm-dd`
- `order:`: `latest`, `likes`, `views`, `latest_topic`
- `assigned:`: username (without `@`)
- `in:`: `title`, `likes`, `personal`, `messages`, `seen`, `unseen`, `posted`, `created`, `watching`, `tracking`, `bookmarks`, `assigned`, `unassigned`, `first`, `pinned`, `wiki`
- `with:`: `images`
- `status:`: `open`, `closed`, `public`, `archived`, `noreplies`, `single_user`, `solved`, `unsolved`
- `group:`: group_name or group_id
- `group_messages:`: group_name or group_id
- `min_posts:`: 1
- `max_posts:`: 10
- `min_views:`: 1
- `max_views:`: 10

If you are using cURL you can use the `-G` and the `--data-urlencode` flags to encode the query:

```
curl -i -sS -X GET -G "http://localhost:4200/search.json" \
--data-urlencode 'q=wordpress @scossar #fun after:2020-01-01'
```
| api @blake #support tags:api after:2021-06-04 in:unseen in:open order:latest_topic | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | | +| `page` | *number* | :heavy_minus_sign: | N/A | [object Object] | +| `q` | *string* | :heavy_minus_sign: | The query string needs to be url encoded and is made up of the following options:
- Search term. This is just a string. Usually it would be the first item in the query.
- `@`: Use the `@` followed by the username to specify posts by this user.
- `#`: Use the `#` followed by the category slug to search within this category.
- `tags:`: `api,solved` or for posts that have all the specified tags `api+solved`.
- `before:`: `yyyy-mm-dd`
- `after:`: `yyyy-mm-dd`
- `order:`: `latest`, `likes`, `views`, `latest_topic`
- `assigned:`: username (without `@`)
- `in:`: `title`, `likes`, `personal`, `messages`, `seen`, `unseen`, `posted`, `created`, `watching`, `tracking`, `bookmarks`, `assigned`, `unassigned`, `first`, `pinned`, `wiki`
- `with:`: `images`
- `status:`: `open`, `closed`, `public`, `archived`, `noreplies`, `single_user`, `solved`, `unsolved`
- `group:`: group_name or group_id
- `group_messages:`: group_name or group_id
- `min_posts:`: 1
- `max_posts:`: 10
- `min_views:`: 1
- `max_views:`: 10

If you are using cURL you can use the `-G` and the `--data-urlencode` flags to encode the query:

```
curl -i -sS -X GET -G "http://localhost:4200/search.json" \
--data-urlencode 'q=wordpress @scossar #fun after:2020-01-01'
```
| [object Object] | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | +| `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. | | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | | ### Response -**Promise<[operations.SearchResponse](../../sdk/models/operations/searchresponse.md)>** +**Promise\<[operations.SearchResponseBody](../../sdk/models/operations/searchresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/site/README.md b/docs/sdks/site/README.md index fea9d84..2b575ab 100644 --- a/docs/sdks/site/README.md +++ b/docs/sdks/site/README.md @@ -14,14 +14,13 @@ Can be used to fetch all categories and subcategories ```typescript import { SDK } from "@lukehagar/discoursejs"; +const sdk = new SDK(); + async function run() { - const sdk = new SDK(); + const result = await sdk.site.getSite(); - const res = await sdk.site.getSite(); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -29,14 +28,16 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.GetSiteResponse](../../sdk/models/operations/getsiteresponse.md)>** +**Promise\<[operations.GetSiteResponseBody](../../sdk/models/operations/getsiteresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/tags/README.md b/docs/sdks/tags/README.md index 1ab8998..c0dc0cf 100644 --- a/docs/sdks/tags/README.md +++ b/docs/sdks/tags/README.md @@ -19,16 +19,13 @@ Creates a tag group ```typescript import { SDK } from "@lukehagar/discoursejs"; +const sdk = new SDK(); + async function run() { - const sdk = new SDK(); + const result = await sdk.tags.createTagGroup(); - const res = await sdk.tags.createTagGroup({ - name: "", - }); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -36,15 +33,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateTagGroupRequestBody](../../sdk/models/operations/createtaggrouprequestbody.md) | :heavy_check_mark: | The request object to use for the request. | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateTagGroupRequestBody](../../sdk/models/operations/createtaggrouprequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.CreateTagGroupResponse](../../sdk/models/operations/createtaggroupresponse.md)>** +**Promise\<[operations.CreateTagGroupResponseBody](../../sdk/models/operations/createtaggroupresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -59,17 +58,14 @@ Get a specific tag ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { GetTagRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const name: string = ""; + const result = await sdk.tags.getTag(""); - const res = await sdk.tags.getTag(name); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -77,15 +73,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `name` | *string* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `name` | *string* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.GetTagResponse](../../sdk/models/operations/gettagresponse.md)>** +**Promise\<[operations.GetTagResponseBody](../../sdk/models/operations/gettagresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -100,17 +98,14 @@ Get a single tag group ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { GetTagGroupRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: string = ""; + const result = await sdk.tags.getTagGroup(""); - const res = await sdk.tags.getTagGroup(id); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -118,15 +113,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `id` | *string* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *string* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.GetTagGroupResponse](../../sdk/models/operations/gettaggroupresponse.md)>** +**Promise\<[operations.GetTagGroupResponseBody](../../sdk/models/operations/gettaggroupresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -142,14 +139,13 @@ Get a list of tag groups ```typescript import { SDK } from "@lukehagar/discoursejs"; +const sdk = new SDK(); + async function run() { - const sdk = new SDK(); + const result = await sdk.tags.listTagGroups(); - const res = await sdk.tags.listTagGroups(); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -157,14 +153,16 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.ListTagGroupsResponse](../../sdk/models/operations/listtaggroupsresponse.md)>** +**Promise\<[operations.ListTagGroupsResponseBody](../../sdk/models/operations/listtaggroupsresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -180,14 +178,13 @@ Get a list of tags ```typescript import { SDK } from "@lukehagar/discoursejs"; +const sdk = new SDK(); + async function run() { - const sdk = new SDK(); + const result = await sdk.tags.listTags(); - const res = await sdk.tags.listTags(); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -195,14 +192,16 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.ListTagsResponse](../../sdk/models/operations/listtagsresponse.md)>** +**Promise\<[operations.ListTagsResponseBody](../../sdk/models/operations/listtagsresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -217,18 +216,14 @@ Update tag group ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { UpdateTagGroupRequest, UpdateTagGroupRequestBody } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: string = ""; -const requestBody: UpdateTagGroupRequestBody = {}; + const result = await sdk.tags.updateTagGroup(""); - const res = await sdk.tags.updateTagGroup(id, requestBody); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -236,16 +231,18 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `id` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.UpdateTagGroupRequestBody](../../sdk/models/operations/updatetaggrouprequestbody.md) | :heavy_minus_sign: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *string* | :heavy_check_mark: | N/A | +| `requestBody` | [operations.UpdateTagGroupRequestBody](../../sdk/models/operations/updatetaggrouprequestbody.md) | :heavy_minus_sign: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.UpdateTagGroupResponse](../../sdk/models/operations/updatetaggroupresponse.md)>** +**Promise\<[operations.UpdateTagGroupResponseBody](../../sdk/models/operations/updatetaggroupresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/topics/README.md b/docs/sdks/topics/README.md index 3233a73..add4faf 100644 --- a/docs/sdks/topics/README.md +++ b/docs/sdks/topics/README.md @@ -25,19 +25,13 @@ Bookmark topic ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { BookmarkTopicRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const apiKey: string = ""; -const apiUsername: string = ""; -const id: string = ""; + await sdk.topics.bookmarkTopic("", "", ""); - const res = await sdk.topics.bookmarkTopic(apiKey, apiUsername, id); - - if (res.statusCode == 200) { - // handle response - } + } run(); @@ -45,17 +39,19 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `apiKey` | *string* | :heavy_check_mark: | N/A | -| `apiUsername` | *string* | :heavy_check_mark: | N/A | -| `id` | *string* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `apiKey` | *string* | :heavy_check_mark: | N/A | +| `apiUsername` | *string* | :heavy_check_mark: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.BookmarkTopicResponse](../../sdk/models/operations/bookmarktopicresponse.md)>** +**Promise\** ### Errors | Error Object | Status Code | Content Type | @@ -71,18 +67,17 @@ Creates a new topic, a new post, or a private message ```typescript import { SDK } from "@lukehagar/discoursejs"; -async function run() { - const sdk = new SDK(); +const sdk = new SDK(); - const res = await sdk.topics.createTopicPostPM({ +async function run() { + const result = await sdk.topics.createTopicPostPM({ archetype: "private_message", raw: "", targetRecipients: "blake,sam", }); - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -90,15 +85,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateTopicPostPMRequestBody](../../sdk/models/operations/createtopicpostpmrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateTopicPostPMRequestBody](../../sdk/models/operations/createtopicpostpmrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.CreateTopicPostPMResponse](../../sdk/models/operations/createtopicpostpmresponse.md)>** +**Promise\<[operations.CreateTopicPostPMResponseBody](../../sdk/models/operations/createtopicpostpmresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -113,22 +110,16 @@ Create topic timer ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { CreateTopicTimerRequest, CreateTopicTimerRequestBody } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const apiKey: string = ""; -const apiUsername: string = ""; -const id: string = ""; -const requestBody: CreateTopicTimerRequestBody = { - time: "", -}; + const result = await sdk.topics.createTopicTimer("", "", "", { + time: "", + }); - const res = await sdk.topics.createTopicTimer(apiKey, apiUsername, id, requestBody); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -136,18 +127,20 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `apiKey` | *string* | :heavy_check_mark: | N/A | -| `apiUsername` | *string* | :heavy_check_mark: | N/A | -| `id` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.CreateTopicTimerRequestBody](../../sdk/models/operations/createtopictimerrequestbody.md) | :heavy_minus_sign: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `apiKey` | *string* | :heavy_check_mark: | N/A | +| `apiUsername` | *string* | :heavy_check_mark: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | +| `requestBody` | [operations.CreateTopicTimerRequestBody](../../sdk/models/operations/createtopictimerrequestbody.md) | :heavy_minus_sign: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.CreateTopicTimerResponse](../../sdk/models/operations/createtopictimerresponse.md)>** +**Promise\<[operations.CreateTopicTimerResponseBody](../../sdk/models/operations/createtopictimerresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -162,19 +155,14 @@ Get a single topic ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { GetTopicRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const apiKey: string = ""; -const apiUsername: string = ""; -const id: string = ""; + const result = await sdk.topics.getTopic("", "", ""); - const res = await sdk.topics.getTopic(apiKey, apiUsername, id); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -182,17 +170,19 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `apiKey` | *string* | :heavy_check_mark: | N/A | -| `apiUsername` | *string* | :heavy_check_mark: | N/A | -| `id` | *string* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `apiKey` | *string* | :heavy_check_mark: | N/A | +| `apiUsername` | *string* | :heavy_check_mark: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.GetTopicResponse](../../sdk/models/operations/gettopicresponse.md)>** +**Promise\<[operations.GetTopicResponseBody](../../sdk/models/operations/gettopicresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -207,17 +197,13 @@ Get topic by external_id ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { GetTopicByExternalIdRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const externalId: string = ""; + await sdk.topics.getTopicByExternalId(""); - const res = await sdk.topics.getTopicByExternalId(externalId); - - if (res.statusCode == 200) { - // handle response - } + } run(); @@ -225,15 +211,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `externalId` | *string* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `externalId` | *string* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.GetTopicByExternalIdResponse](../../sdk/models/operations/gettopicbyexternalidresponse.md)>** +**Promise\** ### Errors | Error Object | Status Code | Content Type | @@ -248,20 +236,14 @@ Invite to topic ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { InviteToTopicRequest, InviteToTopicRequestBody } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const apiKey: string = ""; -const apiUsername: string = ""; -const id: string = ""; -const requestBody: InviteToTopicRequestBody = {}; + const result = await sdk.topics.inviteToTopic("", "", ""); - const res = await sdk.topics.inviteToTopic(apiKey, apiUsername, id, requestBody); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -269,18 +251,20 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| `apiKey` | *string* | :heavy_check_mark: | N/A | -| `apiUsername` | *string* | :heavy_check_mark: | N/A | -| `id` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.InviteToTopicRequestBody](../../sdk/models/operations/invitetotopicrequestbody.md) | :heavy_minus_sign: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `apiKey` | *string* | :heavy_check_mark: | N/A | +| `apiUsername` | *string* | :heavy_check_mark: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | +| `requestBody` | [operations.InviteToTopicRequestBody](../../sdk/models/operations/invitetotopicrequestbody.md) | :heavy_minus_sign: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.InviteToTopicResponse](../../sdk/models/operations/invitetotopicresponse.md)>** +**Promise\<[operations.InviteToTopicResponseBody](../../sdk/models/operations/invitetotopicresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -295,20 +279,14 @@ Get the latest topics ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { ListLatestTopicsRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const apiKey: string = ""; -const apiUsername: string = ""; -const ascending: string = ""; -const order: string = ""; + const result = await sdk.topics.listLatestTopics("", ""); - const res = await sdk.topics.listLatestTopics(apiKey, apiUsername, ascending, order); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -316,18 +294,20 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `apiKey` | *string* | :heavy_check_mark: | N/A | -| `apiUsername` | *string* | :heavy_check_mark: | N/A | -| `ascending` | *string* | :heavy_minus_sign: | Defaults to `desc`, add `ascending=true` to sort asc | -| `order` | *string* | :heavy_minus_sign: | Enum: `default`, `created`, `activity`, `views`, `posts`, `category`, `likes`, `op_likes`, `posters` | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `apiKey` | *string* | :heavy_check_mark: | N/A | +| `apiUsername` | *string* | :heavy_check_mark: | N/A | +| `ascending` | *string* | :heavy_minus_sign: | Defaults to `desc`, add `ascending=true` to sort asc | +| `order` | *string* | :heavy_minus_sign: | Enum: `default`, `created`, `activity`, `views`, `posts`, `category`, `likes`, `op_likes`, `posters` | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.ListLatestTopicsResponse](../../sdk/models/operations/listlatesttopicsresponse.md)>** +**Promise\<[operations.ListLatestTopicsResponseBody](../../sdk/models/operations/listlatesttopicsresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -342,19 +322,14 @@ Get the top topics filtered by period ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { ListTopTopicsRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const apiKey: string = ""; -const apiUsername: string = ""; -const period: string = ""; + const result = await sdk.topics.listTopTopics("", ""); - const res = await sdk.topics.listTopTopics(apiKey, apiUsername, period); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -362,17 +337,19 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | -| `apiKey` | *string* | :heavy_check_mark: | N/A | -| `apiUsername` | *string* | :heavy_check_mark: | N/A | -| `period` | *string* | :heavy_minus_sign: | Enum: `all`, `yearly`, `quarterly`, `monthly`, `weekly`, `daily` | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `apiKey` | *string* | :heavy_check_mark: | N/A | +| `apiUsername` | *string* | :heavy_check_mark: | N/A | +| `period` | *string* | :heavy_minus_sign: | Enum: `all`, `yearly`, `quarterly`, `monthly`, `weekly`, `daily` | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.ListTopTopicsResponse](../../sdk/models/operations/listtoptopicsresponse.md)>** +**Promise\<[operations.ListTopTopicsResponseBody](../../sdk/models/operations/listtoptopicsresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -387,19 +364,13 @@ Remove a topic ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { RemoveTopicRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const apiKey: string = ""; -const apiUsername: string = ""; -const id: string = ""; + await sdk.topics.removeTopic("", "", ""); - const res = await sdk.topics.removeTopic(apiKey, apiUsername, id); - - if (res.statusCode == 200) { - // handle response - } + } run(); @@ -407,17 +378,19 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `apiKey` | *string* | :heavy_check_mark: | N/A | -| `apiUsername` | *string* | :heavy_check_mark: | N/A | -| `id` | *string* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `apiKey` | *string* | :heavy_check_mark: | N/A | +| `apiUsername` | *string* | :heavy_check_mark: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.RemoveTopicResponse](../../sdk/models/operations/removetopicresponse.md)>** +**Promise\** ### Errors | Error Object | Status Code | Content Type | @@ -432,22 +405,14 @@ Set notification level ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { NotificationLevel, SetNotificationLevelRequest, SetNotificationLevelRequestBody } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const apiKey: string = ""; -const apiUsername: string = ""; -const id: string = ""; -const requestBody: SetNotificationLevelRequestBody = { - notificationLevel: NotificationLevel.Two, -}; + const result = await sdk.topics.setNotificationLevel("", "", ""); - const res = await sdk.topics.setNotificationLevel(apiKey, apiUsername, id, requestBody); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -455,18 +420,20 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `apiKey` | *string* | :heavy_check_mark: | N/A | -| `apiUsername` | *string* | :heavy_check_mark: | N/A | -| `id` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.SetNotificationLevelRequestBody](../../sdk/models/operations/setnotificationlevelrequestbody.md) | :heavy_minus_sign: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `apiKey` | *string* | :heavy_check_mark: | N/A | +| `apiUsername` | *string* | :heavy_check_mark: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | +| `requestBody` | [operations.SetNotificationLevelRequestBody](../../sdk/models/operations/setnotificationlevelrequestbody.md) | :heavy_minus_sign: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.SetNotificationLevelResponse](../../sdk/models/operations/setnotificationlevelresponse.md)>** +**Promise\<[operations.SetNotificationLevelResponseBody](../../sdk/models/operations/setnotificationlevelresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -481,22 +448,14 @@ Update a topic ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { Topic, UpdateTopicRequest, UpdateTopicRequestBody } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const apiKey: string = ""; -const apiUsername: string = ""; -const id: string = ""; -const requestBody: UpdateTopicRequestBody = { - topic: {}, -}; + const result = await sdk.topics.updateTopic("", "", ""); - const res = await sdk.topics.updateTopic(apiKey, apiUsername, id, requestBody); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -504,18 +463,20 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `apiKey` | *string* | :heavy_check_mark: | N/A | -| `apiUsername` | *string* | :heavy_check_mark: | N/A | -| `id` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.UpdateTopicRequestBody](../../sdk/models/operations/updatetopicrequestbody.md) | :heavy_minus_sign: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `apiKey` | *string* | :heavy_check_mark: | N/A | +| `apiUsername` | *string* | :heavy_check_mark: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | +| `requestBody` | [operations.UpdateTopicRequestBody](../../sdk/models/operations/updatetopicrequestbody.md) | :heavy_minus_sign: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.UpdateTopicResponse](../../sdk/models/operations/updatetopicresponse.md)>** +**Promise\<[operations.UpdateTopicResponseBody](../../sdk/models/operations/updatetopicresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -530,24 +491,18 @@ Update the status of a topic ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { Enabled, Status, UpdateTopicStatusRequest, UpdateTopicStatusRequestBody } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const apiKey: string = ""; -const apiUsername: string = ""; -const id: string = ""; -const requestBody: UpdateTopicStatusRequestBody = { - enabled: Enabled.False, - status: Status.PinnedGlobally, - until: "2030-12-31", -}; + const result = await sdk.topics.updateTopicStatus("", "", "", { + enabled: "false", + status: "pinned_globally", + until: "2030-12-31", + }); - const res = await sdk.topics.updateTopicStatus(apiKey, apiUsername, id, requestBody); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -555,18 +510,20 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | -| `apiKey` | *string* | :heavy_check_mark: | N/A | -| `apiUsername` | *string* | :heavy_check_mark: | N/A | -| `id` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.UpdateTopicStatusRequestBody](../../sdk/models/operations/updatetopicstatusrequestbody.md) | :heavy_minus_sign: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `apiKey` | *string* | :heavy_check_mark: | N/A | +| `apiUsername` | *string* | :heavy_check_mark: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | +| `requestBody` | [operations.UpdateTopicStatusRequestBody](../../sdk/models/operations/updatetopicstatusrequestbody.md) | :heavy_minus_sign: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.UpdateTopicStatusResponse](../../sdk/models/operations/updatetopicstatusresponse.md)>** +**Promise\<[operations.UpdateTopicStatusResponseBody](../../sdk/models/operations/updatetopicstatusresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -581,22 +538,16 @@ Update topic timestamp ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { UpdateTopicTimestampRequest, UpdateTopicTimestampRequestBody } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const apiKey: string = ""; -const apiUsername: string = ""; -const id: string = ""; -const requestBody: UpdateTopicTimestampRequestBody = { - timestamp: "1594291380", -}; + const result = await sdk.topics.updateTopicTimestamp("", "", "", { + timestamp: "1594291380", + }); - const res = await sdk.topics.updateTopicTimestamp(apiKey, apiUsername, id, requestBody); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -604,18 +555,20 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `apiKey` | *string* | :heavy_check_mark: | N/A | -| `apiUsername` | *string* | :heavy_check_mark: | N/A | -| `id` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.UpdateTopicTimestampRequestBody](../../sdk/models/operations/updatetopictimestamprequestbody.md) | :heavy_minus_sign: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `apiKey` | *string* | :heavy_check_mark: | N/A | +| `apiUsername` | *string* | :heavy_check_mark: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | +| `requestBody` | [operations.UpdateTopicTimestampRequestBody](../../sdk/models/operations/updatetopictimestamprequestbody.md) | :heavy_minus_sign: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.UpdateTopicTimestampResponse](../../sdk/models/operations/updatetopictimestampresponse.md)>** +**Promise\<[operations.UpdateTopicTimestampResponseBody](../../sdk/models/operations/updatetopictimestampresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/uploads/README.md b/docs/sdks/uploads/README.md index 7df6d02..2b5d97c 100644 --- a/docs/sdks/uploads/README.md +++ b/docs/sdks/uploads/README.md @@ -32,16 +32,15 @@ be set to true for this endpoint to function. ```typescript import { SDK } from "@lukehagar/discoursejs"; -async function run() { - const sdk = new SDK(); +const sdk = new SDK(); - const res = await sdk.uploads.abortMultipart({ +async function run() { + const result = await sdk.uploads.abortMultipart({ externalUploadIdentifier: "84x83tmxy398t3y._Q_z8CoJYVr69bE6D7f8J6Oo0434QquLFoYdGVerWFx9X5HDEI_TP_95c34n853495x35345394.d.ghQ", }); - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -49,15 +48,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `request` | [operations.AbortMultipartRequestBody](../../sdk/models/operations/abortmultipartrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.AbortMultipartRequestBody](../../sdk/models/operations/abortmultipartrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.AbortMultipartResponse](../../sdk/models/operations/abortmultipartresponse.md)>** +**Promise\<[operations.AbortMultipartResponseBody](../../sdk/models/operations/abortmultipartresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -94,10 +95,10 @@ be set to true for this endpoint to function. ```typescript import { SDK } from "@lukehagar/discoursejs"; -async function run() { - const sdk = new SDK(); +const sdk = new SDK(); - const res = await sdk.uploads.batchPresignMultipartParts({ +async function run() { + const result = await sdk.uploads.batchPresignMultipartParts({ partNumbers: [ 1, 2, @@ -106,9 +107,8 @@ async function run() { uniqueIdentifier: "66e86218-80d9-4bda-b4d5-2b6def968705", }); - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -116,15 +116,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.BatchPresignMultipartPartsRequestBody](../../sdk/models/operations/batchpresignmultipartpartsrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.BatchPresignMultipartPartsRequestBody](../../sdk/models/operations/batchpresignmultipartpartsrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.BatchPresignMultipartPartsResponse](../../sdk/models/operations/batchpresignmultipartpartsresponse.md)>** +**Promise\<[operations.BatchPresignMultipartPartsResponseBody](../../sdk/models/operations/batchpresignmultipartpartsresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -157,19 +159,18 @@ be set to true for this endpoint to function. ```typescript import { SDK } from "@lukehagar/discoursejs"; -async function run() { - const sdk = new SDK(); +const sdk = new SDK(); - const res = await sdk.uploads.completeExternalUpload({ +async function run() { + const result = await sdk.uploads.completeExternalUpload({ forPrivateMessage: "true", forSiteSetting: "true", pasted: "true", uniqueIdentifier: "66e86218-80d9-4bda-b4d5-2b6def968705", }); - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -177,15 +178,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | -| `request` | [operations.CompleteExternalUploadRequestBody](../../sdk/models/operations/completeexternaluploadrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CompleteExternalUploadRequestBody](../../sdk/models/operations/completeexternaluploadrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.CompleteExternalUploadResponse](../../sdk/models/operations/completeexternaluploadresponse.md)>** +**Promise\<[operations.CompleteExternalUploadResponseBody](../../sdk/models/operations/completeexternaluploadresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -215,10 +218,10 @@ be set to true for this endpoint to function. ```typescript import { SDK } from "@lukehagar/discoursejs"; -async function run() { - const sdk = new SDK(); +const sdk = new SDK(); - const res = await sdk.uploads.completeMultipart({ +async function run() { + const result = await sdk.uploads.completeMultipart({ parts: [ { "part_number": 1, @@ -232,9 +235,8 @@ async function run() { uniqueIdentifier: "66e86218-80d9-4bda-b4d5-2b6def968705", }); - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -242,15 +244,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CompleteMultipartRequestBody](../../sdk/models/operations/completemultipartrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CompleteMultipartRequestBody](../../sdk/models/operations/completemultipartrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.CompleteMultipartResponse](../../sdk/models/operations/completemultipartresponse.md)>** +**Promise\<[operations.CompleteMultipartResponseBody](../../sdk/models/operations/completemultipartresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -276,21 +280,18 @@ be set to true for this endpoint to function. ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { UploadType } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); - - const res = await sdk.uploads.createMultipartUpload({ + const result = await sdk.uploads.createMultipartUpload({ fileName: "IMG_2021.jpeg", fileSize: 4096, - metadata: {}, - uploadType: UploadType.CardBackground, + uploadType: "card_background", }); - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -298,15 +299,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -| `request` | [operations.CreateMultipartUploadRequestBody](../../sdk/models/operations/createmultipartuploadrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateMultipartUploadRequestBody](../../sdk/models/operations/createmultipartuploadrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.CreateMultipartUploadResponse](../../sdk/models/operations/createmultipartuploadresponse.md)>** +**Promise\<[operations.CreateMultipartUploadResponseBody](../../sdk/models/operations/createmultipartuploadresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -321,22 +324,14 @@ Creates an upload ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { TypeT } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); + const result = await sdk.uploads.createUpload(); - const res = await sdk.uploads.createUpload({ - file: { - content: new TextEncoder().encode("0x5d6beD2Fe2"), - fileName: "your_file_here", - }, - type: TypeT.Composer, - }); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -344,15 +339,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `request` | [operations.CreateUploadRequestBody](../../sdk/models/operations/createuploadrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateUploadRequestBody](../../sdk/models/operations/createuploadrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.CreateUploadResponse](../../sdk/models/operations/createuploadresponse.md)>** +**Promise\<[operations.CreateUploadResponseBody](../../sdk/models/operations/createuploadresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -387,21 +384,18 @@ be set to true for this endpoint to function. ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { GeneratePresignedPutType } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); - - const res = await sdk.uploads.generatePresignedPut({ + const result = await sdk.uploads.generatePresignedPut({ fileName: "IMG_2021.jpeg", fileSize: 4096, - metadata: {}, - type: GeneratePresignedPutType.CardBackground, + type: "card_background", }); - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -409,15 +403,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GeneratePresignedPutRequestBody](../../sdk/models/operations/generatepresignedputrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GeneratePresignedPutRequestBody](../../sdk/models/operations/generatepresignedputrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.GeneratePresignedPutResponse](../../sdk/models/operations/generatepresignedputresponse.md)>** +**Promise\<[operations.GeneratePresignedPutResponseBody](../../sdk/models/operations/generatepresignedputresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | diff --git a/docs/sdks/users/README.md b/docs/sdks/users/README.md index 930316a..cb84ec0 100644 --- a/docs/sdks/users/README.md +++ b/docs/sdks/users/README.md @@ -36,17 +36,14 @@ Activate a user ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { ActivateUserRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: number = 203554; + const result = await sdk.users.activateUser(203554); - const res = await sdk.users.activateUser(id); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -54,15 +51,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `id` | *number* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *number* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.ActivateUserResponse](../../sdk/models/operations/activateuserresponse.md)>** +**Promise\<[operations.ActivateUserResponseBody](../../sdk/models/operations/activateuserresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -77,17 +76,14 @@ Get a user by id ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { AdminGetUserRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: number = 386776; + const result = await sdk.users.adminGetUser(386776); - const res = await sdk.users.adminGetUser(id); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -95,15 +91,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `id` | *number* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *number* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.AdminGetUserResponse](../../sdk/models/operations/admingetuserresponse.md)>** +**Promise\<[operations.AdminGetUserResponseBody](../../sdk/models/operations/admingetuserresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -118,18 +116,16 @@ Get a list of users ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { Flag, QueryParamAsc, QueryParamOrder } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); - - const res = await sdk.users.adminListUsers({ - flag: Flag.New, + const result = await sdk.users.adminListUsers({ + flag: "new", }); - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -137,15 +133,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `request` | [operations.AdminListUsersRequest](../../sdk/models/operations/adminlistusersrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.AdminListUsersRequest](../../sdk/models/operations/adminlistusersrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.AdminListUsersResponse](../../sdk/models/operations/adminlistusersresponse.md)>** +**Promise\<[operations.AdminListUsersResponseBody[]](../../models/.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -160,17 +158,14 @@ Anonymize a user ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { AnonymizeUserRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: number = 418778; + const result = await sdk.users.anonymizeUser(418778); - const res = await sdk.users.anonymizeUser(id); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -178,15 +173,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `id` | *number* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *number* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.AnonymizeUserResponse](../../sdk/models/operations/anonymizeuserresponse.md)>** +**Promise\<[operations.AnonymizeUserResponseBody](../../sdk/models/operations/anonymizeuserresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -201,21 +198,13 @@ Change password ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { ChangePasswordRequest, ChangePasswordRequestBody } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const token: string = ""; -const requestBody: ChangePasswordRequestBody = { - password: "Gm1zHM7WngzsMbv", - username: "Ines.Grady", -}; + await sdk.users.changePassword(""); - const res = await sdk.users.changePassword(token, requestBody); - - if (res.statusCode == 200) { - // handle response - } + } run(); @@ -223,16 +212,18 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `token` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.ChangePasswordRequestBody](../../sdk/models/operations/changepasswordrequestbody.md) | :heavy_minus_sign: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `token` | *string* | :heavy_check_mark: | N/A | +| `requestBody` | [operations.ChangePasswordRequestBody](../../sdk/models/operations/changepasswordrequestbody.md) | :heavy_minus_sign: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.ChangePasswordResponse](../../sdk/models/operations/changepasswordresponse.md)>** +**Promise\** ### Errors | Error Object | Status Code | Content Type | @@ -247,25 +238,14 @@ Creates a user ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { CreateUserRequest, CreateUserRequestBody, ExternalIds } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const apiKey: string = ""; -const apiUsername: string = ""; -const requestBody: CreateUserRequestBody = { - email: "Hailey.Effertz62@yahoo.com", - externalIds: {}, - name: "", - password: "Pd4wq13VrTPEl8B", - username: "Domenico_Gottlieb", -}; + const result = await sdk.users.createUser("", ""); - const res = await sdk.users.createUser(apiKey, apiUsername, requestBody); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -273,17 +253,19 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `apiKey` | *string* | :heavy_check_mark: | N/A | -| `apiUsername` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.CreateUserRequestBody](../../sdk/models/operations/createuserrequestbody.md) | :heavy_minus_sign: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `apiKey` | *string* | :heavy_check_mark: | N/A | +| `apiUsername` | *string* | :heavy_check_mark: | N/A | +| `requestBody` | [operations.CreateUserRequestBody](../../sdk/models/operations/createuserrequestbody.md) | :heavy_minus_sign: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.CreateUserResponse](../../sdk/models/operations/createuserresponse.md)>** +**Promise\<[operations.CreateUserResponseBody](../../sdk/models/operations/createuserresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -298,17 +280,14 @@ Deactivate a user ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { DeactivateUserRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: number = 143950; + const result = await sdk.users.deactivateUser(143950); - const res = await sdk.users.deactivateUser(id); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -316,15 +295,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `id` | *number* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *number* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.DeactivateUserResponse](../../sdk/models/operations/deactivateuserresponse.md)>** +**Promise\<[operations.DeactivateUserResponseBody](../../sdk/models/operations/deactivateuserresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -339,18 +320,14 @@ Delete a user ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { DeleteUserRequest, DeleteUserRequestBody } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: number = 251343; -const requestBody: DeleteUserRequestBody = {}; + const result = await sdk.users.deleteUser(251343); - const res = await sdk.users.deleteUser(id, requestBody); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -358,16 +335,18 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `id` | *number* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.DeleteUserRequestBody](../../sdk/models/operations/deleteuserrequestbody.md) | :heavy_minus_sign: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *number* | :heavy_check_mark: | N/A | +| `requestBody` | [operations.DeleteUserRequestBody](../../sdk/models/operations/deleteuserrequestbody.md) | :heavy_minus_sign: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.DeleteUserResponse](../../sdk/models/operations/deleteuserresponse.md)>** +**Promise\<[operations.DeleteUserResponseBody](../../sdk/models/operations/deleteuserresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -382,19 +361,14 @@ Get a single user by username ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { GetUserRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const apiKey: string = ""; -const apiUsername: string = ""; -const username: string = ""; + const result = await sdk.users.getUser("", "", ""); - const res = await sdk.users.getUser(apiKey, apiUsername, username); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -402,17 +376,19 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `apiKey` | *string* | :heavy_check_mark: | N/A | -| `apiUsername` | *string* | :heavy_check_mark: | N/A | -| `username` | *string* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `apiKey` | *string* | :heavy_check_mark: | N/A | +| `apiUsername` | *string* | :heavy_check_mark: | N/A | +| `username` | *string* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.GetUserResponse](../../sdk/models/operations/getuserresponse.md)>** +**Promise\<[operations.GetUserResponseBody](../../sdk/models/operations/getuserresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -427,17 +403,14 @@ Get email addresses belonging to a user ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { GetUserEmailsRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const username: string = ""; + const result = await sdk.users.getUserEmails(""); - const res = await sdk.users.getUserEmails(username); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -445,15 +418,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `username` | *string* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `username` | *string* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.GetUserEmailsResponse](../../sdk/models/operations/getuseremailsresponse.md)>** +**Promise\<[operations.GetUserEmailsResponseBody](../../sdk/models/operations/getuseremailsresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -468,19 +443,14 @@ Get a user by external_id ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { GetUserExternalIdRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const apiKey: string = ""; -const apiUsername: string = ""; -const externalId: string = ""; + const result = await sdk.users.getUserExternalId("", "", ""); - const res = await sdk.users.getUserExternalId(apiKey, apiUsername, externalId); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -488,17 +458,19 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `apiKey` | *string* | :heavy_check_mark: | N/A | -| `apiUsername` | *string* | :heavy_check_mark: | N/A | -| `externalId` | *string* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `apiKey` | *string* | :heavy_check_mark: | N/A | +| `apiUsername` | *string* | :heavy_check_mark: | N/A | +| `externalId` | *string* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.GetUserExternalIdResponse](../../sdk/models/operations/getuserexternalidresponse.md)>** +**Promise\<[operations.GetUserExternalIdResponseBody](../../sdk/models/operations/getuserexternalidresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -513,20 +485,14 @@ Get a user by identity provider external ID ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { GetUserIdentiyProviderExternalIdRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const apiKey: string = ""; -const apiUsername: string = ""; -const externalId: string = ""; -const provider: string = ""; + const result = await sdk.users.getUserIdentiyProviderExternalId("", "", "", ""); - const res = await sdk.users.getUserIdentiyProviderExternalId(apiKey, apiUsername, externalId, provider); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -534,18 +500,20 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `apiKey` | *string* | :heavy_check_mark: | N/A | -| `apiUsername` | *string* | :heavy_check_mark: | N/A | -| `externalId` | *string* | :heavy_check_mark: | N/A | -| `provider` | *string* | :heavy_check_mark: | Authentication provider name. Can be found in the provider callback URL: `/auth/{provider}/callback` | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `apiKey` | *string* | :heavy_check_mark: | N/A | +| `apiUsername` | *string* | :heavy_check_mark: | N/A | +| `externalId` | *string* | :heavy_check_mark: | N/A | +| `provider` | *string* | :heavy_check_mark: | Authentication provider name. Can be found in the provider callback URL: `/auth/{provider}/callback` | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.GetUserIdentiyProviderExternalIdResponse](../../sdk/models/operations/getuseridentiyproviderexternalidresponse.md)>** +**Promise\<[operations.GetUserIdentiyProviderExternalIdResponseBody](../../sdk/models/operations/getuseridentiyproviderexternalidresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -560,19 +528,14 @@ Get a list of user actions ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { ListUserActionsRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const filter: string = ""; -const offset: number = 620550; -const username: string = ""; + const result = await sdk.users.listUserActions("", 620550, ""); - const res = await sdk.users.listUserActions(filter, offset, username); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -580,17 +543,19 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `filter` | *string* | :heavy_check_mark: | N/A | -| `offset` | *number* | :heavy_check_mark: | N/A | -| `username` | *string* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `filter` | *string* | :heavy_check_mark: | N/A | +| `offset` | *number* | :heavy_check_mark: | N/A | +| `username` | *string* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.ListUserActionsResponse](../../sdk/models/operations/listuseractionsresponse.md)>** +**Promise\<[operations.ListUserActionsResponseBody](../../sdk/models/operations/listuseractionsresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -605,17 +570,14 @@ List badges for a user ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { ListUserBadgesRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const username: string = ""; + const result = await sdk.users.listUserBadges(""); - const res = await sdk.users.listUserBadges(username); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -623,15 +585,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `username` | *string* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `username` | *string* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.ListUserBadgesResponse](../../sdk/models/operations/listuserbadgesresponse.md)>** +**Promise\<[operations.ListUserBadgesResponseBody](../../sdk/models/operations/listuserbadgesresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -646,20 +610,14 @@ Get a public list of users ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { Asc, ListUsersPublicRequest, Order, Period } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const order: Order = Order.TopicCount; -const period: Period = Period.Monthly; -const asc: Asc = Asc.True; -const page: number = 772202; + const result = await sdk.users.listUsersPublic("topic_count", "monthly"); - const res = await sdk.users.listUsersPublic(order, period, asc, page); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -667,18 +625,20 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `order` | [operations.Order](../../sdk/models/operations/order.md) | :heavy_check_mark: | N/A | -| `period` | [operations.Period](../../sdk/models/operations/period.md) | :heavy_check_mark: | N/A | -| `asc` | [operations.Asc](../../sdk/models/operations/asc.md) | :heavy_minus_sign: | N/A | -| `page` | *number* | :heavy_minus_sign: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `order` | [operations.Order](../../sdk/models/operations/order.md) | :heavy_check_mark: | N/A | +| `period` | [operations.Period](../../sdk/models/operations/period.md) | :heavy_check_mark: | N/A | +| `asc` | [operations.Asc](../../sdk/models/operations/asc.md) | :heavy_minus_sign: | N/A | +| `page` | *number* | :heavy_minus_sign: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.ListUsersPublicResponse](../../sdk/models/operations/listuserspublicresponse.md)>** +**Promise\<[operations.ListUsersPublicResponseBody](../../sdk/models/operations/listuserspublicresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -693,17 +653,14 @@ Log a user out ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { LogOutUserRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: number = 379568; + const result = await sdk.users.logOutUser(379568); - const res = await sdk.users.logOutUser(id); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -711,15 +668,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `id` | *number* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *number* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.LogOutUserResponse](../../sdk/models/operations/logoutuserresponse.md)>** +**Promise\<[operations.LogOutUserResponseBody](../../sdk/models/operations/logoutuserresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -734,17 +693,14 @@ Refresh gravatar ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { RefreshGravatarRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const username: string = ""; + const result = await sdk.users.refreshGravatar(""); - const res = await sdk.users.refreshGravatar(username); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -752,15 +708,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | -| `username` | *string* | :heavy_check_mark: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `username` | *string* | :heavy_check_mark: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.RefreshGravatarResponse](../../sdk/models/operations/refreshgravatarresponse.md)>** +**Promise\<[operations.RefreshGravatarResponseBody](../../sdk/models/operations/refreshgravatarresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -776,16 +734,13 @@ Send password reset email ```typescript import { SDK } from "@lukehagar/discoursejs"; +const sdk = new SDK(); + async function run() { - const sdk = new SDK(); + const result = await sdk.users.sendPasswordResetEmail(); - const res = await sdk.users.sendPasswordResetEmail({ - login: "Bert.Kohler48", - }); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -793,15 +748,17 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | -| `request` | [operations.SendPasswordResetEmailRequestBody](../../sdk/models/operations/sendpasswordresetemailrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.SendPasswordResetEmailRequestBody](../../sdk/models/operations/sendpasswordresetemailrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.SendPasswordResetEmailResponse](../../sdk/models/operations/sendpasswordresetemailresponse.md)>** +**Promise\<[operations.SendPasswordResetEmailResponseBody](../../sdk/models/operations/sendpasswordresetemailresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -816,21 +773,17 @@ Silence a user ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { SilenceUserRequest, SilenceUserRequestBody } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: number = 606247; -const requestBody: SilenceUserRequestBody = { - postAction: "delete", - silencedTill: "2022-06-01T08:00:00.000Z", -}; + const result = await sdk.users.silenceUser(606247, { + postAction: "delete", + silencedTill: "2022-06-01T08:00:00.000Z", + }); - const res = await sdk.users.silenceUser(id, requestBody); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -838,16 +791,18 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `id` | *number* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.SilenceUserRequestBody](../../sdk/models/operations/silenceuserrequestbody.md) | :heavy_minus_sign: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *number* | :heavy_check_mark: | N/A | +| `requestBody` | [operations.SilenceUserRequestBody](../../sdk/models/operations/silenceuserrequestbody.md) | :heavy_minus_sign: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.SilenceUserResponse](../../sdk/models/operations/silenceuserresponse.md)>** +**Promise\<[operations.SilenceUserResponseBody](../../sdk/models/operations/silenceuserresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -862,22 +817,18 @@ Suspend a user ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { SuspendUserRequest, SuspendUserRequestBody } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const id: number = 970832; -const requestBody: SuspendUserRequestBody = { - postAction: "delete", - reason: "", - suspendUntil: "2121-02-22", -}; + const result = await sdk.users.suspendUser(970832, { + postAction: "delete", + reason: "", + suspendUntil: "2121-02-22", + }); - const res = await sdk.users.suspendUser(id, requestBody); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -885,16 +836,18 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `id` | *number* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.SuspendUserRequestBody](../../sdk/models/operations/suspenduserrequestbody.md) | :heavy_minus_sign: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *number* | :heavy_check_mark: | N/A | +| `requestBody` | [operations.SuspendUserRequestBody](../../sdk/models/operations/suspenduserrequestbody.md) | :heavy_minus_sign: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.SuspendUserResponse](../../sdk/models/operations/suspenduserresponse.md)>** +**Promise\<[operations.SuspendUserResponseBody](../../sdk/models/operations/suspenduserresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -909,21 +862,14 @@ Update avatar ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { UpdateAvatarRequest, UpdateAvatarRequestBody, UpdateAvatarType } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const username: string = ""; -const requestBody: UpdateAvatarRequestBody = { - type: UpdateAvatarType.Gravatar, - uploadId: 261978, -}; + const result = await sdk.users.updateAvatar(""); - const res = await sdk.users.updateAvatar(username, requestBody); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -931,16 +877,18 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -| `username` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.UpdateAvatarRequestBody](../../sdk/models/operations/updateavatarrequestbody.md) | :heavy_minus_sign: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `username` | *string* | :heavy_check_mark: | N/A | +| `requestBody` | [operations.UpdateAvatarRequestBody](../../sdk/models/operations/updateavatarrequestbody.md) | :heavy_minus_sign: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.UpdateAvatarResponse](../../sdk/models/operations/updateavatarresponse.md)>** +**Promise\<[operations.UpdateAvatarResponseBody](../../sdk/models/operations/updateavatarresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -955,20 +903,13 @@ Update email ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { UpdateEmailRequest, UpdateEmailRequestBody } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const username: string = ""; -const requestBody: UpdateEmailRequestBody = { - email: "Jodie.Reichel79@yahoo.com", -}; + await sdk.users.updateEmail(""); - const res = await sdk.users.updateEmail(username, requestBody); - - if (res.statusCode == 200) { - // handle response - } + } run(); @@ -976,16 +917,18 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `username` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.UpdateEmailRequestBody](../../sdk/models/operations/updateemailrequestbody.md) | :heavy_minus_sign: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `username` | *string* | :heavy_check_mark: | N/A | +| `requestBody` | [operations.UpdateEmailRequestBody](../../sdk/models/operations/updateemailrequestbody.md) | :heavy_minus_sign: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.UpdateEmailResponse](../../sdk/models/operations/updateemailresponse.md)>** +**Promise\** ### Errors | Error Object | Status Code | Content Type | @@ -1000,22 +943,14 @@ Update a user ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { UpdateUserExternalIds, UpdateUserRequest, UpdateUserRequestBody } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const apiKey: string = ""; -const apiUsername: string = ""; -const username: string = ""; -const requestBody: UpdateUserRequestBody = { - externalIds: {}, -}; + const result = await sdk.users.updateUser("", "", ""); - const res = await sdk.users.updateUser(apiKey, apiUsername, username, requestBody); - - if (res.statusCode == 200) { - // handle response - } + // Handle the result + console.log(result) } run(); @@ -1023,18 +958,20 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `apiKey` | *string* | :heavy_check_mark: | N/A | -| `apiUsername` | *string* | :heavy_check_mark: | N/A | -| `username` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.UpdateUserRequestBody](../../sdk/models/operations/updateuserrequestbody.md) | :heavy_minus_sign: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `apiKey` | *string* | :heavy_check_mark: | N/A | +| `apiUsername` | *string* | :heavy_check_mark: | N/A | +| `username` | *string* | :heavy_check_mark: | N/A | +| `requestBody` | [operations.UpdateUserRequestBody](../../sdk/models/operations/updateuserrequestbody.md) | :heavy_minus_sign: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.UpdateUserResponse](../../sdk/models/operations/updateuserresponse.md)>** +**Promise\<[operations.UpdateUserResponseBody](../../sdk/models/operations/updateuserresponsebody.md)\>** ### Errors | Error Object | Status Code | Content Type | @@ -1049,20 +986,13 @@ Update username ```typescript import { SDK } from "@lukehagar/discoursejs"; -import { UpdateUsernameRequest, UpdateUsernameRequestBody } from "@lukehagar/discoursejs/dist/sdk/models/operations"; + +const sdk = new SDK(); async function run() { - const sdk = new SDK(); -const username: string = ""; -const requestBody: UpdateUsernameRequestBody = { - newUsername: "", -}; + await sdk.users.updateUsername(""); - const res = await sdk.users.updateUsername(username, requestBody); - - if (res.statusCode == 200) { - // handle response - } + } run(); @@ -1070,16 +1000,18 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | -| `username` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.UpdateUsernameRequestBody](../../sdk/models/operations/updateusernamerequestbody.md) | :heavy_minus_sign: | N/A | -| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `username` | *string* | :heavy_check_mark: | N/A | +| `requestBody` | [operations.UpdateUsernameRequestBody](../../sdk/models/operations/updateusernamerequestbody.md) | :heavy_minus_sign: | N/A | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `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. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response -**Promise<[operations.UpdateUsernameResponse](../../sdk/models/operations/updateusernameresponse.md)>** +**Promise\** ### Errors | Error Object | Status Code | Content Type | diff --git a/gen.yaml b/gen.yaml index e866e67..8fdcb07 100644 --- a/gen.yaml +++ b/gen.yaml @@ -11,9 +11,15 @@ generation: auth: oAuth2ClientCredentialsEnabled: false typescript: - version: 0.4.10 + version: 0.5.0 + additionalDependencies: + dependencies: {} + devDependencies: {} + peerDependencies: {} + additionalPackageJSON: {} author: LukeHagar clientServerStatusCodesAsErrors: false + enumFormat: union flattenGlobalSecurity: true imports: option: openapi @@ -25,6 +31,10 @@ typescript: webhooks: sdk/models/webhooks inputModelSuffix: input maxMethodParams: 4 + methodArguments: require-security-and-request + moduleFormat: commonjs outputModelSuffix: output packageName: '@lukehagar/discoursejs' - templateVersion: v1 + responseFormat: flat + templateVersion: v2 + useIndexModules: true diff --git a/jest.config.js b/jest.config.js deleted file mode 100644 index e451988..0000000 --- a/jest.config.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = { - preset: "ts-jest", - testEnvironment: "node", - testPathIgnorePatterns: [ - "/__tests__/helpers.ts", - "/__tests__/common_helpers.ts", - ], -}; diff --git a/jsr.json b/jsr.json new file mode 100644 index 0000000..42140be --- /dev/null +++ b/jsr.json @@ -0,0 +1,27 @@ + + +{ + "name": "@lukehagar/discoursejs", + "version": "0.5.0", + "exports": { + ".": "./src/index.ts", + "./sdk/models/errors": "./src/sdk/models/errors/index.ts", + "./sdk/models/shared": "./src/sdk/models/shared/index.ts", + "./sdk/models/operations": "./src/sdk/models/operations/index.ts", + "./lib/config": "./src/lib/config.ts", + "./lib/http": "./src/lib/http.ts", + "./lib/retries": "./src/lib/retries.ts", + "./lib/sdks": "./src/lib/sdks.ts", + "./types": "./src/sdk/types/index.ts" + }, + "publish": { + "include": [ + "LICENSE", + "README.md", + "RUNTIMES.md", + "USAGE.md", + "jsr.json", + "src/**/*.ts" + ] + } +} diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index a5cf19c..0000000 --- a/package-lock.json +++ /dev/null @@ -1,3118 +0,0 @@ -{ - "name": "@lukehagar/discoursejs", - "version": "0.4.10", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "@lukehagar/discoursejs", - "version": "0.4.10", - "dependencies": { - "axios": "^1.1.3", - "class-transformer": "^0.5.1", - "form-data": "^4.0.0", - "jsonpath": "^1.1.1", - "reflect-metadata": "^0.1.13" - }, - "devDependencies": { - "@types/jsonpath": "^0.2.0", - "@types/node": "^18.11.5", - "@typescript-eslint/eslint-plugin": "^5.56.0", - "@typescript-eslint/parser": "^5.56.0", - "eslint": "^8.36.0", - "typescript": "^4.8.4" - } - }, - "node_modules/@eslint-community/eslint-utils": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" - } - }, - "node_modules/@eslint-community/regexpp": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.4.1.tgz", - "integrity": "sha512-BISJ6ZE4xQsuL/FmsyRaiffpq977bMlsKfGHTQrOGFErfByxIe6iZTxPf/00Zon9b9a7iUykfQwejN3s2ZW/Bw==", - "dev": true, - "engines": { - "node": "^12.0.0 || ^14.0.0 || >=16.0.0" - } - }, - "node_modules/@eslint/eslintrc": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.1.tgz", - "integrity": "sha512-eFRmABvW2E5Ho6f5fHLqgena46rOj7r7OKHYfLElqcBfGFHHpjBhivyi5+jOEQuSpdc/1phIZJlbC2te+tZNIw==", - "dev": true, - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.5.0", - "globals": "^13.19.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/@eslint/js": { - "version": "8.36.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.36.0.tgz", - "integrity": "sha512-lxJ9R5ygVm8ZWgYdUweoq5ownDlJ4upvoWmO4eLxBYHdMo+vZ/Rx0EN6MbKWDJOSUGrqJy2Gt+Dyv/VKml0fjg==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.11.8", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", - "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", - "dev": true, - "dependencies": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", - "minimatch": "^3.0.5" - }, - "engines": { - "node": ">=10.10.0" - } - }, - "node_modules/@humanwhocodes/module-importer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", - "dev": true, - "engines": { - "node": ">=12.22" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, - "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", - "dev": true - }, - "node_modules/@types/jsonpath": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@types/jsonpath/-/jsonpath-0.2.0.tgz", - "integrity": "sha512-v7qlPA0VpKUlEdhghbDqRoKMxFB3h3Ch688TApBJ6v+XLDdvWCGLJIYiPKGZnS6MAOie+IorCfNYVHOPIHSWwQ==", - "dev": true - }, - "node_modules/@types/node": { - "version": "18.11.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz", - "integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==", - "dev": true - }, - "node_modules/@types/semver": { - "version": "7.3.13", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz", - "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", - "dev": true - }, - "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.56.0.tgz", - "integrity": "sha512-ZNW37Ccl3oMZkzxrYDUX4o7cnuPgU+YrcaYXzsRtLB16I1FR5SHMqga3zGsaSliZADCWo2v8qHWqAYIj8nWCCg==", - "dev": true, - "dependencies": { - "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.56.0", - "@typescript-eslint/type-utils": "5.56.0", - "@typescript-eslint/utils": "5.56.0", - "debug": "^4.3.4", - "grapheme-splitter": "^1.0.4", - "ignore": "^5.2.0", - "natural-compare-lite": "^1.4.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "@typescript-eslint/parser": "^5.0.0", - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/parser": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.56.0.tgz", - "integrity": "sha512-sn1OZmBxUsgxMmR8a8U5QM/Wl+tyqlH//jTqCg8daTAmhAk26L2PFhcqPLlYBhYUJMZJK276qLXlHN3a83o2cg==", - "dev": true, - "dependencies": { - "@typescript-eslint/scope-manager": "5.56.0", - "@typescript-eslint/types": "5.56.0", - "@typescript-eslint/typescript-estree": "5.56.0", - "debug": "^4.3.4" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.56.0.tgz", - "integrity": "sha512-jGYKyt+iBakD0SA5Ww8vFqGpoV2asSjwt60Gl6YcO8ksQ8s2HlUEyHBMSa38bdLopYqGf7EYQMUIGdT/Luw+sw==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.56.0", - "@typescript-eslint/visitor-keys": "5.56.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/type-utils": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.56.0.tgz", - "integrity": "sha512-8WxgOgJjWRy6m4xg9KoSHPzBNZeQbGlQOH7l2QEhQID/+YseaFxg5J/DLwWSsi9Axj4e/cCiKx7PVzOq38tY4A==", - "dev": true, - "dependencies": { - "@typescript-eslint/typescript-estree": "5.56.0", - "@typescript-eslint/utils": "5.56.0", - "debug": "^4.3.4", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "*" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/types": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.56.0.tgz", - "integrity": "sha512-JyAzbTJcIyhuUhogmiu+t79AkdnqgPUEsxMTMc/dCZczGMJQh1MK2wgrju++yMN6AWroVAy2jxyPcPr3SWCq5w==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.56.0.tgz", - "integrity": "sha512-41CH/GncsLXOJi0jb74SnC7jVPWeVJ0pxQj8bOjH1h2O26jXN3YHKDT1ejkVz5YeTEQPeLCCRY0U2r68tfNOcg==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.56.0", - "@typescript-eslint/visitor-keys": "5.56.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "node_modules/@typescript-eslint/utils": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.56.0.tgz", - "integrity": "sha512-XhZDVdLnUJNtbzaJeDSCIYaM+Tgr59gZGbFuELgF7m0IY03PlciidS7UQNKLE0+WpUTn1GlycEr6Ivb/afjbhA==", - "dev": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.56.0", - "@typescript-eslint/types": "5.56.0", - "@typescript-eslint/typescript-estree": "5.56.0", - "eslint-scope": "^5.1.1", - "semver": "^7.3.7" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.56.0.tgz", - "integrity": "sha512-1mFdED7u5bZpX6Xxf5N9U2c18sb+8EvU3tyOIj6LQZ5OOvnmj8BVeNNP603OFPm5KkS1a7IvCIcwrdHXaEMG/Q==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "5.56.0", - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "node_modules/acorn": { - "version": "8.8.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", - "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "node_modules/array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" - }, - "node_modules/axios": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.1.3.tgz", - "integrity": "sha512-00tXVRwKx/FZr/IDVFt4C+f9FYairX517WoGCL6dpOntqLkZofjhu43F/Xl44UOpqa+9sLFDrG/XAnFsUYgkDA==", - "dependencies": { - "follow-redirects": "^1.15.0", - "form-data": "^4.0.0", - "proxy-from-env": "^1.1.0" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/class-transformer": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/class-transformer/-/class-transformer-0.5.1.tgz", - "integrity": "sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==" - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/escodegen": { - "version": "1.14.3", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", - "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", - "dependencies": { - "esprima": "^4.0.1", - "estraverse": "^4.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1" - }, - "bin": { - "escodegen": "bin/escodegen.js", - "esgenerate": "bin/esgenerate.js" - }, - "engines": { - "node": ">=4.0" - }, - "optionalDependencies": { - "source-map": "~0.6.1" - } - }, - "node_modules/escodegen/node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/escodegen/node_modules/levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", - "dependencies": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/escodegen/node_modules/optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "dependencies": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/escodegen/node_modules/prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/escodegen/node_modules/type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", - "dependencies": { - "prelude-ls": "~1.1.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/eslint": { - "version": "8.36.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.36.0.tgz", - "integrity": "sha512-Y956lmS7vDqomxlaaQAHVmeb4tNMp2FWIvU/RnU5BD3IKMD/MJPr76xdyr68P8tV1iNMvN2mRK0yy3c+UjL+bw==", - "dev": true, - "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.4.0", - "@eslint/eslintrc": "^2.0.1", - "@eslint/js": "8.36.0", - "@humanwhocodes/config-array": "^0.11.8", - "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "doctrine": "^3.0.0", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.1", - "eslint-visitor-keys": "^3.3.0", - "espree": "^9.5.0", - "esquery": "^1.4.2", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "find-up": "^5.0.0", - "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "grapheme-splitter": "^1.0.4", - "ignore": "^5.2.0", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-sdsl": "^4.1.4", - "js-yaml": "^4.1.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", - "text-table": "^0.2.0" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/eslint/node_modules/eslint-scope": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", - "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/eslint/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/espree": { - "version": "9.5.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.5.0.tgz", - "integrity": "sha512-JPbJGhKc47++oo4JkEoTe2wjy4fmMwvFpgJT9cQzmfXKp22Dr6Hf1tdCteLz1h0P3t+mGvWZ+4Uankvh8+c6zw==", - "dev": true, - "dependencies": { - "acorn": "^8.8.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/esprima": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.2.2.tgz", - "integrity": "sha512-+JpPZam9w5DuJ3Q67SqsMGtiHKENSMRVoxvArfJZK01/BfLEObtZ6orJa/MtoGNR/rfMgp5837T41PAmTwAv/A==", - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", - "dev": true, - "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esquery/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esrecurse/node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "node_modules/fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fast-glob/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" - }, - "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", - "dev": true, - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "dependencies": { - "flat-cache": "^3.0.4" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, - "dependencies": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", - "dev": true - }, - "node_modules/follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, - "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true - }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", - "dev": true, - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/grapheme-splitter": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", - "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", - "dev": true - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, - "node_modules/js-sdsl": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.0.tgz", - "integrity": "sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg==", - "dev": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/js-sdsl" - } - }, - "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true - }, - "node_modules/jsonpath": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/jsonpath/-/jsonpath-1.1.1.tgz", - "integrity": "sha512-l6Cg7jRpixfbgoWgkrl77dgEj8RPvND0wMH6TwQmi9Qs4TFfS9u5cUFnbeKTwj5ga5Y3BTGGNI28k117LJ009w==", - "dependencies": { - "esprima": "1.2.2", - "static-eval": "2.0.2", - "underscore": "1.12.1" - } - }, - "node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true - }, - "node_modules/natural-compare-lite": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", - "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", - "dev": true - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, - "dependencies": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" - }, - "node_modules/punycode": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", - "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/reflect-metadata": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", - "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==" - }, - "node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/static-eval": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.0.2.tgz", - "integrity": "sha512-N/D219Hcr2bPjLxPiV+TQE++Tsmrady7TqAJugLy7Xk1EumfDWS/f5dtBbkRCGE7wKKXuYockQoj8Rm2/pVKyg==", - "dependencies": { - "escodegen": "^1.8.1" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, - "node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "dependencies": { - "prelude-ls": "^1.2.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/typescript": { - "version": "4.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.3.tgz", - "integrity": "sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA==", - "dev": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=4.2.0" - } - }, - "node_modules/underscore": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.12.1.tgz", - "integrity": "sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw==" - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - } - }, - "dependencies": { - "@eslint-community/eslint-utils": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", - "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^3.3.0" - } - }, - "@eslint-community/regexpp": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.4.1.tgz", - "integrity": "sha512-BISJ6ZE4xQsuL/FmsyRaiffpq977bMlsKfGHTQrOGFErfByxIe6iZTxPf/00Zon9b9a7iUykfQwejN3s2ZW/Bw==", - "dev": true - }, - "@eslint/eslintrc": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.1.tgz", - "integrity": "sha512-eFRmABvW2E5Ho6f5fHLqgena46rOj7r7OKHYfLElqcBfGFHHpjBhivyi5+jOEQuSpdc/1phIZJlbC2te+tZNIw==", - "dev": true, - "requires": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.5.0", - "globals": "^13.19.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - } - }, - "@eslint/js": { - "version": "8.36.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.36.0.tgz", - "integrity": "sha512-lxJ9R5ygVm8ZWgYdUweoq5ownDlJ4upvoWmO4eLxBYHdMo+vZ/Rx0EN6MbKWDJOSUGrqJy2Gt+Dyv/VKml0fjg==", - "dev": true - }, - "@humanwhocodes/config-array": { - "version": "0.11.8", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", - "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", - "dev": true, - "requires": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", - "minimatch": "^3.0.5" - } - }, - "@humanwhocodes/module-importer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", - "dev": true - }, - "@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true - }, - "@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true - }, - "@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "requires": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - } - }, - "@types/json-schema": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", - "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", - "dev": true - }, - "@types/jsonpath": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@types/jsonpath/-/jsonpath-0.2.0.tgz", - "integrity": "sha512-v7qlPA0VpKUlEdhghbDqRoKMxFB3h3Ch688TApBJ6v+XLDdvWCGLJIYiPKGZnS6MAOie+IorCfNYVHOPIHSWwQ==", - "dev": true - }, - "@types/node": { - "version": "18.11.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz", - "integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==", - "dev": true - }, - "@types/semver": { - "version": "7.3.13", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.13.tgz", - "integrity": "sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw==", - "dev": true - }, - "@typescript-eslint/eslint-plugin": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.56.0.tgz", - "integrity": "sha512-ZNW37Ccl3oMZkzxrYDUX4o7cnuPgU+YrcaYXzsRtLB16I1FR5SHMqga3zGsaSliZADCWo2v8qHWqAYIj8nWCCg==", - "dev": true, - "requires": { - "@eslint-community/regexpp": "^4.4.0", - "@typescript-eslint/scope-manager": "5.56.0", - "@typescript-eslint/type-utils": "5.56.0", - "@typescript-eslint/utils": "5.56.0", - "debug": "^4.3.4", - "grapheme-splitter": "^1.0.4", - "ignore": "^5.2.0", - "natural-compare-lite": "^1.4.0", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - } - }, - "@typescript-eslint/parser": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.56.0.tgz", - "integrity": "sha512-sn1OZmBxUsgxMmR8a8U5QM/Wl+tyqlH//jTqCg8daTAmhAk26L2PFhcqPLlYBhYUJMZJK276qLXlHN3a83o2cg==", - "dev": true, - "requires": { - "@typescript-eslint/scope-manager": "5.56.0", - "@typescript-eslint/types": "5.56.0", - "@typescript-eslint/typescript-estree": "5.56.0", - "debug": "^4.3.4" - } - }, - "@typescript-eslint/scope-manager": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.56.0.tgz", - "integrity": "sha512-jGYKyt+iBakD0SA5Ww8vFqGpoV2asSjwt60Gl6YcO8ksQ8s2HlUEyHBMSa38bdLopYqGf7EYQMUIGdT/Luw+sw==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.56.0", - "@typescript-eslint/visitor-keys": "5.56.0" - } - }, - "@typescript-eslint/type-utils": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.56.0.tgz", - "integrity": "sha512-8WxgOgJjWRy6m4xg9KoSHPzBNZeQbGlQOH7l2QEhQID/+YseaFxg5J/DLwWSsi9Axj4e/cCiKx7PVzOq38tY4A==", - "dev": true, - "requires": { - "@typescript-eslint/typescript-estree": "5.56.0", - "@typescript-eslint/utils": "5.56.0", - "debug": "^4.3.4", - "tsutils": "^3.21.0" - } - }, - "@typescript-eslint/types": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.56.0.tgz", - "integrity": "sha512-JyAzbTJcIyhuUhogmiu+t79AkdnqgPUEsxMTMc/dCZczGMJQh1MK2wgrju++yMN6AWroVAy2jxyPcPr3SWCq5w==", - "dev": true - }, - "@typescript-eslint/typescript-estree": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.56.0.tgz", - "integrity": "sha512-41CH/GncsLXOJi0jb74SnC7jVPWeVJ0pxQj8bOjH1h2O26jXN3YHKDT1ejkVz5YeTEQPeLCCRY0U2r68tfNOcg==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.56.0", - "@typescript-eslint/visitor-keys": "5.56.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "semver": "^7.3.7", - "tsutils": "^3.21.0" - } - }, - "@typescript-eslint/utils": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.56.0.tgz", - "integrity": "sha512-XhZDVdLnUJNtbzaJeDSCIYaM+Tgr59gZGbFuELgF7m0IY03PlciidS7UQNKLE0+WpUTn1GlycEr6Ivb/afjbhA==", - "dev": true, - "requires": { - "@eslint-community/eslint-utils": "^4.2.0", - "@types/json-schema": "^7.0.9", - "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.56.0", - "@typescript-eslint/types": "5.56.0", - "@typescript-eslint/typescript-estree": "5.56.0", - "eslint-scope": "^5.1.1", - "semver": "^7.3.7" - } - }, - "@typescript-eslint/visitor-keys": { - "version": "5.56.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.56.0.tgz", - "integrity": "sha512-1mFdED7u5bZpX6Xxf5N9U2c18sb+8EvU3tyOIj6LQZ5OOvnmj8BVeNNP603OFPm5KkS1a7IvCIcwrdHXaEMG/Q==", - "dev": true, - "requires": { - "@typescript-eslint/types": "5.56.0", - "eslint-visitor-keys": "^3.3.0" - } - }, - "acorn": { - "version": "8.8.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", - "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", - "dev": true - }, - "acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "requires": {} - }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" - }, - "axios": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.1.3.tgz", - "integrity": "sha512-00tXVRwKx/FZr/IDVFt4C+f9FYairX517WoGCL6dpOntqLkZofjhu43F/Xl44UOpqa+9sLFDrG/XAnFsUYgkDA==", - "requires": { - "follow-redirects": "^1.15.0", - "form-data": "^4.0.0", - "proxy-from-env": "^1.1.0" - } - }, - "balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "requires": { - "fill-range": "^7.0.1" - } - }, - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "class-transformer": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/class-transformer/-/class-transformer-0.5.1.tgz", - "integrity": "sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw==" - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true - }, - "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==" - }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "requires": { - "path-type": "^4.0.0" - } - }, - "doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "requires": { - "esutils": "^2.0.2" - } - }, - "escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true - }, - "escodegen": { - "version": "1.14.3", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", - "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", - "requires": { - "esprima": "^4.0.1", - "estraverse": "^4.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.6.1" - }, - "dependencies": { - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" - }, - "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", - "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - } - }, - "optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.6", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "word-wrap": "~1.2.3" - } - }, - "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==" - }, - "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", - "requires": { - "prelude-ls": "~1.1.2" - } - } - } - }, - "eslint": { - "version": "8.36.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.36.0.tgz", - "integrity": "sha512-Y956lmS7vDqomxlaaQAHVmeb4tNMp2FWIvU/RnU5BD3IKMD/MJPr76xdyr68P8tV1iNMvN2mRK0yy3c+UjL+bw==", - "dev": true, - "requires": { - "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.4.0", - "@eslint/eslintrc": "^2.0.1", - "@eslint/js": "8.36.0", - "@humanwhocodes/config-array": "^0.11.8", - "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "doctrine": "^3.0.0", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.1", - "eslint-visitor-keys": "^3.3.0", - "espree": "^9.5.0", - "esquery": "^1.4.2", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "find-up": "^5.0.0", - "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "grapheme-splitter": "^1.0.4", - "ignore": "^5.2.0", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-sdsl": "^4.1.4", - "js-yaml": "^4.1.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", - "text-table": "^0.2.0" - }, - "dependencies": { - "eslint-scope": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", - "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", - "dev": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - } - }, - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - } - } - }, - "eslint-scope": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", - "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", - "dev": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^4.1.1" - } - }, - "eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", - "dev": true - }, - "espree": { - "version": "9.5.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.5.0.tgz", - "integrity": "sha512-JPbJGhKc47++oo4JkEoTe2wjy4fmMwvFpgJT9cQzmfXKp22Dr6Hf1tdCteLz1h0P3t+mGvWZ+4Uankvh8+c6zw==", - "dev": true, - "requires": { - "acorn": "^8.8.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.3.0" - } - }, - "esprima": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.2.2.tgz", - "integrity": "sha512-+JpPZam9w5DuJ3Q67SqsMGtiHKENSMRVoxvArfJZK01/BfLEObtZ6orJa/MtoGNR/rfMgp5837T41PAmTwAv/A==" - }, - "esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", - "dev": true, - "requires": { - "estraverse": "^5.1.0" - }, - "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - } - } - }, - "esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "requires": { - "estraverse": "^5.2.0" - }, - "dependencies": { - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - } - } - }, - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==" - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "dependencies": { - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "requires": { - "is-glob": "^4.0.1" - } - } - } - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" - }, - "fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", - "dev": true, - "requires": { - "reusify": "^1.0.4" - } - }, - "file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "requires": { - "flat-cache": "^3.0.4" - } - }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "requires": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - } - }, - "flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, - "requires": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - } - }, - "flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", - "dev": true - }, - "follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==" - }, - "form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true - }, - "glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "requires": { - "is-glob": "^4.0.3" - } - }, - "globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", - "dev": true, - "requires": { - "type-fest": "^0.20.2" - } - }, - "globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "requires": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - } - }, - "grapheme-splitter": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", - "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "dev": true - }, - "import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true - }, - "is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, - "js-sdsl": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.0.tgz", - "integrity": "sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg==", - "dev": true - }, - "js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "requires": { - "argparse": "^2.0.1" - } - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true - }, - "jsonpath": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/jsonpath/-/jsonpath-1.1.1.tgz", - "integrity": "sha512-l6Cg7jRpixfbgoWgkrl77dgEj8RPvND0wMH6TwQmi9Qs4TFfS9u5cUFnbeKTwj5ga5Y3BTGGNI28k117LJ009w==", - "requires": { - "esprima": "1.2.2", - "static-eval": "2.0.2", - "underscore": "1.12.1" - } - }, - "levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "requires": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - } - }, - "locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "requires": { - "p-locate": "^5.0.0" - } - }, - "lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true - }, - "lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "requires": { - "yallist": "^4.0.0" - } - }, - "merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true - }, - "micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "requires": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - } - }, - "mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" - }, - "mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "requires": { - "mime-db": "1.52.0" - } - }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true - }, - "natural-compare-lite": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", - "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", - "dev": true - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, - "requires": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" - } - }, - "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "requires": { - "yocto-queue": "^0.1.0" - } - }, - "p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "requires": { - "p-limit": "^3.0.2" - } - }, - "parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "requires": { - "callsites": "^3.0.0" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true - }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - }, - "picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true - }, - "prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true - }, - "proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" - }, - "punycode": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", - "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", - "dev": true - }, - "queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true - }, - "reflect-metadata": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", - "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==" - }, - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "requires": { - "queue-microtask": "^1.2.2" - } - }, - "semver": { - "version": "7.3.8", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", - "integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true - }, - "slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "optional": true - }, - "static-eval": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.0.2.tgz", - "integrity": "sha512-N/D219Hcr2bPjLxPiV+TQE++Tsmrady7TqAJugLy7Xk1EumfDWS/f5dtBbkRCGE7wKKXuYockQoj8Rm2/pVKyg==", - "requires": { - "escodegen": "^1.8.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "requires": { - "is-number": "^7.0.0" - } - }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", - "dev": true - }, - "tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "requires": { - "tslib": "^1.8.1" - } - }, - "type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "requires": { - "prelude-ls": "^1.2.1" - } - }, - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true - }, - "typescript": { - "version": "4.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.3.tgz", - "integrity": "sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA==", - "dev": true - }, - "underscore": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.12.1.tgz", - "integrity": "sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw==" - }, - "uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==" - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, - "yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true - } - } -} diff --git a/package.json b/package.json index 46c1570..2cb7ccd 100644 --- a/package.json +++ b/package.json @@ -1,37 +1,32 @@ { "name": "@lukehagar/discoursejs", - "version": "0.4.10", + "version": "0.5.0", "author": "LukeHagar", - "scripts": { - "prepare": "tsc --build", - "check:tsc": "tsc --noEmit --skipLibCheck", - "check:eslint": "eslint --max-warnings=0 src", - "check": "npm run check:tsc && npm run check:eslint" - }, - "dependencies": { - "axios": "^1.1.3", - "jsonpath": "^1.1.1", - "class-transformer": "^0.5.1", - "form-data": "^4.0.0", - "reflect-metadata": "^0.1.13" - }, - "devDependencies": { - "@types/jsonpath": "^0.2.0", - "@types/node": "^18.11.5", - "typescript": "^4.8.4", - "@typescript-eslint/eslint-plugin": "^5.56.0", - "@typescript-eslint/parser": "^5.56.0", - "eslint": "^8.36.0" - }, - "main": "dist/index.js", - "files": [ - "dist", - "docs", - "README.md" - ], + "main": "./index.js", + "sideEffects": false, "repository": { "type": "git", "url": "https://github.com/LukeHagar/discoursejs.git", "directory": "." + }, + "scripts": { + "lint": "eslint --max-warnings=0 src", + "build": "tsc", + "prepare": "npm run build" + }, + "peerDependencies": { + "zod": ">= 3" + }, + "devDependencies": { + "@typescript-eslint/eslint-plugin": "^7.7.1", + "@typescript-eslint/parser": "^7.7.1", + "eslint": "^8.57.0", + "eslint-import-resolver-typescript": "^3.6.1", + "eslint-plugin-import": "^2.29.1", + "typescript": "^5.4.5", + "zod": "^3.23.4" + }, + "dependencies": { + } } diff --git a/src/core.ts b/src/core.ts new file mode 100644 index 0000000..c4486e4 --- /dev/null +++ b/src/core.ts @@ -0,0 +1,13 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ClientSDK } from "./lib/sdks.js"; + +/** + * A minimal client to use when calling standalone SDK functions. Typically, an + * instance of this class would be instantiated once at the start of an + * application and passed around through some dependency injection mechanism to + * parts of an application that need to make SDK calls. + */ +export class SDKCore extends ClientSDK {} diff --git a/src/funcs/adminActivateUser.ts b/src/funcs/adminActivateUser.ts new file mode 100644 index 0000000..d33c1e9 --- /dev/null +++ b/src/funcs/adminActivateUser.ts @@ -0,0 +1,111 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Activate a user + */ +export async function adminActivateUser( + client$: SDKCore, + id: number, + options?: RequestOptions +): Promise< + Result< + operations.ActivateUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.ActivateUserRequest = { + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ActivateUserRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/admin/users/{id}/activate.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "activateUser", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.ActivateUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.ActivateUserResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/adminAdminGetUser.ts b/src/funcs/adminAdminGetUser.ts new file mode 100644 index 0000000..91fc3b8 --- /dev/null +++ b/src/funcs/adminAdminGetUser.ts @@ -0,0 +1,111 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Get a user by id + */ +export async function adminAdminGetUser( + client$: SDKCore, + id: number, + options?: RequestOptions +): Promise< + Result< + operations.AdminGetUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.AdminGetUserRequest = { + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.AdminGetUserRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/admin/users/{id}.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "adminGetUser", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.AdminGetUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.AdminGetUserResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/adminAdminListUsers.ts b/src/funcs/adminAdminListUsers.ts new file mode 100644 index 0000000..3039804 --- /dev/null +++ b/src/funcs/adminAdminListUsers.ts @@ -0,0 +1,124 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; +import * as z from "zod"; + +/** + * Get a list of users + */ +export async function adminAdminListUsers( + client$: SDKCore, + request: operations.AdminListUsersRequest, + options?: RequestOptions +): Promise< + Result< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.AdminListUsersRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + flag: encodeSimple$("flag", payload$.flag, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/admin/users/list/{flag}.json")(pathParams$); + + const query$ = encodeFormQuery$({ + asc: payload$.asc, + email: payload$.email, + ip: payload$.ip, + order: payload$.order, + page: payload$.page, + show_emails: payload$.show_emails, + stats: payload$.stats, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "adminListUsers", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, z.array(operations.AdminListUsersResponseBody$inboundSchema)))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/adminAnonymizeUser.ts b/src/funcs/adminAnonymizeUser.ts new file mode 100644 index 0000000..4639821 --- /dev/null +++ b/src/funcs/adminAnonymizeUser.ts @@ -0,0 +1,111 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Anonymize a user + */ +export async function adminAnonymizeUser( + client$: SDKCore, + id: number, + options?: RequestOptions +): Promise< + Result< + operations.AnonymizeUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.AnonymizeUserRequest = { + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.AnonymizeUserRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/admin/users/{id}/anonymize.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "anonymizeUser", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.AnonymizeUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.AnonymizeUserResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/adminDeactivateUser.ts b/src/funcs/adminDeactivateUser.ts new file mode 100644 index 0000000..f3c4cff --- /dev/null +++ b/src/funcs/adminDeactivateUser.ts @@ -0,0 +1,111 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Deactivate a user + */ +export async function adminDeactivateUser( + client$: SDKCore, + id: number, + options?: RequestOptions +): Promise< + Result< + operations.DeactivateUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.DeactivateUserRequest = { + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.DeactivateUserRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/admin/users/{id}/deactivate.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "deactivateUser", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.DeactivateUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.DeactivateUserResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/adminDeleteUser.ts b/src/funcs/adminDeleteUser.ts new file mode 100644 index 0000000..977ef5e --- /dev/null +++ b/src/funcs/adminDeleteUser.ts @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Delete a user + */ +export async function adminDeleteUser( + client$: SDKCore, + id: number, + requestBody?: operations.DeleteUserRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.DeleteUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.DeleteUserRequest = { + requestBody: requestBody, + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.DeleteUserRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/admin/users/{id}.json")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const context = { operationID: "deleteUser", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "DELETE", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.DeleteUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.DeleteUserResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/adminLogOutUser.ts b/src/funcs/adminLogOutUser.ts new file mode 100644 index 0000000..c1f6c1b --- /dev/null +++ b/src/funcs/adminLogOutUser.ts @@ -0,0 +1,111 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Log a user out + */ +export async function adminLogOutUser( + client$: SDKCore, + id: number, + options?: RequestOptions +): Promise< + Result< + operations.LogOutUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.LogOutUserRequest = { + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.LogOutUserRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/admin/users/{id}/log_out.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "logOutUser", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.LogOutUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.LogOutUserResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/adminRefreshGravatar.ts b/src/funcs/adminRefreshGravatar.ts new file mode 100644 index 0000000..5e4dc93 --- /dev/null +++ b/src/funcs/adminRefreshGravatar.ts @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Refresh gravatar + */ +export async function adminRefreshGravatar( + client$: SDKCore, + username: string, + options?: RequestOptions +): Promise< + Result< + operations.RefreshGravatarResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.RefreshGravatarRequest = { + username: username, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.RefreshGravatarRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + username: encodeSimple$("username", payload$.username, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/user_avatar/{username}/refresh_gravatar.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "refreshGravatar", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.RefreshGravatarResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.RefreshGravatarResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/adminSilenceUser.ts b/src/funcs/adminSilenceUser.ts new file mode 100644 index 0000000..c1137d7 --- /dev/null +++ b/src/funcs/adminSilenceUser.ts @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Silence a user + */ +export async function adminSilenceUser( + client$: SDKCore, + id: number, + requestBody?: operations.SilenceUserRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.SilenceUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.SilenceUserRequest = { + requestBody: requestBody, + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.SilenceUserRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/admin/users/{id}/silence.json")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const context = { operationID: "silenceUser", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.SilenceUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.SilenceUserResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/adminSuspendUser.ts b/src/funcs/adminSuspendUser.ts new file mode 100644 index 0000000..02ddd11 --- /dev/null +++ b/src/funcs/adminSuspendUser.ts @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Suspend a user + */ +export async function adminSuspendUser( + client$: SDKCore, + id: number, + requestBody?: operations.SuspendUserRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.SuspendUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.SuspendUserRequest = { + requestBody: requestBody, + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.SuspendUserRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/admin/users/{id}/suspend.json")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const context = { operationID: "suspendUser", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.SuspendUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.SuspendUserResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/backupsCreateBackup.ts b/src/funcs/backupsCreateBackup.ts new file mode 100644 index 0000000..c66e380 --- /dev/null +++ b/src/funcs/backupsCreateBackup.ts @@ -0,0 +1,106 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Create backup + */ +export async function backupsCreateBackup( + client$: SDKCore, + request?: operations.CreateBackupRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.CreateBackupResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.CreateBackupRequestBody$outboundSchema.optional().parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = payload$ === undefined ? null : encodeJSON$("body", payload$, { explode: true }); + + const path$ = pathToFunc("/admin/backups.json")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const context = { operationID: "createBackup", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.CreateBackupResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.CreateBackupResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/backupsDownloadBackup.ts b/src/funcs/backupsDownloadBackup.ts new file mode 100644 index 0000000..9ce3d0d --- /dev/null +++ b/src/funcs/backupsDownloadBackup.ts @@ -0,0 +1,125 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; +import * as z from "zod"; + +/** + * Download backup + */ +export async function backupsDownloadBackup( + client$: SDKCore, + filename: string, + token: string, + options?: RequestOptions +): Promise< + Result< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.DownloadBackupRequest = { + filename: filename, + token: token, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.DownloadBackupRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + filename: encodeSimple$("filename", payload$.filename, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/admin/backups/{filename}")(pathParams$); + + const query$ = encodeFormQuery$({ + token: payload$.token, + }); + + const headers$ = new Headers({ + Accept: "*/*", + }); + + const context = { operationID: "downloadBackup", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.nil(200, z.void()))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/backupsGetBackups.ts b/src/funcs/backupsGetBackups.ts new file mode 100644 index 0000000..1dec503 --- /dev/null +++ b/src/funcs/backupsGetBackups.ts @@ -0,0 +1,89 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import * as m$ from "../lib/matchers.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; +import * as z from "zod"; + +/** + * List backups + */ +export async function backupsGetBackups( + client$: SDKCore, + options?: RequestOptions +): Promise< + Result< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const path$ = pathToFunc("/admin/backups.json")(); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "getBackups", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, z.array(operations.ResponseBody$inboundSchema)))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/backupsSendDownloadBackupEmail.ts b/src/funcs/backupsSendDownloadBackupEmail.ts new file mode 100644 index 0000000..ace6466 --- /dev/null +++ b/src/funcs/backupsSendDownloadBackupEmail.ts @@ -0,0 +1,119 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; +import * as z from "zod"; + +/** + * Send download backup email + */ +export async function backupsSendDownloadBackupEmail( + client$: SDKCore, + filename: string, + options?: RequestOptions +): Promise< + Result< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.SendDownloadBackupEmailRequest = { + filename: filename, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.SendDownloadBackupEmailRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + filename: encodeSimple$("filename", payload$.filename, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/admin/backups/{filename}")(pathParams$); + + const headers$ = new Headers({ + Accept: "*/*", + }); + + const context = { + operationID: "sendDownloadBackupEmail", + oAuth2Scopes: [], + securitySource: null, + }; + + const requestRes = client$.createRequest$( + context, + { + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.nil(200, z.void()))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/badgesAdminListBadges.ts b/src/funcs/badgesAdminListBadges.ts new file mode 100644 index 0000000..ea281fd --- /dev/null +++ b/src/funcs/badgesAdminListBadges.ts @@ -0,0 +1,88 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import * as m$ from "../lib/matchers.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * List badges + */ +export async function badgesAdminListBadges( + client$: SDKCore, + options?: RequestOptions +): Promise< + Result< + operations.AdminListBadgesResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const path$ = pathToFunc("/admin/badges.json")(); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "adminListBadges", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.AdminListBadgesResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.AdminListBadgesResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/badgesCreateBadge.ts b/src/funcs/badgesCreateBadge.ts new file mode 100644 index 0000000..ee5a32a --- /dev/null +++ b/src/funcs/badgesCreateBadge.ts @@ -0,0 +1,106 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Create badge + */ +export async function badgesCreateBadge( + client$: SDKCore, + request?: operations.CreateBadgeRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.CreateBadgeResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.CreateBadgeRequestBody$outboundSchema.optional().parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = payload$ === undefined ? null : encodeJSON$("body", payload$, { explode: true }); + + const path$ = pathToFunc("/admin/badges.json")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const context = { operationID: "createBadge", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.CreateBadgeResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.CreateBadgeResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/badgesDeleteBadge.ts b/src/funcs/badgesDeleteBadge.ts new file mode 100644 index 0000000..f1fe4fa --- /dev/null +++ b/src/funcs/badgesDeleteBadge.ts @@ -0,0 +1,112 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; +import * as z from "zod"; + +/** + * Delete badge + */ +export async function badgesDeleteBadge( + client$: SDKCore, + id: number, + options?: RequestOptions +): Promise< + Result< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.DeleteBadgeRequest = { + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.DeleteBadgeRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/admin/badges/{id}.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "*/*", + }); + + const context = { operationID: "deleteBadge", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "DELETE", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.nil(200, z.void()))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/badgesListUserBadges.ts b/src/funcs/badgesListUserBadges.ts new file mode 100644 index 0000000..797fbac --- /dev/null +++ b/src/funcs/badgesListUserBadges.ts @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * List badges for a user + */ +export async function badgesListUserBadges( + client$: SDKCore, + username: string, + options?: RequestOptions +): Promise< + Result< + operations.ListUserBadgesResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.ListUserBadgesRequest = { + username: username, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListUserBadgesRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + username: encodeSimple$("username", payload$.username, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/user-badges/{username}.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "listUserBadges", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.ListUserBadgesResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.ListUserBadgesResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/badgesUpdateBadge.ts b/src/funcs/badgesUpdateBadge.ts new file mode 100644 index 0000000..9593815 --- /dev/null +++ b/src/funcs/badgesUpdateBadge.ts @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Update badge + */ +export async function badgesUpdateBadge( + client$: SDKCore, + id: number, + requestBody?: operations.UpdateBadgeRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.UpdateBadgeResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.UpdateBadgeRequest = { + requestBody: requestBody, + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.UpdateBadgeRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/admin/badges/{id}.json")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const context = { operationID: "updateBadge", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.UpdateBadgeResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.UpdateBadgeResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/categoriesCreateCategory.ts b/src/funcs/categoriesCreateCategory.ts new file mode 100644 index 0000000..ea0cd97 --- /dev/null +++ b/src/funcs/categoriesCreateCategory.ts @@ -0,0 +1,106 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Creates a category + */ +export async function categoriesCreateCategory( + client$: SDKCore, + request?: operations.CreateCategoryRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.CreateCategoryResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.CreateCategoryRequestBody$outboundSchema.optional().parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = payload$ === undefined ? null : encodeJSON$("body", payload$, { explode: true }); + + const path$ = pathToFunc("/categories.json")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const context = { operationID: "createCategory", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.CreateCategoryResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.CreateCategoryResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/categoriesGetCategory.ts b/src/funcs/categoriesGetCategory.ts new file mode 100644 index 0000000..c5d37a7 --- /dev/null +++ b/src/funcs/categoriesGetCategory.ts @@ -0,0 +1,111 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Show category + */ +export async function categoriesGetCategory( + client$: SDKCore, + id: number, + options?: RequestOptions +): Promise< + Result< + operations.GetCategoryResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.GetCategoryRequest = { + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetCategoryRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/c/{id}/show.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "getCategory", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.GetCategoryResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.GetCategoryResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/categoriesGetSite.ts b/src/funcs/categoriesGetSite.ts new file mode 100644 index 0000000..e397d58 --- /dev/null +++ b/src/funcs/categoriesGetSite.ts @@ -0,0 +1,91 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import * as m$ from "../lib/matchers.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Get site info + * + * @remarks + * Can be used to fetch all categories and subcategories + */ +export async function categoriesGetSite( + client$: SDKCore, + options?: RequestOptions +): Promise< + Result< + operations.GetSiteResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const path$ = pathToFunc("/site.json")(); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "getSite", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.GetSiteResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.GetSiteResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/categoriesListCategories.ts b/src/funcs/categoriesListCategories.ts new file mode 100644 index 0000000..1a5007a --- /dev/null +++ b/src/funcs/categoriesListCategories.ts @@ -0,0 +1,112 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Retrieves a list of categories + */ +export async function categoriesListCategories( + client$: SDKCore, + includeSubcategories?: boolean | undefined, + options?: RequestOptions +): Promise< + Result< + operations.ListCategoriesResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.ListCategoriesRequest = { + includeSubcategories: includeSubcategories, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListCategoriesRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const path$ = pathToFunc("/categories.json")(); + + const query$ = encodeFormQuery$({ + include_subcategories: payload$.include_subcategories, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "listCategories", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.ListCategoriesResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.ListCategoriesResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/categoriesListCategoryTopics.ts b/src/funcs/categoriesListCategoryTopics.ts new file mode 100644 index 0000000..9c3101b --- /dev/null +++ b/src/funcs/categoriesListCategoryTopics.ts @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * List topics + */ +export async function categoriesListCategoryTopics( + client$: SDKCore, + id: number, + slug: string, + options?: RequestOptions +): Promise< + Result< + operations.ListCategoryTopicsResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.ListCategoryTopicsRequest = { + id: id, + slug: slug, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListCategoryTopicsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + slug: encodeSimple$("slug", payload$.slug, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/c/{slug}/{id}.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "listCategoryTopics", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.ListCategoryTopicsResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.ListCategoryTopicsResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/categoriesUpdateCategory.ts b/src/funcs/categoriesUpdateCategory.ts new file mode 100644 index 0000000..368250c --- /dev/null +++ b/src/funcs/categoriesUpdateCategory.ts @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Updates a category + */ +export async function categoriesUpdateCategory( + client$: SDKCore, + id: number, + requestBody?: operations.UpdateCategoryRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.UpdateCategoryResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.UpdateCategoryRequest = { + requestBody: requestBody, + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.UpdateCategoryRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/categories/{id}.json")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const context = { operationID: "updateCategory", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.UpdateCategoryResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.UpdateCategoryResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/groupsAddGroupMembers.ts b/src/funcs/groupsAddGroupMembers.ts new file mode 100644 index 0000000..4b1581f --- /dev/null +++ b/src/funcs/groupsAddGroupMembers.ts @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Add group members + */ +export async function groupsAddGroupMembers( + client$: SDKCore, + id: number, + requestBody?: operations.AddGroupMembersRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.AddGroupMembersResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.AddGroupMembersRequest = { + requestBody: requestBody, + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.AddGroupMembersRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/groups/{id}/members.json")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const context = { operationID: "addGroupMembers", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.AddGroupMembersResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.AddGroupMembersResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/groupsCreateGroup.ts b/src/funcs/groupsCreateGroup.ts new file mode 100644 index 0000000..025ee4e --- /dev/null +++ b/src/funcs/groupsCreateGroup.ts @@ -0,0 +1,106 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Create a group + */ +export async function groupsCreateGroup( + client$: SDKCore, + request?: operations.CreateGroupRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.CreateGroupResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.CreateGroupRequestBody$outboundSchema.optional().parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = payload$ === undefined ? null : encodeJSON$("body", payload$, { explode: true }); + + const path$ = pathToFunc("/admin/groups.json")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const context = { operationID: "createGroup", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.CreateGroupResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.CreateGroupResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/groupsDeleteGroup.ts b/src/funcs/groupsDeleteGroup.ts new file mode 100644 index 0000000..c954a47 --- /dev/null +++ b/src/funcs/groupsDeleteGroup.ts @@ -0,0 +1,111 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Delete a group + */ +export async function groupsDeleteGroup( + client$: SDKCore, + id: number, + options?: RequestOptions +): Promise< + Result< + operations.DeleteGroupResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.DeleteGroupRequest = { + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.DeleteGroupRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/admin/groups/{id}.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "deleteGroup", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "DELETE", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.DeleteGroupResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.DeleteGroupResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/groupsGetGroup.ts b/src/funcs/groupsGetGroup.ts new file mode 100644 index 0000000..35f808c --- /dev/null +++ b/src/funcs/groupsGetGroup.ts @@ -0,0 +1,111 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Get a group + */ +export async function groupsGetGroup( + client$: SDKCore, + id: string, + options?: RequestOptions +): Promise< + Result< + operations.GetGroupResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.GetGroupRequest = { + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetGroupRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/groups/{id}.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "getGroup", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.GetGroupResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.GetGroupResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/groupsListGroupMembers.ts b/src/funcs/groupsListGroupMembers.ts new file mode 100644 index 0000000..2ef2600 --- /dev/null +++ b/src/funcs/groupsListGroupMembers.ts @@ -0,0 +1,111 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * List group members + */ +export async function groupsListGroupMembers( + client$: SDKCore, + id: string, + options?: RequestOptions +): Promise< + Result< + operations.ListGroupMembersResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.ListGroupMembersRequest = { + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListGroupMembersRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/groups/{id}/members.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "listGroupMembers", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.ListGroupMembersResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.ListGroupMembersResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/groupsListGroups.ts b/src/funcs/groupsListGroups.ts new file mode 100644 index 0000000..c6cda7e --- /dev/null +++ b/src/funcs/groupsListGroups.ts @@ -0,0 +1,88 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import * as m$ from "../lib/matchers.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * List groups + */ +export async function groupsListGroups( + client$: SDKCore, + options?: RequestOptions +): Promise< + Result< + operations.ListGroupsResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const path$ = pathToFunc("/groups.json")(); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "listGroups", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.ListGroupsResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.ListGroupsResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/groupsRemoveGroupMembers.ts b/src/funcs/groupsRemoveGroupMembers.ts new file mode 100644 index 0000000..89e6b65 --- /dev/null +++ b/src/funcs/groupsRemoveGroupMembers.ts @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Remove group members + */ +export async function groupsRemoveGroupMembers( + client$: SDKCore, + id: number, + requestBody?: operations.RemoveGroupMembersRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.RemoveGroupMembersResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.RemoveGroupMembersRequest = { + requestBody: requestBody, + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.RemoveGroupMembersRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/groups/{id}/members.json")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const context = { operationID: "removeGroupMembers", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "DELETE", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.RemoveGroupMembersResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.RemoveGroupMembersResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/groupsUpdateGroup.ts b/src/funcs/groupsUpdateGroup.ts new file mode 100644 index 0000000..fd2fbfd --- /dev/null +++ b/src/funcs/groupsUpdateGroup.ts @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Update a group + */ +export async function groupsUpdateGroup( + client$: SDKCore, + id: number, + requestBody?: operations.UpdateGroupRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.UpdateGroupResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.UpdateGroupRequest = { + requestBody: requestBody, + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.UpdateGroupRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/groups/{id}.json")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const context = { operationID: "updateGroup", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.UpdateGroupResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.UpdateGroupResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/invitesCreateInvite.ts b/src/funcs/invitesCreateInvite.ts new file mode 100644 index 0000000..20a48dd --- /dev/null +++ b/src/funcs/invitesCreateInvite.ts @@ -0,0 +1,120 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Create an invite + */ +export async function invitesCreateInvite( + client$: SDKCore, + apiKey: string, + apiUsername: string, + requestBody?: operations.CreateInviteRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.CreateInviteResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.CreateInviteRequest = { + apiKey: apiKey, + apiUsername: apiUsername, + requestBody: requestBody, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.CreateInviteRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); + + const path$ = pathToFunc("/invites.json")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + "Api-Key": encodeSimple$("Api-Key", payload$["Api-Key"], { + explode: false, + charEncoding: "none", + }), + "Api-Username": encodeSimple$("Api-Username", payload$["Api-Username"], { + explode: false, + charEncoding: "none", + }), + }); + + const context = { operationID: "createInvite", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.CreateInviteResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.CreateInviteResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/invitesInviteToTopic.ts b/src/funcs/invitesInviteToTopic.ts new file mode 100644 index 0000000..caeba68 --- /dev/null +++ b/src/funcs/invitesInviteToTopic.ts @@ -0,0 +1,126 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Invite to topic + */ +export async function invitesInviteToTopic( + client$: SDKCore, + apiKey: string, + apiUsername: string, + id: string, + requestBody?: operations.InviteToTopicRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.InviteToTopicResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.InviteToTopicRequest = { + apiKey: apiKey, + apiUsername: apiUsername, + requestBody: requestBody, + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.InviteToTopicRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/t/{id}/invite.json")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + "Api-Key": encodeSimple$("Api-Key", payload$["Api-Key"], { + explode: false, + charEncoding: "none", + }), + "Api-Username": encodeSimple$("Api-Username", payload$["Api-Username"], { + explode: false, + charEncoding: "none", + }), + }); + + const context = { operationID: "inviteToTopic", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.InviteToTopicResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.InviteToTopicResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/notificationsGetNotifications.ts b/src/funcs/notificationsGetNotifications.ts new file mode 100644 index 0000000..77c3820 --- /dev/null +++ b/src/funcs/notificationsGetNotifications.ts @@ -0,0 +1,88 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import * as m$ from "../lib/matchers.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Get the notifications that belong to the current user + */ +export async function notificationsGetNotifications( + client$: SDKCore, + options?: RequestOptions +): Promise< + Result< + operations.GetNotificationsResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const path$ = pathToFunc("/notifications.json")(); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "getNotifications", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.GetNotificationsResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.GetNotificationsResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/notificationsMarkNotificationsAsRead.ts b/src/funcs/notificationsMarkNotificationsAsRead.ts new file mode 100644 index 0000000..19c2833 --- /dev/null +++ b/src/funcs/notificationsMarkNotificationsAsRead.ts @@ -0,0 +1,111 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Mark notifications as read + */ +export async function notificationsMarkNotificationsAsRead( + client$: SDKCore, + request?: operations.MarkNotificationsAsReadRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.MarkNotificationsAsReadResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.MarkNotificationsAsReadRequestBody$outboundSchema.optional().parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = payload$ === undefined ? null : encodeJSON$("body", payload$, { explode: true }); + + const path$ = pathToFunc("/notifications/mark-read.json")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const context = { + operationID: "markNotificationsAsRead", + oAuth2Scopes: [], + securitySource: null, + }; + + const requestRes = client$.createRequest$( + context, + { + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.MarkNotificationsAsReadResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.MarkNotificationsAsReadResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/postsCreateTopicPostPM.ts b/src/funcs/postsCreateTopicPostPM.ts new file mode 100644 index 0000000..528a6cd --- /dev/null +++ b/src/funcs/postsCreateTopicPostPM.ts @@ -0,0 +1,106 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Creates a new topic, a new post, or a private message + */ +export async function postsCreateTopicPostPM( + client$: SDKCore, + request?: operations.CreateTopicPostPMRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.CreateTopicPostPMResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.CreateTopicPostPMRequestBody$outboundSchema.optional().parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = payload$ === undefined ? null : encodeJSON$("body", payload$, { explode: true }); + + const path$ = pathToFunc("/posts.json")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const context = { operationID: "createTopicPostPM", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.CreateTopicPostPMResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.CreateTopicPostPMResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/postsDeletePost.ts b/src/funcs/postsDeletePost.ts new file mode 100644 index 0000000..3888b7c --- /dev/null +++ b/src/funcs/postsDeletePost.ts @@ -0,0 +1,115 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; +import * as z from "zod"; + +/** + * delete a single post + */ +export async function postsDeletePost( + client$: SDKCore, + id: number, + requestBody?: operations.DeletePostRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.DeletePostRequest = { + requestBody: requestBody, + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.DeletePostRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/posts/{id}.json")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "*/*", + }); + + const context = { operationID: "deletePost", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "DELETE", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.nil(200, z.void()))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/postsGetPost.ts b/src/funcs/postsGetPost.ts new file mode 100644 index 0000000..cc2d1ee --- /dev/null +++ b/src/funcs/postsGetPost.ts @@ -0,0 +1,119 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Retrieve a single post + * + * @remarks + * This endpoint can be used to get the number of likes on a post using the + * `actions_summary` property in the response. `actions_summary` responses + * with the id of `2` signify a `like`. If there are no `actions_summary` + * items with the id of `2`, that means there are 0 likes. Other ids likely + * refer to various different flag types. + * + */ +export async function postsGetPost( + client$: SDKCore, + id: string, + options?: RequestOptions +): Promise< + Result< + operations.GetPostResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.GetPostRequest = { + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetPostRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/posts/{id}.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "getPost", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.GetPostResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.GetPostResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/postsListPosts.ts b/src/funcs/postsListPosts.ts new file mode 100644 index 0000000..a2e0484 --- /dev/null +++ b/src/funcs/postsListPosts.ts @@ -0,0 +1,127 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * List latest posts across topics + */ +export async function postsListPosts( + client$: SDKCore, + apiKey: string, + apiUsername: string, + before?: string | undefined, + options?: RequestOptions +): Promise< + Result< + operations.ListPostsResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.ListPostsRequest = { + apiKey: apiKey, + apiUsername: apiUsername, + before: before, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListPostsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const path$ = pathToFunc("/posts.json")(); + + const query$ = encodeFormQuery$({ + before: payload$.before, + }); + + const headers$ = new Headers({ + Accept: "application/json", + "Api-Key": encodeSimple$("Api-Key", payload$["Api-Key"], { + explode: false, + charEncoding: "none", + }), + "Api-Username": encodeSimple$("Api-Username", payload$["Api-Username"], { + explode: false, + charEncoding: "none", + }), + }); + + const context = { operationID: "listPosts", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.ListPostsResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.ListPostsResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/postsLockPost.ts b/src/funcs/postsLockPost.ts new file mode 100644 index 0000000..971e60b --- /dev/null +++ b/src/funcs/postsLockPost.ts @@ -0,0 +1,126 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Lock a post from being edited + */ +export async function postsLockPost( + client$: SDKCore, + apiKey: string, + apiUsername: string, + id: string, + requestBody?: operations.LockPostRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.LockPostResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.LockPostRequest = { + apiKey: apiKey, + apiUsername: apiUsername, + requestBody: requestBody, + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.LockPostRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/posts/{id}/locked.json")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + "Api-Key": encodeSimple$("Api-Key", payload$["Api-Key"], { + explode: false, + charEncoding: "none", + }), + "Api-Username": encodeSimple$("Api-Username", payload$["Api-Username"], { + explode: false, + charEncoding: "none", + }), + }); + + const context = { operationID: "lockPost", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.LockPostResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.LockPostResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/postsPerformPostAction.ts b/src/funcs/postsPerformPostAction.ts new file mode 100644 index 0000000..55717f7 --- /dev/null +++ b/src/funcs/postsPerformPostAction.ts @@ -0,0 +1,120 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Like a post and other actions + */ +export async function postsPerformPostAction( + client$: SDKCore, + apiKey: string, + apiUsername: string, + requestBody?: operations.PerformPostActionRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.PerformPostActionResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.PerformPostActionRequest = { + apiKey: apiKey, + apiUsername: apiUsername, + requestBody: requestBody, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.PerformPostActionRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); + + const path$ = pathToFunc("/post_actions.json")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + "Api-Key": encodeSimple$("Api-Key", payload$["Api-Key"], { + explode: false, + charEncoding: "none", + }), + "Api-Username": encodeSimple$("Api-Username", payload$["Api-Username"], { + explode: false, + charEncoding: "none", + }), + }); + + const context = { operationID: "performPostAction", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.PerformPostActionResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.PerformPostActionResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/postsPostReplies.ts b/src/funcs/postsPostReplies.ts new file mode 100644 index 0000000..585bece --- /dev/null +++ b/src/funcs/postsPostReplies.ts @@ -0,0 +1,112 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; +import * as z from "zod"; + +/** + * List replies to a post + */ +export async function postsPostReplies( + client$: SDKCore, + id: string, + options?: RequestOptions +): Promise< + Result< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.PostRepliesRequest = { + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.PostRepliesRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/posts/{id}/replies.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "postReplies", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, z.array(operations.PostRepliesResponseBody$inboundSchema)))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/postsUpdatePost.ts b/src/funcs/postsUpdatePost.ts new file mode 100644 index 0000000..1157005 --- /dev/null +++ b/src/funcs/postsUpdatePost.ts @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Update a single post + */ +export async function postsUpdatePost( + client$: SDKCore, + id: string, + requestBody?: operations.UpdatePostRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.UpdatePostResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.UpdatePostRequest = { + requestBody: requestBody, + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.UpdatePostRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/posts/{id}.json")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const context = { operationID: "updatePost", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.UpdatePostResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.UpdatePostResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/privateMessagesCreateTopicPostPM.ts b/src/funcs/privateMessagesCreateTopicPostPM.ts new file mode 100644 index 0000000..980a9c6 --- /dev/null +++ b/src/funcs/privateMessagesCreateTopicPostPM.ts @@ -0,0 +1,106 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Creates a new topic, a new post, or a private message + */ +export async function privateMessagesCreateTopicPostPM( + client$: SDKCore, + request?: operations.CreateTopicPostPMRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.CreateTopicPostPMResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.CreateTopicPostPMRequestBody$outboundSchema.optional().parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = payload$ === undefined ? null : encodeJSON$("body", payload$, { explode: true }); + + const path$ = pathToFunc("/posts.json")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const context = { operationID: "createTopicPostPM", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.CreateTopicPostPMResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.CreateTopicPostPMResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/privateMessagesGetUserSentPrivateMessages.ts b/src/funcs/privateMessagesGetUserSentPrivateMessages.ts new file mode 100644 index 0000000..838ce89 --- /dev/null +++ b/src/funcs/privateMessagesGetUserSentPrivateMessages.ts @@ -0,0 +1,118 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Get a list of private messages sent for a user + */ +export async function privateMessagesGetUserSentPrivateMessages( + client$: SDKCore, + username: string, + options?: RequestOptions +): Promise< + Result< + operations.GetUserSentPrivateMessagesResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.GetUserSentPrivateMessagesRequest = { + username: username, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetUserSentPrivateMessagesRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + username: encodeSimple$("username", payload$.username, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/topics/private-messages-sent/{username}.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { + operationID: "getUserSentPrivateMessages", + oAuth2Scopes: [], + securitySource: null, + }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.GetUserSentPrivateMessagesResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.GetUserSentPrivateMessagesResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/privateMessagesListUserPrivateMessages.ts b/src/funcs/privateMessagesListUserPrivateMessages.ts new file mode 100644 index 0000000..3fde4ff --- /dev/null +++ b/src/funcs/privateMessagesListUserPrivateMessages.ts @@ -0,0 +1,118 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Get a list of private messages for a user + */ +export async function privateMessagesListUserPrivateMessages( + client$: SDKCore, + username: string, + options?: RequestOptions +): Promise< + Result< + operations.ListUserPrivateMessagesResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.ListUserPrivateMessagesRequest = { + username: username, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListUserPrivateMessagesRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + username: encodeSimple$("username", payload$.username, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/topics/private-messages/{username}.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { + operationID: "listUserPrivateMessages", + oAuth2Scopes: [], + securitySource: null, + }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.ListUserPrivateMessagesResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.ListUserPrivateMessagesResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/searchSearch.ts b/src/funcs/searchSearch.ts new file mode 100644 index 0000000..e667908 --- /dev/null +++ b/src/funcs/searchSearch.ts @@ -0,0 +1,115 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Search for a term + */ +export async function searchSearch( + client$: SDKCore, + page?: number | undefined, + q?: string | undefined, + options?: RequestOptions +): Promise< + Result< + operations.SearchResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.SearchRequest = { + page: page, + q: q, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.SearchRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const path$ = pathToFunc("/search.json")(); + + const query$ = encodeFormQuery$({ + page: payload$.page, + q: payload$.q, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "search", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.SearchResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.SearchResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/siteGetSite.ts b/src/funcs/siteGetSite.ts new file mode 100644 index 0000000..92f3989 --- /dev/null +++ b/src/funcs/siteGetSite.ts @@ -0,0 +1,91 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import * as m$ from "../lib/matchers.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Get site info + * + * @remarks + * Can be used to fetch all categories and subcategories + */ +export async function siteGetSite( + client$: SDKCore, + options?: RequestOptions +): Promise< + Result< + operations.GetSiteResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const path$ = pathToFunc("/site.json")(); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "getSite", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.GetSiteResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.GetSiteResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/tagsCreateTagGroup.ts b/src/funcs/tagsCreateTagGroup.ts new file mode 100644 index 0000000..d2a2340 --- /dev/null +++ b/src/funcs/tagsCreateTagGroup.ts @@ -0,0 +1,106 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Creates a tag group + */ +export async function tagsCreateTagGroup( + client$: SDKCore, + request?: operations.CreateTagGroupRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.CreateTagGroupResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.CreateTagGroupRequestBody$outboundSchema.optional().parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = payload$ === undefined ? null : encodeJSON$("body", payload$, { explode: true }); + + const path$ = pathToFunc("/tag_groups.json")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const context = { operationID: "createTagGroup", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.CreateTagGroupResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.CreateTagGroupResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/tagsGetTag.ts b/src/funcs/tagsGetTag.ts new file mode 100644 index 0000000..34b32a5 --- /dev/null +++ b/src/funcs/tagsGetTag.ts @@ -0,0 +1,111 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Get a specific tag + */ +export async function tagsGetTag( + client$: SDKCore, + name: string, + options?: RequestOptions +): Promise< + Result< + operations.GetTagResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.GetTagRequest = { + name: name, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetTagRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + name: encodeSimple$("name", payload$.name, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/tag/{name}.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "getTag", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.GetTagResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.GetTagResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/tagsGetTagGroup.ts b/src/funcs/tagsGetTagGroup.ts new file mode 100644 index 0000000..f890b64 --- /dev/null +++ b/src/funcs/tagsGetTagGroup.ts @@ -0,0 +1,111 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Get a single tag group + */ +export async function tagsGetTagGroup( + client$: SDKCore, + id: string, + options?: RequestOptions +): Promise< + Result< + operations.GetTagGroupResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.GetTagGroupRequest = { + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetTagGroupRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/tag_groups/{id}.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "getTagGroup", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.GetTagGroupResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.GetTagGroupResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/tagsListTagGroups.ts b/src/funcs/tagsListTagGroups.ts new file mode 100644 index 0000000..e44b8a8 --- /dev/null +++ b/src/funcs/tagsListTagGroups.ts @@ -0,0 +1,88 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import * as m$ from "../lib/matchers.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Get a list of tag groups + */ +export async function tagsListTagGroups( + client$: SDKCore, + options?: RequestOptions +): Promise< + Result< + operations.ListTagGroupsResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const path$ = pathToFunc("/tag_groups.json")(); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "listTagGroups", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.ListTagGroupsResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.ListTagGroupsResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/tagsListTags.ts b/src/funcs/tagsListTags.ts new file mode 100644 index 0000000..b2f2f24 --- /dev/null +++ b/src/funcs/tagsListTags.ts @@ -0,0 +1,88 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import * as m$ from "../lib/matchers.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Get a list of tags + */ +export async function tagsListTags( + client$: SDKCore, + options?: RequestOptions +): Promise< + Result< + operations.ListTagsResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const path$ = pathToFunc("/tags.json")(); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "listTags", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.ListTagsResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.ListTagsResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/tagsUpdateTagGroup.ts b/src/funcs/tagsUpdateTagGroup.ts new file mode 100644 index 0000000..2d99ded --- /dev/null +++ b/src/funcs/tagsUpdateTagGroup.ts @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Update tag group + */ +export async function tagsUpdateTagGroup( + client$: SDKCore, + id: string, + requestBody?: operations.UpdateTagGroupRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.UpdateTagGroupResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.UpdateTagGroupRequest = { + requestBody: requestBody, + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.UpdateTagGroupRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/tag_groups/{id}.json")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const context = { operationID: "updateTagGroup", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.UpdateTagGroupResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.UpdateTagGroupResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/topicsBookmarkTopic.ts b/src/funcs/topicsBookmarkTopic.ts new file mode 100644 index 0000000..e0286ae --- /dev/null +++ b/src/funcs/topicsBookmarkTopic.ts @@ -0,0 +1,124 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; +import * as z from "zod"; + +/** + * Bookmark topic + */ +export async function topicsBookmarkTopic( + client$: SDKCore, + apiKey: string, + apiUsername: string, + id: string, + options?: RequestOptions +): Promise< + Result< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.BookmarkTopicRequest = { + apiKey: apiKey, + apiUsername: apiUsername, + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.BookmarkTopicRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/t/{id}/bookmark.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "*/*", + "Api-Key": encodeSimple$("Api-Key", payload$["Api-Key"], { + explode: false, + charEncoding: "none", + }), + "Api-Username": encodeSimple$("Api-Username", payload$["Api-Username"], { + explode: false, + charEncoding: "none", + }), + }); + + const context = { operationID: "bookmarkTopic", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.nil(200, z.void()))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/topicsCreateTopicPostPM.ts b/src/funcs/topicsCreateTopicPostPM.ts new file mode 100644 index 0000000..14e22ea --- /dev/null +++ b/src/funcs/topicsCreateTopicPostPM.ts @@ -0,0 +1,106 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Creates a new topic, a new post, or a private message + */ +export async function topicsCreateTopicPostPM( + client$: SDKCore, + request?: operations.CreateTopicPostPMRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.CreateTopicPostPMResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.CreateTopicPostPMRequestBody$outboundSchema.optional().parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = payload$ === undefined ? null : encodeJSON$("body", payload$, { explode: true }); + + const path$ = pathToFunc("/posts.json")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const context = { operationID: "createTopicPostPM", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.CreateTopicPostPMResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.CreateTopicPostPMResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/topicsCreateTopicTimer.ts b/src/funcs/topicsCreateTopicTimer.ts new file mode 100644 index 0000000..12f410f --- /dev/null +++ b/src/funcs/topicsCreateTopicTimer.ts @@ -0,0 +1,126 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Create topic timer + */ +export async function topicsCreateTopicTimer( + client$: SDKCore, + apiKey: string, + apiUsername: string, + id: string, + requestBody?: operations.CreateTopicTimerRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.CreateTopicTimerResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.CreateTopicTimerRequest = { + apiKey: apiKey, + apiUsername: apiUsername, + requestBody: requestBody, + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.CreateTopicTimerRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/t/{id}/timer.json")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + "Api-Key": encodeSimple$("Api-Key", payload$["Api-Key"], { + explode: false, + charEncoding: "none", + }), + "Api-Username": encodeSimple$("Api-Username", payload$["Api-Username"], { + explode: false, + charEncoding: "none", + }), + }); + + const context = { operationID: "createTopicTimer", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.CreateTopicTimerResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.CreateTopicTimerResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/topicsGetTopic.ts b/src/funcs/topicsGetTopic.ts new file mode 100644 index 0000000..a1616c6 --- /dev/null +++ b/src/funcs/topicsGetTopic.ts @@ -0,0 +1,123 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Get a single topic + */ +export async function topicsGetTopic( + client$: SDKCore, + apiKey: string, + apiUsername: string, + id: string, + options?: RequestOptions +): Promise< + Result< + operations.GetTopicResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.GetTopicRequest = { + apiKey: apiKey, + apiUsername: apiUsername, + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetTopicRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/t/{id}.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + "Api-Key": encodeSimple$("Api-Key", payload$["Api-Key"], { + explode: false, + charEncoding: "none", + }), + "Api-Username": encodeSimple$("Api-Username", payload$["Api-Username"], { + explode: false, + charEncoding: "none", + }), + }); + + const context = { operationID: "getTopic", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.GetTopicResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.GetTopicResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/topicsGetTopicByExternalId.ts b/src/funcs/topicsGetTopicByExternalId.ts new file mode 100644 index 0000000..03306b7 --- /dev/null +++ b/src/funcs/topicsGetTopicByExternalId.ts @@ -0,0 +1,115 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; +import * as z from "zod"; + +/** + * Get topic by external_id + */ +export async function topicsGetTopicByExternalId( + client$: SDKCore, + externalId: string, + options?: RequestOptions +): Promise< + Result< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.GetTopicByExternalIdRequest = { + externalId: externalId, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetTopicByExternalIdRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + external_id: encodeSimple$("external_id", payload$.external_id, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/t/external_id/{external_id}.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "*/*", + }); + + const context = { operationID: "getTopicByExternalId", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.nil(301, z.void()))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/topicsInviteToTopic.ts b/src/funcs/topicsInviteToTopic.ts new file mode 100644 index 0000000..9c5403c --- /dev/null +++ b/src/funcs/topicsInviteToTopic.ts @@ -0,0 +1,126 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Invite to topic + */ +export async function topicsInviteToTopic( + client$: SDKCore, + apiKey: string, + apiUsername: string, + id: string, + requestBody?: operations.InviteToTopicRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.InviteToTopicResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.InviteToTopicRequest = { + apiKey: apiKey, + apiUsername: apiUsername, + requestBody: requestBody, + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.InviteToTopicRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/t/{id}/invite.json")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + "Api-Key": encodeSimple$("Api-Key", payload$["Api-Key"], { + explode: false, + charEncoding: "none", + }), + "Api-Username": encodeSimple$("Api-Username", payload$["Api-Username"], { + explode: false, + charEncoding: "none", + }), + }); + + const context = { operationID: "inviteToTopic", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.InviteToTopicResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.InviteToTopicResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/topicsListLatestTopics.ts b/src/funcs/topicsListLatestTopics.ts new file mode 100644 index 0000000..d88a775 --- /dev/null +++ b/src/funcs/topicsListLatestTopics.ts @@ -0,0 +1,130 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Get the latest topics + */ +export async function topicsListLatestTopics( + client$: SDKCore, + apiKey: string, + apiUsername: string, + ascending?: string | undefined, + order?: string | undefined, + options?: RequestOptions +): Promise< + Result< + operations.ListLatestTopicsResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.ListLatestTopicsRequest = { + apiKey: apiKey, + apiUsername: apiUsername, + ascending: ascending, + order: order, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListLatestTopicsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const path$ = pathToFunc("/latest.json")(); + + const query$ = encodeFormQuery$({ + ascending: payload$.ascending, + order: payload$.order, + }); + + const headers$ = new Headers({ + Accept: "application/json", + "Api-Key": encodeSimple$("Api-Key", payload$["Api-Key"], { + explode: false, + charEncoding: "none", + }), + "Api-Username": encodeSimple$("Api-Username", payload$["Api-Username"], { + explode: false, + charEncoding: "none", + }), + }); + + const context = { operationID: "listLatestTopics", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.ListLatestTopicsResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.ListLatestTopicsResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/topicsListTopTopics.ts b/src/funcs/topicsListTopTopics.ts new file mode 100644 index 0000000..205dab4 --- /dev/null +++ b/src/funcs/topicsListTopTopics.ts @@ -0,0 +1,127 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Get the top topics filtered by period + */ +export async function topicsListTopTopics( + client$: SDKCore, + apiKey: string, + apiUsername: string, + period?: string | undefined, + options?: RequestOptions +): Promise< + Result< + operations.ListTopTopicsResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.ListTopTopicsRequest = { + apiKey: apiKey, + apiUsername: apiUsername, + period: period, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListTopTopicsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const path$ = pathToFunc("/top.json")(); + + const query$ = encodeFormQuery$({ + period: payload$.period, + }); + + const headers$ = new Headers({ + Accept: "application/json", + "Api-Key": encodeSimple$("Api-Key", payload$["Api-Key"], { + explode: false, + charEncoding: "none", + }), + "Api-Username": encodeSimple$("Api-Username", payload$["Api-Username"], { + explode: false, + charEncoding: "none", + }), + }); + + const context = { operationID: "listTopTopics", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.ListTopTopicsResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.ListTopTopicsResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/topicsRemoveTopic.ts b/src/funcs/topicsRemoveTopic.ts new file mode 100644 index 0000000..4154657 --- /dev/null +++ b/src/funcs/topicsRemoveTopic.ts @@ -0,0 +1,124 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; +import * as z from "zod"; + +/** + * Remove a topic + */ +export async function topicsRemoveTopic( + client$: SDKCore, + apiKey: string, + apiUsername: string, + id: string, + options?: RequestOptions +): Promise< + Result< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.RemoveTopicRequest = { + apiKey: apiKey, + apiUsername: apiUsername, + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.RemoveTopicRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/t/{id}.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "*/*", + "Api-Key": encodeSimple$("Api-Key", payload$["Api-Key"], { + explode: false, + charEncoding: "none", + }), + "Api-Username": encodeSimple$("Api-Username", payload$["Api-Username"], { + explode: false, + charEncoding: "none", + }), + }); + + const context = { operationID: "removeTopic", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "DELETE", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.nil(200, z.void()))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/topicsSetNotificationLevel.ts b/src/funcs/topicsSetNotificationLevel.ts new file mode 100644 index 0000000..d554142 --- /dev/null +++ b/src/funcs/topicsSetNotificationLevel.ts @@ -0,0 +1,126 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Set notification level + */ +export async function topicsSetNotificationLevel( + client$: SDKCore, + apiKey: string, + apiUsername: string, + id: string, + requestBody?: operations.SetNotificationLevelRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.SetNotificationLevelResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.SetNotificationLevelRequest = { + apiKey: apiKey, + apiUsername: apiUsername, + requestBody: requestBody, + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.SetNotificationLevelRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/t/{id}/notifications.json")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + "Api-Key": encodeSimple$("Api-Key", payload$["Api-Key"], { + explode: false, + charEncoding: "none", + }), + "Api-Username": encodeSimple$("Api-Username", payload$["Api-Username"], { + explode: false, + charEncoding: "none", + }), + }); + + const context = { operationID: "setNotificationLevel", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.SetNotificationLevelResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.SetNotificationLevelResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/topicsUpdateTopic.ts b/src/funcs/topicsUpdateTopic.ts new file mode 100644 index 0000000..54319b8 --- /dev/null +++ b/src/funcs/topicsUpdateTopic.ts @@ -0,0 +1,126 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Update a topic + */ +export async function topicsUpdateTopic( + client$: SDKCore, + apiKey: string, + apiUsername: string, + id: string, + requestBody?: operations.UpdateTopicRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.UpdateTopicResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.UpdateTopicRequest = { + apiKey: apiKey, + apiUsername: apiUsername, + requestBody: requestBody, + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.UpdateTopicRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/t/-/{id}.json")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + "Api-Key": encodeSimple$("Api-Key", payload$["Api-Key"], { + explode: false, + charEncoding: "none", + }), + "Api-Username": encodeSimple$("Api-Username", payload$["Api-Username"], { + explode: false, + charEncoding: "none", + }), + }); + + const context = { operationID: "updateTopic", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.UpdateTopicResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.UpdateTopicResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/topicsUpdateTopicStatus.ts b/src/funcs/topicsUpdateTopicStatus.ts new file mode 100644 index 0000000..b7f7943 --- /dev/null +++ b/src/funcs/topicsUpdateTopicStatus.ts @@ -0,0 +1,126 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Update the status of a topic + */ +export async function topicsUpdateTopicStatus( + client$: SDKCore, + apiKey: string, + apiUsername: string, + id: string, + requestBody?: operations.UpdateTopicStatusRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.UpdateTopicStatusResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.UpdateTopicStatusRequest = { + apiKey: apiKey, + apiUsername: apiUsername, + requestBody: requestBody, + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.UpdateTopicStatusRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/t/{id}/status.json")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + "Api-Key": encodeSimple$("Api-Key", payload$["Api-Key"], { + explode: false, + charEncoding: "none", + }), + "Api-Username": encodeSimple$("Api-Username", payload$["Api-Username"], { + explode: false, + charEncoding: "none", + }), + }); + + const context = { operationID: "updateTopicStatus", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.UpdateTopicStatusResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.UpdateTopicStatusResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/topicsUpdateTopicTimestamp.ts b/src/funcs/topicsUpdateTopicTimestamp.ts new file mode 100644 index 0000000..cc3c6e2 --- /dev/null +++ b/src/funcs/topicsUpdateTopicTimestamp.ts @@ -0,0 +1,126 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Update topic timestamp + */ +export async function topicsUpdateTopicTimestamp( + client$: SDKCore, + apiKey: string, + apiUsername: string, + id: string, + requestBody?: operations.UpdateTopicTimestampRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.UpdateTopicTimestampResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.UpdateTopicTimestampRequest = { + apiKey: apiKey, + apiUsername: apiUsername, + requestBody: requestBody, + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.UpdateTopicTimestampRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/t/{id}/change-timestamp.json")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + "Api-Key": encodeSimple$("Api-Key", payload$["Api-Key"], { + explode: false, + charEncoding: "none", + }), + "Api-Username": encodeSimple$("Api-Username", payload$["Api-Username"], { + explode: false, + charEncoding: "none", + }), + }); + + const context = { operationID: "updateTopicTimestamp", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.UpdateTopicTimestampResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.UpdateTopicTimestampResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/uploadsAbortMultipart.ts b/src/funcs/uploadsAbortMultipart.ts new file mode 100644 index 0000000..2911359 --- /dev/null +++ b/src/funcs/uploadsAbortMultipart.ts @@ -0,0 +1,121 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Abort multipart upload + * + * @remarks + * This endpoint aborts the multipart upload initiated with /create-multipart. + * This should be used when cancelling the upload. It does not matter if parts + * were already uploaded into the external storage provider. + * + * You must have the correct permissions and CORS settings configured in your + * external provider. We support AWS S3 as the default. See: + * + * https://meta.discourse.org/t/-/210469#s3-multipart-direct-uploads-4. + * + * An external file store must be set up and `enable_direct_s3_uploads` must + * be set to true for this endpoint to function. + * + * + */ +export async function uploadsAbortMultipart( + client$: SDKCore, + request?: operations.AbortMultipartRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.AbortMultipartResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.AbortMultipartRequestBody$outboundSchema.optional().parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = payload$ === undefined ? null : encodeJSON$("body", payload$, { explode: true }); + + const path$ = pathToFunc("/uploads/abort-multipart.json")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const context = { operationID: "abortMultipart", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.AbortMultipartResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.AbortMultipartResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/uploadsBatchPresignMultipartParts.ts b/src/funcs/uploadsBatchPresignMultipartParts.ts new file mode 100644 index 0000000..4f578d7 --- /dev/null +++ b/src/funcs/uploadsBatchPresignMultipartParts.ts @@ -0,0 +1,137 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Generates batches of presigned URLs for multipart parts + * + * @remarks + * Multipart uploads are uploaded in chunks or parts to individual presigned + * URLs, similar to the one generated by /generate-presigned-put. The part + * numbers provided must be between 1 and 10000. The total number of parts + * will depend on the chunk size in bytes that you intend to use to upload + * each chunk. For example a 12MB file may have 2 5MB chunks and a final + * 2MB chunk, for part numbers 1, 2, and 3. + * + * This endpoint will return a presigned URL for each part number provided, + * which you can then use to send PUT requests for the binary chunk corresponding + * to that part. When the part is uploaded, the provider should return an + * ETag for the part, and this should be stored along with the part number, + * because this is needed to complete the multipart upload. + * + * You must have the correct permissions and CORS settings configured in your + * external provider. We support AWS S3 as the default. See: + * + * https://meta.discourse.org/t/-/210469#s3-multipart-direct-uploads-4. + * + * An external file store must be set up and `enable_direct_s3_uploads` must + * be set to true for this endpoint to function. + * + * + */ +export async function uploadsBatchPresignMultipartParts( + client$: SDKCore, + request?: operations.BatchPresignMultipartPartsRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.BatchPresignMultipartPartsResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.BatchPresignMultipartPartsRequestBody$outboundSchema.optional().parse( + value$ + ), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = payload$ === undefined ? null : encodeJSON$("body", payload$, { explode: true }); + + const path$ = pathToFunc("/uploads/batch-presign-multipart-parts.json")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const context = { + operationID: "batchPresignMultipartParts", + oAuth2Scopes: [], + securitySource: null, + }; + + const requestRes = client$.createRequest$( + context, + { + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.BatchPresignMultipartPartsResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.BatchPresignMultipartPartsResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/uploadsCompleteExternalUpload.ts b/src/funcs/uploadsCompleteExternalUpload.ts new file mode 100644 index 0000000..1082548 --- /dev/null +++ b/src/funcs/uploadsCompleteExternalUpload.ts @@ -0,0 +1,131 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Completes a direct external upload + * + * @remarks + * Completes an external upload initialized with /get-presigned-put. The + * file will be moved from its temporary location in external storage to + * a final destination in the S3 bucket. An Upload record will also be + * created in the database in most cases. + * + * If a sha1-checksum was provided in the initial request it will also + * be compared with the uploaded file in storage to make sure the same + * file was uploaded. The file size will be compared for the same reason. + * + * You must have the correct permissions and CORS settings configured in your + * external provider. We support AWS S3 as the default. See: + * + * https://meta.discourse.org/t/-/210469#s3-multipart-direct-uploads-4. + * + * An external file store must be set up and `enable_direct_s3_uploads` must + * be set to true for this endpoint to function. + * + * + */ +export async function uploadsCompleteExternalUpload( + client$: SDKCore, + request?: operations.CompleteExternalUploadRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.CompleteExternalUploadResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.CompleteExternalUploadRequestBody$outboundSchema.optional().parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = payload$ === undefined ? null : encodeJSON$("body", payload$, { explode: true }); + + const path$ = pathToFunc("/uploads/complete-external-upload.json")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const context = { + operationID: "completeExternalUpload", + oAuth2Scopes: [], + securitySource: null, + }; + + const requestRes = client$.createRequest$( + context, + { + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.CompleteExternalUploadResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.CompleteExternalUploadResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/uploadsCompleteMultipart.ts b/src/funcs/uploadsCompleteMultipart.ts new file mode 100644 index 0000000..74d7ebe --- /dev/null +++ b/src/funcs/uploadsCompleteMultipart.ts @@ -0,0 +1,123 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Complete multipart upload + * + * @remarks + * Completes the multipart upload in the external store, and copies the + * file from its temporary location to its final location in the store. + * All of the parts must have been uploaded to the external storage provider. + * An Upload record will be completed in most cases once the file is copied + * to its final location. + * + * You must have the correct permissions and CORS settings configured in your + * external provider. We support AWS S3 as the default. See: + * + * https://meta.discourse.org/t/-/210469#s3-multipart-direct-uploads-4. + * + * An external file store must be set up and `enable_direct_s3_uploads` must + * be set to true for this endpoint to function. + * + * + */ +export async function uploadsCompleteMultipart( + client$: SDKCore, + request?: operations.CompleteMultipartRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.CompleteMultipartResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.CompleteMultipartRequestBody$outboundSchema.optional().parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = payload$ === undefined ? null : encodeJSON$("body", payload$, { explode: true }); + + const path$ = pathToFunc("/uploads/complete-multipart.json")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const context = { operationID: "completeMultipart", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.CompleteMultipartResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.CompleteMultipartResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/uploadsCreateMultipartUpload.ts b/src/funcs/uploadsCreateMultipartUpload.ts new file mode 100644 index 0000000..54ceccf --- /dev/null +++ b/src/funcs/uploadsCreateMultipartUpload.ts @@ -0,0 +1,125 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Creates a multipart external upload + * + * @remarks + * Creates a multipart upload in the external storage provider, storing + * a temporary reference to the external upload similar to /get-presigned-put. + * + * You must have the correct permissions and CORS settings configured in your + * external provider. We support AWS S3 as the default. See: + * + * https://meta.discourse.org/t/-/210469#s3-multipart-direct-uploads-4. + * + * An external file store must be set up and `enable_direct_s3_uploads` must + * be set to true for this endpoint to function. + * + * + */ +export async function uploadsCreateMultipartUpload( + client$: SDKCore, + request?: operations.CreateMultipartUploadRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.CreateMultipartUploadResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.CreateMultipartUploadRequestBody$outboundSchema.optional().parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = payload$ === undefined ? null : encodeJSON$("body", payload$, { explode: true }); + + const path$ = pathToFunc("/uploads/create-multipart.json")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const context = { + operationID: "createMultipartUpload", + oAuth2Scopes: [], + securitySource: null, + }; + + const requestRes = client$.createRequest$( + context, + { + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.CreateMultipartUploadResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.CreateMultipartUploadResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/uploadsCreateUpload.ts b/src/funcs/uploadsCreateUpload.ts new file mode 100644 index 0000000..f06f952 --- /dev/null +++ b/src/funcs/uploadsCreateUpload.ts @@ -0,0 +1,125 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +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"; + +/** + * Creates an upload + */ +export async function uploadsCreateUpload( + client$: SDKCore, + request?: operations.CreateUploadRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.CreateUploadResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.CreateUploadRequestBody$outboundSchema.optional().parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = new FormData(); + if (payload$ != null) { + body$.append("type", payload$?.type); + if (payload$?.file !== undefined) { + if (isBlobLike(payload$?.file)) { + body$.append("file", payload$?.file); + } else { + body$.append( + "file", + new Blob([payload$?.file.content], { type: "application/octet-stream" }), + payload$?.file.fileName + ); + } + } + if (payload$?.synchronous !== undefined) { + body$.append("synchronous", String(payload$?.synchronous)); + } + if (payload$?.user_id !== undefined) { + body$.append("user_id", String(payload$?.user_id)); + } + } + + const path$ = pathToFunc("/uploads.json")(); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "createUpload", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.CreateUploadResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.CreateUploadResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/uploadsGeneratePresignedPut.ts b/src/funcs/uploadsGeneratePresignedPut.ts new file mode 100644 index 0000000..6aada2d --- /dev/null +++ b/src/funcs/uploadsGeneratePresignedPut.ts @@ -0,0 +1,130 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Initiates a direct external upload + * + * @remarks + * Direct external uploads bypass the usual method of creating uploads + * via the POST /uploads route, and upload directly to an external provider, + * which by default is S3. This route begins the process, and will return + * a unique identifier for the external upload as well as a presigned URL + * which is where the file binary blob should be uploaded to. + * + * Once the upload is complete to the external service, you must call the + * POST /complete-external-upload route using the unique identifier returned + * by this route, which will create any required Upload record in the Discourse + * database and also move file from its temporary location to the final + * destination in the external storage service. + * + * You must have the correct permissions and CORS settings configured in your + * external provider. We support AWS S3 as the default. See: + * + * https://meta.discourse.org/t/-/210469#s3-multipart-direct-uploads-4. + * + * An external file store must be set up and `enable_direct_s3_uploads` must + * be set to true for this endpoint to function. + * + * + */ +export async function uploadsGeneratePresignedPut( + client$: SDKCore, + request?: operations.GeneratePresignedPutRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.GeneratePresignedPutResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.GeneratePresignedPutRequestBody$outboundSchema.optional().parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = payload$ === undefined ? null : encodeJSON$("body", payload$, { explode: true }); + + const path$ = pathToFunc("/uploads/generate-presigned-put.json")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const context = { operationID: "generatePresignedPut", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.GeneratePresignedPutResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.GeneratePresignedPutResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/usersActivateUser.ts b/src/funcs/usersActivateUser.ts new file mode 100644 index 0000000..3a0f940 --- /dev/null +++ b/src/funcs/usersActivateUser.ts @@ -0,0 +1,111 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Activate a user + */ +export async function usersActivateUser( + client$: SDKCore, + id: number, + options?: RequestOptions +): Promise< + Result< + operations.ActivateUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.ActivateUserRequest = { + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ActivateUserRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/admin/users/{id}/activate.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "activateUser", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.ActivateUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.ActivateUserResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/usersAdminGetUser.ts b/src/funcs/usersAdminGetUser.ts new file mode 100644 index 0000000..910dfe8 --- /dev/null +++ b/src/funcs/usersAdminGetUser.ts @@ -0,0 +1,111 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Get a user by id + */ +export async function usersAdminGetUser( + client$: SDKCore, + id: number, + options?: RequestOptions +): Promise< + Result< + operations.AdminGetUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.AdminGetUserRequest = { + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.AdminGetUserRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/admin/users/{id}.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "adminGetUser", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.AdminGetUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.AdminGetUserResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/usersAdminListUsers.ts b/src/funcs/usersAdminListUsers.ts new file mode 100644 index 0000000..15a294e --- /dev/null +++ b/src/funcs/usersAdminListUsers.ts @@ -0,0 +1,124 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { + encodeFormQuery as encodeFormQuery$, + encodeSimple as encodeSimple$, +} from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; +import * as z from "zod"; + +/** + * Get a list of users + */ +export async function usersAdminListUsers( + client$: SDKCore, + request: operations.AdminListUsersRequest, + options?: RequestOptions +): Promise< + Result< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.AdminListUsersRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + flag: encodeSimple$("flag", payload$.flag, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/admin/users/list/{flag}.json")(pathParams$); + + const query$ = encodeFormQuery$({ + asc: payload$.asc, + email: payload$.email, + ip: payload$.ip, + order: payload$.order, + page: payload$.page, + show_emails: payload$.show_emails, + stats: payload$.stats, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "adminListUsers", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, z.array(operations.AdminListUsersResponseBody$inboundSchema)))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/usersAnonymizeUser.ts b/src/funcs/usersAnonymizeUser.ts new file mode 100644 index 0000000..2d50f3f --- /dev/null +++ b/src/funcs/usersAnonymizeUser.ts @@ -0,0 +1,111 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Anonymize a user + */ +export async function usersAnonymizeUser( + client$: SDKCore, + id: number, + options?: RequestOptions +): Promise< + Result< + operations.AnonymizeUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.AnonymizeUserRequest = { + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.AnonymizeUserRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/admin/users/{id}/anonymize.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "anonymizeUser", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.AnonymizeUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.AnonymizeUserResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/usersChangePassword.ts b/src/funcs/usersChangePassword.ts new file mode 100644 index 0000000..681c149 --- /dev/null +++ b/src/funcs/usersChangePassword.ts @@ -0,0 +1,115 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; +import * as z from "zod"; + +/** + * Change password + */ +export async function usersChangePassword( + client$: SDKCore, + token: string, + requestBody?: operations.ChangePasswordRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.ChangePasswordRequest = { + requestBody: requestBody, + token: token, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ChangePasswordRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); + + const pathParams$ = { + token: encodeSimple$("token", payload$.token, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/users/password-reset/{token}.json")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "*/*", + }); + + const context = { operationID: "changePassword", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.nil(200, z.void()))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/usersCreateUser.ts b/src/funcs/usersCreateUser.ts new file mode 100644 index 0000000..7ef8dcb --- /dev/null +++ b/src/funcs/usersCreateUser.ts @@ -0,0 +1,120 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Creates a user + */ +export async function usersCreateUser( + client$: SDKCore, + apiKey: string, + apiUsername: string, + requestBody?: operations.CreateUserRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.CreateUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.CreateUserRequest = { + apiKey: apiKey, + apiUsername: apiUsername, + requestBody: requestBody, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.CreateUserRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); + + const path$ = pathToFunc("/users.json")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + "Api-Key": encodeSimple$("Api-Key", payload$["Api-Key"], { + explode: false, + charEncoding: "none", + }), + "Api-Username": encodeSimple$("Api-Username", payload$["Api-Username"], { + explode: false, + charEncoding: "none", + }), + }); + + const context = { operationID: "createUser", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.CreateUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.CreateUserResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/usersDeactivateUser.ts b/src/funcs/usersDeactivateUser.ts new file mode 100644 index 0000000..f813f32 --- /dev/null +++ b/src/funcs/usersDeactivateUser.ts @@ -0,0 +1,111 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Deactivate a user + */ +export async function usersDeactivateUser( + client$: SDKCore, + id: number, + options?: RequestOptions +): Promise< + Result< + operations.DeactivateUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.DeactivateUserRequest = { + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.DeactivateUserRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/admin/users/{id}/deactivate.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "deactivateUser", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.DeactivateUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.DeactivateUserResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/usersDeleteUser.ts b/src/funcs/usersDeleteUser.ts new file mode 100644 index 0000000..0dc3158 --- /dev/null +++ b/src/funcs/usersDeleteUser.ts @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Delete a user + */ +export async function usersDeleteUser( + client$: SDKCore, + id: number, + requestBody?: operations.DeleteUserRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.DeleteUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.DeleteUserRequest = { + requestBody: requestBody, + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.DeleteUserRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/admin/users/{id}.json")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const context = { operationID: "deleteUser", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "DELETE", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.DeleteUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.DeleteUserResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/usersGetUser.ts b/src/funcs/usersGetUser.ts new file mode 100644 index 0000000..d0ad7a9 --- /dev/null +++ b/src/funcs/usersGetUser.ts @@ -0,0 +1,126 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Get a single user by username + */ +export async function usersGetUser( + client$: SDKCore, + apiKey: string, + apiUsername: string, + username: string, + options?: RequestOptions +): Promise< + Result< + operations.GetUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.GetUserRequest = { + apiKey: apiKey, + apiUsername: apiUsername, + username: username, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetUserRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + username: encodeSimple$("username", payload$.username, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/u/{username}.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + "Api-Key": encodeSimple$("Api-Key", payload$["Api-Key"], { + explode: false, + charEncoding: "none", + }), + "Api-Username": encodeSimple$("Api-Username", payload$["Api-Username"], { + explode: false, + charEncoding: "none", + }), + }); + + const context = { operationID: "getUser", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.GetUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.GetUserResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/usersGetUserEmails.ts b/src/funcs/usersGetUserEmails.ts new file mode 100644 index 0000000..0185084 --- /dev/null +++ b/src/funcs/usersGetUserEmails.ts @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Get email addresses belonging to a user + */ +export async function usersGetUserEmails( + client$: SDKCore, + username: string, + options?: RequestOptions +): Promise< + Result< + operations.GetUserEmailsResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.GetUserEmailsRequest = { + username: username, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetUserEmailsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + username: encodeSimple$("username", payload$.username, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/u/{username}/emails.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "getUserEmails", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.GetUserEmailsResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.GetUserEmailsResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/usersGetUserExternalId.ts b/src/funcs/usersGetUserExternalId.ts new file mode 100644 index 0000000..d378598 --- /dev/null +++ b/src/funcs/usersGetUserExternalId.ts @@ -0,0 +1,126 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Get a user by external_id + */ +export async function usersGetUserExternalId( + client$: SDKCore, + apiKey: string, + apiUsername: string, + externalId: string, + options?: RequestOptions +): Promise< + Result< + operations.GetUserExternalIdResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.GetUserExternalIdRequest = { + apiKey: apiKey, + apiUsername: apiUsername, + externalId: externalId, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetUserExternalIdRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + external_id: encodeSimple$("external_id", payload$.external_id, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/u/by-external/{external_id}.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + "Api-Key": encodeSimple$("Api-Key", payload$["Api-Key"], { + explode: false, + charEncoding: "none", + }), + "Api-Username": encodeSimple$("Api-Username", payload$["Api-Username"], { + explode: false, + charEncoding: "none", + }), + }); + + const context = { operationID: "getUserExternalId", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.GetUserExternalIdResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.GetUserExternalIdResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/usersGetUserIdentiyProviderExternalId.ts b/src/funcs/usersGetUserIdentiyProviderExternalId.ts new file mode 100644 index 0000000..0acfcd5 --- /dev/null +++ b/src/funcs/usersGetUserIdentiyProviderExternalId.ts @@ -0,0 +1,138 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Get a user by identity provider external ID + */ +export async function usersGetUserIdentiyProviderExternalId( + client$: SDKCore, + apiKey: string, + apiUsername: string, + externalId: string, + provider: string, + options?: RequestOptions +): Promise< + Result< + operations.GetUserIdentiyProviderExternalIdResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.GetUserIdentiyProviderExternalIdRequest = { + apiKey: apiKey, + apiUsername: apiUsername, + externalId: externalId, + provider: provider, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.GetUserIdentiyProviderExternalIdRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + external_id: encodeSimple$("external_id", payload$.external_id, { + explode: false, + charEncoding: "percent", + }), + provider: encodeSimple$("provider", payload$.provider, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/u/by-external/{provider}/{external_id}.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + "Api-Key": encodeSimple$("Api-Key", payload$["Api-Key"], { + explode: false, + charEncoding: "none", + }), + "Api-Username": encodeSimple$("Api-Username", payload$["Api-Username"], { + explode: false, + charEncoding: "none", + }), + }); + + const context = { + operationID: "getUserIdentiyProviderExternalId", + oAuth2Scopes: [], + securitySource: null, + }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.GetUserIdentiyProviderExternalIdResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.GetUserIdentiyProviderExternalIdResponseBody$inboundSchema))( + response + ); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/usersListUserActions.ts b/src/funcs/usersListUserActions.ts new file mode 100644 index 0000000..7a287d2 --- /dev/null +++ b/src/funcs/usersListUserActions.ts @@ -0,0 +1,118 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Get a list of user actions + */ +export async function usersListUserActions( + client$: SDKCore, + filter: string, + offset: number, + username: string, + options?: RequestOptions +): Promise< + Result< + operations.ListUserActionsResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.ListUserActionsRequest = { + filter: filter, + offset: offset, + username: username, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListUserActionsRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const path$ = pathToFunc("/user_actions.json")(); + + const query$ = encodeFormQuery$({ + filter: payload$.filter, + offset: payload$.offset, + username: payload$.username, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "listUserActions", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.ListUserActionsResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.ListUserActionsResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/usersListUserBadges.ts b/src/funcs/usersListUserBadges.ts new file mode 100644 index 0000000..30a57a9 --- /dev/null +++ b/src/funcs/usersListUserBadges.ts @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * List badges for a user + */ +export async function usersListUserBadges( + client$: SDKCore, + username: string, + options?: RequestOptions +): Promise< + Result< + operations.ListUserBadgesResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.ListUserBadgesRequest = { + username: username, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListUserBadgesRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + username: encodeSimple$("username", payload$.username, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/user-badges/{username}.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "listUserBadges", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.ListUserBadgesResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.ListUserBadgesResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/usersListUsersPublic.ts b/src/funcs/usersListUsersPublic.ts new file mode 100644 index 0000000..fc540f0 --- /dev/null +++ b/src/funcs/usersListUsersPublic.ts @@ -0,0 +1,121 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeFormQuery as encodeFormQuery$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Get a public list of users + */ +export async function usersListUsersPublic( + client$: SDKCore, + order: operations.Order, + period: operations.Period, + asc?: operations.Asc | undefined, + page?: number | undefined, + options?: RequestOptions +): Promise< + Result< + operations.ListUsersPublicResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.ListUsersPublicRequest = { + asc: asc, + order: order, + page: page, + period: period, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.ListUsersPublicRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const path$ = pathToFunc("/directory_items.json")(); + + const query$ = encodeFormQuery$({ + asc: payload$.asc, + order: payload$.order, + page: payload$.page, + period: payload$.period, + }); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "listUsersPublic", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.ListUsersPublicResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.ListUsersPublicResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/usersLogOutUser.ts b/src/funcs/usersLogOutUser.ts new file mode 100644 index 0000000..9e78997 --- /dev/null +++ b/src/funcs/usersLogOutUser.ts @@ -0,0 +1,111 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Log a user out + */ +export async function usersLogOutUser( + client$: SDKCore, + id: number, + options?: RequestOptions +): Promise< + Result< + operations.LogOutUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.LogOutUserRequest = { + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.LogOutUserRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/admin/users/{id}/log_out.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "logOutUser", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.LogOutUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.LogOutUserResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/usersRefreshGravatar.ts b/src/funcs/usersRefreshGravatar.ts new file mode 100644 index 0000000..7a01bc4 --- /dev/null +++ b/src/funcs/usersRefreshGravatar.ts @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Refresh gravatar + */ +export async function usersRefreshGravatar( + client$: SDKCore, + username: string, + options?: RequestOptions +): Promise< + Result< + operations.RefreshGravatarResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.RefreshGravatarRequest = { + username: username, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.RefreshGravatarRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = null; + + const pathParams$ = { + username: encodeSimple$("username", payload$.username, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/user_avatar/{username}/refresh_gravatar.json")(pathParams$); + + const headers$ = new Headers({ + Accept: "application/json", + }); + + const context = { operationID: "refreshGravatar", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.RefreshGravatarResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.RefreshGravatarResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/usersSendPasswordResetEmail.ts b/src/funcs/usersSendPasswordResetEmail.ts new file mode 100644 index 0000000..2ffe977 --- /dev/null +++ b/src/funcs/usersSendPasswordResetEmail.ts @@ -0,0 +1,111 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Send password reset email + */ +export async function usersSendPasswordResetEmail( + client$: SDKCore, + request?: operations.SendPasswordResetEmailRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.SendPasswordResetEmailResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$ = request; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => + operations.SendPasswordResetEmailRequestBody$outboundSchema.optional().parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = payload$ === undefined ? null : encodeJSON$("body", payload$, { explode: true }); + + const path$ = pathToFunc("/session/forgot_password.json")(); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const context = { + operationID: "sendPasswordResetEmail", + oAuth2Scopes: [], + securitySource: null, + }; + + const requestRes = client$.createRequest$( + context, + { + method: "POST", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.SendPasswordResetEmailResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.SendPasswordResetEmailResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/usersSilenceUser.ts b/src/funcs/usersSilenceUser.ts new file mode 100644 index 0000000..15c586e --- /dev/null +++ b/src/funcs/usersSilenceUser.ts @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Silence a user + */ +export async function usersSilenceUser( + client$: SDKCore, + id: number, + requestBody?: operations.SilenceUserRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.SilenceUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.SilenceUserRequest = { + requestBody: requestBody, + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.SilenceUserRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/admin/users/{id}/silence.json")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const context = { operationID: "silenceUser", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.SilenceUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.SilenceUserResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/usersSuspendUser.ts b/src/funcs/usersSuspendUser.ts new file mode 100644 index 0000000..851793d --- /dev/null +++ b/src/funcs/usersSuspendUser.ts @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Suspend a user + */ +export async function usersSuspendUser( + client$: SDKCore, + id: number, + requestBody?: operations.SuspendUserRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.SuspendUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.SuspendUserRequest = { + requestBody: requestBody, + id: id, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.SuspendUserRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); + + const pathParams$ = { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + }; + + const path$ = pathToFunc("/admin/users/{id}/suspend.json")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const context = { operationID: "suspendUser", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.SuspendUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.SuspendUserResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/usersUpdateAvatar.ts b/src/funcs/usersUpdateAvatar.ts new file mode 100644 index 0000000..fb67239 --- /dev/null +++ b/src/funcs/usersUpdateAvatar.ts @@ -0,0 +1,117 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Update avatar + */ +export async function usersUpdateAvatar( + client$: SDKCore, + username: string, + requestBody?: operations.UpdateAvatarRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.UpdateAvatarResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.UpdateAvatarRequest = { + requestBody: requestBody, + username: username, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.UpdateAvatarRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); + + const pathParams$ = { + username: encodeSimple$("username", payload$.username, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/u/{username}/preferences/avatar/pick.json")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + + const context = { operationID: "updateAvatar", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.UpdateAvatarResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.UpdateAvatarResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/usersUpdateEmail.ts b/src/funcs/usersUpdateEmail.ts new file mode 100644 index 0000000..7cc61bd --- /dev/null +++ b/src/funcs/usersUpdateEmail.ts @@ -0,0 +1,118 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; +import * as z from "zod"; + +/** + * Update email + */ +export async function usersUpdateEmail( + client$: SDKCore, + username: string, + requestBody?: operations.UpdateEmailRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.UpdateEmailRequest = { + requestBody: requestBody, + username: username, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.UpdateEmailRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); + + const pathParams$ = { + username: encodeSimple$("username", payload$.username, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/u/{username}/preferences/email.json")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "*/*", + }); + + const context = { operationID: "updateEmail", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.nil(200, z.void()))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/usersUpdateUser.ts b/src/funcs/usersUpdateUser.ts new file mode 100644 index 0000000..a14651a --- /dev/null +++ b/src/funcs/usersUpdateUser.ts @@ -0,0 +1,129 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Update a user + */ +export async function usersUpdateUser( + client$: SDKCore, + apiKey: string, + apiUsername: string, + username: string, + requestBody?: operations.UpdateUserRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + operations.UpdateUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.UpdateUserRequest = { + apiKey: apiKey, + apiUsername: apiUsername, + requestBody: requestBody, + username: username, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.UpdateUserRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); + + const pathParams$ = { + username: encodeSimple$("username", payload$.username, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/u/{username}.json")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + "Api-Key": encodeSimple$("Api-Key", payload$["Api-Key"], { + explode: false, + charEncoding: "none", + }), + "Api-Username": encodeSimple$("Api-Username", payload$["Api-Username"], { + explode: false, + charEncoding: "none", + }), + }); + + const context = { operationID: "updateUser", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + operations.UpdateUserResponseBody, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.json(200, operations.UpdateUserResponseBody$inboundSchema))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/funcs/usersUpdateUsername.ts b/src/funcs/usersUpdateUsername.ts new file mode 100644 index 0000000..342e280 --- /dev/null +++ b/src/funcs/usersUpdateUsername.ts @@ -0,0 +1,118 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SDKCore } from "../core.js"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; +import * as m$ from "../lib/matchers.js"; +import * as schemas$ from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import { Result } from "../sdk/types/fp.js"; +import * as z from "zod"; + +/** + * Update username + */ +export async function usersUpdateUsername( + client$: SDKCore, + username: string, + requestBody?: operations.UpdateUsernameRequestBody | undefined, + options?: RequestOptions +): Promise< + Result< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + const input$: operations.UpdateUsernameRequest = { + requestBody: requestBody, + username: username, + }; + + const parsed$ = schemas$.safeParse( + input$, + (value$) => operations.UpdateUsernameRequest$outboundSchema.parse(value$), + "Input validation failed" + ); + if (!parsed$.ok) { + return parsed$; + } + const payload$ = parsed$.value; + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); + + const pathParams$ = { + username: encodeSimple$("username", payload$.username, { + explode: false, + charEncoding: "percent", + }), + }; + + const path$ = pathToFunc("/u/{username}/preferences/username.json")(pathParams$); + + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "*/*", + }); + + const context = { operationID: "updateUsername", oAuth2Scopes: [], securitySource: null }; + + const requestRes = client$.createRequest$( + context, + { + method: "PUT", + path: path$, + headers: headers$, + body: body$, + timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1, + }, + options + ); + if (!requestRes.ok) { + return requestRes; + } + const request$ = requestRes.value; + + const doResult = await client$.do$(request$, { + context, + errorCodes: [], + retryConfig: options?.retries || client$.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); + if (!doResult.ok) { + return doResult; + } + const response = doResult.value; + + const [result$] = await m$.match< + void, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >(m$.nil(200, z.void()))(response); + if (!result$.ok) { + return result$; + } + + return result$; +} diff --git a/src/hooks/hooks.ts b/src/hooks/hooks.ts new file mode 100644 index 0000000..a6b6e17 --- /dev/null +++ b/src/hooks/hooks.ts @@ -0,0 +1,103 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { RequestInput } from "../lib/http.js"; +import { + AfterErrorContext, + AfterErrorHook, + AfterSuccessContext, + AfterSuccessHook, + BeforeRequestContext, + BeforeRequestHook, + BeforeCreateRequestHook, + BeforeCreateRequestContext, + Hooks, + SDKInitHook, + SDKInitOptions, +} from "./types.js"; + +import { initHooks } from "./registration.js"; + +export class SDKHooks implements Hooks { + sdkInitHooks: SDKInitHook[] = []; + beforeCreateRequestHooks: BeforeCreateRequestHook[] = []; + beforeRequestHooks: BeforeRequestHook[] = []; + afterSuccessHooks: AfterSuccessHook[] = []; + afterErrorHooks: AfterErrorHook[] = []; + + constructor() { + initHooks(this); + } + + registerSDKInitHook(hook: SDKInitHook) { + this.sdkInitHooks.push(hook); + } + + registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook) { + this.beforeCreateRequestHooks.push(hook); + } + + registerBeforeRequestHook(hook: BeforeRequestHook) { + this.beforeRequestHooks.push(hook); + } + + registerAfterSuccessHook(hook: AfterSuccessHook) { + this.afterSuccessHooks.push(hook); + } + + registerAfterErrorHook(hook: AfterErrorHook) { + this.afterErrorHooks.push(hook); + } + + sdkInit(opts: SDKInitOptions): SDKInitOptions { + return this.sdkInitHooks.reduce((opts, hook) => hook.sdkInit(opts), opts); + } + + beforeCreateRequest(hookCtx: BeforeCreateRequestContext, input: RequestInput): RequestInput { + let inp = input; + + for (const hook of this.beforeCreateRequestHooks) { + inp = hook.beforeCreateRequest(hookCtx, inp); + } + + return inp; + } + + async beforeRequest(hookCtx: BeforeRequestContext, request: Request): Promise { + let req = request; + + for (const hook of this.beforeRequestHooks) { + req = await hook.beforeRequest(hookCtx, req); + } + + return req; + } + + async afterSuccess(hookCtx: AfterSuccessContext, response: Response): Promise { + let res = response; + + for (const hook of this.afterSuccessHooks) { + res = await hook.afterSuccess(hookCtx, res); + } + + return res; + } + + async afterError( + hookCtx: AfterErrorContext, + response: Response | null, + error: unknown + ): Promise<{ response: Response | null; error: unknown }> { + let res = response; + let err = error; + + for (const hook of this.afterErrorHooks) { + const result = await hook.afterError(hookCtx, res, err); + res = result.response; + err = result.error; + } + + return { response: res, error: err }; + } +} diff --git a/src/hooks/index.ts b/src/hooks/index.ts new file mode 100644 index 0000000..8f0e4db --- /dev/null +++ b/src/hooks/index.ts @@ -0,0 +1,6 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +export * from "./types.js"; +export * from "./hooks.js"; diff --git a/src/hooks/registration.ts b/src/hooks/registration.ts new file mode 100644 index 0000000..598a6df --- /dev/null +++ b/src/hooks/registration.ts @@ -0,0 +1,14 @@ +import { Hooks } from "./types.js"; + +/* + * This file is only ever generated once on the first generation and then is free to be modified. + * Any hooks you wish to add should be registered in the initHooks function. Feel free to define them + * in this file or in separate files in the hooks folder. + */ + +// @ts-expect-error remove this line when you add your first hook and hooks is used +export function initHooks(hooks: Hooks) { + // Add hooks by calling hooks.register{ClientInit/BeforeCreateRequest/BeforeRequest/AfterSuccess/AfterError}Hook + // with an instance of a hook that implements that specific Hook interface + // Hooks are registered per SDK instance, and are valid for the lifetime of the SDK instance +} diff --git a/src/hooks/types.ts b/src/hooks/types.ts new file mode 100644 index 0000000..3a31914 --- /dev/null +++ b/src/hooks/types.ts @@ -0,0 +1,89 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { HTTPClient, RequestInput } from "../lib/http.js"; + +export type HookContext = { + operationID: string; + oAuth2Scopes?: string[]; + securitySource?: any | (() => Promise); +}; + +export type Awaitable = T | Promise; + +export type SDKInitOptions = { + baseURL: URL | null; + client: HTTPClient; +}; + +export type BeforeCreateRequestContext = HookContext & {}; +export type BeforeRequestContext = HookContext & {}; +export type AfterSuccessContext = HookContext & {}; +export type AfterErrorContext = HookContext & {}; + +/** + * SDKInitHook is called when the SDK is initializing. The + * hook can return a new baseURL and HTTP client to be used by the SDK. + */ +export interface SDKInitHook { + sdkInit: (opts: SDKInitOptions) => SDKInitOptions; +} + +export interface BeforeCreateRequestHook { + /** + * A hook that is called before the SDK creates a `Request` object. The hook + * can modify how a request is constructed since certain modifications, like + * changing the request URL, cannot be done on a request object directly. + */ + beforeCreateRequest: (hookCtx: BeforeCreateRequestContext, input: RequestInput) => RequestInput; +} + +export interface BeforeRequestHook { + /** + * A hook that is called before the SDK sends a request. The hook can + * introduce instrumentation code such as logging, tracing and metrics or + * replace the request before it is sent or throw an error to stop the + * request from being sent. + */ + beforeRequest: (hookCtx: BeforeRequestContext, request: Request) => Awaitable; +} + +export interface AfterSuccessHook { + /** + * A hook that is called after the SDK receives a response. The hook can + * introduce instrumentation code such as logging, tracing and metrics or + * modify the response before it is handled or throw an error to stop the + * response from being handled. + */ + afterSuccess: (hookCtx: AfterSuccessContext, response: Response) => Awaitable; +} + +export interface AfterErrorHook { + /** + * A hook that is called after the SDK encounters an error, or a + * non-successful response. The hook can introduce instrumentation code such + * as logging, tracing and metrics or modify the response or error values. + */ + afterError: ( + hookCtx: AfterErrorContext, + response: Response | null, + error: unknown + ) => Awaitable<{ + response: Response | null; + error: unknown; + }>; +} + +export interface Hooks { + /** Registers a hook to be used by the SDK for initialization event. */ + registerSDKInitHook(hook: SDKInitHook): void; + /** Registers a hook to be used by the SDK for to modify `Request` construction. */ + registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook): void; + /** Registers a hook to be used by the SDK for the before request event. */ + registerBeforeRequestHook(hook: BeforeRequestHook): void; + /** Registers a hook to be used by the SDK for the after success event. */ + registerAfterSuccessHook(hook: AfterSuccessHook): void; + /** Registers a hook to be used by the SDK for the after error event. */ + registerAfterErrorHook(hook: AfterErrorHook): void; +} diff --git a/src/index.ts b/src/index.ts index b9e0fdd..ceb6380 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,6 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -export * from "./sdk"; +export * from "./sdk/sdk.js"; +export * from "./lib/config.js"; diff --git a/src/internal/utils/contenttype.ts b/src/internal/utils/contenttype.ts deleted file mode 100644 index bea128c..0000000 --- a/src/internal/utils/contenttype.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. - */ - -export function matchContentType( - contentType: string, - pattern: string, -): boolean { - let res = false; - contentType - .split(";") - .map((ctPart: string) => { - return ctPart.trim(); - }) - .forEach((ctPart: string) => { - if (ctPart === pattern || pattern === "*" || pattern === "*/*") { - res = true; - return; - } - if (ctPart === pattern) { - res = true; - return; - } - const parts: string[] = ctPart.split("/"); - if (parts.length === 2) { - if (`${parts[0]}/*` === pattern || `*/${parts[1]}` === pattern) { - res = true; - return; - } - } - }); - return res; -} diff --git a/src/internal/utils/headers.ts b/src/internal/utils/headers.ts deleted file mode 100644 index a597d3f..0000000 --- a/src/internal/utils/headers.ts +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. - */ - -import { AxiosResponseHeaders, RawAxiosResponseHeaders } from "axios"; -import { - ParamDecorator, - isBooleanRecord, - isEmpty, - isNumberRecord, - isStringRecord, - parseParamDecorator, - valToString, -} from "./utils"; - -import { requestMetadataKey } from "./requestbody"; - -export const headerMetadataKey = "header"; - -export function getHeadersFromRequest(headerParams: any): any { - if (headerParams == null) return; - - const headers: any = {}; - - const fieldNames: string[] = Object.getOwnPropertyNames(headerParams); - fieldNames.forEach((fname) => { - const requestBodyAnn: string = Reflect.getMetadata( - requestMetadataKey, - headerParams, - fname, - ); - - if (requestBodyAnn) return; - - const headerAnn: string = Reflect.getMetadata( - headerMetadataKey, - headerParams, - fname, - ); - - if (headerAnn == null) return; - - const headerDecorator: ParamDecorator = parseParamDecorator( - headerAnn, - fname, - "simple", - false, - ); - - if (headerDecorator == null) return; - - const value: string = serializeHeader( - headerParams[fname], - headerDecorator.Explode, - ); - - if (value != "") headers[headerDecorator.ParamName] = value; - }); - - return headers; -} - -export function getHeadersFromResponse( - headers: RawAxiosResponseHeaders | AxiosResponseHeaders, -): Record { - const reponseHeaders: Record = {}; - - Object.keys(headers).forEach((key) => { - const value = headers[key]; - - if (!value) return; - - if (Array.isArray(value)) { - const h: string[] = []; - - value.forEach((val: any) => { - if (val) { - h.push(String(val)); - } - }); - - reponseHeaders[key] = h; - } else { - reponseHeaders[key] = [value]; - } - }); - - return reponseHeaders; -} - -function serializeHeader(header: any, explode: boolean): string { - const headerVals: string[] = []; - - if (Array.isArray(header)) { - header.forEach((val: any) => { - headerVals.push(valToString(val)); - }); - } else if ( - isStringRecord(header) || - isNumberRecord(header) || - isBooleanRecord(header) - ) { - Object.getOwnPropertyNames(header).forEach((headerKey: string) => { - if (explode) - headerVals.push(`${headerKey}=${valToString(header[headerKey])}`); - else headerVals.push(`${headerKey},${valToString(header[headerKey])}`); - }); - } else if (header instanceof Object) { - Object.getOwnPropertyNames(header).forEach((headerKey: string) => { - const headerAnn: string = Reflect.getMetadata( - headerMetadataKey, - header, - headerKey, - ); - - if (headerAnn == null) return; - - const headerDecorator: ParamDecorator = parseParamDecorator( - headerAnn, - headerKey, - "simple", - explode, - ); - - if (headerDecorator == null) return; - - const headerFieldValue = valToString(header[headerKey]); - - if (isEmpty(headerFieldValue)) return; - else if (explode) - headerVals.push(`${headerDecorator.ParamName}=${headerFieldValue}`); - else headerVals.push(`${headerDecorator.ParamName},${headerFieldValue}`); - }); - } else { - return String(header); - } - return headerVals.join(","); -} diff --git a/src/internal/utils/index.ts b/src/internal/utils/index.ts deleted file mode 100644 index fe60df3..0000000 --- a/src/internal/utils/index.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. - */ - -export * from "./contenttype"; -export * from "./headers"; -export * from "./pathparams"; -export * from "./queryparams"; -export * from "./requestbody"; -export * from "./retries"; -export * from "./security"; -export * from "./utils"; diff --git a/src/internal/utils/pathparams.ts b/src/internal/utils/pathparams.ts deleted file mode 100644 index 444c45b..0000000 --- a/src/internal/utils/pathparams.ts +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. - */ - -import { - ParamDecorator, - isBooleanRecord, - isEmpty, - isNumberRecord, - isStringRecord, - parseParamDecorator, - valToString, -} from "./utils"; - -export const ppMetadataKey = "pathParam"; - -export function getSimplePathParams( - paramName: string, - paramValue: any, - explode: boolean, -): Map { - const pathParams: Map = new Map(); - const ppVals: string[] = []; - - if (Array.isArray(paramValue)) { - paramValue.forEach((param) => { - ppVals.push(encodeURIComponent(valToString(param))); - }); - pathParams.set(paramName, ppVals.join(",")); - } else if ( - isStringRecord(paramValue) || - isNumberRecord(paramValue) || - isBooleanRecord(paramValue) - ) { - Object.getOwnPropertyNames(paramValue).forEach((paramKey: string) => { - const paramFieldValue = encodeURIComponent( - valToString(paramValue[paramKey]), - ); - - if (explode) ppVals.push(`${paramKey}=${paramFieldValue}`); - else ppVals.push(`${paramKey},${paramFieldValue}`); - }); - - pathParams.set(paramName, ppVals.join(",")); - } else if (paramValue instanceof Object) { - Object.getOwnPropertyNames(paramValue).forEach((paramKey: string) => { - const ppAnn: string = Reflect.getMetadata( - ppMetadataKey, - paramValue, - paramKey, - ); - - if (ppAnn == null) return; - - const ppDecorator: ParamDecorator = parseParamDecorator( - ppAnn, - paramKey, - "simple", - explode, - ); - - if (ppDecorator == null) return; - - const paramFieldValue = encodeURIComponent( - valToString(paramValue[paramKey]), - ); - - if (isEmpty(paramFieldValue)) return; - else if (explode) - ppVals.push(`${ppDecorator.ParamName}=${paramFieldValue}`); - else ppVals.push(`${ppDecorator.ParamName},${paramFieldValue}`); - }); - - pathParams.set(paramName, ppVals.join(",")); - } else { - pathParams.set(paramName, encodeURIComponent(valToString(paramValue))); - } - return pathParams; -} diff --git a/src/internal/utils/queryparams.ts b/src/internal/utils/queryparams.ts deleted file mode 100644 index f729f22..0000000 --- a/src/internal/utils/queryparams.ts +++ /dev/null @@ -1,248 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. - */ - -import { - ParamDecorator, - parseParamDecorator, - populateFromGlobals, - shouldQueryParamSerialize, - valToString, -} from "./utils"; - -import { requestMetadataKey } from "./requestbody"; - -export const qpMetadataKey = "queryParam"; -const queryStringPrefix = "?"; - -const filterAndJoin = (strings: string[]): string => - strings.filter((s) => !!s).join("&"); - -export function serializeQueryParams(queryParams: any, globals?: any): string { - const queryStringParts: string[] = []; - if (!queryParams) return filterAndJoin(queryStringParts); - - const fieldNames: string[] = - "__props__" in queryParams - ? queryParams["__props__"].map((prop: any) => prop.key) - : Object.getOwnPropertyNames(queryParams); - - fieldNames.forEach((fname) => { - const requestBodyAnn: string = Reflect.getMetadata( - requestMetadataKey, - queryParams, - fname, - ); - - if (requestBodyAnn) return; - - const qpAnn: string = Reflect.getMetadata( - qpMetadataKey, - queryParams, - fname, - ); - - if (!qpAnn) return { serialize: () => "" }; - - const qpDecorator: ParamDecorator = parseParamDecorator( - qpAnn, - fname, - "form", - true, - ); - - if (!qpDecorator) return; - - let value = queryParams[fname]; - value = populateFromGlobals(value, fname, "queryParam", globals); - - if (qpDecorator.Serialization === "json") - queryStringParts.push(jsonSerializer({ [qpDecorator.ParamName]: value })); - else { - switch (qpDecorator.Style) { - case "deepObject": - queryStringParts.push( - deepObjectSerializer({ [qpDecorator.ParamName]: value }), - ); - return; - case "form": - if (!qpDecorator.Explode) - queryStringParts.push( - noExplodeSerializer({ [qpDecorator.ParamName]: value }), - ); - else - queryStringParts.push( - formSerializerExplode({ [qpDecorator.ParamName]: value }), - ); - return; - case "pipeDelimited": - if (!qpDecorator.Explode) { - queryStringParts.push( - noExplodeSerializer({ [qpDecorator.ParamName]: value }, "|"), - ); - } else { - queryStringParts.push( - formSerializerExplode({ [qpDecorator.ParamName]: value }), - ); - } - return; - default: - queryStringParts.push( - formSerializerExplode({ [qpDecorator.ParamName]: value }), - ); - } - } - }); - return queryStringPrefix + filterAndJoin(queryStringParts); -} - -// TODO: Add support for disabling percent encoding for reserved characters -function jsonSerializer(params: Record): string { - const query: string[] = []; - - Object.entries(Object.assign({}, params)).forEach(([key, value]) => { - query.push(`${key}=${encodeURIComponent(JSON.stringify(value))}`); - }); - return filterAndJoin(query); -} - -// TODO: Add support for disabling percent encoding for reserved characters -function noExplodeSerializer( - params: Record, - delimiter = ",", -): string { - const query: string[] = []; - - Object.entries(Object.assign({}, params)).forEach(([key, value]) => { - if (!shouldQueryParamSerialize(value)) return; - if (value !== Object(value)) - query.push(`${key}=${encodeURIComponent(valToString(value))}`); - else if (Array.isArray(value)) { - const values: string = value.map((aValue) => aValue).join(delimiter); - - query.push(`${key}=${encodeURIComponent(values)}`); - } else { - const values: string = Object.getOwnPropertyNames(value) - .map((paramKey: string) => { - const qpAnn: string = Reflect.getMetadata( - qpMetadataKey, - value, - paramKey, - ); - - const qpDecorator: ParamDecorator = parseParamDecorator( - qpAnn, - paramKey, - "form", - true, - ); - - if (qpDecorator == null) return; - - const key = qpDecorator.ParamName || paramKey; - return `${key}${delimiter}${valToString(value[paramKey])}`; - }) - .join(delimiter); - query.push(`${key}=${encodeURIComponent(values)}`); - } - }); - return filterAndJoin(query); -} - -// TODO: Add support for disabling percent encoding for reserved characters -function formSerializerExplode(params: Record): string { - const query: string[] = []; - - Object.entries(Object.assign({}, params)).forEach(([key, value]) => { - if (!shouldQueryParamSerialize(value)) return; - if (value !== Object(value)) - query.push(`${key}=${encodeURIComponent(value)}`); - else if (Array.isArray(value)) { - query.push( - value - .map((aValue) => `${key}=${encodeURIComponent(valToString(aValue))}`) - .join("&"), - ); - } else - query.push( - Object.getOwnPropertyNames(value) - .map((paramKey: string) => { - const qpAnn: string = Reflect.getMetadata( - qpMetadataKey, - value, - paramKey, - ); - - const qpDecorator: ParamDecorator = parseParamDecorator( - qpAnn, - paramKey, - "form", - true, - ); - - if (qpDecorator == null) return; - - const key = qpDecorator.ParamName || paramKey; - return `${key}=${encodeURIComponent(valToString(value[paramKey]))}`; - }) - .join("&"), - ); - }); - return filterAndJoin(query); -} - -// TODO: Add support for disabling percent encoding for reserved characters -function deepObjectSerializer(params: Record): string { - const query: string[] = []; - - Object.entries(Object.assign({}, params)).forEach(([key, value]) => { - if (!shouldQueryParamSerialize(value)) return; - if (value !== Object(value)) - query.push(`${key}=${encodeURIComponent(value)}`); - else if (Array.isArray(value)) { - query.push( - value - .map( - ([objKey, objValue]) => - `${key}[${objKey}]=${encodeURIComponent(valToString(objValue))}`, - ) - .join("&"), - ); - } else - query.push( - Object.getOwnPropertyNames(value) - .map((paramKey: string) => { - const qpAnn: string = Reflect.getMetadata( - qpMetadataKey, - value, - paramKey, - ); - - const qpDecorator: ParamDecorator = parseParamDecorator( - qpAnn, - paramKey, - "form", - true, - ); - - if (qpDecorator == null) return; - - // For deep objects, arr is wrapped inside object - if (Array.isArray(value[paramKey])) - return value[paramKey] - .map( - (arrValue: any) => - `${key}[${paramKey}]=${encodeURIComponent( - valToString(arrValue), - )}`, - ) - .join("&"); - return `${key}[${paramKey}]=${encodeURIComponent( - valToString(value[paramKey]), - )}`; - }) - .join("&"), - ); - }); - return filterAndJoin(query); -} diff --git a/src/internal/utils/requestbody.ts b/src/internal/utils/requestbody.ts deleted file mode 100644 index 3ddec57..0000000 --- a/src/internal/utils/requestbody.ts +++ /dev/null @@ -1,357 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. - */ - -import { - isBooleanRecord, - isNumberRecord, - isStringRecord, - SerializationMethodToContentType, - valToString, -} from "./utils"; - -import FormData from "form-data"; -import { RFCDate } from "../../sdk/types"; -import { classToPlain } from "class-transformer"; - -export const requestMetadataKey = "request"; -const mpFormMetadataKey = "multipart_form"; - -export function serializeRequestBody( - request: any, - requestFieldName: string, - serializationMethod: string -): [Record, any] { - if (request !== Object(request) || !request.hasOwnProperty(requestFieldName)) { - return serializeContentType(SerializationMethodToContentType[serializationMethod], request); - } - - const requestBodyAnn: string = Reflect.getMetadata( - requestMetadataKey, - request, - requestFieldName - ); - if (!requestBodyAnn) { - throw new Error("invalid request type"); - } - - const requestDecorator: RequestDecorator = parseRequestDecorator(requestBodyAnn); - return serializeContentType(requestDecorator.MediaType, request[requestFieldName]); -} - -const serializeContentType = (contentType: string, reqBody: any): [Record, any] => { - let [requestHeaders, requestBody]: [Record, any] = [{}, {}]; - - switch (contentType) { - case "multipart/form-data": - requestBody = encodeMultipartFormData(reqBody); - break; - - case "multipart/mixed": - requestBody = encodeMultipartFormData(reqBody); - requestHeaders = (requestBody as FormData).getHeaders(); - break; - - case "application/x-www-form-urlencoded": - [requestHeaders, requestBody] = [ - { "Content-Type": `${contentType}` }, - encodeFormUrlEncodedData(reqBody), - ]; - break; - - case "application/json": - [requestHeaders, requestBody] = [ - { "Content-Type": `${contentType}` }, - classToPlain(reqBody, { exposeUnsetFields: false }), - ]; - break; - case "text/json": - [requestHeaders, requestBody] = [{ "Content-Type": `${contentType}` }, reqBody]; - break; - - default: { - requestBody = reqBody; - const requestBodyType: string = typeof requestBody; - if ( - requestBodyType === "string" || - requestBody instanceof String || - requestBody instanceof Uint8Array - ) - requestHeaders = { "Content-Type": `${contentType}` }; - else - throw new Error( - `invalid request body type ${requestBodyType} for mediaType ${contentType}` - ); - } - } - return [requestHeaders, requestBody]; -}; - -const encodeFormUrlEncodedData = (data: any): string => { - const fieldNames: string[] = Object.getOwnPropertyNames(data); - - let urlencoded = ""; - let amp = ""; - const appendPair = (key: string, value: string) => { - urlencoded += `${amp}${encodeURIComponent(key)}=${encodeURIComponent(value)}`; - amp = "&"; - }; - - if (isNumberRecord(data) || isBooleanRecord(data) || isStringRecord(data)) { - fieldNames.forEach((fname) => { - const formAnn: string = Reflect.getMetadata("form", data, fname); - let name = fname; - if (formAnn) { - const formDecorator: FormDecorator = parseFormDecorator(formAnn); - name = formDecorator.Name ?? fname; - } - appendPair(name, data[fname]?.toString()); - }); - } else { - fieldNames.forEach((fname) => { - const formAnn: string = Reflect.getMetadata("form", data, fname); - if (formAnn === null) { - return; - } - const formDecorator: FormDecorator = parseFormDecorator(formAnn); - - if (formDecorator.JSON) { - const name = formDecorator.Name ?? fname; - const val = JSON.stringify(data[fname]); - appendPair(name, val); - } else if (formDecorator.Style === "form") { - let parsed: Record; - const name = formDecorator.Name ?? fname; - if (formDecorator.Explode === true) { - parsed = formExplode(name, data[fname]); - } else { - parsed = formNotExplode(name, data[fname]); - } - - Object.keys(parsed).forEach((key) => { - parsed[key].forEach((v) => appendPair(key, v)); - }); - return; - } - }); - } - return urlencoded; -}; - -const formExplode = (fname: string, data: any): Record => { - const exploded: Record = {}; - - if (Array.isArray(data)) { - data.forEach((value) => { - if (!exploded[fname]) { - exploded[fname] = []; - } - exploded[fname].push(value); - }); - } else if (typeof data === "object") { - if (data instanceof Date || data instanceof RFCDate) { - if (!exploded[fname]) { - exploded[fname] = []; - } - exploded[fname].push(valToString(data)); - } else { - Object.keys(data).forEach((key) => { - if (!exploded[key]) { - exploded[key] = []; - } - exploded[key].push(data[key]); - }); - } - } else { - if (!exploded[fname]) { - exploded[fname] = []; - } - exploded[fname].push(valToString(data)); - } - return exploded; -}; - -const formNotExplode = (fname: string, data: any): Record => { - const notExploded: Record = {}; - - if (Array.isArray(data)) { - if (!notExploded[fname]) { - notExploded[fname] = []; - } - notExploded[fname].push(data.map((item) => item.toString()).join(",")); - } else if (typeof data === "object") { - if (data instanceof Date || data instanceof RFCDate) { - if (!notExploded[fname]) { - notExploded[fname] = []; - } - notExploded[fname].push(valToString(data)); - } else { - Object.keys(data).forEach((key) => { - if (!notExploded[key]) { - notExploded[key] = []; - } - notExploded[fname].push(`${key}=${data[key]}`); - }); - } - } else { - if (!notExploded[fname]) { - notExploded[fname] = []; - } - notExploded[fname].push(valToString(data)); - } - return notExploded; -}; - -function parseFormDecorator(formAnn: string): FormDecorator { - const formDecorator: FormDecorator = new FormDecorator("", "form", false, false); - formAnn.split(";").forEach((formAnnPart) => { - const [formKey, formVal]: string[] = formAnnPart.split("="); - switch (formKey) { - case "name": - formDecorator.Name = formVal; - break; - case "style": - formDecorator.Style = formVal; - break; - case "explode": - formDecorator.Explode = formVal === "true"; - break; - case "json": - formDecorator.JSON = formVal === "true"; - break; - } - }); - - return formDecorator; -} - -class FormDecorator { - Name?: string; - Style?: string; - Explode?: boolean; - JSON?: boolean; - - constructor(Name?: string, Style?: string, Explode?: boolean, JSON?: boolean) { - this.Name = Name; - this.Style = Style; - this.Explode = Explode; - this.JSON = JSON; - } -} - -function encodeMultipartFormData(form: any): FormData { - const formData: FormData = new FormData(); - - const fieldNames: string[] = Object.getOwnPropertyNames(form); - fieldNames.forEach((fname) => { - const mpFormAnn: string = Reflect.getMetadata(mpFormMetadataKey, form, fname); - - if (mpFormAnn == null) return; - - const mpFormDecorator: MultipartFormDecorator = parseMultipartFormDecorator(mpFormAnn); - - if (mpFormDecorator.File) return encodeMultipartFormDataFile(formData, form[fname]); - else if (mpFormDecorator.JSON) { - formData.append(mpFormDecorator.Name, JSON.stringify(form[fname])); - } else { - if (Array.isArray(form[fname])) { - form[fname].forEach((val: any) => { - formData.append(mpFormDecorator.Name + "[]", valToString(val)); - }); - } else { - formData.append(mpFormDecorator.Name, valToString(form[fname])); - } - } - }); - return formData; -} - -function encodeMultipartFormDataFile(formData: FormData, file: any): FormData { - if (typeof file !== "object" || Array.isArray(file) || file == null) { - throw new Error("invalid type for multipart/form-data file"); - } - let content: any = null; - let fileName = ""; - let mpFormDecoratorName = ""; - - const fieldNames: string[] = Object.getOwnPropertyNames(file); - fieldNames.forEach((fname) => { - const mpFormAnn: string = Reflect.getMetadata(mpFormMetadataKey, file, fname); - - if (mpFormAnn == null) return; - - const mpFormDecorator: MultipartFormDecorator = parseMultipartFormDecorator(mpFormAnn); - - if (!mpFormDecorator.Content && mpFormDecorator.Name == "") return; - if (mpFormDecorator.Content) content = file[fname]; - else { - mpFormDecoratorName = mpFormDecorator.Name; - fileName = file[fname]; - } - }); - - if (mpFormDecoratorName === "" || fileName === "" || content == null) { - throw new Error("invalid multipart/form-data file"); - } - formData.append(mpFormDecoratorName, Buffer.from(content), fileName); - return formData; -} - -function parseMultipartFormDecorator(mpFormAnn: string): MultipartFormDecorator { - // example "name=file" - const mpFormDecorator: MultipartFormDecorator = new MultipartFormDecorator( - false, - false, - false, - "" - ); - mpFormAnn.split(";").forEach((mpFormAnnPart) => { - const [mpFormKey, mpFormVal]: string[] = mpFormAnnPart.split("="); - switch (mpFormKey) { - case "file": - mpFormDecorator.File = mpFormVal == "true"; - break; - case "content": - mpFormDecorator.Content = mpFormVal == "true"; - break; - case "name": - mpFormDecorator.Name = mpFormVal; - break; - case "json": - mpFormDecorator.JSON = mpFormVal == "true"; - break; - } - }); - - return mpFormDecorator; -} - -class MultipartFormDecorator { - File: boolean; - Content: boolean; - JSON: boolean; - Name: string; - - constructor(File: boolean, Content: boolean, JSON: boolean, Name: string) { - this.File = File; - this.Content = Content; - this.JSON = JSON; - this.Name = Name; - } -} - -function parseRequestDecorator(requestAnn: string): RequestDecorator { - // example "media_type=multipart/form-data" - const requestDecorator: RequestDecorator = new RequestDecorator("application/octet-stream"); - const [mediaTypeKey, mediaTypeVal]: string[] = requestAnn.split("="); - if (mediaTypeKey === "media_type") requestDecorator.MediaType = mediaTypeVal; - return requestDecorator; -} - -class RequestDecorator { - MediaType: string; - - constructor(MediaType: string) { - this.MediaType = MediaType; - } -} diff --git a/src/internal/utils/retries.ts b/src/internal/utils/retries.ts deleted file mode 100644 index edf6a73..0000000 --- a/src/internal/utils/retries.ts +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. - */ - -import { AxiosError, AxiosResponse } from "axios"; - -export class BackoffStrategy { - initialInterval: number; - maxInterval: number; - exponent: number; - maxElapsedTime: number; - - constructor( - initialInterval: number, - maxInterval: number, - exponent: number, - maxElapsedTime: number, - ) { - this.initialInterval = initialInterval; - this.maxInterval = maxInterval; - this.exponent = exponent; - this.maxElapsedTime = maxElapsedTime; - } -} - -export class RetryConfig { - strategy: "backoff" | "none"; - backoff?: BackoffStrategy; - retryConnectionErrors: boolean; - - constructor( - strategy: "backoff" | "none", - backoff?: BackoffStrategy, - retryConnectionErrors = true, - ) { - this.strategy = strategy; - this.backoff = backoff; - this.retryConnectionErrors = retryConnectionErrors; - } -} - -export class Retries { - config: RetryConfig; - statusCodes: string[]; - - constructor(config: RetryConfig, statusCodes: string[]) { - this.config = config; - this.statusCodes = statusCodes; - } -} - -class PermanentError extends Error { - inner: unknown; - - constructor(inner: unknown) { - super("Permanent error"); - this.inner = inner; - - Object.setPrototypeOf(this, PermanentError.prototype); - } -} - -class TemporaryError extends Error { - res: AxiosResponse; - - constructor(res: AxiosResponse) { - super("Temporary error"); - this.res = res; - - Object.setPrototypeOf(this, TemporaryError.prototype); - } -} - -export async function Retry( - fn: () => Promise>, - retries: Retries, -): Promise> { - switch (retries.config.strategy) { - case "backoff": - return retryBackoff( - async () => { - try { - const res = await fn(); - if (isRetryableResponse(res, retries.statusCodes)) { - throw new TemporaryError(res); - } - - return res; - } catch (err) { - if (err instanceof AxiosError) { - if (err.response) { - if (isRetryableResponse(err.response, retries.statusCodes)) { - throw err; - } - throw new PermanentError(err); - } else if (err.request) { - throw err; - } else { - throw new PermanentError(err); - } - } else if (err instanceof TemporaryError) { - throw err; - } - throw new PermanentError(err); - } - }, - retries.config.backoff?.initialInterval ?? 500, - retries.config.backoff?.maxInterval ?? 60000, - retries.config.backoff?.exponent ?? 1.5, - retries.config.backoff?.maxElapsedTime ?? 3600000, - ); - default: - return await fn(); - } -} - -function isRetryableResponse( - res: AxiosResponse, - statusCodes: string[], -): boolean { - for (const code of statusCodes) { - if (code.toUpperCase().includes("X")) { - const codeRange = parseInt(code[0]); - if (isNaN(codeRange)) { - throw new Error("Invalid status code range"); - } - - const s = res.status / 100; - - if (s >= codeRange && s < codeRange + 1) { - return true; - } - } else if (res.status == parseInt(code)) { - return true; - } - } - - return false; -} - -async function retryBackoff( - fn: () => Promise>, - initialInterval: number, - maxInterval: number, - exponent: number, - maxElapsedTime: number, -): Promise> { - const start = Date.now(); - let x = 0; - - // eslint-disable-next-line no-constant-condition - while (true) { - try { - return await fn(); - } catch (err) { - if (err instanceof PermanentError) { - throw err.inner; - } - - const now = Date.now(); - if (now - start > maxElapsedTime) { - if (err instanceof TemporaryError) { - return err.res; - } - - throw err; - } - - const d = Math.min( - initialInterval * Math.pow(x, exponent) + Math.random() * 1000, - maxInterval, - ); - - await delay(d); - x++; - } - } -} - -async function delay(delay: number): Promise { - return new Promise((resolve) => setTimeout(resolve, delay)); -} diff --git a/src/internal/utils/security.ts b/src/internal/utils/security.ts deleted file mode 100644 index 845e8bb..0000000 --- a/src/internal/utils/security.ts +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. - */ - -const securityMetadataKey = "security"; - -export type SecurityProperties = { - params: Record; - headers: Record; -}; - -export function parseSecurityProperties(security: any): SecurityProperties { - return parseSecurityClass(security); -} - -function parseSecurityDecorator(securityAnn: string): SecurityDecorator { - // scheme=true;type=apiKey;subtype=header" - let option = false; - let scheme = false; - let name = ""; - let securityType = ""; - let securitySubType = ""; - - securityAnn.split(";").forEach((securityAnnPart) => { - const [sKey, sVal]: string[] = securityAnnPart.split("="); - switch (sKey) { - case "name": - name = sVal; - break; - case "type": - securityType = sVal; - break; - case "subtype": - securitySubType = sVal; - break; - case "option": - option = sVal == "true"; - break; - case "scheme": - scheme = sVal == "true"; - } - }); - - return new SecurityDecorator( - name, - securityType, - option, - scheme, - securitySubType, - ); -} - -function parseSecurityClass(security: any): SecurityProperties { - const fieldNames: string[] = Object.getOwnPropertyNames(security); - const properties: SecurityProperties = { - params: {}, - headers: {}, - }; - fieldNames.forEach((fname) => { - const securityAnn: string = Reflect.getMetadata( - securityMetadataKey, - security, - fname, - ); - if (securityAnn == null) return; - const securityDecorator: SecurityDecorator = - parseSecurityDecorator(securityAnn); - if (securityDecorator == null) return; - - const value = security[fname]; - - if (securityDecorator.Option) { - return parseSecurityOption(properties, value); - } else if (securityDecorator.Scheme) { - if (securityDecorator.SubType === "basic" && value !== Object(value)) { - return parseSecurityScheme(properties, securityDecorator, security); - } else { - return parseSecurityScheme(properties, securityDecorator, value); - } - } - }); - - return properties; -} - -function parseSecurityOption( - properties: SecurityProperties, - optionType: any, -): void { - const fieldNames: string[] = Object.getOwnPropertyNames(optionType); - fieldNames.forEach((fname) => { - const securityAnn: string = Reflect.getMetadata( - securityMetadataKey, - optionType, - fname, - ); - if (securityAnn == null) return; - const securityDecorator: SecurityDecorator = - parseSecurityDecorator(securityAnn); - if (securityDecorator == null || !securityDecorator.Scheme) return; - return parseSecurityScheme( - properties, - securityDecorator, - optionType[fname], - ); - }); -} - -function parseSecurityScheme( - properties: SecurityProperties, - schemeDecorator: SecurityDecorator, - scheme: any, -): void { - if (scheme === Object(scheme)) { - if ( - schemeDecorator.Type === "http" && - schemeDecorator.SubType === "basic" - ) { - return parseBasicAuthScheme(properties, scheme); - } - - const fieldNames: string[] = Object.getOwnPropertyNames(scheme); - fieldNames.forEach((fname) => { - const securityAnn: string = Reflect.getMetadata( - securityMetadataKey, - scheme, - fname, - ); - if (securityAnn == null) return; - const securityDecorator: SecurityDecorator = - parseSecurityDecorator(securityAnn); - if (securityDecorator == null || securityDecorator.Name === "") return; - - return parseSecuritySchemeValue( - properties, - schemeDecorator, - securityDecorator, - scheme[fname], - ); - }); - } else { - return parseSecuritySchemeValue( - properties, - schemeDecorator, - schemeDecorator, - scheme, - ); - } -} - -function parseSecuritySchemeValue( - properties: SecurityProperties, - schemeDecorator: SecurityDecorator, - securityDecorator: SecurityDecorator, - value: any, -): void { - switch (schemeDecorator.Type) { - case "apiKey": - switch (schemeDecorator.SubType) { - case "header": - properties.headers[securityDecorator.Name] = value; - break; - case "query": - properties.params[securityDecorator.Name] = value; - break; - case "cookie": { - const securityDecoratorName: string = securityDecorator.Name; - const val: string = value; - properties.headers["Cookie"] = `${securityDecoratorName}=${val}`; - break; - } - default: - throw new Error("not supported"); - } - break; - case "openIdConnect": - properties.headers[securityDecorator.Name] = value; - break; - case "oauth2": - properties.headers[securityDecorator.Name] = value - .toLowerCase() - .startsWith("bearer ") - ? value - : `Bearer ${value}`; - break; - case "http": - switch (schemeDecorator.SubType) { - case "basic": - break; - case "bearer": - properties.headers[securityDecorator.Name] = value - .toLowerCase() - .startsWith("bearer ") - ? value - : `Bearer ${value}`; - break; - default: - throw new Error("not supported"); - } - break; - default: - throw new Error("not supported"); - } -} - -function parseBasicAuthScheme( - properties: SecurityProperties, - scheme: any, -): void { - let username, - password = ""; - - const fieldNames: string[] = Object.getOwnPropertyNames(scheme); - fieldNames.forEach((fname) => { - const securityAnn: string = Reflect.getMetadata( - securityMetadataKey, - scheme, - fname, - ); - if (securityAnn == null) return; - const securityDecorator: SecurityDecorator = - parseSecurityDecorator(securityAnn); - if (securityDecorator == null || securityDecorator.Name === "") return; - - switch (securityDecorator.Name) { - case "username": - username = scheme[fname]; - break; - case "password": - password = scheme[fname]; - break; - } - }); - - properties.headers["Authorization"] = `Basic ${Buffer.from( - `${username}:${password}`, - ).toString("base64")}`; -} - -class SecurityDecorator { - Name: string; - Type: string; - Option: boolean; - Scheme: boolean; - SubType: string; - constructor( - Name: string, - Type: string, - Option: boolean, - Scheme: boolean, - SubType: string, - ) { - this.Name = Name; - this.Type = Type; - this.Option = Option; - this.Scheme = Scheme; - this.SubType = SubType; - } -} diff --git a/src/internal/utils/utils.ts b/src/internal/utils/utils.ts deleted file mode 100644 index 2cb7ab7..0000000 --- a/src/internal/utils/utils.ts +++ /dev/null @@ -1,367 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. - */ - -import "reflect-metadata"; - -import { getSimplePathParams, ppMetadataKey } from "./pathparams"; - -import { plainToInstance } from "class-transformer"; -import { RFCDate } from "../../sdk/types"; -import { requestMetadataKey } from "./requestbody"; - -export const SerializationMethodToContentType: Record = { - json: "application/json", - form: "application/x-www-form-urlencoded", - multipart: "multipart/form-data", - raw: "application/octet-stream", - string: "text/plain", -}; - -export interface PropInfo { - key: string | symbol; - type: any; - elemType: any; - elemDepth: number; -} - -function isSpeakeasyBase(type: any): boolean { - return type && Object.getPrototypeOf(type)?.name == SpeakeasyBase.name; -} - -function handleArray(value: any, elemType: any, elemDepth: number): any { - if (!Array.isArray(value)) { - return value; - } - - if (elemDepth == 1) { - return value.map((v: any) => new elemType(v)); - } else { - return value.map((v: any) => { - if (Array.isArray(v)) { - return handleArray(v, elemType, elemDepth - 1); - } else if (typeof v == "object") { - return handleObject(v, elemType, elemDepth - 1); - } else { - return v; - } - }); - } -} - -function handleObject(value: any, elemType: any, elemDepth: number): any { - if (typeof value != "object") { - return value; - } - - if (elemDepth == 1) { - return Object.keys(value).reduce((acc: any, key: string) => { - acc[key] = new elemType(value[key]); - return acc; - }, {}); - } else { - return Object.keys(value).reduce((acc: any, key: string) => { - const v = value[key]; - if (Array.isArray(v)) { - acc[key] = handleArray(v, elemType, elemDepth - 1); - } else if (typeof v == "object") { - acc[key] = handleObject(v, elemType, elemDepth - 1); - } else { - acc[key] = v; - } - return acc; - }, {}); - } -} - -export class SpeakeasyBase { - constructor(payload?: Record) { - const props: PropInfo[] = (this as any)["__props__"]; - if (props) { - for (const prop of props) { - if (payload && payload.hasOwnProperty(prop.key)) { - const value = payload[prop.key]; - if (isSpeakeasyBase(prop.type) && value != null) { - (this as any)[prop.key] = new prop.type(value); - } else if (prop.type.name == "Array" && isSpeakeasyBase(prop.elemType)) { - (this as any)[prop.key] = handleArray(value, prop.elemType, prop.elemDepth); - } else if (prop.type.name == "Object" && isSpeakeasyBase(prop.elemType)) { - (this as any)[prop.key] = handleObject( - value, - prop.elemType, - prop.elemDepth - ); - } else if (prop.type.name == "RFCDate") { - if (value instanceof Date) { - (this as any)[prop.key] = new RFCDate(value); - } else { - (this as any)[prop.key] = value; - } - } else { - (this as any)[prop.key] = value; - } - } - } - } - } -} - -export class ParamDecorator { - Style: string; - Explode: boolean; - ParamName: string; - Serialization?: string; - constructor(Style: string, Explode: boolean, ParamName: string, Serialization?: string) { - this.Style = Style; - this.Explode = Explode; - this.ParamName = ParamName; - this.Serialization = Serialization; - } -} - -export function SpeakeasyMetadata< - T extends SpeakeasyBase = Record ->(params?: { data?: string; elemType?: { new (): T }; elemDepth?: number }): PropertyDecorator { - return (target, propertyKey) => { - if (params?.data) { - const annsArr = params.data.split(", "); - - for (let i = 0; i < annsArr.length; i += 2) { - Reflect.defineMetadata(annsArr[i], annsArr[i + 1], target, propertyKey); - } - } - - let props: PropInfo[]; - if (target.hasOwnProperty("__props__")) { - props = (target as any)["__props__"]; - } else { - props = (target as any)["__props__"] = []; - } - - const prop = { - key: propertyKey, - type: Reflect.getMetadata("design:type", target, propertyKey), - } as PropInfo; - - if (params?.elemType) { - prop.elemType = params.elemType; - prop.elemDepth = params.elemDepth || 1; - } - - props.push(prop); - }; -} - -export function templateUrl(stringWithParams: string, params: Record): string { - let res: string = stringWithParams; - if (params) { - Object.entries(params).forEach(([key, value]) => { - const match: string = "{" + key + "}"; - res = res.replaceAll(match, value); - }); - } - return res; -} - -export function generateURL( - serverURL: string, - path: string, - pathParams: any, - globals?: any -): string { - const url: string = serverURL.replace(/\/$/, "") + path; - const parsedParameters: Record = {}; - - const fieldNames: string[] = - "__props__" in pathParams - ? pathParams["__props__"].map((prop: any) => prop.key) - : Object.getOwnPropertyNames(pathParams); - fieldNames.forEach((fname) => { - const requestBodyAnn: string = Reflect.getMetadata(requestMetadataKey, pathParams, fname); - - if (requestBodyAnn) return; - - const ppAnn: string = Reflect.getMetadata(ppMetadataKey, pathParams, fname); - - if (ppAnn == null) return; - - const ppDecorator: ParamDecorator = parseParamDecorator(ppAnn, fname, "simple", false); - if (ppDecorator == null) return; - - let value = pathParams[fname]; - value = populateFromGlobals(value, fname, "pathParam", globals); - - if (ppDecorator.Serialization) { - switch (ppDecorator.Serialization) { - case "json": - parsedParameters[ppDecorator.ParamName] = encodeURIComponent( - JSON.stringify(value) - ); - break; - } - } else { - switch (ppDecorator.Style) { - case "simple": { - const simpleParams: Map = getSimplePathParams( - ppDecorator.ParamName, - value, - ppDecorator.Explode - ); - simpleParams.forEach((value, key) => { - parsedParameters[key] = value; - }); - } - } - } - }); - return templateUrl(url, parsedParameters); -} - -export function parseParamDecorator( - ann: string, - fName: string, - defaultStyle: string, - defaultExplode: boolean -): ParamDecorator { - // style=simple;explode=false;name=apiID - const decorator: ParamDecorator = new ParamDecorator( - defaultStyle, - defaultExplode, - fName.toLowerCase() - ); - - if (ann == null) return decorator; - ann.split(";").forEach((annPart) => { - const [paramKey, paramVal]: string[] = annPart.split("="); - switch (paramKey) { - case "style": - decorator.Style = paramVal; - break; - case "explode": - decorator.Explode = paramVal == "true"; - break; - case "name": - decorator.ParamName = paramVal; - break; - case "serialization": - decorator.Serialization = paramVal; - break; - } - }); - return decorator; -} - -export function isStringRecord(obj: any): obj is Record { - if (typeof obj !== "object") return false; - - if (Object.getOwnPropertySymbols(obj).length > 0) return false; - - return Object.getOwnPropertyNames(obj).every((prop) => typeof obj[prop] === "string"); -} - -export function isNumberRecord(obj: any): obj is Record { - if (typeof obj !== "object") return false; - - if (Object.getOwnPropertySymbols(obj).length > 0) return false; - - return Object.getOwnPropertyNames(obj).every((prop) => typeof obj[prop] === "number"); -} - -export function isBooleanRecord(obj: any): obj is Record { - if (typeof obj !== "object") return false; - - if (Object.getOwnPropertySymbols(obj).length > 0) return false; - - return Object.getOwnPropertyNames(obj).every((prop) => typeof obj[prop] === "boolean"); -} - -export function isEmpty(value: any): boolean { - // check for undefined, null, and NaN - let res = false; - if (typeof value === "number") res = Number.isNaN(value); - else if (typeof value === "string") res = value === ""; - return res || value == null; -} - -export function objectToClass(value: T, klass?: any, elemDepth = 0): any { - if (value !== Object(value)) { - return value; - } - - if (elemDepth === 0 && klass != null) { - return plainToInstance(klass, value, { - excludeExtraneousValues: true, - exposeUnsetFields: false, - }) as typeof klass; - } - - if (Array.isArray(value)) { - return value.map((v) => objectToClass(v, klass, elemDepth - 1)); - } - - if (typeof value === "object" && value != null) { - const copiedRecord: Record = {}; - for (const key in value) { - copiedRecord[key] = objectToClass(value[key], klass, elemDepth - 1); - } - return copiedRecord; - } - - return plainToInstance(klass, value, { - excludeExtraneousValues: true, - exposeUnsetFields: false, - }) as typeof klass; -} - -export function getResFieldDepth(res: any): number { - const props = res["__props__"]; - let resFieldDepth = 1; - - if (props) { - for (const prop of props) { - if (res && res.hasOwnProperty(prop.key)) { - if ( - (prop.type.name == "Array" || prop.type.name == "Object") && - isSpeakeasyBase(prop.elemType) - ) { - if (prop.elemDepth > resFieldDepth) { - resFieldDepth = prop.elemDepth; - break; - } - } - } - } - } - - return resFieldDepth; -} - -export function populateFromGlobals( - value: any, - fieldName: string, - paramType: string, - globals: any -): any { - if (globals && value === undefined) { - if ("parameters" in globals && paramType in globals.parameters) { - const globalValue = globals.parameters[paramType][fieldName]; - if (globalValue !== undefined) { - value = globalValue; - } - } - } - - return value; -} - -export function valToString(value: any): string { - if (value instanceof Date) { - return value.toISOString(); - } - - return value.toString(); -} - -export function shouldQueryParamSerialize(value: any): boolean { - return !(value === undefined || value === null || value === ""); -} diff --git a/src/lib/base64.ts b/src/lib/base64.ts new file mode 100644 index 0000000..c2d5b38 --- /dev/null +++ b/src/lib/base64.ts @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export function bytesToBase64(u8arr: Uint8Array): string { + return btoa(String.fromCodePoint(...u8arr)); +} + +export function bytesFromBase64(encoded: string): Uint8Array { + return Uint8Array.from(atob(encoded), (c) => c.charCodeAt(0)); +} + +export function stringToBytes(str: string): Uint8Array { + return new TextEncoder().encode(str); +} + +export function stringFromBytes(u8arr: Uint8Array): string { + return new TextDecoder().decode(u8arr); +} + +export function stringToBase64(str: string): string { + return bytesToBase64(stringToBytes(str)); +} + +export function stringFromBase64(b64str: string): string { + return stringFromBytes(bytesFromBase64(b64str)); +} + +export const zodOutbound = z + .instanceof(Uint8Array) + .or(z.string().transform(stringToBytes)); + +export const zodInbound = z + .instanceof(Uint8Array) + .or(z.string().transform(bytesFromBase64)); diff --git a/src/lib/config.ts b/src/lib/config.ts new file mode 100644 index 0000000..ef58e2f --- /dev/null +++ b/src/lib/config.ts @@ -0,0 +1,64 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { HTTPClient } from "./http.js"; +import { RetryConfig } from "./retries.js"; +import { Params, pathToFunc } from "./url.js"; + +/** + * Contains the list of servers available to the SDK + */ +export const ServerList = ["https://{defaultHost}"] as const; + +export type SDKOptions = { + httpClient?: HTTPClient; + /** + * Allows overriding the default server used by the SDK + */ + serverIdx?: number; + /** + * Sets the defaultHost variable for url substitution + */ + defaultHost?: string; + /** + * Allows overriding the default server URL used by the SDK + */ + serverURL?: string; + /** + * Allows overriding the default retry config used by the SDK + */ + retryConfig?: RetryConfig; + timeoutMs?: number; +}; + +export function serverURLFromOptions(options: SDKOptions): URL | null { + let serverURL = options.serverURL; + + const serverParams: Params[] = [ + { + defaultHost: options.defaultHost ?? "discourse.example.com", + }, + ]; + let params: Params = {}; + + if (!serverURL) { + const serverIdx = options.serverIdx ?? 0; + if (serverIdx < 0 || serverIdx >= ServerList.length) { + throw new Error(`Invalid server index ${serverIdx}`); + } + serverURL = ServerList[serverIdx] || ""; + params = serverParams[serverIdx] || {}; + } + + const u = pathToFunc(serverURL)(params); + return new URL(u); +} + +export const SDK_METADATA = { + language: "typescript", + openapiDocVersion: "latest", + sdkVersion: "0.5.0", + genVersion: "2.390.6", + userAgent: "speakeasy-sdk/typescript 0.5.0 2.390.6 latest @lukehagar/discoursejs", +} as const; diff --git a/src/lib/dlv.ts b/src/lib/dlv.ts new file mode 100644 index 0000000..e81091f --- /dev/null +++ b/src/lib/dlv.ts @@ -0,0 +1,53 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +/* +MIT License + +Copyright (c) 2024 Jason Miller (http://jasonformat.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +/** + * @param obj The object to walk + * @param key The key path to walk the object with + * @param def A default value to return if the result is undefined + * + * @example + * dlv(obj, "a.b.c.d") + * @example + * dlv(object, ["a", "b", "c", "d"]) + * @example + * dlv(object, "foo.bar.baz", "Hello, default value!") + */ +export function dlv( + obj: any, + key: string | string[], + def?: T, + p?: number, + undef?: never, +): T | undefined { + key = Array.isArray(key) ? key : key.split("."); + for (p = 0; p < key.length; p++) { + const k = key[p]; + obj = k != null && obj ? obj[k] : undef; + } + return obj === undef ? def : obj; +} diff --git a/src/lib/encodings.ts b/src/lib/encodings.ts new file mode 100644 index 0000000..44fa728 --- /dev/null +++ b/src/lib/encodings.ts @@ -0,0 +1,449 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { bytesToBase64 } from "./base64.js"; +import { isPlainObject } from "./is-plain-object.js"; + +export class EncodingError extends Error { + constructor(message: string) { + super(message); + this.name = "EncodingError"; + } +} + +export function encodeMatrix( + key: string, + value: unknown, + options?: { explode?: boolean; charEncoding?: "percent" | "none" }, +): string { + let out = ""; + const pairs: [string, unknown][] = options?.explode + ? explode(key, value) + : [[key, value]]; + + const encodeString = (v: string) => { + return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; + }; + const encodeValue = (v: unknown) => encodeString(serializeValue(v)); + + pairs.forEach(([pk, pv]) => { + let tmp = ""; + let encValue = ""; + + if (pv === undefined) { + return; + } else if (Array.isArray(pv)) { + encValue = mapDefined(pv, (v) => `${encodeValue(v)}`).join(","); + } else if (isPlainObject(pv)) { + encValue = mapDefinedEntries(Object.entries(pv), ([k, v]) => { + return `,${encodeString(k)},${encodeValue(v)}`; + }).join(""); + encValue = encValue.slice(1); + } else { + encValue = `${encodeValue(pv)}`; + } + + const keyPrefix = encodeString(pk); + tmp = `${keyPrefix}=${encValue}`; + // trim trailing '=' if value was empty + if (tmp === `${keyPrefix}=`) { + tmp = tmp.slice(0, -1); + } + + // If we end up with the nothing then skip forward + if (!tmp) { + return; + } + + out += `;${tmp}`; + }); + + return out; +} + +export function encodeLabel( + key: string, + value: unknown, + options?: { explode?: boolean; charEncoding?: "percent" | "none" }, +): string { + let out = ""; + const pairs: [string, unknown][] = options?.explode + ? explode(key, value) + : [[key, value]]; + + const encodeString = (v: string) => { + return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; + }; + const encodeValue = (v: unknown) => encodeString(serializeValue(v)); + + pairs.forEach(([pk, pv]) => { + let encValue = ""; + + if (pv === undefined) { + return; + } else if (Array.isArray(pv)) { + encValue = mapDefined(pv, (v) => `${encodeValue(v)}`).join("."); + } else if (isPlainObject(pv)) { + encValue = mapDefinedEntries(Object.entries(pv), ([k, v]) => { + return `.${encodeString(k)}.${encodeValue(v)}`; + }).join(""); + encValue = encValue.slice(1); + } else { + const k = + options?.explode && isPlainObject(value) ? `${encodeString(pk)}=` : ""; + encValue = `${k}${encodeValue(pv)}`; + } + + out += `.${encValue}`; + }); + + return out; +} + +type FormEncoder = ( + key: string, + value: unknown, + options?: { explode?: boolean; charEncoding?: "percent" | "none" }, +) => string; + +function formEncoder(sep: string): FormEncoder { + return ( + key: string, + value: unknown, + options?: { explode?: boolean; charEncoding?: "percent" | "none" }, + ) => { + let out = ""; + const pairs: [string, unknown][] = options?.explode + ? explode(key, value) + : [[key, value]]; + + const encodeString = (v: string) => { + return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; + }; + + const encodeValue = (v: unknown) => encodeString(serializeValue(v)); + + const encodedSep = encodeString(sep); + + pairs.forEach(([pk, pv]) => { + let tmp = ""; + let encValue = ""; + + if (pv === undefined) { + return; + } else if (Array.isArray(pv)) { + encValue = mapDefined(pv, (v) => `${encodeValue(v)}`).join(encodedSep); + } else if (isPlainObject(pv)) { + encValue = mapDefinedEntries(Object.entries(pv), ([k, v]) => { + return `${encodeString(k)}${encodedSep}${encodeValue(v)}`; + }).join(encodedSep); + } else { + encValue = `${encodeValue(pv)}`; + } + + tmp = `${encodeString(pk)}=${encValue}`; + + // If we end up with the nothing then skip forward + if (!tmp || tmp === "=") { + return; + } + + out += `&${tmp}`; + }); + + return out.slice(1); + }; +} + +export const encodeForm = formEncoder(","); +export const encodeSpaceDelimited = formEncoder(" "); +export const encodePipeDelimited = formEncoder("|"); + +export function encodeBodyForm( + key: string, + value: unknown, + options?: { explode?: boolean; charEncoding?: "percent" | "none" }, +): string { + let out = ""; + const pairs: [string, unknown][] = options?.explode + ? explode(key, value) + : [[key, value]]; + + const encodeString = (v: string) => { + return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; + }; + + const encodeValue = (v: unknown) => encodeString(serializeValue(v)); + + pairs.forEach(([pk, pv]) => { + let tmp = ""; + let encValue = ""; + + if (pv === undefined) { + return; + } else if (Array.isArray(pv)) { + encValue = JSON.stringify(pv, jsonReplacer); + } else if (isPlainObject(pv)) { + encValue = JSON.stringify(pv, jsonReplacer); + } else { + encValue = `${encodeValue(pv)}`; + } + + tmp = `${encodeString(pk)}=${encValue}`; + + // If we end up with the nothing then skip forward + if (!tmp || tmp === "=") { + return; + } + + out += `&${tmp}`; + }); + + return out.slice(1); +} + +export function encodeDeepObject( + key: string, + value: unknown, + options?: { charEncoding?: "percent" | "none" }, +): string { + if (value == null) { + return ""; + } + + if (!isPlainObject(value)) { + throw new EncodingError( + `Value of parameter '${key}' which uses deepObject encoding must be an object`, + ); + } + + return encodeDeepObjectObject(key, value, options); +} + +export function encodeDeepObjectObject( + key: string, + value: unknown, + options?: { charEncoding?: "percent" | "none" }, +): string { + if (value == null) { + return ""; + } + + let out = ""; + + const encodeString = (v: string) => { + return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; + }; + + if (!isPlainObject(value)) { + throw new EncodingError(`Expected parameter '${key}' to be an object.`); + } + + Object.entries(value).forEach(([ck, cv]) => { + if (cv === undefined) { + return; + } + + const pk = `${key}[${ck}]`; + + if (isPlainObject(cv)) { + const objOut = encodeDeepObjectObject(pk, cv, options); + + out += `&${objOut}`; + + return; + } + + const pairs: unknown[] = Array.isArray(cv) ? cv : [cv]; + let encoded = ""; + + encoded = mapDefined(pairs, (v) => { + return `${encodeString(pk)}=${encodeString(serializeValue(v))}`; + }).join("&"); + + out += `&${encoded}`; + }); + + return out.slice(1); +} + +export function encodeJSON( + key: string, + value: unknown, + options?: { explode?: boolean; charEncoding?: "percent" | "none" }, +): string { + if (typeof value === "undefined") { + return ""; + } + + const encodeString = (v: string) => { + return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; + }; + + const encVal = encodeString(JSON.stringify(value, jsonReplacer)); + + return options?.explode ? encVal : `${encodeString(key)}=${encVal}`; +} + +export const encodeSimple = ( + key: string, + value: unknown, + options?: { explode?: boolean; charEncoding?: "percent" | "none" }, +): string => { + let out = ""; + const pairs: [string, unknown][] = options?.explode + ? explode(key, value) + : [[key, value]]; + + const encodeString = (v: string) => { + return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; + }; + const encodeValue = (v: unknown) => encodeString(serializeValue(v)); + + pairs.forEach(([pk, pv]) => { + let tmp = ""; + + if (pv === undefined) { + return; + } else if (Array.isArray(pv)) { + tmp = mapDefined(pv, (v) => `${encodeValue(v)}`).join(","); + } else if (isPlainObject(pv)) { + tmp = mapDefinedEntries(Object.entries(pv), ([k, v]) => { + return `,${encodeString(k)},${encodeValue(v)}`; + }).join(""); + tmp = tmp.slice(1); + } else { + const k = options?.explode && isPlainObject(value) ? `${pk}=` : ""; + tmp = `${k}${encodeValue(pv)}`; + } + + // If we end up with the nothing then skip forward + if (!tmp) { + return; + } + + out += `,${tmp}`; + }); + + return out.slice(1); +}; + +function explode(key: string, value: unknown): [string, unknown][] { + if (Array.isArray(value)) { + return value.map((v) => [key, v]); + } else if (isPlainObject(value)) { + const o = value ?? {}; + return Object.entries(o).map(([k, v]) => [k, v]); + } else { + return [[key, value]]; + } +} + +function serializeValue(value: unknown): string { + if (value === null) { + return "null"; + } else if (typeof value === "undefined") { + return ""; + } else if (value instanceof Date) { + return value.toISOString(); + } else if (value instanceof Uint8Array) { + return bytesToBase64(value); + } else if (typeof value === "object") { + return JSON.stringify(value, jsonReplacer); + } + + return `${value}`; +} + +function jsonReplacer(_: string, value: unknown): unknown { + if (value instanceof Uint8Array) { + return bytesToBase64(value); + } else { + return value; + } +} + +function mapDefined(inp: T[], mapper: (v: T) => R): R[] { + return inp.reduce((acc, v) => { + if (v === undefined) { + return acc; + } + + const m = mapper(v); + if (m === undefined) { + return acc; + } + + acc.push(m); + + return acc; + }, []); +} + +function mapDefinedEntries( + inp: Iterable<[K, V]>, + mapper: (v: [K, V]) => R, +): R[] { + const acc: R[] = []; + for (const [k, v] of inp) { + if (v === undefined) { + continue; + } + + const m = mapper([k, v]); + if (m === undefined) { + continue; + } + + acc.push(m); + } + + return acc; +} + +export function queryJoin(...args: string[]): string { + return args.filter(Boolean).join("&"); +} + +type QueryEncoderOptions = { + explode?: boolean; + charEncoding?: "percent" | "none"; +}; + +type QueryEncoder = ( + key: string, + value: unknown, + options?: QueryEncoderOptions, +) => string; + +type BulkQueryEncoder = ( + values: Record, + options?: QueryEncoderOptions, +) => string; + +export function queryEncoder(f: QueryEncoder): BulkQueryEncoder { + const bulkEncode = function ( + values: Record, + options?: QueryEncoderOptions, + ): string { + const opts: QueryEncoderOptions = { + ...options, + explode: options?.explode ?? true, + charEncoding: options?.charEncoding ?? "percent", + }; + + const encoded = Object.entries(values).map(([key, value]) => { + return f(key, value, opts); + }); + return queryJoin(...encoded); + }; + + return bulkEncode; +} + +export const encodeJSONQuery = queryEncoder(encodeJSON); +export const encodeFormQuery = queryEncoder(encodeForm); +export const encodeSpaceDelimitedQuery = queryEncoder(encodeSpaceDelimited); +export const encodePipeDelimitedQuery = queryEncoder(encodePipeDelimited); +export const encodeDeepObjectQuery = queryEncoder(encodeDeepObject); diff --git a/src/lib/http.ts b/src/lib/http.ts new file mode 100644 index 0000000..f8c544d --- /dev/null +++ b/src/lib/http.ts @@ -0,0 +1,323 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +export type Fetcher = ( + input: RequestInfo | URL, + init?: RequestInit, +) => Promise; + +export type Awaitable = T | Promise; + +const DEFAULT_FETCHER: Fetcher = (input, init) => { + // If input is a Request and init is undefined, Bun will discard the method, + // headers, body and other options that were set on the request object. + // Node.js and browers would ignore an undefined init value. This check is + // therefore needed for interop with Bun. + if (init == null) { + return fetch(input); + } else { + return fetch(input, init); + } +}; + +export type RequestInput = { + /** + * The URL the request will use. + */ + url: URL; + /** + * Options used to create a [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request). + */ + options?: RequestInit | undefined; +}; + +export interface HTTPClientOptions { + fetcher?: Fetcher; +} + +export type BeforeRequestHook = (req: Request) => Awaitable; +export type RequestErrorHook = (err: unknown, req: Request) => Awaitable; +export type ResponseHook = (res: Response, req: Request) => Awaitable; + +export class HTTPClient { + private fetcher: Fetcher; + private requestHooks: BeforeRequestHook[] = []; + private requestErrorHooks: RequestErrorHook[] = []; + private responseHooks: ResponseHook[] = []; + + constructor(private options: HTTPClientOptions = {}) { + this.fetcher = options.fetcher || DEFAULT_FETCHER; + } + + async request(request: Request): Promise { + let req = request; + for (const hook of this.requestHooks) { + const nextRequest = await hook(req); + if (nextRequest) { + req = nextRequest; + } + } + + try { + const res = await this.fetcher(req); + + for (const hook of this.responseHooks) { + await hook(res, req); + } + + return res; + } catch (err) { + for (const hook of this.requestErrorHooks) { + await hook(err, req); + } + + throw err; + } + } + + /** + * Registers a hook that is called before a request is made. The hook function + * can mutate the request or return a new request. This may be useful to add + * additional information to request such as request IDs and tracing headers. + */ + addHook(hook: "beforeRequest", fn: BeforeRequestHook): this; + /** + * Registers a hook that is called when a request cannot be made due to a + * network error. + */ + addHook(hook: "requestError", fn: RequestErrorHook): this; + /** + * Registers a hook that is called when a response has been received from the + * server. + */ + addHook(hook: "response", fn: ResponseHook): this; + addHook( + ...args: + | [hook: "beforeRequest", fn: BeforeRequestHook] + | [hook: "requestError", fn: RequestErrorHook] + | [hook: "response", fn: ResponseHook] + ) { + if (args[0] === "beforeRequest") { + this.requestHooks.push(args[1]); + } else if (args[0] === "requestError") { + this.requestErrorHooks.push(args[1]); + } else if (args[0] === "response") { + this.responseHooks.push(args[1]); + } else { + throw new Error(`Invalid hook type: ${args[0]}`); + } + return this; + } + + /** Removes a hook that was previously registered with `addHook`. */ + removeHook(hook: "beforeRequest", fn: BeforeRequestHook): this; + /** Removes a hook that was previously registered with `addHook`. */ + removeHook(hook: "requestError", fn: RequestErrorHook): this; + /** Removes a hook that was previously registered with `addHook`. */ + removeHook(hook: "response", fn: ResponseHook): this; + removeHook( + ...args: + | [hook: "beforeRequest", fn: BeforeRequestHook] + | [hook: "requestError", fn: RequestErrorHook] + | [hook: "response", fn: ResponseHook] + ): this { + let target: unknown[]; + if (args[0] === "beforeRequest") { + target = this.requestHooks; + } else if (args[0] === "requestError") { + target = this.requestErrorHooks; + } else if (args[0] === "response") { + target = this.responseHooks; + } else { + throw new Error(`Invalid hook type: ${args[0]}`); + } + + const index = target.findIndex((v) => v === args[1]); + if (index >= 0) { + target.splice(index, 1); + } + + return this; + } + + clone(): HTTPClient { + const child = new HTTPClient(this.options); + child.requestHooks = this.requestHooks.slice(); + child.requestErrorHooks = this.requestErrorHooks.slice(); + child.responseHooks = this.responseHooks.slice(); + + return child; + } +} + +export type StatusCodePredicate = number | string | (number | string)[]; + +// A semicolon surrounded by optional whitespace characters is used to separate +// segments in a media type string. +const mediaParamSeparator = /\s*;\s*/g; + +function matchContentType(response: Response, pattern: string): boolean { + // `*` is a special case which means anything is acceptable. + if (pattern === "*") { + return true; + } + + let contentType = + response.headers.get("content-type")?.trim() || "application/octet-stream"; + contentType = contentType.toLowerCase(); + + const wantParts = pattern.toLowerCase().trim().split(mediaParamSeparator); + const [wantType = "", ...wantParams] = wantParts; + + if (wantType.split("/").length !== 2) { + return false; + } + + const gotParts = contentType.split(mediaParamSeparator); + const [gotType = "", ...gotParams] = gotParts; + + const [type = "", subtype = ""] = gotType.split("/"); + if (!type || !subtype) { + return false; + } + + if ( + wantType !== "*/*" && + gotType !== wantType && + `${type}/*` !== wantType && + `*/${subtype}` !== wantType + ) { + return false; + } + + if (gotParams.length < wantParams.length) { + return false; + } + + const params = new Set(gotParams); + for (const wantParam of wantParams) { + if (!params.has(wantParam)) { + return false; + } + } + + return true; +} + +const codeRangeRE = new RegExp("^[0-9]xx$", "i"); + +export function matchStatusCode( + response: Response, + codes: StatusCodePredicate, +): boolean { + const actual = `${response.status}`; + const expectedCodes = Array.isArray(codes) ? codes : [codes]; + if (!expectedCodes.length) { + return false; + } + + return expectedCodes.some((ec) => { + const code = `${ec}`; + + if (code === "default") { + return true; + } + + if (!codeRangeRE.test(`${code}`)) { + return code === actual; + } + + const expectFamily = code.charAt(0); + if (!expectFamily) { + throw new Error("Invalid status code range"); + } + + const actualFamily = actual.charAt(0); + if (!actualFamily) { + throw new Error(`Invalid response status code: ${actual}`); + } + + return actualFamily === expectFamily; + }); +} + +export function matchResponse( + response: Response, + code: StatusCodePredicate, + contentTypePattern: string, +): boolean { + return ( + matchStatusCode(response, code) && + matchContentType(response, contentTypePattern) + ); +} + +/** + * Uses various heurisitics to determine if an error is a connection error. + */ +export function isConnectionError(err: unknown): boolean { + if (typeof err !== "object" || err == null) { + return false; + } + + // Covers fetch in Deno as well + const isBrowserErr = + err instanceof TypeError && + err.message.toLowerCase().startsWith("failed to fetch"); + + const isNodeErr = + err instanceof TypeError && + err.message.toLowerCase().startsWith("fetch failed"); + + const isBunErr = "name" in err && err.name === "ConnectionError"; + + const isGenericErr = + "code" in err && + typeof err.code === "string" && + err.code.toLowerCase() === "econnreset"; + + return isBrowserErr || isNodeErr || isGenericErr || isBunErr; +} + +/** + * Uses various heurisitics to determine if an error is a timeout error. + */ +export function isTimeoutError(err: unknown): boolean { + if (typeof err !== "object" || err == null) { + return false; + } + + // Fetch in browser, Node.js, Bun, Deno + const isNative = "name" in err && err.name === "TimeoutError"; + const isLegacyNative = "code" in err && err.code === 23; + + // Node.js HTTP client and Axios + const isGenericErr = + "code" in err && + typeof err.code === "string" && + err.code.toLowerCase() === "econnaborted"; + + return isNative || isLegacyNative || isGenericErr; +} + +/** + * Uses various heurisitics to determine if an error is a abort error. + */ +export function isAbortError(err: unknown): boolean { + if (typeof err !== "object" || err == null) { + return false; + } + + // Fetch in browser, Node.js, Bun, Deno + const isNative = "name" in err && err.name === "AbortError"; + const isLegacyNative = "code" in err && err.code === 20; + + // Node.js HTTP client and Axios + const isGenericErr = + "code" in err && + typeof err.code === "string" && + err.code.toLowerCase() === "econnaborted"; + + return isNative || isLegacyNative || isGenericErr; +} diff --git a/src/lib/is-plain-object.ts b/src/lib/is-plain-object.ts new file mode 100644 index 0000000..61070d3 --- /dev/null +++ b/src/lib/is-plain-object.ts @@ -0,0 +1,43 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +/* +MIT License + +Copyright (c) Sindre Sorhus (https://sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +// Taken from https://github.com/sindresorhus/is-plain-obj/blob/97f38e8836f86a642cce98fc6ab3058bc36df181/index.js + +export function isPlainObject(value: unknown): value is object { + if (typeof value !== "object" || value === null) { + return false; + } + + const prototype = Object.getPrototypeOf(value); + return ( + (prototype === null || + prototype === Object.prototype || + Object.getPrototypeOf(prototype) === null) && + !(Symbol.toStringTag in value) && + !(Symbol.iterator in value) + ); +} diff --git a/src/lib/matchers.ts b/src/lib/matchers.ts new file mode 100644 index 0000000..2ccbfb6 --- /dev/null +++ b/src/lib/matchers.ts @@ -0,0 +1,308 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { safeParse } from "./schemas.js"; +import { StatusCodePredicate, matchResponse, matchStatusCode } from "./http.js"; +import { isPlainObject } from "./is-plain-object.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import { Result } from "../sdk/types/fp.js"; + +export type Encoding = "json" | "text" | "bytes" | "stream" | "sse" | "nil" | "fail"; + +const DEFAULT_CONTENT_TYPES: Record = { + json: "application/json", + text: "text/plain", + bytes: "application/octet-stream", + stream: "application/octet-stream", + sse: "text/event-stream", + nil: "*", + fail: "*", +}; + +type Schema = { parse(raw: unknown): T }; + +type MatchOptions = { ctype?: string; hdrs?: boolean; key?: string; sseSentinel?: string }; + +export type ValueMatcher = MatchOptions & { + enc: Encoding; + codes: StatusCodePredicate; + schema: Schema; +}; + +export type ErrorMatcher = MatchOptions & { + enc: Encoding; + codes: StatusCodePredicate; + schema: Schema; + err: true; +}; + +export type FailMatcher = { + enc: "fail"; + codes: StatusCodePredicate; +}; + +export type Matcher = ValueMatcher | ErrorMatcher | FailMatcher; + +export function jsonErr( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ErrorMatcher { + return { ...options, err: true, enc: "json", codes, schema }; +} +export function json( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ValueMatcher { + return { ...options, enc: "json", codes, schema }; +} + +export function textErr( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ErrorMatcher { + return { ...options, err: true, enc: "text", codes, schema }; +} +export function text( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ValueMatcher { + return { ...options, enc: "text", codes, schema }; +} + +export function bytesErr( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ErrorMatcher { + return { ...options, err: true, enc: "bytes", codes, schema }; +} +export function bytes( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ValueMatcher { + return { ...options, enc: "bytes", codes, schema }; +} + +export function streamErr( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ErrorMatcher { + return { ...options, err: true, enc: "stream", codes, schema }; +} +export function stream( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ValueMatcher { + return { ...options, enc: "stream", codes, schema }; +} + +export function sseErr( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ErrorMatcher { + return { ...options, err: true, enc: "sse", codes, schema }; +} +export function sse( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ValueMatcher { + return { ...options, enc: "sse", codes, schema }; +} + +export function nilErr( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ErrorMatcher { + return { ...options, err: true, enc: "nil", codes, schema }; +} +export function nil( + codes: StatusCodePredicate, + schema: Schema, + options?: MatchOptions +): ValueMatcher { + return { ...options, enc: "nil", codes, schema }; +} + +export function fail(codes: StatusCodePredicate): FailMatcher { + return { enc: "fail", codes }; +} + +export type MatchedValue = Matchers extends Matcher[] ? T : never; +export type MatchedError = Matchers extends Matcher[] ? E : never; +export type MatchFunc = ( + response: Response, + options?: { resultKey?: string; extraFields?: Record } +) => Promise<[result: Result, raw: unknown]>; + +export function match( + ...matchers: Array> +): MatchFunc { + return async function matchFunc( + response: Response, + options?: { resultKey?: string; extraFields?: Record } + ): Promise<[result: Result, raw: unknown]> { + let raw: unknown; + let matcher: Matcher | undefined; + for (const match of matchers) { + const { codes } = match; + const ctpattern = "ctype" in match ? match.ctype : DEFAULT_CONTENT_TYPES[match.enc]; + if (ctpattern && matchResponse(response, codes, ctpattern)) { + matcher = match; + break; + } else if (!ctpattern && matchStatusCode(response, codes)) { + matcher = match; + break; + } + } + + if (!matcher) { + const responseBody = await response.text(); + return [ + { + ok: false, + error: new SDKError( + "Unexpected API response status or content-type", + response, + responseBody + ), + }, + responseBody, + ]; + } + + const encoding = matcher.enc; + switch (encoding) { + case "json": + raw = await response.json(); + break; + case "bytes": + raw = await response.arrayBuffer(); + break; + case "stream": + raw = response.body; + break; + case "text": + raw = await response.text(); + break; + case "sse": + raw = response.body; + break; + case "nil": + raw = await discardResponseBody(response); + break; + case "fail": + raw = await response.text(); + break; + default: + encoding satisfies never; + throw new Error(`Unsupported response type: ${encoding}`); + } + + if (matcher.enc === "fail") { + return [ + { + ok: false, + error: new SDKError( + "API error occurred", + response, + typeof raw === "string" ? raw : "" + ), + }, + raw, + ]; + } + + const resultKey = matcher.key || options?.resultKey; + let data: unknown; + + if ("err" in matcher) { + data = { + ...options?.extraFields, + ...(matcher.hdrs ? { Headers: unpackHeaders(response.headers) } : null), + ...(isPlainObject(raw) ? raw : null), + }; + } else if (resultKey) { + data = { + ...options?.extraFields, + ...(matcher.hdrs ? { Headers: unpackHeaders(response.headers) } : null), + [resultKey]: raw, + }; + } else if (matcher.hdrs) { + data = { + ...options?.extraFields, + ...(matcher.hdrs ? { Headers: unpackHeaders(response.headers) } : null), + ...(isPlainObject(raw) ? raw : null), + }; + } else { + data = raw; + } + + if ("err" in matcher) { + const result = safeParse( + data, + (v: unknown) => matcher.schema.parse(v), + "Response validation failed" + ); + return [result.ok ? { ok: false, error: result.value } : result, raw]; + } else { + return [ + safeParse( + data, + (v: unknown) => matcher.schema.parse(v), + "Response validation failed" + ), + raw, + ]; + } + }; +} + +const headerValRE = /, */; +/** + * Iterates over a Headers object and returns an object with all the header + * entries. Values are represented as an array to account for repeated headers. + */ +export function unpackHeaders(headers: Headers): Record { + const out: Record = {}; + + for (const [k, v] of headers.entries()) { + out[k] = v.split(headerValRE); + } + + return out; +} + +/** + * Discards the response body to free up resources. + * + * To learn why this is need, see the undici docs: + * https://undici.nodejs.org/#/?id=garbage-collection + */ +export async function discardResponseBody(res: Response) { + const reader = res.body?.getReader(); + if (reader == null) { + return; + } + + try { + let done = false; + while (!done) { + const res = await reader.read(); + done = res.done; + } + } finally { + reader.releaseLock(); + } +} diff --git a/src/lib/primitives.ts b/src/lib/primitives.ts new file mode 100644 index 0000000..23794a2 --- /dev/null +++ b/src/lib/primitives.ts @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +export type Remap = { + [k in keyof Inp as Mapping[k] extends string /* if we have a string mapping for this key then use it */ + ? Mapping[k] + : Mapping[k] extends null /* if the mapping is to `null` then drop the key */ + ? never + : k /* otherwise keep the key as-is */]: Inp[k]; +}; + +/** + * Converts or omits an object's keys according to a mapping. + * + * @param inp An object whose keys will be remapped + * @param mappings A mapping of original keys to new keys. If a key is not present in the mapping, it will be left as is. If a key is mapped to `null`, it will be removed in the resulting object. + * @returns A new object with keys remapped or omitted according to the mappings + */ +export function remap< + Inp extends Record, + const Mapping extends { [k in keyof Inp]?: string | null }, +>(inp: Inp, mappings: Mapping): Remap { + let out: any = {}; + + if (!Object.keys(mappings).length) { + out = inp; + return out; + } + + for (const [k, v] of Object.entries(inp)) { + const j = mappings[k]; + if (j === null) { + continue; + } + out[j ?? k] = v; + } + + return out; +} diff --git a/src/lib/retries.ts b/src/lib/retries.ts new file mode 100644 index 0000000..df3e0bc --- /dev/null +++ b/src/lib/retries.ts @@ -0,0 +1,187 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { isConnectionError, isTimeoutError } from "./http.js"; + +export type BackoffStrategy = { + initialInterval: number; + maxInterval: number; + exponent: number; + maxElapsedTime: number; +}; + +const defaultBackoff: BackoffStrategy = { + initialInterval: 500, + maxInterval: 60000, + exponent: 1.5, + maxElapsedTime: 3600000, +}; + +export type RetryConfig = + | { strategy: "none" } + | { + strategy: "backoff"; + backoff?: BackoffStrategy; + retryConnectionErrors?: boolean; + }; + +class PermanentError extends Error { + inner: unknown; + + constructor(inner: unknown) { + super("Permanent error"); + this.inner = inner; + + Object.setPrototypeOf(this, PermanentError.prototype); + } +} + +class TemporaryError extends Error { + res: Response; + + constructor(res: Response) { + super("Temporary error"); + this.res = res; + + Object.setPrototypeOf(this, TemporaryError.prototype); + } +} + +export async function retry( + fetchFn: () => Promise, + options: { + config: RetryConfig; + statusCodes: string[]; + }, +): Promise { + switch (options.config.strategy) { + case "backoff": + return retryBackoff( + wrapFetcher(fetchFn, { + statusCodes: options.statusCodes, + retryConnectionErrors: !!options.config.retryConnectionErrors, + }), + options.config.backoff ?? defaultBackoff, + ); + default: + return await fetchFn(); + } +} + +function wrapFetcher( + fn: () => Promise, + options: { + statusCodes: string[]; + retryConnectionErrors: boolean; + }, +): () => Promise { + return async () => { + try { + const res = await fn(); + if (isRetryableResponse(res, options.statusCodes)) { + throw new TemporaryError(res); + } + + return res; + } catch (err) { + if (err instanceof TemporaryError) { + throw err; + } + + if ( + options.retryConnectionErrors && + (isTimeoutError(err) || isConnectionError(err)) + ) { + throw err; + } + + throw new PermanentError(err); + } + }; +} + +const codeRangeRE = new RegExp("^[0-9]xx$", "i"); + +function isRetryableResponse(res: Response, statusCodes: string[]): boolean { + const actual = `${res.status}`; + + return statusCodes.some((code) => { + if (!codeRangeRE.test(code)) { + return code === actual; + } + + const expectFamily = code.charAt(0); + if (!expectFamily) { + throw new Error("Invalid status code range"); + } + + const actualFamily = actual.charAt(0); + if (!actualFamily) { + throw new Error(`Invalid response status code: ${actual}`); + } + + return actualFamily === expectFamily; + }); +} + +async function retryBackoff( + fn: () => Promise, + strategy: BackoffStrategy, +): Promise { + const { maxElapsedTime, initialInterval, exponent, maxInterval } = strategy; + + const start = Date.now(); + let x = 0; + + // eslint-disable-next-line no-constant-condition + while (true) { + try { + const res = await fn(); + return res; + } catch (err) { + if (err instanceof PermanentError) { + throw err.inner; + } + const elapsed = Date.now() - start; + if (elapsed > maxElapsedTime) { + if (err instanceof TemporaryError) { + return err.res; + } + + throw err; + } + + let retryInterval = 0; + if (err instanceof TemporaryError && err.res && err.res.headers) { + const retryVal = err.res.headers.get("retry-after") || ""; + if (retryVal != "") { + const parsedNumber = Number(retryVal); + if (!isNaN(parsedNumber) && Number.isInteger(parsedNumber)) { + retryInterval = parsedNumber * 1000; + } else { + const parsedDate = Date.parse(retryVal); + if (!isNaN(parsedDate)) { + const deltaMS = parsedDate - Date.now(); + retryInterval = deltaMS > 0 ? Math.ceil(deltaMS) : 0; + } + } + } + } + + if (retryInterval == 0) { + retryInterval = + initialInterval * Math.pow(x, exponent) + Math.random() * 1000; + } + + const d = Math.min(retryInterval, maxInterval); + + await delay(d); + x++; + } + } +} + +async function delay(delay: number): Promise { + return new Promise((resolve) => setTimeout(resolve, delay)); +} diff --git a/src/lib/schemas.ts b/src/lib/schemas.ts new file mode 100644 index 0000000..3eda511 --- /dev/null +++ b/src/lib/schemas.ts @@ -0,0 +1,74 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { output, ZodEffects, ZodError, ZodObject, ZodRawShape, ZodTypeAny } from "zod"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import { ERR, OK, Result } from "../sdk/types/fp.js"; + +/** + * Utility function that executes some code which may throw a ZodError. It + * intercepts this error and converts it to an SDKValidationError so as to not + * leak Zod implementation details to user code. + */ +export function parse(rawValue: Inp, fn: (value: Inp) => Out, errorMessage: string): Out { + try { + return fn(rawValue); + } catch (err) { + if (err instanceof ZodError) { + throw new SDKValidationError(errorMessage, err, rawValue); + } + throw err; + } +} + +/** + * Utility function that executes some code which may result in a ZodError. It + * intercepts this error and converts it to an SDKValidationError so as to not + * leak Zod implementation details to user code. + */ +export function safeParse( + rawValue: Inp, + fn: (value: Inp) => Out, + errorMessage: string +): Result { + try { + return OK(fn(rawValue)); + } catch (err) { + return ERR(new SDKValidationError(errorMessage, err, rawValue)); + } +} + +export function collectExtraKeys< + Shape extends ZodRawShape, + Catchall extends ZodTypeAny, + K extends string +>( + obj: ZodObject, + extrasKey: K +): ZodEffects< + typeof obj, + output> & { + [k in K]: Record>; + } +> { + return obj.transform((val) => { + const extras: Record> = {}; + const { shape } = obj; + for (const [key] of Object.entries(val)) { + if (key in shape) { + continue; + } + + const v = val[key]; + if (typeof v === "undefined") { + continue; + } + + extras[key] = v; + delete val[key]; + } + + return { ...val, [extrasKey]: extras }; + }); +} diff --git a/src/lib/sdks.ts b/src/lib/sdks.ts new file mode 100644 index 0000000..530ca70 --- /dev/null +++ b/src/lib/sdks.ts @@ -0,0 +1,261 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + HTTPClient, + matchStatusCode, + isAbortError, + isTimeoutError, + isConnectionError, +} from "./http.js"; +import { SecurityState } from "./security.js"; +import { retry, RetryConfig } from "./retries.js"; +import { encodeForm } from "./encodings.js"; +import { stringToBase64 } from "./base64.js"; +import { SDKOptions, SDK_METADATA, serverURLFromOptions } from "./config.js"; +import { SDKHooks } from "../hooks/hooks.js"; +import { HookContext } from "../hooks/types.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../sdk/models/errors/httpclienterrors.js"; +import { ERR, OK, Result } from "../sdk/types/fp.js"; + +export type RequestOptions = { + /** + * Sets a timeout, in milliseconds, on HTTP requests made by an SDK method. If + * `fetchOptions.signal` is set then it will take precedence over this option. + */ + timeoutMs?: number; + /** + * Set or override a retry policy on HTTP calls. + */ + retries?: RetryConfig; + /** + * Specifies the status codes which should be retried using the given retry policy. + */ + retryCodes?: string[]; + /** + * Sets various request options on the `fetch` call made by an SDK method. + * + * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options|Request} + */ + fetchOptions?: Omit; +}; + +type RequestConfig = { + method: string; + path: string; + baseURL?: string | URL; + query?: string; + body?: RequestInit["body"]; + headers?: HeadersInit; + security?: SecurityState | null; + uaHeader?: string; + timeoutMs?: number; +}; + +const gt: unknown = typeof globalThis === "undefined" ? null : globalThis; +const webWorkerLike = + typeof gt === "object" && + gt != null && + "importScripts" in gt && + typeof gt["importScripts"] === "function"; +const isBrowserLike = + webWorkerLike || + (typeof navigator !== "undefined" && "serviceWorker" in navigator) || + (typeof window === "object" && typeof window.document !== "undefined"); + +export class ClientSDK { + private readonly httpClient: HTTPClient; + protected readonly baseURL: URL | null; + protected readonly hooks$: SDKHooks; + public readonly options$: SDKOptions & { hooks?: SDKHooks }; + + constructor(options: SDKOptions = {}) { + const opt = options as unknown; + if ( + typeof opt === "object" && + opt != null && + "hooks" in opt && + opt.hooks instanceof SDKHooks + ) { + this.hooks$ = opt.hooks; + } else { + this.hooks$ = new SDKHooks(); + } + this.options$ = { ...options, hooks: this.hooks$ }; + + const url = serverURLFromOptions(options); + if (url) { + url.pathname = url.pathname.replace(/\/+$/, "") + "/"; + } + const { baseURL, client } = this.hooks$.sdkInit({ + baseURL: url, + client: options.httpClient || new HTTPClient(), + }); + this.baseURL = baseURL; + this.httpClient = client; + } + + public createRequest$( + context: HookContext, + conf: RequestConfig, + options?: RequestOptions + ): Result { + const { method, path, query, headers: opHeaders, security } = conf; + + const base = conf.baseURL ?? this.baseURL; + if (!base) { + return ERR(new InvalidRequestError("No base URL provided for operation")); + } + const reqURL = new URL(base); + const inputURL = new URL(path, reqURL); + + if (path) { + reqURL.pathname += inputURL.pathname.replace(/^\/+/, ""); + } + + let finalQuery = query || ""; + + const secQuery: string[] = []; + for (const [k, v] of Object.entries(security?.queryParams || {})) { + secQuery.push(encodeForm(k, v, { charEncoding: "percent" })); + } + if (secQuery.length) { + finalQuery += `&${secQuery.join("&")}`; + } + + if (finalQuery) { + const q = finalQuery.startsWith("&") ? finalQuery.slice(1) : finalQuery; + reqURL.search = `?${q}`; + } + + const headers = new Headers(opHeaders); + + const username = security?.basic.username; + const password = security?.basic.password; + if (username != null || password != null) { + const encoded = stringToBase64([username || "", password || ""].join(":")); + headers.set("Authorization", `Basic ${encoded}`); + } + + const securityHeaders = new Headers(security?.headers || {}); + for (const [k, v] of securityHeaders) { + headers.set(k, v); + } + + let cookie = headers.get("cookie") || ""; + for (const [k, v] of Object.entries(security?.cookies || {})) { + cookie += `; ${k}=${v}`; + } + cookie = cookie.startsWith("; ") ? cookie.slice(2) : cookie; + headers.set("cookie", cookie); + + const userHeaders = new Headers(options?.fetchOptions?.headers); + for (const [k, v] of userHeaders) { + headers.set(k, v); + } + + // Only set user agent header in non-browser-like environments since CORS + // policy disallows setting it in browsers e.g. Chrome throws an error. + if (!isBrowserLike) { + headers.set(conf.uaHeader ?? "user-agent", SDK_METADATA.userAgent); + } + + let fetchOptions = options?.fetchOptions; + if (!fetchOptions?.signal && conf.timeoutMs && conf.timeoutMs > 0) { + const timeoutSignal = AbortSignal.timeout(conf.timeoutMs); + if (!fetchOptions) { + fetchOptions = { signal: timeoutSignal }; + } else { + fetchOptions.signal = timeoutSignal; + } + } + + let input; + try { + input = this.hooks$.beforeCreateRequest(context, { + url: reqURL, + options: { + ...fetchOptions, + body: conf.body ?? null, + headers, + method, + }, + }); + } catch (err: unknown) { + return ERR( + new UnexpectedClientError("Create request hook failed to execute", { cause: err }) + ); + } + + return OK(new Request(input.url, input.options)); + } + + public async do$( + request: Request, + options: { + context: HookContext; + errorCodes: number | string | (number | string)[]; + retryConfig?: RetryConfig | undefined; + retryCodes?: string[] | undefined; + } + ): Promise< + Result< + Response, + RequestAbortedError | RequestTimeoutError | ConnectionError | UnexpectedClientError + > + > { + const { context, errorCodes } = options; + const retryConfig = options.retryConfig || { strategy: "none" }; + const retryCodes = options.retryCodes || []; + + return retry( + async () => { + const req = request.clone(); + + let response = await this.httpClient.request( + await this.hooks$.beforeRequest(context, req) + ); + + if (matchStatusCode(response, errorCodes)) { + const result = await this.hooks$.afterError(context, response, null); + if (result.error) { + throw result.error; + } + response = result.response || response; + } else { + response = await this.hooks$.afterSuccess(context, response); + } + + return response; + }, + { config: retryConfig, statusCodes: retryCodes } + ).then( + (r) => OK(r), + (err) => { + switch (true) { + case isAbortError(err): + return ERR( + new RequestAbortedError("Request aborted by client", { cause: err }) + ); + case isTimeoutError(err): + return ERR(new RequestTimeoutError("Request timed out", { cause: err })); + case isConnectionError(err): + return ERR(new ConnectionError("Unable to make request", { cause: err })); + default: + return ERR( + new UnexpectedClientError("Unexpected HTTP client error", { + cause: err, + }) + ); + } + } + ); + } +} diff --git a/src/lib/security.ts b/src/lib/security.ts new file mode 100644 index 0000000..94dcf92 --- /dev/null +++ b/src/lib/security.ts @@ -0,0 +1,170 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +export enum SecurityErrorCode { + Incomplete = "incomplete", + UnrecognisedSecurityType = "unrecognized_security_type", +} + +export class SecurityError extends Error { + constructor(public code: SecurityErrorCode, message: string) { + super(message); + this.name = "SecurityError"; + } + + static incomplete(): SecurityError { + return new SecurityError( + SecurityErrorCode.Incomplete, + "Security requirements not met in order to perform the operation" + ); + } + static unrecognizedType(type: string): SecurityError { + return new SecurityError( + SecurityErrorCode.UnrecognisedSecurityType, + `Unrecognised security type: ${type}` + ); + } +} + +export type SecurityState = { + basic: { username?: string | undefined; password?: string | undefined }; + headers: Record; + queryParams: Record; + cookies: Record; +}; + +type SecurityInputBasic = { + type: "http:basic"; + value: { username?: string | undefined; password?: string | undefined } | null | undefined; +}; + +type SecurityInputBearer = { + type: "http:bearer"; + value: string | null | undefined; + fieldName: string; +}; + +type SecurityInputAPIKey = { + type: "apiKey:header" | "apiKey:query" | "apiKey:cookie"; + value: string | null | undefined; + fieldName: string; +}; + +type SecurityInputOIDC = { + type: "openIdConnect"; + value: string | null | undefined; + fieldName: string; +}; + +type SecurityInputOAuth2 = { + type: "oauth2"; + value: string | null | undefined; + fieldName: string; +}; + +type SecurityInputOAuth2ClientCredentials = { + type: "oauth2:client_credentials"; + value: { clientID?: string | undefined; clientSecret?: string | undefined } | null | undefined; +}; + +export type SecurityInput = + | SecurityInputBasic + | SecurityInputBearer + | SecurityInputAPIKey + | SecurityInputOAuth2 + | SecurityInputOAuth2ClientCredentials + | SecurityInputOIDC; + +export function resolveSecurity(...options: SecurityInput[][]): SecurityState | null { + const state: SecurityState = { + basic: { username: "", password: "" }, + headers: {}, + queryParams: {}, + cookies: {}, + }; + + const option = options.find((opts) => { + return opts.every((o) => { + if (o.value == null) { + return false; + } else if (o.type === "http:basic") { + return o.value.username != null || o.value.password != null; + } else if (o.type === "oauth2:client_credentials") { + return o.value.clientID != null || o.value.clientSecret != null; + } else if (typeof o.value === "string") { + return !!o.value; + } else { + throw new Error( + `Unrecognized security type: ${o.type} (value type: ${typeof o.value})` + ); + } + }); + }); + if (option == null) { + return null; + } + + option.forEach((spec) => { + if (spec.value == null) { + return; + } + + const { type } = spec; + + switch (type) { + case "apiKey:header": + state.headers[spec.fieldName] = spec.value; + break; + case "apiKey:query": + state.queryParams[spec.fieldName] = spec.value; + break; + case "apiKey:cookie": + state.cookies[spec.fieldName] = spec.value; + break; + case "http:basic": + applyBasic(state, spec); + break; + case "http:bearer": + applyBearer(state, spec); + break; + case "oauth2": + applyBearer(state, spec); + break; + case "oauth2:client_credentials": + break; + case "openIdConnect": + applyBearer(state, spec); + break; + default: + spec satisfies never; + throw SecurityError.unrecognizedType(type); + } + }); + + return state; +} + +function applyBasic(state: SecurityState, spec: SecurityInputBasic) { + if (spec.value == null) { + return; + } + + state.basic = spec.value; +} + +function applyBearer( + state: SecurityState, + spec: SecurityInputBearer | SecurityInputOAuth2 | SecurityInputOIDC +) { + if (spec.value == null) { + return; + } + + let value = spec.value; + if (value.slice(0, 7).toLowerCase() !== "bearer ") { + value = `Bearer ${value}`; + } + + state.headers[spec.fieldName] = value; +} diff --git a/src/lib/url.ts b/src/lib/url.ts new file mode 100644 index 0000000..6bc6356 --- /dev/null +++ b/src/lib/url.ts @@ -0,0 +1,33 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +const hasOwn = Object.prototype.hasOwnProperty; + +export type Params = Partial>; + +export function pathToFunc( + pathPattern: string, + options?: { charEncoding?: "percent" | "none" }, +): (params?: Params) => string { + const paramRE = /\{([a-zA-Z0-9_]+?)\}/g; + + return function buildURLPath(params: Record = {}): string { + return pathPattern.replace(paramRE, function (_, placeholder) { + if (!hasOwn.call(params, placeholder)) { + throw new Error(`Parameter '${placeholder}' is required`); + } + + const value = params[placeholder]; + if (typeof value !== "string" && typeof value !== "number") { + throw new Error( + `Parameter '${placeholder}' must be a string or number`, + ); + } + + return options?.charEncoding === "percent" + ? encodeURIComponent(`${value}`) + : `${value}`; + }); + }; +} diff --git a/src/sdk/admin.ts b/src/sdk/admin.ts index a89c7a3..95306ab 100644 --- a/src/sdk/admin.ts +++ b/src/sdk/admin.ts @@ -1,85 +1,30 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as utils from "../internal/utils"; -import * as errors from "../sdk/models/errors"; -import * as operations from "../sdk/models/operations"; -import { SDKConfiguration } from "./sdk"; -import { AxiosInstance, AxiosRequestConfig, AxiosResponse, RawAxiosRequestHeaders } from "axios"; - -export class Admin { - private sdkConfiguration: SDKConfiguration; - - constructor(sdkConfig: SDKConfiguration) { - this.sdkConfiguration = sdkConfig; - } +import { adminActivateUser } from "../funcs/adminActivateUser.js"; +import { adminAdminGetUser } from "../funcs/adminAdminGetUser.js"; +import { adminAdminListUsers } from "../funcs/adminAdminListUsers.js"; +import { adminAnonymizeUser } from "../funcs/adminAnonymizeUser.js"; +import { adminDeactivateUser } from "../funcs/adminDeactivateUser.js"; +import { adminDeleteUser } from "../funcs/adminDeleteUser.js"; +import { adminLogOutUser } from "../funcs/adminLogOutUser.js"; +import { adminRefreshGravatar } from "../funcs/adminRefreshGravatar.js"; +import { adminSilenceUser } from "../funcs/adminSilenceUser.js"; +import { adminSuspendUser } from "../funcs/adminSuspendUser.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as operations from "./models/operations/index.js"; +import { unwrapAsync } from "./types/fp.js"; +export class Admin extends ClientSDK { /** * Activate a user */ async activateUser( id: number, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.ActivateUserRequest({ - id: id, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL( - baseURL, - "/admin/users/{id}/activate.json", - req - ); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "put", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.ActivateUserResponse = new operations.ActivateUserResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.ActivateUserResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + options?: RequestOptions + ): Promise { + return unwrapAsync(adminActivateUser(this, id, options)); } /** @@ -87,134 +32,19 @@ export class Admin { */ async adminGetUser( id: number, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.AdminGetUserRequest({ - id: id, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL(baseURL, "/admin/users/{id}.json", req); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.AdminGetUserResponse = new operations.AdminGetUserResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.AdminGetUserResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + options?: RequestOptions + ): Promise { + return unwrapAsync(adminAdminGetUser(this, id, options)); } /** * Get a list of users */ async adminListUsers( - req: operations.AdminListUsersRequest, - config?: AxiosRequestConfig - ): Promise { - if (!(req instanceof utils.SpeakeasyBase)) { - req = new operations.AdminListUsersRequest(req); - } - - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL( - baseURL, - "/admin/users/list/{flag}.json", - req - ); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - const queryParams: string = utils.serializeQueryParams(req); - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl + queryParams, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.AdminListUsersResponse = new operations.AdminListUsersResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.responseBodies = []; - const resFieldDepth: number = utils.getResFieldDepth(res); - res.responseBodies = utils.objectToClass( - JSON.parse(decodedRes), - operations.AdminListUsersResponseBody, - resFieldDepth - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + request: operations.AdminListUsersRequest, + options?: RequestOptions + ): Promise> { + return unwrapAsync(adminAdminListUsers(this, request, options)); } /** @@ -222,66 +52,9 @@ export class Admin { */ async anonymizeUser( id: number, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.AnonymizeUserRequest({ - id: id, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL( - baseURL, - "/admin/users/{id}/anonymize.json", - req - ); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "put", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.AnonymizeUserResponse = new operations.AnonymizeUserResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.AnonymizeUserResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + options?: RequestOptions + ): Promise { + return unwrapAsync(adminAnonymizeUser(this, id, options)); } /** @@ -289,66 +62,9 @@ export class Admin { */ async deactivateUser( id: number, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.DeactivateUserRequest({ - id: id, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL( - baseURL, - "/admin/users/{id}/deactivate.json", - req - ); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "put", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.DeactivateUserResponse = new operations.DeactivateUserResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.DeactivateUserResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + options?: RequestOptions + ): Promise { + return unwrapAsync(adminDeactivateUser(this, id, options)); } /** @@ -356,75 +72,10 @@ export class Admin { */ async deleteUser( id: number, - requestBody?: operations.DeleteUserRequestBody, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.DeleteUserRequest({ - id: id, - requestBody: requestBody, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL(baseURL, "/admin/users/{id}.json", req); - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "requestBody", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "delete", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.DeleteUserResponse = new operations.DeleteUserResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.DeleteUserResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + requestBody?: operations.DeleteUserRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(adminDeleteUser(this, id, requestBody, options)); } /** @@ -432,66 +83,9 @@ export class Admin { */ async logOutUser( id: number, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.LogOutUserRequest({ - id: id, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL( - baseURL, - "/admin/users/{id}/log_out.json", - req - ); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "post", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.LogOutUserResponse = new operations.LogOutUserResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.LogOutUserResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + options?: RequestOptions + ): Promise { + return unwrapAsync(adminLogOutUser(this, id, options)); } /** @@ -499,66 +93,9 @@ export class Admin { */ async refreshGravatar( username: string, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.RefreshGravatarRequest({ - username: username, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL( - baseURL, - "/user_avatar/{username}/refresh_gravatar.json", - req - ); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "post", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.RefreshGravatarResponse = new operations.RefreshGravatarResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.RefreshGravatarResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + options?: RequestOptions + ): Promise { + return unwrapAsync(adminRefreshGravatar(this, username, options)); } /** @@ -566,79 +103,10 @@ export class Admin { */ async silenceUser( id: number, - requestBody?: operations.SilenceUserRequestBody, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.SilenceUserRequest({ - id: id, - requestBody: requestBody, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL( - baseURL, - "/admin/users/{id}/silence.json", - req - ); - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "requestBody", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "put", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.SilenceUserResponse = new operations.SilenceUserResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.SilenceUserResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + requestBody?: operations.SilenceUserRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(adminSilenceUser(this, id, requestBody, options)); } /** @@ -646,78 +114,9 @@ export class Admin { */ async suspendUser( id: number, - requestBody?: operations.SuspendUserRequestBody, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.SuspendUserRequest({ - id: id, - requestBody: requestBody, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL( - baseURL, - "/admin/users/{id}/suspend.json", - req - ); - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "requestBody", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "put", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.SuspendUserResponse = new operations.SuspendUserResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.SuspendUserResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + requestBody?: operations.SuspendUserRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(adminSuspendUser(this, id, requestBody, options)); } } diff --git a/src/sdk/backups.ts b/src/sdk/backups.ts index 3830c12..79f60a0 100644 --- a/src/sdk/backups.ts +++ b/src/sdk/backups.ts @@ -1,254 +1,44 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as utils from "../internal/utils"; -import * as errors from "../sdk/models/errors"; -import * as operations from "../sdk/models/operations"; -import { SDKConfiguration } from "./sdk"; -import { AxiosInstance, AxiosRequestConfig, AxiosResponse, RawAxiosRequestHeaders } from "axios"; - -export class Backups { - private sdkConfiguration: SDKConfiguration; - - constructor(sdkConfig: SDKConfiguration) { - this.sdkConfiguration = sdkConfig; - } +import { backupsCreateBackup } from "../funcs/backupsCreateBackup.js"; +import { backupsDownloadBackup } from "../funcs/backupsDownloadBackup.js"; +import { backupsGetBackups } from "../funcs/backupsGetBackups.js"; +import { backupsSendDownloadBackupEmail } from "../funcs/backupsSendDownloadBackupEmail.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as operations from "./models/operations/index.js"; +import { unwrapAsync } from "./types/fp.js"; +export class Backups extends ClientSDK { /** * Create backup */ async createBackup( - req: operations.CreateBackupRequestBody, - config?: AxiosRequestConfig - ): Promise { - if (!(req instanceof utils.SpeakeasyBase)) { - req = new operations.CreateBackupRequestBody(req); - } - - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = baseURL.replace(/\/$/, "") + "/admin/backups.json"; - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "request", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "post", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.CreateBackupResponse = new operations.CreateBackupResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.CreateBackupResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + request?: operations.CreateBackupRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(backupsCreateBackup(this, request, options)); } /** * Download backup */ - async downloadBackup( - filename: string, - token: string, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.DownloadBackupRequest({ - filename: filename, - token: token, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL(baseURL, "/admin/backups/{filename}", req); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - const queryParams: string = utils.serializeQueryParams(req); - headers["Accept"] = "*/*"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl + queryParams, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.DownloadBackupResponse = new operations.DownloadBackupResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - switch (true) { - case httpRes?.status == 200: - break; - } - - return res; + async downloadBackup(filename: string, token: string, options?: RequestOptions): Promise { + return unwrapAsync(backupsDownloadBackup(this, filename, token, options)); } /** * List backups */ - async getBackups(config?: AxiosRequestConfig): Promise { - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = baseURL.replace(/\/$/, "") + "/admin/backups.json"; - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.GetBackupsResponse = new operations.GetBackupsResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.responseBodies = []; - const resFieldDepth: number = utils.getResFieldDepth(res); - res.responseBodies = utils.objectToClass( - JSON.parse(decodedRes), - operations.ResponseBody, - resFieldDepth - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + async getBackups(options?: RequestOptions): Promise> { + return unwrapAsync(backupsGetBackups(this, options)); } /** * Send download backup email */ - async sendDownloadBackupEmail( - filename: string, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.SendDownloadBackupEmailRequest({ - filename: filename, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL(baseURL, "/admin/backups/{filename}", req); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "*/*"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "put", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.SendDownloadBackupEmailResponse = - new operations.SendDownloadBackupEmailResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - switch (true) { - case httpRes?.status == 200: - break; - } - - return res; + async sendDownloadBackupEmail(filename: string, options?: RequestOptions): Promise { + return unwrapAsync(backupsSendDownloadBackupEmail(this, filename, options)); } } diff --git a/src/sdk/badges.ts b/src/sdk/badges.ts index 61ef20e..27d58cc 100644 --- a/src/sdk/badges.ts +++ b/src/sdk/badges.ts @@ -1,201 +1,41 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as utils from "../internal/utils"; -import * as errors from "../sdk/models/errors"; -import * as operations from "../sdk/models/operations"; -import { SDKConfiguration } from "./sdk"; -import { AxiosInstance, AxiosRequestConfig, AxiosResponse, RawAxiosRequestHeaders } from "axios"; - -export class Badges { - private sdkConfiguration: SDKConfiguration; - - constructor(sdkConfig: SDKConfiguration) { - this.sdkConfiguration = sdkConfig; - } +import { badgesAdminListBadges } from "../funcs/badgesAdminListBadges.js"; +import { badgesCreateBadge } from "../funcs/badgesCreateBadge.js"; +import { badgesDeleteBadge } from "../funcs/badgesDeleteBadge.js"; +import { badgesListUserBadges } from "../funcs/badgesListUserBadges.js"; +import { badgesUpdateBadge } from "../funcs/badgesUpdateBadge.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as operations from "./models/operations/index.js"; +import { unwrapAsync } from "./types/fp.js"; +export class Badges extends ClientSDK { /** * List badges */ async adminListBadges( - config?: AxiosRequestConfig - ): Promise { - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = baseURL.replace(/\/$/, "") + "/admin/badges.json"; - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.AdminListBadgesResponse = new operations.AdminListBadgesResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.AdminListBadgesResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + options?: RequestOptions + ): Promise { + return unwrapAsync(badgesAdminListBadges(this, options)); } /** * Create badge */ async createBadge( - req: operations.CreateBadgeRequestBody, - config?: AxiosRequestConfig - ): Promise { - if (!(req instanceof utils.SpeakeasyBase)) { - req = new operations.CreateBadgeRequestBody(req); - } - - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = baseURL.replace(/\/$/, "") + "/admin/badges.json"; - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "request", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "post", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.CreateBadgeResponse = new operations.CreateBadgeResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.CreateBadgeResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + request?: operations.CreateBadgeRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(badgesCreateBadge(this, request, options)); } /** * Delete badge */ - async deleteBadge( - id: number, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.DeleteBadgeRequest({ - id: id, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL(baseURL, "/admin/badges/{id}.json", req); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "*/*"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "delete", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.DeleteBadgeResponse = new operations.DeleteBadgeResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - switch (true) { - case httpRes?.status == 200: - break; - } - - return res; + async deleteBadge(id: number, options?: RequestOptions): Promise { + return unwrapAsync(badgesDeleteBadge(this, id, options)); } /** @@ -203,66 +43,9 @@ export class Badges { */ async listUserBadges( username: string, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.ListUserBadgesRequest({ - username: username, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL( - baseURL, - "/user-badges/{username}.json", - req - ); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.ListUserBadgesResponse = new operations.ListUserBadgesResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.ListUserBadgesResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + options?: RequestOptions + ): Promise { + return unwrapAsync(badgesListUserBadges(this, username, options)); } /** @@ -270,74 +53,9 @@ export class Badges { */ async updateBadge( id: number, - requestBody?: operations.UpdateBadgeRequestBody, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.UpdateBadgeRequest({ - id: id, - requestBody: requestBody, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL(baseURL, "/admin/badges/{id}.json", req); - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "requestBody", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "put", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.UpdateBadgeResponse = new operations.UpdateBadgeResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.UpdateBadgeResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + requestBody?: operations.UpdateBadgeRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(badgesUpdateBadge(this, id, requestBody, options)); } } diff --git a/src/sdk/categories.ts b/src/sdk/categories.ts index 2e8d9e4..8ede30d 100644 --- a/src/sdk/categories.ts +++ b/src/sdk/categories.ts @@ -1,93 +1,26 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as utils from "../internal/utils"; -import * as errors from "../sdk/models/errors"; -import * as operations from "../sdk/models/operations"; -import { SDKConfiguration } from "./sdk"; -import { AxiosInstance, AxiosRequestConfig, AxiosResponse, RawAxiosRequestHeaders } from "axios"; - -export class Categories { - private sdkConfiguration: SDKConfiguration; - - constructor(sdkConfig: SDKConfiguration) { - this.sdkConfiguration = sdkConfig; - } +import { categoriesCreateCategory } from "../funcs/categoriesCreateCategory.js"; +import { categoriesGetCategory } from "../funcs/categoriesGetCategory.js"; +import { categoriesGetSite } from "../funcs/categoriesGetSite.js"; +import { categoriesListCategories } from "../funcs/categoriesListCategories.js"; +import { categoriesListCategoryTopics } from "../funcs/categoriesListCategoryTopics.js"; +import { categoriesUpdateCategory } from "../funcs/categoriesUpdateCategory.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as operations from "./models/operations/index.js"; +import { unwrapAsync } from "./types/fp.js"; +export class Categories extends ClientSDK { /** * Creates a category */ async createCategory( - req: operations.CreateCategoryRequestBody, - config?: AxiosRequestConfig - ): Promise { - if (!(req instanceof utils.SpeakeasyBase)) { - req = new operations.CreateCategoryRequestBody(req); - } - - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = baseURL.replace(/\/$/, "") + "/categories.json"; - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "request", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "post", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.CreateCategoryResponse = new operations.CreateCategoryResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.CreateCategoryResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + request?: operations.CreateCategoryRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(categoriesCreateCategory(this, request, options)); } /** @@ -95,62 +28,9 @@ export class Categories { */ async getCategory( id: number, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.GetCategoryRequest({ - id: id, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL(baseURL, "/c/{id}/show.json", req); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.GetCategoryResponse = new operations.GetCategoryResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.GetCategoryResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + options?: RequestOptions + ): Promise { + return unwrapAsync(categoriesGetCategory(this, id, options)); } /** @@ -159,122 +39,18 @@ export class Categories { * @remarks * Can be used to fetch all categories and subcategories */ - async getSite(config?: AxiosRequestConfig): Promise { - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = baseURL.replace(/\/$/, "") + "/site.json"; - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.GetSiteResponse = new operations.GetSiteResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.GetSiteResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + async getSite(options?: RequestOptions): Promise { + return unwrapAsync(categoriesGetSite(this, options)); } /** * Retrieves a list of categories */ async listCategories( - includeSubcategories?: boolean, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.ListCategoriesRequest({ - includeSubcategories: includeSubcategories, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = baseURL.replace(/\/$/, "") + "/categories.json"; - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - const queryParams: string = utils.serializeQueryParams(req); - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl + queryParams, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.ListCategoriesResponse = new operations.ListCategoriesResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.ListCategoriesResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + includeSubcategories?: boolean | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(categoriesListCategories(this, includeSubcategories, options)); } /** @@ -283,64 +59,9 @@ export class Categories { async listCategoryTopics( id: number, slug: string, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.ListCategoryTopicsRequest({ - id: id, - slug: slug, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL(baseURL, "/c/{slug}/{id}.json", req); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.ListCategoryTopicsResponse = - new operations.ListCategoryTopicsResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.ListCategoryTopicsResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + options?: RequestOptions + ): Promise { + return unwrapAsync(categoriesListCategoryTopics(this, id, slug, options)); } /** @@ -348,74 +69,9 @@ export class Categories { */ async updateCategory( id: number, - requestBody?: operations.UpdateCategoryRequestBody, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.UpdateCategoryRequest({ - id: id, - requestBody: requestBody, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL(baseURL, "/categories/{id}.json", req); - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "requestBody", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "put", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.UpdateCategoryResponse = new operations.UpdateCategoryResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.UpdateCategoryResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + requestBody?: operations.UpdateCategoryRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(categoriesUpdateCategory(this, id, requestBody, options)); } } diff --git a/src/sdk/groups.ts b/src/sdk/groups.ts index ce7fbbb..a404ea6 100644 --- a/src/sdk/groups.ts +++ b/src/sdk/groups.ts @@ -1,169 +1,39 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as utils from "../internal/utils"; -import * as errors from "../sdk/models/errors"; -import * as operations from "../sdk/models/operations"; -import { SDKConfiguration } from "./sdk"; -import { AxiosInstance, AxiosRequestConfig, AxiosResponse, RawAxiosRequestHeaders } from "axios"; - -export class Groups { - private sdkConfiguration: SDKConfiguration; - - constructor(sdkConfig: SDKConfiguration) { - this.sdkConfiguration = sdkConfig; - } +import { groupsAddGroupMembers } from "../funcs/groupsAddGroupMembers.js"; +import { groupsCreateGroup } from "../funcs/groupsCreateGroup.js"; +import { groupsDeleteGroup } from "../funcs/groupsDeleteGroup.js"; +import { groupsGetGroup } from "../funcs/groupsGetGroup.js"; +import { groupsListGroupMembers } from "../funcs/groupsListGroupMembers.js"; +import { groupsListGroups } from "../funcs/groupsListGroups.js"; +import { groupsRemoveGroupMembers } from "../funcs/groupsRemoveGroupMembers.js"; +import { groupsUpdateGroup } from "../funcs/groupsUpdateGroup.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as operations from "./models/operations/index.js"; +import { unwrapAsync } from "./types/fp.js"; +export class Groups extends ClientSDK { /** * Add group members */ async addGroupMembers( id: number, - requestBody?: operations.AddGroupMembersRequestBody, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.AddGroupMembersRequest({ - id: id, - requestBody: requestBody, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL(baseURL, "/groups/{id}/members.json", req); - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "requestBody", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "put", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.AddGroupMembersResponse = new operations.AddGroupMembersResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.AddGroupMembersResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + requestBody?: operations.AddGroupMembersRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(groupsAddGroupMembers(this, id, requestBody, options)); } /** * Create a group */ async createGroup( - req: operations.CreateGroupRequestBody, - config?: AxiosRequestConfig - ): Promise { - if (!(req instanceof utils.SpeakeasyBase)) { - req = new operations.CreateGroupRequestBody(req); - } - - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = baseURL.replace(/\/$/, "") + "/admin/groups.json"; - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "request", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "post", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.CreateGroupResponse = new operations.CreateGroupResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.CreateGroupResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + request?: operations.CreateGroupRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(groupsCreateGroup(this, request, options)); } /** @@ -171,122 +41,16 @@ export class Groups { */ async deleteGroup( id: number, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.DeleteGroupRequest({ - id: id, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL(baseURL, "/admin/groups/{id}.json", req); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "delete", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.DeleteGroupResponse = new operations.DeleteGroupResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.DeleteGroupResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + options?: RequestOptions + ): Promise { + return unwrapAsync(groupsDeleteGroup(this, id, options)); } /** * Get a group */ - async getGroup(id: string, config?: AxiosRequestConfig): Promise { - const req = new operations.GetGroupRequest({ - id: id, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL(baseURL, "/groups/{id}.json", req); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.GetGroupResponse = new operations.GetGroupResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.GetGroupResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + async getGroup(id: string, options?: RequestOptions): Promise { + return unwrapAsync(groupsGetGroup(this, id, options)); } /** @@ -294,119 +58,16 @@ export class Groups { */ async listGroupMembers( id: string, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.ListGroupMembersRequest({ - id: id, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL(baseURL, "/groups/{id}/members.json", req); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.ListGroupMembersResponse = new operations.ListGroupMembersResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.ListGroupMembersResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + options?: RequestOptions + ): Promise { + return unwrapAsync(groupsListGroupMembers(this, id, options)); } /** * List groups */ - async listGroups(config?: AxiosRequestConfig): Promise { - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = baseURL.replace(/\/$/, "") + "/groups.json"; - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.ListGroupsResponse = new operations.ListGroupsResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.ListGroupsResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + async listGroups(options?: RequestOptions): Promise { + return unwrapAsync(groupsListGroups(this, options)); } /** @@ -414,76 +75,10 @@ export class Groups { */ async removeGroupMembers( id: number, - requestBody?: operations.RemoveGroupMembersRequestBody, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.RemoveGroupMembersRequest({ - id: id, - requestBody: requestBody, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL(baseURL, "/groups/{id}/members.json", req); - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "requestBody", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "delete", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.RemoveGroupMembersResponse = - new operations.RemoveGroupMembersResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.RemoveGroupMembersResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + requestBody?: operations.RemoveGroupMembersRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(groupsRemoveGroupMembers(this, id, requestBody, options)); } /** @@ -491,74 +86,9 @@ export class Groups { */ async updateGroup( id: number, - requestBody?: operations.UpdateGroupRequestBody, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.UpdateGroupRequest({ - id: id, - requestBody: requestBody, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL(baseURL, "/groups/{id}.json", req); - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "requestBody", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "put", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.UpdateGroupResponse = new operations.UpdateGroupResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.UpdateGroupResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + requestBody?: operations.UpdateGroupRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(groupsUpdateGroup(this, id, requestBody, options)); } } diff --git a/src/sdk/index.ts b/src/sdk/index.ts index b9e0fdd..ecac226 100644 --- a/src/sdk/index.ts +++ b/src/sdk/index.ts @@ -1,5 +1,5 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -export * from "./sdk"; +export * from "./sdk.js"; diff --git a/src/sdk/invites.ts b/src/sdk/invites.ts index b65f1f9..ec1d3e8 100644 --- a/src/sdk/invites.ts +++ b/src/sdk/invites.ts @@ -1,100 +1,24 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as utils from "../internal/utils"; -import * as errors from "../sdk/models/errors"; -import * as operations from "../sdk/models/operations"; -import { SDKConfiguration } from "./sdk"; -import { AxiosInstance, AxiosRequestConfig, AxiosResponse, RawAxiosRequestHeaders } from "axios"; - -export class Invites { - private sdkConfiguration: SDKConfiguration; - - constructor(sdkConfig: SDKConfiguration) { - this.sdkConfiguration = sdkConfig; - } +import { invitesCreateInvite } from "../funcs/invitesCreateInvite.js"; +import { invitesInviteToTopic } from "../funcs/invitesInviteToTopic.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as operations from "./models/operations/index.js"; +import { unwrapAsync } from "./types/fp.js"; +export class Invites extends ClientSDK { /** * Create an invite */ async createInvite( apiKey: string, apiUsername: string, - requestBody?: operations.CreateInviteRequestBody, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.CreateInviteRequest({ - apiKey: apiKey, - apiUsername: apiUsername, - requestBody: requestBody, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = baseURL.replace(/\/$/, "") + "/invites.json"; - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "requestBody", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { - ...utils.getHeadersFromRequest(req), - ...reqBodyHeaders, - ...config?.headers, - }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "post", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.CreateInviteResponse = new operations.CreateInviteResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.CreateInviteResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + requestBody?: operations.CreateInviteRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(invitesCreateInvite(this, apiKey, apiUsername, requestBody, options)); } /** @@ -104,80 +28,11 @@ export class Invites { apiKey: string, apiUsername: string, id: string, - requestBody?: operations.InviteToTopicRequestBody, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.InviteToTopicRequest({ - apiKey: apiKey, - apiUsername: apiUsername, - id: id, - requestBody: requestBody, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults + requestBody?: operations.InviteToTopicRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync( + invitesInviteToTopic(this, apiKey, apiUsername, id, requestBody, options) ); - const operationUrl: string = utils.generateURL(baseURL, "/t/{id}/invite.json", req); - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "requestBody", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { - ...utils.getHeadersFromRequest(req), - ...reqBodyHeaders, - ...config?.headers, - }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "post", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.InviteToTopicResponse = new operations.InviteToTopicResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.InviteToTopicResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; } } diff --git a/src/sdk/models/errors/httpclienterrors.ts b/src/sdk/models/errors/httpclienterrors.ts new file mode 100644 index 0000000..cdb2995 --- /dev/null +++ b/src/sdk/models/errors/httpclienterrors.ts @@ -0,0 +1,62 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +/** + * Base class for all HTTP errors. + */ +export class HTTPClientError extends Error { + /** The underlying cause of the error. */ + override readonly cause: unknown; + override name = "HTTPClientError"; + constructor(message: string, opts?: { cause?: unknown }) { + let msg = message; + if (opts?.cause) { + msg += `: ${opts.cause}`; + } + + super(msg, opts); + // In older runtimes, the cause field would not have been assigned through + // the super() call. + if (typeof this.cause === "undefined") { + this.cause = opts?.cause; + } + } +} + +/** + * An error to capture unrecognised or unexpected errors when making HTTP calls. + */ +export class UnexpectedClientError extends HTTPClientError { + override name = "UnexpectedClientError"; +} + +/** + * An error that is raised when any inputs used to create a request are invalid. + */ +export class InvalidRequestError extends HTTPClientError { + override name = "InvalidRequestError"; +} + +/** + * An error that is raised when a HTTP request was aborted by the client error. + */ +export class RequestAbortedError extends HTTPClientError { + override readonly name = "RequestAbortedError"; +} + +/** + * An error that is raised when a HTTP request timed out due to an AbortSignal + * signal timeout. + */ +export class RequestTimeoutError extends HTTPClientError { + override readonly name = "RequestTimeoutError"; +} + +/** + * An error that is raised when a HTTP client is unable to make a request to + * a server. + */ +export class ConnectionError extends HTTPClientError { + override readonly name = "ConnectionError"; +} diff --git a/src/sdk/models/errors/index.ts b/src/sdk/models/errors/index.ts index 4cfb3cc..ead269b 100644 --- a/src/sdk/models/errors/index.ts +++ b/src/sdk/models/errors/index.ts @@ -1,5 +1,6 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -export * from "./sdkerror"; +export * from "./sdkerror.js"; +export * from "./sdkvalidationerror.js"; diff --git a/src/sdk/models/errors/sdkerror.ts b/src/sdk/models/errors/sdkerror.ts index 7da38ec..80e3aa4 100644 --- a/src/sdk/models/errors/sdkerror.ts +++ b/src/sdk/models/errors/sdkerror.ts @@ -1,31 +1,25 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { AxiosResponse } from "axios"; - export class SDKError extends Error { - statusCode: number; - body: string; - rawResponse: AxiosResponse; + public readonly statusCode: number; + public readonly contentType: string; - constructor( - message: string, - statusCode: number, - body: string, - rawResponse: AxiosResponse, - ) { - let bodyString = ""; - if (body?.length > 0) { - bodyString = `\n${body}`; + constructor( + message: string, + public readonly rawResponse: Response, + public readonly body: string = "" + ) { + const statusCode = rawResponse.status; + const contentType = rawResponse.headers.get("content-type") || ""; + const bodyString = body.length > 0 ? `\n${body}` : ""; + + super(`${message}: Status ${statusCode} Content-Type ${contentType} Body ${bodyString}`); + + this.statusCode = statusCode; + this.contentType = contentType; + + this.name = "SDKError"; } - - super(`${message}: Status ${statusCode}${bodyString}`); - this.statusCode = statusCode; - this.body = body; - this.rawResponse = rawResponse; - - this.name = "SDKError"; - Object.setPrototypeOf(this, SDKError.prototype); - } } diff --git a/src/sdk/models/errors/sdkvalidationerror.ts b/src/sdk/models/errors/sdkvalidationerror.ts new file mode 100644 index 0000000..3030cd7 --- /dev/null +++ b/src/sdk/models/errors/sdkvalidationerror.ts @@ -0,0 +1,95 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export class SDKValidationError extends Error { + /** + * The raw value that failed validation. + */ + public readonly rawValue: unknown; + + constructor(message: string, cause: unknown, rawValue: unknown) { + super(message); + this.name = "SDKValidationError"; + this.cause = cause; + this.rawValue = rawValue; + } + + public override toString(): string { + return `${this.message}: ${this.cause}`; + } + + /** + * Return a pretty-formatted error message if the underlying validation error + * is a ZodError or some other recognized error type, otherwise return the + * default error message. + */ + public pretty(): string { + if (this.cause instanceof z.ZodError) { + return `${this.message}\n${formatZodError(this.cause)}`; + } else { + return this.toString(); + } + } +} + +export function formatZodError(err: z.ZodError, level = 0): string { + let pre = " ".repeat(level); + pre = level > 0 ? `│${pre}` : pre; + pre += " ".repeat(level); + + let message = ""; + const append = (str: string) => (message += `\n${pre}${str}`); + + const len = err.issues.length; + const headline = len === 1 ? `${len} issue found` : `${len} issues found`; + + if (len) { + append(`┌ ${headline}:`); + } + + for (const issue of err.issues) { + let path = issue.path.join("."); + path = path ? `.${path}` : ""; + append(`│ • [${path}]: ${issue.message} (${issue.code})`); + switch (issue.code) { + case "invalid_literal": + case "invalid_type": { + append(`│ Want: ${issue.expected}`); + append(`│ Got: ${issue.received}`); + break; + } + case "unrecognized_keys": { + append(`│ Keys: ${issue.keys.join(", ")}`); + break; + } + case "invalid_enum_value": { + append(`│ Allowed: ${issue.options.join(", ")}`); + append(`│ Got: ${issue.received}`); + break; + } + case "invalid_union_discriminator": { + append(`│ Allowed: ${issue.options.join(", ")}`); + break; + } + case "invalid_union": { + const len = issue.unionErrors.length; + append( + `│ ✖︎ Attemped to deserialize into one of ${len} union members:`, + ); + issue.unionErrors.forEach((err, i) => { + append(`│ ✖︎ Member ${i + 1} of ${len}`); + append(`${formatZodError(err, level + 1)}`); + }); + } + } + } + + if (err.issues.length) { + append(`└─*`); + } + + return message.slice(1); +} diff --git a/src/sdk/models/operations/abortmultipart.ts b/src/sdk/models/operations/abortmultipart.ts index d5e59a2..1e1dede 100644 --- a/src/sdk/models/operations/abortmultipart.ts +++ b/src/sdk/models/operations/abortmultipart.ts @@ -1,51 +1,104 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class AbortMultipartRequestBody extends SpeakeasyBase { +export type AbortMultipartRequestBody = { /** * The identifier of the multipart upload in the external storage provider. This is the multipart upload_id in AWS S3. */ - @SpeakeasyMetadata() - @Expose({ name: "external_upload_identifier" }) externalUploadIdentifier: string; -} +}; /** * external upload initialized */ -export class AbortMultipartResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "success" }) +export type AbortMultipartResponseBody = { success: string; +}; + +/** @internal */ +export const AbortMultipartRequestBody$inboundSchema: z.ZodType< + AbortMultipartRequestBody, + z.ZodTypeDef, + unknown +> = z + .object({ + external_upload_identifier: z.string(), + }) + .transform((v) => { + return remap$(v, { + external_upload_identifier: "externalUploadIdentifier", + }); + }); + +/** @internal */ +export type AbortMultipartRequestBody$Outbound = { + external_upload_identifier: string; +}; + +/** @internal */ +export const AbortMultipartRequestBody$outboundSchema: z.ZodType< + AbortMultipartRequestBody$Outbound, + z.ZodTypeDef, + AbortMultipartRequestBody +> = z + .object({ + externalUploadIdentifier: z.string(), + }) + .transform((v) => { + return remap$(v, { + externalUploadIdentifier: "external_upload_identifier", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AbortMultipartRequestBody$ { + /** @deprecated use `AbortMultipartRequestBody$inboundSchema` instead. */ + export const inboundSchema = AbortMultipartRequestBody$inboundSchema; + /** @deprecated use `AbortMultipartRequestBody$outboundSchema` instead. */ + export const outboundSchema = AbortMultipartRequestBody$outboundSchema; + /** @deprecated use `AbortMultipartRequestBody$Outbound` instead. */ + export type Outbound = AbortMultipartRequestBody$Outbound; } -export class AbortMultipartResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const AbortMultipartResponseBody$inboundSchema: z.ZodType< + AbortMultipartResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + success: z.string(), +}); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type AbortMultipartResponseBody$Outbound = { + success: string; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const AbortMultipartResponseBody$outboundSchema: z.ZodType< + AbortMultipartResponseBody$Outbound, + z.ZodTypeDef, + AbortMultipartResponseBody +> = z.object({ + success: z.string(), +}); - /** - * external upload initialized - */ - @SpeakeasyMetadata() - object?: AbortMultipartResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AbortMultipartResponseBody$ { + /** @deprecated use `AbortMultipartResponseBody$inboundSchema` instead. */ + export const inboundSchema = AbortMultipartResponseBody$inboundSchema; + /** @deprecated use `AbortMultipartResponseBody$outboundSchema` instead. */ + export const outboundSchema = AbortMultipartResponseBody$outboundSchema; + /** @deprecated use `AbortMultipartResponseBody$Outbound` instead. */ + export type Outbound = AbortMultipartResponseBody$Outbound; } diff --git a/src/sdk/models/operations/activateuser.ts b/src/sdk/models/operations/activateuser.ts index 81ee814..e98acf8 100644 --- a/src/sdk/models/operations/activateuser.ts +++ b/src/sdk/models/operations/activateuser.ts @@ -1,47 +1,88 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose } from "class-transformer"; +import * as z from "zod"; -export class ActivateUserRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) +export type ActivateUserRequest = { id: number; -} +}; /** * response */ -export class ActivateUserResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "success" }) +export type ActivateUserResponseBody = { success: string; +}; + +/** @internal */ +export const ActivateUserRequest$inboundSchema: z.ZodType< + ActivateUserRequest, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.number().int(), +}); + +/** @internal */ +export type ActivateUserRequest$Outbound = { + id: number; +}; + +/** @internal */ +export const ActivateUserRequest$outboundSchema: z.ZodType< + ActivateUserRequest$Outbound, + z.ZodTypeDef, + ActivateUserRequest +> = z.object({ + id: z.number().int(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ActivateUserRequest$ { + /** @deprecated use `ActivateUserRequest$inboundSchema` instead. */ + export const inboundSchema = ActivateUserRequest$inboundSchema; + /** @deprecated use `ActivateUserRequest$outboundSchema` instead. */ + export const outboundSchema = ActivateUserRequest$outboundSchema; + /** @deprecated use `ActivateUserRequest$Outbound` instead. */ + export type Outbound = ActivateUserRequest$Outbound; } -export class ActivateUserResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const ActivateUserResponseBody$inboundSchema: z.ZodType< + ActivateUserResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + success: z.string(), +}); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type ActivateUserResponseBody$Outbound = { + success: string; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const ActivateUserResponseBody$outboundSchema: z.ZodType< + ActivateUserResponseBody$Outbound, + z.ZodTypeDef, + ActivateUserResponseBody +> = z.object({ + success: z.string(), +}); - /** - * response - */ - @SpeakeasyMetadata() - object?: ActivateUserResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ActivateUserResponseBody$ { + /** @deprecated use `ActivateUserResponseBody$inboundSchema` instead. */ + export const inboundSchema = ActivateUserResponseBody$inboundSchema; + /** @deprecated use `ActivateUserResponseBody$outboundSchema` instead. */ + export const outboundSchema = ActivateUserResponseBody$outboundSchema; + /** @deprecated use `ActivateUserResponseBody$Outbound` instead. */ + export type Outbound = ActivateUserResponseBody$Outbound; } diff --git a/src/sdk/models/operations/addgroupmembers.ts b/src/sdk/models/operations/addgroupmembers.ts index 4188f91..fffffe2 100644 --- a/src/sdk/models/operations/addgroupmembers.ts +++ b/src/sdk/models/operations/addgroupmembers.ts @@ -1,67 +1,156 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class AddGroupMembersRequestBody extends SpeakeasyBase { +export type AddGroupMembersRequestBody = { /** * comma separated list */ - @SpeakeasyMetadata() - @Expose({ name: "usernames" }) - usernames?: string; -} + usernames?: string | undefined; +}; -export class AddGroupMembersRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) +export type AddGroupMembersRequest = { + requestBody?: AddGroupMembersRequestBody | undefined; id: number; - - @SpeakeasyMetadata({ data: "request, media_type=application/json" }) - requestBody?: AddGroupMembersRequestBody; -} +}; /** * success response */ -export class AddGroupMembersResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "emails" }) - emails: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "success" }) +export type AddGroupMembersResponseBody = { + emails: Array; success: string; + usernames: Array; +}; - @SpeakeasyMetadata() - @Expose({ name: "usernames" }) - usernames: any[]; +/** @internal */ +export const AddGroupMembersRequestBody$inboundSchema: z.ZodType< + AddGroupMembersRequestBody, + z.ZodTypeDef, + unknown +> = z.object({ + usernames: z.string().optional(), +}); + +/** @internal */ +export type AddGroupMembersRequestBody$Outbound = { + usernames?: string | undefined; +}; + +/** @internal */ +export const AddGroupMembersRequestBody$outboundSchema: z.ZodType< + AddGroupMembersRequestBody$Outbound, + z.ZodTypeDef, + AddGroupMembersRequestBody +> = z.object({ + usernames: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AddGroupMembersRequestBody$ { + /** @deprecated use `AddGroupMembersRequestBody$inboundSchema` instead. */ + export const inboundSchema = AddGroupMembersRequestBody$inboundSchema; + /** @deprecated use `AddGroupMembersRequestBody$outboundSchema` instead. */ + export const outboundSchema = AddGroupMembersRequestBody$outboundSchema; + /** @deprecated use `AddGroupMembersRequestBody$Outbound` instead. */ + export type Outbound = AddGroupMembersRequestBody$Outbound; } -export class AddGroupMembersResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const AddGroupMembersRequest$inboundSchema: z.ZodType< + AddGroupMembersRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + RequestBody: z.lazy(() => AddGroupMembersRequestBody$inboundSchema).optional(), + id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + RequestBody: "requestBody", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type AddGroupMembersRequest$Outbound = { + RequestBody?: AddGroupMembersRequestBody$Outbound | undefined; + id: number; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const AddGroupMembersRequest$outboundSchema: z.ZodType< + AddGroupMembersRequest$Outbound, + z.ZodTypeDef, + AddGroupMembersRequest +> = z + .object({ + requestBody: z.lazy(() => AddGroupMembersRequestBody$outboundSchema).optional(), + id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + requestBody: "RequestBody", + }); + }); - /** - * success response - */ - @SpeakeasyMetadata() - object?: AddGroupMembersResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AddGroupMembersRequest$ { + /** @deprecated use `AddGroupMembersRequest$inboundSchema` instead. */ + export const inboundSchema = AddGroupMembersRequest$inboundSchema; + /** @deprecated use `AddGroupMembersRequest$outboundSchema` instead. */ + export const outboundSchema = AddGroupMembersRequest$outboundSchema; + /** @deprecated use `AddGroupMembersRequest$Outbound` instead. */ + export type Outbound = AddGroupMembersRequest$Outbound; +} + +/** @internal */ +export const AddGroupMembersResponseBody$inboundSchema: z.ZodType< + AddGroupMembersResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + emails: z.array(z.any()), + success: z.string(), + usernames: z.array(z.any()), +}); + +/** @internal */ +export type AddGroupMembersResponseBody$Outbound = { + emails: Array; + success: string; + usernames: Array; +}; + +/** @internal */ +export const AddGroupMembersResponseBody$outboundSchema: z.ZodType< + AddGroupMembersResponseBody$Outbound, + z.ZodTypeDef, + AddGroupMembersResponseBody +> = z.object({ + emails: z.array(z.any()), + success: z.string(), + usernames: z.array(z.any()), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AddGroupMembersResponseBody$ { + /** @deprecated use `AddGroupMembersResponseBody$inboundSchema` instead. */ + export const inboundSchema = AddGroupMembersResponseBody$inboundSchema; + /** @deprecated use `AddGroupMembersResponseBody$outboundSchema` instead. */ + export const outboundSchema = AddGroupMembersResponseBody$outboundSchema; + /** @deprecated use `AddGroupMembersResponseBody$Outbound` instead. */ + export type Outbound = AddGroupMembersResponseBody$Outbound; } diff --git a/src/sdk/models/operations/admingetuser.ts b/src/sdk/models/operations/admingetuser.ts index b620c73..49b50b4 100644 --- a/src/sdk/models/operations/admingetuser.ts +++ b/src/sdk/models/operations/admingetuser.ts @@ -1,593 +1,1078 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class AdminGetUserRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) +export type AdminGetUserRequest = { id: number; -} +}; -export class ApprovedBy extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "avatar_template" }) +export type ApprovedBy = { avatarTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) username: string; -} +}; -export class AdminGetUserExternalIds extends SpeakeasyBase {} +export type AdminGetUserExternalIds = {}; -export class AdminGetUserGroups extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "allow_membership_requests" }) +export type AdminGetUserGroups = { allowMembershipRequests: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "automatic" }) automatic: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "bio_cooked" }) - bioCooked: string; - - @SpeakeasyMetadata() - @Expose({ name: "bio_excerpt" }) - bioExcerpt: string; - - @SpeakeasyMetadata() - @Expose({ name: "bio_raw" }) - bioRaw: string; - - @SpeakeasyMetadata() - @Expose({ name: "can_admin_group" }) + bioCooked: string | null; + bioExcerpt: string | null; + bioRaw: string | null; canAdminGroup: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_see_members" }) canSeeMembers: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "default_notification_level" }) defaultNotificationLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "display_name" }) displayName: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_bg_color" }) - flairBgColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_color" }) - flairColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_group_id" }) - flairGroupId?: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_url" }) - flairUrl: string; - - @SpeakeasyMetadata() - @Expose({ name: "full_name" }) - fullName: string; - - @SpeakeasyMetadata() - @Expose({ name: "grant_trust_level" }) - grantTrustLevel: string; - - @SpeakeasyMetadata() - @Expose({ name: "has_messages" }) + flairBgColor: string | null; + flairColor: string | null; + flairGroupId?: string | null | undefined; + flairUrl: string | null; + fullName: string | null; + grantTrustLevel: string | null; hasMessages: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "incoming_email" }) - incomingEmail: string; - - @SpeakeasyMetadata() - @Expose({ name: "members_visibility_level" }) + incomingEmail: string | null; membersVisibilityLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "membership_request_template" }) - membershipRequestTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "mentionable_level" }) + membershipRequestTemplate: string | null; mentionableLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "messageable_level" }) messageableLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "primary_group" }) primaryGroup: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "public_admission" }) publicAdmission: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "public_exit" }) publicExit: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "publish_read_state" }) publishReadState: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "title" }) - title: string; - - @SpeakeasyMetadata() - @Expose({ name: "user_count" }) + title: string | null; userCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "visibility_level" }) visibilityLevel: number; -} +}; -export class PenaltyCounts extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "silenced" }) +export type PenaltyCounts = { silenced: number; - - @SpeakeasyMetadata() - @Expose({ name: "suspended" }) suspended: number; -} +}; -export class AdminGetUserPenaltyCounts extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "silenced" }) +export type AdminGetUserPenaltyCounts = { silenced: number; - - @SpeakeasyMetadata() - @Expose({ name: "suspended" }) suspended: number; - - @SpeakeasyMetadata() - @Expose({ name: "total" }) total: number; -} +}; -export class Tl3Requirements extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "days_visited" }) +export type Tl3Requirements = { daysVisited: number; - - @SpeakeasyMetadata() - @Expose({ name: "max_flagged_by_users" }) maxFlaggedByUsers: number; - - @SpeakeasyMetadata() - @Expose({ name: "max_flagged_posts" }) maxFlaggedPosts: number; - - @SpeakeasyMetadata() - @Expose({ name: "min_days_visited" }) minDaysVisited: number; - - @SpeakeasyMetadata() - @Expose({ name: "min_likes_given" }) minLikesGiven: number; - - @SpeakeasyMetadata() - @Expose({ name: "min_likes_received" }) minLikesReceived: number; - - @SpeakeasyMetadata() - @Expose({ name: "min_likes_received_days" }) minLikesReceivedDays: number; - - @SpeakeasyMetadata() - @Expose({ name: "min_likes_received_users" }) minLikesReceivedUsers: number; - - @SpeakeasyMetadata() - @Expose({ name: "min_posts_read" }) minPostsRead: number; - - @SpeakeasyMetadata() - @Expose({ name: "min_posts_read_all_time" }) minPostsReadAllTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "min_topics_replied_to" }) minTopicsRepliedTo: number; - - @SpeakeasyMetadata() - @Expose({ name: "min_topics_viewed" }) minTopicsViewed: number; - - @SpeakeasyMetadata() - @Expose({ name: "min_topics_viewed_all_time" }) minTopicsViewedAllTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "num_flagged_by_users" }) numFlaggedByUsers: number; - - @SpeakeasyMetadata() - @Expose({ name: "num_flagged_posts" }) numFlaggedPosts: number; - - @SpeakeasyMetadata() - @Expose({ name: "num_likes_given" }) numLikesGiven: number; - - @SpeakeasyMetadata() - @Expose({ name: "num_likes_received" }) numLikesReceived: number; - - @SpeakeasyMetadata() - @Expose({ name: "num_likes_received_days" }) numLikesReceivedDays: number; - - @SpeakeasyMetadata() - @Expose({ name: "num_likes_received_users" }) numLikesReceivedUsers: number; - - @SpeakeasyMetadata() - @Expose({ name: "num_topics_replied_to" }) numTopicsRepliedTo: number; - - @SpeakeasyMetadata() - @Expose({ name: "on_grace_period" }) onGracePeriod: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "penalty_counts" }) - @Type(() => AdminGetUserPenaltyCounts) penaltyCounts: AdminGetUserPenaltyCounts; - - @SpeakeasyMetadata() - @Expose({ name: "posts_read" }) postsRead: number; - - @SpeakeasyMetadata() - @Expose({ name: "posts_read_all_time" }) postsReadAllTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "requirements_lost" }) requirementsLost: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "requirements_met" }) requirementsMet: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "time_period" }) timePeriod: number; - - @SpeakeasyMetadata() - @Expose({ name: "topics_viewed" }) topicsViewed: number; - - @SpeakeasyMetadata() - @Expose({ name: "topics_viewed_all_time" }) topicsViewedAllTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "trust_level_locked" }) trustLevelLocked: boolean; -} +}; /** * response */ -export class AdminGetUserResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "active" }) +export type AdminGetUserResponseBody = { active: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "admin" }) admin: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "api_key_count" }) apiKeyCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "approved_by" }) - @Type(() => ApprovedBy) - approvedBy: ApprovedBy; - - @SpeakeasyMetadata() - @Expose({ name: "associated_accounts" }) - associatedAccounts?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "avatar_template" }) + approvedBy: ApprovedBy | null; + associatedAccounts?: Array | undefined; avatarTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "badge_count" }) badgeCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "bounce_score" }) - bounceScore: number; - - @SpeakeasyMetadata() - @Expose({ name: "can_activate" }) + bounceScore: number | null; canActivate: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_be_anonymized" }) canBeAnonymized: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_be_deleted" }) canBeDeleted: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_be_merged" }) canBeMerged: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_deactivate" }) canDeactivate: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_delete_all_posts" }) canDeleteAllPosts: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_delete_sso_record" }) canDeleteSsoRecord: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_disable_second_factor" }) canDisableSecondFactor: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_grant_admin" }) canGrantAdmin: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_grant_moderation" }) canGrantModeration: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_impersonate" }) canImpersonate: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_revoke_admin" }) canRevokeAdmin: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_revoke_moderation" }) canRevokeModeration: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_send_activation_email" }) canSendActivationEmail: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_view_action_logs" }) canViewActionLogs: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "created_at" }) createdAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "created_at_age" }) - createdAtAge: number; - - @SpeakeasyMetadata() - @Expose({ name: "days_visited" }) + createdAtAge: number | null; daysVisited: number; - - @SpeakeasyMetadata() - @Expose({ name: "external_ids" }) - @Type(() => AdminGetUserExternalIds) externalIds: AdminGetUserExternalIds; - - @SpeakeasyMetadata() - @Expose({ name: "flags_given_count" }) flagsGivenCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "flags_received_count" }) flagsReceivedCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "full_suspend_reason" }) - fullSuspendReason: string; - - @SpeakeasyMetadata({ elemType: AdminGetUserGroups }) - @Expose({ name: "groups" }) - @Type(() => AdminGetUserGroups) - groups: AdminGetUserGroups[]; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) + fullSuspendReason: string | null; + groups: Array; id: number; - - @SpeakeasyMetadata() - @Expose({ name: "ip_address" }) ipAddress: string; - - @SpeakeasyMetadata() - @Expose({ name: "last_emailed_age" }) - lastEmailedAge: number; - - @SpeakeasyMetadata() - @Expose({ name: "last_emailed_at" }) - lastEmailedAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "last_seen_age" }) - lastSeenAge: number; - - @SpeakeasyMetadata() - @Expose({ name: "last_seen_at" }) - lastSeenAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "like_count" }) + lastEmailedAge: number | null; + lastEmailedAt: string | null; + lastSeenAge: number | null; + lastSeenAt: string | null; likeCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "like_given_count" }) likeGivenCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "manual_locked_trust_level" }) - manualLockedTrustLevel: string; - - @SpeakeasyMetadata() - @Expose({ name: "moderator" }) + manualLockedTrustLevel: string | null; moderator: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) - name: string; - - @SpeakeasyMetadata() - @Expose({ name: "next_penalty" }) - nextPenalty?: string; - - @SpeakeasyMetadata() - @Expose({ name: "penalty_counts" }) - @Type(() => PenaltyCounts) - penaltyCounts?: PenaltyCounts; - - @SpeakeasyMetadata() - @Expose({ name: "post_count" }) + name: string | null; + nextPenalty?: string | undefined; + penaltyCounts?: PenaltyCounts | undefined; postCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "post_edits_count" }) - postEditsCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "posts_read_count" }) + postEditsCount?: number | null | undefined; postsReadCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "primary_group_id" }) - primaryGroupId: string; - - @SpeakeasyMetadata() - @Expose({ name: "private_topics_count" }) + primaryGroupId: string | null; privateTopicsCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "registration_ip_address" }) - registrationIpAddress: string; - - @SpeakeasyMetadata() - @Expose({ name: "reset_bounce_score_after" }) - resetBounceScoreAfter: string; - - @SpeakeasyMetadata() - @Expose({ name: "silence_reason" }) - silenceReason: string; - - @SpeakeasyMetadata() - @Expose({ name: "silenced_by" }) - silencedBy: string; - - @SpeakeasyMetadata() - @Expose({ name: "single_sign_on_record" }) - singleSignOnRecord: string; - - @SpeakeasyMetadata() - @Expose({ name: "staged" }) + registrationIpAddress: string | null; + resetBounceScoreAfter: string | null; + silenceReason: string | null; + silencedBy: string | null; + singleSignOnRecord: string | null; staged: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "suspended_by" }) - suspendedBy: string; - - @SpeakeasyMetadata() - @Expose({ name: "time_read" }) + suspendedBy: string | null; timeRead: number; - - @SpeakeasyMetadata() - @Expose({ name: "title" }) - title: string; - - @SpeakeasyMetadata() - @Expose({ name: "tl3_requirements" }) - @Type(() => Tl3Requirements) - tl3Requirements?: Tl3Requirements; - - @SpeakeasyMetadata() - @Expose({ name: "topic_count" }) + title: string | null; + tl3Requirements?: Tl3Requirements | undefined; topicCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "topics_entered" }) topicsEntered: number; - - @SpeakeasyMetadata() - @Expose({ name: "trust_level" }) trustLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) username: string; - - @SpeakeasyMetadata() - @Expose({ name: "warnings_received_count" }) warningsReceivedCount: number; +}; + +/** @internal */ +export const AdminGetUserRequest$inboundSchema: z.ZodType< + AdminGetUserRequest, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.number().int(), +}); + +/** @internal */ +export type AdminGetUserRequest$Outbound = { + id: number; +}; + +/** @internal */ +export const AdminGetUserRequest$outboundSchema: z.ZodType< + AdminGetUserRequest$Outbound, + z.ZodTypeDef, + AdminGetUserRequest +> = z.object({ + id: z.number().int(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AdminGetUserRequest$ { + /** @deprecated use `AdminGetUserRequest$inboundSchema` instead. */ + export const inboundSchema = AdminGetUserRequest$inboundSchema; + /** @deprecated use `AdminGetUserRequest$outboundSchema` instead. */ + export const outboundSchema = AdminGetUserRequest$outboundSchema; + /** @deprecated use `AdminGetUserRequest$Outbound` instead. */ + export type Outbound = AdminGetUserRequest$Outbound; } -export class AdminGetUserResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const ApprovedBy$inboundSchema: z.ZodType = z + .object({ + avatar_template: z.string(), + id: z.number().int(), + name: z.string(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + avatar_template: "avatarTemplate", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type ApprovedBy$Outbound = { + avatar_template: string; + id: number; + name: string; + username: string; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const ApprovedBy$outboundSchema: z.ZodType = z + .object({ + avatarTemplate: z.string(), + id: z.number().int(), + name: z.string(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + avatarTemplate: "avatar_template", + }); + }); - /** - * response - */ - @SpeakeasyMetadata() - object?: AdminGetUserResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ApprovedBy$ { + /** @deprecated use `ApprovedBy$inboundSchema` instead. */ + export const inboundSchema = ApprovedBy$inboundSchema; + /** @deprecated use `ApprovedBy$outboundSchema` instead. */ + export const outboundSchema = ApprovedBy$outboundSchema; + /** @deprecated use `ApprovedBy$Outbound` instead. */ + export type Outbound = ApprovedBy$Outbound; +} + +/** @internal */ +export const AdminGetUserExternalIds$inboundSchema: z.ZodType< + AdminGetUserExternalIds, + z.ZodTypeDef, + unknown +> = z.object({}); + +/** @internal */ +export type AdminGetUserExternalIds$Outbound = {}; + +/** @internal */ +export const AdminGetUserExternalIds$outboundSchema: z.ZodType< + AdminGetUserExternalIds$Outbound, + z.ZodTypeDef, + AdminGetUserExternalIds +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AdminGetUserExternalIds$ { + /** @deprecated use `AdminGetUserExternalIds$inboundSchema` instead. */ + export const inboundSchema = AdminGetUserExternalIds$inboundSchema; + /** @deprecated use `AdminGetUserExternalIds$outboundSchema` instead. */ + export const outboundSchema = AdminGetUserExternalIds$outboundSchema; + /** @deprecated use `AdminGetUserExternalIds$Outbound` instead. */ + export type Outbound = AdminGetUserExternalIds$Outbound; +} + +/** @internal */ +export const AdminGetUserGroups$inboundSchema: z.ZodType< + AdminGetUserGroups, + z.ZodTypeDef, + unknown +> = z + .object({ + allow_membership_requests: z.boolean(), + automatic: z.boolean(), + bio_cooked: z.nullable(z.string()), + bio_excerpt: z.nullable(z.string()), + bio_raw: z.nullable(z.string()), + can_admin_group: z.boolean(), + can_see_members: z.boolean(), + default_notification_level: z.number().int(), + display_name: z.string(), + flair_bg_color: z.nullable(z.string()), + flair_color: z.nullable(z.string()), + flair_group_id: z.nullable(z.string()).optional(), + flair_url: z.nullable(z.string()), + full_name: z.nullable(z.string()), + grant_trust_level: z.nullable(z.string()), + has_messages: z.boolean(), + id: z.number().int(), + incoming_email: z.nullable(z.string()), + members_visibility_level: z.number().int(), + membership_request_template: z.nullable(z.string()), + mentionable_level: z.number().int(), + messageable_level: z.number().int(), + name: z.string(), + primary_group: z.boolean(), + public_admission: z.boolean(), + public_exit: z.boolean(), + publish_read_state: z.boolean(), + title: z.nullable(z.string()), + user_count: z.number().int(), + visibility_level: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + allow_membership_requests: "allowMembershipRequests", + bio_cooked: "bioCooked", + bio_excerpt: "bioExcerpt", + bio_raw: "bioRaw", + can_admin_group: "canAdminGroup", + can_see_members: "canSeeMembers", + default_notification_level: "defaultNotificationLevel", + display_name: "displayName", + flair_bg_color: "flairBgColor", + flair_color: "flairColor", + flair_group_id: "flairGroupId", + flair_url: "flairUrl", + full_name: "fullName", + grant_trust_level: "grantTrustLevel", + has_messages: "hasMessages", + incoming_email: "incomingEmail", + members_visibility_level: "membersVisibilityLevel", + membership_request_template: "membershipRequestTemplate", + mentionable_level: "mentionableLevel", + messageable_level: "messageableLevel", + primary_group: "primaryGroup", + public_admission: "publicAdmission", + public_exit: "publicExit", + publish_read_state: "publishReadState", + user_count: "userCount", + visibility_level: "visibilityLevel", + }); + }); + +/** @internal */ +export type AdminGetUserGroups$Outbound = { + allow_membership_requests: boolean; + automatic: boolean; + bio_cooked: string | null; + bio_excerpt: string | null; + bio_raw: string | null; + can_admin_group: boolean; + can_see_members: boolean; + default_notification_level: number; + display_name: string; + flair_bg_color: string | null; + flair_color: string | null; + flair_group_id?: string | null | undefined; + flair_url: string | null; + full_name: string | null; + grant_trust_level: string | null; + has_messages: boolean; + id: number; + incoming_email: string | null; + members_visibility_level: number; + membership_request_template: string | null; + mentionable_level: number; + messageable_level: number; + name: string; + primary_group: boolean; + public_admission: boolean; + public_exit: boolean; + publish_read_state: boolean; + title: string | null; + user_count: number; + visibility_level: number; +}; + +/** @internal */ +export const AdminGetUserGroups$outboundSchema: z.ZodType< + AdminGetUserGroups$Outbound, + z.ZodTypeDef, + AdminGetUserGroups +> = z + .object({ + allowMembershipRequests: z.boolean(), + automatic: z.boolean(), + bioCooked: z.nullable(z.string()), + bioExcerpt: z.nullable(z.string()), + bioRaw: z.nullable(z.string()), + canAdminGroup: z.boolean(), + canSeeMembers: z.boolean(), + defaultNotificationLevel: z.number().int(), + displayName: z.string(), + flairBgColor: z.nullable(z.string()), + flairColor: z.nullable(z.string()), + flairGroupId: z.nullable(z.string()).optional(), + flairUrl: z.nullable(z.string()), + fullName: z.nullable(z.string()), + grantTrustLevel: z.nullable(z.string()), + hasMessages: z.boolean(), + id: z.number().int(), + incomingEmail: z.nullable(z.string()), + membersVisibilityLevel: z.number().int(), + membershipRequestTemplate: z.nullable(z.string()), + mentionableLevel: z.number().int(), + messageableLevel: z.number().int(), + name: z.string(), + primaryGroup: z.boolean(), + publicAdmission: z.boolean(), + publicExit: z.boolean(), + publishReadState: z.boolean(), + title: z.nullable(z.string()), + userCount: z.number().int(), + visibilityLevel: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + allowMembershipRequests: "allow_membership_requests", + bioCooked: "bio_cooked", + bioExcerpt: "bio_excerpt", + bioRaw: "bio_raw", + canAdminGroup: "can_admin_group", + canSeeMembers: "can_see_members", + defaultNotificationLevel: "default_notification_level", + displayName: "display_name", + flairBgColor: "flair_bg_color", + flairColor: "flair_color", + flairGroupId: "flair_group_id", + flairUrl: "flair_url", + fullName: "full_name", + grantTrustLevel: "grant_trust_level", + hasMessages: "has_messages", + incomingEmail: "incoming_email", + membersVisibilityLevel: "members_visibility_level", + membershipRequestTemplate: "membership_request_template", + mentionableLevel: "mentionable_level", + messageableLevel: "messageable_level", + primaryGroup: "primary_group", + publicAdmission: "public_admission", + publicExit: "public_exit", + publishReadState: "publish_read_state", + userCount: "user_count", + visibilityLevel: "visibility_level", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AdminGetUserGroups$ { + /** @deprecated use `AdminGetUserGroups$inboundSchema` instead. */ + export const inboundSchema = AdminGetUserGroups$inboundSchema; + /** @deprecated use `AdminGetUserGroups$outboundSchema` instead. */ + export const outboundSchema = AdminGetUserGroups$outboundSchema; + /** @deprecated use `AdminGetUserGroups$Outbound` instead. */ + export type Outbound = AdminGetUserGroups$Outbound; +} + +/** @internal */ +export const PenaltyCounts$inboundSchema: z.ZodType = + z.object({ + silenced: z.number().int(), + suspended: z.number().int(), + }); + +/** @internal */ +export type PenaltyCounts$Outbound = { + silenced: number; + suspended: number; +}; + +/** @internal */ +export const PenaltyCounts$outboundSchema: z.ZodType< + PenaltyCounts$Outbound, + z.ZodTypeDef, + PenaltyCounts +> = z.object({ + silenced: z.number().int(), + suspended: z.number().int(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PenaltyCounts$ { + /** @deprecated use `PenaltyCounts$inboundSchema` instead. */ + export const inboundSchema = PenaltyCounts$inboundSchema; + /** @deprecated use `PenaltyCounts$outboundSchema` instead. */ + export const outboundSchema = PenaltyCounts$outboundSchema; + /** @deprecated use `PenaltyCounts$Outbound` instead. */ + export type Outbound = PenaltyCounts$Outbound; +} + +/** @internal */ +export const AdminGetUserPenaltyCounts$inboundSchema: z.ZodType< + AdminGetUserPenaltyCounts, + z.ZodTypeDef, + unknown +> = z.object({ + silenced: z.number().int(), + suspended: z.number().int(), + total: z.number().int(), +}); + +/** @internal */ +export type AdminGetUserPenaltyCounts$Outbound = { + silenced: number; + suspended: number; + total: number; +}; + +/** @internal */ +export const AdminGetUserPenaltyCounts$outboundSchema: z.ZodType< + AdminGetUserPenaltyCounts$Outbound, + z.ZodTypeDef, + AdminGetUserPenaltyCounts +> = z.object({ + silenced: z.number().int(), + suspended: z.number().int(), + total: z.number().int(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AdminGetUserPenaltyCounts$ { + /** @deprecated use `AdminGetUserPenaltyCounts$inboundSchema` instead. */ + export const inboundSchema = AdminGetUserPenaltyCounts$inboundSchema; + /** @deprecated use `AdminGetUserPenaltyCounts$outboundSchema` instead. */ + export const outboundSchema = AdminGetUserPenaltyCounts$outboundSchema; + /** @deprecated use `AdminGetUserPenaltyCounts$Outbound` instead. */ + export type Outbound = AdminGetUserPenaltyCounts$Outbound; +} + +/** @internal */ +export const Tl3Requirements$inboundSchema: z.ZodType = z + .object({ + days_visited: z.number().int(), + max_flagged_by_users: z.number().int(), + max_flagged_posts: z.number().int(), + min_days_visited: z.number().int(), + min_likes_given: z.number().int(), + min_likes_received: z.number().int(), + min_likes_received_days: z.number().int(), + min_likes_received_users: z.number().int(), + min_posts_read: z.number().int(), + min_posts_read_all_time: z.number().int(), + min_topics_replied_to: z.number().int(), + min_topics_viewed: z.number().int(), + min_topics_viewed_all_time: z.number().int(), + num_flagged_by_users: z.number().int(), + num_flagged_posts: z.number().int(), + num_likes_given: z.number().int(), + num_likes_received: z.number().int(), + num_likes_received_days: z.number().int(), + num_likes_received_users: z.number().int(), + num_topics_replied_to: z.number().int(), + on_grace_period: z.boolean(), + penalty_counts: z.lazy(() => AdminGetUserPenaltyCounts$inboundSchema), + posts_read: z.number().int(), + posts_read_all_time: z.number().int(), + requirements_lost: z.boolean(), + requirements_met: z.boolean(), + time_period: z.number().int(), + topics_viewed: z.number().int(), + topics_viewed_all_time: z.number().int(), + trust_level_locked: z.boolean(), + }) + .transform((v) => { + return remap$(v, { + days_visited: "daysVisited", + max_flagged_by_users: "maxFlaggedByUsers", + max_flagged_posts: "maxFlaggedPosts", + min_days_visited: "minDaysVisited", + min_likes_given: "minLikesGiven", + min_likes_received: "minLikesReceived", + min_likes_received_days: "minLikesReceivedDays", + min_likes_received_users: "minLikesReceivedUsers", + min_posts_read: "minPostsRead", + min_posts_read_all_time: "minPostsReadAllTime", + min_topics_replied_to: "minTopicsRepliedTo", + min_topics_viewed: "minTopicsViewed", + min_topics_viewed_all_time: "minTopicsViewedAllTime", + num_flagged_by_users: "numFlaggedByUsers", + num_flagged_posts: "numFlaggedPosts", + num_likes_given: "numLikesGiven", + num_likes_received: "numLikesReceived", + num_likes_received_days: "numLikesReceivedDays", + num_likes_received_users: "numLikesReceivedUsers", + num_topics_replied_to: "numTopicsRepliedTo", + on_grace_period: "onGracePeriod", + penalty_counts: "penaltyCounts", + posts_read: "postsRead", + posts_read_all_time: "postsReadAllTime", + requirements_lost: "requirementsLost", + requirements_met: "requirementsMet", + time_period: "timePeriod", + topics_viewed: "topicsViewed", + topics_viewed_all_time: "topicsViewedAllTime", + trust_level_locked: "trustLevelLocked", + }); + }); + +/** @internal */ +export type Tl3Requirements$Outbound = { + days_visited: number; + max_flagged_by_users: number; + max_flagged_posts: number; + min_days_visited: number; + min_likes_given: number; + min_likes_received: number; + min_likes_received_days: number; + min_likes_received_users: number; + min_posts_read: number; + min_posts_read_all_time: number; + min_topics_replied_to: number; + min_topics_viewed: number; + min_topics_viewed_all_time: number; + num_flagged_by_users: number; + num_flagged_posts: number; + num_likes_given: number; + num_likes_received: number; + num_likes_received_days: number; + num_likes_received_users: number; + num_topics_replied_to: number; + on_grace_period: boolean; + penalty_counts: AdminGetUserPenaltyCounts$Outbound; + posts_read: number; + posts_read_all_time: number; + requirements_lost: boolean; + requirements_met: boolean; + time_period: number; + topics_viewed: number; + topics_viewed_all_time: number; + trust_level_locked: boolean; +}; + +/** @internal */ +export const Tl3Requirements$outboundSchema: z.ZodType< + Tl3Requirements$Outbound, + z.ZodTypeDef, + Tl3Requirements +> = z + .object({ + daysVisited: z.number().int(), + maxFlaggedByUsers: z.number().int(), + maxFlaggedPosts: z.number().int(), + minDaysVisited: z.number().int(), + minLikesGiven: z.number().int(), + minLikesReceived: z.number().int(), + minLikesReceivedDays: z.number().int(), + minLikesReceivedUsers: z.number().int(), + minPostsRead: z.number().int(), + minPostsReadAllTime: z.number().int(), + minTopicsRepliedTo: z.number().int(), + minTopicsViewed: z.number().int(), + minTopicsViewedAllTime: z.number().int(), + numFlaggedByUsers: z.number().int(), + numFlaggedPosts: z.number().int(), + numLikesGiven: z.number().int(), + numLikesReceived: z.number().int(), + numLikesReceivedDays: z.number().int(), + numLikesReceivedUsers: z.number().int(), + numTopicsRepliedTo: z.number().int(), + onGracePeriod: z.boolean(), + penaltyCounts: z.lazy(() => AdminGetUserPenaltyCounts$outboundSchema), + postsRead: z.number().int(), + postsReadAllTime: z.number().int(), + requirementsLost: z.boolean(), + requirementsMet: z.boolean(), + timePeriod: z.number().int(), + topicsViewed: z.number().int(), + topicsViewedAllTime: z.number().int(), + trustLevelLocked: z.boolean(), + }) + .transform((v) => { + return remap$(v, { + daysVisited: "days_visited", + maxFlaggedByUsers: "max_flagged_by_users", + maxFlaggedPosts: "max_flagged_posts", + minDaysVisited: "min_days_visited", + minLikesGiven: "min_likes_given", + minLikesReceived: "min_likes_received", + minLikesReceivedDays: "min_likes_received_days", + minLikesReceivedUsers: "min_likes_received_users", + minPostsRead: "min_posts_read", + minPostsReadAllTime: "min_posts_read_all_time", + minTopicsRepliedTo: "min_topics_replied_to", + minTopicsViewed: "min_topics_viewed", + minTopicsViewedAllTime: "min_topics_viewed_all_time", + numFlaggedByUsers: "num_flagged_by_users", + numFlaggedPosts: "num_flagged_posts", + numLikesGiven: "num_likes_given", + numLikesReceived: "num_likes_received", + numLikesReceivedDays: "num_likes_received_days", + numLikesReceivedUsers: "num_likes_received_users", + numTopicsRepliedTo: "num_topics_replied_to", + onGracePeriod: "on_grace_period", + penaltyCounts: "penalty_counts", + postsRead: "posts_read", + postsReadAllTime: "posts_read_all_time", + requirementsLost: "requirements_lost", + requirementsMet: "requirements_met", + timePeriod: "time_period", + topicsViewed: "topics_viewed", + topicsViewedAllTime: "topics_viewed_all_time", + trustLevelLocked: "trust_level_locked", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Tl3Requirements$ { + /** @deprecated use `Tl3Requirements$inboundSchema` instead. */ + export const inboundSchema = Tl3Requirements$inboundSchema; + /** @deprecated use `Tl3Requirements$outboundSchema` instead. */ + export const outboundSchema = Tl3Requirements$outboundSchema; + /** @deprecated use `Tl3Requirements$Outbound` instead. */ + export type Outbound = Tl3Requirements$Outbound; +} + +/** @internal */ +export const AdminGetUserResponseBody$inboundSchema: z.ZodType< + AdminGetUserResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + active: z.boolean(), + admin: z.boolean(), + api_key_count: z.number().int(), + approved_by: z.nullable(z.lazy(() => ApprovedBy$inboundSchema)), + associated_accounts: z.array(z.any()).optional(), + avatar_template: z.string(), + badge_count: z.number().int(), + bounce_score: z.nullable(z.number().int()), + can_activate: z.boolean(), + can_be_anonymized: z.boolean(), + can_be_deleted: z.boolean(), + can_be_merged: z.boolean(), + can_deactivate: z.boolean(), + can_delete_all_posts: z.boolean(), + can_delete_sso_record: z.boolean(), + can_disable_second_factor: z.boolean(), + can_grant_admin: z.boolean(), + can_grant_moderation: z.boolean(), + can_impersonate: z.boolean(), + can_revoke_admin: z.boolean(), + can_revoke_moderation: z.boolean(), + can_send_activation_email: z.boolean(), + can_view_action_logs: z.boolean(), + created_at: z.string(), + created_at_age: z.nullable(z.number()), + days_visited: z.number().int(), + external_ids: z.lazy(() => AdminGetUserExternalIds$inboundSchema), + flags_given_count: z.number().int(), + flags_received_count: z.number().int(), + full_suspend_reason: z.nullable(z.string()), + groups: z.array(z.lazy(() => AdminGetUserGroups$inboundSchema)), + id: z.number().int(), + ip_address: z.string(), + last_emailed_age: z.nullable(z.number()), + last_emailed_at: z.nullable(z.string()), + last_seen_age: z.nullable(z.number()), + last_seen_at: z.nullable(z.string()), + like_count: z.number().int(), + like_given_count: z.number().int(), + manual_locked_trust_level: z.nullable(z.string()), + moderator: z.boolean(), + name: z.nullable(z.string()), + next_penalty: z.string().optional(), + penalty_counts: z.lazy(() => PenaltyCounts$inboundSchema).optional(), + post_count: z.number().int(), + post_edits_count: z.nullable(z.number().int()).optional(), + posts_read_count: z.number().int(), + primary_group_id: z.nullable(z.string()), + private_topics_count: z.number().int(), + registration_ip_address: z.nullable(z.string()), + reset_bounce_score_after: z.nullable(z.string()), + silence_reason: z.nullable(z.string()), + silenced_by: z.nullable(z.string()), + single_sign_on_record: z.nullable(z.string()), + staged: z.boolean(), + suspended_by: z.nullable(z.string()), + time_read: z.number().int(), + title: z.nullable(z.string()), + tl3_requirements: z.lazy(() => Tl3Requirements$inboundSchema).optional(), + topic_count: z.number().int(), + topics_entered: z.number().int(), + trust_level: z.number().int(), + username: z.string(), + warnings_received_count: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + api_key_count: "apiKeyCount", + approved_by: "approvedBy", + associated_accounts: "associatedAccounts", + avatar_template: "avatarTemplate", + badge_count: "badgeCount", + bounce_score: "bounceScore", + can_activate: "canActivate", + can_be_anonymized: "canBeAnonymized", + can_be_deleted: "canBeDeleted", + can_be_merged: "canBeMerged", + can_deactivate: "canDeactivate", + can_delete_all_posts: "canDeleteAllPosts", + can_delete_sso_record: "canDeleteSsoRecord", + can_disable_second_factor: "canDisableSecondFactor", + can_grant_admin: "canGrantAdmin", + can_grant_moderation: "canGrantModeration", + can_impersonate: "canImpersonate", + can_revoke_admin: "canRevokeAdmin", + can_revoke_moderation: "canRevokeModeration", + can_send_activation_email: "canSendActivationEmail", + can_view_action_logs: "canViewActionLogs", + created_at: "createdAt", + created_at_age: "createdAtAge", + days_visited: "daysVisited", + external_ids: "externalIds", + flags_given_count: "flagsGivenCount", + flags_received_count: "flagsReceivedCount", + full_suspend_reason: "fullSuspendReason", + ip_address: "ipAddress", + last_emailed_age: "lastEmailedAge", + last_emailed_at: "lastEmailedAt", + last_seen_age: "lastSeenAge", + last_seen_at: "lastSeenAt", + like_count: "likeCount", + like_given_count: "likeGivenCount", + manual_locked_trust_level: "manualLockedTrustLevel", + next_penalty: "nextPenalty", + penalty_counts: "penaltyCounts", + post_count: "postCount", + post_edits_count: "postEditsCount", + posts_read_count: "postsReadCount", + primary_group_id: "primaryGroupId", + private_topics_count: "privateTopicsCount", + registration_ip_address: "registrationIpAddress", + reset_bounce_score_after: "resetBounceScoreAfter", + silence_reason: "silenceReason", + silenced_by: "silencedBy", + single_sign_on_record: "singleSignOnRecord", + suspended_by: "suspendedBy", + time_read: "timeRead", + tl3_requirements: "tl3Requirements", + topic_count: "topicCount", + topics_entered: "topicsEntered", + trust_level: "trustLevel", + warnings_received_count: "warningsReceivedCount", + }); + }); + +/** @internal */ +export type AdminGetUserResponseBody$Outbound = { + active: boolean; + admin: boolean; + api_key_count: number; + approved_by: ApprovedBy$Outbound | null; + associated_accounts?: Array | undefined; + avatar_template: string; + badge_count: number; + bounce_score: number | null; + can_activate: boolean; + can_be_anonymized: boolean; + can_be_deleted: boolean; + can_be_merged: boolean; + can_deactivate: boolean; + can_delete_all_posts: boolean; + can_delete_sso_record: boolean; + can_disable_second_factor: boolean; + can_grant_admin: boolean; + can_grant_moderation: boolean; + can_impersonate: boolean; + can_revoke_admin: boolean; + can_revoke_moderation: boolean; + can_send_activation_email: boolean; + can_view_action_logs: boolean; + created_at: string; + created_at_age: number | null; + days_visited: number; + external_ids: AdminGetUserExternalIds$Outbound; + flags_given_count: number; + flags_received_count: number; + full_suspend_reason: string | null; + groups: Array; + id: number; + ip_address: string; + last_emailed_age: number | null; + last_emailed_at: string | null; + last_seen_age: number | null; + last_seen_at: string | null; + like_count: number; + like_given_count: number; + manual_locked_trust_level: string | null; + moderator: boolean; + name: string | null; + next_penalty?: string | undefined; + penalty_counts?: PenaltyCounts$Outbound | undefined; + post_count: number; + post_edits_count?: number | null | undefined; + posts_read_count: number; + primary_group_id: string | null; + private_topics_count: number; + registration_ip_address: string | null; + reset_bounce_score_after: string | null; + silence_reason: string | null; + silenced_by: string | null; + single_sign_on_record: string | null; + staged: boolean; + suspended_by: string | null; + time_read: number; + title: string | null; + tl3_requirements?: Tl3Requirements$Outbound | undefined; + topic_count: number; + topics_entered: number; + trust_level: number; + username: string; + warnings_received_count: number; +}; + +/** @internal */ +export const AdminGetUserResponseBody$outboundSchema: z.ZodType< + AdminGetUserResponseBody$Outbound, + z.ZodTypeDef, + AdminGetUserResponseBody +> = z + .object({ + active: z.boolean(), + admin: z.boolean(), + apiKeyCount: z.number().int(), + approvedBy: z.nullable(z.lazy(() => ApprovedBy$outboundSchema)), + associatedAccounts: z.array(z.any()).optional(), + avatarTemplate: z.string(), + badgeCount: z.number().int(), + bounceScore: z.nullable(z.number().int()), + canActivate: z.boolean(), + canBeAnonymized: z.boolean(), + canBeDeleted: z.boolean(), + canBeMerged: z.boolean(), + canDeactivate: z.boolean(), + canDeleteAllPosts: z.boolean(), + canDeleteSsoRecord: z.boolean(), + canDisableSecondFactor: z.boolean(), + canGrantAdmin: z.boolean(), + canGrantModeration: z.boolean(), + canImpersonate: z.boolean(), + canRevokeAdmin: z.boolean(), + canRevokeModeration: z.boolean(), + canSendActivationEmail: z.boolean(), + canViewActionLogs: z.boolean(), + createdAt: z.string(), + createdAtAge: z.nullable(z.number()), + daysVisited: z.number().int(), + externalIds: z.lazy(() => AdminGetUserExternalIds$outboundSchema), + flagsGivenCount: z.number().int(), + flagsReceivedCount: z.number().int(), + fullSuspendReason: z.nullable(z.string()), + groups: z.array(z.lazy(() => AdminGetUserGroups$outboundSchema)), + id: z.number().int(), + ipAddress: z.string(), + lastEmailedAge: z.nullable(z.number()), + lastEmailedAt: z.nullable(z.string()), + lastSeenAge: z.nullable(z.number()), + lastSeenAt: z.nullable(z.string()), + likeCount: z.number().int(), + likeGivenCount: z.number().int(), + manualLockedTrustLevel: z.nullable(z.string()), + moderator: z.boolean(), + name: z.nullable(z.string()), + nextPenalty: z.string().optional(), + penaltyCounts: z.lazy(() => PenaltyCounts$outboundSchema).optional(), + postCount: z.number().int(), + postEditsCount: z.nullable(z.number().int()).optional(), + postsReadCount: z.number().int(), + primaryGroupId: z.nullable(z.string()), + privateTopicsCount: z.number().int(), + registrationIpAddress: z.nullable(z.string()), + resetBounceScoreAfter: z.nullable(z.string()), + silenceReason: z.nullable(z.string()), + silencedBy: z.nullable(z.string()), + singleSignOnRecord: z.nullable(z.string()), + staged: z.boolean(), + suspendedBy: z.nullable(z.string()), + timeRead: z.number().int(), + title: z.nullable(z.string()), + tl3Requirements: z.lazy(() => Tl3Requirements$outboundSchema).optional(), + topicCount: z.number().int(), + topicsEntered: z.number().int(), + trustLevel: z.number().int(), + username: z.string(), + warningsReceivedCount: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + apiKeyCount: "api_key_count", + approvedBy: "approved_by", + associatedAccounts: "associated_accounts", + avatarTemplate: "avatar_template", + badgeCount: "badge_count", + bounceScore: "bounce_score", + canActivate: "can_activate", + canBeAnonymized: "can_be_anonymized", + canBeDeleted: "can_be_deleted", + canBeMerged: "can_be_merged", + canDeactivate: "can_deactivate", + canDeleteAllPosts: "can_delete_all_posts", + canDeleteSsoRecord: "can_delete_sso_record", + canDisableSecondFactor: "can_disable_second_factor", + canGrantAdmin: "can_grant_admin", + canGrantModeration: "can_grant_moderation", + canImpersonate: "can_impersonate", + canRevokeAdmin: "can_revoke_admin", + canRevokeModeration: "can_revoke_moderation", + canSendActivationEmail: "can_send_activation_email", + canViewActionLogs: "can_view_action_logs", + createdAt: "created_at", + createdAtAge: "created_at_age", + daysVisited: "days_visited", + externalIds: "external_ids", + flagsGivenCount: "flags_given_count", + flagsReceivedCount: "flags_received_count", + fullSuspendReason: "full_suspend_reason", + ipAddress: "ip_address", + lastEmailedAge: "last_emailed_age", + lastEmailedAt: "last_emailed_at", + lastSeenAge: "last_seen_age", + lastSeenAt: "last_seen_at", + likeCount: "like_count", + likeGivenCount: "like_given_count", + manualLockedTrustLevel: "manual_locked_trust_level", + nextPenalty: "next_penalty", + penaltyCounts: "penalty_counts", + postCount: "post_count", + postEditsCount: "post_edits_count", + postsReadCount: "posts_read_count", + primaryGroupId: "primary_group_id", + privateTopicsCount: "private_topics_count", + registrationIpAddress: "registration_ip_address", + resetBounceScoreAfter: "reset_bounce_score_after", + silenceReason: "silence_reason", + silencedBy: "silenced_by", + singleSignOnRecord: "single_sign_on_record", + suspendedBy: "suspended_by", + timeRead: "time_read", + tl3Requirements: "tl3_requirements", + topicCount: "topic_count", + topicsEntered: "topics_entered", + trustLevel: "trust_level", + warningsReceivedCount: "warnings_received_count", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AdminGetUserResponseBody$ { + /** @deprecated use `AdminGetUserResponseBody$inboundSchema` instead. */ + export const inboundSchema = AdminGetUserResponseBody$inboundSchema; + /** @deprecated use `AdminGetUserResponseBody$outboundSchema` instead. */ + export const outboundSchema = AdminGetUserResponseBody$outboundSchema; + /** @deprecated use `AdminGetUserResponseBody$Outbound` instead. */ + export type Outbound = AdminGetUserResponseBody$Outbound; } diff --git a/src/sdk/models/operations/adminlistbadges.ts b/src/sdk/models/operations/adminlistbadges.ts index addf2f7..50c75ec 100644 --- a/src/sdk/models/operations/adminlistbadges.ts +++ b/src/sdk/models/operations/adminlistbadges.ts @@ -1,229 +1,468 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class Triggers extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "none" }) +export type Triggers = { none: number; - - @SpeakeasyMetadata() - @Expose({ name: "post_action" }) postAction: number; - - @SpeakeasyMetadata() - @Expose({ name: "post_revision" }) postRevision: number; - - @SpeakeasyMetadata() - @Expose({ name: "trust_level_change" }) trustLevelChange: number; - - @SpeakeasyMetadata() - @Expose({ name: "user_change" }) userChange: number; -} +}; -export class AdminBadges extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "badge_grouping_ids" }) - badgeGroupingIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "badge_ids" }) - badgeIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "badge_type_ids" }) - badgeTypeIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "protected_system_fields" }) - protectedSystemFields: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "triggers" }) - @Type(() => Triggers) +export type AdminBadges = { + badgeGroupingIds: Array; + badgeIds: Array; + badgeTypeIds: Array; + protectedSystemFields: Array; triggers: Triggers; -} +}; -export class BadgeGroupings extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "description" }) - description: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) +export type BadgeGroupings = { + description: string | null; id: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "position" }) position: number; - - @SpeakeasyMetadata() - @Expose({ name: "system" }) system: boolean; -} +}; -export class BadgeTypes extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "id" }) +export type BadgeTypes = { id: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "sort_order" }) sortOrder: number; -} +}; -export class Badges extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "allow_title" }) +export type Badges = { allowTitle: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "auto_revoke" }) autoRevoke: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "badge_grouping_id" }) badgeGroupingId: number; - - @SpeakeasyMetadata() - @Expose({ name: "badge_type_id" }) badgeTypeId: number; - - @SpeakeasyMetadata() - @Expose({ name: "description" }) description: string; - - @SpeakeasyMetadata() - @Expose({ name: "enabled" }) enabled: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "grant_count" }) grantCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "i18n_name" }) - i18nName?: string; - - @SpeakeasyMetadata() - @Expose({ name: "icon" }) + i18nName?: string | null | undefined; icon: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "image_url" }) - imageUrl: string; - - @SpeakeasyMetadata() - @Expose({ name: "listable" }) + imageUrl: string | null; listable: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "long_description" }) longDescription: string; - - @SpeakeasyMetadata() - @Expose({ name: "manually_grantable" }) manuallyGrantable: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "multiple_grant" }) multipleGrant: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "query" }) - query: string; - - @SpeakeasyMetadata() - @Expose({ name: "show_posts" }) + query: string | null; showPosts: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "slug" }) slug: string; - - @SpeakeasyMetadata() - @Expose({ name: "system" }) system: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "target_posts" }) targetPosts: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "trigger" }) - trigger: number; -} + trigger: number | null; +}; /** * success response */ -export class AdminListBadgesResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "admin_badges" }) - @Type(() => AdminBadges) +export type AdminListBadgesResponseBody = { adminBadges: AdminBadges; + badgeGroupings: Array; + badgeTypes: Array; + badges: Array; +}; - @SpeakeasyMetadata({ elemType: BadgeGroupings }) - @Expose({ name: "badge_groupings" }) - @Type(() => BadgeGroupings) - badgeGroupings: BadgeGroupings[]; +/** @internal */ +export const Triggers$inboundSchema: z.ZodType = z + .object({ + none: z.number().int(), + post_action: z.number().int(), + post_revision: z.number().int(), + trust_level_change: z.number().int(), + user_change: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + post_action: "postAction", + post_revision: "postRevision", + trust_level_change: "trustLevelChange", + user_change: "userChange", + }); + }); - @SpeakeasyMetadata({ elemType: BadgeTypes }) - @Expose({ name: "badge_types" }) - @Type(() => BadgeTypes) - badgeTypes: BadgeTypes[]; +/** @internal */ +export type Triggers$Outbound = { + none: number; + post_action: number; + post_revision: number; + trust_level_change: number; + user_change: number; +}; - @SpeakeasyMetadata({ elemType: Badges }) - @Expose({ name: "badges" }) - @Type(() => Badges) - badges: Badges[]; +/** @internal */ +export const Triggers$outboundSchema: z.ZodType = z + .object({ + none: z.number().int(), + postAction: z.number().int(), + postRevision: z.number().int(), + trustLevelChange: z.number().int(), + userChange: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + postAction: "post_action", + postRevision: "post_revision", + trustLevelChange: "trust_level_change", + userChange: "user_change", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Triggers$ { + /** @deprecated use `Triggers$inboundSchema` instead. */ + export const inboundSchema = Triggers$inboundSchema; + /** @deprecated use `Triggers$outboundSchema` instead. */ + export const outboundSchema = Triggers$outboundSchema; + /** @deprecated use `Triggers$Outbound` instead. */ + export type Outbound = Triggers$Outbound; } -export class AdminListBadgesResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const AdminBadges$inboundSchema: z.ZodType = z + .object({ + badge_grouping_ids: z.array(z.any()), + badge_ids: z.array(z.any()), + badge_type_ids: z.array(z.any()), + protected_system_fields: z.array(z.any()), + triggers: z.lazy(() => Triggers$inboundSchema), + }) + .transform((v) => { + return remap$(v, { + badge_grouping_ids: "badgeGroupingIds", + badge_ids: "badgeIds", + badge_type_ids: "badgeTypeIds", + protected_system_fields: "protectedSystemFields", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type AdminBadges$Outbound = { + badge_grouping_ids: Array; + badge_ids: Array; + badge_type_ids: Array; + protected_system_fields: Array; + triggers: Triggers$Outbound; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const AdminBadges$outboundSchema: z.ZodType< + AdminBadges$Outbound, + z.ZodTypeDef, + AdminBadges +> = z + .object({ + badgeGroupingIds: z.array(z.any()), + badgeIds: z.array(z.any()), + badgeTypeIds: z.array(z.any()), + protectedSystemFields: z.array(z.any()), + triggers: z.lazy(() => Triggers$outboundSchema), + }) + .transform((v) => { + return remap$(v, { + badgeGroupingIds: "badge_grouping_ids", + badgeIds: "badge_ids", + badgeTypeIds: "badge_type_ids", + protectedSystemFields: "protected_system_fields", + }); + }); - /** - * success response - */ - @SpeakeasyMetadata() - object?: AdminListBadgesResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AdminBadges$ { + /** @deprecated use `AdminBadges$inboundSchema` instead. */ + export const inboundSchema = AdminBadges$inboundSchema; + /** @deprecated use `AdminBadges$outboundSchema` instead. */ + export const outboundSchema = AdminBadges$outboundSchema; + /** @deprecated use `AdminBadges$Outbound` instead. */ + export type Outbound = AdminBadges$Outbound; +} + +/** @internal */ +export const BadgeGroupings$inboundSchema: z.ZodType = + z.object({ + description: z.nullable(z.string()), + id: z.number().int(), + name: z.string(), + position: z.number().int(), + system: z.boolean(), + }); + +/** @internal */ +export type BadgeGroupings$Outbound = { + description: string | null; + id: number; + name: string; + position: number; + system: boolean; +}; + +/** @internal */ +export const BadgeGroupings$outboundSchema: z.ZodType< + BadgeGroupings$Outbound, + z.ZodTypeDef, + BadgeGroupings +> = z.object({ + description: z.nullable(z.string()), + id: z.number().int(), + name: z.string(), + position: z.number().int(), + system: z.boolean(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace BadgeGroupings$ { + /** @deprecated use `BadgeGroupings$inboundSchema` instead. */ + export const inboundSchema = BadgeGroupings$inboundSchema; + /** @deprecated use `BadgeGroupings$outboundSchema` instead. */ + export const outboundSchema = BadgeGroupings$outboundSchema; + /** @deprecated use `BadgeGroupings$Outbound` instead. */ + export type Outbound = BadgeGroupings$Outbound; +} + +/** @internal */ +export const BadgeTypes$inboundSchema: z.ZodType = z + .object({ + id: z.number().int(), + name: z.string(), + sort_order: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + sort_order: "sortOrder", + }); + }); + +/** @internal */ +export type BadgeTypes$Outbound = { + id: number; + name: string; + sort_order: number; +}; + +/** @internal */ +export const BadgeTypes$outboundSchema: z.ZodType = z + .object({ + id: z.number().int(), + name: z.string(), + sortOrder: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + sortOrder: "sort_order", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace BadgeTypes$ { + /** @deprecated use `BadgeTypes$inboundSchema` instead. */ + export const inboundSchema = BadgeTypes$inboundSchema; + /** @deprecated use `BadgeTypes$outboundSchema` instead. */ + export const outboundSchema = BadgeTypes$outboundSchema; + /** @deprecated use `BadgeTypes$Outbound` instead. */ + export type Outbound = BadgeTypes$Outbound; +} + +/** @internal */ +export const Badges$inboundSchema: z.ZodType = z + .object({ + allow_title: z.boolean(), + auto_revoke: z.boolean(), + badge_grouping_id: z.number().int(), + badge_type_id: z.number().int(), + description: z.string(), + enabled: z.boolean(), + grant_count: z.number().int(), + i18n_name: z.nullable(z.string()).optional(), + icon: z.string(), + id: z.number().int(), + image_url: z.nullable(z.string()), + listable: z.boolean(), + long_description: z.string(), + manually_grantable: z.boolean(), + multiple_grant: z.boolean(), + name: z.string(), + query: z.nullable(z.string()), + show_posts: z.boolean(), + slug: z.string(), + system: z.boolean(), + target_posts: z.boolean(), + trigger: z.nullable(z.number().int()), + }) + .transform((v) => { + return remap$(v, { + allow_title: "allowTitle", + auto_revoke: "autoRevoke", + badge_grouping_id: "badgeGroupingId", + badge_type_id: "badgeTypeId", + grant_count: "grantCount", + i18n_name: "i18nName", + image_url: "imageUrl", + long_description: "longDescription", + manually_grantable: "manuallyGrantable", + multiple_grant: "multipleGrant", + show_posts: "showPosts", + target_posts: "targetPosts", + }); + }); + +/** @internal */ +export type Badges$Outbound = { + allow_title: boolean; + auto_revoke: boolean; + badge_grouping_id: number; + badge_type_id: number; + description: string; + enabled: boolean; + grant_count: number; + i18n_name?: string | null | undefined; + icon: string; + id: number; + image_url: string | null; + listable: boolean; + long_description: string; + manually_grantable: boolean; + multiple_grant: boolean; + name: string; + query: string | null; + show_posts: boolean; + slug: string; + system: boolean; + target_posts: boolean; + trigger: number | null; +}; + +/** @internal */ +export const Badges$outboundSchema: z.ZodType = z + .object({ + allowTitle: z.boolean(), + autoRevoke: z.boolean(), + badgeGroupingId: z.number().int(), + badgeTypeId: z.number().int(), + description: z.string(), + enabled: z.boolean(), + grantCount: z.number().int(), + i18nName: z.nullable(z.string()).optional(), + icon: z.string(), + id: z.number().int(), + imageUrl: z.nullable(z.string()), + listable: z.boolean(), + longDescription: z.string(), + manuallyGrantable: z.boolean(), + multipleGrant: z.boolean(), + name: z.string(), + query: z.nullable(z.string()), + showPosts: z.boolean(), + slug: z.string(), + system: z.boolean(), + targetPosts: z.boolean(), + trigger: z.nullable(z.number().int()), + }) + .transform((v) => { + return remap$(v, { + allowTitle: "allow_title", + autoRevoke: "auto_revoke", + badgeGroupingId: "badge_grouping_id", + badgeTypeId: "badge_type_id", + grantCount: "grant_count", + i18nName: "i18n_name", + imageUrl: "image_url", + longDescription: "long_description", + manuallyGrantable: "manually_grantable", + multipleGrant: "multiple_grant", + showPosts: "show_posts", + targetPosts: "target_posts", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Badges$ { + /** @deprecated use `Badges$inboundSchema` instead. */ + export const inboundSchema = Badges$inboundSchema; + /** @deprecated use `Badges$outboundSchema` instead. */ + export const outboundSchema = Badges$outboundSchema; + /** @deprecated use `Badges$Outbound` instead. */ + export type Outbound = Badges$Outbound; +} + +/** @internal */ +export const AdminListBadgesResponseBody$inboundSchema: z.ZodType< + AdminListBadgesResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + admin_badges: z.lazy(() => AdminBadges$inboundSchema), + badge_groupings: z.array(z.lazy(() => BadgeGroupings$inboundSchema)), + badge_types: z.array(z.lazy(() => BadgeTypes$inboundSchema)), + badges: z.array(z.lazy(() => Badges$inboundSchema)), + }) + .transform((v) => { + return remap$(v, { + admin_badges: "adminBadges", + badge_groupings: "badgeGroupings", + badge_types: "badgeTypes", + }); + }); + +/** @internal */ +export type AdminListBadgesResponseBody$Outbound = { + admin_badges: AdminBadges$Outbound; + badge_groupings: Array; + badge_types: Array; + badges: Array; +}; + +/** @internal */ +export const AdminListBadgesResponseBody$outboundSchema: z.ZodType< + AdminListBadgesResponseBody$Outbound, + z.ZodTypeDef, + AdminListBadgesResponseBody +> = z + .object({ + adminBadges: z.lazy(() => AdminBadges$outboundSchema), + badgeGroupings: z.array(z.lazy(() => BadgeGroupings$outboundSchema)), + badgeTypes: z.array(z.lazy(() => BadgeTypes$outboundSchema)), + badges: z.array(z.lazy(() => Badges$outboundSchema)), + }) + .transform((v) => { + return remap$(v, { + adminBadges: "admin_badges", + badgeGroupings: "badge_groupings", + badgeTypes: "badge_types", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AdminListBadgesResponseBody$ { + /** @deprecated use `AdminListBadgesResponseBody$inboundSchema` instead. */ + export const inboundSchema = AdminListBadgesResponseBody$inboundSchema; + /** @deprecated use `AdminListBadgesResponseBody$outboundSchema` instead. */ + export const outboundSchema = AdminListBadgesResponseBody$outboundSchema; + /** @deprecated use `AdminListBadgesResponseBody$Outbound` instead. */ + export type Outbound = AdminListBadgesResponseBody$Outbound; } diff --git a/src/sdk/models/operations/adminlistusers.ts b/src/sdk/models/operations/adminlistusers.ts index 81ad618..c4b5a53 100644 --- a/src/sdk/models/operations/adminlistusers.ts +++ b/src/sdk/models/operations/adminlistusers.ts @@ -1,196 +1,356 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; -export enum QueryParamAsc { - True = "true", -} +export const QueryParamAsc = { + True: "true", +} as const; +export type QueryParamAsc = ClosedEnum; -export enum Flag { - Active = "active", - New = "new", - Staff = "staff", - Suspended = "suspended", - Blocked = "blocked", - Suspect = "suspect", -} +export const Flag = { + Active: "active", + New: "new", + Staff: "staff", + Suspended: "suspended", + Blocked: "blocked", + Suspect: "suspect", +} as const; +export type Flag = ClosedEnum; -export enum QueryParamOrder { - Created = "created", - LastEmailed = "last_emailed", - Seen = "seen", - Username = "username", - Email = "email", - TrustLevel = "trust_level", - DaysVisited = "days_visited", - PostsRead = "posts_read", - TopicsViewed = "topics_viewed", - Posts = "posts", - ReadTime = "read_time", -} - -export class AdminListUsersRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "queryParam, style=form;explode=true;name=asc" }) - asc?: QueryParamAsc; +export const QueryParamOrder = { + Created: "created", + LastEmailed: "last_emailed", + Seen: "seen", + Username: "username", + Email: "email", + TrustLevel: "trust_level", + DaysVisited: "days_visited", + PostsRead: "posts_read", + TopicsViewed: "topics_viewed", + Posts: "posts", + ReadTime: "read_time", +} as const; +export type QueryParamOrder = ClosedEnum; +export type AdminListUsersRequest = { + asc?: QueryParamAsc | undefined; /** * Filter to the user with this email address */ - @SpeakeasyMetadata({ data: "queryParam, style=form;explode=true;name=email" }) - email?: string; - - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=flag" }) + email?: string | undefined; flag: Flag; - /** * Filter to users with this IP address */ - @SpeakeasyMetadata({ data: "queryParam, style=form;explode=true;name=ip" }) - ip?: string; - - @SpeakeasyMetadata({ data: "queryParam, style=form;explode=true;name=order" }) - order?: QueryParamOrder; - - @SpeakeasyMetadata({ data: "queryParam, style=form;explode=true;name=page" }) - page?: number; - + ip?: string | undefined; + order?: QueryParamOrder | undefined; + page?: number | undefined; /** * Include user email addresses in response. These requests will be logged in the staff action logs. */ - @SpeakeasyMetadata({ data: "queryParam, style=form;explode=true;name=show_emails" }) - showEmails?: boolean; - + showEmails?: boolean | undefined; /** * Include user stats information */ - @SpeakeasyMetadata({ data: "queryParam, style=form;explode=true;name=stats" }) - stats?: boolean; -} + stats?: boolean | undefined; +}; -export class AdminListUsersResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "active" }) +export type AdminListUsersResponseBody = { active: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "admin" }) admin: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "avatar_template" }) avatarTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "created_at" }) createdAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "created_at_age" }) - createdAtAge: number; - - @SpeakeasyMetadata() - @Expose({ name: "days_visited" }) + createdAtAge: number | null; daysVisited: number; - - @SpeakeasyMetadata() - @Expose({ name: "email" }) - email?: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) + email?: string | undefined; id: number; - - @SpeakeasyMetadata() - @Expose({ name: "last_emailed_age" }) - lastEmailedAge: number; - - @SpeakeasyMetadata() - @Expose({ name: "last_emailed_at" }) - lastEmailedAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "last_seen_age" }) - lastSeenAge: number; - - @SpeakeasyMetadata() - @Expose({ name: "last_seen_at" }) - lastSeenAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "manual_locked_trust_level" }) - manualLockedTrustLevel: string; - - @SpeakeasyMetadata() - @Expose({ name: "moderator" }) + lastEmailedAge: number | null; + lastEmailedAt: string | null; + lastSeenAge: number | null; + lastSeenAt: string | null; + manualLockedTrustLevel: string | null; moderator: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) - name: string; - - @SpeakeasyMetadata() - @Expose({ name: "post_count" }) + name: string | null; postCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "posts_read_count" }) postsReadCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "secondary_emails" }) - secondaryEmails?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "staged" }) + secondaryEmails?: Array | undefined; staged: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "time_read" }) timeRead: number; - - @SpeakeasyMetadata() - @Expose({ name: "title" }) - title: string; - - @SpeakeasyMetadata() - @Expose({ name: "topics_entered" }) + title: string | null; topicsEntered: number; - - @SpeakeasyMetadata() - @Expose({ name: "trust_level" }) trustLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) username: string; +}; + +/** @internal */ +export const QueryParamAsc$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(QueryParamAsc); + +/** @internal */ +export const QueryParamAsc$outboundSchema: z.ZodNativeEnum = + QueryParamAsc$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace QueryParamAsc$ { + /** @deprecated use `QueryParamAsc$inboundSchema` instead. */ + export const inboundSchema = QueryParamAsc$inboundSchema; + /** @deprecated use `QueryParamAsc$outboundSchema` instead. */ + export const outboundSchema = QueryParamAsc$outboundSchema; } -export class AdminListUsersResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const Flag$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Flag); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export const Flag$outboundSchema: z.ZodNativeEnum = Flag$inboundSchema; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; - - /** - * response - */ - @SpeakeasyMetadata({ elemType: AdminListUsersResponseBody }) - responseBodies?: AdminListUsersResponseBody[]; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Flag$ { + /** @deprecated use `Flag$inboundSchema` instead. */ + export const inboundSchema = Flag$inboundSchema; + /** @deprecated use `Flag$outboundSchema` instead. */ + export const outboundSchema = Flag$outboundSchema; +} + +/** @internal */ +export const QueryParamOrder$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(QueryParamOrder); + +/** @internal */ +export const QueryParamOrder$outboundSchema: z.ZodNativeEnum = + QueryParamOrder$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace QueryParamOrder$ { + /** @deprecated use `QueryParamOrder$inboundSchema` instead. */ + export const inboundSchema = QueryParamOrder$inboundSchema; + /** @deprecated use `QueryParamOrder$outboundSchema` instead. */ + export const outboundSchema = QueryParamOrder$outboundSchema; +} + +/** @internal */ +export const AdminListUsersRequest$inboundSchema: z.ZodType< + AdminListUsersRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + asc: QueryParamAsc$inboundSchema.optional(), + email: z.string().optional(), + flag: Flag$inboundSchema, + ip: z.string().optional(), + order: QueryParamOrder$inboundSchema.optional(), + page: z.number().int().optional(), + show_emails: z.boolean().optional(), + stats: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + show_emails: "showEmails", + }); + }); + +/** @internal */ +export type AdminListUsersRequest$Outbound = { + asc?: string | undefined; + email?: string | undefined; + flag: string; + ip?: string | undefined; + order?: string | undefined; + page?: number | undefined; + show_emails?: boolean | undefined; + stats?: boolean | undefined; +}; + +/** @internal */ +export const AdminListUsersRequest$outboundSchema: z.ZodType< + AdminListUsersRequest$Outbound, + z.ZodTypeDef, + AdminListUsersRequest +> = z + .object({ + asc: QueryParamAsc$outboundSchema.optional(), + email: z.string().optional(), + flag: Flag$outboundSchema, + ip: z.string().optional(), + order: QueryParamOrder$outboundSchema.optional(), + page: z.number().int().optional(), + showEmails: z.boolean().optional(), + stats: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + showEmails: "show_emails", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AdminListUsersRequest$ { + /** @deprecated use `AdminListUsersRequest$inboundSchema` instead. */ + export const inboundSchema = AdminListUsersRequest$inboundSchema; + /** @deprecated use `AdminListUsersRequest$outboundSchema` instead. */ + export const outboundSchema = AdminListUsersRequest$outboundSchema; + /** @deprecated use `AdminListUsersRequest$Outbound` instead. */ + export type Outbound = AdminListUsersRequest$Outbound; +} + +/** @internal */ +export const AdminListUsersResponseBody$inboundSchema: z.ZodType< + AdminListUsersResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + active: z.boolean(), + admin: z.boolean(), + avatar_template: z.string(), + created_at: z.string(), + created_at_age: z.nullable(z.number()), + days_visited: z.number().int(), + email: z.string().optional(), + id: z.number().int(), + last_emailed_age: z.nullable(z.number()), + last_emailed_at: z.nullable(z.string()), + last_seen_age: z.nullable(z.number()), + last_seen_at: z.nullable(z.string()), + manual_locked_trust_level: z.nullable(z.string()), + moderator: z.boolean(), + name: z.nullable(z.string()), + post_count: z.number().int(), + posts_read_count: z.number().int(), + secondary_emails: z.array(z.any()).optional(), + staged: z.boolean(), + time_read: z.number().int(), + title: z.nullable(z.string()), + topics_entered: z.number().int(), + trust_level: z.number().int(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + avatar_template: "avatarTemplate", + created_at: "createdAt", + created_at_age: "createdAtAge", + days_visited: "daysVisited", + last_emailed_age: "lastEmailedAge", + last_emailed_at: "lastEmailedAt", + last_seen_age: "lastSeenAge", + last_seen_at: "lastSeenAt", + manual_locked_trust_level: "manualLockedTrustLevel", + post_count: "postCount", + posts_read_count: "postsReadCount", + secondary_emails: "secondaryEmails", + time_read: "timeRead", + topics_entered: "topicsEntered", + trust_level: "trustLevel", + }); + }); + +/** @internal */ +export type AdminListUsersResponseBody$Outbound = { + active: boolean; + admin: boolean; + avatar_template: string; + created_at: string; + created_at_age: number | null; + days_visited: number; + email?: string | undefined; + id: number; + last_emailed_age: number | null; + last_emailed_at: string | null; + last_seen_age: number | null; + last_seen_at: string | null; + manual_locked_trust_level: string | null; + moderator: boolean; + name: string | null; + post_count: number; + posts_read_count: number; + secondary_emails?: Array | undefined; + staged: boolean; + time_read: number; + title: string | null; + topics_entered: number; + trust_level: number; + username: string; +}; + +/** @internal */ +export const AdminListUsersResponseBody$outboundSchema: z.ZodType< + AdminListUsersResponseBody$Outbound, + z.ZodTypeDef, + AdminListUsersResponseBody +> = z + .object({ + active: z.boolean(), + admin: z.boolean(), + avatarTemplate: z.string(), + createdAt: z.string(), + createdAtAge: z.nullable(z.number()), + daysVisited: z.number().int(), + email: z.string().optional(), + id: z.number().int(), + lastEmailedAge: z.nullable(z.number()), + lastEmailedAt: z.nullable(z.string()), + lastSeenAge: z.nullable(z.number()), + lastSeenAt: z.nullable(z.string()), + manualLockedTrustLevel: z.nullable(z.string()), + moderator: z.boolean(), + name: z.nullable(z.string()), + postCount: z.number().int(), + postsReadCount: z.number().int(), + secondaryEmails: z.array(z.any()).optional(), + staged: z.boolean(), + timeRead: z.number().int(), + title: z.nullable(z.string()), + topicsEntered: z.number().int(), + trustLevel: z.number().int(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + avatarTemplate: "avatar_template", + createdAt: "created_at", + createdAtAge: "created_at_age", + daysVisited: "days_visited", + lastEmailedAge: "last_emailed_age", + lastEmailedAt: "last_emailed_at", + lastSeenAge: "last_seen_age", + lastSeenAt: "last_seen_at", + manualLockedTrustLevel: "manual_locked_trust_level", + postCount: "post_count", + postsReadCount: "posts_read_count", + secondaryEmails: "secondary_emails", + timeRead: "time_read", + topicsEntered: "topics_entered", + trustLevel: "trust_level", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AdminListUsersResponseBody$ { + /** @deprecated use `AdminListUsersResponseBody$inboundSchema` instead. */ + export const inboundSchema = AdminListUsersResponseBody$inboundSchema; + /** @deprecated use `AdminListUsersResponseBody$outboundSchema` instead. */ + export const outboundSchema = AdminListUsersResponseBody$outboundSchema; + /** @deprecated use `AdminListUsersResponseBody$Outbound` instead. */ + export type Outbound = AdminListUsersResponseBody$Outbound; } diff --git a/src/sdk/models/operations/anonymizeuser.ts b/src/sdk/models/operations/anonymizeuser.ts index e0f3c43..2fa3c18 100644 --- a/src/sdk/models/operations/anonymizeuser.ts +++ b/src/sdk/models/operations/anonymizeuser.ts @@ -1,51 +1,92 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose } from "class-transformer"; +import * as z from "zod"; -export class AnonymizeUserRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) +export type AnonymizeUserRequest = { id: number; -} +}; /** * response */ -export class AnonymizeUserResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "success" }) +export type AnonymizeUserResponseBody = { success: string; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) username: string; +}; + +/** @internal */ +export const AnonymizeUserRequest$inboundSchema: z.ZodType< + AnonymizeUserRequest, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.number().int(), +}); + +/** @internal */ +export type AnonymizeUserRequest$Outbound = { + id: number; +}; + +/** @internal */ +export const AnonymizeUserRequest$outboundSchema: z.ZodType< + AnonymizeUserRequest$Outbound, + z.ZodTypeDef, + AnonymizeUserRequest +> = z.object({ + id: z.number().int(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AnonymizeUserRequest$ { + /** @deprecated use `AnonymizeUserRequest$inboundSchema` instead. */ + export const inboundSchema = AnonymizeUserRequest$inboundSchema; + /** @deprecated use `AnonymizeUserRequest$outboundSchema` instead. */ + export const outboundSchema = AnonymizeUserRequest$outboundSchema; + /** @deprecated use `AnonymizeUserRequest$Outbound` instead. */ + export type Outbound = AnonymizeUserRequest$Outbound; } -export class AnonymizeUserResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const AnonymizeUserResponseBody$inboundSchema: z.ZodType< + AnonymizeUserResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + success: z.string(), + username: z.string(), +}); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type AnonymizeUserResponseBody$Outbound = { + success: string; + username: string; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const AnonymizeUserResponseBody$outboundSchema: z.ZodType< + AnonymizeUserResponseBody$Outbound, + z.ZodTypeDef, + AnonymizeUserResponseBody +> = z.object({ + success: z.string(), + username: z.string(), +}); - /** - * response - */ - @SpeakeasyMetadata() - object?: AnonymizeUserResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace AnonymizeUserResponseBody$ { + /** @deprecated use `AnonymizeUserResponseBody$inboundSchema` instead. */ + export const inboundSchema = AnonymizeUserResponseBody$inboundSchema; + /** @deprecated use `AnonymizeUserResponseBody$outboundSchema` instead. */ + export const outboundSchema = AnonymizeUserResponseBody$outboundSchema; + /** @deprecated use `AnonymizeUserResponseBody$Outbound` instead. */ + export type Outbound = AnonymizeUserResponseBody$Outbound; } diff --git a/src/sdk/models/operations/batchpresignmultipartparts.ts b/src/sdk/models/operations/batchpresignmultipartparts.ts index 93ac3f0..76bd2be 100644 --- a/src/sdk/models/operations/batchpresignmultipartparts.ts +++ b/src/sdk/models/operations/batchpresignmultipartparts.ts @@ -1,67 +1,160 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class BatchPresignMultipartPartsRequestBody extends SpeakeasyBase { +export type BatchPresignMultipartPartsRequestBody = { /** * The part numbers to generate the presigned URLs for, must be between 1 and 10000. */ - @SpeakeasyMetadata() - @Expose({ name: "part_numbers" }) - partNumbers: any[]; - + partNumbers: Array; /** * The unique identifier returned in the original /create-multipart request. */ - @SpeakeasyMetadata() - @Expose({ name: "unique_identifier" }) uniqueIdentifier: string; -} +}; /** * The presigned URLs for each part number, which has the part numbers as keys. */ -export class PresignedUrls extends SpeakeasyBase {} +export type PresignedUrls = {}; /** * external upload initialized */ -export class BatchPresignMultipartPartsResponseBody extends SpeakeasyBase { +export type BatchPresignMultipartPartsResponseBody = { /** * The presigned URLs for each part number, which has the part numbers as keys. */ - @SpeakeasyMetadata() - @Expose({ name: "presigned_urls" }) - @Type(() => PresignedUrls) presignedUrls: PresignedUrls; +}; + +/** @internal */ +export const BatchPresignMultipartPartsRequestBody$inboundSchema: z.ZodType< + BatchPresignMultipartPartsRequestBody, + z.ZodTypeDef, + unknown +> = z + .object({ + part_numbers: z.array(z.any()), + unique_identifier: z.string(), + }) + .transform((v) => { + return remap$(v, { + part_numbers: "partNumbers", + unique_identifier: "uniqueIdentifier", + }); + }); + +/** @internal */ +export type BatchPresignMultipartPartsRequestBody$Outbound = { + part_numbers: Array; + unique_identifier: string; +}; + +/** @internal */ +export const BatchPresignMultipartPartsRequestBody$outboundSchema: z.ZodType< + BatchPresignMultipartPartsRequestBody$Outbound, + z.ZodTypeDef, + BatchPresignMultipartPartsRequestBody +> = z + .object({ + partNumbers: z.array(z.any()), + uniqueIdentifier: z.string(), + }) + .transform((v) => { + return remap$(v, { + partNumbers: "part_numbers", + uniqueIdentifier: "unique_identifier", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace BatchPresignMultipartPartsRequestBody$ { + /** @deprecated use `BatchPresignMultipartPartsRequestBody$inboundSchema` instead. */ + export const inboundSchema = BatchPresignMultipartPartsRequestBody$inboundSchema; + /** @deprecated use `BatchPresignMultipartPartsRequestBody$outboundSchema` instead. */ + export const outboundSchema = BatchPresignMultipartPartsRequestBody$outboundSchema; + /** @deprecated use `BatchPresignMultipartPartsRequestBody$Outbound` instead. */ + export type Outbound = BatchPresignMultipartPartsRequestBody$Outbound; } -export class BatchPresignMultipartPartsResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const PresignedUrls$inboundSchema: z.ZodType = + z.object({}); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type PresignedUrls$Outbound = {}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const PresignedUrls$outboundSchema: z.ZodType< + PresignedUrls$Outbound, + z.ZodTypeDef, + PresignedUrls +> = z.object({}); - /** - * external upload initialized - */ - @SpeakeasyMetadata() - object?: BatchPresignMultipartPartsResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PresignedUrls$ { + /** @deprecated use `PresignedUrls$inboundSchema` instead. */ + export const inboundSchema = PresignedUrls$inboundSchema; + /** @deprecated use `PresignedUrls$outboundSchema` instead. */ + export const outboundSchema = PresignedUrls$outboundSchema; + /** @deprecated use `PresignedUrls$Outbound` instead. */ + export type Outbound = PresignedUrls$Outbound; +} + +/** @internal */ +export const BatchPresignMultipartPartsResponseBody$inboundSchema: z.ZodType< + BatchPresignMultipartPartsResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + presigned_urls: z.lazy(() => PresignedUrls$inboundSchema), + }) + .transform((v) => { + return remap$(v, { + presigned_urls: "presignedUrls", + }); + }); + +/** @internal */ +export type BatchPresignMultipartPartsResponseBody$Outbound = { + presigned_urls: PresignedUrls$Outbound; +}; + +/** @internal */ +export const BatchPresignMultipartPartsResponseBody$outboundSchema: z.ZodType< + BatchPresignMultipartPartsResponseBody$Outbound, + z.ZodTypeDef, + BatchPresignMultipartPartsResponseBody +> = z + .object({ + presignedUrls: z.lazy(() => PresignedUrls$outboundSchema), + }) + .transform((v) => { + return remap$(v, { + presignedUrls: "presigned_urls", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace BatchPresignMultipartPartsResponseBody$ { + /** @deprecated use `BatchPresignMultipartPartsResponseBody$inboundSchema` instead. */ + export const inboundSchema = BatchPresignMultipartPartsResponseBody$inboundSchema; + /** @deprecated use `BatchPresignMultipartPartsResponseBody$outboundSchema` instead. */ + export const outboundSchema = BatchPresignMultipartPartsResponseBody$outboundSchema; + /** @deprecated use `BatchPresignMultipartPartsResponseBody$Outbound` instead. */ + export type Outbound = BatchPresignMultipartPartsResponseBody$Outbound; } diff --git a/src/sdk/models/operations/bookmarktopic.ts b/src/sdk/models/operations/bookmarktopic.ts index edc7095..9cf8c06 100644 --- a/src/sdk/models/operations/bookmarktopic.ts +++ b/src/sdk/models/operations/bookmarktopic.ts @@ -1,37 +1,68 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class BookmarkTopicRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Key" }) +export type BookmarkTopicRequest = { apiKey: string; - - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Username" }) apiUsername: string; - - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) id: string; -} - -export class BookmarkTopicResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; - - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; - - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +}; + +/** @internal */ +export const BookmarkTopicRequest$inboundSchema: z.ZodType< + BookmarkTopicRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + "Api-Key": z.string(), + "Api-Username": z.string(), + id: z.string(), + }) + .transform((v) => { + return remap$(v, { + "Api-Key": "apiKey", + "Api-Username": "apiUsername", + }); + }); + +/** @internal */ +export type BookmarkTopicRequest$Outbound = { + "Api-Key": string; + "Api-Username": string; + id: string; +}; + +/** @internal */ +export const BookmarkTopicRequest$outboundSchema: z.ZodType< + BookmarkTopicRequest$Outbound, + z.ZodTypeDef, + BookmarkTopicRequest +> = z + .object({ + apiKey: z.string(), + apiUsername: z.string(), + id: z.string(), + }) + .transform((v) => { + return remap$(v, { + apiKey: "Api-Key", + apiUsername: "Api-Username", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace BookmarkTopicRequest$ { + /** @deprecated use `BookmarkTopicRequest$inboundSchema` instead. */ + export const inboundSchema = BookmarkTopicRequest$inboundSchema; + /** @deprecated use `BookmarkTopicRequest$outboundSchema` instead. */ + export const outboundSchema = BookmarkTopicRequest$outboundSchema; + /** @deprecated use `BookmarkTopicRequest$Outbound` instead. */ + export type Outbound = BookmarkTopicRequest$Outbound; } diff --git a/src/sdk/models/operations/changepassword.ts b/src/sdk/models/operations/changepassword.ts index 57a9231..f774b72 100644 --- a/src/sdk/models/operations/changepassword.ts +++ b/src/sdk/models/operations/changepassword.ts @@ -1,45 +1,106 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class ChangePasswordRequestBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "password" }) +export type ChangePasswordRequestBody = { password: string; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) username: string; -} +}; -export class ChangePasswordRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=token" }) +export type ChangePasswordRequest = { + requestBody?: ChangePasswordRequestBody | undefined; token: string; +}; - @SpeakeasyMetadata({ data: "request, media_type=application/json" }) - requestBody?: ChangePasswordRequestBody; +/** @internal */ +export const ChangePasswordRequestBody$inboundSchema: z.ZodType< + ChangePasswordRequestBody, + z.ZodTypeDef, + unknown +> = z.object({ + password: z.string(), + username: z.string(), +}); + +/** @internal */ +export type ChangePasswordRequestBody$Outbound = { + password: string; + username: string; +}; + +/** @internal */ +export const ChangePasswordRequestBody$outboundSchema: z.ZodType< + ChangePasswordRequestBody$Outbound, + z.ZodTypeDef, + ChangePasswordRequestBody +> = z.object({ + password: z.string(), + username: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ChangePasswordRequestBody$ { + /** @deprecated use `ChangePasswordRequestBody$inboundSchema` instead. */ + export const inboundSchema = ChangePasswordRequestBody$inboundSchema; + /** @deprecated use `ChangePasswordRequestBody$outboundSchema` instead. */ + export const outboundSchema = ChangePasswordRequestBody$outboundSchema; + /** @deprecated use `ChangePasswordRequestBody$Outbound` instead. */ + export type Outbound = ChangePasswordRequestBody$Outbound; } -export class ChangePasswordResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const ChangePasswordRequest$inboundSchema: z.ZodType< + ChangePasswordRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + RequestBody: z.lazy(() => ChangePasswordRequestBody$inboundSchema).optional(), + token: z.string(), + }) + .transform((v) => { + return remap$(v, { + RequestBody: "requestBody", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type ChangePasswordRequest$Outbound = { + RequestBody?: ChangePasswordRequestBody$Outbound | undefined; + token: string; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const ChangePasswordRequest$outboundSchema: z.ZodType< + ChangePasswordRequest$Outbound, + z.ZodTypeDef, + ChangePasswordRequest +> = z + .object({ + requestBody: z.lazy(() => ChangePasswordRequestBody$outboundSchema).optional(), + token: z.string(), + }) + .transform((v) => { + return remap$(v, { + requestBody: "RequestBody", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ChangePasswordRequest$ { + /** @deprecated use `ChangePasswordRequest$inboundSchema` instead. */ + export const inboundSchema = ChangePasswordRequest$inboundSchema; + /** @deprecated use `ChangePasswordRequest$outboundSchema` instead. */ + export const outboundSchema = ChangePasswordRequest$outboundSchema; + /** @deprecated use `ChangePasswordRequest$Outbound` instead. */ + export type Outbound = ChangePasswordRequest$Outbound; } diff --git a/src/sdk/models/operations/completeexternalupload.ts b/src/sdk/models/operations/completeexternalupload.ts index 4f43183..3c5fd2c 100644 --- a/src/sdk/models/operations/completeexternalupload.ts +++ b/src/sdk/models/operations/completeexternalupload.ts @@ -1,124 +1,207 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class CompleteExternalUploadRequestBody extends SpeakeasyBase { +export type CompleteExternalUploadRequestBody = { /** * Optionally set this to true if the upload is for a private message. */ - @SpeakeasyMetadata() - @Expose({ name: "for_private_message" }) - forPrivateMessage?: string; - + forPrivateMessage?: string | undefined; /** * Optionally set this to true if the upload is for a site setting. */ - @SpeakeasyMetadata() - @Expose({ name: "for_site_setting" }) - forSiteSetting?: string; - + forSiteSetting?: string | undefined; /** * Optionally set this to true if the upload was pasted into the upload area. This will convert PNG files to JPEG. */ - @SpeakeasyMetadata() - @Expose({ name: "pasted" }) - pasted?: string; - + pasted?: string | undefined; /** * The unique identifier returned in the original /generate-presigned-put request. */ - @SpeakeasyMetadata() - @Expose({ name: "unique_identifier" }) uniqueIdentifier: string; -} +}; /** * external upload initialized */ -export class CompleteExternalUploadResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "dominant_color" }) - dominantColor?: string; - - @SpeakeasyMetadata() - @Expose({ name: "extension" }) +export type CompleteExternalUploadResponseBody = { + dominantColor?: string | null | undefined; extension: string; - - @SpeakeasyMetadata() - @Expose({ name: "filesize" }) filesize: number; - - @SpeakeasyMetadata() - @Expose({ name: "height" }) height: number; - - @SpeakeasyMetadata() - @Expose({ name: "human_filesize" }) humanFilesize: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "original_filename" }) originalFilename: string; - - @SpeakeasyMetadata() - @Expose({ name: "retain_hours" }) - retainHours: string; - - @SpeakeasyMetadata() - @Expose({ name: "short_path" }) + retainHours: string | null; shortPath: string; - - @SpeakeasyMetadata() - @Expose({ name: "short_url" }) shortUrl: string; - - @SpeakeasyMetadata() - @Expose({ name: "thumbnail_height" }) thumbnailHeight: number; - - @SpeakeasyMetadata() - @Expose({ name: "thumbnail_width" }) thumbnailWidth: number; - - @SpeakeasyMetadata() - @Expose({ name: "url" }) url: string; - - @SpeakeasyMetadata() - @Expose({ name: "width" }) width: number; +}; + +/** @internal */ +export const CompleteExternalUploadRequestBody$inboundSchema: z.ZodType< + CompleteExternalUploadRequestBody, + z.ZodTypeDef, + unknown +> = z + .object({ + for_private_message: z.string().optional(), + for_site_setting: z.string().optional(), + pasted: z.string().optional(), + unique_identifier: z.string(), + }) + .transform((v) => { + return remap$(v, { + for_private_message: "forPrivateMessage", + for_site_setting: "forSiteSetting", + unique_identifier: "uniqueIdentifier", + }); + }); + +/** @internal */ +export type CompleteExternalUploadRequestBody$Outbound = { + for_private_message?: string | undefined; + for_site_setting?: string | undefined; + pasted?: string | undefined; + unique_identifier: string; +}; + +/** @internal */ +export const CompleteExternalUploadRequestBody$outboundSchema: z.ZodType< + CompleteExternalUploadRequestBody$Outbound, + z.ZodTypeDef, + CompleteExternalUploadRequestBody +> = z + .object({ + forPrivateMessage: z.string().optional(), + forSiteSetting: z.string().optional(), + pasted: z.string().optional(), + uniqueIdentifier: z.string(), + }) + .transform((v) => { + return remap$(v, { + forPrivateMessage: "for_private_message", + forSiteSetting: "for_site_setting", + uniqueIdentifier: "unique_identifier", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CompleteExternalUploadRequestBody$ { + /** @deprecated use `CompleteExternalUploadRequestBody$inboundSchema` instead. */ + export const inboundSchema = CompleteExternalUploadRequestBody$inboundSchema; + /** @deprecated use `CompleteExternalUploadRequestBody$outboundSchema` instead. */ + export const outboundSchema = CompleteExternalUploadRequestBody$outboundSchema; + /** @deprecated use `CompleteExternalUploadRequestBody$Outbound` instead. */ + export type Outbound = CompleteExternalUploadRequestBody$Outbound; } -export class CompleteExternalUploadResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const CompleteExternalUploadResponseBody$inboundSchema: z.ZodType< + CompleteExternalUploadResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + dominant_color: z.nullable(z.string()).optional(), + extension: z.string(), + filesize: z.number().int(), + height: z.number().int(), + human_filesize: z.string(), + id: z.number().int(), + original_filename: z.string(), + retain_hours: z.nullable(z.string()), + short_path: z.string(), + short_url: z.string(), + thumbnail_height: z.number().int(), + thumbnail_width: z.number().int(), + url: z.string(), + width: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + dominant_color: "dominantColor", + human_filesize: "humanFilesize", + original_filename: "originalFilename", + retain_hours: "retainHours", + short_path: "shortPath", + short_url: "shortUrl", + thumbnail_height: "thumbnailHeight", + thumbnail_width: "thumbnailWidth", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type CompleteExternalUploadResponseBody$Outbound = { + dominant_color?: string | null | undefined; + extension: string; + filesize: number; + height: number; + human_filesize: string; + id: number; + original_filename: string; + retain_hours: string | null; + short_path: string; + short_url: string; + thumbnail_height: number; + thumbnail_width: number; + url: string; + width: number; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const CompleteExternalUploadResponseBody$outboundSchema: z.ZodType< + CompleteExternalUploadResponseBody$Outbound, + z.ZodTypeDef, + CompleteExternalUploadResponseBody +> = z + .object({ + dominantColor: z.nullable(z.string()).optional(), + extension: z.string(), + filesize: z.number().int(), + height: z.number().int(), + humanFilesize: z.string(), + id: z.number().int(), + originalFilename: z.string(), + retainHours: z.nullable(z.string()), + shortPath: z.string(), + shortUrl: z.string(), + thumbnailHeight: z.number().int(), + thumbnailWidth: z.number().int(), + url: z.string(), + width: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + dominantColor: "dominant_color", + humanFilesize: "human_filesize", + originalFilename: "original_filename", + retainHours: "retain_hours", + shortPath: "short_path", + shortUrl: "short_url", + thumbnailHeight: "thumbnail_height", + thumbnailWidth: "thumbnail_width", + }); + }); - /** - * external upload initialized - */ - @SpeakeasyMetadata() - object?: CompleteExternalUploadResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CompleteExternalUploadResponseBody$ { + /** @deprecated use `CompleteExternalUploadResponseBody$inboundSchema` instead. */ + export const inboundSchema = CompleteExternalUploadResponseBody$inboundSchema; + /** @deprecated use `CompleteExternalUploadResponseBody$outboundSchema` instead. */ + export const outboundSchema = CompleteExternalUploadResponseBody$outboundSchema; + /** @deprecated use `CompleteExternalUploadResponseBody$Outbound` instead. */ + export type Outbound = CompleteExternalUploadResponseBody$Outbound; } diff --git a/src/sdk/models/operations/completemultipart.ts b/src/sdk/models/operations/completemultipart.ts index 64fccea..18aeae1 100644 --- a/src/sdk/models/operations/completemultipart.ts +++ b/src/sdk/models/operations/completemultipart.ts @@ -1,110 +1,189 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class CompleteMultipartRequestBody extends SpeakeasyBase { +export type CompleteMultipartRequestBody = { /** * All of the part numbers and their corresponding ETags that have been uploaded must be provided. */ - @SpeakeasyMetadata() - @Expose({ name: "parts" }) - parts: any[]; - + parts: Array; /** * The unique identifier returned in the original /create-multipart request. */ - @SpeakeasyMetadata() - @Expose({ name: "unique_identifier" }) uniqueIdentifier: string; -} +}; /** * external upload initialized */ -export class CompleteMultipartResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "dominant_color" }) - dominantColor?: string; - - @SpeakeasyMetadata() - @Expose({ name: "extension" }) +export type CompleteMultipartResponseBody = { + dominantColor?: string | null | undefined; extension: string; - - @SpeakeasyMetadata() - @Expose({ name: "filesize" }) filesize: number; - - @SpeakeasyMetadata() - @Expose({ name: "height" }) height: number; - - @SpeakeasyMetadata() - @Expose({ name: "human_filesize" }) humanFilesize: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "original_filename" }) originalFilename: string; - - @SpeakeasyMetadata() - @Expose({ name: "retain_hours" }) - retainHours: string; - - @SpeakeasyMetadata() - @Expose({ name: "short_path" }) + retainHours: string | null; shortPath: string; - - @SpeakeasyMetadata() - @Expose({ name: "short_url" }) shortUrl: string; - - @SpeakeasyMetadata() - @Expose({ name: "thumbnail_height" }) thumbnailHeight: number; - - @SpeakeasyMetadata() - @Expose({ name: "thumbnail_width" }) thumbnailWidth: number; - - @SpeakeasyMetadata() - @Expose({ name: "url" }) url: string; - - @SpeakeasyMetadata() - @Expose({ name: "width" }) width: number; +}; + +/** @internal */ +export const CompleteMultipartRequestBody$inboundSchema: z.ZodType< + CompleteMultipartRequestBody, + z.ZodTypeDef, + unknown +> = z + .object({ + parts: z.array(z.any()), + unique_identifier: z.string(), + }) + .transform((v) => { + return remap$(v, { + unique_identifier: "uniqueIdentifier", + }); + }); + +/** @internal */ +export type CompleteMultipartRequestBody$Outbound = { + parts: Array; + unique_identifier: string; +}; + +/** @internal */ +export const CompleteMultipartRequestBody$outboundSchema: z.ZodType< + CompleteMultipartRequestBody$Outbound, + z.ZodTypeDef, + CompleteMultipartRequestBody +> = z + .object({ + parts: z.array(z.any()), + uniqueIdentifier: z.string(), + }) + .transform((v) => { + return remap$(v, { + uniqueIdentifier: "unique_identifier", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CompleteMultipartRequestBody$ { + /** @deprecated use `CompleteMultipartRequestBody$inboundSchema` instead. */ + export const inboundSchema = CompleteMultipartRequestBody$inboundSchema; + /** @deprecated use `CompleteMultipartRequestBody$outboundSchema` instead. */ + export const outboundSchema = CompleteMultipartRequestBody$outboundSchema; + /** @deprecated use `CompleteMultipartRequestBody$Outbound` instead. */ + export type Outbound = CompleteMultipartRequestBody$Outbound; } -export class CompleteMultipartResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const CompleteMultipartResponseBody$inboundSchema: z.ZodType< + CompleteMultipartResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + dominant_color: z.nullable(z.string()).optional(), + extension: z.string(), + filesize: z.number().int(), + height: z.number().int(), + human_filesize: z.string(), + id: z.number().int(), + original_filename: z.string(), + retain_hours: z.nullable(z.string()), + short_path: z.string(), + short_url: z.string(), + thumbnail_height: z.number().int(), + thumbnail_width: z.number().int(), + url: z.string(), + width: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + dominant_color: "dominantColor", + human_filesize: "humanFilesize", + original_filename: "originalFilename", + retain_hours: "retainHours", + short_path: "shortPath", + short_url: "shortUrl", + thumbnail_height: "thumbnailHeight", + thumbnail_width: "thumbnailWidth", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type CompleteMultipartResponseBody$Outbound = { + dominant_color?: string | null | undefined; + extension: string; + filesize: number; + height: number; + human_filesize: string; + id: number; + original_filename: string; + retain_hours: string | null; + short_path: string; + short_url: string; + thumbnail_height: number; + thumbnail_width: number; + url: string; + width: number; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const CompleteMultipartResponseBody$outboundSchema: z.ZodType< + CompleteMultipartResponseBody$Outbound, + z.ZodTypeDef, + CompleteMultipartResponseBody +> = z + .object({ + dominantColor: z.nullable(z.string()).optional(), + extension: z.string(), + filesize: z.number().int(), + height: z.number().int(), + humanFilesize: z.string(), + id: z.number().int(), + originalFilename: z.string(), + retainHours: z.nullable(z.string()), + shortPath: z.string(), + shortUrl: z.string(), + thumbnailHeight: z.number().int(), + thumbnailWidth: z.number().int(), + url: z.string(), + width: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + dominantColor: "dominant_color", + humanFilesize: "human_filesize", + originalFilename: "original_filename", + retainHours: "retain_hours", + shortPath: "short_path", + shortUrl: "short_url", + thumbnailHeight: "thumbnail_height", + thumbnailWidth: "thumbnail_width", + }); + }); - /** - * external upload initialized - */ - @SpeakeasyMetadata() - object?: CompleteMultipartResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CompleteMultipartResponseBody$ { + /** @deprecated use `CompleteMultipartResponseBody$inboundSchema` instead. */ + export const inboundSchema = CompleteMultipartResponseBody$inboundSchema; + /** @deprecated use `CompleteMultipartResponseBody$outboundSchema` instead. */ + export const outboundSchema = CompleteMultipartResponseBody$outboundSchema; + /** @deprecated use `CompleteMultipartResponseBody$Outbound` instead. */ + export type Outbound = CompleteMultipartResponseBody$Outbound; } diff --git a/src/sdk/models/operations/createbackup.ts b/src/sdk/models/operations/createbackup.ts index 0a354e0..cc5a12b 100644 --- a/src/sdk/models/operations/createbackup.ts +++ b/src/sdk/models/operations/createbackup.ts @@ -1,48 +1,101 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class CreateBackupRequestBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "with_uploads" }) +export type CreateBackupRequestBody = { withUploads: boolean; -} +}; /** * success response */ -export class CreateBackupResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "success" }) +export type CreateBackupResponseBody = { success: string; +}; + +/** @internal */ +export const CreateBackupRequestBody$inboundSchema: z.ZodType< + CreateBackupRequestBody, + z.ZodTypeDef, + unknown +> = z + .object({ + with_uploads: z.boolean(), + }) + .transform((v) => { + return remap$(v, { + with_uploads: "withUploads", + }); + }); + +/** @internal */ +export type CreateBackupRequestBody$Outbound = { + with_uploads: boolean; +}; + +/** @internal */ +export const CreateBackupRequestBody$outboundSchema: z.ZodType< + CreateBackupRequestBody$Outbound, + z.ZodTypeDef, + CreateBackupRequestBody +> = z + .object({ + withUploads: z.boolean(), + }) + .transform((v) => { + return remap$(v, { + withUploads: "with_uploads", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateBackupRequestBody$ { + /** @deprecated use `CreateBackupRequestBody$inboundSchema` instead. */ + export const inboundSchema = CreateBackupRequestBody$inboundSchema; + /** @deprecated use `CreateBackupRequestBody$outboundSchema` instead. */ + export const outboundSchema = CreateBackupRequestBody$outboundSchema; + /** @deprecated use `CreateBackupRequestBody$Outbound` instead. */ + export type Outbound = CreateBackupRequestBody$Outbound; } -export class CreateBackupResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const CreateBackupResponseBody$inboundSchema: z.ZodType< + CreateBackupResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + success: z.string(), +}); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type CreateBackupResponseBody$Outbound = { + success: string; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const CreateBackupResponseBody$outboundSchema: z.ZodType< + CreateBackupResponseBody$Outbound, + z.ZodTypeDef, + CreateBackupResponseBody +> = z.object({ + success: z.string(), +}); - /** - * success response - */ - @SpeakeasyMetadata() - object?: CreateBackupResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateBackupResponseBody$ { + /** @deprecated use `CreateBackupResponseBody$inboundSchema` instead. */ + export const inboundSchema = CreateBackupResponseBody$inboundSchema; + /** @deprecated use `CreateBackupResponseBody$outboundSchema` instead. */ + export const outboundSchema = CreateBackupResponseBody$outboundSchema; + /** @deprecated use `CreateBackupResponseBody$Outbound` instead. */ + export type Outbound = CreateBackupResponseBody$Outbound; } diff --git a/src/sdk/models/operations/createbadge.ts b/src/sdk/models/operations/createbadge.ts index d0bf383..d9b3344 100644 --- a/src/sdk/models/operations/createbadge.ts +++ b/src/sdk/models/operations/createbadge.ts @@ -1,164 +1,331 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class CreateBadgeRequestBody extends SpeakeasyBase { +export type CreateBadgeRequestBody = { /** * The ID for the badge type. 1 for Gold, 2 for Silver, 3 for Bronze. */ - @SpeakeasyMetadata() - @Expose({ name: "badge_type_id" }) badgeTypeId: number; - /** * The name for the new badge. */ - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; -} +}; -export class Badge extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "allow_title" }) +export type Badge = { allowTitle: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "auto_revoke" }) autoRevoke: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "badge_grouping_id" }) badgeGroupingId: number; - - @SpeakeasyMetadata() - @Expose({ name: "badge_type_id" }) badgeTypeId: number; - - @SpeakeasyMetadata() - @Expose({ name: "description" }) description: string; - - @SpeakeasyMetadata() - @Expose({ name: "enabled" }) enabled: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "grant_count" }) grantCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "icon" }) icon: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "image_url" }) - imageUrl: string; - - @SpeakeasyMetadata() - @Expose({ name: "listable" }) + imageUrl: string | null; listable: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "long_description" }) longDescription: string; - - @SpeakeasyMetadata() - @Expose({ name: "manually_grantable" }) manuallyGrantable: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "multiple_grant" }) multipleGrant: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "query" }) - query: string; - - @SpeakeasyMetadata() - @Expose({ name: "show_posts" }) + query: string | null; showPosts: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "slug" }) slug: string; - - @SpeakeasyMetadata() - @Expose({ name: "system" }) system: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "target_posts" }) targetPosts: boolean; + trigger: string | null; +}; - @SpeakeasyMetadata() - @Expose({ name: "trigger" }) - trigger: string; -} - -export class CreateBadgeBadgeTypes extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "id" }) +export type CreateBadgeBadgeTypes = { id: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "sort_order" }) sortOrder: number; -} +}; /** * success response */ -export class CreateBadgeResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "badge" }) - @Type(() => Badge) +export type CreateBadgeResponseBody = { badge: Badge; + badgeTypes: Array; +}; - @SpeakeasyMetadata({ elemType: CreateBadgeBadgeTypes }) - @Expose({ name: "badge_types" }) - @Type(() => CreateBadgeBadgeTypes) - badgeTypes: CreateBadgeBadgeTypes[]; +/** @internal */ +export const CreateBadgeRequestBody$inboundSchema: z.ZodType< + CreateBadgeRequestBody, + z.ZodTypeDef, + unknown +> = z + .object({ + badge_type_id: z.number().int(), + name: z.string(), + }) + .transform((v) => { + return remap$(v, { + badge_type_id: "badgeTypeId", + }); + }); + +/** @internal */ +export type CreateBadgeRequestBody$Outbound = { + badge_type_id: number; + name: string; +}; + +/** @internal */ +export const CreateBadgeRequestBody$outboundSchema: z.ZodType< + CreateBadgeRequestBody$Outbound, + z.ZodTypeDef, + CreateBadgeRequestBody +> = z + .object({ + badgeTypeId: z.number().int(), + name: z.string(), + }) + .transform((v) => { + return remap$(v, { + badgeTypeId: "badge_type_id", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateBadgeRequestBody$ { + /** @deprecated use `CreateBadgeRequestBody$inboundSchema` instead. */ + export const inboundSchema = CreateBadgeRequestBody$inboundSchema; + /** @deprecated use `CreateBadgeRequestBody$outboundSchema` instead. */ + export const outboundSchema = CreateBadgeRequestBody$outboundSchema; + /** @deprecated use `CreateBadgeRequestBody$Outbound` instead. */ + export type Outbound = CreateBadgeRequestBody$Outbound; } -export class CreateBadgeResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const Badge$inboundSchema: z.ZodType = z + .object({ + allow_title: z.boolean(), + auto_revoke: z.boolean(), + badge_grouping_id: z.number().int(), + badge_type_id: z.number().int(), + description: z.string(), + enabled: z.boolean(), + grant_count: z.number().int(), + icon: z.string(), + id: z.number().int(), + image_url: z.nullable(z.string()), + listable: z.boolean(), + long_description: z.string(), + manually_grantable: z.boolean(), + multiple_grant: z.boolean(), + name: z.string(), + query: z.nullable(z.string()), + show_posts: z.boolean(), + slug: z.string(), + system: z.boolean(), + target_posts: z.boolean(), + trigger: z.nullable(z.string()), + }) + .transform((v) => { + return remap$(v, { + allow_title: "allowTitle", + auto_revoke: "autoRevoke", + badge_grouping_id: "badgeGroupingId", + badge_type_id: "badgeTypeId", + grant_count: "grantCount", + image_url: "imageUrl", + long_description: "longDescription", + manually_grantable: "manuallyGrantable", + multiple_grant: "multipleGrant", + show_posts: "showPosts", + target_posts: "targetPosts", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type Badge$Outbound = { + allow_title: boolean; + auto_revoke: boolean; + badge_grouping_id: number; + badge_type_id: number; + description: string; + enabled: boolean; + grant_count: number; + icon: string; + id: number; + image_url: string | null; + listable: boolean; + long_description: string; + manually_grantable: boolean; + multiple_grant: boolean; + name: string; + query: string | null; + show_posts: boolean; + slug: string; + system: boolean; + target_posts: boolean; + trigger: string | null; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const Badge$outboundSchema: z.ZodType = z + .object({ + allowTitle: z.boolean(), + autoRevoke: z.boolean(), + badgeGroupingId: z.number().int(), + badgeTypeId: z.number().int(), + description: z.string(), + enabled: z.boolean(), + grantCount: z.number().int(), + icon: z.string(), + id: z.number().int(), + imageUrl: z.nullable(z.string()), + listable: z.boolean(), + longDescription: z.string(), + manuallyGrantable: z.boolean(), + multipleGrant: z.boolean(), + name: z.string(), + query: z.nullable(z.string()), + showPosts: z.boolean(), + slug: z.string(), + system: z.boolean(), + targetPosts: z.boolean(), + trigger: z.nullable(z.string()), + }) + .transform((v) => { + return remap$(v, { + allowTitle: "allow_title", + autoRevoke: "auto_revoke", + badgeGroupingId: "badge_grouping_id", + badgeTypeId: "badge_type_id", + grantCount: "grant_count", + imageUrl: "image_url", + longDescription: "long_description", + manuallyGrantable: "manually_grantable", + multipleGrant: "multiple_grant", + showPosts: "show_posts", + targetPosts: "target_posts", + }); + }); - /** - * success response - */ - @SpeakeasyMetadata() - object?: CreateBadgeResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Badge$ { + /** @deprecated use `Badge$inboundSchema` instead. */ + export const inboundSchema = Badge$inboundSchema; + /** @deprecated use `Badge$outboundSchema` instead. */ + export const outboundSchema = Badge$outboundSchema; + /** @deprecated use `Badge$Outbound` instead. */ + export type Outbound = Badge$Outbound; +} + +/** @internal */ +export const CreateBadgeBadgeTypes$inboundSchema: z.ZodType< + CreateBadgeBadgeTypes, + z.ZodTypeDef, + unknown +> = z + .object({ + id: z.number().int(), + name: z.string(), + sort_order: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + sort_order: "sortOrder", + }); + }); + +/** @internal */ +export type CreateBadgeBadgeTypes$Outbound = { + id: number; + name: string; + sort_order: number; +}; + +/** @internal */ +export const CreateBadgeBadgeTypes$outboundSchema: z.ZodType< + CreateBadgeBadgeTypes$Outbound, + z.ZodTypeDef, + CreateBadgeBadgeTypes +> = z + .object({ + id: z.number().int(), + name: z.string(), + sortOrder: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + sortOrder: "sort_order", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateBadgeBadgeTypes$ { + /** @deprecated use `CreateBadgeBadgeTypes$inboundSchema` instead. */ + export const inboundSchema = CreateBadgeBadgeTypes$inboundSchema; + /** @deprecated use `CreateBadgeBadgeTypes$outboundSchema` instead. */ + export const outboundSchema = CreateBadgeBadgeTypes$outboundSchema; + /** @deprecated use `CreateBadgeBadgeTypes$Outbound` instead. */ + export type Outbound = CreateBadgeBadgeTypes$Outbound; +} + +/** @internal */ +export const CreateBadgeResponseBody$inboundSchema: z.ZodType< + CreateBadgeResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + badge: z.lazy(() => Badge$inboundSchema), + badge_types: z.array(z.lazy(() => CreateBadgeBadgeTypes$inboundSchema)), + }) + .transform((v) => { + return remap$(v, { + badge_types: "badgeTypes", + }); + }); + +/** @internal */ +export type CreateBadgeResponseBody$Outbound = { + badge: Badge$Outbound; + badge_types: Array; +}; + +/** @internal */ +export const CreateBadgeResponseBody$outboundSchema: z.ZodType< + CreateBadgeResponseBody$Outbound, + z.ZodTypeDef, + CreateBadgeResponseBody +> = z + .object({ + badge: z.lazy(() => Badge$outboundSchema), + badgeTypes: z.array(z.lazy(() => CreateBadgeBadgeTypes$outboundSchema)), + }) + .transform((v) => { + return remap$(v, { + badgeTypes: "badge_types", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateBadgeResponseBody$ { + /** @deprecated use `CreateBadgeResponseBody$inboundSchema` instead. */ + export const inboundSchema = CreateBadgeResponseBody$inboundSchema; + /** @deprecated use `CreateBadgeResponseBody$outboundSchema` instead. */ + export const outboundSchema = CreateBadgeResponseBody$outboundSchema; + /** @deprecated use `CreateBadgeResponseBody$Outbound` instead. */ + export type Outbound = CreateBadgeResponseBody$Outbound; } diff --git a/src/sdk/models/operations/createcategory.ts b/src/sdk/models/operations/createcategory.ts index d619f03..b14b7ff 100644 --- a/src/sdk/models/operations/createcategory.ts +++ b/src/sdk/models/operations/createcategory.ts @@ -1,328 +1,692 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import { collectExtraKeys as collectExtraKeys$ } from "../../../lib/schemas.js"; +import * as z from "zod"; -export class CreateCategoryRequestBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "allow_badges" }) - allowBadges?: boolean; +export type Permissions = { + everyone?: number | undefined; + staff?: number | undefined; + additionalProperties: { [k: string]: any }; +}; - @SpeakeasyMetadata() - @Expose({ name: "color" }) - color?: string; - - @SpeakeasyMetadata() - @Expose({ name: "form_template_ids" }) - formTemplateIds?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) +export type CreateCategoryRequestBody = { + allowBadges?: boolean | undefined; + color?: string | undefined; + formTemplateIds?: Array | undefined; name: string; + parentCategoryId?: number | undefined; + permissions?: Permissions | undefined; + searchPriority?: number | undefined; + slug?: string | undefined; + textColor?: string | undefined; + topicFeaturedLinksAllowed?: boolean | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "parent_category_id" }) - parentCategoryId?: number; +export type CustomFields = {}; - @SpeakeasyMetadata() - @Expose({ name: "permissions" }) - permissions?: Record; - - @SpeakeasyMetadata() - @Expose({ name: "search_priority" }) - searchPriority?: number; - - @SpeakeasyMetadata() - @Expose({ name: "slug" }) - slug?: string; - - @SpeakeasyMetadata() - @Expose({ name: "text_color" }) - textColor?: string; - - @SpeakeasyMetadata() - @Expose({ name: "topic_featured_links_allowed" }) - topicFeaturedLinksAllowed?: boolean; -} - -export class CustomFields extends SpeakeasyBase {} - -export class GroupPermissions extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "group_name" }) +export type GroupPermissions = { groupName: string; - - @SpeakeasyMetadata() - @Expose({ name: "permission_type" }) permissionType: number; -} +}; -export class RequiredTagGroups extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "min_count" }) +export type RequiredTagGroups = { minCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; -} +}; -export class Category extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "all_topics_wiki" }) +export type Category = { allTopicsWiki: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "allow_badges" }) allowBadges: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "allow_global_tags" }) - allowGlobalTags?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "allow_unlimited_owner_edits_on_first_post" }) + allowGlobalTags?: boolean | undefined; allowUnlimitedOwnerEditsOnFirstPost: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "allowed_tag_groups" }) - allowedTagGroups?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "allowed_tags" }) - allowedTags?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "auto_close_based_on_last_post" }) + allowedTagGroups?: Array | undefined; + allowedTags?: Array | undefined; autoCloseBasedOnLastPost: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "auto_close_hours" }) - autoCloseHours: string; - - @SpeakeasyMetadata() - @Expose({ name: "available_groups" }) - availableGroups: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "can_delete" }) + autoCloseHours: string | null; + availableGroups: Array; canDelete: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_edit" }) canEdit: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "category_setting" }) - categorySetting?: any; - - @SpeakeasyMetadata() - @Expose({ name: "color" }) + categorySetting?: any | undefined; color: string; - - @SpeakeasyMetadata() - @Expose({ name: "custom_fields" }) - @Type(() => CustomFields) customFields: CustomFields; - - @SpeakeasyMetadata() - @Expose({ name: "default_list_filter" }) defaultListFilter: string; - - @SpeakeasyMetadata() - @Expose({ name: "default_slow_mode_seconds" }) - defaultSlowModeSeconds: string; - - @SpeakeasyMetadata() - @Expose({ name: "default_top_period" }) + defaultSlowModeSeconds: string | null; defaultTopPeriod: string; - - @SpeakeasyMetadata() - @Expose({ name: "default_view" }) - defaultView: string; - - @SpeakeasyMetadata() - @Expose({ name: "description" }) - description: string; - - @SpeakeasyMetadata() - @Expose({ name: "description_excerpt" }) - descriptionExcerpt: string; - - @SpeakeasyMetadata() - @Expose({ name: "description_text" }) - descriptionText: string; - - @SpeakeasyMetadata() - @Expose({ name: "email_in" }) - emailIn: string; - - @SpeakeasyMetadata() - @Expose({ name: "email_in_allow_strangers" }) + defaultView: string | null; + description: string | null; + descriptionExcerpt: string | null; + descriptionText: string | null; + emailIn: string | null; emailInAllowStrangers: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "form_template_ids" }) - formTemplateIds?: any[]; - - @SpeakeasyMetadata({ elemType: GroupPermissions }) - @Expose({ name: "group_permissions" }) - @Type(() => GroupPermissions) - groupPermissions: GroupPermissions[]; - - @SpeakeasyMetadata() - @Expose({ name: "has_children" }) - hasChildren: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) + formTemplateIds?: Array | undefined; + groupPermissions: Array; + hasChildren: boolean | null; id: number; - - @SpeakeasyMetadata() - @Expose({ name: "mailinglist_mirror" }) mailinglistMirror: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "minimum_required_tags" }) minimumRequiredTags: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "navigate_to_first_post_after_read" }) navigateToFirstPostAfterRead: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "notification_level" }) notificationLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "num_featured_topics" }) numFeaturedTopics: number; - - @SpeakeasyMetadata() - @Expose({ name: "permission" }) - permission: number; - - @SpeakeasyMetadata() - @Expose({ name: "position" }) + permission: number | null; position: number; - - @SpeakeasyMetadata() - @Expose({ name: "post_count" }) postCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "read_only_banner" }) - readOnlyBanner: string; - - @SpeakeasyMetadata() - @Expose({ name: "read_restricted" }) + readOnlyBanner: string | null; readRestricted: boolean; - - @SpeakeasyMetadata({ elemType: RequiredTagGroups }) - @Expose({ name: "required_tag_groups" }) - @Type(() => RequiredTagGroups) - requiredTagGroups: RequiredTagGroups[]; - - @SpeakeasyMetadata() - @Expose({ name: "search_priority" }) + requiredTagGroups: Array; searchPriority: number; - - @SpeakeasyMetadata() - @Expose({ name: "show_subcategory_list" }) showSubcategoryList: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "slug" }) slug: string; - - @SpeakeasyMetadata() - @Expose({ name: "sort_ascending" }) - sortAscending: string; - - @SpeakeasyMetadata() - @Expose({ name: "sort_order" }) - sortOrder: string; - - @SpeakeasyMetadata() - @Expose({ name: "subcategory_list_style" }) + sortAscending: string | null; + sortOrder: string | null; subcategoryListStyle: string; - - @SpeakeasyMetadata() - @Expose({ name: "text_color" }) textColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "topic_count" }) topicCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "topic_featured_link_allowed" }) topicFeaturedLinkAllowed: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "topic_template" }) - topicTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "topic_url" }) - topicUrl: string; - - @SpeakeasyMetadata() - @Expose({ name: "uploaded_background" }) - uploadedBackground: string; - - @SpeakeasyMetadata() - @Expose({ name: "uploaded_background_dark" }) - uploadedBackgroundDark: string; - - @SpeakeasyMetadata() - @Expose({ name: "uploaded_logo" }) - uploadedLogo: string; - - @SpeakeasyMetadata() - @Expose({ name: "uploaded_logo_dark" }) - uploadedLogoDark: string; -} + topicTemplate: string | null; + topicUrl: string | null; + uploadedBackground: string | null; + uploadedBackgroundDark: string | null; + uploadedLogo: string | null; + uploadedLogoDark: string | null; +}; /** * success response */ -export class CreateCategoryResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "category" }) - @Type(() => Category) +export type CreateCategoryResponseBody = { category: Category; +}; + +/** @internal */ +export const Permissions$inboundSchema: z.ZodType = + collectExtraKeys$( + z + .object({ + everyone: z.number().int().optional(), + staff: z.number().int().optional(), + }) + .catchall(z.any()), + "additionalProperties" + ); + +/** @internal */ +export type Permissions$Outbound = { + everyone?: number | undefined; + staff?: number | undefined; + [additionalProperties: string]: unknown; +}; + +/** @internal */ +export const Permissions$outboundSchema: z.ZodType< + Permissions$Outbound, + z.ZodTypeDef, + Permissions +> = z + .object({ + additionalProperties: z.record(z.any()), + + everyone: z.number().int().optional(), + staff: z.number().int().optional(), + }) + .transform((v) => { + return { + ...v.additionalProperties, + ...remap$(v, { + additionalProperties: null, + }), + }; + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Permissions$ { + /** @deprecated use `Permissions$inboundSchema` instead. */ + export const inboundSchema = Permissions$inboundSchema; + /** @deprecated use `Permissions$outboundSchema` instead. */ + export const outboundSchema = Permissions$outboundSchema; + /** @deprecated use `Permissions$Outbound` instead. */ + export type Outbound = Permissions$Outbound; } -export class CreateCategoryResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const CreateCategoryRequestBody$inboundSchema: z.ZodType< + CreateCategoryRequestBody, + z.ZodTypeDef, + unknown +> = z + .object({ + allow_badges: z.boolean().optional(), + color: z.string().optional(), + form_template_ids: z.array(z.any()).optional(), + name: z.string(), + parent_category_id: z.number().int().optional(), + permissions: z.lazy(() => Permissions$inboundSchema).optional(), + search_priority: z.number().int().optional(), + slug: z.string().optional(), + text_color: z.string().optional(), + topic_featured_links_allowed: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + allow_badges: "allowBadges", + form_template_ids: "formTemplateIds", + parent_category_id: "parentCategoryId", + search_priority: "searchPriority", + text_color: "textColor", + topic_featured_links_allowed: "topicFeaturedLinksAllowed", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type CreateCategoryRequestBody$Outbound = { + allow_badges?: boolean | undefined; + color?: string | undefined; + form_template_ids?: Array | undefined; + name: string; + parent_category_id?: number | undefined; + permissions?: Permissions$Outbound | undefined; + search_priority?: number | undefined; + slug?: string | undefined; + text_color?: string | undefined; + topic_featured_links_allowed?: boolean | undefined; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const CreateCategoryRequestBody$outboundSchema: z.ZodType< + CreateCategoryRequestBody$Outbound, + z.ZodTypeDef, + CreateCategoryRequestBody +> = z + .object({ + allowBadges: z.boolean().optional(), + color: z.string().optional(), + formTemplateIds: z.array(z.any()).optional(), + name: z.string(), + parentCategoryId: z.number().int().optional(), + permissions: z.lazy(() => Permissions$outboundSchema).optional(), + searchPriority: z.number().int().optional(), + slug: z.string().optional(), + textColor: z.string().optional(), + topicFeaturedLinksAllowed: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + allowBadges: "allow_badges", + formTemplateIds: "form_template_ids", + parentCategoryId: "parent_category_id", + searchPriority: "search_priority", + textColor: "text_color", + topicFeaturedLinksAllowed: "topic_featured_links_allowed", + }); + }); - /** - * success response - */ - @SpeakeasyMetadata() - object?: CreateCategoryResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateCategoryRequestBody$ { + /** @deprecated use `CreateCategoryRequestBody$inboundSchema` instead. */ + export const inboundSchema = CreateCategoryRequestBody$inboundSchema; + /** @deprecated use `CreateCategoryRequestBody$outboundSchema` instead. */ + export const outboundSchema = CreateCategoryRequestBody$outboundSchema; + /** @deprecated use `CreateCategoryRequestBody$Outbound` instead. */ + export type Outbound = CreateCategoryRequestBody$Outbound; +} + +/** @internal */ +export const CustomFields$inboundSchema: z.ZodType = z.object( + {} +); + +/** @internal */ +export type CustomFields$Outbound = {}; + +/** @internal */ +export const CustomFields$outboundSchema: z.ZodType< + CustomFields$Outbound, + z.ZodTypeDef, + CustomFields +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CustomFields$ { + /** @deprecated use `CustomFields$inboundSchema` instead. */ + export const inboundSchema = CustomFields$inboundSchema; + /** @deprecated use `CustomFields$outboundSchema` instead. */ + export const outboundSchema = CustomFields$outboundSchema; + /** @deprecated use `CustomFields$Outbound` instead. */ + export type Outbound = CustomFields$Outbound; +} + +/** @internal */ +export const GroupPermissions$inboundSchema: z.ZodType = z + .object({ + group_name: z.string(), + permission_type: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + group_name: "groupName", + permission_type: "permissionType", + }); + }); + +/** @internal */ +export type GroupPermissions$Outbound = { + group_name: string; + permission_type: number; +}; + +/** @internal */ +export const GroupPermissions$outboundSchema: z.ZodType< + GroupPermissions$Outbound, + z.ZodTypeDef, + GroupPermissions +> = z + .object({ + groupName: z.string(), + permissionType: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + groupName: "group_name", + permissionType: "permission_type", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GroupPermissions$ { + /** @deprecated use `GroupPermissions$inboundSchema` instead. */ + export const inboundSchema = GroupPermissions$inboundSchema; + /** @deprecated use `GroupPermissions$outboundSchema` instead. */ + export const outboundSchema = GroupPermissions$outboundSchema; + /** @deprecated use `GroupPermissions$Outbound` instead. */ + export type Outbound = GroupPermissions$Outbound; +} + +/** @internal */ +export const RequiredTagGroups$inboundSchema: z.ZodType = + z + .object({ + min_count: z.number().int(), + name: z.string(), + }) + .transform((v) => { + return remap$(v, { + min_count: "minCount", + }); + }); + +/** @internal */ +export type RequiredTagGroups$Outbound = { + min_count: number; + name: string; +}; + +/** @internal */ +export const RequiredTagGroups$outboundSchema: z.ZodType< + RequiredTagGroups$Outbound, + z.ZodTypeDef, + RequiredTagGroups +> = z + .object({ + minCount: z.number().int(), + name: z.string(), + }) + .transform((v) => { + return remap$(v, { + minCount: "min_count", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace RequiredTagGroups$ { + /** @deprecated use `RequiredTagGroups$inboundSchema` instead. */ + export const inboundSchema = RequiredTagGroups$inboundSchema; + /** @deprecated use `RequiredTagGroups$outboundSchema` instead. */ + export const outboundSchema = RequiredTagGroups$outboundSchema; + /** @deprecated use `RequiredTagGroups$Outbound` instead. */ + export type Outbound = RequiredTagGroups$Outbound; +} + +/** @internal */ +export const Category$inboundSchema: z.ZodType = z + .object({ + all_topics_wiki: z.boolean(), + allow_badges: z.boolean(), + allow_global_tags: z.boolean().optional(), + allow_unlimited_owner_edits_on_first_post: z.boolean(), + allowed_tag_groups: z.array(z.any()).optional(), + allowed_tags: z.array(z.any()).optional(), + auto_close_based_on_last_post: z.boolean(), + auto_close_hours: z.nullable(z.string()), + available_groups: z.array(z.any()), + can_delete: z.boolean(), + can_edit: z.boolean(), + category_setting: z.any().optional(), + color: z.string(), + custom_fields: z.lazy(() => CustomFields$inboundSchema), + default_list_filter: z.string(), + default_slow_mode_seconds: z.nullable(z.string()), + default_top_period: z.string(), + default_view: z.nullable(z.string()), + description: z.nullable(z.string()), + description_excerpt: z.nullable(z.string()), + description_text: z.nullable(z.string()), + email_in: z.nullable(z.string()), + email_in_allow_strangers: z.boolean(), + form_template_ids: z.array(z.any()).optional(), + group_permissions: z.array(z.lazy(() => GroupPermissions$inboundSchema)), + has_children: z.nullable(z.boolean()), + id: z.number().int(), + mailinglist_mirror: z.boolean(), + minimum_required_tags: z.number().int(), + name: z.string(), + navigate_to_first_post_after_read: z.boolean(), + notification_level: z.number().int(), + num_featured_topics: z.number().int(), + permission: z.nullable(z.number().int()), + position: z.number().int(), + post_count: z.number().int(), + read_only_banner: z.nullable(z.string()), + read_restricted: z.boolean(), + required_tag_groups: z.array(z.lazy(() => RequiredTagGroups$inboundSchema)), + search_priority: z.number().int(), + show_subcategory_list: z.boolean(), + slug: z.string(), + sort_ascending: z.nullable(z.string()), + sort_order: z.nullable(z.string()), + subcategory_list_style: z.string(), + text_color: z.string(), + topic_count: z.number().int(), + topic_featured_link_allowed: z.boolean(), + topic_template: z.nullable(z.string()), + topic_url: z.nullable(z.string()), + uploaded_background: z.nullable(z.string()), + uploaded_background_dark: z.nullable(z.string()), + uploaded_logo: z.nullable(z.string()), + uploaded_logo_dark: z.nullable(z.string()), + }) + .transform((v) => { + return remap$(v, { + all_topics_wiki: "allTopicsWiki", + allow_badges: "allowBadges", + allow_global_tags: "allowGlobalTags", + allow_unlimited_owner_edits_on_first_post: "allowUnlimitedOwnerEditsOnFirstPost", + allowed_tag_groups: "allowedTagGroups", + allowed_tags: "allowedTags", + auto_close_based_on_last_post: "autoCloseBasedOnLastPost", + auto_close_hours: "autoCloseHours", + available_groups: "availableGroups", + can_delete: "canDelete", + can_edit: "canEdit", + category_setting: "categorySetting", + custom_fields: "customFields", + default_list_filter: "defaultListFilter", + default_slow_mode_seconds: "defaultSlowModeSeconds", + default_top_period: "defaultTopPeriod", + default_view: "defaultView", + description_excerpt: "descriptionExcerpt", + description_text: "descriptionText", + email_in: "emailIn", + email_in_allow_strangers: "emailInAllowStrangers", + form_template_ids: "formTemplateIds", + group_permissions: "groupPermissions", + has_children: "hasChildren", + mailinglist_mirror: "mailinglistMirror", + minimum_required_tags: "minimumRequiredTags", + navigate_to_first_post_after_read: "navigateToFirstPostAfterRead", + notification_level: "notificationLevel", + num_featured_topics: "numFeaturedTopics", + post_count: "postCount", + read_only_banner: "readOnlyBanner", + read_restricted: "readRestricted", + required_tag_groups: "requiredTagGroups", + search_priority: "searchPriority", + show_subcategory_list: "showSubcategoryList", + sort_ascending: "sortAscending", + sort_order: "sortOrder", + subcategory_list_style: "subcategoryListStyle", + text_color: "textColor", + topic_count: "topicCount", + topic_featured_link_allowed: "topicFeaturedLinkAllowed", + topic_template: "topicTemplate", + topic_url: "topicUrl", + uploaded_background: "uploadedBackground", + uploaded_background_dark: "uploadedBackgroundDark", + uploaded_logo: "uploadedLogo", + uploaded_logo_dark: "uploadedLogoDark", + }); + }); + +/** @internal */ +export type Category$Outbound = { + all_topics_wiki: boolean; + allow_badges: boolean; + allow_global_tags?: boolean | undefined; + allow_unlimited_owner_edits_on_first_post: boolean; + allowed_tag_groups?: Array | undefined; + allowed_tags?: Array | undefined; + auto_close_based_on_last_post: boolean; + auto_close_hours: string | null; + available_groups: Array; + can_delete: boolean; + can_edit: boolean; + category_setting?: any | undefined; + color: string; + custom_fields: CustomFields$Outbound; + default_list_filter: string; + default_slow_mode_seconds: string | null; + default_top_period: string; + default_view: string | null; + description: string | null; + description_excerpt: string | null; + description_text: string | null; + email_in: string | null; + email_in_allow_strangers: boolean; + form_template_ids?: Array | undefined; + group_permissions: Array; + has_children: boolean | null; + id: number; + mailinglist_mirror: boolean; + minimum_required_tags: number; + name: string; + navigate_to_first_post_after_read: boolean; + notification_level: number; + num_featured_topics: number; + permission: number | null; + position: number; + post_count: number; + read_only_banner: string | null; + read_restricted: boolean; + required_tag_groups: Array; + search_priority: number; + show_subcategory_list: boolean; + slug: string; + sort_ascending: string | null; + sort_order: string | null; + subcategory_list_style: string; + text_color: string; + topic_count: number; + topic_featured_link_allowed: boolean; + topic_template: string | null; + topic_url: string | null; + uploaded_background: string | null; + uploaded_background_dark: string | null; + uploaded_logo: string | null; + uploaded_logo_dark: string | null; +}; + +/** @internal */ +export const Category$outboundSchema: z.ZodType = z + .object({ + allTopicsWiki: z.boolean(), + allowBadges: z.boolean(), + allowGlobalTags: z.boolean().optional(), + allowUnlimitedOwnerEditsOnFirstPost: z.boolean(), + allowedTagGroups: z.array(z.any()).optional(), + allowedTags: z.array(z.any()).optional(), + autoCloseBasedOnLastPost: z.boolean(), + autoCloseHours: z.nullable(z.string()), + availableGroups: z.array(z.any()), + canDelete: z.boolean(), + canEdit: z.boolean(), + categorySetting: z.any().optional(), + color: z.string(), + customFields: z.lazy(() => CustomFields$outboundSchema), + defaultListFilter: z.string(), + defaultSlowModeSeconds: z.nullable(z.string()), + defaultTopPeriod: z.string(), + defaultView: z.nullable(z.string()), + description: z.nullable(z.string()), + descriptionExcerpt: z.nullable(z.string()), + descriptionText: z.nullable(z.string()), + emailIn: z.nullable(z.string()), + emailInAllowStrangers: z.boolean(), + formTemplateIds: z.array(z.any()).optional(), + groupPermissions: z.array(z.lazy(() => GroupPermissions$outboundSchema)), + hasChildren: z.nullable(z.boolean()), + id: z.number().int(), + mailinglistMirror: z.boolean(), + minimumRequiredTags: z.number().int(), + name: z.string(), + navigateToFirstPostAfterRead: z.boolean(), + notificationLevel: z.number().int(), + numFeaturedTopics: z.number().int(), + permission: z.nullable(z.number().int()), + position: z.number().int(), + postCount: z.number().int(), + readOnlyBanner: z.nullable(z.string()), + readRestricted: z.boolean(), + requiredTagGroups: z.array(z.lazy(() => RequiredTagGroups$outboundSchema)), + searchPriority: z.number().int(), + showSubcategoryList: z.boolean(), + slug: z.string(), + sortAscending: z.nullable(z.string()), + sortOrder: z.nullable(z.string()), + subcategoryListStyle: z.string(), + textColor: z.string(), + topicCount: z.number().int(), + topicFeaturedLinkAllowed: z.boolean(), + topicTemplate: z.nullable(z.string()), + topicUrl: z.nullable(z.string()), + uploadedBackground: z.nullable(z.string()), + uploadedBackgroundDark: z.nullable(z.string()), + uploadedLogo: z.nullable(z.string()), + uploadedLogoDark: z.nullable(z.string()), + }) + .transform((v) => { + return remap$(v, { + allTopicsWiki: "all_topics_wiki", + allowBadges: "allow_badges", + allowGlobalTags: "allow_global_tags", + allowUnlimitedOwnerEditsOnFirstPost: "allow_unlimited_owner_edits_on_first_post", + allowedTagGroups: "allowed_tag_groups", + allowedTags: "allowed_tags", + autoCloseBasedOnLastPost: "auto_close_based_on_last_post", + autoCloseHours: "auto_close_hours", + availableGroups: "available_groups", + canDelete: "can_delete", + canEdit: "can_edit", + categorySetting: "category_setting", + customFields: "custom_fields", + defaultListFilter: "default_list_filter", + defaultSlowModeSeconds: "default_slow_mode_seconds", + defaultTopPeriod: "default_top_period", + defaultView: "default_view", + descriptionExcerpt: "description_excerpt", + descriptionText: "description_text", + emailIn: "email_in", + emailInAllowStrangers: "email_in_allow_strangers", + formTemplateIds: "form_template_ids", + groupPermissions: "group_permissions", + hasChildren: "has_children", + mailinglistMirror: "mailinglist_mirror", + minimumRequiredTags: "minimum_required_tags", + navigateToFirstPostAfterRead: "navigate_to_first_post_after_read", + notificationLevel: "notification_level", + numFeaturedTopics: "num_featured_topics", + postCount: "post_count", + readOnlyBanner: "read_only_banner", + readRestricted: "read_restricted", + requiredTagGroups: "required_tag_groups", + searchPriority: "search_priority", + showSubcategoryList: "show_subcategory_list", + sortAscending: "sort_ascending", + sortOrder: "sort_order", + subcategoryListStyle: "subcategory_list_style", + textColor: "text_color", + topicCount: "topic_count", + topicFeaturedLinkAllowed: "topic_featured_link_allowed", + topicTemplate: "topic_template", + topicUrl: "topic_url", + uploadedBackground: "uploaded_background", + uploadedBackgroundDark: "uploaded_background_dark", + uploadedLogo: "uploaded_logo", + uploadedLogoDark: "uploaded_logo_dark", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Category$ { + /** @deprecated use `Category$inboundSchema` instead. */ + export const inboundSchema = Category$inboundSchema; + /** @deprecated use `Category$outboundSchema` instead. */ + export const outboundSchema = Category$outboundSchema; + /** @deprecated use `Category$Outbound` instead. */ + export type Outbound = Category$Outbound; +} + +/** @internal */ +export const CreateCategoryResponseBody$inboundSchema: z.ZodType< + CreateCategoryResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + category: z.lazy(() => Category$inboundSchema), +}); + +/** @internal */ +export type CreateCategoryResponseBody$Outbound = { + category: Category$Outbound; +}; + +/** @internal */ +export const CreateCategoryResponseBody$outboundSchema: z.ZodType< + CreateCategoryResponseBody$Outbound, + z.ZodTypeDef, + CreateCategoryResponseBody +> = z.object({ + category: z.lazy(() => Category$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateCategoryResponseBody$ { + /** @deprecated use `CreateCategoryResponseBody$inboundSchema` instead. */ + export const inboundSchema = CreateCategoryResponseBody$inboundSchema; + /** @deprecated use `CreateCategoryResponseBody$outboundSchema` instead. */ + export const outboundSchema = CreateCategoryResponseBody$outboundSchema; + /** @deprecated use `CreateCategoryResponseBody$Outbound` instead. */ + export type Outbound = CreateCategoryResponseBody$Outbound; } diff --git a/src/sdk/models/operations/creategroup.ts b/src/sdk/models/operations/creategroup.ts index fbf888d..86354dd 100644 --- a/src/sdk/models/operations/creategroup.ts +++ b/src/sdk/models/operations/creategroup.ts @@ -1,258 +1,465 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class Group extends SpeakeasyBase { +export type Group = { /** * pipe|separated */ - @SpeakeasyMetadata() - @Expose({ name: "automatic_membership_email_domains" }) - automaticMembershipEmailDomains?: string; - + automaticMembershipEmailDomains?: string | undefined; /** * About Group */ - @SpeakeasyMetadata() - @Expose({ name: "bio_raw" }) - bioRaw?: string; - - @SpeakeasyMetadata() - @Expose({ name: "default_notification_level" }) - defaultNotificationLevel?: number; - - @SpeakeasyMetadata() - @Expose({ name: "flair_bg_color" }) - flairBgColor?: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_icon" }) - flairIcon?: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_upload_id" }) - flairUploadId?: number; - - @SpeakeasyMetadata() - @Expose({ name: "full_name" }) - fullName?: string; - - @SpeakeasyMetadata() - @Expose({ name: "muted_category_ids" }) - mutedCategoryIds?: number[]; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) + bioRaw?: string | undefined; + defaultNotificationLevel?: number | undefined; + flairBgColor?: string | undefined; + flairIcon?: string | undefined; + flairUploadId?: number | undefined; + fullName?: string | undefined; + mutedCategoryIds?: Array | undefined; name: string; - /** * comma,separated */ - @SpeakeasyMetadata() - @Expose({ name: "owner_usernames" }) - ownerUsernames?: string; - - @SpeakeasyMetadata() - @Expose({ name: "primary_group" }) - primaryGroup?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "public_admission" }) - publicAdmission?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "public_exit" }) - publicExit?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "regular_category_ids" }) - regularCategoryIds?: number[]; - - @SpeakeasyMetadata() - @Expose({ name: "tracking_category_ids" }) - trackingCategoryIds?: number[]; - + ownerUsernames?: string | undefined; + primaryGroup?: boolean | undefined; + publicAdmission?: boolean | undefined; + publicExit?: boolean | undefined; + regularCategoryIds?: Array | undefined; + trackingCategoryIds?: Array | undefined; /** * comma,separated */ - @SpeakeasyMetadata() - @Expose({ name: "usernames" }) - usernames?: string; + usernames?: string | undefined; + visibilityLevel?: number | undefined; + watchingCategoryIds?: Array | undefined; + watchingFirstPostCategoryIds?: Array | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "visibility_level" }) - visibilityLevel?: number; - - @SpeakeasyMetadata() - @Expose({ name: "watching_category_ids" }) - watchingCategoryIds?: number[]; - - @SpeakeasyMetadata() - @Expose({ name: "watching_first_post_category_ids" }) - watchingFirstPostCategoryIds?: number[]; -} - -export class CreateGroupRequestBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "group" }) - @Type(() => Group) +export type CreateGroupRequestBody = { group: Group; -} +}; -export class BasicGroup extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "allow_membership_requests" }) +export type BasicGroup = { allowMembershipRequests: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "automatic" }) automatic: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "bio_cooked" }) - bioCooked: string; - - @SpeakeasyMetadata() - @Expose({ name: "bio_excerpt" }) - bioExcerpt: string; - - @SpeakeasyMetadata() - @Expose({ name: "bio_raw" }) - bioRaw: string; - - @SpeakeasyMetadata() - @Expose({ name: "can_admin_group" }) + bioCooked: string | null; + bioExcerpt: string | null; + bioRaw: string | null; canAdminGroup: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_edit_group" }) - canEditGroup?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_see_members" }) + canEditGroup?: boolean | undefined; canSeeMembers: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "default_notification_level" }) defaultNotificationLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "flair_bg_color" }) - flairBgColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_color" }) - flairColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_url" }) - flairUrl: string; - - @SpeakeasyMetadata() - @Expose({ name: "full_name" }) - fullName: string; - - @SpeakeasyMetadata() - @Expose({ name: "grant_trust_level" }) - grantTrustLevel: string; - - @SpeakeasyMetadata() - @Expose({ name: "has_messages" }) + flairBgColor: string | null; + flairColor: string | null; + flairUrl: string | null; + fullName: string | null; + grantTrustLevel: string | null; hasMessages: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "incoming_email" }) - incomingEmail: string; - - @SpeakeasyMetadata() - @Expose({ name: "members_visibility_level" }) + incomingEmail: string | null; membersVisibilityLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "membership_request_template" }) - membershipRequestTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "mentionable_level" }) + membershipRequestTemplate: string | null; mentionableLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "messageable_level" }) messageableLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "primary_group" }) primaryGroup: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "public_admission" }) publicAdmission: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "public_exit" }) publicExit: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "publish_read_state" }) publishReadState: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "title" }) - title: string; - - @SpeakeasyMetadata() - @Expose({ name: "user_count" }) + title: string | null; userCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "visibility_level" }) visibilityLevel: number; -} +}; /** * group created */ -export class CreateGroupResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "basic_group" }) - @Type(() => BasicGroup) +export type CreateGroupResponseBody = { basicGroup: BasicGroup; +}; + +/** @internal */ +export const Group$inboundSchema: z.ZodType = z + .object({ + automatic_membership_email_domains: z.string().optional(), + bio_raw: z.string().optional(), + default_notification_level: z.number().int().optional(), + flair_bg_color: z.string().optional(), + flair_icon: z.string().optional(), + flair_upload_id: z.number().int().optional(), + full_name: z.string().optional(), + muted_category_ids: z.array(z.number().int()).optional(), + name: z.string(), + owner_usernames: z.string().optional(), + primary_group: z.boolean().optional(), + public_admission: z.boolean().optional(), + public_exit: z.boolean().optional(), + regular_category_ids: z.array(z.number().int()).optional(), + tracking_category_ids: z.array(z.number().int()).optional(), + usernames: z.string().optional(), + visibility_level: z.number().int().optional(), + watching_category_ids: z.array(z.number().int()).optional(), + watching_first_post_category_ids: z.array(z.number().int()).optional(), + }) + .transform((v) => { + return remap$(v, { + automatic_membership_email_domains: "automaticMembershipEmailDomains", + bio_raw: "bioRaw", + default_notification_level: "defaultNotificationLevel", + flair_bg_color: "flairBgColor", + flair_icon: "flairIcon", + flair_upload_id: "flairUploadId", + full_name: "fullName", + muted_category_ids: "mutedCategoryIds", + owner_usernames: "ownerUsernames", + primary_group: "primaryGroup", + public_admission: "publicAdmission", + public_exit: "publicExit", + regular_category_ids: "regularCategoryIds", + tracking_category_ids: "trackingCategoryIds", + visibility_level: "visibilityLevel", + watching_category_ids: "watchingCategoryIds", + watching_first_post_category_ids: "watchingFirstPostCategoryIds", + }); + }); + +/** @internal */ +export type Group$Outbound = { + automatic_membership_email_domains?: string | undefined; + bio_raw?: string | undefined; + default_notification_level?: number | undefined; + flair_bg_color?: string | undefined; + flair_icon?: string | undefined; + flair_upload_id?: number | undefined; + full_name?: string | undefined; + muted_category_ids?: Array | undefined; + name: string; + owner_usernames?: string | undefined; + primary_group?: boolean | undefined; + public_admission?: boolean | undefined; + public_exit?: boolean | undefined; + regular_category_ids?: Array | undefined; + tracking_category_ids?: Array | undefined; + usernames?: string | undefined; + visibility_level?: number | undefined; + watching_category_ids?: Array | undefined; + watching_first_post_category_ids?: Array | undefined; +}; + +/** @internal */ +export const Group$outboundSchema: z.ZodType = z + .object({ + automaticMembershipEmailDomains: z.string().optional(), + bioRaw: z.string().optional(), + defaultNotificationLevel: z.number().int().optional(), + flairBgColor: z.string().optional(), + flairIcon: z.string().optional(), + flairUploadId: z.number().int().optional(), + fullName: z.string().optional(), + mutedCategoryIds: z.array(z.number().int()).optional(), + name: z.string(), + ownerUsernames: z.string().optional(), + primaryGroup: z.boolean().optional(), + publicAdmission: z.boolean().optional(), + publicExit: z.boolean().optional(), + regularCategoryIds: z.array(z.number().int()).optional(), + trackingCategoryIds: z.array(z.number().int()).optional(), + usernames: z.string().optional(), + visibilityLevel: z.number().int().optional(), + watchingCategoryIds: z.array(z.number().int()).optional(), + watchingFirstPostCategoryIds: z.array(z.number().int()).optional(), + }) + .transform((v) => { + return remap$(v, { + automaticMembershipEmailDomains: "automatic_membership_email_domains", + bioRaw: "bio_raw", + defaultNotificationLevel: "default_notification_level", + flairBgColor: "flair_bg_color", + flairIcon: "flair_icon", + flairUploadId: "flair_upload_id", + fullName: "full_name", + mutedCategoryIds: "muted_category_ids", + ownerUsernames: "owner_usernames", + primaryGroup: "primary_group", + publicAdmission: "public_admission", + publicExit: "public_exit", + regularCategoryIds: "regular_category_ids", + trackingCategoryIds: "tracking_category_ids", + visibilityLevel: "visibility_level", + watchingCategoryIds: "watching_category_ids", + watchingFirstPostCategoryIds: "watching_first_post_category_ids", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Group$ { + /** @deprecated use `Group$inboundSchema` instead. */ + export const inboundSchema = Group$inboundSchema; + /** @deprecated use `Group$outboundSchema` instead. */ + export const outboundSchema = Group$outboundSchema; + /** @deprecated use `Group$Outbound` instead. */ + export type Outbound = Group$Outbound; } -export class CreateGroupResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const CreateGroupRequestBody$inboundSchema: z.ZodType< + CreateGroupRequestBody, + z.ZodTypeDef, + unknown +> = z.object({ + group: z.lazy(() => Group$inboundSchema), +}); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type CreateGroupRequestBody$Outbound = { + group: Group$Outbound; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const CreateGroupRequestBody$outboundSchema: z.ZodType< + CreateGroupRequestBody$Outbound, + z.ZodTypeDef, + CreateGroupRequestBody +> = z.object({ + group: z.lazy(() => Group$outboundSchema), +}); - /** - * group created - */ - @SpeakeasyMetadata() - object?: CreateGroupResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateGroupRequestBody$ { + /** @deprecated use `CreateGroupRequestBody$inboundSchema` instead. */ + export const inboundSchema = CreateGroupRequestBody$inboundSchema; + /** @deprecated use `CreateGroupRequestBody$outboundSchema` instead. */ + export const outboundSchema = CreateGroupRequestBody$outboundSchema; + /** @deprecated use `CreateGroupRequestBody$Outbound` instead. */ + export type Outbound = CreateGroupRequestBody$Outbound; +} + +/** @internal */ +export const BasicGroup$inboundSchema: z.ZodType = z + .object({ + allow_membership_requests: z.boolean(), + automatic: z.boolean(), + bio_cooked: z.nullable(z.string()), + bio_excerpt: z.nullable(z.string()), + bio_raw: z.nullable(z.string()), + can_admin_group: z.boolean(), + can_edit_group: z.boolean().optional(), + can_see_members: z.boolean(), + default_notification_level: z.number().int(), + flair_bg_color: z.nullable(z.string()), + flair_color: z.nullable(z.string()), + flair_url: z.nullable(z.string()), + full_name: z.nullable(z.string()), + grant_trust_level: z.nullable(z.string()), + has_messages: z.boolean(), + id: z.number().int(), + incoming_email: z.nullable(z.string()), + members_visibility_level: z.number().int(), + membership_request_template: z.nullable(z.string()), + mentionable_level: z.number().int(), + messageable_level: z.number().int(), + name: z.string(), + primary_group: z.boolean(), + public_admission: z.boolean(), + public_exit: z.boolean(), + publish_read_state: z.boolean(), + title: z.nullable(z.string()), + user_count: z.number().int(), + visibility_level: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + allow_membership_requests: "allowMembershipRequests", + bio_cooked: "bioCooked", + bio_excerpt: "bioExcerpt", + bio_raw: "bioRaw", + can_admin_group: "canAdminGroup", + can_edit_group: "canEditGroup", + can_see_members: "canSeeMembers", + default_notification_level: "defaultNotificationLevel", + flair_bg_color: "flairBgColor", + flair_color: "flairColor", + flair_url: "flairUrl", + full_name: "fullName", + grant_trust_level: "grantTrustLevel", + has_messages: "hasMessages", + incoming_email: "incomingEmail", + members_visibility_level: "membersVisibilityLevel", + membership_request_template: "membershipRequestTemplate", + mentionable_level: "mentionableLevel", + messageable_level: "messageableLevel", + primary_group: "primaryGroup", + public_admission: "publicAdmission", + public_exit: "publicExit", + publish_read_state: "publishReadState", + user_count: "userCount", + visibility_level: "visibilityLevel", + }); + }); + +/** @internal */ +export type BasicGroup$Outbound = { + allow_membership_requests: boolean; + automatic: boolean; + bio_cooked: string | null; + bio_excerpt: string | null; + bio_raw: string | null; + can_admin_group: boolean; + can_edit_group?: boolean | undefined; + can_see_members: boolean; + default_notification_level: number; + flair_bg_color: string | null; + flair_color: string | null; + flair_url: string | null; + full_name: string | null; + grant_trust_level: string | null; + has_messages: boolean; + id: number; + incoming_email: string | null; + members_visibility_level: number; + membership_request_template: string | null; + mentionable_level: number; + messageable_level: number; + name: string; + primary_group: boolean; + public_admission: boolean; + public_exit: boolean; + publish_read_state: boolean; + title: string | null; + user_count: number; + visibility_level: number; +}; + +/** @internal */ +export const BasicGroup$outboundSchema: z.ZodType = z + .object({ + allowMembershipRequests: z.boolean(), + automatic: z.boolean(), + bioCooked: z.nullable(z.string()), + bioExcerpt: z.nullable(z.string()), + bioRaw: z.nullable(z.string()), + canAdminGroup: z.boolean(), + canEditGroup: z.boolean().optional(), + canSeeMembers: z.boolean(), + defaultNotificationLevel: z.number().int(), + flairBgColor: z.nullable(z.string()), + flairColor: z.nullable(z.string()), + flairUrl: z.nullable(z.string()), + fullName: z.nullable(z.string()), + grantTrustLevel: z.nullable(z.string()), + hasMessages: z.boolean(), + id: z.number().int(), + incomingEmail: z.nullable(z.string()), + membersVisibilityLevel: z.number().int(), + membershipRequestTemplate: z.nullable(z.string()), + mentionableLevel: z.number().int(), + messageableLevel: z.number().int(), + name: z.string(), + primaryGroup: z.boolean(), + publicAdmission: z.boolean(), + publicExit: z.boolean(), + publishReadState: z.boolean(), + title: z.nullable(z.string()), + userCount: z.number().int(), + visibilityLevel: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + allowMembershipRequests: "allow_membership_requests", + bioCooked: "bio_cooked", + bioExcerpt: "bio_excerpt", + bioRaw: "bio_raw", + canAdminGroup: "can_admin_group", + canEditGroup: "can_edit_group", + canSeeMembers: "can_see_members", + defaultNotificationLevel: "default_notification_level", + flairBgColor: "flair_bg_color", + flairColor: "flair_color", + flairUrl: "flair_url", + fullName: "full_name", + grantTrustLevel: "grant_trust_level", + hasMessages: "has_messages", + incomingEmail: "incoming_email", + membersVisibilityLevel: "members_visibility_level", + membershipRequestTemplate: "membership_request_template", + mentionableLevel: "mentionable_level", + messageableLevel: "messageable_level", + primaryGroup: "primary_group", + publicAdmission: "public_admission", + publicExit: "public_exit", + publishReadState: "publish_read_state", + userCount: "user_count", + visibilityLevel: "visibility_level", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace BasicGroup$ { + /** @deprecated use `BasicGroup$inboundSchema` instead. */ + export const inboundSchema = BasicGroup$inboundSchema; + /** @deprecated use `BasicGroup$outboundSchema` instead. */ + export const outboundSchema = BasicGroup$outboundSchema; + /** @deprecated use `BasicGroup$Outbound` instead. */ + export type Outbound = BasicGroup$Outbound; +} + +/** @internal */ +export const CreateGroupResponseBody$inboundSchema: z.ZodType< + CreateGroupResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + basic_group: z.lazy(() => BasicGroup$inboundSchema), + }) + .transform((v) => { + return remap$(v, { + basic_group: "basicGroup", + }); + }); + +/** @internal */ +export type CreateGroupResponseBody$Outbound = { + basic_group: BasicGroup$Outbound; +}; + +/** @internal */ +export const CreateGroupResponseBody$outboundSchema: z.ZodType< + CreateGroupResponseBody$Outbound, + z.ZodTypeDef, + CreateGroupResponseBody +> = z + .object({ + basicGroup: z.lazy(() => BasicGroup$outboundSchema), + }) + .transform((v) => { + return remap$(v, { + basicGroup: "basic_group", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateGroupResponseBody$ { + /** @deprecated use `CreateGroupResponseBody$inboundSchema` instead. */ + export const inboundSchema = CreateGroupResponseBody$inboundSchema; + /** @deprecated use `CreateGroupResponseBody$outboundSchema` instead. */ + export const outboundSchema = CreateGroupResponseBody$outboundSchema; + /** @deprecated use `CreateGroupResponseBody$Outbound` instead. */ + export type Outbound = CreateGroupResponseBody$Outbound; } diff --git a/src/sdk/models/operations/createinvite.ts b/src/sdk/models/operations/createinvite.ts index 590e8ff..e1aa05a 100644 --- a/src/sdk/models/operations/createinvite.ts +++ b/src/sdk/models/operations/createinvite.ts @@ -1,145 +1,281 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class CreateInviteRequestBody extends SpeakeasyBase { +export type CreateInviteRequestBody = { /** * optional, for email invites */ - @SpeakeasyMetadata() - @Expose({ name: "custom_message" }) - customMessage?: string; - + customMessage?: string | undefined; /** * required for email invites only */ - @SpeakeasyMetadata() - @Expose({ name: "email" }) - email?: string; - + email?: string | undefined; /** * optional, if not supplied, the invite_expiry_days site setting is used */ - @SpeakeasyMetadata() - @Expose({ name: "expires_at" }) - expiresAt?: string; - + expiresAt?: string | undefined; /** * Optional, either this or `group_names`. Comma separated list for multiple ids. */ - @SpeakeasyMetadata() - @Expose({ name: "group_ids" }) - groupIds?: string; - + groupIds?: string | undefined; /** * Optional, either this or `group_ids`. Comma separated list for multiple names. */ - @SpeakeasyMetadata() - @Expose({ name: "group_names" }) - groupNames?: string; - + groupNames?: string | undefined; /** * optional, for link invites */ - @SpeakeasyMetadata() - @Expose({ name: "max_redemptions_allowed" }) - maxRedemptionsAllowed?: number; + maxRedemptionsAllowed?: number | undefined; + skipEmail?: boolean | undefined; + topicId?: number | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "skip_email" }) - skipEmail?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "topic_id" }) - topicId?: number; -} - -export class CreateInviteRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Key" }) +export type CreateInviteRequest = { apiKey: string; - - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Username" }) apiUsername: string; - - @SpeakeasyMetadata({ data: "request, media_type=application/json" }) - requestBody?: CreateInviteRequestBody; -} + requestBody?: CreateInviteRequestBody | undefined; +}; /** * success response */ -export class CreateInviteResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "created_at" }) - createdAt?: string; +export type CreateInviteResponseBody = { + createdAt?: string | undefined; + customMessage?: string | null | undefined; + email?: string | undefined; + emailed?: boolean | undefined; + expired?: boolean | undefined; + expiresAt?: string | undefined; + groups?: Array | undefined; + id?: number | undefined; + link?: string | undefined; + topics?: Array | undefined; + updatedAt?: string | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "custom_message" }) - customMessage?: string; +/** @internal */ +export const CreateInviteRequestBody$inboundSchema: z.ZodType< + CreateInviteRequestBody, + z.ZodTypeDef, + unknown +> = z + .object({ + custom_message: z.string().optional(), + email: z.string().optional(), + expires_at: z.string().optional(), + group_ids: z.string().optional(), + group_names: z.string().optional(), + max_redemptions_allowed: z.number().int().default(1), + skip_email: z.boolean().default(false), + topic_id: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + custom_message: "customMessage", + expires_at: "expiresAt", + group_ids: "groupIds", + group_names: "groupNames", + max_redemptions_allowed: "maxRedemptionsAllowed", + skip_email: "skipEmail", + topic_id: "topicId", + }); + }); - @SpeakeasyMetadata() - @Expose({ name: "email" }) - email?: string; +/** @internal */ +export type CreateInviteRequestBody$Outbound = { + custom_message?: string | undefined; + email?: string | undefined; + expires_at?: string | undefined; + group_ids?: string | undefined; + group_names?: string | undefined; + max_redemptions_allowed: number; + skip_email: boolean; + topic_id?: number | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "emailed" }) - emailed?: boolean; +/** @internal */ +export const CreateInviteRequestBody$outboundSchema: z.ZodType< + CreateInviteRequestBody$Outbound, + z.ZodTypeDef, + CreateInviteRequestBody +> = z + .object({ + customMessage: z.string().optional(), + email: z.string().optional(), + expiresAt: z.string().optional(), + groupIds: z.string().optional(), + groupNames: z.string().optional(), + maxRedemptionsAllowed: z.number().int().default(1), + skipEmail: z.boolean().default(false), + topicId: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + customMessage: "custom_message", + expiresAt: "expires_at", + groupIds: "group_ids", + groupNames: "group_names", + maxRedemptionsAllowed: "max_redemptions_allowed", + skipEmail: "skip_email", + topicId: "topic_id", + }); + }); - @SpeakeasyMetadata() - @Expose({ name: "expired" }) - expired?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "expires_at" }) - expiresAt?: string; - - @SpeakeasyMetadata() - @Expose({ name: "groups" }) - groups?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) - id?: number; - - @SpeakeasyMetadata() - @Expose({ name: "link" }) - link?: string; - - @SpeakeasyMetadata() - @Expose({ name: "topics" }) - topics?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "updated_at" }) - updatedAt?: string; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateInviteRequestBody$ { + /** @deprecated use `CreateInviteRequestBody$inboundSchema` instead. */ + export const inboundSchema = CreateInviteRequestBody$inboundSchema; + /** @deprecated use `CreateInviteRequestBody$outboundSchema` instead. */ + export const outboundSchema = CreateInviteRequestBody$outboundSchema; + /** @deprecated use `CreateInviteRequestBody$Outbound` instead. */ + export type Outbound = CreateInviteRequestBody$Outbound; } -export class CreateInviteResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const CreateInviteRequest$inboundSchema: z.ZodType< + CreateInviteRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + "Api-Key": z.string(), + "Api-Username": z.string(), + RequestBody: z.lazy(() => CreateInviteRequestBody$inboundSchema).optional(), + }) + .transform((v) => { + return remap$(v, { + "Api-Key": "apiKey", + "Api-Username": "apiUsername", + RequestBody: "requestBody", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type CreateInviteRequest$Outbound = { + "Api-Key": string; + "Api-Username": string; + RequestBody?: CreateInviteRequestBody$Outbound | undefined; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const CreateInviteRequest$outboundSchema: z.ZodType< + CreateInviteRequest$Outbound, + z.ZodTypeDef, + CreateInviteRequest +> = z + .object({ + apiKey: z.string(), + apiUsername: z.string(), + requestBody: z.lazy(() => CreateInviteRequestBody$outboundSchema).optional(), + }) + .transform((v) => { + return remap$(v, { + apiKey: "Api-Key", + apiUsername: "Api-Username", + requestBody: "RequestBody", + }); + }); - /** - * success response - */ - @SpeakeasyMetadata() - object?: CreateInviteResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateInviteRequest$ { + /** @deprecated use `CreateInviteRequest$inboundSchema` instead. */ + export const inboundSchema = CreateInviteRequest$inboundSchema; + /** @deprecated use `CreateInviteRequest$outboundSchema` instead. */ + export const outboundSchema = CreateInviteRequest$outboundSchema; + /** @deprecated use `CreateInviteRequest$Outbound` instead. */ + export type Outbound = CreateInviteRequest$Outbound; +} + +/** @internal */ +export const CreateInviteResponseBody$inboundSchema: z.ZodType< + CreateInviteResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + created_at: z.string().optional(), + custom_message: z.nullable(z.string()).optional(), + email: z.string().optional(), + emailed: z.boolean().optional(), + expired: z.boolean().optional(), + expires_at: z.string().optional(), + groups: z.array(z.any()).optional(), + id: z.number().int().optional(), + link: z.string().optional(), + topics: z.array(z.any()).optional(), + updated_at: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + created_at: "createdAt", + custom_message: "customMessage", + expires_at: "expiresAt", + updated_at: "updatedAt", + }); + }); + +/** @internal */ +export type CreateInviteResponseBody$Outbound = { + created_at?: string | undefined; + custom_message?: string | null | undefined; + email?: string | undefined; + emailed?: boolean | undefined; + expired?: boolean | undefined; + expires_at?: string | undefined; + groups?: Array | undefined; + id?: number | undefined; + link?: string | undefined; + topics?: Array | undefined; + updated_at?: string | undefined; +}; + +/** @internal */ +export const CreateInviteResponseBody$outboundSchema: z.ZodType< + CreateInviteResponseBody$Outbound, + z.ZodTypeDef, + CreateInviteResponseBody +> = z + .object({ + createdAt: z.string().optional(), + customMessage: z.nullable(z.string()).optional(), + email: z.string().optional(), + emailed: z.boolean().optional(), + expired: z.boolean().optional(), + expiresAt: z.string().optional(), + groups: z.array(z.any()).optional(), + id: z.number().int().optional(), + link: z.string().optional(), + topics: z.array(z.any()).optional(), + updatedAt: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + createdAt: "created_at", + customMessage: "custom_message", + expiresAt: "expires_at", + updatedAt: "updated_at", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateInviteResponseBody$ { + /** @deprecated use `CreateInviteResponseBody$inboundSchema` instead. */ + export const inboundSchema = CreateInviteResponseBody$inboundSchema; + /** @deprecated use `CreateInviteResponseBody$outboundSchema` instead. */ + export const outboundSchema = CreateInviteResponseBody$outboundSchema; + /** @deprecated use `CreateInviteResponseBody$Outbound` instead. */ + export type Outbound = CreateInviteResponseBody$Outbound; } diff --git a/src/sdk/models/operations/createmultipartupload.ts b/src/sdk/models/operations/createmultipartupload.ts index 0b1bcfd..5f2a786 100644 --- a/src/sdk/models/operations/createmultipartupload.ts +++ b/src/sdk/models/operations/createmultipartupload.ts @@ -1,98 +1,227 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; -export class Metadata extends SpeakeasyBase { +export type Metadata = { /** * The SHA1 checksum of the upload binary blob. Optionally be provided and serves as an additional security check when later processing the file in complete-external-upload endpoint. */ - @SpeakeasyMetadata() - @Expose({ name: "sha1-checksum" }) - sha1Checksum?: string; -} + sha1Checksum?: string | undefined; +}; -export enum UploadType { - Avatar = "avatar", - ProfileBackground = "profile_background", - CardBackground = "card_background", - CustomEmoji = "custom_emoji", - Composer = "composer", -} +export const UploadType = { + Avatar: "avatar", + ProfileBackground: "profile_background", + CardBackground: "card_background", + CustomEmoji: "custom_emoji", + Composer: "composer", +} as const; +export type UploadType = ClosedEnum; -export class CreateMultipartUploadRequestBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "file_name" }) +export type CreateMultipartUploadRequestBody = { fileName: string; - /** * File size should be represented in bytes. */ - @SpeakeasyMetadata() - @Expose({ name: "file_size" }) fileSize: number; - - @SpeakeasyMetadata() - @Expose({ name: "metadata" }) - @Type(() => Metadata) - metadata?: Metadata; - - @SpeakeasyMetadata() - @Expose({ name: "upload_type" }) + metadata?: Metadata | undefined; uploadType: UploadType; -} +}; /** * external upload initialized */ -export class CreateMultipartUploadResponseBody extends SpeakeasyBase { +export type CreateMultipartUploadResponseBody = { /** * The identifier of the multipart upload in the external storage provider. This is the multipart upload_id in AWS S3. */ - @SpeakeasyMetadata() - @Expose({ name: "external_upload_identifier" }) externalUploadIdentifier: string; - /** * The path of the temporary file on the external storage service. */ - @SpeakeasyMetadata() - @Expose({ name: "key" }) key: string; - /** * A unique string that identifies the external upload. This must be stored and then sent in the /complete-multipart and /batch-presign-multipart-parts endpoints. */ - @SpeakeasyMetadata() - @Expose({ name: "unique_identifier" }) uniqueIdentifier: string; +}; + +/** @internal */ +export const Metadata$inboundSchema: z.ZodType = z + .object({ + "sha1-checksum": z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + "sha1-checksum": "sha1Checksum", + }); + }); + +/** @internal */ +export type Metadata$Outbound = { + "sha1-checksum"?: string | undefined; +}; + +/** @internal */ +export const Metadata$outboundSchema: z.ZodType = z + .object({ + sha1Checksum: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + sha1Checksum: "sha1-checksum", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Metadata$ { + /** @deprecated use `Metadata$inboundSchema` instead. */ + export const inboundSchema = Metadata$inboundSchema; + /** @deprecated use `Metadata$outboundSchema` instead. */ + export const outboundSchema = Metadata$outboundSchema; + /** @deprecated use `Metadata$Outbound` instead. */ + export type Outbound = Metadata$Outbound; } -export class CreateMultipartUploadResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const UploadType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(UploadType); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export const UploadType$outboundSchema: z.ZodNativeEnum = + UploadType$inboundSchema; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; - - /** - * external upload initialized - */ - @SpeakeasyMetadata() - object?: CreateMultipartUploadResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UploadType$ { + /** @deprecated use `UploadType$inboundSchema` instead. */ + export const inboundSchema = UploadType$inboundSchema; + /** @deprecated use `UploadType$outboundSchema` instead. */ + export const outboundSchema = UploadType$outboundSchema; +} + +/** @internal */ +export const CreateMultipartUploadRequestBody$inboundSchema: z.ZodType< + CreateMultipartUploadRequestBody, + z.ZodTypeDef, + unknown +> = z + .object({ + file_name: z.string(), + file_size: z.number().int(), + metadata: z.lazy(() => Metadata$inboundSchema).optional(), + upload_type: UploadType$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + file_name: "fileName", + file_size: "fileSize", + upload_type: "uploadType", + }); + }); + +/** @internal */ +export type CreateMultipartUploadRequestBody$Outbound = { + file_name: string; + file_size: number; + metadata?: Metadata$Outbound | undefined; + upload_type: string; +}; + +/** @internal */ +export const CreateMultipartUploadRequestBody$outboundSchema: z.ZodType< + CreateMultipartUploadRequestBody$Outbound, + z.ZodTypeDef, + CreateMultipartUploadRequestBody +> = z + .object({ + fileName: z.string(), + fileSize: z.number().int(), + metadata: z.lazy(() => Metadata$outboundSchema).optional(), + uploadType: UploadType$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + fileName: "file_name", + fileSize: "file_size", + uploadType: "upload_type", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateMultipartUploadRequestBody$ { + /** @deprecated use `CreateMultipartUploadRequestBody$inboundSchema` instead. */ + export const inboundSchema = CreateMultipartUploadRequestBody$inboundSchema; + /** @deprecated use `CreateMultipartUploadRequestBody$outboundSchema` instead. */ + export const outboundSchema = CreateMultipartUploadRequestBody$outboundSchema; + /** @deprecated use `CreateMultipartUploadRequestBody$Outbound` instead. */ + export type Outbound = CreateMultipartUploadRequestBody$Outbound; +} + +/** @internal */ +export const CreateMultipartUploadResponseBody$inboundSchema: z.ZodType< + CreateMultipartUploadResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + external_upload_identifier: z.string(), + key: z.string(), + unique_identifier: z.string(), + }) + .transform((v) => { + return remap$(v, { + external_upload_identifier: "externalUploadIdentifier", + unique_identifier: "uniqueIdentifier", + }); + }); + +/** @internal */ +export type CreateMultipartUploadResponseBody$Outbound = { + external_upload_identifier: string; + key: string; + unique_identifier: string; +}; + +/** @internal */ +export const CreateMultipartUploadResponseBody$outboundSchema: z.ZodType< + CreateMultipartUploadResponseBody$Outbound, + z.ZodTypeDef, + CreateMultipartUploadResponseBody +> = z + .object({ + externalUploadIdentifier: z.string(), + key: z.string(), + uniqueIdentifier: z.string(), + }) + .transform((v) => { + return remap$(v, { + externalUploadIdentifier: "external_upload_identifier", + uniqueIdentifier: "unique_identifier", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateMultipartUploadResponseBody$ { + /** @deprecated use `CreateMultipartUploadResponseBody$inboundSchema` instead. */ + export const inboundSchema = CreateMultipartUploadResponseBody$inboundSchema; + /** @deprecated use `CreateMultipartUploadResponseBody$outboundSchema` instead. */ + export const outboundSchema = CreateMultipartUploadResponseBody$outboundSchema; + /** @deprecated use `CreateMultipartUploadResponseBody$Outbound` instead. */ + export type Outbound = CreateMultipartUploadResponseBody$Outbound; } diff --git a/src/sdk/models/operations/createtaggroup.ts b/src/sdk/models/operations/createtaggroup.ts index a823447..ad2c6c8 100644 --- a/src/sdk/models/operations/createtaggroup.ts +++ b/src/sdk/models/operations/createtaggroup.ts @@ -1,78 +1,201 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class CreateTagGroupRequestBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "name" }) +export type CreateTagGroupRequestBody = { name: string; -} +}; -export class Permissions extends SpeakeasyBase {} +export type CreateTagGroupPermissions = {}; -export class TagGroup extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "id" }) +export type TagGroup = { id: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "one_per_topic" }) onePerTopic: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "parent_tag_name" }) - parentTagName: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "permissions" }) - @Type(() => Permissions) - permissions: Permissions; - - @SpeakeasyMetadata() - @Expose({ name: "tag_names" }) - tagNames: any[]; -} + parentTagName: Array; + permissions: CreateTagGroupPermissions; + tagNames: Array; +}; /** * tag group created */ -export class CreateTagGroupResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "tag_group" }) - @Type(() => TagGroup) +export type CreateTagGroupResponseBody = { tagGroup: TagGroup; +}; + +/** @internal */ +export const CreateTagGroupRequestBody$inboundSchema: z.ZodType< + CreateTagGroupRequestBody, + z.ZodTypeDef, + unknown +> = z.object({ + name: z.string(), +}); + +/** @internal */ +export type CreateTagGroupRequestBody$Outbound = { + name: string; +}; + +/** @internal */ +export const CreateTagGroupRequestBody$outboundSchema: z.ZodType< + CreateTagGroupRequestBody$Outbound, + z.ZodTypeDef, + CreateTagGroupRequestBody +> = z.object({ + name: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateTagGroupRequestBody$ { + /** @deprecated use `CreateTagGroupRequestBody$inboundSchema` instead. */ + export const inboundSchema = CreateTagGroupRequestBody$inboundSchema; + /** @deprecated use `CreateTagGroupRequestBody$outboundSchema` instead. */ + export const outboundSchema = CreateTagGroupRequestBody$outboundSchema; + /** @deprecated use `CreateTagGroupRequestBody$Outbound` instead. */ + export type Outbound = CreateTagGroupRequestBody$Outbound; } -export class CreateTagGroupResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const CreateTagGroupPermissions$inboundSchema: z.ZodType< + CreateTagGroupPermissions, + z.ZodTypeDef, + unknown +> = z.object({}); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type CreateTagGroupPermissions$Outbound = {}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const CreateTagGroupPermissions$outboundSchema: z.ZodType< + CreateTagGroupPermissions$Outbound, + z.ZodTypeDef, + CreateTagGroupPermissions +> = z.object({}); - /** - * tag group created - */ - @SpeakeasyMetadata() - object?: CreateTagGroupResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateTagGroupPermissions$ { + /** @deprecated use `CreateTagGroupPermissions$inboundSchema` instead. */ + export const inboundSchema = CreateTagGroupPermissions$inboundSchema; + /** @deprecated use `CreateTagGroupPermissions$outboundSchema` instead. */ + export const outboundSchema = CreateTagGroupPermissions$outboundSchema; + /** @deprecated use `CreateTagGroupPermissions$Outbound` instead. */ + export type Outbound = CreateTagGroupPermissions$Outbound; +} + +/** @internal */ +export const TagGroup$inboundSchema: z.ZodType = z + .object({ + id: z.number().int(), + name: z.string(), + one_per_topic: z.boolean(), + parent_tag_name: z.array(z.any()), + permissions: z.lazy(() => CreateTagGroupPermissions$inboundSchema), + tag_names: z.array(z.any()), + }) + .transform((v) => { + return remap$(v, { + one_per_topic: "onePerTopic", + parent_tag_name: "parentTagName", + tag_names: "tagNames", + }); + }); + +/** @internal */ +export type TagGroup$Outbound = { + id: number; + name: string; + one_per_topic: boolean; + parent_tag_name: Array; + permissions: CreateTagGroupPermissions$Outbound; + tag_names: Array; +}; + +/** @internal */ +export const TagGroup$outboundSchema: z.ZodType = z + .object({ + id: z.number().int(), + name: z.string(), + onePerTopic: z.boolean(), + parentTagName: z.array(z.any()), + permissions: z.lazy(() => CreateTagGroupPermissions$outboundSchema), + tagNames: z.array(z.any()), + }) + .transform((v) => { + return remap$(v, { + onePerTopic: "one_per_topic", + parentTagName: "parent_tag_name", + tagNames: "tag_names", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TagGroup$ { + /** @deprecated use `TagGroup$inboundSchema` instead. */ + export const inboundSchema = TagGroup$inboundSchema; + /** @deprecated use `TagGroup$outboundSchema` instead. */ + export const outboundSchema = TagGroup$outboundSchema; + /** @deprecated use `TagGroup$Outbound` instead. */ + export type Outbound = TagGroup$Outbound; +} + +/** @internal */ +export const CreateTagGroupResponseBody$inboundSchema: z.ZodType< + CreateTagGroupResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + tag_group: z.lazy(() => TagGroup$inboundSchema), + }) + .transform((v) => { + return remap$(v, { + tag_group: "tagGroup", + }); + }); + +/** @internal */ +export type CreateTagGroupResponseBody$Outbound = { + tag_group: TagGroup$Outbound; +}; + +/** @internal */ +export const CreateTagGroupResponseBody$outboundSchema: z.ZodType< + CreateTagGroupResponseBody$Outbound, + z.ZodTypeDef, + CreateTagGroupResponseBody +> = z + .object({ + tagGroup: z.lazy(() => TagGroup$outboundSchema), + }) + .transform((v) => { + return remap$(v, { + tagGroup: "tag_group", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateTagGroupResponseBody$ { + /** @deprecated use `CreateTagGroupResponseBody$inboundSchema` instead. */ + export const inboundSchema = CreateTagGroupResponseBody$inboundSchema; + /** @deprecated use `CreateTagGroupResponseBody$outboundSchema` instead. */ + export const outboundSchema = CreateTagGroupResponseBody$outboundSchema; + /** @deprecated use `CreateTagGroupResponseBody$Outbound` instead. */ + export type Outbound = CreateTagGroupResponseBody$Outbound; } diff --git a/src/sdk/models/operations/createtopicpostpm.ts b/src/sdk/models/operations/createtopicpostpm.ts index 3018ca0..fc776a4 100644 --- a/src/sdk/models/operations/createtopicpostpm.ts +++ b/src/sdk/models/operations/createtopicpostpm.ts @@ -1,332 +1,526 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class CreateTopicPostPMRequestBody extends SpeakeasyBase { +export type CreateTopicPostPMRequestBody = { /** * Required for new private message. */ - @SpeakeasyMetadata() - @Expose({ name: "archetype" }) - archetype?: string; - + archetype?: string | undefined; /** * Optional if creating a new topic, and ignored if creating a new post. */ - @SpeakeasyMetadata() - @Expose({ name: "category" }) - category?: number; - - @SpeakeasyMetadata() - @Expose({ name: "created_at" }) - createdAt?: string; - + category?: number | undefined; + createdAt?: string | undefined; /** * Provide a URL from a remote system to associate a forum topic with that URL, typically for using Discourse as a comments system for an external blog. */ - @SpeakeasyMetadata() - @Expose({ name: "embed_url" }) - embedUrl?: string; - + embedUrl?: string | undefined; /** * Provide an external_id from a remote system to associate a forum topic with that id. */ - @SpeakeasyMetadata() - @Expose({ name: "external_id" }) - externalId?: string; - - @SpeakeasyMetadata() - @Expose({ name: "raw" }) + externalId?: string | undefined; raw: string; - /** * Optional, the post number to reply to inside a topic. */ - @SpeakeasyMetadata() - @Expose({ name: "reply_to_post_number" }) - replyToPostNumber?: number; - + replyToPostNumber?: number | undefined; /** * Required for private message, comma separated. */ - @SpeakeasyMetadata() - @Expose({ name: "target_recipients" }) - targetRecipients?: string; - + targetRecipients?: string | undefined; /** * Deprecated. Use target_recipients instead. * * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. */ - @SpeakeasyMetadata() - @Expose({ name: "target_usernames" }) - targetUsernames?: string; - + targetUsernames?: string | undefined; /** * Required if creating a new topic or new private message. */ - @SpeakeasyMetadata() - @Expose({ name: "title" }) - title?: string; - + title?: string | undefined; /** * Required if creating a new post. */ - @SpeakeasyMetadata() - @Expose({ name: "topic_id" }) - topicId?: number; -} + topicId?: number | undefined; +}; -export class CreateTopicPostPMActionsSummary extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "can_act" }) +export type CreateTopicPostPMActionsSummary = { canAct: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; -} +}; /** * post created */ -export class CreateTopicPostPMResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata({ elemType: CreateTopicPostPMActionsSummary }) - @Expose({ name: "actions_summary" }) - @Type(() => CreateTopicPostPMActionsSummary) - actionsSummary: CreateTopicPostPMActionsSummary[]; - - @SpeakeasyMetadata() - @Expose({ name: "admin" }) +export type CreateTopicPostPMResponseBody = { + actionsSummary: Array; admin: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "avatar_template" }) avatarTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "bookmarked" }) bookmarked: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_delete" }) canDelete: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_edit" }) canEdit: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_recover" }) canRecover: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_see_hidden_post" }) - canSeeHiddenPost?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_view_edit_history" }) + canSeeHiddenPost?: boolean | undefined; canViewEditHistory: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_wiki" }) canWiki: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "cooked" }) cooked: string; - - @SpeakeasyMetadata() - @Expose({ name: "created_at" }) createdAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "deleted_at" }) - deletedAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "display_username" }) - displayUsername: string; - - @SpeakeasyMetadata() - @Expose({ name: "draft_sequence" }) + deletedAt: string | null; + displayUsername: string | null; draftSequence: number; - - @SpeakeasyMetadata() - @Expose({ name: "edit_reason" }) - editReason: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_bg_color" }) - flairBgColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_color" }) - flairColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_group_id" }) - flairGroupId?: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_name" }) - flairName: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_url" }) - flairUrl: string; - - @SpeakeasyMetadata() - @Expose({ name: "hidden" }) + editReason: string | null; + flairBgColor: string | null; + flairColor: string | null; + flairGroupId?: string | null | undefined; + flairName: string | null; + flairUrl: string | null; hidden: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "incoming_link_count" }) incomingLinkCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "mentioned_users" }) - mentionedUsers?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "moderator" }) + mentionedUsers?: Array | undefined; moderator: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) - name: string; - - @SpeakeasyMetadata() - @Expose({ name: "post_number" }) + name: string | null; postNumber: number; - - @SpeakeasyMetadata() - @Expose({ name: "post_type" }) postType: number; - - @SpeakeasyMetadata() - @Expose({ name: "primary_group_name" }) - primaryGroupName: string; - - @SpeakeasyMetadata() - @Expose({ name: "quote_count" }) + primaryGroupName: string | null; quoteCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "raw" }) - raw?: string; - - @SpeakeasyMetadata() - @Expose({ name: "readers_count" }) + raw?: string | undefined; readersCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "reads" }) reads: number; - - @SpeakeasyMetadata() - @Expose({ name: "reply_count" }) replyCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "reply_to_post_number" }) - replyToPostNumber: string; - - @SpeakeasyMetadata() - @Expose({ name: "reviewable_id" }) - reviewableId: string; - - @SpeakeasyMetadata() - @Expose({ name: "reviewable_score_count" }) + replyToPostNumber: string | null; + reviewableId: string | null; reviewableScoreCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "reviewable_score_pending_count" }) reviewableScorePendingCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "score" }) score: number; - - @SpeakeasyMetadata() - @Expose({ name: "staff" }) staff: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "topic_id" }) topicId: number; - - @SpeakeasyMetadata() - @Expose({ name: "topic_slug" }) topicSlug: string; - - @SpeakeasyMetadata() - @Expose({ name: "trust_level" }) trustLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "updated_at" }) updatedAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "user_deleted" }) userDeleted: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "user_id" }) userId: number; - - @SpeakeasyMetadata() - @Expose({ name: "user_title" }) - userTitle: string; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) + userTitle: string | null; username: string; - - @SpeakeasyMetadata() - @Expose({ name: "version" }) version: number; - - @SpeakeasyMetadata() - @Expose({ name: "wiki" }) wiki: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "yours" }) yours: boolean; +}; + +/** @internal */ +export const CreateTopicPostPMRequestBody$inboundSchema: z.ZodType< + CreateTopicPostPMRequestBody, + z.ZodTypeDef, + unknown +> = z + .object({ + archetype: z.string().optional(), + category: z.number().int().optional(), + created_at: z.string().optional(), + embed_url: z.string().optional(), + external_id: z.string().optional(), + raw: z.string(), + reply_to_post_number: z.number().int().optional(), + target_recipients: z.string().optional(), + target_usernames: z.string().optional(), + title: z.string().optional(), + topic_id: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + created_at: "createdAt", + embed_url: "embedUrl", + external_id: "externalId", + reply_to_post_number: "replyToPostNumber", + target_recipients: "targetRecipients", + target_usernames: "targetUsernames", + topic_id: "topicId", + }); + }); + +/** @internal */ +export type CreateTopicPostPMRequestBody$Outbound = { + archetype?: string | undefined; + category?: number | undefined; + created_at?: string | undefined; + embed_url?: string | undefined; + external_id?: string | undefined; + raw: string; + reply_to_post_number?: number | undefined; + target_recipients?: string | undefined; + target_usernames?: string | undefined; + title?: string | undefined; + topic_id?: number | undefined; +}; + +/** @internal */ +export const CreateTopicPostPMRequestBody$outboundSchema: z.ZodType< + CreateTopicPostPMRequestBody$Outbound, + z.ZodTypeDef, + CreateTopicPostPMRequestBody +> = z + .object({ + archetype: z.string().optional(), + category: z.number().int().optional(), + createdAt: z.string().optional(), + embedUrl: z.string().optional(), + externalId: z.string().optional(), + raw: z.string(), + replyToPostNumber: z.number().int().optional(), + targetRecipients: z.string().optional(), + targetUsernames: z.string().optional(), + title: z.string().optional(), + topicId: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + createdAt: "created_at", + embedUrl: "embed_url", + externalId: "external_id", + replyToPostNumber: "reply_to_post_number", + targetRecipients: "target_recipients", + targetUsernames: "target_usernames", + topicId: "topic_id", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateTopicPostPMRequestBody$ { + /** @deprecated use `CreateTopicPostPMRequestBody$inboundSchema` instead. */ + export const inboundSchema = CreateTopicPostPMRequestBody$inboundSchema; + /** @deprecated use `CreateTopicPostPMRequestBody$outboundSchema` instead. */ + export const outboundSchema = CreateTopicPostPMRequestBody$outboundSchema; + /** @deprecated use `CreateTopicPostPMRequestBody$Outbound` instead. */ + export type Outbound = CreateTopicPostPMRequestBody$Outbound; } -export class CreateTopicPostPMResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const CreateTopicPostPMActionsSummary$inboundSchema: z.ZodType< + CreateTopicPostPMActionsSummary, + z.ZodTypeDef, + unknown +> = z + .object({ + can_act: z.boolean(), + id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + can_act: "canAct", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type CreateTopicPostPMActionsSummary$Outbound = { + can_act: boolean; + id: number; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const CreateTopicPostPMActionsSummary$outboundSchema: z.ZodType< + CreateTopicPostPMActionsSummary$Outbound, + z.ZodTypeDef, + CreateTopicPostPMActionsSummary +> = z + .object({ + canAct: z.boolean(), + id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + canAct: "can_act", + }); + }); - /** - * post created - */ - @SpeakeasyMetadata() - object?: CreateTopicPostPMResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateTopicPostPMActionsSummary$ { + /** @deprecated use `CreateTopicPostPMActionsSummary$inboundSchema` instead. */ + export const inboundSchema = CreateTopicPostPMActionsSummary$inboundSchema; + /** @deprecated use `CreateTopicPostPMActionsSummary$outboundSchema` instead. */ + export const outboundSchema = CreateTopicPostPMActionsSummary$outboundSchema; + /** @deprecated use `CreateTopicPostPMActionsSummary$Outbound` instead. */ + export type Outbound = CreateTopicPostPMActionsSummary$Outbound; +} + +/** @internal */ +export const CreateTopicPostPMResponseBody$inboundSchema: z.ZodType< + CreateTopicPostPMResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + actions_summary: z.array(z.lazy(() => CreateTopicPostPMActionsSummary$inboundSchema)), + admin: z.boolean(), + avatar_template: z.string(), + bookmarked: z.boolean(), + can_delete: z.boolean(), + can_edit: z.boolean(), + can_recover: z.boolean(), + can_see_hidden_post: z.boolean().optional(), + can_view_edit_history: z.boolean(), + can_wiki: z.boolean(), + cooked: z.string(), + created_at: z.string(), + deleted_at: z.nullable(z.string()), + display_username: z.nullable(z.string()), + draft_sequence: z.number().int(), + edit_reason: z.nullable(z.string()), + flair_bg_color: z.nullable(z.string()), + flair_color: z.nullable(z.string()), + flair_group_id: z.nullable(z.string()).optional(), + flair_name: z.nullable(z.string()), + flair_url: z.nullable(z.string()), + hidden: z.boolean(), + id: z.number().int(), + incoming_link_count: z.number().int(), + mentioned_users: z.array(z.any()).optional(), + moderator: z.boolean(), + name: z.nullable(z.string()), + post_number: z.number().int(), + post_type: z.number().int(), + primary_group_name: z.nullable(z.string()), + quote_count: z.number().int(), + raw: z.string().optional(), + readers_count: z.number().int(), + reads: z.number().int(), + reply_count: z.number().int(), + reply_to_post_number: z.nullable(z.string()), + reviewable_id: z.nullable(z.string()), + reviewable_score_count: z.number().int(), + reviewable_score_pending_count: z.number().int(), + score: z.number().int(), + staff: z.boolean(), + topic_id: z.number().int(), + topic_slug: z.string(), + trust_level: z.number().int(), + updated_at: z.string(), + user_deleted: z.boolean(), + user_id: z.number().int(), + user_title: z.nullable(z.string()), + username: z.string(), + version: z.number().int(), + wiki: z.boolean(), + yours: z.boolean(), + }) + .transform((v) => { + return remap$(v, { + actions_summary: "actionsSummary", + avatar_template: "avatarTemplate", + can_delete: "canDelete", + can_edit: "canEdit", + can_recover: "canRecover", + can_see_hidden_post: "canSeeHiddenPost", + can_view_edit_history: "canViewEditHistory", + can_wiki: "canWiki", + created_at: "createdAt", + deleted_at: "deletedAt", + display_username: "displayUsername", + draft_sequence: "draftSequence", + edit_reason: "editReason", + flair_bg_color: "flairBgColor", + flair_color: "flairColor", + flair_group_id: "flairGroupId", + flair_name: "flairName", + flair_url: "flairUrl", + incoming_link_count: "incomingLinkCount", + mentioned_users: "mentionedUsers", + post_number: "postNumber", + post_type: "postType", + primary_group_name: "primaryGroupName", + quote_count: "quoteCount", + readers_count: "readersCount", + reply_count: "replyCount", + reply_to_post_number: "replyToPostNumber", + reviewable_id: "reviewableId", + reviewable_score_count: "reviewableScoreCount", + reviewable_score_pending_count: "reviewableScorePendingCount", + topic_id: "topicId", + topic_slug: "topicSlug", + trust_level: "trustLevel", + updated_at: "updatedAt", + user_deleted: "userDeleted", + user_id: "userId", + user_title: "userTitle", + }); + }); + +/** @internal */ +export type CreateTopicPostPMResponseBody$Outbound = { + actions_summary: Array; + admin: boolean; + avatar_template: string; + bookmarked: boolean; + can_delete: boolean; + can_edit: boolean; + can_recover: boolean; + can_see_hidden_post?: boolean | undefined; + can_view_edit_history: boolean; + can_wiki: boolean; + cooked: string; + created_at: string; + deleted_at: string | null; + display_username: string | null; + draft_sequence: number; + edit_reason: string | null; + flair_bg_color: string | null; + flair_color: string | null; + flair_group_id?: string | null | undefined; + flair_name: string | null; + flair_url: string | null; + hidden: boolean; + id: number; + incoming_link_count: number; + mentioned_users?: Array | undefined; + moderator: boolean; + name: string | null; + post_number: number; + post_type: number; + primary_group_name: string | null; + quote_count: number; + raw?: string | undefined; + readers_count: number; + reads: number; + reply_count: number; + reply_to_post_number: string | null; + reviewable_id: string | null; + reviewable_score_count: number; + reviewable_score_pending_count: number; + score: number; + staff: boolean; + topic_id: number; + topic_slug: string; + trust_level: number; + updated_at: string; + user_deleted: boolean; + user_id: number; + user_title: string | null; + username: string; + version: number; + wiki: boolean; + yours: boolean; +}; + +/** @internal */ +export const CreateTopicPostPMResponseBody$outboundSchema: z.ZodType< + CreateTopicPostPMResponseBody$Outbound, + z.ZodTypeDef, + CreateTopicPostPMResponseBody +> = z + .object({ + actionsSummary: z.array(z.lazy(() => CreateTopicPostPMActionsSummary$outboundSchema)), + admin: z.boolean(), + avatarTemplate: z.string(), + bookmarked: z.boolean(), + canDelete: z.boolean(), + canEdit: z.boolean(), + canRecover: z.boolean(), + canSeeHiddenPost: z.boolean().optional(), + canViewEditHistory: z.boolean(), + canWiki: z.boolean(), + cooked: z.string(), + createdAt: z.string(), + deletedAt: z.nullable(z.string()), + displayUsername: z.nullable(z.string()), + draftSequence: z.number().int(), + editReason: z.nullable(z.string()), + flairBgColor: z.nullable(z.string()), + flairColor: z.nullable(z.string()), + flairGroupId: z.nullable(z.string()).optional(), + flairName: z.nullable(z.string()), + flairUrl: z.nullable(z.string()), + hidden: z.boolean(), + id: z.number().int(), + incomingLinkCount: z.number().int(), + mentionedUsers: z.array(z.any()).optional(), + moderator: z.boolean(), + name: z.nullable(z.string()), + postNumber: z.number().int(), + postType: z.number().int(), + primaryGroupName: z.nullable(z.string()), + quoteCount: z.number().int(), + raw: z.string().optional(), + readersCount: z.number().int(), + reads: z.number().int(), + replyCount: z.number().int(), + replyToPostNumber: z.nullable(z.string()), + reviewableId: z.nullable(z.string()), + reviewableScoreCount: z.number().int(), + reviewableScorePendingCount: z.number().int(), + score: z.number().int(), + staff: z.boolean(), + topicId: z.number().int(), + topicSlug: z.string(), + trustLevel: z.number().int(), + updatedAt: z.string(), + userDeleted: z.boolean(), + userId: z.number().int(), + userTitle: z.nullable(z.string()), + username: z.string(), + version: z.number().int(), + wiki: z.boolean(), + yours: z.boolean(), + }) + .transform((v) => { + return remap$(v, { + actionsSummary: "actions_summary", + avatarTemplate: "avatar_template", + canDelete: "can_delete", + canEdit: "can_edit", + canRecover: "can_recover", + canSeeHiddenPost: "can_see_hidden_post", + canViewEditHistory: "can_view_edit_history", + canWiki: "can_wiki", + createdAt: "created_at", + deletedAt: "deleted_at", + displayUsername: "display_username", + draftSequence: "draft_sequence", + editReason: "edit_reason", + flairBgColor: "flair_bg_color", + flairColor: "flair_color", + flairGroupId: "flair_group_id", + flairName: "flair_name", + flairUrl: "flair_url", + incomingLinkCount: "incoming_link_count", + mentionedUsers: "mentioned_users", + postNumber: "post_number", + postType: "post_type", + primaryGroupName: "primary_group_name", + quoteCount: "quote_count", + readersCount: "readers_count", + replyCount: "reply_count", + replyToPostNumber: "reply_to_post_number", + reviewableId: "reviewable_id", + reviewableScoreCount: "reviewable_score_count", + reviewableScorePendingCount: "reviewable_score_pending_count", + topicId: "topic_id", + topicSlug: "topic_slug", + trustLevel: "trust_level", + updatedAt: "updated_at", + userDeleted: "user_deleted", + userId: "user_id", + userTitle: "user_title", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateTopicPostPMResponseBody$ { + /** @deprecated use `CreateTopicPostPMResponseBody$inboundSchema` instead. */ + export const inboundSchema = CreateTopicPostPMResponseBody$inboundSchema; + /** @deprecated use `CreateTopicPostPMResponseBody$outboundSchema` instead. */ + export const outboundSchema = CreateTopicPostPMResponseBody$outboundSchema; + /** @deprecated use `CreateTopicPostPMResponseBody$Outbound` instead. */ + export type Outbound = CreateTopicPostPMResponseBody$Outbound; } diff --git a/src/sdk/models/operations/createtopictimer.ts b/src/sdk/models/operations/createtopictimer.ts index 6b7593c..f460b02 100644 --- a/src/sdk/models/operations/createtopictimer.ts +++ b/src/sdk/models/operations/createtopictimer.ts @@ -1,94 +1,221 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class CreateTopicTimerRequestBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "based_on_last_post" }) - basedOnLastPost?: boolean; +export type CreateTopicTimerRequestBody = { + basedOnLastPost?: boolean | undefined; + categoryId?: number | undefined; + statusType?: string | undefined; + time?: string | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "category_id" }) - categoryId?: number; - - @SpeakeasyMetadata() - @Expose({ name: "status_type" }) - statusType?: string; - - @SpeakeasyMetadata() - @Expose({ name: "time" }) - time?: string; -} - -export class CreateTopicTimerRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Key" }) +export type CreateTopicTimerRequest = { apiKey: string; - - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Username" }) apiUsername: string; - - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) + requestBody?: CreateTopicTimerRequestBody | undefined; id: string; - - @SpeakeasyMetadata({ data: "request, media_type=application/json" }) - requestBody?: CreateTopicTimerRequestBody; -} +}; /** * topic updated */ -export class CreateTopicTimerResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "based_on_last_post" }) - basedOnLastPost?: boolean; +export type CreateTopicTimerResponseBody = { + basedOnLastPost?: boolean | undefined; + categoryId?: string | null | undefined; + closed?: boolean | undefined; + duration?: string | null | undefined; + executeAt?: string | undefined; + success?: string | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "category_id" }) - categoryId?: string; +/** @internal */ +export const CreateTopicTimerRequestBody$inboundSchema: z.ZodType< + CreateTopicTimerRequestBody, + z.ZodTypeDef, + unknown +> = z + .object({ + based_on_last_post: z.boolean().optional(), + category_id: z.number().int().optional(), + status_type: z.string().optional(), + time: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + based_on_last_post: "basedOnLastPost", + category_id: "categoryId", + status_type: "statusType", + }); + }); - @SpeakeasyMetadata() - @Expose({ name: "closed" }) - closed?: boolean; +/** @internal */ +export type CreateTopicTimerRequestBody$Outbound = { + based_on_last_post?: boolean | undefined; + category_id?: number | undefined; + status_type?: string | undefined; + time?: string | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "duration" }) - duration?: string; +/** @internal */ +export const CreateTopicTimerRequestBody$outboundSchema: z.ZodType< + CreateTopicTimerRequestBody$Outbound, + z.ZodTypeDef, + CreateTopicTimerRequestBody +> = z + .object({ + basedOnLastPost: z.boolean().optional(), + categoryId: z.number().int().optional(), + statusType: z.string().optional(), + time: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + basedOnLastPost: "based_on_last_post", + categoryId: "category_id", + statusType: "status_type", + }); + }); - @SpeakeasyMetadata() - @Expose({ name: "execute_at" }) - executeAt?: string; - - @SpeakeasyMetadata() - @Expose({ name: "success" }) - success?: string; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateTopicTimerRequestBody$ { + /** @deprecated use `CreateTopicTimerRequestBody$inboundSchema` instead. */ + export const inboundSchema = CreateTopicTimerRequestBody$inboundSchema; + /** @deprecated use `CreateTopicTimerRequestBody$outboundSchema` instead. */ + export const outboundSchema = CreateTopicTimerRequestBody$outboundSchema; + /** @deprecated use `CreateTopicTimerRequestBody$Outbound` instead. */ + export type Outbound = CreateTopicTimerRequestBody$Outbound; } -export class CreateTopicTimerResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const CreateTopicTimerRequest$inboundSchema: z.ZodType< + CreateTopicTimerRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + "Api-Key": z.string(), + "Api-Username": z.string(), + RequestBody: z.lazy(() => CreateTopicTimerRequestBody$inboundSchema).optional(), + id: z.string(), + }) + .transform((v) => { + return remap$(v, { + "Api-Key": "apiKey", + "Api-Username": "apiUsername", + RequestBody: "requestBody", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type CreateTopicTimerRequest$Outbound = { + "Api-Key": string; + "Api-Username": string; + RequestBody?: CreateTopicTimerRequestBody$Outbound | undefined; + id: string; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const CreateTopicTimerRequest$outboundSchema: z.ZodType< + CreateTopicTimerRequest$Outbound, + z.ZodTypeDef, + CreateTopicTimerRequest +> = z + .object({ + apiKey: z.string(), + apiUsername: z.string(), + requestBody: z.lazy(() => CreateTopicTimerRequestBody$outboundSchema).optional(), + id: z.string(), + }) + .transform((v) => { + return remap$(v, { + apiKey: "Api-Key", + apiUsername: "Api-Username", + requestBody: "RequestBody", + }); + }); - /** - * topic updated - */ - @SpeakeasyMetadata() - object?: CreateTopicTimerResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateTopicTimerRequest$ { + /** @deprecated use `CreateTopicTimerRequest$inboundSchema` instead. */ + export const inboundSchema = CreateTopicTimerRequest$inboundSchema; + /** @deprecated use `CreateTopicTimerRequest$outboundSchema` instead. */ + export const outboundSchema = CreateTopicTimerRequest$outboundSchema; + /** @deprecated use `CreateTopicTimerRequest$Outbound` instead. */ + export type Outbound = CreateTopicTimerRequest$Outbound; +} + +/** @internal */ +export const CreateTopicTimerResponseBody$inboundSchema: z.ZodType< + CreateTopicTimerResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + based_on_last_post: z.boolean().optional(), + category_id: z.nullable(z.string()).optional(), + closed: z.boolean().optional(), + duration: z.nullable(z.string()).optional(), + execute_at: z.string().optional(), + success: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + based_on_last_post: "basedOnLastPost", + category_id: "categoryId", + execute_at: "executeAt", + }); + }); + +/** @internal */ +export type CreateTopicTimerResponseBody$Outbound = { + based_on_last_post?: boolean | undefined; + category_id?: string | null | undefined; + closed?: boolean | undefined; + duration?: string | null | undefined; + execute_at?: string | undefined; + success?: string | undefined; +}; + +/** @internal */ +export const CreateTopicTimerResponseBody$outboundSchema: z.ZodType< + CreateTopicTimerResponseBody$Outbound, + z.ZodTypeDef, + CreateTopicTimerResponseBody +> = z + .object({ + basedOnLastPost: z.boolean().optional(), + categoryId: z.nullable(z.string()).optional(), + closed: z.boolean().optional(), + duration: z.nullable(z.string()).optional(), + executeAt: z.string().optional(), + success: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + basedOnLastPost: "based_on_last_post", + categoryId: "category_id", + executeAt: "execute_at", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateTopicTimerResponseBody$ { + /** @deprecated use `CreateTopicTimerResponseBody$inboundSchema` instead. */ + export const inboundSchema = CreateTopicTimerResponseBody$inboundSchema; + /** @deprecated use `CreateTopicTimerResponseBody$outboundSchema` instead. */ + export const outboundSchema = CreateTopicTimerResponseBody$outboundSchema; + /** @deprecated use `CreateTopicTimerResponseBody$Outbound` instead. */ + export type Outbound = CreateTopicTimerResponseBody$Outbound; } diff --git a/src/sdk/models/operations/createupload.ts b/src/sdk/models/operations/createupload.ts index ea0c96b..050dc19 100644 --- a/src/sdk/models/operations/createupload.ts +++ b/src/sdk/models/operations/createupload.ts @@ -1,130 +1,265 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose } from "class-transformer"; +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 class File extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "multipart_form, content=true" }) - content: Uint8Array; - - @SpeakeasyMetadata({ data: "multipart_form, name=file" }) +export type FileT = { + content: Uint8Array | string; fileName: string; -} +}; -export enum TypeT { - Avatar = "avatar", - ProfileBackground = "profile_background", - CardBackground = "card_background", - CustomEmoji = "custom_emoji", - Composer = "composer", -} - -export class CreateUploadRequestBody extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "multipart_form, file=true" }) - file?: File; +export const Type = { + Avatar: "avatar", + ProfileBackground: "profile_background", + CardBackground: "card_background", + CustomEmoji: "custom_emoji", + Composer: "composer", +} as const; +export type Type = ClosedEnum; +export type CreateUploadRequestBody = { + type: Type; + file?: FileT | Blob | undefined; /** * Use this flag to return an id and url */ - @SpeakeasyMetadata({ data: "multipart_form, name=synchronous" }) - synchronous?: boolean; - - @SpeakeasyMetadata({ data: "multipart_form, name=type" }) - type: TypeT; - + synchronous?: boolean | undefined; /** * required if uploading an avatar */ - @SpeakeasyMetadata({ data: "multipart_form, name=user_id" }) - userId?: number; -} + userId?: number | undefined; +}; /** * file uploaded */ -export class CreateUploadResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "dominant_color" }) - dominantColor?: string; - - @SpeakeasyMetadata() - @Expose({ name: "extension" }) +export type CreateUploadResponseBody = { + dominantColor?: string | null | undefined; extension: string; - - @SpeakeasyMetadata() - @Expose({ name: "filesize" }) filesize: number; - - @SpeakeasyMetadata() - @Expose({ name: "height" }) height: number; - - @SpeakeasyMetadata() - @Expose({ name: "human_filesize" }) humanFilesize: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "original_filename" }) originalFilename: string; - - @SpeakeasyMetadata() - @Expose({ name: "retain_hours" }) - retainHours: string; - - @SpeakeasyMetadata() - @Expose({ name: "short_path" }) + retainHours: string | null; shortPath: string; - - @SpeakeasyMetadata() - @Expose({ name: "short_url" }) shortUrl: string; - - @SpeakeasyMetadata() - @Expose({ name: "thumbnail_height" }) thumbnailHeight: number; - - @SpeakeasyMetadata() - @Expose({ name: "thumbnail_width" }) thumbnailWidth: number; - - @SpeakeasyMetadata() - @Expose({ name: "url" }) url: string; - - @SpeakeasyMetadata() - @Expose({ name: "width" }) width: number; +}; + +/** @internal */ +export const FileT$inboundSchema: z.ZodType = z.object({ + content: b64$.zodInbound, + fileName: z.string(), +}); + +/** @internal */ +export type FileT$Outbound = { + content: Uint8Array; + fileName: string; +}; + +/** @internal */ +export const FileT$outboundSchema: z.ZodType = z.object({ + content: b64$.zodOutbound, + fileName: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace FileT$ { + /** @deprecated use `FileT$inboundSchema` instead. */ + export const inboundSchema = FileT$inboundSchema; + /** @deprecated use `FileT$outboundSchema` instead. */ + export const outboundSchema = FileT$outboundSchema; + /** @deprecated use `FileT$Outbound` instead. */ + export type Outbound = FileT$Outbound; } -export class CreateUploadResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const Type$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Type); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export const Type$outboundSchema: z.ZodNativeEnum = Type$inboundSchema; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; - - /** - * file uploaded - */ - @SpeakeasyMetadata() - object?: CreateUploadResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Type$ { + /** @deprecated use `Type$inboundSchema` instead. */ + export const inboundSchema = Type$inboundSchema; + /** @deprecated use `Type$outboundSchema` instead. */ + export const outboundSchema = Type$outboundSchema; +} + +/** @internal */ +export const CreateUploadRequestBody$inboundSchema: z.ZodType< + CreateUploadRequestBody, + z.ZodTypeDef, + unknown +> = z + .object({ + type: Type$inboundSchema, + file: z.lazy(() => FileT$inboundSchema).optional(), + synchronous: z.boolean().optional(), + user_id: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + user_id: "userId", + }); + }); + +/** @internal */ +export type CreateUploadRequestBody$Outbound = { + type: string; + file?: FileT$Outbound | Blob | undefined; + synchronous?: boolean | undefined; + user_id?: number | undefined; +}; + +/** @internal */ +export const CreateUploadRequestBody$outboundSchema: z.ZodType< + CreateUploadRequestBody$Outbound, + z.ZodTypeDef, + CreateUploadRequestBody +> = z + .object({ + type: Type$outboundSchema, + file: z + .lazy(() => FileT$outboundSchema) + .or(blobLikeSchema) + .optional(), + synchronous: z.boolean().optional(), + userId: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + userId: "user_id", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateUploadRequestBody$ { + /** @deprecated use `CreateUploadRequestBody$inboundSchema` instead. */ + export const inboundSchema = CreateUploadRequestBody$inboundSchema; + /** @deprecated use `CreateUploadRequestBody$outboundSchema` instead. */ + export const outboundSchema = CreateUploadRequestBody$outboundSchema; + /** @deprecated use `CreateUploadRequestBody$Outbound` instead. */ + export type Outbound = CreateUploadRequestBody$Outbound; +} + +/** @internal */ +export const CreateUploadResponseBody$inboundSchema: z.ZodType< + CreateUploadResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + dominant_color: z.nullable(z.string()).optional(), + extension: z.string(), + filesize: z.number().int(), + height: z.number().int(), + human_filesize: z.string(), + id: z.number().int(), + original_filename: z.string(), + retain_hours: z.nullable(z.string()), + short_path: z.string(), + short_url: z.string(), + thumbnail_height: z.number().int(), + thumbnail_width: z.number().int(), + url: z.string(), + width: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + dominant_color: "dominantColor", + human_filesize: "humanFilesize", + original_filename: "originalFilename", + retain_hours: "retainHours", + short_path: "shortPath", + short_url: "shortUrl", + thumbnail_height: "thumbnailHeight", + thumbnail_width: "thumbnailWidth", + }); + }); + +/** @internal */ +export type CreateUploadResponseBody$Outbound = { + dominant_color?: string | null | undefined; + extension: string; + filesize: number; + height: number; + human_filesize: string; + id: number; + original_filename: string; + retain_hours: string | null; + short_path: string; + short_url: string; + thumbnail_height: number; + thumbnail_width: number; + url: string; + width: number; +}; + +/** @internal */ +export const CreateUploadResponseBody$outboundSchema: z.ZodType< + CreateUploadResponseBody$Outbound, + z.ZodTypeDef, + CreateUploadResponseBody +> = z + .object({ + dominantColor: z.nullable(z.string()).optional(), + extension: z.string(), + filesize: z.number().int(), + height: z.number().int(), + humanFilesize: z.string(), + id: z.number().int(), + originalFilename: z.string(), + retainHours: z.nullable(z.string()), + shortPath: z.string(), + shortUrl: z.string(), + thumbnailHeight: z.number().int(), + thumbnailWidth: z.number().int(), + url: z.string(), + width: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + dominantColor: "dominant_color", + humanFilesize: "human_filesize", + originalFilename: "original_filename", + retainHours: "retain_hours", + shortPath: "short_path", + shortUrl: "short_url", + thumbnailHeight: "thumbnail_height", + thumbnailWidth: "thumbnail_width", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateUploadResponseBody$ { + /** @deprecated use `CreateUploadResponseBody$inboundSchema` instead. */ + export const inboundSchema = CreateUploadResponseBody$inboundSchema; + /** @deprecated use `CreateUploadResponseBody$outboundSchema` instead. */ + export const outboundSchema = CreateUploadResponseBody$outboundSchema; + /** @deprecated use `CreateUploadResponseBody$Outbound` instead. */ + export type Outbound = CreateUploadResponseBody$Outbound; } diff --git a/src/sdk/models/operations/createuser.ts b/src/sdk/models/operations/createuser.ts index a678b4a..69464f6 100644 --- a/src/sdk/models/operations/createuser.ts +++ b/src/sdk/models/operations/createuser.ts @@ -1,105 +1,249 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class ExternalIds extends SpeakeasyBase {} +export type ExternalIds = {}; -export class CreateUserRequestBody extends SpeakeasyBase { +export type CreateUserRequestBody = { /** * This param requires an api key in the request header or it will be ignored */ - @SpeakeasyMetadata() - @Expose({ name: "active" }) - active?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "approved" }) - approved?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "email" }) + active?: boolean | undefined; + approved?: boolean | undefined; email: string; - - @SpeakeasyMetadata() - @Expose({ name: "external_ids" }) - @Type(() => ExternalIds) - externalIds?: ExternalIds; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) + externalIds?: ExternalIds | undefined; name: string; - - @SpeakeasyMetadata() - @Expose({ name: "password" }) password: string; - - @SpeakeasyMetadata() - @Expose({ name: "user_fields[1]" }) - userFields1?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) + userFields1?: boolean | undefined; username: string; -} +}; -export class CreateUserRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Key" }) +export type CreateUserRequest = { apiKey: string; - - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Username" }) apiUsername: string; - - @SpeakeasyMetadata({ data: "request, media_type=application/json" }) - requestBody?: CreateUserRequestBody; -} + requestBody?: CreateUserRequestBody | undefined; +}; /** * user created */ -export class CreateUserResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "active" }) +export type CreateUserResponseBody = { active: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "message" }) message: string; - - @SpeakeasyMetadata() - @Expose({ name: "success" }) success: boolean; + userId?: number | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "user_id" }) - userId?: number; +/** @internal */ +export const ExternalIds$inboundSchema: z.ZodType = z.object( + {} +); + +/** @internal */ +export type ExternalIds$Outbound = {}; + +/** @internal */ +export const ExternalIds$outboundSchema: z.ZodType< + ExternalIds$Outbound, + z.ZodTypeDef, + ExternalIds +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ExternalIds$ { + /** @deprecated use `ExternalIds$inboundSchema` instead. */ + export const inboundSchema = ExternalIds$inboundSchema; + /** @deprecated use `ExternalIds$outboundSchema` instead. */ + export const outboundSchema = ExternalIds$outboundSchema; + /** @deprecated use `ExternalIds$Outbound` instead. */ + export type Outbound = ExternalIds$Outbound; } -export class CreateUserResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const CreateUserRequestBody$inboundSchema: z.ZodType< + CreateUserRequestBody, + z.ZodTypeDef, + unknown +> = z + .object({ + active: z.boolean().optional(), + approved: z.boolean().optional(), + email: z.string(), + external_ids: z.lazy(() => ExternalIds$inboundSchema).optional(), + name: z.string(), + password: z.string(), + "user_fields[1]": z.boolean().optional(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + external_ids: "externalIds", + "user_fields[1]": "userFields1", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type CreateUserRequestBody$Outbound = { + active?: boolean | undefined; + approved?: boolean | undefined; + email: string; + external_ids?: ExternalIds$Outbound | undefined; + name: string; + password: string; + "user_fields[1]"?: boolean | undefined; + username: string; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const CreateUserRequestBody$outboundSchema: z.ZodType< + CreateUserRequestBody$Outbound, + z.ZodTypeDef, + CreateUserRequestBody +> = z + .object({ + active: z.boolean().optional(), + approved: z.boolean().optional(), + email: z.string(), + externalIds: z.lazy(() => ExternalIds$outboundSchema).optional(), + name: z.string(), + password: z.string(), + userFields1: z.boolean().optional(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + externalIds: "external_ids", + userFields1: "user_fields[1]", + }); + }); - /** - * user created - */ - @SpeakeasyMetadata() - object?: CreateUserResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateUserRequestBody$ { + /** @deprecated use `CreateUserRequestBody$inboundSchema` instead. */ + export const inboundSchema = CreateUserRequestBody$inboundSchema; + /** @deprecated use `CreateUserRequestBody$outboundSchema` instead. */ + export const outboundSchema = CreateUserRequestBody$outboundSchema; + /** @deprecated use `CreateUserRequestBody$Outbound` instead. */ + export type Outbound = CreateUserRequestBody$Outbound; +} + +/** @internal */ +export const CreateUserRequest$inboundSchema: z.ZodType = + z + .object({ + "Api-Key": z.string(), + "Api-Username": z.string(), + RequestBody: z.lazy(() => CreateUserRequestBody$inboundSchema).optional(), + }) + .transform((v) => { + return remap$(v, { + "Api-Key": "apiKey", + "Api-Username": "apiUsername", + RequestBody: "requestBody", + }); + }); + +/** @internal */ +export type CreateUserRequest$Outbound = { + "Api-Key": string; + "Api-Username": string; + RequestBody?: CreateUserRequestBody$Outbound | undefined; +}; + +/** @internal */ +export const CreateUserRequest$outboundSchema: z.ZodType< + CreateUserRequest$Outbound, + z.ZodTypeDef, + CreateUserRequest +> = z + .object({ + apiKey: z.string(), + apiUsername: z.string(), + requestBody: z.lazy(() => CreateUserRequestBody$outboundSchema).optional(), + }) + .transform((v) => { + return remap$(v, { + apiKey: "Api-Key", + apiUsername: "Api-Username", + requestBody: "RequestBody", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateUserRequest$ { + /** @deprecated use `CreateUserRequest$inboundSchema` instead. */ + export const inboundSchema = CreateUserRequest$inboundSchema; + /** @deprecated use `CreateUserRequest$outboundSchema` instead. */ + export const outboundSchema = CreateUserRequest$outboundSchema; + /** @deprecated use `CreateUserRequest$Outbound` instead. */ + export type Outbound = CreateUserRequest$Outbound; +} + +/** @internal */ +export const CreateUserResponseBody$inboundSchema: z.ZodType< + CreateUserResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + active: z.boolean(), + message: z.string(), + success: z.boolean(), + user_id: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + user_id: "userId", + }); + }); + +/** @internal */ +export type CreateUserResponseBody$Outbound = { + active: boolean; + message: string; + success: boolean; + user_id?: number | undefined; +}; + +/** @internal */ +export const CreateUserResponseBody$outboundSchema: z.ZodType< + CreateUserResponseBody$Outbound, + z.ZodTypeDef, + CreateUserResponseBody +> = z + .object({ + active: z.boolean(), + message: z.string(), + success: z.boolean(), + userId: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + userId: "user_id", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateUserResponseBody$ { + /** @deprecated use `CreateUserResponseBody$inboundSchema` instead. */ + export const inboundSchema = CreateUserResponseBody$inboundSchema; + /** @deprecated use `CreateUserResponseBody$outboundSchema` instead. */ + export const outboundSchema = CreateUserResponseBody$outboundSchema; + /** @deprecated use `CreateUserResponseBody$Outbound` instead. */ + export type Outbound = CreateUserResponseBody$Outbound; } diff --git a/src/sdk/models/operations/deactivateuser.ts b/src/sdk/models/operations/deactivateuser.ts index a62a7dc..88cddfb 100644 --- a/src/sdk/models/operations/deactivateuser.ts +++ b/src/sdk/models/operations/deactivateuser.ts @@ -1,47 +1,88 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose } from "class-transformer"; +import * as z from "zod"; -export class DeactivateUserRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) +export type DeactivateUserRequest = { id: number; -} +}; /** * response */ -export class DeactivateUserResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "success" }) +export type DeactivateUserResponseBody = { success: string; +}; + +/** @internal */ +export const DeactivateUserRequest$inboundSchema: z.ZodType< + DeactivateUserRequest, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.number().int(), +}); + +/** @internal */ +export type DeactivateUserRequest$Outbound = { + id: number; +}; + +/** @internal */ +export const DeactivateUserRequest$outboundSchema: z.ZodType< + DeactivateUserRequest$Outbound, + z.ZodTypeDef, + DeactivateUserRequest +> = z.object({ + id: z.number().int(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DeactivateUserRequest$ { + /** @deprecated use `DeactivateUserRequest$inboundSchema` instead. */ + export const inboundSchema = DeactivateUserRequest$inboundSchema; + /** @deprecated use `DeactivateUserRequest$outboundSchema` instead. */ + export const outboundSchema = DeactivateUserRequest$outboundSchema; + /** @deprecated use `DeactivateUserRequest$Outbound` instead. */ + export type Outbound = DeactivateUserRequest$Outbound; } -export class DeactivateUserResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const DeactivateUserResponseBody$inboundSchema: z.ZodType< + DeactivateUserResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + success: z.string(), +}); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type DeactivateUserResponseBody$Outbound = { + success: string; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const DeactivateUserResponseBody$outboundSchema: z.ZodType< + DeactivateUserResponseBody$Outbound, + z.ZodTypeDef, + DeactivateUserResponseBody +> = z.object({ + success: z.string(), +}); - /** - * response - */ - @SpeakeasyMetadata() - object?: DeactivateUserResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DeactivateUserResponseBody$ { + /** @deprecated use `DeactivateUserResponseBody$inboundSchema` instead. */ + export const inboundSchema = DeactivateUserResponseBody$inboundSchema; + /** @deprecated use `DeactivateUserResponseBody$outboundSchema` instead. */ + export const outboundSchema = DeactivateUserResponseBody$outboundSchema; + /** @deprecated use `DeactivateUserResponseBody$Outbound` instead. */ + export type Outbound = DeactivateUserResponseBody$Outbound; } diff --git a/src/sdk/models/operations/deletebadge.ts b/src/sdk/models/operations/deletebadge.ts index a19cd25..45c34bf 100644 --- a/src/sdk/models/operations/deletebadge.ts +++ b/src/sdk/models/operations/deletebadge.ts @@ -1,31 +1,45 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; +import * as z from "zod"; -export class DeleteBadgeRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) +export type DeleteBadgeRequest = { id: number; -} - -export class DeleteBadgeResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; - - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; - - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +}; + +/** @internal */ +export const DeleteBadgeRequest$inboundSchema: z.ZodType< + DeleteBadgeRequest, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.number().int(), +}); + +/** @internal */ +export type DeleteBadgeRequest$Outbound = { + id: number; +}; + +/** @internal */ +export const DeleteBadgeRequest$outboundSchema: z.ZodType< + DeleteBadgeRequest$Outbound, + z.ZodTypeDef, + DeleteBadgeRequest +> = z.object({ + id: z.number().int(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DeleteBadgeRequest$ { + /** @deprecated use `DeleteBadgeRequest$inboundSchema` instead. */ + export const inboundSchema = DeleteBadgeRequest$inboundSchema; + /** @deprecated use `DeleteBadgeRequest$outboundSchema` instead. */ + export const outboundSchema = DeleteBadgeRequest$outboundSchema; + /** @deprecated use `DeleteBadgeRequest$Outbound` instead. */ + export type Outbound = DeleteBadgeRequest$Outbound; } diff --git a/src/sdk/models/operations/deletegroup.ts b/src/sdk/models/operations/deletegroup.ts index 87e889b..4790082 100644 --- a/src/sdk/models/operations/deletegroup.ts +++ b/src/sdk/models/operations/deletegroup.ts @@ -1,47 +1,88 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose } from "class-transformer"; +import * as z from "zod"; -export class DeleteGroupRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) +export type DeleteGroupRequest = { id: number; -} +}; /** * response */ -export class DeleteGroupResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "success" }) +export type DeleteGroupResponseBody = { success: string; +}; + +/** @internal */ +export const DeleteGroupRequest$inboundSchema: z.ZodType< + DeleteGroupRequest, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.number().int(), +}); + +/** @internal */ +export type DeleteGroupRequest$Outbound = { + id: number; +}; + +/** @internal */ +export const DeleteGroupRequest$outboundSchema: z.ZodType< + DeleteGroupRequest$Outbound, + z.ZodTypeDef, + DeleteGroupRequest +> = z.object({ + id: z.number().int(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DeleteGroupRequest$ { + /** @deprecated use `DeleteGroupRequest$inboundSchema` instead. */ + export const inboundSchema = DeleteGroupRequest$inboundSchema; + /** @deprecated use `DeleteGroupRequest$outboundSchema` instead. */ + export const outboundSchema = DeleteGroupRequest$outboundSchema; + /** @deprecated use `DeleteGroupRequest$Outbound` instead. */ + export type Outbound = DeleteGroupRequest$Outbound; } -export class DeleteGroupResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const DeleteGroupResponseBody$inboundSchema: z.ZodType< + DeleteGroupResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + success: z.string(), +}); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type DeleteGroupResponseBody$Outbound = { + success: string; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const DeleteGroupResponseBody$outboundSchema: z.ZodType< + DeleteGroupResponseBody$Outbound, + z.ZodTypeDef, + DeleteGroupResponseBody +> = z.object({ + success: z.string(), +}); - /** - * response - */ - @SpeakeasyMetadata() - object?: DeleteGroupResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DeleteGroupResponseBody$ { + /** @deprecated use `DeleteGroupResponseBody$inboundSchema` instead. */ + export const inboundSchema = DeleteGroupResponseBody$inboundSchema; + /** @deprecated use `DeleteGroupResponseBody$outboundSchema` instead. */ + export const outboundSchema = DeleteGroupResponseBody$outboundSchema; + /** @deprecated use `DeleteGroupResponseBody$Outbound` instead. */ + export type Outbound = DeleteGroupResponseBody$Outbound; } diff --git a/src/sdk/models/operations/deletepost.ts b/src/sdk/models/operations/deletepost.ts index 269d6e7..886d33a 100644 --- a/src/sdk/models/operations/deletepost.ts +++ b/src/sdk/models/operations/deletepost.ts @@ -1,44 +1,114 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class DeletePostRequestBody extends SpeakeasyBase { +export type DeletePostRequestBody = { /** * The `SiteSetting.can_permanently_delete` needs to be enabled first before this param can be used. Also this endpoint needs to be called first without `force_destroy` and then followed up with a second call 5 minutes later with `force_destroy` to permanently delete. */ - @SpeakeasyMetadata() - @Expose({ name: "force_destroy" }) - forceDestroy?: boolean; -} + forceDestroy?: boolean | undefined; +}; -export class DeletePostRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) +export type DeletePostRequest = { + requestBody?: DeletePostRequestBody | undefined; id: number; +}; - @SpeakeasyMetadata({ data: "request, media_type=application/json" }) - requestBody?: DeletePostRequestBody; +/** @internal */ +export const DeletePostRequestBody$inboundSchema: z.ZodType< + DeletePostRequestBody, + z.ZodTypeDef, + unknown +> = z + .object({ + force_destroy: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + force_destroy: "forceDestroy", + }); + }); + +/** @internal */ +export type DeletePostRequestBody$Outbound = { + force_destroy?: boolean | undefined; +}; + +/** @internal */ +export const DeletePostRequestBody$outboundSchema: z.ZodType< + DeletePostRequestBody$Outbound, + z.ZodTypeDef, + DeletePostRequestBody +> = z + .object({ + forceDestroy: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + forceDestroy: "force_destroy", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DeletePostRequestBody$ { + /** @deprecated use `DeletePostRequestBody$inboundSchema` instead. */ + export const inboundSchema = DeletePostRequestBody$inboundSchema; + /** @deprecated use `DeletePostRequestBody$outboundSchema` instead. */ + export const outboundSchema = DeletePostRequestBody$outboundSchema; + /** @deprecated use `DeletePostRequestBody$Outbound` instead. */ + export type Outbound = DeletePostRequestBody$Outbound; } -export class DeletePostResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const DeletePostRequest$inboundSchema: z.ZodType = + z + .object({ + RequestBody: z.lazy(() => DeletePostRequestBody$inboundSchema).optional(), + id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + RequestBody: "requestBody", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type DeletePostRequest$Outbound = { + RequestBody?: DeletePostRequestBody$Outbound | undefined; + id: number; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const DeletePostRequest$outboundSchema: z.ZodType< + DeletePostRequest$Outbound, + z.ZodTypeDef, + DeletePostRequest +> = z + .object({ + requestBody: z.lazy(() => DeletePostRequestBody$outboundSchema).optional(), + id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + requestBody: "RequestBody", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DeletePostRequest$ { + /** @deprecated use `DeletePostRequest$inboundSchema` instead. */ + export const inboundSchema = DeletePostRequest$inboundSchema; + /** @deprecated use `DeletePostRequest$outboundSchema` instead. */ + export const outboundSchema = DeletePostRequest$outboundSchema; + /** @deprecated use `DeletePostRequest$Outbound` instead. */ + export type Outbound = DeletePostRequest$Outbound; } diff --git a/src/sdk/models/operations/deleteuser.ts b/src/sdk/models/operations/deleteuser.ts index af16e5b..0ac3d83 100644 --- a/src/sdk/models/operations/deleteuser.ts +++ b/src/sdk/models/operations/deleteuser.ts @@ -1,68 +1,172 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class DeleteUserRequestBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "block_email" }) - blockEmail?: boolean; +export type DeleteUserRequestBody = { + blockEmail?: boolean | undefined; + blockIp?: boolean | undefined; + blockUrls?: boolean | undefined; + deletePosts?: boolean | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "block_ip" }) - blockIp?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "block_urls" }) - blockUrls?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "delete_posts" }) - deletePosts?: boolean; -} - -export class DeleteUserRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) +export type DeleteUserRequest = { + requestBody?: DeleteUserRequestBody | undefined; id: number; - - @SpeakeasyMetadata({ data: "request, media_type=application/json" }) - requestBody?: DeleteUserRequestBody; -} +}; /** * response */ -export class DeleteUserResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "deleted" }) +export type DeleteUserResponseBody = { deleted: boolean; +}; + +/** @internal */ +export const DeleteUserRequestBody$inboundSchema: z.ZodType< + DeleteUserRequestBody, + z.ZodTypeDef, + unknown +> = z + .object({ + block_email: z.boolean().optional(), + block_ip: z.boolean().optional(), + block_urls: z.boolean().optional(), + delete_posts: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + block_email: "blockEmail", + block_ip: "blockIp", + block_urls: "blockUrls", + delete_posts: "deletePosts", + }); + }); + +/** @internal */ +export type DeleteUserRequestBody$Outbound = { + block_email?: boolean | undefined; + block_ip?: boolean | undefined; + block_urls?: boolean | undefined; + delete_posts?: boolean | undefined; +}; + +/** @internal */ +export const DeleteUserRequestBody$outboundSchema: z.ZodType< + DeleteUserRequestBody$Outbound, + z.ZodTypeDef, + DeleteUserRequestBody +> = z + .object({ + blockEmail: z.boolean().optional(), + blockIp: z.boolean().optional(), + blockUrls: z.boolean().optional(), + deletePosts: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + blockEmail: "block_email", + blockIp: "block_ip", + blockUrls: "block_urls", + deletePosts: "delete_posts", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DeleteUserRequestBody$ { + /** @deprecated use `DeleteUserRequestBody$inboundSchema` instead. */ + export const inboundSchema = DeleteUserRequestBody$inboundSchema; + /** @deprecated use `DeleteUserRequestBody$outboundSchema` instead. */ + export const outboundSchema = DeleteUserRequestBody$outboundSchema; + /** @deprecated use `DeleteUserRequestBody$Outbound` instead. */ + export type Outbound = DeleteUserRequestBody$Outbound; } -export class DeleteUserResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const DeleteUserRequest$inboundSchema: z.ZodType = + z + .object({ + RequestBody: z.lazy(() => DeleteUserRequestBody$inboundSchema).optional(), + id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + RequestBody: "requestBody", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type DeleteUserRequest$Outbound = { + RequestBody?: DeleteUserRequestBody$Outbound | undefined; + id: number; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const DeleteUserRequest$outboundSchema: z.ZodType< + DeleteUserRequest$Outbound, + z.ZodTypeDef, + DeleteUserRequest +> = z + .object({ + requestBody: z.lazy(() => DeleteUserRequestBody$outboundSchema).optional(), + id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + requestBody: "RequestBody", + }); + }); - /** - * response - */ - @SpeakeasyMetadata() - object?: DeleteUserResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DeleteUserRequest$ { + /** @deprecated use `DeleteUserRequest$inboundSchema` instead. */ + export const inboundSchema = DeleteUserRequest$inboundSchema; + /** @deprecated use `DeleteUserRequest$outboundSchema` instead. */ + export const outboundSchema = DeleteUserRequest$outboundSchema; + /** @deprecated use `DeleteUserRequest$Outbound` instead. */ + export type Outbound = DeleteUserRequest$Outbound; +} + +/** @internal */ +export const DeleteUserResponseBody$inboundSchema: z.ZodType< + DeleteUserResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + deleted: z.boolean(), +}); + +/** @internal */ +export type DeleteUserResponseBody$Outbound = { + deleted: boolean; +}; + +/** @internal */ +export const DeleteUserResponseBody$outboundSchema: z.ZodType< + DeleteUserResponseBody$Outbound, + z.ZodTypeDef, + DeleteUserResponseBody +> = z.object({ + deleted: z.boolean(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DeleteUserResponseBody$ { + /** @deprecated use `DeleteUserResponseBody$inboundSchema` instead. */ + export const inboundSchema = DeleteUserResponseBody$inboundSchema; + /** @deprecated use `DeleteUserResponseBody$outboundSchema` instead. */ + export const outboundSchema = DeleteUserResponseBody$outboundSchema; + /** @deprecated use `DeleteUserResponseBody$Outbound` instead. */ + export type Outbound = DeleteUserResponseBody$Outbound; } diff --git a/src/sdk/models/operations/downloadbackup.ts b/src/sdk/models/operations/downloadbackup.ts index 382f702..2870316 100644 --- a/src/sdk/models/operations/downloadbackup.ts +++ b/src/sdk/models/operations/downloadbackup.ts @@ -1,34 +1,49 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; +import * as z from "zod"; -export class DownloadBackupRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=filename" }) +export type DownloadBackupRequest = { filename: string; - - @SpeakeasyMetadata({ data: "queryParam, style=form;explode=true;name=token" }) token: string; -} - -export class DownloadBackupResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; - - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; - - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +}; + +/** @internal */ +export const DownloadBackupRequest$inboundSchema: z.ZodType< + DownloadBackupRequest, + z.ZodTypeDef, + unknown +> = z.object({ + filename: z.string(), + token: z.string(), +}); + +/** @internal */ +export type DownloadBackupRequest$Outbound = { + filename: string; + token: string; +}; + +/** @internal */ +export const DownloadBackupRequest$outboundSchema: z.ZodType< + DownloadBackupRequest$Outbound, + z.ZodTypeDef, + DownloadBackupRequest +> = z.object({ + filename: z.string(), + token: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DownloadBackupRequest$ { + /** @deprecated use `DownloadBackupRequest$inboundSchema` instead. */ + export const inboundSchema = DownloadBackupRequest$inboundSchema; + /** @deprecated use `DownloadBackupRequest$outboundSchema` instead. */ + export const outboundSchema = DownloadBackupRequest$outboundSchema; + /** @deprecated use `DownloadBackupRequest$Outbound` instead. */ + export type Outbound = DownloadBackupRequest$Outbound; } diff --git a/src/sdk/models/operations/generatepresignedput.ts b/src/sdk/models/operations/generatepresignedput.ts index 8e9e3a1..8727916 100644 --- a/src/sdk/models/operations/generatepresignedput.ts +++ b/src/sdk/models/operations/generatepresignedput.ts @@ -1,111 +1,274 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; -export class GeneratePresignedPutMetadata extends SpeakeasyBase { +export type GeneratePresignedPutMetadata = { /** * The SHA1 checksum of the upload binary blob. Optionally be provided and serves as an additional security check when later processing the file in complete-external-upload endpoint. */ - @SpeakeasyMetadata() - @Expose({ name: "sha1-checksum" }) - sha1Checksum?: string; -} + sha1Checksum?: string | undefined; +}; -export enum GeneratePresignedPutType { - Avatar = "avatar", - ProfileBackground = "profile_background", - CardBackground = "card_background", - CustomEmoji = "custom_emoji", - Composer = "composer", -} +export const GeneratePresignedPutType = { + Avatar: "avatar", + ProfileBackground: "profile_background", + CardBackground: "card_background", + CustomEmoji: "custom_emoji", + Composer: "composer", +} as const; +export type GeneratePresignedPutType = ClosedEnum; -export class GeneratePresignedPutRequestBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "file_name" }) +export type GeneratePresignedPutRequestBody = { fileName: string; - /** * File size should be represented in bytes. */ - @SpeakeasyMetadata() - @Expose({ name: "file_size" }) fileSize: number; - - @SpeakeasyMetadata() - @Expose({ name: "metadata" }) - @Type(() => GeneratePresignedPutMetadata) - metadata?: GeneratePresignedPutMetadata; - - @SpeakeasyMetadata() - @Expose({ name: "type" }) + metadata?: GeneratePresignedPutMetadata | undefined; type: GeneratePresignedPutType; -} +}; /** * A map of headers that must be sent with the PUT request. */ -export class SignedHeaders extends SpeakeasyBase {} +export type SignedHeaders = {}; /** * external upload initialized */ -export class GeneratePresignedPutResponseBody extends SpeakeasyBase { +export type GeneratePresignedPutResponseBody = { /** * The path of the temporary file on the external storage service. */ - @SpeakeasyMetadata() - @Expose({ name: "key" }) - key?: string; - + key?: string | undefined; /** * A map of headers that must be sent with the PUT request. */ - @SpeakeasyMetadata() - @Expose({ name: "signed_headers" }) - @Type(() => SignedHeaders) - signedHeaders?: SignedHeaders; - + signedHeaders?: SignedHeaders | undefined; /** * A unique string that identifies the external upload. This must be stored and then sent in the /complete-external-upload endpoint to complete the direct upload. */ - @SpeakeasyMetadata() - @Expose({ name: "unique_identifier" }) - uniqueIdentifier?: string; - + uniqueIdentifier?: string | undefined; /** * A presigned PUT URL which must be used to upload the file binary blob to. */ - @SpeakeasyMetadata() - @Expose({ name: "url" }) - url?: string; + url?: string | undefined; +}; + +/** @internal */ +export const GeneratePresignedPutMetadata$inboundSchema: z.ZodType< + GeneratePresignedPutMetadata, + z.ZodTypeDef, + unknown +> = z + .object({ + "sha1-checksum": z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + "sha1-checksum": "sha1Checksum", + }); + }); + +/** @internal */ +export type GeneratePresignedPutMetadata$Outbound = { + "sha1-checksum"?: string | undefined; +}; + +/** @internal */ +export const GeneratePresignedPutMetadata$outboundSchema: z.ZodType< + GeneratePresignedPutMetadata$Outbound, + z.ZodTypeDef, + GeneratePresignedPutMetadata +> = z + .object({ + sha1Checksum: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + sha1Checksum: "sha1-checksum", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GeneratePresignedPutMetadata$ { + /** @deprecated use `GeneratePresignedPutMetadata$inboundSchema` instead. */ + export const inboundSchema = GeneratePresignedPutMetadata$inboundSchema; + /** @deprecated use `GeneratePresignedPutMetadata$outboundSchema` instead. */ + export const outboundSchema = GeneratePresignedPutMetadata$outboundSchema; + /** @deprecated use `GeneratePresignedPutMetadata$Outbound` instead. */ + export type Outbound = GeneratePresignedPutMetadata$Outbound; } -export class GeneratePresignedPutResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const GeneratePresignedPutType$inboundSchema: z.ZodNativeEnum< + typeof GeneratePresignedPutType +> = z.nativeEnum(GeneratePresignedPutType); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export const GeneratePresignedPutType$outboundSchema: z.ZodNativeEnum< + typeof GeneratePresignedPutType +> = GeneratePresignedPutType$inboundSchema; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; - - /** - * external upload initialized - */ - @SpeakeasyMetadata() - object?: GeneratePresignedPutResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GeneratePresignedPutType$ { + /** @deprecated use `GeneratePresignedPutType$inboundSchema` instead. */ + export const inboundSchema = GeneratePresignedPutType$inboundSchema; + /** @deprecated use `GeneratePresignedPutType$outboundSchema` instead. */ + export const outboundSchema = GeneratePresignedPutType$outboundSchema; +} + +/** @internal */ +export const GeneratePresignedPutRequestBody$inboundSchema: z.ZodType< + GeneratePresignedPutRequestBody, + z.ZodTypeDef, + unknown +> = z + .object({ + file_name: z.string(), + file_size: z.number().int(), + metadata: z.lazy(() => GeneratePresignedPutMetadata$inboundSchema).optional(), + type: GeneratePresignedPutType$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + file_name: "fileName", + file_size: "fileSize", + }); + }); + +/** @internal */ +export type GeneratePresignedPutRequestBody$Outbound = { + file_name: string; + file_size: number; + metadata?: GeneratePresignedPutMetadata$Outbound | undefined; + type: string; +}; + +/** @internal */ +export const GeneratePresignedPutRequestBody$outboundSchema: z.ZodType< + GeneratePresignedPutRequestBody$Outbound, + z.ZodTypeDef, + GeneratePresignedPutRequestBody +> = z + .object({ + fileName: z.string(), + fileSize: z.number().int(), + metadata: z.lazy(() => GeneratePresignedPutMetadata$outboundSchema).optional(), + type: GeneratePresignedPutType$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + fileName: "file_name", + fileSize: "file_size", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GeneratePresignedPutRequestBody$ { + /** @deprecated use `GeneratePresignedPutRequestBody$inboundSchema` instead. */ + export const inboundSchema = GeneratePresignedPutRequestBody$inboundSchema; + /** @deprecated use `GeneratePresignedPutRequestBody$outboundSchema` instead. */ + export const outboundSchema = GeneratePresignedPutRequestBody$outboundSchema; + /** @deprecated use `GeneratePresignedPutRequestBody$Outbound` instead. */ + export type Outbound = GeneratePresignedPutRequestBody$Outbound; +} + +/** @internal */ +export const SignedHeaders$inboundSchema: z.ZodType = + z.object({}); + +/** @internal */ +export type SignedHeaders$Outbound = {}; + +/** @internal */ +export const SignedHeaders$outboundSchema: z.ZodType< + SignedHeaders$Outbound, + z.ZodTypeDef, + SignedHeaders +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SignedHeaders$ { + /** @deprecated use `SignedHeaders$inboundSchema` instead. */ + export const inboundSchema = SignedHeaders$inboundSchema; + /** @deprecated use `SignedHeaders$outboundSchema` instead. */ + export const outboundSchema = SignedHeaders$outboundSchema; + /** @deprecated use `SignedHeaders$Outbound` instead. */ + export type Outbound = SignedHeaders$Outbound; +} + +/** @internal */ +export const GeneratePresignedPutResponseBody$inboundSchema: z.ZodType< + GeneratePresignedPutResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + key: z.string().optional(), + signed_headers: z.lazy(() => SignedHeaders$inboundSchema).optional(), + unique_identifier: z.string().optional(), + url: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + signed_headers: "signedHeaders", + unique_identifier: "uniqueIdentifier", + }); + }); + +/** @internal */ +export type GeneratePresignedPutResponseBody$Outbound = { + key?: string | undefined; + signed_headers?: SignedHeaders$Outbound | undefined; + unique_identifier?: string | undefined; + url?: string | undefined; +}; + +/** @internal */ +export const GeneratePresignedPutResponseBody$outboundSchema: z.ZodType< + GeneratePresignedPutResponseBody$Outbound, + z.ZodTypeDef, + GeneratePresignedPutResponseBody +> = z + .object({ + key: z.string().optional(), + signedHeaders: z.lazy(() => SignedHeaders$outboundSchema).optional(), + uniqueIdentifier: z.string().optional(), + url: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + signedHeaders: "signed_headers", + uniqueIdentifier: "unique_identifier", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GeneratePresignedPutResponseBody$ { + /** @deprecated use `GeneratePresignedPutResponseBody$inboundSchema` instead. */ + export const inboundSchema = GeneratePresignedPutResponseBody$inboundSchema; + /** @deprecated use `GeneratePresignedPutResponseBody$outboundSchema` instead. */ + export const outboundSchema = GeneratePresignedPutResponseBody$outboundSchema; + /** @deprecated use `GeneratePresignedPutResponseBody$Outbound` instead. */ + export type Outbound = GeneratePresignedPutResponseBody$Outbound; } diff --git a/src/sdk/models/operations/getbackups.ts b/src/sdk/models/operations/getbackups.ts index 6f69827..2e16239 100644 --- a/src/sdk/models/operations/getbackups.ts +++ b/src/sdk/models/operations/getbackups.ts @@ -1,47 +1,62 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class ResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "filename" }) +export type ResponseBody = { filename: string; - - @SpeakeasyMetadata() - @Expose({ name: "last_modified" }) lastModified: string; - - @SpeakeasyMetadata() - @Expose({ name: "size" }) size: number; -} - -export class GetBackupsResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; - - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; - - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; - - /** - * success response - */ - @SpeakeasyMetadata({ elemType: ResponseBody }) - responseBodies?: ResponseBody[]; +}; + +/** @internal */ +export const ResponseBody$inboundSchema: z.ZodType = z + .object({ + filename: z.string(), + last_modified: z.string(), + size: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + last_modified: "lastModified", + }); + }); + +/** @internal */ +export type ResponseBody$Outbound = { + filename: string; + last_modified: string; + size: number; +}; + +/** @internal */ +export const ResponseBody$outboundSchema: z.ZodType< + ResponseBody$Outbound, + z.ZodTypeDef, + ResponseBody +> = z + .object({ + filename: z.string(), + lastModified: z.string(), + size: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + lastModified: "last_modified", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ResponseBody$ { + /** @deprecated use `ResponseBody$inboundSchema` instead. */ + export const inboundSchema = ResponseBody$inboundSchema; + /** @deprecated use `ResponseBody$outboundSchema` instead. */ + export const outboundSchema = ResponseBody$outboundSchema; + /** @deprecated use `ResponseBody$Outbound` instead. */ + export type Outbound = ResponseBody$Outbound; } diff --git a/src/sdk/models/operations/getcategory.ts b/src/sdk/models/operations/getcategory.ts index 63a28cb..7ba49c4 100644 --- a/src/sdk/models/operations/getcategory.ts +++ b/src/sdk/models/operations/getcategory.ts @@ -1,291 +1,591 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class GetCategoryRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) +export type GetCategoryRequest = { id: number; -} +}; -export class GetCategoryCustomFields extends SpeakeasyBase {} +export type GetCategoryCustomFields = {}; -export class GetCategoryGroupPermissions extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "group_name" }) +export type GetCategoryGroupPermissions = { groupName: string; - - @SpeakeasyMetadata() - @Expose({ name: "permission_type" }) permissionType: number; -} +}; -export class GetCategoryRequiredTagGroups extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "min_count" }) +export type GetCategoryRequiredTagGroups = { minCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; -} +}; -export class GetCategoryCategory extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "all_topics_wiki" }) +export type GetCategoryCategory = { allTopicsWiki: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "allow_badges" }) allowBadges: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "allow_global_tags" }) - allowGlobalTags?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "allow_unlimited_owner_edits_on_first_post" }) + allowGlobalTags?: boolean | undefined; allowUnlimitedOwnerEditsOnFirstPost: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "allowed_tag_groups" }) - allowedTagGroups?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "allowed_tags" }) - allowedTags?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "auto_close_based_on_last_post" }) + allowedTagGroups?: Array | undefined; + allowedTags?: Array | undefined; autoCloseBasedOnLastPost: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "auto_close_hours" }) - autoCloseHours: string; - - @SpeakeasyMetadata() - @Expose({ name: "available_groups" }) - availableGroups: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "can_delete" }) + autoCloseHours: string | null; + availableGroups: Array; canDelete: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_edit" }) canEdit: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "category_setting" }) - categorySetting?: any; - - @SpeakeasyMetadata() - @Expose({ name: "color" }) + categorySetting?: any | undefined; color: string; - - @SpeakeasyMetadata() - @Expose({ name: "custom_fields" }) - @Type(() => GetCategoryCustomFields) customFields: GetCategoryCustomFields; - - @SpeakeasyMetadata() - @Expose({ name: "default_list_filter" }) defaultListFilter: string; - - @SpeakeasyMetadata() - @Expose({ name: "default_slow_mode_seconds" }) - defaultSlowModeSeconds: string; - - @SpeakeasyMetadata() - @Expose({ name: "default_top_period" }) + defaultSlowModeSeconds: string | null; defaultTopPeriod: string; - - @SpeakeasyMetadata() - @Expose({ name: "default_view" }) - defaultView: string; - - @SpeakeasyMetadata() - @Expose({ name: "description" }) - description: string; - - @SpeakeasyMetadata() - @Expose({ name: "description_excerpt" }) - descriptionExcerpt: string; - - @SpeakeasyMetadata() - @Expose({ name: "description_text" }) - descriptionText: string; - - @SpeakeasyMetadata() - @Expose({ name: "email_in" }) - emailIn: string; - - @SpeakeasyMetadata() - @Expose({ name: "email_in_allow_strangers" }) + defaultView: string | null; + description: string | null; + descriptionExcerpt: string | null; + descriptionText: string | null; + emailIn: string | null; emailInAllowStrangers: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "form_template_ids" }) - formTemplateIds?: any[]; - - @SpeakeasyMetadata({ elemType: GetCategoryGroupPermissions }) - @Expose({ name: "group_permissions" }) - @Type(() => GetCategoryGroupPermissions) - groupPermissions: GetCategoryGroupPermissions[]; - - @SpeakeasyMetadata() - @Expose({ name: "has_children" }) - hasChildren: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) + formTemplateIds?: Array | undefined; + groupPermissions: Array; + hasChildren: boolean | null; id: number; - - @SpeakeasyMetadata() - @Expose({ name: "mailinglist_mirror" }) mailinglistMirror: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "minimum_required_tags" }) minimumRequiredTags: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "navigate_to_first_post_after_read" }) navigateToFirstPostAfterRead: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "notification_level" }) notificationLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "num_featured_topics" }) numFeaturedTopics: number; - - @SpeakeasyMetadata() - @Expose({ name: "permission" }) - permission: number; - - @SpeakeasyMetadata() - @Expose({ name: "position" }) + permission: number | null; position: number; - - @SpeakeasyMetadata() - @Expose({ name: "post_count" }) postCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "read_only_banner" }) - readOnlyBanner: string; - - @SpeakeasyMetadata() - @Expose({ name: "read_restricted" }) + readOnlyBanner: string | null; readRestricted: boolean; - - @SpeakeasyMetadata({ elemType: GetCategoryRequiredTagGroups }) - @Expose({ name: "required_tag_groups" }) - @Type(() => GetCategoryRequiredTagGroups) - requiredTagGroups: GetCategoryRequiredTagGroups[]; - - @SpeakeasyMetadata() - @Expose({ name: "search_priority" }) + requiredTagGroups: Array; searchPriority: number; - - @SpeakeasyMetadata() - @Expose({ name: "show_subcategory_list" }) showSubcategoryList: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "slug" }) slug: string; - - @SpeakeasyMetadata() - @Expose({ name: "sort_ascending" }) - sortAscending: string; - - @SpeakeasyMetadata() - @Expose({ name: "sort_order" }) - sortOrder: string; - - @SpeakeasyMetadata() - @Expose({ name: "subcategory_list_style" }) + sortAscending: string | null; + sortOrder: string | null; subcategoryListStyle: string; - - @SpeakeasyMetadata() - @Expose({ name: "text_color" }) textColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "topic_count" }) topicCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "topic_featured_link_allowed" }) topicFeaturedLinkAllowed: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "topic_template" }) - topicTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "topic_url" }) - topicUrl: string; - - @SpeakeasyMetadata() - @Expose({ name: "uploaded_background" }) - uploadedBackground: string; - - @SpeakeasyMetadata() - @Expose({ name: "uploaded_background_dark" }) - uploadedBackgroundDark: string; - - @SpeakeasyMetadata() - @Expose({ name: "uploaded_logo" }) - uploadedLogo: string; - - @SpeakeasyMetadata() - @Expose({ name: "uploaded_logo_dark" }) - uploadedLogoDark: string; -} + topicTemplate: string | null; + topicUrl: string | null; + uploadedBackground: string | null; + uploadedBackgroundDark: string | null; + uploadedLogo: string | null; + uploadedLogoDark: string | null; +}; /** * response */ -export class GetCategoryResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "category" }) - @Type(() => GetCategoryCategory) +export type GetCategoryResponseBody = { category: GetCategoryCategory; +}; + +/** @internal */ +export const GetCategoryRequest$inboundSchema: z.ZodType< + GetCategoryRequest, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.number().int(), +}); + +/** @internal */ +export type GetCategoryRequest$Outbound = { + id: number; +}; + +/** @internal */ +export const GetCategoryRequest$outboundSchema: z.ZodType< + GetCategoryRequest$Outbound, + z.ZodTypeDef, + GetCategoryRequest +> = z.object({ + id: z.number().int(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetCategoryRequest$ { + /** @deprecated use `GetCategoryRequest$inboundSchema` instead. */ + export const inboundSchema = GetCategoryRequest$inboundSchema; + /** @deprecated use `GetCategoryRequest$outboundSchema` instead. */ + export const outboundSchema = GetCategoryRequest$outboundSchema; + /** @deprecated use `GetCategoryRequest$Outbound` instead. */ + export type Outbound = GetCategoryRequest$Outbound; } -export class GetCategoryResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const GetCategoryCustomFields$inboundSchema: z.ZodType< + GetCategoryCustomFields, + z.ZodTypeDef, + unknown +> = z.object({}); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type GetCategoryCustomFields$Outbound = {}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const GetCategoryCustomFields$outboundSchema: z.ZodType< + GetCategoryCustomFields$Outbound, + z.ZodTypeDef, + GetCategoryCustomFields +> = z.object({}); - /** - * response - */ - @SpeakeasyMetadata() - object?: GetCategoryResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetCategoryCustomFields$ { + /** @deprecated use `GetCategoryCustomFields$inboundSchema` instead. */ + export const inboundSchema = GetCategoryCustomFields$inboundSchema; + /** @deprecated use `GetCategoryCustomFields$outboundSchema` instead. */ + export const outboundSchema = GetCategoryCustomFields$outboundSchema; + /** @deprecated use `GetCategoryCustomFields$Outbound` instead. */ + export type Outbound = GetCategoryCustomFields$Outbound; +} + +/** @internal */ +export const GetCategoryGroupPermissions$inboundSchema: z.ZodType< + GetCategoryGroupPermissions, + z.ZodTypeDef, + unknown +> = z + .object({ + group_name: z.string(), + permission_type: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + group_name: "groupName", + permission_type: "permissionType", + }); + }); + +/** @internal */ +export type GetCategoryGroupPermissions$Outbound = { + group_name: string; + permission_type: number; +}; + +/** @internal */ +export const GetCategoryGroupPermissions$outboundSchema: z.ZodType< + GetCategoryGroupPermissions$Outbound, + z.ZodTypeDef, + GetCategoryGroupPermissions +> = z + .object({ + groupName: z.string(), + permissionType: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + groupName: "group_name", + permissionType: "permission_type", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetCategoryGroupPermissions$ { + /** @deprecated use `GetCategoryGroupPermissions$inboundSchema` instead. */ + export const inboundSchema = GetCategoryGroupPermissions$inboundSchema; + /** @deprecated use `GetCategoryGroupPermissions$outboundSchema` instead. */ + export const outboundSchema = GetCategoryGroupPermissions$outboundSchema; + /** @deprecated use `GetCategoryGroupPermissions$Outbound` instead. */ + export type Outbound = GetCategoryGroupPermissions$Outbound; +} + +/** @internal */ +export const GetCategoryRequiredTagGroups$inboundSchema: z.ZodType< + GetCategoryRequiredTagGroups, + z.ZodTypeDef, + unknown +> = z + .object({ + min_count: z.number().int(), + name: z.string(), + }) + .transform((v) => { + return remap$(v, { + min_count: "minCount", + }); + }); + +/** @internal */ +export type GetCategoryRequiredTagGroups$Outbound = { + min_count: number; + name: string; +}; + +/** @internal */ +export const GetCategoryRequiredTagGroups$outboundSchema: z.ZodType< + GetCategoryRequiredTagGroups$Outbound, + z.ZodTypeDef, + GetCategoryRequiredTagGroups +> = z + .object({ + minCount: z.number().int(), + name: z.string(), + }) + .transform((v) => { + return remap$(v, { + minCount: "min_count", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetCategoryRequiredTagGroups$ { + /** @deprecated use `GetCategoryRequiredTagGroups$inboundSchema` instead. */ + export const inboundSchema = GetCategoryRequiredTagGroups$inboundSchema; + /** @deprecated use `GetCategoryRequiredTagGroups$outboundSchema` instead. */ + export const outboundSchema = GetCategoryRequiredTagGroups$outboundSchema; + /** @deprecated use `GetCategoryRequiredTagGroups$Outbound` instead. */ + export type Outbound = GetCategoryRequiredTagGroups$Outbound; +} + +/** @internal */ +export const GetCategoryCategory$inboundSchema: z.ZodType< + GetCategoryCategory, + z.ZodTypeDef, + unknown +> = z + .object({ + all_topics_wiki: z.boolean(), + allow_badges: z.boolean(), + allow_global_tags: z.boolean().optional(), + allow_unlimited_owner_edits_on_first_post: z.boolean(), + allowed_tag_groups: z.array(z.any()).optional(), + allowed_tags: z.array(z.any()).optional(), + auto_close_based_on_last_post: z.boolean(), + auto_close_hours: z.nullable(z.string()), + available_groups: z.array(z.any()), + can_delete: z.boolean(), + can_edit: z.boolean(), + category_setting: z.any().optional(), + color: z.string(), + custom_fields: z.lazy(() => GetCategoryCustomFields$inboundSchema), + default_list_filter: z.string(), + default_slow_mode_seconds: z.nullable(z.string()), + default_top_period: z.string(), + default_view: z.nullable(z.string()), + description: z.nullable(z.string()), + description_excerpt: z.nullable(z.string()), + description_text: z.nullable(z.string()), + email_in: z.nullable(z.string()), + email_in_allow_strangers: z.boolean(), + form_template_ids: z.array(z.any()).optional(), + group_permissions: z.array(z.lazy(() => GetCategoryGroupPermissions$inboundSchema)), + has_children: z.nullable(z.boolean()), + id: z.number().int(), + mailinglist_mirror: z.boolean(), + minimum_required_tags: z.number().int(), + name: z.string(), + navigate_to_first_post_after_read: z.boolean(), + notification_level: z.number().int(), + num_featured_topics: z.number().int(), + permission: z.nullable(z.number().int()), + position: z.number().int(), + post_count: z.number().int(), + read_only_banner: z.nullable(z.string()), + read_restricted: z.boolean(), + required_tag_groups: z.array(z.lazy(() => GetCategoryRequiredTagGroups$inboundSchema)), + search_priority: z.number().int(), + show_subcategory_list: z.boolean(), + slug: z.string(), + sort_ascending: z.nullable(z.string()), + sort_order: z.nullable(z.string()), + subcategory_list_style: z.string(), + text_color: z.string(), + topic_count: z.number().int(), + topic_featured_link_allowed: z.boolean(), + topic_template: z.nullable(z.string()), + topic_url: z.nullable(z.string()), + uploaded_background: z.nullable(z.string()), + uploaded_background_dark: z.nullable(z.string()), + uploaded_logo: z.nullable(z.string()), + uploaded_logo_dark: z.nullable(z.string()), + }) + .transform((v) => { + return remap$(v, { + all_topics_wiki: "allTopicsWiki", + allow_badges: "allowBadges", + allow_global_tags: "allowGlobalTags", + allow_unlimited_owner_edits_on_first_post: "allowUnlimitedOwnerEditsOnFirstPost", + allowed_tag_groups: "allowedTagGroups", + allowed_tags: "allowedTags", + auto_close_based_on_last_post: "autoCloseBasedOnLastPost", + auto_close_hours: "autoCloseHours", + available_groups: "availableGroups", + can_delete: "canDelete", + can_edit: "canEdit", + category_setting: "categorySetting", + custom_fields: "customFields", + default_list_filter: "defaultListFilter", + default_slow_mode_seconds: "defaultSlowModeSeconds", + default_top_period: "defaultTopPeriod", + default_view: "defaultView", + description_excerpt: "descriptionExcerpt", + description_text: "descriptionText", + email_in: "emailIn", + email_in_allow_strangers: "emailInAllowStrangers", + form_template_ids: "formTemplateIds", + group_permissions: "groupPermissions", + has_children: "hasChildren", + mailinglist_mirror: "mailinglistMirror", + minimum_required_tags: "minimumRequiredTags", + navigate_to_first_post_after_read: "navigateToFirstPostAfterRead", + notification_level: "notificationLevel", + num_featured_topics: "numFeaturedTopics", + post_count: "postCount", + read_only_banner: "readOnlyBanner", + read_restricted: "readRestricted", + required_tag_groups: "requiredTagGroups", + search_priority: "searchPriority", + show_subcategory_list: "showSubcategoryList", + sort_ascending: "sortAscending", + sort_order: "sortOrder", + subcategory_list_style: "subcategoryListStyle", + text_color: "textColor", + topic_count: "topicCount", + topic_featured_link_allowed: "topicFeaturedLinkAllowed", + topic_template: "topicTemplate", + topic_url: "topicUrl", + uploaded_background: "uploadedBackground", + uploaded_background_dark: "uploadedBackgroundDark", + uploaded_logo: "uploadedLogo", + uploaded_logo_dark: "uploadedLogoDark", + }); + }); + +/** @internal */ +export type GetCategoryCategory$Outbound = { + all_topics_wiki: boolean; + allow_badges: boolean; + allow_global_tags?: boolean | undefined; + allow_unlimited_owner_edits_on_first_post: boolean; + allowed_tag_groups?: Array | undefined; + allowed_tags?: Array | undefined; + auto_close_based_on_last_post: boolean; + auto_close_hours: string | null; + available_groups: Array; + can_delete: boolean; + can_edit: boolean; + category_setting?: any | undefined; + color: string; + custom_fields: GetCategoryCustomFields$Outbound; + default_list_filter: string; + default_slow_mode_seconds: string | null; + default_top_period: string; + default_view: string | null; + description: string | null; + description_excerpt: string | null; + description_text: string | null; + email_in: string | null; + email_in_allow_strangers: boolean; + form_template_ids?: Array | undefined; + group_permissions: Array; + has_children: boolean | null; + id: number; + mailinglist_mirror: boolean; + minimum_required_tags: number; + name: string; + navigate_to_first_post_after_read: boolean; + notification_level: number; + num_featured_topics: number; + permission: number | null; + position: number; + post_count: number; + read_only_banner: string | null; + read_restricted: boolean; + required_tag_groups: Array; + search_priority: number; + show_subcategory_list: boolean; + slug: string; + sort_ascending: string | null; + sort_order: string | null; + subcategory_list_style: string; + text_color: string; + topic_count: number; + topic_featured_link_allowed: boolean; + topic_template: string | null; + topic_url: string | null; + uploaded_background: string | null; + uploaded_background_dark: string | null; + uploaded_logo: string | null; + uploaded_logo_dark: string | null; +}; + +/** @internal */ +export const GetCategoryCategory$outboundSchema: z.ZodType< + GetCategoryCategory$Outbound, + z.ZodTypeDef, + GetCategoryCategory +> = z + .object({ + allTopicsWiki: z.boolean(), + allowBadges: z.boolean(), + allowGlobalTags: z.boolean().optional(), + allowUnlimitedOwnerEditsOnFirstPost: z.boolean(), + allowedTagGroups: z.array(z.any()).optional(), + allowedTags: z.array(z.any()).optional(), + autoCloseBasedOnLastPost: z.boolean(), + autoCloseHours: z.nullable(z.string()), + availableGroups: z.array(z.any()), + canDelete: z.boolean(), + canEdit: z.boolean(), + categorySetting: z.any().optional(), + color: z.string(), + customFields: z.lazy(() => GetCategoryCustomFields$outboundSchema), + defaultListFilter: z.string(), + defaultSlowModeSeconds: z.nullable(z.string()), + defaultTopPeriod: z.string(), + defaultView: z.nullable(z.string()), + description: z.nullable(z.string()), + descriptionExcerpt: z.nullable(z.string()), + descriptionText: z.nullable(z.string()), + emailIn: z.nullable(z.string()), + emailInAllowStrangers: z.boolean(), + formTemplateIds: z.array(z.any()).optional(), + groupPermissions: z.array(z.lazy(() => GetCategoryGroupPermissions$outboundSchema)), + hasChildren: z.nullable(z.boolean()), + id: z.number().int(), + mailinglistMirror: z.boolean(), + minimumRequiredTags: z.number().int(), + name: z.string(), + navigateToFirstPostAfterRead: z.boolean(), + notificationLevel: z.number().int(), + numFeaturedTopics: z.number().int(), + permission: z.nullable(z.number().int()), + position: z.number().int(), + postCount: z.number().int(), + readOnlyBanner: z.nullable(z.string()), + readRestricted: z.boolean(), + requiredTagGroups: z.array(z.lazy(() => GetCategoryRequiredTagGroups$outboundSchema)), + searchPriority: z.number().int(), + showSubcategoryList: z.boolean(), + slug: z.string(), + sortAscending: z.nullable(z.string()), + sortOrder: z.nullable(z.string()), + subcategoryListStyle: z.string(), + textColor: z.string(), + topicCount: z.number().int(), + topicFeaturedLinkAllowed: z.boolean(), + topicTemplate: z.nullable(z.string()), + topicUrl: z.nullable(z.string()), + uploadedBackground: z.nullable(z.string()), + uploadedBackgroundDark: z.nullable(z.string()), + uploadedLogo: z.nullable(z.string()), + uploadedLogoDark: z.nullable(z.string()), + }) + .transform((v) => { + return remap$(v, { + allTopicsWiki: "all_topics_wiki", + allowBadges: "allow_badges", + allowGlobalTags: "allow_global_tags", + allowUnlimitedOwnerEditsOnFirstPost: "allow_unlimited_owner_edits_on_first_post", + allowedTagGroups: "allowed_tag_groups", + allowedTags: "allowed_tags", + autoCloseBasedOnLastPost: "auto_close_based_on_last_post", + autoCloseHours: "auto_close_hours", + availableGroups: "available_groups", + canDelete: "can_delete", + canEdit: "can_edit", + categorySetting: "category_setting", + customFields: "custom_fields", + defaultListFilter: "default_list_filter", + defaultSlowModeSeconds: "default_slow_mode_seconds", + defaultTopPeriod: "default_top_period", + defaultView: "default_view", + descriptionExcerpt: "description_excerpt", + descriptionText: "description_text", + emailIn: "email_in", + emailInAllowStrangers: "email_in_allow_strangers", + formTemplateIds: "form_template_ids", + groupPermissions: "group_permissions", + hasChildren: "has_children", + mailinglistMirror: "mailinglist_mirror", + minimumRequiredTags: "minimum_required_tags", + navigateToFirstPostAfterRead: "navigate_to_first_post_after_read", + notificationLevel: "notification_level", + numFeaturedTopics: "num_featured_topics", + postCount: "post_count", + readOnlyBanner: "read_only_banner", + readRestricted: "read_restricted", + requiredTagGroups: "required_tag_groups", + searchPriority: "search_priority", + showSubcategoryList: "show_subcategory_list", + sortAscending: "sort_ascending", + sortOrder: "sort_order", + subcategoryListStyle: "subcategory_list_style", + textColor: "text_color", + topicCount: "topic_count", + topicFeaturedLinkAllowed: "topic_featured_link_allowed", + topicTemplate: "topic_template", + topicUrl: "topic_url", + uploadedBackground: "uploaded_background", + uploadedBackgroundDark: "uploaded_background_dark", + uploadedLogo: "uploaded_logo", + uploadedLogoDark: "uploaded_logo_dark", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetCategoryCategory$ { + /** @deprecated use `GetCategoryCategory$inboundSchema` instead. */ + export const inboundSchema = GetCategoryCategory$inboundSchema; + /** @deprecated use `GetCategoryCategory$outboundSchema` instead. */ + export const outboundSchema = GetCategoryCategory$outboundSchema; + /** @deprecated use `GetCategoryCategory$Outbound` instead. */ + export type Outbound = GetCategoryCategory$Outbound; +} + +/** @internal */ +export const GetCategoryResponseBody$inboundSchema: z.ZodType< + GetCategoryResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + category: z.lazy(() => GetCategoryCategory$inboundSchema), +}); + +/** @internal */ +export type GetCategoryResponseBody$Outbound = { + category: GetCategoryCategory$Outbound; +}; + +/** @internal */ +export const GetCategoryResponseBody$outboundSchema: z.ZodType< + GetCategoryResponseBody$Outbound, + z.ZodTypeDef, + GetCategoryResponseBody +> = z.object({ + category: z.lazy(() => GetCategoryCategory$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetCategoryResponseBody$ { + /** @deprecated use `GetCategoryResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetCategoryResponseBody$inboundSchema; + /** @deprecated use `GetCategoryResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetCategoryResponseBody$outboundSchema; + /** @deprecated use `GetCategoryResponseBody$Outbound` instead. */ + export type Outbound = GetCategoryResponseBody$Outbound; } diff --git a/src/sdk/models/operations/getgroup.ts b/src/sdk/models/operations/getgroup.ts index 8306800..a76a56a 100644 --- a/src/sdk/models/operations/getgroup.ts +++ b/src/sdk/models/operations/getgroup.ts @@ -1,338 +1,627 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class GetGroupRequest extends SpeakeasyBase { +export type GetGroupRequest = { /** * Use group name instead of id */ - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) id: string; -} +}; -export class Extras extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "visible_group_names" }) - visibleGroupNames: any[]; -} +export type Extras = { + visibleGroupNames: Array; +}; -export class ImapUpdatedBy extends SpeakeasyBase {} +export type ImapUpdatedBy = {}; -export class SmtpUpdatedBy extends SpeakeasyBase {} +export type SmtpUpdatedBy = {}; -export class GetGroupGroup extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "allow_membership_requests" }) +export type GetGroupGroup = { allowMembershipRequests: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "allow_unknown_sender_topic_replies" }) allowUnknownSenderTopicReplies: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "associated_group_ids" }) - associatedGroupIds?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "automatic" }) + associatedGroupIds?: Array | undefined; automatic: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "automatic_membership_email_domains" }) - automaticMembershipEmailDomains: string; - - @SpeakeasyMetadata() - @Expose({ name: "bio_cooked" }) - bioCooked: string; - - @SpeakeasyMetadata() - @Expose({ name: "bio_excerpt" }) - bioExcerpt: string; - - @SpeakeasyMetadata() - @Expose({ name: "bio_raw" }) - bioRaw: string; - - @SpeakeasyMetadata() - @Expose({ name: "can_admin_group" }) + automaticMembershipEmailDomains: string | null; + bioCooked: string | null; + bioExcerpt: string | null; + bioRaw: string | null; canAdminGroup: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_edit_group" }) - canEditGroup?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_see_members" }) + canEditGroup?: boolean | undefined; canSeeMembers: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "default_notification_level" }) defaultNotificationLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "email_from_alias" }) - emailFromAlias?: string; - - @SpeakeasyMetadata() - @Expose({ name: "email_password" }) - emailPassword: string; - - @SpeakeasyMetadata() - @Expose({ name: "email_username" }) - emailUsername: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_bg_color" }) - flairBgColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_color" }) - flairColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_url" }) - flairUrl: string; - - @SpeakeasyMetadata() - @Expose({ name: "full_name" }) - fullName: string; - - @SpeakeasyMetadata() - @Expose({ name: "grant_trust_level" }) - grantTrustLevel: string; - - @SpeakeasyMetadata() - @Expose({ name: "has_messages" }) + emailFromAlias?: string | null | undefined; + emailPassword: string | null; + emailUsername: string | null; + flairBgColor: string | null; + flairColor: string | null; + flairUrl: string | null; + fullName: string | null; + grantTrustLevel: string | null; hasMessages: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "imap_enabled" }) - imapEnabled?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "imap_last_error" }) - imapLastError: string; - - @SpeakeasyMetadata() - @Expose({ name: "imap_mailbox_name" }) + imapEnabled?: boolean | undefined; + imapLastError: string | null; imapMailboxName: string; - - @SpeakeasyMetadata() - @Expose({ name: "imap_mailboxes" }) - imapMailboxes: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "imap_new_emails" }) - imapNewEmails: string; - - @SpeakeasyMetadata() - @Expose({ name: "imap_old_emails" }) - imapOldEmails: string; - - @SpeakeasyMetadata() - @Expose({ name: "imap_port" }) - imapPort: string; - - @SpeakeasyMetadata() - @Expose({ name: "imap_server" }) - imapServer: string; - - @SpeakeasyMetadata() - @Expose({ name: "imap_ssl" }) - imapSsl: string; - - @SpeakeasyMetadata() - @Expose({ name: "imap_updated_at" }) - imapUpdatedAt?: string; - - @SpeakeasyMetadata() - @Expose({ name: "imap_updated_by" }) - @Type(() => ImapUpdatedBy) - imapUpdatedBy?: ImapUpdatedBy; - - @SpeakeasyMetadata() - @Expose({ name: "incoming_email" }) - incomingEmail: string; - - @SpeakeasyMetadata() - @Expose({ name: "is_group_owner_display" }) + imapMailboxes: Array; + imapNewEmails: string | null; + imapOldEmails: string | null; + imapPort: string | null; + imapServer: string | null; + imapSsl: string | null; + imapUpdatedAt?: string | null | undefined; + imapUpdatedBy?: ImapUpdatedBy | null | undefined; + incomingEmail: string | null; isGroupOwnerDisplay: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "is_group_user" }) isGroupUser: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "members_visibility_level" }) membersVisibilityLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "membership_request_template" }) - membershipRequestTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "mentionable" }) + membershipRequestTemplate: string | null; mentionable: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "mentionable_level" }) mentionableLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "message_count" }) messageCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "messageable" }) messageable: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "messageable_level" }) messageableLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "muted_category_ids" }) - mutedCategoryIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "muted_tags" }) - mutedTags?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) + mutedCategoryIds: Array; + mutedTags?: Array | undefined; name: string; - - @SpeakeasyMetadata() - @Expose({ name: "primary_group" }) primaryGroup: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "public_admission" }) publicAdmission: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "public_exit" }) publicExit: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "publish_read_state" }) publishReadState: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "regular_category_ids" }) - regularCategoryIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "regular_tags" }) - regularTags?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "smtp_enabled" }) - smtpEnabled?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "smtp_port" }) - smtpPort: string; - - @SpeakeasyMetadata() - @Expose({ name: "smtp_server" }) - smtpServer: string; - - @SpeakeasyMetadata() - @Expose({ name: "smtp_ssl" }) - smtpSsl: string; - - @SpeakeasyMetadata() - @Expose({ name: "smtp_updated_at" }) - smtpUpdatedAt?: string; - - @SpeakeasyMetadata() - @Expose({ name: "smtp_updated_by" }) - @Type(() => SmtpUpdatedBy) - smtpUpdatedBy?: SmtpUpdatedBy; - - @SpeakeasyMetadata() - @Expose({ name: "title" }) - title: string; - - @SpeakeasyMetadata() - @Expose({ name: "tracking_category_ids" }) - trackingCategoryIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "tracking_tags" }) - trackingTags?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "user_count" }) + regularCategoryIds: Array; + regularTags?: Array | undefined; + smtpEnabled?: boolean | undefined; + smtpPort: string | null; + smtpServer: string | null; + smtpSsl: string | null; + smtpUpdatedAt?: string | null | undefined; + smtpUpdatedBy?: SmtpUpdatedBy | null | undefined; + title: string | null; + trackingCategoryIds: Array; + trackingTags?: Array | undefined; userCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "visibility_level" }) visibilityLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "watching_category_ids" }) - watchingCategoryIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "watching_first_post_category_ids" }) - watchingFirstPostCategoryIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "watching_first_post_tags" }) - watchingFirstPostTags?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "watching_tags" }) - watchingTags?: any[]; -} + watchingCategoryIds: Array; + watchingFirstPostCategoryIds: Array; + watchingFirstPostTags?: Array | undefined; + watchingTags?: Array | undefined; +}; /** * success response */ -export class GetGroupResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "extras" }) - @Type(() => Extras) +export type GetGroupResponseBody = { extras: Extras; - - @SpeakeasyMetadata() - @Expose({ name: "group" }) - @Type(() => GetGroupGroup) group: GetGroupGroup; +}; + +/** @internal */ +export const GetGroupRequest$inboundSchema: z.ZodType = + z.object({ + id: z.string(), + }); + +/** @internal */ +export type GetGroupRequest$Outbound = { + id: string; +}; + +/** @internal */ +export const GetGroupRequest$outboundSchema: z.ZodType< + GetGroupRequest$Outbound, + z.ZodTypeDef, + GetGroupRequest +> = z.object({ + id: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetGroupRequest$ { + /** @deprecated use `GetGroupRequest$inboundSchema` instead. */ + export const inboundSchema = GetGroupRequest$inboundSchema; + /** @deprecated use `GetGroupRequest$outboundSchema` instead. */ + export const outboundSchema = GetGroupRequest$outboundSchema; + /** @deprecated use `GetGroupRequest$Outbound` instead. */ + export type Outbound = GetGroupRequest$Outbound; } -export class GetGroupResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const Extras$inboundSchema: z.ZodType = z + .object({ + visible_group_names: z.array(z.any()), + }) + .transform((v) => { + return remap$(v, { + visible_group_names: "visibleGroupNames", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type Extras$Outbound = { + visible_group_names: Array; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const Extras$outboundSchema: z.ZodType = z + .object({ + visibleGroupNames: z.array(z.any()), + }) + .transform((v) => { + return remap$(v, { + visibleGroupNames: "visible_group_names", + }); + }); - /** - * success response - */ - @SpeakeasyMetadata() - object?: GetGroupResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Extras$ { + /** @deprecated use `Extras$inboundSchema` instead. */ + export const inboundSchema = Extras$inboundSchema; + /** @deprecated use `Extras$outboundSchema` instead. */ + export const outboundSchema = Extras$outboundSchema; + /** @deprecated use `Extras$Outbound` instead. */ + export type Outbound = Extras$Outbound; +} + +/** @internal */ +export const ImapUpdatedBy$inboundSchema: z.ZodType = + z.object({}); + +/** @internal */ +export type ImapUpdatedBy$Outbound = {}; + +/** @internal */ +export const ImapUpdatedBy$outboundSchema: z.ZodType< + ImapUpdatedBy$Outbound, + z.ZodTypeDef, + ImapUpdatedBy +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ImapUpdatedBy$ { + /** @deprecated use `ImapUpdatedBy$inboundSchema` instead. */ + export const inboundSchema = ImapUpdatedBy$inboundSchema; + /** @deprecated use `ImapUpdatedBy$outboundSchema` instead. */ + export const outboundSchema = ImapUpdatedBy$outboundSchema; + /** @deprecated use `ImapUpdatedBy$Outbound` instead. */ + export type Outbound = ImapUpdatedBy$Outbound; +} + +/** @internal */ +export const SmtpUpdatedBy$inboundSchema: z.ZodType = + z.object({}); + +/** @internal */ +export type SmtpUpdatedBy$Outbound = {}; + +/** @internal */ +export const SmtpUpdatedBy$outboundSchema: z.ZodType< + SmtpUpdatedBy$Outbound, + z.ZodTypeDef, + SmtpUpdatedBy +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SmtpUpdatedBy$ { + /** @deprecated use `SmtpUpdatedBy$inboundSchema` instead. */ + export const inboundSchema = SmtpUpdatedBy$inboundSchema; + /** @deprecated use `SmtpUpdatedBy$outboundSchema` instead. */ + export const outboundSchema = SmtpUpdatedBy$outboundSchema; + /** @deprecated use `SmtpUpdatedBy$Outbound` instead. */ + export type Outbound = SmtpUpdatedBy$Outbound; +} + +/** @internal */ +export const GetGroupGroup$inboundSchema: z.ZodType = z + .object({ + allow_membership_requests: z.boolean(), + allow_unknown_sender_topic_replies: z.boolean(), + associated_group_ids: z.array(z.any()).optional(), + automatic: z.boolean(), + automatic_membership_email_domains: z.nullable(z.string()), + bio_cooked: z.nullable(z.string()), + bio_excerpt: z.nullable(z.string()), + bio_raw: z.nullable(z.string()), + can_admin_group: z.boolean(), + can_edit_group: z.boolean().optional(), + can_see_members: z.boolean(), + default_notification_level: z.number().int(), + email_from_alias: z.nullable(z.string()).optional(), + email_password: z.nullable(z.string()), + email_username: z.nullable(z.string()), + flair_bg_color: z.nullable(z.string()), + flair_color: z.nullable(z.string()), + flair_url: z.nullable(z.string()), + full_name: z.nullable(z.string()), + grant_trust_level: z.nullable(z.string()), + has_messages: z.boolean(), + id: z.number().int(), + imap_enabled: z.boolean().optional(), + imap_last_error: z.nullable(z.string()), + imap_mailbox_name: z.string(), + imap_mailboxes: z.array(z.any()), + imap_new_emails: z.nullable(z.string()), + imap_old_emails: z.nullable(z.string()), + imap_port: z.nullable(z.string()), + imap_server: z.nullable(z.string()), + imap_ssl: z.nullable(z.string()), + imap_updated_at: z.nullable(z.string()).optional(), + imap_updated_by: z.nullable(z.lazy(() => ImapUpdatedBy$inboundSchema)).optional(), + incoming_email: z.nullable(z.string()), + is_group_owner_display: z.boolean(), + is_group_user: z.boolean(), + members_visibility_level: z.number().int(), + membership_request_template: z.nullable(z.string()), + mentionable: z.boolean(), + mentionable_level: z.number().int(), + message_count: z.number().int(), + messageable: z.boolean(), + messageable_level: z.number().int(), + muted_category_ids: z.array(z.any()), + muted_tags: z.array(z.any()).optional(), + name: z.string(), + primary_group: z.boolean(), + public_admission: z.boolean(), + public_exit: z.boolean(), + publish_read_state: z.boolean(), + regular_category_ids: z.array(z.any()), + regular_tags: z.array(z.any()).optional(), + smtp_enabled: z.boolean().optional(), + smtp_port: z.nullable(z.string()), + smtp_server: z.nullable(z.string()), + smtp_ssl: z.nullable(z.string()), + smtp_updated_at: z.nullable(z.string()).optional(), + smtp_updated_by: z.nullable(z.lazy(() => SmtpUpdatedBy$inboundSchema)).optional(), + title: z.nullable(z.string()), + tracking_category_ids: z.array(z.any()), + tracking_tags: z.array(z.any()).optional(), + user_count: z.number().int(), + visibility_level: z.number().int(), + watching_category_ids: z.array(z.any()), + watching_first_post_category_ids: z.array(z.any()), + watching_first_post_tags: z.array(z.any()).optional(), + watching_tags: z.array(z.any()).optional(), + }) + .transform((v) => { + return remap$(v, { + allow_membership_requests: "allowMembershipRequests", + allow_unknown_sender_topic_replies: "allowUnknownSenderTopicReplies", + associated_group_ids: "associatedGroupIds", + automatic_membership_email_domains: "automaticMembershipEmailDomains", + bio_cooked: "bioCooked", + bio_excerpt: "bioExcerpt", + bio_raw: "bioRaw", + can_admin_group: "canAdminGroup", + can_edit_group: "canEditGroup", + can_see_members: "canSeeMembers", + default_notification_level: "defaultNotificationLevel", + email_from_alias: "emailFromAlias", + email_password: "emailPassword", + email_username: "emailUsername", + flair_bg_color: "flairBgColor", + flair_color: "flairColor", + flair_url: "flairUrl", + full_name: "fullName", + grant_trust_level: "grantTrustLevel", + has_messages: "hasMessages", + imap_enabled: "imapEnabled", + imap_last_error: "imapLastError", + imap_mailbox_name: "imapMailboxName", + imap_mailboxes: "imapMailboxes", + imap_new_emails: "imapNewEmails", + imap_old_emails: "imapOldEmails", + imap_port: "imapPort", + imap_server: "imapServer", + imap_ssl: "imapSsl", + imap_updated_at: "imapUpdatedAt", + imap_updated_by: "imapUpdatedBy", + incoming_email: "incomingEmail", + is_group_owner_display: "isGroupOwnerDisplay", + is_group_user: "isGroupUser", + members_visibility_level: "membersVisibilityLevel", + membership_request_template: "membershipRequestTemplate", + mentionable_level: "mentionableLevel", + message_count: "messageCount", + messageable_level: "messageableLevel", + muted_category_ids: "mutedCategoryIds", + muted_tags: "mutedTags", + primary_group: "primaryGroup", + public_admission: "publicAdmission", + public_exit: "publicExit", + publish_read_state: "publishReadState", + regular_category_ids: "regularCategoryIds", + regular_tags: "regularTags", + smtp_enabled: "smtpEnabled", + smtp_port: "smtpPort", + smtp_server: "smtpServer", + smtp_ssl: "smtpSsl", + smtp_updated_at: "smtpUpdatedAt", + smtp_updated_by: "smtpUpdatedBy", + tracking_category_ids: "trackingCategoryIds", + tracking_tags: "trackingTags", + user_count: "userCount", + visibility_level: "visibilityLevel", + watching_category_ids: "watchingCategoryIds", + watching_first_post_category_ids: "watchingFirstPostCategoryIds", + watching_first_post_tags: "watchingFirstPostTags", + watching_tags: "watchingTags", + }); + }); + +/** @internal */ +export type GetGroupGroup$Outbound = { + allow_membership_requests: boolean; + allow_unknown_sender_topic_replies: boolean; + associated_group_ids?: Array | undefined; + automatic: boolean; + automatic_membership_email_domains: string | null; + bio_cooked: string | null; + bio_excerpt: string | null; + bio_raw: string | null; + can_admin_group: boolean; + can_edit_group?: boolean | undefined; + can_see_members: boolean; + default_notification_level: number; + email_from_alias?: string | null | undefined; + email_password: string | null; + email_username: string | null; + flair_bg_color: string | null; + flair_color: string | null; + flair_url: string | null; + full_name: string | null; + grant_trust_level: string | null; + has_messages: boolean; + id: number; + imap_enabled?: boolean | undefined; + imap_last_error: string | null; + imap_mailbox_name: string; + imap_mailboxes: Array; + imap_new_emails: string | null; + imap_old_emails: string | null; + imap_port: string | null; + imap_server: string | null; + imap_ssl: string | null; + imap_updated_at?: string | null | undefined; + imap_updated_by?: ImapUpdatedBy$Outbound | null | undefined; + incoming_email: string | null; + is_group_owner_display: boolean; + is_group_user: boolean; + members_visibility_level: number; + membership_request_template: string | null; + mentionable: boolean; + mentionable_level: number; + message_count: number; + messageable: boolean; + messageable_level: number; + muted_category_ids: Array; + muted_tags?: Array | undefined; + name: string; + primary_group: boolean; + public_admission: boolean; + public_exit: boolean; + publish_read_state: boolean; + regular_category_ids: Array; + regular_tags?: Array | undefined; + smtp_enabled?: boolean | undefined; + smtp_port: string | null; + smtp_server: string | null; + smtp_ssl: string | null; + smtp_updated_at?: string | null | undefined; + smtp_updated_by?: SmtpUpdatedBy$Outbound | null | undefined; + title: string | null; + tracking_category_ids: Array; + tracking_tags?: Array | undefined; + user_count: number; + visibility_level: number; + watching_category_ids: Array; + watching_first_post_category_ids: Array; + watching_first_post_tags?: Array | undefined; + watching_tags?: Array | undefined; +}; + +/** @internal */ +export const GetGroupGroup$outboundSchema: z.ZodType< + GetGroupGroup$Outbound, + z.ZodTypeDef, + GetGroupGroup +> = z + .object({ + allowMembershipRequests: z.boolean(), + allowUnknownSenderTopicReplies: z.boolean(), + associatedGroupIds: z.array(z.any()).optional(), + automatic: z.boolean(), + automaticMembershipEmailDomains: z.nullable(z.string()), + bioCooked: z.nullable(z.string()), + bioExcerpt: z.nullable(z.string()), + bioRaw: z.nullable(z.string()), + canAdminGroup: z.boolean(), + canEditGroup: z.boolean().optional(), + canSeeMembers: z.boolean(), + defaultNotificationLevel: z.number().int(), + emailFromAlias: z.nullable(z.string()).optional(), + emailPassword: z.nullable(z.string()), + emailUsername: z.nullable(z.string()), + flairBgColor: z.nullable(z.string()), + flairColor: z.nullable(z.string()), + flairUrl: z.nullable(z.string()), + fullName: z.nullable(z.string()), + grantTrustLevel: z.nullable(z.string()), + hasMessages: z.boolean(), + id: z.number().int(), + imapEnabled: z.boolean().optional(), + imapLastError: z.nullable(z.string()), + imapMailboxName: z.string(), + imapMailboxes: z.array(z.any()), + imapNewEmails: z.nullable(z.string()), + imapOldEmails: z.nullable(z.string()), + imapPort: z.nullable(z.string()), + imapServer: z.nullable(z.string()), + imapSsl: z.nullable(z.string()), + imapUpdatedAt: z.nullable(z.string()).optional(), + imapUpdatedBy: z.nullable(z.lazy(() => ImapUpdatedBy$outboundSchema)).optional(), + incomingEmail: z.nullable(z.string()), + isGroupOwnerDisplay: z.boolean(), + isGroupUser: z.boolean(), + membersVisibilityLevel: z.number().int(), + membershipRequestTemplate: z.nullable(z.string()), + mentionable: z.boolean(), + mentionableLevel: z.number().int(), + messageCount: z.number().int(), + messageable: z.boolean(), + messageableLevel: z.number().int(), + mutedCategoryIds: z.array(z.any()), + mutedTags: z.array(z.any()).optional(), + name: z.string(), + primaryGroup: z.boolean(), + publicAdmission: z.boolean(), + publicExit: z.boolean(), + publishReadState: z.boolean(), + regularCategoryIds: z.array(z.any()), + regularTags: z.array(z.any()).optional(), + smtpEnabled: z.boolean().optional(), + smtpPort: z.nullable(z.string()), + smtpServer: z.nullable(z.string()), + smtpSsl: z.nullable(z.string()), + smtpUpdatedAt: z.nullable(z.string()).optional(), + smtpUpdatedBy: z.nullable(z.lazy(() => SmtpUpdatedBy$outboundSchema)).optional(), + title: z.nullable(z.string()), + trackingCategoryIds: z.array(z.any()), + trackingTags: z.array(z.any()).optional(), + userCount: z.number().int(), + visibilityLevel: z.number().int(), + watchingCategoryIds: z.array(z.any()), + watchingFirstPostCategoryIds: z.array(z.any()), + watchingFirstPostTags: z.array(z.any()).optional(), + watchingTags: z.array(z.any()).optional(), + }) + .transform((v) => { + return remap$(v, { + allowMembershipRequests: "allow_membership_requests", + allowUnknownSenderTopicReplies: "allow_unknown_sender_topic_replies", + associatedGroupIds: "associated_group_ids", + automaticMembershipEmailDomains: "automatic_membership_email_domains", + bioCooked: "bio_cooked", + bioExcerpt: "bio_excerpt", + bioRaw: "bio_raw", + canAdminGroup: "can_admin_group", + canEditGroup: "can_edit_group", + canSeeMembers: "can_see_members", + defaultNotificationLevel: "default_notification_level", + emailFromAlias: "email_from_alias", + emailPassword: "email_password", + emailUsername: "email_username", + flairBgColor: "flair_bg_color", + flairColor: "flair_color", + flairUrl: "flair_url", + fullName: "full_name", + grantTrustLevel: "grant_trust_level", + hasMessages: "has_messages", + imapEnabled: "imap_enabled", + imapLastError: "imap_last_error", + imapMailboxName: "imap_mailbox_name", + imapMailboxes: "imap_mailboxes", + imapNewEmails: "imap_new_emails", + imapOldEmails: "imap_old_emails", + imapPort: "imap_port", + imapServer: "imap_server", + imapSsl: "imap_ssl", + imapUpdatedAt: "imap_updated_at", + imapUpdatedBy: "imap_updated_by", + incomingEmail: "incoming_email", + isGroupOwnerDisplay: "is_group_owner_display", + isGroupUser: "is_group_user", + membersVisibilityLevel: "members_visibility_level", + membershipRequestTemplate: "membership_request_template", + mentionableLevel: "mentionable_level", + messageCount: "message_count", + messageableLevel: "messageable_level", + mutedCategoryIds: "muted_category_ids", + mutedTags: "muted_tags", + primaryGroup: "primary_group", + publicAdmission: "public_admission", + publicExit: "public_exit", + publishReadState: "publish_read_state", + regularCategoryIds: "regular_category_ids", + regularTags: "regular_tags", + smtpEnabled: "smtp_enabled", + smtpPort: "smtp_port", + smtpServer: "smtp_server", + smtpSsl: "smtp_ssl", + smtpUpdatedAt: "smtp_updated_at", + smtpUpdatedBy: "smtp_updated_by", + trackingCategoryIds: "tracking_category_ids", + trackingTags: "tracking_tags", + userCount: "user_count", + visibilityLevel: "visibility_level", + watchingCategoryIds: "watching_category_ids", + watchingFirstPostCategoryIds: "watching_first_post_category_ids", + watchingFirstPostTags: "watching_first_post_tags", + watchingTags: "watching_tags", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetGroupGroup$ { + /** @deprecated use `GetGroupGroup$inboundSchema` instead. */ + export const inboundSchema = GetGroupGroup$inboundSchema; + /** @deprecated use `GetGroupGroup$outboundSchema` instead. */ + export const outboundSchema = GetGroupGroup$outboundSchema; + /** @deprecated use `GetGroupGroup$Outbound` instead. */ + export type Outbound = GetGroupGroup$Outbound; +} + +/** @internal */ +export const GetGroupResponseBody$inboundSchema: z.ZodType< + GetGroupResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + extras: z.lazy(() => Extras$inboundSchema), + group: z.lazy(() => GetGroupGroup$inboundSchema), +}); + +/** @internal */ +export type GetGroupResponseBody$Outbound = { + extras: Extras$Outbound; + group: GetGroupGroup$Outbound; +}; + +/** @internal */ +export const GetGroupResponseBody$outboundSchema: z.ZodType< + GetGroupResponseBody$Outbound, + z.ZodTypeDef, + GetGroupResponseBody +> = z.object({ + extras: z.lazy(() => Extras$outboundSchema), + group: z.lazy(() => GetGroupGroup$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetGroupResponseBody$ { + /** @deprecated use `GetGroupResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetGroupResponseBody$inboundSchema; + /** @deprecated use `GetGroupResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetGroupResponseBody$outboundSchema; + /** @deprecated use `GetGroupResponseBody$Outbound` instead. */ + export type Outbound = GetGroupResponseBody$Outbound; } diff --git a/src/sdk/models/operations/getnotifications.ts b/src/sdk/models/operations/getnotifications.ts index 88cd872..32d9953 100644 --- a/src/sdk/models/operations/getnotifications.ts +++ b/src/sdk/models/operations/getnotifications.ts @@ -1,116 +1,231 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class Data extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "badge_id" }) - badgeId?: number; +export type Data = { + badgeId?: number | undefined; + badgeName?: string | undefined; + badgeSlug?: string | undefined; + badgeTitle?: boolean | undefined; + username?: string | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "badge_name" }) - badgeName?: string; - - @SpeakeasyMetadata() - @Expose({ name: "badge_slug" }) - badgeSlug?: string; - - @SpeakeasyMetadata() - @Expose({ name: "badge_title" }) - badgeTitle?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) - username?: string; -} - -export class Notifications extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "created_at" }) - createdAt?: string; - - @SpeakeasyMetadata() - @Expose({ name: "data" }) - @Type(() => Data) - data?: Data; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) - id?: number; - - @SpeakeasyMetadata() - @Expose({ name: "notification_type" }) - notificationType?: number; - - @SpeakeasyMetadata() - @Expose({ name: "post_number" }) - postNumber?: string; - - @SpeakeasyMetadata() - @Expose({ name: "read" }) - read?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "slug" }) - slug?: string; - - @SpeakeasyMetadata() - @Expose({ name: "topic_id" }) - topicId?: number; - - @SpeakeasyMetadata() - @Expose({ name: "user_id" }) - userId?: number; -} +export type Notifications = { + createdAt?: string | undefined; + data?: Data | undefined; + id?: number | undefined; + notificationType?: number | undefined; + postNumber?: string | null | undefined; + read?: boolean | undefined; + slug?: string | null | undefined; + topicId?: number | null | undefined; + userId?: number | undefined; +}; /** * notifications */ -export class GetNotificationsResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "load_more_notifications" }) - loadMoreNotifications?: string; +export type GetNotificationsResponseBody = { + loadMoreNotifications?: string | undefined; + notifications?: Array | undefined; + seenNotificationId?: number | undefined; + totalRowsNotifications?: number | undefined; +}; - @SpeakeasyMetadata({ elemType: Notifications }) - @Expose({ name: "notifications" }) - @Type(() => Notifications) - notifications?: Notifications[]; +/** @internal */ +export const Data$inboundSchema: z.ZodType = z + .object({ + badge_id: z.number().int().optional(), + badge_name: z.string().optional(), + badge_slug: z.string().optional(), + badge_title: z.boolean().optional(), + username: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + badge_id: "badgeId", + badge_name: "badgeName", + badge_slug: "badgeSlug", + badge_title: "badgeTitle", + }); + }); - @SpeakeasyMetadata() - @Expose({ name: "seen_notification_id" }) - seenNotificationId?: number; +/** @internal */ +export type Data$Outbound = { + badge_id?: number | undefined; + badge_name?: string | undefined; + badge_slug?: string | undefined; + badge_title?: boolean | undefined; + username?: string | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "total_rows_notifications" }) - totalRowsNotifications?: number; +/** @internal */ +export const Data$outboundSchema: z.ZodType = z + .object({ + badgeId: z.number().int().optional(), + badgeName: z.string().optional(), + badgeSlug: z.string().optional(), + badgeTitle: z.boolean().optional(), + username: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + badgeId: "badge_id", + badgeName: "badge_name", + badgeSlug: "badge_slug", + badgeTitle: "badge_title", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Data$ { + /** @deprecated use `Data$inboundSchema` instead. */ + export const inboundSchema = Data$inboundSchema; + /** @deprecated use `Data$outboundSchema` instead. */ + export const outboundSchema = Data$outboundSchema; + /** @deprecated use `Data$Outbound` instead. */ + export type Outbound = Data$Outbound; } -export class GetNotificationsResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const Notifications$inboundSchema: z.ZodType = z + .object({ + created_at: z.string().optional(), + data: z.lazy(() => Data$inboundSchema).optional(), + id: z.number().int().optional(), + notification_type: z.number().int().optional(), + post_number: z.nullable(z.string()).optional(), + read: z.boolean().optional(), + slug: z.nullable(z.string()).optional(), + topic_id: z.nullable(z.number().int()).optional(), + user_id: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + created_at: "createdAt", + notification_type: "notificationType", + post_number: "postNumber", + topic_id: "topicId", + user_id: "userId", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type Notifications$Outbound = { + created_at?: string | undefined; + data?: Data$Outbound | undefined; + id?: number | undefined; + notification_type?: number | undefined; + post_number?: string | null | undefined; + read?: boolean | undefined; + slug?: string | null | undefined; + topic_id?: number | null | undefined; + user_id?: number | undefined; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const Notifications$outboundSchema: z.ZodType< + Notifications$Outbound, + z.ZodTypeDef, + Notifications +> = z + .object({ + createdAt: z.string().optional(), + data: z.lazy(() => Data$outboundSchema).optional(), + id: z.number().int().optional(), + notificationType: z.number().int().optional(), + postNumber: z.nullable(z.string()).optional(), + read: z.boolean().optional(), + slug: z.nullable(z.string()).optional(), + topicId: z.nullable(z.number().int()).optional(), + userId: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + createdAt: "created_at", + notificationType: "notification_type", + postNumber: "post_number", + topicId: "topic_id", + userId: "user_id", + }); + }); - /** - * notifications - */ - @SpeakeasyMetadata() - object?: GetNotificationsResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Notifications$ { + /** @deprecated use `Notifications$inboundSchema` instead. */ + export const inboundSchema = Notifications$inboundSchema; + /** @deprecated use `Notifications$outboundSchema` instead. */ + export const outboundSchema = Notifications$outboundSchema; + /** @deprecated use `Notifications$Outbound` instead. */ + export type Outbound = Notifications$Outbound; +} + +/** @internal */ +export const GetNotificationsResponseBody$inboundSchema: z.ZodType< + GetNotificationsResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + load_more_notifications: z.string().optional(), + notifications: z.array(z.lazy(() => Notifications$inboundSchema)).optional(), + seen_notification_id: z.number().int().optional(), + total_rows_notifications: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + load_more_notifications: "loadMoreNotifications", + seen_notification_id: "seenNotificationId", + total_rows_notifications: "totalRowsNotifications", + }); + }); + +/** @internal */ +export type GetNotificationsResponseBody$Outbound = { + load_more_notifications?: string | undefined; + notifications?: Array | undefined; + seen_notification_id?: number | undefined; + total_rows_notifications?: number | undefined; +}; + +/** @internal */ +export const GetNotificationsResponseBody$outboundSchema: z.ZodType< + GetNotificationsResponseBody$Outbound, + z.ZodTypeDef, + GetNotificationsResponseBody +> = z + .object({ + loadMoreNotifications: z.string().optional(), + notifications: z.array(z.lazy(() => Notifications$outboundSchema)).optional(), + seenNotificationId: z.number().int().optional(), + totalRowsNotifications: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + loadMoreNotifications: "load_more_notifications", + seenNotificationId: "seen_notification_id", + totalRowsNotifications: "total_rows_notifications", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetNotificationsResponseBody$ { + /** @deprecated use `GetNotificationsResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetNotificationsResponseBody$inboundSchema; + /** @deprecated use `GetNotificationsResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetNotificationsResponseBody$outboundSchema; + /** @deprecated use `GetNotificationsResponseBody$Outbound` instead. */ + export type Outbound = GetNotificationsResponseBody$Outbound; } diff --git a/src/sdk/models/operations/getpost.ts b/src/sdk/models/operations/getpost.ts index b74b45a..fb63fb9 100644 --- a/src/sdk/models/operations/getpost.ts +++ b/src/sdk/models/operations/getpost.ts @@ -1,37 +1,449 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import { collectExtraKeys as collectExtraKeys$ } from "../../../lib/schemas.js"; +import * as z from "zod"; -export class GetPostRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) +export type GetPostRequest = { id: string; +}; + +export type ActionsSummary = { + acted?: boolean | undefined; + canAct?: boolean | undefined; + canUndo?: boolean | undefined; + count?: number | undefined; + /** + * `2`: like, `3`, `4`, `6`, `7`, `8`: flag + */ + id: number; +}; + +/** + * single post + */ +export type GetPostResponseBody = { + actionsSummary: Array; + admin: boolean; + avatarTemplate: string; + bookmarked: boolean; + canDelete: boolean; + canEdit: boolean; + canRecover: boolean; + canSeeHiddenPost?: boolean | undefined; + canViewEditHistory: boolean; + canWiki: boolean; + cooked: string; + createdAt: string; + deletedAt: string | null; + displayUsername?: string | null | undefined; + editReason: string | null; + flairBgColor: string | null; + flairColor: string | null; + flairGroupId?: string | null | undefined; + flairName: string | null; + flairUrl: string | null; + hidden: boolean; + id: number; + incomingLinkCount: number; + mentionedUsers?: Array | undefined; + moderator: boolean; + name?: string | null | undefined; + postNumber: number; + postType: number; + primaryGroupName: string | null; + quoteCount: number; + raw: string; + readersCount: number; + reads: number; + replyCount: number; + replyToPostNumber: string | null; + reviewableId: string | null; + reviewableScoreCount: number; + reviewableScorePendingCount: number; + score: number; + staff: boolean; + topicId: number; + topicSlug: string; + trustLevel: number; + updatedAt: string; + userDeleted: boolean; + userId: number; + userTitle: string | null; + username: string; + version: number; + wiki: boolean; + yours: boolean; + additionalProperties: { [k: string]: any }; +}; + +/** @internal */ +export const GetPostRequest$inboundSchema: z.ZodType = + z.object({ + id: z.string(), + }); + +/** @internal */ +export type GetPostRequest$Outbound = { + id: string; +}; + +/** @internal */ +export const GetPostRequest$outboundSchema: z.ZodType< + GetPostRequest$Outbound, + z.ZodTypeDef, + GetPostRequest +> = z.object({ + id: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetPostRequest$ { + /** @deprecated use `GetPostRequest$inboundSchema` instead. */ + export const inboundSchema = GetPostRequest$inboundSchema; + /** @deprecated use `GetPostRequest$outboundSchema` instead. */ + export const outboundSchema = GetPostRequest$outboundSchema; + /** @deprecated use `GetPostRequest$Outbound` instead. */ + export type Outbound = GetPostRequest$Outbound; } -export class GetPostResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const ActionsSummary$inboundSchema: z.ZodType = z + .object({ + acted: z.boolean().optional(), + can_act: z.boolean().optional(), + can_undo: z.boolean().optional(), + count: z.number().int().optional(), + id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + can_act: "canAct", + can_undo: "canUndo", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type ActionsSummary$Outbound = { + acted?: boolean | undefined; + can_act?: boolean | undefined; + can_undo?: boolean | undefined; + count?: number | undefined; + id: number; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const ActionsSummary$outboundSchema: z.ZodType< + ActionsSummary$Outbound, + z.ZodTypeDef, + ActionsSummary +> = z + .object({ + acted: z.boolean().optional(), + canAct: z.boolean().optional(), + canUndo: z.boolean().optional(), + count: z.number().int().optional(), + id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + canAct: "can_act", + canUndo: "can_undo", + }); + }); - /** - * single post - */ - @SpeakeasyMetadata() - object?: Record; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ActionsSummary$ { + /** @deprecated use `ActionsSummary$inboundSchema` instead. */ + export const inboundSchema = ActionsSummary$inboundSchema; + /** @deprecated use `ActionsSummary$outboundSchema` instead. */ + export const outboundSchema = ActionsSummary$outboundSchema; + /** @deprecated use `ActionsSummary$Outbound` instead. */ + export type Outbound = ActionsSummary$Outbound; +} + +/** @internal */ +export const GetPostResponseBody$inboundSchema: z.ZodType< + GetPostResponseBody, + z.ZodTypeDef, + unknown +> = collectExtraKeys$( + z + .object({ + actions_summary: z.array(z.lazy(() => ActionsSummary$inboundSchema)), + admin: z.boolean(), + avatar_template: z.string(), + bookmarked: z.boolean(), + can_delete: z.boolean(), + can_edit: z.boolean(), + can_recover: z.boolean(), + can_see_hidden_post: z.boolean().optional(), + can_view_edit_history: z.boolean(), + can_wiki: z.boolean(), + cooked: z.string(), + created_at: z.string(), + deleted_at: z.nullable(z.string()), + display_username: z.nullable(z.string()).optional(), + edit_reason: z.nullable(z.string()), + flair_bg_color: z.nullable(z.string()), + flair_color: z.nullable(z.string()), + flair_group_id: z.nullable(z.string()).optional(), + flair_name: z.nullable(z.string()), + flair_url: z.nullable(z.string()), + hidden: z.boolean(), + id: z.number().int(), + incoming_link_count: z.number().int(), + mentioned_users: z.array(z.any()).optional(), + moderator: z.boolean(), + name: z.nullable(z.string()).optional(), + post_number: z.number().int(), + post_type: z.number().int(), + primary_group_name: z.nullable(z.string()), + quote_count: z.number().int(), + raw: z.string(), + readers_count: z.number().int(), + reads: z.number().int(), + reply_count: z.number().int(), + reply_to_post_number: z.nullable(z.string()), + reviewable_id: z.nullable(z.string()), + reviewable_score_count: z.number().int(), + reviewable_score_pending_count: z.number().int(), + score: z.number().int(), + staff: z.boolean(), + topic_id: z.number().int(), + topic_slug: z.string(), + trust_level: z.number().int(), + updated_at: z.string(), + user_deleted: z.boolean(), + user_id: z.number().int(), + user_title: z.nullable(z.string()), + username: z.string(), + version: z.number().int(), + wiki: z.boolean(), + yours: z.boolean(), + }) + .catchall(z.any()), + "additionalProperties" +).transform((v) => { + return remap$(v, { + actions_summary: "actionsSummary", + avatar_template: "avatarTemplate", + can_delete: "canDelete", + can_edit: "canEdit", + can_recover: "canRecover", + can_see_hidden_post: "canSeeHiddenPost", + can_view_edit_history: "canViewEditHistory", + can_wiki: "canWiki", + created_at: "createdAt", + deleted_at: "deletedAt", + display_username: "displayUsername", + edit_reason: "editReason", + flair_bg_color: "flairBgColor", + flair_color: "flairColor", + flair_group_id: "flairGroupId", + flair_name: "flairName", + flair_url: "flairUrl", + incoming_link_count: "incomingLinkCount", + mentioned_users: "mentionedUsers", + post_number: "postNumber", + post_type: "postType", + primary_group_name: "primaryGroupName", + quote_count: "quoteCount", + readers_count: "readersCount", + reply_count: "replyCount", + reply_to_post_number: "replyToPostNumber", + reviewable_id: "reviewableId", + reviewable_score_count: "reviewableScoreCount", + reviewable_score_pending_count: "reviewableScorePendingCount", + topic_id: "topicId", + topic_slug: "topicSlug", + trust_level: "trustLevel", + updated_at: "updatedAt", + user_deleted: "userDeleted", + user_id: "userId", + user_title: "userTitle", + }); +}); + +/** @internal */ +export type GetPostResponseBody$Outbound = { + actions_summary: Array; + admin: boolean; + avatar_template: string; + bookmarked: boolean; + can_delete: boolean; + can_edit: boolean; + can_recover: boolean; + can_see_hidden_post?: boolean | undefined; + can_view_edit_history: boolean; + can_wiki: boolean; + cooked: string; + created_at: string; + deleted_at: string | null; + display_username?: string | null | undefined; + edit_reason: string | null; + flair_bg_color: string | null; + flair_color: string | null; + flair_group_id?: string | null | undefined; + flair_name: string | null; + flair_url: string | null; + hidden: boolean; + id: number; + incoming_link_count: number; + mentioned_users?: Array | undefined; + moderator: boolean; + name?: string | null | undefined; + post_number: number; + post_type: number; + primary_group_name: string | null; + quote_count: number; + raw: string; + readers_count: number; + reads: number; + reply_count: number; + reply_to_post_number: string | null; + reviewable_id: string | null; + reviewable_score_count: number; + reviewable_score_pending_count: number; + score: number; + staff: boolean; + topic_id: number; + topic_slug: string; + trust_level: number; + updated_at: string; + user_deleted: boolean; + user_id: number; + user_title: string | null; + username: string; + version: number; + wiki: boolean; + yours: boolean; + [additionalProperties: string]: unknown; +}; + +/** @internal */ +export const GetPostResponseBody$outboundSchema: z.ZodType< + GetPostResponseBody$Outbound, + z.ZodTypeDef, + GetPostResponseBody +> = z + .object({ + additionalProperties: z.record(z.any()), + + actionsSummary: z.array(z.lazy(() => ActionsSummary$outboundSchema)), + admin: z.boolean(), + avatarTemplate: z.string(), + bookmarked: z.boolean(), + canDelete: z.boolean(), + canEdit: z.boolean(), + canRecover: z.boolean(), + canSeeHiddenPost: z.boolean().optional(), + canViewEditHistory: z.boolean(), + canWiki: z.boolean(), + cooked: z.string(), + createdAt: z.string(), + deletedAt: z.nullable(z.string()), + displayUsername: z.nullable(z.string()).optional(), + editReason: z.nullable(z.string()), + flairBgColor: z.nullable(z.string()), + flairColor: z.nullable(z.string()), + flairGroupId: z.nullable(z.string()).optional(), + flairName: z.nullable(z.string()), + flairUrl: z.nullable(z.string()), + hidden: z.boolean(), + id: z.number().int(), + incomingLinkCount: z.number().int(), + mentionedUsers: z.array(z.any()).optional(), + moderator: z.boolean(), + name: z.nullable(z.string()).optional(), + postNumber: z.number().int(), + postType: z.number().int(), + primaryGroupName: z.nullable(z.string()), + quoteCount: z.number().int(), + raw: z.string(), + readersCount: z.number().int(), + reads: z.number().int(), + replyCount: z.number().int(), + replyToPostNumber: z.nullable(z.string()), + reviewableId: z.nullable(z.string()), + reviewableScoreCount: z.number().int(), + reviewableScorePendingCount: z.number().int(), + score: z.number().int(), + staff: z.boolean(), + topicId: z.number().int(), + topicSlug: z.string(), + trustLevel: z.number().int(), + updatedAt: z.string(), + userDeleted: z.boolean(), + userId: z.number().int(), + userTitle: z.nullable(z.string()), + username: z.string(), + version: z.number().int(), + wiki: z.boolean(), + yours: z.boolean(), + }) + .transform((v) => { + return { + ...v.additionalProperties, + ...remap$(v, { + additionalProperties: null, + actionsSummary: "actions_summary", + avatarTemplate: "avatar_template", + canDelete: "can_delete", + canEdit: "can_edit", + canRecover: "can_recover", + canSeeHiddenPost: "can_see_hidden_post", + canViewEditHistory: "can_view_edit_history", + canWiki: "can_wiki", + createdAt: "created_at", + deletedAt: "deleted_at", + displayUsername: "display_username", + editReason: "edit_reason", + flairBgColor: "flair_bg_color", + flairColor: "flair_color", + flairGroupId: "flair_group_id", + flairName: "flair_name", + flairUrl: "flair_url", + incomingLinkCount: "incoming_link_count", + mentionedUsers: "mentioned_users", + postNumber: "post_number", + postType: "post_type", + primaryGroupName: "primary_group_name", + quoteCount: "quote_count", + readersCount: "readers_count", + replyCount: "reply_count", + replyToPostNumber: "reply_to_post_number", + reviewableId: "reviewable_id", + reviewableScoreCount: "reviewable_score_count", + reviewableScorePendingCount: "reviewable_score_pending_count", + topicId: "topic_id", + topicSlug: "topic_slug", + trustLevel: "trust_level", + updatedAt: "updated_at", + userDeleted: "user_deleted", + userId: "user_id", + userTitle: "user_title", + }), + }; + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetPostResponseBody$ { + /** @deprecated use `GetPostResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetPostResponseBody$inboundSchema; + /** @deprecated use `GetPostResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetPostResponseBody$outboundSchema; + /** @deprecated use `GetPostResponseBody$Outbound` instead. */ + export type Outbound = GetPostResponseBody$Outbound; } diff --git a/src/sdk/models/operations/getsite.ts b/src/sdk/models/operations/getsite.ts index 0e0248e..7913738 100644 --- a/src/sdk/models/operations/getsite.ts +++ b/src/sdk/models/operations/getsite.ts @@ -1,764 +1,1637 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class Archetypes extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "id" }) +export type Archetypes = { id: string; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; + options: Array; +}; - @SpeakeasyMetadata() - @Expose({ name: "options" }) - options: any[]; -} - -export class GetSiteRequiredTagGroups extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "min_count" }) +export type GetSiteRequiredTagGroups = { minCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; -} +}; -export class GetSiteCategories extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "allow_global_tags" }) +export type GetSiteCategories = { allowGlobalTags: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "allowed_tag_groups" }) - allowedTagGroups: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "allowed_tags" }) - allowedTags: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "can_edit" }) + allowedTagGroups: Array; + allowedTags: Array; canEdit: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "color" }) color: string; - - @SpeakeasyMetadata() - @Expose({ name: "custom_fields" }) - customFields?: Record; - - @SpeakeasyMetadata() - @Expose({ name: "default_list_filter" }) + customFields?: { [k: string]: any } | null | undefined; defaultListFilter: string; - - @SpeakeasyMetadata() - @Expose({ name: "default_top_period" }) defaultTopPeriod: string; - - @SpeakeasyMetadata() - @Expose({ name: "default_view" }) - defaultView: string; - - @SpeakeasyMetadata() - @Expose({ name: "description" }) - description?: string; - - @SpeakeasyMetadata() - @Expose({ name: "description_excerpt" }) - descriptionExcerpt?: string; - - @SpeakeasyMetadata() - @Expose({ name: "description_text" }) - descriptionText?: string; - - @SpeakeasyMetadata() - @Expose({ name: "form_template_ids" }) - formTemplateIds?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "has_children" }) + defaultView: string | null; + description?: string | null | undefined; + descriptionExcerpt?: string | null | undefined; + descriptionText?: string | null | undefined; + formTemplateIds?: Array | undefined; hasChildren: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "minimum_required_tags" }) minimumRequiredTags: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "navigate_to_first_post_after_read" }) navigateToFirstPostAfterRead: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "notification_level" }) notificationLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "num_featured_topics" }) numFeaturedTopics: number; - - @SpeakeasyMetadata() - @Expose({ name: "parent_category_id" }) - parentCategoryId?: number; - - @SpeakeasyMetadata() - @Expose({ name: "permission" }) + parentCategoryId?: number | undefined; permission: number; - - @SpeakeasyMetadata() - @Expose({ name: "position" }) position: number; - - @SpeakeasyMetadata() - @Expose({ name: "post_count" }) postCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "read_only_banner" }) - readOnlyBanner: string; - - @SpeakeasyMetadata() - @Expose({ name: "read_restricted" }) + readOnlyBanner: string | null; readRestricted: boolean; - - @SpeakeasyMetadata({ elemType: GetSiteRequiredTagGroups }) - @Expose({ name: "required_tag_groups" }) - @Type(() => GetSiteRequiredTagGroups) - requiredTagGroups: GetSiteRequiredTagGroups[]; - - @SpeakeasyMetadata() - @Expose({ name: "show_subcategory_list" }) + requiredTagGroups: Array; showSubcategoryList: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "slug" }) slug: string; - - @SpeakeasyMetadata() - @Expose({ name: "sort_ascending" }) - sortAscending: string; - - @SpeakeasyMetadata() - @Expose({ name: "sort_order" }) - sortOrder: string; - - @SpeakeasyMetadata() - @Expose({ name: "subcategory_list_style" }) + sortAscending: string | null; + sortOrder: string | null; subcategoryListStyle: string; - - @SpeakeasyMetadata() - @Expose({ name: "text_color" }) textColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "topic_count" }) topicCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "topic_template" }) - topicTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "topic_url" }) + topicTemplate: string | null; topicUrl: string; + uploadedBackground: string | null; + uploadedBackgroundDark: string | null; + uploadedLogo: string | null; + uploadedLogoDark: string | null; +}; - @SpeakeasyMetadata() - @Expose({ name: "uploaded_background" }) - uploadedBackground: string; +export type CensoredRegexp = {}; - @SpeakeasyMetadata() - @Expose({ name: "uploaded_background_dark" }) - uploadedBackgroundDark: string; +export type CustomEmojiTranslation = {}; - @SpeakeasyMetadata() - @Expose({ name: "uploaded_logo" }) - uploadedLogo: string; +export type DefaultDarkColorScheme = {}; - @SpeakeasyMetadata() - @Expose({ name: "uploaded_logo_dark" }) - uploadedLogoDark: string; -} - -export class CensoredRegexp extends SpeakeasyBase {} - -export class CustomEmojiTranslation extends SpeakeasyBase {} - -export class DefaultDarkColorScheme extends SpeakeasyBase {} - -export class GetSiteGroups extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "flair_bg_color" }) - flairBgColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_color" }) - flairColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_url" }) - flairUrl: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) +export type GetSiteGroups = { + flairBgColor: string | null; + flairColor: string | null; + flairUrl: string | null; id: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; -} +}; -export class HashtagConfigurations extends SpeakeasyBase {} +export type HashtagConfigurations = {}; -export class HashtagIcons extends SpeakeasyBase {} +export type HashtagIcons = {}; -export class MarkdownAdditionalOptions extends SpeakeasyBase {} +export type MarkdownAdditionalOptions = {}; -export class NotificationTypes extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "admin_problems" }) - adminProblems?: number; - - @SpeakeasyMetadata() - @Expose({ name: "assigned" }) - assigned?: number; - - @SpeakeasyMetadata() - @Expose({ name: "bookmark_reminder" }) +export type NotificationTypes = { + adminProblems?: number | undefined; + assigned?: number | undefined; bookmarkReminder: number; - - @SpeakeasyMetadata() - @Expose({ name: "chat_group_mention" }) chatGroupMention: number; - - @SpeakeasyMetadata() - @Expose({ name: "chat_invitation" }) chatInvitation: number; - - @SpeakeasyMetadata() - @Expose({ name: "chat_mention" }) chatMention: number; - - @SpeakeasyMetadata() - @Expose({ name: "chat_message" }) chatMessage: number; - - @SpeakeasyMetadata() - @Expose({ name: "chat_quoted" }) - chatQuoted?: number; - - @SpeakeasyMetadata() - @Expose({ name: "circles_activity" }) - circlesActivity?: number; - - @SpeakeasyMetadata() - @Expose({ name: "code_review_commit_approved" }) + chatQuoted?: number | undefined; + circlesActivity?: number | undefined; codeReviewCommitApproved: number; - - @SpeakeasyMetadata() - @Expose({ name: "custom" }) custom: number; - - @SpeakeasyMetadata() - @Expose({ name: "edited" }) edited: number; - - @SpeakeasyMetadata() - @Expose({ name: "event_invitation" }) eventInvitation: number; - - @SpeakeasyMetadata() - @Expose({ name: "event_reminder" }) eventReminder: number; - - @SpeakeasyMetadata() - @Expose({ name: "following" }) - following?: number; - - @SpeakeasyMetadata() - @Expose({ name: "following_created_topic" }) - followingCreatedTopic?: number; - - @SpeakeasyMetadata() - @Expose({ name: "following_replied" }) - followingReplied?: number; - - @SpeakeasyMetadata() - @Expose({ name: "granted_badge" }) + following?: number | undefined; + followingCreatedTopic?: number | undefined; + followingReplied?: number | undefined; grantedBadge: number; - - @SpeakeasyMetadata() - @Expose({ name: "group_mentioned" }) groupMentioned: number; - - @SpeakeasyMetadata() - @Expose({ name: "group_message_summary" }) groupMessageSummary: number; - - @SpeakeasyMetadata() - @Expose({ name: "invited_to_private_message" }) invitedToPrivateMessage: number; - - @SpeakeasyMetadata() - @Expose({ name: "invited_to_topic" }) invitedToTopic: number; - - @SpeakeasyMetadata() - @Expose({ name: "invitee_accepted" }) inviteeAccepted: number; - - @SpeakeasyMetadata() - @Expose({ name: "liked" }) liked: number; - - @SpeakeasyMetadata() - @Expose({ name: "liked_consolidated" }) likedConsolidated: number; - - @SpeakeasyMetadata() - @Expose({ name: "linked" }) linked: number; - - @SpeakeasyMetadata() - @Expose({ name: "membership_request_accepted" }) membershipRequestAccepted: number; - - @SpeakeasyMetadata() - @Expose({ name: "membership_request_consolidated" }) membershipRequestConsolidated: number; - - @SpeakeasyMetadata() - @Expose({ name: "mentioned" }) mentioned: number; - - @SpeakeasyMetadata() - @Expose({ name: "moved_post" }) movedPost: number; - - @SpeakeasyMetadata() - @Expose({ name: "new_features" }) - newFeatures?: number; - - @SpeakeasyMetadata() - @Expose({ name: "post_approved" }) + newFeatures?: number | undefined; postApproved: number; - - @SpeakeasyMetadata() - @Expose({ name: "posted" }) posted: number; - - @SpeakeasyMetadata() - @Expose({ name: "private_message" }) privateMessage: number; - - @SpeakeasyMetadata() - @Expose({ name: "question_answer_user_commented" }) - questionAnswerUserCommented?: number; - - @SpeakeasyMetadata() - @Expose({ name: "quoted" }) + questionAnswerUserCommented?: number | undefined; quoted: number; - - @SpeakeasyMetadata() - @Expose({ name: "reaction" }) reaction: number; - - @SpeakeasyMetadata() - @Expose({ name: "replied" }) replied: number; - - @SpeakeasyMetadata() - @Expose({ name: "topic_reminder" }) topicReminder: number; - - @SpeakeasyMetadata() - @Expose({ name: "votes_released" }) votesReleased: number; - - @SpeakeasyMetadata() - @Expose({ name: "watching_category_or_tag" }) watchingCategoryOrTag: number; - - @SpeakeasyMetadata() - @Expose({ name: "watching_first_post" }) watchingFirstPost: number; -} +}; -export class PostActionTypes extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "description" }) +export type PostActionTypes = { description: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) - id: number; - - @SpeakeasyMetadata() - @Expose({ name: "is_custom_flag" }) + id: number | null; isCustomFlag: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "is_flag" }) isFlag: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "name_key" }) - nameKey: string; - - @SpeakeasyMetadata() - @Expose({ name: "short_description" }) + nameKey: string | null; shortDescription: string; -} +}; -export class PostTypes extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "moderator_action" }) +export type PostTypes = { moderatorAction: number; - - @SpeakeasyMetadata() - @Expose({ name: "regular" }) regular: number; - - @SpeakeasyMetadata() - @Expose({ name: "small_action" }) smallAction: number; - - @SpeakeasyMetadata() - @Expose({ name: "whisper" }) whisper: number; -} +}; -export class TopicFlagTypes extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "description" }) +export type TopicFlagTypes = { description: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) - id: number; - - @SpeakeasyMetadata() - @Expose({ name: "is_custom_flag" }) + id: number | null; isCustomFlag: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "is_flag" }) isFlag: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "name_key" }) - nameKey: string; - - @SpeakeasyMetadata() - @Expose({ name: "short_description" }) + nameKey: string | null; shortDescription: string; -} +}; -export class TrustLevels extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "basic" }) +export type TrustLevels = { basic: number; - - @SpeakeasyMetadata() - @Expose({ name: "leader" }) leader: number; - - @SpeakeasyMetadata() - @Expose({ name: "member" }) member: number; - - @SpeakeasyMetadata() - @Expose({ name: "newuser" }) newuser: number; - - @SpeakeasyMetadata() - @Expose({ name: "regular" }) regular: number; -} +}; -export class UserColorSchemes extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "id" }) +export type UserColorSchemes = { id: number; - - @SpeakeasyMetadata() - @Expose({ name: "is_dark" }) isDark: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; -} +}; -export class UserThemes extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "color_scheme_id" }) - colorSchemeId: number; - - @SpeakeasyMetadata() - @Expose({ name: "default" }) +export type UserThemes = { + colorSchemeId: number | null; default: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "theme_id" }) themeId: number; -} +}; -export class UserTips extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "admin_guide" }) +export type UserTips = { adminGuide: number; - - @SpeakeasyMetadata() - @Expose({ name: "first_notification" }) firstNotification: number; - - @SpeakeasyMetadata() - @Expose({ name: "post_menu" }) postMenu: number; - - @SpeakeasyMetadata() - @Expose({ name: "suggested_topics" }) suggestedTopics: number; - - @SpeakeasyMetadata() - @Expose({ name: "topic_notification_levels" }) topicNotificationLevels: number; - - @SpeakeasyMetadata() - @Expose({ name: "topic_timeline" }) topicTimeline: number; -} +}; /** * success response */ -export class GetSiteResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "anonymous_top_menu_items" }) - anonymousTopMenuItems: any[]; - - @SpeakeasyMetadata({ elemType: Archetypes }) - @Expose({ name: "archetypes" }) - @Type(() => Archetypes) - archetypes: Archetypes[]; - - @SpeakeasyMetadata() - @Expose({ name: "auth_providers" }) - authProviders: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "can_associate_groups" }) - canAssociateGroups?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_create_tag" }) +export type GetSiteResponseBody = { + anonymousTopMenuItems: Array; + archetypes: Array; + authProviders: Array; + canAssociateGroups?: boolean | undefined; canCreateTag: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_tag_pms" }) canTagPms: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_tag_topics" }) canTagTopics: boolean; - - @SpeakeasyMetadata({ elemType: GetSiteCategories }) - @Expose({ name: "categories" }) - @Type(() => GetSiteCategories) - categories: GetSiteCategories[]; - - @SpeakeasyMetadata({ elemType: CensoredRegexp }) - @Expose({ name: "censored_regexp" }) - @Type(() => CensoredRegexp) - censoredRegexp: CensoredRegexp[]; - - @SpeakeasyMetadata() - @Expose({ name: "custom_emoji_translation" }) - @Type(() => CustomEmojiTranslation) + categories: Array; + censoredRegexp: Array; customEmojiTranslation: CustomEmojiTranslation; - - @SpeakeasyMetadata() - @Expose({ name: "default_archetype" }) defaultArchetype: string; - - @SpeakeasyMetadata() - @Expose({ name: "default_dark_color_scheme" }) - @Type(() => DefaultDarkColorScheme) - defaultDarkColorScheme: DefaultDarkColorScheme; - - @SpeakeasyMetadata() - @Expose({ name: "denied_emojis" }) - deniedEmojis?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "displayed_about_plugin_stat_groups" }) - displayedAboutPluginStatGroups?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "filters" }) - filters: any[]; - - @SpeakeasyMetadata({ elemType: GetSiteGroups }) - @Expose({ name: "groups" }) - @Type(() => GetSiteGroups) - groups: GetSiteGroups[]; - - @SpeakeasyMetadata() - @Expose({ name: "hashtag_configurations" }) - @Type(() => HashtagConfigurations) - hashtagConfigurations?: HashtagConfigurations; - - @SpeakeasyMetadata() - @Expose({ name: "hashtag_icons" }) - @Type(() => HashtagIcons) - hashtagIcons?: HashtagIcons; - - @SpeakeasyMetadata() - @Expose({ name: "markdown_additional_options" }) - @Type(() => MarkdownAdditionalOptions) - markdownAdditionalOptions?: MarkdownAdditionalOptions; - - @SpeakeasyMetadata() - @Expose({ name: "navigation_menu_site_top_tags" }) - navigationMenuSiteTopTags?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "notification_types" }) - @Type(() => NotificationTypes) + defaultDarkColorScheme: DefaultDarkColorScheme | null; + deniedEmojis?: Array | undefined; + displayedAboutPluginStatGroups?: Array | undefined; + filters: Array; + groups: Array; + hashtagConfigurations?: HashtagConfigurations | undefined; + hashtagIcons?: HashtagIcons | undefined; + markdownAdditionalOptions?: MarkdownAdditionalOptions | undefined; + navigationMenuSiteTopTags?: Array | undefined; notificationTypes: NotificationTypes; - - @SpeakeasyMetadata() - @Expose({ name: "periods" }) - periods: any[]; - - @SpeakeasyMetadata({ elemType: PostActionTypes }) - @Expose({ name: "post_action_types" }) - @Type(() => PostActionTypes) - postActionTypes: PostActionTypes[]; - - @SpeakeasyMetadata() - @Expose({ name: "post_types" }) - @Type(() => PostTypes) + periods: Array; + postActionTypes: Array; postTypes: PostTypes; - - @SpeakeasyMetadata() - @Expose({ name: "tags_filter_regexp" }) tagsFilterRegexp: string; - - @SpeakeasyMetadata() - @Expose({ name: "top_menu_items" }) - topMenuItems: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "top_tags" }) - topTags: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "topic_featured_link_allowed_category_ids" }) - topicFeaturedLinkAllowedCategoryIds: any[]; - - @SpeakeasyMetadata({ elemType: TopicFlagTypes }) - @Expose({ name: "topic_flag_types" }) - @Type(() => TopicFlagTypes) - topicFlagTypes: TopicFlagTypes[]; - - @SpeakeasyMetadata() - @Expose({ name: "trust_levels" }) - @Type(() => TrustLevels) + topMenuItems: Array; + topTags: Array; + topicFeaturedLinkAllowedCategoryIds: Array; + topicFlagTypes: Array; trustLevels: TrustLevels; - - @SpeakeasyMetadata() - @Expose({ name: "uncategorized_category_id" }) uncategorizedCategoryId: number; - - @SpeakeasyMetadata({ elemType: UserColorSchemes }) - @Expose({ name: "user_color_schemes" }) - @Type(() => UserColorSchemes) - userColorSchemes: UserColorSchemes[]; - - @SpeakeasyMetadata() - @Expose({ name: "user_field_max_length" }) + userColorSchemes: Array; userFieldMaxLength: number; + userFields: Array; + userThemes: Array; + userTips?: UserTips | undefined; + watchedWordsLink: string | null; + watchedWordsReplace: string | null; + whispersAllowedGroupsNames?: Array | undefined; + wizardRequired?: boolean | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "user_fields" }) - userFields: any[]; +/** @internal */ +export const Archetypes$inboundSchema: z.ZodType = z.object({ + id: z.string(), + name: z.string(), + options: z.array(z.any()), +}); - @SpeakeasyMetadata({ elemType: UserThemes }) - @Expose({ name: "user_themes" }) - @Type(() => UserThemes) - userThemes: UserThemes[]; +/** @internal */ +export type Archetypes$Outbound = { + id: string; + name: string; + options: Array; +}; - @SpeakeasyMetadata() - @Expose({ name: "user_tips" }) - @Type(() => UserTips) - userTips?: UserTips; +/** @internal */ +export const Archetypes$outboundSchema: z.ZodType = + z.object({ + id: z.string(), + name: z.string(), + options: z.array(z.any()), + }); - @SpeakeasyMetadata() - @Expose({ name: "watched_words_link" }) - watchedWordsLink: string; - - @SpeakeasyMetadata() - @Expose({ name: "watched_words_replace" }) - watchedWordsReplace: string; - - @SpeakeasyMetadata() - @Expose({ name: "whispers_allowed_groups_names" }) - whispersAllowedGroupsNames?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "wizard_required" }) - wizardRequired?: boolean; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Archetypes$ { + /** @deprecated use `Archetypes$inboundSchema` instead. */ + export const inboundSchema = Archetypes$inboundSchema; + /** @deprecated use `Archetypes$outboundSchema` instead. */ + export const outboundSchema = Archetypes$outboundSchema; + /** @deprecated use `Archetypes$Outbound` instead. */ + export type Outbound = Archetypes$Outbound; } -export class GetSiteResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const GetSiteRequiredTagGroups$inboundSchema: z.ZodType< + GetSiteRequiredTagGroups, + z.ZodTypeDef, + unknown +> = z + .object({ + min_count: z.number().int(), + name: z.string(), + }) + .transform((v) => { + return remap$(v, { + min_count: "minCount", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type GetSiteRequiredTagGroups$Outbound = { + min_count: number; + name: string; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const GetSiteRequiredTagGroups$outboundSchema: z.ZodType< + GetSiteRequiredTagGroups$Outbound, + z.ZodTypeDef, + GetSiteRequiredTagGroups +> = z + .object({ + minCount: z.number().int(), + name: z.string(), + }) + .transform((v) => { + return remap$(v, { + minCount: "min_count", + }); + }); - /** - * success response - */ - @SpeakeasyMetadata() - object?: GetSiteResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetSiteRequiredTagGroups$ { + /** @deprecated use `GetSiteRequiredTagGroups$inboundSchema` instead. */ + export const inboundSchema = GetSiteRequiredTagGroups$inboundSchema; + /** @deprecated use `GetSiteRequiredTagGroups$outboundSchema` instead. */ + export const outboundSchema = GetSiteRequiredTagGroups$outboundSchema; + /** @deprecated use `GetSiteRequiredTagGroups$Outbound` instead. */ + export type Outbound = GetSiteRequiredTagGroups$Outbound; +} + +/** @internal */ +export const GetSiteCategories$inboundSchema: z.ZodType = + z + .object({ + allow_global_tags: z.boolean(), + allowed_tag_groups: z.array(z.any()), + allowed_tags: z.array(z.any()), + can_edit: z.boolean(), + color: z.string(), + custom_fields: z.nullable(z.record(z.any())).optional(), + default_list_filter: z.string(), + default_top_period: z.string(), + default_view: z.nullable(z.string()), + description: z.nullable(z.string()).optional(), + description_excerpt: z.nullable(z.string()).optional(), + description_text: z.nullable(z.string()).optional(), + form_template_ids: z.array(z.any()).optional(), + has_children: z.boolean(), + id: z.number().int(), + minimum_required_tags: z.number().int(), + name: z.string(), + navigate_to_first_post_after_read: z.boolean(), + notification_level: z.number().int(), + num_featured_topics: z.number().int(), + parent_category_id: z.number().int().optional(), + permission: z.number().int(), + position: z.number().int(), + post_count: z.number().int(), + read_only_banner: z.nullable(z.string()), + read_restricted: z.boolean(), + required_tag_groups: z.array(z.lazy(() => GetSiteRequiredTagGroups$inboundSchema)), + show_subcategory_list: z.boolean(), + slug: z.string(), + sort_ascending: z.nullable(z.string()), + sort_order: z.nullable(z.string()), + subcategory_list_style: z.string(), + text_color: z.string(), + topic_count: z.number().int(), + topic_template: z.nullable(z.string()), + topic_url: z.string(), + uploaded_background: z.nullable(z.string()), + uploaded_background_dark: z.nullable(z.string()), + uploaded_logo: z.nullable(z.string()), + uploaded_logo_dark: z.nullable(z.string()), + }) + .transform((v) => { + return remap$(v, { + allow_global_tags: "allowGlobalTags", + allowed_tag_groups: "allowedTagGroups", + allowed_tags: "allowedTags", + can_edit: "canEdit", + custom_fields: "customFields", + default_list_filter: "defaultListFilter", + default_top_period: "defaultTopPeriod", + default_view: "defaultView", + description_excerpt: "descriptionExcerpt", + description_text: "descriptionText", + form_template_ids: "formTemplateIds", + has_children: "hasChildren", + minimum_required_tags: "minimumRequiredTags", + navigate_to_first_post_after_read: "navigateToFirstPostAfterRead", + notification_level: "notificationLevel", + num_featured_topics: "numFeaturedTopics", + parent_category_id: "parentCategoryId", + post_count: "postCount", + read_only_banner: "readOnlyBanner", + read_restricted: "readRestricted", + required_tag_groups: "requiredTagGroups", + show_subcategory_list: "showSubcategoryList", + sort_ascending: "sortAscending", + sort_order: "sortOrder", + subcategory_list_style: "subcategoryListStyle", + text_color: "textColor", + topic_count: "topicCount", + topic_template: "topicTemplate", + topic_url: "topicUrl", + uploaded_background: "uploadedBackground", + uploaded_background_dark: "uploadedBackgroundDark", + uploaded_logo: "uploadedLogo", + uploaded_logo_dark: "uploadedLogoDark", + }); + }); + +/** @internal */ +export type GetSiteCategories$Outbound = { + allow_global_tags: boolean; + allowed_tag_groups: Array; + allowed_tags: Array; + can_edit: boolean; + color: string; + custom_fields?: { [k: string]: any } | null | undefined; + default_list_filter: string; + default_top_period: string; + default_view: string | null; + description?: string | null | undefined; + description_excerpt?: string | null | undefined; + description_text?: string | null | undefined; + form_template_ids?: Array | undefined; + has_children: boolean; + id: number; + minimum_required_tags: number; + name: string; + navigate_to_first_post_after_read: boolean; + notification_level: number; + num_featured_topics: number; + parent_category_id?: number | undefined; + permission: number; + position: number; + post_count: number; + read_only_banner: string | null; + read_restricted: boolean; + required_tag_groups: Array; + show_subcategory_list: boolean; + slug: string; + sort_ascending: string | null; + sort_order: string | null; + subcategory_list_style: string; + text_color: string; + topic_count: number; + topic_template: string | null; + topic_url: string; + uploaded_background: string | null; + uploaded_background_dark: string | null; + uploaded_logo: string | null; + uploaded_logo_dark: string | null; +}; + +/** @internal */ +export const GetSiteCategories$outboundSchema: z.ZodType< + GetSiteCategories$Outbound, + z.ZodTypeDef, + GetSiteCategories +> = z + .object({ + allowGlobalTags: z.boolean(), + allowedTagGroups: z.array(z.any()), + allowedTags: z.array(z.any()), + canEdit: z.boolean(), + color: z.string(), + customFields: z.nullable(z.record(z.any())).optional(), + defaultListFilter: z.string(), + defaultTopPeriod: z.string(), + defaultView: z.nullable(z.string()), + description: z.nullable(z.string()).optional(), + descriptionExcerpt: z.nullable(z.string()).optional(), + descriptionText: z.nullable(z.string()).optional(), + formTemplateIds: z.array(z.any()).optional(), + hasChildren: z.boolean(), + id: z.number().int(), + minimumRequiredTags: z.number().int(), + name: z.string(), + navigateToFirstPostAfterRead: z.boolean(), + notificationLevel: z.number().int(), + numFeaturedTopics: z.number().int(), + parentCategoryId: z.number().int().optional(), + permission: z.number().int(), + position: z.number().int(), + postCount: z.number().int(), + readOnlyBanner: z.nullable(z.string()), + readRestricted: z.boolean(), + requiredTagGroups: z.array(z.lazy(() => GetSiteRequiredTagGroups$outboundSchema)), + showSubcategoryList: z.boolean(), + slug: z.string(), + sortAscending: z.nullable(z.string()), + sortOrder: z.nullable(z.string()), + subcategoryListStyle: z.string(), + textColor: z.string(), + topicCount: z.number().int(), + topicTemplate: z.nullable(z.string()), + topicUrl: z.string(), + uploadedBackground: z.nullable(z.string()), + uploadedBackgroundDark: z.nullable(z.string()), + uploadedLogo: z.nullable(z.string()), + uploadedLogoDark: z.nullable(z.string()), + }) + .transform((v) => { + return remap$(v, { + allowGlobalTags: "allow_global_tags", + allowedTagGroups: "allowed_tag_groups", + allowedTags: "allowed_tags", + canEdit: "can_edit", + customFields: "custom_fields", + defaultListFilter: "default_list_filter", + defaultTopPeriod: "default_top_period", + defaultView: "default_view", + descriptionExcerpt: "description_excerpt", + descriptionText: "description_text", + formTemplateIds: "form_template_ids", + hasChildren: "has_children", + minimumRequiredTags: "minimum_required_tags", + navigateToFirstPostAfterRead: "navigate_to_first_post_after_read", + notificationLevel: "notification_level", + numFeaturedTopics: "num_featured_topics", + parentCategoryId: "parent_category_id", + postCount: "post_count", + readOnlyBanner: "read_only_banner", + readRestricted: "read_restricted", + requiredTagGroups: "required_tag_groups", + showSubcategoryList: "show_subcategory_list", + sortAscending: "sort_ascending", + sortOrder: "sort_order", + subcategoryListStyle: "subcategory_list_style", + textColor: "text_color", + topicCount: "topic_count", + topicTemplate: "topic_template", + topicUrl: "topic_url", + uploadedBackground: "uploaded_background", + uploadedBackgroundDark: "uploaded_background_dark", + uploadedLogo: "uploaded_logo", + uploadedLogoDark: "uploaded_logo_dark", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetSiteCategories$ { + /** @deprecated use `GetSiteCategories$inboundSchema` instead. */ + export const inboundSchema = GetSiteCategories$inboundSchema; + /** @deprecated use `GetSiteCategories$outboundSchema` instead. */ + export const outboundSchema = GetSiteCategories$outboundSchema; + /** @deprecated use `GetSiteCategories$Outbound` instead. */ + export type Outbound = GetSiteCategories$Outbound; +} + +/** @internal */ +export const CensoredRegexp$inboundSchema: z.ZodType = + z.object({}); + +/** @internal */ +export type CensoredRegexp$Outbound = {}; + +/** @internal */ +export const CensoredRegexp$outboundSchema: z.ZodType< + CensoredRegexp$Outbound, + z.ZodTypeDef, + CensoredRegexp +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CensoredRegexp$ { + /** @deprecated use `CensoredRegexp$inboundSchema` instead. */ + export const inboundSchema = CensoredRegexp$inboundSchema; + /** @deprecated use `CensoredRegexp$outboundSchema` instead. */ + export const outboundSchema = CensoredRegexp$outboundSchema; + /** @deprecated use `CensoredRegexp$Outbound` instead. */ + export type Outbound = CensoredRegexp$Outbound; +} + +/** @internal */ +export const CustomEmojiTranslation$inboundSchema: z.ZodType< + CustomEmojiTranslation, + z.ZodTypeDef, + unknown +> = z.object({}); + +/** @internal */ +export type CustomEmojiTranslation$Outbound = {}; + +/** @internal */ +export const CustomEmojiTranslation$outboundSchema: z.ZodType< + CustomEmojiTranslation$Outbound, + z.ZodTypeDef, + CustomEmojiTranslation +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CustomEmojiTranslation$ { + /** @deprecated use `CustomEmojiTranslation$inboundSchema` instead. */ + export const inboundSchema = CustomEmojiTranslation$inboundSchema; + /** @deprecated use `CustomEmojiTranslation$outboundSchema` instead. */ + export const outboundSchema = CustomEmojiTranslation$outboundSchema; + /** @deprecated use `CustomEmojiTranslation$Outbound` instead. */ + export type Outbound = CustomEmojiTranslation$Outbound; +} + +/** @internal */ +export const DefaultDarkColorScheme$inboundSchema: z.ZodType< + DefaultDarkColorScheme, + z.ZodTypeDef, + unknown +> = z.object({}); + +/** @internal */ +export type DefaultDarkColorScheme$Outbound = {}; + +/** @internal */ +export const DefaultDarkColorScheme$outboundSchema: z.ZodType< + DefaultDarkColorScheme$Outbound, + z.ZodTypeDef, + DefaultDarkColorScheme +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DefaultDarkColorScheme$ { + /** @deprecated use `DefaultDarkColorScheme$inboundSchema` instead. */ + export const inboundSchema = DefaultDarkColorScheme$inboundSchema; + /** @deprecated use `DefaultDarkColorScheme$outboundSchema` instead. */ + export const outboundSchema = DefaultDarkColorScheme$outboundSchema; + /** @deprecated use `DefaultDarkColorScheme$Outbound` instead. */ + export type Outbound = DefaultDarkColorScheme$Outbound; +} + +/** @internal */ +export const GetSiteGroups$inboundSchema: z.ZodType = z + .object({ + flair_bg_color: z.nullable(z.string()), + flair_color: z.nullable(z.string()), + flair_url: z.nullable(z.string()), + id: z.number().int(), + name: z.string(), + }) + .transform((v) => { + return remap$(v, { + flair_bg_color: "flairBgColor", + flair_color: "flairColor", + flair_url: "flairUrl", + }); + }); + +/** @internal */ +export type GetSiteGroups$Outbound = { + flair_bg_color: string | null; + flair_color: string | null; + flair_url: string | null; + id: number; + name: string; +}; + +/** @internal */ +export const GetSiteGroups$outboundSchema: z.ZodType< + GetSiteGroups$Outbound, + z.ZodTypeDef, + GetSiteGroups +> = z + .object({ + flairBgColor: z.nullable(z.string()), + flairColor: z.nullable(z.string()), + flairUrl: z.nullable(z.string()), + id: z.number().int(), + name: z.string(), + }) + .transform((v) => { + return remap$(v, { + flairBgColor: "flair_bg_color", + flairColor: "flair_color", + flairUrl: "flair_url", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetSiteGroups$ { + /** @deprecated use `GetSiteGroups$inboundSchema` instead. */ + export const inboundSchema = GetSiteGroups$inboundSchema; + /** @deprecated use `GetSiteGroups$outboundSchema` instead. */ + export const outboundSchema = GetSiteGroups$outboundSchema; + /** @deprecated use `GetSiteGroups$Outbound` instead. */ + export type Outbound = GetSiteGroups$Outbound; +} + +/** @internal */ +export const HashtagConfigurations$inboundSchema: z.ZodType< + HashtagConfigurations, + z.ZodTypeDef, + unknown +> = z.object({}); + +/** @internal */ +export type HashtagConfigurations$Outbound = {}; + +/** @internal */ +export const HashtagConfigurations$outboundSchema: z.ZodType< + HashtagConfigurations$Outbound, + z.ZodTypeDef, + HashtagConfigurations +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace HashtagConfigurations$ { + /** @deprecated use `HashtagConfigurations$inboundSchema` instead. */ + export const inboundSchema = HashtagConfigurations$inboundSchema; + /** @deprecated use `HashtagConfigurations$outboundSchema` instead. */ + export const outboundSchema = HashtagConfigurations$outboundSchema; + /** @deprecated use `HashtagConfigurations$Outbound` instead. */ + export type Outbound = HashtagConfigurations$Outbound; +} + +/** @internal */ +export const HashtagIcons$inboundSchema: z.ZodType = z.object( + {} +); + +/** @internal */ +export type HashtagIcons$Outbound = {}; + +/** @internal */ +export const HashtagIcons$outboundSchema: z.ZodType< + HashtagIcons$Outbound, + z.ZodTypeDef, + HashtagIcons +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace HashtagIcons$ { + /** @deprecated use `HashtagIcons$inboundSchema` instead. */ + export const inboundSchema = HashtagIcons$inboundSchema; + /** @deprecated use `HashtagIcons$outboundSchema` instead. */ + export const outboundSchema = HashtagIcons$outboundSchema; + /** @deprecated use `HashtagIcons$Outbound` instead. */ + export type Outbound = HashtagIcons$Outbound; +} + +/** @internal */ +export const MarkdownAdditionalOptions$inboundSchema: z.ZodType< + MarkdownAdditionalOptions, + z.ZodTypeDef, + unknown +> = z.object({}); + +/** @internal */ +export type MarkdownAdditionalOptions$Outbound = {}; + +/** @internal */ +export const MarkdownAdditionalOptions$outboundSchema: z.ZodType< + MarkdownAdditionalOptions$Outbound, + z.ZodTypeDef, + MarkdownAdditionalOptions +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace MarkdownAdditionalOptions$ { + /** @deprecated use `MarkdownAdditionalOptions$inboundSchema` instead. */ + export const inboundSchema = MarkdownAdditionalOptions$inboundSchema; + /** @deprecated use `MarkdownAdditionalOptions$outboundSchema` instead. */ + export const outboundSchema = MarkdownAdditionalOptions$outboundSchema; + /** @deprecated use `MarkdownAdditionalOptions$Outbound` instead. */ + export type Outbound = MarkdownAdditionalOptions$Outbound; +} + +/** @internal */ +export const NotificationTypes$inboundSchema: z.ZodType = + z + .object({ + admin_problems: z.number().int().optional(), + assigned: z.number().int().optional(), + bookmark_reminder: z.number().int(), + chat_group_mention: z.number().int(), + chat_invitation: z.number().int(), + chat_mention: z.number().int(), + chat_message: z.number().int(), + chat_quoted: z.number().int().optional(), + circles_activity: z.number().int().optional(), + code_review_commit_approved: z.number().int(), + custom: z.number().int(), + edited: z.number().int(), + event_invitation: z.number().int(), + event_reminder: z.number().int(), + following: z.number().int().optional(), + following_created_topic: z.number().int().optional(), + following_replied: z.number().int().optional(), + granted_badge: z.number().int(), + group_mentioned: z.number().int(), + group_message_summary: z.number().int(), + invited_to_private_message: z.number().int(), + invited_to_topic: z.number().int(), + invitee_accepted: z.number().int(), + liked: z.number().int(), + liked_consolidated: z.number().int(), + linked: z.number().int(), + membership_request_accepted: z.number().int(), + membership_request_consolidated: z.number().int(), + mentioned: z.number().int(), + moved_post: z.number().int(), + new_features: z.number().int().optional(), + post_approved: z.number().int(), + posted: z.number().int(), + private_message: z.number().int(), + question_answer_user_commented: z.number().int().optional(), + quoted: z.number().int(), + reaction: z.number().int(), + replied: z.number().int(), + topic_reminder: z.number().int(), + votes_released: z.number().int(), + watching_category_or_tag: z.number().int(), + watching_first_post: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + admin_problems: "adminProblems", + bookmark_reminder: "bookmarkReminder", + chat_group_mention: "chatGroupMention", + chat_invitation: "chatInvitation", + chat_mention: "chatMention", + chat_message: "chatMessage", + chat_quoted: "chatQuoted", + circles_activity: "circlesActivity", + code_review_commit_approved: "codeReviewCommitApproved", + event_invitation: "eventInvitation", + event_reminder: "eventReminder", + following_created_topic: "followingCreatedTopic", + following_replied: "followingReplied", + granted_badge: "grantedBadge", + group_mentioned: "groupMentioned", + group_message_summary: "groupMessageSummary", + invited_to_private_message: "invitedToPrivateMessage", + invited_to_topic: "invitedToTopic", + invitee_accepted: "inviteeAccepted", + liked_consolidated: "likedConsolidated", + membership_request_accepted: "membershipRequestAccepted", + membership_request_consolidated: "membershipRequestConsolidated", + moved_post: "movedPost", + new_features: "newFeatures", + post_approved: "postApproved", + private_message: "privateMessage", + question_answer_user_commented: "questionAnswerUserCommented", + topic_reminder: "topicReminder", + votes_released: "votesReleased", + watching_category_or_tag: "watchingCategoryOrTag", + watching_first_post: "watchingFirstPost", + }); + }); + +/** @internal */ +export type NotificationTypes$Outbound = { + admin_problems?: number | undefined; + assigned?: number | undefined; + bookmark_reminder: number; + chat_group_mention: number; + chat_invitation: number; + chat_mention: number; + chat_message: number; + chat_quoted?: number | undefined; + circles_activity?: number | undefined; + code_review_commit_approved: number; + custom: number; + edited: number; + event_invitation: number; + event_reminder: number; + following?: number | undefined; + following_created_topic?: number | undefined; + following_replied?: number | undefined; + granted_badge: number; + group_mentioned: number; + group_message_summary: number; + invited_to_private_message: number; + invited_to_topic: number; + invitee_accepted: number; + liked: number; + liked_consolidated: number; + linked: number; + membership_request_accepted: number; + membership_request_consolidated: number; + mentioned: number; + moved_post: number; + new_features?: number | undefined; + post_approved: number; + posted: number; + private_message: number; + question_answer_user_commented?: number | undefined; + quoted: number; + reaction: number; + replied: number; + topic_reminder: number; + votes_released: number; + watching_category_or_tag: number; + watching_first_post: number; +}; + +/** @internal */ +export const NotificationTypes$outboundSchema: z.ZodType< + NotificationTypes$Outbound, + z.ZodTypeDef, + NotificationTypes +> = z + .object({ + adminProblems: z.number().int().optional(), + assigned: z.number().int().optional(), + bookmarkReminder: z.number().int(), + chatGroupMention: z.number().int(), + chatInvitation: z.number().int(), + chatMention: z.number().int(), + chatMessage: z.number().int(), + chatQuoted: z.number().int().optional(), + circlesActivity: z.number().int().optional(), + codeReviewCommitApproved: z.number().int(), + custom: z.number().int(), + edited: z.number().int(), + eventInvitation: z.number().int(), + eventReminder: z.number().int(), + following: z.number().int().optional(), + followingCreatedTopic: z.number().int().optional(), + followingReplied: z.number().int().optional(), + grantedBadge: z.number().int(), + groupMentioned: z.number().int(), + groupMessageSummary: z.number().int(), + invitedToPrivateMessage: z.number().int(), + invitedToTopic: z.number().int(), + inviteeAccepted: z.number().int(), + liked: z.number().int(), + likedConsolidated: z.number().int(), + linked: z.number().int(), + membershipRequestAccepted: z.number().int(), + membershipRequestConsolidated: z.number().int(), + mentioned: z.number().int(), + movedPost: z.number().int(), + newFeatures: z.number().int().optional(), + postApproved: z.number().int(), + posted: z.number().int(), + privateMessage: z.number().int(), + questionAnswerUserCommented: z.number().int().optional(), + quoted: z.number().int(), + reaction: z.number().int(), + replied: z.number().int(), + topicReminder: z.number().int(), + votesReleased: z.number().int(), + watchingCategoryOrTag: z.number().int(), + watchingFirstPost: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + adminProblems: "admin_problems", + bookmarkReminder: "bookmark_reminder", + chatGroupMention: "chat_group_mention", + chatInvitation: "chat_invitation", + chatMention: "chat_mention", + chatMessage: "chat_message", + chatQuoted: "chat_quoted", + circlesActivity: "circles_activity", + codeReviewCommitApproved: "code_review_commit_approved", + eventInvitation: "event_invitation", + eventReminder: "event_reminder", + followingCreatedTopic: "following_created_topic", + followingReplied: "following_replied", + grantedBadge: "granted_badge", + groupMentioned: "group_mentioned", + groupMessageSummary: "group_message_summary", + invitedToPrivateMessage: "invited_to_private_message", + invitedToTopic: "invited_to_topic", + inviteeAccepted: "invitee_accepted", + likedConsolidated: "liked_consolidated", + membershipRequestAccepted: "membership_request_accepted", + membershipRequestConsolidated: "membership_request_consolidated", + movedPost: "moved_post", + newFeatures: "new_features", + postApproved: "post_approved", + privateMessage: "private_message", + questionAnswerUserCommented: "question_answer_user_commented", + topicReminder: "topic_reminder", + votesReleased: "votes_released", + watchingCategoryOrTag: "watching_category_or_tag", + watchingFirstPost: "watching_first_post", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace NotificationTypes$ { + /** @deprecated use `NotificationTypes$inboundSchema` instead. */ + export const inboundSchema = NotificationTypes$inboundSchema; + /** @deprecated use `NotificationTypes$outboundSchema` instead. */ + export const outboundSchema = NotificationTypes$outboundSchema; + /** @deprecated use `NotificationTypes$Outbound` instead. */ + export type Outbound = NotificationTypes$Outbound; +} + +/** @internal */ +export const PostActionTypes$inboundSchema: z.ZodType = z + .object({ + description: z.string(), + id: z.nullable(z.number().int()), + is_custom_flag: z.boolean(), + is_flag: z.boolean(), + name: z.string(), + name_key: z.nullable(z.string()), + short_description: z.string(), + }) + .transform((v) => { + return remap$(v, { + is_custom_flag: "isCustomFlag", + is_flag: "isFlag", + name_key: "nameKey", + short_description: "shortDescription", + }); + }); + +/** @internal */ +export type PostActionTypes$Outbound = { + description: string; + id: number | null; + is_custom_flag: boolean; + is_flag: boolean; + name: string; + name_key: string | null; + short_description: string; +}; + +/** @internal */ +export const PostActionTypes$outboundSchema: z.ZodType< + PostActionTypes$Outbound, + z.ZodTypeDef, + PostActionTypes +> = z + .object({ + description: z.string(), + id: z.nullable(z.number().int()), + isCustomFlag: z.boolean(), + isFlag: z.boolean(), + name: z.string(), + nameKey: z.nullable(z.string()), + shortDescription: z.string(), + }) + .transform((v) => { + return remap$(v, { + isCustomFlag: "is_custom_flag", + isFlag: "is_flag", + nameKey: "name_key", + shortDescription: "short_description", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PostActionTypes$ { + /** @deprecated use `PostActionTypes$inboundSchema` instead. */ + export const inboundSchema = PostActionTypes$inboundSchema; + /** @deprecated use `PostActionTypes$outboundSchema` instead. */ + export const outboundSchema = PostActionTypes$outboundSchema; + /** @deprecated use `PostActionTypes$Outbound` instead. */ + export type Outbound = PostActionTypes$Outbound; +} + +/** @internal */ +export const PostTypes$inboundSchema: z.ZodType = z + .object({ + moderator_action: z.number().int(), + regular: z.number().int(), + small_action: z.number().int(), + whisper: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + moderator_action: "moderatorAction", + small_action: "smallAction", + }); + }); + +/** @internal */ +export type PostTypes$Outbound = { + moderator_action: number; + regular: number; + small_action: number; + whisper: number; +}; + +/** @internal */ +export const PostTypes$outboundSchema: z.ZodType = z + .object({ + moderatorAction: z.number().int(), + regular: z.number().int(), + smallAction: z.number().int(), + whisper: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + moderatorAction: "moderator_action", + smallAction: "small_action", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PostTypes$ { + /** @deprecated use `PostTypes$inboundSchema` instead. */ + export const inboundSchema = PostTypes$inboundSchema; + /** @deprecated use `PostTypes$outboundSchema` instead. */ + export const outboundSchema = PostTypes$outboundSchema; + /** @deprecated use `PostTypes$Outbound` instead. */ + export type Outbound = PostTypes$Outbound; +} + +/** @internal */ +export const TopicFlagTypes$inboundSchema: z.ZodType = z + .object({ + description: z.string(), + id: z.nullable(z.number().int()), + is_custom_flag: z.boolean(), + is_flag: z.boolean(), + name: z.string(), + name_key: z.nullable(z.string()), + short_description: z.string(), + }) + .transform((v) => { + return remap$(v, { + is_custom_flag: "isCustomFlag", + is_flag: "isFlag", + name_key: "nameKey", + short_description: "shortDescription", + }); + }); + +/** @internal */ +export type TopicFlagTypes$Outbound = { + description: string; + id: number | null; + is_custom_flag: boolean; + is_flag: boolean; + name: string; + name_key: string | null; + short_description: string; +}; + +/** @internal */ +export const TopicFlagTypes$outboundSchema: z.ZodType< + TopicFlagTypes$Outbound, + z.ZodTypeDef, + TopicFlagTypes +> = z + .object({ + description: z.string(), + id: z.nullable(z.number().int()), + isCustomFlag: z.boolean(), + isFlag: z.boolean(), + name: z.string(), + nameKey: z.nullable(z.string()), + shortDescription: z.string(), + }) + .transform((v) => { + return remap$(v, { + isCustomFlag: "is_custom_flag", + isFlag: "is_flag", + nameKey: "name_key", + shortDescription: "short_description", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TopicFlagTypes$ { + /** @deprecated use `TopicFlagTypes$inboundSchema` instead. */ + export const inboundSchema = TopicFlagTypes$inboundSchema; + /** @deprecated use `TopicFlagTypes$outboundSchema` instead. */ + export const outboundSchema = TopicFlagTypes$outboundSchema; + /** @deprecated use `TopicFlagTypes$Outbound` instead. */ + export type Outbound = TopicFlagTypes$Outbound; +} + +/** @internal */ +export const TrustLevels$inboundSchema: z.ZodType = z.object({ + basic: z.number().int(), + leader: z.number().int(), + member: z.number().int(), + newuser: z.number().int(), + regular: z.number().int(), +}); + +/** @internal */ +export type TrustLevels$Outbound = { + basic: number; + leader: number; + member: number; + newuser: number; + regular: number; +}; + +/** @internal */ +export const TrustLevels$outboundSchema: z.ZodType< + TrustLevels$Outbound, + z.ZodTypeDef, + TrustLevels +> = z.object({ + basic: z.number().int(), + leader: z.number().int(), + member: z.number().int(), + newuser: z.number().int(), + regular: z.number().int(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TrustLevels$ { + /** @deprecated use `TrustLevels$inboundSchema` instead. */ + export const inboundSchema = TrustLevels$inboundSchema; + /** @deprecated use `TrustLevels$outboundSchema` instead. */ + export const outboundSchema = TrustLevels$outboundSchema; + /** @deprecated use `TrustLevels$Outbound` instead. */ + export type Outbound = TrustLevels$Outbound; +} + +/** @internal */ +export const UserColorSchemes$inboundSchema: z.ZodType = z + .object({ + id: z.number().int(), + is_dark: z.boolean(), + name: z.string(), + }) + .transform((v) => { + return remap$(v, { + is_dark: "isDark", + }); + }); + +/** @internal */ +export type UserColorSchemes$Outbound = { + id: number; + is_dark: boolean; + name: string; +}; + +/** @internal */ +export const UserColorSchemes$outboundSchema: z.ZodType< + UserColorSchemes$Outbound, + z.ZodTypeDef, + UserColorSchemes +> = z + .object({ + id: z.number().int(), + isDark: z.boolean(), + name: z.string(), + }) + .transform((v) => { + return remap$(v, { + isDark: "is_dark", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UserColorSchemes$ { + /** @deprecated use `UserColorSchemes$inboundSchema` instead. */ + export const inboundSchema = UserColorSchemes$inboundSchema; + /** @deprecated use `UserColorSchemes$outboundSchema` instead. */ + export const outboundSchema = UserColorSchemes$outboundSchema; + /** @deprecated use `UserColorSchemes$Outbound` instead. */ + export type Outbound = UserColorSchemes$Outbound; +} + +/** @internal */ +export const UserThemes$inboundSchema: z.ZodType = z + .object({ + color_scheme_id: z.nullable(z.number().int()), + default: z.boolean(), + name: z.string(), + theme_id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + color_scheme_id: "colorSchemeId", + theme_id: "themeId", + }); + }); + +/** @internal */ +export type UserThemes$Outbound = { + color_scheme_id: number | null; + default: boolean; + name: string; + theme_id: number; +}; + +/** @internal */ +export const UserThemes$outboundSchema: z.ZodType = z + .object({ + colorSchemeId: z.nullable(z.number().int()), + default: z.boolean(), + name: z.string(), + themeId: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + colorSchemeId: "color_scheme_id", + themeId: "theme_id", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UserThemes$ { + /** @deprecated use `UserThemes$inboundSchema` instead. */ + export const inboundSchema = UserThemes$inboundSchema; + /** @deprecated use `UserThemes$outboundSchema` instead. */ + export const outboundSchema = UserThemes$outboundSchema; + /** @deprecated use `UserThemes$Outbound` instead. */ + export type Outbound = UserThemes$Outbound; +} + +/** @internal */ +export const UserTips$inboundSchema: z.ZodType = z + .object({ + admin_guide: z.number().int(), + first_notification: z.number().int(), + post_menu: z.number().int(), + suggested_topics: z.number().int(), + topic_notification_levels: z.number().int(), + topic_timeline: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + admin_guide: "adminGuide", + first_notification: "firstNotification", + post_menu: "postMenu", + suggested_topics: "suggestedTopics", + topic_notification_levels: "topicNotificationLevels", + topic_timeline: "topicTimeline", + }); + }); + +/** @internal */ +export type UserTips$Outbound = { + admin_guide: number; + first_notification: number; + post_menu: number; + suggested_topics: number; + topic_notification_levels: number; + topic_timeline: number; +}; + +/** @internal */ +export const UserTips$outboundSchema: z.ZodType = z + .object({ + adminGuide: z.number().int(), + firstNotification: z.number().int(), + postMenu: z.number().int(), + suggestedTopics: z.number().int(), + topicNotificationLevels: z.number().int(), + topicTimeline: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + adminGuide: "admin_guide", + firstNotification: "first_notification", + postMenu: "post_menu", + suggestedTopics: "suggested_topics", + topicNotificationLevels: "topic_notification_levels", + topicTimeline: "topic_timeline", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UserTips$ { + /** @deprecated use `UserTips$inboundSchema` instead. */ + export const inboundSchema = UserTips$inboundSchema; + /** @deprecated use `UserTips$outboundSchema` instead. */ + export const outboundSchema = UserTips$outboundSchema; + /** @deprecated use `UserTips$Outbound` instead. */ + export type Outbound = UserTips$Outbound; +} + +/** @internal */ +export const GetSiteResponseBody$inboundSchema: z.ZodType< + GetSiteResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + anonymous_top_menu_items: z.array(z.any()), + archetypes: z.array(z.lazy(() => Archetypes$inboundSchema)), + auth_providers: z.array(z.any()), + can_associate_groups: z.boolean().optional(), + can_create_tag: z.boolean(), + can_tag_pms: z.boolean(), + can_tag_topics: z.boolean(), + categories: z.array(z.lazy(() => GetSiteCategories$inboundSchema)), + censored_regexp: z.array(z.lazy(() => CensoredRegexp$inboundSchema)), + custom_emoji_translation: z.lazy(() => CustomEmojiTranslation$inboundSchema), + default_archetype: z.string(), + default_dark_color_scheme: z.nullable(z.lazy(() => DefaultDarkColorScheme$inboundSchema)), + denied_emojis: z.array(z.any()).optional(), + displayed_about_plugin_stat_groups: z.array(z.any()).optional(), + filters: z.array(z.any()), + groups: z.array(z.lazy(() => GetSiteGroups$inboundSchema)), + hashtag_configurations: z.lazy(() => HashtagConfigurations$inboundSchema).optional(), + hashtag_icons: z.lazy(() => HashtagIcons$inboundSchema).optional(), + markdown_additional_options: z + .lazy(() => MarkdownAdditionalOptions$inboundSchema) + .optional(), + navigation_menu_site_top_tags: z.array(z.any()).optional(), + notification_types: z.lazy(() => NotificationTypes$inboundSchema), + periods: z.array(z.any()), + post_action_types: z.array(z.lazy(() => PostActionTypes$inboundSchema)), + post_types: z.lazy(() => PostTypes$inboundSchema), + tags_filter_regexp: z.string(), + top_menu_items: z.array(z.any()), + top_tags: z.array(z.any()), + topic_featured_link_allowed_category_ids: z.array(z.any()), + topic_flag_types: z.array(z.lazy(() => TopicFlagTypes$inboundSchema)), + trust_levels: z.lazy(() => TrustLevels$inboundSchema), + uncategorized_category_id: z.number().int(), + user_color_schemes: z.array(z.lazy(() => UserColorSchemes$inboundSchema)), + user_field_max_length: z.number().int(), + user_fields: z.array(z.any()), + user_themes: z.array(z.lazy(() => UserThemes$inboundSchema)), + user_tips: z.lazy(() => UserTips$inboundSchema).optional(), + watched_words_link: z.nullable(z.string()), + watched_words_replace: z.nullable(z.string()), + whispers_allowed_groups_names: z.array(z.any()).optional(), + wizard_required: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + anonymous_top_menu_items: "anonymousTopMenuItems", + auth_providers: "authProviders", + can_associate_groups: "canAssociateGroups", + can_create_tag: "canCreateTag", + can_tag_pms: "canTagPms", + can_tag_topics: "canTagTopics", + censored_regexp: "censoredRegexp", + custom_emoji_translation: "customEmojiTranslation", + default_archetype: "defaultArchetype", + default_dark_color_scheme: "defaultDarkColorScheme", + denied_emojis: "deniedEmojis", + displayed_about_plugin_stat_groups: "displayedAboutPluginStatGroups", + hashtag_configurations: "hashtagConfigurations", + hashtag_icons: "hashtagIcons", + markdown_additional_options: "markdownAdditionalOptions", + navigation_menu_site_top_tags: "navigationMenuSiteTopTags", + notification_types: "notificationTypes", + post_action_types: "postActionTypes", + post_types: "postTypes", + tags_filter_regexp: "tagsFilterRegexp", + top_menu_items: "topMenuItems", + top_tags: "topTags", + topic_featured_link_allowed_category_ids: "topicFeaturedLinkAllowedCategoryIds", + topic_flag_types: "topicFlagTypes", + trust_levels: "trustLevels", + uncategorized_category_id: "uncategorizedCategoryId", + user_color_schemes: "userColorSchemes", + user_field_max_length: "userFieldMaxLength", + user_fields: "userFields", + user_themes: "userThemes", + user_tips: "userTips", + watched_words_link: "watchedWordsLink", + watched_words_replace: "watchedWordsReplace", + whispers_allowed_groups_names: "whispersAllowedGroupsNames", + wizard_required: "wizardRequired", + }); + }); + +/** @internal */ +export type GetSiteResponseBody$Outbound = { + anonymous_top_menu_items: Array; + archetypes: Array; + auth_providers: Array; + can_associate_groups?: boolean | undefined; + can_create_tag: boolean; + can_tag_pms: boolean; + can_tag_topics: boolean; + categories: Array; + censored_regexp: Array; + custom_emoji_translation: CustomEmojiTranslation$Outbound; + default_archetype: string; + default_dark_color_scheme: DefaultDarkColorScheme$Outbound | null; + denied_emojis?: Array | undefined; + displayed_about_plugin_stat_groups?: Array | undefined; + filters: Array; + groups: Array; + hashtag_configurations?: HashtagConfigurations$Outbound | undefined; + hashtag_icons?: HashtagIcons$Outbound | undefined; + markdown_additional_options?: MarkdownAdditionalOptions$Outbound | undefined; + navigation_menu_site_top_tags?: Array | undefined; + notification_types: NotificationTypes$Outbound; + periods: Array; + post_action_types: Array; + post_types: PostTypes$Outbound; + tags_filter_regexp: string; + top_menu_items: Array; + top_tags: Array; + topic_featured_link_allowed_category_ids: Array; + topic_flag_types: Array; + trust_levels: TrustLevels$Outbound; + uncategorized_category_id: number; + user_color_schemes: Array; + user_field_max_length: number; + user_fields: Array; + user_themes: Array; + user_tips?: UserTips$Outbound | undefined; + watched_words_link: string | null; + watched_words_replace: string | null; + whispers_allowed_groups_names?: Array | undefined; + wizard_required?: boolean | undefined; +}; + +/** @internal */ +export const GetSiteResponseBody$outboundSchema: z.ZodType< + GetSiteResponseBody$Outbound, + z.ZodTypeDef, + GetSiteResponseBody +> = z + .object({ + anonymousTopMenuItems: z.array(z.any()), + archetypes: z.array(z.lazy(() => Archetypes$outboundSchema)), + authProviders: z.array(z.any()), + canAssociateGroups: z.boolean().optional(), + canCreateTag: z.boolean(), + canTagPms: z.boolean(), + canTagTopics: z.boolean(), + categories: z.array(z.lazy(() => GetSiteCategories$outboundSchema)), + censoredRegexp: z.array(z.lazy(() => CensoredRegexp$outboundSchema)), + customEmojiTranslation: z.lazy(() => CustomEmojiTranslation$outboundSchema), + defaultArchetype: z.string(), + defaultDarkColorScheme: z.nullable(z.lazy(() => DefaultDarkColorScheme$outboundSchema)), + deniedEmojis: z.array(z.any()).optional(), + displayedAboutPluginStatGroups: z.array(z.any()).optional(), + filters: z.array(z.any()), + groups: z.array(z.lazy(() => GetSiteGroups$outboundSchema)), + hashtagConfigurations: z.lazy(() => HashtagConfigurations$outboundSchema).optional(), + hashtagIcons: z.lazy(() => HashtagIcons$outboundSchema).optional(), + markdownAdditionalOptions: z + .lazy(() => MarkdownAdditionalOptions$outboundSchema) + .optional(), + navigationMenuSiteTopTags: z.array(z.any()).optional(), + notificationTypes: z.lazy(() => NotificationTypes$outboundSchema), + periods: z.array(z.any()), + postActionTypes: z.array(z.lazy(() => PostActionTypes$outboundSchema)), + postTypes: z.lazy(() => PostTypes$outboundSchema), + tagsFilterRegexp: z.string(), + topMenuItems: z.array(z.any()), + topTags: z.array(z.any()), + topicFeaturedLinkAllowedCategoryIds: z.array(z.any()), + topicFlagTypes: z.array(z.lazy(() => TopicFlagTypes$outboundSchema)), + trustLevels: z.lazy(() => TrustLevels$outboundSchema), + uncategorizedCategoryId: z.number().int(), + userColorSchemes: z.array(z.lazy(() => UserColorSchemes$outboundSchema)), + userFieldMaxLength: z.number().int(), + userFields: z.array(z.any()), + userThemes: z.array(z.lazy(() => UserThemes$outboundSchema)), + userTips: z.lazy(() => UserTips$outboundSchema).optional(), + watchedWordsLink: z.nullable(z.string()), + watchedWordsReplace: z.nullable(z.string()), + whispersAllowedGroupsNames: z.array(z.any()).optional(), + wizardRequired: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + anonymousTopMenuItems: "anonymous_top_menu_items", + authProviders: "auth_providers", + canAssociateGroups: "can_associate_groups", + canCreateTag: "can_create_tag", + canTagPms: "can_tag_pms", + canTagTopics: "can_tag_topics", + censoredRegexp: "censored_regexp", + customEmojiTranslation: "custom_emoji_translation", + defaultArchetype: "default_archetype", + defaultDarkColorScheme: "default_dark_color_scheme", + deniedEmojis: "denied_emojis", + displayedAboutPluginStatGroups: "displayed_about_plugin_stat_groups", + hashtagConfigurations: "hashtag_configurations", + hashtagIcons: "hashtag_icons", + markdownAdditionalOptions: "markdown_additional_options", + navigationMenuSiteTopTags: "navigation_menu_site_top_tags", + notificationTypes: "notification_types", + postActionTypes: "post_action_types", + postTypes: "post_types", + tagsFilterRegexp: "tags_filter_regexp", + topMenuItems: "top_menu_items", + topTags: "top_tags", + topicFeaturedLinkAllowedCategoryIds: "topic_featured_link_allowed_category_ids", + topicFlagTypes: "topic_flag_types", + trustLevels: "trust_levels", + uncategorizedCategoryId: "uncategorized_category_id", + userColorSchemes: "user_color_schemes", + userFieldMaxLength: "user_field_max_length", + userFields: "user_fields", + userThemes: "user_themes", + userTips: "user_tips", + watchedWordsLink: "watched_words_link", + watchedWordsReplace: "watched_words_replace", + whispersAllowedGroupsNames: "whispers_allowed_groups_names", + wizardRequired: "wizard_required", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetSiteResponseBody$ { + /** @deprecated use `GetSiteResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetSiteResponseBody$inboundSchema; + /** @deprecated use `GetSiteResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetSiteResponseBody$outboundSchema; + /** @deprecated use `GetSiteResponseBody$Outbound` instead. */ + export type Outbound = GetSiteResponseBody$Outbound; } diff --git a/src/sdk/models/operations/gettag.ts b/src/sdk/models/operations/gettag.ts index 4d8c160..7c431cb 100644 --- a/src/sdk/models/operations/gettag.ts +++ b/src/sdk/models/operations/gettag.ts @@ -1,278 +1,572 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class GetTagRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=name" }) +export type GetTagRequest = { name: string; -} +}; -export class GetTagTags extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "id" }) - id?: number; +export type GetTagTags = { + id?: number | undefined; + name?: string | undefined; + staff?: boolean | undefined; + topicCount?: number | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "name" }) - name?: string; +export type GetTagPosters = { + description?: string | undefined; + extras?: string | undefined; + primaryGroupId?: string | null | undefined; + userId?: number | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "staff" }) - staff?: boolean; +export type GetTagTopics = { + archetype?: string | undefined; + archived?: boolean | undefined; + bookmarked?: boolean | undefined; + bumped?: boolean | undefined; + bumpedAt?: string | undefined; + categoryId?: number | undefined; + closed?: boolean | undefined; + createdAt?: string | undefined; + fancyTitle?: string | undefined; + featuredLink?: string | null | undefined; + hasSummary?: boolean | undefined; + highestPostNumber?: number | undefined; + id?: number | undefined; + imageUrl?: string | null | undefined; + lastPostedAt?: string | undefined; + lastPosterUsername?: string | undefined; + lastReadPostNumber?: number | undefined; + likeCount?: number | undefined; + liked?: boolean | undefined; + notificationLevel?: number | undefined; + pinned?: boolean | undefined; + pinnedGlobally?: boolean | undefined; + posters?: Array | undefined; + postsCount?: number | undefined; + replyCount?: number | undefined; + slug?: string | undefined; + tags?: Array | undefined; + title?: string | undefined; + unpinned?: string | null | undefined; + unreadPosts?: number | undefined; + unseen?: boolean | undefined; + views?: number | undefined; + visible?: boolean | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "topic_count" }) - topicCount?: number; -} +export type GetTagTopicList = { + canCreateTopic?: boolean | undefined; + draft?: string | null | undefined; + draftKey?: string | undefined; + draftSequence?: number | undefined; + perPage?: number | undefined; + tags?: Array | undefined; + topics?: Array | undefined; +}; -export class GetTagPosters extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "description" }) - description?: string; - - @SpeakeasyMetadata() - @Expose({ name: "extras" }) - extras?: string; - - @SpeakeasyMetadata() - @Expose({ name: "primary_group_id" }) - primaryGroupId?: string; - - @SpeakeasyMetadata() - @Expose({ name: "user_id" }) - userId?: number; -} - -export class GetTagTopics extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "archetype" }) - archetype?: string; - - @SpeakeasyMetadata() - @Expose({ name: "archived" }) - archived?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "bookmarked" }) - bookmarked?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "bumped" }) - bumped?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "bumped_at" }) - bumpedAt?: string; - - @SpeakeasyMetadata() - @Expose({ name: "category_id" }) - categoryId?: number; - - @SpeakeasyMetadata() - @Expose({ name: "closed" }) - closed?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "created_at" }) - createdAt?: string; - - @SpeakeasyMetadata() - @Expose({ name: "fancy_title" }) - fancyTitle?: string; - - @SpeakeasyMetadata() - @Expose({ name: "featured_link" }) - featuredLink?: string; - - @SpeakeasyMetadata() - @Expose({ name: "has_summary" }) - hasSummary?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "highest_post_number" }) - highestPostNumber?: number; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) - id?: number; - - @SpeakeasyMetadata() - @Expose({ name: "image_url" }) - imageUrl?: string; - - @SpeakeasyMetadata() - @Expose({ name: "last_posted_at" }) - lastPostedAt?: string; - - @SpeakeasyMetadata() - @Expose({ name: "last_poster_username" }) - lastPosterUsername?: string; - - @SpeakeasyMetadata() - @Expose({ name: "last_read_post_number" }) - lastReadPostNumber?: number; - - @SpeakeasyMetadata() - @Expose({ name: "like_count" }) - likeCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "liked" }) - liked?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "notification_level" }) - notificationLevel?: number; - - @SpeakeasyMetadata() - @Expose({ name: "pinned" }) - pinned?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "pinned_globally" }) - pinnedGlobally?: boolean; - - @SpeakeasyMetadata({ elemType: GetTagPosters }) - @Expose({ name: "posters" }) - @Type(() => GetTagPosters) - posters?: GetTagPosters[]; - - @SpeakeasyMetadata() - @Expose({ name: "posts_count" }) - postsCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "reply_count" }) - replyCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "slug" }) - slug?: string; - - @SpeakeasyMetadata() - @Expose({ name: "tags" }) - tags?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "title" }) - title?: string; - - @SpeakeasyMetadata() - @Expose({ name: "unpinned" }) - unpinned?: string; - - @SpeakeasyMetadata() - @Expose({ name: "unread_posts" }) - unreadPosts?: number; - - @SpeakeasyMetadata() - @Expose({ name: "unseen" }) - unseen?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "views" }) - views?: number; - - @SpeakeasyMetadata() - @Expose({ name: "visible" }) - visible?: boolean; -} - -export class GetTagTopicList extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "can_create_topic" }) - canCreateTopic?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "draft" }) - draft?: string; - - @SpeakeasyMetadata() - @Expose({ name: "draft_key" }) - draftKey?: string; - - @SpeakeasyMetadata() - @Expose({ name: "draft_sequence" }) - draftSequence?: number; - - @SpeakeasyMetadata() - @Expose({ name: "per_page" }) - perPage?: number; - - @SpeakeasyMetadata({ elemType: GetTagTags }) - @Expose({ name: "tags" }) - @Type(() => GetTagTags) - tags?: GetTagTags[]; - - @SpeakeasyMetadata({ elemType: GetTagTopics }) - @Expose({ name: "topics" }) - @Type(() => GetTagTopics) - topics?: GetTagTopics[]; -} - -export class GetTagUsers extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "avatar_template" }) - avatarTemplate?: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) - id?: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) - name?: string; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) - username?: string; -} +export type GetTagUsers = { + avatarTemplate?: string | undefined; + id?: number | undefined; + name?: string | null | undefined; + username?: string | undefined; +}; /** * notifications */ -export class GetTagResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "primary_groups" }) - primaryGroups?: any[]; +export type GetTagResponseBody = { + primaryGroups?: Array | undefined; + topicList?: GetTagTopicList | undefined; + users?: Array | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "topic_list" }) - @Type(() => GetTagTopicList) - topicList?: GetTagTopicList; +/** @internal */ +export const GetTagRequest$inboundSchema: z.ZodType = + z.object({ + name: z.string(), + }); - @SpeakeasyMetadata({ elemType: GetTagUsers }) - @Expose({ name: "users" }) - @Type(() => GetTagUsers) - users?: GetTagUsers[]; +/** @internal */ +export type GetTagRequest$Outbound = { + name: string; +}; + +/** @internal */ +export const GetTagRequest$outboundSchema: z.ZodType< + GetTagRequest$Outbound, + z.ZodTypeDef, + GetTagRequest +> = z.object({ + name: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTagRequest$ { + /** @deprecated use `GetTagRequest$inboundSchema` instead. */ + export const inboundSchema = GetTagRequest$inboundSchema; + /** @deprecated use `GetTagRequest$outboundSchema` instead. */ + export const outboundSchema = GetTagRequest$outboundSchema; + /** @deprecated use `GetTagRequest$Outbound` instead. */ + export type Outbound = GetTagRequest$Outbound; } -export class GetTagResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const GetTagTags$inboundSchema: z.ZodType = z + .object({ + id: z.number().int().optional(), + name: z.string().optional(), + staff: z.boolean().optional(), + topic_count: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + topic_count: "topicCount", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type GetTagTags$Outbound = { + id?: number | undefined; + name?: string | undefined; + staff?: boolean | undefined; + topic_count?: number | undefined; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const GetTagTags$outboundSchema: z.ZodType = z + .object({ + id: z.number().int().optional(), + name: z.string().optional(), + staff: z.boolean().optional(), + topicCount: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + topicCount: "topic_count", + }); + }); - /** - * notifications - */ - @SpeakeasyMetadata() - object?: GetTagResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTagTags$ { + /** @deprecated use `GetTagTags$inboundSchema` instead. */ + export const inboundSchema = GetTagTags$inboundSchema; + /** @deprecated use `GetTagTags$outboundSchema` instead. */ + export const outboundSchema = GetTagTags$outboundSchema; + /** @deprecated use `GetTagTags$Outbound` instead. */ + export type Outbound = GetTagTags$Outbound; +} + +/** @internal */ +export const GetTagPosters$inboundSchema: z.ZodType = z + .object({ + description: z.string().optional(), + extras: z.string().optional(), + primary_group_id: z.nullable(z.string()).optional(), + user_id: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + primary_group_id: "primaryGroupId", + user_id: "userId", + }); + }); + +/** @internal */ +export type GetTagPosters$Outbound = { + description?: string | undefined; + extras?: string | undefined; + primary_group_id?: string | null | undefined; + user_id?: number | undefined; +}; + +/** @internal */ +export const GetTagPosters$outboundSchema: z.ZodType< + GetTagPosters$Outbound, + z.ZodTypeDef, + GetTagPosters +> = z + .object({ + description: z.string().optional(), + extras: z.string().optional(), + primaryGroupId: z.nullable(z.string()).optional(), + userId: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + primaryGroupId: "primary_group_id", + userId: "user_id", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTagPosters$ { + /** @deprecated use `GetTagPosters$inboundSchema` instead. */ + export const inboundSchema = GetTagPosters$inboundSchema; + /** @deprecated use `GetTagPosters$outboundSchema` instead. */ + export const outboundSchema = GetTagPosters$outboundSchema; + /** @deprecated use `GetTagPosters$Outbound` instead. */ + export type Outbound = GetTagPosters$Outbound; +} + +/** @internal */ +export const GetTagTopics$inboundSchema: z.ZodType = z + .object({ + archetype: z.string().optional(), + archived: z.boolean().optional(), + bookmarked: z.boolean().optional(), + bumped: z.boolean().optional(), + bumped_at: z.string().optional(), + category_id: z.number().int().optional(), + closed: z.boolean().optional(), + created_at: z.string().optional(), + fancy_title: z.string().optional(), + featured_link: z.nullable(z.string()).optional(), + has_summary: z.boolean().optional(), + highest_post_number: z.number().int().optional(), + id: z.number().int().optional(), + image_url: z.nullable(z.string()).optional(), + last_posted_at: z.string().optional(), + last_poster_username: z.string().optional(), + last_read_post_number: z.number().int().optional(), + like_count: z.number().int().optional(), + liked: z.boolean().optional(), + notification_level: z.number().int().optional(), + pinned: z.boolean().optional(), + pinned_globally: z.boolean().optional(), + posters: z.array(z.lazy(() => GetTagPosters$inboundSchema)).optional(), + posts_count: z.number().int().optional(), + reply_count: z.number().int().optional(), + slug: z.string().optional(), + tags: z.array(z.any()).optional(), + title: z.string().optional(), + unpinned: z.nullable(z.string()).optional(), + unread_posts: z.number().int().optional(), + unseen: z.boolean().optional(), + views: z.number().int().optional(), + visible: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + bumped_at: "bumpedAt", + category_id: "categoryId", + created_at: "createdAt", + fancy_title: "fancyTitle", + featured_link: "featuredLink", + has_summary: "hasSummary", + highest_post_number: "highestPostNumber", + image_url: "imageUrl", + last_posted_at: "lastPostedAt", + last_poster_username: "lastPosterUsername", + last_read_post_number: "lastReadPostNumber", + like_count: "likeCount", + notification_level: "notificationLevel", + pinned_globally: "pinnedGlobally", + posts_count: "postsCount", + reply_count: "replyCount", + unread_posts: "unreadPosts", + }); + }); + +/** @internal */ +export type GetTagTopics$Outbound = { + archetype?: string | undefined; + archived?: boolean | undefined; + bookmarked?: boolean | undefined; + bumped?: boolean | undefined; + bumped_at?: string | undefined; + category_id?: number | undefined; + closed?: boolean | undefined; + created_at?: string | undefined; + fancy_title?: string | undefined; + featured_link?: string | null | undefined; + has_summary?: boolean | undefined; + highest_post_number?: number | undefined; + id?: number | undefined; + image_url?: string | null | undefined; + last_posted_at?: string | undefined; + last_poster_username?: string | undefined; + last_read_post_number?: number | undefined; + like_count?: number | undefined; + liked?: boolean | undefined; + notification_level?: number | undefined; + pinned?: boolean | undefined; + pinned_globally?: boolean | undefined; + posters?: Array | undefined; + posts_count?: number | undefined; + reply_count?: number | undefined; + slug?: string | undefined; + tags?: Array | undefined; + title?: string | undefined; + unpinned?: string | null | undefined; + unread_posts?: number | undefined; + unseen?: boolean | undefined; + views?: number | undefined; + visible?: boolean | undefined; +}; + +/** @internal */ +export const GetTagTopics$outboundSchema: z.ZodType< + GetTagTopics$Outbound, + z.ZodTypeDef, + GetTagTopics +> = z + .object({ + archetype: z.string().optional(), + archived: z.boolean().optional(), + bookmarked: z.boolean().optional(), + bumped: z.boolean().optional(), + bumpedAt: z.string().optional(), + categoryId: z.number().int().optional(), + closed: z.boolean().optional(), + createdAt: z.string().optional(), + fancyTitle: z.string().optional(), + featuredLink: z.nullable(z.string()).optional(), + hasSummary: z.boolean().optional(), + highestPostNumber: z.number().int().optional(), + id: z.number().int().optional(), + imageUrl: z.nullable(z.string()).optional(), + lastPostedAt: z.string().optional(), + lastPosterUsername: z.string().optional(), + lastReadPostNumber: z.number().int().optional(), + likeCount: z.number().int().optional(), + liked: z.boolean().optional(), + notificationLevel: z.number().int().optional(), + pinned: z.boolean().optional(), + pinnedGlobally: z.boolean().optional(), + posters: z.array(z.lazy(() => GetTagPosters$outboundSchema)).optional(), + postsCount: z.number().int().optional(), + replyCount: z.number().int().optional(), + slug: z.string().optional(), + tags: z.array(z.any()).optional(), + title: z.string().optional(), + unpinned: z.nullable(z.string()).optional(), + unreadPosts: z.number().int().optional(), + unseen: z.boolean().optional(), + views: z.number().int().optional(), + visible: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + bumpedAt: "bumped_at", + categoryId: "category_id", + createdAt: "created_at", + fancyTitle: "fancy_title", + featuredLink: "featured_link", + hasSummary: "has_summary", + highestPostNumber: "highest_post_number", + imageUrl: "image_url", + lastPostedAt: "last_posted_at", + lastPosterUsername: "last_poster_username", + lastReadPostNumber: "last_read_post_number", + likeCount: "like_count", + notificationLevel: "notification_level", + pinnedGlobally: "pinned_globally", + postsCount: "posts_count", + replyCount: "reply_count", + unreadPosts: "unread_posts", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTagTopics$ { + /** @deprecated use `GetTagTopics$inboundSchema` instead. */ + export const inboundSchema = GetTagTopics$inboundSchema; + /** @deprecated use `GetTagTopics$outboundSchema` instead. */ + export const outboundSchema = GetTagTopics$outboundSchema; + /** @deprecated use `GetTagTopics$Outbound` instead. */ + export type Outbound = GetTagTopics$Outbound; +} + +/** @internal */ +export const GetTagTopicList$inboundSchema: z.ZodType = z + .object({ + can_create_topic: z.boolean().optional(), + draft: z.nullable(z.string()).optional(), + draft_key: z.string().optional(), + draft_sequence: z.number().int().optional(), + per_page: z.number().int().optional(), + tags: z.array(z.lazy(() => GetTagTags$inboundSchema)).optional(), + topics: z.array(z.lazy(() => GetTagTopics$inboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + can_create_topic: "canCreateTopic", + draft_key: "draftKey", + draft_sequence: "draftSequence", + per_page: "perPage", + }); + }); + +/** @internal */ +export type GetTagTopicList$Outbound = { + can_create_topic?: boolean | undefined; + draft?: string | null | undefined; + draft_key?: string | undefined; + draft_sequence?: number | undefined; + per_page?: number | undefined; + tags?: Array | undefined; + topics?: Array | undefined; +}; + +/** @internal */ +export const GetTagTopicList$outboundSchema: z.ZodType< + GetTagTopicList$Outbound, + z.ZodTypeDef, + GetTagTopicList +> = z + .object({ + canCreateTopic: z.boolean().optional(), + draft: z.nullable(z.string()).optional(), + draftKey: z.string().optional(), + draftSequence: z.number().int().optional(), + perPage: z.number().int().optional(), + tags: z.array(z.lazy(() => GetTagTags$outboundSchema)).optional(), + topics: z.array(z.lazy(() => GetTagTopics$outboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + canCreateTopic: "can_create_topic", + draftKey: "draft_key", + draftSequence: "draft_sequence", + perPage: "per_page", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTagTopicList$ { + /** @deprecated use `GetTagTopicList$inboundSchema` instead. */ + export const inboundSchema = GetTagTopicList$inboundSchema; + /** @deprecated use `GetTagTopicList$outboundSchema` instead. */ + export const outboundSchema = GetTagTopicList$outboundSchema; + /** @deprecated use `GetTagTopicList$Outbound` instead. */ + export type Outbound = GetTagTopicList$Outbound; +} + +/** @internal */ +export const GetTagUsers$inboundSchema: z.ZodType = z + .object({ + avatar_template: z.string().optional(), + id: z.number().int().optional(), + name: z.nullable(z.string()).optional(), + username: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + avatar_template: "avatarTemplate", + }); + }); + +/** @internal */ +export type GetTagUsers$Outbound = { + avatar_template?: string | undefined; + id?: number | undefined; + name?: string | null | undefined; + username?: string | undefined; +}; + +/** @internal */ +export const GetTagUsers$outboundSchema: z.ZodType< + GetTagUsers$Outbound, + z.ZodTypeDef, + GetTagUsers +> = z + .object({ + avatarTemplate: z.string().optional(), + id: z.number().int().optional(), + name: z.nullable(z.string()).optional(), + username: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + avatarTemplate: "avatar_template", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTagUsers$ { + /** @deprecated use `GetTagUsers$inboundSchema` instead. */ + export const inboundSchema = GetTagUsers$inboundSchema; + /** @deprecated use `GetTagUsers$outboundSchema` instead. */ + export const outboundSchema = GetTagUsers$outboundSchema; + /** @deprecated use `GetTagUsers$Outbound` instead. */ + export type Outbound = GetTagUsers$Outbound; +} + +/** @internal */ +export const GetTagResponseBody$inboundSchema: z.ZodType< + GetTagResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + primary_groups: z.array(z.any()).optional(), + topic_list: z.lazy(() => GetTagTopicList$inboundSchema).optional(), + users: z.array(z.lazy(() => GetTagUsers$inboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + primary_groups: "primaryGroups", + topic_list: "topicList", + }); + }); + +/** @internal */ +export type GetTagResponseBody$Outbound = { + primary_groups?: Array | undefined; + topic_list?: GetTagTopicList$Outbound | undefined; + users?: Array | undefined; +}; + +/** @internal */ +export const GetTagResponseBody$outboundSchema: z.ZodType< + GetTagResponseBody$Outbound, + z.ZodTypeDef, + GetTagResponseBody +> = z + .object({ + primaryGroups: z.array(z.any()).optional(), + topicList: z.lazy(() => GetTagTopicList$outboundSchema).optional(), + users: z.array(z.lazy(() => GetTagUsers$outboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + primaryGroups: "primary_groups", + topicList: "topic_list", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTagResponseBody$ { + /** @deprecated use `GetTagResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetTagResponseBody$inboundSchema; + /** @deprecated use `GetTagResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetTagResponseBody$outboundSchema; + /** @deprecated use `GetTagResponseBody$Outbound` instead. */ + export type Outbound = GetTagResponseBody$Outbound; } diff --git a/src/sdk/models/operations/gettaggroup.ts b/src/sdk/models/operations/gettaggroup.ts index 68b4f2e..a41b6c4 100644 --- a/src/sdk/models/operations/gettaggroup.ts +++ b/src/sdk/models/operations/gettaggroup.ts @@ -1,81 +1,217 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class GetTagGroupRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) +export type GetTagGroupRequest = { id: string; -} +}; -export class GetTagGroupPermissions extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "everyone" }) - everyone?: number; -} +export type GetTagGroupPermissions = { + everyone?: number | undefined; +}; -export class GetTagGroupTagGroup extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "id" }) - id?: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) - name?: string; - - @SpeakeasyMetadata() - @Expose({ name: "one_per_topic" }) - onePerTopic?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "parent_tag_name" }) - parentTagName?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "permissions" }) - @Type(() => GetTagGroupPermissions) - permissions?: GetTagGroupPermissions; - - @SpeakeasyMetadata() - @Expose({ name: "tag_names" }) - tagNames?: any[]; -} +export type GetTagGroupTagGroup = { + id?: number | undefined; + name?: string | undefined; + onePerTopic?: boolean | undefined; + parentTagName?: Array | undefined; + permissions?: GetTagGroupPermissions | undefined; + tagNames?: Array | undefined; +}; /** * notifications */ -export class GetTagGroupResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "tag_group" }) - @Type(() => GetTagGroupTagGroup) - tagGroup?: GetTagGroupTagGroup; +export type GetTagGroupResponseBody = { + tagGroup?: GetTagGroupTagGroup | undefined; +}; + +/** @internal */ +export const GetTagGroupRequest$inboundSchema: z.ZodType< + GetTagGroupRequest, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.string(), +}); + +/** @internal */ +export type GetTagGroupRequest$Outbound = { + id: string; +}; + +/** @internal */ +export const GetTagGroupRequest$outboundSchema: z.ZodType< + GetTagGroupRequest$Outbound, + z.ZodTypeDef, + GetTagGroupRequest +> = z.object({ + id: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTagGroupRequest$ { + /** @deprecated use `GetTagGroupRequest$inboundSchema` instead. */ + export const inboundSchema = GetTagGroupRequest$inboundSchema; + /** @deprecated use `GetTagGroupRequest$outboundSchema` instead. */ + export const outboundSchema = GetTagGroupRequest$outboundSchema; + /** @deprecated use `GetTagGroupRequest$Outbound` instead. */ + export type Outbound = GetTagGroupRequest$Outbound; } -export class GetTagGroupResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const GetTagGroupPermissions$inboundSchema: z.ZodType< + GetTagGroupPermissions, + z.ZodTypeDef, + unknown +> = z.object({ + everyone: z.number().int().optional(), +}); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type GetTagGroupPermissions$Outbound = { + everyone?: number | undefined; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const GetTagGroupPermissions$outboundSchema: z.ZodType< + GetTagGroupPermissions$Outbound, + z.ZodTypeDef, + GetTagGroupPermissions +> = z.object({ + everyone: z.number().int().optional(), +}); - /** - * notifications - */ - @SpeakeasyMetadata() - object?: GetTagGroupResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTagGroupPermissions$ { + /** @deprecated use `GetTagGroupPermissions$inboundSchema` instead. */ + export const inboundSchema = GetTagGroupPermissions$inboundSchema; + /** @deprecated use `GetTagGroupPermissions$outboundSchema` instead. */ + export const outboundSchema = GetTagGroupPermissions$outboundSchema; + /** @deprecated use `GetTagGroupPermissions$Outbound` instead. */ + export type Outbound = GetTagGroupPermissions$Outbound; +} + +/** @internal */ +export const GetTagGroupTagGroup$inboundSchema: z.ZodType< + GetTagGroupTagGroup, + z.ZodTypeDef, + unknown +> = z + .object({ + id: z.number().int().optional(), + name: z.string().optional(), + one_per_topic: z.boolean().optional(), + parent_tag_name: z.array(z.any()).optional(), + permissions: z.lazy(() => GetTagGroupPermissions$inboundSchema).optional(), + tag_names: z.array(z.any()).optional(), + }) + .transform((v) => { + return remap$(v, { + one_per_topic: "onePerTopic", + parent_tag_name: "parentTagName", + tag_names: "tagNames", + }); + }); + +/** @internal */ +export type GetTagGroupTagGroup$Outbound = { + id?: number | undefined; + name?: string | undefined; + one_per_topic?: boolean | undefined; + parent_tag_name?: Array | undefined; + permissions?: GetTagGroupPermissions$Outbound | undefined; + tag_names?: Array | undefined; +}; + +/** @internal */ +export const GetTagGroupTagGroup$outboundSchema: z.ZodType< + GetTagGroupTagGroup$Outbound, + z.ZodTypeDef, + GetTagGroupTagGroup +> = z + .object({ + id: z.number().int().optional(), + name: z.string().optional(), + onePerTopic: z.boolean().optional(), + parentTagName: z.array(z.any()).optional(), + permissions: z.lazy(() => GetTagGroupPermissions$outboundSchema).optional(), + tagNames: z.array(z.any()).optional(), + }) + .transform((v) => { + return remap$(v, { + onePerTopic: "one_per_topic", + parentTagName: "parent_tag_name", + tagNames: "tag_names", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTagGroupTagGroup$ { + /** @deprecated use `GetTagGroupTagGroup$inboundSchema` instead. */ + export const inboundSchema = GetTagGroupTagGroup$inboundSchema; + /** @deprecated use `GetTagGroupTagGroup$outboundSchema` instead. */ + export const outboundSchema = GetTagGroupTagGroup$outboundSchema; + /** @deprecated use `GetTagGroupTagGroup$Outbound` instead. */ + export type Outbound = GetTagGroupTagGroup$Outbound; +} + +/** @internal */ +export const GetTagGroupResponseBody$inboundSchema: z.ZodType< + GetTagGroupResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + tag_group: z.lazy(() => GetTagGroupTagGroup$inboundSchema).optional(), + }) + .transform((v) => { + return remap$(v, { + tag_group: "tagGroup", + }); + }); + +/** @internal */ +export type GetTagGroupResponseBody$Outbound = { + tag_group?: GetTagGroupTagGroup$Outbound | undefined; +}; + +/** @internal */ +export const GetTagGroupResponseBody$outboundSchema: z.ZodType< + GetTagGroupResponseBody$Outbound, + z.ZodTypeDef, + GetTagGroupResponseBody +> = z + .object({ + tagGroup: z.lazy(() => GetTagGroupTagGroup$outboundSchema).optional(), + }) + .transform((v) => { + return remap$(v, { + tagGroup: "tag_group", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTagGroupResponseBody$ { + /** @deprecated use `GetTagGroupResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetTagGroupResponseBody$inboundSchema; + /** @deprecated use `GetTagGroupResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetTagGroupResponseBody$outboundSchema; + /** @deprecated use `GetTagGroupResponseBody$Outbound` instead. */ + export type Outbound = GetTagGroupResponseBody$Outbound; } diff --git a/src/sdk/models/operations/gettopic.ts b/src/sdk/models/operations/gettopic.ts index 8465f29..5b92f92 100644 --- a/src/sdk/models/operations/gettopic.ts +++ b/src/sdk/models/operations/gettopic.ts @@ -1,871 +1,1644 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class GetTopicRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Key" }) +export type GetTopicRequest = { apiKey: string; - - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Username" }) apiUsername: string; - - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) id: string; -} +}; -export class GetTopicActionsSummary extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "can_act" }) +export type GetTopicActionsSummary = { canAct: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "count" }) count: number; - - @SpeakeasyMetadata() - @Expose({ name: "hidden" }) hidden: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; -} +}; -export class CreatedBy extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "avatar_template" }) +export type CreatedBy = { avatarTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) username: string; -} +}; -export class LastPoster extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "avatar_template" }) +export type LastPoster = { avatarTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) username: string; -} +}; -export class Participants extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "admin" }) +export type Participants = { admin: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "avatar_template" }) avatarTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_bg_color" }) - flairBgColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_color" }) - flairColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_group_id" }) - flairGroupId?: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_name" }) - flairName: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_url" }) - flairUrl: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) + flairBgColor: string | null; + flairColor: string | null; + flairGroupId?: string | null | undefined; + flairName: string | null; + flairUrl: string | null; id: number; - - @SpeakeasyMetadata() - @Expose({ name: "moderator" }) moderator: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "post_count" }) postCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "primary_group_name" }) - primaryGroupName: string; - - @SpeakeasyMetadata() - @Expose({ name: "trust_level" }) + primaryGroupName: string | null; trustLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) username: string; -} +}; -export class Details extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "can_archive_topic" }) +export type Details = { canArchiveTopic: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_close_topic" }) canCloseTopic: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_convert_topic" }) canConvertTopic: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_create_post" }) canCreatePost: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_delete" }) canDelete: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_edit" }) canEdit: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_edit_staff_notes" }) canEditStaffNotes: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_flag_topic" }) - canFlagTopic?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_invite_to" }) - canInviteTo?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_invite_via_email" }) - canInviteViaEmail?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_moderate_category" }) + canFlagTopic?: boolean | undefined; + canInviteTo?: boolean | undefined; + canInviteViaEmail?: boolean | undefined; canModerateCategory: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_move_posts" }) canMovePosts: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_pin_unpin_topic" }) canPinUnpinTopic: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_remove_allowed_users" }) canRemoveAllowedUsers: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_remove_self_id" }) canRemoveSelfId: number; - - @SpeakeasyMetadata() - @Expose({ name: "can_reply_as_new_topic" }) canReplyAsNewTopic: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_review_topic" }) canReviewTopic: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_split_merge_topic" }) canSplitMergeTopic: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_toggle_topic_visibility" }) canToggleTopicVisibility: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "created_by" }) - @Type(() => CreatedBy) createdBy: CreatedBy; - - @SpeakeasyMetadata() - @Expose({ name: "last_poster" }) - @Type(() => LastPoster) lastPoster: LastPoster; - - @SpeakeasyMetadata() - @Expose({ name: "notification_level" }) notificationLevel: number; + participants?: Array | undefined; +}; - @SpeakeasyMetadata({ elemType: Participants }) - @Expose({ name: "participants" }) - @Type(() => Participants) - participants?: Participants[]; -} - -export class GetTopicTopicsActionsSummary extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "can_act" }) +export type GetTopicTopicsActionsSummary = { canAct: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; -} +}; -export class LinkCounts extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "clicks" }) +export type LinkCounts = { clicks: number; - - @SpeakeasyMetadata() - @Expose({ name: "internal" }) internal: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "reflection" }) reflection: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "title" }) title: string; - - @SpeakeasyMetadata() - @Expose({ name: "url" }) url: string; -} +}; -export class Posts extends SpeakeasyBase { - @SpeakeasyMetadata({ elemType: GetTopicTopicsActionsSummary }) - @Expose({ name: "actions_summary" }) - @Type(() => GetTopicTopicsActionsSummary) - actionsSummary: GetTopicTopicsActionsSummary[]; - - @SpeakeasyMetadata() - @Expose({ name: "admin" }) +export type Posts = { + actionsSummary: Array; admin: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "avatar_template" }) avatarTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "bookmarked" }) bookmarked: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_delete" }) canDelete: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_edit" }) canEdit: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_recover" }) canRecover: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_see_hidden_post" }) - canSeeHiddenPost?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_view_edit_history" }) + canSeeHiddenPost?: boolean | undefined; canViewEditHistory: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_wiki" }) canWiki: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "cooked" }) cooked: string; - - @SpeakeasyMetadata() - @Expose({ name: "created_at" }) createdAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "deleted_at" }) - deletedAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "display_username" }) + deletedAt: string | null; displayUsername: string; - - @SpeakeasyMetadata() - @Expose({ name: "edit_reason" }) - editReason: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_bg_color" }) - flairBgColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_color" }) - flairColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_name" }) - flairName: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_url" }) - flairUrl: string; - - @SpeakeasyMetadata() - @Expose({ name: "hidden" }) + editReason: string | null; + flairBgColor: string | null; + flairColor: string | null; + flairName: string | null; + flairUrl: string | null; hidden: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "incoming_link_count" }) incomingLinkCount: number; - - @SpeakeasyMetadata({ elemType: LinkCounts }) - @Expose({ name: "link_counts" }) - @Type(() => LinkCounts) - linkCounts: LinkCounts[]; - - @SpeakeasyMetadata() - @Expose({ name: "moderator" }) + linkCounts: Array; moderator: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "post_number" }) postNumber: number; - - @SpeakeasyMetadata() - @Expose({ name: "post_type" }) postType: number; - - @SpeakeasyMetadata() - @Expose({ name: "primary_group_name" }) - primaryGroupName: string; - - @SpeakeasyMetadata() - @Expose({ name: "quote_count" }) + primaryGroupName: string | null; quoteCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "read" }) read: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "readers_count" }) readersCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "reads" }) reads: number; - - @SpeakeasyMetadata() - @Expose({ name: "reply_count" }) replyCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "reply_to_post_number" }) - replyToPostNumber: string; - - @SpeakeasyMetadata() - @Expose({ name: "reviewable_id" }) + replyToPostNumber: string | null; reviewableId: number; - - @SpeakeasyMetadata() - @Expose({ name: "reviewable_score_count" }) reviewableScoreCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "reviewable_score_pending_count" }) reviewableScorePendingCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "score" }) score: number; - - @SpeakeasyMetadata() - @Expose({ name: "staff" }) staff: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "topic_id" }) topicId: number; - - @SpeakeasyMetadata() - @Expose({ name: "topic_slug" }) topicSlug: string; - - @SpeakeasyMetadata() - @Expose({ name: "trust_level" }) trustLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "updated_at" }) updatedAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "user_deleted" }) userDeleted: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "user_id" }) userId: number; - - @SpeakeasyMetadata() - @Expose({ name: "user_title" }) - userTitle: string; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) + userTitle: string | null; username: string; - - @SpeakeasyMetadata() - @Expose({ name: "version" }) version: number; - - @SpeakeasyMetadata() - @Expose({ name: "wiki" }) wiki: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "yours" }) yours: boolean; -} +}; -export class PostStream extends SpeakeasyBase { - @SpeakeasyMetadata({ elemType: Posts }) - @Expose({ name: "posts" }) - @Type(() => Posts) - posts: Posts[]; +export type PostStream = { + posts: Array; + stream: Array; +}; - @SpeakeasyMetadata() - @Expose({ name: "stream" }) - stream: any[]; -} - -export class GetTopicUser extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "avatar_template" }) +export type GetTopicUser = { avatarTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) username: string; -} +}; -export class Posters extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "description" }) +export type Posters = { description: string; - - @SpeakeasyMetadata() - @Expose({ name: "extras" }) extras: string; - - @SpeakeasyMetadata() - @Expose({ name: "user" }) - @Type(() => GetTopicUser) user: GetTopicUser; -} +}; -export class GetTopicTagsDescriptions extends SpeakeasyBase {} +export type GetTopicTagsDescriptions = {}; -export class SuggestedTopics extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "archetype" }) +export type SuggestedTopics = { archetype: string; - - @SpeakeasyMetadata() - @Expose({ name: "archived" }) archived: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "bookmarked" }) - bookmarked: string; - - @SpeakeasyMetadata() - @Expose({ name: "bumped" }) + bookmarked: string | null; bumped: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "bumped_at" }) bumpedAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "category_id" }) categoryId: number; - - @SpeakeasyMetadata() - @Expose({ name: "closed" }) closed: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "created_at" }) createdAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "excerpt" }) excerpt: string; - - @SpeakeasyMetadata() - @Expose({ name: "fancy_title" }) fancyTitle: string; - - @SpeakeasyMetadata() - @Expose({ name: "featured_link" }) - featuredLink: string; - - @SpeakeasyMetadata() - @Expose({ name: "highest_post_number" }) + featuredLink: string | null; highestPostNumber: number; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "image_url" }) - imageUrl: string; - - @SpeakeasyMetadata() - @Expose({ name: "last_posted_at" }) - lastPostedAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "like_count" }) + imageUrl: string | null; + lastPostedAt: string | null; likeCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "liked" }) - liked: string; - - @SpeakeasyMetadata() - @Expose({ name: "pinned" }) + liked: string | null; pinned: boolean; - - @SpeakeasyMetadata({ elemType: Posters }) - @Expose({ name: "posters" }) - @Type(() => Posters) - posters: Posters[]; - - @SpeakeasyMetadata() - @Expose({ name: "posts_count" }) + posters: Array; postsCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "reply_count" }) replyCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "slug" }) slug: string; - - @SpeakeasyMetadata() - @Expose({ name: "tags" }) - tags: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "tags_descriptions" }) - @Type(() => GetTopicTagsDescriptions) + tags: Array; tagsDescriptions: GetTopicTagsDescriptions; - - @SpeakeasyMetadata() - @Expose({ name: "title" }) title: string; - - @SpeakeasyMetadata() - @Expose({ name: "unpinned" }) - unpinned: string; - - @SpeakeasyMetadata() - @Expose({ name: "unseen" }) + unpinned: string | null; unseen: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "views" }) views: number; - - @SpeakeasyMetadata() - @Expose({ name: "visible" }) visible: boolean; -} +}; -export class TagsDescriptions extends SpeakeasyBase {} +export type TagsDescriptions = {}; /** * specific posts */ -export class GetTopicResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata({ elemType: GetTopicActionsSummary }) - @Expose({ name: "actions_summary" }) - @Type(() => GetTopicActionsSummary) - actionsSummary: GetTopicActionsSummary[]; - - @SpeakeasyMetadata() - @Expose({ name: "archetype" }) +export type GetTopicResponseBody = { + actionsSummary: Array; archetype: string; - - @SpeakeasyMetadata() - @Expose({ name: "archived" }) archived: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "bookmarked" }) bookmarked: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "bookmarks" }) - bookmarks: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "category_id" }) + bookmarks: Array; categoryId: number; - - @SpeakeasyMetadata() - @Expose({ name: "chunk_size" }) chunkSize: number; - - @SpeakeasyMetadata() - @Expose({ name: "closed" }) closed: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "created_at" }) createdAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "current_post_number" }) - currentPostNumber?: number; - - @SpeakeasyMetadata() - @Expose({ name: "deleted_at" }) - deletedAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "deleted_by" }) - deletedBy: string; - - @SpeakeasyMetadata() - @Expose({ name: "details" }) - @Type(() => Details) + currentPostNumber?: number | undefined; + deletedAt: string | null; + deletedBy: string | null; details: Details; - - @SpeakeasyMetadata() - @Expose({ name: "draft" }) - draft: string; - - @SpeakeasyMetadata() - @Expose({ name: "draft_key" }) + draft: string | null; draftKey: string; - - @SpeakeasyMetadata() - @Expose({ name: "draft_sequence" }) draftSequence: number; - - @SpeakeasyMetadata() - @Expose({ name: "fancy_title" }) fancyTitle: string; - - @SpeakeasyMetadata() - @Expose({ name: "featured_link" }) - featuredLink: string; - - @SpeakeasyMetadata() - @Expose({ name: "has_deleted" }) + featuredLink: string | null; hasDeleted: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "has_summary" }) hasSummary: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "highest_post_number" }) - highestPostNumber: number; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) + highestPostNumber: number | null; id: number; - - @SpeakeasyMetadata() - @Expose({ name: "image_url" }) - imageUrl: string; - - @SpeakeasyMetadata() - @Expose({ name: "last_posted_at" }) - lastPostedAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "like_count" }) + imageUrl: string | null; + lastPostedAt: string | null; likeCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "message_bus_last_id" }) messageBusLastId: number; - - @SpeakeasyMetadata() - @Expose({ name: "participant_count" }) participantCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "pinned" }) pinned: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "pinned_at" }) - pinnedAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "pinned_globally" }) + pinnedAt: string | null; pinnedGlobally: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "pinned_until" }) - pinnedUntil: string; - - @SpeakeasyMetadata() - @Expose({ name: "post_stream" }) - @Type(() => PostStream) + pinnedUntil: string | null; postStream: PostStream; - - @SpeakeasyMetadata() - @Expose({ name: "posts_count" }) postsCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "reply_count" }) replyCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "show_read_indicator" }) showReadIndicator: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "slow_mode_enabled_until" }) - slowModeEnabledUntil: string; - - @SpeakeasyMetadata() - @Expose({ name: "slow_mode_seconds" }) + slowModeEnabledUntil: string | null; slowModeSeconds: number; - - @SpeakeasyMetadata() - @Expose({ name: "slug" }) slug: string; - - @SpeakeasyMetadata({ elemType: SuggestedTopics }) - @Expose({ name: "suggested_topics" }) - @Type(() => SuggestedTopics) - suggestedTopics: SuggestedTopics[]; - - @SpeakeasyMetadata() - @Expose({ name: "summarizable" }) + suggestedTopics: Array; summarizable: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "tags" }) - tags: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "tags_descriptions" }) - @Type(() => TagsDescriptions) + tags: Array; tagsDescriptions: TagsDescriptions; - - @SpeakeasyMetadata() - @Expose({ name: "thumbnails" }) - thumbnails: string; - - @SpeakeasyMetadata() - @Expose({ name: "timeline_lookup" }) - timelineLookup: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "title" }) + thumbnails: string | null; + timelineLookup: Array; title: string; - - @SpeakeasyMetadata() - @Expose({ name: "topic_timer" }) - topicTimer: string; - - @SpeakeasyMetadata() - @Expose({ name: "unpinned" }) - unpinned: string; - - @SpeakeasyMetadata() - @Expose({ name: "user_id" }) + topicTimer: string | null; + unpinned: string | null; userId: number; - - @SpeakeasyMetadata() - @Expose({ name: "views" }) views: number; - - @SpeakeasyMetadata() - @Expose({ name: "visible" }) visible: boolean; + wordCount: number | null; +}; - @SpeakeasyMetadata() - @Expose({ name: "word_count" }) - wordCount: number; +/** @internal */ +export const GetTopicRequest$inboundSchema: z.ZodType = z + .object({ + "Api-Key": z.string(), + "Api-Username": z.string(), + id: z.string(), + }) + .transform((v) => { + return remap$(v, { + "Api-Key": "apiKey", + "Api-Username": "apiUsername", + }); + }); + +/** @internal */ +export type GetTopicRequest$Outbound = { + "Api-Key": string; + "Api-Username": string; + id: string; +}; + +/** @internal */ +export const GetTopicRequest$outboundSchema: z.ZodType< + GetTopicRequest$Outbound, + z.ZodTypeDef, + GetTopicRequest +> = z + .object({ + apiKey: z.string(), + apiUsername: z.string(), + id: z.string(), + }) + .transform((v) => { + return remap$(v, { + apiKey: "Api-Key", + apiUsername: "Api-Username", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTopicRequest$ { + /** @deprecated use `GetTopicRequest$inboundSchema` instead. */ + export const inboundSchema = GetTopicRequest$inboundSchema; + /** @deprecated use `GetTopicRequest$outboundSchema` instead. */ + export const outboundSchema = GetTopicRequest$outboundSchema; + /** @deprecated use `GetTopicRequest$Outbound` instead. */ + export type Outbound = GetTopicRequest$Outbound; } -export class GetTopicResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const GetTopicActionsSummary$inboundSchema: z.ZodType< + GetTopicActionsSummary, + z.ZodTypeDef, + unknown +> = z + .object({ + can_act: z.boolean(), + count: z.number().int(), + hidden: z.boolean(), + id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + can_act: "canAct", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type GetTopicActionsSummary$Outbound = { + can_act: boolean; + count: number; + hidden: boolean; + id: number; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const GetTopicActionsSummary$outboundSchema: z.ZodType< + GetTopicActionsSummary$Outbound, + z.ZodTypeDef, + GetTopicActionsSummary +> = z + .object({ + canAct: z.boolean(), + count: z.number().int(), + hidden: z.boolean(), + id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + canAct: "can_act", + }); + }); - /** - * specific posts - */ - @SpeakeasyMetadata() - object?: GetTopicResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTopicActionsSummary$ { + /** @deprecated use `GetTopicActionsSummary$inboundSchema` instead. */ + export const inboundSchema = GetTopicActionsSummary$inboundSchema; + /** @deprecated use `GetTopicActionsSummary$outboundSchema` instead. */ + export const outboundSchema = GetTopicActionsSummary$outboundSchema; + /** @deprecated use `GetTopicActionsSummary$Outbound` instead. */ + export type Outbound = GetTopicActionsSummary$Outbound; +} + +/** @internal */ +export const CreatedBy$inboundSchema: z.ZodType = z + .object({ + avatar_template: z.string(), + id: z.number().int(), + name: z.string(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + avatar_template: "avatarTemplate", + }); + }); + +/** @internal */ +export type CreatedBy$Outbound = { + avatar_template: string; + id: number; + name: string; + username: string; +}; + +/** @internal */ +export const CreatedBy$outboundSchema: z.ZodType = z + .object({ + avatarTemplate: z.string(), + id: z.number().int(), + name: z.string(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + avatarTemplate: "avatar_template", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreatedBy$ { + /** @deprecated use `CreatedBy$inboundSchema` instead. */ + export const inboundSchema = CreatedBy$inboundSchema; + /** @deprecated use `CreatedBy$outboundSchema` instead. */ + export const outboundSchema = CreatedBy$outboundSchema; + /** @deprecated use `CreatedBy$Outbound` instead. */ + export type Outbound = CreatedBy$Outbound; +} + +/** @internal */ +export const LastPoster$inboundSchema: z.ZodType = z + .object({ + avatar_template: z.string(), + id: z.number().int(), + name: z.string(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + avatar_template: "avatarTemplate", + }); + }); + +/** @internal */ +export type LastPoster$Outbound = { + avatar_template: string; + id: number; + name: string; + username: string; +}; + +/** @internal */ +export const LastPoster$outboundSchema: z.ZodType = z + .object({ + avatarTemplate: z.string(), + id: z.number().int(), + name: z.string(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + avatarTemplate: "avatar_template", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace LastPoster$ { + /** @deprecated use `LastPoster$inboundSchema` instead. */ + export const inboundSchema = LastPoster$inboundSchema; + /** @deprecated use `LastPoster$outboundSchema` instead. */ + export const outboundSchema = LastPoster$outboundSchema; + /** @deprecated use `LastPoster$Outbound` instead. */ + export type Outbound = LastPoster$Outbound; +} + +/** @internal */ +export const Participants$inboundSchema: z.ZodType = z + .object({ + admin: z.boolean(), + avatar_template: z.string(), + flair_bg_color: z.nullable(z.string()), + flair_color: z.nullable(z.string()), + flair_group_id: z.nullable(z.string()).optional(), + flair_name: z.nullable(z.string()), + flair_url: z.nullable(z.string()), + id: z.number().int(), + moderator: z.boolean(), + name: z.string(), + post_count: z.number().int(), + primary_group_name: z.nullable(z.string()), + trust_level: z.number().int(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + avatar_template: "avatarTemplate", + flair_bg_color: "flairBgColor", + flair_color: "flairColor", + flair_group_id: "flairGroupId", + flair_name: "flairName", + flair_url: "flairUrl", + post_count: "postCount", + primary_group_name: "primaryGroupName", + trust_level: "trustLevel", + }); + }); + +/** @internal */ +export type Participants$Outbound = { + admin: boolean; + avatar_template: string; + flair_bg_color: string | null; + flair_color: string | null; + flair_group_id?: string | null | undefined; + flair_name: string | null; + flair_url: string | null; + id: number; + moderator: boolean; + name: string; + post_count: number; + primary_group_name: string | null; + trust_level: number; + username: string; +}; + +/** @internal */ +export const Participants$outboundSchema: z.ZodType< + Participants$Outbound, + z.ZodTypeDef, + Participants +> = z + .object({ + admin: z.boolean(), + avatarTemplate: z.string(), + flairBgColor: z.nullable(z.string()), + flairColor: z.nullable(z.string()), + flairGroupId: z.nullable(z.string()).optional(), + flairName: z.nullable(z.string()), + flairUrl: z.nullable(z.string()), + id: z.number().int(), + moderator: z.boolean(), + name: z.string(), + postCount: z.number().int(), + primaryGroupName: z.nullable(z.string()), + trustLevel: z.number().int(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + avatarTemplate: "avatar_template", + flairBgColor: "flair_bg_color", + flairColor: "flair_color", + flairGroupId: "flair_group_id", + flairName: "flair_name", + flairUrl: "flair_url", + postCount: "post_count", + primaryGroupName: "primary_group_name", + trustLevel: "trust_level", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Participants$ { + /** @deprecated use `Participants$inboundSchema` instead. */ + export const inboundSchema = Participants$inboundSchema; + /** @deprecated use `Participants$outboundSchema` instead. */ + export const outboundSchema = Participants$outboundSchema; + /** @deprecated use `Participants$Outbound` instead. */ + export type Outbound = Participants$Outbound; +} + +/** @internal */ +export const Details$inboundSchema: z.ZodType = z + .object({ + can_archive_topic: z.boolean(), + can_close_topic: z.boolean(), + can_convert_topic: z.boolean(), + can_create_post: z.boolean(), + can_delete: z.boolean(), + can_edit: z.boolean(), + can_edit_staff_notes: z.boolean(), + can_flag_topic: z.boolean().optional(), + can_invite_to: z.boolean().optional(), + can_invite_via_email: z.boolean().optional(), + can_moderate_category: z.boolean(), + can_move_posts: z.boolean(), + can_pin_unpin_topic: z.boolean(), + can_remove_allowed_users: z.boolean(), + can_remove_self_id: z.number().int(), + can_reply_as_new_topic: z.boolean(), + can_review_topic: z.boolean(), + can_split_merge_topic: z.boolean(), + can_toggle_topic_visibility: z.boolean(), + created_by: z.lazy(() => CreatedBy$inboundSchema), + last_poster: z.lazy(() => LastPoster$inboundSchema), + notification_level: z.number().int(), + participants: z.array(z.lazy(() => Participants$inboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + can_archive_topic: "canArchiveTopic", + can_close_topic: "canCloseTopic", + can_convert_topic: "canConvertTopic", + can_create_post: "canCreatePost", + can_delete: "canDelete", + can_edit: "canEdit", + can_edit_staff_notes: "canEditStaffNotes", + can_flag_topic: "canFlagTopic", + can_invite_to: "canInviteTo", + can_invite_via_email: "canInviteViaEmail", + can_moderate_category: "canModerateCategory", + can_move_posts: "canMovePosts", + can_pin_unpin_topic: "canPinUnpinTopic", + can_remove_allowed_users: "canRemoveAllowedUsers", + can_remove_self_id: "canRemoveSelfId", + can_reply_as_new_topic: "canReplyAsNewTopic", + can_review_topic: "canReviewTopic", + can_split_merge_topic: "canSplitMergeTopic", + can_toggle_topic_visibility: "canToggleTopicVisibility", + created_by: "createdBy", + last_poster: "lastPoster", + notification_level: "notificationLevel", + }); + }); + +/** @internal */ +export type Details$Outbound = { + can_archive_topic: boolean; + can_close_topic: boolean; + can_convert_topic: boolean; + can_create_post: boolean; + can_delete: boolean; + can_edit: boolean; + can_edit_staff_notes: boolean; + can_flag_topic?: boolean | undefined; + can_invite_to?: boolean | undefined; + can_invite_via_email?: boolean | undefined; + can_moderate_category: boolean; + can_move_posts: boolean; + can_pin_unpin_topic: boolean; + can_remove_allowed_users: boolean; + can_remove_self_id: number; + can_reply_as_new_topic: boolean; + can_review_topic: boolean; + can_split_merge_topic: boolean; + can_toggle_topic_visibility: boolean; + created_by: CreatedBy$Outbound; + last_poster: LastPoster$Outbound; + notification_level: number; + participants?: Array | undefined; +}; + +/** @internal */ +export const Details$outboundSchema: z.ZodType = z + .object({ + canArchiveTopic: z.boolean(), + canCloseTopic: z.boolean(), + canConvertTopic: z.boolean(), + canCreatePost: z.boolean(), + canDelete: z.boolean(), + canEdit: z.boolean(), + canEditStaffNotes: z.boolean(), + canFlagTopic: z.boolean().optional(), + canInviteTo: z.boolean().optional(), + canInviteViaEmail: z.boolean().optional(), + canModerateCategory: z.boolean(), + canMovePosts: z.boolean(), + canPinUnpinTopic: z.boolean(), + canRemoveAllowedUsers: z.boolean(), + canRemoveSelfId: z.number().int(), + canReplyAsNewTopic: z.boolean(), + canReviewTopic: z.boolean(), + canSplitMergeTopic: z.boolean(), + canToggleTopicVisibility: z.boolean(), + createdBy: z.lazy(() => CreatedBy$outboundSchema), + lastPoster: z.lazy(() => LastPoster$outboundSchema), + notificationLevel: z.number().int(), + participants: z.array(z.lazy(() => Participants$outboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + canArchiveTopic: "can_archive_topic", + canCloseTopic: "can_close_topic", + canConvertTopic: "can_convert_topic", + canCreatePost: "can_create_post", + canDelete: "can_delete", + canEdit: "can_edit", + canEditStaffNotes: "can_edit_staff_notes", + canFlagTopic: "can_flag_topic", + canInviteTo: "can_invite_to", + canInviteViaEmail: "can_invite_via_email", + canModerateCategory: "can_moderate_category", + canMovePosts: "can_move_posts", + canPinUnpinTopic: "can_pin_unpin_topic", + canRemoveAllowedUsers: "can_remove_allowed_users", + canRemoveSelfId: "can_remove_self_id", + canReplyAsNewTopic: "can_reply_as_new_topic", + canReviewTopic: "can_review_topic", + canSplitMergeTopic: "can_split_merge_topic", + canToggleTopicVisibility: "can_toggle_topic_visibility", + createdBy: "created_by", + lastPoster: "last_poster", + notificationLevel: "notification_level", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Details$ { + /** @deprecated use `Details$inboundSchema` instead. */ + export const inboundSchema = Details$inboundSchema; + /** @deprecated use `Details$outboundSchema` instead. */ + export const outboundSchema = Details$outboundSchema; + /** @deprecated use `Details$Outbound` instead. */ + export type Outbound = Details$Outbound; +} + +/** @internal */ +export const GetTopicTopicsActionsSummary$inboundSchema: z.ZodType< + GetTopicTopicsActionsSummary, + z.ZodTypeDef, + unknown +> = z + .object({ + can_act: z.boolean(), + id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + can_act: "canAct", + }); + }); + +/** @internal */ +export type GetTopicTopicsActionsSummary$Outbound = { + can_act: boolean; + id: number; +}; + +/** @internal */ +export const GetTopicTopicsActionsSummary$outboundSchema: z.ZodType< + GetTopicTopicsActionsSummary$Outbound, + z.ZodTypeDef, + GetTopicTopicsActionsSummary +> = z + .object({ + canAct: z.boolean(), + id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + canAct: "can_act", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTopicTopicsActionsSummary$ { + /** @deprecated use `GetTopicTopicsActionsSummary$inboundSchema` instead. */ + export const inboundSchema = GetTopicTopicsActionsSummary$inboundSchema; + /** @deprecated use `GetTopicTopicsActionsSummary$outboundSchema` instead. */ + export const outboundSchema = GetTopicTopicsActionsSummary$outboundSchema; + /** @deprecated use `GetTopicTopicsActionsSummary$Outbound` instead. */ + export type Outbound = GetTopicTopicsActionsSummary$Outbound; +} + +/** @internal */ +export const LinkCounts$inboundSchema: z.ZodType = z.object({ + clicks: z.number().int(), + internal: z.boolean(), + reflection: z.boolean(), + title: z.string(), + url: z.string(), +}); + +/** @internal */ +export type LinkCounts$Outbound = { + clicks: number; + internal: boolean; + reflection: boolean; + title: string; + url: string; +}; + +/** @internal */ +export const LinkCounts$outboundSchema: z.ZodType = + z.object({ + clicks: z.number().int(), + internal: z.boolean(), + reflection: z.boolean(), + title: z.string(), + url: z.string(), + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace LinkCounts$ { + /** @deprecated use `LinkCounts$inboundSchema` instead. */ + export const inboundSchema = LinkCounts$inboundSchema; + /** @deprecated use `LinkCounts$outboundSchema` instead. */ + export const outboundSchema = LinkCounts$outboundSchema; + /** @deprecated use `LinkCounts$Outbound` instead. */ + export type Outbound = LinkCounts$Outbound; +} + +/** @internal */ +export const Posts$inboundSchema: z.ZodType = z + .object({ + actions_summary: z.array(z.lazy(() => GetTopicTopicsActionsSummary$inboundSchema)), + admin: z.boolean(), + avatar_template: z.string(), + bookmarked: z.boolean(), + can_delete: z.boolean(), + can_edit: z.boolean(), + can_recover: z.boolean(), + can_see_hidden_post: z.boolean().optional(), + can_view_edit_history: z.boolean(), + can_wiki: z.boolean(), + cooked: z.string(), + created_at: z.string(), + deleted_at: z.nullable(z.string()), + display_username: z.string(), + edit_reason: z.nullable(z.string()), + flair_bg_color: z.nullable(z.string()), + flair_color: z.nullable(z.string()), + flair_name: z.nullable(z.string()), + flair_url: z.nullable(z.string()), + hidden: z.boolean(), + id: z.number().int(), + incoming_link_count: z.number().int(), + link_counts: z.array(z.lazy(() => LinkCounts$inboundSchema)), + moderator: z.boolean(), + name: z.string(), + post_number: z.number().int(), + post_type: z.number().int(), + primary_group_name: z.nullable(z.string()), + quote_count: z.number().int(), + read: z.boolean(), + readers_count: z.number().int(), + reads: z.number().int(), + reply_count: z.number().int(), + reply_to_post_number: z.nullable(z.string()), + reviewable_id: z.number().int(), + reviewable_score_count: z.number().int(), + reviewable_score_pending_count: z.number().int(), + score: z.number().int(), + staff: z.boolean(), + topic_id: z.number().int(), + topic_slug: z.string(), + trust_level: z.number().int(), + updated_at: z.string(), + user_deleted: z.boolean(), + user_id: z.number().int(), + user_title: z.nullable(z.string()), + username: z.string(), + version: z.number().int(), + wiki: z.boolean(), + yours: z.boolean(), + }) + .transform((v) => { + return remap$(v, { + actions_summary: "actionsSummary", + avatar_template: "avatarTemplate", + can_delete: "canDelete", + can_edit: "canEdit", + can_recover: "canRecover", + can_see_hidden_post: "canSeeHiddenPost", + can_view_edit_history: "canViewEditHistory", + can_wiki: "canWiki", + created_at: "createdAt", + deleted_at: "deletedAt", + display_username: "displayUsername", + edit_reason: "editReason", + flair_bg_color: "flairBgColor", + flair_color: "flairColor", + flair_name: "flairName", + flair_url: "flairUrl", + incoming_link_count: "incomingLinkCount", + link_counts: "linkCounts", + post_number: "postNumber", + post_type: "postType", + primary_group_name: "primaryGroupName", + quote_count: "quoteCount", + readers_count: "readersCount", + reply_count: "replyCount", + reply_to_post_number: "replyToPostNumber", + reviewable_id: "reviewableId", + reviewable_score_count: "reviewableScoreCount", + reviewable_score_pending_count: "reviewableScorePendingCount", + topic_id: "topicId", + topic_slug: "topicSlug", + trust_level: "trustLevel", + updated_at: "updatedAt", + user_deleted: "userDeleted", + user_id: "userId", + user_title: "userTitle", + }); + }); + +/** @internal */ +export type Posts$Outbound = { + actions_summary: Array; + admin: boolean; + avatar_template: string; + bookmarked: boolean; + can_delete: boolean; + can_edit: boolean; + can_recover: boolean; + can_see_hidden_post?: boolean | undefined; + can_view_edit_history: boolean; + can_wiki: boolean; + cooked: string; + created_at: string; + deleted_at: string | null; + display_username: string; + edit_reason: string | null; + flair_bg_color: string | null; + flair_color: string | null; + flair_name: string | null; + flair_url: string | null; + hidden: boolean; + id: number; + incoming_link_count: number; + link_counts: Array; + moderator: boolean; + name: string; + post_number: number; + post_type: number; + primary_group_name: string | null; + quote_count: number; + read: boolean; + readers_count: number; + reads: number; + reply_count: number; + reply_to_post_number: string | null; + reviewable_id: number; + reviewable_score_count: number; + reviewable_score_pending_count: number; + score: number; + staff: boolean; + topic_id: number; + topic_slug: string; + trust_level: number; + updated_at: string; + user_deleted: boolean; + user_id: number; + user_title: string | null; + username: string; + version: number; + wiki: boolean; + yours: boolean; +}; + +/** @internal */ +export const Posts$outboundSchema: z.ZodType = z + .object({ + actionsSummary: z.array(z.lazy(() => GetTopicTopicsActionsSummary$outboundSchema)), + admin: z.boolean(), + avatarTemplate: z.string(), + bookmarked: z.boolean(), + canDelete: z.boolean(), + canEdit: z.boolean(), + canRecover: z.boolean(), + canSeeHiddenPost: z.boolean().optional(), + canViewEditHistory: z.boolean(), + canWiki: z.boolean(), + cooked: z.string(), + createdAt: z.string(), + deletedAt: z.nullable(z.string()), + displayUsername: z.string(), + editReason: z.nullable(z.string()), + flairBgColor: z.nullable(z.string()), + flairColor: z.nullable(z.string()), + flairName: z.nullable(z.string()), + flairUrl: z.nullable(z.string()), + hidden: z.boolean(), + id: z.number().int(), + incomingLinkCount: z.number().int(), + linkCounts: z.array(z.lazy(() => LinkCounts$outboundSchema)), + moderator: z.boolean(), + name: z.string(), + postNumber: z.number().int(), + postType: z.number().int(), + primaryGroupName: z.nullable(z.string()), + quoteCount: z.number().int(), + read: z.boolean(), + readersCount: z.number().int(), + reads: z.number().int(), + replyCount: z.number().int(), + replyToPostNumber: z.nullable(z.string()), + reviewableId: z.number().int(), + reviewableScoreCount: z.number().int(), + reviewableScorePendingCount: z.number().int(), + score: z.number().int(), + staff: z.boolean(), + topicId: z.number().int(), + topicSlug: z.string(), + trustLevel: z.number().int(), + updatedAt: z.string(), + userDeleted: z.boolean(), + userId: z.number().int(), + userTitle: z.nullable(z.string()), + username: z.string(), + version: z.number().int(), + wiki: z.boolean(), + yours: z.boolean(), + }) + .transform((v) => { + return remap$(v, { + actionsSummary: "actions_summary", + avatarTemplate: "avatar_template", + canDelete: "can_delete", + canEdit: "can_edit", + canRecover: "can_recover", + canSeeHiddenPost: "can_see_hidden_post", + canViewEditHistory: "can_view_edit_history", + canWiki: "can_wiki", + createdAt: "created_at", + deletedAt: "deleted_at", + displayUsername: "display_username", + editReason: "edit_reason", + flairBgColor: "flair_bg_color", + flairColor: "flair_color", + flairName: "flair_name", + flairUrl: "flair_url", + incomingLinkCount: "incoming_link_count", + linkCounts: "link_counts", + postNumber: "post_number", + postType: "post_type", + primaryGroupName: "primary_group_name", + quoteCount: "quote_count", + readersCount: "readers_count", + replyCount: "reply_count", + replyToPostNumber: "reply_to_post_number", + reviewableId: "reviewable_id", + reviewableScoreCount: "reviewable_score_count", + reviewableScorePendingCount: "reviewable_score_pending_count", + topicId: "topic_id", + topicSlug: "topic_slug", + trustLevel: "trust_level", + updatedAt: "updated_at", + userDeleted: "user_deleted", + userId: "user_id", + userTitle: "user_title", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Posts$ { + /** @deprecated use `Posts$inboundSchema` instead. */ + export const inboundSchema = Posts$inboundSchema; + /** @deprecated use `Posts$outboundSchema` instead. */ + export const outboundSchema = Posts$outboundSchema; + /** @deprecated use `Posts$Outbound` instead. */ + export type Outbound = Posts$Outbound; +} + +/** @internal */ +export const PostStream$inboundSchema: z.ZodType = z.object({ + posts: z.array(z.lazy(() => Posts$inboundSchema)), + stream: z.array(z.any()), +}); + +/** @internal */ +export type PostStream$Outbound = { + posts: Array; + stream: Array; +}; + +/** @internal */ +export const PostStream$outboundSchema: z.ZodType = + z.object({ + posts: z.array(z.lazy(() => Posts$outboundSchema)), + stream: z.array(z.any()), + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PostStream$ { + /** @deprecated use `PostStream$inboundSchema` instead. */ + export const inboundSchema = PostStream$inboundSchema; + /** @deprecated use `PostStream$outboundSchema` instead. */ + export const outboundSchema = PostStream$outboundSchema; + /** @deprecated use `PostStream$Outbound` instead. */ + export type Outbound = PostStream$Outbound; +} + +/** @internal */ +export const GetTopicUser$inboundSchema: z.ZodType = z + .object({ + avatar_template: z.string(), + id: z.number().int(), + name: z.string(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + avatar_template: "avatarTemplate", + }); + }); + +/** @internal */ +export type GetTopicUser$Outbound = { + avatar_template: string; + id: number; + name: string; + username: string; +}; + +/** @internal */ +export const GetTopicUser$outboundSchema: z.ZodType< + GetTopicUser$Outbound, + z.ZodTypeDef, + GetTopicUser +> = z + .object({ + avatarTemplate: z.string(), + id: z.number().int(), + name: z.string(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + avatarTemplate: "avatar_template", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTopicUser$ { + /** @deprecated use `GetTopicUser$inboundSchema` instead. */ + export const inboundSchema = GetTopicUser$inboundSchema; + /** @deprecated use `GetTopicUser$outboundSchema` instead. */ + export const outboundSchema = GetTopicUser$outboundSchema; + /** @deprecated use `GetTopicUser$Outbound` instead. */ + export type Outbound = GetTopicUser$Outbound; +} + +/** @internal */ +export const Posters$inboundSchema: z.ZodType = z.object({ + description: z.string(), + extras: z.string(), + user: z.lazy(() => GetTopicUser$inboundSchema), +}); + +/** @internal */ +export type Posters$Outbound = { + description: string; + extras: string; + user: GetTopicUser$Outbound; +}; + +/** @internal */ +export const Posters$outboundSchema: z.ZodType = z.object({ + description: z.string(), + extras: z.string(), + user: z.lazy(() => GetTopicUser$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Posters$ { + /** @deprecated use `Posters$inboundSchema` instead. */ + export const inboundSchema = Posters$inboundSchema; + /** @deprecated use `Posters$outboundSchema` instead. */ + export const outboundSchema = Posters$outboundSchema; + /** @deprecated use `Posters$Outbound` instead. */ + export type Outbound = Posters$Outbound; +} + +/** @internal */ +export const GetTopicTagsDescriptions$inboundSchema: z.ZodType< + GetTopicTagsDescriptions, + z.ZodTypeDef, + unknown +> = z.object({}); + +/** @internal */ +export type GetTopicTagsDescriptions$Outbound = {}; + +/** @internal */ +export const GetTopicTagsDescriptions$outboundSchema: z.ZodType< + GetTopicTagsDescriptions$Outbound, + z.ZodTypeDef, + GetTopicTagsDescriptions +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTopicTagsDescriptions$ { + /** @deprecated use `GetTopicTagsDescriptions$inboundSchema` instead. */ + export const inboundSchema = GetTopicTagsDescriptions$inboundSchema; + /** @deprecated use `GetTopicTagsDescriptions$outboundSchema` instead. */ + export const outboundSchema = GetTopicTagsDescriptions$outboundSchema; + /** @deprecated use `GetTopicTagsDescriptions$Outbound` instead. */ + export type Outbound = GetTopicTagsDescriptions$Outbound; +} + +/** @internal */ +export const SuggestedTopics$inboundSchema: z.ZodType = z + .object({ + archetype: z.string(), + archived: z.boolean(), + bookmarked: z.nullable(z.string()), + bumped: z.boolean(), + bumped_at: z.string(), + category_id: z.number().int(), + closed: z.boolean(), + created_at: z.string(), + excerpt: z.string(), + fancy_title: z.string(), + featured_link: z.nullable(z.string()), + highest_post_number: z.number().int(), + id: z.number().int(), + image_url: z.nullable(z.string()), + last_posted_at: z.nullable(z.string()), + like_count: z.number().int(), + liked: z.nullable(z.string()), + pinned: z.boolean(), + posters: z.array(z.lazy(() => Posters$inboundSchema)), + posts_count: z.number().int(), + reply_count: z.number().int(), + slug: z.string(), + tags: z.array(z.any()), + tags_descriptions: z.lazy(() => GetTopicTagsDescriptions$inboundSchema), + title: z.string(), + unpinned: z.nullable(z.string()), + unseen: z.boolean(), + views: z.number().int(), + visible: z.boolean(), + }) + .transform((v) => { + return remap$(v, { + bumped_at: "bumpedAt", + category_id: "categoryId", + created_at: "createdAt", + fancy_title: "fancyTitle", + featured_link: "featuredLink", + highest_post_number: "highestPostNumber", + image_url: "imageUrl", + last_posted_at: "lastPostedAt", + like_count: "likeCount", + posts_count: "postsCount", + reply_count: "replyCount", + tags_descriptions: "tagsDescriptions", + }); + }); + +/** @internal */ +export type SuggestedTopics$Outbound = { + archetype: string; + archived: boolean; + bookmarked: string | null; + bumped: boolean; + bumped_at: string; + category_id: number; + closed: boolean; + created_at: string; + excerpt: string; + fancy_title: string; + featured_link: string | null; + highest_post_number: number; + id: number; + image_url: string | null; + last_posted_at: string | null; + like_count: number; + liked: string | null; + pinned: boolean; + posters: Array; + posts_count: number; + reply_count: number; + slug: string; + tags: Array; + tags_descriptions: GetTopicTagsDescriptions$Outbound; + title: string; + unpinned: string | null; + unseen: boolean; + views: number; + visible: boolean; +}; + +/** @internal */ +export const SuggestedTopics$outboundSchema: z.ZodType< + SuggestedTopics$Outbound, + z.ZodTypeDef, + SuggestedTopics +> = z + .object({ + archetype: z.string(), + archived: z.boolean(), + bookmarked: z.nullable(z.string()), + bumped: z.boolean(), + bumpedAt: z.string(), + categoryId: z.number().int(), + closed: z.boolean(), + createdAt: z.string(), + excerpt: z.string(), + fancyTitle: z.string(), + featuredLink: z.nullable(z.string()), + highestPostNumber: z.number().int(), + id: z.number().int(), + imageUrl: z.nullable(z.string()), + lastPostedAt: z.nullable(z.string()), + likeCount: z.number().int(), + liked: z.nullable(z.string()), + pinned: z.boolean(), + posters: z.array(z.lazy(() => Posters$outboundSchema)), + postsCount: z.number().int(), + replyCount: z.number().int(), + slug: z.string(), + tags: z.array(z.any()), + tagsDescriptions: z.lazy(() => GetTopicTagsDescriptions$outboundSchema), + title: z.string(), + unpinned: z.nullable(z.string()), + unseen: z.boolean(), + views: z.number().int(), + visible: z.boolean(), + }) + .transform((v) => { + return remap$(v, { + bumpedAt: "bumped_at", + categoryId: "category_id", + createdAt: "created_at", + fancyTitle: "fancy_title", + featuredLink: "featured_link", + highestPostNumber: "highest_post_number", + imageUrl: "image_url", + lastPostedAt: "last_posted_at", + likeCount: "like_count", + postsCount: "posts_count", + replyCount: "reply_count", + tagsDescriptions: "tags_descriptions", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SuggestedTopics$ { + /** @deprecated use `SuggestedTopics$inboundSchema` instead. */ + export const inboundSchema = SuggestedTopics$inboundSchema; + /** @deprecated use `SuggestedTopics$outboundSchema` instead. */ + export const outboundSchema = SuggestedTopics$outboundSchema; + /** @deprecated use `SuggestedTopics$Outbound` instead. */ + export type Outbound = SuggestedTopics$Outbound; +} + +/** @internal */ +export const TagsDescriptions$inboundSchema: z.ZodType = + z.object({}); + +/** @internal */ +export type TagsDescriptions$Outbound = {}; + +/** @internal */ +export const TagsDescriptions$outboundSchema: z.ZodType< + TagsDescriptions$Outbound, + z.ZodTypeDef, + TagsDescriptions +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TagsDescriptions$ { + /** @deprecated use `TagsDescriptions$inboundSchema` instead. */ + export const inboundSchema = TagsDescriptions$inboundSchema; + /** @deprecated use `TagsDescriptions$outboundSchema` instead. */ + export const outboundSchema = TagsDescriptions$outboundSchema; + /** @deprecated use `TagsDescriptions$Outbound` instead. */ + export type Outbound = TagsDescriptions$Outbound; +} + +/** @internal */ +export const GetTopicResponseBody$inboundSchema: z.ZodType< + GetTopicResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + actions_summary: z.array(z.lazy(() => GetTopicActionsSummary$inboundSchema)), + archetype: z.string(), + archived: z.boolean(), + bookmarked: z.boolean(), + bookmarks: z.array(z.any()), + category_id: z.number().int(), + chunk_size: z.number().int(), + closed: z.boolean(), + created_at: z.string(), + current_post_number: z.number().int().optional(), + deleted_at: z.nullable(z.string()), + deleted_by: z.nullable(z.string()), + details: z.lazy(() => Details$inboundSchema), + draft: z.nullable(z.string()), + draft_key: z.string(), + draft_sequence: z.number().int(), + fancy_title: z.string(), + featured_link: z.nullable(z.string()), + has_deleted: z.boolean(), + has_summary: z.boolean(), + highest_post_number: z.nullable(z.number().int()), + id: z.number().int(), + image_url: z.nullable(z.string()), + last_posted_at: z.nullable(z.string()), + like_count: z.number().int(), + message_bus_last_id: z.number().int(), + participant_count: z.number().int(), + pinned: z.boolean(), + pinned_at: z.nullable(z.string()), + pinned_globally: z.boolean(), + pinned_until: z.nullable(z.string()), + post_stream: z.lazy(() => PostStream$inboundSchema), + posts_count: z.number().int(), + reply_count: z.number().int(), + show_read_indicator: z.boolean(), + slow_mode_enabled_until: z.nullable(z.string()), + slow_mode_seconds: z.number().int(), + slug: z.string(), + suggested_topics: z.array(z.lazy(() => SuggestedTopics$inboundSchema)), + summarizable: z.boolean(), + tags: z.array(z.any()), + tags_descriptions: z.lazy(() => TagsDescriptions$inboundSchema), + thumbnails: z.nullable(z.string()), + timeline_lookup: z.array(z.any()), + title: z.string(), + topic_timer: z.nullable(z.string()), + unpinned: z.nullable(z.string()), + user_id: z.number().int(), + views: z.number().int(), + visible: z.boolean(), + word_count: z.nullable(z.number().int()), + }) + .transform((v) => { + return remap$(v, { + actions_summary: "actionsSummary", + category_id: "categoryId", + chunk_size: "chunkSize", + created_at: "createdAt", + current_post_number: "currentPostNumber", + deleted_at: "deletedAt", + deleted_by: "deletedBy", + draft_key: "draftKey", + draft_sequence: "draftSequence", + fancy_title: "fancyTitle", + featured_link: "featuredLink", + has_deleted: "hasDeleted", + has_summary: "hasSummary", + highest_post_number: "highestPostNumber", + image_url: "imageUrl", + last_posted_at: "lastPostedAt", + like_count: "likeCount", + message_bus_last_id: "messageBusLastId", + participant_count: "participantCount", + pinned_at: "pinnedAt", + pinned_globally: "pinnedGlobally", + pinned_until: "pinnedUntil", + post_stream: "postStream", + posts_count: "postsCount", + reply_count: "replyCount", + show_read_indicator: "showReadIndicator", + slow_mode_enabled_until: "slowModeEnabledUntil", + slow_mode_seconds: "slowModeSeconds", + suggested_topics: "suggestedTopics", + tags_descriptions: "tagsDescriptions", + timeline_lookup: "timelineLookup", + topic_timer: "topicTimer", + user_id: "userId", + word_count: "wordCount", + }); + }); + +/** @internal */ +export type GetTopicResponseBody$Outbound = { + actions_summary: Array; + archetype: string; + archived: boolean; + bookmarked: boolean; + bookmarks: Array; + category_id: number; + chunk_size: number; + closed: boolean; + created_at: string; + current_post_number?: number | undefined; + deleted_at: string | null; + deleted_by: string | null; + details: Details$Outbound; + draft: string | null; + draft_key: string; + draft_sequence: number; + fancy_title: string; + featured_link: string | null; + has_deleted: boolean; + has_summary: boolean; + highest_post_number: number | null; + id: number; + image_url: string | null; + last_posted_at: string | null; + like_count: number; + message_bus_last_id: number; + participant_count: number; + pinned: boolean; + pinned_at: string | null; + pinned_globally: boolean; + pinned_until: string | null; + post_stream: PostStream$Outbound; + posts_count: number; + reply_count: number; + show_read_indicator: boolean; + slow_mode_enabled_until: string | null; + slow_mode_seconds: number; + slug: string; + suggested_topics: Array; + summarizable: boolean; + tags: Array; + tags_descriptions: TagsDescriptions$Outbound; + thumbnails: string | null; + timeline_lookup: Array; + title: string; + topic_timer: string | null; + unpinned: string | null; + user_id: number; + views: number; + visible: boolean; + word_count: number | null; +}; + +/** @internal */ +export const GetTopicResponseBody$outboundSchema: z.ZodType< + GetTopicResponseBody$Outbound, + z.ZodTypeDef, + GetTopicResponseBody +> = z + .object({ + actionsSummary: z.array(z.lazy(() => GetTopicActionsSummary$outboundSchema)), + archetype: z.string(), + archived: z.boolean(), + bookmarked: z.boolean(), + bookmarks: z.array(z.any()), + categoryId: z.number().int(), + chunkSize: z.number().int(), + closed: z.boolean(), + createdAt: z.string(), + currentPostNumber: z.number().int().optional(), + deletedAt: z.nullable(z.string()), + deletedBy: z.nullable(z.string()), + details: z.lazy(() => Details$outboundSchema), + draft: z.nullable(z.string()), + draftKey: z.string(), + draftSequence: z.number().int(), + fancyTitle: z.string(), + featuredLink: z.nullable(z.string()), + hasDeleted: z.boolean(), + hasSummary: z.boolean(), + highestPostNumber: z.nullable(z.number().int()), + id: z.number().int(), + imageUrl: z.nullable(z.string()), + lastPostedAt: z.nullable(z.string()), + likeCount: z.number().int(), + messageBusLastId: z.number().int(), + participantCount: z.number().int(), + pinned: z.boolean(), + pinnedAt: z.nullable(z.string()), + pinnedGlobally: z.boolean(), + pinnedUntil: z.nullable(z.string()), + postStream: z.lazy(() => PostStream$outboundSchema), + postsCount: z.number().int(), + replyCount: z.number().int(), + showReadIndicator: z.boolean(), + slowModeEnabledUntil: z.nullable(z.string()), + slowModeSeconds: z.number().int(), + slug: z.string(), + suggestedTopics: z.array(z.lazy(() => SuggestedTopics$outboundSchema)), + summarizable: z.boolean(), + tags: z.array(z.any()), + tagsDescriptions: z.lazy(() => TagsDescriptions$outboundSchema), + thumbnails: z.nullable(z.string()), + timelineLookup: z.array(z.any()), + title: z.string(), + topicTimer: z.nullable(z.string()), + unpinned: z.nullable(z.string()), + userId: z.number().int(), + views: z.number().int(), + visible: z.boolean(), + wordCount: z.nullable(z.number().int()), + }) + .transform((v) => { + return remap$(v, { + actionsSummary: "actions_summary", + categoryId: "category_id", + chunkSize: "chunk_size", + createdAt: "created_at", + currentPostNumber: "current_post_number", + deletedAt: "deleted_at", + deletedBy: "deleted_by", + draftKey: "draft_key", + draftSequence: "draft_sequence", + fancyTitle: "fancy_title", + featuredLink: "featured_link", + hasDeleted: "has_deleted", + hasSummary: "has_summary", + highestPostNumber: "highest_post_number", + imageUrl: "image_url", + lastPostedAt: "last_posted_at", + likeCount: "like_count", + messageBusLastId: "message_bus_last_id", + participantCount: "participant_count", + pinnedAt: "pinned_at", + pinnedGlobally: "pinned_globally", + pinnedUntil: "pinned_until", + postStream: "post_stream", + postsCount: "posts_count", + replyCount: "reply_count", + showReadIndicator: "show_read_indicator", + slowModeEnabledUntil: "slow_mode_enabled_until", + slowModeSeconds: "slow_mode_seconds", + suggestedTopics: "suggested_topics", + tagsDescriptions: "tags_descriptions", + timelineLookup: "timeline_lookup", + topicTimer: "topic_timer", + userId: "user_id", + wordCount: "word_count", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTopicResponseBody$ { + /** @deprecated use `GetTopicResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetTopicResponseBody$inboundSchema; + /** @deprecated use `GetTopicResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetTopicResponseBody$outboundSchema; + /** @deprecated use `GetTopicResponseBody$Outbound` instead. */ + export type Outbound = GetTopicResponseBody$Outbound; } diff --git a/src/sdk/models/operations/gettopicbyexternalid.ts b/src/sdk/models/operations/gettopicbyexternalid.ts index 244cbb6..1fa6ee2 100644 --- a/src/sdk/models/operations/gettopicbyexternalid.ts +++ b/src/sdk/models/operations/gettopicbyexternalid.ts @@ -1,31 +1,58 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class GetTopicByExternalIdRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=external_id" }) +export type GetTopicByExternalIdRequest = { externalId: string; -} - -export class GetTopicByExternalIdResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; - - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; - - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +}; + +/** @internal */ +export const GetTopicByExternalIdRequest$inboundSchema: z.ZodType< + GetTopicByExternalIdRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + external_id: z.string(), + }) + .transform((v) => { + return remap$(v, { + external_id: "externalId", + }); + }); + +/** @internal */ +export type GetTopicByExternalIdRequest$Outbound = { + external_id: string; +}; + +/** @internal */ +export const GetTopicByExternalIdRequest$outboundSchema: z.ZodType< + GetTopicByExternalIdRequest$Outbound, + z.ZodTypeDef, + GetTopicByExternalIdRequest +> = z + .object({ + externalId: z.string(), + }) + .transform((v) => { + return remap$(v, { + externalId: "external_id", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetTopicByExternalIdRequest$ { + /** @deprecated use `GetTopicByExternalIdRequest$inboundSchema` instead. */ + export const inboundSchema = GetTopicByExternalIdRequest$inboundSchema; + /** @deprecated use `GetTopicByExternalIdRequest$outboundSchema` instead. */ + export const outboundSchema = GetTopicByExternalIdRequest$outboundSchema; + /** @deprecated use `GetTopicByExternalIdRequest$Outbound` instead. */ + export type Outbound = GetTopicByExternalIdRequest$Outbound; } diff --git a/src/sdk/models/operations/getuser.ts b/src/sdk/models/operations/getuser.ts index 1487315..539b9cd 100644 --- a/src/sdk/models/operations/getuser.ts +++ b/src/sdk/models/operations/getuser.ts @@ -1,797 +1,1477 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class GetUserRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Key" }) +export type GetUserRequest = { apiKey: string; - - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Username" }) apiUsername: string; - - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=username" }) username: string; -} +}; -export class GetUserCustomFields extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "first_name" }) - firstName?: string; -} +export type GetUserCustomFields = { + firstName?: string | null | undefined; +}; -export class GroupUsers extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "group_id" }) +export type GroupUsers = { groupId: number; - - @SpeakeasyMetadata() - @Expose({ name: "notification_level" }) notificationLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "owner" }) - owner?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "user_id" }) + owner?: boolean | undefined; userId: number; -} +}; -export class GetUserGroups extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "allow_membership_requests" }) +export type GetUserGroups = { allowMembershipRequests: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "automatic" }) automatic: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "bio_cooked" }) - bioCooked: string; - - @SpeakeasyMetadata() - @Expose({ name: "bio_excerpt" }) - bioExcerpt: string; - - @SpeakeasyMetadata() - @Expose({ name: "bio_raw" }) - bioRaw: string; - - @SpeakeasyMetadata() - @Expose({ name: "can_admin_group" }) + bioCooked: string | null; + bioExcerpt: string | null; + bioRaw: string | null; canAdminGroup: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_see_members" }) canSeeMembers: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "default_notification_level" }) defaultNotificationLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "display_name" }) displayName: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_bg_color" }) - flairBgColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_color" }) - flairColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_url" }) - flairUrl: string; - - @SpeakeasyMetadata() - @Expose({ name: "full_name" }) - fullName: string; - - @SpeakeasyMetadata() - @Expose({ name: "grant_trust_level" }) - grantTrustLevel: string; - - @SpeakeasyMetadata() - @Expose({ name: "has_messages" }) + flairBgColor: string | null; + flairColor: string | null; + flairUrl: string | null; + fullName: string | null; + grantTrustLevel: string | null; hasMessages: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "incoming_email" }) - incomingEmail: string; - - @SpeakeasyMetadata() - @Expose({ name: "members_visibility_level" }) + incomingEmail: string | null; membersVisibilityLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "membership_request_template" }) - membershipRequestTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "mentionable_level" }) + membershipRequestTemplate: string | null; mentionableLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "messageable_level" }) messageableLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "primary_group" }) primaryGroup: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "public_admission" }) publicAdmission: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "public_exit" }) publicExit: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "publish_read_state" }) publishReadState: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "title" }) - title: string; - - @SpeakeasyMetadata() - @Expose({ name: "user_count" }) + title: string | null; userCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "visibility_level" }) visibilityLevel: number; -} +}; -export class UserAuthTokens extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "browser" }) +export type UserAuthTokens = { browser: string; - - @SpeakeasyMetadata() - @Expose({ name: "client_ip" }) clientIp: string; - - @SpeakeasyMetadata() - @Expose({ name: "created_at" }) createdAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "device" }) device: string; - - @SpeakeasyMetadata() - @Expose({ name: "icon" }) icon: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "is_active" }) isActive: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "location" }) location: string; - - @SpeakeasyMetadata() - @Expose({ name: "os" }) os: string; - - @SpeakeasyMetadata() - @Expose({ name: "seen_at" }) seenAt: string; -} +}; -export class UserFields extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "1" }) - one: string; +export type UserFields = { + one: string | null; + two: string | null; +}; - @SpeakeasyMetadata() - @Expose({ name: "2" }) - two: string; -} - -export class UserNotificationSchedule extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "day_0_end_time" }) +export type UserNotificationSchedule = { day0EndTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_0_start_time" }) day0StartTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_1_end_time" }) day1EndTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_1_start_time" }) day1StartTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_2_end_time" }) day2EndTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_2_start_time" }) day2StartTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_3_end_time" }) day3EndTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_3_start_time" }) day3StartTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_4_end_time" }) day4EndTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_4_start_time" }) day4StartTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_5_end_time" }) day5EndTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_5_start_time" }) day5StartTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_6_end_time" }) day6EndTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_6_start_time" }) day6StartTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "enabled" }) enabled: boolean; -} +}; -export class UserOption extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "allow_private_messages" }) +export type UserOption = { allowPrivateMessages: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "auto_track_topics_after_msecs" }) autoTrackTopicsAfterMsecs: number; - - @SpeakeasyMetadata() - @Expose({ name: "automatically_unpin_topics" }) automaticallyUnpinTopics: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "bookmark_auto_delete_preference" }) - bookmarkAutoDeletePreference?: number; - - @SpeakeasyMetadata() - @Expose({ name: "color_scheme_id" }) - colorSchemeId: string; - - @SpeakeasyMetadata() - @Expose({ name: "dark_scheme_id" }) - darkSchemeId: string; - - @SpeakeasyMetadata() - @Expose({ name: "default_calendar" }) - defaultCalendar?: string; - - @SpeakeasyMetadata() - @Expose({ name: "digest_after_minutes" }) + bookmarkAutoDeletePreference?: number | undefined; + colorSchemeId: string | null; + darkSchemeId: string | null; + defaultCalendar?: string | undefined; digestAfterMinutes: number; - - @SpeakeasyMetadata() - @Expose({ name: "dynamic_favicon" }) dynamicFavicon: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "email_digests" }) emailDigests: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "email_in_reply_to" }) emailInReplyTo: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "email_level" }) emailLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "email_messages_level" }) emailMessagesLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "email_previous_replies" }) emailPreviousReplies: number; - - @SpeakeasyMetadata() - @Expose({ name: "enable_allowed_pm_users" }) enableAllowedPmUsers: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "enable_defer" }) enableDefer: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "enable_quoting" }) enableQuoting: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "external_links_in_new_tab" }) externalLinksInNewTab: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "hide_profile_and_presence" }) hideProfileAndPresence: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "homepage_id" }) - homepageId: string; - - @SpeakeasyMetadata() - @Expose({ name: "include_tl0_in_digests" }) + homepageId: string | null; includeTl0InDigests: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "like_notification_frequency" }) likeNotificationFrequency: number; - - @SpeakeasyMetadata() - @Expose({ name: "mailing_list_mode" }) mailingListMode: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "mailing_list_mode_frequency" }) mailingListModeFrequency: number; - - @SpeakeasyMetadata() - @Expose({ name: "new_topic_duration_minutes" }) newTopicDurationMinutes: number; - - @SpeakeasyMetadata() - @Expose({ name: "notification_level_when_replying" }) notificationLevelWhenReplying: number; - - @SpeakeasyMetadata() - @Expose({ name: "oldest_search_log_date" }) - oldestSearchLogDate?: string; - - @SpeakeasyMetadata() - @Expose({ name: "seen_popups" }) - seenPopups?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "sidebar_link_to_filtered_list" }) - sidebarLinkToFilteredList?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "sidebar_show_count_of_new_items" }) - sidebarShowCountOfNewItems?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "skip_new_user_tips" }) + oldestSearchLogDate?: string | null | undefined; + seenPopups?: Array | null | undefined; + sidebarLinkToFilteredList?: boolean | undefined; + sidebarShowCountOfNewItems?: boolean | undefined; skipNewUserTips: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "text_size" }) textSize: string; - - @SpeakeasyMetadata() - @Expose({ name: "text_size_seq" }) textSizeSeq: number; - - @SpeakeasyMetadata() - @Expose({ name: "theme_ids" }) - themeIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "theme_key_seq" }) + themeIds: Array; themeKeySeq: number; - - @SpeakeasyMetadata() - @Expose({ name: "timezone" }) - timezone: string; - - @SpeakeasyMetadata() - @Expose({ name: "title_count_mode" }) + timezone: string | null; titleCountMode: string; - - @SpeakeasyMetadata() - @Expose({ name: "user_id" }) userId: number; + watchedPrecedenceOverMuted?: boolean | null | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "watched_precedence_over_muted" }) - watchedPrecedenceOverMuted?: boolean; -} - -export class User extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "admin" }) +export type User = { admin: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "allowed_pm_usernames" }) - allowedPmUsernames: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "avatar_template" }) + allowedPmUsernames: Array; avatarTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "badge_count" }) badgeCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "can_be_deleted" }) canBeDeleted: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_change_bio" }) canChangeBio: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_change_location" }) canChangeLocation: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_change_tracking_preferences" }) canChangeTrackingPreferences: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_change_website" }) canChangeWebsite: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_delete_all_posts" }) canDeleteAllPosts: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_edit" }) canEdit: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_edit_email" }) canEditEmail: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_edit_name" }) canEditName: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_edit_username" }) canEditUsername: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_ignore_user" }) canIgnoreUser: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_mute_user" }) canMuteUser: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_send_private_message_to_user" }) canSendPrivateMessageToUser: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_send_private_messages" }) canSendPrivateMessages: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_upload_profile_header" }) canUploadProfileHeader: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_upload_user_card_background" }) canUploadUserCardBackground: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "created_at" }) createdAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "custom_fields" }) - @Type(() => GetUserCustomFields) customFields: GetUserCustomFields; - - @SpeakeasyMetadata() - @Expose({ name: "display_sidebar_tags" }) - displaySidebarTags?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "featured_topic" }) - featuredTopic: string; - - @SpeakeasyMetadata() - @Expose({ name: "featured_user_badge_ids" }) - featuredUserBadgeIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "flair_bg_color" }) - flairBgColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_color" }) - flairColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_group_id" }) - flairGroupId: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_name" }) - flairName: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_url" }) - flairUrl: string; - - @SpeakeasyMetadata({ elemType: GroupUsers }) - @Expose({ name: "group_users" }) - @Type(() => GroupUsers) - groupUsers: GroupUsers[]; - - @SpeakeasyMetadata({ elemType: GetUserGroups }) - @Expose({ name: "groups" }) - @Type(() => GetUserGroups) - groups: GetUserGroups[]; - - @SpeakeasyMetadata() - @Expose({ name: "has_title_badges" }) + displaySidebarTags?: boolean | undefined; + featuredTopic: string | null; + featuredUserBadgeIds: Array; + flairBgColor: string | null; + flairColor: string | null; + flairGroupId: string | null; + flairName: string | null; + flairUrl: string | null; + groupUsers: Array; + groups: Array; hasTitleBadges: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "ignored" }) ignored: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "ignored_usernames" }) - ignoredUsernames: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "invited_by" }) - invitedBy: string; - - @SpeakeasyMetadata() - @Expose({ name: "last_posted_at" }) - lastPostedAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "last_seen_at" }) - lastSeenAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "locale" }) - locale: string; - - @SpeakeasyMetadata() - @Expose({ name: "mailing_list_posts_per_day" }) + ignoredUsernames: Array; + invitedBy: string | null; + lastPostedAt: string | null; + lastSeenAt: string | null; + locale: string | null; mailingListPostsPerDay: number; - - @SpeakeasyMetadata() - @Expose({ name: "moderator" }) moderator: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "muted" }) muted: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "muted_category_ids" }) - mutedCategoryIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "muted_tags" }) - mutedTags: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "muted_usernames" }) - mutedUsernames: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) + mutedCategoryIds: Array; + mutedTags: Array; + mutedUsernames: Array; name: string; - - @SpeakeasyMetadata() - @Expose({ name: "pending_count" }) pendingCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "pending_posts_count" }) - pendingPostsCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "post_count" }) + pendingPostsCount?: number | undefined; postCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "primary_group_id" }) - primaryGroupId: string; - - @SpeakeasyMetadata() - @Expose({ name: "primary_group_name" }) - primaryGroupName: string; - - @SpeakeasyMetadata() - @Expose({ name: "profile_view_count" }) + primaryGroupId: string | null; + primaryGroupName: string | null; profileViewCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "recent_time_read" }) recentTimeRead: number; - - @SpeakeasyMetadata() - @Expose({ name: "regular_category_ids" }) - regularCategoryIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "second_factor_backup_enabled" }) - secondFactorBackupEnabled?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "second_factor_enabled" }) + regularCategoryIds: Array; + secondFactorBackupEnabled?: boolean | undefined; secondFactorEnabled: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "sidebar_category_ids" }) - sidebarCategoryIds?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "sidebar_tags" }) - sidebarTags?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "staged" }) + sidebarCategoryIds?: Array | undefined; + sidebarTags?: Array | undefined; staged: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "system_avatar_template" }) systemAvatarTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "system_avatar_upload_id" }) - systemAvatarUploadId: string; - - @SpeakeasyMetadata() - @Expose({ name: "time_read" }) + systemAvatarUploadId: string | null; timeRead: number; - - @SpeakeasyMetadata() - @Expose({ name: "title" }) - title: string; - - @SpeakeasyMetadata() - @Expose({ name: "tracked_category_ids" }) - trackedCategoryIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "tracked_tags" }) - trackedTags: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "trust_level" }) + title: string | null; + trackedCategoryIds: Array; + trackedTags: Array; trustLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "uploaded_avatar_id" }) - uploadedAvatarId: string; - - @SpeakeasyMetadata() - @Expose({ name: "use_logo_small_as_avatar" }) + uploadedAvatarId: string | null; useLogoSmallAsAvatar: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "user_api_keys" }) - userApiKeys: string; - - @SpeakeasyMetadata({ elemType: UserAuthTokens }) - @Expose({ name: "user_auth_tokens" }) - @Type(() => UserAuthTokens) - userAuthTokens: UserAuthTokens[]; - - @SpeakeasyMetadata() - @Expose({ name: "user_fields" }) - @Type(() => UserFields) - userFields?: UserFields; - - @SpeakeasyMetadata() - @Expose({ name: "user_notification_schedule" }) - @Type(() => UserNotificationSchedule) + userApiKeys: string | null; + userAuthTokens: Array; + userFields?: UserFields | undefined; userNotificationSchedule: UserNotificationSchedule; - - @SpeakeasyMetadata() - @Expose({ name: "user_option" }) - @Type(() => UserOption) userOption: UserOption; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) username: string; - - @SpeakeasyMetadata() - @Expose({ name: "watched_category_ids" }) - watchedCategoryIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "watched_first_post_category_ids" }) - watchedFirstPostCategoryIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "watched_tags" }) - watchedTags: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "watching_first_post_tags" }) - watchingFirstPostTags: any[]; -} + watchedCategoryIds: Array; + watchedFirstPostCategoryIds: Array; + watchedTags: Array; + watchingFirstPostTags: Array; +}; /** * user response */ -export class GetUserResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "user" }) - @Type(() => User) +export type GetUserResponseBody = { user: User; + userBadges: Array; +}; - @SpeakeasyMetadata() - @Expose({ name: "user_badges" }) - userBadges: any[]; +/** @internal */ +export const GetUserRequest$inboundSchema: z.ZodType = z + .object({ + "Api-Key": z.string(), + "Api-Username": z.string(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + "Api-Key": "apiKey", + "Api-Username": "apiUsername", + }); + }); + +/** @internal */ +export type GetUserRequest$Outbound = { + "Api-Key": string; + "Api-Username": string; + username: string; +}; + +/** @internal */ +export const GetUserRequest$outboundSchema: z.ZodType< + GetUserRequest$Outbound, + z.ZodTypeDef, + GetUserRequest +> = z + .object({ + apiKey: z.string(), + apiUsername: z.string(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + apiKey: "Api-Key", + apiUsername: "Api-Username", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserRequest$ { + /** @deprecated use `GetUserRequest$inboundSchema` instead. */ + export const inboundSchema = GetUserRequest$inboundSchema; + /** @deprecated use `GetUserRequest$outboundSchema` instead. */ + export const outboundSchema = GetUserRequest$outboundSchema; + /** @deprecated use `GetUserRequest$Outbound` instead. */ + export type Outbound = GetUserRequest$Outbound; } -export class GetUserResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const GetUserCustomFields$inboundSchema: z.ZodType< + GetUserCustomFields, + z.ZodTypeDef, + unknown +> = z + .object({ + first_name: z.nullable(z.string()).optional(), + }) + .transform((v) => { + return remap$(v, { + first_name: "firstName", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type GetUserCustomFields$Outbound = { + first_name?: string | null | undefined; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const GetUserCustomFields$outboundSchema: z.ZodType< + GetUserCustomFields$Outbound, + z.ZodTypeDef, + GetUserCustomFields +> = z + .object({ + firstName: z.nullable(z.string()).optional(), + }) + .transform((v) => { + return remap$(v, { + firstName: "first_name", + }); + }); - /** - * user response - */ - @SpeakeasyMetadata() - object?: GetUserResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserCustomFields$ { + /** @deprecated use `GetUserCustomFields$inboundSchema` instead. */ + export const inboundSchema = GetUserCustomFields$inboundSchema; + /** @deprecated use `GetUserCustomFields$outboundSchema` instead. */ + export const outboundSchema = GetUserCustomFields$outboundSchema; + /** @deprecated use `GetUserCustomFields$Outbound` instead. */ + export type Outbound = GetUserCustomFields$Outbound; +} + +/** @internal */ +export const GroupUsers$inboundSchema: z.ZodType = z + .object({ + group_id: z.number().int(), + notification_level: z.number().int(), + owner: z.boolean().optional(), + user_id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + group_id: "groupId", + notification_level: "notificationLevel", + user_id: "userId", + }); + }); + +/** @internal */ +export type GroupUsers$Outbound = { + group_id: number; + notification_level: number; + owner?: boolean | undefined; + user_id: number; +}; + +/** @internal */ +export const GroupUsers$outboundSchema: z.ZodType = z + .object({ + groupId: z.number().int(), + notificationLevel: z.number().int(), + owner: z.boolean().optional(), + userId: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + groupId: "group_id", + notificationLevel: "notification_level", + userId: "user_id", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GroupUsers$ { + /** @deprecated use `GroupUsers$inboundSchema` instead. */ + export const inboundSchema = GroupUsers$inboundSchema; + /** @deprecated use `GroupUsers$outboundSchema` instead. */ + export const outboundSchema = GroupUsers$outboundSchema; + /** @deprecated use `GroupUsers$Outbound` instead. */ + export type Outbound = GroupUsers$Outbound; +} + +/** @internal */ +export const GetUserGroups$inboundSchema: z.ZodType = z + .object({ + allow_membership_requests: z.boolean(), + automatic: z.boolean(), + bio_cooked: z.nullable(z.string()), + bio_excerpt: z.nullable(z.string()), + bio_raw: z.nullable(z.string()), + can_admin_group: z.boolean(), + can_see_members: z.boolean(), + default_notification_level: z.number().int(), + display_name: z.string(), + flair_bg_color: z.nullable(z.string()), + flair_color: z.nullable(z.string()), + flair_url: z.nullable(z.string()), + full_name: z.nullable(z.string()), + grant_trust_level: z.nullable(z.string()), + has_messages: z.boolean(), + id: z.number().int(), + incoming_email: z.nullable(z.string()), + members_visibility_level: z.number().int(), + membership_request_template: z.nullable(z.string()), + mentionable_level: z.number().int(), + messageable_level: z.number().int(), + name: z.string(), + primary_group: z.boolean(), + public_admission: z.boolean(), + public_exit: z.boolean(), + publish_read_state: z.boolean(), + title: z.nullable(z.string()), + user_count: z.number().int(), + visibility_level: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + allow_membership_requests: "allowMembershipRequests", + bio_cooked: "bioCooked", + bio_excerpt: "bioExcerpt", + bio_raw: "bioRaw", + can_admin_group: "canAdminGroup", + can_see_members: "canSeeMembers", + default_notification_level: "defaultNotificationLevel", + display_name: "displayName", + flair_bg_color: "flairBgColor", + flair_color: "flairColor", + flair_url: "flairUrl", + full_name: "fullName", + grant_trust_level: "grantTrustLevel", + has_messages: "hasMessages", + incoming_email: "incomingEmail", + members_visibility_level: "membersVisibilityLevel", + membership_request_template: "membershipRequestTemplate", + mentionable_level: "mentionableLevel", + messageable_level: "messageableLevel", + primary_group: "primaryGroup", + public_admission: "publicAdmission", + public_exit: "publicExit", + publish_read_state: "publishReadState", + user_count: "userCount", + visibility_level: "visibilityLevel", + }); + }); + +/** @internal */ +export type GetUserGroups$Outbound = { + allow_membership_requests: boolean; + automatic: boolean; + bio_cooked: string | null; + bio_excerpt: string | null; + bio_raw: string | null; + can_admin_group: boolean; + can_see_members: boolean; + default_notification_level: number; + display_name: string; + flair_bg_color: string | null; + flair_color: string | null; + flair_url: string | null; + full_name: string | null; + grant_trust_level: string | null; + has_messages: boolean; + id: number; + incoming_email: string | null; + members_visibility_level: number; + membership_request_template: string | null; + mentionable_level: number; + messageable_level: number; + name: string; + primary_group: boolean; + public_admission: boolean; + public_exit: boolean; + publish_read_state: boolean; + title: string | null; + user_count: number; + visibility_level: number; +}; + +/** @internal */ +export const GetUserGroups$outboundSchema: z.ZodType< + GetUserGroups$Outbound, + z.ZodTypeDef, + GetUserGroups +> = z + .object({ + allowMembershipRequests: z.boolean(), + automatic: z.boolean(), + bioCooked: z.nullable(z.string()), + bioExcerpt: z.nullable(z.string()), + bioRaw: z.nullable(z.string()), + canAdminGroup: z.boolean(), + canSeeMembers: z.boolean(), + defaultNotificationLevel: z.number().int(), + displayName: z.string(), + flairBgColor: z.nullable(z.string()), + flairColor: z.nullable(z.string()), + flairUrl: z.nullable(z.string()), + fullName: z.nullable(z.string()), + grantTrustLevel: z.nullable(z.string()), + hasMessages: z.boolean(), + id: z.number().int(), + incomingEmail: z.nullable(z.string()), + membersVisibilityLevel: z.number().int(), + membershipRequestTemplate: z.nullable(z.string()), + mentionableLevel: z.number().int(), + messageableLevel: z.number().int(), + name: z.string(), + primaryGroup: z.boolean(), + publicAdmission: z.boolean(), + publicExit: z.boolean(), + publishReadState: z.boolean(), + title: z.nullable(z.string()), + userCount: z.number().int(), + visibilityLevel: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + allowMembershipRequests: "allow_membership_requests", + bioCooked: "bio_cooked", + bioExcerpt: "bio_excerpt", + bioRaw: "bio_raw", + canAdminGroup: "can_admin_group", + canSeeMembers: "can_see_members", + defaultNotificationLevel: "default_notification_level", + displayName: "display_name", + flairBgColor: "flair_bg_color", + flairColor: "flair_color", + flairUrl: "flair_url", + fullName: "full_name", + grantTrustLevel: "grant_trust_level", + hasMessages: "has_messages", + incomingEmail: "incoming_email", + membersVisibilityLevel: "members_visibility_level", + membershipRequestTemplate: "membership_request_template", + mentionableLevel: "mentionable_level", + messageableLevel: "messageable_level", + primaryGroup: "primary_group", + publicAdmission: "public_admission", + publicExit: "public_exit", + publishReadState: "publish_read_state", + userCount: "user_count", + visibilityLevel: "visibility_level", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserGroups$ { + /** @deprecated use `GetUserGroups$inboundSchema` instead. */ + export const inboundSchema = GetUserGroups$inboundSchema; + /** @deprecated use `GetUserGroups$outboundSchema` instead. */ + export const outboundSchema = GetUserGroups$outboundSchema; + /** @deprecated use `GetUserGroups$Outbound` instead. */ + export type Outbound = GetUserGroups$Outbound; +} + +/** @internal */ +export const UserAuthTokens$inboundSchema: z.ZodType = z + .object({ + browser: z.string(), + client_ip: z.string(), + created_at: z.string(), + device: z.string(), + icon: z.string(), + id: z.number().int(), + is_active: z.boolean(), + location: z.string(), + os: z.string(), + seen_at: z.string(), + }) + .transform((v) => { + return remap$(v, { + client_ip: "clientIp", + created_at: "createdAt", + is_active: "isActive", + seen_at: "seenAt", + }); + }); + +/** @internal */ +export type UserAuthTokens$Outbound = { + browser: string; + client_ip: string; + created_at: string; + device: string; + icon: string; + id: number; + is_active: boolean; + location: string; + os: string; + seen_at: string; +}; + +/** @internal */ +export const UserAuthTokens$outboundSchema: z.ZodType< + UserAuthTokens$Outbound, + z.ZodTypeDef, + UserAuthTokens +> = z + .object({ + browser: z.string(), + clientIp: z.string(), + createdAt: z.string(), + device: z.string(), + icon: z.string(), + id: z.number().int(), + isActive: z.boolean(), + location: z.string(), + os: z.string(), + seenAt: z.string(), + }) + .transform((v) => { + return remap$(v, { + clientIp: "client_ip", + createdAt: "created_at", + isActive: "is_active", + seenAt: "seen_at", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UserAuthTokens$ { + /** @deprecated use `UserAuthTokens$inboundSchema` instead. */ + export const inboundSchema = UserAuthTokens$inboundSchema; + /** @deprecated use `UserAuthTokens$outboundSchema` instead. */ + export const outboundSchema = UserAuthTokens$outboundSchema; + /** @deprecated use `UserAuthTokens$Outbound` instead. */ + export type Outbound = UserAuthTokens$Outbound; +} + +/** @internal */ +export const UserFields$inboundSchema: z.ZodType = z + .object({ + "1": z.nullable(z.string()), + "2": z.nullable(z.string()), + }) + .transform((v) => { + return remap$(v, { + "1": "one", + "2": "two", + }); + }); + +/** @internal */ +export type UserFields$Outbound = { + "1": string | null; + "2": string | null; +}; + +/** @internal */ +export const UserFields$outboundSchema: z.ZodType = z + .object({ + one: z.nullable(z.string()), + two: z.nullable(z.string()), + }) + .transform((v) => { + return remap$(v, { + one: "1", + two: "2", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UserFields$ { + /** @deprecated use `UserFields$inboundSchema` instead. */ + export const inboundSchema = UserFields$inboundSchema; + /** @deprecated use `UserFields$outboundSchema` instead. */ + export const outboundSchema = UserFields$outboundSchema; + /** @deprecated use `UserFields$Outbound` instead. */ + export type Outbound = UserFields$Outbound; +} + +/** @internal */ +export const UserNotificationSchedule$inboundSchema: z.ZodType< + UserNotificationSchedule, + z.ZodTypeDef, + unknown +> = z + .object({ + day_0_end_time: z.number().int(), + day_0_start_time: z.number().int(), + day_1_end_time: z.number().int(), + day_1_start_time: z.number().int(), + day_2_end_time: z.number().int(), + day_2_start_time: z.number().int(), + day_3_end_time: z.number().int(), + day_3_start_time: z.number().int(), + day_4_end_time: z.number().int(), + day_4_start_time: z.number().int(), + day_5_end_time: z.number().int(), + day_5_start_time: z.number().int(), + day_6_end_time: z.number().int(), + day_6_start_time: z.number().int(), + enabled: z.boolean(), + }) + .transform((v) => { + return remap$(v, { + day_0_end_time: "day0EndTime", + day_0_start_time: "day0StartTime", + day_1_end_time: "day1EndTime", + day_1_start_time: "day1StartTime", + day_2_end_time: "day2EndTime", + day_2_start_time: "day2StartTime", + day_3_end_time: "day3EndTime", + day_3_start_time: "day3StartTime", + day_4_end_time: "day4EndTime", + day_4_start_time: "day4StartTime", + day_5_end_time: "day5EndTime", + day_5_start_time: "day5StartTime", + day_6_end_time: "day6EndTime", + day_6_start_time: "day6StartTime", + }); + }); + +/** @internal */ +export type UserNotificationSchedule$Outbound = { + day_0_end_time: number; + day_0_start_time: number; + day_1_end_time: number; + day_1_start_time: number; + day_2_end_time: number; + day_2_start_time: number; + day_3_end_time: number; + day_3_start_time: number; + day_4_end_time: number; + day_4_start_time: number; + day_5_end_time: number; + day_5_start_time: number; + day_6_end_time: number; + day_6_start_time: number; + enabled: boolean; +}; + +/** @internal */ +export const UserNotificationSchedule$outboundSchema: z.ZodType< + UserNotificationSchedule$Outbound, + z.ZodTypeDef, + UserNotificationSchedule +> = z + .object({ + day0EndTime: z.number().int(), + day0StartTime: z.number().int(), + day1EndTime: z.number().int(), + day1StartTime: z.number().int(), + day2EndTime: z.number().int(), + day2StartTime: z.number().int(), + day3EndTime: z.number().int(), + day3StartTime: z.number().int(), + day4EndTime: z.number().int(), + day4StartTime: z.number().int(), + day5EndTime: z.number().int(), + day5StartTime: z.number().int(), + day6EndTime: z.number().int(), + day6StartTime: z.number().int(), + enabled: z.boolean(), + }) + .transform((v) => { + return remap$(v, { + day0EndTime: "day_0_end_time", + day0StartTime: "day_0_start_time", + day1EndTime: "day_1_end_time", + day1StartTime: "day_1_start_time", + day2EndTime: "day_2_end_time", + day2StartTime: "day_2_start_time", + day3EndTime: "day_3_end_time", + day3StartTime: "day_3_start_time", + day4EndTime: "day_4_end_time", + day4StartTime: "day_4_start_time", + day5EndTime: "day_5_end_time", + day5StartTime: "day_5_start_time", + day6EndTime: "day_6_end_time", + day6StartTime: "day_6_start_time", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UserNotificationSchedule$ { + /** @deprecated use `UserNotificationSchedule$inboundSchema` instead. */ + export const inboundSchema = UserNotificationSchedule$inboundSchema; + /** @deprecated use `UserNotificationSchedule$outboundSchema` instead. */ + export const outboundSchema = UserNotificationSchedule$outboundSchema; + /** @deprecated use `UserNotificationSchedule$Outbound` instead. */ + export type Outbound = UserNotificationSchedule$Outbound; +} + +/** @internal */ +export const UserOption$inboundSchema: z.ZodType = z + .object({ + allow_private_messages: z.boolean(), + auto_track_topics_after_msecs: z.number().int(), + automatically_unpin_topics: z.boolean(), + bookmark_auto_delete_preference: z.number().int().optional(), + color_scheme_id: z.nullable(z.string()), + dark_scheme_id: z.nullable(z.string()), + default_calendar: z.string().optional(), + digest_after_minutes: z.number().int(), + dynamic_favicon: z.boolean(), + email_digests: z.boolean(), + email_in_reply_to: z.boolean(), + email_level: z.number().int(), + email_messages_level: z.number().int(), + email_previous_replies: z.number().int(), + enable_allowed_pm_users: z.boolean(), + enable_defer: z.boolean(), + enable_quoting: z.boolean(), + external_links_in_new_tab: z.boolean(), + hide_profile_and_presence: z.boolean(), + homepage_id: z.nullable(z.string()), + include_tl0_in_digests: z.boolean(), + like_notification_frequency: z.number().int(), + mailing_list_mode: z.boolean(), + mailing_list_mode_frequency: z.number().int(), + new_topic_duration_minutes: z.number().int(), + notification_level_when_replying: z.number().int(), + oldest_search_log_date: z.nullable(z.string()).optional(), + seen_popups: z.nullable(z.array(z.any())).optional(), + sidebar_link_to_filtered_list: z.boolean().optional(), + sidebar_show_count_of_new_items: z.boolean().optional(), + skip_new_user_tips: z.boolean(), + text_size: z.string(), + text_size_seq: z.number().int(), + theme_ids: z.array(z.any()), + theme_key_seq: z.number().int(), + timezone: z.nullable(z.string()), + title_count_mode: z.string(), + user_id: z.number().int(), + watched_precedence_over_muted: z.nullable(z.boolean()).optional(), + }) + .transform((v) => { + return remap$(v, { + allow_private_messages: "allowPrivateMessages", + auto_track_topics_after_msecs: "autoTrackTopicsAfterMsecs", + automatically_unpin_topics: "automaticallyUnpinTopics", + bookmark_auto_delete_preference: "bookmarkAutoDeletePreference", + color_scheme_id: "colorSchemeId", + dark_scheme_id: "darkSchemeId", + default_calendar: "defaultCalendar", + digest_after_minutes: "digestAfterMinutes", + dynamic_favicon: "dynamicFavicon", + email_digests: "emailDigests", + email_in_reply_to: "emailInReplyTo", + email_level: "emailLevel", + email_messages_level: "emailMessagesLevel", + email_previous_replies: "emailPreviousReplies", + enable_allowed_pm_users: "enableAllowedPmUsers", + enable_defer: "enableDefer", + enable_quoting: "enableQuoting", + external_links_in_new_tab: "externalLinksInNewTab", + hide_profile_and_presence: "hideProfileAndPresence", + homepage_id: "homepageId", + include_tl0_in_digests: "includeTl0InDigests", + like_notification_frequency: "likeNotificationFrequency", + mailing_list_mode: "mailingListMode", + mailing_list_mode_frequency: "mailingListModeFrequency", + new_topic_duration_minutes: "newTopicDurationMinutes", + notification_level_when_replying: "notificationLevelWhenReplying", + oldest_search_log_date: "oldestSearchLogDate", + seen_popups: "seenPopups", + sidebar_link_to_filtered_list: "sidebarLinkToFilteredList", + sidebar_show_count_of_new_items: "sidebarShowCountOfNewItems", + skip_new_user_tips: "skipNewUserTips", + text_size: "textSize", + text_size_seq: "textSizeSeq", + theme_ids: "themeIds", + theme_key_seq: "themeKeySeq", + title_count_mode: "titleCountMode", + user_id: "userId", + watched_precedence_over_muted: "watchedPrecedenceOverMuted", + }); + }); + +/** @internal */ +export type UserOption$Outbound = { + allow_private_messages: boolean; + auto_track_topics_after_msecs: number; + automatically_unpin_topics: boolean; + bookmark_auto_delete_preference?: number | undefined; + color_scheme_id: string | null; + dark_scheme_id: string | null; + default_calendar?: string | undefined; + digest_after_minutes: number; + dynamic_favicon: boolean; + email_digests: boolean; + email_in_reply_to: boolean; + email_level: number; + email_messages_level: number; + email_previous_replies: number; + enable_allowed_pm_users: boolean; + enable_defer: boolean; + enable_quoting: boolean; + external_links_in_new_tab: boolean; + hide_profile_and_presence: boolean; + homepage_id: string | null; + include_tl0_in_digests: boolean; + like_notification_frequency: number; + mailing_list_mode: boolean; + mailing_list_mode_frequency: number; + new_topic_duration_minutes: number; + notification_level_when_replying: number; + oldest_search_log_date?: string | null | undefined; + seen_popups?: Array | null | undefined; + sidebar_link_to_filtered_list?: boolean | undefined; + sidebar_show_count_of_new_items?: boolean | undefined; + skip_new_user_tips: boolean; + text_size: string; + text_size_seq: number; + theme_ids: Array; + theme_key_seq: number; + timezone: string | null; + title_count_mode: string; + user_id: number; + watched_precedence_over_muted?: boolean | null | undefined; +}; + +/** @internal */ +export const UserOption$outboundSchema: z.ZodType = z + .object({ + allowPrivateMessages: z.boolean(), + autoTrackTopicsAfterMsecs: z.number().int(), + automaticallyUnpinTopics: z.boolean(), + bookmarkAutoDeletePreference: z.number().int().optional(), + colorSchemeId: z.nullable(z.string()), + darkSchemeId: z.nullable(z.string()), + defaultCalendar: z.string().optional(), + digestAfterMinutes: z.number().int(), + dynamicFavicon: z.boolean(), + emailDigests: z.boolean(), + emailInReplyTo: z.boolean(), + emailLevel: z.number().int(), + emailMessagesLevel: z.number().int(), + emailPreviousReplies: z.number().int(), + enableAllowedPmUsers: z.boolean(), + enableDefer: z.boolean(), + enableQuoting: z.boolean(), + externalLinksInNewTab: z.boolean(), + hideProfileAndPresence: z.boolean(), + homepageId: z.nullable(z.string()), + includeTl0InDigests: z.boolean(), + likeNotificationFrequency: z.number().int(), + mailingListMode: z.boolean(), + mailingListModeFrequency: z.number().int(), + newTopicDurationMinutes: z.number().int(), + notificationLevelWhenReplying: z.number().int(), + oldestSearchLogDate: z.nullable(z.string()).optional(), + seenPopups: z.nullable(z.array(z.any())).optional(), + sidebarLinkToFilteredList: z.boolean().optional(), + sidebarShowCountOfNewItems: z.boolean().optional(), + skipNewUserTips: z.boolean(), + textSize: z.string(), + textSizeSeq: z.number().int(), + themeIds: z.array(z.any()), + themeKeySeq: z.number().int(), + timezone: z.nullable(z.string()), + titleCountMode: z.string(), + userId: z.number().int(), + watchedPrecedenceOverMuted: z.nullable(z.boolean()).optional(), + }) + .transform((v) => { + return remap$(v, { + allowPrivateMessages: "allow_private_messages", + autoTrackTopicsAfterMsecs: "auto_track_topics_after_msecs", + automaticallyUnpinTopics: "automatically_unpin_topics", + bookmarkAutoDeletePreference: "bookmark_auto_delete_preference", + colorSchemeId: "color_scheme_id", + darkSchemeId: "dark_scheme_id", + defaultCalendar: "default_calendar", + digestAfterMinutes: "digest_after_minutes", + dynamicFavicon: "dynamic_favicon", + emailDigests: "email_digests", + emailInReplyTo: "email_in_reply_to", + emailLevel: "email_level", + emailMessagesLevel: "email_messages_level", + emailPreviousReplies: "email_previous_replies", + enableAllowedPmUsers: "enable_allowed_pm_users", + enableDefer: "enable_defer", + enableQuoting: "enable_quoting", + externalLinksInNewTab: "external_links_in_new_tab", + hideProfileAndPresence: "hide_profile_and_presence", + homepageId: "homepage_id", + includeTl0InDigests: "include_tl0_in_digests", + likeNotificationFrequency: "like_notification_frequency", + mailingListMode: "mailing_list_mode", + mailingListModeFrequency: "mailing_list_mode_frequency", + newTopicDurationMinutes: "new_topic_duration_minutes", + notificationLevelWhenReplying: "notification_level_when_replying", + oldestSearchLogDate: "oldest_search_log_date", + seenPopups: "seen_popups", + sidebarLinkToFilteredList: "sidebar_link_to_filtered_list", + sidebarShowCountOfNewItems: "sidebar_show_count_of_new_items", + skipNewUserTips: "skip_new_user_tips", + textSize: "text_size", + textSizeSeq: "text_size_seq", + themeIds: "theme_ids", + themeKeySeq: "theme_key_seq", + titleCountMode: "title_count_mode", + userId: "user_id", + watchedPrecedenceOverMuted: "watched_precedence_over_muted", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UserOption$ { + /** @deprecated use `UserOption$inboundSchema` instead. */ + export const inboundSchema = UserOption$inboundSchema; + /** @deprecated use `UserOption$outboundSchema` instead. */ + export const outboundSchema = UserOption$outboundSchema; + /** @deprecated use `UserOption$Outbound` instead. */ + export type Outbound = UserOption$Outbound; +} + +/** @internal */ +export const User$inboundSchema: z.ZodType = z + .object({ + admin: z.boolean(), + allowed_pm_usernames: z.array(z.any()), + avatar_template: z.string(), + badge_count: z.number().int(), + can_be_deleted: z.boolean(), + can_change_bio: z.boolean(), + can_change_location: z.boolean(), + can_change_tracking_preferences: z.boolean(), + can_change_website: z.boolean(), + can_delete_all_posts: z.boolean(), + can_edit: z.boolean(), + can_edit_email: z.boolean(), + can_edit_name: z.boolean(), + can_edit_username: z.boolean(), + can_ignore_user: z.boolean(), + can_mute_user: z.boolean(), + can_send_private_message_to_user: z.boolean(), + can_send_private_messages: z.boolean(), + can_upload_profile_header: z.boolean(), + can_upload_user_card_background: z.boolean(), + created_at: z.string(), + custom_fields: z.lazy(() => GetUserCustomFields$inboundSchema), + display_sidebar_tags: z.boolean().optional(), + featured_topic: z.nullable(z.string()), + featured_user_badge_ids: z.array(z.any()), + flair_bg_color: z.nullable(z.string()), + flair_color: z.nullable(z.string()), + flair_group_id: z.nullable(z.string()), + flair_name: z.nullable(z.string()), + flair_url: z.nullable(z.string()), + group_users: z.array(z.lazy(() => GroupUsers$inboundSchema)), + groups: z.array(z.lazy(() => GetUserGroups$inboundSchema)), + has_title_badges: z.boolean(), + id: z.number().int(), + ignored: z.boolean(), + ignored_usernames: z.array(z.any()), + invited_by: z.nullable(z.string()), + last_posted_at: z.nullable(z.string()), + last_seen_at: z.nullable(z.string()), + locale: z.nullable(z.string()), + mailing_list_posts_per_day: z.number().int(), + moderator: z.boolean(), + muted: z.boolean(), + muted_category_ids: z.array(z.any()), + muted_tags: z.array(z.any()), + muted_usernames: z.array(z.any()), + name: z.string(), + pending_count: z.number().int(), + pending_posts_count: z.number().int().optional(), + post_count: z.number().int(), + primary_group_id: z.nullable(z.string()), + primary_group_name: z.nullable(z.string()), + profile_view_count: z.number().int(), + recent_time_read: z.number().int(), + regular_category_ids: z.array(z.any()), + second_factor_backup_enabled: z.boolean().optional(), + second_factor_enabled: z.boolean(), + sidebar_category_ids: z.array(z.any()).optional(), + sidebar_tags: z.array(z.any()).optional(), + staged: z.boolean(), + system_avatar_template: z.string(), + system_avatar_upload_id: z.nullable(z.string()), + time_read: z.number().int(), + title: z.nullable(z.string()), + tracked_category_ids: z.array(z.any()), + tracked_tags: z.array(z.any()), + trust_level: z.number().int(), + uploaded_avatar_id: z.nullable(z.string()), + use_logo_small_as_avatar: z.boolean(), + user_api_keys: z.nullable(z.string()), + user_auth_tokens: z.array(z.lazy(() => UserAuthTokens$inboundSchema)), + user_fields: z.lazy(() => UserFields$inboundSchema).optional(), + user_notification_schedule: z.lazy(() => UserNotificationSchedule$inboundSchema), + user_option: z.lazy(() => UserOption$inboundSchema), + username: z.string(), + watched_category_ids: z.array(z.any()), + watched_first_post_category_ids: z.array(z.any()), + watched_tags: z.array(z.any()), + watching_first_post_tags: z.array(z.any()), + }) + .transform((v) => { + return remap$(v, { + allowed_pm_usernames: "allowedPmUsernames", + avatar_template: "avatarTemplate", + badge_count: "badgeCount", + can_be_deleted: "canBeDeleted", + can_change_bio: "canChangeBio", + can_change_location: "canChangeLocation", + can_change_tracking_preferences: "canChangeTrackingPreferences", + can_change_website: "canChangeWebsite", + can_delete_all_posts: "canDeleteAllPosts", + can_edit: "canEdit", + can_edit_email: "canEditEmail", + can_edit_name: "canEditName", + can_edit_username: "canEditUsername", + can_ignore_user: "canIgnoreUser", + can_mute_user: "canMuteUser", + can_send_private_message_to_user: "canSendPrivateMessageToUser", + can_send_private_messages: "canSendPrivateMessages", + can_upload_profile_header: "canUploadProfileHeader", + can_upload_user_card_background: "canUploadUserCardBackground", + created_at: "createdAt", + custom_fields: "customFields", + display_sidebar_tags: "displaySidebarTags", + featured_topic: "featuredTopic", + featured_user_badge_ids: "featuredUserBadgeIds", + flair_bg_color: "flairBgColor", + flair_color: "flairColor", + flair_group_id: "flairGroupId", + flair_name: "flairName", + flair_url: "flairUrl", + group_users: "groupUsers", + has_title_badges: "hasTitleBadges", + ignored_usernames: "ignoredUsernames", + invited_by: "invitedBy", + last_posted_at: "lastPostedAt", + last_seen_at: "lastSeenAt", + mailing_list_posts_per_day: "mailingListPostsPerDay", + muted_category_ids: "mutedCategoryIds", + muted_tags: "mutedTags", + muted_usernames: "mutedUsernames", + pending_count: "pendingCount", + pending_posts_count: "pendingPostsCount", + post_count: "postCount", + primary_group_id: "primaryGroupId", + primary_group_name: "primaryGroupName", + profile_view_count: "profileViewCount", + recent_time_read: "recentTimeRead", + regular_category_ids: "regularCategoryIds", + second_factor_backup_enabled: "secondFactorBackupEnabled", + second_factor_enabled: "secondFactorEnabled", + sidebar_category_ids: "sidebarCategoryIds", + sidebar_tags: "sidebarTags", + system_avatar_template: "systemAvatarTemplate", + system_avatar_upload_id: "systemAvatarUploadId", + time_read: "timeRead", + tracked_category_ids: "trackedCategoryIds", + tracked_tags: "trackedTags", + trust_level: "trustLevel", + uploaded_avatar_id: "uploadedAvatarId", + use_logo_small_as_avatar: "useLogoSmallAsAvatar", + user_api_keys: "userApiKeys", + user_auth_tokens: "userAuthTokens", + user_fields: "userFields", + user_notification_schedule: "userNotificationSchedule", + user_option: "userOption", + watched_category_ids: "watchedCategoryIds", + watched_first_post_category_ids: "watchedFirstPostCategoryIds", + watched_tags: "watchedTags", + watching_first_post_tags: "watchingFirstPostTags", + }); + }); + +/** @internal */ +export type User$Outbound = { + admin: boolean; + allowed_pm_usernames: Array; + avatar_template: string; + badge_count: number; + can_be_deleted: boolean; + can_change_bio: boolean; + can_change_location: boolean; + can_change_tracking_preferences: boolean; + can_change_website: boolean; + can_delete_all_posts: boolean; + can_edit: boolean; + can_edit_email: boolean; + can_edit_name: boolean; + can_edit_username: boolean; + can_ignore_user: boolean; + can_mute_user: boolean; + can_send_private_message_to_user: boolean; + can_send_private_messages: boolean; + can_upload_profile_header: boolean; + can_upload_user_card_background: boolean; + created_at: string; + custom_fields: GetUserCustomFields$Outbound; + display_sidebar_tags?: boolean | undefined; + featured_topic: string | null; + featured_user_badge_ids: Array; + flair_bg_color: string | null; + flair_color: string | null; + flair_group_id: string | null; + flair_name: string | null; + flair_url: string | null; + group_users: Array; + groups: Array; + has_title_badges: boolean; + id: number; + ignored: boolean; + ignored_usernames: Array; + invited_by: string | null; + last_posted_at: string | null; + last_seen_at: string | null; + locale: string | null; + mailing_list_posts_per_day: number; + moderator: boolean; + muted: boolean; + muted_category_ids: Array; + muted_tags: Array; + muted_usernames: Array; + name: string; + pending_count: number; + pending_posts_count?: number | undefined; + post_count: number; + primary_group_id: string | null; + primary_group_name: string | null; + profile_view_count: number; + recent_time_read: number; + regular_category_ids: Array; + second_factor_backup_enabled?: boolean | undefined; + second_factor_enabled: boolean; + sidebar_category_ids?: Array | undefined; + sidebar_tags?: Array | undefined; + staged: boolean; + system_avatar_template: string; + system_avatar_upload_id: string | null; + time_read: number; + title: string | null; + tracked_category_ids: Array; + tracked_tags: Array; + trust_level: number; + uploaded_avatar_id: string | null; + use_logo_small_as_avatar: boolean; + user_api_keys: string | null; + user_auth_tokens: Array; + user_fields?: UserFields$Outbound | undefined; + user_notification_schedule: UserNotificationSchedule$Outbound; + user_option: UserOption$Outbound; + username: string; + watched_category_ids: Array; + watched_first_post_category_ids: Array; + watched_tags: Array; + watching_first_post_tags: Array; +}; + +/** @internal */ +export const User$outboundSchema: z.ZodType = z + .object({ + admin: z.boolean(), + allowedPmUsernames: z.array(z.any()), + avatarTemplate: z.string(), + badgeCount: z.number().int(), + canBeDeleted: z.boolean(), + canChangeBio: z.boolean(), + canChangeLocation: z.boolean(), + canChangeTrackingPreferences: z.boolean(), + canChangeWebsite: z.boolean(), + canDeleteAllPosts: z.boolean(), + canEdit: z.boolean(), + canEditEmail: z.boolean(), + canEditName: z.boolean(), + canEditUsername: z.boolean(), + canIgnoreUser: z.boolean(), + canMuteUser: z.boolean(), + canSendPrivateMessageToUser: z.boolean(), + canSendPrivateMessages: z.boolean(), + canUploadProfileHeader: z.boolean(), + canUploadUserCardBackground: z.boolean(), + createdAt: z.string(), + customFields: z.lazy(() => GetUserCustomFields$outboundSchema), + displaySidebarTags: z.boolean().optional(), + featuredTopic: z.nullable(z.string()), + featuredUserBadgeIds: z.array(z.any()), + flairBgColor: z.nullable(z.string()), + flairColor: z.nullable(z.string()), + flairGroupId: z.nullable(z.string()), + flairName: z.nullable(z.string()), + flairUrl: z.nullable(z.string()), + groupUsers: z.array(z.lazy(() => GroupUsers$outboundSchema)), + groups: z.array(z.lazy(() => GetUserGroups$outboundSchema)), + hasTitleBadges: z.boolean(), + id: z.number().int(), + ignored: z.boolean(), + ignoredUsernames: z.array(z.any()), + invitedBy: z.nullable(z.string()), + lastPostedAt: z.nullable(z.string()), + lastSeenAt: z.nullable(z.string()), + locale: z.nullable(z.string()), + mailingListPostsPerDay: z.number().int(), + moderator: z.boolean(), + muted: z.boolean(), + mutedCategoryIds: z.array(z.any()), + mutedTags: z.array(z.any()), + mutedUsernames: z.array(z.any()), + name: z.string(), + pendingCount: z.number().int(), + pendingPostsCount: z.number().int().optional(), + postCount: z.number().int(), + primaryGroupId: z.nullable(z.string()), + primaryGroupName: z.nullable(z.string()), + profileViewCount: z.number().int(), + recentTimeRead: z.number().int(), + regularCategoryIds: z.array(z.any()), + secondFactorBackupEnabled: z.boolean().optional(), + secondFactorEnabled: z.boolean(), + sidebarCategoryIds: z.array(z.any()).optional(), + sidebarTags: z.array(z.any()).optional(), + staged: z.boolean(), + systemAvatarTemplate: z.string(), + systemAvatarUploadId: z.nullable(z.string()), + timeRead: z.number().int(), + title: z.nullable(z.string()), + trackedCategoryIds: z.array(z.any()), + trackedTags: z.array(z.any()), + trustLevel: z.number().int(), + uploadedAvatarId: z.nullable(z.string()), + useLogoSmallAsAvatar: z.boolean(), + userApiKeys: z.nullable(z.string()), + userAuthTokens: z.array(z.lazy(() => UserAuthTokens$outboundSchema)), + userFields: z.lazy(() => UserFields$outboundSchema).optional(), + userNotificationSchedule: z.lazy(() => UserNotificationSchedule$outboundSchema), + userOption: z.lazy(() => UserOption$outboundSchema), + username: z.string(), + watchedCategoryIds: z.array(z.any()), + watchedFirstPostCategoryIds: z.array(z.any()), + watchedTags: z.array(z.any()), + watchingFirstPostTags: z.array(z.any()), + }) + .transform((v) => { + return remap$(v, { + allowedPmUsernames: "allowed_pm_usernames", + avatarTemplate: "avatar_template", + badgeCount: "badge_count", + canBeDeleted: "can_be_deleted", + canChangeBio: "can_change_bio", + canChangeLocation: "can_change_location", + canChangeTrackingPreferences: "can_change_tracking_preferences", + canChangeWebsite: "can_change_website", + canDeleteAllPosts: "can_delete_all_posts", + canEdit: "can_edit", + canEditEmail: "can_edit_email", + canEditName: "can_edit_name", + canEditUsername: "can_edit_username", + canIgnoreUser: "can_ignore_user", + canMuteUser: "can_mute_user", + canSendPrivateMessageToUser: "can_send_private_message_to_user", + canSendPrivateMessages: "can_send_private_messages", + canUploadProfileHeader: "can_upload_profile_header", + canUploadUserCardBackground: "can_upload_user_card_background", + createdAt: "created_at", + customFields: "custom_fields", + displaySidebarTags: "display_sidebar_tags", + featuredTopic: "featured_topic", + featuredUserBadgeIds: "featured_user_badge_ids", + flairBgColor: "flair_bg_color", + flairColor: "flair_color", + flairGroupId: "flair_group_id", + flairName: "flair_name", + flairUrl: "flair_url", + groupUsers: "group_users", + hasTitleBadges: "has_title_badges", + ignoredUsernames: "ignored_usernames", + invitedBy: "invited_by", + lastPostedAt: "last_posted_at", + lastSeenAt: "last_seen_at", + mailingListPostsPerDay: "mailing_list_posts_per_day", + mutedCategoryIds: "muted_category_ids", + mutedTags: "muted_tags", + mutedUsernames: "muted_usernames", + pendingCount: "pending_count", + pendingPostsCount: "pending_posts_count", + postCount: "post_count", + primaryGroupId: "primary_group_id", + primaryGroupName: "primary_group_name", + profileViewCount: "profile_view_count", + recentTimeRead: "recent_time_read", + regularCategoryIds: "regular_category_ids", + secondFactorBackupEnabled: "second_factor_backup_enabled", + secondFactorEnabled: "second_factor_enabled", + sidebarCategoryIds: "sidebar_category_ids", + sidebarTags: "sidebar_tags", + systemAvatarTemplate: "system_avatar_template", + systemAvatarUploadId: "system_avatar_upload_id", + timeRead: "time_read", + trackedCategoryIds: "tracked_category_ids", + trackedTags: "tracked_tags", + trustLevel: "trust_level", + uploadedAvatarId: "uploaded_avatar_id", + useLogoSmallAsAvatar: "use_logo_small_as_avatar", + userApiKeys: "user_api_keys", + userAuthTokens: "user_auth_tokens", + userFields: "user_fields", + userNotificationSchedule: "user_notification_schedule", + userOption: "user_option", + watchedCategoryIds: "watched_category_ids", + watchedFirstPostCategoryIds: "watched_first_post_category_ids", + watchedTags: "watched_tags", + watchingFirstPostTags: "watching_first_post_tags", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace User$ { + /** @deprecated use `User$inboundSchema` instead. */ + export const inboundSchema = User$inboundSchema; + /** @deprecated use `User$outboundSchema` instead. */ + export const outboundSchema = User$outboundSchema; + /** @deprecated use `User$Outbound` instead. */ + export type Outbound = User$Outbound; +} + +/** @internal */ +export const GetUserResponseBody$inboundSchema: z.ZodType< + GetUserResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + user: z.lazy(() => User$inboundSchema), + user_badges: z.array(z.any()), + }) + .transform((v) => { + return remap$(v, { + user_badges: "userBadges", + }); + }); + +/** @internal */ +export type GetUserResponseBody$Outbound = { + user: User$Outbound; + user_badges: Array; +}; + +/** @internal */ +export const GetUserResponseBody$outboundSchema: z.ZodType< + GetUserResponseBody$Outbound, + z.ZodTypeDef, + GetUserResponseBody +> = z + .object({ + user: z.lazy(() => User$outboundSchema), + userBadges: z.array(z.any()), + }) + .transform((v) => { + return remap$(v, { + userBadges: "user_badges", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserResponseBody$ { + /** @deprecated use `GetUserResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetUserResponseBody$inboundSchema; + /** @deprecated use `GetUserResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetUserResponseBody$outboundSchema; + /** @deprecated use `GetUserResponseBody$Outbound` instead. */ + export type Outbound = GetUserResponseBody$Outbound; } diff --git a/src/sdk/models/operations/getuseremails.ts b/src/sdk/models/operations/getuseremails.ts index 410936d..1da1965 100644 --- a/src/sdk/models/operations/getuseremails.ts +++ b/src/sdk/models/operations/getuseremails.ts @@ -1,59 +1,117 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class GetUserEmailsRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=username" }) +export type GetUserEmailsRequest = { username: string; -} +}; /** * success response */ -export class GetUserEmailsResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "associated_accounts" }) - associatedAccounts: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "email" }) +export type GetUserEmailsResponseBody = { + associatedAccounts: Array; email: string; + secondaryEmails: Array; + unconfirmedEmails: Array; +}; - @SpeakeasyMetadata() - @Expose({ name: "secondary_emails" }) - secondaryEmails: any[]; +/** @internal */ +export const GetUserEmailsRequest$inboundSchema: z.ZodType< + GetUserEmailsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + username: z.string(), +}); - @SpeakeasyMetadata() - @Expose({ name: "unconfirmed_emails" }) - unconfirmedEmails: any[]; +/** @internal */ +export type GetUserEmailsRequest$Outbound = { + username: string; +}; + +/** @internal */ +export const GetUserEmailsRequest$outboundSchema: z.ZodType< + GetUserEmailsRequest$Outbound, + z.ZodTypeDef, + GetUserEmailsRequest +> = z.object({ + username: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserEmailsRequest$ { + /** @deprecated use `GetUserEmailsRequest$inboundSchema` instead. */ + export const inboundSchema = GetUserEmailsRequest$inboundSchema; + /** @deprecated use `GetUserEmailsRequest$outboundSchema` instead. */ + export const outboundSchema = GetUserEmailsRequest$outboundSchema; + /** @deprecated use `GetUserEmailsRequest$Outbound` instead. */ + export type Outbound = GetUserEmailsRequest$Outbound; } -export class GetUserEmailsResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const GetUserEmailsResponseBody$inboundSchema: z.ZodType< + GetUserEmailsResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + associated_accounts: z.array(z.any()), + email: z.string(), + secondary_emails: z.array(z.any()), + unconfirmed_emails: z.array(z.any()), + }) + .transform((v) => { + return remap$(v, { + associated_accounts: "associatedAccounts", + secondary_emails: "secondaryEmails", + unconfirmed_emails: "unconfirmedEmails", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type GetUserEmailsResponseBody$Outbound = { + associated_accounts: Array; + email: string; + secondary_emails: Array; + unconfirmed_emails: Array; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const GetUserEmailsResponseBody$outboundSchema: z.ZodType< + GetUserEmailsResponseBody$Outbound, + z.ZodTypeDef, + GetUserEmailsResponseBody +> = z + .object({ + associatedAccounts: z.array(z.any()), + email: z.string(), + secondaryEmails: z.array(z.any()), + unconfirmedEmails: z.array(z.any()), + }) + .transform((v) => { + return remap$(v, { + associatedAccounts: "associated_accounts", + secondaryEmails: "secondary_emails", + unconfirmedEmails: "unconfirmed_emails", + }); + }); - /** - * success response - */ - @SpeakeasyMetadata() - object?: GetUserEmailsResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserEmailsResponseBody$ { + /** @deprecated use `GetUserEmailsResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetUserEmailsResponseBody$inboundSchema; + /** @deprecated use `GetUserEmailsResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetUserEmailsResponseBody$outboundSchema; + /** @deprecated use `GetUserEmailsResponseBody$Outbound` instead. */ + export type Outbound = GetUserEmailsResponseBody$Outbound; } diff --git a/src/sdk/models/operations/getuserexternalid.ts b/src/sdk/models/operations/getuserexternalid.ts index d44a7f7..b9bddbb 100644 --- a/src/sdk/models/operations/getuserexternalid.ts +++ b/src/sdk/models/operations/getuserexternalid.ts @@ -1,797 +1,1527 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class GetUserExternalIdRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Key" }) +export type GetUserExternalIdRequest = { apiKey: string; - - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Username" }) apiUsername: string; - - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=external_id" }) externalId: string; -} +}; -export class GetUserExternalIdCustomFields extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "first_name" }) - firstName?: string; -} +export type GetUserExternalIdCustomFields = { + firstName?: string | null | undefined; +}; -export class GetUserExternalIdGroupUsers extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "group_id" }) +export type GetUserExternalIdGroupUsers = { groupId: number; - - @SpeakeasyMetadata() - @Expose({ name: "notification_level" }) notificationLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "owner" }) - owner?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "user_id" }) + owner?: boolean | undefined; userId: number; -} +}; -export class GetUserExternalIdGroups extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "allow_membership_requests" }) +export type GetUserExternalIdGroups = { allowMembershipRequests: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "automatic" }) automatic: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "bio_cooked" }) - bioCooked: string; - - @SpeakeasyMetadata() - @Expose({ name: "bio_excerpt" }) - bioExcerpt: string; - - @SpeakeasyMetadata() - @Expose({ name: "bio_raw" }) - bioRaw: string; - - @SpeakeasyMetadata() - @Expose({ name: "can_admin_group" }) + bioCooked: string | null; + bioExcerpt: string | null; + bioRaw: string | null; canAdminGroup: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_see_members" }) canSeeMembers: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "default_notification_level" }) defaultNotificationLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "display_name" }) displayName: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_bg_color" }) - flairBgColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_color" }) - flairColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_url" }) - flairUrl: string; - - @SpeakeasyMetadata() - @Expose({ name: "full_name" }) - fullName: string; - - @SpeakeasyMetadata() - @Expose({ name: "grant_trust_level" }) - grantTrustLevel: string; - - @SpeakeasyMetadata() - @Expose({ name: "has_messages" }) + flairBgColor: string | null; + flairColor: string | null; + flairUrl: string | null; + fullName: string | null; + grantTrustLevel: string | null; hasMessages: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "incoming_email" }) - incomingEmail: string; - - @SpeakeasyMetadata() - @Expose({ name: "members_visibility_level" }) + incomingEmail: string | null; membersVisibilityLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "membership_request_template" }) - membershipRequestTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "mentionable_level" }) + membershipRequestTemplate: string | null; mentionableLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "messageable_level" }) messageableLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "primary_group" }) primaryGroup: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "public_admission" }) publicAdmission: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "public_exit" }) publicExit: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "publish_read_state" }) publishReadState: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "title" }) - title: string; - - @SpeakeasyMetadata() - @Expose({ name: "user_count" }) + title: string | null; userCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "visibility_level" }) visibilityLevel: number; -} +}; -export class GetUserExternalIdUserAuthTokens extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "browser" }) +export type GetUserExternalIdUserAuthTokens = { browser: string; - - @SpeakeasyMetadata() - @Expose({ name: "client_ip" }) clientIp: string; - - @SpeakeasyMetadata() - @Expose({ name: "created_at" }) createdAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "device" }) device: string; - - @SpeakeasyMetadata() - @Expose({ name: "icon" }) icon: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "is_active" }) isActive: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "location" }) location: string; - - @SpeakeasyMetadata() - @Expose({ name: "os" }) os: string; - - @SpeakeasyMetadata() - @Expose({ name: "seen_at" }) seenAt: string; -} +}; -export class GetUserExternalIdUserFields extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "1" }) - one: string; +export type GetUserExternalIdUserFields = { + one: string | null; + two: string | null; +}; - @SpeakeasyMetadata() - @Expose({ name: "2" }) - two: string; -} - -export class GetUserExternalIdUserNotificationSchedule extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "day_0_end_time" }) +export type GetUserExternalIdUserNotificationSchedule = { day0EndTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_0_start_time" }) day0StartTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_1_end_time" }) day1EndTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_1_start_time" }) day1StartTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_2_end_time" }) day2EndTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_2_start_time" }) day2StartTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_3_end_time" }) day3EndTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_3_start_time" }) day3StartTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_4_end_time" }) day4EndTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_4_start_time" }) day4StartTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_5_end_time" }) day5EndTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_5_start_time" }) day5StartTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_6_end_time" }) day6EndTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_6_start_time" }) day6StartTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "enabled" }) enabled: boolean; -} +}; -export class GetUserExternalIdUserOption extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "allow_private_messages" }) +export type GetUserExternalIdUserOption = { allowPrivateMessages: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "auto_track_topics_after_msecs" }) autoTrackTopicsAfterMsecs: number; - - @SpeakeasyMetadata() - @Expose({ name: "automatically_unpin_topics" }) automaticallyUnpinTopics: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "bookmark_auto_delete_preference" }) - bookmarkAutoDeletePreference?: number; - - @SpeakeasyMetadata() - @Expose({ name: "color_scheme_id" }) - colorSchemeId: string; - - @SpeakeasyMetadata() - @Expose({ name: "dark_scheme_id" }) - darkSchemeId: string; - - @SpeakeasyMetadata() - @Expose({ name: "default_calendar" }) - defaultCalendar?: string; - - @SpeakeasyMetadata() - @Expose({ name: "digest_after_minutes" }) + bookmarkAutoDeletePreference?: number | undefined; + colorSchemeId: string | null; + darkSchemeId: string | null; + defaultCalendar?: string | undefined; digestAfterMinutes: number; - - @SpeakeasyMetadata() - @Expose({ name: "dynamic_favicon" }) dynamicFavicon: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "email_digests" }) emailDigests: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "email_in_reply_to" }) emailInReplyTo: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "email_level" }) emailLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "email_messages_level" }) emailMessagesLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "email_previous_replies" }) emailPreviousReplies: number; - - @SpeakeasyMetadata() - @Expose({ name: "enable_allowed_pm_users" }) enableAllowedPmUsers: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "enable_defer" }) enableDefer: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "enable_quoting" }) enableQuoting: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "external_links_in_new_tab" }) externalLinksInNewTab: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "hide_profile_and_presence" }) hideProfileAndPresence: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "homepage_id" }) - homepageId: string; - - @SpeakeasyMetadata() - @Expose({ name: "include_tl0_in_digests" }) + homepageId: string | null; includeTl0InDigests: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "like_notification_frequency" }) likeNotificationFrequency: number; - - @SpeakeasyMetadata() - @Expose({ name: "mailing_list_mode" }) mailingListMode: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "mailing_list_mode_frequency" }) mailingListModeFrequency: number; - - @SpeakeasyMetadata() - @Expose({ name: "new_topic_duration_minutes" }) newTopicDurationMinutes: number; - - @SpeakeasyMetadata() - @Expose({ name: "notification_level_when_replying" }) notificationLevelWhenReplying: number; - - @SpeakeasyMetadata() - @Expose({ name: "oldest_search_log_date" }) - oldestSearchLogDate?: string; - - @SpeakeasyMetadata() - @Expose({ name: "seen_popups" }) - seenPopups?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "sidebar_link_to_filtered_list" }) - sidebarLinkToFilteredList?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "sidebar_show_count_of_new_items" }) - sidebarShowCountOfNewItems?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "skip_new_user_tips" }) + oldestSearchLogDate?: string | null | undefined; + seenPopups?: Array | null | undefined; + sidebarLinkToFilteredList?: boolean | undefined; + sidebarShowCountOfNewItems?: boolean | undefined; skipNewUserTips: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "text_size" }) textSize: string; - - @SpeakeasyMetadata() - @Expose({ name: "text_size_seq" }) textSizeSeq: number; - - @SpeakeasyMetadata() - @Expose({ name: "theme_ids" }) - themeIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "theme_key_seq" }) + themeIds: Array; themeKeySeq: number; - - @SpeakeasyMetadata() - @Expose({ name: "timezone" }) - timezone: string; - - @SpeakeasyMetadata() - @Expose({ name: "title_count_mode" }) + timezone: string | null; titleCountMode: string; - - @SpeakeasyMetadata() - @Expose({ name: "user_id" }) userId: number; + watchedPrecedenceOverMuted?: boolean | null | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "watched_precedence_over_muted" }) - watchedPrecedenceOverMuted?: boolean; -} - -export class GetUserExternalIdUser extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "admin" }) +export type GetUserExternalIdUser = { admin: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "allowed_pm_usernames" }) - allowedPmUsernames: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "avatar_template" }) + allowedPmUsernames: Array; avatarTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "badge_count" }) badgeCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "can_be_deleted" }) canBeDeleted: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_change_bio" }) canChangeBio: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_change_location" }) canChangeLocation: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_change_tracking_preferences" }) canChangeTrackingPreferences: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_change_website" }) canChangeWebsite: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_delete_all_posts" }) canDeleteAllPosts: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_edit" }) canEdit: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_edit_email" }) canEditEmail: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_edit_name" }) canEditName: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_edit_username" }) canEditUsername: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_ignore_user" }) canIgnoreUser: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_mute_user" }) canMuteUser: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_send_private_message_to_user" }) canSendPrivateMessageToUser: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_send_private_messages" }) canSendPrivateMessages: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_upload_profile_header" }) canUploadProfileHeader: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_upload_user_card_background" }) canUploadUserCardBackground: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "created_at" }) createdAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "custom_fields" }) - @Type(() => GetUserExternalIdCustomFields) customFields: GetUserExternalIdCustomFields; - - @SpeakeasyMetadata() - @Expose({ name: "display_sidebar_tags" }) - displaySidebarTags?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "featured_topic" }) - featuredTopic: string; - - @SpeakeasyMetadata() - @Expose({ name: "featured_user_badge_ids" }) - featuredUserBadgeIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "flair_bg_color" }) - flairBgColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_color" }) - flairColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_group_id" }) - flairGroupId: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_name" }) - flairName: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_url" }) - flairUrl: string; - - @SpeakeasyMetadata({ elemType: GetUserExternalIdGroupUsers }) - @Expose({ name: "group_users" }) - @Type(() => GetUserExternalIdGroupUsers) - groupUsers: GetUserExternalIdGroupUsers[]; - - @SpeakeasyMetadata({ elemType: GetUserExternalIdGroups }) - @Expose({ name: "groups" }) - @Type(() => GetUserExternalIdGroups) - groups: GetUserExternalIdGroups[]; - - @SpeakeasyMetadata() - @Expose({ name: "has_title_badges" }) + displaySidebarTags?: boolean | undefined; + featuredTopic: string | null; + featuredUserBadgeIds: Array; + flairBgColor: string | null; + flairColor: string | null; + flairGroupId: string | null; + flairName: string | null; + flairUrl: string | null; + groupUsers: Array; + groups: Array; hasTitleBadges: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "ignored" }) ignored: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "ignored_usernames" }) - ignoredUsernames: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "invited_by" }) - invitedBy: string; - - @SpeakeasyMetadata() - @Expose({ name: "last_posted_at" }) - lastPostedAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "last_seen_at" }) - lastSeenAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "locale" }) - locale: string; - - @SpeakeasyMetadata() - @Expose({ name: "mailing_list_posts_per_day" }) + ignoredUsernames: Array; + invitedBy: string | null; + lastPostedAt: string | null; + lastSeenAt: string | null; + locale: string | null; mailingListPostsPerDay: number; - - @SpeakeasyMetadata() - @Expose({ name: "moderator" }) moderator: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "muted" }) muted: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "muted_category_ids" }) - mutedCategoryIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "muted_tags" }) - mutedTags: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "muted_usernames" }) - mutedUsernames: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) + mutedCategoryIds: Array; + mutedTags: Array; + mutedUsernames: Array; name: string; - - @SpeakeasyMetadata() - @Expose({ name: "pending_count" }) pendingCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "pending_posts_count" }) - pendingPostsCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "post_count" }) + pendingPostsCount?: number | undefined; postCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "primary_group_id" }) - primaryGroupId: string; - - @SpeakeasyMetadata() - @Expose({ name: "primary_group_name" }) - primaryGroupName: string; - - @SpeakeasyMetadata() - @Expose({ name: "profile_view_count" }) + primaryGroupId: string | null; + primaryGroupName: string | null; profileViewCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "recent_time_read" }) recentTimeRead: number; - - @SpeakeasyMetadata() - @Expose({ name: "regular_category_ids" }) - regularCategoryIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "second_factor_backup_enabled" }) - secondFactorBackupEnabled?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "second_factor_enabled" }) + regularCategoryIds: Array; + secondFactorBackupEnabled?: boolean | undefined; secondFactorEnabled: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "sidebar_category_ids" }) - sidebarCategoryIds?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "sidebar_tags" }) - sidebarTags?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "staged" }) + sidebarCategoryIds?: Array | undefined; + sidebarTags?: Array | undefined; staged: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "system_avatar_template" }) systemAvatarTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "system_avatar_upload_id" }) - systemAvatarUploadId: string; - - @SpeakeasyMetadata() - @Expose({ name: "time_read" }) + systemAvatarUploadId: string | null; timeRead: number; - - @SpeakeasyMetadata() - @Expose({ name: "title" }) - title: string; - - @SpeakeasyMetadata() - @Expose({ name: "tracked_category_ids" }) - trackedCategoryIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "tracked_tags" }) - trackedTags: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "trust_level" }) + title: string | null; + trackedCategoryIds: Array; + trackedTags: Array; trustLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "uploaded_avatar_id" }) - uploadedAvatarId: string; - - @SpeakeasyMetadata() - @Expose({ name: "use_logo_small_as_avatar" }) + uploadedAvatarId: string | null; useLogoSmallAsAvatar: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "user_api_keys" }) - userApiKeys: string; - - @SpeakeasyMetadata({ elemType: GetUserExternalIdUserAuthTokens }) - @Expose({ name: "user_auth_tokens" }) - @Type(() => GetUserExternalIdUserAuthTokens) - userAuthTokens: GetUserExternalIdUserAuthTokens[]; - - @SpeakeasyMetadata() - @Expose({ name: "user_fields" }) - @Type(() => GetUserExternalIdUserFields) - userFields?: GetUserExternalIdUserFields; - - @SpeakeasyMetadata() - @Expose({ name: "user_notification_schedule" }) - @Type(() => GetUserExternalIdUserNotificationSchedule) + userApiKeys: string | null; + userAuthTokens: Array; + userFields?: GetUserExternalIdUserFields | undefined; userNotificationSchedule: GetUserExternalIdUserNotificationSchedule; - - @SpeakeasyMetadata() - @Expose({ name: "user_option" }) - @Type(() => GetUserExternalIdUserOption) userOption: GetUserExternalIdUserOption; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) username: string; - - @SpeakeasyMetadata() - @Expose({ name: "watched_category_ids" }) - watchedCategoryIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "watched_first_post_category_ids" }) - watchedFirstPostCategoryIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "watched_tags" }) - watchedTags: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "watching_first_post_tags" }) - watchingFirstPostTags: any[]; -} + watchedCategoryIds: Array; + watchedFirstPostCategoryIds: Array; + watchedTags: Array; + watchingFirstPostTags: Array; +}; /** * user response */ -export class GetUserExternalIdResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "user" }) - @Type(() => GetUserExternalIdUser) +export type GetUserExternalIdResponseBody = { user: GetUserExternalIdUser; + userBadges: Array; +}; - @SpeakeasyMetadata() - @Expose({ name: "user_badges" }) - userBadges: any[]; +/** @internal */ +export const GetUserExternalIdRequest$inboundSchema: z.ZodType< + GetUserExternalIdRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + "Api-Key": z.string(), + "Api-Username": z.string(), + external_id: z.string(), + }) + .transform((v) => { + return remap$(v, { + "Api-Key": "apiKey", + "Api-Username": "apiUsername", + external_id: "externalId", + }); + }); + +/** @internal */ +export type GetUserExternalIdRequest$Outbound = { + "Api-Key": string; + "Api-Username": string; + external_id: string; +}; + +/** @internal */ +export const GetUserExternalIdRequest$outboundSchema: z.ZodType< + GetUserExternalIdRequest$Outbound, + z.ZodTypeDef, + GetUserExternalIdRequest +> = z + .object({ + apiKey: z.string(), + apiUsername: z.string(), + externalId: z.string(), + }) + .transform((v) => { + return remap$(v, { + apiKey: "Api-Key", + apiUsername: "Api-Username", + externalId: "external_id", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserExternalIdRequest$ { + /** @deprecated use `GetUserExternalIdRequest$inboundSchema` instead. */ + export const inboundSchema = GetUserExternalIdRequest$inboundSchema; + /** @deprecated use `GetUserExternalIdRequest$outboundSchema` instead. */ + export const outboundSchema = GetUserExternalIdRequest$outboundSchema; + /** @deprecated use `GetUserExternalIdRequest$Outbound` instead. */ + export type Outbound = GetUserExternalIdRequest$Outbound; } -export class GetUserExternalIdResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const GetUserExternalIdCustomFields$inboundSchema: z.ZodType< + GetUserExternalIdCustomFields, + z.ZodTypeDef, + unknown +> = z + .object({ + first_name: z.nullable(z.string()).optional(), + }) + .transform((v) => { + return remap$(v, { + first_name: "firstName", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type GetUserExternalIdCustomFields$Outbound = { + first_name?: string | null | undefined; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const GetUserExternalIdCustomFields$outboundSchema: z.ZodType< + GetUserExternalIdCustomFields$Outbound, + z.ZodTypeDef, + GetUserExternalIdCustomFields +> = z + .object({ + firstName: z.nullable(z.string()).optional(), + }) + .transform((v) => { + return remap$(v, { + firstName: "first_name", + }); + }); - /** - * user response - */ - @SpeakeasyMetadata() - object?: GetUserExternalIdResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserExternalIdCustomFields$ { + /** @deprecated use `GetUserExternalIdCustomFields$inboundSchema` instead. */ + export const inboundSchema = GetUserExternalIdCustomFields$inboundSchema; + /** @deprecated use `GetUserExternalIdCustomFields$outboundSchema` instead. */ + export const outboundSchema = GetUserExternalIdCustomFields$outboundSchema; + /** @deprecated use `GetUserExternalIdCustomFields$Outbound` instead. */ + export type Outbound = GetUserExternalIdCustomFields$Outbound; +} + +/** @internal */ +export const GetUserExternalIdGroupUsers$inboundSchema: z.ZodType< + GetUserExternalIdGroupUsers, + z.ZodTypeDef, + unknown +> = z + .object({ + group_id: z.number().int(), + notification_level: z.number().int(), + owner: z.boolean().optional(), + user_id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + group_id: "groupId", + notification_level: "notificationLevel", + user_id: "userId", + }); + }); + +/** @internal */ +export type GetUserExternalIdGroupUsers$Outbound = { + group_id: number; + notification_level: number; + owner?: boolean | undefined; + user_id: number; +}; + +/** @internal */ +export const GetUserExternalIdGroupUsers$outboundSchema: z.ZodType< + GetUserExternalIdGroupUsers$Outbound, + z.ZodTypeDef, + GetUserExternalIdGroupUsers +> = z + .object({ + groupId: z.number().int(), + notificationLevel: z.number().int(), + owner: z.boolean().optional(), + userId: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + groupId: "group_id", + notificationLevel: "notification_level", + userId: "user_id", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserExternalIdGroupUsers$ { + /** @deprecated use `GetUserExternalIdGroupUsers$inboundSchema` instead. */ + export const inboundSchema = GetUserExternalIdGroupUsers$inboundSchema; + /** @deprecated use `GetUserExternalIdGroupUsers$outboundSchema` instead. */ + export const outboundSchema = GetUserExternalIdGroupUsers$outboundSchema; + /** @deprecated use `GetUserExternalIdGroupUsers$Outbound` instead. */ + export type Outbound = GetUserExternalIdGroupUsers$Outbound; +} + +/** @internal */ +export const GetUserExternalIdGroups$inboundSchema: z.ZodType< + GetUserExternalIdGroups, + z.ZodTypeDef, + unknown +> = z + .object({ + allow_membership_requests: z.boolean(), + automatic: z.boolean(), + bio_cooked: z.nullable(z.string()), + bio_excerpt: z.nullable(z.string()), + bio_raw: z.nullable(z.string()), + can_admin_group: z.boolean(), + can_see_members: z.boolean(), + default_notification_level: z.number().int(), + display_name: z.string(), + flair_bg_color: z.nullable(z.string()), + flair_color: z.nullable(z.string()), + flair_url: z.nullable(z.string()), + full_name: z.nullable(z.string()), + grant_trust_level: z.nullable(z.string()), + has_messages: z.boolean(), + id: z.number().int(), + incoming_email: z.nullable(z.string()), + members_visibility_level: z.number().int(), + membership_request_template: z.nullable(z.string()), + mentionable_level: z.number().int(), + messageable_level: z.number().int(), + name: z.string(), + primary_group: z.boolean(), + public_admission: z.boolean(), + public_exit: z.boolean(), + publish_read_state: z.boolean(), + title: z.nullable(z.string()), + user_count: z.number().int(), + visibility_level: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + allow_membership_requests: "allowMembershipRequests", + bio_cooked: "bioCooked", + bio_excerpt: "bioExcerpt", + bio_raw: "bioRaw", + can_admin_group: "canAdminGroup", + can_see_members: "canSeeMembers", + default_notification_level: "defaultNotificationLevel", + display_name: "displayName", + flair_bg_color: "flairBgColor", + flair_color: "flairColor", + flair_url: "flairUrl", + full_name: "fullName", + grant_trust_level: "grantTrustLevel", + has_messages: "hasMessages", + incoming_email: "incomingEmail", + members_visibility_level: "membersVisibilityLevel", + membership_request_template: "membershipRequestTemplate", + mentionable_level: "mentionableLevel", + messageable_level: "messageableLevel", + primary_group: "primaryGroup", + public_admission: "publicAdmission", + public_exit: "publicExit", + publish_read_state: "publishReadState", + user_count: "userCount", + visibility_level: "visibilityLevel", + }); + }); + +/** @internal */ +export type GetUserExternalIdGroups$Outbound = { + allow_membership_requests: boolean; + automatic: boolean; + bio_cooked: string | null; + bio_excerpt: string | null; + bio_raw: string | null; + can_admin_group: boolean; + can_see_members: boolean; + default_notification_level: number; + display_name: string; + flair_bg_color: string | null; + flair_color: string | null; + flair_url: string | null; + full_name: string | null; + grant_trust_level: string | null; + has_messages: boolean; + id: number; + incoming_email: string | null; + members_visibility_level: number; + membership_request_template: string | null; + mentionable_level: number; + messageable_level: number; + name: string; + primary_group: boolean; + public_admission: boolean; + public_exit: boolean; + publish_read_state: boolean; + title: string | null; + user_count: number; + visibility_level: number; +}; + +/** @internal */ +export const GetUserExternalIdGroups$outboundSchema: z.ZodType< + GetUserExternalIdGroups$Outbound, + z.ZodTypeDef, + GetUserExternalIdGroups +> = z + .object({ + allowMembershipRequests: z.boolean(), + automatic: z.boolean(), + bioCooked: z.nullable(z.string()), + bioExcerpt: z.nullable(z.string()), + bioRaw: z.nullable(z.string()), + canAdminGroup: z.boolean(), + canSeeMembers: z.boolean(), + defaultNotificationLevel: z.number().int(), + displayName: z.string(), + flairBgColor: z.nullable(z.string()), + flairColor: z.nullable(z.string()), + flairUrl: z.nullable(z.string()), + fullName: z.nullable(z.string()), + grantTrustLevel: z.nullable(z.string()), + hasMessages: z.boolean(), + id: z.number().int(), + incomingEmail: z.nullable(z.string()), + membersVisibilityLevel: z.number().int(), + membershipRequestTemplate: z.nullable(z.string()), + mentionableLevel: z.number().int(), + messageableLevel: z.number().int(), + name: z.string(), + primaryGroup: z.boolean(), + publicAdmission: z.boolean(), + publicExit: z.boolean(), + publishReadState: z.boolean(), + title: z.nullable(z.string()), + userCount: z.number().int(), + visibilityLevel: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + allowMembershipRequests: "allow_membership_requests", + bioCooked: "bio_cooked", + bioExcerpt: "bio_excerpt", + bioRaw: "bio_raw", + canAdminGroup: "can_admin_group", + canSeeMembers: "can_see_members", + defaultNotificationLevel: "default_notification_level", + displayName: "display_name", + flairBgColor: "flair_bg_color", + flairColor: "flair_color", + flairUrl: "flair_url", + fullName: "full_name", + grantTrustLevel: "grant_trust_level", + hasMessages: "has_messages", + incomingEmail: "incoming_email", + membersVisibilityLevel: "members_visibility_level", + membershipRequestTemplate: "membership_request_template", + mentionableLevel: "mentionable_level", + messageableLevel: "messageable_level", + primaryGroup: "primary_group", + publicAdmission: "public_admission", + publicExit: "public_exit", + publishReadState: "publish_read_state", + userCount: "user_count", + visibilityLevel: "visibility_level", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserExternalIdGroups$ { + /** @deprecated use `GetUserExternalIdGroups$inboundSchema` instead. */ + export const inboundSchema = GetUserExternalIdGroups$inboundSchema; + /** @deprecated use `GetUserExternalIdGroups$outboundSchema` instead. */ + export const outboundSchema = GetUserExternalIdGroups$outboundSchema; + /** @deprecated use `GetUserExternalIdGroups$Outbound` instead. */ + export type Outbound = GetUserExternalIdGroups$Outbound; +} + +/** @internal */ +export const GetUserExternalIdUserAuthTokens$inboundSchema: z.ZodType< + GetUserExternalIdUserAuthTokens, + z.ZodTypeDef, + unknown +> = z + .object({ + browser: z.string(), + client_ip: z.string(), + created_at: z.string(), + device: z.string(), + icon: z.string(), + id: z.number().int(), + is_active: z.boolean(), + location: z.string(), + os: z.string(), + seen_at: z.string(), + }) + .transform((v) => { + return remap$(v, { + client_ip: "clientIp", + created_at: "createdAt", + is_active: "isActive", + seen_at: "seenAt", + }); + }); + +/** @internal */ +export type GetUserExternalIdUserAuthTokens$Outbound = { + browser: string; + client_ip: string; + created_at: string; + device: string; + icon: string; + id: number; + is_active: boolean; + location: string; + os: string; + seen_at: string; +}; + +/** @internal */ +export const GetUserExternalIdUserAuthTokens$outboundSchema: z.ZodType< + GetUserExternalIdUserAuthTokens$Outbound, + z.ZodTypeDef, + GetUserExternalIdUserAuthTokens +> = z + .object({ + browser: z.string(), + clientIp: z.string(), + createdAt: z.string(), + device: z.string(), + icon: z.string(), + id: z.number().int(), + isActive: z.boolean(), + location: z.string(), + os: z.string(), + seenAt: z.string(), + }) + .transform((v) => { + return remap$(v, { + clientIp: "client_ip", + createdAt: "created_at", + isActive: "is_active", + seenAt: "seen_at", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserExternalIdUserAuthTokens$ { + /** @deprecated use `GetUserExternalIdUserAuthTokens$inboundSchema` instead. */ + export const inboundSchema = GetUserExternalIdUserAuthTokens$inboundSchema; + /** @deprecated use `GetUserExternalIdUserAuthTokens$outboundSchema` instead. */ + export const outboundSchema = GetUserExternalIdUserAuthTokens$outboundSchema; + /** @deprecated use `GetUserExternalIdUserAuthTokens$Outbound` instead. */ + export type Outbound = GetUserExternalIdUserAuthTokens$Outbound; +} + +/** @internal */ +export const GetUserExternalIdUserFields$inboundSchema: z.ZodType< + GetUserExternalIdUserFields, + z.ZodTypeDef, + unknown +> = z + .object({ + "1": z.nullable(z.string()), + "2": z.nullable(z.string()), + }) + .transform((v) => { + return remap$(v, { + "1": "one", + "2": "two", + }); + }); + +/** @internal */ +export type GetUserExternalIdUserFields$Outbound = { + "1": string | null; + "2": string | null; +}; + +/** @internal */ +export const GetUserExternalIdUserFields$outboundSchema: z.ZodType< + GetUserExternalIdUserFields$Outbound, + z.ZodTypeDef, + GetUserExternalIdUserFields +> = z + .object({ + one: z.nullable(z.string()), + two: z.nullable(z.string()), + }) + .transform((v) => { + return remap$(v, { + one: "1", + two: "2", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserExternalIdUserFields$ { + /** @deprecated use `GetUserExternalIdUserFields$inboundSchema` instead. */ + export const inboundSchema = GetUserExternalIdUserFields$inboundSchema; + /** @deprecated use `GetUserExternalIdUserFields$outboundSchema` instead. */ + export const outboundSchema = GetUserExternalIdUserFields$outboundSchema; + /** @deprecated use `GetUserExternalIdUserFields$Outbound` instead. */ + export type Outbound = GetUserExternalIdUserFields$Outbound; +} + +/** @internal */ +export const GetUserExternalIdUserNotificationSchedule$inboundSchema: z.ZodType< + GetUserExternalIdUserNotificationSchedule, + z.ZodTypeDef, + unknown +> = z + .object({ + day_0_end_time: z.number().int(), + day_0_start_time: z.number().int(), + day_1_end_time: z.number().int(), + day_1_start_time: z.number().int(), + day_2_end_time: z.number().int(), + day_2_start_time: z.number().int(), + day_3_end_time: z.number().int(), + day_3_start_time: z.number().int(), + day_4_end_time: z.number().int(), + day_4_start_time: z.number().int(), + day_5_end_time: z.number().int(), + day_5_start_time: z.number().int(), + day_6_end_time: z.number().int(), + day_6_start_time: z.number().int(), + enabled: z.boolean(), + }) + .transform((v) => { + return remap$(v, { + day_0_end_time: "day0EndTime", + day_0_start_time: "day0StartTime", + day_1_end_time: "day1EndTime", + day_1_start_time: "day1StartTime", + day_2_end_time: "day2EndTime", + day_2_start_time: "day2StartTime", + day_3_end_time: "day3EndTime", + day_3_start_time: "day3StartTime", + day_4_end_time: "day4EndTime", + day_4_start_time: "day4StartTime", + day_5_end_time: "day5EndTime", + day_5_start_time: "day5StartTime", + day_6_end_time: "day6EndTime", + day_6_start_time: "day6StartTime", + }); + }); + +/** @internal */ +export type GetUserExternalIdUserNotificationSchedule$Outbound = { + day_0_end_time: number; + day_0_start_time: number; + day_1_end_time: number; + day_1_start_time: number; + day_2_end_time: number; + day_2_start_time: number; + day_3_end_time: number; + day_3_start_time: number; + day_4_end_time: number; + day_4_start_time: number; + day_5_end_time: number; + day_5_start_time: number; + day_6_end_time: number; + day_6_start_time: number; + enabled: boolean; +}; + +/** @internal */ +export const GetUserExternalIdUserNotificationSchedule$outboundSchema: z.ZodType< + GetUserExternalIdUserNotificationSchedule$Outbound, + z.ZodTypeDef, + GetUserExternalIdUserNotificationSchedule +> = z + .object({ + day0EndTime: z.number().int(), + day0StartTime: z.number().int(), + day1EndTime: z.number().int(), + day1StartTime: z.number().int(), + day2EndTime: z.number().int(), + day2StartTime: z.number().int(), + day3EndTime: z.number().int(), + day3StartTime: z.number().int(), + day4EndTime: z.number().int(), + day4StartTime: z.number().int(), + day5EndTime: z.number().int(), + day5StartTime: z.number().int(), + day6EndTime: z.number().int(), + day6StartTime: z.number().int(), + enabled: z.boolean(), + }) + .transform((v) => { + return remap$(v, { + day0EndTime: "day_0_end_time", + day0StartTime: "day_0_start_time", + day1EndTime: "day_1_end_time", + day1StartTime: "day_1_start_time", + day2EndTime: "day_2_end_time", + day2StartTime: "day_2_start_time", + day3EndTime: "day_3_end_time", + day3StartTime: "day_3_start_time", + day4EndTime: "day_4_end_time", + day4StartTime: "day_4_start_time", + day5EndTime: "day_5_end_time", + day5StartTime: "day_5_start_time", + day6EndTime: "day_6_end_time", + day6StartTime: "day_6_start_time", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserExternalIdUserNotificationSchedule$ { + /** @deprecated use `GetUserExternalIdUserNotificationSchedule$inboundSchema` instead. */ + export const inboundSchema = GetUserExternalIdUserNotificationSchedule$inboundSchema; + /** @deprecated use `GetUserExternalIdUserNotificationSchedule$outboundSchema` instead. */ + export const outboundSchema = GetUserExternalIdUserNotificationSchedule$outboundSchema; + /** @deprecated use `GetUserExternalIdUserNotificationSchedule$Outbound` instead. */ + export type Outbound = GetUserExternalIdUserNotificationSchedule$Outbound; +} + +/** @internal */ +export const GetUserExternalIdUserOption$inboundSchema: z.ZodType< + GetUserExternalIdUserOption, + z.ZodTypeDef, + unknown +> = z + .object({ + allow_private_messages: z.boolean(), + auto_track_topics_after_msecs: z.number().int(), + automatically_unpin_topics: z.boolean(), + bookmark_auto_delete_preference: z.number().int().optional(), + color_scheme_id: z.nullable(z.string()), + dark_scheme_id: z.nullable(z.string()), + default_calendar: z.string().optional(), + digest_after_minutes: z.number().int(), + dynamic_favicon: z.boolean(), + email_digests: z.boolean(), + email_in_reply_to: z.boolean(), + email_level: z.number().int(), + email_messages_level: z.number().int(), + email_previous_replies: z.number().int(), + enable_allowed_pm_users: z.boolean(), + enable_defer: z.boolean(), + enable_quoting: z.boolean(), + external_links_in_new_tab: z.boolean(), + hide_profile_and_presence: z.boolean(), + homepage_id: z.nullable(z.string()), + include_tl0_in_digests: z.boolean(), + like_notification_frequency: z.number().int(), + mailing_list_mode: z.boolean(), + mailing_list_mode_frequency: z.number().int(), + new_topic_duration_minutes: z.number().int(), + notification_level_when_replying: z.number().int(), + oldest_search_log_date: z.nullable(z.string()).optional(), + seen_popups: z.nullable(z.array(z.any())).optional(), + sidebar_link_to_filtered_list: z.boolean().optional(), + sidebar_show_count_of_new_items: z.boolean().optional(), + skip_new_user_tips: z.boolean(), + text_size: z.string(), + text_size_seq: z.number().int(), + theme_ids: z.array(z.any()), + theme_key_seq: z.number().int(), + timezone: z.nullable(z.string()), + title_count_mode: z.string(), + user_id: z.number().int(), + watched_precedence_over_muted: z.nullable(z.boolean()).optional(), + }) + .transform((v) => { + return remap$(v, { + allow_private_messages: "allowPrivateMessages", + auto_track_topics_after_msecs: "autoTrackTopicsAfterMsecs", + automatically_unpin_topics: "automaticallyUnpinTopics", + bookmark_auto_delete_preference: "bookmarkAutoDeletePreference", + color_scheme_id: "colorSchemeId", + dark_scheme_id: "darkSchemeId", + default_calendar: "defaultCalendar", + digest_after_minutes: "digestAfterMinutes", + dynamic_favicon: "dynamicFavicon", + email_digests: "emailDigests", + email_in_reply_to: "emailInReplyTo", + email_level: "emailLevel", + email_messages_level: "emailMessagesLevel", + email_previous_replies: "emailPreviousReplies", + enable_allowed_pm_users: "enableAllowedPmUsers", + enable_defer: "enableDefer", + enable_quoting: "enableQuoting", + external_links_in_new_tab: "externalLinksInNewTab", + hide_profile_and_presence: "hideProfileAndPresence", + homepage_id: "homepageId", + include_tl0_in_digests: "includeTl0InDigests", + like_notification_frequency: "likeNotificationFrequency", + mailing_list_mode: "mailingListMode", + mailing_list_mode_frequency: "mailingListModeFrequency", + new_topic_duration_minutes: "newTopicDurationMinutes", + notification_level_when_replying: "notificationLevelWhenReplying", + oldest_search_log_date: "oldestSearchLogDate", + seen_popups: "seenPopups", + sidebar_link_to_filtered_list: "sidebarLinkToFilteredList", + sidebar_show_count_of_new_items: "sidebarShowCountOfNewItems", + skip_new_user_tips: "skipNewUserTips", + text_size: "textSize", + text_size_seq: "textSizeSeq", + theme_ids: "themeIds", + theme_key_seq: "themeKeySeq", + title_count_mode: "titleCountMode", + user_id: "userId", + watched_precedence_over_muted: "watchedPrecedenceOverMuted", + }); + }); + +/** @internal */ +export type GetUserExternalIdUserOption$Outbound = { + allow_private_messages: boolean; + auto_track_topics_after_msecs: number; + automatically_unpin_topics: boolean; + bookmark_auto_delete_preference?: number | undefined; + color_scheme_id: string | null; + dark_scheme_id: string | null; + default_calendar?: string | undefined; + digest_after_minutes: number; + dynamic_favicon: boolean; + email_digests: boolean; + email_in_reply_to: boolean; + email_level: number; + email_messages_level: number; + email_previous_replies: number; + enable_allowed_pm_users: boolean; + enable_defer: boolean; + enable_quoting: boolean; + external_links_in_new_tab: boolean; + hide_profile_and_presence: boolean; + homepage_id: string | null; + include_tl0_in_digests: boolean; + like_notification_frequency: number; + mailing_list_mode: boolean; + mailing_list_mode_frequency: number; + new_topic_duration_minutes: number; + notification_level_when_replying: number; + oldest_search_log_date?: string | null | undefined; + seen_popups?: Array | null | undefined; + sidebar_link_to_filtered_list?: boolean | undefined; + sidebar_show_count_of_new_items?: boolean | undefined; + skip_new_user_tips: boolean; + text_size: string; + text_size_seq: number; + theme_ids: Array; + theme_key_seq: number; + timezone: string | null; + title_count_mode: string; + user_id: number; + watched_precedence_over_muted?: boolean | null | undefined; +}; + +/** @internal */ +export const GetUserExternalIdUserOption$outboundSchema: z.ZodType< + GetUserExternalIdUserOption$Outbound, + z.ZodTypeDef, + GetUserExternalIdUserOption +> = z + .object({ + allowPrivateMessages: z.boolean(), + autoTrackTopicsAfterMsecs: z.number().int(), + automaticallyUnpinTopics: z.boolean(), + bookmarkAutoDeletePreference: z.number().int().optional(), + colorSchemeId: z.nullable(z.string()), + darkSchemeId: z.nullable(z.string()), + defaultCalendar: z.string().optional(), + digestAfterMinutes: z.number().int(), + dynamicFavicon: z.boolean(), + emailDigests: z.boolean(), + emailInReplyTo: z.boolean(), + emailLevel: z.number().int(), + emailMessagesLevel: z.number().int(), + emailPreviousReplies: z.number().int(), + enableAllowedPmUsers: z.boolean(), + enableDefer: z.boolean(), + enableQuoting: z.boolean(), + externalLinksInNewTab: z.boolean(), + hideProfileAndPresence: z.boolean(), + homepageId: z.nullable(z.string()), + includeTl0InDigests: z.boolean(), + likeNotificationFrequency: z.number().int(), + mailingListMode: z.boolean(), + mailingListModeFrequency: z.number().int(), + newTopicDurationMinutes: z.number().int(), + notificationLevelWhenReplying: z.number().int(), + oldestSearchLogDate: z.nullable(z.string()).optional(), + seenPopups: z.nullable(z.array(z.any())).optional(), + sidebarLinkToFilteredList: z.boolean().optional(), + sidebarShowCountOfNewItems: z.boolean().optional(), + skipNewUserTips: z.boolean(), + textSize: z.string(), + textSizeSeq: z.number().int(), + themeIds: z.array(z.any()), + themeKeySeq: z.number().int(), + timezone: z.nullable(z.string()), + titleCountMode: z.string(), + userId: z.number().int(), + watchedPrecedenceOverMuted: z.nullable(z.boolean()).optional(), + }) + .transform((v) => { + return remap$(v, { + allowPrivateMessages: "allow_private_messages", + autoTrackTopicsAfterMsecs: "auto_track_topics_after_msecs", + automaticallyUnpinTopics: "automatically_unpin_topics", + bookmarkAutoDeletePreference: "bookmark_auto_delete_preference", + colorSchemeId: "color_scheme_id", + darkSchemeId: "dark_scheme_id", + defaultCalendar: "default_calendar", + digestAfterMinutes: "digest_after_minutes", + dynamicFavicon: "dynamic_favicon", + emailDigests: "email_digests", + emailInReplyTo: "email_in_reply_to", + emailLevel: "email_level", + emailMessagesLevel: "email_messages_level", + emailPreviousReplies: "email_previous_replies", + enableAllowedPmUsers: "enable_allowed_pm_users", + enableDefer: "enable_defer", + enableQuoting: "enable_quoting", + externalLinksInNewTab: "external_links_in_new_tab", + hideProfileAndPresence: "hide_profile_and_presence", + homepageId: "homepage_id", + includeTl0InDigests: "include_tl0_in_digests", + likeNotificationFrequency: "like_notification_frequency", + mailingListMode: "mailing_list_mode", + mailingListModeFrequency: "mailing_list_mode_frequency", + newTopicDurationMinutes: "new_topic_duration_minutes", + notificationLevelWhenReplying: "notification_level_when_replying", + oldestSearchLogDate: "oldest_search_log_date", + seenPopups: "seen_popups", + sidebarLinkToFilteredList: "sidebar_link_to_filtered_list", + sidebarShowCountOfNewItems: "sidebar_show_count_of_new_items", + skipNewUserTips: "skip_new_user_tips", + textSize: "text_size", + textSizeSeq: "text_size_seq", + themeIds: "theme_ids", + themeKeySeq: "theme_key_seq", + titleCountMode: "title_count_mode", + userId: "user_id", + watchedPrecedenceOverMuted: "watched_precedence_over_muted", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserExternalIdUserOption$ { + /** @deprecated use `GetUserExternalIdUserOption$inboundSchema` instead. */ + export const inboundSchema = GetUserExternalIdUserOption$inboundSchema; + /** @deprecated use `GetUserExternalIdUserOption$outboundSchema` instead. */ + export const outboundSchema = GetUserExternalIdUserOption$outboundSchema; + /** @deprecated use `GetUserExternalIdUserOption$Outbound` instead. */ + export type Outbound = GetUserExternalIdUserOption$Outbound; +} + +/** @internal */ +export const GetUserExternalIdUser$inboundSchema: z.ZodType< + GetUserExternalIdUser, + z.ZodTypeDef, + unknown +> = z + .object({ + admin: z.boolean(), + allowed_pm_usernames: z.array(z.any()), + avatar_template: z.string(), + badge_count: z.number().int(), + can_be_deleted: z.boolean(), + can_change_bio: z.boolean(), + can_change_location: z.boolean(), + can_change_tracking_preferences: z.boolean(), + can_change_website: z.boolean(), + can_delete_all_posts: z.boolean(), + can_edit: z.boolean(), + can_edit_email: z.boolean(), + can_edit_name: z.boolean(), + can_edit_username: z.boolean(), + can_ignore_user: z.boolean(), + can_mute_user: z.boolean(), + can_send_private_message_to_user: z.boolean(), + can_send_private_messages: z.boolean(), + can_upload_profile_header: z.boolean(), + can_upload_user_card_background: z.boolean(), + created_at: z.string(), + custom_fields: z.lazy(() => GetUserExternalIdCustomFields$inboundSchema), + display_sidebar_tags: z.boolean().optional(), + featured_topic: z.nullable(z.string()), + featured_user_badge_ids: z.array(z.any()), + flair_bg_color: z.nullable(z.string()), + flair_color: z.nullable(z.string()), + flair_group_id: z.nullable(z.string()), + flair_name: z.nullable(z.string()), + flair_url: z.nullable(z.string()), + group_users: z.array(z.lazy(() => GetUserExternalIdGroupUsers$inboundSchema)), + groups: z.array(z.lazy(() => GetUserExternalIdGroups$inboundSchema)), + has_title_badges: z.boolean(), + id: z.number().int(), + ignored: z.boolean(), + ignored_usernames: z.array(z.any()), + invited_by: z.nullable(z.string()), + last_posted_at: z.nullable(z.string()), + last_seen_at: z.nullable(z.string()), + locale: z.nullable(z.string()), + mailing_list_posts_per_day: z.number().int(), + moderator: z.boolean(), + muted: z.boolean(), + muted_category_ids: z.array(z.any()), + muted_tags: z.array(z.any()), + muted_usernames: z.array(z.any()), + name: z.string(), + pending_count: z.number().int(), + pending_posts_count: z.number().int().optional(), + post_count: z.number().int(), + primary_group_id: z.nullable(z.string()), + primary_group_name: z.nullable(z.string()), + profile_view_count: z.number().int(), + recent_time_read: z.number().int(), + regular_category_ids: z.array(z.any()), + second_factor_backup_enabled: z.boolean().optional(), + second_factor_enabled: z.boolean(), + sidebar_category_ids: z.array(z.any()).optional(), + sidebar_tags: z.array(z.any()).optional(), + staged: z.boolean(), + system_avatar_template: z.string(), + system_avatar_upload_id: z.nullable(z.string()), + time_read: z.number().int(), + title: z.nullable(z.string()), + tracked_category_ids: z.array(z.any()), + tracked_tags: z.array(z.any()), + trust_level: z.number().int(), + uploaded_avatar_id: z.nullable(z.string()), + use_logo_small_as_avatar: z.boolean(), + user_api_keys: z.nullable(z.string()), + user_auth_tokens: z.array(z.lazy(() => GetUserExternalIdUserAuthTokens$inboundSchema)), + user_fields: z.lazy(() => GetUserExternalIdUserFields$inboundSchema).optional(), + user_notification_schedule: z.lazy( + () => GetUserExternalIdUserNotificationSchedule$inboundSchema + ), + user_option: z.lazy(() => GetUserExternalIdUserOption$inboundSchema), + username: z.string(), + watched_category_ids: z.array(z.any()), + watched_first_post_category_ids: z.array(z.any()), + watched_tags: z.array(z.any()), + watching_first_post_tags: z.array(z.any()), + }) + .transform((v) => { + return remap$(v, { + allowed_pm_usernames: "allowedPmUsernames", + avatar_template: "avatarTemplate", + badge_count: "badgeCount", + can_be_deleted: "canBeDeleted", + can_change_bio: "canChangeBio", + can_change_location: "canChangeLocation", + can_change_tracking_preferences: "canChangeTrackingPreferences", + can_change_website: "canChangeWebsite", + can_delete_all_posts: "canDeleteAllPosts", + can_edit: "canEdit", + can_edit_email: "canEditEmail", + can_edit_name: "canEditName", + can_edit_username: "canEditUsername", + can_ignore_user: "canIgnoreUser", + can_mute_user: "canMuteUser", + can_send_private_message_to_user: "canSendPrivateMessageToUser", + can_send_private_messages: "canSendPrivateMessages", + can_upload_profile_header: "canUploadProfileHeader", + can_upload_user_card_background: "canUploadUserCardBackground", + created_at: "createdAt", + custom_fields: "customFields", + display_sidebar_tags: "displaySidebarTags", + featured_topic: "featuredTopic", + featured_user_badge_ids: "featuredUserBadgeIds", + flair_bg_color: "flairBgColor", + flair_color: "flairColor", + flair_group_id: "flairGroupId", + flair_name: "flairName", + flair_url: "flairUrl", + group_users: "groupUsers", + has_title_badges: "hasTitleBadges", + ignored_usernames: "ignoredUsernames", + invited_by: "invitedBy", + last_posted_at: "lastPostedAt", + last_seen_at: "lastSeenAt", + mailing_list_posts_per_day: "mailingListPostsPerDay", + muted_category_ids: "mutedCategoryIds", + muted_tags: "mutedTags", + muted_usernames: "mutedUsernames", + pending_count: "pendingCount", + pending_posts_count: "pendingPostsCount", + post_count: "postCount", + primary_group_id: "primaryGroupId", + primary_group_name: "primaryGroupName", + profile_view_count: "profileViewCount", + recent_time_read: "recentTimeRead", + regular_category_ids: "regularCategoryIds", + second_factor_backup_enabled: "secondFactorBackupEnabled", + second_factor_enabled: "secondFactorEnabled", + sidebar_category_ids: "sidebarCategoryIds", + sidebar_tags: "sidebarTags", + system_avatar_template: "systemAvatarTemplate", + system_avatar_upload_id: "systemAvatarUploadId", + time_read: "timeRead", + tracked_category_ids: "trackedCategoryIds", + tracked_tags: "trackedTags", + trust_level: "trustLevel", + uploaded_avatar_id: "uploadedAvatarId", + use_logo_small_as_avatar: "useLogoSmallAsAvatar", + user_api_keys: "userApiKeys", + user_auth_tokens: "userAuthTokens", + user_fields: "userFields", + user_notification_schedule: "userNotificationSchedule", + user_option: "userOption", + watched_category_ids: "watchedCategoryIds", + watched_first_post_category_ids: "watchedFirstPostCategoryIds", + watched_tags: "watchedTags", + watching_first_post_tags: "watchingFirstPostTags", + }); + }); + +/** @internal */ +export type GetUserExternalIdUser$Outbound = { + admin: boolean; + allowed_pm_usernames: Array; + avatar_template: string; + badge_count: number; + can_be_deleted: boolean; + can_change_bio: boolean; + can_change_location: boolean; + can_change_tracking_preferences: boolean; + can_change_website: boolean; + can_delete_all_posts: boolean; + can_edit: boolean; + can_edit_email: boolean; + can_edit_name: boolean; + can_edit_username: boolean; + can_ignore_user: boolean; + can_mute_user: boolean; + can_send_private_message_to_user: boolean; + can_send_private_messages: boolean; + can_upload_profile_header: boolean; + can_upload_user_card_background: boolean; + created_at: string; + custom_fields: GetUserExternalIdCustomFields$Outbound; + display_sidebar_tags?: boolean | undefined; + featured_topic: string | null; + featured_user_badge_ids: Array; + flair_bg_color: string | null; + flair_color: string | null; + flair_group_id: string | null; + flair_name: string | null; + flair_url: string | null; + group_users: Array; + groups: Array; + has_title_badges: boolean; + id: number; + ignored: boolean; + ignored_usernames: Array; + invited_by: string | null; + last_posted_at: string | null; + last_seen_at: string | null; + locale: string | null; + mailing_list_posts_per_day: number; + moderator: boolean; + muted: boolean; + muted_category_ids: Array; + muted_tags: Array; + muted_usernames: Array; + name: string; + pending_count: number; + pending_posts_count?: number | undefined; + post_count: number; + primary_group_id: string | null; + primary_group_name: string | null; + profile_view_count: number; + recent_time_read: number; + regular_category_ids: Array; + second_factor_backup_enabled?: boolean | undefined; + second_factor_enabled: boolean; + sidebar_category_ids?: Array | undefined; + sidebar_tags?: Array | undefined; + staged: boolean; + system_avatar_template: string; + system_avatar_upload_id: string | null; + time_read: number; + title: string | null; + tracked_category_ids: Array; + tracked_tags: Array; + trust_level: number; + uploaded_avatar_id: string | null; + use_logo_small_as_avatar: boolean; + user_api_keys: string | null; + user_auth_tokens: Array; + user_fields?: GetUserExternalIdUserFields$Outbound | undefined; + user_notification_schedule: GetUserExternalIdUserNotificationSchedule$Outbound; + user_option: GetUserExternalIdUserOption$Outbound; + username: string; + watched_category_ids: Array; + watched_first_post_category_ids: Array; + watched_tags: Array; + watching_first_post_tags: Array; +}; + +/** @internal */ +export const GetUserExternalIdUser$outboundSchema: z.ZodType< + GetUserExternalIdUser$Outbound, + z.ZodTypeDef, + GetUserExternalIdUser +> = z + .object({ + admin: z.boolean(), + allowedPmUsernames: z.array(z.any()), + avatarTemplate: z.string(), + badgeCount: z.number().int(), + canBeDeleted: z.boolean(), + canChangeBio: z.boolean(), + canChangeLocation: z.boolean(), + canChangeTrackingPreferences: z.boolean(), + canChangeWebsite: z.boolean(), + canDeleteAllPosts: z.boolean(), + canEdit: z.boolean(), + canEditEmail: z.boolean(), + canEditName: z.boolean(), + canEditUsername: z.boolean(), + canIgnoreUser: z.boolean(), + canMuteUser: z.boolean(), + canSendPrivateMessageToUser: z.boolean(), + canSendPrivateMessages: z.boolean(), + canUploadProfileHeader: z.boolean(), + canUploadUserCardBackground: z.boolean(), + createdAt: z.string(), + customFields: z.lazy(() => GetUserExternalIdCustomFields$outboundSchema), + displaySidebarTags: z.boolean().optional(), + featuredTopic: z.nullable(z.string()), + featuredUserBadgeIds: z.array(z.any()), + flairBgColor: z.nullable(z.string()), + flairColor: z.nullable(z.string()), + flairGroupId: z.nullable(z.string()), + flairName: z.nullable(z.string()), + flairUrl: z.nullable(z.string()), + groupUsers: z.array(z.lazy(() => GetUserExternalIdGroupUsers$outboundSchema)), + groups: z.array(z.lazy(() => GetUserExternalIdGroups$outboundSchema)), + hasTitleBadges: z.boolean(), + id: z.number().int(), + ignored: z.boolean(), + ignoredUsernames: z.array(z.any()), + invitedBy: z.nullable(z.string()), + lastPostedAt: z.nullable(z.string()), + lastSeenAt: z.nullable(z.string()), + locale: z.nullable(z.string()), + mailingListPostsPerDay: z.number().int(), + moderator: z.boolean(), + muted: z.boolean(), + mutedCategoryIds: z.array(z.any()), + mutedTags: z.array(z.any()), + mutedUsernames: z.array(z.any()), + name: z.string(), + pendingCount: z.number().int(), + pendingPostsCount: z.number().int().optional(), + postCount: z.number().int(), + primaryGroupId: z.nullable(z.string()), + primaryGroupName: z.nullable(z.string()), + profileViewCount: z.number().int(), + recentTimeRead: z.number().int(), + regularCategoryIds: z.array(z.any()), + secondFactorBackupEnabled: z.boolean().optional(), + secondFactorEnabled: z.boolean(), + sidebarCategoryIds: z.array(z.any()).optional(), + sidebarTags: z.array(z.any()).optional(), + staged: z.boolean(), + systemAvatarTemplate: z.string(), + systemAvatarUploadId: z.nullable(z.string()), + timeRead: z.number().int(), + title: z.nullable(z.string()), + trackedCategoryIds: z.array(z.any()), + trackedTags: z.array(z.any()), + trustLevel: z.number().int(), + uploadedAvatarId: z.nullable(z.string()), + useLogoSmallAsAvatar: z.boolean(), + userApiKeys: z.nullable(z.string()), + userAuthTokens: z.array(z.lazy(() => GetUserExternalIdUserAuthTokens$outboundSchema)), + userFields: z.lazy(() => GetUserExternalIdUserFields$outboundSchema).optional(), + userNotificationSchedule: z.lazy( + () => GetUserExternalIdUserNotificationSchedule$outboundSchema + ), + userOption: z.lazy(() => GetUserExternalIdUserOption$outboundSchema), + username: z.string(), + watchedCategoryIds: z.array(z.any()), + watchedFirstPostCategoryIds: z.array(z.any()), + watchedTags: z.array(z.any()), + watchingFirstPostTags: z.array(z.any()), + }) + .transform((v) => { + return remap$(v, { + allowedPmUsernames: "allowed_pm_usernames", + avatarTemplate: "avatar_template", + badgeCount: "badge_count", + canBeDeleted: "can_be_deleted", + canChangeBio: "can_change_bio", + canChangeLocation: "can_change_location", + canChangeTrackingPreferences: "can_change_tracking_preferences", + canChangeWebsite: "can_change_website", + canDeleteAllPosts: "can_delete_all_posts", + canEdit: "can_edit", + canEditEmail: "can_edit_email", + canEditName: "can_edit_name", + canEditUsername: "can_edit_username", + canIgnoreUser: "can_ignore_user", + canMuteUser: "can_mute_user", + canSendPrivateMessageToUser: "can_send_private_message_to_user", + canSendPrivateMessages: "can_send_private_messages", + canUploadProfileHeader: "can_upload_profile_header", + canUploadUserCardBackground: "can_upload_user_card_background", + createdAt: "created_at", + customFields: "custom_fields", + displaySidebarTags: "display_sidebar_tags", + featuredTopic: "featured_topic", + featuredUserBadgeIds: "featured_user_badge_ids", + flairBgColor: "flair_bg_color", + flairColor: "flair_color", + flairGroupId: "flair_group_id", + flairName: "flair_name", + flairUrl: "flair_url", + groupUsers: "group_users", + hasTitleBadges: "has_title_badges", + ignoredUsernames: "ignored_usernames", + invitedBy: "invited_by", + lastPostedAt: "last_posted_at", + lastSeenAt: "last_seen_at", + mailingListPostsPerDay: "mailing_list_posts_per_day", + mutedCategoryIds: "muted_category_ids", + mutedTags: "muted_tags", + mutedUsernames: "muted_usernames", + pendingCount: "pending_count", + pendingPostsCount: "pending_posts_count", + postCount: "post_count", + primaryGroupId: "primary_group_id", + primaryGroupName: "primary_group_name", + profileViewCount: "profile_view_count", + recentTimeRead: "recent_time_read", + regularCategoryIds: "regular_category_ids", + secondFactorBackupEnabled: "second_factor_backup_enabled", + secondFactorEnabled: "second_factor_enabled", + sidebarCategoryIds: "sidebar_category_ids", + sidebarTags: "sidebar_tags", + systemAvatarTemplate: "system_avatar_template", + systemAvatarUploadId: "system_avatar_upload_id", + timeRead: "time_read", + trackedCategoryIds: "tracked_category_ids", + trackedTags: "tracked_tags", + trustLevel: "trust_level", + uploadedAvatarId: "uploaded_avatar_id", + useLogoSmallAsAvatar: "use_logo_small_as_avatar", + userApiKeys: "user_api_keys", + userAuthTokens: "user_auth_tokens", + userFields: "user_fields", + userNotificationSchedule: "user_notification_schedule", + userOption: "user_option", + watchedCategoryIds: "watched_category_ids", + watchedFirstPostCategoryIds: "watched_first_post_category_ids", + watchedTags: "watched_tags", + watchingFirstPostTags: "watching_first_post_tags", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserExternalIdUser$ { + /** @deprecated use `GetUserExternalIdUser$inboundSchema` instead. */ + export const inboundSchema = GetUserExternalIdUser$inboundSchema; + /** @deprecated use `GetUserExternalIdUser$outboundSchema` instead. */ + export const outboundSchema = GetUserExternalIdUser$outboundSchema; + /** @deprecated use `GetUserExternalIdUser$Outbound` instead. */ + export type Outbound = GetUserExternalIdUser$Outbound; +} + +/** @internal */ +export const GetUserExternalIdResponseBody$inboundSchema: z.ZodType< + GetUserExternalIdResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + user: z.lazy(() => GetUserExternalIdUser$inboundSchema), + user_badges: z.array(z.any()), + }) + .transform((v) => { + return remap$(v, { + user_badges: "userBadges", + }); + }); + +/** @internal */ +export type GetUserExternalIdResponseBody$Outbound = { + user: GetUserExternalIdUser$Outbound; + user_badges: Array; +}; + +/** @internal */ +export const GetUserExternalIdResponseBody$outboundSchema: z.ZodType< + GetUserExternalIdResponseBody$Outbound, + z.ZodTypeDef, + GetUserExternalIdResponseBody +> = z + .object({ + user: z.lazy(() => GetUserExternalIdUser$outboundSchema), + userBadges: z.array(z.any()), + }) + .transform((v) => { + return remap$(v, { + userBadges: "user_badges", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserExternalIdResponseBody$ { + /** @deprecated use `GetUserExternalIdResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetUserExternalIdResponseBody$inboundSchema; + /** @deprecated use `GetUserExternalIdResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetUserExternalIdResponseBody$outboundSchema; + /** @deprecated use `GetUserExternalIdResponseBody$Outbound` instead. */ + export type Outbound = GetUserExternalIdResponseBody$Outbound; } diff --git a/src/sdk/models/operations/getuseridentiyproviderexternalid.ts b/src/sdk/models/operations/getuseridentiyproviderexternalid.ts index fcc9c0d..b8a93e6 100644 --- a/src/sdk/models/operations/getuseridentiyproviderexternalid.ts +++ b/src/sdk/models/operations/getuseridentiyproviderexternalid.ts @@ -1,803 +1,1548 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class GetUserIdentiyProviderExternalIdRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Key" }) +export type GetUserIdentiyProviderExternalIdRequest = { apiKey: string; - - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Username" }) apiUsername: string; - - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=external_id" }) externalId: string; - /** * Authentication provider name. Can be found in the provider callback URL: `/auth/{provider}/callback` */ - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=provider" }) provider: string; -} +}; -export class GetUserIdentiyProviderExternalIdCustomFields extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "first_name" }) - firstName?: string; -} +export type GetUserIdentiyProviderExternalIdCustomFields = { + firstName?: string | null | undefined; +}; -export class GetUserIdentiyProviderExternalIdGroupUsers extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "group_id" }) +export type GetUserIdentiyProviderExternalIdGroupUsers = { groupId: number; - - @SpeakeasyMetadata() - @Expose({ name: "notification_level" }) notificationLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "owner" }) - owner?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "user_id" }) + owner?: boolean | undefined; userId: number; -} +}; -export class GetUserIdentiyProviderExternalIdGroups extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "allow_membership_requests" }) +export type GetUserIdentiyProviderExternalIdGroups = { allowMembershipRequests: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "automatic" }) automatic: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "bio_cooked" }) - bioCooked: string; - - @SpeakeasyMetadata() - @Expose({ name: "bio_excerpt" }) - bioExcerpt: string; - - @SpeakeasyMetadata() - @Expose({ name: "bio_raw" }) - bioRaw: string; - - @SpeakeasyMetadata() - @Expose({ name: "can_admin_group" }) + bioCooked: string | null; + bioExcerpt: string | null; + bioRaw: string | null; canAdminGroup: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_see_members" }) canSeeMembers: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "default_notification_level" }) defaultNotificationLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "display_name" }) displayName: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_bg_color" }) - flairBgColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_color" }) - flairColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_url" }) - flairUrl: string; - - @SpeakeasyMetadata() - @Expose({ name: "full_name" }) - fullName: string; - - @SpeakeasyMetadata() - @Expose({ name: "grant_trust_level" }) - grantTrustLevel: string; - - @SpeakeasyMetadata() - @Expose({ name: "has_messages" }) + flairBgColor: string | null; + flairColor: string | null; + flairUrl: string | null; + fullName: string | null; + grantTrustLevel: string | null; hasMessages: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "incoming_email" }) - incomingEmail: string; - - @SpeakeasyMetadata() - @Expose({ name: "members_visibility_level" }) + incomingEmail: string | null; membersVisibilityLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "membership_request_template" }) - membershipRequestTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "mentionable_level" }) + membershipRequestTemplate: string | null; mentionableLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "messageable_level" }) messageableLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "primary_group" }) primaryGroup: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "public_admission" }) publicAdmission: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "public_exit" }) publicExit: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "publish_read_state" }) publishReadState: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "title" }) - title: string; - - @SpeakeasyMetadata() - @Expose({ name: "user_count" }) + title: string | null; userCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "visibility_level" }) visibilityLevel: number; -} +}; -export class GetUserIdentiyProviderExternalIdUserAuthTokens extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "browser" }) +export type GetUserIdentiyProviderExternalIdUserAuthTokens = { browser: string; - - @SpeakeasyMetadata() - @Expose({ name: "client_ip" }) clientIp: string; - - @SpeakeasyMetadata() - @Expose({ name: "created_at" }) createdAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "device" }) device: string; - - @SpeakeasyMetadata() - @Expose({ name: "icon" }) icon: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "is_active" }) isActive: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "location" }) location: string; - - @SpeakeasyMetadata() - @Expose({ name: "os" }) os: string; - - @SpeakeasyMetadata() - @Expose({ name: "seen_at" }) seenAt: string; -} +}; -export class GetUserIdentiyProviderExternalIdUserFields extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "1" }) - one: string; +export type GetUserIdentiyProviderExternalIdUserFields = { + one: string | null; + two: string | null; +}; - @SpeakeasyMetadata() - @Expose({ name: "2" }) - two: string; -} - -export class GetUserIdentiyProviderExternalIdUserNotificationSchedule extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "day_0_end_time" }) +export type GetUserIdentiyProviderExternalIdUserNotificationSchedule = { day0EndTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_0_start_time" }) day0StartTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_1_end_time" }) day1EndTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_1_start_time" }) day1StartTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_2_end_time" }) day2EndTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_2_start_time" }) day2StartTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_3_end_time" }) day3EndTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_3_start_time" }) day3StartTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_4_end_time" }) day4EndTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_4_start_time" }) day4StartTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_5_end_time" }) day5EndTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_5_start_time" }) day5StartTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_6_end_time" }) day6EndTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "day_6_start_time" }) day6StartTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "enabled" }) enabled: boolean; -} +}; -export class GetUserIdentiyProviderExternalIdUserOption extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "allow_private_messages" }) +export type GetUserIdentiyProviderExternalIdUserOption = { allowPrivateMessages: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "auto_track_topics_after_msecs" }) autoTrackTopicsAfterMsecs: number; - - @SpeakeasyMetadata() - @Expose({ name: "automatically_unpin_topics" }) automaticallyUnpinTopics: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "bookmark_auto_delete_preference" }) - bookmarkAutoDeletePreference?: number; - - @SpeakeasyMetadata() - @Expose({ name: "color_scheme_id" }) - colorSchemeId: string; - - @SpeakeasyMetadata() - @Expose({ name: "dark_scheme_id" }) - darkSchemeId: string; - - @SpeakeasyMetadata() - @Expose({ name: "default_calendar" }) - defaultCalendar?: string; - - @SpeakeasyMetadata() - @Expose({ name: "digest_after_minutes" }) + bookmarkAutoDeletePreference?: number | undefined; + colorSchemeId: string | null; + darkSchemeId: string | null; + defaultCalendar?: string | undefined; digestAfterMinutes: number; - - @SpeakeasyMetadata() - @Expose({ name: "dynamic_favicon" }) dynamicFavicon: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "email_digests" }) emailDigests: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "email_in_reply_to" }) emailInReplyTo: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "email_level" }) emailLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "email_messages_level" }) emailMessagesLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "email_previous_replies" }) emailPreviousReplies: number; - - @SpeakeasyMetadata() - @Expose({ name: "enable_allowed_pm_users" }) enableAllowedPmUsers: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "enable_defer" }) enableDefer: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "enable_quoting" }) enableQuoting: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "external_links_in_new_tab" }) externalLinksInNewTab: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "hide_profile_and_presence" }) hideProfileAndPresence: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "homepage_id" }) - homepageId: string; - - @SpeakeasyMetadata() - @Expose({ name: "include_tl0_in_digests" }) + homepageId: string | null; includeTl0InDigests: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "like_notification_frequency" }) likeNotificationFrequency: number; - - @SpeakeasyMetadata() - @Expose({ name: "mailing_list_mode" }) mailingListMode: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "mailing_list_mode_frequency" }) mailingListModeFrequency: number; - - @SpeakeasyMetadata() - @Expose({ name: "new_topic_duration_minutes" }) newTopicDurationMinutes: number; - - @SpeakeasyMetadata() - @Expose({ name: "notification_level_when_replying" }) notificationLevelWhenReplying: number; - - @SpeakeasyMetadata() - @Expose({ name: "oldest_search_log_date" }) - oldestSearchLogDate?: string; - - @SpeakeasyMetadata() - @Expose({ name: "seen_popups" }) - seenPopups?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "sidebar_link_to_filtered_list" }) - sidebarLinkToFilteredList?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "sidebar_show_count_of_new_items" }) - sidebarShowCountOfNewItems?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "skip_new_user_tips" }) + oldestSearchLogDate?: string | null | undefined; + seenPopups?: Array | null | undefined; + sidebarLinkToFilteredList?: boolean | undefined; + sidebarShowCountOfNewItems?: boolean | undefined; skipNewUserTips: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "text_size" }) textSize: string; - - @SpeakeasyMetadata() - @Expose({ name: "text_size_seq" }) textSizeSeq: number; - - @SpeakeasyMetadata() - @Expose({ name: "theme_ids" }) - themeIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "theme_key_seq" }) + themeIds: Array; themeKeySeq: number; - - @SpeakeasyMetadata() - @Expose({ name: "timezone" }) - timezone: string; - - @SpeakeasyMetadata() - @Expose({ name: "title_count_mode" }) + timezone: string | null; titleCountMode: string; - - @SpeakeasyMetadata() - @Expose({ name: "user_id" }) userId: number; + watchedPrecedenceOverMuted?: boolean | null | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "watched_precedence_over_muted" }) - watchedPrecedenceOverMuted?: boolean; -} - -export class GetUserIdentiyProviderExternalIdUser extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "admin" }) +export type GetUserIdentiyProviderExternalIdUser = { admin: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "allowed_pm_usernames" }) - allowedPmUsernames: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "avatar_template" }) + allowedPmUsernames: Array; avatarTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "badge_count" }) badgeCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "can_be_deleted" }) canBeDeleted: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_change_bio" }) canChangeBio: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_change_location" }) canChangeLocation: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_change_tracking_preferences" }) canChangeTrackingPreferences: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_change_website" }) canChangeWebsite: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_delete_all_posts" }) canDeleteAllPosts: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_edit" }) canEdit: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_edit_email" }) canEditEmail: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_edit_name" }) canEditName: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_edit_username" }) canEditUsername: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_ignore_user" }) canIgnoreUser: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_mute_user" }) canMuteUser: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_send_private_message_to_user" }) canSendPrivateMessageToUser: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_send_private_messages" }) canSendPrivateMessages: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_upload_profile_header" }) canUploadProfileHeader: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_upload_user_card_background" }) canUploadUserCardBackground: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "created_at" }) createdAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "custom_fields" }) - @Type(() => GetUserIdentiyProviderExternalIdCustomFields) customFields: GetUserIdentiyProviderExternalIdCustomFields; - - @SpeakeasyMetadata() - @Expose({ name: "display_sidebar_tags" }) - displaySidebarTags?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "featured_topic" }) - featuredTopic: string; - - @SpeakeasyMetadata() - @Expose({ name: "featured_user_badge_ids" }) - featuredUserBadgeIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "flair_bg_color" }) - flairBgColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_color" }) - flairColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_group_id" }) - flairGroupId: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_name" }) - flairName: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_url" }) - flairUrl: string; - - @SpeakeasyMetadata({ elemType: GetUserIdentiyProviderExternalIdGroupUsers }) - @Expose({ name: "group_users" }) - @Type(() => GetUserIdentiyProviderExternalIdGroupUsers) - groupUsers: GetUserIdentiyProviderExternalIdGroupUsers[]; - - @SpeakeasyMetadata({ elemType: GetUserIdentiyProviderExternalIdGroups }) - @Expose({ name: "groups" }) - @Type(() => GetUserIdentiyProviderExternalIdGroups) - groups: GetUserIdentiyProviderExternalIdGroups[]; - - @SpeakeasyMetadata() - @Expose({ name: "has_title_badges" }) + displaySidebarTags?: boolean | undefined; + featuredTopic: string | null; + featuredUserBadgeIds: Array; + flairBgColor: string | null; + flairColor: string | null; + flairGroupId: string | null; + flairName: string | null; + flairUrl: string | null; + groupUsers: Array; + groups: Array; hasTitleBadges: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "ignored" }) ignored: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "ignored_usernames" }) - ignoredUsernames: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "invited_by" }) - invitedBy: string; - - @SpeakeasyMetadata() - @Expose({ name: "last_posted_at" }) - lastPostedAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "last_seen_at" }) - lastSeenAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "locale" }) - locale: string; - - @SpeakeasyMetadata() - @Expose({ name: "mailing_list_posts_per_day" }) + ignoredUsernames: Array; + invitedBy: string | null; + lastPostedAt: string | null; + lastSeenAt: string | null; + locale: string | null; mailingListPostsPerDay: number; - - @SpeakeasyMetadata() - @Expose({ name: "moderator" }) moderator: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "muted" }) muted: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "muted_category_ids" }) - mutedCategoryIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "muted_tags" }) - mutedTags: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "muted_usernames" }) - mutedUsernames: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) + mutedCategoryIds: Array; + mutedTags: Array; + mutedUsernames: Array; name: string; - - @SpeakeasyMetadata() - @Expose({ name: "pending_count" }) pendingCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "pending_posts_count" }) - pendingPostsCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "post_count" }) + pendingPostsCount?: number | undefined; postCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "primary_group_id" }) - primaryGroupId: string; - - @SpeakeasyMetadata() - @Expose({ name: "primary_group_name" }) - primaryGroupName: string; - - @SpeakeasyMetadata() - @Expose({ name: "profile_view_count" }) + primaryGroupId: string | null; + primaryGroupName: string | null; profileViewCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "recent_time_read" }) recentTimeRead: number; - - @SpeakeasyMetadata() - @Expose({ name: "regular_category_ids" }) - regularCategoryIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "second_factor_backup_enabled" }) - secondFactorBackupEnabled?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "second_factor_enabled" }) + regularCategoryIds: Array; + secondFactorBackupEnabled?: boolean | undefined; secondFactorEnabled: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "sidebar_category_ids" }) - sidebarCategoryIds?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "sidebar_tags" }) - sidebarTags?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "staged" }) + sidebarCategoryIds?: Array | undefined; + sidebarTags?: Array | undefined; staged: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "system_avatar_template" }) systemAvatarTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "system_avatar_upload_id" }) - systemAvatarUploadId: string; - - @SpeakeasyMetadata() - @Expose({ name: "time_read" }) + systemAvatarUploadId: string | null; timeRead: number; - - @SpeakeasyMetadata() - @Expose({ name: "title" }) - title: string; - - @SpeakeasyMetadata() - @Expose({ name: "tracked_category_ids" }) - trackedCategoryIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "tracked_tags" }) - trackedTags: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "trust_level" }) + title: string | null; + trackedCategoryIds: Array; + trackedTags: Array; trustLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "uploaded_avatar_id" }) - uploadedAvatarId: string; - - @SpeakeasyMetadata() - @Expose({ name: "use_logo_small_as_avatar" }) + uploadedAvatarId: string | null; useLogoSmallAsAvatar: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "user_api_keys" }) - userApiKeys: string; - - @SpeakeasyMetadata({ elemType: GetUserIdentiyProviderExternalIdUserAuthTokens }) - @Expose({ name: "user_auth_tokens" }) - @Type(() => GetUserIdentiyProviderExternalIdUserAuthTokens) - userAuthTokens: GetUserIdentiyProviderExternalIdUserAuthTokens[]; - - @SpeakeasyMetadata() - @Expose({ name: "user_fields" }) - @Type(() => GetUserIdentiyProviderExternalIdUserFields) - userFields?: GetUserIdentiyProviderExternalIdUserFields; - - @SpeakeasyMetadata() - @Expose({ name: "user_notification_schedule" }) - @Type(() => GetUserIdentiyProviderExternalIdUserNotificationSchedule) + userApiKeys: string | null; + userAuthTokens: Array; + userFields?: GetUserIdentiyProviderExternalIdUserFields | undefined; userNotificationSchedule: GetUserIdentiyProviderExternalIdUserNotificationSchedule; - - @SpeakeasyMetadata() - @Expose({ name: "user_option" }) - @Type(() => GetUserIdentiyProviderExternalIdUserOption) userOption: GetUserIdentiyProviderExternalIdUserOption; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) username: string; - - @SpeakeasyMetadata() - @Expose({ name: "watched_category_ids" }) - watchedCategoryIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "watched_first_post_category_ids" }) - watchedFirstPostCategoryIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "watched_tags" }) - watchedTags: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "watching_first_post_tags" }) - watchingFirstPostTags: any[]; -} + watchedCategoryIds: Array; + watchedFirstPostCategoryIds: Array; + watchedTags: Array; + watchingFirstPostTags: Array; +}; /** * user response */ -export class GetUserIdentiyProviderExternalIdResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "user" }) - @Type(() => GetUserIdentiyProviderExternalIdUser) +export type GetUserIdentiyProviderExternalIdResponseBody = { user: GetUserIdentiyProviderExternalIdUser; + userBadges: Array; +}; - @SpeakeasyMetadata() - @Expose({ name: "user_badges" }) - userBadges: any[]; +/** @internal */ +export const GetUserIdentiyProviderExternalIdRequest$inboundSchema: z.ZodType< + GetUserIdentiyProviderExternalIdRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + "Api-Key": z.string(), + "Api-Username": z.string(), + external_id: z.string(), + provider: z.string(), + }) + .transform((v) => { + return remap$(v, { + "Api-Key": "apiKey", + "Api-Username": "apiUsername", + external_id: "externalId", + }); + }); + +/** @internal */ +export type GetUserIdentiyProviderExternalIdRequest$Outbound = { + "Api-Key": string; + "Api-Username": string; + external_id: string; + provider: string; +}; + +/** @internal */ +export const GetUserIdentiyProviderExternalIdRequest$outboundSchema: z.ZodType< + GetUserIdentiyProviderExternalIdRequest$Outbound, + z.ZodTypeDef, + GetUserIdentiyProviderExternalIdRequest +> = z + .object({ + apiKey: z.string(), + apiUsername: z.string(), + externalId: z.string(), + provider: z.string(), + }) + .transform((v) => { + return remap$(v, { + apiKey: "Api-Key", + apiUsername: "Api-Username", + externalId: "external_id", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserIdentiyProviderExternalIdRequest$ { + /** @deprecated use `GetUserIdentiyProviderExternalIdRequest$inboundSchema` instead. */ + export const inboundSchema = GetUserIdentiyProviderExternalIdRequest$inboundSchema; + /** @deprecated use `GetUserIdentiyProviderExternalIdRequest$outboundSchema` instead. */ + export const outboundSchema = GetUserIdentiyProviderExternalIdRequest$outboundSchema; + /** @deprecated use `GetUserIdentiyProviderExternalIdRequest$Outbound` instead. */ + export type Outbound = GetUserIdentiyProviderExternalIdRequest$Outbound; } -export class GetUserIdentiyProviderExternalIdResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const GetUserIdentiyProviderExternalIdCustomFields$inboundSchema: z.ZodType< + GetUserIdentiyProviderExternalIdCustomFields, + z.ZodTypeDef, + unknown +> = z + .object({ + first_name: z.nullable(z.string()).optional(), + }) + .transform((v) => { + return remap$(v, { + first_name: "firstName", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type GetUserIdentiyProviderExternalIdCustomFields$Outbound = { + first_name?: string | null | undefined; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const GetUserIdentiyProviderExternalIdCustomFields$outboundSchema: z.ZodType< + GetUserIdentiyProviderExternalIdCustomFields$Outbound, + z.ZodTypeDef, + GetUserIdentiyProviderExternalIdCustomFields +> = z + .object({ + firstName: z.nullable(z.string()).optional(), + }) + .transform((v) => { + return remap$(v, { + firstName: "first_name", + }); + }); - /** - * user response - */ - @SpeakeasyMetadata() - object?: GetUserIdentiyProviderExternalIdResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserIdentiyProviderExternalIdCustomFields$ { + /** @deprecated use `GetUserIdentiyProviderExternalIdCustomFields$inboundSchema` instead. */ + export const inboundSchema = GetUserIdentiyProviderExternalIdCustomFields$inboundSchema; + /** @deprecated use `GetUserIdentiyProviderExternalIdCustomFields$outboundSchema` instead. */ + export const outboundSchema = GetUserIdentiyProviderExternalIdCustomFields$outboundSchema; + /** @deprecated use `GetUserIdentiyProviderExternalIdCustomFields$Outbound` instead. */ + export type Outbound = GetUserIdentiyProviderExternalIdCustomFields$Outbound; +} + +/** @internal */ +export const GetUserIdentiyProviderExternalIdGroupUsers$inboundSchema: z.ZodType< + GetUserIdentiyProviderExternalIdGroupUsers, + z.ZodTypeDef, + unknown +> = z + .object({ + group_id: z.number().int(), + notification_level: z.number().int(), + owner: z.boolean().optional(), + user_id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + group_id: "groupId", + notification_level: "notificationLevel", + user_id: "userId", + }); + }); + +/** @internal */ +export type GetUserIdentiyProviderExternalIdGroupUsers$Outbound = { + group_id: number; + notification_level: number; + owner?: boolean | undefined; + user_id: number; +}; + +/** @internal */ +export const GetUserIdentiyProviderExternalIdGroupUsers$outboundSchema: z.ZodType< + GetUserIdentiyProviderExternalIdGroupUsers$Outbound, + z.ZodTypeDef, + GetUserIdentiyProviderExternalIdGroupUsers +> = z + .object({ + groupId: z.number().int(), + notificationLevel: z.number().int(), + owner: z.boolean().optional(), + userId: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + groupId: "group_id", + notificationLevel: "notification_level", + userId: "user_id", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserIdentiyProviderExternalIdGroupUsers$ { + /** @deprecated use `GetUserIdentiyProviderExternalIdGroupUsers$inboundSchema` instead. */ + export const inboundSchema = GetUserIdentiyProviderExternalIdGroupUsers$inboundSchema; + /** @deprecated use `GetUserIdentiyProviderExternalIdGroupUsers$outboundSchema` instead. */ + export const outboundSchema = GetUserIdentiyProviderExternalIdGroupUsers$outboundSchema; + /** @deprecated use `GetUserIdentiyProviderExternalIdGroupUsers$Outbound` instead. */ + export type Outbound = GetUserIdentiyProviderExternalIdGroupUsers$Outbound; +} + +/** @internal */ +export const GetUserIdentiyProviderExternalIdGroups$inboundSchema: z.ZodType< + GetUserIdentiyProviderExternalIdGroups, + z.ZodTypeDef, + unknown +> = z + .object({ + allow_membership_requests: z.boolean(), + automatic: z.boolean(), + bio_cooked: z.nullable(z.string()), + bio_excerpt: z.nullable(z.string()), + bio_raw: z.nullable(z.string()), + can_admin_group: z.boolean(), + can_see_members: z.boolean(), + default_notification_level: z.number().int(), + display_name: z.string(), + flair_bg_color: z.nullable(z.string()), + flair_color: z.nullable(z.string()), + flair_url: z.nullable(z.string()), + full_name: z.nullable(z.string()), + grant_trust_level: z.nullable(z.string()), + has_messages: z.boolean(), + id: z.number().int(), + incoming_email: z.nullable(z.string()), + members_visibility_level: z.number().int(), + membership_request_template: z.nullable(z.string()), + mentionable_level: z.number().int(), + messageable_level: z.number().int(), + name: z.string(), + primary_group: z.boolean(), + public_admission: z.boolean(), + public_exit: z.boolean(), + publish_read_state: z.boolean(), + title: z.nullable(z.string()), + user_count: z.number().int(), + visibility_level: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + allow_membership_requests: "allowMembershipRequests", + bio_cooked: "bioCooked", + bio_excerpt: "bioExcerpt", + bio_raw: "bioRaw", + can_admin_group: "canAdminGroup", + can_see_members: "canSeeMembers", + default_notification_level: "defaultNotificationLevel", + display_name: "displayName", + flair_bg_color: "flairBgColor", + flair_color: "flairColor", + flair_url: "flairUrl", + full_name: "fullName", + grant_trust_level: "grantTrustLevel", + has_messages: "hasMessages", + incoming_email: "incomingEmail", + members_visibility_level: "membersVisibilityLevel", + membership_request_template: "membershipRequestTemplate", + mentionable_level: "mentionableLevel", + messageable_level: "messageableLevel", + primary_group: "primaryGroup", + public_admission: "publicAdmission", + public_exit: "publicExit", + publish_read_state: "publishReadState", + user_count: "userCount", + visibility_level: "visibilityLevel", + }); + }); + +/** @internal */ +export type GetUserIdentiyProviderExternalIdGroups$Outbound = { + allow_membership_requests: boolean; + automatic: boolean; + bio_cooked: string | null; + bio_excerpt: string | null; + bio_raw: string | null; + can_admin_group: boolean; + can_see_members: boolean; + default_notification_level: number; + display_name: string; + flair_bg_color: string | null; + flair_color: string | null; + flair_url: string | null; + full_name: string | null; + grant_trust_level: string | null; + has_messages: boolean; + id: number; + incoming_email: string | null; + members_visibility_level: number; + membership_request_template: string | null; + mentionable_level: number; + messageable_level: number; + name: string; + primary_group: boolean; + public_admission: boolean; + public_exit: boolean; + publish_read_state: boolean; + title: string | null; + user_count: number; + visibility_level: number; +}; + +/** @internal */ +export const GetUserIdentiyProviderExternalIdGroups$outboundSchema: z.ZodType< + GetUserIdentiyProviderExternalIdGroups$Outbound, + z.ZodTypeDef, + GetUserIdentiyProviderExternalIdGroups +> = z + .object({ + allowMembershipRequests: z.boolean(), + automatic: z.boolean(), + bioCooked: z.nullable(z.string()), + bioExcerpt: z.nullable(z.string()), + bioRaw: z.nullable(z.string()), + canAdminGroup: z.boolean(), + canSeeMembers: z.boolean(), + defaultNotificationLevel: z.number().int(), + displayName: z.string(), + flairBgColor: z.nullable(z.string()), + flairColor: z.nullable(z.string()), + flairUrl: z.nullable(z.string()), + fullName: z.nullable(z.string()), + grantTrustLevel: z.nullable(z.string()), + hasMessages: z.boolean(), + id: z.number().int(), + incomingEmail: z.nullable(z.string()), + membersVisibilityLevel: z.number().int(), + membershipRequestTemplate: z.nullable(z.string()), + mentionableLevel: z.number().int(), + messageableLevel: z.number().int(), + name: z.string(), + primaryGroup: z.boolean(), + publicAdmission: z.boolean(), + publicExit: z.boolean(), + publishReadState: z.boolean(), + title: z.nullable(z.string()), + userCount: z.number().int(), + visibilityLevel: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + allowMembershipRequests: "allow_membership_requests", + bioCooked: "bio_cooked", + bioExcerpt: "bio_excerpt", + bioRaw: "bio_raw", + canAdminGroup: "can_admin_group", + canSeeMembers: "can_see_members", + defaultNotificationLevel: "default_notification_level", + displayName: "display_name", + flairBgColor: "flair_bg_color", + flairColor: "flair_color", + flairUrl: "flair_url", + fullName: "full_name", + grantTrustLevel: "grant_trust_level", + hasMessages: "has_messages", + incomingEmail: "incoming_email", + membersVisibilityLevel: "members_visibility_level", + membershipRequestTemplate: "membership_request_template", + mentionableLevel: "mentionable_level", + messageableLevel: "messageable_level", + primaryGroup: "primary_group", + publicAdmission: "public_admission", + publicExit: "public_exit", + publishReadState: "publish_read_state", + userCount: "user_count", + visibilityLevel: "visibility_level", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserIdentiyProviderExternalIdGroups$ { + /** @deprecated use `GetUserIdentiyProviderExternalIdGroups$inboundSchema` instead. */ + export const inboundSchema = GetUserIdentiyProviderExternalIdGroups$inboundSchema; + /** @deprecated use `GetUserIdentiyProviderExternalIdGroups$outboundSchema` instead. */ + export const outboundSchema = GetUserIdentiyProviderExternalIdGroups$outboundSchema; + /** @deprecated use `GetUserIdentiyProviderExternalIdGroups$Outbound` instead. */ + export type Outbound = GetUserIdentiyProviderExternalIdGroups$Outbound; +} + +/** @internal */ +export const GetUserIdentiyProviderExternalIdUserAuthTokens$inboundSchema: z.ZodType< + GetUserIdentiyProviderExternalIdUserAuthTokens, + z.ZodTypeDef, + unknown +> = z + .object({ + browser: z.string(), + client_ip: z.string(), + created_at: z.string(), + device: z.string(), + icon: z.string(), + id: z.number().int(), + is_active: z.boolean(), + location: z.string(), + os: z.string(), + seen_at: z.string(), + }) + .transform((v) => { + return remap$(v, { + client_ip: "clientIp", + created_at: "createdAt", + is_active: "isActive", + seen_at: "seenAt", + }); + }); + +/** @internal */ +export type GetUserIdentiyProviderExternalIdUserAuthTokens$Outbound = { + browser: string; + client_ip: string; + created_at: string; + device: string; + icon: string; + id: number; + is_active: boolean; + location: string; + os: string; + seen_at: string; +}; + +/** @internal */ +export const GetUserIdentiyProviderExternalIdUserAuthTokens$outboundSchema: z.ZodType< + GetUserIdentiyProviderExternalIdUserAuthTokens$Outbound, + z.ZodTypeDef, + GetUserIdentiyProviderExternalIdUserAuthTokens +> = z + .object({ + browser: z.string(), + clientIp: z.string(), + createdAt: z.string(), + device: z.string(), + icon: z.string(), + id: z.number().int(), + isActive: z.boolean(), + location: z.string(), + os: z.string(), + seenAt: z.string(), + }) + .transform((v) => { + return remap$(v, { + clientIp: "client_ip", + createdAt: "created_at", + isActive: "is_active", + seenAt: "seen_at", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserIdentiyProviderExternalIdUserAuthTokens$ { + /** @deprecated use `GetUserIdentiyProviderExternalIdUserAuthTokens$inboundSchema` instead. */ + export const inboundSchema = GetUserIdentiyProviderExternalIdUserAuthTokens$inboundSchema; + /** @deprecated use `GetUserIdentiyProviderExternalIdUserAuthTokens$outboundSchema` instead. */ + export const outboundSchema = GetUserIdentiyProviderExternalIdUserAuthTokens$outboundSchema; + /** @deprecated use `GetUserIdentiyProviderExternalIdUserAuthTokens$Outbound` instead. */ + export type Outbound = GetUserIdentiyProviderExternalIdUserAuthTokens$Outbound; +} + +/** @internal */ +export const GetUserIdentiyProviderExternalIdUserFields$inboundSchema: z.ZodType< + GetUserIdentiyProviderExternalIdUserFields, + z.ZodTypeDef, + unknown +> = z + .object({ + "1": z.nullable(z.string()), + "2": z.nullable(z.string()), + }) + .transform((v) => { + return remap$(v, { + "1": "one", + "2": "two", + }); + }); + +/** @internal */ +export type GetUserIdentiyProviderExternalIdUserFields$Outbound = { + "1": string | null; + "2": string | null; +}; + +/** @internal */ +export const GetUserIdentiyProviderExternalIdUserFields$outboundSchema: z.ZodType< + GetUserIdentiyProviderExternalIdUserFields$Outbound, + z.ZodTypeDef, + GetUserIdentiyProviderExternalIdUserFields +> = z + .object({ + one: z.nullable(z.string()), + two: z.nullable(z.string()), + }) + .transform((v) => { + return remap$(v, { + one: "1", + two: "2", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserIdentiyProviderExternalIdUserFields$ { + /** @deprecated use `GetUserIdentiyProviderExternalIdUserFields$inboundSchema` instead. */ + export const inboundSchema = GetUserIdentiyProviderExternalIdUserFields$inboundSchema; + /** @deprecated use `GetUserIdentiyProviderExternalIdUserFields$outboundSchema` instead. */ + export const outboundSchema = GetUserIdentiyProviderExternalIdUserFields$outboundSchema; + /** @deprecated use `GetUserIdentiyProviderExternalIdUserFields$Outbound` instead. */ + export type Outbound = GetUserIdentiyProviderExternalIdUserFields$Outbound; +} + +/** @internal */ +export const GetUserIdentiyProviderExternalIdUserNotificationSchedule$inboundSchema: z.ZodType< + GetUserIdentiyProviderExternalIdUserNotificationSchedule, + z.ZodTypeDef, + unknown +> = z + .object({ + day_0_end_time: z.number().int(), + day_0_start_time: z.number().int(), + day_1_end_time: z.number().int(), + day_1_start_time: z.number().int(), + day_2_end_time: z.number().int(), + day_2_start_time: z.number().int(), + day_3_end_time: z.number().int(), + day_3_start_time: z.number().int(), + day_4_end_time: z.number().int(), + day_4_start_time: z.number().int(), + day_5_end_time: z.number().int(), + day_5_start_time: z.number().int(), + day_6_end_time: z.number().int(), + day_6_start_time: z.number().int(), + enabled: z.boolean(), + }) + .transform((v) => { + return remap$(v, { + day_0_end_time: "day0EndTime", + day_0_start_time: "day0StartTime", + day_1_end_time: "day1EndTime", + day_1_start_time: "day1StartTime", + day_2_end_time: "day2EndTime", + day_2_start_time: "day2StartTime", + day_3_end_time: "day3EndTime", + day_3_start_time: "day3StartTime", + day_4_end_time: "day4EndTime", + day_4_start_time: "day4StartTime", + day_5_end_time: "day5EndTime", + day_5_start_time: "day5StartTime", + day_6_end_time: "day6EndTime", + day_6_start_time: "day6StartTime", + }); + }); + +/** @internal */ +export type GetUserIdentiyProviderExternalIdUserNotificationSchedule$Outbound = { + day_0_end_time: number; + day_0_start_time: number; + day_1_end_time: number; + day_1_start_time: number; + day_2_end_time: number; + day_2_start_time: number; + day_3_end_time: number; + day_3_start_time: number; + day_4_end_time: number; + day_4_start_time: number; + day_5_end_time: number; + day_5_start_time: number; + day_6_end_time: number; + day_6_start_time: number; + enabled: boolean; +}; + +/** @internal */ +export const GetUserIdentiyProviderExternalIdUserNotificationSchedule$outboundSchema: z.ZodType< + GetUserIdentiyProviderExternalIdUserNotificationSchedule$Outbound, + z.ZodTypeDef, + GetUserIdentiyProviderExternalIdUserNotificationSchedule +> = z + .object({ + day0EndTime: z.number().int(), + day0StartTime: z.number().int(), + day1EndTime: z.number().int(), + day1StartTime: z.number().int(), + day2EndTime: z.number().int(), + day2StartTime: z.number().int(), + day3EndTime: z.number().int(), + day3StartTime: z.number().int(), + day4EndTime: z.number().int(), + day4StartTime: z.number().int(), + day5EndTime: z.number().int(), + day5StartTime: z.number().int(), + day6EndTime: z.number().int(), + day6StartTime: z.number().int(), + enabled: z.boolean(), + }) + .transform((v) => { + return remap$(v, { + day0EndTime: "day_0_end_time", + day0StartTime: "day_0_start_time", + day1EndTime: "day_1_end_time", + day1StartTime: "day_1_start_time", + day2EndTime: "day_2_end_time", + day2StartTime: "day_2_start_time", + day3EndTime: "day_3_end_time", + day3StartTime: "day_3_start_time", + day4EndTime: "day_4_end_time", + day4StartTime: "day_4_start_time", + day5EndTime: "day_5_end_time", + day5StartTime: "day_5_start_time", + day6EndTime: "day_6_end_time", + day6StartTime: "day_6_start_time", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserIdentiyProviderExternalIdUserNotificationSchedule$ { + /** @deprecated use `GetUserIdentiyProviderExternalIdUserNotificationSchedule$inboundSchema` instead. */ + export const inboundSchema = + GetUserIdentiyProviderExternalIdUserNotificationSchedule$inboundSchema; + /** @deprecated use `GetUserIdentiyProviderExternalIdUserNotificationSchedule$outboundSchema` instead. */ + export const outboundSchema = + GetUserIdentiyProviderExternalIdUserNotificationSchedule$outboundSchema; + /** @deprecated use `GetUserIdentiyProviderExternalIdUserNotificationSchedule$Outbound` instead. */ + export type Outbound = GetUserIdentiyProviderExternalIdUserNotificationSchedule$Outbound; +} + +/** @internal */ +export const GetUserIdentiyProviderExternalIdUserOption$inboundSchema: z.ZodType< + GetUserIdentiyProviderExternalIdUserOption, + z.ZodTypeDef, + unknown +> = z + .object({ + allow_private_messages: z.boolean(), + auto_track_topics_after_msecs: z.number().int(), + automatically_unpin_topics: z.boolean(), + bookmark_auto_delete_preference: z.number().int().optional(), + color_scheme_id: z.nullable(z.string()), + dark_scheme_id: z.nullable(z.string()), + default_calendar: z.string().optional(), + digest_after_minutes: z.number().int(), + dynamic_favicon: z.boolean(), + email_digests: z.boolean(), + email_in_reply_to: z.boolean(), + email_level: z.number().int(), + email_messages_level: z.number().int(), + email_previous_replies: z.number().int(), + enable_allowed_pm_users: z.boolean(), + enable_defer: z.boolean(), + enable_quoting: z.boolean(), + external_links_in_new_tab: z.boolean(), + hide_profile_and_presence: z.boolean(), + homepage_id: z.nullable(z.string()), + include_tl0_in_digests: z.boolean(), + like_notification_frequency: z.number().int(), + mailing_list_mode: z.boolean(), + mailing_list_mode_frequency: z.number().int(), + new_topic_duration_minutes: z.number().int(), + notification_level_when_replying: z.number().int(), + oldest_search_log_date: z.nullable(z.string()).optional(), + seen_popups: z.nullable(z.array(z.any())).optional(), + sidebar_link_to_filtered_list: z.boolean().optional(), + sidebar_show_count_of_new_items: z.boolean().optional(), + skip_new_user_tips: z.boolean(), + text_size: z.string(), + text_size_seq: z.number().int(), + theme_ids: z.array(z.any()), + theme_key_seq: z.number().int(), + timezone: z.nullable(z.string()), + title_count_mode: z.string(), + user_id: z.number().int(), + watched_precedence_over_muted: z.nullable(z.boolean()).optional(), + }) + .transform((v) => { + return remap$(v, { + allow_private_messages: "allowPrivateMessages", + auto_track_topics_after_msecs: "autoTrackTopicsAfterMsecs", + automatically_unpin_topics: "automaticallyUnpinTopics", + bookmark_auto_delete_preference: "bookmarkAutoDeletePreference", + color_scheme_id: "colorSchemeId", + dark_scheme_id: "darkSchemeId", + default_calendar: "defaultCalendar", + digest_after_minutes: "digestAfterMinutes", + dynamic_favicon: "dynamicFavicon", + email_digests: "emailDigests", + email_in_reply_to: "emailInReplyTo", + email_level: "emailLevel", + email_messages_level: "emailMessagesLevel", + email_previous_replies: "emailPreviousReplies", + enable_allowed_pm_users: "enableAllowedPmUsers", + enable_defer: "enableDefer", + enable_quoting: "enableQuoting", + external_links_in_new_tab: "externalLinksInNewTab", + hide_profile_and_presence: "hideProfileAndPresence", + homepage_id: "homepageId", + include_tl0_in_digests: "includeTl0InDigests", + like_notification_frequency: "likeNotificationFrequency", + mailing_list_mode: "mailingListMode", + mailing_list_mode_frequency: "mailingListModeFrequency", + new_topic_duration_minutes: "newTopicDurationMinutes", + notification_level_when_replying: "notificationLevelWhenReplying", + oldest_search_log_date: "oldestSearchLogDate", + seen_popups: "seenPopups", + sidebar_link_to_filtered_list: "sidebarLinkToFilteredList", + sidebar_show_count_of_new_items: "sidebarShowCountOfNewItems", + skip_new_user_tips: "skipNewUserTips", + text_size: "textSize", + text_size_seq: "textSizeSeq", + theme_ids: "themeIds", + theme_key_seq: "themeKeySeq", + title_count_mode: "titleCountMode", + user_id: "userId", + watched_precedence_over_muted: "watchedPrecedenceOverMuted", + }); + }); + +/** @internal */ +export type GetUserIdentiyProviderExternalIdUserOption$Outbound = { + allow_private_messages: boolean; + auto_track_topics_after_msecs: number; + automatically_unpin_topics: boolean; + bookmark_auto_delete_preference?: number | undefined; + color_scheme_id: string | null; + dark_scheme_id: string | null; + default_calendar?: string | undefined; + digest_after_minutes: number; + dynamic_favicon: boolean; + email_digests: boolean; + email_in_reply_to: boolean; + email_level: number; + email_messages_level: number; + email_previous_replies: number; + enable_allowed_pm_users: boolean; + enable_defer: boolean; + enable_quoting: boolean; + external_links_in_new_tab: boolean; + hide_profile_and_presence: boolean; + homepage_id: string | null; + include_tl0_in_digests: boolean; + like_notification_frequency: number; + mailing_list_mode: boolean; + mailing_list_mode_frequency: number; + new_topic_duration_minutes: number; + notification_level_when_replying: number; + oldest_search_log_date?: string | null | undefined; + seen_popups?: Array | null | undefined; + sidebar_link_to_filtered_list?: boolean | undefined; + sidebar_show_count_of_new_items?: boolean | undefined; + skip_new_user_tips: boolean; + text_size: string; + text_size_seq: number; + theme_ids: Array; + theme_key_seq: number; + timezone: string | null; + title_count_mode: string; + user_id: number; + watched_precedence_over_muted?: boolean | null | undefined; +}; + +/** @internal */ +export const GetUserIdentiyProviderExternalIdUserOption$outboundSchema: z.ZodType< + GetUserIdentiyProviderExternalIdUserOption$Outbound, + z.ZodTypeDef, + GetUserIdentiyProviderExternalIdUserOption +> = z + .object({ + allowPrivateMessages: z.boolean(), + autoTrackTopicsAfterMsecs: z.number().int(), + automaticallyUnpinTopics: z.boolean(), + bookmarkAutoDeletePreference: z.number().int().optional(), + colorSchemeId: z.nullable(z.string()), + darkSchemeId: z.nullable(z.string()), + defaultCalendar: z.string().optional(), + digestAfterMinutes: z.number().int(), + dynamicFavicon: z.boolean(), + emailDigests: z.boolean(), + emailInReplyTo: z.boolean(), + emailLevel: z.number().int(), + emailMessagesLevel: z.number().int(), + emailPreviousReplies: z.number().int(), + enableAllowedPmUsers: z.boolean(), + enableDefer: z.boolean(), + enableQuoting: z.boolean(), + externalLinksInNewTab: z.boolean(), + hideProfileAndPresence: z.boolean(), + homepageId: z.nullable(z.string()), + includeTl0InDigests: z.boolean(), + likeNotificationFrequency: z.number().int(), + mailingListMode: z.boolean(), + mailingListModeFrequency: z.number().int(), + newTopicDurationMinutes: z.number().int(), + notificationLevelWhenReplying: z.number().int(), + oldestSearchLogDate: z.nullable(z.string()).optional(), + seenPopups: z.nullable(z.array(z.any())).optional(), + sidebarLinkToFilteredList: z.boolean().optional(), + sidebarShowCountOfNewItems: z.boolean().optional(), + skipNewUserTips: z.boolean(), + textSize: z.string(), + textSizeSeq: z.number().int(), + themeIds: z.array(z.any()), + themeKeySeq: z.number().int(), + timezone: z.nullable(z.string()), + titleCountMode: z.string(), + userId: z.number().int(), + watchedPrecedenceOverMuted: z.nullable(z.boolean()).optional(), + }) + .transform((v) => { + return remap$(v, { + allowPrivateMessages: "allow_private_messages", + autoTrackTopicsAfterMsecs: "auto_track_topics_after_msecs", + automaticallyUnpinTopics: "automatically_unpin_topics", + bookmarkAutoDeletePreference: "bookmark_auto_delete_preference", + colorSchemeId: "color_scheme_id", + darkSchemeId: "dark_scheme_id", + defaultCalendar: "default_calendar", + digestAfterMinutes: "digest_after_minutes", + dynamicFavicon: "dynamic_favicon", + emailDigests: "email_digests", + emailInReplyTo: "email_in_reply_to", + emailLevel: "email_level", + emailMessagesLevel: "email_messages_level", + emailPreviousReplies: "email_previous_replies", + enableAllowedPmUsers: "enable_allowed_pm_users", + enableDefer: "enable_defer", + enableQuoting: "enable_quoting", + externalLinksInNewTab: "external_links_in_new_tab", + hideProfileAndPresence: "hide_profile_and_presence", + homepageId: "homepage_id", + includeTl0InDigests: "include_tl0_in_digests", + likeNotificationFrequency: "like_notification_frequency", + mailingListMode: "mailing_list_mode", + mailingListModeFrequency: "mailing_list_mode_frequency", + newTopicDurationMinutes: "new_topic_duration_minutes", + notificationLevelWhenReplying: "notification_level_when_replying", + oldestSearchLogDate: "oldest_search_log_date", + seenPopups: "seen_popups", + sidebarLinkToFilteredList: "sidebar_link_to_filtered_list", + sidebarShowCountOfNewItems: "sidebar_show_count_of_new_items", + skipNewUserTips: "skip_new_user_tips", + textSize: "text_size", + textSizeSeq: "text_size_seq", + themeIds: "theme_ids", + themeKeySeq: "theme_key_seq", + titleCountMode: "title_count_mode", + userId: "user_id", + watchedPrecedenceOverMuted: "watched_precedence_over_muted", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserIdentiyProviderExternalIdUserOption$ { + /** @deprecated use `GetUserIdentiyProviderExternalIdUserOption$inboundSchema` instead. */ + export const inboundSchema = GetUserIdentiyProviderExternalIdUserOption$inboundSchema; + /** @deprecated use `GetUserIdentiyProviderExternalIdUserOption$outboundSchema` instead. */ + export const outboundSchema = GetUserIdentiyProviderExternalIdUserOption$outboundSchema; + /** @deprecated use `GetUserIdentiyProviderExternalIdUserOption$Outbound` instead. */ + export type Outbound = GetUserIdentiyProviderExternalIdUserOption$Outbound; +} + +/** @internal */ +export const GetUserIdentiyProviderExternalIdUser$inboundSchema: z.ZodType< + GetUserIdentiyProviderExternalIdUser, + z.ZodTypeDef, + unknown +> = z + .object({ + admin: z.boolean(), + allowed_pm_usernames: z.array(z.any()), + avatar_template: z.string(), + badge_count: z.number().int(), + can_be_deleted: z.boolean(), + can_change_bio: z.boolean(), + can_change_location: z.boolean(), + can_change_tracking_preferences: z.boolean(), + can_change_website: z.boolean(), + can_delete_all_posts: z.boolean(), + can_edit: z.boolean(), + can_edit_email: z.boolean(), + can_edit_name: z.boolean(), + can_edit_username: z.boolean(), + can_ignore_user: z.boolean(), + can_mute_user: z.boolean(), + can_send_private_message_to_user: z.boolean(), + can_send_private_messages: z.boolean(), + can_upload_profile_header: z.boolean(), + can_upload_user_card_background: z.boolean(), + created_at: z.string(), + custom_fields: z.lazy(() => GetUserIdentiyProviderExternalIdCustomFields$inboundSchema), + display_sidebar_tags: z.boolean().optional(), + featured_topic: z.nullable(z.string()), + featured_user_badge_ids: z.array(z.any()), + flair_bg_color: z.nullable(z.string()), + flair_color: z.nullable(z.string()), + flair_group_id: z.nullable(z.string()), + flair_name: z.nullable(z.string()), + flair_url: z.nullable(z.string()), + group_users: z.array( + z.lazy(() => GetUserIdentiyProviderExternalIdGroupUsers$inboundSchema) + ), + groups: z.array(z.lazy(() => GetUserIdentiyProviderExternalIdGroups$inboundSchema)), + has_title_badges: z.boolean(), + id: z.number().int(), + ignored: z.boolean(), + ignored_usernames: z.array(z.any()), + invited_by: z.nullable(z.string()), + last_posted_at: z.nullable(z.string()), + last_seen_at: z.nullable(z.string()), + locale: z.nullable(z.string()), + mailing_list_posts_per_day: z.number().int(), + moderator: z.boolean(), + muted: z.boolean(), + muted_category_ids: z.array(z.any()), + muted_tags: z.array(z.any()), + muted_usernames: z.array(z.any()), + name: z.string(), + pending_count: z.number().int(), + pending_posts_count: z.number().int().optional(), + post_count: z.number().int(), + primary_group_id: z.nullable(z.string()), + primary_group_name: z.nullable(z.string()), + profile_view_count: z.number().int(), + recent_time_read: z.number().int(), + regular_category_ids: z.array(z.any()), + second_factor_backup_enabled: z.boolean().optional(), + second_factor_enabled: z.boolean(), + sidebar_category_ids: z.array(z.any()).optional(), + sidebar_tags: z.array(z.any()).optional(), + staged: z.boolean(), + system_avatar_template: z.string(), + system_avatar_upload_id: z.nullable(z.string()), + time_read: z.number().int(), + title: z.nullable(z.string()), + tracked_category_ids: z.array(z.any()), + tracked_tags: z.array(z.any()), + trust_level: z.number().int(), + uploaded_avatar_id: z.nullable(z.string()), + use_logo_small_as_avatar: z.boolean(), + user_api_keys: z.nullable(z.string()), + user_auth_tokens: z.array( + z.lazy(() => GetUserIdentiyProviderExternalIdUserAuthTokens$inboundSchema) + ), + user_fields: z + .lazy(() => GetUserIdentiyProviderExternalIdUserFields$inboundSchema) + .optional(), + user_notification_schedule: z.lazy( + () => GetUserIdentiyProviderExternalIdUserNotificationSchedule$inboundSchema + ), + user_option: z.lazy(() => GetUserIdentiyProviderExternalIdUserOption$inboundSchema), + username: z.string(), + watched_category_ids: z.array(z.any()), + watched_first_post_category_ids: z.array(z.any()), + watched_tags: z.array(z.any()), + watching_first_post_tags: z.array(z.any()), + }) + .transform((v) => { + return remap$(v, { + allowed_pm_usernames: "allowedPmUsernames", + avatar_template: "avatarTemplate", + badge_count: "badgeCount", + can_be_deleted: "canBeDeleted", + can_change_bio: "canChangeBio", + can_change_location: "canChangeLocation", + can_change_tracking_preferences: "canChangeTrackingPreferences", + can_change_website: "canChangeWebsite", + can_delete_all_posts: "canDeleteAllPosts", + can_edit: "canEdit", + can_edit_email: "canEditEmail", + can_edit_name: "canEditName", + can_edit_username: "canEditUsername", + can_ignore_user: "canIgnoreUser", + can_mute_user: "canMuteUser", + can_send_private_message_to_user: "canSendPrivateMessageToUser", + can_send_private_messages: "canSendPrivateMessages", + can_upload_profile_header: "canUploadProfileHeader", + can_upload_user_card_background: "canUploadUserCardBackground", + created_at: "createdAt", + custom_fields: "customFields", + display_sidebar_tags: "displaySidebarTags", + featured_topic: "featuredTopic", + featured_user_badge_ids: "featuredUserBadgeIds", + flair_bg_color: "flairBgColor", + flair_color: "flairColor", + flair_group_id: "flairGroupId", + flair_name: "flairName", + flair_url: "flairUrl", + group_users: "groupUsers", + has_title_badges: "hasTitleBadges", + ignored_usernames: "ignoredUsernames", + invited_by: "invitedBy", + last_posted_at: "lastPostedAt", + last_seen_at: "lastSeenAt", + mailing_list_posts_per_day: "mailingListPostsPerDay", + muted_category_ids: "mutedCategoryIds", + muted_tags: "mutedTags", + muted_usernames: "mutedUsernames", + pending_count: "pendingCount", + pending_posts_count: "pendingPostsCount", + post_count: "postCount", + primary_group_id: "primaryGroupId", + primary_group_name: "primaryGroupName", + profile_view_count: "profileViewCount", + recent_time_read: "recentTimeRead", + regular_category_ids: "regularCategoryIds", + second_factor_backup_enabled: "secondFactorBackupEnabled", + second_factor_enabled: "secondFactorEnabled", + sidebar_category_ids: "sidebarCategoryIds", + sidebar_tags: "sidebarTags", + system_avatar_template: "systemAvatarTemplate", + system_avatar_upload_id: "systemAvatarUploadId", + time_read: "timeRead", + tracked_category_ids: "trackedCategoryIds", + tracked_tags: "trackedTags", + trust_level: "trustLevel", + uploaded_avatar_id: "uploadedAvatarId", + use_logo_small_as_avatar: "useLogoSmallAsAvatar", + user_api_keys: "userApiKeys", + user_auth_tokens: "userAuthTokens", + user_fields: "userFields", + user_notification_schedule: "userNotificationSchedule", + user_option: "userOption", + watched_category_ids: "watchedCategoryIds", + watched_first_post_category_ids: "watchedFirstPostCategoryIds", + watched_tags: "watchedTags", + watching_first_post_tags: "watchingFirstPostTags", + }); + }); + +/** @internal */ +export type GetUserIdentiyProviderExternalIdUser$Outbound = { + admin: boolean; + allowed_pm_usernames: Array; + avatar_template: string; + badge_count: number; + can_be_deleted: boolean; + can_change_bio: boolean; + can_change_location: boolean; + can_change_tracking_preferences: boolean; + can_change_website: boolean; + can_delete_all_posts: boolean; + can_edit: boolean; + can_edit_email: boolean; + can_edit_name: boolean; + can_edit_username: boolean; + can_ignore_user: boolean; + can_mute_user: boolean; + can_send_private_message_to_user: boolean; + can_send_private_messages: boolean; + can_upload_profile_header: boolean; + can_upload_user_card_background: boolean; + created_at: string; + custom_fields: GetUserIdentiyProviderExternalIdCustomFields$Outbound; + display_sidebar_tags?: boolean | undefined; + featured_topic: string | null; + featured_user_badge_ids: Array; + flair_bg_color: string | null; + flair_color: string | null; + flair_group_id: string | null; + flair_name: string | null; + flair_url: string | null; + group_users: Array; + groups: Array; + has_title_badges: boolean; + id: number; + ignored: boolean; + ignored_usernames: Array; + invited_by: string | null; + last_posted_at: string | null; + last_seen_at: string | null; + locale: string | null; + mailing_list_posts_per_day: number; + moderator: boolean; + muted: boolean; + muted_category_ids: Array; + muted_tags: Array; + muted_usernames: Array; + name: string; + pending_count: number; + pending_posts_count?: number | undefined; + post_count: number; + primary_group_id: string | null; + primary_group_name: string | null; + profile_view_count: number; + recent_time_read: number; + regular_category_ids: Array; + second_factor_backup_enabled?: boolean | undefined; + second_factor_enabled: boolean; + sidebar_category_ids?: Array | undefined; + sidebar_tags?: Array | undefined; + staged: boolean; + system_avatar_template: string; + system_avatar_upload_id: string | null; + time_read: number; + title: string | null; + tracked_category_ids: Array; + tracked_tags: Array; + trust_level: number; + uploaded_avatar_id: string | null; + use_logo_small_as_avatar: boolean; + user_api_keys: string | null; + user_auth_tokens: Array; + user_fields?: GetUserIdentiyProviderExternalIdUserFields$Outbound | undefined; + user_notification_schedule: GetUserIdentiyProviderExternalIdUserNotificationSchedule$Outbound; + user_option: GetUserIdentiyProviderExternalIdUserOption$Outbound; + username: string; + watched_category_ids: Array; + watched_first_post_category_ids: Array; + watched_tags: Array; + watching_first_post_tags: Array; +}; + +/** @internal */ +export const GetUserIdentiyProviderExternalIdUser$outboundSchema: z.ZodType< + GetUserIdentiyProviderExternalIdUser$Outbound, + z.ZodTypeDef, + GetUserIdentiyProviderExternalIdUser +> = z + .object({ + admin: z.boolean(), + allowedPmUsernames: z.array(z.any()), + avatarTemplate: z.string(), + badgeCount: z.number().int(), + canBeDeleted: z.boolean(), + canChangeBio: z.boolean(), + canChangeLocation: z.boolean(), + canChangeTrackingPreferences: z.boolean(), + canChangeWebsite: z.boolean(), + canDeleteAllPosts: z.boolean(), + canEdit: z.boolean(), + canEditEmail: z.boolean(), + canEditName: z.boolean(), + canEditUsername: z.boolean(), + canIgnoreUser: z.boolean(), + canMuteUser: z.boolean(), + canSendPrivateMessageToUser: z.boolean(), + canSendPrivateMessages: z.boolean(), + canUploadProfileHeader: z.boolean(), + canUploadUserCardBackground: z.boolean(), + createdAt: z.string(), + customFields: z.lazy(() => GetUserIdentiyProviderExternalIdCustomFields$outboundSchema), + displaySidebarTags: z.boolean().optional(), + featuredTopic: z.nullable(z.string()), + featuredUserBadgeIds: z.array(z.any()), + flairBgColor: z.nullable(z.string()), + flairColor: z.nullable(z.string()), + flairGroupId: z.nullable(z.string()), + flairName: z.nullable(z.string()), + flairUrl: z.nullable(z.string()), + groupUsers: z.array( + z.lazy(() => GetUserIdentiyProviderExternalIdGroupUsers$outboundSchema) + ), + groups: z.array(z.lazy(() => GetUserIdentiyProviderExternalIdGroups$outboundSchema)), + hasTitleBadges: z.boolean(), + id: z.number().int(), + ignored: z.boolean(), + ignoredUsernames: z.array(z.any()), + invitedBy: z.nullable(z.string()), + lastPostedAt: z.nullable(z.string()), + lastSeenAt: z.nullable(z.string()), + locale: z.nullable(z.string()), + mailingListPostsPerDay: z.number().int(), + moderator: z.boolean(), + muted: z.boolean(), + mutedCategoryIds: z.array(z.any()), + mutedTags: z.array(z.any()), + mutedUsernames: z.array(z.any()), + name: z.string(), + pendingCount: z.number().int(), + pendingPostsCount: z.number().int().optional(), + postCount: z.number().int(), + primaryGroupId: z.nullable(z.string()), + primaryGroupName: z.nullable(z.string()), + profileViewCount: z.number().int(), + recentTimeRead: z.number().int(), + regularCategoryIds: z.array(z.any()), + secondFactorBackupEnabled: z.boolean().optional(), + secondFactorEnabled: z.boolean(), + sidebarCategoryIds: z.array(z.any()).optional(), + sidebarTags: z.array(z.any()).optional(), + staged: z.boolean(), + systemAvatarTemplate: z.string(), + systemAvatarUploadId: z.nullable(z.string()), + timeRead: z.number().int(), + title: z.nullable(z.string()), + trackedCategoryIds: z.array(z.any()), + trackedTags: z.array(z.any()), + trustLevel: z.number().int(), + uploadedAvatarId: z.nullable(z.string()), + useLogoSmallAsAvatar: z.boolean(), + userApiKeys: z.nullable(z.string()), + userAuthTokens: z.array( + z.lazy(() => GetUserIdentiyProviderExternalIdUserAuthTokens$outboundSchema) + ), + userFields: z + .lazy(() => GetUserIdentiyProviderExternalIdUserFields$outboundSchema) + .optional(), + userNotificationSchedule: z.lazy( + () => GetUserIdentiyProviderExternalIdUserNotificationSchedule$outboundSchema + ), + userOption: z.lazy(() => GetUserIdentiyProviderExternalIdUserOption$outboundSchema), + username: z.string(), + watchedCategoryIds: z.array(z.any()), + watchedFirstPostCategoryIds: z.array(z.any()), + watchedTags: z.array(z.any()), + watchingFirstPostTags: z.array(z.any()), + }) + .transform((v) => { + return remap$(v, { + allowedPmUsernames: "allowed_pm_usernames", + avatarTemplate: "avatar_template", + badgeCount: "badge_count", + canBeDeleted: "can_be_deleted", + canChangeBio: "can_change_bio", + canChangeLocation: "can_change_location", + canChangeTrackingPreferences: "can_change_tracking_preferences", + canChangeWebsite: "can_change_website", + canDeleteAllPosts: "can_delete_all_posts", + canEdit: "can_edit", + canEditEmail: "can_edit_email", + canEditName: "can_edit_name", + canEditUsername: "can_edit_username", + canIgnoreUser: "can_ignore_user", + canMuteUser: "can_mute_user", + canSendPrivateMessageToUser: "can_send_private_message_to_user", + canSendPrivateMessages: "can_send_private_messages", + canUploadProfileHeader: "can_upload_profile_header", + canUploadUserCardBackground: "can_upload_user_card_background", + createdAt: "created_at", + customFields: "custom_fields", + displaySidebarTags: "display_sidebar_tags", + featuredTopic: "featured_topic", + featuredUserBadgeIds: "featured_user_badge_ids", + flairBgColor: "flair_bg_color", + flairColor: "flair_color", + flairGroupId: "flair_group_id", + flairName: "flair_name", + flairUrl: "flair_url", + groupUsers: "group_users", + hasTitleBadges: "has_title_badges", + ignoredUsernames: "ignored_usernames", + invitedBy: "invited_by", + lastPostedAt: "last_posted_at", + lastSeenAt: "last_seen_at", + mailingListPostsPerDay: "mailing_list_posts_per_day", + mutedCategoryIds: "muted_category_ids", + mutedTags: "muted_tags", + mutedUsernames: "muted_usernames", + pendingCount: "pending_count", + pendingPostsCount: "pending_posts_count", + postCount: "post_count", + primaryGroupId: "primary_group_id", + primaryGroupName: "primary_group_name", + profileViewCount: "profile_view_count", + recentTimeRead: "recent_time_read", + regularCategoryIds: "regular_category_ids", + secondFactorBackupEnabled: "second_factor_backup_enabled", + secondFactorEnabled: "second_factor_enabled", + sidebarCategoryIds: "sidebar_category_ids", + sidebarTags: "sidebar_tags", + systemAvatarTemplate: "system_avatar_template", + systemAvatarUploadId: "system_avatar_upload_id", + timeRead: "time_read", + trackedCategoryIds: "tracked_category_ids", + trackedTags: "tracked_tags", + trustLevel: "trust_level", + uploadedAvatarId: "uploaded_avatar_id", + useLogoSmallAsAvatar: "use_logo_small_as_avatar", + userApiKeys: "user_api_keys", + userAuthTokens: "user_auth_tokens", + userFields: "user_fields", + userNotificationSchedule: "user_notification_schedule", + userOption: "user_option", + watchedCategoryIds: "watched_category_ids", + watchedFirstPostCategoryIds: "watched_first_post_category_ids", + watchedTags: "watched_tags", + watchingFirstPostTags: "watching_first_post_tags", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserIdentiyProviderExternalIdUser$ { + /** @deprecated use `GetUserIdentiyProviderExternalIdUser$inboundSchema` instead. */ + export const inboundSchema = GetUserIdentiyProviderExternalIdUser$inboundSchema; + /** @deprecated use `GetUserIdentiyProviderExternalIdUser$outboundSchema` instead. */ + export const outboundSchema = GetUserIdentiyProviderExternalIdUser$outboundSchema; + /** @deprecated use `GetUserIdentiyProviderExternalIdUser$Outbound` instead. */ + export type Outbound = GetUserIdentiyProviderExternalIdUser$Outbound; +} + +/** @internal */ +export const GetUserIdentiyProviderExternalIdResponseBody$inboundSchema: z.ZodType< + GetUserIdentiyProviderExternalIdResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + user: z.lazy(() => GetUserIdentiyProviderExternalIdUser$inboundSchema), + user_badges: z.array(z.any()), + }) + .transform((v) => { + return remap$(v, { + user_badges: "userBadges", + }); + }); + +/** @internal */ +export type GetUserIdentiyProviderExternalIdResponseBody$Outbound = { + user: GetUserIdentiyProviderExternalIdUser$Outbound; + user_badges: Array; +}; + +/** @internal */ +export const GetUserIdentiyProviderExternalIdResponseBody$outboundSchema: z.ZodType< + GetUserIdentiyProviderExternalIdResponseBody$Outbound, + z.ZodTypeDef, + GetUserIdentiyProviderExternalIdResponseBody +> = z + .object({ + user: z.lazy(() => GetUserIdentiyProviderExternalIdUser$outboundSchema), + userBadges: z.array(z.any()), + }) + .transform((v) => { + return remap$(v, { + userBadges: "user_badges", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserIdentiyProviderExternalIdResponseBody$ { + /** @deprecated use `GetUserIdentiyProviderExternalIdResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetUserIdentiyProviderExternalIdResponseBody$inboundSchema; + /** @deprecated use `GetUserIdentiyProviderExternalIdResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetUserIdentiyProviderExternalIdResponseBody$outboundSchema; + /** @deprecated use `GetUserIdentiyProviderExternalIdResponseBody$Outbound` instead. */ + export type Outbound = GetUserIdentiyProviderExternalIdResponseBody$Outbound; } diff --git a/src/sdk/models/operations/getusersentprivatemessages.ts b/src/sdk/models/operations/getusersentprivatemessages.ts index 8915db8..b4a887f 100644 --- a/src/sdk/models/operations/getusersentprivatemessages.ts +++ b/src/sdk/models/operations/getusersentprivatemessages.ts @@ -1,259 +1,537 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class GetUserSentPrivateMessagesRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=username" }) +export type GetUserSentPrivateMessagesRequest = { username: string; -} +}; -export class GetUserSentPrivateMessagesPosters extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "description" }) - description?: string; +export type GetUserSentPrivateMessagesPosters = { + description?: string | undefined; + extras?: string | undefined; + primaryGroupId?: string | null | undefined; + userId?: number | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "extras" }) - extras?: string; +export type GetUserSentPrivateMessagesTopics = { + allowedUserCount?: number | undefined; + archetype?: string | undefined; + archived?: boolean | undefined; + bookmarked?: boolean | undefined; + bumped?: boolean | undefined; + bumpedAt?: string | undefined; + categoryId?: string | null | undefined; + closed?: boolean | undefined; + createdAt?: string | undefined; + fancyTitle?: string | undefined; + featuredLink?: string | null | undefined; + hasSummary?: boolean | undefined; + highestPostNumber?: number | undefined; + id?: number | undefined; + imageUrl?: string | null | undefined; + lastPostedAt?: string | undefined; + lastPosterUsername?: string | undefined; + lastReadPostNumber?: number | undefined; + likeCount?: number | undefined; + liked?: boolean | undefined; + notificationLevel?: number | undefined; + participants?: Array | undefined; + pinned?: boolean | undefined; + pinnedGlobally?: boolean | undefined; + posters?: Array | undefined; + postsCount?: number | undefined; + replyCount?: number | undefined; + slug?: string | undefined; + title?: string | undefined; + unpinned?: string | null | undefined; + unreadPosts?: number | undefined; + unseen?: boolean | undefined; + views?: number | undefined; + visible?: boolean | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "primary_group_id" }) - primaryGroupId?: string; +export type GetUserSentPrivateMessagesTopicList = { + canCreateTopic?: boolean | undefined; + draft?: string | null | undefined; + draftKey?: string | undefined; + draftSequence?: number | undefined; + perPage?: number | undefined; + topics?: Array | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "user_id" }) - userId?: number; -} - -export class GetUserSentPrivateMessagesTopics extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "allowed_user_count" }) - allowedUserCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "archetype" }) - archetype?: string; - - @SpeakeasyMetadata() - @Expose({ name: "archived" }) - archived?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "bookmarked" }) - bookmarked?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "bumped" }) - bumped?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "bumped_at" }) - bumpedAt?: string; - - @SpeakeasyMetadata() - @Expose({ name: "category_id" }) - categoryId?: string; - - @SpeakeasyMetadata() - @Expose({ name: "closed" }) - closed?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "created_at" }) - createdAt?: string; - - @SpeakeasyMetadata() - @Expose({ name: "fancy_title" }) - fancyTitle?: string; - - @SpeakeasyMetadata() - @Expose({ name: "featured_link" }) - featuredLink?: string; - - @SpeakeasyMetadata() - @Expose({ name: "has_summary" }) - hasSummary?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "highest_post_number" }) - highestPostNumber?: number; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) - id?: number; - - @SpeakeasyMetadata() - @Expose({ name: "image_url" }) - imageUrl?: string; - - @SpeakeasyMetadata() - @Expose({ name: "last_posted_at" }) - lastPostedAt?: string; - - @SpeakeasyMetadata() - @Expose({ name: "last_poster_username" }) - lastPosterUsername?: string; - - @SpeakeasyMetadata() - @Expose({ name: "last_read_post_number" }) - lastReadPostNumber?: number; - - @SpeakeasyMetadata() - @Expose({ name: "like_count" }) - likeCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "liked" }) - liked?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "notification_level" }) - notificationLevel?: number; - - @SpeakeasyMetadata() - @Expose({ name: "participants" }) - participants?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "pinned" }) - pinned?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "pinned_globally" }) - pinnedGlobally?: boolean; - - @SpeakeasyMetadata({ elemType: GetUserSentPrivateMessagesPosters }) - @Expose({ name: "posters" }) - @Type(() => GetUserSentPrivateMessagesPosters) - posters?: GetUserSentPrivateMessagesPosters[]; - - @SpeakeasyMetadata() - @Expose({ name: "posts_count" }) - postsCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "reply_count" }) - replyCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "slug" }) - slug?: string; - - @SpeakeasyMetadata() - @Expose({ name: "title" }) - title?: string; - - @SpeakeasyMetadata() - @Expose({ name: "unpinned" }) - unpinned?: string; - - @SpeakeasyMetadata() - @Expose({ name: "unread_posts" }) - unreadPosts?: number; - - @SpeakeasyMetadata() - @Expose({ name: "unseen" }) - unseen?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "views" }) - views?: number; - - @SpeakeasyMetadata() - @Expose({ name: "visible" }) - visible?: boolean; -} - -export class GetUserSentPrivateMessagesTopicList extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "can_create_topic" }) - canCreateTopic?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "draft" }) - draft?: string; - - @SpeakeasyMetadata() - @Expose({ name: "draft_key" }) - draftKey?: string; - - @SpeakeasyMetadata() - @Expose({ name: "draft_sequence" }) - draftSequence?: number; - - @SpeakeasyMetadata() - @Expose({ name: "per_page" }) - perPage?: number; - - @SpeakeasyMetadata({ elemType: GetUserSentPrivateMessagesTopics }) - @Expose({ name: "topics" }) - @Type(() => GetUserSentPrivateMessagesTopics) - topics?: GetUserSentPrivateMessagesTopics[]; -} - -export class GetUserSentPrivateMessagesUsers extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "avatar_template" }) - avatarTemplate?: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) - id?: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) - name?: string; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) - username?: string; -} +export type GetUserSentPrivateMessagesUsers = { + avatarTemplate?: string | undefined; + id?: number | undefined; + name?: string | null | undefined; + username?: string | undefined; +}; /** * private messages */ -export class GetUserSentPrivateMessagesResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "primary_groups" }) - primaryGroups?: any[]; +export type GetUserSentPrivateMessagesResponseBody = { + primaryGroups?: Array | undefined; + topicList?: GetUserSentPrivateMessagesTopicList | undefined; + users?: Array | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "topic_list" }) - @Type(() => GetUserSentPrivateMessagesTopicList) - topicList?: GetUserSentPrivateMessagesTopicList; +/** @internal */ +export const GetUserSentPrivateMessagesRequest$inboundSchema: z.ZodType< + GetUserSentPrivateMessagesRequest, + z.ZodTypeDef, + unknown +> = z.object({ + username: z.string(), +}); - @SpeakeasyMetadata({ elemType: GetUserSentPrivateMessagesUsers }) - @Expose({ name: "users" }) - @Type(() => GetUserSentPrivateMessagesUsers) - users?: GetUserSentPrivateMessagesUsers[]; +/** @internal */ +export type GetUserSentPrivateMessagesRequest$Outbound = { + username: string; +}; + +/** @internal */ +export const GetUserSentPrivateMessagesRequest$outboundSchema: z.ZodType< + GetUserSentPrivateMessagesRequest$Outbound, + z.ZodTypeDef, + GetUserSentPrivateMessagesRequest +> = z.object({ + username: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserSentPrivateMessagesRequest$ { + /** @deprecated use `GetUserSentPrivateMessagesRequest$inboundSchema` instead. */ + export const inboundSchema = GetUserSentPrivateMessagesRequest$inboundSchema; + /** @deprecated use `GetUserSentPrivateMessagesRequest$outboundSchema` instead. */ + export const outboundSchema = GetUserSentPrivateMessagesRequest$outboundSchema; + /** @deprecated use `GetUserSentPrivateMessagesRequest$Outbound` instead. */ + export type Outbound = GetUserSentPrivateMessagesRequest$Outbound; } -export class GetUserSentPrivateMessagesResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const GetUserSentPrivateMessagesPosters$inboundSchema: z.ZodType< + GetUserSentPrivateMessagesPosters, + z.ZodTypeDef, + unknown +> = z + .object({ + description: z.string().optional(), + extras: z.string().optional(), + primary_group_id: z.nullable(z.string()).optional(), + user_id: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + primary_group_id: "primaryGroupId", + user_id: "userId", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type GetUserSentPrivateMessagesPosters$Outbound = { + description?: string | undefined; + extras?: string | undefined; + primary_group_id?: string | null | undefined; + user_id?: number | undefined; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const GetUserSentPrivateMessagesPosters$outboundSchema: z.ZodType< + GetUserSentPrivateMessagesPosters$Outbound, + z.ZodTypeDef, + GetUserSentPrivateMessagesPosters +> = z + .object({ + description: z.string().optional(), + extras: z.string().optional(), + primaryGroupId: z.nullable(z.string()).optional(), + userId: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + primaryGroupId: "primary_group_id", + userId: "user_id", + }); + }); - /** - * private messages - */ - @SpeakeasyMetadata() - object?: GetUserSentPrivateMessagesResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserSentPrivateMessagesPosters$ { + /** @deprecated use `GetUserSentPrivateMessagesPosters$inboundSchema` instead. */ + export const inboundSchema = GetUserSentPrivateMessagesPosters$inboundSchema; + /** @deprecated use `GetUserSentPrivateMessagesPosters$outboundSchema` instead. */ + export const outboundSchema = GetUserSentPrivateMessagesPosters$outboundSchema; + /** @deprecated use `GetUserSentPrivateMessagesPosters$Outbound` instead. */ + export type Outbound = GetUserSentPrivateMessagesPosters$Outbound; +} + +/** @internal */ +export const GetUserSentPrivateMessagesTopics$inboundSchema: z.ZodType< + GetUserSentPrivateMessagesTopics, + z.ZodTypeDef, + unknown +> = z + .object({ + allowed_user_count: z.number().int().optional(), + archetype: z.string().optional(), + archived: z.boolean().optional(), + bookmarked: z.boolean().optional(), + bumped: z.boolean().optional(), + bumped_at: z.string().optional(), + category_id: z.nullable(z.string()).optional(), + closed: z.boolean().optional(), + created_at: z.string().optional(), + fancy_title: z.string().optional(), + featured_link: z.nullable(z.string()).optional(), + has_summary: z.boolean().optional(), + highest_post_number: z.number().int().optional(), + id: z.number().int().optional(), + image_url: z.nullable(z.string()).optional(), + last_posted_at: z.string().optional(), + last_poster_username: z.string().optional(), + last_read_post_number: z.number().int().optional(), + like_count: z.number().int().optional(), + liked: z.boolean().optional(), + notification_level: z.number().int().optional(), + participants: z.array(z.any()).optional(), + pinned: z.boolean().optional(), + pinned_globally: z.boolean().optional(), + posters: z.array(z.lazy(() => GetUserSentPrivateMessagesPosters$inboundSchema)).optional(), + posts_count: z.number().int().optional(), + reply_count: z.number().int().optional(), + slug: z.string().optional(), + title: z.string().optional(), + unpinned: z.nullable(z.string()).optional(), + unread_posts: z.number().int().optional(), + unseen: z.boolean().optional(), + views: z.number().int().optional(), + visible: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + allowed_user_count: "allowedUserCount", + bumped_at: "bumpedAt", + category_id: "categoryId", + created_at: "createdAt", + fancy_title: "fancyTitle", + featured_link: "featuredLink", + has_summary: "hasSummary", + highest_post_number: "highestPostNumber", + image_url: "imageUrl", + last_posted_at: "lastPostedAt", + last_poster_username: "lastPosterUsername", + last_read_post_number: "lastReadPostNumber", + like_count: "likeCount", + notification_level: "notificationLevel", + pinned_globally: "pinnedGlobally", + posts_count: "postsCount", + reply_count: "replyCount", + unread_posts: "unreadPosts", + }); + }); + +/** @internal */ +export type GetUserSentPrivateMessagesTopics$Outbound = { + allowed_user_count?: number | undefined; + archetype?: string | undefined; + archived?: boolean | undefined; + bookmarked?: boolean | undefined; + bumped?: boolean | undefined; + bumped_at?: string | undefined; + category_id?: string | null | undefined; + closed?: boolean | undefined; + created_at?: string | undefined; + fancy_title?: string | undefined; + featured_link?: string | null | undefined; + has_summary?: boolean | undefined; + highest_post_number?: number | undefined; + id?: number | undefined; + image_url?: string | null | undefined; + last_posted_at?: string | undefined; + last_poster_username?: string | undefined; + last_read_post_number?: number | undefined; + like_count?: number | undefined; + liked?: boolean | undefined; + notification_level?: number | undefined; + participants?: Array | undefined; + pinned?: boolean | undefined; + pinned_globally?: boolean | undefined; + posters?: Array | undefined; + posts_count?: number | undefined; + reply_count?: number | undefined; + slug?: string | undefined; + title?: string | undefined; + unpinned?: string | null | undefined; + unread_posts?: number | undefined; + unseen?: boolean | undefined; + views?: number | undefined; + visible?: boolean | undefined; +}; + +/** @internal */ +export const GetUserSentPrivateMessagesTopics$outboundSchema: z.ZodType< + GetUserSentPrivateMessagesTopics$Outbound, + z.ZodTypeDef, + GetUserSentPrivateMessagesTopics +> = z + .object({ + allowedUserCount: z.number().int().optional(), + archetype: z.string().optional(), + archived: z.boolean().optional(), + bookmarked: z.boolean().optional(), + bumped: z.boolean().optional(), + bumpedAt: z.string().optional(), + categoryId: z.nullable(z.string()).optional(), + closed: z.boolean().optional(), + createdAt: z.string().optional(), + fancyTitle: z.string().optional(), + featuredLink: z.nullable(z.string()).optional(), + hasSummary: z.boolean().optional(), + highestPostNumber: z.number().int().optional(), + id: z.number().int().optional(), + imageUrl: z.nullable(z.string()).optional(), + lastPostedAt: z.string().optional(), + lastPosterUsername: z.string().optional(), + lastReadPostNumber: z.number().int().optional(), + likeCount: z.number().int().optional(), + liked: z.boolean().optional(), + notificationLevel: z.number().int().optional(), + participants: z.array(z.any()).optional(), + pinned: z.boolean().optional(), + pinnedGlobally: z.boolean().optional(), + posters: z.array(z.lazy(() => GetUserSentPrivateMessagesPosters$outboundSchema)).optional(), + postsCount: z.number().int().optional(), + replyCount: z.number().int().optional(), + slug: z.string().optional(), + title: z.string().optional(), + unpinned: z.nullable(z.string()).optional(), + unreadPosts: z.number().int().optional(), + unseen: z.boolean().optional(), + views: z.number().int().optional(), + visible: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + allowedUserCount: "allowed_user_count", + bumpedAt: "bumped_at", + categoryId: "category_id", + createdAt: "created_at", + fancyTitle: "fancy_title", + featuredLink: "featured_link", + hasSummary: "has_summary", + highestPostNumber: "highest_post_number", + imageUrl: "image_url", + lastPostedAt: "last_posted_at", + lastPosterUsername: "last_poster_username", + lastReadPostNumber: "last_read_post_number", + likeCount: "like_count", + notificationLevel: "notification_level", + pinnedGlobally: "pinned_globally", + postsCount: "posts_count", + replyCount: "reply_count", + unreadPosts: "unread_posts", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserSentPrivateMessagesTopics$ { + /** @deprecated use `GetUserSentPrivateMessagesTopics$inboundSchema` instead. */ + export const inboundSchema = GetUserSentPrivateMessagesTopics$inboundSchema; + /** @deprecated use `GetUserSentPrivateMessagesTopics$outboundSchema` instead. */ + export const outboundSchema = GetUserSentPrivateMessagesTopics$outboundSchema; + /** @deprecated use `GetUserSentPrivateMessagesTopics$Outbound` instead. */ + export type Outbound = GetUserSentPrivateMessagesTopics$Outbound; +} + +/** @internal */ +export const GetUserSentPrivateMessagesTopicList$inboundSchema: z.ZodType< + GetUserSentPrivateMessagesTopicList, + z.ZodTypeDef, + unknown +> = z + .object({ + can_create_topic: z.boolean().optional(), + draft: z.nullable(z.string()).optional(), + draft_key: z.string().optional(), + draft_sequence: z.number().int().optional(), + per_page: z.number().int().optional(), + topics: z.array(z.lazy(() => GetUserSentPrivateMessagesTopics$inboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + can_create_topic: "canCreateTopic", + draft_key: "draftKey", + draft_sequence: "draftSequence", + per_page: "perPage", + }); + }); + +/** @internal */ +export type GetUserSentPrivateMessagesTopicList$Outbound = { + can_create_topic?: boolean | undefined; + draft?: string | null | undefined; + draft_key?: string | undefined; + draft_sequence?: number | undefined; + per_page?: number | undefined; + topics?: Array | undefined; +}; + +/** @internal */ +export const GetUserSentPrivateMessagesTopicList$outboundSchema: z.ZodType< + GetUserSentPrivateMessagesTopicList$Outbound, + z.ZodTypeDef, + GetUserSentPrivateMessagesTopicList +> = z + .object({ + canCreateTopic: z.boolean().optional(), + draft: z.nullable(z.string()).optional(), + draftKey: z.string().optional(), + draftSequence: z.number().int().optional(), + perPage: z.number().int().optional(), + topics: z.array(z.lazy(() => GetUserSentPrivateMessagesTopics$outboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + canCreateTopic: "can_create_topic", + draftKey: "draft_key", + draftSequence: "draft_sequence", + perPage: "per_page", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserSentPrivateMessagesTopicList$ { + /** @deprecated use `GetUserSentPrivateMessagesTopicList$inboundSchema` instead. */ + export const inboundSchema = GetUserSentPrivateMessagesTopicList$inboundSchema; + /** @deprecated use `GetUserSentPrivateMessagesTopicList$outboundSchema` instead. */ + export const outboundSchema = GetUserSentPrivateMessagesTopicList$outboundSchema; + /** @deprecated use `GetUserSentPrivateMessagesTopicList$Outbound` instead. */ + export type Outbound = GetUserSentPrivateMessagesTopicList$Outbound; +} + +/** @internal */ +export const GetUserSentPrivateMessagesUsers$inboundSchema: z.ZodType< + GetUserSentPrivateMessagesUsers, + z.ZodTypeDef, + unknown +> = z + .object({ + avatar_template: z.string().optional(), + id: z.number().int().optional(), + name: z.nullable(z.string()).optional(), + username: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + avatar_template: "avatarTemplate", + }); + }); + +/** @internal */ +export type GetUserSentPrivateMessagesUsers$Outbound = { + avatar_template?: string | undefined; + id?: number | undefined; + name?: string | null | undefined; + username?: string | undefined; +}; + +/** @internal */ +export const GetUserSentPrivateMessagesUsers$outboundSchema: z.ZodType< + GetUserSentPrivateMessagesUsers$Outbound, + z.ZodTypeDef, + GetUserSentPrivateMessagesUsers +> = z + .object({ + avatarTemplate: z.string().optional(), + id: z.number().int().optional(), + name: z.nullable(z.string()).optional(), + username: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + avatarTemplate: "avatar_template", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserSentPrivateMessagesUsers$ { + /** @deprecated use `GetUserSentPrivateMessagesUsers$inboundSchema` instead. */ + export const inboundSchema = GetUserSentPrivateMessagesUsers$inboundSchema; + /** @deprecated use `GetUserSentPrivateMessagesUsers$outboundSchema` instead. */ + export const outboundSchema = GetUserSentPrivateMessagesUsers$outboundSchema; + /** @deprecated use `GetUserSentPrivateMessagesUsers$Outbound` instead. */ + export type Outbound = GetUserSentPrivateMessagesUsers$Outbound; +} + +/** @internal */ +export const GetUserSentPrivateMessagesResponseBody$inboundSchema: z.ZodType< + GetUserSentPrivateMessagesResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + primary_groups: z.array(z.any()).optional(), + topic_list: z.lazy(() => GetUserSentPrivateMessagesTopicList$inboundSchema).optional(), + users: z.array(z.lazy(() => GetUserSentPrivateMessagesUsers$inboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + primary_groups: "primaryGroups", + topic_list: "topicList", + }); + }); + +/** @internal */ +export type GetUserSentPrivateMessagesResponseBody$Outbound = { + primary_groups?: Array | undefined; + topic_list?: GetUserSentPrivateMessagesTopicList$Outbound | undefined; + users?: Array | undefined; +}; + +/** @internal */ +export const GetUserSentPrivateMessagesResponseBody$outboundSchema: z.ZodType< + GetUserSentPrivateMessagesResponseBody$Outbound, + z.ZodTypeDef, + GetUserSentPrivateMessagesResponseBody +> = z + .object({ + primaryGroups: z.array(z.any()).optional(), + topicList: z.lazy(() => GetUserSentPrivateMessagesTopicList$outboundSchema).optional(), + users: z.array(z.lazy(() => GetUserSentPrivateMessagesUsers$outboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + primaryGroups: "primary_groups", + topicList: "topic_list", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetUserSentPrivateMessagesResponseBody$ { + /** @deprecated use `GetUserSentPrivateMessagesResponseBody$inboundSchema` instead. */ + export const inboundSchema = GetUserSentPrivateMessagesResponseBody$inboundSchema; + /** @deprecated use `GetUserSentPrivateMessagesResponseBody$outboundSchema` instead. */ + export const outboundSchema = GetUserSentPrivateMessagesResponseBody$outboundSchema; + /** @deprecated use `GetUserSentPrivateMessagesResponseBody$Outbound` instead. */ + export type Outbound = GetUserSentPrivateMessagesResponseBody$Outbound; } diff --git a/src/sdk/models/operations/index.ts b/src/sdk/models/operations/index.ts index e8f1ece..44398f7 100644 --- a/src/sdk/models/operations/index.ts +++ b/src/sdk/models/operations/index.ts @@ -1,89 +1,89 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -export * from "./abortmultipart"; -export * from "./activateuser"; -export * from "./addgroupmembers"; -export * from "./admingetuser"; -export * from "./adminlistbadges"; -export * from "./adminlistusers"; -export * from "./anonymizeuser"; -export * from "./batchpresignmultipartparts"; -export * from "./bookmarktopic"; -export * from "./changepassword"; -export * from "./completeexternalupload"; -export * from "./completemultipart"; -export * from "./createbackup"; -export * from "./createbadge"; -export * from "./createcategory"; -export * from "./creategroup"; -export * from "./createinvite"; -export * from "./createmultipartupload"; -export * from "./createtaggroup"; -export * from "./createtopicpostpm"; -export * from "./createtopictimer"; -export * from "./createupload"; -export * from "./createuser"; -export * from "./deactivateuser"; -export * from "./deletebadge"; -export * from "./deletegroup"; -export * from "./deletepost"; -export * from "./deleteuser"; -export * from "./downloadbackup"; -export * from "./generatepresignedput"; -export * from "./getbackups"; -export * from "./getcategory"; -export * from "./getgroup"; -export * from "./getnotifications"; -export * from "./getpost"; -export * from "./getsite"; -export * from "./gettag"; -export * from "./gettaggroup"; -export * from "./gettopic"; -export * from "./gettopicbyexternalid"; -export * from "./getuser"; -export * from "./getuseremails"; -export * from "./getuserexternalid"; -export * from "./getuseridentiyproviderexternalid"; -export * from "./getusersentprivatemessages"; -export * from "./invitetotopic"; -export * from "./listcategories"; -export * from "./listcategorytopics"; -export * from "./listgroupmembers"; -export * from "./listgroups"; -export * from "./listlatesttopics"; -export * from "./listposts"; -export * from "./listtaggroups"; -export * from "./listtags"; -export * from "./listtoptopics"; -export * from "./listuseractions"; -export * from "./listuserbadges"; -export * from "./listuserprivatemessages"; -export * from "./listuserspublic"; -export * from "./lockpost"; -export * from "./logoutuser"; -export * from "./marknotificationsasread"; -export * from "./performpostaction"; -export * from "./postreplies"; -export * from "./refreshgravatar"; -export * from "./removegroupmembers"; -export * from "./removetopic"; -export * from "./search"; -export * from "./senddownloadbackupemail"; -export * from "./sendpasswordresetemail"; -export * from "./setnotificationlevel"; -export * from "./silenceuser"; -export * from "./suspenduser"; -export * from "./updateavatar"; -export * from "./updatebadge"; -export * from "./updatecategory"; -export * from "./updateemail"; -export * from "./updategroup"; -export * from "./updatepost"; -export * from "./updatetaggroup"; -export * from "./updatetopic"; -export * from "./updatetopicstatus"; -export * from "./updatetopictimestamp"; -export * from "./updateuser"; -export * from "./updateusername"; +export * from "./abortmultipart.js"; +export * from "./activateuser.js"; +export * from "./addgroupmembers.js"; +export * from "./admingetuser.js"; +export * from "./adminlistbadges.js"; +export * from "./adminlistusers.js"; +export * from "./anonymizeuser.js"; +export * from "./batchpresignmultipartparts.js"; +export * from "./bookmarktopic.js"; +export * from "./changepassword.js"; +export * from "./completeexternalupload.js"; +export * from "./completemultipart.js"; +export * from "./createbackup.js"; +export * from "./createbadge.js"; +export * from "./createcategory.js"; +export * from "./creategroup.js"; +export * from "./createinvite.js"; +export * from "./createmultipartupload.js"; +export * from "./createtaggroup.js"; +export * from "./createtopicpostpm.js"; +export * from "./createtopictimer.js"; +export * from "./createupload.js"; +export * from "./createuser.js"; +export * from "./deactivateuser.js"; +export * from "./deletebadge.js"; +export * from "./deletegroup.js"; +export * from "./deletepost.js"; +export * from "./deleteuser.js"; +export * from "./downloadbackup.js"; +export * from "./generatepresignedput.js"; +export * from "./getbackups.js"; +export * from "./getcategory.js"; +export * from "./getgroup.js"; +export * from "./getnotifications.js"; +export * from "./getpost.js"; +export * from "./getsite.js"; +export * from "./gettag.js"; +export * from "./gettaggroup.js"; +export * from "./gettopic.js"; +export * from "./gettopicbyexternalid.js"; +export * from "./getuser.js"; +export * from "./getuseremails.js"; +export * from "./getuserexternalid.js"; +export * from "./getuseridentiyproviderexternalid.js"; +export * from "./getusersentprivatemessages.js"; +export * from "./invitetotopic.js"; +export * from "./listcategories.js"; +export * from "./listcategorytopics.js"; +export * from "./listgroupmembers.js"; +export * from "./listgroups.js"; +export * from "./listlatesttopics.js"; +export * from "./listposts.js"; +export * from "./listtaggroups.js"; +export * from "./listtags.js"; +export * from "./listtoptopics.js"; +export * from "./listuseractions.js"; +export * from "./listuserbadges.js"; +export * from "./listuserprivatemessages.js"; +export * from "./listuserspublic.js"; +export * from "./lockpost.js"; +export * from "./logoutuser.js"; +export * from "./marknotificationsasread.js"; +export * from "./performpostaction.js"; +export * from "./postreplies.js"; +export * from "./refreshgravatar.js"; +export * from "./removegroupmembers.js"; +export * from "./removetopic.js"; +export * from "./search.js"; +export * from "./senddownloadbackupemail.js"; +export * from "./sendpasswordresetemail.js"; +export * from "./setnotificationlevel.js"; +export * from "./silenceuser.js"; +export * from "./suspenduser.js"; +export * from "./updateavatar.js"; +export * from "./updatebadge.js"; +export * from "./updatecategory.js"; +export * from "./updateemail.js"; +export * from "./updategroup.js"; +export * from "./updatepost.js"; +export * from "./updatetaggroup.js"; +export * from "./updatetopic.js"; +export * from "./updatetopicstatus.js"; +export * from "./updatetopictimestamp.js"; +export * from "./updateuser.js"; +export * from "./updateusername.js"; diff --git a/src/sdk/models/operations/invitetotopic.ts b/src/sdk/models/operations/invitetotopic.ts index c3a8cfd..5de0e7a 100644 --- a/src/sdk/models/operations/invitetotopic.ts +++ b/src/sdk/models/operations/invitetotopic.ts @@ -1,85 +1,222 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class InviteToTopicRequestBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "email" }) - email?: string; +export type InviteToTopicRequestBody = { + email?: string | undefined; + user?: string | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "user" }) - user?: string; -} - -export class InviteToTopicRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Key" }) +export type InviteToTopicRequest = { apiKey: string; - - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Username" }) apiUsername: string; - - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) + requestBody?: InviteToTopicRequestBody | undefined; id: string; +}; - @SpeakeasyMetadata({ data: "request, media_type=application/json" }) - requestBody?: InviteToTopicRequestBody; -} - -export class InviteToTopicUser extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "avatar_template" }) - avatarTemplate?: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) - id?: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) - name?: string; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) - username?: string; -} +export type InviteToTopicUser = { + avatarTemplate?: string | undefined; + id?: number | undefined; + name?: string | undefined; + username?: string | undefined; +}; /** * topic updated */ -export class InviteToTopicResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "user" }) - @Type(() => InviteToTopicUser) - user?: InviteToTopicUser; +export type InviteToTopicResponseBody = { + user?: InviteToTopicUser | undefined; +}; + +/** @internal */ +export const InviteToTopicRequestBody$inboundSchema: z.ZodType< + InviteToTopicRequestBody, + z.ZodTypeDef, + unknown +> = z.object({ + email: z.string().optional(), + user: z.string().optional(), +}); + +/** @internal */ +export type InviteToTopicRequestBody$Outbound = { + email?: string | undefined; + user?: string | undefined; +}; + +/** @internal */ +export const InviteToTopicRequestBody$outboundSchema: z.ZodType< + InviteToTopicRequestBody$Outbound, + z.ZodTypeDef, + InviteToTopicRequestBody +> = z.object({ + email: z.string().optional(), + user: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace InviteToTopicRequestBody$ { + /** @deprecated use `InviteToTopicRequestBody$inboundSchema` instead. */ + export const inboundSchema = InviteToTopicRequestBody$inboundSchema; + /** @deprecated use `InviteToTopicRequestBody$outboundSchema` instead. */ + export const outboundSchema = InviteToTopicRequestBody$outboundSchema; + /** @deprecated use `InviteToTopicRequestBody$Outbound` instead. */ + export type Outbound = InviteToTopicRequestBody$Outbound; } -export class InviteToTopicResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const InviteToTopicRequest$inboundSchema: z.ZodType< + InviteToTopicRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + "Api-Key": z.string(), + "Api-Username": z.string(), + RequestBody: z.lazy(() => InviteToTopicRequestBody$inboundSchema).optional(), + id: z.string(), + }) + .transform((v) => { + return remap$(v, { + "Api-Key": "apiKey", + "Api-Username": "apiUsername", + RequestBody: "requestBody", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type InviteToTopicRequest$Outbound = { + "Api-Key": string; + "Api-Username": string; + RequestBody?: InviteToTopicRequestBody$Outbound | undefined; + id: string; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const InviteToTopicRequest$outboundSchema: z.ZodType< + InviteToTopicRequest$Outbound, + z.ZodTypeDef, + InviteToTopicRequest +> = z + .object({ + apiKey: z.string(), + apiUsername: z.string(), + requestBody: z.lazy(() => InviteToTopicRequestBody$outboundSchema).optional(), + id: z.string(), + }) + .transform((v) => { + return remap$(v, { + apiKey: "Api-Key", + apiUsername: "Api-Username", + requestBody: "RequestBody", + }); + }); - /** - * topic updated - */ - @SpeakeasyMetadata() - object?: InviteToTopicResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace InviteToTopicRequest$ { + /** @deprecated use `InviteToTopicRequest$inboundSchema` instead. */ + export const inboundSchema = InviteToTopicRequest$inboundSchema; + /** @deprecated use `InviteToTopicRequest$outboundSchema` instead. */ + export const outboundSchema = InviteToTopicRequest$outboundSchema; + /** @deprecated use `InviteToTopicRequest$Outbound` instead. */ + export type Outbound = InviteToTopicRequest$Outbound; +} + +/** @internal */ +export const InviteToTopicUser$inboundSchema: z.ZodType = + z + .object({ + avatar_template: z.string().optional(), + id: z.number().int().optional(), + name: z.string().optional(), + username: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + avatar_template: "avatarTemplate", + }); + }); + +/** @internal */ +export type InviteToTopicUser$Outbound = { + avatar_template?: string | undefined; + id?: number | undefined; + name?: string | undefined; + username?: string | undefined; +}; + +/** @internal */ +export const InviteToTopicUser$outboundSchema: z.ZodType< + InviteToTopicUser$Outbound, + z.ZodTypeDef, + InviteToTopicUser +> = z + .object({ + avatarTemplate: z.string().optional(), + id: z.number().int().optional(), + name: z.string().optional(), + username: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + avatarTemplate: "avatar_template", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace InviteToTopicUser$ { + /** @deprecated use `InviteToTopicUser$inboundSchema` instead. */ + export const inboundSchema = InviteToTopicUser$inboundSchema; + /** @deprecated use `InviteToTopicUser$outboundSchema` instead. */ + export const outboundSchema = InviteToTopicUser$outboundSchema; + /** @deprecated use `InviteToTopicUser$Outbound` instead. */ + export type Outbound = InviteToTopicUser$Outbound; +} + +/** @internal */ +export const InviteToTopicResponseBody$inboundSchema: z.ZodType< + InviteToTopicResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + user: z.lazy(() => InviteToTopicUser$inboundSchema).optional(), +}); + +/** @internal */ +export type InviteToTopicResponseBody$Outbound = { + user?: InviteToTopicUser$Outbound | undefined; +}; + +/** @internal */ +export const InviteToTopicResponseBody$outboundSchema: z.ZodType< + InviteToTopicResponseBody$Outbound, + z.ZodTypeDef, + InviteToTopicResponseBody +> = z.object({ + user: z.lazy(() => InviteToTopicUser$outboundSchema).optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace InviteToTopicResponseBody$ { + /** @deprecated use `InviteToTopicResponseBody$inboundSchema` instead. */ + export const inboundSchema = InviteToTopicResponseBody$inboundSchema; + /** @deprecated use `InviteToTopicResponseBody$outboundSchema` instead. */ + export const outboundSchema = InviteToTopicResponseBody$outboundSchema; + /** @deprecated use `InviteToTopicResponseBody$Outbound` instead. */ + export type Outbound = InviteToTopicResponseBody$Outbound; } diff --git a/src/sdk/models/operations/listcategories.ts b/src/sdk/models/operations/listcategories.ts index 2a7d92f..c1f70be 100644 --- a/src/sdk/models/operations/listcategories.ts +++ b/src/sdk/models/operations/listcategories.ts @@ -1,225 +1,435 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class ListCategoriesRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "queryParam, style=form;explode=true;name=include_subcategories" }) - includeSubcategories?: boolean; -} +export type ListCategoriesRequest = { + includeSubcategories?: boolean | undefined; +}; -export class Categories extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "can_edit" }) +export type Categories = { canEdit: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "color" }) color: string; - - @SpeakeasyMetadata() - @Expose({ name: "default_list_filter" }) defaultListFilter: string; - - @SpeakeasyMetadata() - @Expose({ name: "default_top_period" }) defaultTopPeriod: string; - - @SpeakeasyMetadata() - @Expose({ name: "default_view" }) - defaultView: string; - - @SpeakeasyMetadata() - @Expose({ name: "description" }) - description: string; - - @SpeakeasyMetadata() - @Expose({ name: "description_excerpt" }) - descriptionExcerpt: string; - - @SpeakeasyMetadata() - @Expose({ name: "description_text" }) - descriptionText: string; - - @SpeakeasyMetadata() - @Expose({ name: "has_children" }) + defaultView: string | null; + description: string | null; + descriptionExcerpt: string | null; + descriptionText: string | null; hasChildren: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "is_uncategorized" }) - isUncategorized?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "minimum_required_tags" }) + isUncategorized?: boolean | undefined; minimumRequiredTags: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "navigate_to_first_post_after_read" }) navigateToFirstPostAfterRead: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "notification_level" }) notificationLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "num_featured_topics" }) numFeaturedTopics: number; - - @SpeakeasyMetadata() - @Expose({ name: "permission" }) permission: number; - - @SpeakeasyMetadata() - @Expose({ name: "position" }) position: number; - - @SpeakeasyMetadata() - @Expose({ name: "post_count" }) postCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "read_restricted" }) readRestricted: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "show_subcategory_list" }) showSubcategoryList: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "slug" }) slug: string; - - @SpeakeasyMetadata() - @Expose({ name: "sort_ascending" }) - sortAscending: string; - - @SpeakeasyMetadata() - @Expose({ name: "sort_order" }) - sortOrder: string; - - @SpeakeasyMetadata() - @Expose({ name: "subcategory_ids" }) - subcategoryIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "subcategory_list" }) - subcategoryList?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "subcategory_list_style" }) + sortAscending: string | null; + sortOrder: string | null; + subcategoryIds: Array; + subcategoryList?: Array | null | undefined; subcategoryListStyle: string; - - @SpeakeasyMetadata() - @Expose({ name: "text_color" }) textColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "topic_count" }) topicCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "topic_template" }) - topicTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "topic_url" }) - topicUrl: string; - - @SpeakeasyMetadata() - @Expose({ name: "topics_all_time" }) + topicTemplate: string | null; + topicUrl: string | null; topicsAllTime: number; - - @SpeakeasyMetadata() - @Expose({ name: "topics_day" }) topicsDay: number; - - @SpeakeasyMetadata() - @Expose({ name: "topics_month" }) topicsMonth: number; - - @SpeakeasyMetadata() - @Expose({ name: "topics_week" }) topicsWeek: number; - - @SpeakeasyMetadata() - @Expose({ name: "topics_year" }) topicsYear: number; + uploadedBackground: string | null; + uploadedBackgroundDark: string | null; + uploadedLogo: string | null; + uploadedLogoDark: string | null; +}; - @SpeakeasyMetadata() - @Expose({ name: "uploaded_background" }) - uploadedBackground: string; - - @SpeakeasyMetadata() - @Expose({ name: "uploaded_background_dark" }) - uploadedBackgroundDark: string; - - @SpeakeasyMetadata() - @Expose({ name: "uploaded_logo" }) - uploadedLogo: string; - - @SpeakeasyMetadata() - @Expose({ name: "uploaded_logo_dark" }) - uploadedLogoDark: string; -} - -export class CategoryList extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "can_create_category" }) +export type CategoryList = { canCreateCategory: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_create_topic" }) canCreateTopic: boolean; - - @SpeakeasyMetadata({ elemType: Categories }) - @Expose({ name: "categories" }) - @Type(() => Categories) - categories: Categories[]; -} + categories: Array; +}; /** * success response */ -export class ListCategoriesResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "category_list" }) - @Type(() => CategoryList) +export type ListCategoriesResponseBody = { categoryList: CategoryList; +}; + +/** @internal */ +export const ListCategoriesRequest$inboundSchema: z.ZodType< + ListCategoriesRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + include_subcategories: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + include_subcategories: "includeSubcategories", + }); + }); + +/** @internal */ +export type ListCategoriesRequest$Outbound = { + include_subcategories?: boolean | undefined; +}; + +/** @internal */ +export const ListCategoriesRequest$outboundSchema: z.ZodType< + ListCategoriesRequest$Outbound, + z.ZodTypeDef, + ListCategoriesRequest +> = z + .object({ + includeSubcategories: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + includeSubcategories: "include_subcategories", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListCategoriesRequest$ { + /** @deprecated use `ListCategoriesRequest$inboundSchema` instead. */ + export const inboundSchema = ListCategoriesRequest$inboundSchema; + /** @deprecated use `ListCategoriesRequest$outboundSchema` instead. */ + export const outboundSchema = ListCategoriesRequest$outboundSchema; + /** @deprecated use `ListCategoriesRequest$Outbound` instead. */ + export type Outbound = ListCategoriesRequest$Outbound; } -export class ListCategoriesResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const Categories$inboundSchema: z.ZodType = z + .object({ + can_edit: z.boolean(), + color: z.string(), + default_list_filter: z.string(), + default_top_period: z.string(), + default_view: z.nullable(z.string()), + description: z.nullable(z.string()), + description_excerpt: z.nullable(z.string()), + description_text: z.nullable(z.string()), + has_children: z.boolean(), + id: z.number().int(), + is_uncategorized: z.boolean().optional(), + minimum_required_tags: z.number().int(), + name: z.string(), + navigate_to_first_post_after_read: z.boolean(), + notification_level: z.number().int(), + num_featured_topics: z.number().int(), + permission: z.number().int(), + position: z.number().int(), + post_count: z.number().int(), + read_restricted: z.boolean(), + show_subcategory_list: z.boolean(), + slug: z.string(), + sort_ascending: z.nullable(z.string()), + sort_order: z.nullable(z.string()), + subcategory_ids: z.array(z.any()), + subcategory_list: z.nullable(z.array(z.any())).optional(), + subcategory_list_style: z.string(), + text_color: z.string(), + topic_count: z.number().int(), + topic_template: z.nullable(z.string()), + topic_url: z.nullable(z.string()), + topics_all_time: z.number().int(), + topics_day: z.number().int(), + topics_month: z.number().int(), + topics_week: z.number().int(), + topics_year: z.number().int(), + uploaded_background: z.nullable(z.string()), + uploaded_background_dark: z.nullable(z.string()), + uploaded_logo: z.nullable(z.string()), + uploaded_logo_dark: z.nullable(z.string()), + }) + .transform((v) => { + return remap$(v, { + can_edit: "canEdit", + default_list_filter: "defaultListFilter", + default_top_period: "defaultTopPeriod", + default_view: "defaultView", + description_excerpt: "descriptionExcerpt", + description_text: "descriptionText", + has_children: "hasChildren", + is_uncategorized: "isUncategorized", + minimum_required_tags: "minimumRequiredTags", + navigate_to_first_post_after_read: "navigateToFirstPostAfterRead", + notification_level: "notificationLevel", + num_featured_topics: "numFeaturedTopics", + post_count: "postCount", + read_restricted: "readRestricted", + show_subcategory_list: "showSubcategoryList", + sort_ascending: "sortAscending", + sort_order: "sortOrder", + subcategory_ids: "subcategoryIds", + subcategory_list: "subcategoryList", + subcategory_list_style: "subcategoryListStyle", + text_color: "textColor", + topic_count: "topicCount", + topic_template: "topicTemplate", + topic_url: "topicUrl", + topics_all_time: "topicsAllTime", + topics_day: "topicsDay", + topics_month: "topicsMonth", + topics_week: "topicsWeek", + topics_year: "topicsYear", + uploaded_background: "uploadedBackground", + uploaded_background_dark: "uploadedBackgroundDark", + uploaded_logo: "uploadedLogo", + uploaded_logo_dark: "uploadedLogoDark", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type Categories$Outbound = { + can_edit: boolean; + color: string; + default_list_filter: string; + default_top_period: string; + default_view: string | null; + description: string | null; + description_excerpt: string | null; + description_text: string | null; + has_children: boolean; + id: number; + is_uncategorized?: boolean | undefined; + minimum_required_tags: number; + name: string; + navigate_to_first_post_after_read: boolean; + notification_level: number; + num_featured_topics: number; + permission: number; + position: number; + post_count: number; + read_restricted: boolean; + show_subcategory_list: boolean; + slug: string; + sort_ascending: string | null; + sort_order: string | null; + subcategory_ids: Array; + subcategory_list?: Array | null | undefined; + subcategory_list_style: string; + text_color: string; + topic_count: number; + topic_template: string | null; + topic_url: string | null; + topics_all_time: number; + topics_day: number; + topics_month: number; + topics_week: number; + topics_year: number; + uploaded_background: string | null; + uploaded_background_dark: string | null; + uploaded_logo: string | null; + uploaded_logo_dark: string | null; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const Categories$outboundSchema: z.ZodType = z + .object({ + canEdit: z.boolean(), + color: z.string(), + defaultListFilter: z.string(), + defaultTopPeriod: z.string(), + defaultView: z.nullable(z.string()), + description: z.nullable(z.string()), + descriptionExcerpt: z.nullable(z.string()), + descriptionText: z.nullable(z.string()), + hasChildren: z.boolean(), + id: z.number().int(), + isUncategorized: z.boolean().optional(), + minimumRequiredTags: z.number().int(), + name: z.string(), + navigateToFirstPostAfterRead: z.boolean(), + notificationLevel: z.number().int(), + numFeaturedTopics: z.number().int(), + permission: z.number().int(), + position: z.number().int(), + postCount: z.number().int(), + readRestricted: z.boolean(), + showSubcategoryList: z.boolean(), + slug: z.string(), + sortAscending: z.nullable(z.string()), + sortOrder: z.nullable(z.string()), + subcategoryIds: z.array(z.any()), + subcategoryList: z.nullable(z.array(z.any())).optional(), + subcategoryListStyle: z.string(), + textColor: z.string(), + topicCount: z.number().int(), + topicTemplate: z.nullable(z.string()), + topicUrl: z.nullable(z.string()), + topicsAllTime: z.number().int(), + topicsDay: z.number().int(), + topicsMonth: z.number().int(), + topicsWeek: z.number().int(), + topicsYear: z.number().int(), + uploadedBackground: z.nullable(z.string()), + uploadedBackgroundDark: z.nullable(z.string()), + uploadedLogo: z.nullable(z.string()), + uploadedLogoDark: z.nullable(z.string()), + }) + .transform((v) => { + return remap$(v, { + canEdit: "can_edit", + defaultListFilter: "default_list_filter", + defaultTopPeriod: "default_top_period", + defaultView: "default_view", + descriptionExcerpt: "description_excerpt", + descriptionText: "description_text", + hasChildren: "has_children", + isUncategorized: "is_uncategorized", + minimumRequiredTags: "minimum_required_tags", + navigateToFirstPostAfterRead: "navigate_to_first_post_after_read", + notificationLevel: "notification_level", + numFeaturedTopics: "num_featured_topics", + postCount: "post_count", + readRestricted: "read_restricted", + showSubcategoryList: "show_subcategory_list", + sortAscending: "sort_ascending", + sortOrder: "sort_order", + subcategoryIds: "subcategory_ids", + subcategoryList: "subcategory_list", + subcategoryListStyle: "subcategory_list_style", + textColor: "text_color", + topicCount: "topic_count", + topicTemplate: "topic_template", + topicUrl: "topic_url", + topicsAllTime: "topics_all_time", + topicsDay: "topics_day", + topicsMonth: "topics_month", + topicsWeek: "topics_week", + topicsYear: "topics_year", + uploadedBackground: "uploaded_background", + uploadedBackgroundDark: "uploaded_background_dark", + uploadedLogo: "uploaded_logo", + uploadedLogoDark: "uploaded_logo_dark", + }); + }); - /** - * success response - */ - @SpeakeasyMetadata() - object?: ListCategoriesResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Categories$ { + /** @deprecated use `Categories$inboundSchema` instead. */ + export const inboundSchema = Categories$inboundSchema; + /** @deprecated use `Categories$outboundSchema` instead. */ + export const outboundSchema = Categories$outboundSchema; + /** @deprecated use `Categories$Outbound` instead. */ + export type Outbound = Categories$Outbound; +} + +/** @internal */ +export const CategoryList$inboundSchema: z.ZodType = z + .object({ + can_create_category: z.boolean(), + can_create_topic: z.boolean(), + categories: z.array(z.lazy(() => Categories$inboundSchema)), + }) + .transform((v) => { + return remap$(v, { + can_create_category: "canCreateCategory", + can_create_topic: "canCreateTopic", + }); + }); + +/** @internal */ +export type CategoryList$Outbound = { + can_create_category: boolean; + can_create_topic: boolean; + categories: Array; +}; + +/** @internal */ +export const CategoryList$outboundSchema: z.ZodType< + CategoryList$Outbound, + z.ZodTypeDef, + CategoryList +> = z + .object({ + canCreateCategory: z.boolean(), + canCreateTopic: z.boolean(), + categories: z.array(z.lazy(() => Categories$outboundSchema)), + }) + .transform((v) => { + return remap$(v, { + canCreateCategory: "can_create_category", + canCreateTopic: "can_create_topic", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CategoryList$ { + /** @deprecated use `CategoryList$inboundSchema` instead. */ + export const inboundSchema = CategoryList$inboundSchema; + /** @deprecated use `CategoryList$outboundSchema` instead. */ + export const outboundSchema = CategoryList$outboundSchema; + /** @deprecated use `CategoryList$Outbound` instead. */ + export type Outbound = CategoryList$Outbound; +} + +/** @internal */ +export const ListCategoriesResponseBody$inboundSchema: z.ZodType< + ListCategoriesResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + category_list: z.lazy(() => CategoryList$inboundSchema), + }) + .transform((v) => { + return remap$(v, { + category_list: "categoryList", + }); + }); + +/** @internal */ +export type ListCategoriesResponseBody$Outbound = { + category_list: CategoryList$Outbound; +}; + +/** @internal */ +export const ListCategoriesResponseBody$outboundSchema: z.ZodType< + ListCategoriesResponseBody$Outbound, + z.ZodTypeDef, + ListCategoriesResponseBody +> = z + .object({ + categoryList: z.lazy(() => CategoryList$outboundSchema), + }) + .transform((v) => { + return remap$(v, { + categoryList: "category_list", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListCategoriesResponseBody$ { + /** @deprecated use `ListCategoriesResponseBody$inboundSchema` instead. */ + export const inboundSchema = ListCategoriesResponseBody$inboundSchema; + /** @deprecated use `ListCategoriesResponseBody$outboundSchema` instead. */ + export const outboundSchema = ListCategoriesResponseBody$outboundSchema; + /** @deprecated use `ListCategoriesResponseBody$Outbound` instead. */ + export type Outbound = ListCategoriesResponseBody$Outbound; } diff --git a/src/sdk/models/operations/listcategorytopics.ts b/src/sdk/models/operations/listcategorytopics.ts index 60808db..cc30f9b 100644 --- a/src/sdk/models/operations/listcategorytopics.ts +++ b/src/sdk/models/operations/listcategorytopics.ts @@ -1,238 +1,483 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class ListCategoryTopicsRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) +export type ListCategoryTopicsRequest = { id: number; - - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=slug" }) slug: string; -} +}; -export class ListCategoryTopicsPosters extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "description" }) +export type ListCategoryTopicsPosters = { description: string; - - @SpeakeasyMetadata() - @Expose({ name: "extras" }) extras: string; - - @SpeakeasyMetadata() - @Expose({ name: "primary_group_id" }) - primaryGroupId: string; - - @SpeakeasyMetadata() - @Expose({ name: "user_id" }) + primaryGroupId: string | null; userId: number; -} +}; -export class Topics extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "archetype" }) +export type Topics = { archetype: string; - - @SpeakeasyMetadata() - @Expose({ name: "archived" }) archived: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "bookmarked" }) - bookmarked: string; - - @SpeakeasyMetadata() - @Expose({ name: "bumped" }) + bookmarked: string | null; bumped: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "bumped_at" }) bumpedAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "category_id" }) categoryId: number; - - @SpeakeasyMetadata() - @Expose({ name: "closed" }) closed: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "created_at" }) createdAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "excerpt" }) excerpt: string; - - @SpeakeasyMetadata() - @Expose({ name: "fancy_title" }) fancyTitle: string; - - @SpeakeasyMetadata() - @Expose({ name: "featured_link" }) - featuredLink: string; - - @SpeakeasyMetadata() - @Expose({ name: "has_summary" }) + featuredLink: string | null; hasSummary: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "highest_post_number" }) highestPostNumber: number; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "image_url" }) - imageUrl: string; - - @SpeakeasyMetadata() - @Expose({ name: "last_posted_at" }) + imageUrl: string | null; lastPostedAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "last_poster_username" }) lastPosterUsername: string; - - @SpeakeasyMetadata() - @Expose({ name: "like_count" }) likeCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "liked" }) - liked: string; - - @SpeakeasyMetadata() - @Expose({ name: "pinned" }) + liked: string | null; pinned: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "pinned_globally" }) pinnedGlobally: boolean; - - @SpeakeasyMetadata({ elemType: ListCategoryTopicsPosters }) - @Expose({ name: "posters" }) - @Type(() => ListCategoryTopicsPosters) - posters: ListCategoryTopicsPosters[]; - - @SpeakeasyMetadata() - @Expose({ name: "posts_count" }) + posters: Array; postsCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "reply_count" }) replyCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "slug" }) slug: string; - - @SpeakeasyMetadata() - @Expose({ name: "title" }) title: string; - - @SpeakeasyMetadata() - @Expose({ name: "unpinned" }) - unpinned: string; - - @SpeakeasyMetadata() - @Expose({ name: "unseen" }) + unpinned: string | null; unseen: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "views" }) views: number; - - @SpeakeasyMetadata() - @Expose({ name: "visible" }) visible: boolean; -} +}; -export class TopicList extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "can_create_topic" }) +export type TopicList = { canCreateTopic: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "per_page" }) perPage: number; + topTags?: Array | undefined; + topics: Array; +}; - @SpeakeasyMetadata() - @Expose({ name: "top_tags" }) - topTags?: any[]; - - @SpeakeasyMetadata({ elemType: Topics }) - @Expose({ name: "topics" }) - @Type(() => Topics) - topics: Topics[]; -} - -export class Users extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "avatar_template" }) +export type Users = { avatarTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) username: string; -} +}; /** * success response */ -export class ListCategoryTopicsResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "primary_groups" }) - primaryGroups?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "topic_list" }) - @Type(() => TopicList) +export type ListCategoryTopicsResponseBody = { + primaryGroups?: Array | undefined; topicList: TopicList; + users?: Array | undefined; +}; - @SpeakeasyMetadata({ elemType: Users }) - @Expose({ name: "users" }) - @Type(() => Users) - users?: Users[]; +/** @internal */ +export const ListCategoryTopicsRequest$inboundSchema: z.ZodType< + ListCategoryTopicsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.number().int(), + slug: z.string(), +}); + +/** @internal */ +export type ListCategoryTopicsRequest$Outbound = { + id: number; + slug: string; +}; + +/** @internal */ +export const ListCategoryTopicsRequest$outboundSchema: z.ZodType< + ListCategoryTopicsRequest$Outbound, + z.ZodTypeDef, + ListCategoryTopicsRequest +> = z.object({ + id: z.number().int(), + slug: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListCategoryTopicsRequest$ { + /** @deprecated use `ListCategoryTopicsRequest$inboundSchema` instead. */ + export const inboundSchema = ListCategoryTopicsRequest$inboundSchema; + /** @deprecated use `ListCategoryTopicsRequest$outboundSchema` instead. */ + export const outboundSchema = ListCategoryTopicsRequest$outboundSchema; + /** @deprecated use `ListCategoryTopicsRequest$Outbound` instead. */ + export type Outbound = ListCategoryTopicsRequest$Outbound; } -export class ListCategoryTopicsResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const ListCategoryTopicsPosters$inboundSchema: z.ZodType< + ListCategoryTopicsPosters, + z.ZodTypeDef, + unknown +> = z + .object({ + description: z.string(), + extras: z.string(), + primary_group_id: z.nullable(z.string()), + user_id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + primary_group_id: "primaryGroupId", + user_id: "userId", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type ListCategoryTopicsPosters$Outbound = { + description: string; + extras: string; + primary_group_id: string | null; + user_id: number; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const ListCategoryTopicsPosters$outboundSchema: z.ZodType< + ListCategoryTopicsPosters$Outbound, + z.ZodTypeDef, + ListCategoryTopicsPosters +> = z + .object({ + description: z.string(), + extras: z.string(), + primaryGroupId: z.nullable(z.string()), + userId: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + primaryGroupId: "primary_group_id", + userId: "user_id", + }); + }); - /** - * success response - */ - @SpeakeasyMetadata() - object?: ListCategoryTopicsResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListCategoryTopicsPosters$ { + /** @deprecated use `ListCategoryTopicsPosters$inboundSchema` instead. */ + export const inboundSchema = ListCategoryTopicsPosters$inboundSchema; + /** @deprecated use `ListCategoryTopicsPosters$outboundSchema` instead. */ + export const outboundSchema = ListCategoryTopicsPosters$outboundSchema; + /** @deprecated use `ListCategoryTopicsPosters$Outbound` instead. */ + export type Outbound = ListCategoryTopicsPosters$Outbound; +} + +/** @internal */ +export const Topics$inboundSchema: z.ZodType = z + .object({ + archetype: z.string(), + archived: z.boolean(), + bookmarked: z.nullable(z.string()), + bumped: z.boolean(), + bumped_at: z.string(), + category_id: z.number().int(), + closed: z.boolean(), + created_at: z.string(), + excerpt: z.string(), + fancy_title: z.string(), + featured_link: z.nullable(z.string()), + has_summary: z.boolean(), + highest_post_number: z.number().int(), + id: z.number().int(), + image_url: z.nullable(z.string()), + last_posted_at: z.string(), + last_poster_username: z.string(), + like_count: z.number().int(), + liked: z.nullable(z.string()), + pinned: z.boolean(), + pinned_globally: z.boolean(), + posters: z.array(z.lazy(() => ListCategoryTopicsPosters$inboundSchema)), + posts_count: z.number().int(), + reply_count: z.number().int(), + slug: z.string(), + title: z.string(), + unpinned: z.nullable(z.string()), + unseen: z.boolean(), + views: z.number().int(), + visible: z.boolean(), + }) + .transform((v) => { + return remap$(v, { + bumped_at: "bumpedAt", + category_id: "categoryId", + created_at: "createdAt", + fancy_title: "fancyTitle", + featured_link: "featuredLink", + has_summary: "hasSummary", + highest_post_number: "highestPostNumber", + image_url: "imageUrl", + last_posted_at: "lastPostedAt", + last_poster_username: "lastPosterUsername", + like_count: "likeCount", + pinned_globally: "pinnedGlobally", + posts_count: "postsCount", + reply_count: "replyCount", + }); + }); + +/** @internal */ +export type Topics$Outbound = { + archetype: string; + archived: boolean; + bookmarked: string | null; + bumped: boolean; + bumped_at: string; + category_id: number; + closed: boolean; + created_at: string; + excerpt: string; + fancy_title: string; + featured_link: string | null; + has_summary: boolean; + highest_post_number: number; + id: number; + image_url: string | null; + last_posted_at: string; + last_poster_username: string; + like_count: number; + liked: string | null; + pinned: boolean; + pinned_globally: boolean; + posters: Array; + posts_count: number; + reply_count: number; + slug: string; + title: string; + unpinned: string | null; + unseen: boolean; + views: number; + visible: boolean; +}; + +/** @internal */ +export const Topics$outboundSchema: z.ZodType = z + .object({ + archetype: z.string(), + archived: z.boolean(), + bookmarked: z.nullable(z.string()), + bumped: z.boolean(), + bumpedAt: z.string(), + categoryId: z.number().int(), + closed: z.boolean(), + createdAt: z.string(), + excerpt: z.string(), + fancyTitle: z.string(), + featuredLink: z.nullable(z.string()), + hasSummary: z.boolean(), + highestPostNumber: z.number().int(), + id: z.number().int(), + imageUrl: z.nullable(z.string()), + lastPostedAt: z.string(), + lastPosterUsername: z.string(), + likeCount: z.number().int(), + liked: z.nullable(z.string()), + pinned: z.boolean(), + pinnedGlobally: z.boolean(), + posters: z.array(z.lazy(() => ListCategoryTopicsPosters$outboundSchema)), + postsCount: z.number().int(), + replyCount: z.number().int(), + slug: z.string(), + title: z.string(), + unpinned: z.nullable(z.string()), + unseen: z.boolean(), + views: z.number().int(), + visible: z.boolean(), + }) + .transform((v) => { + return remap$(v, { + bumpedAt: "bumped_at", + categoryId: "category_id", + createdAt: "created_at", + fancyTitle: "fancy_title", + featuredLink: "featured_link", + hasSummary: "has_summary", + highestPostNumber: "highest_post_number", + imageUrl: "image_url", + lastPostedAt: "last_posted_at", + lastPosterUsername: "last_poster_username", + likeCount: "like_count", + pinnedGlobally: "pinned_globally", + postsCount: "posts_count", + replyCount: "reply_count", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Topics$ { + /** @deprecated use `Topics$inboundSchema` instead. */ + export const inboundSchema = Topics$inboundSchema; + /** @deprecated use `Topics$outboundSchema` instead. */ + export const outboundSchema = Topics$outboundSchema; + /** @deprecated use `Topics$Outbound` instead. */ + export type Outbound = Topics$Outbound; +} + +/** @internal */ +export const TopicList$inboundSchema: z.ZodType = z + .object({ + can_create_topic: z.boolean(), + per_page: z.number().int(), + top_tags: z.array(z.any()).optional(), + topics: z.array(z.lazy(() => Topics$inboundSchema)), + }) + .transform((v) => { + return remap$(v, { + can_create_topic: "canCreateTopic", + per_page: "perPage", + top_tags: "topTags", + }); + }); + +/** @internal */ +export type TopicList$Outbound = { + can_create_topic: boolean; + per_page: number; + top_tags?: Array | undefined; + topics: Array; +}; + +/** @internal */ +export const TopicList$outboundSchema: z.ZodType = z + .object({ + canCreateTopic: z.boolean(), + perPage: z.number().int(), + topTags: z.array(z.any()).optional(), + topics: z.array(z.lazy(() => Topics$outboundSchema)), + }) + .transform((v) => { + return remap$(v, { + canCreateTopic: "can_create_topic", + perPage: "per_page", + topTags: "top_tags", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TopicList$ { + /** @deprecated use `TopicList$inboundSchema` instead. */ + export const inboundSchema = TopicList$inboundSchema; + /** @deprecated use `TopicList$outboundSchema` instead. */ + export const outboundSchema = TopicList$outboundSchema; + /** @deprecated use `TopicList$Outbound` instead. */ + export type Outbound = TopicList$Outbound; +} + +/** @internal */ +export const Users$inboundSchema: z.ZodType = z + .object({ + avatar_template: z.string(), + id: z.number().int(), + name: z.string(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + avatar_template: "avatarTemplate", + }); + }); + +/** @internal */ +export type Users$Outbound = { + avatar_template: string; + id: number; + name: string; + username: string; +}; + +/** @internal */ +export const Users$outboundSchema: z.ZodType = z + .object({ + avatarTemplate: z.string(), + id: z.number().int(), + name: z.string(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + avatarTemplate: "avatar_template", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Users$ { + /** @deprecated use `Users$inboundSchema` instead. */ + export const inboundSchema = Users$inboundSchema; + /** @deprecated use `Users$outboundSchema` instead. */ + export const outboundSchema = Users$outboundSchema; + /** @deprecated use `Users$Outbound` instead. */ + export type Outbound = Users$Outbound; +} + +/** @internal */ +export const ListCategoryTopicsResponseBody$inboundSchema: z.ZodType< + ListCategoryTopicsResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + primary_groups: z.array(z.any()).optional(), + topic_list: z.lazy(() => TopicList$inboundSchema), + users: z.array(z.lazy(() => Users$inboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + primary_groups: "primaryGroups", + topic_list: "topicList", + }); + }); + +/** @internal */ +export type ListCategoryTopicsResponseBody$Outbound = { + primary_groups?: Array | undefined; + topic_list: TopicList$Outbound; + users?: Array | undefined; +}; + +/** @internal */ +export const ListCategoryTopicsResponseBody$outboundSchema: z.ZodType< + ListCategoryTopicsResponseBody$Outbound, + z.ZodTypeDef, + ListCategoryTopicsResponseBody +> = z + .object({ + primaryGroups: z.array(z.any()).optional(), + topicList: z.lazy(() => TopicList$outboundSchema), + users: z.array(z.lazy(() => Users$outboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + primaryGroups: "primary_groups", + topicList: "topic_list", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListCategoryTopicsResponseBody$ { + /** @deprecated use `ListCategoryTopicsResponseBody$inboundSchema` instead. */ + export const inboundSchema = ListCategoryTopicsResponseBody$inboundSchema; + /** @deprecated use `ListCategoryTopicsResponseBody$outboundSchema` instead. */ + export const outboundSchema = ListCategoryTopicsResponseBody$outboundSchema; + /** @deprecated use `ListCategoryTopicsResponseBody$Outbound` instead. */ + export type Outbound = ListCategoryTopicsResponseBody$Outbound; } diff --git a/src/sdk/models/operations/listgroupmembers.ts b/src/sdk/models/operations/listgroupmembers.ts index ece57e5..e17dbc4 100644 --- a/src/sdk/models/operations/listgroupmembers.ts +++ b/src/sdk/models/operations/listgroupmembers.ts @@ -1,151 +1,304 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class ListGroupMembersRequest extends SpeakeasyBase { +export type ListGroupMembersRequest = { /** * Use group name instead of id */ - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) id: string; -} +}; -export class Members extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "added_at" }) +export type Members = { addedAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "avatar_template" }) avatarTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "last_posted_at" }) lastPostedAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "last_seen_at" }) lastSeenAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) - name: string; - - @SpeakeasyMetadata() - @Expose({ name: "timezone" }) + name: string | null; timezone: string; - - @SpeakeasyMetadata() - @Expose({ name: "title" }) - title: string; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) + title: string | null; username: string; -} +}; -export class Meta extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "limit" }) +export type Meta = { limit: number; - - @SpeakeasyMetadata() - @Expose({ name: "offset" }) offset: number; - - @SpeakeasyMetadata() - @Expose({ name: "total" }) total: number; -} +}; -export class Owners extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "added_at" }) +export type Owners = { addedAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "avatar_template" }) avatarTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "last_posted_at" }) lastPostedAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "last_seen_at" }) lastSeenAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) - name: string; - - @SpeakeasyMetadata() - @Expose({ name: "timezone" }) + name: string | null; timezone: string; - - @SpeakeasyMetadata() - @Expose({ name: "title" }) - title: string; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) + title: string | null; username: string; -} +}; /** * success response */ -export class ListGroupMembersResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata({ elemType: Members }) - @Expose({ name: "members" }) - @Type(() => Members) - members: Members[]; - - @SpeakeasyMetadata() - @Expose({ name: "meta" }) - @Type(() => Meta) +export type ListGroupMembersResponseBody = { + members: Array; meta: Meta; + owners: Array; +}; - @SpeakeasyMetadata({ elemType: Owners }) - @Expose({ name: "owners" }) - @Type(() => Owners) - owners: Owners[]; +/** @internal */ +export const ListGroupMembersRequest$inboundSchema: z.ZodType< + ListGroupMembersRequest, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.string(), +}); + +/** @internal */ +export type ListGroupMembersRequest$Outbound = { + id: string; +}; + +/** @internal */ +export const ListGroupMembersRequest$outboundSchema: z.ZodType< + ListGroupMembersRequest$Outbound, + z.ZodTypeDef, + ListGroupMembersRequest +> = z.object({ + id: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListGroupMembersRequest$ { + /** @deprecated use `ListGroupMembersRequest$inboundSchema` instead. */ + export const inboundSchema = ListGroupMembersRequest$inboundSchema; + /** @deprecated use `ListGroupMembersRequest$outboundSchema` instead. */ + export const outboundSchema = ListGroupMembersRequest$outboundSchema; + /** @deprecated use `ListGroupMembersRequest$Outbound` instead. */ + export type Outbound = ListGroupMembersRequest$Outbound; } -export class ListGroupMembersResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const Members$inboundSchema: z.ZodType = z + .object({ + added_at: z.string(), + avatar_template: z.string(), + id: z.number().int(), + last_posted_at: z.string(), + last_seen_at: z.string(), + name: z.nullable(z.string()), + timezone: z.string(), + title: z.nullable(z.string()), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + added_at: "addedAt", + avatar_template: "avatarTemplate", + last_posted_at: "lastPostedAt", + last_seen_at: "lastSeenAt", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type Members$Outbound = { + added_at: string; + avatar_template: string; + id: number; + last_posted_at: string; + last_seen_at: string; + name: string | null; + timezone: string; + title: string | null; + username: string; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const Members$outboundSchema: z.ZodType = z + .object({ + addedAt: z.string(), + avatarTemplate: z.string(), + id: z.number().int(), + lastPostedAt: z.string(), + lastSeenAt: z.string(), + name: z.nullable(z.string()), + timezone: z.string(), + title: z.nullable(z.string()), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + addedAt: "added_at", + avatarTemplate: "avatar_template", + lastPostedAt: "last_posted_at", + lastSeenAt: "last_seen_at", + }); + }); - /** - * success response - */ - @SpeakeasyMetadata() - object?: ListGroupMembersResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Members$ { + /** @deprecated use `Members$inboundSchema` instead. */ + export const inboundSchema = Members$inboundSchema; + /** @deprecated use `Members$outboundSchema` instead. */ + export const outboundSchema = Members$outboundSchema; + /** @deprecated use `Members$Outbound` instead. */ + export type Outbound = Members$Outbound; +} + +/** @internal */ +export const Meta$inboundSchema: z.ZodType = z.object({ + limit: z.number().int(), + offset: z.number().int(), + total: z.number().int(), +}); + +/** @internal */ +export type Meta$Outbound = { + limit: number; + offset: number; + total: number; +}; + +/** @internal */ +export const Meta$outboundSchema: z.ZodType = z.object({ + limit: z.number().int(), + offset: z.number().int(), + total: z.number().int(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Meta$ { + /** @deprecated use `Meta$inboundSchema` instead. */ + export const inboundSchema = Meta$inboundSchema; + /** @deprecated use `Meta$outboundSchema` instead. */ + export const outboundSchema = Meta$outboundSchema; + /** @deprecated use `Meta$Outbound` instead. */ + export type Outbound = Meta$Outbound; +} + +/** @internal */ +export const Owners$inboundSchema: z.ZodType = z + .object({ + added_at: z.string(), + avatar_template: z.string(), + id: z.number().int(), + last_posted_at: z.string(), + last_seen_at: z.string(), + name: z.nullable(z.string()), + timezone: z.string(), + title: z.nullable(z.string()), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + added_at: "addedAt", + avatar_template: "avatarTemplate", + last_posted_at: "lastPostedAt", + last_seen_at: "lastSeenAt", + }); + }); + +/** @internal */ +export type Owners$Outbound = { + added_at: string; + avatar_template: string; + id: number; + last_posted_at: string; + last_seen_at: string; + name: string | null; + timezone: string; + title: string | null; + username: string; +}; + +/** @internal */ +export const Owners$outboundSchema: z.ZodType = z + .object({ + addedAt: z.string(), + avatarTemplate: z.string(), + id: z.number().int(), + lastPostedAt: z.string(), + lastSeenAt: z.string(), + name: z.nullable(z.string()), + timezone: z.string(), + title: z.nullable(z.string()), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + addedAt: "added_at", + avatarTemplate: "avatar_template", + lastPostedAt: "last_posted_at", + lastSeenAt: "last_seen_at", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Owners$ { + /** @deprecated use `Owners$inboundSchema` instead. */ + export const inboundSchema = Owners$inboundSchema; + /** @deprecated use `Owners$outboundSchema` instead. */ + export const outboundSchema = Owners$outboundSchema; + /** @deprecated use `Owners$Outbound` instead. */ + export type Outbound = Owners$Outbound; +} + +/** @internal */ +export const ListGroupMembersResponseBody$inboundSchema: z.ZodType< + ListGroupMembersResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + members: z.array(z.lazy(() => Members$inboundSchema)), + meta: z.lazy(() => Meta$inboundSchema), + owners: z.array(z.lazy(() => Owners$inboundSchema)), +}); + +/** @internal */ +export type ListGroupMembersResponseBody$Outbound = { + members: Array; + meta: Meta$Outbound; + owners: Array; +}; + +/** @internal */ +export const ListGroupMembersResponseBody$outboundSchema: z.ZodType< + ListGroupMembersResponseBody$Outbound, + z.ZodTypeDef, + ListGroupMembersResponseBody +> = z.object({ + members: z.array(z.lazy(() => Members$outboundSchema)), + meta: z.lazy(() => Meta$outboundSchema), + owners: z.array(z.lazy(() => Owners$outboundSchema)), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListGroupMembersResponseBody$ { + /** @deprecated use `ListGroupMembersResponseBody$inboundSchema` instead. */ + export const inboundSchema = ListGroupMembersResponseBody$inboundSchema; + /** @deprecated use `ListGroupMembersResponseBody$outboundSchema` instead. */ + export const outboundSchema = ListGroupMembersResponseBody$outboundSchema; + /** @deprecated use `ListGroupMembersResponseBody$Outbound` instead. */ + export type Outbound = ListGroupMembersResponseBody$Outbound; } diff --git a/src/sdk/models/operations/listgroups.ts b/src/sdk/models/operations/listgroups.ts index de9b052..e806601 100644 --- a/src/sdk/models/operations/listgroups.ts +++ b/src/sdk/models/operations/listgroups.ts @@ -1,192 +1,345 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class ListGroupsExtras extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "type_filters" }) - typeFilters: any[]; -} +export type ListGroupsExtras = { + typeFilters: Array; +}; -export class Groups extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "allow_membership_requests" }) +export type Groups = { allowMembershipRequests: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "automatic" }) automatic: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "bio_cooked" }) - bioCooked: string; - - @SpeakeasyMetadata() - @Expose({ name: "bio_excerpt" }) - bioExcerpt: string; - - @SpeakeasyMetadata() - @Expose({ name: "bio_raw" }) - bioRaw: string; - - @SpeakeasyMetadata() - @Expose({ name: "can_admin_group" }) + bioCooked: string | null; + bioExcerpt: string | null; + bioRaw: string | null; canAdminGroup: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_edit_group" }) - canEditGroup?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_see_members" }) + canEditGroup?: boolean | undefined; canSeeMembers: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "default_notification_level" }) defaultNotificationLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "display_name" }) displayName: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_bg_color" }) - flairBgColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_color" }) - flairColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_url" }) - flairUrl: string; - - @SpeakeasyMetadata() - @Expose({ name: "full_name" }) - fullName: string; - - @SpeakeasyMetadata() - @Expose({ name: "grant_trust_level" }) - grantTrustLevel: string; - - @SpeakeasyMetadata() - @Expose({ name: "has_messages" }) + flairBgColor: string | null; + flairColor: string | null; + flairUrl: string | null; + fullName: string | null; + grantTrustLevel: string | null; hasMessages: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "incoming_email" }) - incomingEmail: string; - - @SpeakeasyMetadata() - @Expose({ name: "is_group_owner" }) - isGroupOwner?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "is_group_user" }) - isGroupUser?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "members_visibility_level" }) + incomingEmail: string | null; + isGroupOwner?: boolean | undefined; + isGroupUser?: boolean | undefined; membersVisibilityLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "membership_request_template" }) - membershipRequestTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "mentionable_level" }) + membershipRequestTemplate: string | null; mentionableLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "messageable_level" }) messageableLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "primary_group" }) primaryGroup: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "public_admission" }) publicAdmission: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "public_exit" }) publicExit: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "publish_read_state" }) publishReadState: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "title" }) - title: string; - - @SpeakeasyMetadata() - @Expose({ name: "user_count" }) + title: string | null; userCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "visibility_level" }) visibilityLevel: number; -} +}; /** * response */ -export class ListGroupsResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "extras" }) - @Type(() => ListGroupsExtras) +export type ListGroupsResponseBody = { extras: ListGroupsExtras; - - @SpeakeasyMetadata({ elemType: Groups }) - @Expose({ name: "groups" }) - @Type(() => Groups) - groups: Groups[]; - - @SpeakeasyMetadata() - @Expose({ name: "load_more_groups" }) + groups: Array; loadMoreGroups: string; - - @SpeakeasyMetadata() - @Expose({ name: "total_rows_groups" }) totalRowsGroups: number; +}; + +/** @internal */ +export const ListGroupsExtras$inboundSchema: z.ZodType = z + .object({ + type_filters: z.array(z.any()), + }) + .transform((v) => { + return remap$(v, { + type_filters: "typeFilters", + }); + }); + +/** @internal */ +export type ListGroupsExtras$Outbound = { + type_filters: Array; +}; + +/** @internal */ +export const ListGroupsExtras$outboundSchema: z.ZodType< + ListGroupsExtras$Outbound, + z.ZodTypeDef, + ListGroupsExtras +> = z + .object({ + typeFilters: z.array(z.any()), + }) + .transform((v) => { + return remap$(v, { + typeFilters: "type_filters", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListGroupsExtras$ { + /** @deprecated use `ListGroupsExtras$inboundSchema` instead. */ + export const inboundSchema = ListGroupsExtras$inboundSchema; + /** @deprecated use `ListGroupsExtras$outboundSchema` instead. */ + export const outboundSchema = ListGroupsExtras$outboundSchema; + /** @deprecated use `ListGroupsExtras$Outbound` instead. */ + export type Outbound = ListGroupsExtras$Outbound; } -export class ListGroupsResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const Groups$inboundSchema: z.ZodType = z + .object({ + allow_membership_requests: z.boolean(), + automatic: z.boolean(), + bio_cooked: z.nullable(z.string()), + bio_excerpt: z.nullable(z.string()), + bio_raw: z.nullable(z.string()), + can_admin_group: z.boolean(), + can_edit_group: z.boolean().optional(), + can_see_members: z.boolean(), + default_notification_level: z.number().int(), + display_name: z.string(), + flair_bg_color: z.nullable(z.string()), + flair_color: z.nullable(z.string()), + flair_url: z.nullable(z.string()), + full_name: z.nullable(z.string()), + grant_trust_level: z.nullable(z.string()), + has_messages: z.boolean(), + id: z.number().int(), + incoming_email: z.nullable(z.string()), + is_group_owner: z.boolean().optional(), + is_group_user: z.boolean().optional(), + members_visibility_level: z.number().int(), + membership_request_template: z.nullable(z.string()), + mentionable_level: z.number().int(), + messageable_level: z.number().int(), + name: z.string(), + primary_group: z.boolean(), + public_admission: z.boolean(), + public_exit: z.boolean(), + publish_read_state: z.boolean(), + title: z.nullable(z.string()), + user_count: z.number().int(), + visibility_level: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + allow_membership_requests: "allowMembershipRequests", + bio_cooked: "bioCooked", + bio_excerpt: "bioExcerpt", + bio_raw: "bioRaw", + can_admin_group: "canAdminGroup", + can_edit_group: "canEditGroup", + can_see_members: "canSeeMembers", + default_notification_level: "defaultNotificationLevel", + display_name: "displayName", + flair_bg_color: "flairBgColor", + flair_color: "flairColor", + flair_url: "flairUrl", + full_name: "fullName", + grant_trust_level: "grantTrustLevel", + has_messages: "hasMessages", + incoming_email: "incomingEmail", + is_group_owner: "isGroupOwner", + is_group_user: "isGroupUser", + members_visibility_level: "membersVisibilityLevel", + membership_request_template: "membershipRequestTemplate", + mentionable_level: "mentionableLevel", + messageable_level: "messageableLevel", + primary_group: "primaryGroup", + public_admission: "publicAdmission", + public_exit: "publicExit", + publish_read_state: "publishReadState", + user_count: "userCount", + visibility_level: "visibilityLevel", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type Groups$Outbound = { + allow_membership_requests: boolean; + automatic: boolean; + bio_cooked: string | null; + bio_excerpt: string | null; + bio_raw: string | null; + can_admin_group: boolean; + can_edit_group?: boolean | undefined; + can_see_members: boolean; + default_notification_level: number; + display_name: string; + flair_bg_color: string | null; + flair_color: string | null; + flair_url: string | null; + full_name: string | null; + grant_trust_level: string | null; + has_messages: boolean; + id: number; + incoming_email: string | null; + is_group_owner?: boolean | undefined; + is_group_user?: boolean | undefined; + members_visibility_level: number; + membership_request_template: string | null; + mentionable_level: number; + messageable_level: number; + name: string; + primary_group: boolean; + public_admission: boolean; + public_exit: boolean; + publish_read_state: boolean; + title: string | null; + user_count: number; + visibility_level: number; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const Groups$outboundSchema: z.ZodType = z + .object({ + allowMembershipRequests: z.boolean(), + automatic: z.boolean(), + bioCooked: z.nullable(z.string()), + bioExcerpt: z.nullable(z.string()), + bioRaw: z.nullable(z.string()), + canAdminGroup: z.boolean(), + canEditGroup: z.boolean().optional(), + canSeeMembers: z.boolean(), + defaultNotificationLevel: z.number().int(), + displayName: z.string(), + flairBgColor: z.nullable(z.string()), + flairColor: z.nullable(z.string()), + flairUrl: z.nullable(z.string()), + fullName: z.nullable(z.string()), + grantTrustLevel: z.nullable(z.string()), + hasMessages: z.boolean(), + id: z.number().int(), + incomingEmail: z.nullable(z.string()), + isGroupOwner: z.boolean().optional(), + isGroupUser: z.boolean().optional(), + membersVisibilityLevel: z.number().int(), + membershipRequestTemplate: z.nullable(z.string()), + mentionableLevel: z.number().int(), + messageableLevel: z.number().int(), + name: z.string(), + primaryGroup: z.boolean(), + publicAdmission: z.boolean(), + publicExit: z.boolean(), + publishReadState: z.boolean(), + title: z.nullable(z.string()), + userCount: z.number().int(), + visibilityLevel: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + allowMembershipRequests: "allow_membership_requests", + bioCooked: "bio_cooked", + bioExcerpt: "bio_excerpt", + bioRaw: "bio_raw", + canAdminGroup: "can_admin_group", + canEditGroup: "can_edit_group", + canSeeMembers: "can_see_members", + defaultNotificationLevel: "default_notification_level", + displayName: "display_name", + flairBgColor: "flair_bg_color", + flairColor: "flair_color", + flairUrl: "flair_url", + fullName: "full_name", + grantTrustLevel: "grant_trust_level", + hasMessages: "has_messages", + incomingEmail: "incoming_email", + isGroupOwner: "is_group_owner", + isGroupUser: "is_group_user", + membersVisibilityLevel: "members_visibility_level", + membershipRequestTemplate: "membership_request_template", + mentionableLevel: "mentionable_level", + messageableLevel: "messageable_level", + primaryGroup: "primary_group", + publicAdmission: "public_admission", + publicExit: "public_exit", + publishReadState: "publish_read_state", + userCount: "user_count", + visibilityLevel: "visibility_level", + }); + }); - /** - * response - */ - @SpeakeasyMetadata() - object?: ListGroupsResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Groups$ { + /** @deprecated use `Groups$inboundSchema` instead. */ + export const inboundSchema = Groups$inboundSchema; + /** @deprecated use `Groups$outboundSchema` instead. */ + export const outboundSchema = Groups$outboundSchema; + /** @deprecated use `Groups$Outbound` instead. */ + export type Outbound = Groups$Outbound; +} + +/** @internal */ +export const ListGroupsResponseBody$inboundSchema: z.ZodType< + ListGroupsResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + extras: z.lazy(() => ListGroupsExtras$inboundSchema), + groups: z.array(z.lazy(() => Groups$inboundSchema)), + load_more_groups: z.string(), + total_rows_groups: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + load_more_groups: "loadMoreGroups", + total_rows_groups: "totalRowsGroups", + }); + }); + +/** @internal */ +export type ListGroupsResponseBody$Outbound = { + extras: ListGroupsExtras$Outbound; + groups: Array; + load_more_groups: string; + total_rows_groups: number; +}; + +/** @internal */ +export const ListGroupsResponseBody$outboundSchema: z.ZodType< + ListGroupsResponseBody$Outbound, + z.ZodTypeDef, + ListGroupsResponseBody +> = z + .object({ + extras: z.lazy(() => ListGroupsExtras$outboundSchema), + groups: z.array(z.lazy(() => Groups$outboundSchema)), + loadMoreGroups: z.string(), + totalRowsGroups: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + loadMoreGroups: "load_more_groups", + totalRowsGroups: "total_rows_groups", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListGroupsResponseBody$ { + /** @deprecated use `ListGroupsResponseBody$inboundSchema` instead. */ + export const inboundSchema = ListGroupsResponseBody$inboundSchema; + /** @deprecated use `ListGroupsResponseBody$outboundSchema` instead. */ + export const outboundSchema = ListGroupsResponseBody$outboundSchema; + /** @deprecated use `ListGroupsResponseBody$Outbound` instead. */ + export type Outbound = ListGroupsResponseBody$Outbound; } diff --git a/src/sdk/models/operations/listlatesttopics.ts b/src/sdk/models/operations/listlatesttopics.ts index eca3c39..84c1f26 100644 --- a/src/sdk/models/operations/listlatesttopics.ts +++ b/src/sdk/models/operations/listlatesttopics.ts @@ -1,270 +1,565 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class ListLatestTopicsRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Key" }) +export type ListLatestTopicsRequest = { apiKey: string; - - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Username" }) apiUsername: string; - /** * Defaults to `desc`, add `ascending=true` to sort asc */ - @SpeakeasyMetadata({ data: "queryParam, style=form;explode=true;name=ascending" }) - ascending?: string; - + ascending?: string | undefined; /** * Enum: `default`, `created`, `activity`, `views`, `posts`, `category`, `likes`, `op_likes`, `posters` */ - @SpeakeasyMetadata({ data: "queryParam, style=form;explode=true;name=order" }) - order?: string; -} + order?: string | undefined; +}; -export class ListLatestTopicsPosters extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "description" }) - description?: string; +export type ListLatestTopicsPosters = { + description?: string | undefined; + extras?: string | undefined; + primaryGroupId?: string | null | undefined; + userId?: number | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "extras" }) - extras?: string; +export type ListLatestTopicsTopics = { + archetype?: string | undefined; + archived?: boolean | undefined; + bookmarked?: boolean | undefined; + bumped?: boolean | undefined; + bumpedAt?: string | undefined; + categoryId?: number | undefined; + closed?: boolean | undefined; + createdAt?: string | undefined; + fancyTitle?: string | undefined; + featuredLink?: string | null | undefined; + hasSummary?: boolean | undefined; + highestPostNumber?: number | undefined; + id?: number | undefined; + imageUrl?: string | undefined; + lastPostedAt?: string | undefined; + lastPosterUsername?: string | undefined; + lastReadPostNumber?: number | undefined; + likeCount?: number | undefined; + liked?: boolean | undefined; + notificationLevel?: number | undefined; + opLikeCount?: number | undefined; + pinned?: boolean | undefined; + pinnedGlobally?: boolean | undefined; + posters?: Array | undefined; + postsCount?: number | undefined; + replyCount?: number | undefined; + slug?: string | undefined; + title?: string | undefined; + unpinned?: string | null | undefined; + unreadPosts?: number | undefined; + unseen?: boolean | undefined; + views?: number | undefined; + visible?: boolean | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "primary_group_id" }) - primaryGroupId?: string; +export type ListLatestTopicsTopicList = { + canCreateTopic?: boolean | undefined; + draft?: string | null | undefined; + draftKey?: string | undefined; + draftSequence?: number | undefined; + perPage?: number | undefined; + topics?: Array | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "user_id" }) - userId?: number; -} - -export class ListLatestTopicsTopics extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "archetype" }) - archetype?: string; - - @SpeakeasyMetadata() - @Expose({ name: "archived" }) - archived?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "bookmarked" }) - bookmarked?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "bumped" }) - bumped?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "bumped_at" }) - bumpedAt?: string; - - @SpeakeasyMetadata() - @Expose({ name: "category_id" }) - categoryId?: number; - - @SpeakeasyMetadata() - @Expose({ name: "closed" }) - closed?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "created_at" }) - createdAt?: string; - - @SpeakeasyMetadata() - @Expose({ name: "fancy_title" }) - fancyTitle?: string; - - @SpeakeasyMetadata() - @Expose({ name: "featured_link" }) - featuredLink?: string; - - @SpeakeasyMetadata() - @Expose({ name: "has_summary" }) - hasSummary?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "highest_post_number" }) - highestPostNumber?: number; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) - id?: number; - - @SpeakeasyMetadata() - @Expose({ name: "image_url" }) - imageUrl?: string; - - @SpeakeasyMetadata() - @Expose({ name: "last_posted_at" }) - lastPostedAt?: string; - - @SpeakeasyMetadata() - @Expose({ name: "last_poster_username" }) - lastPosterUsername?: string; - - @SpeakeasyMetadata() - @Expose({ name: "last_read_post_number" }) - lastReadPostNumber?: number; - - @SpeakeasyMetadata() - @Expose({ name: "like_count" }) - likeCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "liked" }) - liked?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "notification_level" }) - notificationLevel?: number; - - @SpeakeasyMetadata() - @Expose({ name: "op_like_count" }) - opLikeCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "pinned" }) - pinned?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "pinned_globally" }) - pinnedGlobally?: boolean; - - @SpeakeasyMetadata({ elemType: ListLatestTopicsPosters }) - @Expose({ name: "posters" }) - @Type(() => ListLatestTopicsPosters) - posters?: ListLatestTopicsPosters[]; - - @SpeakeasyMetadata() - @Expose({ name: "posts_count" }) - postsCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "reply_count" }) - replyCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "slug" }) - slug?: string; - - @SpeakeasyMetadata() - @Expose({ name: "title" }) - title?: string; - - @SpeakeasyMetadata() - @Expose({ name: "unpinned" }) - unpinned?: string; - - @SpeakeasyMetadata() - @Expose({ name: "unread_posts" }) - unreadPosts?: number; - - @SpeakeasyMetadata() - @Expose({ name: "unseen" }) - unseen?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "views" }) - views?: number; - - @SpeakeasyMetadata() - @Expose({ name: "visible" }) - visible?: boolean; -} - -export class ListLatestTopicsTopicList extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "can_create_topic" }) - canCreateTopic?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "draft" }) - draft?: string; - - @SpeakeasyMetadata() - @Expose({ name: "draft_key" }) - draftKey?: string; - - @SpeakeasyMetadata() - @Expose({ name: "draft_sequence" }) - draftSequence?: number; - - @SpeakeasyMetadata() - @Expose({ name: "per_page" }) - perPage?: number; - - @SpeakeasyMetadata({ elemType: ListLatestTopicsTopics }) - @Expose({ name: "topics" }) - @Type(() => ListLatestTopicsTopics) - topics?: ListLatestTopicsTopics[]; -} - -export class ListLatestTopicsUsers extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "avatar_template" }) - avatarTemplate?: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) - id?: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) - name?: string; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) - username?: string; -} +export type ListLatestTopicsUsers = { + avatarTemplate?: string | undefined; + id?: number | undefined; + name?: string | null | undefined; + username?: string | undefined; +}; /** * topic updated */ -export class ListLatestTopicsResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "primary_groups" }) - primaryGroups?: any[]; +export type ListLatestTopicsResponseBody = { + primaryGroups?: Array | undefined; + topicList?: ListLatestTopicsTopicList | undefined; + users?: Array | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "topic_list" }) - @Type(() => ListLatestTopicsTopicList) - topicList?: ListLatestTopicsTopicList; +/** @internal */ +export const ListLatestTopicsRequest$inboundSchema: z.ZodType< + ListLatestTopicsRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + "Api-Key": z.string(), + "Api-Username": z.string(), + ascending: z.string().optional(), + order: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + "Api-Key": "apiKey", + "Api-Username": "apiUsername", + }); + }); - @SpeakeasyMetadata({ elemType: ListLatestTopicsUsers }) - @Expose({ name: "users" }) - @Type(() => ListLatestTopicsUsers) - users?: ListLatestTopicsUsers[]; +/** @internal */ +export type ListLatestTopicsRequest$Outbound = { + "Api-Key": string; + "Api-Username": string; + ascending?: string | undefined; + order?: string | undefined; +}; + +/** @internal */ +export const ListLatestTopicsRequest$outboundSchema: z.ZodType< + ListLatestTopicsRequest$Outbound, + z.ZodTypeDef, + ListLatestTopicsRequest +> = z + .object({ + apiKey: z.string(), + apiUsername: z.string(), + ascending: z.string().optional(), + order: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + apiKey: "Api-Key", + apiUsername: "Api-Username", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListLatestTopicsRequest$ { + /** @deprecated use `ListLatestTopicsRequest$inboundSchema` instead. */ + export const inboundSchema = ListLatestTopicsRequest$inboundSchema; + /** @deprecated use `ListLatestTopicsRequest$outboundSchema` instead. */ + export const outboundSchema = ListLatestTopicsRequest$outboundSchema; + /** @deprecated use `ListLatestTopicsRequest$Outbound` instead. */ + export type Outbound = ListLatestTopicsRequest$Outbound; } -export class ListLatestTopicsResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const ListLatestTopicsPosters$inboundSchema: z.ZodType< + ListLatestTopicsPosters, + z.ZodTypeDef, + unknown +> = z + .object({ + description: z.string().optional(), + extras: z.string().optional(), + primary_group_id: z.nullable(z.string()).optional(), + user_id: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + primary_group_id: "primaryGroupId", + user_id: "userId", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type ListLatestTopicsPosters$Outbound = { + description?: string | undefined; + extras?: string | undefined; + primary_group_id?: string | null | undefined; + user_id?: number | undefined; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const ListLatestTopicsPosters$outboundSchema: z.ZodType< + ListLatestTopicsPosters$Outbound, + z.ZodTypeDef, + ListLatestTopicsPosters +> = z + .object({ + description: z.string().optional(), + extras: z.string().optional(), + primaryGroupId: z.nullable(z.string()).optional(), + userId: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + primaryGroupId: "primary_group_id", + userId: "user_id", + }); + }); - /** - * topic updated - */ - @SpeakeasyMetadata() - object?: ListLatestTopicsResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListLatestTopicsPosters$ { + /** @deprecated use `ListLatestTopicsPosters$inboundSchema` instead. */ + export const inboundSchema = ListLatestTopicsPosters$inboundSchema; + /** @deprecated use `ListLatestTopicsPosters$outboundSchema` instead. */ + export const outboundSchema = ListLatestTopicsPosters$outboundSchema; + /** @deprecated use `ListLatestTopicsPosters$Outbound` instead. */ + export type Outbound = ListLatestTopicsPosters$Outbound; +} + +/** @internal */ +export const ListLatestTopicsTopics$inboundSchema: z.ZodType< + ListLatestTopicsTopics, + z.ZodTypeDef, + unknown +> = z + .object({ + archetype: z.string().optional(), + archived: z.boolean().optional(), + bookmarked: z.boolean().optional(), + bumped: z.boolean().optional(), + bumped_at: z.string().optional(), + category_id: z.number().int().optional(), + closed: z.boolean().optional(), + created_at: z.string().optional(), + fancy_title: z.string().optional(), + featured_link: z.nullable(z.string()).optional(), + has_summary: z.boolean().optional(), + highest_post_number: z.number().int().optional(), + id: z.number().int().optional(), + image_url: z.string().optional(), + last_posted_at: z.string().optional(), + last_poster_username: z.string().optional(), + last_read_post_number: z.number().int().optional(), + like_count: z.number().int().optional(), + liked: z.boolean().optional(), + notification_level: z.number().int().optional(), + op_like_count: z.number().int().optional(), + pinned: z.boolean().optional(), + pinned_globally: z.boolean().optional(), + posters: z.array(z.lazy(() => ListLatestTopicsPosters$inboundSchema)).optional(), + posts_count: z.number().int().optional(), + reply_count: z.number().int().optional(), + slug: z.string().optional(), + title: z.string().optional(), + unpinned: z.nullable(z.string()).optional(), + unread_posts: z.number().int().optional(), + unseen: z.boolean().optional(), + views: z.number().int().optional(), + visible: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + bumped_at: "bumpedAt", + category_id: "categoryId", + created_at: "createdAt", + fancy_title: "fancyTitle", + featured_link: "featuredLink", + has_summary: "hasSummary", + highest_post_number: "highestPostNumber", + image_url: "imageUrl", + last_posted_at: "lastPostedAt", + last_poster_username: "lastPosterUsername", + last_read_post_number: "lastReadPostNumber", + like_count: "likeCount", + notification_level: "notificationLevel", + op_like_count: "opLikeCount", + pinned_globally: "pinnedGlobally", + posts_count: "postsCount", + reply_count: "replyCount", + unread_posts: "unreadPosts", + }); + }); + +/** @internal */ +export type ListLatestTopicsTopics$Outbound = { + archetype?: string | undefined; + archived?: boolean | undefined; + bookmarked?: boolean | undefined; + bumped?: boolean | undefined; + bumped_at?: string | undefined; + category_id?: number | undefined; + closed?: boolean | undefined; + created_at?: string | undefined; + fancy_title?: string | undefined; + featured_link?: string | null | undefined; + has_summary?: boolean | undefined; + highest_post_number?: number | undefined; + id?: number | undefined; + image_url?: string | undefined; + last_posted_at?: string | undefined; + last_poster_username?: string | undefined; + last_read_post_number?: number | undefined; + like_count?: number | undefined; + liked?: boolean | undefined; + notification_level?: number | undefined; + op_like_count?: number | undefined; + pinned?: boolean | undefined; + pinned_globally?: boolean | undefined; + posters?: Array | undefined; + posts_count?: number | undefined; + reply_count?: number | undefined; + slug?: string | undefined; + title?: string | undefined; + unpinned?: string | null | undefined; + unread_posts?: number | undefined; + unseen?: boolean | undefined; + views?: number | undefined; + visible?: boolean | undefined; +}; + +/** @internal */ +export const ListLatestTopicsTopics$outboundSchema: z.ZodType< + ListLatestTopicsTopics$Outbound, + z.ZodTypeDef, + ListLatestTopicsTopics +> = z + .object({ + archetype: z.string().optional(), + archived: z.boolean().optional(), + bookmarked: z.boolean().optional(), + bumped: z.boolean().optional(), + bumpedAt: z.string().optional(), + categoryId: z.number().int().optional(), + closed: z.boolean().optional(), + createdAt: z.string().optional(), + fancyTitle: z.string().optional(), + featuredLink: z.nullable(z.string()).optional(), + hasSummary: z.boolean().optional(), + highestPostNumber: z.number().int().optional(), + id: z.number().int().optional(), + imageUrl: z.string().optional(), + lastPostedAt: z.string().optional(), + lastPosterUsername: z.string().optional(), + lastReadPostNumber: z.number().int().optional(), + likeCount: z.number().int().optional(), + liked: z.boolean().optional(), + notificationLevel: z.number().int().optional(), + opLikeCount: z.number().int().optional(), + pinned: z.boolean().optional(), + pinnedGlobally: z.boolean().optional(), + posters: z.array(z.lazy(() => ListLatestTopicsPosters$outboundSchema)).optional(), + postsCount: z.number().int().optional(), + replyCount: z.number().int().optional(), + slug: z.string().optional(), + title: z.string().optional(), + unpinned: z.nullable(z.string()).optional(), + unreadPosts: z.number().int().optional(), + unseen: z.boolean().optional(), + views: z.number().int().optional(), + visible: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + bumpedAt: "bumped_at", + categoryId: "category_id", + createdAt: "created_at", + fancyTitle: "fancy_title", + featuredLink: "featured_link", + hasSummary: "has_summary", + highestPostNumber: "highest_post_number", + imageUrl: "image_url", + lastPostedAt: "last_posted_at", + lastPosterUsername: "last_poster_username", + lastReadPostNumber: "last_read_post_number", + likeCount: "like_count", + notificationLevel: "notification_level", + opLikeCount: "op_like_count", + pinnedGlobally: "pinned_globally", + postsCount: "posts_count", + replyCount: "reply_count", + unreadPosts: "unread_posts", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListLatestTopicsTopics$ { + /** @deprecated use `ListLatestTopicsTopics$inboundSchema` instead. */ + export const inboundSchema = ListLatestTopicsTopics$inboundSchema; + /** @deprecated use `ListLatestTopicsTopics$outboundSchema` instead. */ + export const outboundSchema = ListLatestTopicsTopics$outboundSchema; + /** @deprecated use `ListLatestTopicsTopics$Outbound` instead. */ + export type Outbound = ListLatestTopicsTopics$Outbound; +} + +/** @internal */ +export const ListLatestTopicsTopicList$inboundSchema: z.ZodType< + ListLatestTopicsTopicList, + z.ZodTypeDef, + unknown +> = z + .object({ + can_create_topic: z.boolean().optional(), + draft: z.nullable(z.string()).optional(), + draft_key: z.string().optional(), + draft_sequence: z.number().int().optional(), + per_page: z.number().int().optional(), + topics: z.array(z.lazy(() => ListLatestTopicsTopics$inboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + can_create_topic: "canCreateTopic", + draft_key: "draftKey", + draft_sequence: "draftSequence", + per_page: "perPage", + }); + }); + +/** @internal */ +export type ListLatestTopicsTopicList$Outbound = { + can_create_topic?: boolean | undefined; + draft?: string | null | undefined; + draft_key?: string | undefined; + draft_sequence?: number | undefined; + per_page?: number | undefined; + topics?: Array | undefined; +}; + +/** @internal */ +export const ListLatestTopicsTopicList$outboundSchema: z.ZodType< + ListLatestTopicsTopicList$Outbound, + z.ZodTypeDef, + ListLatestTopicsTopicList +> = z + .object({ + canCreateTopic: z.boolean().optional(), + draft: z.nullable(z.string()).optional(), + draftKey: z.string().optional(), + draftSequence: z.number().int().optional(), + perPage: z.number().int().optional(), + topics: z.array(z.lazy(() => ListLatestTopicsTopics$outboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + canCreateTopic: "can_create_topic", + draftKey: "draft_key", + draftSequence: "draft_sequence", + perPage: "per_page", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListLatestTopicsTopicList$ { + /** @deprecated use `ListLatestTopicsTopicList$inboundSchema` instead. */ + export const inboundSchema = ListLatestTopicsTopicList$inboundSchema; + /** @deprecated use `ListLatestTopicsTopicList$outboundSchema` instead. */ + export const outboundSchema = ListLatestTopicsTopicList$outboundSchema; + /** @deprecated use `ListLatestTopicsTopicList$Outbound` instead. */ + export type Outbound = ListLatestTopicsTopicList$Outbound; +} + +/** @internal */ +export const ListLatestTopicsUsers$inboundSchema: z.ZodType< + ListLatestTopicsUsers, + z.ZodTypeDef, + unknown +> = z + .object({ + avatar_template: z.string().optional(), + id: z.number().int().optional(), + name: z.nullable(z.string()).optional(), + username: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + avatar_template: "avatarTemplate", + }); + }); + +/** @internal */ +export type ListLatestTopicsUsers$Outbound = { + avatar_template?: string | undefined; + id?: number | undefined; + name?: string | null | undefined; + username?: string | undefined; +}; + +/** @internal */ +export const ListLatestTopicsUsers$outboundSchema: z.ZodType< + ListLatestTopicsUsers$Outbound, + z.ZodTypeDef, + ListLatestTopicsUsers +> = z + .object({ + avatarTemplate: z.string().optional(), + id: z.number().int().optional(), + name: z.nullable(z.string()).optional(), + username: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + avatarTemplate: "avatar_template", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListLatestTopicsUsers$ { + /** @deprecated use `ListLatestTopicsUsers$inboundSchema` instead. */ + export const inboundSchema = ListLatestTopicsUsers$inboundSchema; + /** @deprecated use `ListLatestTopicsUsers$outboundSchema` instead. */ + export const outboundSchema = ListLatestTopicsUsers$outboundSchema; + /** @deprecated use `ListLatestTopicsUsers$Outbound` instead. */ + export type Outbound = ListLatestTopicsUsers$Outbound; +} + +/** @internal */ +export const ListLatestTopicsResponseBody$inboundSchema: z.ZodType< + ListLatestTopicsResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + primary_groups: z.array(z.any()).optional(), + topic_list: z.lazy(() => ListLatestTopicsTopicList$inboundSchema).optional(), + users: z.array(z.lazy(() => ListLatestTopicsUsers$inboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + primary_groups: "primaryGroups", + topic_list: "topicList", + }); + }); + +/** @internal */ +export type ListLatestTopicsResponseBody$Outbound = { + primary_groups?: Array | undefined; + topic_list?: ListLatestTopicsTopicList$Outbound | undefined; + users?: Array | undefined; +}; + +/** @internal */ +export const ListLatestTopicsResponseBody$outboundSchema: z.ZodType< + ListLatestTopicsResponseBody$Outbound, + z.ZodTypeDef, + ListLatestTopicsResponseBody +> = z + .object({ + primaryGroups: z.array(z.any()).optional(), + topicList: z.lazy(() => ListLatestTopicsTopicList$outboundSchema).optional(), + users: z.array(z.lazy(() => ListLatestTopicsUsers$outboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + primaryGroups: "primary_groups", + topicList: "topic_list", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListLatestTopicsResponseBody$ { + /** @deprecated use `ListLatestTopicsResponseBody$inboundSchema` instead. */ + export const inboundSchema = ListLatestTopicsResponseBody$inboundSchema; + /** @deprecated use `ListLatestTopicsResponseBody$outboundSchema` instead. */ + export const outboundSchema = ListLatestTopicsResponseBody$outboundSchema; + /** @deprecated use `ListLatestTopicsResponseBody$Outbound` instead. */ + export type Outbound = ListLatestTopicsResponseBody$Outbound; } diff --git a/src/sdk/models/operations/listposts.ts b/src/sdk/models/operations/listposts.ts index c2835f4..78fabb1 100644 --- a/src/sdk/models/operations/listposts.ts +++ b/src/sdk/models/operations/listposts.ts @@ -1,278 +1,504 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class ListPostsRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Key" }) +export type ListPostsRequest = { apiKey: string; - - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Username" }) apiUsername: string; - /** * Load posts with an id lower than this value. Useful for pagination. */ - @SpeakeasyMetadata({ data: "queryParam, style=form;explode=true;name=before" }) - before?: string; -} + before?: string | undefined; +}; -export class ListPostsActionsSummary extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "can_act" }) - canAct?: boolean; +export type ListPostsActionsSummary = { + canAct?: boolean | undefined; + id?: number | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "id" }) - id?: number; -} - -export class LatestPosts extends SpeakeasyBase { - @SpeakeasyMetadata({ elemType: ListPostsActionsSummary }) - @Expose({ name: "actions_summary" }) - @Type(() => ListPostsActionsSummary) - actionsSummary?: ListPostsActionsSummary[]; - - @SpeakeasyMetadata() - @Expose({ name: "admin" }) - admin?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "avatar_template" }) - avatarTemplate?: string; - - @SpeakeasyMetadata() - @Expose({ name: "can_delete" }) - canDelete?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_edit" }) - canEdit?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_recover" }) - canRecover?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_see_hidden_post" }) - canSeeHiddenPost?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_view_edit_history" }) - canViewEditHistory?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_wiki" }) - canWiki?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "category_id" }) - categoryId?: number; - - @SpeakeasyMetadata() - @Expose({ name: "cooked" }) - cooked?: string; - - @SpeakeasyMetadata() - @Expose({ name: "created_at" }) - createdAt?: string; - - @SpeakeasyMetadata() - @Expose({ name: "deleted_at" }) - deletedAt?: string; - - @SpeakeasyMetadata() - @Expose({ name: "display_username" }) - displayUsername?: string; - - @SpeakeasyMetadata() - @Expose({ name: "edit_reason" }) - editReason?: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_bg_color" }) - flairBgColor?: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_color" }) - flairColor?: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_group_id" }) - flairGroupId?: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_name" }) - flairName?: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_url" }) - flairUrl?: string; - - @SpeakeasyMetadata() - @Expose({ name: "hidden" }) - hidden?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) - id?: number; - - @SpeakeasyMetadata() - @Expose({ name: "incoming_link_count" }) - incomingLinkCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "moderator" }) - moderator?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) - name?: string; - - @SpeakeasyMetadata() - @Expose({ name: "post_number" }) - postNumber?: number; - - @SpeakeasyMetadata() - @Expose({ name: "post_type" }) - postType?: number; - - @SpeakeasyMetadata() - @Expose({ name: "primary_group_name" }) - primaryGroupName?: string; - - @SpeakeasyMetadata() - @Expose({ name: "quote_count" }) - quoteCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "raw" }) - raw?: string; - - @SpeakeasyMetadata() - @Expose({ name: "readers_count" }) - readersCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "reads" }) - reads?: number; - - @SpeakeasyMetadata() - @Expose({ name: "reply_count" }) - replyCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "reply_to_post_number" }) - replyToPostNumber?: string; - - @SpeakeasyMetadata() - @Expose({ name: "reviewable_id" }) - reviewableId?: string; - - @SpeakeasyMetadata() - @Expose({ name: "reviewable_score_count" }) - reviewableScoreCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "reviewable_score_pending_count" }) - reviewableScorePendingCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "score" }) - score?: number; - - @SpeakeasyMetadata() - @Expose({ name: "staff" }) - staff?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "topic_html_title" }) - topicHtmlTitle?: string; - - @SpeakeasyMetadata() - @Expose({ name: "topic_id" }) - topicId?: number; - - @SpeakeasyMetadata() - @Expose({ name: "topic_slug" }) - topicSlug?: string; - - @SpeakeasyMetadata() - @Expose({ name: "topic_title" }) - topicTitle?: string; - - @SpeakeasyMetadata() - @Expose({ name: "trust_level" }) - trustLevel?: number; - - @SpeakeasyMetadata() - @Expose({ name: "updated_at" }) - updatedAt?: string; - - @SpeakeasyMetadata() - @Expose({ name: "user_deleted" }) - userDeleted?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "user_id" }) - userId?: number; - - @SpeakeasyMetadata() - @Expose({ name: "user_title" }) - userTitle?: string; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) - username?: string; - - @SpeakeasyMetadata() - @Expose({ name: "version" }) - version?: number; - - @SpeakeasyMetadata() - @Expose({ name: "wiki" }) - wiki?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "yours" }) - yours?: boolean; -} +export type LatestPosts = { + actionsSummary?: Array | undefined; + admin?: boolean | undefined; + avatarTemplate?: string | undefined; + canDelete?: boolean | undefined; + canEdit?: boolean | undefined; + canRecover?: boolean | undefined; + canSeeHiddenPost?: boolean | undefined; + canViewEditHistory?: boolean | undefined; + canWiki?: boolean | undefined; + categoryId?: number | undefined; + cooked?: string | undefined; + createdAt?: string | undefined; + deletedAt?: string | null | undefined; + displayUsername?: string | undefined; + editReason?: string | null | undefined; + flairBgColor?: string | null | undefined; + flairColor?: string | null | undefined; + flairGroupId?: string | null | undefined; + flairName?: string | null | undefined; + flairUrl?: string | null | undefined; + hidden?: boolean | undefined; + id?: number | undefined; + incomingLinkCount?: number | undefined; + moderator?: boolean | undefined; + name?: string | undefined; + postNumber?: number | undefined; + postType?: number | undefined; + primaryGroupName?: string | null | undefined; + quoteCount?: number | undefined; + raw?: string | undefined; + readersCount?: number | undefined; + reads?: number | undefined; + replyCount?: number | undefined; + replyToPostNumber?: string | null | undefined; + reviewableId?: string | null | undefined; + reviewableScoreCount?: number | undefined; + reviewableScorePendingCount?: number | undefined; + score?: number | undefined; + staff?: boolean | undefined; + topicHtmlTitle?: string | undefined; + topicId?: number | undefined; + topicSlug?: string | undefined; + topicTitle?: string | undefined; + trustLevel?: number | undefined; + updatedAt?: string | undefined; + userDeleted?: boolean | undefined; + userId?: number | undefined; + userTitle?: string | null | undefined; + username?: string | undefined; + version?: number | undefined; + wiki?: boolean | undefined; + yours?: boolean | undefined; +}; /** * latest posts */ -export class ListPostsResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata({ elemType: LatestPosts }) - @Expose({ name: "latest_posts" }) - @Type(() => LatestPosts) - latestPosts?: LatestPosts[]; +export type ListPostsResponseBody = { + latestPosts?: Array | undefined; +}; + +/** @internal */ +export const ListPostsRequest$inboundSchema: z.ZodType = z + .object({ + "Api-Key": z.string(), + "Api-Username": z.string(), + before: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + "Api-Key": "apiKey", + "Api-Username": "apiUsername", + }); + }); + +/** @internal */ +export type ListPostsRequest$Outbound = { + "Api-Key": string; + "Api-Username": string; + before?: string | undefined; +}; + +/** @internal */ +export const ListPostsRequest$outboundSchema: z.ZodType< + ListPostsRequest$Outbound, + z.ZodTypeDef, + ListPostsRequest +> = z + .object({ + apiKey: z.string(), + apiUsername: z.string(), + before: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + apiKey: "Api-Key", + apiUsername: "Api-Username", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListPostsRequest$ { + /** @deprecated use `ListPostsRequest$inboundSchema` instead. */ + export const inboundSchema = ListPostsRequest$inboundSchema; + /** @deprecated use `ListPostsRequest$outboundSchema` instead. */ + export const outboundSchema = ListPostsRequest$outboundSchema; + /** @deprecated use `ListPostsRequest$Outbound` instead. */ + export type Outbound = ListPostsRequest$Outbound; } -export class ListPostsResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const ListPostsActionsSummary$inboundSchema: z.ZodType< + ListPostsActionsSummary, + z.ZodTypeDef, + unknown +> = z + .object({ + can_act: z.boolean().optional(), + id: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + can_act: "canAct", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type ListPostsActionsSummary$Outbound = { + can_act?: boolean | undefined; + id?: number | undefined; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const ListPostsActionsSummary$outboundSchema: z.ZodType< + ListPostsActionsSummary$Outbound, + z.ZodTypeDef, + ListPostsActionsSummary +> = z + .object({ + canAct: z.boolean().optional(), + id: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + canAct: "can_act", + }); + }); - /** - * latest posts - */ - @SpeakeasyMetadata() - object?: ListPostsResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListPostsActionsSummary$ { + /** @deprecated use `ListPostsActionsSummary$inboundSchema` instead. */ + export const inboundSchema = ListPostsActionsSummary$inboundSchema; + /** @deprecated use `ListPostsActionsSummary$outboundSchema` instead. */ + export const outboundSchema = ListPostsActionsSummary$outboundSchema; + /** @deprecated use `ListPostsActionsSummary$Outbound` instead. */ + export type Outbound = ListPostsActionsSummary$Outbound; +} + +/** @internal */ +export const LatestPosts$inboundSchema: z.ZodType = z + .object({ + actions_summary: z.array(z.lazy(() => ListPostsActionsSummary$inboundSchema)).optional(), + admin: z.boolean().optional(), + avatar_template: z.string().optional(), + can_delete: z.boolean().optional(), + can_edit: z.boolean().optional(), + can_recover: z.boolean().optional(), + can_see_hidden_post: z.boolean().optional(), + can_view_edit_history: z.boolean().optional(), + can_wiki: z.boolean().optional(), + category_id: z.number().int().optional(), + cooked: z.string().optional(), + created_at: z.string().optional(), + deleted_at: z.nullable(z.string()).optional(), + display_username: z.string().optional(), + edit_reason: z.nullable(z.string()).optional(), + flair_bg_color: z.nullable(z.string()).optional(), + flair_color: z.nullable(z.string()).optional(), + flair_group_id: z.nullable(z.string()).optional(), + flair_name: z.nullable(z.string()).optional(), + flair_url: z.nullable(z.string()).optional(), + hidden: z.boolean().optional(), + id: z.number().int().optional(), + incoming_link_count: z.number().int().optional(), + moderator: z.boolean().optional(), + name: z.string().optional(), + post_number: z.number().int().optional(), + post_type: z.number().int().optional(), + primary_group_name: z.nullable(z.string()).optional(), + quote_count: z.number().int().optional(), + raw: z.string().optional(), + readers_count: z.number().int().optional(), + reads: z.number().int().optional(), + reply_count: z.number().int().optional(), + reply_to_post_number: z.nullable(z.string()).optional(), + reviewable_id: z.nullable(z.string()).optional(), + reviewable_score_count: z.number().int().optional(), + reviewable_score_pending_count: z.number().int().optional(), + score: z.number().optional(), + staff: z.boolean().optional(), + topic_html_title: z.string().optional(), + topic_id: z.number().int().optional(), + topic_slug: z.string().optional(), + topic_title: z.string().optional(), + trust_level: z.number().int().optional(), + updated_at: z.string().optional(), + user_deleted: z.boolean().optional(), + user_id: z.number().int().optional(), + user_title: z.nullable(z.string()).optional(), + username: z.string().optional(), + version: z.number().int().optional(), + wiki: z.boolean().optional(), + yours: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + actions_summary: "actionsSummary", + avatar_template: "avatarTemplate", + can_delete: "canDelete", + can_edit: "canEdit", + can_recover: "canRecover", + can_see_hidden_post: "canSeeHiddenPost", + can_view_edit_history: "canViewEditHistory", + can_wiki: "canWiki", + category_id: "categoryId", + created_at: "createdAt", + deleted_at: "deletedAt", + display_username: "displayUsername", + edit_reason: "editReason", + flair_bg_color: "flairBgColor", + flair_color: "flairColor", + flair_group_id: "flairGroupId", + flair_name: "flairName", + flair_url: "flairUrl", + incoming_link_count: "incomingLinkCount", + post_number: "postNumber", + post_type: "postType", + primary_group_name: "primaryGroupName", + quote_count: "quoteCount", + readers_count: "readersCount", + reply_count: "replyCount", + reply_to_post_number: "replyToPostNumber", + reviewable_id: "reviewableId", + reviewable_score_count: "reviewableScoreCount", + reviewable_score_pending_count: "reviewableScorePendingCount", + topic_html_title: "topicHtmlTitle", + topic_id: "topicId", + topic_slug: "topicSlug", + topic_title: "topicTitle", + trust_level: "trustLevel", + updated_at: "updatedAt", + user_deleted: "userDeleted", + user_id: "userId", + user_title: "userTitle", + }); + }); + +/** @internal */ +export type LatestPosts$Outbound = { + actions_summary?: Array | undefined; + admin?: boolean | undefined; + avatar_template?: string | undefined; + can_delete?: boolean | undefined; + can_edit?: boolean | undefined; + can_recover?: boolean | undefined; + can_see_hidden_post?: boolean | undefined; + can_view_edit_history?: boolean | undefined; + can_wiki?: boolean | undefined; + category_id?: number | undefined; + cooked?: string | undefined; + created_at?: string | undefined; + deleted_at?: string | null | undefined; + display_username?: string | undefined; + edit_reason?: string | null | undefined; + flair_bg_color?: string | null | undefined; + flair_color?: string | null | undefined; + flair_group_id?: string | null | undefined; + flair_name?: string | null | undefined; + flair_url?: string | null | undefined; + hidden?: boolean | undefined; + id?: number | undefined; + incoming_link_count?: number | undefined; + moderator?: boolean | undefined; + name?: string | undefined; + post_number?: number | undefined; + post_type?: number | undefined; + primary_group_name?: string | null | undefined; + quote_count?: number | undefined; + raw?: string | undefined; + readers_count?: number | undefined; + reads?: number | undefined; + reply_count?: number | undefined; + reply_to_post_number?: string | null | undefined; + reviewable_id?: string | null | undefined; + reviewable_score_count?: number | undefined; + reviewable_score_pending_count?: number | undefined; + score?: number | undefined; + staff?: boolean | undefined; + topic_html_title?: string | undefined; + topic_id?: number | undefined; + topic_slug?: string | undefined; + topic_title?: string | undefined; + trust_level?: number | undefined; + updated_at?: string | undefined; + user_deleted?: boolean | undefined; + user_id?: number | undefined; + user_title?: string | null | undefined; + username?: string | undefined; + version?: number | undefined; + wiki?: boolean | undefined; + yours?: boolean | undefined; +}; + +/** @internal */ +export const LatestPosts$outboundSchema: z.ZodType< + LatestPosts$Outbound, + z.ZodTypeDef, + LatestPosts +> = z + .object({ + actionsSummary: z.array(z.lazy(() => ListPostsActionsSummary$outboundSchema)).optional(), + admin: z.boolean().optional(), + avatarTemplate: z.string().optional(), + canDelete: z.boolean().optional(), + canEdit: z.boolean().optional(), + canRecover: z.boolean().optional(), + canSeeHiddenPost: z.boolean().optional(), + canViewEditHistory: z.boolean().optional(), + canWiki: z.boolean().optional(), + categoryId: z.number().int().optional(), + cooked: z.string().optional(), + createdAt: z.string().optional(), + deletedAt: z.nullable(z.string()).optional(), + displayUsername: z.string().optional(), + editReason: z.nullable(z.string()).optional(), + flairBgColor: z.nullable(z.string()).optional(), + flairColor: z.nullable(z.string()).optional(), + flairGroupId: z.nullable(z.string()).optional(), + flairName: z.nullable(z.string()).optional(), + flairUrl: z.nullable(z.string()).optional(), + hidden: z.boolean().optional(), + id: z.number().int().optional(), + incomingLinkCount: z.number().int().optional(), + moderator: z.boolean().optional(), + name: z.string().optional(), + postNumber: z.number().int().optional(), + postType: z.number().int().optional(), + primaryGroupName: z.nullable(z.string()).optional(), + quoteCount: z.number().int().optional(), + raw: z.string().optional(), + readersCount: z.number().int().optional(), + reads: z.number().int().optional(), + replyCount: z.number().int().optional(), + replyToPostNumber: z.nullable(z.string()).optional(), + reviewableId: z.nullable(z.string()).optional(), + reviewableScoreCount: z.number().int().optional(), + reviewableScorePendingCount: z.number().int().optional(), + score: z.number().optional(), + staff: z.boolean().optional(), + topicHtmlTitle: z.string().optional(), + topicId: z.number().int().optional(), + topicSlug: z.string().optional(), + topicTitle: z.string().optional(), + trustLevel: z.number().int().optional(), + updatedAt: z.string().optional(), + userDeleted: z.boolean().optional(), + userId: z.number().int().optional(), + userTitle: z.nullable(z.string()).optional(), + username: z.string().optional(), + version: z.number().int().optional(), + wiki: z.boolean().optional(), + yours: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + actionsSummary: "actions_summary", + avatarTemplate: "avatar_template", + canDelete: "can_delete", + canEdit: "can_edit", + canRecover: "can_recover", + canSeeHiddenPost: "can_see_hidden_post", + canViewEditHistory: "can_view_edit_history", + canWiki: "can_wiki", + categoryId: "category_id", + createdAt: "created_at", + deletedAt: "deleted_at", + displayUsername: "display_username", + editReason: "edit_reason", + flairBgColor: "flair_bg_color", + flairColor: "flair_color", + flairGroupId: "flair_group_id", + flairName: "flair_name", + flairUrl: "flair_url", + incomingLinkCount: "incoming_link_count", + postNumber: "post_number", + postType: "post_type", + primaryGroupName: "primary_group_name", + quoteCount: "quote_count", + readersCount: "readers_count", + replyCount: "reply_count", + replyToPostNumber: "reply_to_post_number", + reviewableId: "reviewable_id", + reviewableScoreCount: "reviewable_score_count", + reviewableScorePendingCount: "reviewable_score_pending_count", + topicHtmlTitle: "topic_html_title", + topicId: "topic_id", + topicSlug: "topic_slug", + topicTitle: "topic_title", + trustLevel: "trust_level", + updatedAt: "updated_at", + userDeleted: "user_deleted", + userId: "user_id", + userTitle: "user_title", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace LatestPosts$ { + /** @deprecated use `LatestPosts$inboundSchema` instead. */ + export const inboundSchema = LatestPosts$inboundSchema; + /** @deprecated use `LatestPosts$outboundSchema` instead. */ + export const outboundSchema = LatestPosts$outboundSchema; + /** @deprecated use `LatestPosts$Outbound` instead. */ + export type Outbound = LatestPosts$Outbound; +} + +/** @internal */ +export const ListPostsResponseBody$inboundSchema: z.ZodType< + ListPostsResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + latest_posts: z.array(z.lazy(() => LatestPosts$inboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + latest_posts: "latestPosts", + }); + }); + +/** @internal */ +export type ListPostsResponseBody$Outbound = { + latest_posts?: Array | undefined; +}; + +/** @internal */ +export const ListPostsResponseBody$outboundSchema: z.ZodType< + ListPostsResponseBody$Outbound, + z.ZodTypeDef, + ListPostsResponseBody +> = z + .object({ + latestPosts: z.array(z.lazy(() => LatestPosts$outboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + latestPosts: "latest_posts", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListPostsResponseBody$ { + /** @deprecated use `ListPostsResponseBody$inboundSchema` instead. */ + export const inboundSchema = ListPostsResponseBody$inboundSchema; + /** @deprecated use `ListPostsResponseBody$outboundSchema` instead. */ + export const outboundSchema = ListPostsResponseBody$outboundSchema; + /** @deprecated use `ListPostsResponseBody$Outbound` instead. */ + export type Outbound = ListPostsResponseBody$Outbound; } diff --git a/src/sdk/models/operations/listtaggroups.ts b/src/sdk/models/operations/listtaggroups.ts index 9d44563..01f858c 100644 --- a/src/sdk/models/operations/listtaggroups.ts +++ b/src/sdk/models/operations/listtaggroups.ts @@ -1,76 +1,169 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class ListTagGroupsPermissions extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "staff" }) - staff?: number; -} +export type ListTagGroupsPermissions = { + staff?: number | undefined; +}; -export class TagGroups extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "id" }) - id?: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) - name?: string; - - @SpeakeasyMetadata() - @Expose({ name: "one_per_topic" }) - onePerTopic?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "parent_tag_name" }) - parentTagName?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "permissions" }) - @Type(() => ListTagGroupsPermissions) - permissions?: ListTagGroupsPermissions; - - @SpeakeasyMetadata() - @Expose({ name: "tag_names" }) - tagNames?: any[]; -} +export type TagGroups = { + id?: number | undefined; + name?: string | undefined; + onePerTopic?: boolean | undefined; + parentTagName?: Array | undefined; + permissions?: ListTagGroupsPermissions | undefined; + tagNames?: Array | undefined; +}; /** * tags */ -export class ListTagGroupsResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata({ elemType: TagGroups }) - @Expose({ name: "tag_groups" }) - @Type(() => TagGroups) - tagGroups?: TagGroups[]; +export type ListTagGroupsResponseBody = { + tagGroups?: Array | undefined; +}; + +/** @internal */ +export const ListTagGroupsPermissions$inboundSchema: z.ZodType< + ListTagGroupsPermissions, + z.ZodTypeDef, + unknown +> = z.object({ + staff: z.number().int().optional(), +}); + +/** @internal */ +export type ListTagGroupsPermissions$Outbound = { + staff?: number | undefined; +}; + +/** @internal */ +export const ListTagGroupsPermissions$outboundSchema: z.ZodType< + ListTagGroupsPermissions$Outbound, + z.ZodTypeDef, + ListTagGroupsPermissions +> = z.object({ + staff: z.number().int().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListTagGroupsPermissions$ { + /** @deprecated use `ListTagGroupsPermissions$inboundSchema` instead. */ + export const inboundSchema = ListTagGroupsPermissions$inboundSchema; + /** @deprecated use `ListTagGroupsPermissions$outboundSchema` instead. */ + export const outboundSchema = ListTagGroupsPermissions$outboundSchema; + /** @deprecated use `ListTagGroupsPermissions$Outbound` instead. */ + export type Outbound = ListTagGroupsPermissions$Outbound; } -export class ListTagGroupsResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const TagGroups$inboundSchema: z.ZodType = z + .object({ + id: z.number().int().optional(), + name: z.string().optional(), + one_per_topic: z.boolean().optional(), + parent_tag_name: z.array(z.any()).optional(), + permissions: z.lazy(() => ListTagGroupsPermissions$inboundSchema).optional(), + tag_names: z.array(z.any()).optional(), + }) + .transform((v) => { + return remap$(v, { + one_per_topic: "onePerTopic", + parent_tag_name: "parentTagName", + tag_names: "tagNames", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type TagGroups$Outbound = { + id?: number | undefined; + name?: string | undefined; + one_per_topic?: boolean | undefined; + parent_tag_name?: Array | undefined; + permissions?: ListTagGroupsPermissions$Outbound | undefined; + tag_names?: Array | undefined; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const TagGroups$outboundSchema: z.ZodType = z + .object({ + id: z.number().int().optional(), + name: z.string().optional(), + onePerTopic: z.boolean().optional(), + parentTagName: z.array(z.any()).optional(), + permissions: z.lazy(() => ListTagGroupsPermissions$outboundSchema).optional(), + tagNames: z.array(z.any()).optional(), + }) + .transform((v) => { + return remap$(v, { + onePerTopic: "one_per_topic", + parentTagName: "parent_tag_name", + tagNames: "tag_names", + }); + }); - /** - * tags - */ - @SpeakeasyMetadata() - object?: ListTagGroupsResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace TagGroups$ { + /** @deprecated use `TagGroups$inboundSchema` instead. */ + export const inboundSchema = TagGroups$inboundSchema; + /** @deprecated use `TagGroups$outboundSchema` instead. */ + export const outboundSchema = TagGroups$outboundSchema; + /** @deprecated use `TagGroups$Outbound` instead. */ + export type Outbound = TagGroups$Outbound; +} + +/** @internal */ +export const ListTagGroupsResponseBody$inboundSchema: z.ZodType< + ListTagGroupsResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + tag_groups: z.array(z.lazy(() => TagGroups$inboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + tag_groups: "tagGroups", + }); + }); + +/** @internal */ +export type ListTagGroupsResponseBody$Outbound = { + tag_groups?: Array | undefined; +}; + +/** @internal */ +export const ListTagGroupsResponseBody$outboundSchema: z.ZodType< + ListTagGroupsResponseBody$Outbound, + z.ZodTypeDef, + ListTagGroupsResponseBody +> = z + .object({ + tagGroups: z.array(z.lazy(() => TagGroups$outboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + tagGroups: "tag_groups", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListTagGroupsResponseBody$ { + /** @deprecated use `ListTagGroupsResponseBody$inboundSchema` instead. */ + export const inboundSchema = ListTagGroupsResponseBody$inboundSchema; + /** @deprecated use `ListTagGroupsResponseBody$outboundSchema` instead. */ + export const outboundSchema = ListTagGroupsResponseBody$outboundSchema; + /** @deprecated use `ListTagGroupsResponseBody$Outbound` instead. */ + export type Outbound = ListTagGroupsResponseBody$Outbound; } diff --git a/src/sdk/models/operations/listtags.ts b/src/sdk/models/operations/listtags.ts index 5660d77..6a914b3 100644 --- a/src/sdk/models/operations/listtags.ts +++ b/src/sdk/models/operations/listtags.ts @@ -1,76 +1,152 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class ListTagsExtras extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "categories" }) - categories?: any[]; -} +export type ListTagsExtras = { + categories?: Array | undefined; +}; -export class Tags extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "count" }) - count?: number; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) - id?: string; - - @SpeakeasyMetadata() - @Expose({ name: "pm_count" }) - pmCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "target_tag" }) - targetTag?: string; - - @SpeakeasyMetadata() - @Expose({ name: "text" }) - text?: string; -} +export type Tags = { + count?: number | undefined; + id?: string | undefined; + pmCount?: number | undefined; + targetTag?: string | null | undefined; + text?: string | undefined; +}; /** * notifications */ -export class ListTagsResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "extras" }) - @Type(() => ListTagsExtras) - extras?: ListTagsExtras; +export type ListTagsResponseBody = { + extras?: ListTagsExtras | undefined; + tags?: Array | undefined; +}; - @SpeakeasyMetadata({ elemType: Tags }) - @Expose({ name: "tags" }) - @Type(() => Tags) - tags?: Tags[]; +/** @internal */ +export const ListTagsExtras$inboundSchema: z.ZodType = + z.object({ + categories: z.array(z.any()).optional(), + }); + +/** @internal */ +export type ListTagsExtras$Outbound = { + categories?: Array | undefined; +}; + +/** @internal */ +export const ListTagsExtras$outboundSchema: z.ZodType< + ListTagsExtras$Outbound, + z.ZodTypeDef, + ListTagsExtras +> = z.object({ + categories: z.array(z.any()).optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListTagsExtras$ { + /** @deprecated use `ListTagsExtras$inboundSchema` instead. */ + export const inboundSchema = ListTagsExtras$inboundSchema; + /** @deprecated use `ListTagsExtras$outboundSchema` instead. */ + export const outboundSchema = ListTagsExtras$outboundSchema; + /** @deprecated use `ListTagsExtras$Outbound` instead. */ + export type Outbound = ListTagsExtras$Outbound; } -export class ListTagsResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const Tags$inboundSchema: z.ZodType = z + .object({ + count: z.number().int().optional(), + id: z.string().optional(), + pm_count: z.number().int().optional(), + target_tag: z.nullable(z.string()).optional(), + text: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + pm_count: "pmCount", + target_tag: "targetTag", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type Tags$Outbound = { + count?: number | undefined; + id?: string | undefined; + pm_count?: number | undefined; + target_tag?: string | null | undefined; + text?: string | undefined; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const Tags$outboundSchema: z.ZodType = z + .object({ + count: z.number().int().optional(), + id: z.string().optional(), + pmCount: z.number().int().optional(), + targetTag: z.nullable(z.string()).optional(), + text: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + pmCount: "pm_count", + targetTag: "target_tag", + }); + }); - /** - * notifications - */ - @SpeakeasyMetadata() - object?: ListTagsResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Tags$ { + /** @deprecated use `Tags$inboundSchema` instead. */ + export const inboundSchema = Tags$inboundSchema; + /** @deprecated use `Tags$outboundSchema` instead. */ + export const outboundSchema = Tags$outboundSchema; + /** @deprecated use `Tags$Outbound` instead. */ + export type Outbound = Tags$Outbound; +} + +/** @internal */ +export const ListTagsResponseBody$inboundSchema: z.ZodType< + ListTagsResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + extras: z.lazy(() => ListTagsExtras$inboundSchema).optional(), + tags: z.array(z.lazy(() => Tags$inboundSchema)).optional(), +}); + +/** @internal */ +export type ListTagsResponseBody$Outbound = { + extras?: ListTagsExtras$Outbound | undefined; + tags?: Array | undefined; +}; + +/** @internal */ +export const ListTagsResponseBody$outboundSchema: z.ZodType< + ListTagsResponseBody$Outbound, + z.ZodTypeDef, + ListTagsResponseBody +> = z.object({ + extras: z.lazy(() => ListTagsExtras$outboundSchema).optional(), + tags: z.array(z.lazy(() => Tags$outboundSchema)).optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListTagsResponseBody$ { + /** @deprecated use `ListTagsResponseBody$inboundSchema` instead. */ + export const inboundSchema = ListTagsResponseBody$inboundSchema; + /** @deprecated use `ListTagsResponseBody$outboundSchema` instead. */ + export const outboundSchema = ListTagsResponseBody$outboundSchema; + /** @deprecated use `ListTagsResponseBody$Outbound` instead. */ + export type Outbound = ListTagsResponseBody$Outbound; } diff --git a/src/sdk/models/operations/listtoptopics.ts b/src/sdk/models/operations/listtoptopics.ts index 0cf79c7..526c280 100644 --- a/src/sdk/models/operations/listtoptopics.ts +++ b/src/sdk/models/operations/listtoptopics.ts @@ -1,268 +1,564 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class ListTopTopicsRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Key" }) +export type ListTopTopicsRequest = { apiKey: string; - - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Username" }) apiUsername: string; - /** * Enum: `all`, `yearly`, `quarterly`, `monthly`, `weekly`, `daily` */ - @SpeakeasyMetadata({ data: "queryParam, style=form;explode=true;name=period" }) - period?: string; -} + period?: string | undefined; +}; -export class ListTopTopicsPosters extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "description" }) - description?: string; +export type ListTopTopicsPosters = { + description?: string | undefined; + extras?: string | null | undefined; + primaryGroupId?: string | null | undefined; + userId?: number | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "extras" }) - extras?: string; +export type ListTopTopicsTopics = { + archetype?: string | undefined; + archived?: boolean | undefined; + bookmarked?: boolean | undefined; + bumped?: boolean | undefined; + bumpedAt?: string | undefined; + categoryId?: number | undefined; + closed?: boolean | undefined; + createdAt?: string | undefined; + fancyTitle?: string | undefined; + featuredLink?: string | null | undefined; + hasSummary?: boolean | undefined; + highestPostNumber?: number | undefined; + id?: number | undefined; + imageUrl?: string | null | undefined; + lastPostedAt?: string | undefined; + lastPosterUsername?: string | undefined; + lastReadPostNumber?: number | undefined; + likeCount?: number | undefined; + liked?: boolean | undefined; + notificationLevel?: number | undefined; + opLikeCount?: number | undefined; + pinned?: boolean | undefined; + pinnedGlobally?: boolean | undefined; + posters?: Array | undefined; + postsCount?: number | undefined; + replyCount?: number | undefined; + slug?: string | undefined; + title?: string | undefined; + unpinned?: boolean | undefined; + unreadPosts?: number | undefined; + unseen?: boolean | undefined; + views?: number | undefined; + visible?: boolean | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "primary_group_id" }) - primaryGroupId?: string; +export type ListTopTopicsTopicList = { + canCreateTopic?: boolean | undefined; + draft?: string | null | undefined; + draftKey?: string | undefined; + draftSequence?: number | undefined; + forPeriod?: string | undefined; + perPage?: number | undefined; + topics?: Array | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "user_id" }) - userId?: number; -} - -export class ListTopTopicsTopics extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "archetype" }) - archetype?: string; - - @SpeakeasyMetadata() - @Expose({ name: "archived" }) - archived?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "bookmarked" }) - bookmarked?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "bumped" }) - bumped?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "bumped_at" }) - bumpedAt?: string; - - @SpeakeasyMetadata() - @Expose({ name: "category_id" }) - categoryId?: number; - - @SpeakeasyMetadata() - @Expose({ name: "closed" }) - closed?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "created_at" }) - createdAt?: string; - - @SpeakeasyMetadata() - @Expose({ name: "fancy_title" }) - fancyTitle?: string; - - @SpeakeasyMetadata() - @Expose({ name: "featured_link" }) - featuredLink?: string; - - @SpeakeasyMetadata() - @Expose({ name: "has_summary" }) - hasSummary?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "highest_post_number" }) - highestPostNumber?: number; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) - id?: number; - - @SpeakeasyMetadata() - @Expose({ name: "image_url" }) - imageUrl?: string; - - @SpeakeasyMetadata() - @Expose({ name: "last_posted_at" }) - lastPostedAt?: string; - - @SpeakeasyMetadata() - @Expose({ name: "last_poster_username" }) - lastPosterUsername?: string; - - @SpeakeasyMetadata() - @Expose({ name: "last_read_post_number" }) - lastReadPostNumber?: number; - - @SpeakeasyMetadata() - @Expose({ name: "like_count" }) - likeCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "liked" }) - liked?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "notification_level" }) - notificationLevel?: number; - - @SpeakeasyMetadata() - @Expose({ name: "op_like_count" }) - opLikeCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "pinned" }) - pinned?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "pinned_globally" }) - pinnedGlobally?: boolean; - - @SpeakeasyMetadata({ elemType: ListTopTopicsPosters }) - @Expose({ name: "posters" }) - @Type(() => ListTopTopicsPosters) - posters?: ListTopTopicsPosters[]; - - @SpeakeasyMetadata() - @Expose({ name: "posts_count" }) - postsCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "reply_count" }) - replyCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "slug" }) - slug?: string; - - @SpeakeasyMetadata() - @Expose({ name: "title" }) - title?: string; - - @SpeakeasyMetadata() - @Expose({ name: "unpinned" }) - unpinned?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "unread_posts" }) - unreadPosts?: number; - - @SpeakeasyMetadata() - @Expose({ name: "unseen" }) - unseen?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "views" }) - views?: number; - - @SpeakeasyMetadata() - @Expose({ name: "visible" }) - visible?: boolean; -} - -export class ListTopTopicsTopicList extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "can_create_topic" }) - canCreateTopic?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "draft" }) - draft?: string; - - @SpeakeasyMetadata() - @Expose({ name: "draft_key" }) - draftKey?: string; - - @SpeakeasyMetadata() - @Expose({ name: "draft_sequence" }) - draftSequence?: number; - - @SpeakeasyMetadata() - @Expose({ name: "for_period" }) - forPeriod?: string; - - @SpeakeasyMetadata() - @Expose({ name: "per_page" }) - perPage?: number; - - @SpeakeasyMetadata({ elemType: ListTopTopicsTopics }) - @Expose({ name: "topics" }) - @Type(() => ListTopTopicsTopics) - topics?: ListTopTopicsTopics[]; -} - -export class ListTopTopicsUsers extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "avatar_template" }) - avatarTemplate?: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) - id?: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) - name?: string; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) - username?: string; -} +export type ListTopTopicsUsers = { + avatarTemplate?: string | undefined; + id?: number | undefined; + name?: string | undefined; + username?: string | undefined; +}; /** * response */ -export class ListTopTopicsResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "primary_groups" }) - primaryGroups?: any[]; +export type ListTopTopicsResponseBody = { + primaryGroups?: Array | undefined; + topicList?: ListTopTopicsTopicList | undefined; + users?: Array | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "topic_list" }) - @Type(() => ListTopTopicsTopicList) - topicList?: ListTopTopicsTopicList; +/** @internal */ +export const ListTopTopicsRequest$inboundSchema: z.ZodType< + ListTopTopicsRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + "Api-Key": z.string(), + "Api-Username": z.string(), + period: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + "Api-Key": "apiKey", + "Api-Username": "apiUsername", + }); + }); - @SpeakeasyMetadata({ elemType: ListTopTopicsUsers }) - @Expose({ name: "users" }) - @Type(() => ListTopTopicsUsers) - users?: ListTopTopicsUsers[]; +/** @internal */ +export type ListTopTopicsRequest$Outbound = { + "Api-Key": string; + "Api-Username": string; + period?: string | undefined; +}; + +/** @internal */ +export const ListTopTopicsRequest$outboundSchema: z.ZodType< + ListTopTopicsRequest$Outbound, + z.ZodTypeDef, + ListTopTopicsRequest +> = z + .object({ + apiKey: z.string(), + apiUsername: z.string(), + period: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + apiKey: "Api-Key", + apiUsername: "Api-Username", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListTopTopicsRequest$ { + /** @deprecated use `ListTopTopicsRequest$inboundSchema` instead. */ + export const inboundSchema = ListTopTopicsRequest$inboundSchema; + /** @deprecated use `ListTopTopicsRequest$outboundSchema` instead. */ + export const outboundSchema = ListTopTopicsRequest$outboundSchema; + /** @deprecated use `ListTopTopicsRequest$Outbound` instead. */ + export type Outbound = ListTopTopicsRequest$Outbound; } -export class ListTopTopicsResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const ListTopTopicsPosters$inboundSchema: z.ZodType< + ListTopTopicsPosters, + z.ZodTypeDef, + unknown +> = z + .object({ + description: z.string().optional(), + extras: z.nullable(z.string()).optional(), + primary_group_id: z.nullable(z.string()).optional(), + user_id: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + primary_group_id: "primaryGroupId", + user_id: "userId", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type ListTopTopicsPosters$Outbound = { + description?: string | undefined; + extras?: string | null | undefined; + primary_group_id?: string | null | undefined; + user_id?: number | undefined; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const ListTopTopicsPosters$outboundSchema: z.ZodType< + ListTopTopicsPosters$Outbound, + z.ZodTypeDef, + ListTopTopicsPosters +> = z + .object({ + description: z.string().optional(), + extras: z.nullable(z.string()).optional(), + primaryGroupId: z.nullable(z.string()).optional(), + userId: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + primaryGroupId: "primary_group_id", + userId: "user_id", + }); + }); - /** - * response - */ - @SpeakeasyMetadata() - object?: ListTopTopicsResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListTopTopicsPosters$ { + /** @deprecated use `ListTopTopicsPosters$inboundSchema` instead. */ + export const inboundSchema = ListTopTopicsPosters$inboundSchema; + /** @deprecated use `ListTopTopicsPosters$outboundSchema` instead. */ + export const outboundSchema = ListTopTopicsPosters$outboundSchema; + /** @deprecated use `ListTopTopicsPosters$Outbound` instead. */ + export type Outbound = ListTopTopicsPosters$Outbound; +} + +/** @internal */ +export const ListTopTopicsTopics$inboundSchema: z.ZodType< + ListTopTopicsTopics, + z.ZodTypeDef, + unknown +> = z + .object({ + archetype: z.string().optional(), + archived: z.boolean().optional(), + bookmarked: z.boolean().optional(), + bumped: z.boolean().optional(), + bumped_at: z.string().optional(), + category_id: z.number().int().optional(), + closed: z.boolean().optional(), + created_at: z.string().optional(), + fancy_title: z.string().optional(), + featured_link: z.nullable(z.string()).optional(), + has_summary: z.boolean().optional(), + highest_post_number: z.number().int().optional(), + id: z.number().int().optional(), + image_url: z.nullable(z.string()).optional(), + last_posted_at: z.string().optional(), + last_poster_username: z.string().optional(), + last_read_post_number: z.number().int().optional(), + like_count: z.number().int().optional(), + liked: z.boolean().optional(), + notification_level: z.number().int().optional(), + op_like_count: z.number().int().optional(), + pinned: z.boolean().optional(), + pinned_globally: z.boolean().optional(), + posters: z.array(z.lazy(() => ListTopTopicsPosters$inboundSchema)).optional(), + posts_count: z.number().int().optional(), + reply_count: z.number().int().optional(), + slug: z.string().optional(), + title: z.string().optional(), + unpinned: z.boolean().optional(), + unread_posts: z.number().int().optional(), + unseen: z.boolean().optional(), + views: z.number().int().optional(), + visible: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + bumped_at: "bumpedAt", + category_id: "categoryId", + created_at: "createdAt", + fancy_title: "fancyTitle", + featured_link: "featuredLink", + has_summary: "hasSummary", + highest_post_number: "highestPostNumber", + image_url: "imageUrl", + last_posted_at: "lastPostedAt", + last_poster_username: "lastPosterUsername", + last_read_post_number: "lastReadPostNumber", + like_count: "likeCount", + notification_level: "notificationLevel", + op_like_count: "opLikeCount", + pinned_globally: "pinnedGlobally", + posts_count: "postsCount", + reply_count: "replyCount", + unread_posts: "unreadPosts", + }); + }); + +/** @internal */ +export type ListTopTopicsTopics$Outbound = { + archetype?: string | undefined; + archived?: boolean | undefined; + bookmarked?: boolean | undefined; + bumped?: boolean | undefined; + bumped_at?: string | undefined; + category_id?: number | undefined; + closed?: boolean | undefined; + created_at?: string | undefined; + fancy_title?: string | undefined; + featured_link?: string | null | undefined; + has_summary?: boolean | undefined; + highest_post_number?: number | undefined; + id?: number | undefined; + image_url?: string | null | undefined; + last_posted_at?: string | undefined; + last_poster_username?: string | undefined; + last_read_post_number?: number | undefined; + like_count?: number | undefined; + liked?: boolean | undefined; + notification_level?: number | undefined; + op_like_count?: number | undefined; + pinned?: boolean | undefined; + pinned_globally?: boolean | undefined; + posters?: Array | undefined; + posts_count?: number | undefined; + reply_count?: number | undefined; + slug?: string | undefined; + title?: string | undefined; + unpinned?: boolean | undefined; + unread_posts?: number | undefined; + unseen?: boolean | undefined; + views?: number | undefined; + visible?: boolean | undefined; +}; + +/** @internal */ +export const ListTopTopicsTopics$outboundSchema: z.ZodType< + ListTopTopicsTopics$Outbound, + z.ZodTypeDef, + ListTopTopicsTopics +> = z + .object({ + archetype: z.string().optional(), + archived: z.boolean().optional(), + bookmarked: z.boolean().optional(), + bumped: z.boolean().optional(), + bumpedAt: z.string().optional(), + categoryId: z.number().int().optional(), + closed: z.boolean().optional(), + createdAt: z.string().optional(), + fancyTitle: z.string().optional(), + featuredLink: z.nullable(z.string()).optional(), + hasSummary: z.boolean().optional(), + highestPostNumber: z.number().int().optional(), + id: z.number().int().optional(), + imageUrl: z.nullable(z.string()).optional(), + lastPostedAt: z.string().optional(), + lastPosterUsername: z.string().optional(), + lastReadPostNumber: z.number().int().optional(), + likeCount: z.number().int().optional(), + liked: z.boolean().optional(), + notificationLevel: z.number().int().optional(), + opLikeCount: z.number().int().optional(), + pinned: z.boolean().optional(), + pinnedGlobally: z.boolean().optional(), + posters: z.array(z.lazy(() => ListTopTopicsPosters$outboundSchema)).optional(), + postsCount: z.number().int().optional(), + replyCount: z.number().int().optional(), + slug: z.string().optional(), + title: z.string().optional(), + unpinned: z.boolean().optional(), + unreadPosts: z.number().int().optional(), + unseen: z.boolean().optional(), + views: z.number().int().optional(), + visible: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + bumpedAt: "bumped_at", + categoryId: "category_id", + createdAt: "created_at", + fancyTitle: "fancy_title", + featuredLink: "featured_link", + hasSummary: "has_summary", + highestPostNumber: "highest_post_number", + imageUrl: "image_url", + lastPostedAt: "last_posted_at", + lastPosterUsername: "last_poster_username", + lastReadPostNumber: "last_read_post_number", + likeCount: "like_count", + notificationLevel: "notification_level", + opLikeCount: "op_like_count", + pinnedGlobally: "pinned_globally", + postsCount: "posts_count", + replyCount: "reply_count", + unreadPosts: "unread_posts", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListTopTopicsTopics$ { + /** @deprecated use `ListTopTopicsTopics$inboundSchema` instead. */ + export const inboundSchema = ListTopTopicsTopics$inboundSchema; + /** @deprecated use `ListTopTopicsTopics$outboundSchema` instead. */ + export const outboundSchema = ListTopTopicsTopics$outboundSchema; + /** @deprecated use `ListTopTopicsTopics$Outbound` instead. */ + export type Outbound = ListTopTopicsTopics$Outbound; +} + +/** @internal */ +export const ListTopTopicsTopicList$inboundSchema: z.ZodType< + ListTopTopicsTopicList, + z.ZodTypeDef, + unknown +> = z + .object({ + can_create_topic: z.boolean().optional(), + draft: z.nullable(z.string()).optional(), + draft_key: z.string().optional(), + draft_sequence: z.number().int().optional(), + for_period: z.string().optional(), + per_page: z.number().int().optional(), + topics: z.array(z.lazy(() => ListTopTopicsTopics$inboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + can_create_topic: "canCreateTopic", + draft_key: "draftKey", + draft_sequence: "draftSequence", + for_period: "forPeriod", + per_page: "perPage", + }); + }); + +/** @internal */ +export type ListTopTopicsTopicList$Outbound = { + can_create_topic?: boolean | undefined; + draft?: string | null | undefined; + draft_key?: string | undefined; + draft_sequence?: number | undefined; + for_period?: string | undefined; + per_page?: number | undefined; + topics?: Array | undefined; +}; + +/** @internal */ +export const ListTopTopicsTopicList$outboundSchema: z.ZodType< + ListTopTopicsTopicList$Outbound, + z.ZodTypeDef, + ListTopTopicsTopicList +> = z + .object({ + canCreateTopic: z.boolean().optional(), + draft: z.nullable(z.string()).optional(), + draftKey: z.string().optional(), + draftSequence: z.number().int().optional(), + forPeriod: z.string().optional(), + perPage: z.number().int().optional(), + topics: z.array(z.lazy(() => ListTopTopicsTopics$outboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + canCreateTopic: "can_create_topic", + draftKey: "draft_key", + draftSequence: "draft_sequence", + forPeriod: "for_period", + perPage: "per_page", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListTopTopicsTopicList$ { + /** @deprecated use `ListTopTopicsTopicList$inboundSchema` instead. */ + export const inboundSchema = ListTopTopicsTopicList$inboundSchema; + /** @deprecated use `ListTopTopicsTopicList$outboundSchema` instead. */ + export const outboundSchema = ListTopTopicsTopicList$outboundSchema; + /** @deprecated use `ListTopTopicsTopicList$Outbound` instead. */ + export type Outbound = ListTopTopicsTopicList$Outbound; +} + +/** @internal */ +export const ListTopTopicsUsers$inboundSchema: z.ZodType< + ListTopTopicsUsers, + z.ZodTypeDef, + unknown +> = z + .object({ + avatar_template: z.string().optional(), + id: z.number().int().optional(), + name: z.string().optional(), + username: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + avatar_template: "avatarTemplate", + }); + }); + +/** @internal */ +export type ListTopTopicsUsers$Outbound = { + avatar_template?: string | undefined; + id?: number | undefined; + name?: string | undefined; + username?: string | undefined; +}; + +/** @internal */ +export const ListTopTopicsUsers$outboundSchema: z.ZodType< + ListTopTopicsUsers$Outbound, + z.ZodTypeDef, + ListTopTopicsUsers +> = z + .object({ + avatarTemplate: z.string().optional(), + id: z.number().int().optional(), + name: z.string().optional(), + username: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + avatarTemplate: "avatar_template", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListTopTopicsUsers$ { + /** @deprecated use `ListTopTopicsUsers$inboundSchema` instead. */ + export const inboundSchema = ListTopTopicsUsers$inboundSchema; + /** @deprecated use `ListTopTopicsUsers$outboundSchema` instead. */ + export const outboundSchema = ListTopTopicsUsers$outboundSchema; + /** @deprecated use `ListTopTopicsUsers$Outbound` instead. */ + export type Outbound = ListTopTopicsUsers$Outbound; +} + +/** @internal */ +export const ListTopTopicsResponseBody$inboundSchema: z.ZodType< + ListTopTopicsResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + primary_groups: z.array(z.any()).optional(), + topic_list: z.lazy(() => ListTopTopicsTopicList$inboundSchema).optional(), + users: z.array(z.lazy(() => ListTopTopicsUsers$inboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + primary_groups: "primaryGroups", + topic_list: "topicList", + }); + }); + +/** @internal */ +export type ListTopTopicsResponseBody$Outbound = { + primary_groups?: Array | undefined; + topic_list?: ListTopTopicsTopicList$Outbound | undefined; + users?: Array | undefined; +}; + +/** @internal */ +export const ListTopTopicsResponseBody$outboundSchema: z.ZodType< + ListTopTopicsResponseBody$Outbound, + z.ZodTypeDef, + ListTopTopicsResponseBody +> = z + .object({ + primaryGroups: z.array(z.any()).optional(), + topicList: z.lazy(() => ListTopTopicsTopicList$outboundSchema).optional(), + users: z.array(z.lazy(() => ListTopTopicsUsers$outboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + primaryGroups: "primary_groups", + topicList: "topic_list", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListTopTopicsResponseBody$ { + /** @deprecated use `ListTopTopicsResponseBody$inboundSchema` instead. */ + export const inboundSchema = ListTopTopicsResponseBody$inboundSchema; + /** @deprecated use `ListTopTopicsResponseBody$outboundSchema` instead. */ + export const outboundSchema = ListTopTopicsResponseBody$outboundSchema; + /** @deprecated use `ListTopTopicsResponseBody$Outbound` instead. */ + export type Outbound = ListTopTopicsResponseBody$Outbound; } diff --git a/src/sdk/models/operations/listuseractions.ts b/src/sdk/models/operations/listuseractions.ts index eb3aca6..3b9ac91 100644 --- a/src/sdk/models/operations/listuseractions.ts +++ b/src/sdk/models/operations/listuseractions.ts @@ -1,160 +1,289 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class ListUserActionsRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "queryParam, style=form;explode=true;name=filter" }) +export type ListUserActionsRequest = { filter: string; - - @SpeakeasyMetadata({ data: "queryParam, style=form;explode=true;name=offset" }) offset: number; - - @SpeakeasyMetadata({ data: "queryParam, style=form;explode=true;name=username" }) username: string; -} +}; -export class UserActions extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "acting_avatar_template" }) +export type UserActions = { actingAvatarTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "acting_name" }) - actingName: string; - - @SpeakeasyMetadata() - @Expose({ name: "acting_user_id" }) + actingName: string | null; actingUserId: number; - - @SpeakeasyMetadata() - @Expose({ name: "acting_username" }) actingUsername: string; - - @SpeakeasyMetadata() - @Expose({ name: "action_code" }) - actionCode: string; - - @SpeakeasyMetadata() - @Expose({ name: "action_type" }) + actionCode: string | null; actionType: number; - - @SpeakeasyMetadata() - @Expose({ name: "archived" }) archived: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "avatar_template" }) avatarTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "category_id" }) categoryId: number; - - @SpeakeasyMetadata() - @Expose({ name: "closed" }) closed: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "created_at" }) createdAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "deleted" }) deleted: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "excerpt" }) excerpt: string; - - @SpeakeasyMetadata() - @Expose({ name: "hidden" }) - hidden: string; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) - name: string; - - @SpeakeasyMetadata() - @Expose({ name: "post_id" }) - postId: string; - - @SpeakeasyMetadata() - @Expose({ name: "post_number" }) + hidden: string | null; + name: string | null; + postId: string | null; postNumber: number; - - @SpeakeasyMetadata() - @Expose({ name: "post_type" }) - postType: string; - - @SpeakeasyMetadata() - @Expose({ name: "slug" }) + postType: string | null; slug: string; - - @SpeakeasyMetadata() - @Expose({ name: "target_name" }) - targetName: string; - - @SpeakeasyMetadata() - @Expose({ name: "target_user_id" }) + targetName: string | null; targetUserId: number; - - @SpeakeasyMetadata() - @Expose({ name: "target_username" }) targetUsername: string; - - @SpeakeasyMetadata() - @Expose({ name: "title" }) title: string; - - @SpeakeasyMetadata() - @Expose({ name: "topic_id" }) topicId: number; - - @SpeakeasyMetadata() - @Expose({ name: "user_id" }) userId: number; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) username: string; -} +}; /** * response */ -export class ListUserActionsResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata({ elemType: UserActions }) - @Expose({ name: "user_actions" }) - @Type(() => UserActions) - userActions: UserActions[]; +export type ListUserActionsResponseBody = { + userActions: Array; +}; + +/** @internal */ +export const ListUserActionsRequest$inboundSchema: z.ZodType< + ListUserActionsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + filter: z.string(), + offset: z.number().int(), + username: z.string(), +}); + +/** @internal */ +export type ListUserActionsRequest$Outbound = { + filter: string; + offset: number; + username: string; +}; + +/** @internal */ +export const ListUserActionsRequest$outboundSchema: z.ZodType< + ListUserActionsRequest$Outbound, + z.ZodTypeDef, + ListUserActionsRequest +> = z.object({ + filter: z.string(), + offset: z.number().int(), + username: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListUserActionsRequest$ { + /** @deprecated use `ListUserActionsRequest$inboundSchema` instead. */ + export const inboundSchema = ListUserActionsRequest$inboundSchema; + /** @deprecated use `ListUserActionsRequest$outboundSchema` instead. */ + export const outboundSchema = ListUserActionsRequest$outboundSchema; + /** @deprecated use `ListUserActionsRequest$Outbound` instead. */ + export type Outbound = ListUserActionsRequest$Outbound; } -export class ListUserActionsResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const UserActions$inboundSchema: z.ZodType = z + .object({ + acting_avatar_template: z.string(), + acting_name: z.nullable(z.string()), + acting_user_id: z.number().int(), + acting_username: z.string(), + action_code: z.nullable(z.string()), + action_type: z.number().int(), + archived: z.boolean(), + avatar_template: z.string(), + category_id: z.number().int(), + closed: z.boolean(), + created_at: z.string(), + deleted: z.boolean(), + excerpt: z.string(), + hidden: z.nullable(z.string()), + name: z.nullable(z.string()), + post_id: z.nullable(z.string()), + post_number: z.number().int(), + post_type: z.nullable(z.string()), + slug: z.string(), + target_name: z.nullable(z.string()), + target_user_id: z.number().int(), + target_username: z.string(), + title: z.string(), + topic_id: z.number().int(), + user_id: z.number().int(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + acting_avatar_template: "actingAvatarTemplate", + acting_name: "actingName", + acting_user_id: "actingUserId", + acting_username: "actingUsername", + action_code: "actionCode", + action_type: "actionType", + avatar_template: "avatarTemplate", + category_id: "categoryId", + created_at: "createdAt", + post_id: "postId", + post_number: "postNumber", + post_type: "postType", + target_name: "targetName", + target_user_id: "targetUserId", + target_username: "targetUsername", + topic_id: "topicId", + user_id: "userId", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type UserActions$Outbound = { + acting_avatar_template: string; + acting_name: string | null; + acting_user_id: number; + acting_username: string; + action_code: string | null; + action_type: number; + archived: boolean; + avatar_template: string; + category_id: number; + closed: boolean; + created_at: string; + deleted: boolean; + excerpt: string; + hidden: string | null; + name: string | null; + post_id: string | null; + post_number: number; + post_type: string | null; + slug: string; + target_name: string | null; + target_user_id: number; + target_username: string; + title: string; + topic_id: number; + user_id: number; + username: string; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const UserActions$outboundSchema: z.ZodType< + UserActions$Outbound, + z.ZodTypeDef, + UserActions +> = z + .object({ + actingAvatarTemplate: z.string(), + actingName: z.nullable(z.string()), + actingUserId: z.number().int(), + actingUsername: z.string(), + actionCode: z.nullable(z.string()), + actionType: z.number().int(), + archived: z.boolean(), + avatarTemplate: z.string(), + categoryId: z.number().int(), + closed: z.boolean(), + createdAt: z.string(), + deleted: z.boolean(), + excerpt: z.string(), + hidden: z.nullable(z.string()), + name: z.nullable(z.string()), + postId: z.nullable(z.string()), + postNumber: z.number().int(), + postType: z.nullable(z.string()), + slug: z.string(), + targetName: z.nullable(z.string()), + targetUserId: z.number().int(), + targetUsername: z.string(), + title: z.string(), + topicId: z.number().int(), + userId: z.number().int(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + actingAvatarTemplate: "acting_avatar_template", + actingName: "acting_name", + actingUserId: "acting_user_id", + actingUsername: "acting_username", + actionCode: "action_code", + actionType: "action_type", + avatarTemplate: "avatar_template", + categoryId: "category_id", + createdAt: "created_at", + postId: "post_id", + postNumber: "post_number", + postType: "post_type", + targetName: "target_name", + targetUserId: "target_user_id", + targetUsername: "target_username", + topicId: "topic_id", + userId: "user_id", + }); + }); - /** - * response - */ - @SpeakeasyMetadata() - object?: ListUserActionsResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UserActions$ { + /** @deprecated use `UserActions$inboundSchema` instead. */ + export const inboundSchema = UserActions$inboundSchema; + /** @deprecated use `UserActions$outboundSchema` instead. */ + export const outboundSchema = UserActions$outboundSchema; + /** @deprecated use `UserActions$Outbound` instead. */ + export type Outbound = UserActions$Outbound; +} + +/** @internal */ +export const ListUserActionsResponseBody$inboundSchema: z.ZodType< + ListUserActionsResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + user_actions: z.array(z.lazy(() => UserActions$inboundSchema)), + }) + .transform((v) => { + return remap$(v, { + user_actions: "userActions", + }); + }); + +/** @internal */ +export type ListUserActionsResponseBody$Outbound = { + user_actions: Array; +}; + +/** @internal */ +export const ListUserActionsResponseBody$outboundSchema: z.ZodType< + ListUserActionsResponseBody$Outbound, + z.ZodTypeDef, + ListUserActionsResponseBody +> = z + .object({ + userActions: z.array(z.lazy(() => UserActions$outboundSchema)), + }) + .transform((v) => { + return remap$(v, { + userActions: "user_actions", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListUserActionsResponseBody$ { + /** @deprecated use `ListUserActionsResponseBody$inboundSchema` instead. */ + export const inboundSchema = ListUserActionsResponseBody$inboundSchema; + /** @deprecated use `ListUserActionsResponseBody$outboundSchema` instead. */ + export const outboundSchema = ListUserActionsResponseBody$outboundSchema; + /** @deprecated use `ListUserActionsResponseBody$Outbound` instead. */ + export type Outbound = ListUserActionsResponseBody$Outbound; } diff --git a/src/sdk/models/operations/listuserbadges.ts b/src/sdk/models/operations/listuserbadges.ts index b78de45..c6dc655 100644 --- a/src/sdk/models/operations/listuserbadges.ts +++ b/src/sdk/models/operations/listuserbadges.ts @@ -1,203 +1,455 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class ListUserBadgesRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=username" }) +export type ListUserBadgesRequest = { username: string; -} +}; -export class ListUserBadgesBadgeTypes extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "id" }) +export type ListUserBadgesBadgeTypes = { id: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "sort_order" }) sortOrder: number; -} +}; -export class ListUserBadgesBadges extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "allow_title" }) +export type ListUserBadgesBadges = { allowTitle: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "badge_grouping_id" }) badgeGroupingId: number; - - @SpeakeasyMetadata() - @Expose({ name: "badge_type_id" }) badgeTypeId: number; - - @SpeakeasyMetadata() - @Expose({ name: "description" }) description: string; - - @SpeakeasyMetadata() - @Expose({ name: "enabled" }) enabled: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "grant_count" }) grantCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "icon" }) icon: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "image_url" }) - imageUrl: string; - - @SpeakeasyMetadata() - @Expose({ name: "listable" }) + imageUrl: string | null; listable: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "manually_grantable" }) manuallyGrantable: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "multiple_grant" }) multipleGrant: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "slug" }) slug: string; - - @SpeakeasyMetadata() - @Expose({ name: "system" }) system: boolean; -} +}; -export class GrantedBies extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "admin" }) +export type GrantedBies = { admin: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "avatar_template" }) avatarTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_name" }) - flairName: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) + flairName: string | null; id: number; - - @SpeakeasyMetadata() - @Expose({ name: "moderator" }) moderator: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "trust_level" }) trustLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) username: string; -} +}; -export class UserBadges extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "badge_id" }) +export type UserBadges = { badgeId: number; - - @SpeakeasyMetadata() - @Expose({ name: "can_favorite" }) canFavorite: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "granted_at" }) grantedAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "granted_by_id" }) grantedById: number; - - @SpeakeasyMetadata() - @Expose({ name: "grouping_position" }) groupingPosition: number; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "is_favorite" }) - isFavorite: string; -} + isFavorite: string | null; +}; /** * success response */ -export class ListUserBadgesResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata({ elemType: ListUserBadgesBadgeTypes }) - @Expose({ name: "badge_types" }) - @Type(() => ListUserBadgesBadgeTypes) - badgeTypes?: ListUserBadgesBadgeTypes[]; +export type ListUserBadgesResponseBody = { + badgeTypes?: Array | undefined; + badges?: Array | undefined; + grantedBies?: Array | undefined; + userBadges: Array; +}; - @SpeakeasyMetadata({ elemType: ListUserBadgesBadges }) - @Expose({ name: "badges" }) - @Type(() => ListUserBadgesBadges) - badges?: ListUserBadgesBadges[]; +/** @internal */ +export const ListUserBadgesRequest$inboundSchema: z.ZodType< + ListUserBadgesRequest, + z.ZodTypeDef, + unknown +> = z.object({ + username: z.string(), +}); - @SpeakeasyMetadata({ elemType: GrantedBies }) - @Expose({ name: "granted_bies" }) - @Type(() => GrantedBies) - grantedBies?: GrantedBies[]; +/** @internal */ +export type ListUserBadgesRequest$Outbound = { + username: string; +}; - @SpeakeasyMetadata({ elemType: UserBadges }) - @Expose({ name: "user_badges" }) - @Type(() => UserBadges) - userBadges: UserBadges[]; +/** @internal */ +export const ListUserBadgesRequest$outboundSchema: z.ZodType< + ListUserBadgesRequest$Outbound, + z.ZodTypeDef, + ListUserBadgesRequest +> = z.object({ + username: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListUserBadgesRequest$ { + /** @deprecated use `ListUserBadgesRequest$inboundSchema` instead. */ + export const inboundSchema = ListUserBadgesRequest$inboundSchema; + /** @deprecated use `ListUserBadgesRequest$outboundSchema` instead. */ + export const outboundSchema = ListUserBadgesRequest$outboundSchema; + /** @deprecated use `ListUserBadgesRequest$Outbound` instead. */ + export type Outbound = ListUserBadgesRequest$Outbound; } -export class ListUserBadgesResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const ListUserBadgesBadgeTypes$inboundSchema: z.ZodType< + ListUserBadgesBadgeTypes, + z.ZodTypeDef, + unknown +> = z + .object({ + id: z.number().int(), + name: z.string(), + sort_order: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + sort_order: "sortOrder", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type ListUserBadgesBadgeTypes$Outbound = { + id: number; + name: string; + sort_order: number; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const ListUserBadgesBadgeTypes$outboundSchema: z.ZodType< + ListUserBadgesBadgeTypes$Outbound, + z.ZodTypeDef, + ListUserBadgesBadgeTypes +> = z + .object({ + id: z.number().int(), + name: z.string(), + sortOrder: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + sortOrder: "sort_order", + }); + }); - /** - * success response - */ - @SpeakeasyMetadata() - object?: ListUserBadgesResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListUserBadgesBadgeTypes$ { + /** @deprecated use `ListUserBadgesBadgeTypes$inboundSchema` instead. */ + export const inboundSchema = ListUserBadgesBadgeTypes$inboundSchema; + /** @deprecated use `ListUserBadgesBadgeTypes$outboundSchema` instead. */ + export const outboundSchema = ListUserBadgesBadgeTypes$outboundSchema; + /** @deprecated use `ListUserBadgesBadgeTypes$Outbound` instead. */ + export type Outbound = ListUserBadgesBadgeTypes$Outbound; +} + +/** @internal */ +export const ListUserBadgesBadges$inboundSchema: z.ZodType< + ListUserBadgesBadges, + z.ZodTypeDef, + unknown +> = z + .object({ + allow_title: z.boolean(), + badge_grouping_id: z.number().int(), + badge_type_id: z.number().int(), + description: z.string(), + enabled: z.boolean(), + grant_count: z.number().int(), + icon: z.string(), + id: z.number().int(), + image_url: z.nullable(z.string()), + listable: z.boolean(), + manually_grantable: z.boolean(), + multiple_grant: z.boolean(), + name: z.string(), + slug: z.string(), + system: z.boolean(), + }) + .transform((v) => { + return remap$(v, { + allow_title: "allowTitle", + badge_grouping_id: "badgeGroupingId", + badge_type_id: "badgeTypeId", + grant_count: "grantCount", + image_url: "imageUrl", + manually_grantable: "manuallyGrantable", + multiple_grant: "multipleGrant", + }); + }); + +/** @internal */ +export type ListUserBadgesBadges$Outbound = { + allow_title: boolean; + badge_grouping_id: number; + badge_type_id: number; + description: string; + enabled: boolean; + grant_count: number; + icon: string; + id: number; + image_url: string | null; + listable: boolean; + manually_grantable: boolean; + multiple_grant: boolean; + name: string; + slug: string; + system: boolean; +}; + +/** @internal */ +export const ListUserBadgesBadges$outboundSchema: z.ZodType< + ListUserBadgesBadges$Outbound, + z.ZodTypeDef, + ListUserBadgesBadges +> = z + .object({ + allowTitle: z.boolean(), + badgeGroupingId: z.number().int(), + badgeTypeId: z.number().int(), + description: z.string(), + enabled: z.boolean(), + grantCount: z.number().int(), + icon: z.string(), + id: z.number().int(), + imageUrl: z.nullable(z.string()), + listable: z.boolean(), + manuallyGrantable: z.boolean(), + multipleGrant: z.boolean(), + name: z.string(), + slug: z.string(), + system: z.boolean(), + }) + .transform((v) => { + return remap$(v, { + allowTitle: "allow_title", + badgeGroupingId: "badge_grouping_id", + badgeTypeId: "badge_type_id", + grantCount: "grant_count", + imageUrl: "image_url", + manuallyGrantable: "manually_grantable", + multipleGrant: "multiple_grant", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListUserBadgesBadges$ { + /** @deprecated use `ListUserBadgesBadges$inboundSchema` instead. */ + export const inboundSchema = ListUserBadgesBadges$inboundSchema; + /** @deprecated use `ListUserBadgesBadges$outboundSchema` instead. */ + export const outboundSchema = ListUserBadgesBadges$outboundSchema; + /** @deprecated use `ListUserBadgesBadges$Outbound` instead. */ + export type Outbound = ListUserBadgesBadges$Outbound; +} + +/** @internal */ +export const GrantedBies$inboundSchema: z.ZodType = z + .object({ + admin: z.boolean(), + avatar_template: z.string(), + flair_name: z.nullable(z.string()), + id: z.number().int(), + moderator: z.boolean(), + name: z.string(), + trust_level: z.number().int(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + avatar_template: "avatarTemplate", + flair_name: "flairName", + trust_level: "trustLevel", + }); + }); + +/** @internal */ +export type GrantedBies$Outbound = { + admin: boolean; + avatar_template: string; + flair_name: string | null; + id: number; + moderator: boolean; + name: string; + trust_level: number; + username: string; +}; + +/** @internal */ +export const GrantedBies$outboundSchema: z.ZodType< + GrantedBies$Outbound, + z.ZodTypeDef, + GrantedBies +> = z + .object({ + admin: z.boolean(), + avatarTemplate: z.string(), + flairName: z.nullable(z.string()), + id: z.number().int(), + moderator: z.boolean(), + name: z.string(), + trustLevel: z.number().int(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + avatarTemplate: "avatar_template", + flairName: "flair_name", + trustLevel: "trust_level", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GrantedBies$ { + /** @deprecated use `GrantedBies$inboundSchema` instead. */ + export const inboundSchema = GrantedBies$inboundSchema; + /** @deprecated use `GrantedBies$outboundSchema` instead. */ + export const outboundSchema = GrantedBies$outboundSchema; + /** @deprecated use `GrantedBies$Outbound` instead. */ + export type Outbound = GrantedBies$Outbound; +} + +/** @internal */ +export const UserBadges$inboundSchema: z.ZodType = z + .object({ + badge_id: z.number().int(), + can_favorite: z.boolean(), + granted_at: z.string(), + granted_by_id: z.number().int(), + grouping_position: z.number().int(), + id: z.number().int(), + is_favorite: z.nullable(z.string()), + }) + .transform((v) => { + return remap$(v, { + badge_id: "badgeId", + can_favorite: "canFavorite", + granted_at: "grantedAt", + granted_by_id: "grantedById", + grouping_position: "groupingPosition", + is_favorite: "isFavorite", + }); + }); + +/** @internal */ +export type UserBadges$Outbound = { + badge_id: number; + can_favorite: boolean; + granted_at: string; + granted_by_id: number; + grouping_position: number; + id: number; + is_favorite: string | null; +}; + +/** @internal */ +export const UserBadges$outboundSchema: z.ZodType = z + .object({ + badgeId: z.number().int(), + canFavorite: z.boolean(), + grantedAt: z.string(), + grantedById: z.number().int(), + groupingPosition: z.number().int(), + id: z.number().int(), + isFavorite: z.nullable(z.string()), + }) + .transform((v) => { + return remap$(v, { + badgeId: "badge_id", + canFavorite: "can_favorite", + grantedAt: "granted_at", + grantedById: "granted_by_id", + groupingPosition: "grouping_position", + isFavorite: "is_favorite", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UserBadges$ { + /** @deprecated use `UserBadges$inboundSchema` instead. */ + export const inboundSchema = UserBadges$inboundSchema; + /** @deprecated use `UserBadges$outboundSchema` instead. */ + export const outboundSchema = UserBadges$outboundSchema; + /** @deprecated use `UserBadges$Outbound` instead. */ + export type Outbound = UserBadges$Outbound; +} + +/** @internal */ +export const ListUserBadgesResponseBody$inboundSchema: z.ZodType< + ListUserBadgesResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + badge_types: z.array(z.lazy(() => ListUserBadgesBadgeTypes$inboundSchema)).optional(), + badges: z.array(z.lazy(() => ListUserBadgesBadges$inboundSchema)).optional(), + granted_bies: z.array(z.lazy(() => GrantedBies$inboundSchema)).optional(), + user_badges: z.array(z.lazy(() => UserBadges$inboundSchema)), + }) + .transform((v) => { + return remap$(v, { + badge_types: "badgeTypes", + granted_bies: "grantedBies", + user_badges: "userBadges", + }); + }); + +/** @internal */ +export type ListUserBadgesResponseBody$Outbound = { + badge_types?: Array | undefined; + badges?: Array | undefined; + granted_bies?: Array | undefined; + user_badges: Array; +}; + +/** @internal */ +export const ListUserBadgesResponseBody$outboundSchema: z.ZodType< + ListUserBadgesResponseBody$Outbound, + z.ZodTypeDef, + ListUserBadgesResponseBody +> = z + .object({ + badgeTypes: z.array(z.lazy(() => ListUserBadgesBadgeTypes$outboundSchema)).optional(), + badges: z.array(z.lazy(() => ListUserBadgesBadges$outboundSchema)).optional(), + grantedBies: z.array(z.lazy(() => GrantedBies$outboundSchema)).optional(), + userBadges: z.array(z.lazy(() => UserBadges$outboundSchema)), + }) + .transform((v) => { + return remap$(v, { + badgeTypes: "badge_types", + grantedBies: "granted_bies", + userBadges: "user_badges", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListUserBadgesResponseBody$ { + /** @deprecated use `ListUserBadgesResponseBody$inboundSchema` instead. */ + export const inboundSchema = ListUserBadgesResponseBody$inboundSchema; + /** @deprecated use `ListUserBadgesResponseBody$outboundSchema` instead. */ + export const outboundSchema = ListUserBadgesResponseBody$outboundSchema; + /** @deprecated use `ListUserBadgesResponseBody$Outbound` instead. */ + export type Outbound = ListUserBadgesResponseBody$Outbound; } diff --git a/src/sdk/models/operations/listuserprivatemessages.ts b/src/sdk/models/operations/listuserprivatemessages.ts index c0497ee..6ce9008 100644 --- a/src/sdk/models/operations/listuserprivatemessages.ts +++ b/src/sdk/models/operations/listuserprivatemessages.ts @@ -1,278 +1,607 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class ListUserPrivateMessagesRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=username" }) +export type ListUserPrivateMessagesRequest = { username: string; -} +}; -export class ListUserPrivateMessagesParticipants extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "description" }) - description?: string; +export type ListUserPrivateMessagesParticipants = { + description?: string | null | undefined; + extras?: string | undefined; + primaryGroupId?: string | null | undefined; + userId?: number | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "extras" }) - extras?: string; +export type ListUserPrivateMessagesPosters = { + description?: string | undefined; + extras?: string | undefined; + primaryGroupId?: string | null | undefined; + userId?: number | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "primary_group_id" }) - primaryGroupId?: string; +export type ListUserPrivateMessagesTopics = { + allowedUserCount?: number | undefined; + archetype?: string | undefined; + archived?: boolean | undefined; + bookmarked?: boolean | undefined; + bumped?: boolean | undefined; + bumpedAt?: string | undefined; + categoryId?: string | null | undefined; + closed?: boolean | undefined; + createdAt?: string | undefined; + fancyTitle?: string | undefined; + featuredLink?: string | null | undefined; + hasSummary?: boolean | undefined; + highestPostNumber?: number | undefined; + id?: number | undefined; + imageUrl?: string | null | undefined; + lastPostedAt?: string | undefined; + lastPosterUsername?: string | undefined; + lastReadPostNumber?: number | undefined; + likeCount?: number | undefined; + liked?: boolean | undefined; + notificationLevel?: number | undefined; + participants?: Array | undefined; + pinned?: boolean | undefined; + pinnedGlobally?: boolean | undefined; + posters?: Array | undefined; + postsCount?: number | undefined; + replyCount?: number | undefined; + slug?: string | undefined; + title?: string | undefined; + unpinned?: string | null | undefined; + unreadPosts?: number | undefined; + unseen?: boolean | undefined; + views?: number | undefined; + visible?: boolean | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "user_id" }) - userId?: number; -} +export type ListUserPrivateMessagesTopicList = { + canCreateTopic?: boolean | undefined; + draft?: string | null | undefined; + draftKey?: string | undefined; + draftSequence?: number | undefined; + perPage?: number | undefined; + topics?: Array | undefined; +}; -export class ListUserPrivateMessagesPosters extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "description" }) - description?: string; - - @SpeakeasyMetadata() - @Expose({ name: "extras" }) - extras?: string; - - @SpeakeasyMetadata() - @Expose({ name: "primary_group_id" }) - primaryGroupId?: string; - - @SpeakeasyMetadata() - @Expose({ name: "user_id" }) - userId?: number; -} - -export class ListUserPrivateMessagesTopics extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "allowed_user_count" }) - allowedUserCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "archetype" }) - archetype?: string; - - @SpeakeasyMetadata() - @Expose({ name: "archived" }) - archived?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "bookmarked" }) - bookmarked?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "bumped" }) - bumped?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "bumped_at" }) - bumpedAt?: string; - - @SpeakeasyMetadata() - @Expose({ name: "category_id" }) - categoryId?: string; - - @SpeakeasyMetadata() - @Expose({ name: "closed" }) - closed?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "created_at" }) - createdAt?: string; - - @SpeakeasyMetadata() - @Expose({ name: "fancy_title" }) - fancyTitle?: string; - - @SpeakeasyMetadata() - @Expose({ name: "featured_link" }) - featuredLink?: string; - - @SpeakeasyMetadata() - @Expose({ name: "has_summary" }) - hasSummary?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "highest_post_number" }) - highestPostNumber?: number; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) - id?: number; - - @SpeakeasyMetadata() - @Expose({ name: "image_url" }) - imageUrl?: string; - - @SpeakeasyMetadata() - @Expose({ name: "last_posted_at" }) - lastPostedAt?: string; - - @SpeakeasyMetadata() - @Expose({ name: "last_poster_username" }) - lastPosterUsername?: string; - - @SpeakeasyMetadata() - @Expose({ name: "last_read_post_number" }) - lastReadPostNumber?: number; - - @SpeakeasyMetadata() - @Expose({ name: "like_count" }) - likeCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "liked" }) - liked?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "notification_level" }) - notificationLevel?: number; - - @SpeakeasyMetadata({ elemType: ListUserPrivateMessagesParticipants }) - @Expose({ name: "participants" }) - @Type(() => ListUserPrivateMessagesParticipants) - participants?: ListUserPrivateMessagesParticipants[]; - - @SpeakeasyMetadata() - @Expose({ name: "pinned" }) - pinned?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "pinned_globally" }) - pinnedGlobally?: boolean; - - @SpeakeasyMetadata({ elemType: ListUserPrivateMessagesPosters }) - @Expose({ name: "posters" }) - @Type(() => ListUserPrivateMessagesPosters) - posters?: ListUserPrivateMessagesPosters[]; - - @SpeakeasyMetadata() - @Expose({ name: "posts_count" }) - postsCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "reply_count" }) - replyCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "slug" }) - slug?: string; - - @SpeakeasyMetadata() - @Expose({ name: "title" }) - title?: string; - - @SpeakeasyMetadata() - @Expose({ name: "unpinned" }) - unpinned?: string; - - @SpeakeasyMetadata() - @Expose({ name: "unread_posts" }) - unreadPosts?: number; - - @SpeakeasyMetadata() - @Expose({ name: "unseen" }) - unseen?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "views" }) - views?: number; - - @SpeakeasyMetadata() - @Expose({ name: "visible" }) - visible?: boolean; -} - -export class ListUserPrivateMessagesTopicList extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "can_create_topic" }) - canCreateTopic?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "draft" }) - draft?: string; - - @SpeakeasyMetadata() - @Expose({ name: "draft_key" }) - draftKey?: string; - - @SpeakeasyMetadata() - @Expose({ name: "draft_sequence" }) - draftSequence?: number; - - @SpeakeasyMetadata() - @Expose({ name: "per_page" }) - perPage?: number; - - @SpeakeasyMetadata({ elemType: ListUserPrivateMessagesTopics }) - @Expose({ name: "topics" }) - @Type(() => ListUserPrivateMessagesTopics) - topics?: ListUserPrivateMessagesTopics[]; -} - -export class ListUserPrivateMessagesUsers extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "avatar_template" }) - avatarTemplate?: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) - id?: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) - name?: string; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) - username?: string; -} +export type ListUserPrivateMessagesUsers = { + avatarTemplate?: string | undefined; + id?: number | undefined; + name?: string | undefined; + username?: string | undefined; +}; /** * private messages */ -export class ListUserPrivateMessagesResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "primary_groups" }) - primaryGroups?: any[]; +export type ListUserPrivateMessagesResponseBody = { + primaryGroups?: Array | undefined; + topicList?: ListUserPrivateMessagesTopicList | undefined; + users?: Array | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "topic_list" }) - @Type(() => ListUserPrivateMessagesTopicList) - topicList?: ListUserPrivateMessagesTopicList; +/** @internal */ +export const ListUserPrivateMessagesRequest$inboundSchema: z.ZodType< + ListUserPrivateMessagesRequest, + z.ZodTypeDef, + unknown +> = z.object({ + username: z.string(), +}); - @SpeakeasyMetadata({ elemType: ListUserPrivateMessagesUsers }) - @Expose({ name: "users" }) - @Type(() => ListUserPrivateMessagesUsers) - users?: ListUserPrivateMessagesUsers[]; +/** @internal */ +export type ListUserPrivateMessagesRequest$Outbound = { + username: string; +}; + +/** @internal */ +export const ListUserPrivateMessagesRequest$outboundSchema: z.ZodType< + ListUserPrivateMessagesRequest$Outbound, + z.ZodTypeDef, + ListUserPrivateMessagesRequest +> = z.object({ + username: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListUserPrivateMessagesRequest$ { + /** @deprecated use `ListUserPrivateMessagesRequest$inboundSchema` instead. */ + export const inboundSchema = ListUserPrivateMessagesRequest$inboundSchema; + /** @deprecated use `ListUserPrivateMessagesRequest$outboundSchema` instead. */ + export const outboundSchema = ListUserPrivateMessagesRequest$outboundSchema; + /** @deprecated use `ListUserPrivateMessagesRequest$Outbound` instead. */ + export type Outbound = ListUserPrivateMessagesRequest$Outbound; } -export class ListUserPrivateMessagesResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const ListUserPrivateMessagesParticipants$inboundSchema: z.ZodType< + ListUserPrivateMessagesParticipants, + z.ZodTypeDef, + unknown +> = z + .object({ + description: z.nullable(z.string()).optional(), + extras: z.string().optional(), + primary_group_id: z.nullable(z.string()).optional(), + user_id: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + primary_group_id: "primaryGroupId", + user_id: "userId", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type ListUserPrivateMessagesParticipants$Outbound = { + description?: string | null | undefined; + extras?: string | undefined; + primary_group_id?: string | null | undefined; + user_id?: number | undefined; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const ListUserPrivateMessagesParticipants$outboundSchema: z.ZodType< + ListUserPrivateMessagesParticipants$Outbound, + z.ZodTypeDef, + ListUserPrivateMessagesParticipants +> = z + .object({ + description: z.nullable(z.string()).optional(), + extras: z.string().optional(), + primaryGroupId: z.nullable(z.string()).optional(), + userId: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + primaryGroupId: "primary_group_id", + userId: "user_id", + }); + }); - /** - * private messages - */ - @SpeakeasyMetadata() - object?: ListUserPrivateMessagesResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListUserPrivateMessagesParticipants$ { + /** @deprecated use `ListUserPrivateMessagesParticipants$inboundSchema` instead. */ + export const inboundSchema = ListUserPrivateMessagesParticipants$inboundSchema; + /** @deprecated use `ListUserPrivateMessagesParticipants$outboundSchema` instead. */ + export const outboundSchema = ListUserPrivateMessagesParticipants$outboundSchema; + /** @deprecated use `ListUserPrivateMessagesParticipants$Outbound` instead. */ + export type Outbound = ListUserPrivateMessagesParticipants$Outbound; +} + +/** @internal */ +export const ListUserPrivateMessagesPosters$inboundSchema: z.ZodType< + ListUserPrivateMessagesPosters, + z.ZodTypeDef, + unknown +> = z + .object({ + description: z.string().optional(), + extras: z.string().optional(), + primary_group_id: z.nullable(z.string()).optional(), + user_id: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + primary_group_id: "primaryGroupId", + user_id: "userId", + }); + }); + +/** @internal */ +export type ListUserPrivateMessagesPosters$Outbound = { + description?: string | undefined; + extras?: string | undefined; + primary_group_id?: string | null | undefined; + user_id?: number | undefined; +}; + +/** @internal */ +export const ListUserPrivateMessagesPosters$outboundSchema: z.ZodType< + ListUserPrivateMessagesPosters$Outbound, + z.ZodTypeDef, + ListUserPrivateMessagesPosters +> = z + .object({ + description: z.string().optional(), + extras: z.string().optional(), + primaryGroupId: z.nullable(z.string()).optional(), + userId: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + primaryGroupId: "primary_group_id", + userId: "user_id", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListUserPrivateMessagesPosters$ { + /** @deprecated use `ListUserPrivateMessagesPosters$inboundSchema` instead. */ + export const inboundSchema = ListUserPrivateMessagesPosters$inboundSchema; + /** @deprecated use `ListUserPrivateMessagesPosters$outboundSchema` instead. */ + export const outboundSchema = ListUserPrivateMessagesPosters$outboundSchema; + /** @deprecated use `ListUserPrivateMessagesPosters$Outbound` instead. */ + export type Outbound = ListUserPrivateMessagesPosters$Outbound; +} + +/** @internal */ +export const ListUserPrivateMessagesTopics$inboundSchema: z.ZodType< + ListUserPrivateMessagesTopics, + z.ZodTypeDef, + unknown +> = z + .object({ + allowed_user_count: z.number().int().optional(), + archetype: z.string().optional(), + archived: z.boolean().optional(), + bookmarked: z.boolean().optional(), + bumped: z.boolean().optional(), + bumped_at: z.string().optional(), + category_id: z.nullable(z.string()).optional(), + closed: z.boolean().optional(), + created_at: z.string().optional(), + fancy_title: z.string().optional(), + featured_link: z.nullable(z.string()).optional(), + has_summary: z.boolean().optional(), + highest_post_number: z.number().int().optional(), + id: z.number().int().optional(), + image_url: z.nullable(z.string()).optional(), + last_posted_at: z.string().optional(), + last_poster_username: z.string().optional(), + last_read_post_number: z.number().int().optional(), + like_count: z.number().int().optional(), + liked: z.boolean().optional(), + notification_level: z.number().int().optional(), + participants: z + .array(z.lazy(() => ListUserPrivateMessagesParticipants$inboundSchema)) + .optional(), + pinned: z.boolean().optional(), + pinned_globally: z.boolean().optional(), + posters: z.array(z.lazy(() => ListUserPrivateMessagesPosters$inboundSchema)).optional(), + posts_count: z.number().int().optional(), + reply_count: z.number().int().optional(), + slug: z.string().optional(), + title: z.string().optional(), + unpinned: z.nullable(z.string()).optional(), + unread_posts: z.number().int().optional(), + unseen: z.boolean().optional(), + views: z.number().int().optional(), + visible: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + allowed_user_count: "allowedUserCount", + bumped_at: "bumpedAt", + category_id: "categoryId", + created_at: "createdAt", + fancy_title: "fancyTitle", + featured_link: "featuredLink", + has_summary: "hasSummary", + highest_post_number: "highestPostNumber", + image_url: "imageUrl", + last_posted_at: "lastPostedAt", + last_poster_username: "lastPosterUsername", + last_read_post_number: "lastReadPostNumber", + like_count: "likeCount", + notification_level: "notificationLevel", + pinned_globally: "pinnedGlobally", + posts_count: "postsCount", + reply_count: "replyCount", + unread_posts: "unreadPosts", + }); + }); + +/** @internal */ +export type ListUserPrivateMessagesTopics$Outbound = { + allowed_user_count?: number | undefined; + archetype?: string | undefined; + archived?: boolean | undefined; + bookmarked?: boolean | undefined; + bumped?: boolean | undefined; + bumped_at?: string | undefined; + category_id?: string | null | undefined; + closed?: boolean | undefined; + created_at?: string | undefined; + fancy_title?: string | undefined; + featured_link?: string | null | undefined; + has_summary?: boolean | undefined; + highest_post_number?: number | undefined; + id?: number | undefined; + image_url?: string | null | undefined; + last_posted_at?: string | undefined; + last_poster_username?: string | undefined; + last_read_post_number?: number | undefined; + like_count?: number | undefined; + liked?: boolean | undefined; + notification_level?: number | undefined; + participants?: Array | undefined; + pinned?: boolean | undefined; + pinned_globally?: boolean | undefined; + posters?: Array | undefined; + posts_count?: number | undefined; + reply_count?: number | undefined; + slug?: string | undefined; + title?: string | undefined; + unpinned?: string | null | undefined; + unread_posts?: number | undefined; + unseen?: boolean | undefined; + views?: number | undefined; + visible?: boolean | undefined; +}; + +/** @internal */ +export const ListUserPrivateMessagesTopics$outboundSchema: z.ZodType< + ListUserPrivateMessagesTopics$Outbound, + z.ZodTypeDef, + ListUserPrivateMessagesTopics +> = z + .object({ + allowedUserCount: z.number().int().optional(), + archetype: z.string().optional(), + archived: z.boolean().optional(), + bookmarked: z.boolean().optional(), + bumped: z.boolean().optional(), + bumpedAt: z.string().optional(), + categoryId: z.nullable(z.string()).optional(), + closed: z.boolean().optional(), + createdAt: z.string().optional(), + fancyTitle: z.string().optional(), + featuredLink: z.nullable(z.string()).optional(), + hasSummary: z.boolean().optional(), + highestPostNumber: z.number().int().optional(), + id: z.number().int().optional(), + imageUrl: z.nullable(z.string()).optional(), + lastPostedAt: z.string().optional(), + lastPosterUsername: z.string().optional(), + lastReadPostNumber: z.number().int().optional(), + likeCount: z.number().int().optional(), + liked: z.boolean().optional(), + notificationLevel: z.number().int().optional(), + participants: z + .array(z.lazy(() => ListUserPrivateMessagesParticipants$outboundSchema)) + .optional(), + pinned: z.boolean().optional(), + pinnedGlobally: z.boolean().optional(), + posters: z.array(z.lazy(() => ListUserPrivateMessagesPosters$outboundSchema)).optional(), + postsCount: z.number().int().optional(), + replyCount: z.number().int().optional(), + slug: z.string().optional(), + title: z.string().optional(), + unpinned: z.nullable(z.string()).optional(), + unreadPosts: z.number().int().optional(), + unseen: z.boolean().optional(), + views: z.number().int().optional(), + visible: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + allowedUserCount: "allowed_user_count", + bumpedAt: "bumped_at", + categoryId: "category_id", + createdAt: "created_at", + fancyTitle: "fancy_title", + featuredLink: "featured_link", + hasSummary: "has_summary", + highestPostNumber: "highest_post_number", + imageUrl: "image_url", + lastPostedAt: "last_posted_at", + lastPosterUsername: "last_poster_username", + lastReadPostNumber: "last_read_post_number", + likeCount: "like_count", + notificationLevel: "notification_level", + pinnedGlobally: "pinned_globally", + postsCount: "posts_count", + replyCount: "reply_count", + unreadPosts: "unread_posts", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListUserPrivateMessagesTopics$ { + /** @deprecated use `ListUserPrivateMessagesTopics$inboundSchema` instead. */ + export const inboundSchema = ListUserPrivateMessagesTopics$inboundSchema; + /** @deprecated use `ListUserPrivateMessagesTopics$outboundSchema` instead. */ + export const outboundSchema = ListUserPrivateMessagesTopics$outboundSchema; + /** @deprecated use `ListUserPrivateMessagesTopics$Outbound` instead. */ + export type Outbound = ListUserPrivateMessagesTopics$Outbound; +} + +/** @internal */ +export const ListUserPrivateMessagesTopicList$inboundSchema: z.ZodType< + ListUserPrivateMessagesTopicList, + z.ZodTypeDef, + unknown +> = z + .object({ + can_create_topic: z.boolean().optional(), + draft: z.nullable(z.string()).optional(), + draft_key: z.string().optional(), + draft_sequence: z.number().int().optional(), + per_page: z.number().int().optional(), + topics: z.array(z.lazy(() => ListUserPrivateMessagesTopics$inboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + can_create_topic: "canCreateTopic", + draft_key: "draftKey", + draft_sequence: "draftSequence", + per_page: "perPage", + }); + }); + +/** @internal */ +export type ListUserPrivateMessagesTopicList$Outbound = { + can_create_topic?: boolean | undefined; + draft?: string | null | undefined; + draft_key?: string | undefined; + draft_sequence?: number | undefined; + per_page?: number | undefined; + topics?: Array | undefined; +}; + +/** @internal */ +export const ListUserPrivateMessagesTopicList$outboundSchema: z.ZodType< + ListUserPrivateMessagesTopicList$Outbound, + z.ZodTypeDef, + ListUserPrivateMessagesTopicList +> = z + .object({ + canCreateTopic: z.boolean().optional(), + draft: z.nullable(z.string()).optional(), + draftKey: z.string().optional(), + draftSequence: z.number().int().optional(), + perPage: z.number().int().optional(), + topics: z.array(z.lazy(() => ListUserPrivateMessagesTopics$outboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + canCreateTopic: "can_create_topic", + draftKey: "draft_key", + draftSequence: "draft_sequence", + perPage: "per_page", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListUserPrivateMessagesTopicList$ { + /** @deprecated use `ListUserPrivateMessagesTopicList$inboundSchema` instead. */ + export const inboundSchema = ListUserPrivateMessagesTopicList$inboundSchema; + /** @deprecated use `ListUserPrivateMessagesTopicList$outboundSchema` instead. */ + export const outboundSchema = ListUserPrivateMessagesTopicList$outboundSchema; + /** @deprecated use `ListUserPrivateMessagesTopicList$Outbound` instead. */ + export type Outbound = ListUserPrivateMessagesTopicList$Outbound; +} + +/** @internal */ +export const ListUserPrivateMessagesUsers$inboundSchema: z.ZodType< + ListUserPrivateMessagesUsers, + z.ZodTypeDef, + unknown +> = z + .object({ + avatar_template: z.string().optional(), + id: z.number().int().optional(), + name: z.string().optional(), + username: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + avatar_template: "avatarTemplate", + }); + }); + +/** @internal */ +export type ListUserPrivateMessagesUsers$Outbound = { + avatar_template?: string | undefined; + id?: number | undefined; + name?: string | undefined; + username?: string | undefined; +}; + +/** @internal */ +export const ListUserPrivateMessagesUsers$outboundSchema: z.ZodType< + ListUserPrivateMessagesUsers$Outbound, + z.ZodTypeDef, + ListUserPrivateMessagesUsers +> = z + .object({ + avatarTemplate: z.string().optional(), + id: z.number().int().optional(), + name: z.string().optional(), + username: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + avatarTemplate: "avatar_template", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListUserPrivateMessagesUsers$ { + /** @deprecated use `ListUserPrivateMessagesUsers$inboundSchema` instead. */ + export const inboundSchema = ListUserPrivateMessagesUsers$inboundSchema; + /** @deprecated use `ListUserPrivateMessagesUsers$outboundSchema` instead. */ + export const outboundSchema = ListUserPrivateMessagesUsers$outboundSchema; + /** @deprecated use `ListUserPrivateMessagesUsers$Outbound` instead. */ + export type Outbound = ListUserPrivateMessagesUsers$Outbound; +} + +/** @internal */ +export const ListUserPrivateMessagesResponseBody$inboundSchema: z.ZodType< + ListUserPrivateMessagesResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + primary_groups: z.array(z.any()).optional(), + topic_list: z.lazy(() => ListUserPrivateMessagesTopicList$inboundSchema).optional(), + users: z.array(z.lazy(() => ListUserPrivateMessagesUsers$inboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + primary_groups: "primaryGroups", + topic_list: "topicList", + }); + }); + +/** @internal */ +export type ListUserPrivateMessagesResponseBody$Outbound = { + primary_groups?: Array | undefined; + topic_list?: ListUserPrivateMessagesTopicList$Outbound | undefined; + users?: Array | undefined; +}; + +/** @internal */ +export const ListUserPrivateMessagesResponseBody$outboundSchema: z.ZodType< + ListUserPrivateMessagesResponseBody$Outbound, + z.ZodTypeDef, + ListUserPrivateMessagesResponseBody +> = z + .object({ + primaryGroups: z.array(z.any()).optional(), + topicList: z.lazy(() => ListUserPrivateMessagesTopicList$outboundSchema).optional(), + users: z.array(z.lazy(() => ListUserPrivateMessagesUsers$outboundSchema)).optional(), + }) + .transform((v) => { + return remap$(v, { + primaryGroups: "primary_groups", + topicList: "topic_list", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListUserPrivateMessagesResponseBody$ { + /** @deprecated use `ListUserPrivateMessagesResponseBody$inboundSchema` instead. */ + export const inboundSchema = ListUserPrivateMessagesResponseBody$inboundSchema; + /** @deprecated use `ListUserPrivateMessagesResponseBody$outboundSchema` instead. */ + export const outboundSchema = ListUserPrivateMessagesResponseBody$outboundSchema; + /** @deprecated use `ListUserPrivateMessagesResponseBody$Outbound` instead. */ + export type Outbound = ListUserPrivateMessagesResponseBody$Outbound; } diff --git a/src/sdk/models/operations/listuserspublic.ts b/src/sdk/models/operations/listuserspublic.ts index 98cda08..e8e2cd0 100644 --- a/src/sdk/models/operations/listuserspublic.ts +++ b/src/sdk/models/operations/listuserspublic.ts @@ -1,160 +1,419 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; -export enum Asc { - True = "true", -} +export const Asc = { + True: "true", +} as const; +export type Asc = ClosedEnum; -export enum Order { - LikesReceived = "likes_received", - LikesGiven = "likes_given", - TopicCount = "topic_count", - PostCount = "post_count", - TopicsEntered = "topics_entered", - PostsRead = "posts_read", - DaysVisited = "days_visited", -} +export const Order = { + LikesReceived: "likes_received", + LikesGiven: "likes_given", + TopicCount: "topic_count", + PostCount: "post_count", + TopicsEntered: "topics_entered", + PostsRead: "posts_read", + DaysVisited: "days_visited", +} as const; +export type Order = ClosedEnum; -export enum Period { - Daily = "daily", - Weekly = "weekly", - Monthly = "monthly", - Quarterly = "quarterly", - Yearly = "yearly", - All = "all", -} +export const Period = { + Daily: "daily", + Weekly: "weekly", + Monthly: "monthly", + Quarterly: "quarterly", + Yearly: "yearly", + All: "all", +} as const; +export type Period = ClosedEnum; -export class ListUsersPublicRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "queryParam, style=form;explode=true;name=order" }) +export type ListUsersPublicRequest = { + asc?: Asc | undefined; order: Order; - - @SpeakeasyMetadata({ data: "queryParam, style=form;explode=true;name=period" }) + page?: number | undefined; period: Period; +}; - @SpeakeasyMetadata({ data: "queryParam, style=form;explode=true;name=asc" }) - asc?: Asc; - - @SpeakeasyMetadata({ data: "queryParam, style=form;explode=true;name=page" }) - page?: number; -} - -export class ListUsersPublicUser extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "avatar_template" }) +export type ListUsersPublicUser = { avatarTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) - name: string; - - @SpeakeasyMetadata() - @Expose({ name: "title" }) - title: string; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) + name: string | null; + title: string | null; username: string; -} +}; -export class DirectoryItems extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "days_visited" }) +export type DirectoryItems = { daysVisited: number; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "likes_given" }) likesGiven: number; - - @SpeakeasyMetadata() - @Expose({ name: "likes_received" }) likesReceived: number; - - @SpeakeasyMetadata() - @Expose({ name: "post_count" }) postCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "posts_read" }) postsRead: number; - - @SpeakeasyMetadata() - @Expose({ name: "topic_count" }) topicCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "topics_entered" }) topicsEntered: number; - - @SpeakeasyMetadata() - @Expose({ name: "user" }) - @Type(() => ListUsersPublicUser) user: ListUsersPublicUser; -} +}; -export class ListUsersPublicMeta extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "last_updated_at" }) - lastUpdatedAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "load_more_directory_items" }) +export type ListUsersPublicMeta = { + lastUpdatedAt: string | null; loadMoreDirectoryItems: string; - - @SpeakeasyMetadata() - @Expose({ name: "total_rows_directory_items" }) totalRowsDirectoryItems: number; -} +}; /** * directory items response */ -export class ListUsersPublicResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata({ elemType: DirectoryItems }) - @Expose({ name: "directory_items" }) - @Type(() => DirectoryItems) - directoryItems: DirectoryItems[]; - - @SpeakeasyMetadata() - @Expose({ name: "meta" }) - @Type(() => ListUsersPublicMeta) +export type ListUsersPublicResponseBody = { + directoryItems: Array; meta: ListUsersPublicMeta; +}; + +/** @internal */ +export const Asc$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Asc); + +/** @internal */ +export const Asc$outboundSchema: z.ZodNativeEnum = Asc$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Asc$ { + /** @deprecated use `Asc$inboundSchema` instead. */ + export const inboundSchema = Asc$inboundSchema; + /** @deprecated use `Asc$outboundSchema` instead. */ + export const outboundSchema = Asc$outboundSchema; } -export class ListUsersPublicResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const Order$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Order); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export const Order$outboundSchema: z.ZodNativeEnum = Order$inboundSchema; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; - - /** - * directory items response - */ - @SpeakeasyMetadata() - object?: ListUsersPublicResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Order$ { + /** @deprecated use `Order$inboundSchema` instead. */ + export const inboundSchema = Order$inboundSchema; + /** @deprecated use `Order$outboundSchema` instead. */ + export const outboundSchema = Order$outboundSchema; +} + +/** @internal */ +export const Period$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Period); + +/** @internal */ +export const Period$outboundSchema: z.ZodNativeEnum = Period$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Period$ { + /** @deprecated use `Period$inboundSchema` instead. */ + export const inboundSchema = Period$inboundSchema; + /** @deprecated use `Period$outboundSchema` instead. */ + export const outboundSchema = Period$outboundSchema; +} + +/** @internal */ +export const ListUsersPublicRequest$inboundSchema: z.ZodType< + ListUsersPublicRequest, + z.ZodTypeDef, + unknown +> = z.object({ + asc: Asc$inboundSchema.optional(), + order: Order$inboundSchema, + page: z.number().int().optional(), + period: Period$inboundSchema, +}); + +/** @internal */ +export type ListUsersPublicRequest$Outbound = { + asc?: string | undefined; + order: string; + page?: number | undefined; + period: string; +}; + +/** @internal */ +export const ListUsersPublicRequest$outboundSchema: z.ZodType< + ListUsersPublicRequest$Outbound, + z.ZodTypeDef, + ListUsersPublicRequest +> = z.object({ + asc: Asc$outboundSchema.optional(), + order: Order$outboundSchema, + page: z.number().int().optional(), + period: Period$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListUsersPublicRequest$ { + /** @deprecated use `ListUsersPublicRequest$inboundSchema` instead. */ + export const inboundSchema = ListUsersPublicRequest$inboundSchema; + /** @deprecated use `ListUsersPublicRequest$outboundSchema` instead. */ + export const outboundSchema = ListUsersPublicRequest$outboundSchema; + /** @deprecated use `ListUsersPublicRequest$Outbound` instead. */ + export type Outbound = ListUsersPublicRequest$Outbound; +} + +/** @internal */ +export const ListUsersPublicUser$inboundSchema: z.ZodType< + ListUsersPublicUser, + z.ZodTypeDef, + unknown +> = z + .object({ + avatar_template: z.string(), + id: z.number().int(), + name: z.nullable(z.string()), + title: z.nullable(z.string()), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + avatar_template: "avatarTemplate", + }); + }); + +/** @internal */ +export type ListUsersPublicUser$Outbound = { + avatar_template: string; + id: number; + name: string | null; + title: string | null; + username: string; +}; + +/** @internal */ +export const ListUsersPublicUser$outboundSchema: z.ZodType< + ListUsersPublicUser$Outbound, + z.ZodTypeDef, + ListUsersPublicUser +> = z + .object({ + avatarTemplate: z.string(), + id: z.number().int(), + name: z.nullable(z.string()), + title: z.nullable(z.string()), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + avatarTemplate: "avatar_template", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListUsersPublicUser$ { + /** @deprecated use `ListUsersPublicUser$inboundSchema` instead. */ + export const inboundSchema = ListUsersPublicUser$inboundSchema; + /** @deprecated use `ListUsersPublicUser$outboundSchema` instead. */ + export const outboundSchema = ListUsersPublicUser$outboundSchema; + /** @deprecated use `ListUsersPublicUser$Outbound` instead. */ + export type Outbound = ListUsersPublicUser$Outbound; +} + +/** @internal */ +export const DirectoryItems$inboundSchema: z.ZodType = z + .object({ + days_visited: z.number().int(), + id: z.number().int(), + likes_given: z.number().int(), + likes_received: z.number().int(), + post_count: z.number().int(), + posts_read: z.number().int(), + topic_count: z.number().int(), + topics_entered: z.number().int(), + user: z.lazy(() => ListUsersPublicUser$inboundSchema), + }) + .transform((v) => { + return remap$(v, { + days_visited: "daysVisited", + likes_given: "likesGiven", + likes_received: "likesReceived", + post_count: "postCount", + posts_read: "postsRead", + topic_count: "topicCount", + topics_entered: "topicsEntered", + }); + }); + +/** @internal */ +export type DirectoryItems$Outbound = { + days_visited: number; + id: number; + likes_given: number; + likes_received: number; + post_count: number; + posts_read: number; + topic_count: number; + topics_entered: number; + user: ListUsersPublicUser$Outbound; +}; + +/** @internal */ +export const DirectoryItems$outboundSchema: z.ZodType< + DirectoryItems$Outbound, + z.ZodTypeDef, + DirectoryItems +> = z + .object({ + daysVisited: z.number().int(), + id: z.number().int(), + likesGiven: z.number().int(), + likesReceived: z.number().int(), + postCount: z.number().int(), + postsRead: z.number().int(), + topicCount: z.number().int(), + topicsEntered: z.number().int(), + user: z.lazy(() => ListUsersPublicUser$outboundSchema), + }) + .transform((v) => { + return remap$(v, { + daysVisited: "days_visited", + likesGiven: "likes_given", + likesReceived: "likes_received", + postCount: "post_count", + postsRead: "posts_read", + topicCount: "topic_count", + topicsEntered: "topics_entered", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DirectoryItems$ { + /** @deprecated use `DirectoryItems$inboundSchema` instead. */ + export const inboundSchema = DirectoryItems$inboundSchema; + /** @deprecated use `DirectoryItems$outboundSchema` instead. */ + export const outboundSchema = DirectoryItems$outboundSchema; + /** @deprecated use `DirectoryItems$Outbound` instead. */ + export type Outbound = DirectoryItems$Outbound; +} + +/** @internal */ +export const ListUsersPublicMeta$inboundSchema: z.ZodType< + ListUsersPublicMeta, + z.ZodTypeDef, + unknown +> = z + .object({ + last_updated_at: z.nullable(z.string()), + load_more_directory_items: z.string(), + total_rows_directory_items: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + last_updated_at: "lastUpdatedAt", + load_more_directory_items: "loadMoreDirectoryItems", + total_rows_directory_items: "totalRowsDirectoryItems", + }); + }); + +/** @internal */ +export type ListUsersPublicMeta$Outbound = { + last_updated_at: string | null; + load_more_directory_items: string; + total_rows_directory_items: number; +}; + +/** @internal */ +export const ListUsersPublicMeta$outboundSchema: z.ZodType< + ListUsersPublicMeta$Outbound, + z.ZodTypeDef, + ListUsersPublicMeta +> = z + .object({ + lastUpdatedAt: z.nullable(z.string()), + loadMoreDirectoryItems: z.string(), + totalRowsDirectoryItems: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + lastUpdatedAt: "last_updated_at", + loadMoreDirectoryItems: "load_more_directory_items", + totalRowsDirectoryItems: "total_rows_directory_items", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListUsersPublicMeta$ { + /** @deprecated use `ListUsersPublicMeta$inboundSchema` instead. */ + export const inboundSchema = ListUsersPublicMeta$inboundSchema; + /** @deprecated use `ListUsersPublicMeta$outboundSchema` instead. */ + export const outboundSchema = ListUsersPublicMeta$outboundSchema; + /** @deprecated use `ListUsersPublicMeta$Outbound` instead. */ + export type Outbound = ListUsersPublicMeta$Outbound; +} + +/** @internal */ +export const ListUsersPublicResponseBody$inboundSchema: z.ZodType< + ListUsersPublicResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + directory_items: z.array(z.lazy(() => DirectoryItems$inboundSchema)), + meta: z.lazy(() => ListUsersPublicMeta$inboundSchema), + }) + .transform((v) => { + return remap$(v, { + directory_items: "directoryItems", + }); + }); + +/** @internal */ +export type ListUsersPublicResponseBody$Outbound = { + directory_items: Array; + meta: ListUsersPublicMeta$Outbound; +}; + +/** @internal */ +export const ListUsersPublicResponseBody$outboundSchema: z.ZodType< + ListUsersPublicResponseBody$Outbound, + z.ZodTypeDef, + ListUsersPublicResponseBody +> = z + .object({ + directoryItems: z.array(z.lazy(() => DirectoryItems$outboundSchema)), + meta: z.lazy(() => ListUsersPublicMeta$outboundSchema), + }) + .transform((v) => { + return remap$(v, { + directoryItems: "directory_items", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListUsersPublicResponseBody$ { + /** @deprecated use `ListUsersPublicResponseBody$inboundSchema` instead. */ + export const inboundSchema = ListUsersPublicResponseBody$inboundSchema; + /** @deprecated use `ListUsersPublicResponseBody$outboundSchema` instead. */ + export const outboundSchema = ListUsersPublicResponseBody$outboundSchema; + /** @deprecated use `ListUsersPublicResponseBody$Outbound` instead. */ + export type Outbound = ListUsersPublicResponseBody$Outbound; } diff --git a/src/sdk/models/operations/lockpost.ts b/src/sdk/models/operations/lockpost.ts index 5f7e657..1995d76 100644 --- a/src/sdk/models/operations/lockpost.ts +++ b/src/sdk/models/operations/lockpost.ts @@ -1,62 +1,153 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class LockPostRequestBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "locked" }) +export type LockPostRequestBody = { locked: string; -} +}; -export class LockPostRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Key" }) +export type LockPostRequest = { apiKey: string; - - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Username" }) apiUsername: string; - - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) + requestBody?: LockPostRequestBody | undefined; id: string; - - @SpeakeasyMetadata({ data: "request, media_type=application/json" }) - requestBody?: LockPostRequestBody; -} +}; /** * post updated */ -export class LockPostResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "locked" }) - locked?: boolean; +export type LockPostResponseBody = { + locked?: boolean | undefined; +}; + +/** @internal */ +export const LockPostRequestBody$inboundSchema: z.ZodType< + LockPostRequestBody, + z.ZodTypeDef, + unknown +> = z.object({ + locked: z.string(), +}); + +/** @internal */ +export type LockPostRequestBody$Outbound = { + locked: string; +}; + +/** @internal */ +export const LockPostRequestBody$outboundSchema: z.ZodType< + LockPostRequestBody$Outbound, + z.ZodTypeDef, + LockPostRequestBody +> = z.object({ + locked: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace LockPostRequestBody$ { + /** @deprecated use `LockPostRequestBody$inboundSchema` instead. */ + export const inboundSchema = LockPostRequestBody$inboundSchema; + /** @deprecated use `LockPostRequestBody$outboundSchema` instead. */ + export const outboundSchema = LockPostRequestBody$outboundSchema; + /** @deprecated use `LockPostRequestBody$Outbound` instead. */ + export type Outbound = LockPostRequestBody$Outbound; } -export class LockPostResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const LockPostRequest$inboundSchema: z.ZodType = z + .object({ + "Api-Key": z.string(), + "Api-Username": z.string(), + RequestBody: z.lazy(() => LockPostRequestBody$inboundSchema).optional(), + id: z.string(), + }) + .transform((v) => { + return remap$(v, { + "Api-Key": "apiKey", + "Api-Username": "apiUsername", + RequestBody: "requestBody", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type LockPostRequest$Outbound = { + "Api-Key": string; + "Api-Username": string; + RequestBody?: LockPostRequestBody$Outbound | undefined; + id: string; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const LockPostRequest$outboundSchema: z.ZodType< + LockPostRequest$Outbound, + z.ZodTypeDef, + LockPostRequest +> = z + .object({ + apiKey: z.string(), + apiUsername: z.string(), + requestBody: z.lazy(() => LockPostRequestBody$outboundSchema).optional(), + id: z.string(), + }) + .transform((v) => { + return remap$(v, { + apiKey: "Api-Key", + apiUsername: "Api-Username", + requestBody: "RequestBody", + }); + }); - /** - * post updated - */ - @SpeakeasyMetadata() - object?: LockPostResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace LockPostRequest$ { + /** @deprecated use `LockPostRequest$inboundSchema` instead. */ + export const inboundSchema = LockPostRequest$inboundSchema; + /** @deprecated use `LockPostRequest$outboundSchema` instead. */ + export const outboundSchema = LockPostRequest$outboundSchema; + /** @deprecated use `LockPostRequest$Outbound` instead. */ + export type Outbound = LockPostRequest$Outbound; +} + +/** @internal */ +export const LockPostResponseBody$inboundSchema: z.ZodType< + LockPostResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + locked: z.boolean().optional(), +}); + +/** @internal */ +export type LockPostResponseBody$Outbound = { + locked?: boolean | undefined; +}; + +/** @internal */ +export const LockPostResponseBody$outboundSchema: z.ZodType< + LockPostResponseBody$Outbound, + z.ZodTypeDef, + LockPostResponseBody +> = z.object({ + locked: z.boolean().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace LockPostResponseBody$ { + /** @deprecated use `LockPostResponseBody$inboundSchema` instead. */ + export const inboundSchema = LockPostResponseBody$inboundSchema; + /** @deprecated use `LockPostResponseBody$outboundSchema` instead. */ + export const outboundSchema = LockPostResponseBody$outboundSchema; + /** @deprecated use `LockPostResponseBody$Outbound` instead. */ + export type Outbound = LockPostResponseBody$Outbound; } diff --git a/src/sdk/models/operations/logoutuser.ts b/src/sdk/models/operations/logoutuser.ts index bb2d780..ef2372d 100644 --- a/src/sdk/models/operations/logoutuser.ts +++ b/src/sdk/models/operations/logoutuser.ts @@ -1,47 +1,85 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose } from "class-transformer"; +import * as z from "zod"; -export class LogOutUserRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) +export type LogOutUserRequest = { id: number; -} +}; /** * response */ -export class LogOutUserResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "success" }) +export type LogOutUserResponseBody = { success: string; +}; + +/** @internal */ +export const LogOutUserRequest$inboundSchema: z.ZodType = + z.object({ + id: z.number().int(), + }); + +/** @internal */ +export type LogOutUserRequest$Outbound = { + id: number; +}; + +/** @internal */ +export const LogOutUserRequest$outboundSchema: z.ZodType< + LogOutUserRequest$Outbound, + z.ZodTypeDef, + LogOutUserRequest +> = z.object({ + id: z.number().int(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace LogOutUserRequest$ { + /** @deprecated use `LogOutUserRequest$inboundSchema` instead. */ + export const inboundSchema = LogOutUserRequest$inboundSchema; + /** @deprecated use `LogOutUserRequest$outboundSchema` instead. */ + export const outboundSchema = LogOutUserRequest$outboundSchema; + /** @deprecated use `LogOutUserRequest$Outbound` instead. */ + export type Outbound = LogOutUserRequest$Outbound; } -export class LogOutUserResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const LogOutUserResponseBody$inboundSchema: z.ZodType< + LogOutUserResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + success: z.string(), +}); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type LogOutUserResponseBody$Outbound = { + success: string; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const LogOutUserResponseBody$outboundSchema: z.ZodType< + LogOutUserResponseBody$Outbound, + z.ZodTypeDef, + LogOutUserResponseBody +> = z.object({ + success: z.string(), +}); - /** - * response - */ - @SpeakeasyMetadata() - object?: LogOutUserResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace LogOutUserResponseBody$ { + /** @deprecated use `LogOutUserResponseBody$inboundSchema` instead. */ + export const inboundSchema = LogOutUserResponseBody$inboundSchema; + /** @deprecated use `LogOutUserResponseBody$outboundSchema` instead. */ + export const outboundSchema = LogOutUserResponseBody$outboundSchema; + /** @deprecated use `LogOutUserResponseBody$Outbound` instead. */ + export type Outbound = LogOutUserResponseBody$Outbound; } diff --git a/src/sdk/models/operations/marknotificationsasread.ts b/src/sdk/models/operations/marknotificationsasread.ts index 9b4e540..b0bc531 100644 --- a/src/sdk/models/operations/marknotificationsasread.ts +++ b/src/sdk/models/operations/marknotificationsasread.ts @@ -1,51 +1,91 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose } from "class-transformer"; +import * as z from "zod"; -export class MarkNotificationsAsReadRequestBody extends SpeakeasyBase { +export type MarkNotificationsAsReadRequestBody = { /** * (optional) Leave off to mark all notifications as read */ - @SpeakeasyMetadata() - @Expose({ name: "id" }) - id?: number; -} + id?: number | undefined; +}; /** * notifications marked read */ -export class MarkNotificationsAsReadResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "success" }) - success?: string; +export type MarkNotificationsAsReadResponseBody = { + success?: string | undefined; +}; + +/** @internal */ +export const MarkNotificationsAsReadRequestBody$inboundSchema: z.ZodType< + MarkNotificationsAsReadRequestBody, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.number().int().optional(), +}); + +/** @internal */ +export type MarkNotificationsAsReadRequestBody$Outbound = { + id?: number | undefined; +}; + +/** @internal */ +export const MarkNotificationsAsReadRequestBody$outboundSchema: z.ZodType< + MarkNotificationsAsReadRequestBody$Outbound, + z.ZodTypeDef, + MarkNotificationsAsReadRequestBody +> = z.object({ + id: z.number().int().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace MarkNotificationsAsReadRequestBody$ { + /** @deprecated use `MarkNotificationsAsReadRequestBody$inboundSchema` instead. */ + export const inboundSchema = MarkNotificationsAsReadRequestBody$inboundSchema; + /** @deprecated use `MarkNotificationsAsReadRequestBody$outboundSchema` instead. */ + export const outboundSchema = MarkNotificationsAsReadRequestBody$outboundSchema; + /** @deprecated use `MarkNotificationsAsReadRequestBody$Outbound` instead. */ + export type Outbound = MarkNotificationsAsReadRequestBody$Outbound; } -export class MarkNotificationsAsReadResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const MarkNotificationsAsReadResponseBody$inboundSchema: z.ZodType< + MarkNotificationsAsReadResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + success: z.string().optional(), +}); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type MarkNotificationsAsReadResponseBody$Outbound = { + success?: string | undefined; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const MarkNotificationsAsReadResponseBody$outboundSchema: z.ZodType< + MarkNotificationsAsReadResponseBody$Outbound, + z.ZodTypeDef, + MarkNotificationsAsReadResponseBody +> = z.object({ + success: z.string().optional(), +}); - /** - * notifications marked read - */ - @SpeakeasyMetadata() - object?: MarkNotificationsAsReadResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace MarkNotificationsAsReadResponseBody$ { + /** @deprecated use `MarkNotificationsAsReadResponseBody$inboundSchema` instead. */ + export const inboundSchema = MarkNotificationsAsReadResponseBody$inboundSchema; + /** @deprecated use `MarkNotificationsAsReadResponseBody$outboundSchema` instead. */ + export const outboundSchema = MarkNotificationsAsReadResponseBody$outboundSchema; + /** @deprecated use `MarkNotificationsAsReadResponseBody$Outbound` instead. */ + export type Outbound = MarkNotificationsAsReadResponseBody$Outbound; } diff --git a/src/sdk/models/operations/performpostaction.ts b/src/sdk/models/operations/performpostaction.ts index 3ea94db..608d8b5 100644 --- a/src/sdk/models/operations/performpostaction.ts +++ b/src/sdk/models/operations/performpostaction.ts @@ -1,273 +1,527 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class PerformPostActionRequestBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "flag_topic" }) - flagTopic?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) +export type PerformPostActionRequestBody = { + flagTopic?: boolean | undefined; id: number; - - @SpeakeasyMetadata() - @Expose({ name: "post_action_type_id" }) postActionTypeId: number; -} +}; -export class PerformPostActionRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Key" }) +export type PerformPostActionRequest = { apiKey: string; - - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Username" }) apiUsername: string; + requestBody?: PerformPostActionRequestBody | undefined; +}; - @SpeakeasyMetadata({ data: "request, media_type=application/json" }) - requestBody?: PerformPostActionRequestBody; -} +export type PerformPostActionActionsSummary = { + acted?: boolean | undefined; + canUndo?: boolean | undefined; + count?: number | undefined; + id?: number | undefined; +}; -export class ActionsSummary extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "acted" }) - acted?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_undo" }) - canUndo?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "count" }) - count?: number; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) - id?: number; -} - -export class Notice extends SpeakeasyBase {} +export type Notice = {}; /** * post updated */ -export class PerformPostActionResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata({ elemType: ActionsSummary }) - @Expose({ name: "actions_summary" }) - @Type(() => ActionsSummary) - actionsSummary?: ActionsSummary[]; +export type PerformPostActionResponseBody = { + actionsSummary?: Array | undefined; + admin?: boolean | undefined; + avatarTemplate?: string | undefined; + canDelete?: boolean | undefined; + canEdit?: boolean | undefined; + canRecover?: boolean | undefined; + canViewEditHistory?: boolean | undefined; + canWiki?: boolean | undefined; + cooked?: string | undefined; + createdAt?: string | undefined; + deletedAt?: string | null | undefined; + displayUsername?: string | undefined; + editReason?: string | null | undefined; + flairBgColor?: string | null | undefined; + flairColor?: string | null | undefined; + flairName?: string | null | undefined; + flairUrl?: string | null | undefined; + hidden?: boolean | undefined; + id?: number | undefined; + incomingLinkCount?: number | undefined; + moderator?: boolean | undefined; + name?: string | undefined; + notice?: Notice | undefined; + postNumber?: number | undefined; + postType?: number | undefined; + primaryGroupName?: string | null | undefined; + quoteCount?: number | undefined; + readersCount?: number | undefined; + reads?: number | undefined; + replyCount?: number | undefined; + replyToPostNumber?: string | null | undefined; + reviewableId?: string | null | undefined; + reviewableScoreCount?: number | undefined; + reviewableScorePendingCount?: number | undefined; + score?: number | undefined; + staff?: boolean | undefined; + topicId?: number | undefined; + topicSlug?: string | undefined; + trustLevel?: number | undefined; + updatedAt?: string | undefined; + userDeleted?: boolean | undefined; + userId?: number | undefined; + userTitle?: string | null | undefined; + username?: string | undefined; + version?: number | undefined; + wiki?: boolean | undefined; + yours?: boolean | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "admin" }) - admin?: boolean; +/** @internal */ +export const PerformPostActionRequestBody$inboundSchema: z.ZodType< + PerformPostActionRequestBody, + z.ZodTypeDef, + unknown +> = z + .object({ + flag_topic: z.boolean().optional(), + id: z.number().int(), + post_action_type_id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + flag_topic: "flagTopic", + post_action_type_id: "postActionTypeId", + }); + }); - @SpeakeasyMetadata() - @Expose({ name: "avatar_template" }) - avatarTemplate?: string; +/** @internal */ +export type PerformPostActionRequestBody$Outbound = { + flag_topic?: boolean | undefined; + id: number; + post_action_type_id: number; +}; - @SpeakeasyMetadata() - @Expose({ name: "can_delete" }) - canDelete?: boolean; +/** @internal */ +export const PerformPostActionRequestBody$outboundSchema: z.ZodType< + PerformPostActionRequestBody$Outbound, + z.ZodTypeDef, + PerformPostActionRequestBody +> = z + .object({ + flagTopic: z.boolean().optional(), + id: z.number().int(), + postActionTypeId: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + flagTopic: "flag_topic", + postActionTypeId: "post_action_type_id", + }); + }); - @SpeakeasyMetadata() - @Expose({ name: "can_edit" }) - canEdit?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_recover" }) - canRecover?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_view_edit_history" }) - canViewEditHistory?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_wiki" }) - canWiki?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "cooked" }) - cooked?: string; - - @SpeakeasyMetadata() - @Expose({ name: "created_at" }) - createdAt?: string; - - @SpeakeasyMetadata() - @Expose({ name: "deleted_at" }) - deletedAt?: string; - - @SpeakeasyMetadata() - @Expose({ name: "display_username" }) - displayUsername?: string; - - @SpeakeasyMetadata() - @Expose({ name: "edit_reason" }) - editReason?: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_bg_color" }) - flairBgColor?: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_color" }) - flairColor?: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_name" }) - flairName?: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_url" }) - flairUrl?: string; - - @SpeakeasyMetadata() - @Expose({ name: "hidden" }) - hidden?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) - id?: number; - - @SpeakeasyMetadata() - @Expose({ name: "incoming_link_count" }) - incomingLinkCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "moderator" }) - moderator?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) - name?: string; - - @SpeakeasyMetadata() - @Expose({ name: "notice" }) - @Type(() => Notice) - notice?: Notice; - - @SpeakeasyMetadata() - @Expose({ name: "post_number" }) - postNumber?: number; - - @SpeakeasyMetadata() - @Expose({ name: "post_type" }) - postType?: number; - - @SpeakeasyMetadata() - @Expose({ name: "primary_group_name" }) - primaryGroupName?: string; - - @SpeakeasyMetadata() - @Expose({ name: "quote_count" }) - quoteCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "readers_count" }) - readersCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "reads" }) - reads?: number; - - @SpeakeasyMetadata() - @Expose({ name: "reply_count" }) - replyCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "reply_to_post_number" }) - replyToPostNumber?: string; - - @SpeakeasyMetadata() - @Expose({ name: "reviewable_id" }) - reviewableId?: string; - - @SpeakeasyMetadata() - @Expose({ name: "reviewable_score_count" }) - reviewableScoreCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "reviewable_score_pending_count" }) - reviewableScorePendingCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "score" }) - score?: number; - - @SpeakeasyMetadata() - @Expose({ name: "staff" }) - staff?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "topic_id" }) - topicId?: number; - - @SpeakeasyMetadata() - @Expose({ name: "topic_slug" }) - topicSlug?: string; - - @SpeakeasyMetadata() - @Expose({ name: "trust_level" }) - trustLevel?: number; - - @SpeakeasyMetadata() - @Expose({ name: "updated_at" }) - updatedAt?: string; - - @SpeakeasyMetadata() - @Expose({ name: "user_deleted" }) - userDeleted?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "user_id" }) - userId?: number; - - @SpeakeasyMetadata() - @Expose({ name: "user_title" }) - userTitle?: string; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) - username?: string; - - @SpeakeasyMetadata() - @Expose({ name: "version" }) - version?: number; - - @SpeakeasyMetadata() - @Expose({ name: "wiki" }) - wiki?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "yours" }) - yours?: boolean; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PerformPostActionRequestBody$ { + /** @deprecated use `PerformPostActionRequestBody$inboundSchema` instead. */ + export const inboundSchema = PerformPostActionRequestBody$inboundSchema; + /** @deprecated use `PerformPostActionRequestBody$outboundSchema` instead. */ + export const outboundSchema = PerformPostActionRequestBody$outboundSchema; + /** @deprecated use `PerformPostActionRequestBody$Outbound` instead. */ + export type Outbound = PerformPostActionRequestBody$Outbound; } -export class PerformPostActionResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const PerformPostActionRequest$inboundSchema: z.ZodType< + PerformPostActionRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + "Api-Key": z.string(), + "Api-Username": z.string(), + RequestBody: z.lazy(() => PerformPostActionRequestBody$inboundSchema).optional(), + }) + .transform((v) => { + return remap$(v, { + "Api-Key": "apiKey", + "Api-Username": "apiUsername", + RequestBody: "requestBody", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type PerformPostActionRequest$Outbound = { + "Api-Key": string; + "Api-Username": string; + RequestBody?: PerformPostActionRequestBody$Outbound | undefined; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const PerformPostActionRequest$outboundSchema: z.ZodType< + PerformPostActionRequest$Outbound, + z.ZodTypeDef, + PerformPostActionRequest +> = z + .object({ + apiKey: z.string(), + apiUsername: z.string(), + requestBody: z.lazy(() => PerformPostActionRequestBody$outboundSchema).optional(), + }) + .transform((v) => { + return remap$(v, { + apiKey: "Api-Key", + apiUsername: "Api-Username", + requestBody: "RequestBody", + }); + }); - /** - * post updated - */ - @SpeakeasyMetadata() - object?: PerformPostActionResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PerformPostActionRequest$ { + /** @deprecated use `PerformPostActionRequest$inboundSchema` instead. */ + export const inboundSchema = PerformPostActionRequest$inboundSchema; + /** @deprecated use `PerformPostActionRequest$outboundSchema` instead. */ + export const outboundSchema = PerformPostActionRequest$outboundSchema; + /** @deprecated use `PerformPostActionRequest$Outbound` instead. */ + export type Outbound = PerformPostActionRequest$Outbound; +} + +/** @internal */ +export const PerformPostActionActionsSummary$inboundSchema: z.ZodType< + PerformPostActionActionsSummary, + z.ZodTypeDef, + unknown +> = z + .object({ + acted: z.boolean().optional(), + can_undo: z.boolean().optional(), + count: z.number().int().optional(), + id: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + can_undo: "canUndo", + }); + }); + +/** @internal */ +export type PerformPostActionActionsSummary$Outbound = { + acted?: boolean | undefined; + can_undo?: boolean | undefined; + count?: number | undefined; + id?: number | undefined; +}; + +/** @internal */ +export const PerformPostActionActionsSummary$outboundSchema: z.ZodType< + PerformPostActionActionsSummary$Outbound, + z.ZodTypeDef, + PerformPostActionActionsSummary +> = z + .object({ + acted: z.boolean().optional(), + canUndo: z.boolean().optional(), + count: z.number().int().optional(), + id: z.number().int().optional(), + }) + .transform((v) => { + return remap$(v, { + canUndo: "can_undo", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PerformPostActionActionsSummary$ { + /** @deprecated use `PerformPostActionActionsSummary$inboundSchema` instead. */ + export const inboundSchema = PerformPostActionActionsSummary$inboundSchema; + /** @deprecated use `PerformPostActionActionsSummary$outboundSchema` instead. */ + export const outboundSchema = PerformPostActionActionsSummary$outboundSchema; + /** @deprecated use `PerformPostActionActionsSummary$Outbound` instead. */ + export type Outbound = PerformPostActionActionsSummary$Outbound; +} + +/** @internal */ +export const Notice$inboundSchema: z.ZodType = z.object({}); + +/** @internal */ +export type Notice$Outbound = {}; + +/** @internal */ +export const Notice$outboundSchema: z.ZodType = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Notice$ { + /** @deprecated use `Notice$inboundSchema` instead. */ + export const inboundSchema = Notice$inboundSchema; + /** @deprecated use `Notice$outboundSchema` instead. */ + export const outboundSchema = Notice$outboundSchema; + /** @deprecated use `Notice$Outbound` instead. */ + export type Outbound = Notice$Outbound; +} + +/** @internal */ +export const PerformPostActionResponseBody$inboundSchema: z.ZodType< + PerformPostActionResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + actions_summary: z + .array(z.lazy(() => PerformPostActionActionsSummary$inboundSchema)) + .optional(), + admin: z.boolean().optional(), + avatar_template: z.string().optional(), + can_delete: z.boolean().optional(), + can_edit: z.boolean().optional(), + can_recover: z.boolean().optional(), + can_view_edit_history: z.boolean().optional(), + can_wiki: z.boolean().optional(), + cooked: z.string().optional(), + created_at: z.string().optional(), + deleted_at: z.nullable(z.string()).optional(), + display_username: z.string().optional(), + edit_reason: z.nullable(z.string()).optional(), + flair_bg_color: z.nullable(z.string()).optional(), + flair_color: z.nullable(z.string()).optional(), + flair_name: z.nullable(z.string()).optional(), + flair_url: z.nullable(z.string()).optional(), + hidden: z.boolean().optional(), + id: z.number().int().optional(), + incoming_link_count: z.number().int().optional(), + moderator: z.boolean().optional(), + name: z.string().optional(), + notice: z.lazy(() => Notice$inboundSchema).optional(), + post_number: z.number().int().optional(), + post_type: z.number().int().optional(), + primary_group_name: z.nullable(z.string()).optional(), + quote_count: z.number().int().optional(), + readers_count: z.number().int().optional(), + reads: z.number().int().optional(), + reply_count: z.number().int().optional(), + reply_to_post_number: z.nullable(z.string()).optional(), + reviewable_id: z.nullable(z.string()).optional(), + reviewable_score_count: z.number().int().optional(), + reviewable_score_pending_count: z.number().int().optional(), + score: z.number().optional(), + staff: z.boolean().optional(), + topic_id: z.number().int().optional(), + topic_slug: z.string().optional(), + trust_level: z.number().int().optional(), + updated_at: z.string().optional(), + user_deleted: z.boolean().optional(), + user_id: z.number().int().optional(), + user_title: z.nullable(z.string()).optional(), + username: z.string().optional(), + version: z.number().int().optional(), + wiki: z.boolean().optional(), + yours: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + actions_summary: "actionsSummary", + avatar_template: "avatarTemplate", + can_delete: "canDelete", + can_edit: "canEdit", + can_recover: "canRecover", + can_view_edit_history: "canViewEditHistory", + can_wiki: "canWiki", + created_at: "createdAt", + deleted_at: "deletedAt", + display_username: "displayUsername", + edit_reason: "editReason", + flair_bg_color: "flairBgColor", + flair_color: "flairColor", + flair_name: "flairName", + flair_url: "flairUrl", + incoming_link_count: "incomingLinkCount", + post_number: "postNumber", + post_type: "postType", + primary_group_name: "primaryGroupName", + quote_count: "quoteCount", + readers_count: "readersCount", + reply_count: "replyCount", + reply_to_post_number: "replyToPostNumber", + reviewable_id: "reviewableId", + reviewable_score_count: "reviewableScoreCount", + reviewable_score_pending_count: "reviewableScorePendingCount", + topic_id: "topicId", + topic_slug: "topicSlug", + trust_level: "trustLevel", + updated_at: "updatedAt", + user_deleted: "userDeleted", + user_id: "userId", + user_title: "userTitle", + }); + }); + +/** @internal */ +export type PerformPostActionResponseBody$Outbound = { + actions_summary?: Array | undefined; + admin?: boolean | undefined; + avatar_template?: string | undefined; + can_delete?: boolean | undefined; + can_edit?: boolean | undefined; + can_recover?: boolean | undefined; + can_view_edit_history?: boolean | undefined; + can_wiki?: boolean | undefined; + cooked?: string | undefined; + created_at?: string | undefined; + deleted_at?: string | null | undefined; + display_username?: string | undefined; + edit_reason?: string | null | undefined; + flair_bg_color?: string | null | undefined; + flair_color?: string | null | undefined; + flair_name?: string | null | undefined; + flair_url?: string | null | undefined; + hidden?: boolean | undefined; + id?: number | undefined; + incoming_link_count?: number | undefined; + moderator?: boolean | undefined; + name?: string | undefined; + notice?: Notice$Outbound | undefined; + post_number?: number | undefined; + post_type?: number | undefined; + primary_group_name?: string | null | undefined; + quote_count?: number | undefined; + readers_count?: number | undefined; + reads?: number | undefined; + reply_count?: number | undefined; + reply_to_post_number?: string | null | undefined; + reviewable_id?: string | null | undefined; + reviewable_score_count?: number | undefined; + reviewable_score_pending_count?: number | undefined; + score?: number | undefined; + staff?: boolean | undefined; + topic_id?: number | undefined; + topic_slug?: string | undefined; + trust_level?: number | undefined; + updated_at?: string | undefined; + user_deleted?: boolean | undefined; + user_id?: number | undefined; + user_title?: string | null | undefined; + username?: string | undefined; + version?: number | undefined; + wiki?: boolean | undefined; + yours?: boolean | undefined; +}; + +/** @internal */ +export const PerformPostActionResponseBody$outboundSchema: z.ZodType< + PerformPostActionResponseBody$Outbound, + z.ZodTypeDef, + PerformPostActionResponseBody +> = z + .object({ + actionsSummary: z + .array(z.lazy(() => PerformPostActionActionsSummary$outboundSchema)) + .optional(), + admin: z.boolean().optional(), + avatarTemplate: z.string().optional(), + canDelete: z.boolean().optional(), + canEdit: z.boolean().optional(), + canRecover: z.boolean().optional(), + canViewEditHistory: z.boolean().optional(), + canWiki: z.boolean().optional(), + cooked: z.string().optional(), + createdAt: z.string().optional(), + deletedAt: z.nullable(z.string()).optional(), + displayUsername: z.string().optional(), + editReason: z.nullable(z.string()).optional(), + flairBgColor: z.nullable(z.string()).optional(), + flairColor: z.nullable(z.string()).optional(), + flairName: z.nullable(z.string()).optional(), + flairUrl: z.nullable(z.string()).optional(), + hidden: z.boolean().optional(), + id: z.number().int().optional(), + incomingLinkCount: z.number().int().optional(), + moderator: z.boolean().optional(), + name: z.string().optional(), + notice: z.lazy(() => Notice$outboundSchema).optional(), + postNumber: z.number().int().optional(), + postType: z.number().int().optional(), + primaryGroupName: z.nullable(z.string()).optional(), + quoteCount: z.number().int().optional(), + readersCount: z.number().int().optional(), + reads: z.number().int().optional(), + replyCount: z.number().int().optional(), + replyToPostNumber: z.nullable(z.string()).optional(), + reviewableId: z.nullable(z.string()).optional(), + reviewableScoreCount: z.number().int().optional(), + reviewableScorePendingCount: z.number().int().optional(), + score: z.number().optional(), + staff: z.boolean().optional(), + topicId: z.number().int().optional(), + topicSlug: z.string().optional(), + trustLevel: z.number().int().optional(), + updatedAt: z.string().optional(), + userDeleted: z.boolean().optional(), + userId: z.number().int().optional(), + userTitle: z.nullable(z.string()).optional(), + username: z.string().optional(), + version: z.number().int().optional(), + wiki: z.boolean().optional(), + yours: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + actionsSummary: "actions_summary", + avatarTemplate: "avatar_template", + canDelete: "can_delete", + canEdit: "can_edit", + canRecover: "can_recover", + canViewEditHistory: "can_view_edit_history", + canWiki: "can_wiki", + createdAt: "created_at", + deletedAt: "deleted_at", + displayUsername: "display_username", + editReason: "edit_reason", + flairBgColor: "flair_bg_color", + flairColor: "flair_color", + flairName: "flair_name", + flairUrl: "flair_url", + incomingLinkCount: "incoming_link_count", + postNumber: "post_number", + postType: "post_type", + primaryGroupName: "primary_group_name", + quoteCount: "quote_count", + readersCount: "readers_count", + replyCount: "reply_count", + replyToPostNumber: "reply_to_post_number", + reviewableId: "reviewable_id", + reviewableScoreCount: "reviewable_score_count", + reviewableScorePendingCount: "reviewable_score_pending_count", + topicId: "topic_id", + topicSlug: "topic_slug", + trustLevel: "trust_level", + updatedAt: "updated_at", + userDeleted: "user_deleted", + userId: "user_id", + userTitle: "user_title", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PerformPostActionResponseBody$ { + /** @deprecated use `PerformPostActionResponseBody$inboundSchema` instead. */ + export const inboundSchema = PerformPostActionResponseBody$inboundSchema; + /** @deprecated use `PerformPostActionResponseBody$outboundSchema` instead. */ + export const outboundSchema = PerformPostActionResponseBody$outboundSchema; + /** @deprecated use `PerformPostActionResponseBody$Outbound` instead. */ + export type Outbound = PerformPostActionResponseBody$Outbound; } diff --git a/src/sdk/models/operations/postreplies.ts b/src/sdk/models/operations/postreplies.ts index d8ca660..f1a8a3f 100644 --- a/src/sdk/models/operations/postreplies.ts +++ b/src/sdk/models/operations/postreplies.ts @@ -1,266 +1,476 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class PostRepliesRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) +export type PostRepliesRequest = { id: string; -} +}; -export class PostRepliesActionsSummary extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "can_act" }) +export type PostRepliesActionsSummary = { canAct: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; -} +}; -export class ReplyToUser extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "avatar_template" }) +export type ReplyToUser = { avatarTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) - name?: string; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) + name?: string | undefined; username: string; -} +}; -export class PostRepliesResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata({ elemType: PostRepliesActionsSummary }) - @Expose({ name: "actions_summary" }) - @Type(() => PostRepliesActionsSummary) - actionsSummary: PostRepliesActionsSummary[]; - - @SpeakeasyMetadata() - @Expose({ name: "admin" }) +export type PostRepliesResponseBody = { + actionsSummary: Array; admin: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "avatar_template" }) avatarTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "bookmarked" }) bookmarked: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_delete" }) canDelete: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_edit" }) canEdit: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_recover" }) canRecover: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_see_hidden_post" }) canSeeHiddenPost: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_view_edit_history" }) canViewEditHistory: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_wiki" }) canWiki: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "cooked" }) cooked: string; - - @SpeakeasyMetadata() - @Expose({ name: "created_at" }) createdAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "deleted_at" }) - deletedAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "display_username" }) - displayUsername: string; - - @SpeakeasyMetadata() - @Expose({ name: "edit_reason" }) - editReason: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_bg_color" }) - flairBgColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_color" }) - flairColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_group_id" }) - flairGroupId?: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_name" }) - flairName: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_url" }) - flairUrl: string; - - @SpeakeasyMetadata() - @Expose({ name: "hidden" }) + deletedAt: string | null; + displayUsername: string | null; + editReason: string | null; + flairBgColor: string | null; + flairColor: string | null; + flairGroupId?: string | null | undefined; + flairName: string | null; + flairUrl: string | null; hidden: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "incoming_link_count" }) incomingLinkCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "moderator" }) moderator: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) - name: string; - - @SpeakeasyMetadata() - @Expose({ name: "post_number" }) + name: string | null; postNumber: number; - - @SpeakeasyMetadata() - @Expose({ name: "post_type" }) postType: number; - - @SpeakeasyMetadata() - @Expose({ name: "primary_group_name" }) - primaryGroupName: string; - - @SpeakeasyMetadata() - @Expose({ name: "quote_count" }) + primaryGroupName: string | null; quoteCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "readers_count" }) readersCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "reads" }) reads: number; - - @SpeakeasyMetadata() - @Expose({ name: "reply_count" }) replyCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "reply_to_post_number" }) replyToPostNumber: number; - - @SpeakeasyMetadata() - @Expose({ name: "reply_to_user" }) - @Type(() => ReplyToUser) replyToUser: ReplyToUser; - - @SpeakeasyMetadata() - @Expose({ name: "reviewable_id" }) - reviewableId: string; - - @SpeakeasyMetadata() - @Expose({ name: "reviewable_score_count" }) + reviewableId: string | null; reviewableScoreCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "reviewable_score_pending_count" }) reviewableScorePendingCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "score" }) score: number; - - @SpeakeasyMetadata() - @Expose({ name: "staff" }) staff: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "topic_id" }) topicId: number; - - @SpeakeasyMetadata() - @Expose({ name: "topic_slug" }) topicSlug: string; - - @SpeakeasyMetadata() - @Expose({ name: "trust_level" }) trustLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "updated_at" }) updatedAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "user_deleted" }) userDeleted: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "user_id" }) userId: number; - - @SpeakeasyMetadata() - @Expose({ name: "user_title" }) - userTitle: string; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) + userTitle: string | null; username: string; - - @SpeakeasyMetadata() - @Expose({ name: "version" }) version: number; - - @SpeakeasyMetadata() - @Expose({ name: "wiki" }) wiki: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "yours" }) yours: boolean; +}; + +/** @internal */ +export const PostRepliesRequest$inboundSchema: z.ZodType< + PostRepliesRequest, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.string(), +}); + +/** @internal */ +export type PostRepliesRequest$Outbound = { + id: string; +}; + +/** @internal */ +export const PostRepliesRequest$outboundSchema: z.ZodType< + PostRepliesRequest$Outbound, + z.ZodTypeDef, + PostRepliesRequest +> = z.object({ + id: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PostRepliesRequest$ { + /** @deprecated use `PostRepliesRequest$inboundSchema` instead. */ + export const inboundSchema = PostRepliesRequest$inboundSchema; + /** @deprecated use `PostRepliesRequest$outboundSchema` instead. */ + export const outboundSchema = PostRepliesRequest$outboundSchema; + /** @deprecated use `PostRepliesRequest$Outbound` instead. */ + export type Outbound = PostRepliesRequest$Outbound; } -export class PostRepliesResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const PostRepliesActionsSummary$inboundSchema: z.ZodType< + PostRepliesActionsSummary, + z.ZodTypeDef, + unknown +> = z + .object({ + can_act: z.boolean(), + id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + can_act: "canAct", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type PostRepliesActionsSummary$Outbound = { + can_act: boolean; + id: number; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const PostRepliesActionsSummary$outboundSchema: z.ZodType< + PostRepliesActionsSummary$Outbound, + z.ZodTypeDef, + PostRepliesActionsSummary +> = z + .object({ + canAct: z.boolean(), + id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + canAct: "can_act", + }); + }); - /** - * post replies - */ - @SpeakeasyMetadata({ elemType: PostRepliesResponseBody }) - responseBodies?: PostRepliesResponseBody[]; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PostRepliesActionsSummary$ { + /** @deprecated use `PostRepliesActionsSummary$inboundSchema` instead. */ + export const inboundSchema = PostRepliesActionsSummary$inboundSchema; + /** @deprecated use `PostRepliesActionsSummary$outboundSchema` instead. */ + export const outboundSchema = PostRepliesActionsSummary$outboundSchema; + /** @deprecated use `PostRepliesActionsSummary$Outbound` instead. */ + export type Outbound = PostRepliesActionsSummary$Outbound; +} + +/** @internal */ +export const ReplyToUser$inboundSchema: z.ZodType = z + .object({ + avatar_template: z.string(), + name: z.string().optional(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + avatar_template: "avatarTemplate", + }); + }); + +/** @internal */ +export type ReplyToUser$Outbound = { + avatar_template: string; + name?: string | undefined; + username: string; +}; + +/** @internal */ +export const ReplyToUser$outboundSchema: z.ZodType< + ReplyToUser$Outbound, + z.ZodTypeDef, + ReplyToUser +> = z + .object({ + avatarTemplate: z.string(), + name: z.string().optional(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + avatarTemplate: "avatar_template", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ReplyToUser$ { + /** @deprecated use `ReplyToUser$inboundSchema` instead. */ + export const inboundSchema = ReplyToUser$inboundSchema; + /** @deprecated use `ReplyToUser$outboundSchema` instead. */ + export const outboundSchema = ReplyToUser$outboundSchema; + /** @deprecated use `ReplyToUser$Outbound` instead. */ + export type Outbound = ReplyToUser$Outbound; +} + +/** @internal */ +export const PostRepliesResponseBody$inboundSchema: z.ZodType< + PostRepliesResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + actions_summary: z.array(z.lazy(() => PostRepliesActionsSummary$inboundSchema)), + admin: z.boolean(), + avatar_template: z.string(), + bookmarked: z.boolean(), + can_delete: z.boolean(), + can_edit: z.boolean(), + can_recover: z.boolean(), + can_see_hidden_post: z.boolean(), + can_view_edit_history: z.boolean(), + can_wiki: z.boolean(), + cooked: z.string(), + created_at: z.string(), + deleted_at: z.nullable(z.string()), + display_username: z.nullable(z.string()), + edit_reason: z.nullable(z.string()), + flair_bg_color: z.nullable(z.string()), + flair_color: z.nullable(z.string()), + flair_group_id: z.nullable(z.string()).optional(), + flair_name: z.nullable(z.string()), + flair_url: z.nullable(z.string()), + hidden: z.boolean(), + id: z.number().int(), + incoming_link_count: z.number().int(), + moderator: z.boolean(), + name: z.nullable(z.string()), + post_number: z.number().int(), + post_type: z.number().int(), + primary_group_name: z.nullable(z.string()), + quote_count: z.number().int(), + readers_count: z.number().int(), + reads: z.number().int(), + reply_count: z.number().int(), + reply_to_post_number: z.number().int(), + reply_to_user: z.lazy(() => ReplyToUser$inboundSchema), + reviewable_id: z.nullable(z.string()), + reviewable_score_count: z.number().int(), + reviewable_score_pending_count: z.number().int(), + score: z.number().int(), + staff: z.boolean(), + topic_id: z.number().int(), + topic_slug: z.string(), + trust_level: z.number().int(), + updated_at: z.string(), + user_deleted: z.boolean(), + user_id: z.number().int(), + user_title: z.nullable(z.string()), + username: z.string(), + version: z.number().int(), + wiki: z.boolean(), + yours: z.boolean(), + }) + .transform((v) => { + return remap$(v, { + actions_summary: "actionsSummary", + avatar_template: "avatarTemplate", + can_delete: "canDelete", + can_edit: "canEdit", + can_recover: "canRecover", + can_see_hidden_post: "canSeeHiddenPost", + can_view_edit_history: "canViewEditHistory", + can_wiki: "canWiki", + created_at: "createdAt", + deleted_at: "deletedAt", + display_username: "displayUsername", + edit_reason: "editReason", + flair_bg_color: "flairBgColor", + flair_color: "flairColor", + flair_group_id: "flairGroupId", + flair_name: "flairName", + flair_url: "flairUrl", + incoming_link_count: "incomingLinkCount", + post_number: "postNumber", + post_type: "postType", + primary_group_name: "primaryGroupName", + quote_count: "quoteCount", + readers_count: "readersCount", + reply_count: "replyCount", + reply_to_post_number: "replyToPostNumber", + reply_to_user: "replyToUser", + reviewable_id: "reviewableId", + reviewable_score_count: "reviewableScoreCount", + reviewable_score_pending_count: "reviewableScorePendingCount", + topic_id: "topicId", + topic_slug: "topicSlug", + trust_level: "trustLevel", + updated_at: "updatedAt", + user_deleted: "userDeleted", + user_id: "userId", + user_title: "userTitle", + }); + }); + +/** @internal */ +export type PostRepliesResponseBody$Outbound = { + actions_summary: Array; + admin: boolean; + avatar_template: string; + bookmarked: boolean; + can_delete: boolean; + can_edit: boolean; + can_recover: boolean; + can_see_hidden_post: boolean; + can_view_edit_history: boolean; + can_wiki: boolean; + cooked: string; + created_at: string; + deleted_at: string | null; + display_username: string | null; + edit_reason: string | null; + flair_bg_color: string | null; + flair_color: string | null; + flair_group_id?: string | null | undefined; + flair_name: string | null; + flair_url: string | null; + hidden: boolean; + id: number; + incoming_link_count: number; + moderator: boolean; + name: string | null; + post_number: number; + post_type: number; + primary_group_name: string | null; + quote_count: number; + readers_count: number; + reads: number; + reply_count: number; + reply_to_post_number: number; + reply_to_user: ReplyToUser$Outbound; + reviewable_id: string | null; + reviewable_score_count: number; + reviewable_score_pending_count: number; + score: number; + staff: boolean; + topic_id: number; + topic_slug: string; + trust_level: number; + updated_at: string; + user_deleted: boolean; + user_id: number; + user_title: string | null; + username: string; + version: number; + wiki: boolean; + yours: boolean; +}; + +/** @internal */ +export const PostRepliesResponseBody$outboundSchema: z.ZodType< + PostRepliesResponseBody$Outbound, + z.ZodTypeDef, + PostRepliesResponseBody +> = z + .object({ + actionsSummary: z.array(z.lazy(() => PostRepliesActionsSummary$outboundSchema)), + admin: z.boolean(), + avatarTemplate: z.string(), + bookmarked: z.boolean(), + canDelete: z.boolean(), + canEdit: z.boolean(), + canRecover: z.boolean(), + canSeeHiddenPost: z.boolean(), + canViewEditHistory: z.boolean(), + canWiki: z.boolean(), + cooked: z.string(), + createdAt: z.string(), + deletedAt: z.nullable(z.string()), + displayUsername: z.nullable(z.string()), + editReason: z.nullable(z.string()), + flairBgColor: z.nullable(z.string()), + flairColor: z.nullable(z.string()), + flairGroupId: z.nullable(z.string()).optional(), + flairName: z.nullable(z.string()), + flairUrl: z.nullable(z.string()), + hidden: z.boolean(), + id: z.number().int(), + incomingLinkCount: z.number().int(), + moderator: z.boolean(), + name: z.nullable(z.string()), + postNumber: z.number().int(), + postType: z.number().int(), + primaryGroupName: z.nullable(z.string()), + quoteCount: z.number().int(), + readersCount: z.number().int(), + reads: z.number().int(), + replyCount: z.number().int(), + replyToPostNumber: z.number().int(), + replyToUser: z.lazy(() => ReplyToUser$outboundSchema), + reviewableId: z.nullable(z.string()), + reviewableScoreCount: z.number().int(), + reviewableScorePendingCount: z.number().int(), + score: z.number().int(), + staff: z.boolean(), + topicId: z.number().int(), + topicSlug: z.string(), + trustLevel: z.number().int(), + updatedAt: z.string(), + userDeleted: z.boolean(), + userId: z.number().int(), + userTitle: z.nullable(z.string()), + username: z.string(), + version: z.number().int(), + wiki: z.boolean(), + yours: z.boolean(), + }) + .transform((v) => { + return remap$(v, { + actionsSummary: "actions_summary", + avatarTemplate: "avatar_template", + canDelete: "can_delete", + canEdit: "can_edit", + canRecover: "can_recover", + canSeeHiddenPost: "can_see_hidden_post", + canViewEditHistory: "can_view_edit_history", + canWiki: "can_wiki", + createdAt: "created_at", + deletedAt: "deleted_at", + displayUsername: "display_username", + editReason: "edit_reason", + flairBgColor: "flair_bg_color", + flairColor: "flair_color", + flairGroupId: "flair_group_id", + flairName: "flair_name", + flairUrl: "flair_url", + incomingLinkCount: "incoming_link_count", + postNumber: "post_number", + postType: "post_type", + primaryGroupName: "primary_group_name", + quoteCount: "quote_count", + readersCount: "readers_count", + replyCount: "reply_count", + replyToPostNumber: "reply_to_post_number", + replyToUser: "reply_to_user", + reviewableId: "reviewable_id", + reviewableScoreCount: "reviewable_score_count", + reviewableScorePendingCount: "reviewable_score_pending_count", + topicId: "topic_id", + topicSlug: "topic_slug", + trustLevel: "trust_level", + updatedAt: "updated_at", + userDeleted: "user_deleted", + userId: "user_id", + userTitle: "user_title", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PostRepliesResponseBody$ { + /** @deprecated use `PostRepliesResponseBody$inboundSchema` instead. */ + export const inboundSchema = PostRepliesResponseBody$inboundSchema; + /** @deprecated use `PostRepliesResponseBody$outboundSchema` instead. */ + export const outboundSchema = PostRepliesResponseBody$outboundSchema; + /** @deprecated use `PostRepliesResponseBody$Outbound` instead. */ + export type Outbound = PostRepliesResponseBody$Outbound; } diff --git a/src/sdk/models/operations/refreshgravatar.ts b/src/sdk/models/operations/refreshgravatar.ts index c4f2221..ccf9848 100644 --- a/src/sdk/models/operations/refreshgravatar.ts +++ b/src/sdk/models/operations/refreshgravatar.ts @@ -1,51 +1,107 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class RefreshGravatarRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=username" }) +export type RefreshGravatarRequest = { username: string; -} +}; /** * response */ -export class RefreshGravatarResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "gravatar_avatar_template" }) - gravatarAvatarTemplate: string; +export type RefreshGravatarResponseBody = { + gravatarAvatarTemplate: string | null; + gravatarUploadId: number | null; +}; - @SpeakeasyMetadata() - @Expose({ name: "gravatar_upload_id" }) - gravatarUploadId: number; +/** @internal */ +export const RefreshGravatarRequest$inboundSchema: z.ZodType< + RefreshGravatarRequest, + z.ZodTypeDef, + unknown +> = z.object({ + username: z.string(), +}); + +/** @internal */ +export type RefreshGravatarRequest$Outbound = { + username: string; +}; + +/** @internal */ +export const RefreshGravatarRequest$outboundSchema: z.ZodType< + RefreshGravatarRequest$Outbound, + z.ZodTypeDef, + RefreshGravatarRequest +> = z.object({ + username: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace RefreshGravatarRequest$ { + /** @deprecated use `RefreshGravatarRequest$inboundSchema` instead. */ + export const inboundSchema = RefreshGravatarRequest$inboundSchema; + /** @deprecated use `RefreshGravatarRequest$outboundSchema` instead. */ + export const outboundSchema = RefreshGravatarRequest$outboundSchema; + /** @deprecated use `RefreshGravatarRequest$Outbound` instead. */ + export type Outbound = RefreshGravatarRequest$Outbound; } -export class RefreshGravatarResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const RefreshGravatarResponseBody$inboundSchema: z.ZodType< + RefreshGravatarResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + gravatar_avatar_template: z.nullable(z.string()), + gravatar_upload_id: z.nullable(z.number().int()), + }) + .transform((v) => { + return remap$(v, { + gravatar_avatar_template: "gravatarAvatarTemplate", + gravatar_upload_id: "gravatarUploadId", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type RefreshGravatarResponseBody$Outbound = { + gravatar_avatar_template: string | null; + gravatar_upload_id: number | null; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const RefreshGravatarResponseBody$outboundSchema: z.ZodType< + RefreshGravatarResponseBody$Outbound, + z.ZodTypeDef, + RefreshGravatarResponseBody +> = z + .object({ + gravatarAvatarTemplate: z.nullable(z.string()), + gravatarUploadId: z.nullable(z.number().int()), + }) + .transform((v) => { + return remap$(v, { + gravatarAvatarTemplate: "gravatar_avatar_template", + gravatarUploadId: "gravatar_upload_id", + }); + }); - /** - * response - */ - @SpeakeasyMetadata() - object?: RefreshGravatarResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace RefreshGravatarResponseBody$ { + /** @deprecated use `RefreshGravatarResponseBody$inboundSchema` instead. */ + export const inboundSchema = RefreshGravatarResponseBody$inboundSchema; + /** @deprecated use `RefreshGravatarResponseBody$outboundSchema` instead. */ + export const outboundSchema = RefreshGravatarResponseBody$outboundSchema; + /** @deprecated use `RefreshGravatarResponseBody$Outbound` instead. */ + export type Outbound = RefreshGravatarResponseBody$Outbound; } diff --git a/src/sdk/models/operations/removegroupmembers.ts b/src/sdk/models/operations/removegroupmembers.ts index 2366552..2279a1f 100644 --- a/src/sdk/models/operations/removegroupmembers.ts +++ b/src/sdk/models/operations/removegroupmembers.ts @@ -1,67 +1,168 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class RemoveGroupMembersRequestBody extends SpeakeasyBase { +export type RemoveGroupMembersRequestBody = { /** * comma separated list */ - @SpeakeasyMetadata() - @Expose({ name: "usernames" }) - usernames?: string; -} + usernames?: string | undefined; +}; -export class RemoveGroupMembersRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) +export type RemoveGroupMembersRequest = { + requestBody?: RemoveGroupMembersRequestBody | undefined; id: number; - - @SpeakeasyMetadata({ data: "request, media_type=application/json" }) - requestBody?: RemoveGroupMembersRequestBody; -} +}; /** * success response */ -export class RemoveGroupMembersResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "skipped_usernames" }) - skippedUsernames: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "success" }) +export type RemoveGroupMembersResponseBody = { + skippedUsernames: Array; success: string; + usernames: Array; +}; - @SpeakeasyMetadata() - @Expose({ name: "usernames" }) - usernames: any[]; +/** @internal */ +export const RemoveGroupMembersRequestBody$inboundSchema: z.ZodType< + RemoveGroupMembersRequestBody, + z.ZodTypeDef, + unknown +> = z.object({ + usernames: z.string().optional(), +}); + +/** @internal */ +export type RemoveGroupMembersRequestBody$Outbound = { + usernames?: string | undefined; +}; + +/** @internal */ +export const RemoveGroupMembersRequestBody$outboundSchema: z.ZodType< + RemoveGroupMembersRequestBody$Outbound, + z.ZodTypeDef, + RemoveGroupMembersRequestBody +> = z.object({ + usernames: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace RemoveGroupMembersRequestBody$ { + /** @deprecated use `RemoveGroupMembersRequestBody$inboundSchema` instead. */ + export const inboundSchema = RemoveGroupMembersRequestBody$inboundSchema; + /** @deprecated use `RemoveGroupMembersRequestBody$outboundSchema` instead. */ + export const outboundSchema = RemoveGroupMembersRequestBody$outboundSchema; + /** @deprecated use `RemoveGroupMembersRequestBody$Outbound` instead. */ + export type Outbound = RemoveGroupMembersRequestBody$Outbound; } -export class RemoveGroupMembersResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const RemoveGroupMembersRequest$inboundSchema: z.ZodType< + RemoveGroupMembersRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + RequestBody: z.lazy(() => RemoveGroupMembersRequestBody$inboundSchema).optional(), + id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + RequestBody: "requestBody", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type RemoveGroupMembersRequest$Outbound = { + RequestBody?: RemoveGroupMembersRequestBody$Outbound | undefined; + id: number; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const RemoveGroupMembersRequest$outboundSchema: z.ZodType< + RemoveGroupMembersRequest$Outbound, + z.ZodTypeDef, + RemoveGroupMembersRequest +> = z + .object({ + requestBody: z.lazy(() => RemoveGroupMembersRequestBody$outboundSchema).optional(), + id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + requestBody: "RequestBody", + }); + }); - /** - * success response - */ - @SpeakeasyMetadata() - object?: RemoveGroupMembersResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace RemoveGroupMembersRequest$ { + /** @deprecated use `RemoveGroupMembersRequest$inboundSchema` instead. */ + export const inboundSchema = RemoveGroupMembersRequest$inboundSchema; + /** @deprecated use `RemoveGroupMembersRequest$outboundSchema` instead. */ + export const outboundSchema = RemoveGroupMembersRequest$outboundSchema; + /** @deprecated use `RemoveGroupMembersRequest$Outbound` instead. */ + export type Outbound = RemoveGroupMembersRequest$Outbound; +} + +/** @internal */ +export const RemoveGroupMembersResponseBody$inboundSchema: z.ZodType< + RemoveGroupMembersResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + skipped_usernames: z.array(z.any()), + success: z.string(), + usernames: z.array(z.any()), + }) + .transform((v) => { + return remap$(v, { + skipped_usernames: "skippedUsernames", + }); + }); + +/** @internal */ +export type RemoveGroupMembersResponseBody$Outbound = { + skipped_usernames: Array; + success: string; + usernames: Array; +}; + +/** @internal */ +export const RemoveGroupMembersResponseBody$outboundSchema: z.ZodType< + RemoveGroupMembersResponseBody$Outbound, + z.ZodTypeDef, + RemoveGroupMembersResponseBody +> = z + .object({ + skippedUsernames: z.array(z.any()), + success: z.string(), + usernames: z.array(z.any()), + }) + .transform((v) => { + return remap$(v, { + skippedUsernames: "skipped_usernames", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace RemoveGroupMembersResponseBody$ { + /** @deprecated use `RemoveGroupMembersResponseBody$inboundSchema` instead. */ + export const inboundSchema = RemoveGroupMembersResponseBody$inboundSchema; + /** @deprecated use `RemoveGroupMembersResponseBody$outboundSchema` instead. */ + export const outboundSchema = RemoveGroupMembersResponseBody$outboundSchema; + /** @deprecated use `RemoveGroupMembersResponseBody$Outbound` instead. */ + export type Outbound = RemoveGroupMembersResponseBody$Outbound; } diff --git a/src/sdk/models/operations/removetopic.ts b/src/sdk/models/operations/removetopic.ts index 130b132..5db10dc 100644 --- a/src/sdk/models/operations/removetopic.ts +++ b/src/sdk/models/operations/removetopic.ts @@ -1,37 +1,68 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class RemoveTopicRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Key" }) +export type RemoveTopicRequest = { apiKey: string; - - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Username" }) apiUsername: string; - - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) id: string; -} - -export class RemoveTopicResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; - - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; - - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +}; + +/** @internal */ +export const RemoveTopicRequest$inboundSchema: z.ZodType< + RemoveTopicRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + "Api-Key": z.string(), + "Api-Username": z.string(), + id: z.string(), + }) + .transform((v) => { + return remap$(v, { + "Api-Key": "apiKey", + "Api-Username": "apiUsername", + }); + }); + +/** @internal */ +export type RemoveTopicRequest$Outbound = { + "Api-Key": string; + "Api-Username": string; + id: string; +}; + +/** @internal */ +export const RemoveTopicRequest$outboundSchema: z.ZodType< + RemoveTopicRequest$Outbound, + z.ZodTypeDef, + RemoveTopicRequest +> = z + .object({ + apiKey: z.string(), + apiUsername: z.string(), + id: z.string(), + }) + .transform((v) => { + return remap$(v, { + apiKey: "Api-Key", + apiUsername: "Api-Username", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace RemoveTopicRequest$ { + /** @deprecated use `RemoveTopicRequest$inboundSchema` instead. */ + export const inboundSchema = RemoveTopicRequest$inboundSchema; + /** @deprecated use `RemoveTopicRequest$outboundSchema` instead. */ + export const outboundSchema = RemoveTopicRequest$outboundSchema; + /** @deprecated use `RemoveTopicRequest$Outbound` instead. */ + export type Outbound = RemoveTopicRequest$Outbound; } diff --git a/src/sdk/models/operations/search.ts b/src/sdk/models/operations/search.ts index 6889603..dddadc1 100644 --- a/src/sdk/models/operations/search.ts +++ b/src/sdk/models/operations/search.ts @@ -1,15 +1,12 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; - -export class SearchRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "queryParam, style=form;explode=true;name=page" }) - page?: number; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; +export type SearchRequest = { + page?: number | undefined; /** * The query string needs to be url encoded and is made up of the following options: * @@ -40,116 +37,236 @@ export class SearchRequest extends SpeakeasyBase { * ``` * */ - @SpeakeasyMetadata({ data: "queryParam, style=form;explode=true;name=q" }) - q?: string; -} + q?: string | undefined; +}; -export class GroupedSearchResult extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "can_create_topic" }) +export type GroupedSearchResult = { canCreateTopic: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "category_ids" }) - categoryIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "error" }) - error: string; - - @SpeakeasyMetadata() - @Expose({ name: "group_ids" }) - groupIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "more_categories" }) - moreCategories: string; - - @SpeakeasyMetadata() - @Expose({ name: "more_full_page_results" }) - moreFullPageResults: string; - - @SpeakeasyMetadata() - @Expose({ name: "more_posts" }) - morePosts: string; - - @SpeakeasyMetadata() - @Expose({ name: "more_users" }) - moreUsers: string; - - @SpeakeasyMetadata() - @Expose({ name: "post_ids" }) - postIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "search_log_id" }) + categoryIds: Array; + error: string | null; + groupIds: Array; + moreCategories: string | null; + moreFullPageResults: string | null; + morePosts: string | null; + moreUsers: string | null; + postIds: Array; searchLogId: number; - - @SpeakeasyMetadata() - @Expose({ name: "tag_ids" }) - tagIds: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "term" }) + tagIds: Array; term: string; - - @SpeakeasyMetadata() - @Expose({ name: "user_ids" }) - userIds: any[]; -} + userIds: Array; +}; /** * success response */ -export class SearchResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "categories" }) - categories: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "grouped_search_result" }) - @Type(() => GroupedSearchResult) +export type SearchResponseBody = { + categories: Array; groupedSearchResult: GroupedSearchResult; + groups: Array; + posts: Array; + tags: Array; + users: Array; +}; - @SpeakeasyMetadata() - @Expose({ name: "groups" }) - groups: any[]; +/** @internal */ +export const SearchRequest$inboundSchema: z.ZodType = + z.object({ + page: z.number().int().optional(), + q: z.string().optional(), + }); - @SpeakeasyMetadata() - @Expose({ name: "posts" }) - posts: any[]; +/** @internal */ +export type SearchRequest$Outbound = { + page?: number | undefined; + q?: string | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "tags" }) - tags: any[]; +/** @internal */ +export const SearchRequest$outboundSchema: z.ZodType< + SearchRequest$Outbound, + z.ZodTypeDef, + SearchRequest +> = z.object({ + page: z.number().int().optional(), + q: z.string().optional(), +}); - @SpeakeasyMetadata() - @Expose({ name: "users" }) - users: any[]; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SearchRequest$ { + /** @deprecated use `SearchRequest$inboundSchema` instead. */ + export const inboundSchema = SearchRequest$inboundSchema; + /** @deprecated use `SearchRequest$outboundSchema` instead. */ + export const outboundSchema = SearchRequest$outboundSchema; + /** @deprecated use `SearchRequest$Outbound` instead. */ + export type Outbound = SearchRequest$Outbound; } -export class SearchResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const GroupedSearchResult$inboundSchema: z.ZodType< + GroupedSearchResult, + z.ZodTypeDef, + unknown +> = z + .object({ + can_create_topic: z.boolean(), + category_ids: z.array(z.any()), + error: z.nullable(z.string()), + group_ids: z.array(z.any()), + more_categories: z.nullable(z.string()), + more_full_page_results: z.nullable(z.string()), + more_posts: z.nullable(z.string()), + more_users: z.nullable(z.string()), + post_ids: z.array(z.any()), + search_log_id: z.number().int(), + tag_ids: z.array(z.any()), + term: z.string(), + user_ids: z.array(z.any()), + }) + .transform((v) => { + return remap$(v, { + can_create_topic: "canCreateTopic", + category_ids: "categoryIds", + group_ids: "groupIds", + more_categories: "moreCategories", + more_full_page_results: "moreFullPageResults", + more_posts: "morePosts", + more_users: "moreUsers", + post_ids: "postIds", + search_log_id: "searchLogId", + tag_ids: "tagIds", + user_ids: "userIds", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type GroupedSearchResult$Outbound = { + can_create_topic: boolean; + category_ids: Array; + error: string | null; + group_ids: Array; + more_categories: string | null; + more_full_page_results: string | null; + more_posts: string | null; + more_users: string | null; + post_ids: Array; + search_log_id: number; + tag_ids: Array; + term: string; + user_ids: Array; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const GroupedSearchResult$outboundSchema: z.ZodType< + GroupedSearchResult$Outbound, + z.ZodTypeDef, + GroupedSearchResult +> = z + .object({ + canCreateTopic: z.boolean(), + categoryIds: z.array(z.any()), + error: z.nullable(z.string()), + groupIds: z.array(z.any()), + moreCategories: z.nullable(z.string()), + moreFullPageResults: z.nullable(z.string()), + morePosts: z.nullable(z.string()), + moreUsers: z.nullable(z.string()), + postIds: z.array(z.any()), + searchLogId: z.number().int(), + tagIds: z.array(z.any()), + term: z.string(), + userIds: z.array(z.any()), + }) + .transform((v) => { + return remap$(v, { + canCreateTopic: "can_create_topic", + categoryIds: "category_ids", + groupIds: "group_ids", + moreCategories: "more_categories", + moreFullPageResults: "more_full_page_results", + morePosts: "more_posts", + moreUsers: "more_users", + postIds: "post_ids", + searchLogId: "search_log_id", + tagIds: "tag_ids", + userIds: "user_ids", + }); + }); - /** - * success response - */ - @SpeakeasyMetadata() - object?: SearchResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GroupedSearchResult$ { + /** @deprecated use `GroupedSearchResult$inboundSchema` instead. */ + export const inboundSchema = GroupedSearchResult$inboundSchema; + /** @deprecated use `GroupedSearchResult$outboundSchema` instead. */ + export const outboundSchema = GroupedSearchResult$outboundSchema; + /** @deprecated use `GroupedSearchResult$Outbound` instead. */ + export type Outbound = GroupedSearchResult$Outbound; +} + +/** @internal */ +export const SearchResponseBody$inboundSchema: z.ZodType< + SearchResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + categories: z.array(z.any()), + grouped_search_result: z.lazy(() => GroupedSearchResult$inboundSchema), + groups: z.array(z.any()), + posts: z.array(z.any()), + tags: z.array(z.any()), + users: z.array(z.any()), + }) + .transform((v) => { + return remap$(v, { + grouped_search_result: "groupedSearchResult", + }); + }); + +/** @internal */ +export type SearchResponseBody$Outbound = { + categories: Array; + grouped_search_result: GroupedSearchResult$Outbound; + groups: Array; + posts: Array; + tags: Array; + users: Array; +}; + +/** @internal */ +export const SearchResponseBody$outboundSchema: z.ZodType< + SearchResponseBody$Outbound, + z.ZodTypeDef, + SearchResponseBody +> = z + .object({ + categories: z.array(z.any()), + groupedSearchResult: z.lazy(() => GroupedSearchResult$outboundSchema), + groups: z.array(z.any()), + posts: z.array(z.any()), + tags: z.array(z.any()), + users: z.array(z.any()), + }) + .transform((v) => { + return remap$(v, { + groupedSearchResult: "grouped_search_result", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SearchResponseBody$ { + /** @deprecated use `SearchResponseBody$inboundSchema` instead. */ + export const inboundSchema = SearchResponseBody$inboundSchema; + /** @deprecated use `SearchResponseBody$outboundSchema` instead. */ + export const outboundSchema = SearchResponseBody$outboundSchema; + /** @deprecated use `SearchResponseBody$Outbound` instead. */ + export type Outbound = SearchResponseBody$Outbound; } diff --git a/src/sdk/models/operations/senddownloadbackupemail.ts b/src/sdk/models/operations/senddownloadbackupemail.ts index 18b3c41..279f484 100644 --- a/src/sdk/models/operations/senddownloadbackupemail.ts +++ b/src/sdk/models/operations/senddownloadbackupemail.ts @@ -1,31 +1,45 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; +import * as z from "zod"; -export class SendDownloadBackupEmailRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=filename" }) +export type SendDownloadBackupEmailRequest = { filename: string; -} - -export class SendDownloadBackupEmailResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; - - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; - - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +}; + +/** @internal */ +export const SendDownloadBackupEmailRequest$inboundSchema: z.ZodType< + SendDownloadBackupEmailRequest, + z.ZodTypeDef, + unknown +> = z.object({ + filename: z.string(), +}); + +/** @internal */ +export type SendDownloadBackupEmailRequest$Outbound = { + filename: string; +}; + +/** @internal */ +export const SendDownloadBackupEmailRequest$outboundSchema: z.ZodType< + SendDownloadBackupEmailRequest$Outbound, + z.ZodTypeDef, + SendDownloadBackupEmailRequest +> = z.object({ + filename: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SendDownloadBackupEmailRequest$ { + /** @deprecated use `SendDownloadBackupEmailRequest$inboundSchema` instead. */ + export const inboundSchema = SendDownloadBackupEmailRequest$inboundSchema; + /** @deprecated use `SendDownloadBackupEmailRequest$outboundSchema` instead. */ + export const outboundSchema = SendDownloadBackupEmailRequest$outboundSchema; + /** @deprecated use `SendDownloadBackupEmailRequest$Outbound` instead. */ + export type Outbound = SendDownloadBackupEmailRequest$Outbound; } diff --git a/src/sdk/models/operations/sendpasswordresetemail.ts b/src/sdk/models/operations/sendpasswordresetemail.ts index c0935d5..8a993a0 100644 --- a/src/sdk/models/operations/sendpasswordresetemail.ts +++ b/src/sdk/models/operations/sendpasswordresetemail.ts @@ -1,52 +1,105 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class SendPasswordResetEmailRequestBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "login" }) +export type SendPasswordResetEmailRequestBody = { login: string; -} +}; /** * success response */ -export class SendPasswordResetEmailResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "success" }) +export type SendPasswordResetEmailResponseBody = { success: string; - - @SpeakeasyMetadata() - @Expose({ name: "user_found" }) userFound: boolean; +}; + +/** @internal */ +export const SendPasswordResetEmailRequestBody$inboundSchema: z.ZodType< + SendPasswordResetEmailRequestBody, + z.ZodTypeDef, + unknown +> = z.object({ + login: z.string(), +}); + +/** @internal */ +export type SendPasswordResetEmailRequestBody$Outbound = { + login: string; +}; + +/** @internal */ +export const SendPasswordResetEmailRequestBody$outboundSchema: z.ZodType< + SendPasswordResetEmailRequestBody$Outbound, + z.ZodTypeDef, + SendPasswordResetEmailRequestBody +> = z.object({ + login: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SendPasswordResetEmailRequestBody$ { + /** @deprecated use `SendPasswordResetEmailRequestBody$inboundSchema` instead. */ + export const inboundSchema = SendPasswordResetEmailRequestBody$inboundSchema; + /** @deprecated use `SendPasswordResetEmailRequestBody$outboundSchema` instead. */ + export const outboundSchema = SendPasswordResetEmailRequestBody$outboundSchema; + /** @deprecated use `SendPasswordResetEmailRequestBody$Outbound` instead. */ + export type Outbound = SendPasswordResetEmailRequestBody$Outbound; } -export class SendPasswordResetEmailResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const SendPasswordResetEmailResponseBody$inboundSchema: z.ZodType< + SendPasswordResetEmailResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + success: z.string(), + user_found: z.boolean(), + }) + .transform((v) => { + return remap$(v, { + user_found: "userFound", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type SendPasswordResetEmailResponseBody$Outbound = { + success: string; + user_found: boolean; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const SendPasswordResetEmailResponseBody$outboundSchema: z.ZodType< + SendPasswordResetEmailResponseBody$Outbound, + z.ZodTypeDef, + SendPasswordResetEmailResponseBody +> = z + .object({ + success: z.string(), + userFound: z.boolean(), + }) + .transform((v) => { + return remap$(v, { + userFound: "user_found", + }); + }); - /** - * success response - */ - @SpeakeasyMetadata() - object?: SendPasswordResetEmailResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SendPasswordResetEmailResponseBody$ { + /** @deprecated use `SendPasswordResetEmailResponseBody$inboundSchema` instead. */ + export const inboundSchema = SendPasswordResetEmailResponseBody$inboundSchema; + /** @deprecated use `SendPasswordResetEmailResponseBody$outboundSchema` instead. */ + export const outboundSchema = SendPasswordResetEmailResponseBody$outboundSchema; + /** @deprecated use `SendPasswordResetEmailResponseBody$Outbound` instead. */ + export type Outbound = SendPasswordResetEmailResponseBody$Outbound; } diff --git a/src/sdk/models/operations/setnotificationlevel.ts b/src/sdk/models/operations/setnotificationlevel.ts index cf333db..340d6ae 100644 --- a/src/sdk/models/operations/setnotificationlevel.ts +++ b/src/sdk/models/operations/setnotificationlevel.ts @@ -1,69 +1,197 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; -export enum NotificationLevel { - Zero = "0", - One = "1", - Two = "2", - Three = "3", -} +export const NotificationLevel = { + Zero: "0", + One: "1", + Two: "2", + Three: "3", +} as const; +export type NotificationLevel = ClosedEnum; -export class SetNotificationLevelRequestBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "notification_level" }) +export type SetNotificationLevelRequestBody = { notificationLevel: NotificationLevel; -} +}; -export class SetNotificationLevelRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Key" }) +export type SetNotificationLevelRequest = { apiKey: string; - - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Username" }) apiUsername: string; - - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) + requestBody?: SetNotificationLevelRequestBody | undefined; id: string; - - @SpeakeasyMetadata({ data: "request, media_type=application/json" }) - requestBody?: SetNotificationLevelRequestBody; -} +}; /** * topic updated */ -export class SetNotificationLevelResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "success" }) - success?: string; +export type SetNotificationLevelResponseBody = { + success?: string | undefined; +}; + +/** @internal */ +export const NotificationLevel$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(NotificationLevel); + +/** @internal */ +export const NotificationLevel$outboundSchema: z.ZodNativeEnum = + NotificationLevel$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace NotificationLevel$ { + /** @deprecated use `NotificationLevel$inboundSchema` instead. */ + export const inboundSchema = NotificationLevel$inboundSchema; + /** @deprecated use `NotificationLevel$outboundSchema` instead. */ + export const outboundSchema = NotificationLevel$outboundSchema; } -export class SetNotificationLevelResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const SetNotificationLevelRequestBody$inboundSchema: z.ZodType< + SetNotificationLevelRequestBody, + z.ZodTypeDef, + unknown +> = z + .object({ + notification_level: NotificationLevel$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + notification_level: "notificationLevel", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type SetNotificationLevelRequestBody$Outbound = { + notification_level: string; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const SetNotificationLevelRequestBody$outboundSchema: z.ZodType< + SetNotificationLevelRequestBody$Outbound, + z.ZodTypeDef, + SetNotificationLevelRequestBody +> = z + .object({ + notificationLevel: NotificationLevel$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + notificationLevel: "notification_level", + }); + }); - /** - * topic updated - */ - @SpeakeasyMetadata() - object?: SetNotificationLevelResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SetNotificationLevelRequestBody$ { + /** @deprecated use `SetNotificationLevelRequestBody$inboundSchema` instead. */ + export const inboundSchema = SetNotificationLevelRequestBody$inboundSchema; + /** @deprecated use `SetNotificationLevelRequestBody$outboundSchema` instead. */ + export const outboundSchema = SetNotificationLevelRequestBody$outboundSchema; + /** @deprecated use `SetNotificationLevelRequestBody$Outbound` instead. */ + export type Outbound = SetNotificationLevelRequestBody$Outbound; +} + +/** @internal */ +export const SetNotificationLevelRequest$inboundSchema: z.ZodType< + SetNotificationLevelRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + "Api-Key": z.string(), + "Api-Username": z.string(), + RequestBody: z.lazy(() => SetNotificationLevelRequestBody$inboundSchema).optional(), + id: z.string(), + }) + .transform((v) => { + return remap$(v, { + "Api-Key": "apiKey", + "Api-Username": "apiUsername", + RequestBody: "requestBody", + }); + }); + +/** @internal */ +export type SetNotificationLevelRequest$Outbound = { + "Api-Key": string; + "Api-Username": string; + RequestBody?: SetNotificationLevelRequestBody$Outbound | undefined; + id: string; +}; + +/** @internal */ +export const SetNotificationLevelRequest$outboundSchema: z.ZodType< + SetNotificationLevelRequest$Outbound, + z.ZodTypeDef, + SetNotificationLevelRequest +> = z + .object({ + apiKey: z.string(), + apiUsername: z.string(), + requestBody: z.lazy(() => SetNotificationLevelRequestBody$outboundSchema).optional(), + id: z.string(), + }) + .transform((v) => { + return remap$(v, { + apiKey: "Api-Key", + apiUsername: "Api-Username", + requestBody: "RequestBody", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SetNotificationLevelRequest$ { + /** @deprecated use `SetNotificationLevelRequest$inboundSchema` instead. */ + export const inboundSchema = SetNotificationLevelRequest$inboundSchema; + /** @deprecated use `SetNotificationLevelRequest$outboundSchema` instead. */ + export const outboundSchema = SetNotificationLevelRequest$outboundSchema; + /** @deprecated use `SetNotificationLevelRequest$Outbound` instead. */ + export type Outbound = SetNotificationLevelRequest$Outbound; +} + +/** @internal */ +export const SetNotificationLevelResponseBody$inboundSchema: z.ZodType< + SetNotificationLevelResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + success: z.string().optional(), +}); + +/** @internal */ +export type SetNotificationLevelResponseBody$Outbound = { + success?: string | undefined; +}; + +/** @internal */ +export const SetNotificationLevelResponseBody$outboundSchema: z.ZodType< + SetNotificationLevelResponseBody$Outbound, + z.ZodTypeDef, + SetNotificationLevelResponseBody +> = z.object({ + success: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SetNotificationLevelResponseBody$ { + /** @deprecated use `SetNotificationLevelResponseBody$inboundSchema` instead. */ + export const inboundSchema = SetNotificationLevelResponseBody$inboundSchema; + /** @deprecated use `SetNotificationLevelResponseBody$outboundSchema` instead. */ + export const outboundSchema = SetNotificationLevelResponseBody$outboundSchema; + /** @deprecated use `SetNotificationLevelResponseBody$Outbound` instead. */ + export type Outbound = SetNotificationLevelResponseBody$Outbound; } diff --git a/src/sdk/models/operations/silenceuser.ts b/src/sdk/models/operations/silenceuser.ts index 9df84aa..1cbb829 100644 --- a/src/sdk/models/operations/silenceuser.ts +++ b/src/sdk/models/operations/silenceuser.ts @@ -1,113 +1,296 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class SilenceUserRequestBody extends SpeakeasyBase { +export type SilenceUserRequestBody = { /** * Will send an email with this message when present */ - @SpeakeasyMetadata() - @Expose({ name: "message" }) - message?: string; + message?: string | undefined; + postAction?: string | undefined; + reason?: string | undefined; + silencedTill?: string | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "post_action" }) - postAction?: string; - - @SpeakeasyMetadata() - @Expose({ name: "reason" }) - reason?: string; - - @SpeakeasyMetadata() - @Expose({ name: "silenced_till" }) - silencedTill?: string; -} - -export class SilenceUserRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) +export type SilenceUserRequest = { + requestBody?: SilenceUserRequestBody | undefined; id: number; +}; - @SpeakeasyMetadata({ data: "request, media_type=application/json" }) - requestBody?: SilenceUserRequestBody; -} - -export class SilencedBy extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "avatar_template" }) +export type SilencedBy = { avatarTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) username: string; -} +}; -export class Silence extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "silence_reason" }) +export type Silence = { silenceReason: string; - - @SpeakeasyMetadata() - @Expose({ name: "silenced" }) silenced: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "silenced_at" }) silencedAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "silenced_by" }) - @Type(() => SilencedBy) silencedBy: SilencedBy; - - @SpeakeasyMetadata() - @Expose({ name: "silenced_till" }) silencedTill: string; -} +}; /** * response */ -export class SilenceUserResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "silence" }) - @Type(() => Silence) +export type SilenceUserResponseBody = { silence: Silence; +}; + +/** @internal */ +export const SilenceUserRequestBody$inboundSchema: z.ZodType< + SilenceUserRequestBody, + z.ZodTypeDef, + unknown +> = z + .object({ + message: z.string().optional(), + post_action: z.string().optional(), + reason: z.string().optional(), + silenced_till: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + post_action: "postAction", + silenced_till: "silencedTill", + }); + }); + +/** @internal */ +export type SilenceUserRequestBody$Outbound = { + message?: string | undefined; + post_action?: string | undefined; + reason?: string | undefined; + silenced_till?: string | undefined; +}; + +/** @internal */ +export const SilenceUserRequestBody$outboundSchema: z.ZodType< + SilenceUserRequestBody$Outbound, + z.ZodTypeDef, + SilenceUserRequestBody +> = z + .object({ + message: z.string().optional(), + postAction: z.string().optional(), + reason: z.string().optional(), + silencedTill: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + postAction: "post_action", + silencedTill: "silenced_till", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SilenceUserRequestBody$ { + /** @deprecated use `SilenceUserRequestBody$inboundSchema` instead. */ + export const inboundSchema = SilenceUserRequestBody$inboundSchema; + /** @deprecated use `SilenceUserRequestBody$outboundSchema` instead. */ + export const outboundSchema = SilenceUserRequestBody$outboundSchema; + /** @deprecated use `SilenceUserRequestBody$Outbound` instead. */ + export type Outbound = SilenceUserRequestBody$Outbound; } -export class SilenceUserResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const SilenceUserRequest$inboundSchema: z.ZodType< + SilenceUserRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + RequestBody: z.lazy(() => SilenceUserRequestBody$inboundSchema).optional(), + id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + RequestBody: "requestBody", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type SilenceUserRequest$Outbound = { + RequestBody?: SilenceUserRequestBody$Outbound | undefined; + id: number; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const SilenceUserRequest$outboundSchema: z.ZodType< + SilenceUserRequest$Outbound, + z.ZodTypeDef, + SilenceUserRequest +> = z + .object({ + requestBody: z.lazy(() => SilenceUserRequestBody$outboundSchema).optional(), + id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + requestBody: "RequestBody", + }); + }); - /** - * response - */ - @SpeakeasyMetadata() - object?: SilenceUserResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SilenceUserRequest$ { + /** @deprecated use `SilenceUserRequest$inboundSchema` instead. */ + export const inboundSchema = SilenceUserRequest$inboundSchema; + /** @deprecated use `SilenceUserRequest$outboundSchema` instead. */ + export const outboundSchema = SilenceUserRequest$outboundSchema; + /** @deprecated use `SilenceUserRequest$Outbound` instead. */ + export type Outbound = SilenceUserRequest$Outbound; +} + +/** @internal */ +export const SilencedBy$inboundSchema: z.ZodType = z + .object({ + avatar_template: z.string(), + id: z.number().int(), + name: z.string(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + avatar_template: "avatarTemplate", + }); + }); + +/** @internal */ +export type SilencedBy$Outbound = { + avatar_template: string; + id: number; + name: string; + username: string; +}; + +/** @internal */ +export const SilencedBy$outboundSchema: z.ZodType = z + .object({ + avatarTemplate: z.string(), + id: z.number().int(), + name: z.string(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + avatarTemplate: "avatar_template", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SilencedBy$ { + /** @deprecated use `SilencedBy$inboundSchema` instead. */ + export const inboundSchema = SilencedBy$inboundSchema; + /** @deprecated use `SilencedBy$outboundSchema` instead. */ + export const outboundSchema = SilencedBy$outboundSchema; + /** @deprecated use `SilencedBy$Outbound` instead. */ + export type Outbound = SilencedBy$Outbound; +} + +/** @internal */ +export const Silence$inboundSchema: z.ZodType = z + .object({ + silence_reason: z.string(), + silenced: z.boolean(), + silenced_at: z.string(), + silenced_by: z.lazy(() => SilencedBy$inboundSchema), + silenced_till: z.string(), + }) + .transform((v) => { + return remap$(v, { + silence_reason: "silenceReason", + silenced_at: "silencedAt", + silenced_by: "silencedBy", + silenced_till: "silencedTill", + }); + }); + +/** @internal */ +export type Silence$Outbound = { + silence_reason: string; + silenced: boolean; + silenced_at: string; + silenced_by: SilencedBy$Outbound; + silenced_till: string; +}; + +/** @internal */ +export const Silence$outboundSchema: z.ZodType = z + .object({ + silenceReason: z.string(), + silenced: z.boolean(), + silencedAt: z.string(), + silencedBy: z.lazy(() => SilencedBy$outboundSchema), + silencedTill: z.string(), + }) + .transform((v) => { + return remap$(v, { + silenceReason: "silence_reason", + silencedAt: "silenced_at", + silencedBy: "silenced_by", + silencedTill: "silenced_till", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Silence$ { + /** @deprecated use `Silence$inboundSchema` instead. */ + export const inboundSchema = Silence$inboundSchema; + /** @deprecated use `Silence$outboundSchema` instead. */ + export const outboundSchema = Silence$outboundSchema; + /** @deprecated use `Silence$Outbound` instead. */ + export type Outbound = Silence$Outbound; +} + +/** @internal */ +export const SilenceUserResponseBody$inboundSchema: z.ZodType< + SilenceUserResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + silence: z.lazy(() => Silence$inboundSchema), +}); + +/** @internal */ +export type SilenceUserResponseBody$Outbound = { + silence: Silence$Outbound; +}; + +/** @internal */ +export const SilenceUserResponseBody$outboundSchema: z.ZodType< + SilenceUserResponseBody$Outbound, + z.ZodTypeDef, + SilenceUserResponseBody +> = z.object({ + silence: z.lazy(() => Silence$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SilenceUserResponseBody$ { + /** @deprecated use `SilenceUserResponseBody$inboundSchema` instead. */ + export const inboundSchema = SilenceUserResponseBody$inboundSchema; + /** @deprecated use `SilenceUserResponseBody$outboundSchema` instead. */ + export const outboundSchema = SilenceUserResponseBody$outboundSchema; + /** @deprecated use `SilenceUserResponseBody$Outbound` instead. */ + export type Outbound = SilenceUserResponseBody$Outbound; } diff --git a/src/sdk/models/operations/suspenduser.ts b/src/sdk/models/operations/suspenduser.ts index 2661ba3..a0ca49f 100644 --- a/src/sdk/models/operations/suspenduser.ts +++ b/src/sdk/models/operations/suspenduser.ts @@ -1,113 +1,302 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class SuspendUserRequestBody extends SpeakeasyBase { +export type SuspendUserRequestBody = { /** * Will send an email with this message when present */ - @SpeakeasyMetadata() - @Expose({ name: "message" }) - message?: string; - - @SpeakeasyMetadata() - @Expose({ name: "post_action" }) - postAction?: string; - - @SpeakeasyMetadata() - @Expose({ name: "reason" }) + message?: string | undefined; + postAction?: string | undefined; reason: string; - - @SpeakeasyMetadata() - @Expose({ name: "suspend_until" }) suspendUntil: string; -} +}; -export class SuspendUserRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) +export type SuspendUserRequest = { + requestBody?: SuspendUserRequestBody | undefined; id: number; +}; - @SpeakeasyMetadata({ data: "request, media_type=application/json" }) - requestBody?: SuspendUserRequestBody; -} - -export class SuspendedBy extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "avatar_template" }) +export type SuspendedBy = { avatarTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) username: string; -} +}; -export class Suspension extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "full_suspend_reason" }) +export type Suspension = { fullSuspendReason: string; - - @SpeakeasyMetadata() - @Expose({ name: "suspend_reason" }) suspendReason: string; - - @SpeakeasyMetadata() - @Expose({ name: "suspended_at" }) suspendedAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "suspended_by" }) - @Type(() => SuspendedBy) suspendedBy: SuspendedBy; - - @SpeakeasyMetadata() - @Expose({ name: "suspended_till" }) suspendedTill: string; -} +}; /** * response */ -export class SuspendUserResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "suspension" }) - @Type(() => Suspension) +export type SuspendUserResponseBody = { suspension: Suspension; +}; + +/** @internal */ +export const SuspendUserRequestBody$inboundSchema: z.ZodType< + SuspendUserRequestBody, + z.ZodTypeDef, + unknown +> = z + .object({ + message: z.string().optional(), + post_action: z.string().optional(), + reason: z.string(), + suspend_until: z.string(), + }) + .transform((v) => { + return remap$(v, { + post_action: "postAction", + suspend_until: "suspendUntil", + }); + }); + +/** @internal */ +export type SuspendUserRequestBody$Outbound = { + message?: string | undefined; + post_action?: string | undefined; + reason: string; + suspend_until: string; +}; + +/** @internal */ +export const SuspendUserRequestBody$outboundSchema: z.ZodType< + SuspendUserRequestBody$Outbound, + z.ZodTypeDef, + SuspendUserRequestBody +> = z + .object({ + message: z.string().optional(), + postAction: z.string().optional(), + reason: z.string(), + suspendUntil: z.string(), + }) + .transform((v) => { + return remap$(v, { + postAction: "post_action", + suspendUntil: "suspend_until", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SuspendUserRequestBody$ { + /** @deprecated use `SuspendUserRequestBody$inboundSchema` instead. */ + export const inboundSchema = SuspendUserRequestBody$inboundSchema; + /** @deprecated use `SuspendUserRequestBody$outboundSchema` instead. */ + export const outboundSchema = SuspendUserRequestBody$outboundSchema; + /** @deprecated use `SuspendUserRequestBody$Outbound` instead. */ + export type Outbound = SuspendUserRequestBody$Outbound; } -export class SuspendUserResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const SuspendUserRequest$inboundSchema: z.ZodType< + SuspendUserRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + RequestBody: z.lazy(() => SuspendUserRequestBody$inboundSchema).optional(), + id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + RequestBody: "requestBody", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type SuspendUserRequest$Outbound = { + RequestBody?: SuspendUserRequestBody$Outbound | undefined; + id: number; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const SuspendUserRequest$outboundSchema: z.ZodType< + SuspendUserRequest$Outbound, + z.ZodTypeDef, + SuspendUserRequest +> = z + .object({ + requestBody: z.lazy(() => SuspendUserRequestBody$outboundSchema).optional(), + id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + requestBody: "RequestBody", + }); + }); - /** - * response - */ - @SpeakeasyMetadata() - object?: SuspendUserResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SuspendUserRequest$ { + /** @deprecated use `SuspendUserRequest$inboundSchema` instead. */ + export const inboundSchema = SuspendUserRequest$inboundSchema; + /** @deprecated use `SuspendUserRequest$outboundSchema` instead. */ + export const outboundSchema = SuspendUserRequest$outboundSchema; + /** @deprecated use `SuspendUserRequest$Outbound` instead. */ + export type Outbound = SuspendUserRequest$Outbound; +} + +/** @internal */ +export const SuspendedBy$inboundSchema: z.ZodType = z + .object({ + avatar_template: z.string(), + id: z.number().int(), + name: z.string(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + avatar_template: "avatarTemplate", + }); + }); + +/** @internal */ +export type SuspendedBy$Outbound = { + avatar_template: string; + id: number; + name: string; + username: string; +}; + +/** @internal */ +export const SuspendedBy$outboundSchema: z.ZodType< + SuspendedBy$Outbound, + z.ZodTypeDef, + SuspendedBy +> = z + .object({ + avatarTemplate: z.string(), + id: z.number().int(), + name: z.string(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + avatarTemplate: "avatar_template", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SuspendedBy$ { + /** @deprecated use `SuspendedBy$inboundSchema` instead. */ + export const inboundSchema = SuspendedBy$inboundSchema; + /** @deprecated use `SuspendedBy$outboundSchema` instead. */ + export const outboundSchema = SuspendedBy$outboundSchema; + /** @deprecated use `SuspendedBy$Outbound` instead. */ + export type Outbound = SuspendedBy$Outbound; +} + +/** @internal */ +export const Suspension$inboundSchema: z.ZodType = z + .object({ + full_suspend_reason: z.string(), + suspend_reason: z.string(), + suspended_at: z.string(), + suspended_by: z.lazy(() => SuspendedBy$inboundSchema), + suspended_till: z.string(), + }) + .transform((v) => { + return remap$(v, { + full_suspend_reason: "fullSuspendReason", + suspend_reason: "suspendReason", + suspended_at: "suspendedAt", + suspended_by: "suspendedBy", + suspended_till: "suspendedTill", + }); + }); + +/** @internal */ +export type Suspension$Outbound = { + full_suspend_reason: string; + suspend_reason: string; + suspended_at: string; + suspended_by: SuspendedBy$Outbound; + suspended_till: string; +}; + +/** @internal */ +export const Suspension$outboundSchema: z.ZodType = z + .object({ + fullSuspendReason: z.string(), + suspendReason: z.string(), + suspendedAt: z.string(), + suspendedBy: z.lazy(() => SuspendedBy$outboundSchema), + suspendedTill: z.string(), + }) + .transform((v) => { + return remap$(v, { + fullSuspendReason: "full_suspend_reason", + suspendReason: "suspend_reason", + suspendedAt: "suspended_at", + suspendedBy: "suspended_by", + suspendedTill: "suspended_till", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Suspension$ { + /** @deprecated use `Suspension$inboundSchema` instead. */ + export const inboundSchema = Suspension$inboundSchema; + /** @deprecated use `Suspension$outboundSchema` instead. */ + export const outboundSchema = Suspension$outboundSchema; + /** @deprecated use `Suspension$Outbound` instead. */ + export type Outbound = Suspension$Outbound; +} + +/** @internal */ +export const SuspendUserResponseBody$inboundSchema: z.ZodType< + SuspendUserResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + suspension: z.lazy(() => Suspension$inboundSchema), +}); + +/** @internal */ +export type SuspendUserResponseBody$Outbound = { + suspension: Suspension$Outbound; +}; + +/** @internal */ +export const SuspendUserResponseBody$outboundSchema: z.ZodType< + SuspendUserResponseBody$Outbound, + z.ZodTypeDef, + SuspendUserResponseBody +> = z.object({ + suspension: z.lazy(() => Suspension$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SuspendUserResponseBody$ { + /** @deprecated use `SuspendUserResponseBody$inboundSchema` instead. */ + export const inboundSchema = SuspendUserResponseBody$inboundSchema; + /** @deprecated use `SuspendUserResponseBody$outboundSchema` instead. */ + export const outboundSchema = SuspendUserResponseBody$outboundSchema; + /** @deprecated use `SuspendUserResponseBody$Outbound` instead. */ + export type Outbound = SuspendUserResponseBody$Outbound; } diff --git a/src/sdk/models/operations/updateavatar.ts b/src/sdk/models/operations/updateavatar.ts index a016405..9886079 100644 --- a/src/sdk/models/operations/updateavatar.ts +++ b/src/sdk/models/operations/updateavatar.ts @@ -1,67 +1,189 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; -export enum UpdateAvatarType { - Uploaded = "uploaded", - Custom = "custom", - Gravatar = "gravatar", - System = "system", -} +export const UpdateAvatarType = { + Uploaded: "uploaded", + Custom: "custom", + Gravatar: "gravatar", + System: "system", +} as const; +export type UpdateAvatarType = ClosedEnum; -export class UpdateAvatarRequestBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "type" }) +export type UpdateAvatarRequestBody = { type: UpdateAvatarType; - - @SpeakeasyMetadata() - @Expose({ name: "upload_id" }) uploadId: number; -} +}; -export class UpdateAvatarRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=username" }) +export type UpdateAvatarRequest = { + requestBody?: UpdateAvatarRequestBody | undefined; username: string; - - @SpeakeasyMetadata({ data: "request, media_type=application/json" }) - requestBody?: UpdateAvatarRequestBody; -} +}; /** * avatar updated */ -export class UpdateAvatarResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "success" }) +export type UpdateAvatarResponseBody = { success: string; +}; + +/** @internal */ +export const UpdateAvatarType$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(UpdateAvatarType); + +/** @internal */ +export const UpdateAvatarType$outboundSchema: z.ZodNativeEnum = + UpdateAvatarType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateAvatarType$ { + /** @deprecated use `UpdateAvatarType$inboundSchema` instead. */ + export const inboundSchema = UpdateAvatarType$inboundSchema; + /** @deprecated use `UpdateAvatarType$outboundSchema` instead. */ + export const outboundSchema = UpdateAvatarType$outboundSchema; } -export class UpdateAvatarResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const UpdateAvatarRequestBody$inboundSchema: z.ZodType< + UpdateAvatarRequestBody, + z.ZodTypeDef, + unknown +> = z + .object({ + type: UpdateAvatarType$inboundSchema, + upload_id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + upload_id: "uploadId", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type UpdateAvatarRequestBody$Outbound = { + type: string; + upload_id: number; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const UpdateAvatarRequestBody$outboundSchema: z.ZodType< + UpdateAvatarRequestBody$Outbound, + z.ZodTypeDef, + UpdateAvatarRequestBody +> = z + .object({ + type: UpdateAvatarType$outboundSchema, + uploadId: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + uploadId: "upload_id", + }); + }); - /** - * avatar updated - */ - @SpeakeasyMetadata() - object?: UpdateAvatarResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateAvatarRequestBody$ { + /** @deprecated use `UpdateAvatarRequestBody$inboundSchema` instead. */ + export const inboundSchema = UpdateAvatarRequestBody$inboundSchema; + /** @deprecated use `UpdateAvatarRequestBody$outboundSchema` instead. */ + export const outboundSchema = UpdateAvatarRequestBody$outboundSchema; + /** @deprecated use `UpdateAvatarRequestBody$Outbound` instead. */ + export type Outbound = UpdateAvatarRequestBody$Outbound; +} + +/** @internal */ +export const UpdateAvatarRequest$inboundSchema: z.ZodType< + UpdateAvatarRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + RequestBody: z.lazy(() => UpdateAvatarRequestBody$inboundSchema).optional(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + RequestBody: "requestBody", + }); + }); + +/** @internal */ +export type UpdateAvatarRequest$Outbound = { + RequestBody?: UpdateAvatarRequestBody$Outbound | undefined; + username: string; +}; + +/** @internal */ +export const UpdateAvatarRequest$outboundSchema: z.ZodType< + UpdateAvatarRequest$Outbound, + z.ZodTypeDef, + UpdateAvatarRequest +> = z + .object({ + requestBody: z.lazy(() => UpdateAvatarRequestBody$outboundSchema).optional(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + requestBody: "RequestBody", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateAvatarRequest$ { + /** @deprecated use `UpdateAvatarRequest$inboundSchema` instead. */ + export const inboundSchema = UpdateAvatarRequest$inboundSchema; + /** @deprecated use `UpdateAvatarRequest$outboundSchema` instead. */ + export const outboundSchema = UpdateAvatarRequest$outboundSchema; + /** @deprecated use `UpdateAvatarRequest$Outbound` instead. */ + export type Outbound = UpdateAvatarRequest$Outbound; +} + +/** @internal */ +export const UpdateAvatarResponseBody$inboundSchema: z.ZodType< + UpdateAvatarResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + success: z.string(), +}); + +/** @internal */ +export type UpdateAvatarResponseBody$Outbound = { + success: string; +}; + +/** @internal */ +export const UpdateAvatarResponseBody$outboundSchema: z.ZodType< + UpdateAvatarResponseBody$Outbound, + z.ZodTypeDef, + UpdateAvatarResponseBody +> = z.object({ + success: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateAvatarResponseBody$ { + /** @deprecated use `UpdateAvatarResponseBody$inboundSchema` instead. */ + export const inboundSchema = UpdateAvatarResponseBody$inboundSchema; + /** @deprecated use `UpdateAvatarResponseBody$outboundSchema` instead. */ + export const outboundSchema = UpdateAvatarResponseBody$outboundSchema; + /** @deprecated use `UpdateAvatarResponseBody$Outbound` instead. */ + export type Outbound = UpdateAvatarResponseBody$Outbound; } diff --git a/src/sdk/models/operations/updatebadge.ts b/src/sdk/models/operations/updatebadge.ts index 0ae98c3..c3b61c3 100644 --- a/src/sdk/models/operations/updatebadge.ts +++ b/src/sdk/models/operations/updatebadge.ts @@ -1,172 +1,391 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class UpdateBadgeRequestBody extends SpeakeasyBase { +export type UpdateBadgeRequestBody = { /** * The ID for the badge type. 1 for Gold, 2 for Silver, 3 for Bronze. */ - @SpeakeasyMetadata() - @Expose({ name: "badge_type_id" }) badgeTypeId: number; - /** * The name for the new badge. */ - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; -} +}; -export class UpdateBadgeRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) +export type UpdateBadgeRequest = { + requestBody?: UpdateBadgeRequestBody | undefined; id: number; +}; - @SpeakeasyMetadata({ data: "request, media_type=application/json" }) - requestBody?: UpdateBadgeRequestBody; -} - -export class UpdateBadgeBadge extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "allow_title" }) +export type UpdateBadgeBadge = { allowTitle: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "auto_revoke" }) autoRevoke: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "badge_grouping_id" }) badgeGroupingId: number; - - @SpeakeasyMetadata() - @Expose({ name: "badge_type_id" }) badgeTypeId: number; - - @SpeakeasyMetadata() - @Expose({ name: "description" }) description: string; - - @SpeakeasyMetadata() - @Expose({ name: "enabled" }) enabled: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "grant_count" }) grantCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "icon" }) icon: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "image_url" }) - imageUrl: string; - - @SpeakeasyMetadata() - @Expose({ name: "listable" }) + imageUrl: string | null; listable: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "long_description" }) longDescription: string; - - @SpeakeasyMetadata() - @Expose({ name: "manually_grantable" }) manuallyGrantable: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "multiple_grant" }) multipleGrant: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "query" }) - query: string; - - @SpeakeasyMetadata() - @Expose({ name: "show_posts" }) + query: string | null; showPosts: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "slug" }) slug: string; - - @SpeakeasyMetadata() - @Expose({ name: "system" }) system: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "target_posts" }) targetPosts: boolean; + trigger: string | null; +}; - @SpeakeasyMetadata() - @Expose({ name: "trigger" }) - trigger: string; -} - -export class UpdateBadgeBadgeTypes extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "id" }) +export type UpdateBadgeBadgeTypes = { id: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "sort_order" }) sortOrder: number; -} +}; /** * success response */ -export class UpdateBadgeResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "badge" }) - @Type(() => UpdateBadgeBadge) +export type UpdateBadgeResponseBody = { badge: UpdateBadgeBadge; + badgeTypes: Array; +}; - @SpeakeasyMetadata({ elemType: UpdateBadgeBadgeTypes }) - @Expose({ name: "badge_types" }) - @Type(() => UpdateBadgeBadgeTypes) - badgeTypes: UpdateBadgeBadgeTypes[]; +/** @internal */ +export const UpdateBadgeRequestBody$inboundSchema: z.ZodType< + UpdateBadgeRequestBody, + z.ZodTypeDef, + unknown +> = z + .object({ + badge_type_id: z.number().int(), + name: z.string(), + }) + .transform((v) => { + return remap$(v, { + badge_type_id: "badgeTypeId", + }); + }); + +/** @internal */ +export type UpdateBadgeRequestBody$Outbound = { + badge_type_id: number; + name: string; +}; + +/** @internal */ +export const UpdateBadgeRequestBody$outboundSchema: z.ZodType< + UpdateBadgeRequestBody$Outbound, + z.ZodTypeDef, + UpdateBadgeRequestBody +> = z + .object({ + badgeTypeId: z.number().int(), + name: z.string(), + }) + .transform((v) => { + return remap$(v, { + badgeTypeId: "badge_type_id", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateBadgeRequestBody$ { + /** @deprecated use `UpdateBadgeRequestBody$inboundSchema` instead. */ + export const inboundSchema = UpdateBadgeRequestBody$inboundSchema; + /** @deprecated use `UpdateBadgeRequestBody$outboundSchema` instead. */ + export const outboundSchema = UpdateBadgeRequestBody$outboundSchema; + /** @deprecated use `UpdateBadgeRequestBody$Outbound` instead. */ + export type Outbound = UpdateBadgeRequestBody$Outbound; } -export class UpdateBadgeResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const UpdateBadgeRequest$inboundSchema: z.ZodType< + UpdateBadgeRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + RequestBody: z.lazy(() => UpdateBadgeRequestBody$inboundSchema).optional(), + id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + RequestBody: "requestBody", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type UpdateBadgeRequest$Outbound = { + RequestBody?: UpdateBadgeRequestBody$Outbound | undefined; + id: number; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const UpdateBadgeRequest$outboundSchema: z.ZodType< + UpdateBadgeRequest$Outbound, + z.ZodTypeDef, + UpdateBadgeRequest +> = z + .object({ + requestBody: z.lazy(() => UpdateBadgeRequestBody$outboundSchema).optional(), + id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + requestBody: "RequestBody", + }); + }); - /** - * success response - */ - @SpeakeasyMetadata() - object?: UpdateBadgeResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateBadgeRequest$ { + /** @deprecated use `UpdateBadgeRequest$inboundSchema` instead. */ + export const inboundSchema = UpdateBadgeRequest$inboundSchema; + /** @deprecated use `UpdateBadgeRequest$outboundSchema` instead. */ + export const outboundSchema = UpdateBadgeRequest$outboundSchema; + /** @deprecated use `UpdateBadgeRequest$Outbound` instead. */ + export type Outbound = UpdateBadgeRequest$Outbound; +} + +/** @internal */ +export const UpdateBadgeBadge$inboundSchema: z.ZodType = z + .object({ + allow_title: z.boolean(), + auto_revoke: z.boolean(), + badge_grouping_id: z.number().int(), + badge_type_id: z.number().int(), + description: z.string(), + enabled: z.boolean(), + grant_count: z.number().int(), + icon: z.string(), + id: z.number().int(), + image_url: z.nullable(z.string()), + listable: z.boolean(), + long_description: z.string(), + manually_grantable: z.boolean(), + multiple_grant: z.boolean(), + name: z.string(), + query: z.nullable(z.string()), + show_posts: z.boolean(), + slug: z.string(), + system: z.boolean(), + target_posts: z.boolean(), + trigger: z.nullable(z.string()), + }) + .transform((v) => { + return remap$(v, { + allow_title: "allowTitle", + auto_revoke: "autoRevoke", + badge_grouping_id: "badgeGroupingId", + badge_type_id: "badgeTypeId", + grant_count: "grantCount", + image_url: "imageUrl", + long_description: "longDescription", + manually_grantable: "manuallyGrantable", + multiple_grant: "multipleGrant", + show_posts: "showPosts", + target_posts: "targetPosts", + }); + }); + +/** @internal */ +export type UpdateBadgeBadge$Outbound = { + allow_title: boolean; + auto_revoke: boolean; + badge_grouping_id: number; + badge_type_id: number; + description: string; + enabled: boolean; + grant_count: number; + icon: string; + id: number; + image_url: string | null; + listable: boolean; + long_description: string; + manually_grantable: boolean; + multiple_grant: boolean; + name: string; + query: string | null; + show_posts: boolean; + slug: string; + system: boolean; + target_posts: boolean; + trigger: string | null; +}; + +/** @internal */ +export const UpdateBadgeBadge$outboundSchema: z.ZodType< + UpdateBadgeBadge$Outbound, + z.ZodTypeDef, + UpdateBadgeBadge +> = z + .object({ + allowTitle: z.boolean(), + autoRevoke: z.boolean(), + badgeGroupingId: z.number().int(), + badgeTypeId: z.number().int(), + description: z.string(), + enabled: z.boolean(), + grantCount: z.number().int(), + icon: z.string(), + id: z.number().int(), + imageUrl: z.nullable(z.string()), + listable: z.boolean(), + longDescription: z.string(), + manuallyGrantable: z.boolean(), + multipleGrant: z.boolean(), + name: z.string(), + query: z.nullable(z.string()), + showPosts: z.boolean(), + slug: z.string(), + system: z.boolean(), + targetPosts: z.boolean(), + trigger: z.nullable(z.string()), + }) + .transform((v) => { + return remap$(v, { + allowTitle: "allow_title", + autoRevoke: "auto_revoke", + badgeGroupingId: "badge_grouping_id", + badgeTypeId: "badge_type_id", + grantCount: "grant_count", + imageUrl: "image_url", + longDescription: "long_description", + manuallyGrantable: "manually_grantable", + multipleGrant: "multiple_grant", + showPosts: "show_posts", + targetPosts: "target_posts", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateBadgeBadge$ { + /** @deprecated use `UpdateBadgeBadge$inboundSchema` instead. */ + export const inboundSchema = UpdateBadgeBadge$inboundSchema; + /** @deprecated use `UpdateBadgeBadge$outboundSchema` instead. */ + export const outboundSchema = UpdateBadgeBadge$outboundSchema; + /** @deprecated use `UpdateBadgeBadge$Outbound` instead. */ + export type Outbound = UpdateBadgeBadge$Outbound; +} + +/** @internal */ +export const UpdateBadgeBadgeTypes$inboundSchema: z.ZodType< + UpdateBadgeBadgeTypes, + z.ZodTypeDef, + unknown +> = z + .object({ + id: z.number().int(), + name: z.string(), + sort_order: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + sort_order: "sortOrder", + }); + }); + +/** @internal */ +export type UpdateBadgeBadgeTypes$Outbound = { + id: number; + name: string; + sort_order: number; +}; + +/** @internal */ +export const UpdateBadgeBadgeTypes$outboundSchema: z.ZodType< + UpdateBadgeBadgeTypes$Outbound, + z.ZodTypeDef, + UpdateBadgeBadgeTypes +> = z + .object({ + id: z.number().int(), + name: z.string(), + sortOrder: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + sortOrder: "sort_order", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateBadgeBadgeTypes$ { + /** @deprecated use `UpdateBadgeBadgeTypes$inboundSchema` instead. */ + export const inboundSchema = UpdateBadgeBadgeTypes$inboundSchema; + /** @deprecated use `UpdateBadgeBadgeTypes$outboundSchema` instead. */ + export const outboundSchema = UpdateBadgeBadgeTypes$outboundSchema; + /** @deprecated use `UpdateBadgeBadgeTypes$Outbound` instead. */ + export type Outbound = UpdateBadgeBadgeTypes$Outbound; +} + +/** @internal */ +export const UpdateBadgeResponseBody$inboundSchema: z.ZodType< + UpdateBadgeResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + badge: z.lazy(() => UpdateBadgeBadge$inboundSchema), + badge_types: z.array(z.lazy(() => UpdateBadgeBadgeTypes$inboundSchema)), + }) + .transform((v) => { + return remap$(v, { + badge_types: "badgeTypes", + }); + }); + +/** @internal */ +export type UpdateBadgeResponseBody$Outbound = { + badge: UpdateBadgeBadge$Outbound; + badge_types: Array; +}; + +/** @internal */ +export const UpdateBadgeResponseBody$outboundSchema: z.ZodType< + UpdateBadgeResponseBody$Outbound, + z.ZodTypeDef, + UpdateBadgeResponseBody +> = z + .object({ + badge: z.lazy(() => UpdateBadgeBadge$outboundSchema), + badgeTypes: z.array(z.lazy(() => UpdateBadgeBadgeTypes$outboundSchema)), + }) + .transform((v) => { + return remap$(v, { + badgeTypes: "badge_types", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateBadgeResponseBody$ { + /** @deprecated use `UpdateBadgeResponseBody$inboundSchema` instead. */ + export const inboundSchema = UpdateBadgeResponseBody$inboundSchema; + /** @deprecated use `UpdateBadgeResponseBody$outboundSchema` instead. */ + export const outboundSchema = UpdateBadgeResponseBody$outboundSchema; + /** @deprecated use `UpdateBadgeResponseBody$Outbound` instead. */ + export type Outbound = UpdateBadgeResponseBody$Outbound; } diff --git a/src/sdk/models/operations/updatecategory.ts b/src/sdk/models/operations/updatecategory.ts index 7774eb0..dd71810 100644 --- a/src/sdk/models/operations/updatecategory.ts +++ b/src/sdk/models/operations/updatecategory.ts @@ -1,340 +1,772 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import { collectExtraKeys as collectExtraKeys$ } from "../../../lib/schemas.js"; +import * as z from "zod"; -export class UpdateCategoryRequestBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "allow_badges" }) - allowBadges?: boolean; +export type UpdateCategoryPermissions = { + everyone?: number | undefined; + staff?: number | undefined; + additionalProperties: { [k: string]: any }; +}; - @SpeakeasyMetadata() - @Expose({ name: "color" }) - color?: string; - - @SpeakeasyMetadata() - @Expose({ name: "form_template_ids" }) - formTemplateIds?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) +export type UpdateCategoryRequestBody = { + allowBadges?: boolean | undefined; + color?: string | undefined; + formTemplateIds?: Array | undefined; name: string; + parentCategoryId?: number | undefined; + permissions?: UpdateCategoryPermissions | undefined; + searchPriority?: number | undefined; + slug?: string | undefined; + textColor?: string | undefined; + topicFeaturedLinksAllowed?: boolean | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "parent_category_id" }) - parentCategoryId?: number; - - @SpeakeasyMetadata() - @Expose({ name: "permissions" }) - permissions?: Record; - - @SpeakeasyMetadata() - @Expose({ name: "search_priority" }) - searchPriority?: number; - - @SpeakeasyMetadata() - @Expose({ name: "slug" }) - slug?: string; - - @SpeakeasyMetadata() - @Expose({ name: "text_color" }) - textColor?: string; - - @SpeakeasyMetadata() - @Expose({ name: "topic_featured_links_allowed" }) - topicFeaturedLinksAllowed?: boolean; -} - -export class UpdateCategoryRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) +export type UpdateCategoryRequest = { + requestBody?: UpdateCategoryRequestBody | undefined; id: number; +}; - @SpeakeasyMetadata({ data: "request, media_type=application/json" }) - requestBody?: UpdateCategoryRequestBody; -} +export type UpdateCategoryCustomFields = {}; -export class UpdateCategoryCustomFields extends SpeakeasyBase {} - -export class UpdateCategoryGroupPermissions extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "group_name" }) +export type UpdateCategoryGroupPermissions = { groupName: string; - - @SpeakeasyMetadata() - @Expose({ name: "permission_type" }) permissionType: number; -} +}; -export class UpdateCategoryRequiredTagGroups extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "min_count" }) +export type UpdateCategoryRequiredTagGroups = { minCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; -} +}; -export class UpdateCategoryCategory extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "all_topics_wiki" }) +export type UpdateCategoryCategory = { allTopicsWiki: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "allow_badges" }) allowBadges: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "allow_global_tags" }) - allowGlobalTags?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "allow_unlimited_owner_edits_on_first_post" }) + allowGlobalTags?: boolean | undefined; allowUnlimitedOwnerEditsOnFirstPost: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "allowed_tag_groups" }) - allowedTagGroups?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "allowed_tags" }) - allowedTags?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "auto_close_based_on_last_post" }) + allowedTagGroups?: Array | undefined; + allowedTags?: Array | undefined; autoCloseBasedOnLastPost: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "auto_close_hours" }) - autoCloseHours: string; - - @SpeakeasyMetadata() - @Expose({ name: "available_groups" }) - availableGroups: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "can_delete" }) + autoCloseHours: string | null; + availableGroups: Array; canDelete: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_edit" }) canEdit: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "category_setting" }) - categorySetting?: any; - - @SpeakeasyMetadata() - @Expose({ name: "color" }) + categorySetting?: any | undefined; color: string; - - @SpeakeasyMetadata() - @Expose({ name: "custom_fields" }) - @Type(() => UpdateCategoryCustomFields) customFields: UpdateCategoryCustomFields; - - @SpeakeasyMetadata() - @Expose({ name: "default_list_filter" }) defaultListFilter: string; - - @SpeakeasyMetadata() - @Expose({ name: "default_slow_mode_seconds" }) - defaultSlowModeSeconds: string; - - @SpeakeasyMetadata() - @Expose({ name: "default_top_period" }) + defaultSlowModeSeconds: string | null; defaultTopPeriod: string; - - @SpeakeasyMetadata() - @Expose({ name: "default_view" }) - defaultView: string; - - @SpeakeasyMetadata() - @Expose({ name: "description" }) - description: string; - - @SpeakeasyMetadata() - @Expose({ name: "description_excerpt" }) - descriptionExcerpt: string; - - @SpeakeasyMetadata() - @Expose({ name: "description_text" }) - descriptionText: string; - - @SpeakeasyMetadata() - @Expose({ name: "email_in" }) - emailIn: string; - - @SpeakeasyMetadata() - @Expose({ name: "email_in_allow_strangers" }) + defaultView: string | null; + description: string | null; + descriptionExcerpt: string | null; + descriptionText: string | null; + emailIn: string | null; emailInAllowStrangers: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "form_template_ids" }) - formTemplateIds: any[]; - - @SpeakeasyMetadata({ elemType: UpdateCategoryGroupPermissions }) - @Expose({ name: "group_permissions" }) - @Type(() => UpdateCategoryGroupPermissions) - groupPermissions: UpdateCategoryGroupPermissions[]; - - @SpeakeasyMetadata() - @Expose({ name: "has_children" }) - hasChildren: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) + formTemplateIds: Array; + groupPermissions: Array; + hasChildren: boolean | null; id: number; - - @SpeakeasyMetadata() - @Expose({ name: "mailinglist_mirror" }) mailinglistMirror: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "minimum_required_tags" }) minimumRequiredTags: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) name: string; - - @SpeakeasyMetadata() - @Expose({ name: "navigate_to_first_post_after_read" }) navigateToFirstPostAfterRead: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "notification_level" }) notificationLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "num_featured_topics" }) numFeaturedTopics: number; - - @SpeakeasyMetadata() - @Expose({ name: "permission" }) - permission: number; - - @SpeakeasyMetadata() - @Expose({ name: "position" }) + permission: number | null; position: number; - - @SpeakeasyMetadata() - @Expose({ name: "post_count" }) postCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "read_only_banner" }) - readOnlyBanner: string; - - @SpeakeasyMetadata() - @Expose({ name: "read_restricted" }) + readOnlyBanner: string | null; readRestricted: boolean; - - @SpeakeasyMetadata({ elemType: UpdateCategoryRequiredTagGroups }) - @Expose({ name: "required_tag_groups" }) - @Type(() => UpdateCategoryRequiredTagGroups) - requiredTagGroups: UpdateCategoryRequiredTagGroups[]; - - @SpeakeasyMetadata() - @Expose({ name: "search_priority" }) + requiredTagGroups: Array; searchPriority: number; - - @SpeakeasyMetadata() - @Expose({ name: "show_subcategory_list" }) showSubcategoryList: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "slug" }) slug: string; - - @SpeakeasyMetadata() - @Expose({ name: "sort_ascending" }) - sortAscending: string; - - @SpeakeasyMetadata() - @Expose({ name: "sort_order" }) - sortOrder: string; - - @SpeakeasyMetadata() - @Expose({ name: "subcategory_list_style" }) + sortAscending: string | null; + sortOrder: string | null; subcategoryListStyle: string; - - @SpeakeasyMetadata() - @Expose({ name: "text_color" }) textColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "topic_count" }) topicCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "topic_featured_link_allowed" }) topicFeaturedLinkAllowed: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "topic_template" }) - topicTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "topic_url" }) - topicUrl: string; - - @SpeakeasyMetadata() - @Expose({ name: "uploaded_background" }) - uploadedBackground: string; - - @SpeakeasyMetadata() - @Expose({ name: "uploaded_background_dark" }) - uploadedBackgroundDark: string; - - @SpeakeasyMetadata() - @Expose({ name: "uploaded_logo" }) - uploadedLogo: string; - - @SpeakeasyMetadata() - @Expose({ name: "uploaded_logo_dark" }) - uploadedLogoDark: string; -} + topicTemplate: string | null; + topicUrl: string | null; + uploadedBackground: string | null; + uploadedBackgroundDark: string | null; + uploadedLogo: string | null; + uploadedLogoDark: string | null; +}; /** * success response */ -export class UpdateCategoryResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "category" }) - @Type(() => UpdateCategoryCategory) +export type UpdateCategoryResponseBody = { category: UpdateCategoryCategory; - - @SpeakeasyMetadata() - @Expose({ name: "success" }) success: string; +}; + +/** @internal */ +export const UpdateCategoryPermissions$inboundSchema: z.ZodType< + UpdateCategoryPermissions, + z.ZodTypeDef, + unknown +> = collectExtraKeys$( + z + .object({ + everyone: z.number().int().optional(), + staff: z.number().int().optional(), + }) + .catchall(z.any()), + "additionalProperties" +); + +/** @internal */ +export type UpdateCategoryPermissions$Outbound = { + everyone?: number | undefined; + staff?: number | undefined; + [additionalProperties: string]: unknown; +}; + +/** @internal */ +export const UpdateCategoryPermissions$outboundSchema: z.ZodType< + UpdateCategoryPermissions$Outbound, + z.ZodTypeDef, + UpdateCategoryPermissions +> = z + .object({ + additionalProperties: z.record(z.any()), + + everyone: z.number().int().optional(), + staff: z.number().int().optional(), + }) + .transform((v) => { + return { + ...v.additionalProperties, + ...remap$(v, { + additionalProperties: null, + }), + }; + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateCategoryPermissions$ { + /** @deprecated use `UpdateCategoryPermissions$inboundSchema` instead. */ + export const inboundSchema = UpdateCategoryPermissions$inboundSchema; + /** @deprecated use `UpdateCategoryPermissions$outboundSchema` instead. */ + export const outboundSchema = UpdateCategoryPermissions$outboundSchema; + /** @deprecated use `UpdateCategoryPermissions$Outbound` instead. */ + export type Outbound = UpdateCategoryPermissions$Outbound; } -export class UpdateCategoryResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const UpdateCategoryRequestBody$inboundSchema: z.ZodType< + UpdateCategoryRequestBody, + z.ZodTypeDef, + unknown +> = z + .object({ + allow_badges: z.boolean().optional(), + color: z.string().optional(), + form_template_ids: z.array(z.any()).optional(), + name: z.string(), + parent_category_id: z.number().int().optional(), + permissions: z.lazy(() => UpdateCategoryPermissions$inboundSchema).optional(), + search_priority: z.number().int().optional(), + slug: z.string().optional(), + text_color: z.string().optional(), + topic_featured_links_allowed: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + allow_badges: "allowBadges", + form_template_ids: "formTemplateIds", + parent_category_id: "parentCategoryId", + search_priority: "searchPriority", + text_color: "textColor", + topic_featured_links_allowed: "topicFeaturedLinksAllowed", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type UpdateCategoryRequestBody$Outbound = { + allow_badges?: boolean | undefined; + color?: string | undefined; + form_template_ids?: Array | undefined; + name: string; + parent_category_id?: number | undefined; + permissions?: UpdateCategoryPermissions$Outbound | undefined; + search_priority?: number | undefined; + slug?: string | undefined; + text_color?: string | undefined; + topic_featured_links_allowed?: boolean | undefined; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const UpdateCategoryRequestBody$outboundSchema: z.ZodType< + UpdateCategoryRequestBody$Outbound, + z.ZodTypeDef, + UpdateCategoryRequestBody +> = z + .object({ + allowBadges: z.boolean().optional(), + color: z.string().optional(), + formTemplateIds: z.array(z.any()).optional(), + name: z.string(), + parentCategoryId: z.number().int().optional(), + permissions: z.lazy(() => UpdateCategoryPermissions$outboundSchema).optional(), + searchPriority: z.number().int().optional(), + slug: z.string().optional(), + textColor: z.string().optional(), + topicFeaturedLinksAllowed: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + allowBadges: "allow_badges", + formTemplateIds: "form_template_ids", + parentCategoryId: "parent_category_id", + searchPriority: "search_priority", + textColor: "text_color", + topicFeaturedLinksAllowed: "topic_featured_links_allowed", + }); + }); - /** - * success response - */ - @SpeakeasyMetadata() - object?: UpdateCategoryResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateCategoryRequestBody$ { + /** @deprecated use `UpdateCategoryRequestBody$inboundSchema` instead. */ + export const inboundSchema = UpdateCategoryRequestBody$inboundSchema; + /** @deprecated use `UpdateCategoryRequestBody$outboundSchema` instead. */ + export const outboundSchema = UpdateCategoryRequestBody$outboundSchema; + /** @deprecated use `UpdateCategoryRequestBody$Outbound` instead. */ + export type Outbound = UpdateCategoryRequestBody$Outbound; +} + +/** @internal */ +export const UpdateCategoryRequest$inboundSchema: z.ZodType< + UpdateCategoryRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + RequestBody: z.lazy(() => UpdateCategoryRequestBody$inboundSchema).optional(), + id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + RequestBody: "requestBody", + }); + }); + +/** @internal */ +export type UpdateCategoryRequest$Outbound = { + RequestBody?: UpdateCategoryRequestBody$Outbound | undefined; + id: number; +}; + +/** @internal */ +export const UpdateCategoryRequest$outboundSchema: z.ZodType< + UpdateCategoryRequest$Outbound, + z.ZodTypeDef, + UpdateCategoryRequest +> = z + .object({ + requestBody: z.lazy(() => UpdateCategoryRequestBody$outboundSchema).optional(), + id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + requestBody: "RequestBody", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateCategoryRequest$ { + /** @deprecated use `UpdateCategoryRequest$inboundSchema` instead. */ + export const inboundSchema = UpdateCategoryRequest$inboundSchema; + /** @deprecated use `UpdateCategoryRequest$outboundSchema` instead. */ + export const outboundSchema = UpdateCategoryRequest$outboundSchema; + /** @deprecated use `UpdateCategoryRequest$Outbound` instead. */ + export type Outbound = UpdateCategoryRequest$Outbound; +} + +/** @internal */ +export const UpdateCategoryCustomFields$inboundSchema: z.ZodType< + UpdateCategoryCustomFields, + z.ZodTypeDef, + unknown +> = z.object({}); + +/** @internal */ +export type UpdateCategoryCustomFields$Outbound = {}; + +/** @internal */ +export const UpdateCategoryCustomFields$outboundSchema: z.ZodType< + UpdateCategoryCustomFields$Outbound, + z.ZodTypeDef, + UpdateCategoryCustomFields +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateCategoryCustomFields$ { + /** @deprecated use `UpdateCategoryCustomFields$inboundSchema` instead. */ + export const inboundSchema = UpdateCategoryCustomFields$inboundSchema; + /** @deprecated use `UpdateCategoryCustomFields$outboundSchema` instead. */ + export const outboundSchema = UpdateCategoryCustomFields$outboundSchema; + /** @deprecated use `UpdateCategoryCustomFields$Outbound` instead. */ + export type Outbound = UpdateCategoryCustomFields$Outbound; +} + +/** @internal */ +export const UpdateCategoryGroupPermissions$inboundSchema: z.ZodType< + UpdateCategoryGroupPermissions, + z.ZodTypeDef, + unknown +> = z + .object({ + group_name: z.string(), + permission_type: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + group_name: "groupName", + permission_type: "permissionType", + }); + }); + +/** @internal */ +export type UpdateCategoryGroupPermissions$Outbound = { + group_name: string; + permission_type: number; +}; + +/** @internal */ +export const UpdateCategoryGroupPermissions$outboundSchema: z.ZodType< + UpdateCategoryGroupPermissions$Outbound, + z.ZodTypeDef, + UpdateCategoryGroupPermissions +> = z + .object({ + groupName: z.string(), + permissionType: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + groupName: "group_name", + permissionType: "permission_type", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateCategoryGroupPermissions$ { + /** @deprecated use `UpdateCategoryGroupPermissions$inboundSchema` instead. */ + export const inboundSchema = UpdateCategoryGroupPermissions$inboundSchema; + /** @deprecated use `UpdateCategoryGroupPermissions$outboundSchema` instead. */ + export const outboundSchema = UpdateCategoryGroupPermissions$outboundSchema; + /** @deprecated use `UpdateCategoryGroupPermissions$Outbound` instead. */ + export type Outbound = UpdateCategoryGroupPermissions$Outbound; +} + +/** @internal */ +export const UpdateCategoryRequiredTagGroups$inboundSchema: z.ZodType< + UpdateCategoryRequiredTagGroups, + z.ZodTypeDef, + unknown +> = z + .object({ + min_count: z.number().int(), + name: z.string(), + }) + .transform((v) => { + return remap$(v, { + min_count: "minCount", + }); + }); + +/** @internal */ +export type UpdateCategoryRequiredTagGroups$Outbound = { + min_count: number; + name: string; +}; + +/** @internal */ +export const UpdateCategoryRequiredTagGroups$outboundSchema: z.ZodType< + UpdateCategoryRequiredTagGroups$Outbound, + z.ZodTypeDef, + UpdateCategoryRequiredTagGroups +> = z + .object({ + minCount: z.number().int(), + name: z.string(), + }) + .transform((v) => { + return remap$(v, { + minCount: "min_count", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateCategoryRequiredTagGroups$ { + /** @deprecated use `UpdateCategoryRequiredTagGroups$inboundSchema` instead. */ + export const inboundSchema = UpdateCategoryRequiredTagGroups$inboundSchema; + /** @deprecated use `UpdateCategoryRequiredTagGroups$outboundSchema` instead. */ + export const outboundSchema = UpdateCategoryRequiredTagGroups$outboundSchema; + /** @deprecated use `UpdateCategoryRequiredTagGroups$Outbound` instead. */ + export type Outbound = UpdateCategoryRequiredTagGroups$Outbound; +} + +/** @internal */ +export const UpdateCategoryCategory$inboundSchema: z.ZodType< + UpdateCategoryCategory, + z.ZodTypeDef, + unknown +> = z + .object({ + all_topics_wiki: z.boolean(), + allow_badges: z.boolean(), + allow_global_tags: z.boolean().optional(), + allow_unlimited_owner_edits_on_first_post: z.boolean(), + allowed_tag_groups: z.array(z.any()).optional(), + allowed_tags: z.array(z.any()).optional(), + auto_close_based_on_last_post: z.boolean(), + auto_close_hours: z.nullable(z.string()), + available_groups: z.array(z.any()), + can_delete: z.boolean(), + can_edit: z.boolean(), + category_setting: z.any().optional(), + color: z.string(), + custom_fields: z.lazy(() => UpdateCategoryCustomFields$inboundSchema), + default_list_filter: z.string(), + default_slow_mode_seconds: z.nullable(z.string()), + default_top_period: z.string(), + default_view: z.nullable(z.string()), + description: z.nullable(z.string()), + description_excerpt: z.nullable(z.string()), + description_text: z.nullable(z.string()), + email_in: z.nullable(z.string()), + email_in_allow_strangers: z.boolean(), + form_template_ids: z.array(z.any()), + group_permissions: z.array(z.lazy(() => UpdateCategoryGroupPermissions$inboundSchema)), + has_children: z.nullable(z.boolean()), + id: z.number().int(), + mailinglist_mirror: z.boolean(), + minimum_required_tags: z.number().int(), + name: z.string(), + navigate_to_first_post_after_read: z.boolean(), + notification_level: z.number().int(), + num_featured_topics: z.number().int(), + permission: z.nullable(z.number().int()), + position: z.number().int(), + post_count: z.number().int(), + read_only_banner: z.nullable(z.string()), + read_restricted: z.boolean(), + required_tag_groups: z.array(z.lazy(() => UpdateCategoryRequiredTagGroups$inboundSchema)), + search_priority: z.number().int(), + show_subcategory_list: z.boolean(), + slug: z.string(), + sort_ascending: z.nullable(z.string()), + sort_order: z.nullable(z.string()), + subcategory_list_style: z.string(), + text_color: z.string(), + topic_count: z.number().int(), + topic_featured_link_allowed: z.boolean(), + topic_template: z.nullable(z.string()), + topic_url: z.nullable(z.string()), + uploaded_background: z.nullable(z.string()), + uploaded_background_dark: z.nullable(z.string()), + uploaded_logo: z.nullable(z.string()), + uploaded_logo_dark: z.nullable(z.string()), + }) + .transform((v) => { + return remap$(v, { + all_topics_wiki: "allTopicsWiki", + allow_badges: "allowBadges", + allow_global_tags: "allowGlobalTags", + allow_unlimited_owner_edits_on_first_post: "allowUnlimitedOwnerEditsOnFirstPost", + allowed_tag_groups: "allowedTagGroups", + allowed_tags: "allowedTags", + auto_close_based_on_last_post: "autoCloseBasedOnLastPost", + auto_close_hours: "autoCloseHours", + available_groups: "availableGroups", + can_delete: "canDelete", + can_edit: "canEdit", + category_setting: "categorySetting", + custom_fields: "customFields", + default_list_filter: "defaultListFilter", + default_slow_mode_seconds: "defaultSlowModeSeconds", + default_top_period: "defaultTopPeriod", + default_view: "defaultView", + description_excerpt: "descriptionExcerpt", + description_text: "descriptionText", + email_in: "emailIn", + email_in_allow_strangers: "emailInAllowStrangers", + form_template_ids: "formTemplateIds", + group_permissions: "groupPermissions", + has_children: "hasChildren", + mailinglist_mirror: "mailinglistMirror", + minimum_required_tags: "minimumRequiredTags", + navigate_to_first_post_after_read: "navigateToFirstPostAfterRead", + notification_level: "notificationLevel", + num_featured_topics: "numFeaturedTopics", + post_count: "postCount", + read_only_banner: "readOnlyBanner", + read_restricted: "readRestricted", + required_tag_groups: "requiredTagGroups", + search_priority: "searchPriority", + show_subcategory_list: "showSubcategoryList", + sort_ascending: "sortAscending", + sort_order: "sortOrder", + subcategory_list_style: "subcategoryListStyle", + text_color: "textColor", + topic_count: "topicCount", + topic_featured_link_allowed: "topicFeaturedLinkAllowed", + topic_template: "topicTemplate", + topic_url: "topicUrl", + uploaded_background: "uploadedBackground", + uploaded_background_dark: "uploadedBackgroundDark", + uploaded_logo: "uploadedLogo", + uploaded_logo_dark: "uploadedLogoDark", + }); + }); + +/** @internal */ +export type UpdateCategoryCategory$Outbound = { + all_topics_wiki: boolean; + allow_badges: boolean; + allow_global_tags?: boolean | undefined; + allow_unlimited_owner_edits_on_first_post: boolean; + allowed_tag_groups?: Array | undefined; + allowed_tags?: Array | undefined; + auto_close_based_on_last_post: boolean; + auto_close_hours: string | null; + available_groups: Array; + can_delete: boolean; + can_edit: boolean; + category_setting?: any | undefined; + color: string; + custom_fields: UpdateCategoryCustomFields$Outbound; + default_list_filter: string; + default_slow_mode_seconds: string | null; + default_top_period: string; + default_view: string | null; + description: string | null; + description_excerpt: string | null; + description_text: string | null; + email_in: string | null; + email_in_allow_strangers: boolean; + form_template_ids: Array; + group_permissions: Array; + has_children: boolean | null; + id: number; + mailinglist_mirror: boolean; + minimum_required_tags: number; + name: string; + navigate_to_first_post_after_read: boolean; + notification_level: number; + num_featured_topics: number; + permission: number | null; + position: number; + post_count: number; + read_only_banner: string | null; + read_restricted: boolean; + required_tag_groups: Array; + search_priority: number; + show_subcategory_list: boolean; + slug: string; + sort_ascending: string | null; + sort_order: string | null; + subcategory_list_style: string; + text_color: string; + topic_count: number; + topic_featured_link_allowed: boolean; + topic_template: string | null; + topic_url: string | null; + uploaded_background: string | null; + uploaded_background_dark: string | null; + uploaded_logo: string | null; + uploaded_logo_dark: string | null; +}; + +/** @internal */ +export const UpdateCategoryCategory$outboundSchema: z.ZodType< + UpdateCategoryCategory$Outbound, + z.ZodTypeDef, + UpdateCategoryCategory +> = z + .object({ + allTopicsWiki: z.boolean(), + allowBadges: z.boolean(), + allowGlobalTags: z.boolean().optional(), + allowUnlimitedOwnerEditsOnFirstPost: z.boolean(), + allowedTagGroups: z.array(z.any()).optional(), + allowedTags: z.array(z.any()).optional(), + autoCloseBasedOnLastPost: z.boolean(), + autoCloseHours: z.nullable(z.string()), + availableGroups: z.array(z.any()), + canDelete: z.boolean(), + canEdit: z.boolean(), + categorySetting: z.any().optional(), + color: z.string(), + customFields: z.lazy(() => UpdateCategoryCustomFields$outboundSchema), + defaultListFilter: z.string(), + defaultSlowModeSeconds: z.nullable(z.string()), + defaultTopPeriod: z.string(), + defaultView: z.nullable(z.string()), + description: z.nullable(z.string()), + descriptionExcerpt: z.nullable(z.string()), + descriptionText: z.nullable(z.string()), + emailIn: z.nullable(z.string()), + emailInAllowStrangers: z.boolean(), + formTemplateIds: z.array(z.any()), + groupPermissions: z.array(z.lazy(() => UpdateCategoryGroupPermissions$outboundSchema)), + hasChildren: z.nullable(z.boolean()), + id: z.number().int(), + mailinglistMirror: z.boolean(), + minimumRequiredTags: z.number().int(), + name: z.string(), + navigateToFirstPostAfterRead: z.boolean(), + notificationLevel: z.number().int(), + numFeaturedTopics: z.number().int(), + permission: z.nullable(z.number().int()), + position: z.number().int(), + postCount: z.number().int(), + readOnlyBanner: z.nullable(z.string()), + readRestricted: z.boolean(), + requiredTagGroups: z.array(z.lazy(() => UpdateCategoryRequiredTagGroups$outboundSchema)), + searchPriority: z.number().int(), + showSubcategoryList: z.boolean(), + slug: z.string(), + sortAscending: z.nullable(z.string()), + sortOrder: z.nullable(z.string()), + subcategoryListStyle: z.string(), + textColor: z.string(), + topicCount: z.number().int(), + topicFeaturedLinkAllowed: z.boolean(), + topicTemplate: z.nullable(z.string()), + topicUrl: z.nullable(z.string()), + uploadedBackground: z.nullable(z.string()), + uploadedBackgroundDark: z.nullable(z.string()), + uploadedLogo: z.nullable(z.string()), + uploadedLogoDark: z.nullable(z.string()), + }) + .transform((v) => { + return remap$(v, { + allTopicsWiki: "all_topics_wiki", + allowBadges: "allow_badges", + allowGlobalTags: "allow_global_tags", + allowUnlimitedOwnerEditsOnFirstPost: "allow_unlimited_owner_edits_on_first_post", + allowedTagGroups: "allowed_tag_groups", + allowedTags: "allowed_tags", + autoCloseBasedOnLastPost: "auto_close_based_on_last_post", + autoCloseHours: "auto_close_hours", + availableGroups: "available_groups", + canDelete: "can_delete", + canEdit: "can_edit", + categorySetting: "category_setting", + customFields: "custom_fields", + defaultListFilter: "default_list_filter", + defaultSlowModeSeconds: "default_slow_mode_seconds", + defaultTopPeriod: "default_top_period", + defaultView: "default_view", + descriptionExcerpt: "description_excerpt", + descriptionText: "description_text", + emailIn: "email_in", + emailInAllowStrangers: "email_in_allow_strangers", + formTemplateIds: "form_template_ids", + groupPermissions: "group_permissions", + hasChildren: "has_children", + mailinglistMirror: "mailinglist_mirror", + minimumRequiredTags: "minimum_required_tags", + navigateToFirstPostAfterRead: "navigate_to_first_post_after_read", + notificationLevel: "notification_level", + numFeaturedTopics: "num_featured_topics", + postCount: "post_count", + readOnlyBanner: "read_only_banner", + readRestricted: "read_restricted", + requiredTagGroups: "required_tag_groups", + searchPriority: "search_priority", + showSubcategoryList: "show_subcategory_list", + sortAscending: "sort_ascending", + sortOrder: "sort_order", + subcategoryListStyle: "subcategory_list_style", + textColor: "text_color", + topicCount: "topic_count", + topicFeaturedLinkAllowed: "topic_featured_link_allowed", + topicTemplate: "topic_template", + topicUrl: "topic_url", + uploadedBackground: "uploaded_background", + uploadedBackgroundDark: "uploaded_background_dark", + uploadedLogo: "uploaded_logo", + uploadedLogoDark: "uploaded_logo_dark", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateCategoryCategory$ { + /** @deprecated use `UpdateCategoryCategory$inboundSchema` instead. */ + export const inboundSchema = UpdateCategoryCategory$inboundSchema; + /** @deprecated use `UpdateCategoryCategory$outboundSchema` instead. */ + export const outboundSchema = UpdateCategoryCategory$outboundSchema; + /** @deprecated use `UpdateCategoryCategory$Outbound` instead. */ + export type Outbound = UpdateCategoryCategory$Outbound; +} + +/** @internal */ +export const UpdateCategoryResponseBody$inboundSchema: z.ZodType< + UpdateCategoryResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + category: z.lazy(() => UpdateCategoryCategory$inboundSchema), + success: z.string(), +}); + +/** @internal */ +export type UpdateCategoryResponseBody$Outbound = { + category: UpdateCategoryCategory$Outbound; + success: string; +}; + +/** @internal */ +export const UpdateCategoryResponseBody$outboundSchema: z.ZodType< + UpdateCategoryResponseBody$Outbound, + z.ZodTypeDef, + UpdateCategoryResponseBody +> = z.object({ + category: z.lazy(() => UpdateCategoryCategory$outboundSchema), + success: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateCategoryResponseBody$ { + /** @deprecated use `UpdateCategoryResponseBody$inboundSchema` instead. */ + export const inboundSchema = UpdateCategoryResponseBody$inboundSchema; + /** @deprecated use `UpdateCategoryResponseBody$outboundSchema` instead. */ + export const outboundSchema = UpdateCategoryResponseBody$outboundSchema; + /** @deprecated use `UpdateCategoryResponseBody$Outbound` instead. */ + export type Outbound = UpdateCategoryResponseBody$Outbound; } diff --git a/src/sdk/models/operations/updateemail.ts b/src/sdk/models/operations/updateemail.ts index 28e8202..72f5faf 100644 --- a/src/sdk/models/operations/updateemail.ts +++ b/src/sdk/models/operations/updateemail.ts @@ -1,41 +1,102 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class UpdateEmailRequestBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "email" }) +export type UpdateEmailRequestBody = { email: string; -} +}; -export class UpdateEmailRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=username" }) +export type UpdateEmailRequest = { + requestBody?: UpdateEmailRequestBody | undefined; username: string; +}; - @SpeakeasyMetadata({ data: "request, media_type=application/json" }) - requestBody?: UpdateEmailRequestBody; +/** @internal */ +export const UpdateEmailRequestBody$inboundSchema: z.ZodType< + UpdateEmailRequestBody, + z.ZodTypeDef, + unknown +> = z.object({ + email: z.string(), +}); + +/** @internal */ +export type UpdateEmailRequestBody$Outbound = { + email: string; +}; + +/** @internal */ +export const UpdateEmailRequestBody$outboundSchema: z.ZodType< + UpdateEmailRequestBody$Outbound, + z.ZodTypeDef, + UpdateEmailRequestBody +> = z.object({ + email: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateEmailRequestBody$ { + /** @deprecated use `UpdateEmailRequestBody$inboundSchema` instead. */ + export const inboundSchema = UpdateEmailRequestBody$inboundSchema; + /** @deprecated use `UpdateEmailRequestBody$outboundSchema` instead. */ + export const outboundSchema = UpdateEmailRequestBody$outboundSchema; + /** @deprecated use `UpdateEmailRequestBody$Outbound` instead. */ + export type Outbound = UpdateEmailRequestBody$Outbound; } -export class UpdateEmailResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const UpdateEmailRequest$inboundSchema: z.ZodType< + UpdateEmailRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + RequestBody: z.lazy(() => UpdateEmailRequestBody$inboundSchema).optional(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + RequestBody: "requestBody", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type UpdateEmailRequest$Outbound = { + RequestBody?: UpdateEmailRequestBody$Outbound | undefined; + username: string; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const UpdateEmailRequest$outboundSchema: z.ZodType< + UpdateEmailRequest$Outbound, + z.ZodTypeDef, + UpdateEmailRequest +> = z + .object({ + requestBody: z.lazy(() => UpdateEmailRequestBody$outboundSchema).optional(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + requestBody: "RequestBody", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateEmailRequest$ { + /** @deprecated use `UpdateEmailRequest$inboundSchema` instead. */ + export const inboundSchema = UpdateEmailRequest$inboundSchema; + /** @deprecated use `UpdateEmailRequest$outboundSchema` instead. */ + export const outboundSchema = UpdateEmailRequest$outboundSchema; + /** @deprecated use `UpdateEmailRequest$Outbound` instead. */ + export type Outbound = UpdateEmailRequest$Outbound; } diff --git a/src/sdk/models/operations/updategroup.ts b/src/sdk/models/operations/updategroup.ts index 234df19..0217c91 100644 --- a/src/sdk/models/operations/updategroup.ts +++ b/src/sdk/models/operations/updategroup.ts @@ -1,147 +1,309 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class UpdateGroupGroup extends SpeakeasyBase { +export type UpdateGroupGroup = { /** * pipe|separated */ - @SpeakeasyMetadata() - @Expose({ name: "automatic_membership_email_domains" }) - automaticMembershipEmailDomains?: string; - + automaticMembershipEmailDomains?: string | undefined; /** * About Group */ - @SpeakeasyMetadata() - @Expose({ name: "bio_raw" }) - bioRaw?: string; - - @SpeakeasyMetadata() - @Expose({ name: "default_notification_level" }) - defaultNotificationLevel?: number; - - @SpeakeasyMetadata() - @Expose({ name: "flair_bg_color" }) - flairBgColor?: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_icon" }) - flairIcon?: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_upload_id" }) - flairUploadId?: number; - - @SpeakeasyMetadata() - @Expose({ name: "full_name" }) - fullName?: string; - - @SpeakeasyMetadata() - @Expose({ name: "muted_category_ids" }) - mutedCategoryIds?: number[]; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) + bioRaw?: string | undefined; + defaultNotificationLevel?: number | undefined; + flairBgColor?: string | undefined; + flairIcon?: string | undefined; + flairUploadId?: number | undefined; + fullName?: string | undefined; + mutedCategoryIds?: Array | undefined; name: string; - /** * comma,separated */ - @SpeakeasyMetadata() - @Expose({ name: "owner_usernames" }) - ownerUsernames?: string; - - @SpeakeasyMetadata() - @Expose({ name: "primary_group" }) - primaryGroup?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "public_admission" }) - publicAdmission?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "public_exit" }) - publicExit?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "regular_category_ids" }) - regularCategoryIds?: number[]; - - @SpeakeasyMetadata() - @Expose({ name: "tracking_category_ids" }) - trackingCategoryIds?: number[]; - + ownerUsernames?: string | undefined; + primaryGroup?: boolean | undefined; + publicAdmission?: boolean | undefined; + publicExit?: boolean | undefined; + regularCategoryIds?: Array | undefined; + trackingCategoryIds?: Array | undefined; /** * comma,separated */ - @SpeakeasyMetadata() - @Expose({ name: "usernames" }) - usernames?: string; + usernames?: string | undefined; + visibilityLevel?: number | undefined; + watchingCategoryIds?: Array | undefined; + watchingFirstPostCategoryIds?: Array | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "visibility_level" }) - visibilityLevel?: number; - - @SpeakeasyMetadata() - @Expose({ name: "watching_category_ids" }) - watchingCategoryIds?: number[]; - - @SpeakeasyMetadata() - @Expose({ name: "watching_first_post_category_ids" }) - watchingFirstPostCategoryIds?: number[]; -} - -export class UpdateGroupRequestBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "group" }) - @Type(() => UpdateGroupGroup) +export type UpdateGroupRequestBody = { group: UpdateGroupGroup; -} +}; -export class UpdateGroupRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) +export type UpdateGroupRequest = { + requestBody?: UpdateGroupRequestBody | undefined; id: number; - - @SpeakeasyMetadata({ data: "request, media_type=application/json" }) - requestBody?: UpdateGroupRequestBody; -} +}; /** * success response */ -export class UpdateGroupResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "success" }) - success?: string; +export type UpdateGroupResponseBody = { + success?: string | undefined; +}; + +/** @internal */ +export const UpdateGroupGroup$inboundSchema: z.ZodType = z + .object({ + automatic_membership_email_domains: z.string().optional(), + bio_raw: z.string().optional(), + default_notification_level: z.number().int().optional(), + flair_bg_color: z.string().optional(), + flair_icon: z.string().optional(), + flair_upload_id: z.number().int().optional(), + full_name: z.string().optional(), + muted_category_ids: z.array(z.number().int()).optional(), + name: z.string(), + owner_usernames: z.string().optional(), + primary_group: z.boolean().optional(), + public_admission: z.boolean().optional(), + public_exit: z.boolean().optional(), + regular_category_ids: z.array(z.number().int()).optional(), + tracking_category_ids: z.array(z.number().int()).optional(), + usernames: z.string().optional(), + visibility_level: z.number().int().optional(), + watching_category_ids: z.array(z.number().int()).optional(), + watching_first_post_category_ids: z.array(z.number().int()).optional(), + }) + .transform((v) => { + return remap$(v, { + automatic_membership_email_domains: "automaticMembershipEmailDomains", + bio_raw: "bioRaw", + default_notification_level: "defaultNotificationLevel", + flair_bg_color: "flairBgColor", + flair_icon: "flairIcon", + flair_upload_id: "flairUploadId", + full_name: "fullName", + muted_category_ids: "mutedCategoryIds", + owner_usernames: "ownerUsernames", + primary_group: "primaryGroup", + public_admission: "publicAdmission", + public_exit: "publicExit", + regular_category_ids: "regularCategoryIds", + tracking_category_ids: "trackingCategoryIds", + visibility_level: "visibilityLevel", + watching_category_ids: "watchingCategoryIds", + watching_first_post_category_ids: "watchingFirstPostCategoryIds", + }); + }); + +/** @internal */ +export type UpdateGroupGroup$Outbound = { + automatic_membership_email_domains?: string | undefined; + bio_raw?: string | undefined; + default_notification_level?: number | undefined; + flair_bg_color?: string | undefined; + flair_icon?: string | undefined; + flair_upload_id?: number | undefined; + full_name?: string | undefined; + muted_category_ids?: Array | undefined; + name: string; + owner_usernames?: string | undefined; + primary_group?: boolean | undefined; + public_admission?: boolean | undefined; + public_exit?: boolean | undefined; + regular_category_ids?: Array | undefined; + tracking_category_ids?: Array | undefined; + usernames?: string | undefined; + visibility_level?: number | undefined; + watching_category_ids?: Array | undefined; + watching_first_post_category_ids?: Array | undefined; +}; + +/** @internal */ +export const UpdateGroupGroup$outboundSchema: z.ZodType< + UpdateGroupGroup$Outbound, + z.ZodTypeDef, + UpdateGroupGroup +> = z + .object({ + automaticMembershipEmailDomains: z.string().optional(), + bioRaw: z.string().optional(), + defaultNotificationLevel: z.number().int().optional(), + flairBgColor: z.string().optional(), + flairIcon: z.string().optional(), + flairUploadId: z.number().int().optional(), + fullName: z.string().optional(), + mutedCategoryIds: z.array(z.number().int()).optional(), + name: z.string(), + ownerUsernames: z.string().optional(), + primaryGroup: z.boolean().optional(), + publicAdmission: z.boolean().optional(), + publicExit: z.boolean().optional(), + regularCategoryIds: z.array(z.number().int()).optional(), + trackingCategoryIds: z.array(z.number().int()).optional(), + usernames: z.string().optional(), + visibilityLevel: z.number().int().optional(), + watchingCategoryIds: z.array(z.number().int()).optional(), + watchingFirstPostCategoryIds: z.array(z.number().int()).optional(), + }) + .transform((v) => { + return remap$(v, { + automaticMembershipEmailDomains: "automatic_membership_email_domains", + bioRaw: "bio_raw", + defaultNotificationLevel: "default_notification_level", + flairBgColor: "flair_bg_color", + flairIcon: "flair_icon", + flairUploadId: "flair_upload_id", + fullName: "full_name", + mutedCategoryIds: "muted_category_ids", + ownerUsernames: "owner_usernames", + primaryGroup: "primary_group", + publicAdmission: "public_admission", + publicExit: "public_exit", + regularCategoryIds: "regular_category_ids", + trackingCategoryIds: "tracking_category_ids", + visibilityLevel: "visibility_level", + watchingCategoryIds: "watching_category_ids", + watchingFirstPostCategoryIds: "watching_first_post_category_ids", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateGroupGroup$ { + /** @deprecated use `UpdateGroupGroup$inboundSchema` instead. */ + export const inboundSchema = UpdateGroupGroup$inboundSchema; + /** @deprecated use `UpdateGroupGroup$outboundSchema` instead. */ + export const outboundSchema = UpdateGroupGroup$outboundSchema; + /** @deprecated use `UpdateGroupGroup$Outbound` instead. */ + export type Outbound = UpdateGroupGroup$Outbound; } -export class UpdateGroupResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const UpdateGroupRequestBody$inboundSchema: z.ZodType< + UpdateGroupRequestBody, + z.ZodTypeDef, + unknown +> = z.object({ + group: z.lazy(() => UpdateGroupGroup$inboundSchema), +}); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type UpdateGroupRequestBody$Outbound = { + group: UpdateGroupGroup$Outbound; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const UpdateGroupRequestBody$outboundSchema: z.ZodType< + UpdateGroupRequestBody$Outbound, + z.ZodTypeDef, + UpdateGroupRequestBody +> = z.object({ + group: z.lazy(() => UpdateGroupGroup$outboundSchema), +}); - /** - * success response - */ - @SpeakeasyMetadata() - object?: UpdateGroupResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateGroupRequestBody$ { + /** @deprecated use `UpdateGroupRequestBody$inboundSchema` instead. */ + export const inboundSchema = UpdateGroupRequestBody$inboundSchema; + /** @deprecated use `UpdateGroupRequestBody$outboundSchema` instead. */ + export const outboundSchema = UpdateGroupRequestBody$outboundSchema; + /** @deprecated use `UpdateGroupRequestBody$Outbound` instead. */ + export type Outbound = UpdateGroupRequestBody$Outbound; +} + +/** @internal */ +export const UpdateGroupRequest$inboundSchema: z.ZodType< + UpdateGroupRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + RequestBody: z.lazy(() => UpdateGroupRequestBody$inboundSchema).optional(), + id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + RequestBody: "requestBody", + }); + }); + +/** @internal */ +export type UpdateGroupRequest$Outbound = { + RequestBody?: UpdateGroupRequestBody$Outbound | undefined; + id: number; +}; + +/** @internal */ +export const UpdateGroupRequest$outboundSchema: z.ZodType< + UpdateGroupRequest$Outbound, + z.ZodTypeDef, + UpdateGroupRequest +> = z + .object({ + requestBody: z.lazy(() => UpdateGroupRequestBody$outboundSchema).optional(), + id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + requestBody: "RequestBody", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateGroupRequest$ { + /** @deprecated use `UpdateGroupRequest$inboundSchema` instead. */ + export const inboundSchema = UpdateGroupRequest$inboundSchema; + /** @deprecated use `UpdateGroupRequest$outboundSchema` instead. */ + export const outboundSchema = UpdateGroupRequest$outboundSchema; + /** @deprecated use `UpdateGroupRequest$Outbound` instead. */ + export type Outbound = UpdateGroupRequest$Outbound; +} + +/** @internal */ +export const UpdateGroupResponseBody$inboundSchema: z.ZodType< + UpdateGroupResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + success: z.string().optional(), +}); + +/** @internal */ +export type UpdateGroupResponseBody$Outbound = { + success?: string | undefined; +}; + +/** @internal */ +export const UpdateGroupResponseBody$outboundSchema: z.ZodType< + UpdateGroupResponseBody$Outbound, + z.ZodTypeDef, + UpdateGroupResponseBody +> = z.object({ + success: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateGroupResponseBody$ { + /** @deprecated use `UpdateGroupResponseBody$inboundSchema` instead. */ + export const inboundSchema = UpdateGroupResponseBody$inboundSchema; + /** @deprecated use `UpdateGroupResponseBody$outboundSchema` instead. */ + export const outboundSchema = UpdateGroupResponseBody$outboundSchema; + /** @deprecated use `UpdateGroupResponseBody$Outbound` instead. */ + export type Outbound = UpdateGroupResponseBody$Outbound; } diff --git a/src/sdk/models/operations/updatepost.ts b/src/sdk/models/operations/updatepost.ts index b46e8cc..68b6aa9 100644 --- a/src/sdk/models/operations/updatepost.ts +++ b/src/sdk/models/operations/updatepost.ts @@ -1,289 +1,570 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class Post extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "edit_reason" }) - editReason?: string; - - @SpeakeasyMetadata() - @Expose({ name: "raw" }) +export type Post = { + editReason?: string | undefined; raw: string; -} +}; -export class UpdatePostRequestBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "post" }) - @Type(() => Post) - post?: Post; -} +export type UpdatePostRequestBody = { + post?: Post | undefined; +}; -export class UpdatePostRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) +export type UpdatePostRequest = { + requestBody?: UpdatePostRequestBody | undefined; id: string; +}; - @SpeakeasyMetadata({ data: "request, media_type=application/json" }) - requestBody?: UpdatePostRequestBody; -} - -export class UpdatePostActionsSummary extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "can_act" }) +export type UpdatePostActionsSummary = { canAct: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; -} +}; -export class UpdatePostPost extends SpeakeasyBase { - @SpeakeasyMetadata({ elemType: UpdatePostActionsSummary }) - @Expose({ name: "actions_summary" }) - @Type(() => UpdatePostActionsSummary) - actionsSummary: UpdatePostActionsSummary[]; - - @SpeakeasyMetadata() - @Expose({ name: "admin" }) +export type UpdatePostPost = { + actionsSummary: Array; admin: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "avatar_template" }) avatarTemplate: string; - - @SpeakeasyMetadata() - @Expose({ name: "bookmarked" }) bookmarked: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_delete" }) canDelete: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_edit" }) canEdit: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_recover" }) canRecover: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_see_hidden_post" }) - canSeeHiddenPost?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_view_edit_history" }) + canSeeHiddenPost?: boolean | undefined; canViewEditHistory: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "can_wiki" }) canWiki: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "cooked" }) cooked: string; - - @SpeakeasyMetadata() - @Expose({ name: "created_at" }) createdAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "deleted_at" }) - deletedAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "display_username" }) - displayUsername?: string; - - @SpeakeasyMetadata() - @Expose({ name: "draft_sequence" }) + deletedAt: string | null; + displayUsername?: string | null | undefined; draftSequence: number; - - @SpeakeasyMetadata() - @Expose({ name: "edit_reason" }) - editReason: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_bg_color" }) - flairBgColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_color" }) - flairColor: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_group_id" }) - flairGroupId?: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_name" }) - flairName: string; - - @SpeakeasyMetadata() - @Expose({ name: "flair_url" }) - flairUrl: string; - - @SpeakeasyMetadata() - @Expose({ name: "hidden" }) + editReason: string | null; + flairBgColor: string | null; + flairColor: string | null; + flairGroupId?: string | null | undefined; + flairName: string | null; + flairUrl: string | null; hidden: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) id: number; - - @SpeakeasyMetadata() - @Expose({ name: "incoming_link_count" }) incomingLinkCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "mentioned_users" }) - mentionedUsers?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "moderator" }) + mentionedUsers?: Array | undefined; moderator: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) - name?: string; - - @SpeakeasyMetadata() - @Expose({ name: "post_number" }) + name?: string | null | undefined; postNumber: number; - - @SpeakeasyMetadata() - @Expose({ name: "post_type" }) postType: number; - - @SpeakeasyMetadata() - @Expose({ name: "primary_group_name" }) - primaryGroupName: string; - - @SpeakeasyMetadata() - @Expose({ name: "quote_count" }) + primaryGroupName: string | null; quoteCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "raw" }) raw: string; - - @SpeakeasyMetadata() - @Expose({ name: "readers_count" }) readersCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "reads" }) reads: number; - - @SpeakeasyMetadata() - @Expose({ name: "reply_count" }) replyCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "reply_to_post_number" }) - replyToPostNumber: string; - - @SpeakeasyMetadata() - @Expose({ name: "reviewable_id" }) - reviewableId: string; - - @SpeakeasyMetadata() - @Expose({ name: "reviewable_score_count" }) + replyToPostNumber: string | null; + reviewableId: string | null; reviewableScoreCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "reviewable_score_pending_count" }) reviewableScorePendingCount: number; - - @SpeakeasyMetadata() - @Expose({ name: "score" }) score: number; - - @SpeakeasyMetadata() - @Expose({ name: "staff" }) staff: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "topic_id" }) topicId: number; - - @SpeakeasyMetadata() - @Expose({ name: "topic_slug" }) topicSlug: string; - - @SpeakeasyMetadata() - @Expose({ name: "trust_level" }) trustLevel: number; - - @SpeakeasyMetadata() - @Expose({ name: "updated_at" }) updatedAt: string; - - @SpeakeasyMetadata() - @Expose({ name: "user_deleted" }) userDeleted: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "user_id" }) userId: number; - - @SpeakeasyMetadata() - @Expose({ name: "user_title" }) - userTitle: string; - - @SpeakeasyMetadata() - @Expose({ name: "username" }) + userTitle: string | null; username: string; - - @SpeakeasyMetadata() - @Expose({ name: "version" }) version: number; - - @SpeakeasyMetadata() - @Expose({ name: "wiki" }) wiki: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "yours" }) yours: boolean; -} +}; /** * post updated */ -export class UpdatePostResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "post" }) - @Type(() => UpdatePostPost) +export type UpdatePostResponseBody = { post: UpdatePostPost; +}; + +/** @internal */ +export const Post$inboundSchema: z.ZodType = z + .object({ + edit_reason: z.string().optional(), + raw: z.string(), + }) + .transform((v) => { + return remap$(v, { + edit_reason: "editReason", + }); + }); + +/** @internal */ +export type Post$Outbound = { + edit_reason?: string | undefined; + raw: string; +}; + +/** @internal */ +export const Post$outboundSchema: z.ZodType = z + .object({ + editReason: z.string().optional(), + raw: z.string(), + }) + .transform((v) => { + return remap$(v, { + editReason: "edit_reason", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Post$ { + /** @deprecated use `Post$inboundSchema` instead. */ + export const inboundSchema = Post$inboundSchema; + /** @deprecated use `Post$outboundSchema` instead. */ + export const outboundSchema = Post$outboundSchema; + /** @deprecated use `Post$Outbound` instead. */ + export type Outbound = Post$Outbound; } -export class UpdatePostResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const UpdatePostRequestBody$inboundSchema: z.ZodType< + UpdatePostRequestBody, + z.ZodTypeDef, + unknown +> = z.object({ + post: z.lazy(() => Post$inboundSchema).optional(), +}); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type UpdatePostRequestBody$Outbound = { + post?: Post$Outbound | undefined; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const UpdatePostRequestBody$outboundSchema: z.ZodType< + UpdatePostRequestBody$Outbound, + z.ZodTypeDef, + UpdatePostRequestBody +> = z.object({ + post: z.lazy(() => Post$outboundSchema).optional(), +}); - /** - * post updated - */ - @SpeakeasyMetadata() - object?: UpdatePostResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdatePostRequestBody$ { + /** @deprecated use `UpdatePostRequestBody$inboundSchema` instead. */ + export const inboundSchema = UpdatePostRequestBody$inboundSchema; + /** @deprecated use `UpdatePostRequestBody$outboundSchema` instead. */ + export const outboundSchema = UpdatePostRequestBody$outboundSchema; + /** @deprecated use `UpdatePostRequestBody$Outbound` instead. */ + export type Outbound = UpdatePostRequestBody$Outbound; +} + +/** @internal */ +export const UpdatePostRequest$inboundSchema: z.ZodType = + z + .object({ + RequestBody: z.lazy(() => UpdatePostRequestBody$inboundSchema).optional(), + id: z.string(), + }) + .transform((v) => { + return remap$(v, { + RequestBody: "requestBody", + }); + }); + +/** @internal */ +export type UpdatePostRequest$Outbound = { + RequestBody?: UpdatePostRequestBody$Outbound | undefined; + id: string; +}; + +/** @internal */ +export const UpdatePostRequest$outboundSchema: z.ZodType< + UpdatePostRequest$Outbound, + z.ZodTypeDef, + UpdatePostRequest +> = z + .object({ + requestBody: z.lazy(() => UpdatePostRequestBody$outboundSchema).optional(), + id: z.string(), + }) + .transform((v) => { + return remap$(v, { + requestBody: "RequestBody", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdatePostRequest$ { + /** @deprecated use `UpdatePostRequest$inboundSchema` instead. */ + export const inboundSchema = UpdatePostRequest$inboundSchema; + /** @deprecated use `UpdatePostRequest$outboundSchema` instead. */ + export const outboundSchema = UpdatePostRequest$outboundSchema; + /** @deprecated use `UpdatePostRequest$Outbound` instead. */ + export type Outbound = UpdatePostRequest$Outbound; +} + +/** @internal */ +export const UpdatePostActionsSummary$inboundSchema: z.ZodType< + UpdatePostActionsSummary, + z.ZodTypeDef, + unknown +> = z + .object({ + can_act: z.boolean(), + id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + can_act: "canAct", + }); + }); + +/** @internal */ +export type UpdatePostActionsSummary$Outbound = { + can_act: boolean; + id: number; +}; + +/** @internal */ +export const UpdatePostActionsSummary$outboundSchema: z.ZodType< + UpdatePostActionsSummary$Outbound, + z.ZodTypeDef, + UpdatePostActionsSummary +> = z + .object({ + canAct: z.boolean(), + id: z.number().int(), + }) + .transform((v) => { + return remap$(v, { + canAct: "can_act", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdatePostActionsSummary$ { + /** @deprecated use `UpdatePostActionsSummary$inboundSchema` instead. */ + export const inboundSchema = UpdatePostActionsSummary$inboundSchema; + /** @deprecated use `UpdatePostActionsSummary$outboundSchema` instead. */ + export const outboundSchema = UpdatePostActionsSummary$outboundSchema; + /** @deprecated use `UpdatePostActionsSummary$Outbound` instead. */ + export type Outbound = UpdatePostActionsSummary$Outbound; +} + +/** @internal */ +export const UpdatePostPost$inboundSchema: z.ZodType = z + .object({ + actions_summary: z.array(z.lazy(() => UpdatePostActionsSummary$inboundSchema)), + admin: z.boolean(), + avatar_template: z.string(), + bookmarked: z.boolean(), + can_delete: z.boolean(), + can_edit: z.boolean(), + can_recover: z.boolean(), + can_see_hidden_post: z.boolean().optional(), + can_view_edit_history: z.boolean(), + can_wiki: z.boolean(), + cooked: z.string(), + created_at: z.string(), + deleted_at: z.nullable(z.string()), + display_username: z.nullable(z.string()).optional(), + draft_sequence: z.number().int(), + edit_reason: z.nullable(z.string()), + flair_bg_color: z.nullable(z.string()), + flair_color: z.nullable(z.string()), + flair_group_id: z.nullable(z.string()).optional(), + flair_name: z.nullable(z.string()), + flair_url: z.nullable(z.string()), + hidden: z.boolean(), + id: z.number().int(), + incoming_link_count: z.number().int(), + mentioned_users: z.array(z.any()).optional(), + moderator: z.boolean(), + name: z.nullable(z.string()).optional(), + post_number: z.number().int(), + post_type: z.number().int(), + primary_group_name: z.nullable(z.string()), + quote_count: z.number().int(), + raw: z.string(), + readers_count: z.number().int(), + reads: z.number().int(), + reply_count: z.number().int(), + reply_to_post_number: z.nullable(z.string()), + reviewable_id: z.nullable(z.string()), + reviewable_score_count: z.number().int(), + reviewable_score_pending_count: z.number().int(), + score: z.number().int(), + staff: z.boolean(), + topic_id: z.number().int(), + topic_slug: z.string(), + trust_level: z.number().int(), + updated_at: z.string(), + user_deleted: z.boolean(), + user_id: z.number().int(), + user_title: z.nullable(z.string()), + username: z.string(), + version: z.number().int(), + wiki: z.boolean(), + yours: z.boolean(), + }) + .transform((v) => { + return remap$(v, { + actions_summary: "actionsSummary", + avatar_template: "avatarTemplate", + can_delete: "canDelete", + can_edit: "canEdit", + can_recover: "canRecover", + can_see_hidden_post: "canSeeHiddenPost", + can_view_edit_history: "canViewEditHistory", + can_wiki: "canWiki", + created_at: "createdAt", + deleted_at: "deletedAt", + display_username: "displayUsername", + draft_sequence: "draftSequence", + edit_reason: "editReason", + flair_bg_color: "flairBgColor", + flair_color: "flairColor", + flair_group_id: "flairGroupId", + flair_name: "flairName", + flair_url: "flairUrl", + incoming_link_count: "incomingLinkCount", + mentioned_users: "mentionedUsers", + post_number: "postNumber", + post_type: "postType", + primary_group_name: "primaryGroupName", + quote_count: "quoteCount", + readers_count: "readersCount", + reply_count: "replyCount", + reply_to_post_number: "replyToPostNumber", + reviewable_id: "reviewableId", + reviewable_score_count: "reviewableScoreCount", + reviewable_score_pending_count: "reviewableScorePendingCount", + topic_id: "topicId", + topic_slug: "topicSlug", + trust_level: "trustLevel", + updated_at: "updatedAt", + user_deleted: "userDeleted", + user_id: "userId", + user_title: "userTitle", + }); + }); + +/** @internal */ +export type UpdatePostPost$Outbound = { + actions_summary: Array; + admin: boolean; + avatar_template: string; + bookmarked: boolean; + can_delete: boolean; + can_edit: boolean; + can_recover: boolean; + can_see_hidden_post?: boolean | undefined; + can_view_edit_history: boolean; + can_wiki: boolean; + cooked: string; + created_at: string; + deleted_at: string | null; + display_username?: string | null | undefined; + draft_sequence: number; + edit_reason: string | null; + flair_bg_color: string | null; + flair_color: string | null; + flair_group_id?: string | null | undefined; + flair_name: string | null; + flair_url: string | null; + hidden: boolean; + id: number; + incoming_link_count: number; + mentioned_users?: Array | undefined; + moderator: boolean; + name?: string | null | undefined; + post_number: number; + post_type: number; + primary_group_name: string | null; + quote_count: number; + raw: string; + readers_count: number; + reads: number; + reply_count: number; + reply_to_post_number: string | null; + reviewable_id: string | null; + reviewable_score_count: number; + reviewable_score_pending_count: number; + score: number; + staff: boolean; + topic_id: number; + topic_slug: string; + trust_level: number; + updated_at: string; + user_deleted: boolean; + user_id: number; + user_title: string | null; + username: string; + version: number; + wiki: boolean; + yours: boolean; +}; + +/** @internal */ +export const UpdatePostPost$outboundSchema: z.ZodType< + UpdatePostPost$Outbound, + z.ZodTypeDef, + UpdatePostPost +> = z + .object({ + actionsSummary: z.array(z.lazy(() => UpdatePostActionsSummary$outboundSchema)), + admin: z.boolean(), + avatarTemplate: z.string(), + bookmarked: z.boolean(), + canDelete: z.boolean(), + canEdit: z.boolean(), + canRecover: z.boolean(), + canSeeHiddenPost: z.boolean().optional(), + canViewEditHistory: z.boolean(), + canWiki: z.boolean(), + cooked: z.string(), + createdAt: z.string(), + deletedAt: z.nullable(z.string()), + displayUsername: z.nullable(z.string()).optional(), + draftSequence: z.number().int(), + editReason: z.nullable(z.string()), + flairBgColor: z.nullable(z.string()), + flairColor: z.nullable(z.string()), + flairGroupId: z.nullable(z.string()).optional(), + flairName: z.nullable(z.string()), + flairUrl: z.nullable(z.string()), + hidden: z.boolean(), + id: z.number().int(), + incomingLinkCount: z.number().int(), + mentionedUsers: z.array(z.any()).optional(), + moderator: z.boolean(), + name: z.nullable(z.string()).optional(), + postNumber: z.number().int(), + postType: z.number().int(), + primaryGroupName: z.nullable(z.string()), + quoteCount: z.number().int(), + raw: z.string(), + readersCount: z.number().int(), + reads: z.number().int(), + replyCount: z.number().int(), + replyToPostNumber: z.nullable(z.string()), + reviewableId: z.nullable(z.string()), + reviewableScoreCount: z.number().int(), + reviewableScorePendingCount: z.number().int(), + score: z.number().int(), + staff: z.boolean(), + topicId: z.number().int(), + topicSlug: z.string(), + trustLevel: z.number().int(), + updatedAt: z.string(), + userDeleted: z.boolean(), + userId: z.number().int(), + userTitle: z.nullable(z.string()), + username: z.string(), + version: z.number().int(), + wiki: z.boolean(), + yours: z.boolean(), + }) + .transform((v) => { + return remap$(v, { + actionsSummary: "actions_summary", + avatarTemplate: "avatar_template", + canDelete: "can_delete", + canEdit: "can_edit", + canRecover: "can_recover", + canSeeHiddenPost: "can_see_hidden_post", + canViewEditHistory: "can_view_edit_history", + canWiki: "can_wiki", + createdAt: "created_at", + deletedAt: "deleted_at", + displayUsername: "display_username", + draftSequence: "draft_sequence", + editReason: "edit_reason", + flairBgColor: "flair_bg_color", + flairColor: "flair_color", + flairGroupId: "flair_group_id", + flairName: "flair_name", + flairUrl: "flair_url", + incomingLinkCount: "incoming_link_count", + mentionedUsers: "mentioned_users", + postNumber: "post_number", + postType: "post_type", + primaryGroupName: "primary_group_name", + quoteCount: "quote_count", + readersCount: "readers_count", + replyCount: "reply_count", + replyToPostNumber: "reply_to_post_number", + reviewableId: "reviewable_id", + reviewableScoreCount: "reviewable_score_count", + reviewableScorePendingCount: "reviewable_score_pending_count", + topicId: "topic_id", + topicSlug: "topic_slug", + trustLevel: "trust_level", + updatedAt: "updated_at", + userDeleted: "user_deleted", + userId: "user_id", + userTitle: "user_title", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdatePostPost$ { + /** @deprecated use `UpdatePostPost$inboundSchema` instead. */ + export const inboundSchema = UpdatePostPost$inboundSchema; + /** @deprecated use `UpdatePostPost$outboundSchema` instead. */ + export const outboundSchema = UpdatePostPost$outboundSchema; + /** @deprecated use `UpdatePostPost$Outbound` instead. */ + export type Outbound = UpdatePostPost$Outbound; +} + +/** @internal */ +export const UpdatePostResponseBody$inboundSchema: z.ZodType< + UpdatePostResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + post: z.lazy(() => UpdatePostPost$inboundSchema), +}); + +/** @internal */ +export type UpdatePostResponseBody$Outbound = { + post: UpdatePostPost$Outbound; +}; + +/** @internal */ +export const UpdatePostResponseBody$outboundSchema: z.ZodType< + UpdatePostResponseBody$Outbound, + z.ZodTypeDef, + UpdatePostResponseBody +> = z.object({ + post: z.lazy(() => UpdatePostPost$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdatePostResponseBody$ { + /** @deprecated use `UpdatePostResponseBody$inboundSchema` instead. */ + export const inboundSchema = UpdatePostResponseBody$inboundSchema; + /** @deprecated use `UpdatePostResponseBody$outboundSchema` instead. */ + export const outboundSchema = UpdatePostResponseBody$outboundSchema; + /** @deprecated use `UpdatePostResponseBody$Outbound` instead. */ + export type Outbound = UpdatePostResponseBody$Outbound; } diff --git a/src/sdk/models/operations/updatetaggroup.ts b/src/sdk/models/operations/updatetaggroup.ts index 59e96b1..11da492 100644 --- a/src/sdk/models/operations/updatetaggroup.ts +++ b/src/sdk/models/operations/updatetaggroup.ts @@ -1,94 +1,277 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class UpdateTagGroupRequestBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "name" }) - name?: string; -} +export type UpdateTagGroupRequestBody = { + name?: string | undefined; +}; -export class UpdateTagGroupRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) +export type UpdateTagGroupRequest = { + requestBody?: UpdateTagGroupRequestBody | undefined; id: string; +}; - @SpeakeasyMetadata({ data: "request, media_type=application/json" }) - requestBody?: UpdateTagGroupRequestBody; -} +export type UpdateTagGroupPermissions = { + everyone?: number | undefined; +}; -export class UpdateTagGroupPermissions extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "everyone" }) - everyone?: number; -} - -export class UpdateTagGroupTagGroup extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "id" }) - id?: number; - - @SpeakeasyMetadata() - @Expose({ name: "name" }) - name?: string; - - @SpeakeasyMetadata() - @Expose({ name: "one_per_topic" }) - onePerTopic?: boolean; - - @SpeakeasyMetadata() - @Expose({ name: "parent_tag_name" }) - parentTagName?: any[]; - - @SpeakeasyMetadata() - @Expose({ name: "permissions" }) - @Type(() => UpdateTagGroupPermissions) - permissions?: UpdateTagGroupPermissions; - - @SpeakeasyMetadata() - @Expose({ name: "tag_names" }) - tagNames?: any[]; -} +export type UpdateTagGroupTagGroup = { + id?: number | undefined; + name?: string | undefined; + onePerTopic?: boolean | undefined; + parentTagName?: Array | undefined; + permissions?: UpdateTagGroupPermissions | undefined; + tagNames?: Array | undefined; +}; /** * Tag group updated */ -export class UpdateTagGroupResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "success" }) - success?: string; +export type UpdateTagGroupResponseBody = { + success?: string | undefined; + tagGroup?: UpdateTagGroupTagGroup | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "tag_group" }) - @Type(() => UpdateTagGroupTagGroup) - tagGroup?: UpdateTagGroupTagGroup; +/** @internal */ +export const UpdateTagGroupRequestBody$inboundSchema: z.ZodType< + UpdateTagGroupRequestBody, + z.ZodTypeDef, + unknown +> = z.object({ + name: z.string().optional(), +}); + +/** @internal */ +export type UpdateTagGroupRequestBody$Outbound = { + name?: string | undefined; +}; + +/** @internal */ +export const UpdateTagGroupRequestBody$outboundSchema: z.ZodType< + UpdateTagGroupRequestBody$Outbound, + z.ZodTypeDef, + UpdateTagGroupRequestBody +> = z.object({ + name: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateTagGroupRequestBody$ { + /** @deprecated use `UpdateTagGroupRequestBody$inboundSchema` instead. */ + export const inboundSchema = UpdateTagGroupRequestBody$inboundSchema; + /** @deprecated use `UpdateTagGroupRequestBody$outboundSchema` instead. */ + export const outboundSchema = UpdateTagGroupRequestBody$outboundSchema; + /** @deprecated use `UpdateTagGroupRequestBody$Outbound` instead. */ + export type Outbound = UpdateTagGroupRequestBody$Outbound; } -export class UpdateTagGroupResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const UpdateTagGroupRequest$inboundSchema: z.ZodType< + UpdateTagGroupRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + RequestBody: z.lazy(() => UpdateTagGroupRequestBody$inboundSchema).optional(), + id: z.string(), + }) + .transform((v) => { + return remap$(v, { + RequestBody: "requestBody", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type UpdateTagGroupRequest$Outbound = { + RequestBody?: UpdateTagGroupRequestBody$Outbound | undefined; + id: string; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const UpdateTagGroupRequest$outboundSchema: z.ZodType< + UpdateTagGroupRequest$Outbound, + z.ZodTypeDef, + UpdateTagGroupRequest +> = z + .object({ + requestBody: z.lazy(() => UpdateTagGroupRequestBody$outboundSchema).optional(), + id: z.string(), + }) + .transform((v) => { + return remap$(v, { + requestBody: "RequestBody", + }); + }); - /** - * Tag group updated - */ - @SpeakeasyMetadata() - object?: UpdateTagGroupResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateTagGroupRequest$ { + /** @deprecated use `UpdateTagGroupRequest$inboundSchema` instead. */ + export const inboundSchema = UpdateTagGroupRequest$inboundSchema; + /** @deprecated use `UpdateTagGroupRequest$outboundSchema` instead. */ + export const outboundSchema = UpdateTagGroupRequest$outboundSchema; + /** @deprecated use `UpdateTagGroupRequest$Outbound` instead. */ + export type Outbound = UpdateTagGroupRequest$Outbound; +} + +/** @internal */ +export const UpdateTagGroupPermissions$inboundSchema: z.ZodType< + UpdateTagGroupPermissions, + z.ZodTypeDef, + unknown +> = z.object({ + everyone: z.number().int().optional(), +}); + +/** @internal */ +export type UpdateTagGroupPermissions$Outbound = { + everyone?: number | undefined; +}; + +/** @internal */ +export const UpdateTagGroupPermissions$outboundSchema: z.ZodType< + UpdateTagGroupPermissions$Outbound, + z.ZodTypeDef, + UpdateTagGroupPermissions +> = z.object({ + everyone: z.number().int().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateTagGroupPermissions$ { + /** @deprecated use `UpdateTagGroupPermissions$inboundSchema` instead. */ + export const inboundSchema = UpdateTagGroupPermissions$inboundSchema; + /** @deprecated use `UpdateTagGroupPermissions$outboundSchema` instead. */ + export const outboundSchema = UpdateTagGroupPermissions$outboundSchema; + /** @deprecated use `UpdateTagGroupPermissions$Outbound` instead. */ + export type Outbound = UpdateTagGroupPermissions$Outbound; +} + +/** @internal */ +export const UpdateTagGroupTagGroup$inboundSchema: z.ZodType< + UpdateTagGroupTagGroup, + z.ZodTypeDef, + unknown +> = z + .object({ + id: z.number().int().optional(), + name: z.string().optional(), + one_per_topic: z.boolean().optional(), + parent_tag_name: z.array(z.any()).optional(), + permissions: z.lazy(() => UpdateTagGroupPermissions$inboundSchema).optional(), + tag_names: z.array(z.any()).optional(), + }) + .transform((v) => { + return remap$(v, { + one_per_topic: "onePerTopic", + parent_tag_name: "parentTagName", + tag_names: "tagNames", + }); + }); + +/** @internal */ +export type UpdateTagGroupTagGroup$Outbound = { + id?: number | undefined; + name?: string | undefined; + one_per_topic?: boolean | undefined; + parent_tag_name?: Array | undefined; + permissions?: UpdateTagGroupPermissions$Outbound | undefined; + tag_names?: Array | undefined; +}; + +/** @internal */ +export const UpdateTagGroupTagGroup$outboundSchema: z.ZodType< + UpdateTagGroupTagGroup$Outbound, + z.ZodTypeDef, + UpdateTagGroupTagGroup +> = z + .object({ + id: z.number().int().optional(), + name: z.string().optional(), + onePerTopic: z.boolean().optional(), + parentTagName: z.array(z.any()).optional(), + permissions: z.lazy(() => UpdateTagGroupPermissions$outboundSchema).optional(), + tagNames: z.array(z.any()).optional(), + }) + .transform((v) => { + return remap$(v, { + onePerTopic: "one_per_topic", + parentTagName: "parent_tag_name", + tagNames: "tag_names", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateTagGroupTagGroup$ { + /** @deprecated use `UpdateTagGroupTagGroup$inboundSchema` instead. */ + export const inboundSchema = UpdateTagGroupTagGroup$inboundSchema; + /** @deprecated use `UpdateTagGroupTagGroup$outboundSchema` instead. */ + export const outboundSchema = UpdateTagGroupTagGroup$outboundSchema; + /** @deprecated use `UpdateTagGroupTagGroup$Outbound` instead. */ + export type Outbound = UpdateTagGroupTagGroup$Outbound; +} + +/** @internal */ +export const UpdateTagGroupResponseBody$inboundSchema: z.ZodType< + UpdateTagGroupResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + success: z.string().optional(), + tag_group: z.lazy(() => UpdateTagGroupTagGroup$inboundSchema).optional(), + }) + .transform((v) => { + return remap$(v, { + tag_group: "tagGroup", + }); + }); + +/** @internal */ +export type UpdateTagGroupResponseBody$Outbound = { + success?: string | undefined; + tag_group?: UpdateTagGroupTagGroup$Outbound | undefined; +}; + +/** @internal */ +export const UpdateTagGroupResponseBody$outboundSchema: z.ZodType< + UpdateTagGroupResponseBody$Outbound, + z.ZodTypeDef, + UpdateTagGroupResponseBody +> = z + .object({ + success: z.string().optional(), + tagGroup: z.lazy(() => UpdateTagGroupTagGroup$outboundSchema).optional(), + }) + .transform((v) => { + return remap$(v, { + tagGroup: "tag_group", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateTagGroupResponseBody$ { + /** @deprecated use `UpdateTagGroupResponseBody$inboundSchema` instead. */ + export const inboundSchema = UpdateTagGroupResponseBody$inboundSchema; + /** @deprecated use `UpdateTagGroupResponseBody$outboundSchema` instead. */ + export const outboundSchema = UpdateTagGroupResponseBody$outboundSchema; + /** @deprecated use `UpdateTagGroupResponseBody$Outbound` instead. */ + export type Outbound = UpdateTagGroupResponseBody$Outbound; } diff --git a/src/sdk/models/operations/updatetopic.ts b/src/sdk/models/operations/updatetopic.ts index db61f1f..fdd9e4a 100644 --- a/src/sdk/models/operations/updatetopic.ts +++ b/src/sdk/models/operations/updatetopic.ts @@ -1,96 +1,279 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class Topic extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "category_id" }) - categoryId?: number; +export type Topic = { + categoryId?: number | undefined; + title?: string | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "title" }) - title?: string; -} +export type UpdateTopicRequestBody = { + topic?: Topic | undefined; +}; -export class UpdateTopicRequestBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "topic" }) - @Type(() => Topic) - topic?: Topic; -} - -export class UpdateTopicRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Key" }) +export type UpdateTopicRequest = { apiKey: string; - - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Username" }) apiUsername: string; - - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) + requestBody?: UpdateTopicRequestBody | undefined; id: string; +}; - @SpeakeasyMetadata({ data: "request, media_type=application/json" }) - requestBody?: UpdateTopicRequestBody; -} - -export class BasicTopic extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "fancy_title" }) - fancyTitle?: string; - - @SpeakeasyMetadata() - @Expose({ name: "id" }) - id?: number; - - @SpeakeasyMetadata() - @Expose({ name: "posts_count" }) - postsCount?: number; - - @SpeakeasyMetadata() - @Expose({ name: "slug" }) - slug?: string; - - @SpeakeasyMetadata() - @Expose({ name: "title" }) - title?: string; -} +export type BasicTopic = { + fancyTitle?: string | undefined; + id?: number | undefined; + postsCount?: number | undefined; + slug?: string | undefined; + title?: string | undefined; +}; /** * topic updated */ -export class UpdateTopicResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "basic_topic" }) - @Type(() => BasicTopic) - basicTopic?: BasicTopic; +export type UpdateTopicResponseBody = { + basicTopic?: BasicTopic | undefined; +}; + +/** @internal */ +export const Topic$inboundSchema: z.ZodType = z + .object({ + category_id: z.number().int().optional(), + title: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + category_id: "categoryId", + }); + }); + +/** @internal */ +export type Topic$Outbound = { + category_id?: number | undefined; + title?: string | undefined; +}; + +/** @internal */ +export const Topic$outboundSchema: z.ZodType = z + .object({ + categoryId: z.number().int().optional(), + title: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + categoryId: "category_id", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Topic$ { + /** @deprecated use `Topic$inboundSchema` instead. */ + export const inboundSchema = Topic$inboundSchema; + /** @deprecated use `Topic$outboundSchema` instead. */ + export const outboundSchema = Topic$outboundSchema; + /** @deprecated use `Topic$Outbound` instead. */ + export type Outbound = Topic$Outbound; } -export class UpdateTopicResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const UpdateTopicRequestBody$inboundSchema: z.ZodType< + UpdateTopicRequestBody, + z.ZodTypeDef, + unknown +> = z.object({ + topic: z.lazy(() => Topic$inboundSchema).optional(), +}); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type UpdateTopicRequestBody$Outbound = { + topic?: Topic$Outbound | undefined; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const UpdateTopicRequestBody$outboundSchema: z.ZodType< + UpdateTopicRequestBody$Outbound, + z.ZodTypeDef, + UpdateTopicRequestBody +> = z.object({ + topic: z.lazy(() => Topic$outboundSchema).optional(), +}); - /** - * topic updated - */ - @SpeakeasyMetadata() - object?: UpdateTopicResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateTopicRequestBody$ { + /** @deprecated use `UpdateTopicRequestBody$inboundSchema` instead. */ + export const inboundSchema = UpdateTopicRequestBody$inboundSchema; + /** @deprecated use `UpdateTopicRequestBody$outboundSchema` instead. */ + export const outboundSchema = UpdateTopicRequestBody$outboundSchema; + /** @deprecated use `UpdateTopicRequestBody$Outbound` instead. */ + export type Outbound = UpdateTopicRequestBody$Outbound; +} + +/** @internal */ +export const UpdateTopicRequest$inboundSchema: z.ZodType< + UpdateTopicRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + "Api-Key": z.string(), + "Api-Username": z.string(), + RequestBody: z.lazy(() => UpdateTopicRequestBody$inboundSchema).optional(), + id: z.string(), + }) + .transform((v) => { + return remap$(v, { + "Api-Key": "apiKey", + "Api-Username": "apiUsername", + RequestBody: "requestBody", + }); + }); + +/** @internal */ +export type UpdateTopicRequest$Outbound = { + "Api-Key": string; + "Api-Username": string; + RequestBody?: UpdateTopicRequestBody$Outbound | undefined; + id: string; +}; + +/** @internal */ +export const UpdateTopicRequest$outboundSchema: z.ZodType< + UpdateTopicRequest$Outbound, + z.ZodTypeDef, + UpdateTopicRequest +> = z + .object({ + apiKey: z.string(), + apiUsername: z.string(), + requestBody: z.lazy(() => UpdateTopicRequestBody$outboundSchema).optional(), + id: z.string(), + }) + .transform((v) => { + return remap$(v, { + apiKey: "Api-Key", + apiUsername: "Api-Username", + requestBody: "RequestBody", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateTopicRequest$ { + /** @deprecated use `UpdateTopicRequest$inboundSchema` instead. */ + export const inboundSchema = UpdateTopicRequest$inboundSchema; + /** @deprecated use `UpdateTopicRequest$outboundSchema` instead. */ + export const outboundSchema = UpdateTopicRequest$outboundSchema; + /** @deprecated use `UpdateTopicRequest$Outbound` instead. */ + export type Outbound = UpdateTopicRequest$Outbound; +} + +/** @internal */ +export const BasicTopic$inboundSchema: z.ZodType = z + .object({ + fancy_title: z.string().optional(), + id: z.number().int().optional(), + posts_count: z.number().int().optional(), + slug: z.string().optional(), + title: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + fancy_title: "fancyTitle", + posts_count: "postsCount", + }); + }); + +/** @internal */ +export type BasicTopic$Outbound = { + fancy_title?: string | undefined; + id?: number | undefined; + posts_count?: number | undefined; + slug?: string | undefined; + title?: string | undefined; +}; + +/** @internal */ +export const BasicTopic$outboundSchema: z.ZodType = z + .object({ + fancyTitle: z.string().optional(), + id: z.number().int().optional(), + postsCount: z.number().int().optional(), + slug: z.string().optional(), + title: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + fancyTitle: "fancy_title", + postsCount: "posts_count", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace BasicTopic$ { + /** @deprecated use `BasicTopic$inboundSchema` instead. */ + export const inboundSchema = BasicTopic$inboundSchema; + /** @deprecated use `BasicTopic$outboundSchema` instead. */ + export const outboundSchema = BasicTopic$outboundSchema; + /** @deprecated use `BasicTopic$Outbound` instead. */ + export type Outbound = BasicTopic$Outbound; +} + +/** @internal */ +export const UpdateTopicResponseBody$inboundSchema: z.ZodType< + UpdateTopicResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + basic_topic: z.lazy(() => BasicTopic$inboundSchema).optional(), + }) + .transform((v) => { + return remap$(v, { + basic_topic: "basicTopic", + }); + }); + +/** @internal */ +export type UpdateTopicResponseBody$Outbound = { + basic_topic?: BasicTopic$Outbound | undefined; +}; + +/** @internal */ +export const UpdateTopicResponseBody$outboundSchema: z.ZodType< + UpdateTopicResponseBody$Outbound, + z.ZodTypeDef, + UpdateTopicResponseBody +> = z + .object({ + basicTopic: z.lazy(() => BasicTopic$outboundSchema).optional(), + }) + .transform((v) => { + return remap$(v, { + basicTopic: "basic_topic", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateTopicResponseBody$ { + /** @deprecated use `UpdateTopicResponseBody$inboundSchema` instead. */ + export const inboundSchema = UpdateTopicResponseBody$inboundSchema; + /** @deprecated use `UpdateTopicResponseBody$outboundSchema` instead. */ + export const outboundSchema = UpdateTopicResponseBody$outboundSchema; + /** @deprecated use `UpdateTopicResponseBody$Outbound` instead. */ + export type Outbound = UpdateTopicResponseBody$Outbound; } diff --git a/src/sdk/models/operations/updatetopicstatus.ts b/src/sdk/models/operations/updatetopicstatus.ts index 18fa4cb..7c332d5 100644 --- a/src/sdk/models/operations/updatetopicstatus.ts +++ b/src/sdk/models/operations/updatetopicstatus.ts @@ -1,90 +1,234 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import { ClosedEnum } from "../../types/enums.js"; +import * as z from "zod"; -export enum Enabled { - True = "true", - False = "false", -} +export const Enabled = { + True: "true", + False: "false", +} as const; +export type Enabled = ClosedEnum; -export enum Status { - Closed = "closed", - Pinned = "pinned", - PinnedGlobally = "pinned_globally", - Archived = "archived", - Visible = "visible", -} +export const Status = { + Closed: "closed", + Pinned: "pinned", + PinnedGlobally: "pinned_globally", + Archived: "archived", + Visible: "visible", +} as const; +export type Status = ClosedEnum; -export class UpdateTopicStatusRequestBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "enabled" }) +export type UpdateTopicStatusRequestBody = { enabled: Enabled; - - @SpeakeasyMetadata() - @Expose({ name: "status" }) status: Status; - /** * Only required for `pinned` and `pinned_globally` */ - @SpeakeasyMetadata() - @Expose({ name: "until" }) - until?: string; -} + until?: string | undefined; +}; -export class UpdateTopicStatusRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Key" }) +export type UpdateTopicStatusRequest = { apiKey: string; - - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Username" }) apiUsername: string; - - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) + requestBody?: UpdateTopicStatusRequestBody | undefined; id: string; - - @SpeakeasyMetadata({ data: "request, media_type=application/json" }) - requestBody?: UpdateTopicStatusRequestBody; -} +}; /** * topic updated */ -export class UpdateTopicStatusResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "success" }) - success?: string; +export type UpdateTopicStatusResponseBody = { + success?: string | undefined; + topicStatusUpdate?: string | null | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "topic_status_update" }) - topicStatusUpdate?: string; +/** @internal */ +export const Enabled$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Enabled); + +/** @internal */ +export const Enabled$outboundSchema: z.ZodNativeEnum = Enabled$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Enabled$ { + /** @deprecated use `Enabled$inboundSchema` instead. */ + export const inboundSchema = Enabled$inboundSchema; + /** @deprecated use `Enabled$outboundSchema` instead. */ + export const outboundSchema = Enabled$outboundSchema; } -export class UpdateTopicStatusResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const Status$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Status); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export const Status$outboundSchema: z.ZodNativeEnum = Status$inboundSchema; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; - - /** - * topic updated - */ - @SpeakeasyMetadata() - object?: UpdateTopicStatusResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Status$ { + /** @deprecated use `Status$inboundSchema` instead. */ + export const inboundSchema = Status$inboundSchema; + /** @deprecated use `Status$outboundSchema` instead. */ + export const outboundSchema = Status$outboundSchema; +} + +/** @internal */ +export const UpdateTopicStatusRequestBody$inboundSchema: z.ZodType< + UpdateTopicStatusRequestBody, + z.ZodTypeDef, + unknown +> = z.object({ + enabled: Enabled$inboundSchema, + status: Status$inboundSchema, + until: z.string().optional(), +}); + +/** @internal */ +export type UpdateTopicStatusRequestBody$Outbound = { + enabled: string; + status: string; + until?: string | undefined; +}; + +/** @internal */ +export const UpdateTopicStatusRequestBody$outboundSchema: z.ZodType< + UpdateTopicStatusRequestBody$Outbound, + z.ZodTypeDef, + UpdateTopicStatusRequestBody +> = z.object({ + enabled: Enabled$outboundSchema, + status: Status$outboundSchema, + until: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateTopicStatusRequestBody$ { + /** @deprecated use `UpdateTopicStatusRequestBody$inboundSchema` instead. */ + export const inboundSchema = UpdateTopicStatusRequestBody$inboundSchema; + /** @deprecated use `UpdateTopicStatusRequestBody$outboundSchema` instead. */ + export const outboundSchema = UpdateTopicStatusRequestBody$outboundSchema; + /** @deprecated use `UpdateTopicStatusRequestBody$Outbound` instead. */ + export type Outbound = UpdateTopicStatusRequestBody$Outbound; +} + +/** @internal */ +export const UpdateTopicStatusRequest$inboundSchema: z.ZodType< + UpdateTopicStatusRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + "Api-Key": z.string(), + "Api-Username": z.string(), + RequestBody: z.lazy(() => UpdateTopicStatusRequestBody$inboundSchema).optional(), + id: z.string(), + }) + .transform((v) => { + return remap$(v, { + "Api-Key": "apiKey", + "Api-Username": "apiUsername", + RequestBody: "requestBody", + }); + }); + +/** @internal */ +export type UpdateTopicStatusRequest$Outbound = { + "Api-Key": string; + "Api-Username": string; + RequestBody?: UpdateTopicStatusRequestBody$Outbound | undefined; + id: string; +}; + +/** @internal */ +export const UpdateTopicStatusRequest$outboundSchema: z.ZodType< + UpdateTopicStatusRequest$Outbound, + z.ZodTypeDef, + UpdateTopicStatusRequest +> = z + .object({ + apiKey: z.string(), + apiUsername: z.string(), + requestBody: z.lazy(() => UpdateTopicStatusRequestBody$outboundSchema).optional(), + id: z.string(), + }) + .transform((v) => { + return remap$(v, { + apiKey: "Api-Key", + apiUsername: "Api-Username", + requestBody: "RequestBody", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateTopicStatusRequest$ { + /** @deprecated use `UpdateTopicStatusRequest$inboundSchema` instead. */ + export const inboundSchema = UpdateTopicStatusRequest$inboundSchema; + /** @deprecated use `UpdateTopicStatusRequest$outboundSchema` instead. */ + export const outboundSchema = UpdateTopicStatusRequest$outboundSchema; + /** @deprecated use `UpdateTopicStatusRequest$Outbound` instead. */ + export type Outbound = UpdateTopicStatusRequest$Outbound; +} + +/** @internal */ +export const UpdateTopicStatusResponseBody$inboundSchema: z.ZodType< + UpdateTopicStatusResponseBody, + z.ZodTypeDef, + unknown +> = z + .object({ + success: z.string().optional(), + topic_status_update: z.nullable(z.string()).optional(), + }) + .transform((v) => { + return remap$(v, { + topic_status_update: "topicStatusUpdate", + }); + }); + +/** @internal */ +export type UpdateTopicStatusResponseBody$Outbound = { + success?: string | undefined; + topic_status_update?: string | null | undefined; +}; + +/** @internal */ +export const UpdateTopicStatusResponseBody$outboundSchema: z.ZodType< + UpdateTopicStatusResponseBody$Outbound, + z.ZodTypeDef, + UpdateTopicStatusResponseBody +> = z + .object({ + success: z.string().optional(), + topicStatusUpdate: z.nullable(z.string()).optional(), + }) + .transform((v) => { + return remap$(v, { + topicStatusUpdate: "topic_status_update", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateTopicStatusResponseBody$ { + /** @deprecated use `UpdateTopicStatusResponseBody$inboundSchema` instead. */ + export const inboundSchema = UpdateTopicStatusResponseBody$inboundSchema; + /** @deprecated use `UpdateTopicStatusResponseBody$outboundSchema` instead. */ + export const outboundSchema = UpdateTopicStatusResponseBody$outboundSchema; + /** @deprecated use `UpdateTopicStatusResponseBody$Outbound` instead. */ + export type Outbound = UpdateTopicStatusResponseBody$Outbound; } diff --git a/src/sdk/models/operations/updatetopictimestamp.ts b/src/sdk/models/operations/updatetopictimestamp.ts index 2a4c6bc..642fd60 100644 --- a/src/sdk/models/operations/updatetopictimestamp.ts +++ b/src/sdk/models/operations/updatetopictimestamp.ts @@ -1,62 +1,157 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class UpdateTopicTimestampRequestBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "timestamp" }) +export type UpdateTopicTimestampRequestBody = { timestamp: string; -} +}; -export class UpdateTopicTimestampRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Key" }) +export type UpdateTopicTimestampRequest = { apiKey: string; - - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Username" }) apiUsername: string; - - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=id" }) + requestBody?: UpdateTopicTimestampRequestBody | undefined; id: string; - - @SpeakeasyMetadata({ data: "request, media_type=application/json" }) - requestBody?: UpdateTopicTimestampRequestBody; -} +}; /** * topic updated */ -export class UpdateTopicTimestampResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "success" }) - success?: string; +export type UpdateTopicTimestampResponseBody = { + success?: string | undefined; +}; + +/** @internal */ +export const UpdateTopicTimestampRequestBody$inboundSchema: z.ZodType< + UpdateTopicTimestampRequestBody, + z.ZodTypeDef, + unknown +> = z.object({ + timestamp: z.string(), +}); + +/** @internal */ +export type UpdateTopicTimestampRequestBody$Outbound = { + timestamp: string; +}; + +/** @internal */ +export const UpdateTopicTimestampRequestBody$outboundSchema: z.ZodType< + UpdateTopicTimestampRequestBody$Outbound, + z.ZodTypeDef, + UpdateTopicTimestampRequestBody +> = z.object({ + timestamp: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateTopicTimestampRequestBody$ { + /** @deprecated use `UpdateTopicTimestampRequestBody$inboundSchema` instead. */ + export const inboundSchema = UpdateTopicTimestampRequestBody$inboundSchema; + /** @deprecated use `UpdateTopicTimestampRequestBody$outboundSchema` instead. */ + export const outboundSchema = UpdateTopicTimestampRequestBody$outboundSchema; + /** @deprecated use `UpdateTopicTimestampRequestBody$Outbound` instead. */ + export type Outbound = UpdateTopicTimestampRequestBody$Outbound; } -export class UpdateTopicTimestampResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const UpdateTopicTimestampRequest$inboundSchema: z.ZodType< + UpdateTopicTimestampRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + "Api-Key": z.string(), + "Api-Username": z.string(), + RequestBody: z.lazy(() => UpdateTopicTimestampRequestBody$inboundSchema).optional(), + id: z.string(), + }) + .transform((v) => { + return remap$(v, { + "Api-Key": "apiKey", + "Api-Username": "apiUsername", + RequestBody: "requestBody", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type UpdateTopicTimestampRequest$Outbound = { + "Api-Key": string; + "Api-Username": string; + RequestBody?: UpdateTopicTimestampRequestBody$Outbound | undefined; + id: string; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const UpdateTopicTimestampRequest$outboundSchema: z.ZodType< + UpdateTopicTimestampRequest$Outbound, + z.ZodTypeDef, + UpdateTopicTimestampRequest +> = z + .object({ + apiKey: z.string(), + apiUsername: z.string(), + requestBody: z.lazy(() => UpdateTopicTimestampRequestBody$outboundSchema).optional(), + id: z.string(), + }) + .transform((v) => { + return remap$(v, { + apiKey: "Api-Key", + apiUsername: "Api-Username", + requestBody: "RequestBody", + }); + }); - /** - * topic updated - */ - @SpeakeasyMetadata() - object?: UpdateTopicTimestampResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateTopicTimestampRequest$ { + /** @deprecated use `UpdateTopicTimestampRequest$inboundSchema` instead. */ + export const inboundSchema = UpdateTopicTimestampRequest$inboundSchema; + /** @deprecated use `UpdateTopicTimestampRequest$outboundSchema` instead. */ + export const outboundSchema = UpdateTopicTimestampRequest$outboundSchema; + /** @deprecated use `UpdateTopicTimestampRequest$Outbound` instead. */ + export type Outbound = UpdateTopicTimestampRequest$Outbound; +} + +/** @internal */ +export const UpdateTopicTimestampResponseBody$inboundSchema: z.ZodType< + UpdateTopicTimestampResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + success: z.string().optional(), +}); + +/** @internal */ +export type UpdateTopicTimestampResponseBody$Outbound = { + success?: string | undefined; +}; + +/** @internal */ +export const UpdateTopicTimestampResponseBody$outboundSchema: z.ZodType< + UpdateTopicTimestampResponseBody$Outbound, + z.ZodTypeDef, + UpdateTopicTimestampResponseBody +> = z.object({ + success: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateTopicTimestampResponseBody$ { + /** @deprecated use `UpdateTopicTimestampResponseBody$inboundSchema` instead. */ + export const inboundSchema = UpdateTopicTimestampResponseBody$inboundSchema; + /** @deprecated use `UpdateTopicTimestampResponseBody$outboundSchema` instead. */ + export const outboundSchema = UpdateTopicTimestampResponseBody$outboundSchema; + /** @deprecated use `UpdateTopicTimestampResponseBody$Outbound` instead. */ + export type Outbound = UpdateTopicTimestampResponseBody$Outbound; } diff --git a/src/sdk/models/operations/updateuser.ts b/src/sdk/models/operations/updateuser.ts index bf33111..c17bdab 100644 --- a/src/sdk/models/operations/updateuser.ts +++ b/src/sdk/models/operations/updateuser.ts @@ -1,76 +1,235 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose, Type } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class UpdateUserExternalIds extends SpeakeasyBase {} +export type UpdateUserExternalIds = {}; -export class UpdateUserRequestBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "external_ids" }) - @Type(() => UpdateUserExternalIds) - externalIds?: UpdateUserExternalIds; +export type UpdateUserRequestBody = { + externalIds?: UpdateUserExternalIds | undefined; + name?: string | undefined; +}; - @SpeakeasyMetadata() - @Expose({ name: "name" }) - name?: string; -} - -export class UpdateUserRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Key" }) +export type UpdateUserRequest = { apiKey: string; - - @SpeakeasyMetadata({ data: "header, style=simple;explode=false;name=Api-Username" }) apiUsername: string; - - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=username" }) + requestBody?: UpdateUserRequestBody | undefined; username: string; +}; - @SpeakeasyMetadata({ data: "request, media_type=application/json" }) - requestBody?: UpdateUserRequestBody; -} - -export class UpdateUserUser extends SpeakeasyBase {} +export type UpdateUserUser = {}; /** * user updated */ -export class UpdateUserResponseBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "success" }) +export type UpdateUserResponseBody = { success: string; - - @SpeakeasyMetadata() - @Expose({ name: "user" }) - @Type(() => UpdateUserUser) user: UpdateUserUser; +}; + +/** @internal */ +export const UpdateUserExternalIds$inboundSchema: z.ZodType< + UpdateUserExternalIds, + z.ZodTypeDef, + unknown +> = z.object({}); + +/** @internal */ +export type UpdateUserExternalIds$Outbound = {}; + +/** @internal */ +export const UpdateUserExternalIds$outboundSchema: z.ZodType< + UpdateUserExternalIds$Outbound, + z.ZodTypeDef, + UpdateUserExternalIds +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateUserExternalIds$ { + /** @deprecated use `UpdateUserExternalIds$inboundSchema` instead. */ + export const inboundSchema = UpdateUserExternalIds$inboundSchema; + /** @deprecated use `UpdateUserExternalIds$outboundSchema` instead. */ + export const outboundSchema = UpdateUserExternalIds$outboundSchema; + /** @deprecated use `UpdateUserExternalIds$Outbound` instead. */ + export type Outbound = UpdateUserExternalIds$Outbound; } -export class UpdateUserResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const UpdateUserRequestBody$inboundSchema: z.ZodType< + UpdateUserRequestBody, + z.ZodTypeDef, + unknown +> = z + .object({ + external_ids: z.lazy(() => UpdateUserExternalIds$inboundSchema).optional(), + name: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + external_ids: "externalIds", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type UpdateUserRequestBody$Outbound = { + external_ids?: UpdateUserExternalIds$Outbound | undefined; + name?: string | undefined; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const UpdateUserRequestBody$outboundSchema: z.ZodType< + UpdateUserRequestBody$Outbound, + z.ZodTypeDef, + UpdateUserRequestBody +> = z + .object({ + externalIds: z.lazy(() => UpdateUserExternalIds$outboundSchema).optional(), + name: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + externalIds: "external_ids", + }); + }); - /** - * user updated - */ - @SpeakeasyMetadata() - object?: UpdateUserResponseBody; +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateUserRequestBody$ { + /** @deprecated use `UpdateUserRequestBody$inboundSchema` instead. */ + export const inboundSchema = UpdateUserRequestBody$inboundSchema; + /** @deprecated use `UpdateUserRequestBody$outboundSchema` instead. */ + export const outboundSchema = UpdateUserRequestBody$outboundSchema; + /** @deprecated use `UpdateUserRequestBody$Outbound` instead. */ + export type Outbound = UpdateUserRequestBody$Outbound; +} + +/** @internal */ +export const UpdateUserRequest$inboundSchema: z.ZodType = + z + .object({ + "Api-Key": z.string(), + "Api-Username": z.string(), + RequestBody: z.lazy(() => UpdateUserRequestBody$inboundSchema).optional(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + "Api-Key": "apiKey", + "Api-Username": "apiUsername", + RequestBody: "requestBody", + }); + }); + +/** @internal */ +export type UpdateUserRequest$Outbound = { + "Api-Key": string; + "Api-Username": string; + RequestBody?: UpdateUserRequestBody$Outbound | undefined; + username: string; +}; + +/** @internal */ +export const UpdateUserRequest$outboundSchema: z.ZodType< + UpdateUserRequest$Outbound, + z.ZodTypeDef, + UpdateUserRequest +> = z + .object({ + apiKey: z.string(), + apiUsername: z.string(), + requestBody: z.lazy(() => UpdateUserRequestBody$outboundSchema).optional(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + apiKey: "Api-Key", + apiUsername: "Api-Username", + requestBody: "RequestBody", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateUserRequest$ { + /** @deprecated use `UpdateUserRequest$inboundSchema` instead. */ + export const inboundSchema = UpdateUserRequest$inboundSchema; + /** @deprecated use `UpdateUserRequest$outboundSchema` instead. */ + export const outboundSchema = UpdateUserRequest$outboundSchema; + /** @deprecated use `UpdateUserRequest$Outbound` instead. */ + export type Outbound = UpdateUserRequest$Outbound; +} + +/** @internal */ +export const UpdateUserUser$inboundSchema: z.ZodType = + z.object({}); + +/** @internal */ +export type UpdateUserUser$Outbound = {}; + +/** @internal */ +export const UpdateUserUser$outboundSchema: z.ZodType< + UpdateUserUser$Outbound, + z.ZodTypeDef, + UpdateUserUser +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateUserUser$ { + /** @deprecated use `UpdateUserUser$inboundSchema` instead. */ + export const inboundSchema = UpdateUserUser$inboundSchema; + /** @deprecated use `UpdateUserUser$outboundSchema` instead. */ + export const outboundSchema = UpdateUserUser$outboundSchema; + /** @deprecated use `UpdateUserUser$Outbound` instead. */ + export type Outbound = UpdateUserUser$Outbound; +} + +/** @internal */ +export const UpdateUserResponseBody$inboundSchema: z.ZodType< + UpdateUserResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + success: z.string(), + user: z.lazy(() => UpdateUserUser$inboundSchema), +}); + +/** @internal */ +export type UpdateUserResponseBody$Outbound = { + success: string; + user: UpdateUserUser$Outbound; +}; + +/** @internal */ +export const UpdateUserResponseBody$outboundSchema: z.ZodType< + UpdateUserResponseBody$Outbound, + z.ZodTypeDef, + UpdateUserResponseBody +> = z.object({ + success: z.string(), + user: z.lazy(() => UpdateUserUser$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateUserResponseBody$ { + /** @deprecated use `UpdateUserResponseBody$inboundSchema` instead. */ + export const inboundSchema = UpdateUserResponseBody$inboundSchema; + /** @deprecated use `UpdateUserResponseBody$outboundSchema` instead. */ + export const outboundSchema = UpdateUserResponseBody$outboundSchema; + /** @deprecated use `UpdateUserResponseBody$Outbound` instead. */ + export type Outbound = UpdateUserResponseBody$Outbound; } diff --git a/src/sdk/models/operations/updateusername.ts b/src/sdk/models/operations/updateusername.ts index c6f4997..42a74cc 100644 --- a/src/sdk/models/operations/updateusername.ts +++ b/src/sdk/models/operations/updateusername.ts @@ -1,41 +1,114 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { SpeakeasyBase, SpeakeasyMetadata } from "../../../internal/utils"; -import { AxiosResponse } from "axios"; -import { Expose } from "class-transformer"; +import { remap as remap$ } from "../../../lib/primitives.js"; +import * as z from "zod"; -export class UpdateUsernameRequestBody extends SpeakeasyBase { - @SpeakeasyMetadata() - @Expose({ name: "new_username" }) +export type UpdateUsernameRequestBody = { newUsername: string; -} +}; -export class UpdateUsernameRequest extends SpeakeasyBase { - @SpeakeasyMetadata({ data: "pathParam, style=simple;explode=false;name=username" }) +export type UpdateUsernameRequest = { + requestBody?: UpdateUsernameRequestBody | undefined; username: string; +}; - @SpeakeasyMetadata({ data: "request, media_type=application/json" }) - requestBody?: UpdateUsernameRequestBody; +/** @internal */ +export const UpdateUsernameRequestBody$inboundSchema: z.ZodType< + UpdateUsernameRequestBody, + z.ZodTypeDef, + unknown +> = z + .object({ + new_username: z.string(), + }) + .transform((v) => { + return remap$(v, { + new_username: "newUsername", + }); + }); + +/** @internal */ +export type UpdateUsernameRequestBody$Outbound = { + new_username: string; +}; + +/** @internal */ +export const UpdateUsernameRequestBody$outboundSchema: z.ZodType< + UpdateUsernameRequestBody$Outbound, + z.ZodTypeDef, + UpdateUsernameRequestBody +> = z + .object({ + newUsername: z.string(), + }) + .transform((v) => { + return remap$(v, { + newUsername: "new_username", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateUsernameRequestBody$ { + /** @deprecated use `UpdateUsernameRequestBody$inboundSchema` instead. */ + export const inboundSchema = UpdateUsernameRequestBody$inboundSchema; + /** @deprecated use `UpdateUsernameRequestBody$outboundSchema` instead. */ + export const outboundSchema = UpdateUsernameRequestBody$outboundSchema; + /** @deprecated use `UpdateUsernameRequestBody$Outbound` instead. */ + export type Outbound = UpdateUsernameRequestBody$Outbound; } -export class UpdateUsernameResponse extends SpeakeasyBase { - /** - * HTTP response content type for this operation - */ - @SpeakeasyMetadata() - contentType: string; +/** @internal */ +export const UpdateUsernameRequest$inboundSchema: z.ZodType< + UpdateUsernameRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + RequestBody: z.lazy(() => UpdateUsernameRequestBody$inboundSchema).optional(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + RequestBody: "requestBody", + }); + }); - /** - * HTTP response status code for this operation - */ - @SpeakeasyMetadata() - statusCode: number; +/** @internal */ +export type UpdateUsernameRequest$Outbound = { + RequestBody?: UpdateUsernameRequestBody$Outbound | undefined; + username: string; +}; - /** - * Raw HTTP response; suitable for custom response parsing - */ - @SpeakeasyMetadata() - rawResponse: AxiosResponse; +/** @internal */ +export const UpdateUsernameRequest$outboundSchema: z.ZodType< + UpdateUsernameRequest$Outbound, + z.ZodTypeDef, + UpdateUsernameRequest +> = z + .object({ + requestBody: z.lazy(() => UpdateUsernameRequestBody$outboundSchema).optional(), + username: z.string(), + }) + .transform((v) => { + return remap$(v, { + requestBody: "RequestBody", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateUsernameRequest$ { + /** @deprecated use `UpdateUsernameRequest$inboundSchema` instead. */ + export const inboundSchema = UpdateUsernameRequest$inboundSchema; + /** @deprecated use `UpdateUsernameRequest$outboundSchema` instead. */ + export const outboundSchema = UpdateUsernameRequest$outboundSchema; + /** @deprecated use `UpdateUsernameRequest$Outbound` instead. */ + export type Outbound = UpdateUsernameRequest$Outbound; } diff --git a/src/sdk/notifications.ts b/src/sdk/notifications.ts index fe6e444..af5f047 100644 --- a/src/sdk/notifications.ts +++ b/src/sdk/notifications.ts @@ -1,152 +1,30 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as utils from "../internal/utils"; -import * as errors from "../sdk/models/errors"; -import * as operations from "../sdk/models/operations"; -import { SDKConfiguration } from "./sdk"; -import { AxiosInstance, AxiosRequestConfig, AxiosResponse, RawAxiosRequestHeaders } from "axios"; - -export class Notifications { - private sdkConfiguration: SDKConfiguration; - - constructor(sdkConfig: SDKConfiguration) { - this.sdkConfiguration = sdkConfig; - } +import { notificationsGetNotifications } from "../funcs/notificationsGetNotifications.js"; +import { notificationsMarkNotificationsAsRead } from "../funcs/notificationsMarkNotificationsAsRead.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as operations from "./models/operations/index.js"; +import { unwrapAsync } from "./types/fp.js"; +export class Notifications extends ClientSDK { /** * Get the notifications that belong to the current user */ async getNotifications( - config?: AxiosRequestConfig - ): Promise { - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = baseURL.replace(/\/$/, "") + "/notifications.json"; - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.GetNotificationsResponse = new operations.GetNotificationsResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.GetNotificationsResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + options?: RequestOptions + ): Promise { + return unwrapAsync(notificationsGetNotifications(this, options)); } /** * Mark notifications as read */ async markNotificationsAsRead( - req: operations.MarkNotificationsAsReadRequestBody, - config?: AxiosRequestConfig - ): Promise { - if (!(req instanceof utils.SpeakeasyBase)) { - req = new operations.MarkNotificationsAsReadRequestBody(req); - } - - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = baseURL.replace(/\/$/, "") + "/notifications/mark-read.json"; - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "request", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "put", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.MarkNotificationsAsReadResponse = - new operations.MarkNotificationsAsReadResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.MarkNotificationsAsReadResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + request?: operations.MarkNotificationsAsReadRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(notificationsMarkNotificationsAsRead(this, request, options)); } } diff --git a/src/sdk/posts.ts b/src/sdk/posts.ts index 915ee6a..42cd676 100644 --- a/src/sdk/posts.ts +++ b/src/sdk/posts.ts @@ -1,93 +1,28 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as utils from "../internal/utils"; -import * as errors from "../sdk/models/errors"; -import * as operations from "../sdk/models/operations"; -import { SDKConfiguration } from "./sdk"; -import { AxiosInstance, AxiosRequestConfig, AxiosResponse, RawAxiosRequestHeaders } from "axios"; - -export class Posts { - private sdkConfiguration: SDKConfiguration; - - constructor(sdkConfig: SDKConfiguration) { - this.sdkConfiguration = sdkConfig; - } +import { postsCreateTopicPostPM } from "../funcs/postsCreateTopicPostPM.js"; +import { postsDeletePost } from "../funcs/postsDeletePost.js"; +import { postsGetPost } from "../funcs/postsGetPost.js"; +import { postsListPosts } from "../funcs/postsListPosts.js"; +import { postsLockPost } from "../funcs/postsLockPost.js"; +import { postsPerformPostAction } from "../funcs/postsPerformPostAction.js"; +import { postsPostReplies } from "../funcs/postsPostReplies.js"; +import { postsUpdatePost } from "../funcs/postsUpdatePost.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as operations from "./models/operations/index.js"; +import { unwrapAsync } from "./types/fp.js"; +export class Posts extends ClientSDK { /** * Creates a new topic, a new post, or a private message */ async createTopicPostPM( - req: operations.CreateTopicPostPMRequestBody, - config?: AxiosRequestConfig - ): Promise { - if (!(req instanceof utils.SpeakeasyBase)) { - req = new operations.CreateTopicPostPMRequestBody(req); - } - - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = baseURL.replace(/\/$/, "") + "/posts.json"; - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "request", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "post", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.CreateTopicPostPMResponse = new operations.CreateTopicPostPMResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.CreateTopicPostPMResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + request?: operations.CreateTopicPostPMRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(postsCreateTopicPostPM(this, request, options)); } /** @@ -95,61 +30,10 @@ export class Posts { */ async deletePost( id: number, - requestBody?: operations.DeletePostRequestBody, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.DeletePostRequest({ - id: id, - requestBody: requestBody, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL(baseURL, "/posts/{id}.json", req); - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "requestBody", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "*/*"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "delete", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.DeletePostResponse = new operations.DeletePostResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - switch (true) { - case httpRes?.status == 200: - break; - } - - return res; + requestBody?: operations.DeletePostRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(postsDeletePost(this, id, requestBody, options)); } /** @@ -163,58 +47,8 @@ export class Posts { * refer to various different flag types. * */ - async getPost(id: string, config?: AxiosRequestConfig): Promise { - const req = new operations.GetPostRequest({ - id: id, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL(baseURL, "/posts/{id}.json", req); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.GetPostResponse = new operations.GetPostResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass(JSON.parse(decodedRes)); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + async getPost(id: string, options?: RequestOptions): Promise { + return unwrapAsync(postsGetPost(this, id, options)); } /** @@ -223,69 +57,10 @@ export class Posts { async listPosts( apiKey: string, apiUsername: string, - before?: string, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.ListPostsRequest({ - apiKey: apiKey, - apiUsername: apiUsername, - before: before, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = baseURL.replace(/\/$/, "") + "/posts.json"; - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { - ...utils.getHeadersFromRequest(req), - ...config?.headers, - }; - const queryParams: string = utils.serializeQueryParams(req); - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl + queryParams, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.ListPostsResponse = new operations.ListPostsResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.ListPostsResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + before?: string | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(postsListPosts(this, apiKey, apiUsername, before, options)); } /** @@ -295,81 +70,10 @@ export class Posts { apiKey: string, apiUsername: string, id: string, - requestBody?: operations.LockPostRequestBody, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.LockPostRequest({ - apiKey: apiKey, - apiUsername: apiUsername, - id: id, - requestBody: requestBody, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL(baseURL, "/posts/{id}/locked.json", req); - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "requestBody", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { - ...utils.getHeadersFromRequest(req), - ...reqBodyHeaders, - ...config?.headers, - }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "put", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.LockPostResponse = new operations.LockPostResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.LockPostResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + requestBody?: operations.LockPostRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(postsLockPost(this, apiKey, apiUsername, id, requestBody, options)); } /** @@ -378,80 +82,10 @@ export class Posts { async performPostAction( apiKey: string, apiUsername: string, - requestBody?: operations.PerformPostActionRequestBody, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.PerformPostActionRequest({ - apiKey: apiKey, - apiUsername: apiUsername, - requestBody: requestBody, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = baseURL.replace(/\/$/, "") + "/post_actions.json"; - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "requestBody", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { - ...utils.getHeadersFromRequest(req), - ...reqBodyHeaders, - ...config?.headers, - }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "post", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.PerformPostActionResponse = new operations.PerformPostActionResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.PerformPostActionResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + requestBody?: operations.PerformPostActionRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(postsPerformPostAction(this, apiKey, apiUsername, requestBody, options)); } /** @@ -459,65 +93,9 @@ export class Posts { */ async postReplies( id: string, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.PostRepliesRequest({ - id: id, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL(baseURL, "/posts/{id}/replies.json", req); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.PostRepliesResponse = new operations.PostRepliesResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.responseBodies = []; - const resFieldDepth: number = utils.getResFieldDepth(res); - res.responseBodies = utils.objectToClass( - JSON.parse(decodedRes), - operations.PostRepliesResponseBody, - resFieldDepth - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + options?: RequestOptions + ): Promise> { + return unwrapAsync(postsPostReplies(this, id, options)); } /** @@ -525,74 +103,9 @@ export class Posts { */ async updatePost( id: string, - requestBody?: operations.UpdatePostRequestBody, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.UpdatePostRequest({ - id: id, - requestBody: requestBody, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL(baseURL, "/posts/{id}.json", req); - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "requestBody", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "put", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.UpdatePostResponse = new operations.UpdatePostResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.UpdatePostResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + requestBody?: operations.UpdatePostRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(postsUpdatePost(this, id, requestBody, options)); } } diff --git a/src/sdk/privatemessages.ts b/src/sdk/privatemessages.ts index dc5b400..0a27192 100644 --- a/src/sdk/privatemessages.ts +++ b/src/sdk/privatemessages.ts @@ -1,93 +1,23 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as utils from "../internal/utils"; -import * as errors from "../sdk/models/errors"; -import * as operations from "../sdk/models/operations"; -import { SDKConfiguration } from "./sdk"; -import { AxiosInstance, AxiosRequestConfig, AxiosResponse, RawAxiosRequestHeaders } from "axios"; - -export class PrivateMessages { - private sdkConfiguration: SDKConfiguration; - - constructor(sdkConfig: SDKConfiguration) { - this.sdkConfiguration = sdkConfig; - } +import { privateMessagesCreateTopicPostPM } from "../funcs/privateMessagesCreateTopicPostPM.js"; +import { privateMessagesGetUserSentPrivateMessages } from "../funcs/privateMessagesGetUserSentPrivateMessages.js"; +import { privateMessagesListUserPrivateMessages } from "../funcs/privateMessagesListUserPrivateMessages.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as operations from "./models/operations/index.js"; +import { unwrapAsync } from "./types/fp.js"; +export class PrivateMessages extends ClientSDK { /** * Creates a new topic, a new post, or a private message */ async createTopicPostPM( - req: operations.CreateTopicPostPMRequestBody, - config?: AxiosRequestConfig - ): Promise { - if (!(req instanceof utils.SpeakeasyBase)) { - req = new operations.CreateTopicPostPMRequestBody(req); - } - - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = baseURL.replace(/\/$/, "") + "/posts.json"; - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "request", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "post", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.CreateTopicPostPMResponse = new operations.CreateTopicPostPMResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.CreateTopicPostPMResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + request?: operations.CreateTopicPostPMRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(privateMessagesCreateTopicPostPM(this, request, options)); } /** @@ -95,67 +25,9 @@ export class PrivateMessages { */ async getUserSentPrivateMessages( username: string, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.GetUserSentPrivateMessagesRequest({ - username: username, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL( - baseURL, - "/topics/private-messages-sent/{username}.json", - req - ); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.GetUserSentPrivateMessagesResponse = - new operations.GetUserSentPrivateMessagesResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.GetUserSentPrivateMessagesResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + options?: RequestOptions + ): Promise { + return unwrapAsync(privateMessagesGetUserSentPrivateMessages(this, username, options)); } /** @@ -163,66 +35,8 @@ export class PrivateMessages { */ async listUserPrivateMessages( username: string, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.ListUserPrivateMessagesRequest({ - username: username, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL( - baseURL, - "/topics/private-messages/{username}.json", - req - ); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.ListUserPrivateMessagesResponse = - new operations.ListUserPrivateMessagesResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.ListUserPrivateMessagesResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + options?: RequestOptions + ): Promise { + return unwrapAsync(privateMessagesListUserPrivateMessages(this, username, options)); } } diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts index 9431e78..cb8a87d 100644 --- a/src/sdk/sdk.ts +++ b/src/sdk/sdk.ts @@ -1,196 +1,97 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as utils from "../internal/utils"; -import { Admin } from "./admin"; -import { Backups } from "./backups"; -import { Badges } from "./badges"; -import { Categories } from "./categories"; -import { Groups } from "./groups"; -import { Invites } from "./invites"; -import { Notifications } from "./notifications"; -import { Posts } from "./posts"; -import { PrivateMessages } from "./privatemessages"; -import { Search } from "./search"; -import { Site } from "./site"; -import { Tags } from "./tags"; -import { Topics } from "./topics"; -import { Uploads } from "./uploads"; -import { Users } from "./users"; -import axios from "axios"; -import { AxiosInstance } from "axios"; +import { ClientSDK } from "../lib/sdks.js"; +import { Admin } from "./admin.js"; +import { Backups } from "./backups.js"; +import { Badges } from "./badges.js"; +import { Categories } from "./categories.js"; +import { Groups } from "./groups.js"; +import { Invites } from "./invites.js"; +import { Notifications } from "./notifications.js"; +import { Posts } from "./posts.js"; +import { PrivateMessages } from "./privatemessages.js"; +import { Search } from "./search.js"; +import { Site } from "./site.js"; +import { Tags } from "./tags.js"; +import { Topics } from "./topics.js"; +import { Uploads } from "./uploads.js"; +import { Users } from "./users.js"; -/** - * Contains the list of servers available to the SDK - */ -export const ServerList = ["https://{defaultHost}"] as const; +export class SDK extends ClientSDK { + private _backups?: Backups; + get backups(): Backups { + return (this._backups ??= new Backups(this.options$)); + } -/** - * The available configuration options for the SDK - */ -export type SDKProps = { - /** - * Allows overriding the default axios client used by the SDK - */ - defaultClient?: AxiosInstance; + private _badges?: Badges; + get badges(): Badges { + return (this._badges ??= new Badges(this.options$)); + } - /** - * Allows overriding the default server used by the SDK - */ - serverIdx?: number; + private _groups?: Groups; + get groups(): Groups { + return (this._groups ??= new Groups(this.options$)); + } - /** - * Allows setting the defaultHost variable for url substitution - */ - defaultHost?: string; + private _users?: Users; + get users(): Users { + return (this._users ??= new Users(this.options$)); + } - /** - * Allows overriding the default server URL used by the SDK - */ - serverURL?: string; - /** - * Allows overriding the default retry config used by the SDK - */ - retryConfig?: utils.RetryConfig; -}; + private _admin?: Admin; + get admin(): Admin { + return (this._admin ??= new Admin(this.options$)); + } -export class SDKConfiguration { - defaultClient: AxiosInstance; - serverURL: string; - serverDefaults: any; - language = "typescript"; - openapiDocVersion = "latest"; - sdkVersion = "0.4.10"; - genVersion = "2.379.3"; - userAgent = "speakeasy-sdk/typescript 0.4.10 2.379.3 latest @lukehagar/discoursejs"; - retryConfig?: utils.RetryConfig; - public constructor(init?: Partial) { - Object.assign(this, init); - } -} - -/** - * Discourse API Documentation: This page contains the documentation on how to use Discourse through API calls. - * - * @remarks - * - * > Note: For any endpoints not listed you can follow the - * [reverse engineer the Discourse API](https://meta.discourse.org/t/-/20576) - * guide to figure out how to use an API endpoint. - * - * ### Request Content-Type - * - * The Content-Type for POST and PUT requests can be set to `application/x-www-form-urlencoded`, - * `multipart/form-data`, or `application/json`. - * - * ### Endpoint Names and Response Content-Type - * - * Most API endpoints provide the same content as their HTML counterparts. For example - * the URL `/categories` serves a list of categories, the `/categories.json` API provides the - * same information in JSON format. - * - * Instead of sending API requests to `/categories.json` you may also send them to `/categories` - * and add an `Accept: application/json` header to the request to get the JSON response. - * Sending requests with the `Accept` header is necessary if you want to use URLs - * for related endpoints returned by the API, such as pagination URLs. - * These URLs are returned without the `.json` prefix so you need to add the header in - * order to get the correct response format. - * - * ### Authentication - * - * Some endpoints do not require any authentication, pretty much anything else will - * require you to be authenticated. - * - * To become authenticated you will need to create an API Key from the admin panel. - * - * Once you have your API Key you can pass it in along with your API Username - * as an HTTP header like this: - * - * ``` - * curl -X GET "http://127.0.0.1:3000/admin/users/list/active.json" \ - * -H "Api-Key: 714552c6148e1617aeab526d0606184b94a80ec048fc09894ff1a72b740c5f19" \ - * -H "Api-Username: system" - * ``` - * - * and this is how POST requests will look: - * - * ``` - * curl -X POST "http://127.0.0.1:3000/categories" \ - * -H "Content-Type: multipart/form-data;" \ - * -H "Api-Key: 714552c6148e1617aeab526d0606184b94a80ec048fc09894ff1a72b740c5f19" \ - * -H "Api-Username: system" \ - * -F "name=89853c20-4409-e91a-a8ea-f6cdff96aaaa" \ - * -F "color=49d9e9" \ - * -F "text_color=f0fcfd" - * ``` - * - * ### Boolean values - * - * If an endpoint accepts a boolean be sure to specify it as a lowercase - * `true` or `false` value unless noted otherwise. - * - */ -export class SDK { - public backups: Backups; - public badges: Badges; - public groups: Groups; - public users: Users; - public admin: Admin; - public categories: Categories; - public invites: Invites; - public topics: Topics; - public notifications: Notifications; - public posts: Posts; - public privateMessages: PrivateMessages; - public search: Search; - public site: Site; - public tags: Tags; - public uploads: Uploads; - - private sdkConfiguration: SDKConfiguration; - - constructor(props?: SDKProps) { - let serverURL = props?.serverURL; - let defaults: any = {}; - - const serverDefaults = [ - { - defaultHost: props?.defaultHost?.toString() ?? "discourse.example.com", - }, - ]; - - if (!serverURL) { - const serverIdx = props?.serverIdx ?? 0; - if (serverIdx < 0 || serverIdx >= ServerList.length) { - throw new Error(`Invalid server index ${serverIdx}`); - } - serverURL = ServerList[serverIdx]; - defaults = serverDefaults[serverIdx]; - } - - const defaultClient = props?.defaultClient ?? axios.create(); - this.sdkConfiguration = new SDKConfiguration({ - defaultClient: defaultClient, - serverURL: serverURL, - serverDefaults: defaults, - retryConfig: props?.retryConfig, - }); - - this.backups = new Backups(this.sdkConfiguration); - this.badges = new Badges(this.sdkConfiguration); - this.groups = new Groups(this.sdkConfiguration); - this.users = new Users(this.sdkConfiguration); - this.admin = new Admin(this.sdkConfiguration); - this.categories = new Categories(this.sdkConfiguration); - this.invites = new Invites(this.sdkConfiguration); - this.topics = new Topics(this.sdkConfiguration); - this.notifications = new Notifications(this.sdkConfiguration); - this.posts = new Posts(this.sdkConfiguration); - this.privateMessages = new PrivateMessages(this.sdkConfiguration); - this.search = new Search(this.sdkConfiguration); - this.site = new Site(this.sdkConfiguration); - this.tags = new Tags(this.sdkConfiguration); - this.uploads = new Uploads(this.sdkConfiguration); + private _categories?: Categories; + get categories(): Categories { + return (this._categories ??= new Categories(this.options$)); + } + + private _invites?: Invites; + get invites(): Invites { + return (this._invites ??= new Invites(this.options$)); + } + + private _topics?: Topics; + get topics(): Topics { + return (this._topics ??= new Topics(this.options$)); + } + + private _notifications?: Notifications; + get notifications(): Notifications { + return (this._notifications ??= new Notifications(this.options$)); + } + + private _posts?: Posts; + get posts(): Posts { + return (this._posts ??= new Posts(this.options$)); + } + + private _privateMessages?: PrivateMessages; + get privateMessages(): PrivateMessages { + return (this._privateMessages ??= new PrivateMessages(this.options$)); + } + + private _search?: Search; + get search(): Search { + return (this._search ??= new Search(this.options$)); + } + + private _site?: Site; + get site(): Site { + return (this._site ??= new Site(this.options$)); + } + + private _tags?: Tags; + get tags(): Tags { + return (this._tags ??= new Tags(this.options$)); + } + + private _uploads?: Uploads; + get uploads(): Uploads { + return (this._uploads ??= new Uploads(this.options$)); } } diff --git a/src/sdk/search.ts b/src/sdk/search.ts index 0ccece6..81c1cca 100644 --- a/src/sdk/search.ts +++ b/src/sdk/search.ts @@ -1,83 +1,21 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as utils from "../internal/utils"; -import * as errors from "../sdk/models/errors"; -import * as operations from "../sdk/models/operations"; -import { SDKConfiguration } from "./sdk"; -import { AxiosInstance, AxiosRequestConfig, AxiosResponse, RawAxiosRequestHeaders } from "axios"; - -export class Search { - private sdkConfiguration: SDKConfiguration; - - constructor(sdkConfig: SDKConfiguration) { - this.sdkConfiguration = sdkConfig; - } +import { searchSearch } from "../funcs/searchSearch.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as operations from "./models/operations/index.js"; +import { unwrapAsync } from "./types/fp.js"; +export class Search extends ClientSDK { /** * Search for a term */ async search( - page?: number, - q?: string, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.SearchRequest({ - page: page, - q: q, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = baseURL.replace(/\/$/, "") + "/search.json"; - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - const queryParams: string = utils.serializeQueryParams(req); - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl + queryParams, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.SearchResponse = new operations.SearchResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.SearchResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + page?: number | undefined, + q?: string | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(searchSearch(this, page, q, options)); } } diff --git a/src/sdk/site.ts b/src/sdk/site.ts index 24e2dba..c0d4be3 100644 --- a/src/sdk/site.ts +++ b/src/sdk/site.ts @@ -1,77 +1,20 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as utils from "../internal/utils"; -import * as errors from "../sdk/models/errors"; -import * as operations from "../sdk/models/operations"; -import { SDKConfiguration } from "./sdk"; -import { AxiosInstance, AxiosRequestConfig, AxiosResponse, RawAxiosRequestHeaders } from "axios"; - -export class Site { - private sdkConfiguration: SDKConfiguration; - - constructor(sdkConfig: SDKConfiguration) { - this.sdkConfiguration = sdkConfig; - } +import { siteGetSite } from "../funcs/siteGetSite.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as operations from "./models/operations/index.js"; +import { unwrapAsync } from "./types/fp.js"; +export class Site extends ClientSDK { /** * Get site info * * @remarks * Can be used to fetch all categories and subcategories */ - async getSite(config?: AxiosRequestConfig): Promise { - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = baseURL.replace(/\/$/, "") + "/site.json"; - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.GetSiteResponse = new operations.GetSiteResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.GetSiteResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + async getSite(options?: RequestOptions): Promise { + return unwrapAsync(siteGetSite(this, options)); } } diff --git a/src/sdk/tags.ts b/src/sdk/tags.ts index 8099464..bf8cf4c 100644 --- a/src/sdk/tags.ts +++ b/src/sdk/tags.ts @@ -1,153 +1,33 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as utils from "../internal/utils"; -import * as errors from "../sdk/models/errors"; -import * as operations from "../sdk/models/operations"; -import { SDKConfiguration } from "./sdk"; -import { AxiosInstance, AxiosRequestConfig, AxiosResponse, RawAxiosRequestHeaders } from "axios"; - -export class Tags { - private sdkConfiguration: SDKConfiguration; - - constructor(sdkConfig: SDKConfiguration) { - this.sdkConfiguration = sdkConfig; - } +import { tagsCreateTagGroup } from "../funcs/tagsCreateTagGroup.js"; +import { tagsGetTag } from "../funcs/tagsGetTag.js"; +import { tagsGetTagGroup } from "../funcs/tagsGetTagGroup.js"; +import { tagsListTagGroups } from "../funcs/tagsListTagGroups.js"; +import { tagsListTags } from "../funcs/tagsListTags.js"; +import { tagsUpdateTagGroup } from "../funcs/tagsUpdateTagGroup.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as operations from "./models/operations/index.js"; +import { unwrapAsync } from "./types/fp.js"; +export class Tags extends ClientSDK { /** * Creates a tag group */ async createTagGroup( - req: operations.CreateTagGroupRequestBody, - config?: AxiosRequestConfig - ): Promise { - if (!(req instanceof utils.SpeakeasyBase)) { - req = new operations.CreateTagGroupRequestBody(req); - } - - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = baseURL.replace(/\/$/, "") + "/tag_groups.json"; - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "request", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "post", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.CreateTagGroupResponse = new operations.CreateTagGroupResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.CreateTagGroupResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + request?: operations.CreateTagGroupRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(tagsCreateTagGroup(this, request, options)); } /** * Get a specific tag */ - async getTag(name: string, config?: AxiosRequestConfig): Promise { - const req = new operations.GetTagRequest({ - name: name, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL(baseURL, "/tag/{name}.json", req); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.GetTagResponse = new operations.GetTagResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.GetTagResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + async getTag(name: string, options?: RequestOptions): Promise { + return unwrapAsync(tagsGetTag(this, name, options)); } /** @@ -155,176 +35,23 @@ export class Tags { */ async getTagGroup( id: string, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.GetTagGroupRequest({ - id: id, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL(baseURL, "/tag_groups/{id}.json", req); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.GetTagGroupResponse = new operations.GetTagGroupResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.GetTagGroupResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + options?: RequestOptions + ): Promise { + return unwrapAsync(tagsGetTagGroup(this, id, options)); } /** * Get a list of tag groups */ - async listTagGroups(config?: AxiosRequestConfig): Promise { - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = baseURL.replace(/\/$/, "") + "/tag_groups.json"; - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.ListTagGroupsResponse = new operations.ListTagGroupsResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.ListTagGroupsResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + async listTagGroups(options?: RequestOptions): Promise { + return unwrapAsync(tagsListTagGroups(this, options)); } /** * Get a list of tags */ - async listTags(config?: AxiosRequestConfig): Promise { - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = baseURL.replace(/\/$/, "") + "/tags.json"; - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.ListTagsResponse = new operations.ListTagsResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.ListTagsResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + async listTags(options?: RequestOptions): Promise { + return unwrapAsync(tagsListTags(this, options)); } /** @@ -332,74 +59,9 @@ export class Tags { */ async updateTagGroup( id: string, - requestBody?: operations.UpdateTagGroupRequestBody, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.UpdateTagGroupRequest({ - id: id, - requestBody: requestBody, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL(baseURL, "/tag_groups/{id}.json", req); - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "requestBody", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "put", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.UpdateTagGroupResponse = new operations.UpdateTagGroupResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.UpdateTagGroupResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + requestBody?: operations.UpdateTagGroupRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(tagsUpdateTagGroup(this, id, requestBody, options)); } } diff --git a/src/sdk/topics.ts b/src/sdk/topics.ts index 1538876..24b6d8f 100644 --- a/src/sdk/topics.ts +++ b/src/sdk/topics.ts @@ -1,20 +1,25 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as utils from "../internal/utils"; -import * as errors from "../sdk/models/errors"; -import * as operations from "../sdk/models/operations"; -import { SDKConfiguration } from "./sdk"; -import { AxiosInstance, AxiosRequestConfig, AxiosResponse, RawAxiosRequestHeaders } from "axios"; - -export class Topics { - private sdkConfiguration: SDKConfiguration; - - constructor(sdkConfig: SDKConfiguration) { - this.sdkConfiguration = sdkConfig; - } +import { topicsBookmarkTopic } from "../funcs/topicsBookmarkTopic.js"; +import { topicsCreateTopicPostPM } from "../funcs/topicsCreateTopicPostPM.js"; +import { topicsCreateTopicTimer } from "../funcs/topicsCreateTopicTimer.js"; +import { topicsGetTopic } from "../funcs/topicsGetTopic.js"; +import { topicsGetTopicByExternalId } from "../funcs/topicsGetTopicByExternalId.js"; +import { topicsInviteToTopic } from "../funcs/topicsInviteToTopic.js"; +import { topicsListLatestTopics } from "../funcs/topicsListLatestTopics.js"; +import { topicsListTopTopics } from "../funcs/topicsListTopTopics.js"; +import { topicsRemoveTopic } from "../funcs/topicsRemoveTopic.js"; +import { topicsSetNotificationLevel } from "../funcs/topicsSetNotificationLevel.js"; +import { topicsUpdateTopic } from "../funcs/topicsUpdateTopic.js"; +import { topicsUpdateTopicStatus } from "../funcs/topicsUpdateTopicStatus.js"; +import { topicsUpdateTopicTimestamp } from "../funcs/topicsUpdateTopicTimestamp.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as operations from "./models/operations/index.js"; +import { unwrapAsync } from "./types/fp.js"; +export class Topics extends ClientSDK { /** * Bookmark topic */ @@ -22,128 +27,19 @@ export class Topics { apiKey: string, apiUsername: string, id: string, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.BookmarkTopicRequest({ - apiKey: apiKey, - apiUsername: apiUsername, - id: id, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL(baseURL, "/t/{id}/bookmark.json", req); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { - ...utils.getHeadersFromRequest(req), - ...config?.headers, - }; - headers["Accept"] = "*/*"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "put", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.BookmarkTopicResponse = new operations.BookmarkTopicResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - switch (true) { - case httpRes?.status == 200: - break; - } - - return res; + options?: RequestOptions + ): Promise { + return unwrapAsync(topicsBookmarkTopic(this, apiKey, apiUsername, id, options)); } /** * Creates a new topic, a new post, or a private message */ async createTopicPostPM( - req: operations.CreateTopicPostPMRequestBody, - config?: AxiosRequestConfig - ): Promise { - if (!(req instanceof utils.SpeakeasyBase)) { - req = new operations.CreateTopicPostPMRequestBody(req); - } - - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = baseURL.replace(/\/$/, "") + "/posts.json"; - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "request", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "post", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.CreateTopicPostPMResponse = new operations.CreateTopicPostPMResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.CreateTopicPostPMResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + request?: operations.CreateTopicPostPMRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(topicsCreateTopicPostPM(this, request, options)); } /** @@ -153,81 +49,12 @@ export class Topics { apiKey: string, apiUsername: string, id: string, - requestBody?: operations.CreateTopicTimerRequestBody, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.CreateTopicTimerRequest({ - apiKey: apiKey, - apiUsername: apiUsername, - id: id, - requestBody: requestBody, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults + requestBody?: operations.CreateTopicTimerRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync( + topicsCreateTopicTimer(this, apiKey, apiUsername, id, requestBody, options) ); - const operationUrl: string = utils.generateURL(baseURL, "/t/{id}/timer.json", req); - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "requestBody", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { - ...utils.getHeadersFromRequest(req), - ...reqBodyHeaders, - ...config?.headers, - }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "post", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.CreateTopicTimerResponse = new operations.CreateTopicTimerResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.CreateTopicTimerResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; } /** @@ -237,121 +64,16 @@ export class Topics { apiKey: string, apiUsername: string, id: string, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.GetTopicRequest({ - apiKey: apiKey, - apiUsername: apiUsername, - id: id, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL(baseURL, "/t/{id}.json", req); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { - ...utils.getHeadersFromRequest(req), - ...config?.headers, - }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.GetTopicResponse = new operations.GetTopicResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.GetTopicResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + options?: RequestOptions + ): Promise { + return unwrapAsync(topicsGetTopic(this, apiKey, apiUsername, id, options)); } /** * Get topic by external_id */ - async getTopicByExternalId( - externalId: string, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.GetTopicByExternalIdRequest({ - externalId: externalId, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL( - baseURL, - "/t/external_id/{external_id}.json", - req - ); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "*/*"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.GetTopicByExternalIdResponse = - new operations.GetTopicByExternalIdResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - switch (true) { - case httpRes?.status == 301: - break; - } - - return res; + async getTopicByExternalId(externalId: string, options?: RequestOptions): Promise { + return unwrapAsync(topicsGetTopicByExternalId(this, externalId, options)); } /** @@ -361,81 +83,12 @@ export class Topics { apiKey: string, apiUsername: string, id: string, - requestBody?: operations.InviteToTopicRequestBody, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.InviteToTopicRequest({ - apiKey: apiKey, - apiUsername: apiUsername, - id: id, - requestBody: requestBody, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults + requestBody?: operations.InviteToTopicRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync( + topicsInviteToTopic(this, apiKey, apiUsername, id, requestBody, options) ); - const operationUrl: string = utils.generateURL(baseURL, "/t/{id}/invite.json", req); - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "requestBody", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { - ...utils.getHeadersFromRequest(req), - ...reqBodyHeaders, - ...config?.headers, - }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "post", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.InviteToTopicResponse = new operations.InviteToTopicResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.InviteToTopicResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; } /** @@ -444,71 +97,13 @@ export class Topics { async listLatestTopics( apiKey: string, apiUsername: string, - ascending?: string, - order?: string, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.ListLatestTopicsRequest({ - apiKey: apiKey, - apiUsername: apiUsername, - ascending: ascending, - order: order, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults + ascending?: string | undefined, + order?: string | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync( + topicsListLatestTopics(this, apiKey, apiUsername, ascending, order, options) ); - const operationUrl: string = baseURL.replace(/\/$/, "") + "/latest.json"; - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { - ...utils.getHeadersFromRequest(req), - ...config?.headers, - }; - const queryParams: string = utils.serializeQueryParams(req); - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl + queryParams, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.ListLatestTopicsResponse = new operations.ListLatestTopicsResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.ListLatestTopicsResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; } /** @@ -517,69 +112,10 @@ export class Topics { async listTopTopics( apiKey: string, apiUsername: string, - period?: string, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.ListTopTopicsRequest({ - apiKey: apiKey, - apiUsername: apiUsername, - period: period, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = baseURL.replace(/\/$/, "") + "/top.json"; - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { - ...utils.getHeadersFromRequest(req), - ...config?.headers, - }; - const queryParams: string = utils.serializeQueryParams(req); - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl + queryParams, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.ListTopTopicsResponse = new operations.ListTopTopicsResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.ListTopTopicsResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + period?: string | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(topicsListTopTopics(this, apiKey, apiUsername, period, options)); } /** @@ -589,53 +125,9 @@ export class Topics { apiKey: string, apiUsername: string, id: string, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.RemoveTopicRequest({ - apiKey: apiKey, - apiUsername: apiUsername, - id: id, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL(baseURL, "/t/{id}.json", req); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { - ...utils.getHeadersFromRequest(req), - ...config?.headers, - }; - headers["Accept"] = "*/*"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "delete", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.RemoveTopicResponse = new operations.RemoveTopicResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - switch (true) { - case httpRes?.status == 200: - break; - } - - return res; + options?: RequestOptions + ): Promise { + return unwrapAsync(topicsRemoveTopic(this, apiKey, apiUsername, id, options)); } /** @@ -645,82 +137,12 @@ export class Topics { apiKey: string, apiUsername: string, id: string, - requestBody?: operations.SetNotificationLevelRequestBody, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.SetNotificationLevelRequest({ - apiKey: apiKey, - apiUsername: apiUsername, - id: id, - requestBody: requestBody, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults + requestBody?: operations.SetNotificationLevelRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync( + topicsSetNotificationLevel(this, apiKey, apiUsername, id, requestBody, options) ); - const operationUrl: string = utils.generateURL(baseURL, "/t/{id}/notifications.json", req); - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "requestBody", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { - ...utils.getHeadersFromRequest(req), - ...reqBodyHeaders, - ...config?.headers, - }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "post", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.SetNotificationLevelResponse = - new operations.SetNotificationLevelResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.SetNotificationLevelResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; } /** @@ -730,81 +152,10 @@ export class Topics { apiKey: string, apiUsername: string, id: string, - requestBody?: operations.UpdateTopicRequestBody, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.UpdateTopicRequest({ - apiKey: apiKey, - apiUsername: apiUsername, - id: id, - requestBody: requestBody, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL(baseURL, "/t/-/{id}.json", req); - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "requestBody", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { - ...utils.getHeadersFromRequest(req), - ...reqBodyHeaders, - ...config?.headers, - }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "put", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.UpdateTopicResponse = new operations.UpdateTopicResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.UpdateTopicResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + requestBody?: operations.UpdateTopicRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(topicsUpdateTopic(this, apiKey, apiUsername, id, requestBody, options)); } /** @@ -814,81 +165,12 @@ export class Topics { apiKey: string, apiUsername: string, id: string, - requestBody?: operations.UpdateTopicStatusRequestBody, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.UpdateTopicStatusRequest({ - apiKey: apiKey, - apiUsername: apiUsername, - id: id, - requestBody: requestBody, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults + requestBody?: operations.UpdateTopicStatusRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync( + topicsUpdateTopicStatus(this, apiKey, apiUsername, id, requestBody, options) ); - const operationUrl: string = utils.generateURL(baseURL, "/t/{id}/status.json", req); - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "requestBody", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { - ...utils.getHeadersFromRequest(req), - ...reqBodyHeaders, - ...config?.headers, - }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "put", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.UpdateTopicStatusResponse = new operations.UpdateTopicStatusResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.UpdateTopicStatusResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; } /** @@ -898,85 +180,11 @@ export class Topics { apiKey: string, apiUsername: string, id: string, - requestBody?: operations.UpdateTopicTimestampRequestBody, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.UpdateTopicTimestampRequest({ - apiKey: apiKey, - apiUsername: apiUsername, - id: id, - requestBody: requestBody, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults + requestBody?: operations.UpdateTopicTimestampRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync( + topicsUpdateTopicTimestamp(this, apiKey, apiUsername, id, requestBody, options) ); - const operationUrl: string = utils.generateURL( - baseURL, - "/t/{id}/change-timestamp.json", - req - ); - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "requestBody", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { - ...utils.getHeadersFromRequest(req), - ...reqBodyHeaders, - ...config?.headers, - }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "put", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.UpdateTopicTimestampResponse = - new operations.UpdateTopicTimestampResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.UpdateTopicTimestampResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; } } diff --git a/src/sdk/types/blobs.ts b/src/sdk/types/blobs.ts new file mode 100644 index 0000000..4ce8460 --- /dev/null +++ b/src/sdk/types/blobs.ts @@ -0,0 +1,31 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; + +export const blobLikeSchema: z.ZodType = + z.custom(isBlobLike, { + message: "expected a Blob, File or Blob-like object", + fatal: true, + }); + +export function isBlobLike(val: unknown): val is Blob { + if (val instanceof Blob) { + return true; + } + + if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) { + return false; + } + + const name = val[Symbol.toStringTag]; + if (typeof name !== "string") { + return false; + } + if (name !== "Blob" && name !== "File") { + return false; + } + + return "stream" in val && typeof val.stream === "function"; +} diff --git a/src/sdk/types/enums.ts b/src/sdk/types/enums.ts new file mode 100644 index 0000000..6fb6d91 --- /dev/null +++ b/src/sdk/types/enums.ts @@ -0,0 +1,16 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +declare const __brand: unique symbol; +export type Unrecognized = T & { [__brand]: "unrecognized" }; + +export function catchUnrecognizedEnum(value: T): Unrecognized { + return value as Unrecognized; +} + +type Prettify = { [K in keyof T]: T[K] } & {}; +export type ClosedEnum = T[keyof T]; +export type OpenEnum = + | Prettify + | Unrecognized; diff --git a/src/sdk/types/fp.ts b/src/sdk/types/fp.ts new file mode 100644 index 0000000..ccbe51e --- /dev/null +++ b/src/sdk/types/fp.ts @@ -0,0 +1,50 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +/** + * A monad that captures the result of a function call or an error if it was not + * successful. Railway programming, enabled by this type, can be a nicer + * alternative to traditional exception throwing because it allows functions to + * declare all _known_ errors with static types and then check for them + * exhaustively in application code. Thrown exception have a type of `unknown` + * and break out of regular control flow of programs making them harder to + * inspect and more verbose work with due to try-catch blocks. + */ +export type Result = + | { ok: true; value: T; error?: never } + | { ok: false; value?: never; error: E }; + +export function OK(value: V): Result { + return { ok: true, value }; +} + +export function ERR(error: E): Result { + return { ok: false, error }; +} + +/** + * unwrap is a convenience function for extracting a value from a result or + * throwing if there was an error. + */ +export function unwrap(r: Result): T { + if (!r.ok) { + throw r.error; + } + return r.value; +} + +/** + * unwrapAsync is a convenience function for resolving a value from a Promise + * of a result or rejecting if an error occurred. + */ +export async function unwrapAsync( + pr: Promise>, +): Promise { + const r = await pr; + if (!r.ok) { + throw r.error; + } + + return r.value; +} diff --git a/src/sdk/types/index.ts b/src/sdk/types/index.ts index 0c6e757..dbaa5e6 100644 --- a/src/sdk/types/index.ts +++ b/src/sdk/types/index.ts @@ -1,5 +1,11 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -export * from "./rfcdate"; +export { RFCDate } from "./rfcdate.js"; +export { blobLikeSchema, isBlobLike } from "./blobs.js"; +export type { Paginator, PageIterator } from "./operations.js"; +export { createPageIterator } from "./operations.js"; +export { catchUnrecognizedEnum } from "./enums.js"; +export type { OpenEnum, ClosedEnum, Unrecognized } from "./enums.js"; +export type { Result } from "./fp.js"; diff --git a/src/sdk/types/operations.ts b/src/sdk/types/operations.ts new file mode 100644 index 0000000..0952f6f --- /dev/null +++ b/src/sdk/types/operations.ts @@ -0,0 +1,99 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { Result } from "./fp.js"; + +export type Paginator = () => Promise }> | null; + +export type PageIterator = V & { + next: Paginator; + [Symbol.asyncIterator]: () => AsyncIterableIterator; +}; + +export function createPageIterator( + page: V & { next: Paginator }, + halt: (v: V) => boolean, +): { + [Symbol.asyncIterator]: () => AsyncIterableIterator; +} { + return { + [Symbol.asyncIterator]: async function* paginator() { + yield page; + if (halt(page)) { + return; + } + + let p: typeof page | null = page; + for (p = await p.next(); p != null; p = await p.next()) { + yield p; + if (halt(p)) { + return; + } + } + }, + }; +} + +/** + * This utility create a special iterator that yields a single value and + * terminates. It is useful in paginated SDK functions that have early return + * paths when things go wrong. + */ +export function haltIterator(v: V): PageIterator { + return { + ...v, + next: () => null, + [Symbol.asyncIterator]: async function* paginator() { + yield v; + }, + }; +} + +/** + * Converts an async iterator of `Result` into an async iterator of `V`. + * When error results occur, the underlying error value is thrown. + */ +export async function unwrapResultIterator( + iteratorPromise: Promise>>, +): Promise> { + const resultIter = await iteratorPromise; + + if (!resultIter.ok) { + throw resultIter.error; + } + + return { + ...resultIter.value, + next: unwrapPaginator(resultIter.next), + [Symbol.asyncIterator]: async function* paginator() { + for await (const page of resultIter) { + if (!page.ok) { + throw page.error; + } + yield page.value; + } + }, + }; +} + +function unwrapPaginator( + paginator: Paginator>, +): Paginator { + return () => { + const nextResult = paginator(); + if (nextResult == null) { + return null; + } + return nextResult.then((res) => { + if (!res.ok) { + throw res.error; + } + const out = { + ...res.value, + next: unwrapPaginator(res.next), + }; + return out; + }); + }; +} diff --git a/src/sdk/types/rfcdate.ts b/src/sdk/types/rfcdate.ts index d28fe65..c79b3f5 100644 --- a/src/sdk/types/rfcdate.ts +++ b/src/sdk/types/rfcdate.ts @@ -1,48 +1,54 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ +const dateRE = /^\d{4}-\d{2}-\d{2}$/; + export class RFCDate { - private date: Date; + private serialized: string; - constructor(date: Date | { date: string } | string | undefined) { - if (!date) { - this.date = new Date(); - return; + /** + * Creates a new RFCDate instance using today's date. + */ + static today(): RFCDate { + return new RFCDate(new Date()); + } + + /** + * Creates a new RFCDate instance using the provided input. + * If a string is used then in must be in the format YYYY-MM-DD. + * + * @param date A Date object or a date string in YYYY-MM-DD format + * @example + * new RFCDate("2022-01-01") + * @example + * new RFCDate(new Date()) + */ + constructor(date: Date | string) { + if (typeof date === "string" && !dateRE.test(date)) { + throw new RangeError( + "RFCDate: date strings must be in the format YYYY-MM-DD: " + date, + ); } - if (typeof date === "string") { - this.date = new Date(date); - return; - } - if (date instanceof Date) { - this.date = date as Date; - return; + const value = new Date(date); + if (isNaN(+value)) { + throw new RangeError("RFCDate: invalid date provided: " + date); } - const anyDate = date as any; - if (date && !!anyDate.date) { - this.date = new Date(anyDate.date); + this.serialized = value.toISOString().slice(0, "YYYY-MM-DD".length); + if (!dateRE.test(this.serialized)) { + throw new TypeError( + `RFCDate: failed to build valid date with given value: ${date} serialized to ${this.serialized}`, + ); } } - public getDate(): Date { - return this.date; - } - - public toJSON(): string { + toJSON(): string { return this.toString(); } - public toString(): string { - const dateRegex = /^(\d{4})-(\d{2})-(\d{2})/; - - const matches = this.date.toISOString().match(dateRegex); - if (matches == null) { - throw new Error("Date format is not valid"); - } - - const [, year, month, day]: RegExpMatchArray = matches; - return `${year}-${month}-${day}`; + toString(): string { + return this.serialized; } } diff --git a/src/sdk/uploads.ts b/src/sdk/uploads.ts index 13bccc3..3c0303c 100644 --- a/src/sdk/uploads.ts +++ b/src/sdk/uploads.ts @@ -1,20 +1,19 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as utils from "../internal/utils"; -import * as errors from "../sdk/models/errors"; -import * as operations from "../sdk/models/operations"; -import { SDKConfiguration } from "./sdk"; -import { AxiosInstance, AxiosRequestConfig, AxiosResponse, RawAxiosRequestHeaders } from "axios"; - -export class Uploads { - private sdkConfiguration: SDKConfiguration; - - constructor(sdkConfig: SDKConfiguration) { - this.sdkConfiguration = sdkConfig; - } +import { uploadsAbortMultipart } from "../funcs/uploadsAbortMultipart.js"; +import { uploadsBatchPresignMultipartParts } from "../funcs/uploadsBatchPresignMultipartParts.js"; +import { uploadsCompleteExternalUpload } from "../funcs/uploadsCompleteExternalUpload.js"; +import { uploadsCompleteMultipart } from "../funcs/uploadsCompleteMultipart.js"; +import { uploadsCreateMultipartUpload } from "../funcs/uploadsCreateMultipartUpload.js"; +import { uploadsCreateUpload } from "../funcs/uploadsCreateUpload.js"; +import { uploadsGeneratePresignedPut } from "../funcs/uploadsGeneratePresignedPut.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as operations from "./models/operations/index.js"; +import { unwrapAsync } from "./types/fp.js"; +export class Uploads extends ClientSDK { /** * Abort multipart upload * @@ -34,75 +33,10 @@ export class Uploads { * */ async abortMultipart( - req: operations.AbortMultipartRequestBody, - config?: AxiosRequestConfig - ): Promise { - if (!(req instanceof utils.SpeakeasyBase)) { - req = new operations.AbortMultipartRequestBody(req); - } - - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = baseURL.replace(/\/$/, "") + "/uploads/abort-multipart.json"; - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "request", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "post", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.AbortMultipartResponse = new operations.AbortMultipartResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.AbortMultipartResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + request?: operations.AbortMultipartRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(uploadsAbortMultipart(this, request, options)); } /** @@ -133,77 +67,10 @@ export class Uploads { * */ async batchPresignMultipartParts( - req: operations.BatchPresignMultipartPartsRequestBody, - config?: AxiosRequestConfig - ): Promise { - if (!(req instanceof utils.SpeakeasyBase)) { - req = new operations.BatchPresignMultipartPartsRequestBody(req); - } - - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = - baseURL.replace(/\/$/, "") + "/uploads/batch-presign-multipart-parts.json"; - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "request", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "post", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.BatchPresignMultipartPartsResponse = - new operations.BatchPresignMultipartPartsResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.BatchPresignMultipartPartsResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + request?: operations.BatchPresignMultipartPartsRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(uploadsBatchPresignMultipartParts(this, request, options)); } /** @@ -230,77 +97,10 @@ export class Uploads { * */ async completeExternalUpload( - req: operations.CompleteExternalUploadRequestBody, - config?: AxiosRequestConfig - ): Promise { - if (!(req instanceof utils.SpeakeasyBase)) { - req = new operations.CompleteExternalUploadRequestBody(req); - } - - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = - baseURL.replace(/\/$/, "") + "/uploads/complete-external-upload.json"; - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "request", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "post", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.CompleteExternalUploadResponse = - new operations.CompleteExternalUploadResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.CompleteExternalUploadResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + request?: operations.CompleteExternalUploadRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(uploadsCompleteExternalUpload(this, request, options)); } /** @@ -324,76 +124,10 @@ export class Uploads { * */ async completeMultipart( - req: operations.CompleteMultipartRequestBody, - config?: AxiosRequestConfig - ): Promise { - if (!(req instanceof utils.SpeakeasyBase)) { - req = new operations.CompleteMultipartRequestBody(req); - } - - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = - baseURL.replace(/\/$/, "") + "/uploads/complete-multipart.json"; - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "request", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "post", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.CompleteMultipartResponse = new operations.CompleteMultipartResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.CompleteMultipartResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + request?: operations.CompleteMultipartRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(uploadsCompleteMultipart(this, request, options)); } /** @@ -414,151 +148,20 @@ export class Uploads { * */ async createMultipartUpload( - req: operations.CreateMultipartUploadRequestBody, - config?: AxiosRequestConfig - ): Promise { - if (!(req instanceof utils.SpeakeasyBase)) { - req = new operations.CreateMultipartUploadRequestBody(req); - } - - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = baseURL.replace(/\/$/, "") + "/uploads/create-multipart.json"; - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "request", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "post", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.CreateMultipartUploadResponse = - new operations.CreateMultipartUploadResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.CreateMultipartUploadResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + request?: operations.CreateMultipartUploadRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(uploadsCreateMultipartUpload(this, request, options)); } /** * Creates an upload */ async createUpload( - req: operations.CreateUploadRequestBody, - config?: AxiosRequestConfig - ): Promise { - if (!(req instanceof utils.SpeakeasyBase)) { - req = new operations.CreateUploadRequestBody(req); - } - - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = baseURL.replace(/\/$/, "") + "/uploads.json"; - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "request", "multipart"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "post", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.CreateUploadResponse = new operations.CreateUploadResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.CreateUploadResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + request?: operations.CreateUploadRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(uploadsCreateUpload(this, request, options)); } /** @@ -588,76 +191,9 @@ export class Uploads { * */ async generatePresignedPut( - req: operations.GeneratePresignedPutRequestBody, - config?: AxiosRequestConfig - ): Promise { - if (!(req instanceof utils.SpeakeasyBase)) { - req = new operations.GeneratePresignedPutRequestBody(req); - } - - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = - baseURL.replace(/\/$/, "") + "/uploads/generate-presigned-put.json"; - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "request", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "post", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.GeneratePresignedPutResponse = - new operations.GeneratePresignedPutResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.GeneratePresignedPutResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + request?: operations.GeneratePresignedPutRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(uploadsGeneratePresignedPut(this, request, options)); } } diff --git a/src/sdk/users.ts b/src/sdk/users.ts index b1dc3d1..3b5175d 100644 --- a/src/sdk/users.ts +++ b/src/sdk/users.ts @@ -1,85 +1,44 @@ /* - * Code generated by Speakeasy (https://speakeasyapi.com). DO NOT EDIT. + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import * as utils from "../internal/utils"; -import * as errors from "../sdk/models/errors"; -import * as operations from "../sdk/models/operations"; -import { SDKConfiguration } from "./sdk"; -import { AxiosInstance, AxiosRequestConfig, AxiosResponse, RawAxiosRequestHeaders } from "axios"; - -export class Users { - private sdkConfiguration: SDKConfiguration; - - constructor(sdkConfig: SDKConfiguration) { - this.sdkConfiguration = sdkConfig; - } +import { usersActivateUser } from "../funcs/usersActivateUser.js"; +import { usersAdminGetUser } from "../funcs/usersAdminGetUser.js"; +import { usersAdminListUsers } from "../funcs/usersAdminListUsers.js"; +import { usersAnonymizeUser } from "../funcs/usersAnonymizeUser.js"; +import { usersChangePassword } from "../funcs/usersChangePassword.js"; +import { usersCreateUser } from "../funcs/usersCreateUser.js"; +import { usersDeactivateUser } from "../funcs/usersDeactivateUser.js"; +import { usersDeleteUser } from "../funcs/usersDeleteUser.js"; +import { usersGetUser } from "../funcs/usersGetUser.js"; +import { usersGetUserEmails } from "../funcs/usersGetUserEmails.js"; +import { usersGetUserExternalId } from "../funcs/usersGetUserExternalId.js"; +import { usersGetUserIdentiyProviderExternalId } from "../funcs/usersGetUserIdentiyProviderExternalId.js"; +import { usersListUserActions } from "../funcs/usersListUserActions.js"; +import { usersListUserBadges } from "../funcs/usersListUserBadges.js"; +import { usersListUsersPublic } from "../funcs/usersListUsersPublic.js"; +import { usersLogOutUser } from "../funcs/usersLogOutUser.js"; +import { usersRefreshGravatar } from "../funcs/usersRefreshGravatar.js"; +import { usersSendPasswordResetEmail } from "../funcs/usersSendPasswordResetEmail.js"; +import { usersSilenceUser } from "../funcs/usersSilenceUser.js"; +import { usersSuspendUser } from "../funcs/usersSuspendUser.js"; +import { usersUpdateAvatar } from "../funcs/usersUpdateAvatar.js"; +import { usersUpdateEmail } from "../funcs/usersUpdateEmail.js"; +import { usersUpdateUser } from "../funcs/usersUpdateUser.js"; +import { usersUpdateUsername } from "../funcs/usersUpdateUsername.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as operations from "./models/operations/index.js"; +import { unwrapAsync } from "./types/fp.js"; +export class Users extends ClientSDK { /** * Activate a user */ async activateUser( id: number, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.ActivateUserRequest({ - id: id, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL( - baseURL, - "/admin/users/{id}/activate.json", - req - ); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "put", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.ActivateUserResponse = new operations.ActivateUserResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.ActivateUserResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + options?: RequestOptions + ): Promise { + return unwrapAsync(usersActivateUser(this, id, options)); } /** @@ -87,134 +46,19 @@ export class Users { */ async adminGetUser( id: number, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.AdminGetUserRequest({ - id: id, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL(baseURL, "/admin/users/{id}.json", req); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.AdminGetUserResponse = new operations.AdminGetUserResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.AdminGetUserResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + options?: RequestOptions + ): Promise { + return unwrapAsync(usersAdminGetUser(this, id, options)); } /** * Get a list of users */ async adminListUsers( - req: operations.AdminListUsersRequest, - config?: AxiosRequestConfig - ): Promise { - if (!(req instanceof utils.SpeakeasyBase)) { - req = new operations.AdminListUsersRequest(req); - } - - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL( - baseURL, - "/admin/users/list/{flag}.json", - req - ); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - const queryParams: string = utils.serializeQueryParams(req); - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl + queryParams, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.AdminListUsersResponse = new operations.AdminListUsersResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.responseBodies = []; - const resFieldDepth: number = utils.getResFieldDepth(res); - res.responseBodies = utils.objectToClass( - JSON.parse(decodedRes), - operations.AdminListUsersResponseBody, - resFieldDepth - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + request: operations.AdminListUsersRequest, + options?: RequestOptions + ): Promise> { + return unwrapAsync(usersAdminListUsers(this, request, options)); } /** @@ -222,66 +66,9 @@ export class Users { */ async anonymizeUser( id: number, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.AnonymizeUserRequest({ - id: id, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL( - baseURL, - "/admin/users/{id}/anonymize.json", - req - ); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "put", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.AnonymizeUserResponse = new operations.AnonymizeUserResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.AnonymizeUserResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + options?: RequestOptions + ): Promise { + return unwrapAsync(usersAnonymizeUser(this, id, options)); } /** @@ -289,65 +76,10 @@ export class Users { */ async changePassword( token: string, - requestBody?: operations.ChangePasswordRequestBody, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.ChangePasswordRequest({ - token: token, - requestBody: requestBody, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL( - baseURL, - "/users/password-reset/{token}.json", - req - ); - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "requestBody", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "*/*"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "put", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.ChangePasswordResponse = new operations.ChangePasswordResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - switch (true) { - case httpRes?.status == 200: - break; - } - - return res; + requestBody?: operations.ChangePasswordRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(usersChangePassword(this, token, requestBody, options)); } /** @@ -356,80 +88,10 @@ export class Users { async createUser( apiKey: string, apiUsername: string, - requestBody?: operations.CreateUserRequestBody, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.CreateUserRequest({ - apiKey: apiKey, - apiUsername: apiUsername, - requestBody: requestBody, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = baseURL.replace(/\/$/, "") + "/users.json"; - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "requestBody", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { - ...utils.getHeadersFromRequest(req), - ...reqBodyHeaders, - ...config?.headers, - }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "post", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.CreateUserResponse = new operations.CreateUserResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.CreateUserResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + requestBody?: operations.CreateUserRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(usersCreateUser(this, apiKey, apiUsername, requestBody, options)); } /** @@ -437,66 +99,9 @@ export class Users { */ async deactivateUser( id: number, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.DeactivateUserRequest({ - id: id, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL( - baseURL, - "/admin/users/{id}/deactivate.json", - req - ); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "put", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.DeactivateUserResponse = new operations.DeactivateUserResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.DeactivateUserResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + options?: RequestOptions + ): Promise { + return unwrapAsync(usersDeactivateUser(this, id, options)); } /** @@ -504,75 +109,10 @@ export class Users { */ async deleteUser( id: number, - requestBody?: operations.DeleteUserRequestBody, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.DeleteUserRequest({ - id: id, - requestBody: requestBody, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL(baseURL, "/admin/users/{id}.json", req); - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "requestBody", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "delete", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.DeleteUserResponse = new operations.DeleteUserResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.DeleteUserResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + requestBody?: operations.DeleteUserRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(usersDeleteUser(this, id, requestBody, options)); } /** @@ -582,67 +122,9 @@ export class Users { apiKey: string, apiUsername: string, username: string, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.GetUserRequest({ - apiKey: apiKey, - apiUsername: apiUsername, - username: username, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL(baseURL, "/u/{username}.json", req); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { - ...utils.getHeadersFromRequest(req), - ...config?.headers, - }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.GetUserResponse = new operations.GetUserResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.GetUserResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + options?: RequestOptions + ): Promise { + return unwrapAsync(usersGetUser(this, apiKey, apiUsername, username, options)); } /** @@ -650,62 +132,9 @@ export class Users { */ async getUserEmails( username: string, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.GetUserEmailsRequest({ - username: username, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL(baseURL, "/u/{username}/emails.json", req); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.GetUserEmailsResponse = new operations.GetUserEmailsResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.GetUserEmailsResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + options?: RequestOptions + ): Promise { + return unwrapAsync(usersGetUserEmails(this, username, options)); } /** @@ -715,71 +144,9 @@ export class Users { apiKey: string, apiUsername: string, externalId: string, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.GetUserExternalIdRequest({ - apiKey: apiKey, - apiUsername: apiUsername, - externalId: externalId, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL( - baseURL, - "/u/by-external/{external_id}.json", - req - ); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { - ...utils.getHeadersFromRequest(req), - ...config?.headers, - }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.GetUserExternalIdResponse = new operations.GetUserExternalIdResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.GetUserExternalIdResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + options?: RequestOptions + ): Promise { + return unwrapAsync(usersGetUserExternalId(this, apiKey, apiUsername, externalId, options)); } /** @@ -790,73 +157,18 @@ export class Users { apiUsername: string, externalId: string, provider: string, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.GetUserIdentiyProviderExternalIdRequest({ - apiKey: apiKey, - apiUsername: apiUsername, - externalId: externalId, - provider: provider, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults + options?: RequestOptions + ): Promise { + return unwrapAsync( + usersGetUserIdentiyProviderExternalId( + this, + apiKey, + apiUsername, + externalId, + provider, + options + ) ); - const operationUrl: string = utils.generateURL( - baseURL, - "/u/by-external/{provider}/{external_id}.json", - req - ); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { - ...utils.getHeadersFromRequest(req), - ...config?.headers, - }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.GetUserIdentiyProviderExternalIdResponse = - new operations.GetUserIdentiyProviderExternalIdResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.GetUserIdentiyProviderExternalIdResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; } /** @@ -866,65 +178,9 @@ export class Users { filter: string, offset: number, username: string, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.ListUserActionsRequest({ - filter: filter, - offset: offset, - username: username, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = baseURL.replace(/\/$/, "") + "/user_actions.json"; - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - const queryParams: string = utils.serializeQueryParams(req); - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl + queryParams, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.ListUserActionsResponse = new operations.ListUserActionsResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.ListUserActionsResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + options?: RequestOptions + ): Promise { + return unwrapAsync(usersListUserActions(this, filter, offset, username, options)); } /** @@ -932,66 +188,9 @@ export class Users { */ async listUserBadges( username: string, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.ListUserBadgesRequest({ - username: username, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL( - baseURL, - "/user-badges/{username}.json", - req - ); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.ListUserBadgesResponse = new operations.ListUserBadgesResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.ListUserBadgesResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + options?: RequestOptions + ): Promise { + return unwrapAsync(usersListUserBadges(this, username, options)); } /** @@ -1000,68 +199,11 @@ export class Users { async listUsersPublic( order: operations.Order, period: operations.Period, - asc?: operations.Asc, - page?: number, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.ListUsersPublicRequest({ - order: order, - period: period, - asc: asc, - page: page, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = baseURL.replace(/\/$/, "") + "/directory_items.json"; - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - const queryParams: string = utils.serializeQueryParams(req); - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl + queryParams, - method: "get", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.ListUsersPublicResponse = new operations.ListUsersPublicResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.ListUsersPublicResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + asc?: operations.Asc | undefined, + page?: number | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(usersListUsersPublic(this, order, period, asc, page, options)); } /** @@ -1069,66 +211,9 @@ export class Users { */ async logOutUser( id: number, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.LogOutUserRequest({ - id: id, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL( - baseURL, - "/admin/users/{id}/log_out.json", - req - ); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "post", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.LogOutUserResponse = new operations.LogOutUserResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.LogOutUserResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + options?: RequestOptions + ): Promise { + return unwrapAsync(usersLogOutUser(this, id, options)); } /** @@ -1136,142 +221,19 @@ export class Users { */ async refreshGravatar( username: string, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.RefreshGravatarRequest({ - username: username, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL( - baseURL, - "/user_avatar/{username}/refresh_gravatar.json", - req - ); - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "post", - headers: headers, - responseType: "arraybuffer", - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.RefreshGravatarResponse = new operations.RefreshGravatarResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.RefreshGravatarResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + options?: RequestOptions + ): Promise { + return unwrapAsync(usersRefreshGravatar(this, username, options)); } /** * Send password reset email */ async sendPasswordResetEmail( - req: operations.SendPasswordResetEmailRequestBody, - config?: AxiosRequestConfig - ): Promise { - if (!(req instanceof utils.SpeakeasyBase)) { - req = new operations.SendPasswordResetEmailRequestBody(req); - } - - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = baseURL.replace(/\/$/, "") + "/session/forgot_password.json"; - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "request", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "post", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.SendPasswordResetEmailResponse = - new operations.SendPasswordResetEmailResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.SendPasswordResetEmailResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + request?: operations.SendPasswordResetEmailRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(usersSendPasswordResetEmail(this, request, options)); } /** @@ -1279,79 +241,10 @@ export class Users { */ async silenceUser( id: number, - requestBody?: operations.SilenceUserRequestBody, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.SilenceUserRequest({ - id: id, - requestBody: requestBody, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL( - baseURL, - "/admin/users/{id}/silence.json", - req - ); - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "requestBody", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "put", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.SilenceUserResponse = new operations.SilenceUserResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.SilenceUserResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + requestBody?: operations.SilenceUserRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(usersSilenceUser(this, id, requestBody, options)); } /** @@ -1359,79 +252,10 @@ export class Users { */ async suspendUser( id: number, - requestBody?: operations.SuspendUserRequestBody, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.SuspendUserRequest({ - id: id, - requestBody: requestBody, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL( - baseURL, - "/admin/users/{id}/suspend.json", - req - ); - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "requestBody", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "put", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.SuspendUserResponse = new operations.SuspendUserResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.SuspendUserResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + requestBody?: operations.SuspendUserRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(usersSuspendUser(this, id, requestBody, options)); } /** @@ -1439,79 +263,10 @@ export class Users { */ async updateAvatar( username: string, - requestBody?: operations.UpdateAvatarRequestBody, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.UpdateAvatarRequest({ - username: username, - requestBody: requestBody, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL( - baseURL, - "/u/{username}/preferences/avatar/pick.json", - req - ); - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "requestBody", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "put", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.UpdateAvatarResponse = new operations.UpdateAvatarResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.UpdateAvatarResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; + requestBody?: operations.UpdateAvatarRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(usersUpdateAvatar(this, username, requestBody, options)); } /** @@ -1519,65 +274,10 @@ export class Users { */ async updateEmail( username: string, - requestBody?: operations.UpdateEmailRequestBody, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.UpdateEmailRequest({ - username: username, - requestBody: requestBody, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL( - baseURL, - "/u/{username}/preferences/email.json", - req - ); - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "requestBody", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "*/*"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "put", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.UpdateEmailResponse = new operations.UpdateEmailResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - switch (true) { - case httpRes?.status == 200: - break; - } - - return res; + requestBody?: operations.UpdateEmailRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(usersUpdateEmail(this, username, requestBody, options)); } /** @@ -1587,81 +287,12 @@ export class Users { apiKey: string, apiUsername: string, username: string, - requestBody?: operations.UpdateUserRequestBody, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.UpdateUserRequest({ - apiKey: apiKey, - apiUsername: apiUsername, - username: username, - requestBody: requestBody, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults + requestBody?: operations.UpdateUserRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync( + usersUpdateUser(this, apiKey, apiUsername, username, requestBody, options) ); - const operationUrl: string = utils.generateURL(baseURL, "/u/{username}.json", req); - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "requestBody", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { - ...utils.getHeadersFromRequest(req), - ...reqBodyHeaders, - ...config?.headers, - }; - headers["Accept"] = "application/json"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "put", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.UpdateUserResponse = new operations.UpdateUserResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - const decodedRes = new TextDecoder().decode(httpRes?.data); - switch (true) { - case httpRes?.status == 200: - if (utils.matchContentType(responseContentType, `application/json`)) { - res.object = utils.objectToClass( - JSON.parse(decodedRes), - operations.UpdateUserResponseBody - ); - } else { - throw new errors.SDKError( - "unknown content-type received: " + responseContentType, - httpRes.status, - decodedRes, - httpRes - ); - } - break; - } - - return res; } /** @@ -1669,64 +300,9 @@ export class Users { */ async updateUsername( username: string, - requestBody?: operations.UpdateUsernameRequestBody, - config?: AxiosRequestConfig - ): Promise { - const req = new operations.UpdateUsernameRequest({ - username: username, - requestBody: requestBody, - }); - const baseURL: string = utils.templateUrl( - this.sdkConfiguration.serverURL, - this.sdkConfiguration.serverDefaults - ); - const operationUrl: string = utils.generateURL( - baseURL, - "/u/{username}/preferences/username.json", - req - ); - - let [reqBodyHeaders, reqBody]: [object, any] = [{}, null]; - - try { - [reqBodyHeaders, reqBody] = utils.serializeRequestBody(req, "requestBody", "json"); - } catch (e: unknown) { - if (e instanceof Error) { - throw new Error(`Error serializing request body, cause: ${e.message}`); - } - } - const client: AxiosInstance = this.sdkConfiguration.defaultClient; - const headers: RawAxiosRequestHeaders = { ...reqBodyHeaders, ...config?.headers }; - headers["Accept"] = "*/*"; - - headers["user-agent"] = this.sdkConfiguration.userAgent; - - const httpRes: AxiosResponse = await client.request({ - validateStatus: () => true, - url: operationUrl, - method: "put", - headers: headers, - responseType: "arraybuffer", - data: reqBody, - ...config, - }); - - const responseContentType: string = httpRes?.headers?.["content-type"] ?? ""; - - if (httpRes?.status == null) { - throw new Error(`status code not found in response: ${httpRes}`); - } - - const res: operations.UpdateUsernameResponse = new operations.UpdateUsernameResponse({ - statusCode: httpRes.status, - contentType: responseContentType, - rawResponse: httpRes, - }); - switch (true) { - case httpRes?.status == 200: - break; - } - - return res; + requestBody?: operations.UpdateUsernameRequestBody | undefined, + options?: RequestOptions + ): Promise { + return unwrapAsync(usersUpdateUsername(this, username, requestBody, options)); } } diff --git a/tsconfig.json b/tsconfig.json index 0e90e5e..7a86d2d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,27 +1,40 @@ { "compilerOptions": { - "target": "es5", - "lib": ["es2021"], - "baseUrl": "src", - "rootDir": "src", - "outDir": "dist", + "incremental": true, + "tsBuildInfoFile": ".tsbuildinfo", + "target": "ES2018", + "lib": ["ES2022", "DOM", "DOM.Iterable"], + + "module": "Node16", + "moduleResolution": "Node16", + "allowJs": true, - "downlevelIteration": true, - "skipLibCheck": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "forceConsistentCasingInFileNames": true, - "noFallthroughCasesInSwitch": true, - "module": "commonjs", - "moduleResolution": "node", - "resolveJsonModule": true, - "isolatedModules": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "strictPropertyInitialization": false, + "declaration": true, - "types": ["reflect-metadata"] + "declarationMap": true, + "sourceMap": true, + "outDir": ".", + + + // https://github.com/tsconfig/bases/blob/a1bf7c0fa2e094b068ca3e1448ca2ece4157977e/bases/strictest.json + "strict": true, + "allowUnusedLabels": false, + "allowUnreachableCode": false, + "exactOptionalPropertyTypes": true, + "useUnknownInCatchVariables": true, + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noPropertyAccessFromIndexSignature": true, + "noUncheckedIndexedAccess": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "isolatedModules": true, + "checkJs": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true }, - "include": ["src"] + "include": ["src"], + "exclude": ["node_modules"] }