From 8bb9fed1762a6cd139e6ca7c2fef1b20e2533254 Mon Sep 17 00:00:00 2001 From: Amrit Date: Fri, 29 May 2026 18:40:29 -0700 Subject: [PATCH 1/5] chore: added new version --- .gitattributes | 2 - .gitignore | 26 - .npmignore | 15 - CONTRIBUTING.md | 26 - FUNCTIONS.md | 87 - README.md | 1951 +++- RUNTIMES.md | 48 - USAGE.md | 18 - code-samples.yaml | 281 - docs/lib/utils/retryconfig.md | 24 - docs/models/components/accessgroup.md | 17 - docs/models/components/activedeployment.md | 21 - docs/models/components/apidocument.md | 30 - docs/models/components/embedstatus.md | 15 - docs/models/components/enabledtools.md | 15 - docs/models/components/githubproject.md | 45 - .../components/githubprojectrepository.md | 27 - docs/models/components/httpmetadata.md | 16 - docs/models/components/loginportal.md | 21 - docs/models/components/loginportalemail.md | 25 - docs/models/components/loginportalpage.md | 28 - docs/models/components/manageddocversion.md | 30 - .../models/components/managedschemaversion.md | 23 - docs/models/components/method.md | 15 - docs/models/components/rule.md | 24 - docs/models/components/schema.md | 26 - docs/models/components/security.md | 15 - docs/models/components/team.md | 24 - docs/models/components/teamsummary.md | 20 - docs/models/components/theme.md | 23 - docs/models/components/tools.md | 23 - docs/models/components/uid.md | 17 - docs/models/components/user.md | 29 - docs/models/errors/fivehundred.md | 16 - docs/models/errors/fourhundred.md | 16 - docs/models/errors/fourhundredandfour.md | 16 - docs/models/errors/fourhundredandone.md | 16 - docs/models/errors/fourhundredandthree.md | 16 - docs/models/errors/fourhundredandtwentytwo.md | 16 - .../addapidocumentaccessgrouprequest.md | 20 - .../addapidocumentaccessgroupresponse.md | 16 - .../addrulesetaccessgrouprequest.md | 20 - .../addrulesetaccessgroupresponse.md | 16 - .../operations/addschemaaccessgrouprequest.md | 20 - .../addschemaaccessgroupresponse.md | 16 - .../operations/createapidocumentrequest.md | 18 - .../createapidocumentrequestbody.md | 26 - .../operations/createapidocumentresponse.md | 16 - .../createapidocumentresponsebody.md | 29 - .../createapidocumentversionrequest.md | 20 - .../createapidocumentversionrequestbody.md | 21 - .../createapidocumentversionresponse.md | 16 - .../operations/createguiderequestbody.md | 23 - docs/models/operations/createguideresponse.md | 16 - .../operations/createguideresponsebody.md | 21 - .../createloginportalrequestbody.md | 23 - .../operations/createloginportalresponse.md | 16 - .../models/operations/createrulesetrequest.md | 18 - .../operations/createrulesetrequestbody.md | 23 - .../operations/createrulesetresponse.md | 16 - docs/models/operations/createschemarequest.md | 18 - .../operations/createschemarequestbody.md | 25 - .../models/operations/createschemaresponse.md | 16 - .../operations/createschemaversionrequest.md | 20 - .../createschemaversionrequestbody.md | 19 - .../operations/createschemaversionresponse.md | 16 - .../operations/createthemerequestbody.md | 22 - docs/models/operations/createthemeresponse.md | 16 - .../operations/deleteapidocumentrequest.md | 19 - .../operations/deleteapidocumentresponse.md | 16 - .../deleteapidocumentversionrequest.md | 21 - .../deleteapidocumentversionresponse.md | 16 - .../operations/deleteloginportalrequest.md | 17 - .../operations/deleteloginportalresponse.md | 16 - .../models/operations/deleterulesetrequest.md | 19 - .../operations/deleterulesetresponse.md | 16 - docs/models/operations/deleteschemarequest.md | 19 - .../models/operations/deleteschemaresponse.md | 16 - .../operations/deleteschemaversionrequest.md | 21 - .../operations/deleteschemaversionresponse.md | 16 - docs/models/operations/deletethemerequest.md | 17 - docs/models/operations/deletethemeresponse.md | 16 - .../exchangepersonaltokenrequestbody.md | 17 - .../exchangepersonaltokenresponse.md | 16 - .../exchangepersonaltokenresponsebody.md | 19 - .../getapidocumentversionmetadatarequest.md | 21 - .../getapidocumentversionmetadataresponse.md | 16 - .../getapidocumentversionrequest.md | 21 - .../getapidocumentversionresponse.md | 16 - .../operations/getcurrentuserresponse.md | 16 - .../operations/getloginportalrequest.md | 17 - .../operations/getloginportalresponse.md | 16 - .../operations/getloginportalresponsebody.md | 27 - .../operations/getrulesetdocumentrequest.md | 19 - .../operations/getrulesetdocumentresponse.md | 16 - .../operations/getschemaversionrequest.md | 21 - .../operations/getschemaversionresponse.md | 16 - docs/models/operations/getthemerequest.md | 17 - docs/models/operations/getthemeresponse.md | 16 - .../operations/listallapidocumentsresponse.md | 16 - .../operations/listapidocumentsrequest.md | 17 - .../operations/listapidocumentsresponse.md | 16 - docs/models/operations/listguidesresponse.md | 16 - .../operations/listloginportalsresponse.md | 16 - .../operations/listnamespacesresponse.md | 16 - docs/models/operations/listrulesetsrequest.md | 17 - .../models/operations/listrulesetsresponse.md | 16 - docs/models/operations/listschemasrequest.md | 17 - docs/models/operations/listschemasresponse.md | 16 - docs/models/operations/listteamsresponse.md | 16 - docs/models/operations/listthemesresponse.md | 16 - docs/models/operations/publishguiderequest.md | 17 - .../models/operations/publishguideresponse.md | 16 - .../operations/publishguideresponsebody.md | 19 - .../removeapidocumentaccessgrouprequest.md | 20 - .../removeapidocumentaccessgroupresponse.md | 16 - .../removerulesetaccessgrouprequest.md | 20 - .../removerulesetaccessgroupresponse.md | 16 - .../removeschemaaccessgrouprequest.md | 20 - .../removeschemaaccessgroupresponse.md | 16 - .../operations/replacethemedocumentrequest.md | 18 - .../replacethemedocumentrequestbody.md | 17 - .../replacethemedocumentresponse.md | 16 - .../operations/updateapidocumentrequest.md | 20 - .../updateapidocumentrequestbody.md | 18 - .../operations/updateapidocumentresponse.md | 16 - .../updateapidocumentversionrequest.md | 22 - .../updateapidocumentversionrequestbody.md | 18 - .../updateapidocumentversionresponse.md | 16 - .../updateapidocumentversionresponsebody.md | 23 - .../operations/updateloginportalrequest.md | 18 - .../updateloginportalrequestbody.md | 15 - .../operations/updateloginportalresponse.md | 16 - .../models/operations/updaterulesetrequest.md | 20 - .../operations/updaterulesetrequestbody.md | 19 - .../operations/updaterulesetresponse.md | 16 - docs/models/operations/updateschemarequest.md | 20 - .../operations/updateschemarequestbody.md | 17 - .../models/operations/updateschemaresponse.md | 16 - docs/models/operations/updatethemerequest.md | 18 - .../operations/updatethemerequestbody.md | 16 - docs/models/operations/updatethemeresponse.md | 16 - docs/sdks/authentication/README.md | 158 - docs/sdks/loginportals/README.md | 407 - docs/sdks/namespaces/README.md | 83 - docs/sdks/registry/README.md | 1018 -- docs/sdks/rules/README.md | 596 - docs/sdks/scalar/README.md | 74 - docs/sdks/scalardocs/README.md | 249 - docs/sdks/schemas/README.md | 772 -- docs/sdks/teams/README.md | 83 - docs/sdks/themes/README.md | 490 - eslint.config.mjs | 22 - jsr.json | 27 - openapi.augmented.json | 8207 ++++++++++++++ package.json | 52 +- renovate.json | 21 - scalar-sdk.manifest.json | 9651 +++++++++++++++++ scripts/finalize-build.mjs | 49 + src/api-promise.ts | 76 + src/client.ts | 335 + src/core.ts | 13 - src/error.ts | 48 + .../authenticationExchangePersonalToken.ts | 186 - src/funcs/authenticationGetCurrentUser.ts | 173 - src/funcs/loginPortalsCreateLoginPortal.ts | 192 - src/funcs/loginPortalsDeleteLoginPortal.ts | 197 - src/funcs/loginPortalsGetLoginPortal.ts | 197 - src/funcs/loginPortalsListLoginPortals.ts | 173 - src/funcs/loginPortalsUpdateLoginPortal.ts | 198 - src/funcs/namespacesListNamespaces.ts | 173 - .../registryAddApiDocumentAccessGroup.ts | 205 - src/funcs/registryCreateApiDocument.ts | 198 - src/funcs/registryCreateApiDocumentVersion.ts | 203 - src/funcs/registryDeleteApiDocument.ts | 201 - src/funcs/registryDeleteApiDocumentVersion.ts | 208 - src/funcs/registryGetApiDocumentVersion.ts | 208 - .../registryGetApiDocumentVersionMetadata.ts | 212 - src/funcs/registryListAllApiDocuments.ts | 173 - src/funcs/registryListApiDocuments.ts | 197 - .../registryRemoveApiDocumentAccessGroup.ts | 207 - src/funcs/registryUpdateApiDocument.ts | 202 - src/funcs/registryUpdateApiDocumentVersion.ts | 209 - src/funcs/rulesAddRulesetAccessGroup.ts | 205 - src/funcs/rulesCreateRuleset.ts | 196 - src/funcs/rulesDeleteRuleset.ts | 199 - src/funcs/rulesGetRulesetDocument.ts | 201 - src/funcs/rulesListRulesets.ts | 197 - src/funcs/rulesRemoveRulesetAccessGroup.ts | 205 - src/funcs/rulesUpdateRuleset.ts | 200 - src/funcs/scalarDocsCreateGuide.ts | 191 - src/funcs/scalarDocsListGuides.ts | 173 - src/funcs/scalarDocsPublishGuide.ts | 197 - src/funcs/schemasAddSchemaAccessGroup.ts | 205 - src/funcs/schemasCreateSchema.ts | 196 - src/funcs/schemasCreateSchemaVersion.ts | 203 - src/funcs/schemasDeleteSchema.ts | 199 - src/funcs/schemasDeleteSchemaVersion.ts | 208 - src/funcs/schemasGetSchemaVersion.ts | 207 - src/funcs/schemasListSchemas.ts | 197 - src/funcs/schemasRemoveSchemaAccessGroup.ts | 205 - src/funcs/schemasUpdateSchema.ts | 200 - src/funcs/teamsListTeams.ts | 171 - src/funcs/themesCreateTheme.ts | 189 - src/funcs/themesDeleteTheme.ts | 195 - src/funcs/themesGetTheme.ts | 195 - src/funcs/themesListThemes.ts | 171 - src/funcs/themesReplaceThemeDocument.ts | 199 - src/funcs/themesUpdateTheme.ts | 196 - src/hooks/hooks.ts | 132 - src/hooks/index.ts | 6 - src/hooks/registration.ts | 14 - src/hooks/types.ts | 107 - src/index.ts | 29 +- src/internal/builtin-types.ts | 6 + src/internal/headers.ts | 6 + src/internal/request-options.ts | 23 + src/internal/types.ts | 5 + src/internal/utils/env.ts | 6 + src/internal/utils/path.ts | 4 + src/lib/base64.ts | 37 - src/lib/config.ts | 64 - src/lib/dlv.ts | 53 - src/lib/encodings.ts | 483 - src/lib/files.ts | 82 - src/lib/http.ts | 323 - src/lib/is-plain-object.ts | 43 - src/lib/logger.ts | 9 - src/lib/matchers.ts | 342 - src/lib/primitives.ts | 150 - src/lib/retries.ts | 218 - src/lib/schemas.ts | 91 - src/lib/sdks.ts | 402 - src/lib/security.ts | 260 - src/lib/url.ts | 33 - src/models/components/accessgroup.ts | 62 - src/models/components/activedeployment.ts | 74 - src/models/components/apidocument.ts | 100 - src/models/components/githubproject.ts | 138 - .../components/githubprojectrepository.ts | 98 - src/models/components/httpmetadata.ts | 87 - src/models/components/index.ts | 24 - src/models/components/loginportal.ts | 70 - src/models/components/loginportalemail.ts | 110 - src/models/components/loginportalpage.ts | 116 - src/models/components/manageddocversion.ts | 217 - src/models/components/managedschemaversion.ts | 78 - src/models/components/method.ts | 37 - src/models/components/rule.ts | 76 - src/models/components/schema.ts | 89 - src/models/components/security.ts | 71 - src/models/components/team.ts | 72 - src/models/components/teamsummary.ts | 70 - src/models/components/theme.ts | 71 - src/models/components/uid.ts | 56 - src/models/components/user.ts | 90 - src/models/errors/apierror.ts | 34 - src/models/errors/fivehundred.ts | 83 - src/models/errors/fourhundred.ts | 83 - src/models/errors/fourhundredandfour.ts | 83 - src/models/errors/fourhundredandone.ts | 83 - src/models/errors/fourhundredandthree.ts | 83 - src/models/errors/fourhundredandtwentytwo.ts | 83 - src/models/errors/httpclienterrors.ts | 62 - src/models/errors/index.ts | 14 - src/models/errors/responsevalidationerror.ts | 50 - src/models/errors/scalarerror.ts | 27 - src/models/errors/sdkvalidationerror.ts | 109 - .../operations/addapidocumentaccessgroup.ts | 162 - .../operations/addrulesetaccessgroup.ts | 161 - src/models/operations/addschemaaccessgroup.ts | 161 - src/models/operations/createapidocument.ts | 320 - .../operations/createapidocumentversion.ts | 238 - src/models/operations/createguide.ts | 222 - src/models/operations/createloginportal.ts | 155 - src/models/operations/createruleset.ts | 227 - src/models/operations/createschema.ts | 231 - src/models/operations/createschemaversion.ts | 223 - src/models/operations/createtheme.ts | 153 - src/models/operations/deleteapidocument.ts | 145 - .../operations/deleteapidocumentversion.ts | 153 - src/models/operations/deleteloginportal.ts | 141 - src/models/operations/deleteruleset.ts | 145 - src/models/operations/deleteschema.ts | 145 - src/models/operations/deleteschemaversion.ts | 151 - src/models/operations/deletetheme.ts | 141 - .../operations/exchangepersonaltoken.ts | 211 - .../operations/getapidocumentversion.ts | 153 - .../getapidocumentversionmetadata.ts | 161 - src/models/operations/getcurrentuser.ts | 83 - src/models/operations/getloginportal.ts | 218 - src/models/operations/getrulesetdocument.ts | 145 - src/models/operations/getschemaversion.ts | 149 - src/models/operations/gettheme.ts | 139 - src/models/operations/index.ts | 50 - src/models/operations/listallapidocuments.ts | 87 - src/models/operations/listapidocuments.ts | 143 - src/models/operations/listguides.ts | 85 - src/models/operations/listloginportals.ts | 85 - src/models/operations/listnamespaces.ts | 83 - src/models/operations/listrulesets.ts | 141 - src/models/operations/listschemas.ts | 141 - src/models/operations/listteams.ts | 83 - src/models/operations/listthemes.ts | 83 - src/models/operations/publishguide.ts | 202 - .../removeapidocumentaccessgroup.ts | 167 - .../operations/removerulesetaccessgroup.ts | 161 - .../operations/removeschemaaccessgroup.ts | 161 - src/models/operations/replacethemedocument.ts | 217 - src/models/operations/updateapidocument.ts | 229 - .../operations/updateapidocumentversion.ts | 308 - src/models/operations/updateloginportal.ts | 213 - src/models/operations/updateruleset.ts | 231 - src/models/operations/updateschema.ts | 223 - src/models/operations/updatetheme.ts | 215 - src/resource.ts | 11 + src/resources/authentication.ts | 159 + src/resources/index.ts | 11 + src/resources/login-portals.ts | 247 + src/resources/namespaces.ts | 65 + src/resources/registry.ts | 337 + src/resources/rules.ts | 209 + src/resources/scalar-docs.ts | 245 + src/resources/schemas.ts | 264 + src/resources/teams.ts | 111 + src/resources/themes.ts | 157 + src/sdk/authentication.ts | 43 - src/sdk/index.ts | 5 - src/sdk/loginportals.ts | 97 - src/sdk/namespaces.ts | 25 - src/sdk/registry.ts | 223 - src/sdk/rules.ts | 135 - src/sdk/scalardocs.ts | 61 - src/sdk/schemas.ts | 171 - src/sdk/sdk.ts | 61 - src/sdk/teams.ts | 25 - src/sdk/themes.ts | 115 - src/types/async.ts | 68 - src/types/blobs.ts | 31 - src/types/constdatetime.ts | 15 - src/types/enums.ts | 16 - src/types/fp.ts | 50 - src/types/index.ts | 11 - src/types/operations.ts | 105 - src/types/rfcdate.ts | 54 - src/types/streams.ts | 21 - src/uploads.ts | 9 + src/version.ts | 3 + tsconfig.cjs.json | 23 + tsconfig.json | 47 +- 350 files changed, 21858 insertions(+), 31147 deletions(-) delete mode 100644 .gitattributes delete mode 100644 .gitignore delete mode 100644 .npmignore delete mode 100644 CONTRIBUTING.md delete mode 100644 FUNCTIONS.md delete mode 100644 RUNTIMES.md delete mode 100644 USAGE.md delete mode 100644 code-samples.yaml delete mode 100644 docs/lib/utils/retryconfig.md delete mode 100644 docs/models/components/accessgroup.md delete mode 100644 docs/models/components/activedeployment.md delete mode 100644 docs/models/components/apidocument.md delete mode 100644 docs/models/components/embedstatus.md delete mode 100644 docs/models/components/enabledtools.md delete mode 100644 docs/models/components/githubproject.md delete mode 100644 docs/models/components/githubprojectrepository.md delete mode 100644 docs/models/components/httpmetadata.md delete mode 100644 docs/models/components/loginportal.md delete mode 100644 docs/models/components/loginportalemail.md delete mode 100644 docs/models/components/loginportalpage.md delete mode 100644 docs/models/components/manageddocversion.md delete mode 100644 docs/models/components/managedschemaversion.md delete mode 100644 docs/models/components/method.md delete mode 100644 docs/models/components/rule.md delete mode 100644 docs/models/components/schema.md delete mode 100644 docs/models/components/security.md delete mode 100644 docs/models/components/team.md delete mode 100644 docs/models/components/teamsummary.md delete mode 100644 docs/models/components/theme.md delete mode 100644 docs/models/components/tools.md delete mode 100644 docs/models/components/uid.md delete mode 100644 docs/models/components/user.md delete mode 100644 docs/models/errors/fivehundred.md delete mode 100644 docs/models/errors/fourhundred.md delete mode 100644 docs/models/errors/fourhundredandfour.md delete mode 100644 docs/models/errors/fourhundredandone.md delete mode 100644 docs/models/errors/fourhundredandthree.md delete mode 100644 docs/models/errors/fourhundredandtwentytwo.md delete mode 100644 docs/models/operations/addapidocumentaccessgrouprequest.md delete mode 100644 docs/models/operations/addapidocumentaccessgroupresponse.md delete mode 100644 docs/models/operations/addrulesetaccessgrouprequest.md delete mode 100644 docs/models/operations/addrulesetaccessgroupresponse.md delete mode 100644 docs/models/operations/addschemaaccessgrouprequest.md delete mode 100644 docs/models/operations/addschemaaccessgroupresponse.md delete mode 100644 docs/models/operations/createapidocumentrequest.md delete mode 100644 docs/models/operations/createapidocumentrequestbody.md delete mode 100644 docs/models/operations/createapidocumentresponse.md delete mode 100644 docs/models/operations/createapidocumentresponsebody.md delete mode 100644 docs/models/operations/createapidocumentversionrequest.md delete mode 100644 docs/models/operations/createapidocumentversionrequestbody.md delete mode 100644 docs/models/operations/createapidocumentversionresponse.md delete mode 100644 docs/models/operations/createguiderequestbody.md delete mode 100644 docs/models/operations/createguideresponse.md delete mode 100644 docs/models/operations/createguideresponsebody.md delete mode 100644 docs/models/operations/createloginportalrequestbody.md delete mode 100644 docs/models/operations/createloginportalresponse.md delete mode 100644 docs/models/operations/createrulesetrequest.md delete mode 100644 docs/models/operations/createrulesetrequestbody.md delete mode 100644 docs/models/operations/createrulesetresponse.md delete mode 100644 docs/models/operations/createschemarequest.md delete mode 100644 docs/models/operations/createschemarequestbody.md delete mode 100644 docs/models/operations/createschemaresponse.md delete mode 100644 docs/models/operations/createschemaversionrequest.md delete mode 100644 docs/models/operations/createschemaversionrequestbody.md delete mode 100644 docs/models/operations/createschemaversionresponse.md delete mode 100644 docs/models/operations/createthemerequestbody.md delete mode 100644 docs/models/operations/createthemeresponse.md delete mode 100644 docs/models/operations/deleteapidocumentrequest.md delete mode 100644 docs/models/operations/deleteapidocumentresponse.md delete mode 100644 docs/models/operations/deleteapidocumentversionrequest.md delete mode 100644 docs/models/operations/deleteapidocumentversionresponse.md delete mode 100644 docs/models/operations/deleteloginportalrequest.md delete mode 100644 docs/models/operations/deleteloginportalresponse.md delete mode 100644 docs/models/operations/deleterulesetrequest.md delete mode 100644 docs/models/operations/deleterulesetresponse.md delete mode 100644 docs/models/operations/deleteschemarequest.md delete mode 100644 docs/models/operations/deleteschemaresponse.md delete mode 100644 docs/models/operations/deleteschemaversionrequest.md delete mode 100644 docs/models/operations/deleteschemaversionresponse.md delete mode 100644 docs/models/operations/deletethemerequest.md delete mode 100644 docs/models/operations/deletethemeresponse.md delete mode 100644 docs/models/operations/exchangepersonaltokenrequestbody.md delete mode 100644 docs/models/operations/exchangepersonaltokenresponse.md delete mode 100644 docs/models/operations/exchangepersonaltokenresponsebody.md delete mode 100644 docs/models/operations/getapidocumentversionmetadatarequest.md delete mode 100644 docs/models/operations/getapidocumentversionmetadataresponse.md delete mode 100644 docs/models/operations/getapidocumentversionrequest.md delete mode 100644 docs/models/operations/getapidocumentversionresponse.md delete mode 100644 docs/models/operations/getcurrentuserresponse.md delete mode 100644 docs/models/operations/getloginportalrequest.md delete mode 100644 docs/models/operations/getloginportalresponse.md delete mode 100644 docs/models/operations/getloginportalresponsebody.md delete mode 100644 docs/models/operations/getrulesetdocumentrequest.md delete mode 100644 docs/models/operations/getrulesetdocumentresponse.md delete mode 100644 docs/models/operations/getschemaversionrequest.md delete mode 100644 docs/models/operations/getschemaversionresponse.md delete mode 100644 docs/models/operations/getthemerequest.md delete mode 100644 docs/models/operations/getthemeresponse.md delete mode 100644 docs/models/operations/listallapidocumentsresponse.md delete mode 100644 docs/models/operations/listapidocumentsrequest.md delete mode 100644 docs/models/operations/listapidocumentsresponse.md delete mode 100644 docs/models/operations/listguidesresponse.md delete mode 100644 docs/models/operations/listloginportalsresponse.md delete mode 100644 docs/models/operations/listnamespacesresponse.md delete mode 100644 docs/models/operations/listrulesetsrequest.md delete mode 100644 docs/models/operations/listrulesetsresponse.md delete mode 100644 docs/models/operations/listschemasrequest.md delete mode 100644 docs/models/operations/listschemasresponse.md delete mode 100644 docs/models/operations/listteamsresponse.md delete mode 100644 docs/models/operations/listthemesresponse.md delete mode 100644 docs/models/operations/publishguiderequest.md delete mode 100644 docs/models/operations/publishguideresponse.md delete mode 100644 docs/models/operations/publishguideresponsebody.md delete mode 100644 docs/models/operations/removeapidocumentaccessgrouprequest.md delete mode 100644 docs/models/operations/removeapidocumentaccessgroupresponse.md delete mode 100644 docs/models/operations/removerulesetaccessgrouprequest.md delete mode 100644 docs/models/operations/removerulesetaccessgroupresponse.md delete mode 100644 docs/models/operations/removeschemaaccessgrouprequest.md delete mode 100644 docs/models/operations/removeschemaaccessgroupresponse.md delete mode 100644 docs/models/operations/replacethemedocumentrequest.md delete mode 100644 docs/models/operations/replacethemedocumentrequestbody.md delete mode 100644 docs/models/operations/replacethemedocumentresponse.md delete mode 100644 docs/models/operations/updateapidocumentrequest.md delete mode 100644 docs/models/operations/updateapidocumentrequestbody.md delete mode 100644 docs/models/operations/updateapidocumentresponse.md delete mode 100644 docs/models/operations/updateapidocumentversionrequest.md delete mode 100644 docs/models/operations/updateapidocumentversionrequestbody.md delete mode 100644 docs/models/operations/updateapidocumentversionresponse.md delete mode 100644 docs/models/operations/updateapidocumentversionresponsebody.md delete mode 100644 docs/models/operations/updateloginportalrequest.md delete mode 100644 docs/models/operations/updateloginportalrequestbody.md delete mode 100644 docs/models/operations/updateloginportalresponse.md delete mode 100644 docs/models/operations/updaterulesetrequest.md delete mode 100644 docs/models/operations/updaterulesetrequestbody.md delete mode 100644 docs/models/operations/updaterulesetresponse.md delete mode 100644 docs/models/operations/updateschemarequest.md delete mode 100644 docs/models/operations/updateschemarequestbody.md delete mode 100644 docs/models/operations/updateschemaresponse.md delete mode 100644 docs/models/operations/updatethemerequest.md delete mode 100644 docs/models/operations/updatethemerequestbody.md delete mode 100644 docs/models/operations/updatethemeresponse.md delete mode 100644 docs/sdks/authentication/README.md delete mode 100644 docs/sdks/loginportals/README.md delete mode 100644 docs/sdks/namespaces/README.md delete mode 100644 docs/sdks/registry/README.md delete mode 100644 docs/sdks/rules/README.md delete mode 100644 docs/sdks/scalar/README.md delete mode 100644 docs/sdks/scalardocs/README.md delete mode 100644 docs/sdks/schemas/README.md delete mode 100644 docs/sdks/teams/README.md delete mode 100644 docs/sdks/themes/README.md delete mode 100644 eslint.config.mjs delete mode 100644 jsr.json create mode 100644 openapi.augmented.json delete mode 100644 renovate.json create mode 100644 scalar-sdk.manifest.json create mode 100644 scripts/finalize-build.mjs create mode 100644 src/api-promise.ts create mode 100644 src/client.ts delete mode 100644 src/core.ts create mode 100644 src/error.ts delete mode 100644 src/funcs/authenticationExchangePersonalToken.ts delete mode 100644 src/funcs/authenticationGetCurrentUser.ts delete mode 100644 src/funcs/loginPortalsCreateLoginPortal.ts delete mode 100644 src/funcs/loginPortalsDeleteLoginPortal.ts delete mode 100644 src/funcs/loginPortalsGetLoginPortal.ts delete mode 100644 src/funcs/loginPortalsListLoginPortals.ts delete mode 100644 src/funcs/loginPortalsUpdateLoginPortal.ts delete mode 100644 src/funcs/namespacesListNamespaces.ts delete mode 100644 src/funcs/registryAddApiDocumentAccessGroup.ts delete mode 100644 src/funcs/registryCreateApiDocument.ts delete mode 100644 src/funcs/registryCreateApiDocumentVersion.ts delete mode 100644 src/funcs/registryDeleteApiDocument.ts delete mode 100644 src/funcs/registryDeleteApiDocumentVersion.ts delete mode 100644 src/funcs/registryGetApiDocumentVersion.ts delete mode 100644 src/funcs/registryGetApiDocumentVersionMetadata.ts delete mode 100644 src/funcs/registryListAllApiDocuments.ts delete mode 100644 src/funcs/registryListApiDocuments.ts delete mode 100644 src/funcs/registryRemoveApiDocumentAccessGroup.ts delete mode 100644 src/funcs/registryUpdateApiDocument.ts delete mode 100644 src/funcs/registryUpdateApiDocumentVersion.ts delete mode 100644 src/funcs/rulesAddRulesetAccessGroup.ts delete mode 100644 src/funcs/rulesCreateRuleset.ts delete mode 100644 src/funcs/rulesDeleteRuleset.ts delete mode 100644 src/funcs/rulesGetRulesetDocument.ts delete mode 100644 src/funcs/rulesListRulesets.ts delete mode 100644 src/funcs/rulesRemoveRulesetAccessGroup.ts delete mode 100644 src/funcs/rulesUpdateRuleset.ts delete mode 100644 src/funcs/scalarDocsCreateGuide.ts delete mode 100644 src/funcs/scalarDocsListGuides.ts delete mode 100644 src/funcs/scalarDocsPublishGuide.ts delete mode 100644 src/funcs/schemasAddSchemaAccessGroup.ts delete mode 100644 src/funcs/schemasCreateSchema.ts delete mode 100644 src/funcs/schemasCreateSchemaVersion.ts delete mode 100644 src/funcs/schemasDeleteSchema.ts delete mode 100644 src/funcs/schemasDeleteSchemaVersion.ts delete mode 100644 src/funcs/schemasGetSchemaVersion.ts delete mode 100644 src/funcs/schemasListSchemas.ts delete mode 100644 src/funcs/schemasRemoveSchemaAccessGroup.ts delete mode 100644 src/funcs/schemasUpdateSchema.ts delete mode 100644 src/funcs/teamsListTeams.ts delete mode 100644 src/funcs/themesCreateTheme.ts delete mode 100644 src/funcs/themesDeleteTheme.ts delete mode 100644 src/funcs/themesGetTheme.ts delete mode 100644 src/funcs/themesListThemes.ts delete mode 100644 src/funcs/themesReplaceThemeDocument.ts delete mode 100644 src/funcs/themesUpdateTheme.ts delete mode 100644 src/hooks/hooks.ts delete mode 100644 src/hooks/index.ts delete mode 100644 src/hooks/registration.ts delete mode 100644 src/hooks/types.ts create mode 100644 src/internal/builtin-types.ts create mode 100644 src/internal/headers.ts create mode 100644 src/internal/request-options.ts create mode 100644 src/internal/types.ts create mode 100644 src/internal/utils/env.ts create mode 100644 src/internal/utils/path.ts delete mode 100644 src/lib/base64.ts delete mode 100644 src/lib/config.ts delete mode 100644 src/lib/dlv.ts delete mode 100644 src/lib/encodings.ts delete mode 100644 src/lib/files.ts delete mode 100644 src/lib/http.ts delete mode 100644 src/lib/is-plain-object.ts delete mode 100644 src/lib/logger.ts delete mode 100644 src/lib/matchers.ts delete mode 100644 src/lib/primitives.ts delete mode 100644 src/lib/retries.ts delete mode 100644 src/lib/schemas.ts delete mode 100644 src/lib/sdks.ts delete mode 100644 src/lib/security.ts delete mode 100644 src/lib/url.ts delete mode 100644 src/models/components/accessgroup.ts delete mode 100644 src/models/components/activedeployment.ts delete mode 100644 src/models/components/apidocument.ts delete mode 100644 src/models/components/githubproject.ts delete mode 100644 src/models/components/githubprojectrepository.ts delete mode 100644 src/models/components/httpmetadata.ts delete mode 100644 src/models/components/index.ts delete mode 100644 src/models/components/loginportal.ts delete mode 100644 src/models/components/loginportalemail.ts delete mode 100644 src/models/components/loginportalpage.ts delete mode 100644 src/models/components/manageddocversion.ts delete mode 100644 src/models/components/managedschemaversion.ts delete mode 100644 src/models/components/method.ts delete mode 100644 src/models/components/rule.ts delete mode 100644 src/models/components/schema.ts delete mode 100644 src/models/components/security.ts delete mode 100644 src/models/components/team.ts delete mode 100644 src/models/components/teamsummary.ts delete mode 100644 src/models/components/theme.ts delete mode 100644 src/models/components/uid.ts delete mode 100644 src/models/components/user.ts delete mode 100644 src/models/errors/apierror.ts delete mode 100644 src/models/errors/fivehundred.ts delete mode 100644 src/models/errors/fourhundred.ts delete mode 100644 src/models/errors/fourhundredandfour.ts delete mode 100644 src/models/errors/fourhundredandone.ts delete mode 100644 src/models/errors/fourhundredandthree.ts delete mode 100644 src/models/errors/fourhundredandtwentytwo.ts delete mode 100644 src/models/errors/httpclienterrors.ts delete mode 100644 src/models/errors/index.ts delete mode 100644 src/models/errors/responsevalidationerror.ts delete mode 100644 src/models/errors/scalarerror.ts delete mode 100644 src/models/errors/sdkvalidationerror.ts delete mode 100644 src/models/operations/addapidocumentaccessgroup.ts delete mode 100644 src/models/operations/addrulesetaccessgroup.ts delete mode 100644 src/models/operations/addschemaaccessgroup.ts delete mode 100644 src/models/operations/createapidocument.ts delete mode 100644 src/models/operations/createapidocumentversion.ts delete mode 100644 src/models/operations/createguide.ts delete mode 100644 src/models/operations/createloginportal.ts delete mode 100644 src/models/operations/createruleset.ts delete mode 100644 src/models/operations/createschema.ts delete mode 100644 src/models/operations/createschemaversion.ts delete mode 100644 src/models/operations/createtheme.ts delete mode 100644 src/models/operations/deleteapidocument.ts delete mode 100644 src/models/operations/deleteapidocumentversion.ts delete mode 100644 src/models/operations/deleteloginportal.ts delete mode 100644 src/models/operations/deleteruleset.ts delete mode 100644 src/models/operations/deleteschema.ts delete mode 100644 src/models/operations/deleteschemaversion.ts delete mode 100644 src/models/operations/deletetheme.ts delete mode 100644 src/models/operations/exchangepersonaltoken.ts delete mode 100644 src/models/operations/getapidocumentversion.ts delete mode 100644 src/models/operations/getapidocumentversionmetadata.ts delete mode 100644 src/models/operations/getcurrentuser.ts delete mode 100644 src/models/operations/getloginportal.ts delete mode 100644 src/models/operations/getrulesetdocument.ts delete mode 100644 src/models/operations/getschemaversion.ts delete mode 100644 src/models/operations/gettheme.ts delete mode 100644 src/models/operations/index.ts delete mode 100644 src/models/operations/listallapidocuments.ts delete mode 100644 src/models/operations/listapidocuments.ts delete mode 100644 src/models/operations/listguides.ts delete mode 100644 src/models/operations/listloginportals.ts delete mode 100644 src/models/operations/listnamespaces.ts delete mode 100644 src/models/operations/listrulesets.ts delete mode 100644 src/models/operations/listschemas.ts delete mode 100644 src/models/operations/listteams.ts delete mode 100644 src/models/operations/listthemes.ts delete mode 100644 src/models/operations/publishguide.ts delete mode 100644 src/models/operations/removeapidocumentaccessgroup.ts delete mode 100644 src/models/operations/removerulesetaccessgroup.ts delete mode 100644 src/models/operations/removeschemaaccessgroup.ts delete mode 100644 src/models/operations/replacethemedocument.ts delete mode 100644 src/models/operations/updateapidocument.ts delete mode 100644 src/models/operations/updateapidocumentversion.ts delete mode 100644 src/models/operations/updateloginportal.ts delete mode 100644 src/models/operations/updateruleset.ts delete mode 100644 src/models/operations/updateschema.ts delete mode 100644 src/models/operations/updatetheme.ts create mode 100644 src/resource.ts create mode 100644 src/resources/authentication.ts create mode 100644 src/resources/index.ts create mode 100644 src/resources/login-portals.ts create mode 100644 src/resources/namespaces.ts create mode 100644 src/resources/registry.ts create mode 100644 src/resources/rules.ts create mode 100644 src/resources/scalar-docs.ts create mode 100644 src/resources/schemas.ts create mode 100644 src/resources/teams.ts create mode 100644 src/resources/themes.ts delete mode 100644 src/sdk/authentication.ts delete mode 100644 src/sdk/index.ts delete mode 100644 src/sdk/loginportals.ts delete mode 100644 src/sdk/namespaces.ts delete mode 100644 src/sdk/registry.ts delete mode 100644 src/sdk/rules.ts delete mode 100644 src/sdk/scalardocs.ts delete mode 100644 src/sdk/schemas.ts delete mode 100644 src/sdk/sdk.ts delete mode 100644 src/sdk/teams.ts delete mode 100644 src/sdk/themes.ts delete mode 100644 src/types/async.ts delete mode 100644 src/types/blobs.ts delete mode 100644 src/types/constdatetime.ts delete mode 100644 src/types/enums.ts delete mode 100644 src/types/fp.ts delete mode 100644 src/types/index.ts delete mode 100644 src/types/operations.ts delete mode 100644 src/types/rfcdate.ts delete mode 100644 src/types/streams.ts create mode 100644 src/uploads.ts create mode 100644 src/version.ts create mode 100644 tsconfig.cjs.json diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 113eead..0000000 --- a/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -# This allows generated code to be indexed correctly -*.ts linguist-generated=false \ No newline at end of file diff --git a/.gitignore b/.gitignore deleted file mode 100644 index ccddd9f..0000000 --- a/.gitignore +++ /dev/null @@ -1,26 +0,0 @@ -/models -/models/errors -/types -/node_modules -/lib -/sdk -/funcs -/react-query -/mcp-server -/hooks -/index.* -/core.* -/bin -/cjs -/esm -/dist -/.tsbuildinfo -/.eslintcache -/.tshy -/.tshy-* -/__tests__ -.DS_Store -**/.speakeasy/temp/ -**/.speakeasy/logs/ -.DS_Store -/.speakeasy/reports diff --git a/.npmignore b/.npmignore deleted file mode 100644 index cf98a6b..0000000 --- a/.npmignore +++ /dev/null @@ -1,15 +0,0 @@ -**/* -!/FUNCTIONS.md -!/RUNTIMES.md -!/REACT_QUERY.md -!/**/*.ts -!/**/*.js -!/**/*.mjs -!/**/*.json -!/**/*.map - -/eslint.config.mjs -/cjs -/.tshy -/.tshy-* -/__tests__ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index d585717..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,26 +0,0 @@ -# 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/FUNCTIONS.md b/FUNCTIONS.md deleted file mode 100644 index 3057b9f..0000000 --- a/FUNCTIONS.md +++ /dev/null @@ -1,87 +0,0 @@ -# Standalone Functions - -> [!NOTE] -> This section is useful if you are using a bundler and targetting browsers and -> runtimes where the size of an application affects performance and load times. - -Every method in this SDK is also available as a standalone function. This -alternative API is suitable when targetting the browser or serverless runtimes -and using a bundler to build your application since all unused functionality -will be tree-shaken away. This includes code for unused methods, Zod schemas, -encoding helpers and response handlers. The result is dramatically smaller -impact on the application's final bundle size which grows very slowly as you use -more and more functionality from this SDK. - -Calling methods through the main SDK class remains a valid and generally more -more ergonomic option. Standalone functions represent an optimisation for a -specific category of applications. - -## Example - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { registryListAllApiDocuments } from "@scalar/sdk/funcs/registryListAllApiDocuments.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await registryListAllApiDocuments(scalar); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("registryListAllApiDocuments failed:", res.error); - } -} - -run(); -``` - -## Result types - -Standalone functions differ from SDK methods in that they return a -`Result` type to capture _known errors_ and document them using -the type system. By avoiding throwing errors, application code maintains clear -control flow and error-handling become part of the regular flow of application -code. - -> We use the term "known errors" because standalone functions, and JavaScript -> code in general, can still throw unexpected errors such as `TypeError`s, -> `RangeError`s and `DOMException`s. Exhaustively catching all errors may be -> something this SDK addresses in the future. Nevertheless, there is still a lot -> of benefit from capturing most errors and turning them into values. - -The second reason for this style of programming is because these functions will -typically be used in front-end applications where exception throwing is -sometimes discouraged or considered unidiomatic. React and similar ecosystems -and libraries tend to promote this style of programming so that components -render useful content under all states (loading, success, error and so on). - -The general pattern when calling standalone functions looks like this: - -```typescript -import { Core } from ""; -import { fetchSomething } from "/funcs/fetchSomething.js"; - -const client = new Core(); - -async function run() { - const result = await fetchSomething(client, { id: "123" }); - if (!result.ok) { - // You can throw the error or handle it. It's your choice now. - throw result.error; - } - - console.log(result.value); -} - -run(); -``` - -Notably, `result.error` above will have an explicit type compared to a try-catch -variation where the error in the catch block can only be of type `unknown` (or -`any` depending on your TypeScript settings). \ No newline at end of file diff --git a/README.md b/README.md index 5d8dd7f..cabc02c 100644 --- a/README.md +++ b/README.md @@ -1,585 +1,1704 @@ -# scalar-typescript-sdk +# Scalar API -Developer-friendly, idiomatic Typescript SDK for the *scalar-typescript-sdk* API. +Generated TypeScript SDK for the Scalar API API. +Manage Scalar platform resources programmatically. The Scalar API lets teams create and update API references, schemas, guides, rulesets, themes, login portals, namespaces, and access controls from automated workflows or custom internal tooling. Use it to keep documentation and developer portals in sync with your source of truth, publish new versions safely, and inspect the teams and authenticated user context available to your integration. -
- - - - -
+
+ +## Contents + +- [Installation](#installation) +- [Quickstart](#quickstart) +- [Authentication](#authentication) +- [Client Options](#client-options) +- [Request Options](#request-options) +- [Resources](#resources) +- [Errors](#errors) +- [Retries and Timeouts](#retries-and-timeouts) +- [Debugging](#debugging) +- [Requirements](#requirements) + +
+ +## Installation + +```sh +npm install @scalar/sdk +``` + +
+ +## Quickstart + +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); + +async function main() { + const result = await client.registry.listAllApiDocuments(); + + console.log(result); +} + +main(); +``` + +
+ +## Authentication + +Pass credentials to the generated client constructor. Environment variables are read automatically when supported by the target runtime. + +| Option | Type | Default | Description | +| --- | --- | --- | --- | +| `bearerAuth` | `string \| provider` | - | Credential for the BearerAuth scheme. Defaults to BEARER_AUTH. | + +Declared schemes: + +- `BearerAuth` bearer token + +
+ +## Client Options + +| Option | Type | Default | Description | +| --- | --- | --- | --- | +| `bearerAuth` | `string \| AuthTokenProvider` | `process.env["BEARER_AUTH"]` | Credential for the BearerAuth scheme. | +| `baseURL` | `string \| null` | `process.env["SCALARAPI_BASE_URL"]` | Override the default API base URL. Pass `null` when selecting a configured environment. | +| `timeout` | `number` | `60000` | Maximum time in milliseconds to wait for a response before aborting a request. | +| `maxRetries` | `number` | `2` | Number of retries for temporary failures. | +| `defaultHeaders` | `HeadersInit` | - | Headers sent with every request. | +| `defaultQuery` | `Record` | - | Query parameters sent with every request. | +| `fetchOptions` | `RequestInit` | - | Additional fetch options sent with every request. | +| `fetch` | `Fetch` | - | Custom fetch implementation. | +| `logLevel` | `"off" \| "error" \| "warn" \| "info" \| "debug" \| null` | `process.env["SCALARAPI_LOG"]` | Controls request and retry debug logging. | +| `logger` | `Logger \| null` | `console` | Custom logger implementation. | + +
+ +## Request Options + +| Option | Type | Default | Description | +| --- | --- | --- | --- | +| `headers` | `HeadersInit` | - | Per-request headers. | +| `query` | `Record` | - | Per-request query parameters. | +| `body` | `unknown` | - | Override the generated request body. | +| `timeout` | `number` | - | Per-request timeout in milliseconds. | +| `maxRetries` | `number` | - | Per-request retry count. | +| `signal` | `AbortSignal` | - | Abort an in-flight request. | +| `fetchOptions` | `RequestInit` | - | Per-request fetch options. | +| `idempotencyKey` | `string` | - | Idempotency key for retry-safe operations. | + +
+ +## Resources + +Every operation below includes its HTTP route, generated types, documented error statuses, and a code sample when one can be generated. + +### `Registry` + +#### List all API Documents + +List all API documents across every namespace the caller can access. + +| Field | Value | +| --- | --- | +| HTTP | `GET /v1/apis` | +| Response | `APIPromise>` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | + +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); + +async function main() { + const result = await client.registry.listAllApiDocuments(); + + console.log(result); +} + +main(); +``` + +
+ +#### List API Documents + +List API documents in a namespace. + +| Field | Value | +| --- | --- | +| HTTP | `GET /v1/apis/{namespace}` | +| Input | `namespace: string` | +| Response | `APIPromise>` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | + +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); + +async function main() { + const result = await client.registry.listApiDocuments({ + namespace: "namespace", + }); + + console.log(result); +} + +main(); +``` + +
+ +#### Create API Document + +Create an API document. + +| Field | Value | +| --- | --- | +| HTTP | `POST /v1/apis/{namespace}` | +| Input | `namespace: string`, `RegistryCreateApiDocumentParams` | +| Response | `APIPromise<{ uid: string; versionUid: string; title: string; jsonSha: string; yamlSha: string; versionSha: string }>` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | + +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); + +async function main() { + const result = await client.registry.createApiDocument({ + namespace: "namespace", + body: { + title: "", + version: "", + slug: "", + document: "", + }, + }); + + console.log(result); +} + +main(); +``` + +
+ +#### Delete API Document + +Delete an API document and all versions. + +| Field | Value | +| --- | --- | +| HTTP | `DELETE /v1/apis/{namespace}/{slug}` | +| Input | `namespace: string`, `slug: string` | +| Response | `APIPromise` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | + +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); + +async function main() { + const result = await client.registry.deleteApiDocument({ + namespace: "namespace", + slug: "slug", + }); + + console.log(result); +} + +main(); +``` + +
+ +#### Update API Document metadata + +Update metadata for an API document. + +| Field | Value | +| --- | --- | +| HTTP | `PATCH /v1/apis/{namespace}/{slug}` | +| Input | `namespace: string`, `slug: string`, `RegistryUpdateApiDocumentParams` | +| Response | `APIPromise` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | + +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); + +async function main() { + const result = await client.registry.updateApiDocument({ + namespace: "namespace", + slug: "slug", + body: {}, + }); + + console.log(result); +} + +main(); +``` + +
+ +#### Get API Document + +Get a specific API document version. + +| Field | Value | +| --- | --- | +| HTTP | `GET /v1/apis/{namespace}/{slug}/version/{semver}` | +| Input | `namespace: string`, `slug: string`, `semver: string` | +| Response | `APIPromise` | +| Content-Type | `text/plain` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | + +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); + +async function main() { + const result = await client.registry.retrieveApiDocumentVersion({ + namespace: "namespace", + slug: "slug", + semver: "semver", + }); + + console.log(result); +} + +main(); +``` + +
+ +#### Delete API Document version + +Delete a specific API document version. + +| Field | Value | +| --- | --- | +| HTTP | `DELETE /v1/apis/{namespace}/{slug}/version/{semver}` | +| Input | `namespace: string`, `slug: string`, `semver: string` | +| Response | `APIPromise` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | + +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); + +async function main() { + const result = await client.registry.deleteApiDocumentVersion({ + namespace: "namespace", + slug: "slug", + semver: "semver", + }); + + console.log(result); +} + +main(); +``` + +
+ +#### Update API Document version + +Update the registry file content for an API document version. + +| Field | Value | +| --- | --- | +| HTTP | `PATCH /v1/apis/{namespace}/{slug}/version/{semver}` | +| Input | `namespace: string`, `slug: string`, `semver: string`, `RegistryUpdateApiDocumentVersionParams` | +| Response | `APIPromise<{ jsonSha: string; yamlSha: string; versionSha: string }>` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | + +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); + +async function main() { + const result = await client.registry.updateApiDocumentVersion({ + namespace: "namespace", + slug: "slug", + semver: "semver", + body: { + document: "", + }, + }); + + console.log(result); +} + +main(); +``` + +
+ +#### Get API Document version metadata + +Get metadata (uid, content shas, version sha, tags) for a specific API document version. + +| Field | Value | +| --- | --- | +| HTTP | `GET /v1/apis/{namespace}/{slug}/version/{semver}/metadata` | +| Input | `namespace: string`, `slug: string`, `semver: string` | +| Response | `APIPromise` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | + +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); + +async function main() { + const result = await client.registry.listApiDocumentVersionMetadata({ + namespace: "namespace", + slug: "slug", + semver: "semver", + }); + + console.log(result); +} + +main(); +``` + +
+ +#### Create API Document version + +Create a new API document version. + +| Field | Value | +| --- | --- | +| HTTP | `POST /v1/apis/{namespace}/{slug}/version` | +| Input | `namespace: string`, `slug: string`, `RegistryCreateApiDocumentVersionParams` | +| Response | `APIPromise` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | + +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); + +async function main() { + const result = await client.registry.createApiDocumentVersion({ + namespace: "namespace", + slug: "slug", + body: { + version: "", + document: "", + }, + }); + + console.log(result); +} + +main(); +``` + +
+ +#### Add access group + +Add an access group to an API document. + +| Field | Value | +| --- | --- | +| HTTP | `POST /v1/apis/{namespace}/{slug}/access-group` | +| Input | `namespace: string`, `slug: string`, `RegistryCreateApiDocumentAccessGroupParams` | +| Response | `APIPromise` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | + +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); + +async function main() { + const result = await client.registry.createApiDocumentAccessGroup({ + namespace: "namespace", + slug: "slug", + body: { + accessGroupSlug: "", + }, + }); + + console.log(result); +} + +main(); +``` + +
+ +#### Remove access group + +Remove an access group from an API document. + +| Field | Value | +| --- | --- | +| HTTP | `DELETE /v1/apis/{namespace}/{slug}/access-group` | +| Input | `namespace: string`, `slug: string`, `RegistryDeleteApiDocumentAccessGroupParams` | +| Response | `APIPromise` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | + +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); + +async function main() { + const result = await client.registry.deleteApiDocumentAccessGroup({ + namespace: "namespace", + slug: "slug", + body: { + accessGroupSlug: "", + }, + }); + + console.log(result); +} + +main(); +``` + +### `Schemas` + +#### List all shared components + +List schemas in a namespace. + +| Field | Value | +| --- | --- | +| HTTP | `GET /v1/schemas/{namespace}` | +| Input | `namespace: string` | +| Response | `APIPromise>` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | + +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); + +async function main() { + const result = await client.schemas.list({ + namespace: "namespace", + }); + + console.log(result); +} + +main(); +``` + +
+ +#### Create a shared component + +Create a schema in a namespace. + +| Field | Value | +| --- | --- | +| HTTP | `POST /v1/schemas/{namespace}` | +| Input | `namespace: string`, `SchemaCreateParams` | +| Response | `APIPromise` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | + +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); + +async function main() { + const result = await client.schemas.create({ + namespace: "namespace", + body: { + title: "", + version: "", + slug: "", + document: "", + }, + }); + + console.log(result); +} + +main(); +``` + +
+ +#### Delete a shared component + +Delete a schema and all related versions. + +| Field | Value | +| --- | --- | +| HTTP | `DELETE /v1/schemas/{namespace}/{slug}` | +| Input | `namespace: string`, `slug: string` | +| Response | `APIPromise` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | + +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); + +async function main() { + const result = await client.schemas.delete({ + namespace: "namespace", + slug: "slug", + }); + + console.log(result); +} + +main(); +``` + +
+ +#### Update shared component metadata + +Update schema metadata. + +| Field | Value | +| --- | --- | +| HTTP | `PATCH /v1/schemas/{namespace}/{slug}` | +| Input | `namespace: string`, `slug: string`, `SchemaUpdateParams` | +| Response | `APIPromise` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | + +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); + +async function main() { + const result = await client.schemas.update({ + namespace: "namespace", + slug: "slug", + body: {}, + }); + + console.log(result); +} + +main(); +``` + +
+ +#### Get a shared component document + +Get a specific schema version document. + +| Field | Value | +| --- | --- | +| HTTP | `GET /v1/schemas/{namespace}/{slug}/version/{semver}` | +| Input | `namespace: string`, `slug: string`, `semver: string` | +| Response | `APIPromise` | +| Content-Type | `text/plain` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | + +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); + +async function main() { + const result = await client.schemas.retrieveVersion({ + namespace: "namespace", + slug: "slug", + semver: "semver", + }); + + console.log(result); +} + +main(); +``` + +
+ +#### Delete a shared component version + +Delete a schema version. + +| Field | Value | +| --- | --- | +| HTTP | `DELETE /v1/schemas/{namespace}/{slug}/version/{semver}` | +| Input | `namespace: string`, `slug: string`, `semver: string` | +| Response | `APIPromise` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | + +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); + +async function main() { + const result = await client.schemas.deleteVersion({ + namespace: "namespace", + slug: "slug", + semver: "semver", + }); + + console.log(result); +} + +main(); +``` + +
+ +#### Create a shared component version + +Create a schema version. + +| Field | Value | +| --- | --- | +| HTTP | `POST /v1/schemas/{namespace}/{slug}/version` | +| Input | `namespace: string`, `slug: string`, `SchemaCreateVersionParams` | +| Response | `APIPromise` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | + +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); + +async function main() { + const result = await client.schemas.createVersion({ + namespace: "namespace", + slug: "slug", + body: { + version: "", + document: "", + }, + }); + + console.log(result); +} + +main(); +``` + +
+ +#### Add shared component access group + +Add an access group to a schema. + +| Field | Value | +| --- | --- | +| HTTP | `POST /v1/schemas/{namespace}/{slug}/access-group` | +| Input | `namespace: string`, `slug: string`, `SchemaCreateAccessGroupParams` | +| Response | `APIPromise` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | + +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); + +async function main() { + const result = await client.schemas.createAccessGroup({ + namespace: "namespace", + slug: "slug", + body: { + accessGroupSlug: "", + }, + }); + + console.log(result); +} + +main(); +``` + +
+ +#### Remove shared component access group + +Remove an access group from a schema. + +| Field | Value | +| --- | --- | +| HTTP | `DELETE /v1/schemas/{namespace}/{slug}/access-group` | +| Input | `namespace: string`, `slug: string`, `SchemaDeleteAccessGroupParams` | +| Response | `APIPromise` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | + +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); + +async function main() { + const result = await client.schemas.deleteAccessGroup({ + namespace: "namespace", + slug: "slug", + body: { + accessGroupSlug: "", + }, + }); + + console.log(result); +} + +main(); +``` + +### `LoginPortals` + +#### Get a login portal + +Get a login portal by slug. + +| Field | Value | +| --- | --- | +| HTTP | `GET /v1/login-portals/{slug}` | +| Input | `slug: string` | +| Response | `APIPromise<{ uid: string; title: string; slug: string; email: LoginPortalEmail; page: LoginPortalPage }>` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | + +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); + +async function main() { + const result = await client.loginPortals.loginPortals({ + slug: "slug", + }); + + console.log(result); +} + +main(); +```
-## Summary +#### Delete a login portal + +Delete a login portal. + +| Field | Value | +| --- | --- | +| HTTP | `DELETE /v1/login-portals/{slug}` | +| Input | `slug: string` | +| Response | `APIPromise` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | -Scalar API: API for managing Scalar platform resources. +```ts +import ScalarApi from "@scalar/sdk"; -## TypeScript SDK +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); -For TypeScript, we provide a SDK that makes using our API even easier. +async function main() { + const result = await client.loginPortals.loginPortals3({ + slug: "slug", + }); -### Install + console.log(result); +} -```bash -npm add @scalar/sdk +main(); ``` -### Get a Scalar API key +
+ +#### Update portal metadata + +Update metadata for a login portal. + +| Field | Value | +| --- | --- | +| HTTP | `PATCH /v1/login-portals/{slug}` | +| Input | `slug: string`, `LoginPortals2Params` | +| Response | `APIPromise` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | + +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); -Create an API key in your Scalar account: +async function main() { + const result = await client.loginPortals.loginPortals2({ + slug: "slug", + body: {}, + }); -- Dashboard: https://dashboard.scalar.com/account -- Store it in `.env`, for example: + console.log(result); +} -```bash -SCALAR_API_KEY=your_personal_token +main(); ``` -### Exchange your API key for an access token +
+ +#### List all portals -The personal token is not an access token. Exchange it first with `postv1AuthExchange`. +List all login portals for the current team. -If you use the personal token directly for authenticated API calls, the API returns `401 Invalid authentication token`. +| Field | Value | +| --- | --- | +| HTTP | `GET /v1/login-portals` | +| Response | `APIPromise>` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | ```ts -import { Scalar } from '@scalar/sdk' +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); -const scalar = new Scalar() +async function main() { + const result = await client.loginPortals.loginPortals5(); -const exchange = await scalar.auth.postv1AuthExchange({ - personalToken: process.env.SCALAR_API_KEY!, -}) + console.log(result); +} -const accessToken = exchange.accessToken +main(); ``` -### Use the access token +
+ +#### Create a portal -Construct a second client with bearer auth. Use this authenticated client for API calls. +Create a login portal for the current team. + +| Field | Value | +| --- | --- | +| HTTP | `POST /v1/login-portals` | +| Input | `LoginPortals4Params` | +| Response | `APIPromise` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | ```ts -import { Scalar } from '@scalar/sdk' +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); -const scalar = new Scalar() +async function main() { + const result = await client.loginPortals.loginPortals4({ + body: { + title: "", + slug: "", + email: { + logo: "", + logoSize: "100", + buttonText: "Login", + message: "Click to access private documentation hosted by scalar.com", + title: "Private Docs", + mainColor: "#2a2f45", + mainBackground: "#f6f6f6", + cardColor: "2a2f45", + cardBackground: "#fff", + buttonColor: "#fff", + buttonBackground: "#0f0f0f", + }, + page: { + title: "Scalar Private Docs", + description: "Login to access your documentation", + head: "", + script: "", + theme: "", + companyName: "", + logo: "", + logoUrl: "", + favicon: "", + termsLink: "", + privacyLink: "", + formTitle: "Scalar Private Docs", + formDescription: "Login to access your documentation", + formImage: "", + }, + }, + }); -const exchange = await scalar.auth.postv1AuthExchange({ - personalToken: process.env.SCALAR_API_KEY!, -}) + console.log(result); +} -const authedScalar = new Scalar({ - bearerAuth: exchange.accessToken, -}) +main(); ``` -### Notes - -- The exchange request itself can be made from a client constructed with no arguments (`new Scalar()`). -- The exchanged access token is valid for 12 hours. -- Timestamps are Unix seconds. +### `Rules` -### Read more +#### List all rules -- [@scalar/sdk on npm](https://www.npmjs.com/package/@scalar/sdk) - +List all rulesets in a namespace. - -## Table of Contents - -* [@scalar/sdk](#scalarsdk) - * [TypeScript SDK](#typescript-sdk) - * [SDK Installation](#sdk-installation) - * [Requirements](#requirements) - * [SDK Example Usage](#sdk-example-usage) - * [Authentication](#authentication) - * [Available Resources and Operations](#available-resources-and-operations) - * [Standalone functions](#standalone-functions) - * [Retries](#retries) - * [Error Handling](#error-handling) - * [Server Selection](#server-selection) - * [Custom HTTP Client](#custom-http-client) - * [Debugging](#debugging) -* [Development](#development) - * [Maturity](#maturity) - * [Contributions](#contributions) +| Field | Value | +| --- | --- | +| HTTP | `GET /v1/rulesets/{namespace}` | +| Input | `namespace: string` | +| Response | `APIPromise>` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - +```ts +import ScalarApi from "@scalar/sdk"; - -## SDK Installation +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); -The SDK can be installed with either [npm](https://www.npmjs.com/), [pnpm](https://pnpm.io/), [bun](https://bun.sh/) or [yarn](https://classic.yarnpkg.com/en/) package managers. +async function main() { + const result = await client.rules.listRulesets({ + namespace: "namespace", + }); -### NPM + console.log(result); +} -```bash -npm add @scalar/sdk +main(); ``` -### PNPM +
+ +#### Create a rule -```bash -pnpm add @scalar/sdk -``` +Create a rule in a namespace. -### Bun +| Field | Value | +| --- | --- | +| HTTP | `POST /v1/rulesets/{namespace}` | +| Input | `namespace: string`, `RuleCreateRulesetParams` | +| Response | `APIPromise` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | -```bash -bun add @scalar/sdk -``` +```ts +import ScalarApi from "@scalar/sdk"; -### Yarn +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); -```bash -yarn add @scalar/sdk zod +async function main() { + const result = await client.rules.createRuleset({ + namespace: "namespace", + body: { + title: "", + slug: "", + document: "", + }, + }); -# Note that Yarn does not install peer dependencies automatically. You will need -# to install zod as shown above. -``` + console.log(result); +} -> [!NOTE] -> This package is published with CommonJS and ES Modules (ESM) support. - +main(); +``` - -## Requirements +
-For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md). - +#### Get a rule - -## SDK Example Usage +Get a rule document by slug. -### Example +| Field | Value | +| --- | --- | +| HTTP | `GET /v1/rulesets/{namespace}/{slug}` | +| Input | `namespace: string`, `slug: string` | +| Response | `APIPromise` | +| Content-Type | `text/plain` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | -```typescript -import { Scalar } from "@scalar/sdk"; +```ts +import ScalarApi from "@scalar/sdk"; -const scalar = new Scalar({ - bearerAuth: "", +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var }); -async function run() { - const result = await scalar.registry.listAllApiDocuments(); +async function main() { + const result = await client.rules.retrieveRulesetDocument({ + namespace: "namespace", + slug: "slug", + }); console.log(result); } -run(); - +main(); ``` - - -## Authentication +
-### Per-Client Security Schemes +#### Delete a rule -This SDK supports the following security scheme globally: +Delete a rule by slug. -| Name | Type | Scheme | -| ------------ | ---- | ----------- | -| `bearerAuth` | http | HTTP Bearer | +| Field | Value | +| --- | --- | +| HTTP | `DELETE /v1/rulesets/{namespace}/{slug}` | +| Input | `namespace: string`, `slug: string` | +| Response | `APIPromise` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | -To authenticate with the API the `bearerAuth` parameter must be set when initializing the SDK client instance. For example: -```typescript -import { Scalar } from "@scalar/sdk"; +```ts +import ScalarApi from "@scalar/sdk"; -const scalar = new Scalar({ - bearerAuth: "", +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var }); -async function run() { - const result = await scalar.registry.listAllApiDocuments(); +async function main() { + const result = await client.rules.deleteRuleset({ + namespace: "namespace", + slug: "slug", + }); console.log(result); } -run(); +main(); +``` + +
+ +#### Update rule metadata + +Update rule metadata by slug. + +| Field | Value | +| --- | --- | +| HTTP | `PATCH /v1/rulesets/{namespace}/{slug}` | +| Input | `namespace: string`, `slug: string`, `RuleUpdateRulesetParams` | +| Response | `APIPromise` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | + +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); + +async function main() { + const result = await client.rules.updateRuleset({ + namespace: "namespace", + slug: "slug", + body: {}, + }); + + console.log(result); +} +main(); ``` - - -## Available Resources and Operations +
+ +#### Add rule access group -
-Available methods +Grant an access group to a rule. -### [authentication](docs/sdks/authentication/README.md) +| Field | Value | +| --- | --- | +| HTTP | `POST /v1/rulesets/{namespace}/{slug}/access-group` | +| Input | `namespace: string`, `slug: string`, `RuleCreateRulesetAccessGroupParams` | +| Response | `APIPromise` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | -* [exchangePersonalToken](docs/sdks/authentication/README.md#exchangepersonaltoken) - Exchange token -* [getCurrentUser](docs/sdks/authentication/README.md#getcurrentuser) - Get current user +```ts +import ScalarApi from "@scalar/sdk"; -### [loginPortals](docs/sdks/loginportals/README.md) +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); -* [getLoginPortal](docs/sdks/loginportals/README.md#getloginportal) - Get a login portal -* [updateLoginPortal](docs/sdks/loginportals/README.md#updateloginportal) - Update portal metadata -* [deleteLoginPortal](docs/sdks/loginportals/README.md#deleteloginportal) - Delete a login portal -* [createLoginPortal](docs/sdks/loginportals/README.md#createloginportal) - Create a portal -* [listLoginPortals](docs/sdks/loginportals/README.md#listloginportals) - List all portals +async function main() { + const result = await client.rules.createRulesetAccessGroup({ + namespace: "namespace", + slug: "slug", + body: { + accessGroupSlug: "", + }, + }); -### [namespaces](docs/sdks/namespaces/README.md) + console.log(result); +} -* [listNamespaces](docs/sdks/namespaces/README.md#listnamespaces) - List namespaces +main(); +``` -### [registry](docs/sdks/registry/README.md) +
-* [listAllApiDocuments](docs/sdks/registry/README.md#listallapidocuments) - List all API Documents -* [listApiDocuments](docs/sdks/registry/README.md#listapidocuments) - List API Documents in a namespace -* [createApiDocument](docs/sdks/registry/README.md#createapidocument) - Create API Document -* [updateApiDocument](docs/sdks/registry/README.md#updateapidocument) - Update API Document metadata -* [deleteApiDocument](docs/sdks/registry/README.md#deleteapidocument) - Delete API Document -* [getApiDocumentVersion](docs/sdks/registry/README.md#getapidocumentversion) - Get API Document -* [updateApiDocumentVersion](docs/sdks/registry/README.md#updateapidocumentversion) - Update API Document version -* [deleteApiDocumentVersion](docs/sdks/registry/README.md#deleteapidocumentversion) - Delete API Document version -* [getApiDocumentVersionMetadata](docs/sdks/registry/README.md#getapidocumentversionmetadata) - Get API Document version metadata -* [createApiDocumentVersion](docs/sdks/registry/README.md#createapidocumentversion) - Create API Document version -* [addApiDocumentAccessGroup](docs/sdks/registry/README.md#addapidocumentaccessgroup) - Add access group -* [removeApiDocumentAccessGroup](docs/sdks/registry/README.md#removeapidocumentaccessgroup) - Remove access group +#### Remove rule access group -### [rules](docs/sdks/rules/README.md) - -* [listRulesets](docs/sdks/rules/README.md#listrulesets) - List all rules -* [createRuleset](docs/sdks/rules/README.md#createruleset) - Create a rule -* [updateRuleset](docs/sdks/rules/README.md#updateruleset) - Update rule metadata -* [deleteRuleset](docs/sdks/rules/README.md#deleteruleset) - Delete a rule -* [getRulesetDocument](docs/sdks/rules/README.md#getrulesetdocument) - Get a rule -* [addRulesetAccessGroup](docs/sdks/rules/README.md#addrulesetaccessgroup) - Add rule access group -* [removeRulesetAccessGroup](docs/sdks/rules/README.md#removerulesetaccessgroup) - Remove rule access group - - -### [scalarDocs](docs/sdks/scalardocs/README.md) +Remove an access group from a rule. -* [listGuides](docs/sdks/scalardocs/README.md#listguides) - List all projects -* [createGuide](docs/sdks/scalardocs/README.md#createguide) - Create a project -* [publishGuide](docs/sdks/scalardocs/README.md#publishguide) - Publish a project +| Field | Value | +| --- | --- | +| HTTP | `DELETE /v1/rulesets/{namespace}/{slug}/access-group` | +| Input | `namespace: string`, `slug: string`, `RuleDeleteRulesetAccessGroupParams` | +| Response | `APIPromise` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | -### [schemas](docs/sdks/schemas/README.md) +```ts +import ScalarApi from "@scalar/sdk"; -* [listSchemas](docs/sdks/schemas/README.md#listschemas) - List all shared components -* [createSchema](docs/sdks/schemas/README.md#createschema) - Create a shared component -* [updateSchema](docs/sdks/schemas/README.md#updateschema) - Update shared component metadata -* [deleteSchema](docs/sdks/schemas/README.md#deleteschema) - Delete a shared component -* [getSchemaVersion](docs/sdks/schemas/README.md#getschemaversion) - Get a shared component document -* [deleteSchemaVersion](docs/sdks/schemas/README.md#deleteschemaversion) - Delete a shared component version -* [createSchemaVersion](docs/sdks/schemas/README.md#createschemaversion) - Create a shared component version -* [addSchemaAccessGroup](docs/sdks/schemas/README.md#addschemaaccessgroup) - Add shared component access group -* [removeSchemaAccessGroup](docs/sdks/schemas/README.md#removeschemaaccessgroup) - Remove shared component access group +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); -### [teams](docs/sdks/teams/README.md) - -* [listTeams](docs/sdks/teams/README.md#listteams) - List teams - -### [themes](docs/sdks/themes/README.md) - -* [listThemes](docs/sdks/themes/README.md#listthemes) - List all themes -* [createTheme](docs/sdks/themes/README.md#createtheme) - Create a theme -* [updateTheme](docs/sdks/themes/README.md#updatetheme) - Update theme metadata -* [replaceThemeDocument](docs/sdks/themes/README.md#replacethemedocument) - Update theme document -* [deleteTheme](docs/sdks/themes/README.md#deletetheme) - Delete a theme -* [getTheme](docs/sdks/themes/README.md#gettheme) - Get a theme - -
- - - -## Standalone functions - -All the methods listed above are available as standalone functions. These -functions are ideal for use in applications running in the browser, serverless -runtimes or other environments where application bundle size is a primary -concern. When using a bundler to build your application, all unused -functionality will be either excluded from the final bundle or tree-shaken away. - -To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). - -
- -Available standalone functions - -- [`authenticationExchangePersonalToken`](docs/sdks/authentication/README.md#exchangepersonaltoken) - Exchange token -- [`authenticationGetCurrentUser`](docs/sdks/authentication/README.md#getcurrentuser) - Get current user -- [`loginPortalsCreateLoginPortal`](docs/sdks/loginportals/README.md#createloginportal) - Create a portal -- [`loginPortalsDeleteLoginPortal`](docs/sdks/loginportals/README.md#deleteloginportal) - Delete a login portal -- [`loginPortalsGetLoginPortal`](docs/sdks/loginportals/README.md#getloginportal) - Get a login portal -- [`loginPortalsListLoginPortals`](docs/sdks/loginportals/README.md#listloginportals) - List all portals -- [`loginPortalsUpdateLoginPortal`](docs/sdks/loginportals/README.md#updateloginportal) - Update portal metadata -- [`namespacesListNamespaces`](docs/sdks/namespaces/README.md#listnamespaces) - List namespaces -- [`registryAddApiDocumentAccessGroup`](docs/sdks/registry/README.md#addapidocumentaccessgroup) - Add access group -- [`registryCreateApiDocument`](docs/sdks/registry/README.md#createapidocument) - Create API Document -- [`registryCreateApiDocumentVersion`](docs/sdks/registry/README.md#createapidocumentversion) - Create API Document version -- [`registryDeleteApiDocument`](docs/sdks/registry/README.md#deleteapidocument) - Delete API Document -- [`registryDeleteApiDocumentVersion`](docs/sdks/registry/README.md#deleteapidocumentversion) - Delete API Document version -- [`registryGetApiDocumentVersion`](docs/sdks/registry/README.md#getapidocumentversion) - Get API Document -- [`registryGetApiDocumentVersionMetadata`](docs/sdks/registry/README.md#getapidocumentversionmetadata) - Get API Document version metadata -- [`registryListAllApiDocuments`](docs/sdks/registry/README.md#listallapidocuments) - List all API Documents -- [`registryListApiDocuments`](docs/sdks/registry/README.md#listapidocuments) - List API Documents in a namespace -- [`registryRemoveApiDocumentAccessGroup`](docs/sdks/registry/README.md#removeapidocumentaccessgroup) - Remove access group -- [`registryUpdateApiDocument`](docs/sdks/registry/README.md#updateapidocument) - Update API Document metadata -- [`registryUpdateApiDocumentVersion`](docs/sdks/registry/README.md#updateapidocumentversion) - Update API Document version -- [`rulesAddRulesetAccessGroup`](docs/sdks/rules/README.md#addrulesetaccessgroup) - Add rule access group -- [`rulesCreateRuleset`](docs/sdks/rules/README.md#createruleset) - Create a rule -- [`rulesDeleteRuleset`](docs/sdks/rules/README.md#deleteruleset) - Delete a rule -- [`rulesGetRulesetDocument`](docs/sdks/rules/README.md#getrulesetdocument) - Get a rule -- [`rulesListRulesets`](docs/sdks/rules/README.md#listrulesets) - List all rules -- [`rulesRemoveRulesetAccessGroup`](docs/sdks/rules/README.md#removerulesetaccessgroup) - Remove rule access group -- [`rulesUpdateRuleset`](docs/sdks/rules/README.md#updateruleset) - Update rule metadata -- [`scalarDocsCreateGuide`](docs/sdks/scalardocs/README.md#createguide) - Create a project -- [`scalarDocsListGuides`](docs/sdks/scalardocs/README.md#listguides) - List all projects -- [`scalarDocsPublishGuide`](docs/sdks/scalardocs/README.md#publishguide) - Publish a project -- [`schemasAddSchemaAccessGroup`](docs/sdks/schemas/README.md#addschemaaccessgroup) - Add shared component access group -- [`schemasCreateSchema`](docs/sdks/schemas/README.md#createschema) - Create a shared component -- [`schemasCreateSchemaVersion`](docs/sdks/schemas/README.md#createschemaversion) - Create a shared component version -- [`schemasDeleteSchema`](docs/sdks/schemas/README.md#deleteschema) - Delete a shared component -- [`schemasDeleteSchemaVersion`](docs/sdks/schemas/README.md#deleteschemaversion) - Delete a shared component version -- [`schemasGetSchemaVersion`](docs/sdks/schemas/README.md#getschemaversion) - Get a shared component document -- [`schemasListSchemas`](docs/sdks/schemas/README.md#listschemas) - List all shared components -- [`schemasRemoveSchemaAccessGroup`](docs/sdks/schemas/README.md#removeschemaaccessgroup) - Remove shared component access group -- [`schemasUpdateSchema`](docs/sdks/schemas/README.md#updateschema) - Update shared component metadata -- [`teamsListTeams`](docs/sdks/teams/README.md#listteams) - List teams -- [`themesCreateTheme`](docs/sdks/themes/README.md#createtheme) - Create a theme -- [`themesDeleteTheme`](docs/sdks/themes/README.md#deletetheme) - Delete a theme -- [`themesGetTheme`](docs/sdks/themes/README.md#gettheme) - Get a theme -- [`themesListThemes`](docs/sdks/themes/README.md#listthemes) - List all themes -- [`themesReplaceThemeDocument`](docs/sdks/themes/README.md#replacethemedocument) - Update theme document -- [`themesUpdateTheme`](docs/sdks/themes/README.md#updatetheme) - Update theme metadata - -
- - - -## 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 { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.registry.listAllApiDocuments({ - retries: { - strategy: "backoff", - backoff: { - initialInterval: 1, - maxInterval: 50, - exponent: 1.1, - maxElapsedTime: 100, - }, - retryConnectionErrors: false, +async function main() { + const result = await client.rules.deleteRulesetAccessGroup({ + namespace: "namespace", + slug: "slug", + body: { + accessGroupSlug: "", }, }); console.log(result); } -run(); +main(); +``` + +### `Themes` + +#### List all themes + +List all team themes. + +| Field | Value | +| --- | --- | +| HTTP | `GET /v1/themes` | +| Response | `APIPromise>` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | + +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); + +async function main() { + const result = await client.themes.list(); + + console.log(result); +} +main(); ``` -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 { Scalar } from "@scalar/sdk"; +
+ +#### Create a theme -const scalar = new Scalar({ - retryConfig: { - strategy: "backoff", - backoff: { - initialInterval: 1, - maxInterval: 50, - exponent: 1.1, - maxElapsedTime: 100, - }, - retryConnectionErrors: false, - }, - bearerAuth: "", +Create a team theme. + +| Field | Value | +| --- | --- | +| HTTP | `POST /v1/themes` | +| Input | `ThemeCreateParams` | +| Response | `APIPromise` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | + +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var }); -async function run() { - const result = await scalar.registry.listAllApiDocuments(); +async function main() { + const result = await client.themes.create({ + body: { + name: "", + slug: "", + document: "", + }, + }); console.log(result); } -run(); +main(); +``` + +
+ +#### Get a theme + +Get the theme document by slug. + +| Field | Value | +| --- | --- | +| HTTP | `GET /v1/themes/{slug}` | +| Input | `slug: string` | +| Response | `APIPromise` | +| Content-Type | `text/plain` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); + +async function main() { + const result = await client.themes.retrieve({ + slug: "slug", + }); + + console.log(result); +} + +main(); ``` - - -## Error Handling +
+ +#### Update theme document -[`ScalarError`](./src/models/errors/scalarerror.ts) is the base class for all HTTP error responses. It has the following properties: +Replace the theme document. -| Property | Type | Description | -| ------------------------- | ---------- | --------------------------------------------------------------------------------------- | -| `error.message` | `string` | Error message | -| `error.httpMeta.response` | `Response` | HTTP response. Access to headers and more. | -| `error.httpMeta.request` | `Request` | HTTP request. Access to headers and more. | -| `error.data$` | | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). | +| Field | Value | +| --- | --- | +| HTTP | `PUT /v1/themes/{slug}` | +| Input | `slug: string`, `ThemeReplaceDocumentParams` | +| Response | `APIPromise` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | -### Example -```typescript -import { Scalar } from "@scalar/sdk"; -import * as errors from "@scalar/sdk/models/errors"; +```ts +import ScalarApi from "@scalar/sdk"; -const scalar = new Scalar({ - bearerAuth: "", +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var }); -async function run() { - try { - const result = await scalar.registry.listAllApiDocuments(); +async function main() { + const result = await client.themes.replaceDocument({ + slug: "slug", + body: { + document: "", + }, + }); + + console.log(result); +} + +main(); +``` + +
+ +#### Delete a theme + +Delete a theme by slug. + +| Field | Value | +| --- | --- | +| HTTP | `DELETE /v1/themes/{slug}` | +| Input | `slug: string` | +| Response | `APIPromise` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - console.log(result); - } catch (error) { - // The base class for HTTP error responses - if (error instanceof errors.ScalarError) { - console.log(error.message); - console.log(error.httpMeta.response.status); - console.log(error.httpMeta.response.headers); - console.log(error.httpMeta.request); +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); + +async function main() { + const result = await client.themes.delete({ + slug: "slug", + }); - // Depending on the method different errors may be thrown - if (error instanceof errors.FourHundred) { - console.log(error.data$.message); // string - console.log(error.data$.code); // string - } - } - } + console.log(result); } -run(); +main(); +``` + +
+ +#### Update theme metadata + +Update theme metadata. + +| Field | Value | +| --- | --- | +| HTTP | `PATCH /v1/themes/{slug}` | +| Input | `slug: string`, `ThemeUpdateParams` | +| Response | `APIPromise` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | + +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); +async function main() { + const result = await client.themes.update({ + slug: "slug", + body: {}, + }); + + console.log(result); +} + +main(); ``` -### Error Classes -**Primary errors:** -* [`ScalarError`](./src/models/errors/scalarerror.ts): The base class for HTTP error responses. - * [`FourHundred`](docs/models/errors/fourhundred.md): Bad request. Status code `400`. - * [`FourHundredAndOne`](docs/models/errors/fourhundredandone.md): No auth. Status code `401`. - * [`FourHundredAndThree`](docs/models/errors/fourhundredandthree.md): Forbidden. Status code `403`. - * [`FourHundredAndFour`](docs/models/errors/fourhundredandfour.md): Not found. Status code `404`. - * [`FourHundredAndTwentyTwo`](docs/models/errors/fourhundredandtwentytwo.md): Invalid payload. Status code `422`. - * [`FiveHundred`](docs/models/errors/fivehundred.md): Uncaught error. Status code `500`. +### `Teams` -
Less common errors (6) +#### List teams -
+List all available teams + +| Field | Value | +| --- | --- | +| HTTP | `GET /v1/teams` | +| Response | `APIPromise>` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | + +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); + +async function main() { + const result = await client.teams.list(); -**Network errors:** -* [`ConnectionError`](./src/models/errors/httpclienterrors.ts): HTTP client was unable to make a request to a server. -* [`RequestTimeoutError`](./src/models/errors/httpclienterrors.ts): HTTP request timed out due to an AbortSignal signal. -* [`RequestAbortedError`](./src/models/errors/httpclienterrors.ts): HTTP request was aborted by the client. -* [`InvalidRequestError`](./src/models/errors/httpclienterrors.ts): Any input used to create a request is invalid. -* [`UnexpectedClientError`](./src/models/errors/httpclienterrors.ts): Unrecognised or unexpected error. + console.log(result); +} +main(); +``` -**Inherit from [`ScalarError`](./src/models/errors/scalarerror.ts)**: -* [`ResponseValidationError`](./src/models/errors/responsevalidationerror.ts): Type mismatch between the data returned from the server and the structure expected by the SDK. See `error.rawValue` for the raw value and `error.pretty()` for a nicely formatted multi-line string. +### `ScalarDocs` -
- +#### List all projects - -## Server Selection +List all guide projects. -### Override Server URL Per-Client +| Field | Value | +| --- | --- | +| HTTP | `GET /v1/guides` | +| Response | `APIPromise>` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | -The default server can be overridden globally by passing a URL to the `serverURL: string` optional parameter when initializing the SDK client instance. For example: -```typescript -import { Scalar } from "@scalar/sdk"; +```ts +import ScalarApi from "@scalar/sdk"; -const scalar = new Scalar({ - serverURL: "https://access.scalar.com", - bearerAuth: "", +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var }); -async function run() { - const result = await scalar.registry.listAllApiDocuments(); +async function main() { + const result = await client.scalarDocs.listGuides(); console.log(result); } -run(); +main(); +``` + +
+ +#### Create a project + +Create a guide project. + +| Field | Value | +| --- | --- | +| HTTP | `POST /v1/guides` | +| Input | `ScalarDocCreateGuideParams` | +| Response | `APIPromise<{ uid: string; slug: string }>` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | + +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); + +async function main() { + const result = await client.scalarDocs.createGuide({ + body: { + name: "", + isPrivate: false, + allowedUsers: [], + allowedDomains: [], + }, + }); + + console.log(result); +} +main(); ``` - - -## Custom HTTP Client +
-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. +#### Publish a project -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. +Start a new publish process. -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: +| Field | Value | +| --- | --- | +| HTTP | `POST /v1/guides/{slug}/publish` | +| Input | `slug: string` | +| Response | `APIPromise<{ publishUid: string }>` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | -```typescript -import { Scalar } from "@scalar/sdk"; -import { HTTPClient } from "@scalar/sdk/lib/http"; +```ts +import ScalarApi from "@scalar/sdk"; -const httpClient = new HTTPClient({ - // fetcher takes a function that has the same signature as native `fetch`. - fetcher: (request) => { - return fetch(request); - } +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var }); -httpClient.addHook("beforeRequest", (request) => { - const nextRequest = new Request(request, { - signal: request.signal || AbortSignal.timeout(5000) +async function main() { + const result = await client.scalarDocs.publishGuide({ + slug: "slug", }); - nextRequest.headers.set("x-custom-header", "custom value"); + console.log(result); +} + +main(); +``` + +### `Namespaces` + +#### List namespaces - return nextRequest; +Get all namespaces for the current team + +| Field | Value | +| --- | --- | +| HTTP | `GET /v1/namespaces` | +| Response | `APIPromise>` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | + +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var }); -httpClient.addHook("requestError", (error, request) => { - console.group("Request Error"); - console.log("Reason:", `${error}`); - console.log("Endpoint:", `${request.method} ${request.url}`); - console.groupEnd(); +async function main() { + const result = await client.namespaces.list(); + + console.log(result); +} + +main(); +``` + +### `Authentication` + +#### Exchange token + +Exchange an API key for an access token. + +| Field | Value | +| --- | --- | +| HTTP | `POST /v1/auth/exchange` | +| Input | `AuthenticationExchangePersonalTokenParams` | +| Response | `APIPromise<{ accessToken: string }>` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | + +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var }); -const sdk = new Scalar({ httpClient }); +async function main() { + const result = await client.authentication.exchangePersonalToken({ + body: { + personalToken: "", + }, + }); + + console.log(result); +} + +main(); ``` - - -## Debugging +
-You can setup your SDK to emit debug logs for SDK requests and responses. +#### Get current user -You can pass a logger that matches `console`'s interface as an SDK option. +Get the authenticated user, including their available teams and theme. -> [!WARNING] -> Beware that debug logging will reveal secrets, like API tokens in headers, in log messages printed to a console or files. It's recommended to use this feature only during local development and not in production. +| Field | Value | +| --- | --- | +| HTTP | `GET /v1/auth/me` | +| Response | `APIPromise` | +| Content-Type | `application/json` | +| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | -```typescript -import { Scalar } from "@scalar/sdk"; +```ts +import ScalarApi from "@scalar/sdk"; + +const client = new ScalarApi({ + bearer_auth: process.env["BEARER_AUTH"], // defaults to the BEARER_AUTH env var +}); + +async function main() { + const result = await client.authentication.listCurrentUser(); -const sdk = new Scalar({ debugLogger: console }); + console.log(result); +} + +main(); ``` - -## Contributions +
+ +## Errors + +Non-success responses throw generated API errors. Error objects expose status, headers, response body, and request metadata where the target runtime supports it. + +Documented error statuses: `400`, `401`, `403`, `404`, `422`, `500`. + +
+ +## Retries and Timeouts + +Generated clients support request timeouts and retry temporary failures such as network errors, 408, 409, 429, and 5xx responses. Retry delays honor `Retry-After` headers when present. + +
+ +## Debugging + +- `logLevel: "debug"` logs request URLs, options, response status, response headers, and retry attempts. +- Pass a custom `logger` to route logs into your own observability pipeline. +- Set `logLevel: null` to disable environment-driven logging. + +
+ +## Requirements -While we value open-source contributions to this SDK, this library is generated programmatically. Any manual changes added to internal files will be overwritten on the next generation. -We look forward to hearing your feedback. Feel free to open a PR or an issue with a proof of concept and we'll do our best to include it in a future release. +- Node.js 20+, a modern browser, or any runtime with `fetch` support -### SDK Created by [Scalar](https://www.scalar.com/?utm_source=scalar-typescript-sdk&utm_campaign=typescript) \ No newline at end of file +Powered by Scalar. diff --git a/RUNTIMES.md b/RUNTIMES.md deleted file mode 100644 index db7ea94..0000000 --- a/RUNTIMES.md +++ /dev/null @@ -1,48 +0,0 @@ -# Supported JavaScript runtimes - -This SDK is intended to be used in JavaScript runtimes that support ECMAScript 2020 or newer. The SDK uses 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 - -## Recommended TypeScript compiler options - -The following `tsconfig.json` options are recommended for projects using this -SDK in order to get static type support for features like async iterables, -streams and `fetch`-related APIs ([`for await...of`][for-await-of], -[`AbortSignal`][abort-signal], [`Request`][request], [`Response`][response] and -so on): - -[for-await-of]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of -[abort-signal]: https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal -[request]: https://developer.mozilla.org/en-US/docs/Web/API/Request -[response]: https://developer.mozilla.org/en-US/docs/Web/API/Response - -```jsonc -{ - "compilerOptions": { - "target": "es2020", // or higher - "lib": ["es2020", "dom", "dom.iterable"], - } -} -``` - -While `target` can be set to older ECMAScript versions, it may result in extra, -unnecessary compatibility code being generated if you are not targeting old -runtimes. \ No newline at end of file diff --git a/USAGE.md b/USAGE.md deleted file mode 100644 index fa2c044..0000000 --- a/USAGE.md +++ /dev/null @@ -1,18 +0,0 @@ - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.registry.listAllApiDocuments(); - - console.log(result); -} - -run(); - -``` - \ No newline at end of file diff --git a/code-samples.yaml b/code-samples.yaml deleted file mode 100644 index 032b140..0000000 --- a/code-samples.yaml +++ /dev/null @@ -1,281 +0,0 @@ -overlay: 1.0.0 -info: - title: CodeSamples overlay for typescript target - version: 0.0.0 -actions: - - target: $["paths"]["/v1/apis"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "listAllApiDocuments" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.registry.listAllApiDocuments();\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/apis/{namespace}"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "listApiDocuments" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.registry.listApiDocuments({\n namespace: \"\",\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/apis/{namespace}"]["post"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "createApiDocument" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.registry.createApiDocument({\n namespace: \"\",\n requestBody: {\n title: \"\",\n version: \"\",\n slug: \"\",\n document: \"\",\n },\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/apis/{namespace}/{slug}"]["delete"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "deleteApiDocument" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.registry.deleteApiDocument({\n namespace: \"\",\n slug: \"\",\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/apis/{namespace}/{slug}"]["patch"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "updateApiDocument" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.registry.updateApiDocument({\n namespace: \"\",\n slug: \"\",\n requestBody: {},\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/apis/{namespace}/{slug}/access-group"]["delete"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "removeApiDocumentAccessGroup" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.registry.removeApiDocumentAccessGroup({\n namespace: \"\",\n slug: \"\",\n accessGroup: {\n accessGroupSlug: \"\",\n },\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/apis/{namespace}/{slug}/access-group"]["post"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "addApiDocumentAccessGroup" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.registry.addApiDocumentAccessGroup({\n namespace: \"\",\n slug: \"\",\n accessGroup: {\n accessGroupSlug: \"\",\n },\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/apis/{namespace}/{slug}/version"]["post"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "createApiDocumentVersion" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.registry.createApiDocumentVersion({\n namespace: \"\",\n slug: \"\",\n requestBody: {\n version: \"\",\n document: \"\",\n },\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/apis/{namespace}/{slug}/version/{semver}"]["delete"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "deleteApiDocumentVersion" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.registry.deleteApiDocumentVersion({\n namespace: \"\",\n slug: \"\",\n semver: \"\",\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/apis/{namespace}/{slug}/version/{semver}"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "getApiDocumentVersion" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.registry.getApiDocumentVersion({\n namespace: \"\",\n slug: \"\",\n semver: \"\",\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/apis/{namespace}/{slug}/version/{semver}"]["patch"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "updateApiDocumentVersion" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.registry.updateApiDocumentVersion({\n namespace: \"\",\n slug: \"\",\n semver: \"\",\n requestBody: {\n document: \"\",\n },\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/apis/{namespace}/{slug}/version/{semver}/metadata"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "getApiDocumentVersionMetadata" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.registry.getApiDocumentVersionMetadata({\n namespace: \"\",\n slug: \"\",\n semver: \"\",\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/auth/exchange"]["post"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "exchangePersonalToken" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar();\n\nasync function run() {\n const result = await scalar.authentication.exchangePersonalToken({\n personalToken: \"\",\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/auth/me"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "getCurrentUser" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.authentication.getCurrentUser();\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/guides"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "listGuides" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.scalarDocs.listGuides();\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/guides"]["post"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "createGuide" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.scalarDocs.createGuide({\n name: \"\",\n allowedUsers: [\n \"\",\n ],\n allowedDomains: [],\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/guides/{slug}/publish"]["post"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "publishGuide" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.scalarDocs.publishGuide({\n slug: \"\",\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/login-portals"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "listLoginPortals" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.loginPortals.listLoginPortals();\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/login-portals"]["post"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "createLoginPortal" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.loginPortals.createLoginPortal({\n title: \"\",\n slug: \"\",\n email: {},\n page: {},\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/login-portals/{slug}"]["delete"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "deleteLoginPortal" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.loginPortals.deleteLoginPortal({\n slug: \"\",\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/login-portals/{slug}"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "getLoginPortal" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.loginPortals.getLoginPortal({\n slug: \"\",\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/login-portals/{slug}"]["patch"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "updateLoginPortal" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.loginPortals.updateLoginPortal({\n slug: \"\",\n requestBody: {},\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/namespaces"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "listNamespaces" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.namespaces.listNamespaces();\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/rulesets/{namespace}"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "listRulesets" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.rules.listRulesets({\n namespace: \"\",\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/rulesets/{namespace}"]["post"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "createRuleset" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.rules.createRuleset({\n namespace: \"\",\n requestBody: {\n title: \"\",\n slug: \"\",\n document: \"\",\n },\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/rulesets/{namespace}/{slug}"]["delete"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "deleteRuleset" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.rules.deleteRuleset({\n namespace: \"\",\n slug: \"\",\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/rulesets/{namespace}/{slug}"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "getRulesetDocument" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.rules.getRulesetDocument({\n namespace: \"\",\n slug: \"\",\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/rulesets/{namespace}/{slug}"]["patch"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "updateRuleset" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.rules.updateRuleset({\n namespace: \"\",\n slug: \"\",\n requestBody: {},\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/rulesets/{namespace}/{slug}/access-group"]["delete"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "removeRulesetAccessGroup" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.rules.removeRulesetAccessGroup({\n namespace: \"\",\n slug: \"\",\n accessGroup: {\n accessGroupSlug: \"\",\n },\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/rulesets/{namespace}/{slug}/access-group"]["post"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "addRulesetAccessGroup" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.rules.addRulesetAccessGroup({\n namespace: \"\",\n slug: \"\",\n accessGroup: {\n accessGroupSlug: \"\",\n },\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/schemas/{namespace}"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "listSchemas" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.schemas.listSchemas({\n namespace: \"\",\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/schemas/{namespace}"]["post"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "createSchema" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.schemas.createSchema({\n namespace: \"\",\n requestBody: {\n title: \"\",\n version: \"\",\n slug: \"\",\n document: \"\",\n },\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/schemas/{namespace}/{slug}"]["delete"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "deleteSchema" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.schemas.deleteSchema({\n namespace: \"\",\n slug: \"\",\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/schemas/{namespace}/{slug}"]["patch"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "updateSchema" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.schemas.updateSchema({\n namespace: \"\",\n slug: \"\",\n requestBody: {},\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/schemas/{namespace}/{slug}/access-group"]["delete"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "removeSchemaAccessGroup" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.schemas.removeSchemaAccessGroup({\n namespace: \"\",\n slug: \"\",\n accessGroup: {\n accessGroupSlug: \"\",\n },\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/schemas/{namespace}/{slug}/access-group"]["post"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "addSchemaAccessGroup" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.schemas.addSchemaAccessGroup({\n namespace: \"\",\n slug: \"\",\n accessGroup: {\n accessGroupSlug: \"\",\n },\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/schemas/{namespace}/{slug}/version"]["post"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "createSchemaVersion" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.schemas.createSchemaVersion({\n namespace: \"\",\n slug: \"\",\n requestBody: {\n version: \"\",\n document: \"\",\n },\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/schemas/{namespace}/{slug}/version/{semver}"]["delete"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "deleteSchemaVersion" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.schemas.deleteSchemaVersion({\n namespace: \"\",\n slug: \"\",\n semver: \"\",\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/schemas/{namespace}/{slug}/version/{semver}"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "getSchemaVersion" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.schemas.getSchemaVersion({\n namespace: \"\",\n slug: \"\",\n semver: \"\",\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/teams"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "listTeams" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.teams.listTeams();\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/themes"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "listThemes" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.themes.listThemes();\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/themes"]["post"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "createTheme" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.themes.createTheme({\n name: \"\",\n slug: \"\",\n document: \"\",\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/themes/{slug}"]["delete"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "deleteTheme" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.themes.deleteTheme({\n slug: \"\",\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/themes/{slug}"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "getTheme" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.themes.getTheme({\n slug: \"\",\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/themes/{slug}"]["patch"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "updateTheme" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.themes.updateTheme({\n slug: \"\",\n requestBody: {},\n });\n\n console.log(result);\n}\n\nrun();" - - target: $["paths"]["/v1/themes/{slug}"]["put"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "replaceThemeDocument" - "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.themes.replaceThemeDocument({\n slug: \"\",\n requestBody: {\n document: \"\",\n },\n });\n\n console.log(result);\n}\n\nrun();" diff --git a/docs/lib/utils/retryconfig.md b/docs/lib/utils/retryconfig.md deleted file mode 100644 index 08f95f4..0000000 --- a/docs/lib/utils/retryconfig.md +++ /dev/null @@ -1,24 +0,0 @@ -# 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/models/components/accessgroup.md b/docs/models/components/accessgroup.md deleted file mode 100644 index 77c9911..0000000 --- a/docs/models/components/accessgroup.md +++ /dev/null @@ -1,17 +0,0 @@ -# AccessGroup - -## Example Usage - -```typescript -import { AccessGroup } from "@scalar/sdk/models/components"; - -let value: AccessGroup = { - accessGroupSlug: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `accessGroupSlug` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/activedeployment.md b/docs/models/components/activedeployment.md deleted file mode 100644 index 11d1452..0000000 --- a/docs/models/components/activedeployment.md +++ /dev/null @@ -1,21 +0,0 @@ -# ActiveDeployment - -## Example Usage - -```typescript -import { ActiveDeployment } from "@scalar/sdk/models/components"; - -let value: ActiveDeployment = { - uid: "", - domain: "metallic-sauerkraut.net", - publishedAt: 922131, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `uid` | *string* | :heavy_check_mark: | N/A | -| `domain` | *string* | :heavy_check_mark: | N/A | -| `publishedAt` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/apidocument.md b/docs/models/components/apidocument.md deleted file mode 100644 index 51c343a..0000000 --- a/docs/models/components/apidocument.md +++ /dev/null @@ -1,30 +0,0 @@ -# ApiDocument - -## Example Usage - -```typescript -import { ApiDocument } from "@scalar/sdk/models/components"; - -let value: ApiDocument = { - uid: "", - version: "", - slug: "", - namespace: "", - tags: [], - versions: [], -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | -| `uid` | *string* | :heavy_check_mark: | N/A | -| `version` | *string* | :heavy_check_mark: | N/A | -| `title` | *string* | :heavy_minus_sign: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `description` | *string* | :heavy_minus_sign: | N/A | -| `namespace` | *string* | :heavy_check_mark: | N/A | -| `isPrivate` | *boolean* | :heavy_minus_sign: | N/A | -| `tags` | *any* | :heavy_minus_sign: | N/A | -| `versions` | [components.ManagedDocVersion](../../models/components/manageddocversion.md)[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/embedstatus.md b/docs/models/components/embedstatus.md deleted file mode 100644 index 112d98a..0000000 --- a/docs/models/components/embedstatus.md +++ /dev/null @@ -1,15 +0,0 @@ -# EmbedStatus - -## Example Usage - -```typescript -import { EmbedStatus } from "@scalar/sdk/models/components"; - -let value: EmbedStatus = "complete"; -``` - -## Values - -```typescript -"complete" | "failed" -``` \ No newline at end of file diff --git a/docs/models/components/enabledtools.md b/docs/models/components/enabledtools.md deleted file mode 100644 index 2fd92d5..0000000 --- a/docs/models/components/enabledtools.md +++ /dev/null @@ -1,15 +0,0 @@ -# EnabledTools - -## Example Usage - -```typescript -import { EnabledTools } from "@scalar/sdk/models/components"; - -let value: EnabledTools = "get-mini-openapi-spec"; -``` - -## Values - -```typescript -"execute-request" | "get-mini-openapi-spec" -``` \ No newline at end of file diff --git a/docs/models/components/githubproject.md b/docs/models/components/githubproject.md deleted file mode 100644 index 8c089e9..0000000 --- a/docs/models/components/githubproject.md +++ /dev/null @@ -1,45 +0,0 @@ -# GithubProject - -## Example Usage - -```typescript -import { GithubProject } from "@scalar/sdk/models/components"; - -let value: GithubProject = { - uid: "", - createdAt: 524249, - updatedAt: 617921, - name: "", - activeDeployment: { - uid: "", - domain: "lanky-rosemary.biz", - publishedAt: 249786, - }, - lastPublished: 801545, - lastPublishedUid: "", - accessGroups: [], - slug: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `uid` | *string* | :heavy_check_mark: | N/A | -| `createdAt` | *number* | :heavy_check_mark: | N/A | -| `updatedAt` | *number* | :heavy_check_mark: | N/A | -| `name` | *string* | :heavy_check_mark: | N/A | -| `activeDeployment` | [components.ActiveDeployment](../../models/components/activedeployment.md) | :heavy_check_mark: | N/A | -| `lastPublished` | *number* | :heavy_check_mark: | N/A | -| `lastPublishedUid` | *string* | :heavy_check_mark: | N/A | -| `loginPortalUid` | *string* | :heavy_minus_sign: | N/A | -| `activeThemeId` | *string* | :heavy_minus_sign: | N/A | -| `typesenseId` | *number* | :heavy_minus_sign: | N/A | -| `isPrivate` | *boolean* | :heavy_minus_sign: | N/A | -| `agentEnabled` | *boolean* | :heavy_minus_sign: | N/A | -| `accessGroups` | *any* | :heavy_minus_sign: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `publishStatus` | *string* | :heavy_minus_sign: | N/A | -| `publishMessage` | *string* | :heavy_minus_sign: | N/A | -| `repository` | [components.GithubProjectRepository](../../models/components/githubprojectrepository.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/githubprojectrepository.md b/docs/models/components/githubprojectrepository.md deleted file mode 100644 index 4a1e1c7..0000000 --- a/docs/models/components/githubprojectrepository.md +++ /dev/null @@ -1,27 +0,0 @@ -# GithubProjectRepository - -## Example Usage - -```typescript -import { GithubProjectRepository } from "@scalar/sdk/models/components"; - -let value: GithubProjectRepository = { - linkedBy: "", - id: 5514.52, - name: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `linkedBy` | *string* | :heavy_check_mark: | N/A | -| `id` | *number* | :heavy_check_mark: | N/A | -| `name` | *string* | :heavy_check_mark: | N/A | -| `configPath` | *string* | :heavy_minus_sign: | N/A | -| `branch` | *string* | :heavy_minus_sign: | N/A | -| `publishOnMerge` | *boolean* | :heavy_minus_sign: | N/A | -| `publishPreviews` | *boolean* | :heavy_minus_sign: | N/A | -| `prComments` | *boolean* | :heavy_minus_sign: | N/A | -| `expired` | *boolean* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/httpmetadata.md b/docs/models/components/httpmetadata.md deleted file mode 100644 index 9d6e531..0000000 --- a/docs/models/components/httpmetadata.md +++ /dev/null @@ -1,16 +0,0 @@ -# HTTPMetadata - -## Example Usage - -```typescript -import { HTTPMetadata } from "@scalar/sdk/models/components"; - -let value: HTTPMetadata = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `response` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | -| `request` | *Request* | :heavy_check_mark: | Raw HTTP request; suitable for debugging | \ No newline at end of file diff --git a/docs/models/components/loginportal.md b/docs/models/components/loginportal.md deleted file mode 100644 index f05ecba..0000000 --- a/docs/models/components/loginportal.md +++ /dev/null @@ -1,21 +0,0 @@ -# LoginPortal - -## Example Usage - -```typescript -import { LoginPortal } from "@scalar/sdk/models/components"; - -let value: LoginPortal = { - uid: "", - title: "", - slug: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `uid` | *string* | :heavy_check_mark: | N/A | -| `title` | *string* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/loginportalemail.md b/docs/models/components/loginportalemail.md deleted file mode 100644 index 59ca9fe..0000000 --- a/docs/models/components/loginportalemail.md +++ /dev/null @@ -1,25 +0,0 @@ -# LoginPortalEmail - -## Example Usage - -```typescript -import { LoginPortalEmail } from "@scalar/sdk/models/components"; - -let value: LoginPortalEmail = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `logo` | *string* | :heavy_minus_sign: | N/A | -| `logoSize` | *string* | :heavy_minus_sign: | N/A | -| `buttonText` | *string* | :heavy_minus_sign: | N/A | -| `message` | *string* | :heavy_minus_sign: | N/A | -| `title` | *string* | :heavy_minus_sign: | N/A | -| `mainColor` | *string* | :heavy_minus_sign: | N/A | -| `mainBackground` | *string* | :heavy_minus_sign: | N/A | -| `cardColor` | *string* | :heavy_minus_sign: | N/A | -| `cardBackground` | *string* | :heavy_minus_sign: | N/A | -| `buttonColor` | *string* | :heavy_minus_sign: | N/A | -| `buttonBackground` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/loginportalpage.md b/docs/models/components/loginportalpage.md deleted file mode 100644 index d500bd6..0000000 --- a/docs/models/components/loginportalpage.md +++ /dev/null @@ -1,28 +0,0 @@ -# LoginPortalPage - -## Example Usage - -```typescript -import { LoginPortalPage } from "@scalar/sdk/models/components"; - -let value: LoginPortalPage = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `title` | *string* | :heavy_minus_sign: | N/A | -| `description` | *string* | :heavy_minus_sign: | N/A | -| `head` | *string* | :heavy_minus_sign: | N/A | -| `script` | *string* | :heavy_minus_sign: | N/A | -| `theme` | *string* | :heavy_minus_sign: | N/A | -| `companyName` | *string* | :heavy_minus_sign: | N/A | -| `logo` | *string* | :heavy_minus_sign: | N/A | -| `logoURL` | *string* | :heavy_minus_sign: | N/A | -| `favicon` | *string* | :heavy_minus_sign: | N/A | -| `termsLink` | *string* | :heavy_minus_sign: | N/A | -| `privacyLink` | *string* | :heavy_minus_sign: | N/A | -| `formTitle` | *string* | :heavy_minus_sign: | N/A | -| `formDescription` | *string* | :heavy_minus_sign: | N/A | -| `formImage` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/manageddocversion.md b/docs/models/components/manageddocversion.md deleted file mode 100644 index 2c476d2..0000000 --- a/docs/models/components/manageddocversion.md +++ /dev/null @@ -1,30 +0,0 @@ -# ManagedDocVersion - -## Example Usage - -```typescript -import { ManagedDocVersion } from "@scalar/sdk/models/components"; - -let value: ManagedDocVersion = { - uid: "", - createdAt: 2328.34, - version: "", - embedStatus: "complete", - tags: [], -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | -| `uid` | *string* | :heavy_check_mark: | N/A | -| `createdAt` | *number* | :heavy_check_mark: | N/A | -| `version` | *string* | :heavy_check_mark: | N/A | -| `upgraded` | *boolean* | :heavy_minus_sign: | N/A | -| `embedStatus` | [components.EmbedStatus](../../models/components/embedstatus.md) | :heavy_check_mark: | N/A | -| `tags` | *string*[] | :heavy_check_mark: | N/A | -| `tools` | [components.Tools](../../models/components/tools.md)[] | :heavy_minus_sign: | N/A | -| `yamlSha` | *string* | :heavy_minus_sign: | N/A | -| `jsonSha` | *string* | :heavy_minus_sign: | N/A | -| `versionSha` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/managedschemaversion.md b/docs/models/components/managedschemaversion.md deleted file mode 100644 index 7fbe177..0000000 --- a/docs/models/components/managedschemaversion.md +++ /dev/null @@ -1,23 +0,0 @@ -# ManagedSchemaVersion - -## Example Usage - -```typescript -import { ManagedSchemaVersion } from "@scalar/sdk/models/components"; - -let value: ManagedSchemaVersion = { - uid: "", - createdAt: 117467, - updatedAt: 858498, - version: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `uid` | *string* | :heavy_check_mark: | N/A | -| `createdAt` | *number* | :heavy_check_mark: | N/A | -| `updatedAt` | *number* | :heavy_check_mark: | N/A | -| `version` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/method.md b/docs/models/components/method.md deleted file mode 100644 index 3ce5d84..0000000 --- a/docs/models/components/method.md +++ /dev/null @@ -1,15 +0,0 @@ -# Method - -## Example Usage - -```typescript -import { Method } from "@scalar/sdk/models/components"; - -let value: Method = "head"; -``` - -## Values - -```typescript -"delete" | "get" | "head" | "options" | "patch" | "post" | "put" | "trace" -``` \ No newline at end of file diff --git a/docs/models/components/rule.md b/docs/models/components/rule.md deleted file mode 100644 index 228f548..0000000 --- a/docs/models/components/rule.md +++ /dev/null @@ -1,24 +0,0 @@ -# Rule - -## Example Usage - -```typescript -import { Rule } from "@scalar/sdk/models/components"; - -let value: Rule = { - uid: "", - slug: "", - namespace: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `uid` | *string* | :heavy_check_mark: | N/A | -| `title` | *string* | :heavy_minus_sign: | N/A | -| `description` | *string* | :heavy_minus_sign: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `namespace` | *string* | :heavy_check_mark: | N/A | -| `isPrivate` | *boolean* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/schema.md b/docs/models/components/schema.md deleted file mode 100644 index e371889..0000000 --- a/docs/models/components/schema.md +++ /dev/null @@ -1,26 +0,0 @@ -# Schema - -## Example Usage - -```typescript -import { Schema } from "@scalar/sdk/models/components"; - -let value: Schema = { - uid: "", - slug: "", - namespace: "", - versions: [], -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `uid` | *string* | :heavy_check_mark: | N/A | -| `title` | *string* | :heavy_minus_sign: | N/A | -| `description` | *string* | :heavy_minus_sign: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `namespace` | *string* | :heavy_check_mark: | N/A | -| `isPrivate` | *boolean* | :heavy_minus_sign: | N/A | -| `versions` | [components.ManagedSchemaVersion](../../models/components/managedschemaversion.md)[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/security.md b/docs/models/components/security.md deleted file mode 100644 index 5389c89..0000000 --- a/docs/models/components/security.md +++ /dev/null @@ -1,15 +0,0 @@ -# Security - -## Example Usage - -```typescript -import { Security } from "@scalar/sdk/models/components"; - -let value: Security = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `bearerAuth` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/team.md b/docs/models/components/team.md deleted file mode 100644 index 397df09..0000000 --- a/docs/models/components/team.md +++ /dev/null @@ -1,24 +0,0 @@ -# Team - -## Example Usage - -```typescript -import { Team } from "@scalar/sdk/models/components"; - -let value: Team = { - uid: "", - name: "", - slug: "", - theme: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `uid` | *string* | :heavy_check_mark: | N/A | -| `name` | *string* | :heavy_check_mark: | N/A | -| `imageUri` | *string* | :heavy_minus_sign: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `theme` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/teamsummary.md b/docs/models/components/teamsummary.md deleted file mode 100644 index 9d10ff2..0000000 --- a/docs/models/components/teamsummary.md +++ /dev/null @@ -1,20 +0,0 @@ -# TeamSummary - -## Example Usage - -```typescript -import { TeamSummary } from "@scalar/sdk/models/components"; - -let value: TeamSummary = { - uid: "", - name: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `uid` | *string* | :heavy_check_mark: | N/A | -| `name` | *string* | :heavy_check_mark: | N/A | -| `imageUri` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/theme.md b/docs/models/components/theme.md deleted file mode 100644 index f1e0ae5..0000000 --- a/docs/models/components/theme.md +++ /dev/null @@ -1,23 +0,0 @@ -# Theme - -## Example Usage - -```typescript -import { Theme } from "@scalar/sdk/models/components"; - -let value: Theme = { - uid: "", - name: "", - description: "common ugh how busy", - slug: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `uid` | *string* | :heavy_check_mark: | N/A | -| `name` | *string* | :heavy_check_mark: | N/A | -| `description` | *string* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/tools.md b/docs/models/components/tools.md deleted file mode 100644 index 185d975..0000000 --- a/docs/models/components/tools.md +++ /dev/null @@ -1,23 +0,0 @@ -# Tools - -## Example Usage - -```typescript -import { Tools } from "@scalar/sdk/models/components"; - -let value: Tools = { - path: "/usr/local/bin", - method: "put", - enabledTools: [ - "get-mini-openapi-spec", - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -| `path` | *string* | :heavy_check_mark: | N/A | -| `method` | [components.Method](../../models/components/method.md) | :heavy_check_mark: | N/A | -| `enabledTools` | [components.EnabledTools](../../models/components/enabledtools.md)[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/uid.md b/docs/models/components/uid.md deleted file mode 100644 index 92ebe46..0000000 --- a/docs/models/components/uid.md +++ /dev/null @@ -1,17 +0,0 @@ -# Uid - -## Example Usage - -```typescript -import { Uid } from "@scalar/sdk/models/components"; - -let value: Uid = { - uid: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `uid` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/user.md b/docs/models/components/user.md deleted file mode 100644 index 22b3829..0000000 --- a/docs/models/components/user.md +++ /dev/null @@ -1,29 +0,0 @@ -# User - -## Example Usage - -```typescript -import { User } from "@scalar/sdk/models/components"; - -let value: User = { - uid: "", - createdAt: 503572, - updatedAt: 154785, - email: "Justina.Smith@yahoo.com", - activeTeamId: "", - teams: [], -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `uid` | *string* | :heavy_check_mark: | N/A | -| `createdAt` | *number* | :heavy_check_mark: | N/A | -| `updatedAt` | *number* | :heavy_check_mark: | N/A | -| `email` | *string* | :heavy_check_mark: | N/A | -| `theme` | *string* | :heavy_minus_sign: | N/A | -| `activeTeamId` | *string* | :heavy_check_mark: | N/A | -| `hasGithub` | *boolean* | :heavy_minus_sign: | N/A | -| `teams` | [components.TeamSummary](../../models/components/teamsummary.md)[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/errors/fivehundred.md b/docs/models/errors/fivehundred.md deleted file mode 100644 index 7c4d992..0000000 --- a/docs/models/errors/fivehundred.md +++ /dev/null @@ -1,16 +0,0 @@ -# FiveHundred - -## Example Usage - -```typescript -import { FiveHundred } from "@scalar/sdk/models/errors"; - -// No examples available for this model -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `message` | *string* | :heavy_check_mark: | N/A | -| `code` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/errors/fourhundred.md b/docs/models/errors/fourhundred.md deleted file mode 100644 index 7b3fce8..0000000 --- a/docs/models/errors/fourhundred.md +++ /dev/null @@ -1,16 +0,0 @@ -# FourHundred - -## Example Usage - -```typescript -import { FourHundred } from "@scalar/sdk/models/errors"; - -// No examples available for this model -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `message` | *string* | :heavy_check_mark: | N/A | -| `code` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/errors/fourhundredandfour.md b/docs/models/errors/fourhundredandfour.md deleted file mode 100644 index 5825720..0000000 --- a/docs/models/errors/fourhundredandfour.md +++ /dev/null @@ -1,16 +0,0 @@ -# FourHundredAndFour - -## Example Usage - -```typescript -import { FourHundredAndFour } from "@scalar/sdk/models/errors"; - -// No examples available for this model -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `message` | *string* | :heavy_check_mark: | N/A | -| `code` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/errors/fourhundredandone.md b/docs/models/errors/fourhundredandone.md deleted file mode 100644 index bbfb07c..0000000 --- a/docs/models/errors/fourhundredandone.md +++ /dev/null @@ -1,16 +0,0 @@ -# FourHundredAndOne - -## Example Usage - -```typescript -import { FourHundredAndOne } from "@scalar/sdk/models/errors"; - -// No examples available for this model -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `message` | *string* | :heavy_check_mark: | N/A | -| `code` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/errors/fourhundredandthree.md b/docs/models/errors/fourhundredandthree.md deleted file mode 100644 index d3e4117..0000000 --- a/docs/models/errors/fourhundredandthree.md +++ /dev/null @@ -1,16 +0,0 @@ -# FourHundredAndThree - -## Example Usage - -```typescript -import { FourHundredAndThree } from "@scalar/sdk/models/errors"; - -// No examples available for this model -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `message` | *string* | :heavy_check_mark: | N/A | -| `code` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/errors/fourhundredandtwentytwo.md b/docs/models/errors/fourhundredandtwentytwo.md deleted file mode 100644 index eba036b..0000000 --- a/docs/models/errors/fourhundredandtwentytwo.md +++ /dev/null @@ -1,16 +0,0 @@ -# FourHundredAndTwentyTwo - -## Example Usage - -```typescript -import { FourHundredAndTwentyTwo } from "@scalar/sdk/models/errors"; - -// No examples available for this model -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `message` | *string* | :heavy_check_mark: | N/A | -| `code` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/addapidocumentaccessgrouprequest.md b/docs/models/operations/addapidocumentaccessgrouprequest.md deleted file mode 100644 index 1049232..0000000 --- a/docs/models/operations/addapidocumentaccessgrouprequest.md +++ /dev/null @@ -1,20 +0,0 @@ -# AddApiDocumentAccessGroupRequest - -## Example Usage - -```typescript -import { AddApiDocumentAccessGroupRequest } from "@scalar/sdk/models/operations"; - -let value: AddApiDocumentAccessGroupRequest = { - namespace: "", - slug: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | -| `namespace` | *string* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `accessGroup` | [components.AccessGroup](../../models/components/accessgroup.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/addapidocumentaccessgroupresponse.md b/docs/models/operations/addapidocumentaccessgroupresponse.md deleted file mode 100644 index c7045b1..0000000 --- a/docs/models/operations/addapidocumentaccessgroupresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# AddApiDocumentAccessGroupResponse - -## Example Usage - -```typescript -import { AddApiDocumentAccessGroupResponse } from "@scalar/sdk/models/operations"; - -let value: AddApiDocumentAccessGroupResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `any` | *any* | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/addrulesetaccessgrouprequest.md b/docs/models/operations/addrulesetaccessgrouprequest.md deleted file mode 100644 index c085c7c..0000000 --- a/docs/models/operations/addrulesetaccessgrouprequest.md +++ /dev/null @@ -1,20 +0,0 @@ -# AddRulesetAccessGroupRequest - -## Example Usage - -```typescript -import { AddRulesetAccessGroupRequest } from "@scalar/sdk/models/operations"; - -let value: AddRulesetAccessGroupRequest = { - namespace: "", - slug: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | -| `namespace` | *string* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `accessGroup` | [components.AccessGroup](../../models/components/accessgroup.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/addrulesetaccessgroupresponse.md b/docs/models/operations/addrulesetaccessgroupresponse.md deleted file mode 100644 index e05f3db..0000000 --- a/docs/models/operations/addrulesetaccessgroupresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# AddRulesetAccessGroupResponse - -## Example Usage - -```typescript -import { AddRulesetAccessGroupResponse } from "@scalar/sdk/models/operations"; - -let value: AddRulesetAccessGroupResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `any` | *any* | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/addschemaaccessgrouprequest.md b/docs/models/operations/addschemaaccessgrouprequest.md deleted file mode 100644 index 3901709..0000000 --- a/docs/models/operations/addschemaaccessgrouprequest.md +++ /dev/null @@ -1,20 +0,0 @@ -# AddSchemaAccessGroupRequest - -## Example Usage - -```typescript -import { AddSchemaAccessGroupRequest } from "@scalar/sdk/models/operations"; - -let value: AddSchemaAccessGroupRequest = { - namespace: "", - slug: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | -| `namespace` | *string* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `accessGroup` | [components.AccessGroup](../../models/components/accessgroup.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/addschemaaccessgroupresponse.md b/docs/models/operations/addschemaaccessgroupresponse.md deleted file mode 100644 index efb9012..0000000 --- a/docs/models/operations/addschemaaccessgroupresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# AddSchemaAccessGroupResponse - -## Example Usage - -```typescript -import { AddSchemaAccessGroupResponse } from "@scalar/sdk/models/operations"; - -let value: AddSchemaAccessGroupResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `any` | *any* | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/createapidocumentrequest.md b/docs/models/operations/createapidocumentrequest.md deleted file mode 100644 index e6b9037..0000000 --- a/docs/models/operations/createapidocumentrequest.md +++ /dev/null @@ -1,18 +0,0 @@ -# CreateApiDocumentRequest - -## Example Usage - -```typescript -import { CreateApiDocumentRequest } from "@scalar/sdk/models/operations"; - -let value: CreateApiDocumentRequest = { - namespace: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `namespace` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.CreateApiDocumentRequestBody](../../models/operations/createapidocumentrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createapidocumentrequestbody.md b/docs/models/operations/createapidocumentrequestbody.md deleted file mode 100644 index 81f8ff3..0000000 --- a/docs/models/operations/createapidocumentrequestbody.md +++ /dev/null @@ -1,26 +0,0 @@ -# CreateApiDocumentRequestBody - -## Example Usage - -```typescript -import { CreateApiDocumentRequestBody } from "@scalar/sdk/models/operations"; - -let value: CreateApiDocumentRequestBody = { - title: "", - version: "", - slug: "", - document: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `title` | *string* | :heavy_check_mark: | N/A | -| `description` | *string* | :heavy_minus_sign: | N/A | -| `version` | *string* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `ruleset` | *string* | :heavy_minus_sign: | N/A | -| `isPrivate` | *boolean* | :heavy_minus_sign: | N/A | -| `document` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createapidocumentresponse.md b/docs/models/operations/createapidocumentresponse.md deleted file mode 100644 index 6e7f873..0000000 --- a/docs/models/operations/createapidocumentresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# CreateApiDocumentResponse - -## Example Usage - -```typescript -import { CreateApiDocumentResponse } from "@scalar/sdk/models/operations"; - -let value: CreateApiDocumentResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `object` | [operations.CreateApiDocumentResponseBody](../../models/operations/createapidocumentresponsebody.md) | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/createapidocumentresponsebody.md b/docs/models/operations/createapidocumentresponsebody.md deleted file mode 100644 index 773bb44..0000000 --- a/docs/models/operations/createapidocumentresponsebody.md +++ /dev/null @@ -1,29 +0,0 @@ -# CreateApiDocumentResponseBody - -Default Response - -## Example Usage - -```typescript -import { CreateApiDocumentResponseBody } from "@scalar/sdk/models/operations"; - -let value: CreateApiDocumentResponseBody = { - uid: "", - versionUid: "", - title: "", - jsonSha: "", - yamlSha: "", - versionSha: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `uid` | *string* | :heavy_check_mark: | N/A | -| `versionUid` | *string* | :heavy_check_mark: | N/A | -| `title` | *string* | :heavy_check_mark: | N/A | -| `jsonSha` | *string* | :heavy_check_mark: | N/A | -| `yamlSha` | *string* | :heavy_check_mark: | N/A | -| `versionSha` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createapidocumentversionrequest.md b/docs/models/operations/createapidocumentversionrequest.md deleted file mode 100644 index 615c16b..0000000 --- a/docs/models/operations/createapidocumentversionrequest.md +++ /dev/null @@ -1,20 +0,0 @@ -# CreateApiDocumentVersionRequest - -## Example Usage - -```typescript -import { CreateApiDocumentVersionRequest } from "@scalar/sdk/models/operations"; - -let value: CreateApiDocumentVersionRequest = { - namespace: "", - slug: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | -| `namespace` | *string* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.CreateApiDocumentVersionRequestBody](../../models/operations/createapidocumentversionrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createapidocumentversionrequestbody.md b/docs/models/operations/createapidocumentversionrequestbody.md deleted file mode 100644 index 80ad711..0000000 --- a/docs/models/operations/createapidocumentversionrequestbody.md +++ /dev/null @@ -1,21 +0,0 @@ -# CreateApiDocumentVersionRequestBody - -## Example Usage - -```typescript -import { CreateApiDocumentVersionRequestBody } from "@scalar/sdk/models/operations"; - -let value: CreateApiDocumentVersionRequestBody = { - version: "", - document: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------- | --------------------- | --------------------- | --------------------- | -| `version` | *string* | :heavy_check_mark: | N/A | -| `document` | *string* | :heavy_check_mark: | N/A | -| `force` | *boolean* | :heavy_minus_sign: | N/A | -| `lastKnownVersionSha` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createapidocumentversionresponse.md b/docs/models/operations/createapidocumentversionresponse.md deleted file mode 100644 index 60cb393..0000000 --- a/docs/models/operations/createapidocumentversionresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# CreateApiDocumentVersionResponse - -## Example Usage - -```typescript -import { CreateApiDocumentVersionResponse } from "@scalar/sdk/models/operations"; - -let value: CreateApiDocumentVersionResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `managedDocVersion` | [components.ManagedDocVersion](../../models/components/manageddocversion.md) | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/createguiderequestbody.md b/docs/models/operations/createguiderequestbody.md deleted file mode 100644 index b0b40b5..0000000 --- a/docs/models/operations/createguiderequestbody.md +++ /dev/null @@ -1,23 +0,0 @@ -# CreateGuideRequestBody - -## Example Usage - -```typescript -import { CreateGuideRequestBody } from "@scalar/sdk/models/operations"; - -let value: CreateGuideRequestBody = { - name: "", - allowedUsers: [], - allowedDomains: [], -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `name` | *string* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_minus_sign: | N/A | -| `isPrivate` | *boolean* | :heavy_minus_sign: | N/A | -| `allowedUsers` | *string*[] | :heavy_check_mark: | N/A | -| `allowedDomains` | *string*[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createguideresponse.md b/docs/models/operations/createguideresponse.md deleted file mode 100644 index 11995ad..0000000 --- a/docs/models/operations/createguideresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# CreateGuideResponse - -## Example Usage - -```typescript -import { CreateGuideResponse } from "@scalar/sdk/models/operations"; - -let value: CreateGuideResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `object` | [operations.CreateGuideResponseBody](../../models/operations/createguideresponsebody.md) | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/createguideresponsebody.md b/docs/models/operations/createguideresponsebody.md deleted file mode 100644 index 58738c4..0000000 --- a/docs/models/operations/createguideresponsebody.md +++ /dev/null @@ -1,21 +0,0 @@ -# CreateGuideResponseBody - -Default Response - -## Example Usage - -```typescript -import { CreateGuideResponseBody } from "@scalar/sdk/models/operations"; - -let value: CreateGuideResponseBody = { - uid: "", - slug: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `uid` | *string* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createloginportalrequestbody.md b/docs/models/operations/createloginportalrequestbody.md deleted file mode 100644 index cb7ddbc..0000000 --- a/docs/models/operations/createloginportalrequestbody.md +++ /dev/null @@ -1,23 +0,0 @@ -# CreateLoginPortalRequestBody - -## Example Usage - -```typescript -import { CreateLoginPortalRequestBody } from "@scalar/sdk/models/operations"; - -let value: CreateLoginPortalRequestBody = { - title: "", - slug: "", - email: {}, - page: {}, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -| `title` | *string* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `email` | [components.LoginPortalEmail](../../models/components/loginportalemail.md) | :heavy_check_mark: | N/A | -| `page` | [components.LoginPortalPage](../../models/components/loginportalpage.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createloginportalresponse.md b/docs/models/operations/createloginportalresponse.md deleted file mode 100644 index e32e259..0000000 --- a/docs/models/operations/createloginportalresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# CreateLoginPortalResponse - -## Example Usage - -```typescript -import { CreateLoginPortalResponse } from "@scalar/sdk/models/operations"; - -let value: CreateLoginPortalResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `uid` | [components.Uid](../../models/components/uid.md) | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/createrulesetrequest.md b/docs/models/operations/createrulesetrequest.md deleted file mode 100644 index 050039a..0000000 --- a/docs/models/operations/createrulesetrequest.md +++ /dev/null @@ -1,18 +0,0 @@ -# CreateRulesetRequest - -## Example Usage - -```typescript -import { CreateRulesetRequest } from "@scalar/sdk/models/operations"; - -let value: CreateRulesetRequest = { - namespace: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `namespace` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.CreateRulesetRequestBody](../../models/operations/createrulesetrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createrulesetrequestbody.md b/docs/models/operations/createrulesetrequestbody.md deleted file mode 100644 index b52b152..0000000 --- a/docs/models/operations/createrulesetrequestbody.md +++ /dev/null @@ -1,23 +0,0 @@ -# CreateRulesetRequestBody - -## Example Usage - -```typescript -import { CreateRulesetRequestBody } from "@scalar/sdk/models/operations"; - -let value: CreateRulesetRequestBody = { - title: "", - slug: "", - document: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `title` | *string* | :heavy_check_mark: | N/A | -| `description` | *string* | :heavy_minus_sign: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `isPrivate` | *boolean* | :heavy_minus_sign: | N/A | -| `document` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createrulesetresponse.md b/docs/models/operations/createrulesetresponse.md deleted file mode 100644 index 80d9b64..0000000 --- a/docs/models/operations/createrulesetresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# CreateRulesetResponse - -## Example Usage - -```typescript -import { CreateRulesetResponse } from "@scalar/sdk/models/operations"; - -let value: CreateRulesetResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `uid` | [components.Uid](../../models/components/uid.md) | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/createschemarequest.md b/docs/models/operations/createschemarequest.md deleted file mode 100644 index dde8a6e..0000000 --- a/docs/models/operations/createschemarequest.md +++ /dev/null @@ -1,18 +0,0 @@ -# CreateSchemaRequest - -## Example Usage - -```typescript -import { CreateSchemaRequest } from "@scalar/sdk/models/operations"; - -let value: CreateSchemaRequest = { - namespace: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `namespace` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.CreateSchemaRequestBody](../../models/operations/createschemarequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createschemarequestbody.md b/docs/models/operations/createschemarequestbody.md deleted file mode 100644 index fbc59d1..0000000 --- a/docs/models/operations/createschemarequestbody.md +++ /dev/null @@ -1,25 +0,0 @@ -# CreateSchemaRequestBody - -## Example Usage - -```typescript -import { CreateSchemaRequestBody } from "@scalar/sdk/models/operations"; - -let value: CreateSchemaRequestBody = { - title: "", - version: "", - slug: "", - document: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `title` | *string* | :heavy_check_mark: | N/A | -| `description` | *string* | :heavy_minus_sign: | N/A | -| `version` | *string* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `isPrivate` | *boolean* | :heavy_minus_sign: | N/A | -| `document` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createschemaresponse.md b/docs/models/operations/createschemaresponse.md deleted file mode 100644 index 1f3dce6..0000000 --- a/docs/models/operations/createschemaresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# CreateSchemaResponse - -## Example Usage - -```typescript -import { CreateSchemaResponse } from "@scalar/sdk/models/operations"; - -let value: CreateSchemaResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `uid` | [components.Uid](../../models/components/uid.md) | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/createschemaversionrequest.md b/docs/models/operations/createschemaversionrequest.md deleted file mode 100644 index 678602b..0000000 --- a/docs/models/operations/createschemaversionrequest.md +++ /dev/null @@ -1,20 +0,0 @@ -# CreateSchemaVersionRequest - -## Example Usage - -```typescript -import { CreateSchemaVersionRequest } from "@scalar/sdk/models/operations"; - -let value: CreateSchemaVersionRequest = { - namespace: "", - slug: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | -| `namespace` | *string* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.CreateSchemaVersionRequestBody](../../models/operations/createschemaversionrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createschemaversionrequestbody.md b/docs/models/operations/createschemaversionrequestbody.md deleted file mode 100644 index 0ab194f..0000000 --- a/docs/models/operations/createschemaversionrequestbody.md +++ /dev/null @@ -1,19 +0,0 @@ -# CreateSchemaVersionRequestBody - -## Example Usage - -```typescript -import { CreateSchemaVersionRequestBody } from "@scalar/sdk/models/operations"; - -let value: CreateSchemaVersionRequestBody = { - version: "", - document: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `version` | *string* | :heavy_check_mark: | N/A | -| `document` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createschemaversionresponse.md b/docs/models/operations/createschemaversionresponse.md deleted file mode 100644 index 2025bfd..0000000 --- a/docs/models/operations/createschemaversionresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# CreateSchemaVersionResponse - -## Example Usage - -```typescript -import { CreateSchemaVersionResponse } from "@scalar/sdk/models/operations"; - -let value: CreateSchemaVersionResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `uid` | [components.Uid](../../models/components/uid.md) | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/createthemerequestbody.md b/docs/models/operations/createthemerequestbody.md deleted file mode 100644 index 8291bb7..0000000 --- a/docs/models/operations/createthemerequestbody.md +++ /dev/null @@ -1,22 +0,0 @@ -# CreateThemeRequestBody - -## Example Usage - -```typescript -import { CreateThemeRequestBody } from "@scalar/sdk/models/operations"; - -let value: CreateThemeRequestBody = { - name: "", - slug: "", - document: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `name` | *string* | :heavy_check_mark: | N/A | -| `description` | *string* | :heavy_minus_sign: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `document` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/createthemeresponse.md b/docs/models/operations/createthemeresponse.md deleted file mode 100644 index a0d18d0..0000000 --- a/docs/models/operations/createthemeresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# CreateThemeResponse - -## Example Usage - -```typescript -import { CreateThemeResponse } from "@scalar/sdk/models/operations"; - -let value: CreateThemeResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `uid` | [components.Uid](../../models/components/uid.md) | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/deleteapidocumentrequest.md b/docs/models/operations/deleteapidocumentrequest.md deleted file mode 100644 index 07b64fd..0000000 --- a/docs/models/operations/deleteapidocumentrequest.md +++ /dev/null @@ -1,19 +0,0 @@ -# DeleteApiDocumentRequest - -## Example Usage - -```typescript -import { DeleteApiDocumentRequest } from "@scalar/sdk/models/operations"; - -let value: DeleteApiDocumentRequest = { - namespace: "", - slug: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `namespace` | *string* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/deleteapidocumentresponse.md b/docs/models/operations/deleteapidocumentresponse.md deleted file mode 100644 index 0fa00c1..0000000 --- a/docs/models/operations/deleteapidocumentresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# DeleteApiDocumentResponse - -## Example Usage - -```typescript -import { DeleteApiDocumentResponse } from "@scalar/sdk/models/operations"; - -let value: DeleteApiDocumentResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `any` | *any* | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/deleteapidocumentversionrequest.md b/docs/models/operations/deleteapidocumentversionrequest.md deleted file mode 100644 index 41fb517..0000000 --- a/docs/models/operations/deleteapidocumentversionrequest.md +++ /dev/null @@ -1,21 +0,0 @@ -# DeleteApiDocumentVersionRequest - -## Example Usage - -```typescript -import { DeleteApiDocumentVersionRequest } from "@scalar/sdk/models/operations"; - -let value: DeleteApiDocumentVersionRequest = { - namespace: "", - slug: "", - semver: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `namespace` | *string* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `semver` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/deleteapidocumentversionresponse.md b/docs/models/operations/deleteapidocumentversionresponse.md deleted file mode 100644 index 7686bd6..0000000 --- a/docs/models/operations/deleteapidocumentversionresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# DeleteApiDocumentVersionResponse - -## Example Usage - -```typescript -import { DeleteApiDocumentVersionResponse } from "@scalar/sdk/models/operations"; - -let value: DeleteApiDocumentVersionResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `any` | *any* | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/deleteloginportalrequest.md b/docs/models/operations/deleteloginportalrequest.md deleted file mode 100644 index ad0f9f5..0000000 --- a/docs/models/operations/deleteloginportalrequest.md +++ /dev/null @@ -1,17 +0,0 @@ -# DeleteLoginPortalRequest - -## Example Usage - -```typescript -import { DeleteLoginPortalRequest } from "@scalar/sdk/models/operations"; - -let value: DeleteLoginPortalRequest = { - slug: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `slug` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/deleteloginportalresponse.md b/docs/models/operations/deleteloginportalresponse.md deleted file mode 100644 index 24db50c..0000000 --- a/docs/models/operations/deleteloginportalresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# DeleteLoginPortalResponse - -## Example Usage - -```typescript -import { DeleteLoginPortalResponse } from "@scalar/sdk/models/operations"; - -let value: DeleteLoginPortalResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `any` | *any* | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/deleterulesetrequest.md b/docs/models/operations/deleterulesetrequest.md deleted file mode 100644 index a32ca48..0000000 --- a/docs/models/operations/deleterulesetrequest.md +++ /dev/null @@ -1,19 +0,0 @@ -# DeleteRulesetRequest - -## Example Usage - -```typescript -import { DeleteRulesetRequest } from "@scalar/sdk/models/operations"; - -let value: DeleteRulesetRequest = { - namespace: "", - slug: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `namespace` | *string* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/deleterulesetresponse.md b/docs/models/operations/deleterulesetresponse.md deleted file mode 100644 index 939d2f5..0000000 --- a/docs/models/operations/deleterulesetresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# DeleteRulesetResponse - -## Example Usage - -```typescript -import { DeleteRulesetResponse } from "@scalar/sdk/models/operations"; - -let value: DeleteRulesetResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `any` | *any* | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/deleteschemarequest.md b/docs/models/operations/deleteschemarequest.md deleted file mode 100644 index 4bfa701..0000000 --- a/docs/models/operations/deleteschemarequest.md +++ /dev/null @@ -1,19 +0,0 @@ -# DeleteSchemaRequest - -## Example Usage - -```typescript -import { DeleteSchemaRequest } from "@scalar/sdk/models/operations"; - -let value: DeleteSchemaRequest = { - namespace: "", - slug: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `namespace` | *string* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/deleteschemaresponse.md b/docs/models/operations/deleteschemaresponse.md deleted file mode 100644 index 0e2cd27..0000000 --- a/docs/models/operations/deleteschemaresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# DeleteSchemaResponse - -## Example Usage - -```typescript -import { DeleteSchemaResponse } from "@scalar/sdk/models/operations"; - -let value: DeleteSchemaResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `any` | *any* | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/deleteschemaversionrequest.md b/docs/models/operations/deleteschemaversionrequest.md deleted file mode 100644 index 0ff94ee..0000000 --- a/docs/models/operations/deleteschemaversionrequest.md +++ /dev/null @@ -1,21 +0,0 @@ -# DeleteSchemaVersionRequest - -## Example Usage - -```typescript -import { DeleteSchemaVersionRequest } from "@scalar/sdk/models/operations"; - -let value: DeleteSchemaVersionRequest = { - namespace: "", - slug: "", - semver: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `namespace` | *string* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `semver` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/deleteschemaversionresponse.md b/docs/models/operations/deleteschemaversionresponse.md deleted file mode 100644 index a52003d..0000000 --- a/docs/models/operations/deleteschemaversionresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# DeleteSchemaVersionResponse - -## Example Usage - -```typescript -import { DeleteSchemaVersionResponse } from "@scalar/sdk/models/operations"; - -let value: DeleteSchemaVersionResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `any` | *any* | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/deletethemerequest.md b/docs/models/operations/deletethemerequest.md deleted file mode 100644 index 3445854..0000000 --- a/docs/models/operations/deletethemerequest.md +++ /dev/null @@ -1,17 +0,0 @@ -# DeleteThemeRequest - -## Example Usage - -```typescript -import { DeleteThemeRequest } from "@scalar/sdk/models/operations"; - -let value: DeleteThemeRequest = { - slug: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `slug` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/deletethemeresponse.md b/docs/models/operations/deletethemeresponse.md deleted file mode 100644 index 09d3329..0000000 --- a/docs/models/operations/deletethemeresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# DeleteThemeResponse - -## Example Usage - -```typescript -import { DeleteThemeResponse } from "@scalar/sdk/models/operations"; - -let value: DeleteThemeResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `any` | *any* | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/exchangepersonaltokenrequestbody.md b/docs/models/operations/exchangepersonaltokenrequestbody.md deleted file mode 100644 index a5699d8..0000000 --- a/docs/models/operations/exchangepersonaltokenrequestbody.md +++ /dev/null @@ -1,17 +0,0 @@ -# ExchangePersonalTokenRequestBody - -## Example Usage - -```typescript -import { ExchangePersonalTokenRequestBody } from "@scalar/sdk/models/operations"; - -let value: ExchangePersonalTokenRequestBody = { - personalToken: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `personalToken` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/exchangepersonaltokenresponse.md b/docs/models/operations/exchangepersonaltokenresponse.md deleted file mode 100644 index 136f59e..0000000 --- a/docs/models/operations/exchangepersonaltokenresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# ExchangePersonalTokenResponse - -## Example Usage - -```typescript -import { ExchangePersonalTokenResponse } from "@scalar/sdk/models/operations"; - -let value: ExchangePersonalTokenResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `object` | [operations.ExchangePersonalTokenResponseBody](../../models/operations/exchangepersonaltokenresponsebody.md) | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/exchangepersonaltokenresponsebody.md b/docs/models/operations/exchangepersonaltokenresponsebody.md deleted file mode 100644 index 7b87784..0000000 --- a/docs/models/operations/exchangepersonaltokenresponsebody.md +++ /dev/null @@ -1,19 +0,0 @@ -# ExchangePersonalTokenResponseBody - -Default Response - -## Example Usage - -```typescript -import { ExchangePersonalTokenResponseBody } from "@scalar/sdk/models/operations"; - -let value: ExchangePersonalTokenResponseBody = { - accessToken: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `accessToken` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getapidocumentversionmetadatarequest.md b/docs/models/operations/getapidocumentversionmetadatarequest.md deleted file mode 100644 index 44cb917..0000000 --- a/docs/models/operations/getapidocumentversionmetadatarequest.md +++ /dev/null @@ -1,21 +0,0 @@ -# GetApiDocumentVersionMetadataRequest - -## Example Usage - -```typescript -import { GetApiDocumentVersionMetadataRequest } from "@scalar/sdk/models/operations"; - -let value: GetApiDocumentVersionMetadataRequest = { - namespace: "", - slug: "", - semver: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `namespace` | *string* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `semver` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getapidocumentversionmetadataresponse.md b/docs/models/operations/getapidocumentversionmetadataresponse.md deleted file mode 100644 index 2ef884e..0000000 --- a/docs/models/operations/getapidocumentversionmetadataresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# GetApiDocumentVersionMetadataResponse - -## Example Usage - -```typescript -import { GetApiDocumentVersionMetadataResponse } from "@scalar/sdk/models/operations"; - -let value: GetApiDocumentVersionMetadataResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `managedDocVersion` | [components.ManagedDocVersion](../../models/components/manageddocversion.md) | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/getapidocumentversionrequest.md b/docs/models/operations/getapidocumentversionrequest.md deleted file mode 100644 index f101233..0000000 --- a/docs/models/operations/getapidocumentversionrequest.md +++ /dev/null @@ -1,21 +0,0 @@ -# GetApiDocumentVersionRequest - -## Example Usage - -```typescript -import { GetApiDocumentVersionRequest } from "@scalar/sdk/models/operations"; - -let value: GetApiDocumentVersionRequest = { - namespace: "", - slug: "", - semver: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `namespace` | *string* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `semver` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getapidocumentversionresponse.md b/docs/models/operations/getapidocumentversionresponse.md deleted file mode 100644 index 6c8cf8b..0000000 --- a/docs/models/operations/getapidocumentversionresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# GetApiDocumentVersionResponse - -## Example Usage - -```typescript -import { GetApiDocumentVersionResponse } from "@scalar/sdk/models/operations"; - -let value: GetApiDocumentVersionResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `res` | *string* | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/getcurrentuserresponse.md b/docs/models/operations/getcurrentuserresponse.md deleted file mode 100644 index 8de000c..0000000 --- a/docs/models/operations/getcurrentuserresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# GetCurrentUserResponse - -## Example Usage - -```typescript -import { GetCurrentUserResponse } from "@scalar/sdk/models/operations"; - -let value: GetCurrentUserResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `user` | [components.User](../../models/components/user.md) | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/getloginportalrequest.md b/docs/models/operations/getloginportalrequest.md deleted file mode 100644 index 6addc7f..0000000 --- a/docs/models/operations/getloginportalrequest.md +++ /dev/null @@ -1,17 +0,0 @@ -# GetLoginPortalRequest - -## Example Usage - -```typescript -import { GetLoginPortalRequest } from "@scalar/sdk/models/operations"; - -let value: GetLoginPortalRequest = { - slug: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `slug` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getloginportalresponse.md b/docs/models/operations/getloginportalresponse.md deleted file mode 100644 index a5701fb..0000000 --- a/docs/models/operations/getloginportalresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# GetLoginPortalResponse - -## Example Usage - -```typescript -import { GetLoginPortalResponse } from "@scalar/sdk/models/operations"; - -let value: GetLoginPortalResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `object` | [operations.GetLoginPortalResponseBody](../../models/operations/getloginportalresponsebody.md) | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/getloginportalresponsebody.md b/docs/models/operations/getloginportalresponsebody.md deleted file mode 100644 index 6d2c72c..0000000 --- a/docs/models/operations/getloginportalresponsebody.md +++ /dev/null @@ -1,27 +0,0 @@ -# GetLoginPortalResponseBody - -Default Response - -## Example Usage - -```typescript -import { GetLoginPortalResponseBody } from "@scalar/sdk/models/operations"; - -let value: GetLoginPortalResponseBody = { - uid: "", - title: "", - slug: "", - email: {}, - page: {}, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -| `uid` | *string* | :heavy_check_mark: | N/A | -| `title` | *string* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `email` | [components.LoginPortalEmail](../../models/components/loginportalemail.md) | :heavy_check_mark: | N/A | -| `page` | [components.LoginPortalPage](../../models/components/loginportalpage.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getrulesetdocumentrequest.md b/docs/models/operations/getrulesetdocumentrequest.md deleted file mode 100644 index b45e33e..0000000 --- a/docs/models/operations/getrulesetdocumentrequest.md +++ /dev/null @@ -1,19 +0,0 @@ -# GetRulesetDocumentRequest - -## Example Usage - -```typescript -import { GetRulesetDocumentRequest } from "@scalar/sdk/models/operations"; - -let value: GetRulesetDocumentRequest = { - namespace: "", - slug: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `namespace` | *string* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getrulesetdocumentresponse.md b/docs/models/operations/getrulesetdocumentresponse.md deleted file mode 100644 index d0e0359..0000000 --- a/docs/models/operations/getrulesetdocumentresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# GetRulesetDocumentResponse - -## Example Usage - -```typescript -import { GetRulesetDocumentResponse } from "@scalar/sdk/models/operations"; - -let value: GetRulesetDocumentResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `res` | *string* | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/getschemaversionrequest.md b/docs/models/operations/getschemaversionrequest.md deleted file mode 100644 index f08d4fa..0000000 --- a/docs/models/operations/getschemaversionrequest.md +++ /dev/null @@ -1,21 +0,0 @@ -# GetSchemaVersionRequest - -## Example Usage - -```typescript -import { GetSchemaVersionRequest } from "@scalar/sdk/models/operations"; - -let value: GetSchemaVersionRequest = { - namespace: "", - slug: "", - semver: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `namespace` | *string* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `semver` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getschemaversionresponse.md b/docs/models/operations/getschemaversionresponse.md deleted file mode 100644 index 188ab22..0000000 --- a/docs/models/operations/getschemaversionresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# GetSchemaVersionResponse - -## Example Usage - -```typescript -import { GetSchemaVersionResponse } from "@scalar/sdk/models/operations"; - -let value: GetSchemaVersionResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `res` | *string* | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/getthemerequest.md b/docs/models/operations/getthemerequest.md deleted file mode 100644 index d2d4435..0000000 --- a/docs/models/operations/getthemerequest.md +++ /dev/null @@ -1,17 +0,0 @@ -# GetThemeRequest - -## Example Usage - -```typescript -import { GetThemeRequest } from "@scalar/sdk/models/operations"; - -let value: GetThemeRequest = { - slug: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `slug` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getthemeresponse.md b/docs/models/operations/getthemeresponse.md deleted file mode 100644 index b7d965b..0000000 --- a/docs/models/operations/getthemeresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# GetThemeResponse - -## Example Usage - -```typescript -import { GetThemeResponse } from "@scalar/sdk/models/operations"; - -let value: GetThemeResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `res` | *string* | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/listallapidocumentsresponse.md b/docs/models/operations/listallapidocumentsresponse.md deleted file mode 100644 index 4483da9..0000000 --- a/docs/models/operations/listallapidocumentsresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# ListAllApiDocumentsResponse - -## Example Usage - -```typescript -import { ListAllApiDocumentsResponse } from "@scalar/sdk/models/operations"; - -let value: ListAllApiDocumentsResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `apiDocuments` | [components.ApiDocument](../../models/components/apidocument.md)[] | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/listapidocumentsrequest.md b/docs/models/operations/listapidocumentsrequest.md deleted file mode 100644 index 8922a92..0000000 --- a/docs/models/operations/listapidocumentsrequest.md +++ /dev/null @@ -1,17 +0,0 @@ -# ListApiDocumentsRequest - -## Example Usage - -```typescript -import { ListApiDocumentsRequest } from "@scalar/sdk/models/operations"; - -let value: ListApiDocumentsRequest = { - namespace: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `namespace` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listapidocumentsresponse.md b/docs/models/operations/listapidocumentsresponse.md deleted file mode 100644 index 429a6c6..0000000 --- a/docs/models/operations/listapidocumentsresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# ListApiDocumentsResponse - -## Example Usage - -```typescript -import { ListApiDocumentsResponse } from "@scalar/sdk/models/operations"; - -let value: ListApiDocumentsResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `apiDocuments` | [components.ApiDocument](../../models/components/apidocument.md)[] | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/listguidesresponse.md b/docs/models/operations/listguidesresponse.md deleted file mode 100644 index d37eeab..0000000 --- a/docs/models/operations/listguidesresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# ListGuidesResponse - -## Example Usage - -```typescript -import { ListGuidesResponse } from "@scalar/sdk/models/operations"; - -let value: ListGuidesResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `githubProjects` | [components.GithubProject](../../models/components/githubproject.md)[] | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/listloginportalsresponse.md b/docs/models/operations/listloginportalsresponse.md deleted file mode 100644 index 27b1f19..0000000 --- a/docs/models/operations/listloginportalsresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# ListLoginPortalsResponse - -## Example Usage - -```typescript -import { ListLoginPortalsResponse } from "@scalar/sdk/models/operations"; - -let value: ListLoginPortalsResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `loginPortals` | [components.LoginPortal](../../models/components/loginportal.md)[] | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/listnamespacesresponse.md b/docs/models/operations/listnamespacesresponse.md deleted file mode 100644 index 0ef9e8f..0000000 --- a/docs/models/operations/listnamespacesresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# ListNamespacesResponse - -## Example Usage - -```typescript -import { ListNamespacesResponse } from "@scalar/sdk/models/operations"; - -let value: ListNamespacesResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `strings` | *string*[] | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/listrulesetsrequest.md b/docs/models/operations/listrulesetsrequest.md deleted file mode 100644 index 53309d4..0000000 --- a/docs/models/operations/listrulesetsrequest.md +++ /dev/null @@ -1,17 +0,0 @@ -# ListRulesetsRequest - -## Example Usage - -```typescript -import { ListRulesetsRequest } from "@scalar/sdk/models/operations"; - -let value: ListRulesetsRequest = { - namespace: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `namespace` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listrulesetsresponse.md b/docs/models/operations/listrulesetsresponse.md deleted file mode 100644 index 2b9b655..0000000 --- a/docs/models/operations/listrulesetsresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# ListRulesetsResponse - -## Example Usage - -```typescript -import { ListRulesetsResponse } from "@scalar/sdk/models/operations"; - -let value: ListRulesetsResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `rules` | [components.Rule](../../models/components/rule.md)[] | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/listschemasrequest.md b/docs/models/operations/listschemasrequest.md deleted file mode 100644 index ea08428..0000000 --- a/docs/models/operations/listschemasrequest.md +++ /dev/null @@ -1,17 +0,0 @@ -# ListSchemasRequest - -## Example Usage - -```typescript -import { ListSchemasRequest } from "@scalar/sdk/models/operations"; - -let value: ListSchemasRequest = { - namespace: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `namespace` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listschemasresponse.md b/docs/models/operations/listschemasresponse.md deleted file mode 100644 index afda15a..0000000 --- a/docs/models/operations/listschemasresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# ListSchemasResponse - -## Example Usage - -```typescript -import { ListSchemasResponse } from "@scalar/sdk/models/operations"; - -let value: ListSchemasResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `schemata` | [components.Schema](../../models/components/schema.md)[] | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/listteamsresponse.md b/docs/models/operations/listteamsresponse.md deleted file mode 100644 index c587bab..0000000 --- a/docs/models/operations/listteamsresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# ListTeamsResponse - -## Example Usage - -```typescript -import { ListTeamsResponse } from "@scalar/sdk/models/operations"; - -let value: ListTeamsResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `teams` | [components.Team](../../models/components/team.md)[] | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/listthemesresponse.md b/docs/models/operations/listthemesresponse.md deleted file mode 100644 index b4fa340..0000000 --- a/docs/models/operations/listthemesresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# ListThemesResponse - -## Example Usage - -```typescript -import { ListThemesResponse } from "@scalar/sdk/models/operations"; - -let value: ListThemesResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `themes` | [components.Theme](../../models/components/theme.md)[] | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/publishguiderequest.md b/docs/models/operations/publishguiderequest.md deleted file mode 100644 index e5b095f..0000000 --- a/docs/models/operations/publishguiderequest.md +++ /dev/null @@ -1,17 +0,0 @@ -# PublishGuideRequest - -## Example Usage - -```typescript -import { PublishGuideRequest } from "@scalar/sdk/models/operations"; - -let value: PublishGuideRequest = { - slug: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `slug` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/publishguideresponse.md b/docs/models/operations/publishguideresponse.md deleted file mode 100644 index 15741ed..0000000 --- a/docs/models/operations/publishguideresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# PublishGuideResponse - -## Example Usage - -```typescript -import { PublishGuideResponse } from "@scalar/sdk/models/operations"; - -let value: PublishGuideResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `object` | [operations.PublishGuideResponseBody](../../models/operations/publishguideresponsebody.md) | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/publishguideresponsebody.md b/docs/models/operations/publishguideresponsebody.md deleted file mode 100644 index 564c765..0000000 --- a/docs/models/operations/publishguideresponsebody.md +++ /dev/null @@ -1,19 +0,0 @@ -# PublishGuideResponseBody - -Default Response - -## Example Usage - -```typescript -import { PublishGuideResponseBody } from "@scalar/sdk/models/operations"; - -let value: PublishGuideResponseBody = { - publishUid: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `publishUid` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/removeapidocumentaccessgrouprequest.md b/docs/models/operations/removeapidocumentaccessgrouprequest.md deleted file mode 100644 index bc0bc39..0000000 --- a/docs/models/operations/removeapidocumentaccessgrouprequest.md +++ /dev/null @@ -1,20 +0,0 @@ -# RemoveApiDocumentAccessGroupRequest - -## Example Usage - -```typescript -import { RemoveApiDocumentAccessGroupRequest } from "@scalar/sdk/models/operations"; - -let value: RemoveApiDocumentAccessGroupRequest = { - namespace: "", - slug: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | -| `namespace` | *string* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `accessGroup` | [components.AccessGroup](../../models/components/accessgroup.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/removeapidocumentaccessgroupresponse.md b/docs/models/operations/removeapidocumentaccessgroupresponse.md deleted file mode 100644 index 32cc836..0000000 --- a/docs/models/operations/removeapidocumentaccessgroupresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# RemoveApiDocumentAccessGroupResponse - -## Example Usage - -```typescript -import { RemoveApiDocumentAccessGroupResponse } from "@scalar/sdk/models/operations"; - -let value: RemoveApiDocumentAccessGroupResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `any` | *any* | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/removerulesetaccessgrouprequest.md b/docs/models/operations/removerulesetaccessgrouprequest.md deleted file mode 100644 index 5d0f5e8..0000000 --- a/docs/models/operations/removerulesetaccessgrouprequest.md +++ /dev/null @@ -1,20 +0,0 @@ -# RemoveRulesetAccessGroupRequest - -## Example Usage - -```typescript -import { RemoveRulesetAccessGroupRequest } from "@scalar/sdk/models/operations"; - -let value: RemoveRulesetAccessGroupRequest = { - namespace: "", - slug: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | -| `namespace` | *string* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `accessGroup` | [components.AccessGroup](../../models/components/accessgroup.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/removerulesetaccessgroupresponse.md b/docs/models/operations/removerulesetaccessgroupresponse.md deleted file mode 100644 index 70c13b4..0000000 --- a/docs/models/operations/removerulesetaccessgroupresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# RemoveRulesetAccessGroupResponse - -## Example Usage - -```typescript -import { RemoveRulesetAccessGroupResponse } from "@scalar/sdk/models/operations"; - -let value: RemoveRulesetAccessGroupResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `any` | *any* | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/removeschemaaccessgrouprequest.md b/docs/models/operations/removeschemaaccessgrouprequest.md deleted file mode 100644 index 37220c2..0000000 --- a/docs/models/operations/removeschemaaccessgrouprequest.md +++ /dev/null @@ -1,20 +0,0 @@ -# RemoveSchemaAccessGroupRequest - -## Example Usage - -```typescript -import { RemoveSchemaAccessGroupRequest } from "@scalar/sdk/models/operations"; - -let value: RemoveSchemaAccessGroupRequest = { - namespace: "", - slug: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | -| `namespace` | *string* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `accessGroup` | [components.AccessGroup](../../models/components/accessgroup.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/removeschemaaccessgroupresponse.md b/docs/models/operations/removeschemaaccessgroupresponse.md deleted file mode 100644 index b8b89b3..0000000 --- a/docs/models/operations/removeschemaaccessgroupresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# RemoveSchemaAccessGroupResponse - -## Example Usage - -```typescript -import { RemoveSchemaAccessGroupResponse } from "@scalar/sdk/models/operations"; - -let value: RemoveSchemaAccessGroupResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `any` | *any* | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/replacethemedocumentrequest.md b/docs/models/operations/replacethemedocumentrequest.md deleted file mode 100644 index 4a0f3e3..0000000 --- a/docs/models/operations/replacethemedocumentrequest.md +++ /dev/null @@ -1,18 +0,0 @@ -# ReplaceThemeDocumentRequest - -## Example Usage - -```typescript -import { ReplaceThemeDocumentRequest } from "@scalar/sdk/models/operations"; - -let value: ReplaceThemeDocumentRequest = { - slug: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.ReplaceThemeDocumentRequestBody](../../models/operations/replacethemedocumentrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/replacethemedocumentrequestbody.md b/docs/models/operations/replacethemedocumentrequestbody.md deleted file mode 100644 index 3291415..0000000 --- a/docs/models/operations/replacethemedocumentrequestbody.md +++ /dev/null @@ -1,17 +0,0 @@ -# ReplaceThemeDocumentRequestBody - -## Example Usage - -```typescript -import { ReplaceThemeDocumentRequestBody } from "@scalar/sdk/models/operations"; - -let value: ReplaceThemeDocumentRequestBody = { - document: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `document` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/replacethemedocumentresponse.md b/docs/models/operations/replacethemedocumentresponse.md deleted file mode 100644 index 34b9c0b..0000000 --- a/docs/models/operations/replacethemedocumentresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# ReplaceThemeDocumentResponse - -## Example Usage - -```typescript -import { ReplaceThemeDocumentResponse } from "@scalar/sdk/models/operations"; - -let value: ReplaceThemeDocumentResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `any` | *any* | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/updateapidocumentrequest.md b/docs/models/operations/updateapidocumentrequest.md deleted file mode 100644 index a0bc2a1..0000000 --- a/docs/models/operations/updateapidocumentrequest.md +++ /dev/null @@ -1,20 +0,0 @@ -# UpdateApiDocumentRequest - -## Example Usage - -```typescript -import { UpdateApiDocumentRequest } from "@scalar/sdk/models/operations"; - -let value: UpdateApiDocumentRequest = { - namespace: "", - slug: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `namespace` | *string* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.UpdateApiDocumentRequestBody](../../models/operations/updateapidocumentrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/updateapidocumentrequestbody.md b/docs/models/operations/updateapidocumentrequestbody.md deleted file mode 100644 index 5a4e0ae..0000000 --- a/docs/models/operations/updateapidocumentrequestbody.md +++ /dev/null @@ -1,18 +0,0 @@ -# UpdateApiDocumentRequestBody - -## Example Usage - -```typescript -import { UpdateApiDocumentRequestBody } from "@scalar/sdk/models/operations"; - -let value: UpdateApiDocumentRequestBody = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `title` | *string* | :heavy_minus_sign: | N/A | -| `description` | *string* | :heavy_minus_sign: | N/A | -| `isPrivate` | *boolean* | :heavy_minus_sign: | N/A | -| `ruleset` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/updateapidocumentresponse.md b/docs/models/operations/updateapidocumentresponse.md deleted file mode 100644 index ad9eae3..0000000 --- a/docs/models/operations/updateapidocumentresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# UpdateApiDocumentResponse - -## Example Usage - -```typescript -import { UpdateApiDocumentResponse } from "@scalar/sdk/models/operations"; - -let value: UpdateApiDocumentResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `any` | *any* | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/updateapidocumentversionrequest.md b/docs/models/operations/updateapidocumentversionrequest.md deleted file mode 100644 index 8ff05b6..0000000 --- a/docs/models/operations/updateapidocumentversionrequest.md +++ /dev/null @@ -1,22 +0,0 @@ -# UpdateApiDocumentVersionRequest - -## Example Usage - -```typescript -import { UpdateApiDocumentVersionRequest } from "@scalar/sdk/models/operations"; - -let value: UpdateApiDocumentVersionRequest = { - namespace: "", - slug: "", - semver: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | -| `namespace` | *string* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `semver` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.UpdateApiDocumentVersionRequestBody](../../models/operations/updateapidocumentversionrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/updateapidocumentversionrequestbody.md b/docs/models/operations/updateapidocumentversionrequestbody.md deleted file mode 100644 index 95333a1..0000000 --- a/docs/models/operations/updateapidocumentversionrequestbody.md +++ /dev/null @@ -1,18 +0,0 @@ -# UpdateApiDocumentVersionRequestBody - -## Example Usage - -```typescript -import { UpdateApiDocumentVersionRequestBody } from "@scalar/sdk/models/operations"; - -let value: UpdateApiDocumentVersionRequestBody = { - document: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------- | --------------------- | --------------------- | --------------------- | -| `document` | *string* | :heavy_check_mark: | N/A | -| `lastKnownVersionSha` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/updateapidocumentversionresponse.md b/docs/models/operations/updateapidocumentversionresponse.md deleted file mode 100644 index af57e9c..0000000 --- a/docs/models/operations/updateapidocumentversionresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# UpdateApiDocumentVersionResponse - -## Example Usage - -```typescript -import { UpdateApiDocumentVersionResponse } from "@scalar/sdk/models/operations"; - -let value: UpdateApiDocumentVersionResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `object` | [operations.UpdateApiDocumentVersionResponseBody](../../models/operations/updateapidocumentversionresponsebody.md) | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/updateapidocumentversionresponsebody.md b/docs/models/operations/updateapidocumentversionresponsebody.md deleted file mode 100644 index 4671d0d..0000000 --- a/docs/models/operations/updateapidocumentversionresponsebody.md +++ /dev/null @@ -1,23 +0,0 @@ -# UpdateApiDocumentVersionResponseBody - -Default Response - -## Example Usage - -```typescript -import { UpdateApiDocumentVersionResponseBody } from "@scalar/sdk/models/operations"; - -let value: UpdateApiDocumentVersionResponseBody = { - jsonSha: "", - yamlSha: "", - versionSha: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `jsonSha` | *string* | :heavy_check_mark: | N/A | -| `yamlSha` | *string* | :heavy_check_mark: | N/A | -| `versionSha` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/updateloginportalrequest.md b/docs/models/operations/updateloginportalrequest.md deleted file mode 100644 index ab5dd39..0000000 --- a/docs/models/operations/updateloginportalrequest.md +++ /dev/null @@ -1,18 +0,0 @@ -# UpdateLoginPortalRequest - -## Example Usage - -```typescript -import { UpdateLoginPortalRequest } from "@scalar/sdk/models/operations"; - -let value: UpdateLoginPortalRequest = { - slug: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.UpdateLoginPortalRequestBody](../../models/operations/updateloginportalrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/updateloginportalrequestbody.md b/docs/models/operations/updateloginportalrequestbody.md deleted file mode 100644 index c493acd..0000000 --- a/docs/models/operations/updateloginportalrequestbody.md +++ /dev/null @@ -1,15 +0,0 @@ -# UpdateLoginPortalRequestBody - -## Example Usage - -```typescript -import { UpdateLoginPortalRequestBody } from "@scalar/sdk/models/operations"; - -let value: UpdateLoginPortalRequestBody = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `title` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/updateloginportalresponse.md b/docs/models/operations/updateloginportalresponse.md deleted file mode 100644 index c8d8fdf..0000000 --- a/docs/models/operations/updateloginportalresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# UpdateLoginPortalResponse - -## Example Usage - -```typescript -import { UpdateLoginPortalResponse } from "@scalar/sdk/models/operations"; - -let value: UpdateLoginPortalResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `any` | *any* | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/updaterulesetrequest.md b/docs/models/operations/updaterulesetrequest.md deleted file mode 100644 index c81d07f..0000000 --- a/docs/models/operations/updaterulesetrequest.md +++ /dev/null @@ -1,20 +0,0 @@ -# UpdateRulesetRequest - -## Example Usage - -```typescript -import { UpdateRulesetRequest } from "@scalar/sdk/models/operations"; - -let value: UpdateRulesetRequest = { - namespace: "", - slug: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `namespace` | *string* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.UpdateRulesetRequestBody](../../models/operations/updaterulesetrequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/updaterulesetrequestbody.md b/docs/models/operations/updaterulesetrequestbody.md deleted file mode 100644 index 03fd12b..0000000 --- a/docs/models/operations/updaterulesetrequestbody.md +++ /dev/null @@ -1,19 +0,0 @@ -# UpdateRulesetRequestBody - -## Example Usage - -```typescript -import { UpdateRulesetRequestBody } from "@scalar/sdk/models/operations"; - -let value: UpdateRulesetRequestBody = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `namespace` | *string* | :heavy_minus_sign: | N/A | -| `slug` | *string* | :heavy_minus_sign: | N/A | -| `title` | *string* | :heavy_minus_sign: | N/A | -| `description` | *string* | :heavy_minus_sign: | N/A | -| `isPrivate` | *boolean* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/updaterulesetresponse.md b/docs/models/operations/updaterulesetresponse.md deleted file mode 100644 index 504763c..0000000 --- a/docs/models/operations/updaterulesetresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# UpdateRulesetResponse - -## Example Usage - -```typescript -import { UpdateRulesetResponse } from "@scalar/sdk/models/operations"; - -let value: UpdateRulesetResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `any` | *any* | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/updateschemarequest.md b/docs/models/operations/updateschemarequest.md deleted file mode 100644 index 78566e5..0000000 --- a/docs/models/operations/updateschemarequest.md +++ /dev/null @@ -1,20 +0,0 @@ -# UpdateSchemaRequest - -## Example Usage - -```typescript -import { UpdateSchemaRequest } from "@scalar/sdk/models/operations"; - -let value: UpdateSchemaRequest = { - namespace: "", - slug: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `namespace` | *string* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.UpdateSchemaRequestBody](../../models/operations/updateschemarequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/updateschemarequestbody.md b/docs/models/operations/updateschemarequestbody.md deleted file mode 100644 index e2e1776..0000000 --- a/docs/models/operations/updateschemarequestbody.md +++ /dev/null @@ -1,17 +0,0 @@ -# UpdateSchemaRequestBody - -## Example Usage - -```typescript -import { UpdateSchemaRequestBody } from "@scalar/sdk/models/operations"; - -let value: UpdateSchemaRequestBody = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `title` | *string* | :heavy_minus_sign: | N/A | -| `description` | *string* | :heavy_minus_sign: | N/A | -| `isPrivate` | *boolean* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/updateschemaresponse.md b/docs/models/operations/updateschemaresponse.md deleted file mode 100644 index 5830a54..0000000 --- a/docs/models/operations/updateschemaresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# UpdateSchemaResponse - -## Example Usage - -```typescript -import { UpdateSchemaResponse } from "@scalar/sdk/models/operations"; - -let value: UpdateSchemaResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `any` | *any* | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/models/operations/updatethemerequest.md b/docs/models/operations/updatethemerequest.md deleted file mode 100644 index 25c0a93..0000000 --- a/docs/models/operations/updatethemerequest.md +++ /dev/null @@ -1,18 +0,0 @@ -# UpdateThemeRequest - -## Example Usage - -```typescript -import { UpdateThemeRequest } from "@scalar/sdk/models/operations"; - -let value: UpdateThemeRequest = { - slug: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `requestBody` | [operations.UpdateThemeRequestBody](../../models/operations/updatethemerequestbody.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/updatethemerequestbody.md b/docs/models/operations/updatethemerequestbody.md deleted file mode 100644 index c1fd843..0000000 --- a/docs/models/operations/updatethemerequestbody.md +++ /dev/null @@ -1,16 +0,0 @@ -# UpdateThemeRequestBody - -## Example Usage - -```typescript -import { UpdateThemeRequestBody } from "@scalar/sdk/models/operations"; - -let value: UpdateThemeRequestBody = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `name` | *string* | :heavy_minus_sign: | N/A | -| `description` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/updatethemeresponse.md b/docs/models/operations/updatethemeresponse.md deleted file mode 100644 index 12539ec..0000000 --- a/docs/models/operations/updatethemeresponse.md +++ /dev/null @@ -1,16 +0,0 @@ -# UpdateThemeResponse - -## Example Usage - -```typescript -import { UpdateThemeResponse } from "@scalar/sdk/models/operations"; - -let value: UpdateThemeResponse = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A | -| `any` | *any* | :heavy_minus_sign: | Default Response | \ No newline at end of file diff --git a/docs/sdks/authentication/README.md b/docs/sdks/authentication/README.md deleted file mode 100644 index 04982ea..0000000 --- a/docs/sdks/authentication/README.md +++ /dev/null @@ -1,158 +0,0 @@ -# Authentication -(*authentication*) - -## Overview - -Authentication - -### Available Operations - -* [exchangePersonalToken](#exchangepersonaltoken) - Exchange token -* [getCurrentUser](#getcurrentuser) - Get current user - -## exchangePersonalToken - -Exchange an API key for an access token. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar(); - -async function run() { - const result = await scalar.authentication.exchangePersonalToken({ - personalToken: "", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { authenticationExchangePersonalToken } from "@scalar/sdk/funcs/authenticationExchangePersonalToken.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore(); - -async function run() { - const res = await authenticationExchangePersonalToken(scalar, { - personalToken: "", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("authenticationExchangePersonalToken failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ExchangePersonalTokenRequestBody](../../models/operations/exchangepersonaltokenrequestbody.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.ExchangePersonalTokenResponse](../../models/operations/exchangepersonaltokenresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## getCurrentUser - -Get the authenticated user, including their available teams and theme. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.authentication.getCurrentUser(); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { authenticationGetCurrentUser } from "@scalar/sdk/funcs/authenticationGetCurrentUser.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await authenticationGetCurrentUser(scalar); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("authenticationGetCurrentUser failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| 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.GetCurrentUserResponse](../../models/operations/getcurrentuserresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/loginportals/README.md b/docs/sdks/loginportals/README.md deleted file mode 100644 index 0e2e145..0000000 --- a/docs/sdks/loginportals/README.md +++ /dev/null @@ -1,407 +0,0 @@ -# LoginPortals -(*loginPortals*) - -## Overview - -Login Portals - -### Available Operations - -* [getLoginPortal](#getloginportal) - Get a login portal -* [updateLoginPortal](#updateloginportal) - Update portal metadata -* [deleteLoginPortal](#deleteloginportal) - Delete a login portal -* [createLoginPortal](#createloginportal) - Create a portal -* [listLoginPortals](#listloginportals) - List all portals - -## getLoginPortal - -Get a login portal by slug. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.loginPortals.getLoginPortal({ - slug: "", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { loginPortalsGetLoginPortal } from "@scalar/sdk/funcs/loginPortalsGetLoginPortal.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await loginPortalsGetLoginPortal(scalar, { - slug: "", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("loginPortalsGetLoginPortal failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetLoginPortalRequest](../../models/operations/getloginportalrequest.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.GetLoginPortalResponse](../../models/operations/getloginportalresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## updateLoginPortal - -Update metadata for a login portal. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.loginPortals.updateLoginPortal({ - slug: "", - requestBody: {}, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { loginPortalsUpdateLoginPortal } from "@scalar/sdk/funcs/loginPortalsUpdateLoginPortal.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await loginPortalsUpdateLoginPortal(scalar, { - slug: "", - requestBody: {}, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("loginPortalsUpdateLoginPortal failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.UpdateLoginPortalRequest](../../models/operations/updateloginportalrequest.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.UpdateLoginPortalResponse](../../models/operations/updateloginportalresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## deleteLoginPortal - -Delete a login portal. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.loginPortals.deleteLoginPortal({ - slug: "", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { loginPortalsDeleteLoginPortal } from "@scalar/sdk/funcs/loginPortalsDeleteLoginPortal.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await loginPortalsDeleteLoginPortal(scalar, { - slug: "", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("loginPortalsDeleteLoginPortal failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.DeleteLoginPortalRequest](../../models/operations/deleteloginportalrequest.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.DeleteLoginPortalResponse](../../models/operations/deleteloginportalresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## createLoginPortal - -Create a login portal for the current team. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.loginPortals.createLoginPortal({ - title: "", - slug: "", - email: {}, - page: {}, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { loginPortalsCreateLoginPortal } from "@scalar/sdk/funcs/loginPortalsCreateLoginPortal.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await loginPortalsCreateLoginPortal(scalar, { - title: "", - slug: "", - email: {}, - page: {}, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("loginPortalsCreateLoginPortal failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateLoginPortalRequestBody](../../models/operations/createloginportalrequestbody.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.CreateLoginPortalResponse](../../models/operations/createloginportalresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## listLoginPortals - -List all login portals for the current team. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.loginPortals.listLoginPortals(); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { loginPortalsListLoginPortals } from "@scalar/sdk/funcs/loginPortalsListLoginPortals.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await loginPortalsListLoginPortals(scalar); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("loginPortalsListLoginPortals failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| 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.ListLoginPortalsResponse](../../models/operations/listloginportalsresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/namespaces/README.md b/docs/sdks/namespaces/README.md deleted file mode 100644 index 75ea182..0000000 --- a/docs/sdks/namespaces/README.md +++ /dev/null @@ -1,83 +0,0 @@ -# Namespaces -(*namespaces*) - -## Overview - -Namespaces - -### Available Operations - -* [listNamespaces](#listnamespaces) - List namespaces - -## listNamespaces - -Get all namespaces for the current team - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.namespaces.listNamespaces(); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { namespacesListNamespaces } from "@scalar/sdk/funcs/namespacesListNamespaces.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await namespacesListNamespaces(scalar); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("namespacesListNamespaces failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| 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.ListNamespacesResponse](../../models/operations/listnamespacesresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/registry/README.md b/docs/sdks/registry/README.md deleted file mode 100644 index 175c5e4..0000000 --- a/docs/sdks/registry/README.md +++ /dev/null @@ -1,1018 +0,0 @@ -# Registry -(*registry*) - -## Overview - -Registry - -### Available Operations - -* [listAllApiDocuments](#listallapidocuments) - List all API Documents -* [listApiDocuments](#listapidocuments) - List API Documents in a namespace -* [createApiDocument](#createapidocument) - Create API Document -* [updateApiDocument](#updateapidocument) - Update API Document metadata -* [deleteApiDocument](#deleteapidocument) - Delete API Document -* [getApiDocumentVersion](#getapidocumentversion) - Get API Document -* [updateApiDocumentVersion](#updateapidocumentversion) - Update API Document version -* [deleteApiDocumentVersion](#deleteapidocumentversion) - Delete API Document version -* [getApiDocumentVersionMetadata](#getapidocumentversionmetadata) - Get API Document version metadata -* [createApiDocumentVersion](#createapidocumentversion) - Create API Document version -* [addApiDocumentAccessGroup](#addapidocumentaccessgroup) - Add access group -* [removeApiDocumentAccessGroup](#removeapidocumentaccessgroup) - Remove access group - -## listAllApiDocuments - -List all API documents across every namespace the caller can access. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.registry.listAllApiDocuments(); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { registryListAllApiDocuments } from "@scalar/sdk/funcs/registryListAllApiDocuments.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await registryListAllApiDocuments(scalar); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("registryListAllApiDocuments failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| 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.ListAllApiDocumentsResponse](../../models/operations/listallapidocumentsresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## listApiDocuments - -List API documents in a namespace. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.registry.listApiDocuments({ - namespace: "", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { registryListApiDocuments } from "@scalar/sdk/funcs/registryListApiDocuments.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await registryListApiDocuments(scalar, { - namespace: "", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("registryListApiDocuments failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ListApiDocumentsRequest](../../models/operations/listapidocumentsrequest.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.ListApiDocumentsResponse](../../models/operations/listapidocumentsresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## createApiDocument - -Create an API document. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.registry.createApiDocument({ - namespace: "", - requestBody: { - title: "", - version: "", - slug: "", - document: "", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { registryCreateApiDocument } from "@scalar/sdk/funcs/registryCreateApiDocument.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await registryCreateApiDocument(scalar, { - namespace: "", - requestBody: { - title: "", - version: "", - slug: "", - document: "", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("registryCreateApiDocument failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateApiDocumentRequest](../../models/operations/createapidocumentrequest.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.CreateApiDocumentResponse](../../models/operations/createapidocumentresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## updateApiDocument - -Update metadata for an API document. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.registry.updateApiDocument({ - namespace: "", - slug: "", - requestBody: {}, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { registryUpdateApiDocument } from "@scalar/sdk/funcs/registryUpdateApiDocument.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await registryUpdateApiDocument(scalar, { - namespace: "", - slug: "", - requestBody: {}, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("registryUpdateApiDocument failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.UpdateApiDocumentRequest](../../models/operations/updateapidocumentrequest.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.UpdateApiDocumentResponse](../../models/operations/updateapidocumentresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## deleteApiDocument - -Delete an API document and all versions. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.registry.deleteApiDocument({ - namespace: "", - slug: "", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { registryDeleteApiDocument } from "@scalar/sdk/funcs/registryDeleteApiDocument.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await registryDeleteApiDocument(scalar, { - namespace: "", - slug: "", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("registryDeleteApiDocument failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.DeleteApiDocumentRequest](../../models/operations/deleteapidocumentrequest.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.DeleteApiDocumentResponse](../../models/operations/deleteapidocumentresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## getApiDocumentVersion - -Get a specific API document version. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.registry.getApiDocumentVersion({ - namespace: "", - slug: "", - semver: "", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { registryGetApiDocumentVersion } from "@scalar/sdk/funcs/registryGetApiDocumentVersion.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await registryGetApiDocumentVersion(scalar, { - namespace: "", - slug: "", - semver: "", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("registryGetApiDocumentVersion failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetApiDocumentVersionRequest](../../models/operations/getapidocumentversionrequest.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.GetApiDocumentVersionResponse](../../models/operations/getapidocumentversionresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## updateApiDocumentVersion - -Update the registry file content for an API document version. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.registry.updateApiDocumentVersion({ - namespace: "", - slug: "", - semver: "", - requestBody: { - document: "", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { registryUpdateApiDocumentVersion } from "@scalar/sdk/funcs/registryUpdateApiDocumentVersion.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await registryUpdateApiDocumentVersion(scalar, { - namespace: "", - slug: "", - semver: "", - requestBody: { - document: "", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("registryUpdateApiDocumentVersion failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.UpdateApiDocumentVersionRequest](../../models/operations/updateapidocumentversionrequest.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.UpdateApiDocumentVersionResponse](../../models/operations/updateapidocumentversionresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## deleteApiDocumentVersion - -Delete a specific API document version. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.registry.deleteApiDocumentVersion({ - namespace: "", - slug: "", - semver: "", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { registryDeleteApiDocumentVersion } from "@scalar/sdk/funcs/registryDeleteApiDocumentVersion.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await registryDeleteApiDocumentVersion(scalar, { - namespace: "", - slug: "", - semver: "", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("registryDeleteApiDocumentVersion failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.DeleteApiDocumentVersionRequest](../../models/operations/deleteapidocumentversionrequest.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.DeleteApiDocumentVersionResponse](../../models/operations/deleteapidocumentversionresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## getApiDocumentVersionMetadata - -Get metadata (uid, content shas, version sha, tags) for a specific API document version. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.registry.getApiDocumentVersionMetadata({ - namespace: "", - slug: "", - semver: "", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { registryGetApiDocumentVersionMetadata } from "@scalar/sdk/funcs/registryGetApiDocumentVersionMetadata.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await registryGetApiDocumentVersionMetadata(scalar, { - namespace: "", - slug: "", - semver: "", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("registryGetApiDocumentVersionMetadata failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetApiDocumentVersionMetadataRequest](../../models/operations/getapidocumentversionmetadatarequest.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.GetApiDocumentVersionMetadataResponse](../../models/operations/getapidocumentversionmetadataresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## createApiDocumentVersion - -Create a new API document version. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.registry.createApiDocumentVersion({ - namespace: "", - slug: "", - requestBody: { - version: "", - document: "", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { registryCreateApiDocumentVersion } from "@scalar/sdk/funcs/registryCreateApiDocumentVersion.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await registryCreateApiDocumentVersion(scalar, { - namespace: "", - slug: "", - requestBody: { - version: "", - document: "", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("registryCreateApiDocumentVersion failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateApiDocumentVersionRequest](../../models/operations/createapidocumentversionrequest.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.CreateApiDocumentVersionResponse](../../models/operations/createapidocumentversionresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## addApiDocumentAccessGroup - -Add an access group to an API document. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.registry.addApiDocumentAccessGroup({ - namespace: "", - slug: "", - accessGroup: { - accessGroupSlug: "", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { registryAddApiDocumentAccessGroup } from "@scalar/sdk/funcs/registryAddApiDocumentAccessGroup.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await registryAddApiDocumentAccessGroup(scalar, { - namespace: "", - slug: "", - accessGroup: { - accessGroupSlug: "", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("registryAddApiDocumentAccessGroup failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.AddApiDocumentAccessGroupRequest](../../models/operations/addapidocumentaccessgrouprequest.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.AddApiDocumentAccessGroupResponse](../../models/operations/addapidocumentaccessgroupresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## removeApiDocumentAccessGroup - -Remove an access group from an API document. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.registry.removeApiDocumentAccessGroup({ - namespace: "", - slug: "", - accessGroup: { - accessGroupSlug: "", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { registryRemoveApiDocumentAccessGroup } from "@scalar/sdk/funcs/registryRemoveApiDocumentAccessGroup.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await registryRemoveApiDocumentAccessGroup(scalar, { - namespace: "", - slug: "", - accessGroup: { - accessGroupSlug: "", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("registryRemoveApiDocumentAccessGroup failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.RemoveApiDocumentAccessGroupRequest](../../models/operations/removeapidocumentaccessgrouprequest.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.RemoveApiDocumentAccessGroupResponse](../../models/operations/removeapidocumentaccessgroupresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/rules/README.md b/docs/sdks/rules/README.md deleted file mode 100644 index f073fe2..0000000 --- a/docs/sdks/rules/README.md +++ /dev/null @@ -1,596 +0,0 @@ -# Rules -(*rules*) - -## Overview - -Rules - -### Available Operations - -* [listRulesets](#listrulesets) - List all rules -* [createRuleset](#createruleset) - Create a rule -* [updateRuleset](#updateruleset) - Update rule metadata -* [deleteRuleset](#deleteruleset) - Delete a rule -* [getRulesetDocument](#getrulesetdocument) - Get a rule -* [addRulesetAccessGroup](#addrulesetaccessgroup) - Add rule access group -* [removeRulesetAccessGroup](#removerulesetaccessgroup) - Remove rule access group - -## listRulesets - -List all rulesets in a namespace. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.rules.listRulesets({ - namespace: "", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { rulesListRulesets } from "@scalar/sdk/funcs/rulesListRulesets.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await rulesListRulesets(scalar, { - namespace: "", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("rulesListRulesets failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ListRulesetsRequest](../../models/operations/listrulesetsrequest.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.ListRulesetsResponse](../../models/operations/listrulesetsresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## createRuleset - -Create a rule in a namespace. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.rules.createRuleset({ - namespace: "", - requestBody: { - title: "", - slug: "", - document: "", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { rulesCreateRuleset } from "@scalar/sdk/funcs/rulesCreateRuleset.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await rulesCreateRuleset(scalar, { - namespace: "", - requestBody: { - title: "", - slug: "", - document: "", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("rulesCreateRuleset failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateRulesetRequest](../../models/operations/createrulesetrequest.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.CreateRulesetResponse](../../models/operations/createrulesetresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## updateRuleset - -Update rule metadata by slug. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.rules.updateRuleset({ - namespace: "", - slug: "", - requestBody: {}, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { rulesUpdateRuleset } from "@scalar/sdk/funcs/rulesUpdateRuleset.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await rulesUpdateRuleset(scalar, { - namespace: "", - slug: "", - requestBody: {}, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("rulesUpdateRuleset failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.UpdateRulesetRequest](../../models/operations/updaterulesetrequest.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.UpdateRulesetResponse](../../models/operations/updaterulesetresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## deleteRuleset - -Delete a rule by slug. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.rules.deleteRuleset({ - namespace: "", - slug: "", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { rulesDeleteRuleset } from "@scalar/sdk/funcs/rulesDeleteRuleset.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await rulesDeleteRuleset(scalar, { - namespace: "", - slug: "", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("rulesDeleteRuleset failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.DeleteRulesetRequest](../../models/operations/deleterulesetrequest.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.DeleteRulesetResponse](../../models/operations/deleterulesetresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## getRulesetDocument - -Get a rule document by slug. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.rules.getRulesetDocument({ - namespace: "", - slug: "", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { rulesGetRulesetDocument } from "@scalar/sdk/funcs/rulesGetRulesetDocument.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await rulesGetRulesetDocument(scalar, { - namespace: "", - slug: "", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("rulesGetRulesetDocument failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetRulesetDocumentRequest](../../models/operations/getrulesetdocumentrequest.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.GetRulesetDocumentResponse](../../models/operations/getrulesetdocumentresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## addRulesetAccessGroup - -Grant an access group to a rule. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.rules.addRulesetAccessGroup({ - namespace: "", - slug: "", - accessGroup: { - accessGroupSlug: "", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { rulesAddRulesetAccessGroup } from "@scalar/sdk/funcs/rulesAddRulesetAccessGroup.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await rulesAddRulesetAccessGroup(scalar, { - namespace: "", - slug: "", - accessGroup: { - accessGroupSlug: "", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("rulesAddRulesetAccessGroup failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.AddRulesetAccessGroupRequest](../../models/operations/addrulesetaccessgrouprequest.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.AddRulesetAccessGroupResponse](../../models/operations/addrulesetaccessgroupresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## removeRulesetAccessGroup - -Remove an access group from a rule. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.rules.removeRulesetAccessGroup({ - namespace: "", - slug: "", - accessGroup: { - accessGroupSlug: "", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { rulesRemoveRulesetAccessGroup } from "@scalar/sdk/funcs/rulesRemoveRulesetAccessGroup.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await rulesRemoveRulesetAccessGroup(scalar, { - namespace: "", - slug: "", - accessGroup: { - accessGroupSlug: "", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("rulesRemoveRulesetAccessGroup failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.RemoveRulesetAccessGroupRequest](../../models/operations/removerulesetaccessgrouprequest.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.RemoveRulesetAccessGroupResponse](../../models/operations/removerulesetaccessgroupresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/scalar/README.md b/docs/sdks/scalar/README.md deleted file mode 100644 index e978b93..0000000 --- a/docs/sdks/scalar/README.md +++ /dev/null @@ -1,74 +0,0 @@ -# Scalar SDK - -## Overview - -Scalar API: API for managing Scalar platform resources. - -## TypeScript SDK - -For TypeScript, we provide a SDK that makes using our API even easier. - -### Install - -```bash -npm add @scalar/sdk -``` - -### Get a Scalar API key - -Create an API key in your Scalar account: - -- Dashboard: https://dashboard.scalar.com/account -- Store it in `.env`, for example: - -```bash -SCALAR_API_KEY=your_personal_token -``` - -### Exchange your API key for an access token - -The personal token is not an access token. Exchange it first with `postv1AuthExchange`. - -If you use the personal token directly for authenticated API calls, the API returns `401 Invalid authentication token`. - -```ts -import { Scalar } from '@scalar/sdk' - -const scalar = new Scalar() - -const exchange = await scalar.auth.postv1AuthExchange({ - personalToken: process.env.SCALAR_API_KEY!, -}) - -const accessToken = exchange.accessToken -``` - -### Use the access token - -Construct a second client with bearer auth. Use this authenticated client for API calls. - -```ts -import { Scalar } from '@scalar/sdk' - -const scalar = new Scalar() - -const exchange = await scalar.auth.postv1AuthExchange({ - personalToken: process.env.SCALAR_API_KEY!, -}) - -const authedScalar = new Scalar({ - bearerAuth: exchange.accessToken, -}) -``` - -### Notes - -- The exchange request itself can be made from a client constructed with no arguments (`new Scalar()`). -- The exchanged access token is valid for 12 hours. -- Timestamps are Unix seconds. - -### Read more - -- [@scalar/sdk on npm](https://www.npmjs.com/package/@scalar/sdk) - -### Available Operations diff --git a/docs/sdks/scalardocs/README.md b/docs/sdks/scalardocs/README.md deleted file mode 100644 index 9960070..0000000 --- a/docs/sdks/scalardocs/README.md +++ /dev/null @@ -1,249 +0,0 @@ -# ScalarDocs -(*scalarDocs*) - -## Overview - -Scalar Docs - -### Available Operations - -* [listGuides](#listguides) - List all projects -* [createGuide](#createguide) - Create a project -* [publishGuide](#publishguide) - Publish a project - -## listGuides - -List all guide projects. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.scalarDocs.listGuides(); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { scalarDocsListGuides } from "@scalar/sdk/funcs/scalarDocsListGuides.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await scalarDocsListGuides(scalar); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("scalarDocsListGuides failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| 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.ListGuidesResponse](../../models/operations/listguidesresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## createGuide - -Create a guide project. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.scalarDocs.createGuide({ - name: "", - allowedUsers: [ - "", - ], - allowedDomains: [], - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { scalarDocsCreateGuide } from "@scalar/sdk/funcs/scalarDocsCreateGuide.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await scalarDocsCreateGuide(scalar, { - name: "", - allowedUsers: [ - "", - ], - allowedDomains: [], - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("scalarDocsCreateGuide failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateGuideRequestBody](../../models/operations/createguiderequestbody.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.CreateGuideResponse](../../models/operations/createguideresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## publishGuide - -Start a new publish process. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.scalarDocs.publishGuide({ - slug: "", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { scalarDocsPublishGuide } from "@scalar/sdk/funcs/scalarDocsPublishGuide.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await scalarDocsPublishGuide(scalar, { - slug: "", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("scalarDocsPublishGuide failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.PublishGuideRequest](../../models/operations/publishguiderequest.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.PublishGuideResponse](../../models/operations/publishguideresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/schemas/README.md b/docs/sdks/schemas/README.md deleted file mode 100644 index 5a2bedd..0000000 --- a/docs/sdks/schemas/README.md +++ /dev/null @@ -1,772 +0,0 @@ -# Schemas -(*schemas*) - -## Overview - -Schemas - -### Available Operations - -* [listSchemas](#listschemas) - List all shared components -* [createSchema](#createschema) - Create a shared component -* [updateSchema](#updateschema) - Update shared component metadata -* [deleteSchema](#deleteschema) - Delete a shared component -* [getSchemaVersion](#getschemaversion) - Get a shared component document -* [deleteSchemaVersion](#deleteschemaversion) - Delete a shared component version -* [createSchemaVersion](#createschemaversion) - Create a shared component version -* [addSchemaAccessGroup](#addschemaaccessgroup) - Add shared component access group -* [removeSchemaAccessGroup](#removeschemaaccessgroup) - Remove shared component access group - -## listSchemas - -List schemas in a namespace. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.schemas.listSchemas({ - namespace: "", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { schemasListSchemas } from "@scalar/sdk/funcs/schemasListSchemas.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await schemasListSchemas(scalar, { - namespace: "", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("schemasListSchemas failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ListSchemasRequest](../../models/operations/listschemasrequest.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.ListSchemasResponse](../../models/operations/listschemasresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## createSchema - -Create a schema in a namespace. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.schemas.createSchema({ - namespace: "", - requestBody: { - title: "", - version: "", - slug: "", - document: "", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { schemasCreateSchema } from "@scalar/sdk/funcs/schemasCreateSchema.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await schemasCreateSchema(scalar, { - namespace: "", - requestBody: { - title: "", - version: "", - slug: "", - document: "", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("schemasCreateSchema failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateSchemaRequest](../../models/operations/createschemarequest.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.CreateSchemaResponse](../../models/operations/createschemaresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## updateSchema - -Update schema metadata. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.schemas.updateSchema({ - namespace: "", - slug: "", - requestBody: {}, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { schemasUpdateSchema } from "@scalar/sdk/funcs/schemasUpdateSchema.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await schemasUpdateSchema(scalar, { - namespace: "", - slug: "", - requestBody: {}, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("schemasUpdateSchema failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.UpdateSchemaRequest](../../models/operations/updateschemarequest.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.UpdateSchemaResponse](../../models/operations/updateschemaresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## deleteSchema - -Delete a schema and all related versions. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.schemas.deleteSchema({ - namespace: "", - slug: "", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { schemasDeleteSchema } from "@scalar/sdk/funcs/schemasDeleteSchema.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await schemasDeleteSchema(scalar, { - namespace: "", - slug: "", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("schemasDeleteSchema failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.DeleteSchemaRequest](../../models/operations/deleteschemarequest.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.DeleteSchemaResponse](../../models/operations/deleteschemaresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## getSchemaVersion - -Get a specific schema version document. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.schemas.getSchemaVersion({ - namespace: "", - slug: "", - semver: "", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { schemasGetSchemaVersion } from "@scalar/sdk/funcs/schemasGetSchemaVersion.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await schemasGetSchemaVersion(scalar, { - namespace: "", - slug: "", - semver: "", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("schemasGetSchemaVersion failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetSchemaVersionRequest](../../models/operations/getschemaversionrequest.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.GetSchemaVersionResponse](../../models/operations/getschemaversionresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## deleteSchemaVersion - -Delete a schema version. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.schemas.deleteSchemaVersion({ - namespace: "", - slug: "", - semver: "", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { schemasDeleteSchemaVersion } from "@scalar/sdk/funcs/schemasDeleteSchemaVersion.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await schemasDeleteSchemaVersion(scalar, { - namespace: "", - slug: "", - semver: "", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("schemasDeleteSchemaVersion failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.DeleteSchemaVersionRequest](../../models/operations/deleteschemaversionrequest.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.DeleteSchemaVersionResponse](../../models/operations/deleteschemaversionresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## createSchemaVersion - -Create a schema version. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.schemas.createSchemaVersion({ - namespace: "", - slug: "", - requestBody: { - version: "", - document: "", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { schemasCreateSchemaVersion } from "@scalar/sdk/funcs/schemasCreateSchemaVersion.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await schemasCreateSchemaVersion(scalar, { - namespace: "", - slug: "", - requestBody: { - version: "", - document: "", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("schemasCreateSchemaVersion failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateSchemaVersionRequest](../../models/operations/createschemaversionrequest.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.CreateSchemaVersionResponse](../../models/operations/createschemaversionresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## addSchemaAccessGroup - -Add an access group to a schema. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.schemas.addSchemaAccessGroup({ - namespace: "", - slug: "", - accessGroup: { - accessGroupSlug: "", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { schemasAddSchemaAccessGroup } from "@scalar/sdk/funcs/schemasAddSchemaAccessGroup.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await schemasAddSchemaAccessGroup(scalar, { - namespace: "", - slug: "", - accessGroup: { - accessGroupSlug: "", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("schemasAddSchemaAccessGroup failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.AddSchemaAccessGroupRequest](../../models/operations/addschemaaccessgrouprequest.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.AddSchemaAccessGroupResponse](../../models/operations/addschemaaccessgroupresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## removeSchemaAccessGroup - -Remove an access group from a schema. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.schemas.removeSchemaAccessGroup({ - namespace: "", - slug: "", - accessGroup: { - accessGroupSlug: "", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { schemasRemoveSchemaAccessGroup } from "@scalar/sdk/funcs/schemasRemoveSchemaAccessGroup.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await schemasRemoveSchemaAccessGroup(scalar, { - namespace: "", - slug: "", - accessGroup: { - accessGroupSlug: "", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("schemasRemoveSchemaAccessGroup failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.RemoveSchemaAccessGroupRequest](../../models/operations/removeschemaaccessgrouprequest.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.RemoveSchemaAccessGroupResponse](../../models/operations/removeschemaaccessgroupresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/teams/README.md b/docs/sdks/teams/README.md deleted file mode 100644 index 1059a54..0000000 --- a/docs/sdks/teams/README.md +++ /dev/null @@ -1,83 +0,0 @@ -# Teams -(*teams*) - -## Overview - -Teams - -### Available Operations - -* [listTeams](#listteams) - List teams - -## listTeams - -List all available teams - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.teams.listTeams(); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { teamsListTeams } from "@scalar/sdk/funcs/teamsListTeams.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await teamsListTeams(scalar); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("teamsListTeams failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| 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.ListTeamsResponse](../../models/operations/listteamsresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/themes/README.md b/docs/sdks/themes/README.md deleted file mode 100644 index db14853..0000000 --- a/docs/sdks/themes/README.md +++ /dev/null @@ -1,490 +0,0 @@ -# Themes -(*themes*) - -## Overview - -Themes - -### Available Operations - -* [listThemes](#listthemes) - List all themes -* [createTheme](#createtheme) - Create a theme -* [updateTheme](#updatetheme) - Update theme metadata -* [replaceThemeDocument](#replacethemedocument) - Update theme document -* [deleteTheme](#deletetheme) - Delete a theme -* [getTheme](#gettheme) - Get a theme - -## listThemes - -List all team themes. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.themes.listThemes(); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { themesListThemes } from "@scalar/sdk/funcs/themesListThemes.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await themesListThemes(scalar); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("themesListThemes failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| 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.ListThemesResponse](../../models/operations/listthemesresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## createTheme - -Create a team theme. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.themes.createTheme({ - name: "", - slug: "", - document: "", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { themesCreateTheme } from "@scalar/sdk/funcs/themesCreateTheme.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await themesCreateTheme(scalar, { - name: "", - slug: "", - document: "", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("themesCreateTheme failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateThemeRequestBody](../../models/operations/createthemerequestbody.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.CreateThemeResponse](../../models/operations/createthemeresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## updateTheme - -Update theme metadata. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.themes.updateTheme({ - slug: "", - requestBody: {}, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { themesUpdateTheme } from "@scalar/sdk/funcs/themesUpdateTheme.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await themesUpdateTheme(scalar, { - slug: "", - requestBody: {}, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("themesUpdateTheme failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.UpdateThemeRequest](../../models/operations/updatethemerequest.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.UpdateThemeResponse](../../models/operations/updatethemeresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## replaceThemeDocument - -Replace the theme document. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.themes.replaceThemeDocument({ - slug: "", - requestBody: { - document: "", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { themesReplaceThemeDocument } from "@scalar/sdk/funcs/themesReplaceThemeDocument.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await themesReplaceThemeDocument(scalar, { - slug: "", - requestBody: { - document: "", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("themesReplaceThemeDocument failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ReplaceThemeDocumentRequest](../../models/operations/replacethemedocumentrequest.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.ReplaceThemeDocumentResponse](../../models/operations/replacethemedocumentresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## deleteTheme - -Delete a theme by slug. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.themes.deleteTheme({ - slug: "", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { themesDeleteTheme } from "@scalar/sdk/funcs/themesDeleteTheme.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await themesDeleteTheme(scalar, { - slug: "", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("themesDeleteTheme failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.DeleteThemeRequest](../../models/operations/deletethemerequest.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.DeleteThemeResponse](../../models/operations/deletethemeresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | - -## getTheme - -Get the theme document by slug. - -### Example Usage - -```typescript -import { Scalar } from "@scalar/sdk"; - -const scalar = new Scalar({ - bearerAuth: "", -}); - -async function run() { - const result = await scalar.themes.getTheme({ - slug: "", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { ScalarCore } from "@scalar/sdk/core.js"; -import { themesGetTheme } from "@scalar/sdk/funcs/themesGetTheme.js"; - -// Use `ScalarCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const scalar = new ScalarCore({ - bearerAuth: "", -}); - -async function run() { - const res = await themesGetTheme(scalar, { - slug: "", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("themesGetTheme failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetThemeRequest](../../models/operations/getthemerequest.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.GetThemeResponse](../../models/operations/getthemeresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ------------------------------ | ------------------------------ | ------------------------------ | -| errors.FourHundred | 400 | application/json | -| errors.FourHundredAndOne | 401 | application/json | -| errors.FourHundredAndThree | 403 | application/json | -| errors.FourHundredAndFour | 404 | application/json | -| errors.FourHundredAndTwentyTwo | 422 | application/json | -| errors.FiveHundred | 500 | application/json | -| errors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/eslint.config.mjs b/eslint.config.mjs deleted file mode 100644 index 67bccfe..0000000 --- a/eslint.config.mjs +++ /dev/null @@ -1,22 +0,0 @@ -import globals from "globals"; -import pluginJs from "@eslint/js"; -import tseslint from "typescript-eslint"; - -/** @type {import('eslint').Linter.Config[]} */ -export default [ - { files: ["**/*.{js,mjs,cjs,ts}"] }, - { languageOptions: { globals: globals.browser } }, - pluginJs.configs.recommended, - ...tseslint.configs.recommended, - { - rules: { - "no-constant-condition": "off", - "no-useless-escape": "off", - // Handled by typescript compiler - "@typescript-eslint/no-unused-vars": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-empty-object-type": "off", - "@typescript-eslint/no-namespace": "off", - }, - }, -]; diff --git a/jsr.json b/jsr.json deleted file mode 100644 index 0e77af9..0000000 --- a/jsr.json +++ /dev/null @@ -1,27 +0,0 @@ - - -{ - "name": "@scalar/sdk", - "version": "0.1.5", - "exports": { - ".": "./src/index.ts", - "./models/errors": "./src/models/errors/index.ts", - "./models/components": "./src/models/components/index.ts", - "./models/operations": "./src/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/types/index.ts" - }, - "publish": { - "include": [ - "LICENSE", - "README.md", - "RUNTIMES.md", - "USAGE.md", - "jsr.json", - "src/**/*.ts" - ] - } -} diff --git a/openapi.augmented.json b/openapi.augmented.json new file mode 100644 index 0000000..f4bdee1 --- /dev/null +++ b/openapi.augmented.json @@ -0,0 +1,8207 @@ +{ + "openapi": "3.1.1", + "info": { + "title": "Scalar API", + "description": "Manage Scalar platform resources programmatically. The Scalar API lets teams create and update API references, schemas, guides, rulesets, themes, login portals, namespaces, and access controls from automated workflows or custom internal tooling. Use it to keep documentation and developer portals in sync with your source of truth, publish new versions safely, and inspect the teams and authenticated user context available to your integration.", + "version": "0.1.5", + "contact": { + "name": "Marc from Scalar", + "url": "https://scalar.com", + "email": "support@scalar.com" + } + }, + "servers": [ + { + "url": "https://access.scalar.com" + } + ], + "tags": [ + { + "name": "Registry", + "description": "Registry", + "x-scalar-order": [ + "api/tag/registry/GET/v1/apis", + "api/tag/registry/GET/v1/apis/{namespace}", + "api/tag/registry/POST/v1/apis/{namespace}", + "api/tag/registry/PATCH/v1/apis/{namespace}/{slug}", + "api/tag/registry/DELETE/v1/apis/{namespace}/{slug}", + "api/tag/registry/GET/v1/apis/{namespace}/{slug}/version/{semver}", + "api/tag/registry/PATCH/v1/apis/{namespace}/{slug}/version/{semver}", + "api/tag/registry/DELETE/v1/apis/{namespace}/{slug}/version/{semver}", + "api/tag/registry/GET/v1/apis/{namespace}/{slug}/version/{semver}/metadata", + "api/tag/registry/POST/v1/apis/{namespace}/{slug}/version", + "api/tag/registry/POST/v1/apis/{namespace}/{slug}/access-group", + "api/tag/registry/DELETE/v1/apis/{namespace}/{slug}/access-group" + ] + }, + { + "name": "Schemas", + "description": "Schemas", + "x-scalar-order": [ + "api/tag/schemas/GET/v1/schemas/{namespace}", + "api/tag/schemas/POST/v1/schemas/{namespace}", + "api/tag/schemas/PATCH/v1/schemas/{namespace}/{slug}", + "api/tag/schemas/DELETE/v1/schemas/{namespace}/{slug}", + "api/tag/schemas/GET/v1/schemas/{namespace}/{slug}/version/{semver}", + "api/tag/schemas/DELETE/v1/schemas/{namespace}/{slug}/version/{semver}", + "api/tag/schemas/POST/v1/schemas/{namespace}/{slug}/version", + "api/tag/schemas/POST/v1/schemas/{namespace}/{slug}/access-group", + "api/tag/schemas/DELETE/v1/schemas/{namespace}/{slug}/access-group" + ] + }, + { + "name": "Login Portals", + "description": "Login Portals", + "x-scalar-order": [ + "api/tag/login-portals/GET/v1/login-portals/{slug}", + "api/tag/login-portals/PATCH/v1/login-portals/{slug}", + "api/tag/login-portals/DELETE/v1/login-portals/{slug}", + "api/tag/login-portals/POST/v1/login-portals", + "api/tag/login-portals/GET/v1/login-portals" + ] + }, + { + "name": "Rules", + "description": "Rules", + "x-scalar-order": [ + "api/tag/rules/GET/v1/rulesets/{namespace}", + "api/tag/rules/POST/v1/rulesets/{namespace}", + "api/tag/rules/PATCH/v1/rulesets/{namespace}/{slug}", + "api/tag/rules/DELETE/v1/rulesets/{namespace}/{slug}", + "api/tag/rules/GET/v1/rulesets/{namespace}/{slug}", + "api/tag/rules/POST/v1/rulesets/{namespace}/{slug}/access-group", + "api/tag/rules/DELETE/v1/rulesets/{namespace}/{slug}/access-group" + ] + }, + { + "name": "Themes", + "description": "Themes", + "x-scalar-order": [ + "api/tag/themes/GET/v1/themes", + "api/tag/themes/POST/v1/themes", + "api/tag/themes/PATCH/v1/themes/{slug}", + "api/tag/themes/PUT/v1/themes/{slug}", + "api/tag/themes/DELETE/v1/themes/{slug}", + "api/tag/themes/GET/v1/themes/{slug}" + ] + }, + { + "name": "Teams", + "description": "Teams", + "x-scalar-order": [ + "api/tag/teams/GET/v1/teams" + ] + }, + { + "name": "Scalar Docs", + "description": "Scalar Docs", + "x-scalar-order": [ + "api/tag/scalar-docs/GET/v1/guides", + "api/tag/scalar-docs/POST/v1/guides", + "api/tag/scalar-docs/POST/v1/guides/{slug}/publish" + ] + }, + { + "name": "Namespaces", + "description": "Namespaces", + "x-scalar-order": [ + "api/tag/namespaces/GET/v1/namespaces" + ] + }, + { + "name": "Authentication", + "description": "Authentication", + "x-scalar-order": [ + "api/tag/authentication/POST/v1/auth/exchange", + "api/tag/authentication/GET/v1/auth/me" + ] + } + ], + "components": { + "securitySchemes": { + "BearerAuth": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + } + }, + "schemas": { + "400": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "type": "string" + } + }, + "required": [ + "message", + "code" + ], + "description": "Bad request error response." + }, + "401": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "type": "string" + } + }, + "required": [ + "message", + "code" + ], + "description": "Unauthorized error response." + }, + "403": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "type": "string" + } + }, + "required": [ + "message", + "code" + ], + "description": "Forbidden error response." + }, + "404": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "type": "string" + } + }, + "required": [ + "message", + "code" + ], + "description": "Not found error response." + }, + "422": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "type": "string" + } + }, + "required": [ + "message", + "code" + ], + "description": "Validation error response." + }, + "500": { + "type": "object", + "properties": { + "message": { + "type": "string" + }, + "code": { + "type": "string" + } + }, + "required": [ + "message", + "code" + ], + "description": "Internal server error response." + }, + "api-document": { + "type": "object", + "properties": { + "uid": { + "default": "nanoid()", + "$ref": "#/components/schemas/nanoid" + }, + "version": { + "$ref": "#/components/schemas/version" + }, + "title": { + "default": "", + "type": "string", + "maxLength": 100 + }, + "slug": { + "default": "randomManagedDocSlug()", + "$ref": "#/components/schemas/slug" + }, + "description": { + "default": "", + "type": "string" + }, + "namespace": { + "$ref": "#/components/schemas/namespace" + }, + "isPrivate": { + "default": false, + "type": "boolean", + "description": "Whether the resource is private." + }, + "tags": { + "default": [], + "description": "Tags associated with the resource." + }, + "versions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/managed-doc-version" + }, + "description": "Available versions for the resource." + } + }, + "required": [ + "uid", + "version", + "title", + "slug", + "description", + "namespace", + "isPrivate", + "tags", + "versions" + ], + "additionalProperties": false, + "description": "API document metadata." + }, + "nanoid": { + "type": "string", + "minLength": 5, + "description": "Unique Nano ID identifier." + }, + "version": { + "type": "string", + "minLength": 1, + "description": "Semantic or display version string." + }, + "slug": { + "type": "string", + "minLength": 3, + "maxLength": 60, + "pattern": "^[a-z](?:[a-z0-9-]*[a-z0-9])?$", + "description": "URL-safe slug identifier." + }, + "namespace": { + "type": "string", + "minLength": 3, + "maxLength": 50, + "pattern": "^[a-zA-Z0-9-_]+$", + "description": "Workspace namespace identifier." + }, + "managed-doc-version": { + "type": "object", + "properties": { + "uid": { + "$ref": "#/components/schemas/nanoid" + }, + "createdAt": { + "type": "number", + "description": "Timestamp when the resource was created." + }, + "version": { + "$ref": "#/components/schemas/version" + }, + "upgraded": { + "default": false, + "type": "boolean", + "description": "Whether the version was upgraded." + }, + "embedStatus": { + "default": null, + "anyOf": [ + { + "type": "string", + "enum": [ + "complete", + "failed" + ] + }, + { + "type": "null" + } + ], + "description": "Current embedding status." + }, + "tags": { + "default": [], + "type": "array", + "items": { + "type": "string" + }, + "description": "Tags associated with the resource." + }, + "tools": { + "type": "array", + "items": { + "type": "object", + "properties": { + "path": { + "type": "string", + "description": "Operation path." + }, + "method": { + "$ref": "#/components/schemas/method" + }, + "enabledTools": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "execute-request", + "get-mini-openapi-spec" + ] + }, + "description": "Enabled tools for the operation." + } + }, + "required": [ + "path", + "method", + "enabledTools" + ], + "additionalProperties": false + }, + "description": "Tool configuration for documented operations." + }, + "yamlSha": { + "type": "string", + "description": "SHA hash of the YAML document." + }, + "jsonSha": { + "type": "string", + "description": "SHA hash of the JSON document." + }, + "versionSha": { + "type": "string", + "description": "SHA hash of the version contents." + } + }, + "required": [ + "uid", + "createdAt", + "version", + "upgraded", + "embedStatus", + "tags" + ], + "additionalProperties": false, + "description": "Managed API document version metadata." + }, + "method": { + "type": "string", + "enum": [ + "delete", + "get", + "head", + "options", + "patch", + "post", + "put", + "trace" + ], + "description": "HTTP method." + }, + "access-group": { + "type": "object", + "properties": { + "accessGroupSlug": { + "$ref": "#/components/schemas/slug" + } + }, + "required": [ + "accessGroupSlug" + ], + "additionalProperties": false, + "description": "Access group assignment payload." + }, + "schema": { + "type": "object", + "properties": { + "uid": { + "default": "nanoid()", + "$ref": "#/components/schemas/nanoid" + }, + "title": { + "default": "", + "type": "string", + "maxLength": 100 + }, + "description": { + "default": "", + "type": "string" + }, + "slug": { + "default": "randomManagedDocSlug()", + "$ref": "#/components/schemas/slug" + }, + "namespace": { + "$ref": "#/components/schemas/namespace" + }, + "isPrivate": { + "default": false, + "type": "boolean", + "description": "Whether the resource is private." + }, + "versions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/managed-schema-version" + }, + "description": "Available versions for the resource." + } + }, + "required": [ + "uid", + "title", + "description", + "slug", + "namespace", + "isPrivate", + "versions" + ], + "additionalProperties": false, + "description": "Schema metadata." + }, + "managed-schema-version": { + "type": "object", + "properties": { + "uid": { + "default": "nanoid()", + "$ref": "#/components/schemas/nanoid" + }, + "createdAt": { + "default": "unixTimestamp()", + "$ref": "#/components/schemas/timestamp" + }, + "updatedAt": { + "default": "unixTimestamp()", + "$ref": "#/components/schemas/timestamp" + }, + "version": { + "default": "0.0.1", + "$ref": "#/components/schemas/version" + } + }, + "required": [ + "uid", + "createdAt", + "updatedAt", + "version" + ], + "additionalProperties": false, + "description": "Managed schema version metadata." + }, + "timestamp": { + "type": "integer", + "minimum": 0, + "maximum": 9007199254740991, + "description": "Unix timestamp in milliseconds." + }, + "uid": { + "type": "object", + "properties": { + "uid": { + "$ref": "#/components/schemas/nanoid" + } + }, + "required": [ + "uid" + ], + "additionalProperties": false, + "description": "Object UID wrapper." + }, + "login-portal-email": { + "type": "object", + "properties": { + "logo": { + "default": "", + "type": "string", + "description": "Logo image URL or data URI." + }, + "logoSize": { + "default": "100", + "type": "string", + "description": "Rendered logo size." + }, + "buttonText": { + "default": "Login", + "type": "string", + "maxLength": 50, + "description": "Call-to-action button text." + }, + "message": { + "default": "Click to access private documentation hosted by scalar.com", + "type": "string", + "maxLength": 1000 + }, + "title": { + "default": "Private Docs", + "type": "string", + "maxLength": 100 + }, + "mainColor": { + "default": "#2a2f45", + "type": "string", + "maxLength": 100, + "description": "Primary foreground color." + }, + "mainBackground": { + "default": "#f6f6f6", + "type": "string", + "maxLength": 100, + "description": "Primary background color." + }, + "cardColor": { + "default": "2a2f45", + "type": "string", + "maxLength": 100, + "description": "Card foreground color." + }, + "cardBackground": { + "default": "#fff", + "type": "string", + "maxLength": 100, + "description": "Card background color." + }, + "buttonColor": { + "default": "#fff", + "type": "string", + "maxLength": 100, + "description": "Button foreground color." + }, + "buttonBackground": { + "default": "#0f0f0f", + "type": "string", + "maxLength": 100, + "description": "Button background color." + } + }, + "required": [ + "logo", + "logoSize", + "buttonText", + "message", + "title", + "mainColor", + "mainBackground", + "cardColor", + "cardBackground", + "buttonColor", + "buttonBackground" + ], + "additionalProperties": false, + "description": "Login portal email appearance settings." + }, + "login-portal-page": { + "type": "object", + "properties": { + "title": { + "default": "Scalar Private Docs", + "type": "string", + "maxLength": 100 + }, + "description": { + "default": "Login to access your documentation", + "type": "string", + "maxLength": 500 + }, + "head": { + "default": "", + "type": "string", + "description": "Custom HTML inserted into the page head." + }, + "script": { + "default": "", + "type": "string", + "description": "Custom script content for the page." + }, + "theme": { + "default": "", + "type": "string", + "description": "Theme identifier or theme settings." + }, + "companyName": { + "default": "", + "type": "string", + "maxLength": 100, + "description": "Company name shown on the page." + }, + "logo": { + "default": "", + "type": "string", + "description": "Logo image URL or data URI." + }, + "logoURL": { + "default": "", + "type": "string", + "description": "URL the logo links to." + }, + "favicon": { + "default": "", + "type": "string", + "description": "Favicon URL." + }, + "termsLink": { + "default": "", + "type": "string", + "description": "Terms of service URL." + }, + "privacyLink": { + "default": "", + "type": "string", + "description": "Privacy policy URL." + }, + "formTitle": { + "default": "Scalar Private Docs", + "type": "string", + "maxLength": 100, + "description": "Title shown above the form." + }, + "formDescription": { + "default": "Login to access your documentation", + "type": "string", + "maxLength": 500, + "description": "Description shown above the form." + }, + "formImage": { + "default": "", + "type": "string", + "description": "Image shown with the form." + } + }, + "required": [ + "title", + "description", + "head", + "script", + "theme", + "companyName", + "logo", + "logoURL", + "favicon", + "termsLink", + "privacyLink", + "formTitle", + "formDescription", + "formImage" + ], + "additionalProperties": false, + "description": "Login portal page appearance and content settings." + }, + "login-portal": { + "type": "object", + "properties": { + "uid": { + "$ref": "#/components/schemas/nanoid" + }, + "title": { + "type": "string", + "maxLength": 200 + }, + "slug": { + "$ref": "#/components/schemas/slug" + } + }, + "required": [ + "uid", + "title", + "slug" + ], + "additionalProperties": false, + "description": "Login portal summary." + }, + "rule": { + "type": "object", + "properties": { + "uid": { + "default": "nanoid()", + "$ref": "#/components/schemas/nanoid" + }, + "title": { + "default": "", + "type": "string", + "maxLength": 100 + }, + "description": { + "default": "", + "type": "string" + }, + "slug": { + "default": "randomManagedDocSlug()", + "$ref": "#/components/schemas/slug" + }, + "namespace": { + "$ref": "#/components/schemas/namespace" + }, + "isPrivate": { + "default": false, + "type": "boolean", + "description": "Whether the resource is private." + } + }, + "required": [ + "uid", + "title", + "description", + "slug", + "namespace", + "isPrivate" + ], + "additionalProperties": false, + "description": "Ruleset metadata." + }, + "theme": { + "type": "object", + "properties": { + "uid": { + "$ref": "#/components/schemas/nanoid" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "slug": { + "$ref": "#/components/schemas/slug" + } + }, + "required": [ + "uid", + "name", + "description", + "slug" + ], + "additionalProperties": false, + "description": "Theme metadata." + }, + "team": { + "type": "object", + "properties": { + "uid": { + "$ref": "#/components/schemas/nanoid" + }, + "name": { + "$ref": "#/components/schemas/team-name" + }, + "imageUri": { + "$ref": "#/components/schemas/team-image" + }, + "slug": { + "$ref": "#/components/schemas/slug" + }, + "theme": { + "type": "string", + "description": "Theme identifier or theme settings." + } + }, + "required": [ + "uid", + "name", + "slug", + "theme" + ], + "additionalProperties": false, + "description": "Team metadata." + }, + "team-name": { + "type": "string", + "description": "Team display name." + }, + "team-image": { + "type": "string", + "description": "Team image URL." + }, + "github-project": { + "type": "object", + "properties": { + "uid": { + "default": "nanoid()", + "$ref": "#/components/schemas/nanoid" + }, + "createdAt": { + "default": "unixTimestamp()", + "$ref": "#/components/schemas/timestamp" + }, + "updatedAt": { + "default": "unixTimestamp()", + "$ref": "#/components/schemas/timestamp" + }, + "name": { + "type": "string" + }, + "activeDeployment": { + "default": null, + "anyOf": [ + { + "$ref": "#/components/schemas/active-deployment" + }, + { + "type": "null" + } + ], + "description": "Currently active deployment." + }, + "lastPublished": { + "default": null, + "anyOf": [ + { + "$ref": "#/components/schemas/timestamp" + }, + { + "type": "null" + } + ], + "description": "Timestamp of the most recent publish." + }, + "lastPublishedUid": { + "default": null, + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "UID of the most recent publish." + }, + "loginPortalUid": { + "default": "", + "type": "string", + "description": "Associated login portal UID." + }, + "activeThemeId": { + "default": "", + "type": "string", + "description": "Active theme identifier." + }, + "typesenseId": { + "type": "number", + "description": "Typesense search index identifier." + }, + "isPrivate": { + "default": false, + "type": "boolean", + "description": "Whether the resource is private." + }, + "agentEnabled": { + "default": false, + "type": "boolean", + "description": "Whether the agent experience is enabled." + }, + "accessGroups": { + "default": [], + "description": "Access groups allowed to access the resource." + }, + "slug": { + "$ref": "#/components/schemas/slug" + }, + "publishStatus": { + "default": "", + "type": "string", + "description": "Current publish status." + }, + "publishMessage": { + "default": "", + "type": "string", + "description": "Message describing the latest publish status." + }, + "repository": { + "anyOf": [ + { + "$ref": "#/components/schemas/github-project-repository" + }, + { + "type": "null" + } + ], + "description": "Linked GitHub repository." + } + }, + "required": [ + "uid", + "createdAt", + "updatedAt", + "name", + "activeDeployment", + "lastPublished", + "lastPublishedUid", + "loginPortalUid", + "activeThemeId", + "isPrivate", + "agentEnabled", + "accessGroups", + "slug", + "publishStatus", + "publishMessage" + ], + "additionalProperties": false, + "description": "GitHub-backed project metadata." + }, + "active-deployment": { + "type": "object", + "properties": { + "uid": { + "type": "string", + "description": "Unique identifier for the resource." + }, + "domain": { + "type": "string", + "description": "Published domain." + }, + "publishedAt": { + "$ref": "#/components/schemas/timestamp" + } + }, + "required": [ + "uid", + "domain", + "publishedAt" + ], + "additionalProperties": false, + "description": "Active deployment metadata." + }, + "github-project-repository": { + "type": "object", + "properties": { + "linkedBy": { + "type": "string", + "description": "User or integration that linked the repository." + }, + "id": { + "type": "number", + "description": "Provider-specific identifier." + }, + "name": { + "type": "string", + "minLength": 2 + }, + "configPath": { + "default": "", + "type": "string", + "description": "Path to the Scalar configuration file." + }, + "branch": { + "default": "", + "type": "string", + "description": "Git branch used for publishing." + }, + "publishOnMerge": { + "default": false, + "type": "boolean", + "description": "Whether merges trigger publishing." + }, + "publishPreviews": { + "default": false, + "type": "boolean", + "description": "Whether preview deployments are published." + }, + "prComments": { + "default": false, + "type": "boolean", + "description": "Whether pull request comments are enabled." + }, + "expired": { + "default": false, + "type": "boolean", + "description": "Whether the repository link has expired." + } + }, + "required": [ + "linkedBy", + "id", + "name", + "configPath", + "branch", + "publishOnMerge", + "publishPreviews", + "prComments", + "expired" + ], + "additionalProperties": false, + "description": "Linked GitHub repository settings." + }, + "email": { + "type": "string", + "format": "email", + "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$", + "description": "Email address." + }, + "team-summary": { + "type": "object", + "properties": { + "uid": { + "$ref": "#/components/schemas/nanoid" + }, + "name": { + "$ref": "#/components/schemas/team-name" + }, + "imageUri": { + "$ref": "#/components/schemas/team-image" + } + }, + "required": [ + "uid", + "name" + ], + "additionalProperties": false, + "description": "Team summary." + }, + "user": { + "type": "object", + "properties": { + "uid": { + "default": "nanoid()", + "$ref": "#/components/schemas/nanoid" + }, + "createdAt": { + "default": "unixTimestamp()", + "$ref": "#/components/schemas/timestamp" + }, + "updatedAt": { + "default": "unixTimestamp()", + "$ref": "#/components/schemas/timestamp" + }, + "email": { + "$ref": "#/components/schemas/email" + }, + "theme": { + "type": "string", + "description": "Theme identifier or theme settings." + }, + "activeTeamId": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "description": "Currently active team ID." + }, + "hasGithub": { + "default": false, + "type": "boolean", + "description": "Whether the user has connected GitHub." + }, + "teams": { + "type": "array", + "items": { + "$ref": "#/components/schemas/team-summary" + }, + "description": "Teams available to the user." + } + }, + "required": [ + "uid", + "createdAt", + "updatedAt", + "email", + "activeTeamId", + "hasGithub", + "teams" + ], + "additionalProperties": false, + "description": "Authenticated user profile." + } + } + }, + "security": [ + { + "BearerAuth": [] + } + ], + "paths": { + "/v1/apis": { + "get": { + "tags": [ + "Registry" + ], + "description": "List all API documents across every namespace the caller can access.", + "summary": "List all API Documents", + "operationId": "listAllApiDocuments", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/api-document" + } + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.registry.listAllApiDocuments();\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.registry.listAllApiDocuments();\n\n console.log(result);\n}\n\nmain();" + } + ], + "parameters": [], + "x-scalar-sdk-method": { + "name": "listAllApiDocuments", + "resourcePath": [ + "registry" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + } + }, + "/v1/apis/{namespace}": { + "get": { + "tags": [ + "Registry" + ], + "description": "List API documents in a namespace.", + "summary": "List API Documents", + "operationId": "listApiDocuments", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/api-document" + } + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "Workspace namespace identifier." + }, + "in": "path", + "name": "namespace", + "required": true, + "description": "Workspace namespace that owns the resource." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.registry.listApiDocuments({\n namespace: \"\",\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.registry.listApiDocuments({\n namespace: \"namespace\",\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "listApiDocuments", + "resourcePath": [ + "registry" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + }, + "post": { + "tags": [ + "Registry" + ], + "description": "Create an API document.", + "summary": "Create API Document", + "operationId": "createApiDocument", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "uid": { + "type": "string", + "description": "Unique identifier for the resource." + }, + "versionUid": { + "type": "string", + "description": "UID of the created version." + }, + "title": { + "type": "string" + }, + "jsonSha": { + "type": "string", + "description": "SHA hash of the JSON document." + }, + "yamlSha": { + "type": "string", + "description": "SHA hash of the YAML document." + }, + "versionSha": { + "type": "string", + "description": "SHA hash of the version contents." + } + }, + "required": [ + "uid", + "versionUid", + "title", + "jsonSha", + "yamlSha", + "versionSha" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "version": { + "$ref": "#/components/schemas/version" + }, + "slug": { + "type": "string", + "description": "URL-safe resource slug." + }, + "ruleset": { + "type": "string", + "description": "Ruleset contents." + }, + "isPrivate": { + "type": "boolean", + "description": "Whether the resource is private." + }, + "document": { + "type": "string", + "description": "OpenAPI, schema, theme, or guide document contents." + } + }, + "required": [ + "title", + "version", + "slug", + "document" + ], + "additionalProperties": false + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "Workspace namespace identifier." + }, + "in": "path", + "name": "namespace", + "required": true, + "description": "Workspace namespace that owns the resource." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.registry.createApiDocument({\n namespace: \"\",\n requestBody: {\n title: \"\",\n version: \"\",\n slug: \"\",\n document: \"\",\n },\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.registry.createApiDocument({\n namespace: \"namespace\",\n body: {\n title: \"\",\n version: \"\",\n slug: \"\",\n document: \"\",\n },\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "createApiDocument", + "resourcePath": [ + "registry" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + } + }, + "/v1/apis/{namespace}/{slug}": { + "patch": { + "tags": [ + "Registry" + ], + "description": "Update metadata for an API document.", + "summary": "Update API Document metadata", + "operationId": "updateApiDocument", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "isPrivate": { + "type": "boolean", + "description": "Whether the resource is private." + }, + "ruleset": { + "type": "string", + "description": "Ruleset contents." + } + }, + "additionalProperties": false + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "Workspace namespace identifier." + }, + "in": "path", + "name": "namespace", + "required": true, + "description": "Workspace namespace that owns the resource." + }, + { + "schema": { + "type": "string", + "description": "URL-safe slug identifier." + }, + "in": "path", + "name": "slug", + "required": true, + "description": "URL-safe resource slug." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.registry.updateApiDocument({\n namespace: \"\",\n slug: \"\",\n requestBody: {},\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.registry.updateApiDocument({\n namespace: \"namespace\",\n slug: \"slug\",\n body: {},\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "updateApiDocument", + "resourcePath": [ + "registry" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + }, + "delete": { + "tags": [ + "Registry" + ], + "description": "Delete an API document and all versions.", + "summary": "Delete API Document", + "operationId": "deleteApiDocument", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "Workspace namespace identifier." + }, + "in": "path", + "name": "namespace", + "required": true, + "description": "Workspace namespace that owns the resource." + }, + { + "schema": { + "type": "string", + "description": "URL-safe slug identifier." + }, + "in": "path", + "name": "slug", + "required": true, + "description": "URL-safe resource slug." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.registry.deleteApiDocument({\n namespace: \"\",\n slug: \"\",\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.registry.deleteApiDocument({\n namespace: \"namespace\",\n slug: \"slug\",\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "deleteApiDocument", + "resourcePath": [ + "registry" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + } + }, + "/v1/apis/{namespace}/{slug}/version/{semver}": { + "get": { + "tags": [ + "Registry" + ], + "description": "Get a specific API document version.", + "summary": "Get API Document", + "operationId": "getApiDocumentVersion", + "responses": { + "200": { + "description": "Default Response", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "Workspace namespace identifier." + }, + "in": "path", + "name": "namespace", + "required": true, + "description": "Workspace namespace that owns the resource." + }, + { + "schema": { + "type": "string", + "description": "URL-safe slug identifier." + }, + "in": "path", + "name": "slug", + "required": true, + "description": "URL-safe resource slug." + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "semver", + "required": true, + "description": "Version identifier to operate on." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.registry.getApiDocumentVersion({\n namespace: \"\",\n slug: \"\",\n semver: \"\",\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.registry.retrieveApiDocumentVersion({\n namespace: \"namespace\",\n slug: \"slug\",\n semver: \"semver\",\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "retrieveApiDocumentVersion", + "resourcePath": [ + "registry" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + }, + "patch": { + "tags": [ + "Registry" + ], + "description": "Update the registry file content for an API document version.", + "summary": "Update API Document version", + "operationId": "updateApiDocumentVersion", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "jsonSha": { + "type": "string", + "description": "SHA hash of the JSON document." + }, + "yamlSha": { + "type": "string", + "description": "SHA hash of the YAML document." + }, + "versionSha": { + "type": "string", + "description": "SHA hash of the version contents." + } + }, + "required": [ + "jsonSha", + "yamlSha", + "versionSha" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "document": { + "type": "string", + "description": "OpenAPI, schema, theme, or guide document contents." + }, + "lastKnownVersionSha": { + "type": "string", + "description": "Last known version SHA used for optimistic concurrency." + } + }, + "required": [ + "document" + ], + "additionalProperties": false + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "Workspace namespace identifier." + }, + "in": "path", + "name": "namespace", + "required": true, + "description": "Workspace namespace that owns the resource." + }, + { + "schema": { + "type": "string", + "description": "URL-safe slug identifier." + }, + "in": "path", + "name": "slug", + "required": true, + "description": "URL-safe resource slug." + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "semver", + "required": true, + "description": "Version identifier to operate on." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.registry.updateApiDocumentVersion({\n namespace: \"\",\n slug: \"\",\n semver: \"\",\n requestBody: {\n document: \"\",\n },\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.registry.updateApiDocumentVersion({\n namespace: \"namespace\",\n slug: \"slug\",\n semver: \"semver\",\n body: {\n document: \"\",\n },\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "updateApiDocumentVersion", + "resourcePath": [ + "registry" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + }, + "delete": { + "tags": [ + "Registry" + ], + "description": "Delete a specific API document version.", + "summary": "Delete API Document version", + "operationId": "deleteApiDocumentVersion", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "Workspace namespace identifier." + }, + "in": "path", + "name": "namespace", + "required": true, + "description": "Workspace namespace that owns the resource." + }, + { + "schema": { + "type": "string", + "description": "URL-safe slug identifier." + }, + "in": "path", + "name": "slug", + "required": true, + "description": "URL-safe resource slug." + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "semver", + "required": true, + "description": "Version identifier to operate on." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.registry.deleteApiDocumentVersion({\n namespace: \"\",\n slug: \"\",\n semver: \"\",\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.registry.deleteApiDocumentVersion({\n namespace: \"namespace\",\n slug: \"slug\",\n semver: \"semver\",\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "deleteApiDocumentVersion", + "resourcePath": [ + "registry" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + } + }, + "/v1/apis/{namespace}/{slug}/version/{semver}/metadata": { + "get": { + "tags": [ + "Registry" + ], + "description": "Get metadata (uid, content shas, version sha, tags) for a specific API document version.", + "summary": "Get API Document version metadata", + "operationId": "getApiDocumentVersionMetadata", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/managed-doc-version" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "Workspace namespace identifier." + }, + "in": "path", + "name": "namespace", + "required": true, + "description": "Workspace namespace that owns the resource." + }, + { + "schema": { + "type": "string", + "description": "URL-safe slug identifier." + }, + "in": "path", + "name": "slug", + "required": true, + "description": "URL-safe resource slug." + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "semver", + "required": true, + "description": "Version identifier to operate on." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.registry.getApiDocumentVersionMetadata({\n namespace: \"\",\n slug: \"\",\n semver: \"\",\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.registry.listApiDocumentVersionMetadata({\n namespace: \"namespace\",\n slug: \"slug\",\n semver: \"semver\",\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "listApiDocumentVersionMetadata", + "resourcePath": [ + "registry" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + } + }, + "/v1/apis/{namespace}/{slug}/version": { + "post": { + "tags": [ + "Registry" + ], + "description": "Create a new API document version.", + "summary": "Create API Document version", + "operationId": "createApiDocumentVersion", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/managed-doc-version" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "version": { + "$ref": "#/components/schemas/version" + }, + "document": { + "type": "string", + "description": "OpenAPI, schema, theme, or guide document contents." + }, + "force": { + "type": "boolean", + "description": "Whether to force the operation." + }, + "lastKnownVersionSha": { + "type": "string", + "description": "Last known version SHA used for optimistic concurrency." + } + }, + "required": [ + "version", + "document" + ], + "additionalProperties": false + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "Workspace namespace identifier." + }, + "in": "path", + "name": "namespace", + "required": true, + "description": "Workspace namespace that owns the resource." + }, + { + "schema": { + "type": "string", + "description": "URL-safe slug identifier." + }, + "in": "path", + "name": "slug", + "required": true, + "description": "URL-safe resource slug." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.registry.createApiDocumentVersion({\n namespace: \"\",\n slug: \"\",\n requestBody: {\n version: \"\",\n document: \"\",\n },\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.registry.createApiDocumentVersion({\n namespace: \"namespace\",\n slug: \"slug\",\n body: {\n version: \"\",\n document: \"\",\n },\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "createApiDocumentVersion", + "resourcePath": [ + "registry" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + } + }, + "/v1/apis/{namespace}/{slug}/access-group": { + "post": { + "tags": [ + "Registry" + ], + "description": "Add an access group to an API document.", + "summary": "Add access group", + "operationId": "addApiDocumentAccessGroup", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/access-group" + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "Workspace namespace identifier." + }, + "in": "path", + "name": "namespace", + "required": true, + "description": "Workspace namespace that owns the resource." + }, + { + "schema": { + "type": "string", + "description": "URL-safe slug identifier." + }, + "in": "path", + "name": "slug", + "required": true, + "description": "URL-safe resource slug." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.registry.addApiDocumentAccessGroup({\n namespace: \"\",\n slug: \"\",\n accessGroup: {\n accessGroupSlug: \"\",\n },\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.registry.createApiDocumentAccessGroup({\n namespace: \"namespace\",\n slug: \"slug\",\n body: {\n accessGroupSlug: \"\",\n },\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "createApiDocumentAccessGroup", + "resourcePath": [ + "registry" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + }, + "delete": { + "tags": [ + "Registry" + ], + "description": "Remove an access group from an API document.", + "summary": "Remove access group", + "operationId": "removeApiDocumentAccessGroup", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/access-group" + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "Workspace namespace identifier." + }, + "in": "path", + "name": "namespace", + "required": true, + "description": "Workspace namespace that owns the resource." + }, + { + "schema": { + "type": "string", + "description": "URL-safe slug identifier." + }, + "in": "path", + "name": "slug", + "required": true, + "description": "URL-safe resource slug." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.registry.removeApiDocumentAccessGroup({\n namespace: \"\",\n slug: \"\",\n accessGroup: {\n accessGroupSlug: \"\",\n },\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.registry.deleteApiDocumentAccessGroup({\n namespace: \"namespace\",\n slug: \"slug\",\n body: {\n accessGroupSlug: \"\",\n },\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "deleteApiDocumentAccessGroup", + "resourcePath": [ + "registry" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + } + }, + "/v1/schemas/{namespace}": { + "get": { + "tags": [ + "Schemas" + ], + "description": "List schemas in a namespace.", + "summary": "List all shared components", + "operationId": "listSchemas", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/schema" + } + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "Workspace namespace identifier." + }, + "in": "path", + "name": "namespace", + "required": true, + "description": "Workspace namespace that owns the resource." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.schemas.listSchemas({\n namespace: \"\",\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.schemas.list({\n namespace: \"namespace\",\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "list", + "resourcePath": [ + "schemas" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + }, + "post": { + "tags": [ + "Schemas" + ], + "description": "Create a schema in a namespace.", + "summary": "Create a shared component", + "operationId": "createSchema", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/uid" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "version": { + "$ref": "#/components/schemas/version" + }, + "slug": { + "type": "string", + "description": "URL-safe resource slug." + }, + "isPrivate": { + "type": "boolean", + "description": "Whether the resource is private." + }, + "document": { + "type": "string", + "description": "OpenAPI, schema, theme, or guide document contents." + } + }, + "required": [ + "title", + "version", + "slug", + "document" + ], + "additionalProperties": false + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "Workspace namespace identifier." + }, + "in": "path", + "name": "namespace", + "required": true, + "description": "Workspace namespace that owns the resource." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.schemas.createSchema({\n namespace: \"\",\n requestBody: {\n title: \"\",\n version: \"\",\n slug: \"\",\n document: \"\",\n },\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.schemas.create({\n namespace: \"namespace\",\n body: {\n title: \"\",\n version: \"\",\n slug: \"\",\n document: \"\",\n },\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "create", + "resourcePath": [ + "schemas" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + } + }, + "/v1/schemas/{namespace}/{slug}": { + "patch": { + "tags": [ + "Schemas" + ], + "description": "Update schema metadata.", + "summary": "Update shared component metadata", + "operationId": "updateSchema", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "isPrivate": { + "type": "boolean", + "description": "Whether the resource is private." + } + }, + "additionalProperties": false + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "Workspace namespace identifier." + }, + "in": "path", + "name": "namespace", + "required": true, + "description": "Workspace namespace that owns the resource." + }, + { + "schema": { + "type": "string", + "description": "URL-safe slug identifier." + }, + "in": "path", + "name": "slug", + "required": true, + "description": "URL-safe resource slug." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.schemas.updateSchema({\n namespace: \"\",\n slug: \"\",\n requestBody: {},\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.schemas.update({\n namespace: \"namespace\",\n slug: \"slug\",\n body: {},\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "update", + "resourcePath": [ + "schemas" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + }, + "delete": { + "tags": [ + "Schemas" + ], + "description": "Delete a schema and all related versions.", + "summary": "Delete a shared component", + "operationId": "deleteSchema", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "Workspace namespace identifier." + }, + "in": "path", + "name": "namespace", + "required": true, + "description": "Workspace namespace that owns the resource." + }, + { + "schema": { + "type": "string", + "description": "URL-safe slug identifier." + }, + "in": "path", + "name": "slug", + "required": true, + "description": "URL-safe resource slug." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.schemas.deleteSchema({\n namespace: \"\",\n slug: \"\",\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.schemas.delete({\n namespace: \"namespace\",\n slug: \"slug\",\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "delete", + "resourcePath": [ + "schemas" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + } + }, + "/v1/schemas/{namespace}/{slug}/version/{semver}": { + "get": { + "tags": [ + "Schemas" + ], + "description": "Get a specific schema version document.", + "summary": "Get a shared component document", + "operationId": "getSchemaVersion", + "responses": { + "200": { + "description": "Default Response", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "Workspace namespace identifier." + }, + "in": "path", + "name": "namespace", + "required": true, + "description": "Workspace namespace that owns the resource." + }, + { + "schema": { + "type": "string", + "description": "URL-safe slug identifier." + }, + "in": "path", + "name": "slug", + "required": true, + "description": "URL-safe resource slug." + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "semver", + "required": true, + "description": "Version identifier to operate on." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.schemas.getSchemaVersion({\n namespace: \"\",\n slug: \"\",\n semver: \"\",\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.schemas.retrieveVersion({\n namespace: \"namespace\",\n slug: \"slug\",\n semver: \"semver\",\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "retrieveVersion", + "resourcePath": [ + "schemas" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + }, + "delete": { + "tags": [ + "Schemas" + ], + "description": "Delete a schema version.", + "summary": "Delete a shared component version", + "operationId": "deleteSchemaVersion", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "Workspace namespace identifier." + }, + "in": "path", + "name": "namespace", + "required": true, + "description": "Workspace namespace that owns the resource." + }, + { + "schema": { + "type": "string", + "description": "URL-safe slug identifier." + }, + "in": "path", + "name": "slug", + "required": true, + "description": "URL-safe resource slug." + }, + { + "schema": { + "type": "string" + }, + "in": "path", + "name": "semver", + "required": true, + "description": "Version identifier to operate on." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.schemas.deleteSchemaVersion({\n namespace: \"\",\n slug: \"\",\n semver: \"\",\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.schemas.deleteVersion({\n namespace: \"namespace\",\n slug: \"slug\",\n semver: \"semver\",\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "deleteVersion", + "resourcePath": [ + "schemas" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + } + }, + "/v1/schemas/{namespace}/{slug}/version": { + "post": { + "tags": [ + "Schemas" + ], + "description": "Create a schema version.", + "summary": "Create a shared component version", + "operationId": "createSchemaVersion", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/uid" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "version": { + "$ref": "#/components/schemas/version" + }, + "document": { + "type": "string", + "description": "OpenAPI, schema, theme, or guide document contents." + } + }, + "required": [ + "version", + "document" + ], + "additionalProperties": false + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "Workspace namespace identifier." + }, + "in": "path", + "name": "namespace", + "required": true, + "description": "Workspace namespace that owns the resource." + }, + { + "schema": { + "type": "string", + "description": "URL-safe slug identifier." + }, + "in": "path", + "name": "slug", + "required": true, + "description": "URL-safe resource slug." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.schemas.createSchemaVersion({\n namespace: \"\",\n slug: \"\",\n requestBody: {\n version: \"\",\n document: \"\",\n },\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.schemas.createVersion({\n namespace: \"namespace\",\n slug: \"slug\",\n body: {\n version: \"\",\n document: \"\",\n },\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "createVersion", + "resourcePath": [ + "schemas" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + } + }, + "/v1/schemas/{namespace}/{slug}/access-group": { + "post": { + "tags": [ + "Schemas" + ], + "description": "Add an access group to a schema.", + "summary": "Add shared component access group", + "operationId": "addSchemaAccessGroup", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/access-group" + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "Workspace namespace identifier." + }, + "in": "path", + "name": "namespace", + "required": true, + "description": "Workspace namespace that owns the resource." + }, + { + "schema": { + "type": "string", + "description": "URL-safe slug identifier." + }, + "in": "path", + "name": "slug", + "required": true, + "description": "URL-safe resource slug." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.schemas.addSchemaAccessGroup({\n namespace: \"\",\n slug: \"\",\n accessGroup: {\n accessGroupSlug: \"\",\n },\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.schemas.createAccessGroup({\n namespace: \"namespace\",\n slug: \"slug\",\n body: {\n accessGroupSlug: \"\",\n },\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "createAccessGroup", + "resourcePath": [ + "schemas" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + }, + "delete": { + "tags": [ + "Schemas" + ], + "description": "Remove an access group from a schema.", + "summary": "Remove shared component access group", + "operationId": "removeSchemaAccessGroup", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/access-group" + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "Workspace namespace identifier." + }, + "in": "path", + "name": "namespace", + "required": true, + "description": "Workspace namespace that owns the resource." + }, + { + "schema": { + "type": "string", + "description": "URL-safe slug identifier." + }, + "in": "path", + "name": "slug", + "required": true, + "description": "URL-safe resource slug." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.schemas.removeSchemaAccessGroup({\n namespace: \"\",\n slug: \"\",\n accessGroup: {\n accessGroupSlug: \"\",\n },\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.schemas.deleteAccessGroup({\n namespace: \"namespace\",\n slug: \"slug\",\n body: {\n accessGroupSlug: \"\",\n },\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "deleteAccessGroup", + "resourcePath": [ + "schemas" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + } + }, + "/v1/login-portals/{slug}": { + "get": { + "tags": [ + "Login Portals" + ], + "description": "Get a login portal by slug.", + "summary": "Get a login portal", + "operationId": "getLoginPortal", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "uid": { + "type": "string", + "description": "Unique identifier for the resource." + }, + "title": { + "type": "string" + }, + "slug": { + "type": "string", + "description": "URL-safe resource slug." + }, + "email": { + "$ref": "#/components/schemas/login-portal-email" + }, + "page": { + "$ref": "#/components/schemas/login-portal-page" + } + }, + "required": [ + "uid", + "title", + "slug", + "email", + "page" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "URL-safe slug identifier." + }, + "in": "path", + "name": "slug", + "required": true, + "description": "URL-safe resource slug." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.loginPortals.getLoginPortal({\n slug: \"\",\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.loginPortals.loginPortals({\n slug: \"slug\",\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "loginPortals", + "resourcePath": [ + "loginPortals" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + }, + "patch": { + "tags": [ + "Login Portals" + ], + "description": "Update metadata for a login portal.", + "summary": "Update portal metadata", + "operationId": "updateLoginPortal", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "title": { + "type": "string" + } + }, + "additionalProperties": false + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "URL-safe slug identifier." + }, + "in": "path", + "name": "slug", + "required": true, + "description": "URL-safe resource slug." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.loginPortals.updateLoginPortal({\n slug: \"\",\n requestBody: {},\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.loginPortals.loginPortals2({\n slug: \"slug\",\n body: {},\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "loginPortals2", + "resourcePath": [ + "loginPortals" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + }, + "delete": { + "tags": [ + "Login Portals" + ], + "description": "Delete a login portal.", + "summary": "Delete a login portal", + "operationId": "deleteLoginPortal", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "URL-safe slug identifier." + }, + "in": "path", + "name": "slug", + "required": true, + "description": "URL-safe resource slug." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.loginPortals.deleteLoginPortal({\n slug: \"\",\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.loginPortals.loginPortals3({\n slug: \"slug\",\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "loginPortals3", + "resourcePath": [ + "loginPortals" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + } + }, + "/v1/login-portals": { + "post": { + "tags": [ + "Login Portals" + ], + "description": "Create a login portal for the current team.", + "summary": "Create a portal", + "operationId": "createLoginPortal", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/uid" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "slug": { + "type": "string", + "description": "URL-safe resource slug." + }, + "email": { + "$ref": "#/components/schemas/login-portal-email" + }, + "page": { + "$ref": "#/components/schemas/login-portal-page" + } + }, + "required": [ + "title", + "slug", + "email", + "page" + ], + "additionalProperties": false + } + } + }, + "required": true + }, + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.loginPortals.createLoginPortal({\n title: \"\",\n slug: \"\",\n email: {},\n page: {},\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.loginPortals.loginPortals4({\n body: {\n title: \"\",\n slug: \"\",\n email: {\n logo: \"\",\n logoSize: \"100\",\n buttonText: \"Login\",\n message: \"Click to access private documentation hosted by scalar.com\",\n title: \"Private Docs\",\n mainColor: \"#2a2f45\",\n mainBackground: \"#f6f6f6\",\n cardColor: \"2a2f45\",\n cardBackground: \"#fff\",\n buttonColor: \"#fff\",\n buttonBackground: \"#0f0f0f\",\n },\n page: {\n title: \"Scalar Private Docs\",\n description: \"Login to access your documentation\",\n head: \"\",\n script: \"\",\n theme: \"\",\n companyName: \"\",\n logo: \"\",\n logoUrl: \"\",\n favicon: \"\",\n termsLink: \"\",\n privacyLink: \"\",\n formTitle: \"Scalar Private Docs\",\n formDescription: \"Login to access your documentation\",\n formImage: \"\",\n },\n },\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "parameters": [], + "x-scalar-sdk-method": { + "name": "loginPortals4", + "resourcePath": [ + "loginPortals" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + }, + "get": { + "tags": [ + "Login Portals" + ], + "description": "List all login portals for the current team.", + "summary": "List all portals", + "operationId": "listLoginPortals", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/login-portal" + } + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.loginPortals.listLoginPortals();\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.loginPortals.loginPortals5();\n\n console.log(result);\n}\n\nmain();" + } + ], + "parameters": [], + "x-scalar-sdk-method": { + "name": "loginPortals5", + "resourcePath": [ + "loginPortals" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + } + }, + "/v1/rulesets/{namespace}": { + "get": { + "tags": [ + "Rules" + ], + "description": "List all rulesets in a namespace.", + "summary": "List all rules", + "operationId": "listRulesets", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/rule" + } + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "Workspace namespace identifier." + }, + "in": "path", + "name": "namespace", + "required": true, + "description": "Workspace namespace that owns the resource." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.rules.listRulesets({\n namespace: \"\",\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.rules.listRulesets({\n namespace: \"namespace\",\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "listRulesets", + "resourcePath": [ + "rules" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + }, + "post": { + "tags": [ + "Rules" + ], + "description": "Create a rule in a namespace.", + "summary": "Create a rule", + "operationId": "createRuleset", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/uid" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "slug": { + "type": "string", + "description": "URL-safe resource slug." + }, + "isPrivate": { + "type": "boolean", + "description": "Whether the resource is private." + }, + "document": { + "type": "string", + "description": "OpenAPI, schema, theme, or guide document contents." + } + }, + "required": [ + "title", + "slug", + "document" + ], + "additionalProperties": false + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "Workspace namespace identifier." + }, + "in": "path", + "name": "namespace", + "required": true, + "description": "Workspace namespace that owns the resource." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.rules.createRuleset({\n namespace: \"\",\n requestBody: {\n title: \"\",\n slug: \"\",\n document: \"\",\n },\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.rules.createRuleset({\n namespace: \"namespace\",\n body: {\n title: \"\",\n slug: \"\",\n document: \"\",\n },\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "createRuleset", + "resourcePath": [ + "rules" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + } + }, + "/v1/rulesets/{namespace}/{slug}": { + "patch": { + "tags": [ + "Rules" + ], + "description": "Update rule metadata by slug.", + "summary": "Update rule metadata", + "operationId": "updateRuleset", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "namespace": { + "type": "string", + "description": "Workspace namespace that owns the resource." + }, + "slug": { + "type": "string", + "description": "URL-safe resource slug." + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "isPrivate": { + "type": "boolean", + "description": "Whether the resource is private." + } + }, + "additionalProperties": false + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "Workspace namespace identifier." + }, + "in": "path", + "name": "namespace", + "required": true, + "description": "Workspace namespace that owns the resource." + }, + { + "schema": { + "type": "string", + "description": "URL-safe slug identifier." + }, + "in": "path", + "name": "slug", + "required": true, + "description": "URL-safe resource slug." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.rules.updateRuleset({\n namespace: \"\",\n slug: \"\",\n requestBody: {},\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.rules.updateRuleset({\n namespace: \"namespace\",\n slug: \"slug\",\n body: {},\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "updateRuleset", + "resourcePath": [ + "rules" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + }, + "delete": { + "tags": [ + "Rules" + ], + "description": "Delete a rule by slug.", + "summary": "Delete a rule", + "operationId": "deleteRuleset", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "Workspace namespace identifier." + }, + "in": "path", + "name": "namespace", + "required": true, + "description": "Workspace namespace that owns the resource." + }, + { + "schema": { + "type": "string", + "description": "URL-safe slug identifier." + }, + "in": "path", + "name": "slug", + "required": true, + "description": "URL-safe resource slug." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.rules.deleteRuleset({\n namespace: \"\",\n slug: \"\",\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.rules.deleteRuleset({\n namespace: \"namespace\",\n slug: \"slug\",\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "deleteRuleset", + "resourcePath": [ + "rules" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + }, + "get": { + "tags": [ + "Rules" + ], + "description": "Get a rule document by slug.", + "summary": "Get a rule", + "operationId": "getRulesetDocument", + "responses": { + "200": { + "description": "Default Response", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "Workspace namespace identifier." + }, + "in": "path", + "name": "namespace", + "required": true, + "description": "Workspace namespace that owns the resource." + }, + { + "schema": { + "type": "string", + "description": "URL-safe slug identifier." + }, + "in": "path", + "name": "slug", + "required": true, + "description": "URL-safe resource slug." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.rules.getRulesetDocument({\n namespace: \"\",\n slug: \"\",\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.rules.retrieveRulesetDocument({\n namespace: \"namespace\",\n slug: \"slug\",\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "retrieveRulesetDocument", + "resourcePath": [ + "rules" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + } + }, + "/v1/rulesets/{namespace}/{slug}/access-group": { + "post": { + "tags": [ + "Rules" + ], + "description": "Grant an access group to a rule.", + "summary": "Add rule access group", + "operationId": "addRulesetAccessGroup", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/access-group" + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "Workspace namespace identifier." + }, + "in": "path", + "name": "namespace", + "required": true, + "description": "Workspace namespace that owns the resource." + }, + { + "schema": { + "type": "string", + "description": "URL-safe slug identifier." + }, + "in": "path", + "name": "slug", + "required": true, + "description": "URL-safe resource slug." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.rules.addRulesetAccessGroup({\n namespace: \"\",\n slug: \"\",\n accessGroup: {\n accessGroupSlug: \"\",\n },\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.rules.createRulesetAccessGroup({\n namespace: \"namespace\",\n slug: \"slug\",\n body: {\n accessGroupSlug: \"\",\n },\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "createRulesetAccessGroup", + "resourcePath": [ + "rules" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + }, + "delete": { + "tags": [ + "Rules" + ], + "description": "Remove an access group from a rule.", + "summary": "Remove rule access group", + "operationId": "removeRulesetAccessGroup", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/access-group" + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "Workspace namespace identifier." + }, + "in": "path", + "name": "namespace", + "required": true, + "description": "Workspace namespace that owns the resource." + }, + { + "schema": { + "type": "string", + "description": "URL-safe slug identifier." + }, + "in": "path", + "name": "slug", + "required": true, + "description": "URL-safe resource slug." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.rules.removeRulesetAccessGroup({\n namespace: \"\",\n slug: \"\",\n accessGroup: {\n accessGroupSlug: \"\",\n },\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.rules.deleteRulesetAccessGroup({\n namespace: \"namespace\",\n slug: \"slug\",\n body: {\n accessGroupSlug: \"\",\n },\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "deleteRulesetAccessGroup", + "resourcePath": [ + "rules" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + } + }, + "/v1/themes": { + "get": { + "tags": [ + "Themes" + ], + "description": "List all team themes.", + "summary": "List all themes", + "operationId": "listThemes", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/theme" + } + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.themes.listThemes();\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.themes.list();\n\n console.log(result);\n}\n\nmain();" + } + ], + "parameters": [], + "x-scalar-sdk-method": { + "name": "list", + "resourcePath": [ + "themes" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + }, + "post": { + "tags": [ + "Themes" + ], + "description": "Create a team theme.", + "summary": "Create a theme", + "operationId": "createTheme", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/uid" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "slug": { + "type": "string", + "description": "URL-safe resource slug." + }, + "document": { + "type": "string", + "description": "OpenAPI, schema, theme, or guide document contents." + } + }, + "required": [ + "name", + "slug", + "document" + ], + "additionalProperties": false + } + } + }, + "required": true + }, + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.themes.createTheme({\n name: \"\",\n slug: \"\",\n document: \"\",\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.themes.create({\n body: {\n name: \"\",\n slug: \"\",\n document: \"\",\n },\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "parameters": [], + "x-scalar-sdk-method": { + "name": "create", + "resourcePath": [ + "themes" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + } + }, + "/v1/themes/{slug}": { + "patch": { + "tags": [ + "Themes" + ], + "description": "Update theme metadata.", + "summary": "Update theme metadata", + "operationId": "updateTheme", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + } + }, + "additionalProperties": false + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "URL-safe slug identifier." + }, + "in": "path", + "name": "slug", + "required": true, + "description": "URL-safe resource slug." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.themes.updateTheme({\n slug: \"\",\n requestBody: {},\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.themes.update({\n slug: \"slug\",\n body: {},\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "update", + "resourcePath": [ + "themes" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + }, + "put": { + "tags": [ + "Themes" + ], + "description": "Replace the theme document.", + "summary": "Update theme document", + "operationId": "replaceThemeDocument", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "document": { + "type": "string", + "description": "OpenAPI, schema, theme, or guide document contents." + } + }, + "required": [ + "document" + ], + "additionalProperties": false + } + } + }, + "required": true + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "URL-safe slug identifier." + }, + "in": "path", + "name": "slug", + "required": true, + "description": "URL-safe resource slug." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.themes.replaceThemeDocument({\n slug: \"\",\n requestBody: {\n document: \"\",\n },\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.themes.replaceDocument({\n slug: \"slug\",\n body: {\n document: \"\",\n },\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "replaceDocument", + "resourcePath": [ + "themes" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + }, + "delete": { + "tags": [ + "Themes" + ], + "description": "Delete a theme by slug.", + "summary": "Delete a theme", + "operationId": "deleteTheme", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "null" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "URL-safe slug identifier." + }, + "in": "path", + "name": "slug", + "required": true, + "description": "URL-safe resource slug." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.themes.deleteTheme({\n slug: \"\",\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.themes.delete({\n slug: \"slug\",\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "delete", + "resourcePath": [ + "themes" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + }, + "get": { + "tags": [ + "Themes" + ], + "description": "Get the theme document by slug.", + "summary": "Get a theme", + "operationId": "getTheme", + "responses": { + "200": { + "description": "Default Response", + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "URL-safe slug identifier." + }, + "in": "path", + "name": "slug", + "required": true, + "description": "URL-safe resource slug." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.themes.getTheme({\n slug: \"\",\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.themes.retrieve({\n slug: \"slug\",\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "retrieve", + "resourcePath": [ + "themes" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + } + }, + "/v1/teams": { + "get": { + "tags": [ + "Teams" + ], + "description": "List all available teams", + "summary": "List teams", + "operationId": "listTeams", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/team" + } + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.teams.listTeams();\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.teams.list();\n\n console.log(result);\n}\n\nmain();" + } + ], + "parameters": [], + "x-scalar-sdk-method": { + "name": "list", + "resourcePath": [ + "teams" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + } + }, + "/v1/guides": { + "get": { + "tags": [ + "Scalar Docs" + ], + "description": "List all guide projects.", + "summary": "List all projects", + "operationId": "listGuides", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/github-project" + } + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.scalarDocs.listGuides();\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.scalarDocs.listGuides();\n\n console.log(result);\n}\n\nmain();" + } + ], + "parameters": [], + "x-scalar-sdk-method": { + "name": "listGuides", + "resourcePath": [ + "scalarDocs" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + }, + "post": { + "tags": [ + "Scalar Docs" + ], + "description": "Create a guide project.", + "summary": "Create a project", + "operationId": "createGuide", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "uid": { + "type": "string", + "description": "Unique identifier for the resource." + }, + "slug": { + "type": "string", + "description": "URL-safe resource slug." + } + }, + "required": [ + "uid", + "slug" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "slug": { + "$ref": "#/components/schemas/slug" + }, + "isPrivate": { + "default": false, + "type": "boolean", + "description": "Whether the resource is private." + }, + "allowedUsers": { + "default": [], + "type": "array", + "items": { + "type": "string" + }, + "description": "Email addresses allowed to access the guide." + }, + "allowedDomains": { + "default": [], + "type": "array", + "items": { + "type": "string" + }, + "description": "Email domains allowed to access the guide." + } + }, + "required": [ + "name", + "isPrivate", + "allowedUsers", + "allowedDomains" + ], + "additionalProperties": false + } + } + }, + "required": true + }, + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.scalarDocs.createGuide({\n name: \"\",\n allowedUsers: [\n \"\",\n ],\n allowedDomains: [],\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.scalarDocs.createGuide({\n body: {\n name: \"\",\n isPrivate: false,\n allowedUsers: [],\n allowedDomains: [],\n },\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "parameters": [], + "x-scalar-sdk-method": { + "name": "createGuide", + "resourcePath": [ + "scalarDocs" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + } + }, + "/v1/guides/{slug}/publish": { + "post": { + "tags": [ + "Scalar Docs" + ], + "description": "Start a new publish process.", + "summary": "Publish a project", + "operationId": "publishGuide", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "publishUid": { + "type": "string", + "description": "UID of the publish job or deployment." + } + }, + "required": [ + "publishUid" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "parameters": [ + { + "schema": { + "type": "string", + "description": "URL-safe slug identifier." + }, + "in": "path", + "name": "slug", + "required": true, + "description": "URL-safe resource slug." + } + ], + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.scalarDocs.publishGuide({\n slug: \"\",\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.scalarDocs.publishGuide({\n slug: \"slug\",\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "x-scalar-sdk-method": { + "name": "publishGuide", + "resourcePath": [ + "scalarDocs" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + } + }, + "/v1/namespaces": { + "get": { + "tags": [ + "Namespaces" + ], + "description": "Get all namespaces for the current team", + "summary": "List namespaces", + "operationId": "listNamespaces", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.namespaces.listNamespaces();\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.namespaces.list();\n\n console.log(result);\n}\n\nmain();" + } + ], + "parameters": [], + "x-scalar-sdk-method": { + "name": "list", + "resourcePath": [ + "namespaces" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + } + }, + "/v1/auth/exchange": { + "post": { + "tags": [ + "Authentication" + ], + "description": "Exchange an API key for an access token.", + "summary": "Exchange token", + "operationId": "exchangePersonalToken", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "accessToken": { + "type": "string", + "description": "Bearer access token." + } + }, + "required": [ + "accessToken" + ], + "additionalProperties": false + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "security": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "personalToken": { + "type": "string", + "description": "Personal access token to exchange." + } + }, + "required": [ + "personalToken" + ], + "additionalProperties": false + } + } + }, + "required": true + }, + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar();\n\nasync function run() {\n const result = await scalar.authentication.exchangePersonalToken({\n personalToken: \"\",\n });\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.authentication.exchangePersonalToken({\n body: {\n personalToken: \"\",\n },\n });\n\n console.log(result);\n}\n\nmain();" + } + ], + "parameters": [], + "x-scalar-sdk-method": { + "name": "exchangePersonalToken", + "resourcePath": [ + "authentication" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + } + }, + "/v1/auth/me": { + "get": { + "tags": [ + "Authentication" + ], + "description": "Get the authenticated user, including their available teams and theme.", + "summary": "Get current user", + "operationId": "getCurrentUser", + "responses": { + "200": { + "description": "Default Response", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/user" + } + } + } + }, + "400": { + "description": "Bad request", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/400" + } + } + } + }, + "401": { + "description": "No auth", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/401" + } + } + } + }, + "403": { + "description": "Forbidden", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/403" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/404" + } + } + } + }, + "422": { + "description": "Invalid payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/422" + } + } + } + }, + "500": { + "description": "Uncaught error", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/500" + } + } + } + } + }, + "x-codeSamples": [ + { + "label": "typescript", + "lang": "typescript", + "source": "import { Scalar } from \"@scalar/sdk\";\n\nconst scalar = new Scalar({\n bearerAuth: \"\",\n});\n\nasync function run() {\n const result = await scalar.authentication.getCurrentUser();\n\n console.log(result);\n}\n\nrun();" + }, + { + "lang": "TypeScript", + "label": "Node", + "source": "import Scalar from \"@scalar/sdk\";\n\nconst client = new Scalar({\n bearer_auth: process.env[\"BEARER_AUTH\"], // defaults to the BEARER_AUTH env var\n});\n\nasync function main() {\n const result = await client.authentication.listCurrentUser();\n\n console.log(result);\n}\n\nmain();" + } + ], + "parameters": [], + "x-scalar-sdk-method": { + "name": "listCurrentUser", + "resourcePath": [ + "authentication" + ], + "runtime": { + "defaultRequestOptions": { + "headers": {} + } + } + }, + "x-scalar-pagination": null + } + } + }, + "x-ext-urls": {}, + "x-original-oas-version": "3.1.1", + "x-scalar-original-document-hash": "3e459b64add5ed4b", + "x-scalar-original-source-url": "test-fixtures/documents/scalar-api.json", + "x-scalar-order": [ + "api/description/introduction", + "api/tag/registry", + "api/tag/schemas", + "api/tag/login-portals", + "api/tag/rules", + "api/tag/themes", + "api/tag/teams", + "api/tag/scalar-docs", + "api/tag/namespaces", + "api/tag/authentication", + "api/models" + ], + "x-scalar-navigation": { + "id": "api", + "type": "document", + "title": "Scalar API", + "name": "api", + "children": [ + { + "id": "api/description/introduction", + "title": "Introduction", + "type": "text" + }, + { + "id": "api/tag/registry", + "title": "Registry", + "name": "Registry", + "description": "Registry", + "children": [ + { + "id": "api/tag/registry/GET/v1/apis", + "title": "List all API Documents", + "path": "/v1/apis", + "method": "get", + "ref": "#/paths/~1v1~1apis/get", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/registry/GET/v1/apis/{namespace}", + "title": "List API Documents", + "path": "/v1/apis/{namespace}", + "method": "get", + "ref": "#/paths/~1v1~1apis~1{namespace}/get", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/registry/POST/v1/apis/{namespace}", + "title": "Create API Document", + "path": "/v1/apis/{namespace}", + "method": "post", + "ref": "#/paths/~1v1~1apis~1{namespace}/post", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/registry/PATCH/v1/apis/{namespace}/{slug}", + "title": "Update API Document metadata", + "path": "/v1/apis/{namespace}/{slug}", + "method": "patch", + "ref": "#/paths/~1v1~1apis~1{namespace}~1{slug}/patch", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/registry/DELETE/v1/apis/{namespace}/{slug}", + "title": "Delete API Document", + "path": "/v1/apis/{namespace}/{slug}", + "method": "delete", + "ref": "#/paths/~1v1~1apis~1{namespace}~1{slug}/delete", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/registry/GET/v1/apis/{namespace}/{slug}/version/{semver}", + "title": "Get API Document", + "path": "/v1/apis/{namespace}/{slug}/version/{semver}", + "method": "get", + "ref": "#/paths/~1v1~1apis~1{namespace}~1{slug}~1version~1{semver}/get", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/registry/PATCH/v1/apis/{namespace}/{slug}/version/{semver}", + "title": "Update API Document version", + "path": "/v1/apis/{namespace}/{slug}/version/{semver}", + "method": "patch", + "ref": "#/paths/~1v1~1apis~1{namespace}~1{slug}~1version~1{semver}/patch", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/registry/DELETE/v1/apis/{namespace}/{slug}/version/{semver}", + "title": "Delete API Document version", + "path": "/v1/apis/{namespace}/{slug}/version/{semver}", + "method": "delete", + "ref": "#/paths/~1v1~1apis~1{namespace}~1{slug}~1version~1{semver}/delete", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/registry/GET/v1/apis/{namespace}/{slug}/version/{semver}/metadata", + "title": "Get API Document version metadata", + "path": "/v1/apis/{namespace}/{slug}/version/{semver}/metadata", + "method": "get", + "ref": "#/paths/~1v1~1apis~1{namespace}~1{slug}~1version~1{semver}~1metadata/get", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/registry/POST/v1/apis/{namespace}/{slug}/version", + "title": "Create API Document version", + "path": "/v1/apis/{namespace}/{slug}/version", + "method": "post", + "ref": "#/paths/~1v1~1apis~1{namespace}~1{slug}~1version/post", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/registry/POST/v1/apis/{namespace}/{slug}/access-group", + "title": "Add access group", + "path": "/v1/apis/{namespace}/{slug}/access-group", + "method": "post", + "ref": "#/paths/~1v1~1apis~1{namespace}~1{slug}~1access-group/post", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/registry/DELETE/v1/apis/{namespace}/{slug}/access-group", + "title": "Remove access group", + "path": "/v1/apis/{namespace}/{slug}/access-group", + "method": "delete", + "ref": "#/paths/~1v1~1apis~1{namespace}~1{slug}~1access-group/delete", + "type": "operation", + "isDeprecated": false + } + ], + "isGroup": false, + "isWebhooks": false, + "type": "tag", + "xKeys": { + "x-scalar-order": [ + "api/tag/registry/GET/v1/apis", + "api/tag/registry/GET/v1/apis/{namespace}", + "api/tag/registry/POST/v1/apis/{namespace}", + "api/tag/registry/PATCH/v1/apis/{namespace}/{slug}", + "api/tag/registry/DELETE/v1/apis/{namespace}/{slug}", + "api/tag/registry/GET/v1/apis/{namespace}/{slug}/version/{semver}", + "api/tag/registry/PATCH/v1/apis/{namespace}/{slug}/version/{semver}", + "api/tag/registry/DELETE/v1/apis/{namespace}/{slug}/version/{semver}", + "api/tag/registry/GET/v1/apis/{namespace}/{slug}/version/{semver}/metadata", + "api/tag/registry/POST/v1/apis/{namespace}/{slug}/version", + "api/tag/registry/POST/v1/apis/{namespace}/{slug}/access-group", + "api/tag/registry/DELETE/v1/apis/{namespace}/{slug}/access-group" + ] + } + }, + { + "id": "api/tag/schemas", + "title": "Schemas", + "name": "Schemas", + "description": "Schemas", + "children": [ + { + "id": "api/tag/schemas/GET/v1/schemas/{namespace}", + "title": "List all shared components", + "path": "/v1/schemas/{namespace}", + "method": "get", + "ref": "#/paths/~1v1~1schemas~1{namespace}/get", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/schemas/POST/v1/schemas/{namespace}", + "title": "Create a shared component", + "path": "/v1/schemas/{namespace}", + "method": "post", + "ref": "#/paths/~1v1~1schemas~1{namespace}/post", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/schemas/PATCH/v1/schemas/{namespace}/{slug}", + "title": "Update shared component metadata", + "path": "/v1/schemas/{namespace}/{slug}", + "method": "patch", + "ref": "#/paths/~1v1~1schemas~1{namespace}~1{slug}/patch", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/schemas/DELETE/v1/schemas/{namespace}/{slug}", + "title": "Delete a shared component", + "path": "/v1/schemas/{namespace}/{slug}", + "method": "delete", + "ref": "#/paths/~1v1~1schemas~1{namespace}~1{slug}/delete", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/schemas/GET/v1/schemas/{namespace}/{slug}/version/{semver}", + "title": "Get a shared component document", + "path": "/v1/schemas/{namespace}/{slug}/version/{semver}", + "method": "get", + "ref": "#/paths/~1v1~1schemas~1{namespace}~1{slug}~1version~1{semver}/get", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/schemas/DELETE/v1/schemas/{namespace}/{slug}/version/{semver}", + "title": "Delete a shared component version", + "path": "/v1/schemas/{namespace}/{slug}/version/{semver}", + "method": "delete", + "ref": "#/paths/~1v1~1schemas~1{namespace}~1{slug}~1version~1{semver}/delete", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/schemas/POST/v1/schemas/{namespace}/{slug}/version", + "title": "Create a shared component version", + "path": "/v1/schemas/{namespace}/{slug}/version", + "method": "post", + "ref": "#/paths/~1v1~1schemas~1{namespace}~1{slug}~1version/post", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/schemas/POST/v1/schemas/{namespace}/{slug}/access-group", + "title": "Add shared component access group", + "path": "/v1/schemas/{namespace}/{slug}/access-group", + "method": "post", + "ref": "#/paths/~1v1~1schemas~1{namespace}~1{slug}~1access-group/post", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/schemas/DELETE/v1/schemas/{namespace}/{slug}/access-group", + "title": "Remove shared component access group", + "path": "/v1/schemas/{namespace}/{slug}/access-group", + "method": "delete", + "ref": "#/paths/~1v1~1schemas~1{namespace}~1{slug}~1access-group/delete", + "type": "operation", + "isDeprecated": false + } + ], + "isGroup": false, + "isWebhooks": false, + "type": "tag", + "xKeys": { + "x-scalar-order": [ + "api/tag/schemas/GET/v1/schemas/{namespace}", + "api/tag/schemas/POST/v1/schemas/{namespace}", + "api/tag/schemas/PATCH/v1/schemas/{namespace}/{slug}", + "api/tag/schemas/DELETE/v1/schemas/{namespace}/{slug}", + "api/tag/schemas/GET/v1/schemas/{namespace}/{slug}/version/{semver}", + "api/tag/schemas/DELETE/v1/schemas/{namespace}/{slug}/version/{semver}", + "api/tag/schemas/POST/v1/schemas/{namespace}/{slug}/version", + "api/tag/schemas/POST/v1/schemas/{namespace}/{slug}/access-group", + "api/tag/schemas/DELETE/v1/schemas/{namespace}/{slug}/access-group" + ] + } + }, + { + "id": "api/tag/login-portals", + "title": "Login Portals", + "name": "Login Portals", + "description": "Login Portals", + "children": [ + { + "id": "api/tag/login-portals/GET/v1/login-portals/{slug}", + "title": "Get a login portal", + "path": "/v1/login-portals/{slug}", + "method": "get", + "ref": "#/paths/~1v1~1login-portals~1{slug}/get", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/login-portals/PATCH/v1/login-portals/{slug}", + "title": "Update portal metadata", + "path": "/v1/login-portals/{slug}", + "method": "patch", + "ref": "#/paths/~1v1~1login-portals~1{slug}/patch", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/login-portals/DELETE/v1/login-portals/{slug}", + "title": "Delete a login portal", + "path": "/v1/login-portals/{slug}", + "method": "delete", + "ref": "#/paths/~1v1~1login-portals~1{slug}/delete", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/login-portals/POST/v1/login-portals", + "title": "Create a portal", + "path": "/v1/login-portals", + "method": "post", + "ref": "#/paths/~1v1~1login-portals/post", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/login-portals/GET/v1/login-portals", + "title": "List all portals", + "path": "/v1/login-portals", + "method": "get", + "ref": "#/paths/~1v1~1login-portals/get", + "type": "operation", + "isDeprecated": false + } + ], + "isGroup": false, + "isWebhooks": false, + "type": "tag", + "xKeys": { + "x-scalar-order": [ + "api/tag/login-portals/GET/v1/login-portals/{slug}", + "api/tag/login-portals/PATCH/v1/login-portals/{slug}", + "api/tag/login-portals/DELETE/v1/login-portals/{slug}", + "api/tag/login-portals/POST/v1/login-portals", + "api/tag/login-portals/GET/v1/login-portals" + ] + } + }, + { + "id": "api/tag/rules", + "title": "Rules", + "name": "Rules", + "description": "Rules", + "children": [ + { + "id": "api/tag/rules/GET/v1/rulesets/{namespace}", + "title": "List all rules", + "path": "/v1/rulesets/{namespace}", + "method": "get", + "ref": "#/paths/~1v1~1rulesets~1{namespace}/get", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/rules/POST/v1/rulesets/{namespace}", + "title": "Create a rule", + "path": "/v1/rulesets/{namespace}", + "method": "post", + "ref": "#/paths/~1v1~1rulesets~1{namespace}/post", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/rules/PATCH/v1/rulesets/{namespace}/{slug}", + "title": "Update rule metadata", + "path": "/v1/rulesets/{namespace}/{slug}", + "method": "patch", + "ref": "#/paths/~1v1~1rulesets~1{namespace}~1{slug}/patch", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/rules/DELETE/v1/rulesets/{namespace}/{slug}", + "title": "Delete a rule", + "path": "/v1/rulesets/{namespace}/{slug}", + "method": "delete", + "ref": "#/paths/~1v1~1rulesets~1{namespace}~1{slug}/delete", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/rules/GET/v1/rulesets/{namespace}/{slug}", + "title": "Get a rule", + "path": "/v1/rulesets/{namespace}/{slug}", + "method": "get", + "ref": "#/paths/~1v1~1rulesets~1{namespace}~1{slug}/get", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/rules/POST/v1/rulesets/{namespace}/{slug}/access-group", + "title": "Add rule access group", + "path": "/v1/rulesets/{namespace}/{slug}/access-group", + "method": "post", + "ref": "#/paths/~1v1~1rulesets~1{namespace}~1{slug}~1access-group/post", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/rules/DELETE/v1/rulesets/{namespace}/{slug}/access-group", + "title": "Remove rule access group", + "path": "/v1/rulesets/{namespace}/{slug}/access-group", + "method": "delete", + "ref": "#/paths/~1v1~1rulesets~1{namespace}~1{slug}~1access-group/delete", + "type": "operation", + "isDeprecated": false + } + ], + "isGroup": false, + "isWebhooks": false, + "type": "tag", + "xKeys": { + "x-scalar-order": [ + "api/tag/rules/GET/v1/rulesets/{namespace}", + "api/tag/rules/POST/v1/rulesets/{namespace}", + "api/tag/rules/PATCH/v1/rulesets/{namespace}/{slug}", + "api/tag/rules/DELETE/v1/rulesets/{namespace}/{slug}", + "api/tag/rules/GET/v1/rulesets/{namespace}/{slug}", + "api/tag/rules/POST/v1/rulesets/{namespace}/{slug}/access-group", + "api/tag/rules/DELETE/v1/rulesets/{namespace}/{slug}/access-group" + ] + } + }, + { + "id": "api/tag/themes", + "title": "Themes", + "name": "Themes", + "description": "Themes", + "children": [ + { + "id": "api/tag/themes/GET/v1/themes", + "title": "List all themes", + "path": "/v1/themes", + "method": "get", + "ref": "#/paths/~1v1~1themes/get", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/themes/POST/v1/themes", + "title": "Create a theme", + "path": "/v1/themes", + "method": "post", + "ref": "#/paths/~1v1~1themes/post", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/themes/PATCH/v1/themes/{slug}", + "title": "Update theme metadata", + "path": "/v1/themes/{slug}", + "method": "patch", + "ref": "#/paths/~1v1~1themes~1{slug}/patch", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/themes/PUT/v1/themes/{slug}", + "title": "Update theme document", + "path": "/v1/themes/{slug}", + "method": "put", + "ref": "#/paths/~1v1~1themes~1{slug}/put", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/themes/DELETE/v1/themes/{slug}", + "title": "Delete a theme", + "path": "/v1/themes/{slug}", + "method": "delete", + "ref": "#/paths/~1v1~1themes~1{slug}/delete", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/themes/GET/v1/themes/{slug}", + "title": "Get a theme", + "path": "/v1/themes/{slug}", + "method": "get", + "ref": "#/paths/~1v1~1themes~1{slug}/get", + "type": "operation", + "isDeprecated": false + } + ], + "isGroup": false, + "isWebhooks": false, + "type": "tag", + "xKeys": { + "x-scalar-order": [ + "api/tag/themes/GET/v1/themes", + "api/tag/themes/POST/v1/themes", + "api/tag/themes/PATCH/v1/themes/{slug}", + "api/tag/themes/PUT/v1/themes/{slug}", + "api/tag/themes/DELETE/v1/themes/{slug}", + "api/tag/themes/GET/v1/themes/{slug}" + ] + } + }, + { + "id": "api/tag/teams", + "title": "Teams", + "name": "Teams", + "description": "Teams", + "children": [ + { + "id": "api/tag/teams/GET/v1/teams", + "title": "List teams", + "path": "/v1/teams", + "method": "get", + "ref": "#/paths/~1v1~1teams/get", + "type": "operation", + "isDeprecated": false + } + ], + "isGroup": false, + "isWebhooks": false, + "type": "tag", + "xKeys": { + "x-scalar-order": [ + "api/tag/teams/GET/v1/teams" + ] + } + }, + { + "id": "api/tag/scalar-docs", + "title": "Scalar Docs", + "name": "Scalar Docs", + "description": "Scalar Docs", + "children": [ + { + "id": "api/tag/scalar-docs/GET/v1/guides", + "title": "List all projects", + "path": "/v1/guides", + "method": "get", + "ref": "#/paths/~1v1~1guides/get", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/scalar-docs/POST/v1/guides", + "title": "Create a project", + "path": "/v1/guides", + "method": "post", + "ref": "#/paths/~1v1~1guides/post", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/scalar-docs/POST/v1/guides/{slug}/publish", + "title": "Publish a project", + "path": "/v1/guides/{slug}/publish", + "method": "post", + "ref": "#/paths/~1v1~1guides~1{slug}~1publish/post", + "type": "operation", + "isDeprecated": false + } + ], + "isGroup": false, + "isWebhooks": false, + "type": "tag", + "xKeys": { + "x-scalar-order": [ + "api/tag/scalar-docs/GET/v1/guides", + "api/tag/scalar-docs/POST/v1/guides", + "api/tag/scalar-docs/POST/v1/guides/{slug}/publish" + ] + } + }, + { + "id": "api/tag/namespaces", + "title": "Namespaces", + "name": "Namespaces", + "description": "Namespaces", + "children": [ + { + "id": "api/tag/namespaces/GET/v1/namespaces", + "title": "List namespaces", + "path": "/v1/namespaces", + "method": "get", + "ref": "#/paths/~1v1~1namespaces/get", + "type": "operation", + "isDeprecated": false + } + ], + "isGroup": false, + "isWebhooks": false, + "type": "tag", + "xKeys": { + "x-scalar-order": [ + "api/tag/namespaces/GET/v1/namespaces" + ] + } + }, + { + "id": "api/tag/authentication", + "title": "Authentication", + "name": "Authentication", + "description": "Authentication", + "children": [ + { + "id": "api/tag/authentication/POST/v1/auth/exchange", + "title": "Exchange token", + "path": "/v1/auth/exchange", + "method": "post", + "ref": "#/paths/~1v1~1auth~1exchange/post", + "type": "operation", + "isDeprecated": false + }, + { + "id": "api/tag/authentication/GET/v1/auth/me", + "title": "Get current user", + "path": "/v1/auth/me", + "method": "get", + "ref": "#/paths/~1v1~1auth~1me/get", + "type": "operation", + "isDeprecated": false + } + ], + "isGroup": false, + "isWebhooks": false, + "type": "tag", + "xKeys": { + "x-scalar-order": [ + "api/tag/authentication/POST/v1/auth/exchange", + "api/tag/authentication/GET/v1/auth/me" + ] + } + }, + { + "type": "models", + "id": "api/models", + "title": "Models", + "name": "Models", + "children": [ + { + "id": "api/model/400", + "title": "400", + "name": "400", + "ref": "#/components/schemas/400", + "type": "model" + }, + { + "id": "api/model/401", + "title": "401", + "name": "401", + "ref": "#/components/schemas/401", + "type": "model" + }, + { + "id": "api/model/403", + "title": "403", + "name": "403", + "ref": "#/components/schemas/403", + "type": "model" + }, + { + "id": "api/model/404", + "title": "404", + "name": "404", + "ref": "#/components/schemas/404", + "type": "model" + }, + { + "id": "api/model/422", + "title": "422", + "name": "422", + "ref": "#/components/schemas/422", + "type": "model" + }, + { + "id": "api/model/500", + "title": "500", + "name": "500", + "ref": "#/components/schemas/500", + "type": "model" + }, + { + "id": "api/model/api-document", + "title": "api-document", + "name": "api-document", + "ref": "#/components/schemas/api-document", + "type": "model" + }, + { + "id": "api/model/nanoid", + "title": "nanoid", + "name": "nanoid", + "ref": "#/components/schemas/nanoid", + "type": "model" + }, + { + "id": "api/model/version", + "title": "version", + "name": "version", + "ref": "#/components/schemas/version", + "type": "model" + }, + { + "id": "api/model/slug", + "title": "slug", + "name": "slug", + "ref": "#/components/schemas/slug", + "type": "model" + }, + { + "id": "api/model/namespace", + "title": "namespace", + "name": "namespace", + "ref": "#/components/schemas/namespace", + "type": "model" + }, + { + "id": "api/model/managed-doc-version", + "title": "managed-doc-version", + "name": "managed-doc-version", + "ref": "#/components/schemas/managed-doc-version", + "type": "model" + }, + { + "id": "api/model/method", + "title": "method", + "name": "method", + "ref": "#/components/schemas/method", + "type": "model" + }, + { + "id": "api/model/access-group", + "title": "access-group", + "name": "access-group", + "ref": "#/components/schemas/access-group", + "type": "model" + }, + { + "id": "api/model/schema", + "title": "schema", + "name": "schema", + "ref": "#/components/schemas/schema", + "type": "model" + }, + { + "id": "api/model/managed-schema-version", + "title": "managed-schema-version", + "name": "managed-schema-version", + "ref": "#/components/schemas/managed-schema-version", + "type": "model" + }, + { + "id": "api/model/timestamp", + "title": "timestamp", + "name": "timestamp", + "ref": "#/components/schemas/timestamp", + "type": "model" + }, + { + "id": "api/model/uid", + "title": "uid", + "name": "uid", + "ref": "#/components/schemas/uid", + "type": "model" + }, + { + "id": "api/model/login-portal-email", + "title": "login-portal-email", + "name": "login-portal-email", + "ref": "#/components/schemas/login-portal-email", + "type": "model" + }, + { + "id": "api/model/login-portal-page", + "title": "login-portal-page", + "name": "login-portal-page", + "ref": "#/components/schemas/login-portal-page", + "type": "model" + }, + { + "id": "api/model/login-portal", + "title": "login-portal", + "name": "login-portal", + "ref": "#/components/schemas/login-portal", + "type": "model" + }, + { + "id": "api/model/rule", + "title": "rule", + "name": "rule", + "ref": "#/components/schemas/rule", + "type": "model" + }, + { + "id": "api/model/theme", + "title": "theme", + "name": "theme", + "ref": "#/components/schemas/theme", + "type": "model" + }, + { + "id": "api/model/team", + "title": "team", + "name": "team", + "ref": "#/components/schemas/team", + "type": "model" + }, + { + "id": "api/model/team-name", + "title": "team-name", + "name": "team-name", + "ref": "#/components/schemas/team-name", + "type": "model" + }, + { + "id": "api/model/team-image", + "title": "team-image", + "name": "team-image", + "ref": "#/components/schemas/team-image", + "type": "model" + }, + { + "id": "api/model/github-project", + "title": "github-project", + "name": "github-project", + "ref": "#/components/schemas/github-project", + "type": "model" + }, + { + "id": "api/model/active-deployment", + "title": "active-deployment", + "name": "active-deployment", + "ref": "#/components/schemas/active-deployment", + "type": "model" + }, + { + "id": "api/model/github-project-repository", + "title": "github-project-repository", + "name": "github-project-repository", + "ref": "#/components/schemas/github-project-repository", + "type": "model" + }, + { + "id": "api/model/email", + "title": "email", + "name": "email", + "ref": "#/components/schemas/email", + "type": "model" + }, + { + "id": "api/model/team-summary", + "title": "team-summary", + "name": "team-summary", + "ref": "#/components/schemas/team-summary", + "type": "model" + }, + { + "id": "api/model/user", + "title": "user", + "name": "user", + "ref": "#/components/schemas/user", + "type": "model" + } + ] + } + ] + }, + "x-scalar-sdk": { + "name": "ScalarApi", + "slug": "scalarApi", + "version": "0.1.5", + "schemaVersion": "sdk-ir/v1", + "clientSettings": { + "opts": { + "bearer_auth": { + "type": "string", + "readEnv": "BEARER_AUTH", + "auth": { + "securityScheme": "auth.bearerAuth", + "role": "value" + } + } + } + } + } +} diff --git a/package.json b/package.json index ca6eb3e..f67d05e 100644 --- a/package.json +++ b/package.json @@ -1,42 +1,30 @@ { "name": "@scalar/sdk", "version": "0.1.5", - "author": "Scalar", + "description": "Manage Scalar platform resources programmatically. The Scalar API lets teams create and update API references, schemas, guides, rulesets, themes, login portals, namespaces, and access controls from automated workflows or custom internal tooling. Use it to keep documentation and developer portals in sync with your source of truth, publish new versions safely, and inspect the teams and authenticated user context available to your integration.", "type": "module", - "tshy": { - "sourceDialects": [ - "@scalar/sdk/source" - ], - "exports": { - ".": "./src/index.ts", - "./package.json": "./package.json", - "./types": "./src/types/index.ts", - "./models/errors": "./src/models/errors/index.ts", - "./models/components": "./src/models/components/index.ts", - "./models/operations": "./src/models/operations/index.ts", - "./*.js": "./src/*.ts", - "./*": "./src/*.ts" - } - }, "sideEffects": false, - "scripts": { - "lint": "eslint --cache --max-warnings=0 src", - "build": "tshy", - "prepublishOnly": "npm run build" + "main": "./dist/cjs/index.js", + "module": "./dist/esm/index.js", + "types": "./dist/esm/index.d.ts", + "exports": { + ".": { + "types": "./dist/esm/index.d.ts", + "import": "./dist/esm/index.js", + "require": "./dist/cjs/index.js", + "default": "./dist/esm/index.js" + }, + "./package.json": "./package.json" }, - "peerDependencies": { - "zod": ">= 3" + "files": [ + "dist" + ], + "scripts": { + "build": "tsc -p tsconfig.json && tsc -p tsconfig.cjs.json && node scripts/finalize-build.mjs", + "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.cjs.json --noEmit" }, + "dependencies": {}, "devDependencies": { - "@eslint/js": "^9.19.0", - "eslint": "^9.19.0", - "globals": "^15.14.0", - "tshy": "^2.0.0", - "typescript": "^5.4.5", - "typescript-eslint": "^8.22.0", - "zod": "^3.25.17" - }, - "dependencies": { - + "typescript": "^6.0.0" } } diff --git a/renovate.json b/renovate.json deleted file mode 100644 index 309cae4..0000000 --- a/renovate.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": [ - "config:recommended", - "helpers:pinGitHubActionDigests" - ], - "enabledManagers": ["github-actions"], - "packageRules": [ - { - "matchUpdateTypes": ["minor", "patch", "digest", "pinDigest"], - "enabled": false - }, - { - "matchUpdateTypes": ["major"], - "schedule": ["on the first day of the month"] - } - ], - "vulnerabilityAlerts": { - "enabled": true - } -} diff --git a/scalar-sdk.manifest.json b/scalar-sdk.manifest.json new file mode 100644 index 0000000..021b089 --- /dev/null +++ b/scalar-sdk.manifest.json @@ -0,0 +1,9651 @@ +{ + "name": "ScalarApi", + "slug": "scalarApi", + "version": "0.1.5", + "servers": [ + "https://access.scalar.com" + ], + "environments": { + "production": "https://access.scalar.com" + }, + "environmentOrder": [ + "production" + ], + "auth": [ + "bearer" + ], + "authDetails": [ + { + "kind": "bearer", + "id": "BearerAuth", + "bearerFormat": "JWT" + } + ], + "clientHeaderParams": [], + "schemas": [ + { + "name": "_400", + "source": "_400", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "message", + "publicName": "message", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "code", + "publicName": "code", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "_401", + "source": "_401", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "message", + "publicName": "message", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "code", + "publicName": "code", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "_403", + "source": "_403", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "message", + "publicName": "message", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "code", + "publicName": "code", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "_404", + "source": "_404", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "message", + "publicName": "message", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "code", + "publicName": "code", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "_422", + "source": "_422", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "message", + "publicName": "message", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "code", + "publicName": "code", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "_500", + "source": "_500", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "message", + "publicName": "message", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "code", + "publicName": "code", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "ApiDocument", + "source": "ApiDocument", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "uid", + "publicName": "uid", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Nanoid" + } + }, + { + "name": "version", + "publicName": "version", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Version" + } + }, + { + "name": "title", + "publicName": "title", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 100 + } + } + }, + { + "name": "slug", + "publicName": "slug", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Slug" + } + }, + { + "name": "description", + "publicName": "description", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "namespace", + "publicName": "namespace", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Namespace" + } + }, + { + "name": "isPrivate", + "publicName": "isPrivate", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "boolean" + } + }, + { + "name": "tags", + "publicName": "tags", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "versions", + "publicName": "versions", + "required": true, + "deprecated": false, + "type": { + "kind": "array", + "items": { + "kind": "ref", + "name": "ManagedDocVersion" + } + } + } + ], + "additionalProperties": false + } + }, + { + "name": "Nanoid", + "source": "Nanoid", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "minLength": 5 + } + } + }, + { + "name": "Version", + "source": "Version", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "minLength": 1 + } + } + }, + { + "name": "Slug", + "source": "Slug", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "pattern": "^[a-z](?:[a-z0-9-]*[a-z0-9])?$", + "minLength": 3, + "maxLength": 60 + } + } + }, + { + "name": "Namespace", + "source": "Namespace", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "pattern": "^[a-zA-Z0-9-_]+$", + "minLength": 3, + "maxLength": 50 + } + } + }, + { + "name": "ManagedDocVersion", + "source": "ManagedDocVersion", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "uid", + "publicName": "uid", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Nanoid" + } + }, + { + "name": "createdAt", + "publicName": "createdAt", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "number" + } + }, + { + "name": "version", + "publicName": "version", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Version" + } + }, + { + "name": "upgraded", + "publicName": "upgraded", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "boolean" + } + }, + { + "name": "embedStatus", + "publicName": "embedStatus", + "required": true, + "deprecated": false, + "type": { + "kind": "union", + "variants": [ + { + "kind": "enum", + "values": [ + "complete", + "failed" + ], + "names": [ + "Complete", + "Failed" + ], + "deprecations": [ + false, + false + ] + }, + { + "kind": "null" + } + ] + } + }, + { + "name": "tags", + "publicName": "tags", + "required": true, + "deprecated": false, + "type": { + "kind": "array", + "items": { + "kind": "primitive", + "type": "string" + } + } + }, + { + "name": "tools", + "publicName": "tools", + "required": false, + "deprecated": false, + "type": { + "kind": "array", + "items": { + "kind": "object", + "properties": [ + { + "name": "path", + "publicName": "path", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "method", + "publicName": "method", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Method" + } + }, + { + "name": "enabledTools", + "publicName": "enabledTools", + "required": true, + "deprecated": false, + "type": { + "kind": "array", + "items": { + "kind": "enum", + "values": [ + "execute-request", + "get-mini-openapi-spec" + ], + "names": [ + "ExecuteRequest", + "GetMiniOpenapiSpec" + ], + "deprecations": [ + false, + false + ] + } + } + } + ], + "additionalProperties": false + } + } + }, + { + "name": "yamlSha", + "publicName": "yamlSha", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "jsonSha", + "publicName": "jsonSha", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "versionSha", + "publicName": "versionSha", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "Method", + "source": "Method", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "enum", + "values": [ + "delete", + "get", + "head", + "options", + "patch", + "post", + "put", + "trace" + ], + "names": [ + "Delete", + "Get", + "Head", + "Options", + "Patch", + "Post", + "Put", + "Trace" + ], + "deprecations": [ + false, + false, + false, + false, + false, + false, + false, + false + ] + } + }, + { + "name": "AccessGroup", + "source": "AccessGroup", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "accessGroupSlug", + "publicName": "accessGroupSlug", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Slug" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "Schema", + "source": "Schema", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "uid", + "publicName": "uid", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Nanoid" + } + }, + { + "name": "title", + "publicName": "title", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 100 + } + } + }, + { + "name": "description", + "publicName": "description", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "slug", + "publicName": "slug", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Slug" + } + }, + { + "name": "namespace", + "publicName": "namespace", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Namespace" + } + }, + { + "name": "isPrivate", + "publicName": "isPrivate", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "boolean" + } + }, + { + "name": "versions", + "publicName": "versions", + "required": true, + "deprecated": false, + "type": { + "kind": "array", + "items": { + "kind": "ref", + "name": "ManagedSchemaVersion" + } + } + } + ], + "additionalProperties": false + } + }, + { + "name": "ManagedSchemaVersion", + "source": "ManagedSchemaVersion", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "uid", + "publicName": "uid", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Nanoid" + } + }, + { + "name": "createdAt", + "publicName": "createdAt", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Timestamp" + } + }, + { + "name": "updatedAt", + "publicName": "updatedAt", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Timestamp" + } + }, + { + "name": "version", + "publicName": "version", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Version" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "Timestamp", + "source": "Timestamp", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "primitive", + "type": "integer", + "validation": {} + } + }, + { + "name": "Uid", + "source": "Uid", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "uid", + "publicName": "uid", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Nanoid" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "LoginPortalEmail", + "source": "LoginPortalEmail", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "logo", + "publicName": "logo", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "logoSize", + "publicName": "logoSize", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "buttonText", + "publicName": "buttonText", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 50 + } + } + }, + { + "name": "message", + "publicName": "message", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 1000 + } + } + }, + { + "name": "title", + "publicName": "title", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 100 + } + } + }, + { + "name": "mainColor", + "publicName": "mainColor", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 100 + } + } + }, + { + "name": "mainBackground", + "publicName": "mainBackground", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 100 + } + } + }, + { + "name": "cardColor", + "publicName": "cardColor", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 100 + } + } + }, + { + "name": "cardBackground", + "publicName": "cardBackground", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 100 + } + } + }, + { + "name": "buttonColor", + "publicName": "buttonColor", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 100 + } + } + }, + { + "name": "buttonBackground", + "publicName": "buttonBackground", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 100 + } + } + } + ], + "additionalProperties": false + } + }, + { + "name": "LoginPortalPage", + "source": "LoginPortalPage", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "title", + "publicName": "title", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 100 + } + } + }, + { + "name": "description", + "publicName": "description", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 500 + } + } + }, + { + "name": "head", + "publicName": "head", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "script", + "publicName": "script", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "theme", + "publicName": "theme", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "companyName", + "publicName": "companyName", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 100 + } + } + }, + { + "name": "logo", + "publicName": "logo", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "logoURL", + "publicName": "logoURL", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "favicon", + "publicName": "favicon", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "termsLink", + "publicName": "termsLink", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "privacyLink", + "publicName": "privacyLink", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "formTitle", + "publicName": "formTitle", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 100 + } + } + }, + { + "name": "formDescription", + "publicName": "formDescription", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 500 + } + } + }, + { + "name": "formImage", + "publicName": "formImage", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "LoginPortal", + "source": "LoginPortal", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "uid", + "publicName": "uid", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Nanoid" + } + }, + { + "name": "title", + "publicName": "title", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 200 + } + } + }, + { + "name": "slug", + "publicName": "slug", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Slug" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "Rule", + "source": "Rule", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "uid", + "publicName": "uid", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Nanoid" + } + }, + { + "name": "title", + "publicName": "title", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "maxLength": 100 + } + } + }, + { + "name": "description", + "publicName": "description", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "slug", + "publicName": "slug", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Slug" + } + }, + { + "name": "namespace", + "publicName": "namespace", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Namespace" + } + }, + { + "name": "isPrivate", + "publicName": "isPrivate", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "boolean" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "Theme", + "source": "Theme", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "uid", + "publicName": "uid", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Nanoid" + } + }, + { + "name": "name", + "publicName": "name", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "description", + "publicName": "description", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "slug", + "publicName": "slug", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Slug" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "Team", + "source": "Team", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "uid", + "publicName": "uid", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Nanoid" + } + }, + { + "name": "name", + "publicName": "name", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "TeamName" + } + }, + { + "name": "imageUri", + "publicName": "imageUri", + "required": false, + "deprecated": false, + "type": { + "kind": "ref", + "name": "TeamImage" + } + }, + { + "name": "slug", + "publicName": "slug", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Slug" + } + }, + { + "name": "theme", + "publicName": "theme", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "TeamName", + "source": "TeamName", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "TeamImage", + "source": "TeamImage", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "GithubProject", + "source": "GithubProject", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "uid", + "publicName": "uid", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Nanoid" + } + }, + { + "name": "createdAt", + "publicName": "createdAt", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Timestamp" + } + }, + { + "name": "updatedAt", + "publicName": "updatedAt", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Timestamp" + } + }, + { + "name": "name", + "publicName": "name", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "activeDeployment", + "publicName": "activeDeployment", + "required": true, + "deprecated": false, + "type": { + "kind": "union", + "variants": [ + { + "kind": "ref", + "name": "ActiveDeployment" + }, + { + "kind": "null" + } + ] + } + }, + { + "name": "lastPublished", + "publicName": "lastPublished", + "required": true, + "deprecated": false, + "type": { + "kind": "union", + "variants": [ + { + "kind": "ref", + "name": "Timestamp" + }, + { + "kind": "null" + } + ] + } + }, + { + "name": "lastPublishedUid", + "publicName": "lastPublishedUid", + "required": true, + "deprecated": false, + "type": { + "kind": "union", + "variants": [ + { + "kind": "primitive", + "type": "string" + }, + { + "kind": "null" + } + ] + } + }, + { + "name": "loginPortalUid", + "publicName": "loginPortalUid", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "activeThemeId", + "publicName": "activeThemeId", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "typesenseId", + "publicName": "typesenseId", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "number" + } + }, + { + "name": "isPrivate", + "publicName": "isPrivate", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "boolean" + } + }, + { + "name": "agentEnabled", + "publicName": "agentEnabled", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "boolean" + } + }, + { + "name": "accessGroups", + "publicName": "accessGroups", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "slug", + "publicName": "slug", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Slug" + } + }, + { + "name": "publishStatus", + "publicName": "publishStatus", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "publishMessage", + "publicName": "publishMessage", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "repository", + "publicName": "repository", + "required": false, + "deprecated": false, + "type": { + "kind": "union", + "variants": [ + { + "kind": "ref", + "name": "GithubProjectRepository" + }, + { + "kind": "null" + } + ] + } + } + ], + "additionalProperties": false + } + }, + { + "name": "ActiveDeployment", + "source": "ActiveDeployment", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "uid", + "publicName": "uid", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "domain", + "publicName": "domain", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "publishedAt", + "publicName": "publishedAt", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Timestamp" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "GithubProjectRepository", + "source": "GithubProjectRepository", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "linkedBy", + "publicName": "linkedBy", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "id", + "publicName": "id", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "number" + } + }, + { + "name": "name", + "publicName": "name", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "validation": { + "minLength": 2 + } + } + }, + { + "name": "configPath", + "publicName": "configPath", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "branch", + "publicName": "branch", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "publishOnMerge", + "publicName": "publishOnMerge", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "boolean" + } + }, + { + "name": "publishPreviews", + "publicName": "publishPreviews", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "boolean" + } + }, + { + "name": "prComments", + "publicName": "prComments", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "boolean" + } + }, + { + "name": "expired", + "publicName": "expired", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "boolean" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "Email", + "source": "Email", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string", + "format": "email", + "validation": { + "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$" + } + } + }, + { + "name": "TeamSummary", + "source": "TeamSummary", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "uid", + "publicName": "uid", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Nanoid" + } + }, + { + "name": "name", + "publicName": "name", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "TeamName" + } + }, + { + "name": "imageUri", + "publicName": "imageUri", + "required": false, + "deprecated": false, + "type": { + "kind": "ref", + "name": "TeamImage" + } + } + ], + "additionalProperties": false + } + }, + { + "name": "User", + "source": "User", + "publicAliases": [], + "deprecated": false, + "type": { + "kind": "object", + "properties": [ + { + "name": "uid", + "publicName": "uid", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Nanoid" + } + }, + { + "name": "createdAt", + "publicName": "createdAt", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Timestamp" + } + }, + { + "name": "updatedAt", + "publicName": "updatedAt", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Timestamp" + } + }, + { + "name": "email", + "publicName": "email", + "required": true, + "deprecated": false, + "type": { + "kind": "ref", + "name": "Email" + } + }, + { + "name": "theme", + "publicName": "theme", + "required": false, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "string" + } + }, + { + "name": "activeTeamId", + "publicName": "activeTeamId", + "required": true, + "deprecated": false, + "type": { + "kind": "union", + "variants": [ + { + "kind": "primitive", + "type": "string" + }, + { + "kind": "null" + } + ] + } + }, + { + "name": "hasGithub", + "publicName": "hasGithub", + "required": true, + "deprecated": false, + "type": { + "kind": "primitive", + "type": "boolean" + } + }, + { + "name": "teams", + "publicName": "teams", + "required": true, + "deprecated": false, + "type": { + "kind": "array", + "items": { + "kind": "ref", + "name": "TeamSummary" + } + } + } + ], + "additionalProperties": false + } + } + ], + "resources": [ + "registry", + "schemas", + "loginPortals", + "rules", + "themes", + "teams", + "scalarDocs", + "namespaces", + "authentication" + ], + "publicResources": [ + "registry", + "schemas", + "loginPortals", + "rules", + "themes", + "teams", + "scalarDocs", + "namespaces", + "authentication" + ], + "operations": [ + { + "resource": "registry", + "publicResource": "registry", + "operation": "listAllApiDocuments", + "publicOperation": "listAllApiDocuments", + "deprecated": false, + "method": "GET", + "path": "/v1/apis", + "pathParams": [], + "publicPathParams": [], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "pathParamDetails": [], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "registry", + "publicResource": "registry", + "operation": "listApiDocuments", + "publicOperation": "listApiDocuments", + "deprecated": false, + "method": "GET", + "path": "/v1/apis/{namespace}", + "pathParams": [ + "namespace" + ], + "publicPathParams": [ + "namespace" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RegistryListApiDocumentsParams" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "registry", + "publicResource": "registry", + "operation": "createApiDocument", + "publicOperation": "createApiDocument", + "deprecated": false, + "method": "POST", + "path": "/v1/apis/{namespace}", + "pathParams": [ + "namespace" + ], + "publicPathParams": [ + "namespace" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "title", + "description", + "version", + "slug", + "ruleset", + "isPrivate", + "document" + ], + "publicBodyParams": [ + "title", + "description", + "version", + "slug", + "ruleset", + "isPrivate", + "document" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RegistryCreateApiDocumentParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "registry", + "publicResource": "registry", + "operation": "deleteApiDocument", + "publicOperation": "deleteApiDocument", + "deprecated": false, + "method": "DELETE", + "path": "/v1/apis/{namespace}/{slug}", + "pathParams": [ + "namespace", + "slug" + ], + "publicPathParams": [ + "namespace", + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RegistryDeleteApiDocumentParams" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "registry", + "publicResource": "registry", + "operation": "updateApiDocument", + "publicOperation": "updateApiDocument", + "deprecated": false, + "method": "PATCH", + "path": "/v1/apis/{namespace}/{slug}", + "pathParams": [ + "namespace", + "slug" + ], + "publicPathParams": [ + "namespace", + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "title", + "description", + "isPrivate", + "ruleset" + ], + "publicBodyParams": [ + "title", + "description", + "isPrivate", + "ruleset" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RegistryUpdateApiDocumentParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "registry", + "publicResource": "registry", + "operation": "retrieveApiDocumentVersion", + "publicOperation": "retrieveApiDocumentVersion", + "deprecated": false, + "method": "GET", + "path": "/v1/apis/{namespace}/{slug}/version/{semver}", + "pathParams": [ + "namespace", + "slug", + "semver" + ], + "publicPathParams": [ + "namespace", + "slug", + "semver" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "semver", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RegistryRetrieveApiDocumentVersionParams" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "text/plain", + "encoding": "text", + "contents": [ + { + "contentType": "text/plain", + "encoding": "text" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "registry", + "publicResource": "registry", + "operation": "deleteApiDocumentVersion", + "publicOperation": "deleteApiDocumentVersion", + "deprecated": false, + "method": "DELETE", + "path": "/v1/apis/{namespace}/{slug}/version/{semver}", + "pathParams": [ + "namespace", + "slug", + "semver" + ], + "publicPathParams": [ + "namespace", + "slug", + "semver" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "semver", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RegistryDeleteApiDocumentVersionParams" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "registry", + "publicResource": "registry", + "operation": "updateApiDocumentVersion", + "publicOperation": "updateApiDocumentVersion", + "deprecated": false, + "method": "PATCH", + "path": "/v1/apis/{namespace}/{slug}/version/{semver}", + "pathParams": [ + "namespace", + "slug", + "semver" + ], + "publicPathParams": [ + "namespace", + "slug", + "semver" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "document", + "lastKnownVersionSha" + ], + "publicBodyParams": [ + "document", + "lastKnownVersionSha" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "semver", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RegistryUpdateApiDocumentVersionParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "registry", + "publicResource": "registry", + "operation": "listApiDocumentVersionMetadata", + "publicOperation": "listApiDocumentVersionMetadata", + "deprecated": false, + "method": "GET", + "path": "/v1/apis/{namespace}/{slug}/version/{semver}/metadata", + "pathParams": [ + "namespace", + "slug", + "semver" + ], + "publicPathParams": [ + "namespace", + "slug", + "semver" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "semver", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RegistryListApiDocumentVersionMetadataParams" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "ManagedDocVersion", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "registry", + "publicResource": "registry", + "operation": "createApiDocumentVersion", + "publicOperation": "createApiDocumentVersion", + "deprecated": false, + "method": "POST", + "path": "/v1/apis/{namespace}/{slug}/version", + "pathParams": [ + "namespace", + "slug" + ], + "publicPathParams": [ + "namespace", + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "version", + "document", + "force", + "lastKnownVersionSha" + ], + "publicBodyParams": [ + "version", + "document", + "force", + "lastKnownVersionSha" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RegistryCreateApiDocumentVersionParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "ManagedDocVersion", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "registry", + "publicResource": "registry", + "operation": "createApiDocumentAccessGroup", + "publicOperation": "createApiDocumentAccessGroup", + "deprecated": false, + "method": "POST", + "path": "/v1/apis/{namespace}/{slug}/access-group", + "pathParams": [ + "namespace", + "slug" + ], + "publicPathParams": [ + "namespace", + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "accessGroupSlug" + ], + "publicBodyParams": [ + "accessGroupSlug" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RegistryCreateApiDocumentAccessGroupParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "registry", + "publicResource": "registry", + "operation": "deleteApiDocumentAccessGroup", + "publicOperation": "deleteApiDocumentAccessGroup", + "deprecated": false, + "method": "DELETE", + "path": "/v1/apis/{namespace}/{slug}/access-group", + "pathParams": [ + "namespace", + "slug" + ], + "publicPathParams": [ + "namespace", + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "accessGroupSlug" + ], + "publicBodyParams": [ + "accessGroupSlug" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RegistryDeleteApiDocumentAccessGroupParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "schemas", + "publicResource": "schemas", + "operation": "list", + "publicOperation": "list", + "deprecated": false, + "method": "GET", + "path": "/v1/schemas/{namespace}", + "pathParams": [ + "namespace" + ], + "publicPathParams": [ + "namespace" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "SchemaListParams" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "schemas", + "publicResource": "schemas", + "operation": "create", + "publicOperation": "create", + "deprecated": false, + "method": "POST", + "path": "/v1/schemas/{namespace}", + "pathParams": [ + "namespace" + ], + "publicPathParams": [ + "namespace" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "title", + "description", + "version", + "slug", + "isPrivate", + "document" + ], + "publicBodyParams": [ + "title", + "description", + "version", + "slug", + "isPrivate", + "document" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "SchemaCreateParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "Uid", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "schemas", + "publicResource": "schemas", + "operation": "delete", + "publicOperation": "delete", + "deprecated": false, + "method": "DELETE", + "path": "/v1/schemas/{namespace}/{slug}", + "pathParams": [ + "namespace", + "slug" + ], + "publicPathParams": [ + "namespace", + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "SchemaDeleteParams" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "schemas", + "publicResource": "schemas", + "operation": "update", + "publicOperation": "update", + "deprecated": false, + "method": "PATCH", + "path": "/v1/schemas/{namespace}/{slug}", + "pathParams": [ + "namespace", + "slug" + ], + "publicPathParams": [ + "namespace", + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "title", + "description", + "isPrivate" + ], + "publicBodyParams": [ + "title", + "description", + "isPrivate" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "SchemaUpdateParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "schemas", + "publicResource": "schemas", + "operation": "retrieveVersion", + "publicOperation": "retrieveVersion", + "deprecated": false, + "method": "GET", + "path": "/v1/schemas/{namespace}/{slug}/version/{semver}", + "pathParams": [ + "namespace", + "slug", + "semver" + ], + "publicPathParams": [ + "namespace", + "slug", + "semver" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "semver", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "SchemaRetrieveVersionParams" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "text/plain", + "encoding": "text", + "contents": [ + { + "contentType": "text/plain", + "encoding": "text" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "schemas", + "publicResource": "schemas", + "operation": "deleteVersion", + "publicOperation": "deleteVersion", + "deprecated": false, + "method": "DELETE", + "path": "/v1/schemas/{namespace}/{slug}/version/{semver}", + "pathParams": [ + "namespace", + "slug", + "semver" + ], + "publicPathParams": [ + "namespace", + "slug", + "semver" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "semver", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "SchemaDeleteVersionParams" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "schemas", + "publicResource": "schemas", + "operation": "createVersion", + "publicOperation": "createVersion", + "deprecated": false, + "method": "POST", + "path": "/v1/schemas/{namespace}/{slug}/version", + "pathParams": [ + "namespace", + "slug" + ], + "publicPathParams": [ + "namespace", + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "version", + "document" + ], + "publicBodyParams": [ + "version", + "document" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "SchemaCreateVersionParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "Uid", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "schemas", + "publicResource": "schemas", + "operation": "createAccessGroup", + "publicOperation": "createAccessGroup", + "deprecated": false, + "method": "POST", + "path": "/v1/schemas/{namespace}/{slug}/access-group", + "pathParams": [ + "namespace", + "slug" + ], + "publicPathParams": [ + "namespace", + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "accessGroupSlug" + ], + "publicBodyParams": [ + "accessGroupSlug" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "SchemaCreateAccessGroupParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "schemas", + "publicResource": "schemas", + "operation": "deleteAccessGroup", + "publicOperation": "deleteAccessGroup", + "deprecated": false, + "method": "DELETE", + "path": "/v1/schemas/{namespace}/{slug}/access-group", + "pathParams": [ + "namespace", + "slug" + ], + "publicPathParams": [ + "namespace", + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "accessGroupSlug" + ], + "publicBodyParams": [ + "accessGroupSlug" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "SchemaDeleteAccessGroupParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "loginPortals", + "publicResource": "loginPortals", + "operation": "loginPortals", + "publicOperation": "loginPortals", + "deprecated": false, + "method": "GET", + "path": "/v1/login-portals/{slug}", + "pathParams": [ + "slug" + ], + "publicPathParams": [ + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "pathParamDetails": [ + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "LoginPortalsParams" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "loginPortals", + "publicResource": "loginPortals", + "operation": "loginPortals3", + "publicOperation": "loginPortals3", + "deprecated": false, + "method": "DELETE", + "path": "/v1/login-portals/{slug}", + "pathParams": [ + "slug" + ], + "publicPathParams": [ + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "pathParamDetails": [ + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "LoginPortals3Params" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "loginPortals", + "publicResource": "loginPortals", + "operation": "loginPortals2", + "publicOperation": "loginPortals2", + "deprecated": false, + "method": "PATCH", + "path": "/v1/login-portals/{slug}", + "pathParams": [ + "slug" + ], + "publicPathParams": [ + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "title" + ], + "publicBodyParams": [ + "title" + ], + "pathParamDetails": [ + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "LoginPortals2Params" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "loginPortals", + "publicResource": "loginPortals", + "operation": "loginPortals5", + "publicOperation": "loginPortals5", + "deprecated": false, + "method": "GET", + "path": "/v1/login-portals", + "pathParams": [], + "publicPathParams": [], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "pathParamDetails": [], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "loginPortals", + "publicResource": "loginPortals", + "operation": "loginPortals4", + "publicOperation": "loginPortals4", + "deprecated": false, + "method": "POST", + "path": "/v1/login-portals", + "pathParams": [], + "publicPathParams": [], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "title", + "slug", + "email", + "page" + ], + "publicBodyParams": [ + "title", + "slug", + "email", + "page" + ], + "pathParamDetails": [], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "LoginPortals4Params" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "Uid", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "rules", + "publicResource": "rules", + "operation": "listRulesets", + "publicOperation": "listRulesets", + "deprecated": false, + "method": "GET", + "path": "/v1/rulesets/{namespace}", + "pathParams": [ + "namespace" + ], + "publicPathParams": [ + "namespace" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RuleListRulesetsParams" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "rules", + "publicResource": "rules", + "operation": "createRuleset", + "publicOperation": "createRuleset", + "deprecated": false, + "method": "POST", + "path": "/v1/rulesets/{namespace}", + "pathParams": [ + "namespace" + ], + "publicPathParams": [ + "namespace" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "title", + "description", + "slug", + "isPrivate", + "document" + ], + "publicBodyParams": [ + "title", + "description", + "slug", + "isPrivate", + "document" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RuleCreateRulesetParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "Uid", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "rules", + "publicResource": "rules", + "operation": "retrieveRulesetDocument", + "publicOperation": "retrieveRulesetDocument", + "deprecated": false, + "method": "GET", + "path": "/v1/rulesets/{namespace}/{slug}", + "pathParams": [ + "namespace", + "slug" + ], + "publicPathParams": [ + "namespace", + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RuleRetrieveRulesetDocumentParams" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "text/plain", + "encoding": "text", + "contents": [ + { + "contentType": "text/plain", + "encoding": "text" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "rules", + "publicResource": "rules", + "operation": "deleteRuleset", + "publicOperation": "deleteRuleset", + "deprecated": false, + "method": "DELETE", + "path": "/v1/rulesets/{namespace}/{slug}", + "pathParams": [ + "namespace", + "slug" + ], + "publicPathParams": [ + "namespace", + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RuleDeleteRulesetParams" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "rules", + "publicResource": "rules", + "operation": "updateRuleset", + "publicOperation": "updateRuleset", + "deprecated": false, + "method": "PATCH", + "path": "/v1/rulesets/{namespace}/{slug}", + "pathParams": [ + "namespace", + "slug" + ], + "publicPathParams": [ + "namespace", + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "namespace", + "slug", + "title", + "description", + "isPrivate" + ], + "publicBodyParams": [ + "namespace", + "slug", + "title", + "description", + "isPrivate" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RuleUpdateRulesetParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "rules", + "publicResource": "rules", + "operation": "createRulesetAccessGroup", + "publicOperation": "createRulesetAccessGroup", + "deprecated": false, + "method": "POST", + "path": "/v1/rulesets/{namespace}/{slug}/access-group", + "pathParams": [ + "namespace", + "slug" + ], + "publicPathParams": [ + "namespace", + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "accessGroupSlug" + ], + "publicBodyParams": [ + "accessGroupSlug" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RuleCreateRulesetAccessGroupParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "rules", + "publicResource": "rules", + "operation": "deleteRulesetAccessGroup", + "publicOperation": "deleteRulesetAccessGroup", + "deprecated": false, + "method": "DELETE", + "path": "/v1/rulesets/{namespace}/{slug}/access-group", + "pathParams": [ + "namespace", + "slug" + ], + "publicPathParams": [ + "namespace", + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "accessGroupSlug" + ], + "publicBodyParams": [ + "accessGroupSlug" + ], + "pathParamDetails": [ + { + "name": "namespace", + "required": true, + "style": "simple", + "explode": false + }, + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "RuleDeleteRulesetAccessGroupParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "themes", + "publicResource": "themes", + "operation": "list", + "publicOperation": "list", + "deprecated": false, + "method": "GET", + "path": "/v1/themes", + "pathParams": [], + "publicPathParams": [], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "pathParamDetails": [], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "themes", + "publicResource": "themes", + "operation": "create", + "publicOperation": "create", + "deprecated": false, + "method": "POST", + "path": "/v1/themes", + "pathParams": [], + "publicPathParams": [], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "name", + "description", + "slug", + "document" + ], + "publicBodyParams": [ + "name", + "description", + "slug", + "document" + ], + "pathParamDetails": [], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "ThemeCreateParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "Uid", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "themes", + "publicResource": "themes", + "operation": "retrieve", + "publicOperation": "retrieve", + "deprecated": false, + "method": "GET", + "path": "/v1/themes/{slug}", + "pathParams": [ + "slug" + ], + "publicPathParams": [ + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "pathParamDetails": [ + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "ThemeRetrieveParams" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "text/plain", + "encoding": "text", + "contents": [ + { + "contentType": "text/plain", + "encoding": "text" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "themes", + "publicResource": "themes", + "operation": "replaceDocument", + "publicOperation": "replaceDocument", + "deprecated": false, + "method": "PUT", + "path": "/v1/themes/{slug}", + "pathParams": [ + "slug" + ], + "publicPathParams": [ + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "document" + ], + "publicBodyParams": [ + "document" + ], + "pathParamDetails": [ + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "ThemeReplaceDocumentParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "themes", + "publicResource": "themes", + "operation": "delete", + "publicOperation": "delete", + "deprecated": false, + "method": "DELETE", + "path": "/v1/themes/{slug}", + "pathParams": [ + "slug" + ], + "publicPathParams": [ + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "pathParamDetails": [ + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "ThemeDeleteParams" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "themes", + "publicResource": "themes", + "operation": "update", + "publicOperation": "update", + "deprecated": false, + "method": "PATCH", + "path": "/v1/themes/{slug}", + "pathParams": [ + "slug" + ], + "publicPathParams": [ + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "name", + "description" + ], + "publicBodyParams": [ + "name", + "description" + ], + "pathParamDetails": [ + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "ThemeUpdateParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "teams", + "publicResource": "teams", + "operation": "list", + "publicOperation": "list", + "deprecated": false, + "method": "GET", + "path": "/v1/teams", + "pathParams": [], + "publicPathParams": [], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "pathParamDetails": [], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "scalarDocs", + "publicResource": "scalarDocs", + "operation": "listGuides", + "publicOperation": "listGuides", + "deprecated": false, + "method": "GET", + "path": "/v1/guides", + "pathParams": [], + "publicPathParams": [], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "pathParamDetails": [], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "scalarDocs", + "publicResource": "scalarDocs", + "operation": "createGuide", + "publicOperation": "createGuide", + "deprecated": false, + "method": "POST", + "path": "/v1/guides", + "pathParams": [], + "publicPathParams": [], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "name", + "slug", + "isPrivate", + "allowedUsers", + "allowedDomains" + ], + "publicBodyParams": [ + "name", + "slug", + "isPrivate", + "allowedUsers", + "allowedDomains" + ], + "pathParamDetails": [], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "ScalarDocCreateGuideParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "scalarDocs", + "publicResource": "scalarDocs", + "operation": "publishGuide", + "publicOperation": "publishGuide", + "deprecated": false, + "method": "POST", + "path": "/v1/guides/{slug}/publish", + "pathParams": [ + "slug" + ], + "publicPathParams": [ + "slug" + ], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "pathParamDetails": [ + { + "name": "slug", + "required": true, + "style": "simple", + "explode": false + } + ], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "ScalarDocPublishGuideParams" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "namespaces", + "publicResource": "namespaces", + "operation": "list", + "publicOperation": "list", + "deprecated": false, + "method": "GET", + "path": "/v1/namespaces", + "pathParams": [], + "publicPathParams": [], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "pathParamDetails": [], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "authentication", + "publicResource": "authentication", + "operation": "exchangePersonalToken", + "publicOperation": "exchangePersonalToken", + "deprecated": false, + "method": "POST", + "path": "/v1/auth/exchange", + "pathParams": [], + "publicPathParams": [], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [ + "personalToken" + ], + "publicBodyParams": [ + "personalToken" + ], + "pathParamDetails": [], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "paramsModel": { + "publicName": "AuthenticationExchangePersonalTokenParams" + }, + "requestBody": { + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "required": true, + "publicName": "body", + "publicIdentifier": "body" + }, + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + }, + { + "resource": "authentication", + "publicResource": "authentication", + "operation": "listCurrentUser", + "publicOperation": "listCurrentUser", + "deprecated": false, + "method": "GET", + "path": "/v1/auth/me", + "pathParams": [], + "publicPathParams": [], + "queryParams": [], + "publicQueryParams": [], + "headerParams": [], + "publicHeaderParams": [], + "bodyParams": [], + "publicBodyParams": [], + "pathParamDetails": [], + "queryParamDetails": [], + "headerParamDetails": [], + "cookieParams": [], + "publicCookieParams": [], + "cookieParamDetails": [], + "defaultRequestOptions": { + "headers": {} + }, + "response": { + "status": "200", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ] + }, + "responseModel": { + "name": "User", + "publicAliases": [] + }, + "result": { + "successStatus": "200", + "errorStatuses": [ + "400", + "401", + "403", + "404", + "422", + "500" + ] + }, + "errorResponses": [ + { + "status": "400", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_400", + "publicAliases": [] + } + }, + { + "status": "401", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_401", + "publicAliases": [] + } + }, + { + "status": "403", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_403", + "publicAliases": [] + } + }, + { + "status": "404", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_404", + "publicAliases": [] + } + }, + { + "status": "422", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_422", + "publicAliases": [] + } + }, + { + "status": "500", + "contentType": "application/json", + "encoding": "json", + "contents": [ + { + "contentType": "application/json", + "encoding": "json" + } + ], + "model": { + "name": "_500", + "publicAliases": [] + } + } + ], + "responseLinks": [], + "transport": "http" + } + ], + "webhooks": [] +} diff --git a/scripts/finalize-build.mjs b/scripts/finalize-build.mjs new file mode 100644 index 0000000..11472f1 --- /dev/null +++ b/scripts/finalize-build.mjs @@ -0,0 +1,49 @@ +import { readdir, readFile, writeFile } from 'node:fs/promises' +import { dirname, extname, resolve } from 'node:path' +import { fileURLToPath } from 'node:url' + +const root = resolve(dirname(fileURLToPath(import.meta.url)), '..') +const RELATIVE_SPECIFIER_RE = /(from\s+["']|import\(\s*["'])(\.{1,2}\/[^"']+)(["'])/g + +await Promise.all([ + rewriteRelativeSpecifiers(resolve(root, 'dist/esm')), + markCommonJsOutput(resolve(root, 'dist/cjs')), +]) + +async function rewriteRelativeSpecifiers(dir) { + let entries + try { + entries = await readdir(dir, { withFileTypes: true }) + } catch (error) { + if (error && error.code === 'ENOENT') return + throw error + } + + await Promise.all( + entries.map(async (entry) => { + const path = resolve(dir, entry.name) + if (entry.isDirectory()) { + await rewriteRelativeSpecifiers(path) + return + } + if (!path.endsWith('.js') && !path.endsWith('.d.ts')) return + const source = await readFile(path, 'utf8') + await writeFile(path, source.replace(RELATIVE_SPECIFIER_RE, addJsExtension), 'utf8') + }), + ) +} + +async function markCommonJsOutput(dir) { + try { + await readdir(dir) + await writeFile(resolve(dir, 'package.json'), '{\n "type": "commonjs"\n}\n', 'utf8') + } catch (error) { + if (error && error.code === 'ENOENT') return + throw error + } +} + +function addJsExtension(match, prefix, specifier, suffix) { + if (extname(specifier)) return match + return `${prefix}${specifier}.js${suffix}` +} diff --git a/src/api-promise.ts b/src/api-promise.ts new file mode 100644 index 0000000..361cb19 --- /dev/null +++ b/src/api-promise.ts @@ -0,0 +1,76 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +import type { ScalarApi } from './client.js'; +import type { FinalRequestOptions } from './internal/request-options'; + +export type APIResponseProps = { + readonly response: Response; + readonly options: FinalRequestOptions; + readonly controller: AbortController; +}; + +export type ParseResponse = (client: ScalarApi, props: APIResponseProps) => T | Promise; + +export const defaultParseResponse = async (_client: unknown, props: APIResponseProps): Promise => { + const { response } = props; + if (response.status === 204) return null as T; + if (props.options.__binaryResponse) return response as unknown as T; + const contentType = response.headers.get('content-type'); + const isJson = contentType?.includes('application/json') || contentType?.includes('application/vnd.api+json'); + if (isJson) return (await response.json()) as T; + return (await response.text()) as unknown as T; +}; + +/** A Promise subclass providing SDK response helpers. */ +export class APIPromise extends Promise { + private parsedPromise: Promise | undefined; + + constructor( + private readonly client: ScalarApi, + private readonly responsePromise: Promise, + private readonly parseResponse: ParseResponse = defaultParseResponse, + ) { + super((resolve) => { + resolve(undefined as T); + }); + } + + _thenUnwrap(transform: (data: T, props: APIResponseProps) => U): APIPromise { + return new APIPromise(this.client, this.responsePromise, async (client, props) => + transform(await this.parseResponse(client, props), props), + ); + } + + asResponse(): Promise { + return this.responsePromise.then((props) => props.response); + } + + async withResponse(): Promise<{ data: T; response: Response }> { + const [data, response] = await Promise.all([this.parse(), this.asResponse()]); + return { data, response }; + } + + private parse(): Promise { + if (!this.parsedPromise) { + this.parsedPromise = this.responsePromise.then((props) => this.parseResponse(this.client, props)); + } + return this.parsedPromise; + } + + override then( + onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, + onrejected?: ((reason: unknown) => TResult2 | PromiseLike) | undefined | null, + ): Promise { + return this.parse().then(onfulfilled, onrejected); + } + + override catch( + onrejected?: ((reason: unknown) => TResult | PromiseLike) | undefined | null, + ): Promise { + return this.parse().catch(onrejected); + } + + override finally(onfinally?: (() => void) | undefined | null): Promise { + return this.parse().finally(onfinally); + } +} diff --git a/src/client.ts b/src/client.ts new file mode 100644 index 0000000..b2c6f8a --- /dev/null +++ b/src/client.ts @@ -0,0 +1,335 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +import { APIPromise, type APIResponseProps } from './api-promise'; +import * as Errors from './error'; +import { readEnv } from './internal/utils/env'; +import type { Fetch, RequestInfo } from './internal/builtin-types'; +import type { FinalRequestOptions, RequestOptions } from './internal/request-options'; +import { RegistryResource } from "./resources/registry"; +import { SchemaResource } from "./resources/schemas"; +import { LoginPortalResource } from "./resources/login-portals"; +import { RuleResource } from "./resources/rules"; +import { ThemeResource } from "./resources/themes"; +import { TeamResource } from "./resources/teams"; +import { ScalarDocResource } from "./resources/scalar-docs"; +import { NamespaceResource } from "./resources/namespaces"; +import { AuthenticationResource } from "./resources/authentication"; + +type LogFn = (message: string, ...rest: readonly unknown[]) => void; + +export type Logger = { + error: LogFn; + warn: LogFn; + info: LogFn; + debug: LogFn; +}; + +export type LogLevel = 'off' | 'error' | 'warn' | 'info' | 'debug'; + +export type AuthTokenProvider = () => string | Promise; + +const isLogLevel = (value: string | undefined): value is LogLevel => { + if (value === undefined) return false; + return ['off', 'error', 'warn', 'info', 'debug'].includes(value); +}; + +export interface ClientOptions { +/** + * The token used for authentication. + */ + bearerAuth?: string | AuthTokenProvider | undefined; + + /** + * Override the default base URL for the API. + * + * Defaults to process.env["SCALARAPI_BASE_URL"]. + */ + baseURL?: string | null | undefined; + + /** + * The maximum amount of time, in milliseconds, to wait for a response before aborting a request. + * + * Request timeouts are retried by default, so the total time may be longer when retries are enabled. + */ + timeout?: number | undefined; + + /** + * The maximum number of times to retry temporary failures such as network errors, 408, 409, 429, and 5xx responses. + * + * @default 2 + */ + maxRetries?: number | undefined; + + /** + * Default headers to include with every request. + */ + defaultHeaders?: HeadersInit | undefined; + + /** + * Default query parameters to include with every request. + */ + defaultQuery?: Record | undefined; + + /** + * Additional `RequestInit` options to pass to `fetch` calls. + * + * Per-request `fetchOptions` override these values. + */ + fetchOptions?: RequestInit | undefined; + + /** + * Specify a custom `fetch` implementation. + * + * If omitted, the generated client uses global `fetch`. + */ + fetch?: Fetch | undefined; + + /** + * Set the log level. + * + * Defaults to process.env["SCALARAPI_LOG"]. + */ + logLevel?: LogLevel | undefined | null; + + /** + * Set the logger implementation. + * + * Defaults to `console`. + */ + logger?: Logger | undefined | null; +} + +export type ScalarApiOptions = ClientOptions; + +/** + * Manage Scalar platform resources programmatically. The Scalar API lets teams create and update API references, schemas, guides, rulesets, themes, login portals, namespaces, and access controls from automated workflows or custom internal tooling. Use it to keep documentation and developer portals in sync with your source of truth, publish new versions safely, and inspect the teams and authenticated user context available to your integration. + * + * @param {string | AuthTokenProvider | undefined} [opts.bearerAuth=process.env["BEARER_AUTH"] ?? undefined] + * @param {string | null | undefined} [opts.baseURL=process.env["SCALARAPI_BASE_URL"] ?? https://access.scalar.com] - Override the default base URL for the API. + * @param {number} [opts.timeout=60000] - The maximum amount of time, in milliseconds, to wait for a response before aborting a request. + * @param {RequestInit} [opts.fetchOptions] - Additional `RequestInit` options to pass to `fetch` calls. + * @param {Fetch} [opts.fetch] - Specify a custom `fetch` implementation. + * @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request. + * @param {HeadersInit} opts.defaultHeaders - Default headers to include with every request. + * @param {Record} opts.defaultQuery - Default query parameters to include with every request. + * @param {LogLevel | undefined | null} opts.logLevel - Set the log level. + * @param {Logger | undefined | null} opts.logger - Set the logger implementation. + */ +export class ScalarApi { + baseURL: string; + maxRetries: number; + timeout: number; + logger: Logger | undefined; + logLevel: LogLevel | undefined; + fetchOptions: RequestInit | undefined; + private fetchImpl: Fetch; + private options: ClientOptions; + bearerAuth: string | AuthTokenProvider | undefined; + + registry: RegistryResource; + schemas: SchemaResource; + loginPortals: LoginPortalResource; + rules: RuleResource; + themes: ThemeResource; + teams: TeamResource; + scalarDocs: ScalarDocResource; + namespaces: NamespaceResource; + authentication: AuthenticationResource; + + constructor(options: ClientOptions = {}) { + const baseURL = options.baseURL ?? readEnv("SCALARAPI_BASE_URL"); + this.baseURL = baseURL ?? "https://access.scalar.com"; + this.timeout = options.timeout ?? 60000; + this.maxRetries = options.maxRetries ?? 2; + this.fetchImpl = options.fetch ?? defaultFetch(); + this.fetchOptions = options.fetchOptions; + this.logger = options.logger ?? console; + const envLogLevel = readEnv("SCALARAPI_LOG"); + this.logLevel = options.logLevel === null ? undefined : (options.logLevel ?? (isLogLevel(envLogLevel) ? envLogLevel : undefined)); + this.options = options; + this.bearerAuth = options.bearerAuth ?? readEnv("BEARER_AUTH"); + if (this.bearerAuth === undefined) throw new Errors.ScalarApiError("The BEARER_AUTH environment variable is missing or empty; either provide it, or instantiate the ScalarApi client with a bearerAuth option, like new ScalarApi({ bearerAuth: 'My API Key' })."); + this.registry = new RegistryResource(this); + this.schemas = new SchemaResource(this); + this.loginPortals = new LoginPortalResource(this); + this.rules = new RuleResource(this); + this.themes = new ThemeResource(this); + this.teams = new TeamResource(this); + this.scalarDocs = new ScalarDocResource(this); + this.namespaces = new NamespaceResource(this); + this.authentication = new AuthenticationResource(this); + } + + request(method: FinalRequestOptions["method"], path: string, options: RequestOptions = {}): APIPromise { + return new APIPromise(this, this.makeRequest(method, path, options)); + } + + private async makeRequest(method: FinalRequestOptions["method"], path: string, options: RequestOptions = {}, retriesRemaining: number | null = null): Promise { + const finalOptions: FinalRequestOptions = { ...options, method, path }; + const maxRetries = finalOptions.maxRetries ?? this.maxRetries; + retriesRemaining ??= maxRetries; + const url = buildUrl(this.baseURL, finalOptions.path); + for (const [key, value] of Object.entries({ ...this.options.defaultQuery, ...(finalOptions.query ?? {}) })) { + if (value !== undefined) url.searchParams.set(key, String(value)); + } + const headers = normalizeHeaders(await this.authHeadersAsync(), this.options.defaultHeaders, finalOptions.headers); + const retryCount = maxRetries - retriesRemaining; + headers.set("X-Scalar-Retry-Count", String(retryCount)); + headers.set("X-Scalar-Timeout", String(finalOptions.timeout ?? this.timeout)); + const body = serializeBody(finalOptions.body); + const controller = new AbortController(); + if (finalOptions.signal) finalOptions.signal.addEventListener("abort", () => controller.abort()); + const init: RequestInit = { + method: finalOptions.method.toUpperCase(), + headers, + signal: controller.signal, + ...this.fetchOptions, + ...finalOptions.fetchOptions, + }; + if (body !== undefined) init.body = body; + logDebug(this, "request", String(url), finalOptions, headers); + if (finalOptions.signal?.aborted) throw new Errors.APIUserAbortError(undefined, undefined, undefined, undefined); + let response: Response; + try { + response = await this.fetchWithTimeout(url.toString(), init, finalOptions.timeout ?? this.timeout, controller); + } catch (error) { + const cause = castToError(error); + if (finalOptions.signal?.aborted) throw new Errors.APIUserAbortError(undefined, undefined, undefined, undefined); + if (retriesRemaining > 0) return this.retryRequest(finalOptions, retriesRemaining); + if (isAbortError(cause)) throw new Errors.APIConnectionTimeoutError(undefined, undefined, cause.message, undefined); + throw new Errors.APIConnectionError(undefined, undefined, cause.message, undefined); + } + if (!response.ok) { + if (retriesRemaining > 0 && this.shouldRetry(response)) { + logDebug(this, `response (error; retrying, ${retriesRemaining} attempts remaining)`, response.status, String(url), response.headers); + return this.retryRequest(finalOptions, retriesRemaining, response.headers); + } + const error = await safeJson(response); + logDebug(this, "response (error; (error; not retryable))", response.status, String(url), response.headers, error); + throw Errors.APIError.generate(response.status, error, response.statusText, response.headers); + } + return { response, options: finalOptions, controller }; + } + + async fetchWithTimeout(url: RequestInfo, init: RequestInit | undefined, ms: number, controller: AbortController): Promise { + const timeout = setTimeout(() => controller.abort(), ms); + try { + return await this.fetchImpl(url, init); + } finally { + clearTimeout(timeout); + } + } + + private shouldRetry(response: Response): boolean { + const shouldRetryHeader = response.headers.get('x-should-retry'); + if (shouldRetryHeader === 'true') return true; + if (shouldRetryHeader === 'false') return false; + if (response.status === 408 || response.status === 409 || response.status === 429) return true; + return response.status >= 500; + } + + private async retryRequest(options: FinalRequestOptions, retriesRemaining: number, responseHeaders?: Headers): Promise { + await sleep(this.retryDelayMillis(options, retriesRemaining, responseHeaders)); + return this.makeRequest(options.method, options.path, options, retriesRemaining - 1); + } + + private retryDelayMillis(options: FinalRequestOptions, retriesRemaining: number, responseHeaders?: Headers): number { + const retryAfterMillisHeader = responseHeaders?.get('retry-after-ms'); + if (retryAfterMillisHeader) { + const millis = Number.parseFloat(retryAfterMillisHeader); + if (!Number.isNaN(millis) && millis >= 0 && millis < 60000) return millis; + } + const retryAfterHeader = responseHeaders?.get('retry-after'); + if (retryAfterHeader) { + const seconds = Number.parseFloat(retryAfterHeader); + const millis = Number.isNaN(seconds) ? Date.parse(retryAfterHeader) - Date.now() : seconds * 1000; + if (millis >= 0 && millis < 60000) return millis; + } + const maxRetries = options.maxRetries ?? this.maxRetries; + const retryCount = maxRetries - retriesRemaining; + const delay = Math.min(0.5 * 2 ** retryCount, 8); + return delay * (1 - Math.random() * 0.25) * 1000; + } + + get(path: string, options?: RequestOptions): APIPromise { return this.request('get', path, options); } + post(path: string, options?: RequestOptions): APIPromise { return this.request('post', path, options); } + put(path: string, options?: RequestOptions): APIPromise { return this.request('put', path, options); } + patch(path: string, options?: RequestOptions): APIPromise { return this.request('patch', path, options); } + delete(path: string, options?: RequestOptions): APIPromise { return this.request('delete', path, options); } + + authHeaders(): Record { + const headers: Record = {}; + const bearerAuth = this.resolveAuthOptionSync("bearerAuth", this.bearerAuth); + if (bearerAuth) headers['Authorization'] = `Bearer ${bearerAuth}`; + return headers; + } + + private async authHeadersAsync(): Promise> { + const headers: Record = {}; + const bearerAuth = await this.resolveAuthOption("bearerAuth", this.bearerAuth); + if (bearerAuth) headers['Authorization'] = `Bearer ${bearerAuth}`; + return headers; + } + + private async resolveAuthOption(optionName: string, value: string | AuthTokenProvider | undefined): Promise { + if (value === undefined) return undefined; + const token = typeof value === "function" ? await value() : value; + if (!token) throw new Errors.ScalarApiError(`Expected '${optionName}' to resolve to a non-empty string.`); + return token; + } + + private resolveAuthOptionSync(optionName: string, value: string | AuthTokenProvider | undefined): string | undefined { + if (value === undefined) return undefined; + const token = typeof value === "function" ? value() : value; + if (typeof token !== "string" || !token) throw new Errors.ScalarApiError(`Expected '${optionName}' to resolve to a non-empty string.`); + return token; + } +} + +const serializeBody = (body: unknown): BodyInit | undefined => { + if (body === undefined) return undefined; + if (typeof body === 'string' || body instanceof Blob || body instanceof FormData || body instanceof URLSearchParams) return body; + return JSON.stringify(body); +}; + +const buildUrl = (baseURL: string, path: string): URL => { + const base = baseURL.endsWith("/") ? baseURL : `${baseURL}/`; + return new URL(path.replace(/^\/+/, ""), base); +}; + +const normalizeHeaders = (...sources: readonly (HeadersInit | Record | undefined)[]): Headers => { + const headers = new Headers(); + for (const source of sources) { + if (!source) continue; + if (Array.isArray(source) || source instanceof Headers) { + new Headers(source).forEach((value, key) => headers.set(key, value)); + continue; + } + for (const [key, value] of Object.entries(source)) { + if (value !== undefined) headers.set(key, String(value)); + } + } + return headers; +}; + +const safeJson = async (response: Response): Promise => { + try { return await response.json(); } catch { return undefined; } +}; + +const sleep = (ms: number): Promise => new Promise((resolve) => setTimeout(resolve, ms)); + +const castToError = (error: unknown): Error => (error instanceof Error ? error : new Error(String(error))); + +const isAbortError = (error: Error): boolean => error.name === "AbortError"; + +const defaultFetch = (): Fetch => { + const fetchImpl = globalThis.fetch; + if (typeof fetchImpl !== "function") { + throw new Errors.ScalarApiError('No fetch implementation found; pass `fetch` in client options.'); + } + return fetchImpl.bind(globalThis) as Fetch; +}; + +const logDebug = (client: { logger: Logger | undefined; logLevel: LogLevel | undefined }, message: string, ...rest: readonly unknown[]): void => { + if (client.logLevel === undefined || client.logLevel === 'debug') client.logger?.debug(message, ...rest); +}; diff --git a/src/core.ts b/src/core.ts deleted file mode 100644 index c60d397..0000000 --- a/src/core.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* - * 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 ScalarCore extends ClientSDK {} diff --git a/src/error.ts b/src/error.ts new file mode 100644 index 0000000..6fbd6ef --- /dev/null +++ b/src/error.ts @@ -0,0 +1,48 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +export class ScalarApiError extends Error {} + +export class APIError extends Error { + readonly status: TStatus; + readonly headers: THeaders | undefined; + readonly error: TError | undefined; + + constructor(status: TStatus, error: TError | undefined, message: string | undefined, headers: THeaders | undefined) { + super(APIError.makeMessage(status, error, message)); + this.status = status; + this.headers = headers; + this.error = error; + } + + private static makeMessage(status: number | undefined, error: unknown, message: string | undefined): string { + const bodyMessage = typeof error === 'object' && error !== null && 'message' in error ? (error as { message?: unknown }).message : undefined; + const msg = typeof bodyMessage === 'string' ? bodyMessage : bodyMessage !== undefined ? JSON.stringify(bodyMessage) : error ? JSON.stringify(error) : message; + if (status && msg) return `${status} ${msg}`; + if (status) return `${status} status code (no body)`; + return msg ?? '(no status code or body)'; + } + + static generate(status: number | undefined, error: unknown, message: string | undefined, headers: Headers | undefined): APIError { + if (status === 400) return new BadRequestError(status, error, message, headers); + if (status === 401) return new AuthenticationError(status, error, message, headers); + if (status === 403) return new PermissionDeniedError(status, error, message, headers); + if (status === 404) return new NotFoundError(status, error, message, headers); + if (status === 409) return new ConflictError(status, error, message, headers); + if (status === 422) return new UnprocessableEntityError(status, error, message, headers); + if (status === 429) return new RateLimitError(status, error, message, headers); + if (status && status >= 500) return new InternalServerError(status, error, message, headers); + return new APIError(status, error, message, headers); + } +} + +export class APIUserAbortError extends APIError {} +export class APIConnectionError extends APIError {} +export class APIConnectionTimeoutError extends APIConnectionError {} +export class BadRequestError extends APIError<400> {} +export class AuthenticationError extends APIError<401> {} +export class PermissionDeniedError extends APIError<403> {} +export class NotFoundError extends APIError<404> {} +export class ConflictError extends APIError<409> {} +export class UnprocessableEntityError extends APIError<422> {} +export class RateLimitError extends APIError<429> {} +export class InternalServerError extends APIError {} diff --git a/src/funcs/authenticationExchangePersonalToken.ts b/src/funcs/authenticationExchangePersonalToken.ts deleted file mode 100644 index ffeae34..0000000 --- a/src/funcs/authenticationExchangePersonalToken.ts +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeJSON } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Exchange token - * - * @remarks - * Exchange an API key for an access token. - */ -export function authenticationExchangePersonalToken( - client: ScalarCore, - request: operations.ExchangePersonalTokenRequestBody, - options?: RequestOptions, -): APIPromise< - Result< - operations.ExchangePersonalTokenResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.ExchangePersonalTokenRequestBody, - options?: RequestOptions, -): Promise< - [ - Result< - operations.ExchangePersonalTokenResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.ExchangePersonalTokenRequestBody$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload, { explode: true }); - - const path = pathToFunc("/v1/auth/exchange")(); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "exchangePersonalToken", - oAuth2Scopes: [], - - resolvedSecurity: null, - - securitySource: null, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.ExchangePersonalTokenResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.ExchangePersonalTokenResponse$inboundSchema, { - key: "object", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/authenticationGetCurrentUser.ts b/src/funcs/authenticationGetCurrentUser.ts deleted file mode 100644 index f5b773e..0000000 --- a/src/funcs/authenticationGetCurrentUser.ts +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Get current user - * - * @remarks - * Get the authenticated user, including their available teams and theme. - */ -export function authenticationGetCurrentUser( - client: ScalarCore, - options?: RequestOptions, -): APIPromise< - Result< - operations.GetCurrentUserResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - options, - )); -} - -async function $do( - client: ScalarCore, - options?: RequestOptions, -): Promise< - [ - Result< - operations.GetCurrentUserResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const path = pathToFunc("/v1/auth/me")(); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "getCurrentUser", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.GetCurrentUserResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.GetCurrentUserResponse$inboundSchema, { - key: "user", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/loginPortalsCreateLoginPortal.ts b/src/funcs/loginPortalsCreateLoginPortal.ts deleted file mode 100644 index ea3c504..0000000 --- a/src/funcs/loginPortalsCreateLoginPortal.ts +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeJSON } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Create a portal - * - * @remarks - * Create a login portal for the current team. - */ -export function loginPortalsCreateLoginPortal( - client: ScalarCore, - request: operations.CreateLoginPortalRequestBody, - options?: RequestOptions, -): APIPromise< - Result< - operations.CreateLoginPortalResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.CreateLoginPortalRequestBody, - options?: RequestOptions, -): Promise< - [ - Result< - operations.CreateLoginPortalResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.CreateLoginPortalRequestBody$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload, { explode: true }); - - const path = pathToFunc("/v1/login-portals")(); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "createLoginPortal", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.CreateLoginPortalResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.CreateLoginPortalResponse$inboundSchema, { - key: "uid", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/loginPortalsDeleteLoginPortal.ts b/src/funcs/loginPortalsDeleteLoginPortal.ts deleted file mode 100644 index f7e4afb..0000000 --- a/src/funcs/loginPortalsDeleteLoginPortal.ts +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Delete a login portal - * - * @remarks - * Delete a login portal. - */ -export function loginPortalsDeleteLoginPortal( - client: ScalarCore, - request: operations.DeleteLoginPortalRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.DeleteLoginPortalResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.DeleteLoginPortalRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.DeleteLoginPortalResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.DeleteLoginPortalRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - slug: encodeSimple("slug", payload.slug, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/login-portals/{slug}")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "deleteLoginPortal", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "DELETE", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.DeleteLoginPortalResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.DeleteLoginPortalResponse$inboundSchema, { - key: "any", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/loginPortalsGetLoginPortal.ts b/src/funcs/loginPortalsGetLoginPortal.ts deleted file mode 100644 index 40329cc..0000000 --- a/src/funcs/loginPortalsGetLoginPortal.ts +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Get a login portal - * - * @remarks - * Get a login portal by slug. - */ -export function loginPortalsGetLoginPortal( - client: ScalarCore, - request: operations.GetLoginPortalRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.GetLoginPortalResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.GetLoginPortalRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.GetLoginPortalResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.GetLoginPortalRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - slug: encodeSimple("slug", payload.slug, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/login-portals/{slug}")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "getLoginPortal", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.GetLoginPortalResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.GetLoginPortalResponse$inboundSchema, { - key: "object", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/loginPortalsListLoginPortals.ts b/src/funcs/loginPortalsListLoginPortals.ts deleted file mode 100644 index e04eab1..0000000 --- a/src/funcs/loginPortalsListLoginPortals.ts +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * List all portals - * - * @remarks - * List all login portals for the current team. - */ -export function loginPortalsListLoginPortals( - client: ScalarCore, - options?: RequestOptions, -): APIPromise< - Result< - operations.ListLoginPortalsResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - options, - )); -} - -async function $do( - client: ScalarCore, - options?: RequestOptions, -): Promise< - [ - Result< - operations.ListLoginPortalsResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const path = pathToFunc("/v1/login-portals")(); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "listLoginPortals", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.ListLoginPortalsResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.ListLoginPortalsResponse$inboundSchema, { - key: "login-portals", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/loginPortalsUpdateLoginPortal.ts b/src/funcs/loginPortalsUpdateLoginPortal.ts deleted file mode 100644 index 45036ac..0000000 --- a/src/funcs/loginPortalsUpdateLoginPortal.ts +++ /dev/null @@ -1,198 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Update portal metadata - * - * @remarks - * Update metadata for a login portal. - */ -export function loginPortalsUpdateLoginPortal( - client: ScalarCore, - request: operations.UpdateLoginPortalRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.UpdateLoginPortalResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.UpdateLoginPortalRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.UpdateLoginPortalResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.UpdateLoginPortalRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.RequestBody, { explode: true }); - - const pathParams = { - slug: encodeSimple("slug", payload.slug, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/login-portals/{slug}")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "updateLoginPortal", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PATCH", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.UpdateLoginPortalResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.UpdateLoginPortalResponse$inboundSchema, { - key: "any", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/namespacesListNamespaces.ts b/src/funcs/namespacesListNamespaces.ts deleted file mode 100644 index 8fd757a..0000000 --- a/src/funcs/namespacesListNamespaces.ts +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * List namespaces - * - * @remarks - * Get all namespaces for the current team - */ -export function namespacesListNamespaces( - client: ScalarCore, - options?: RequestOptions, -): APIPromise< - Result< - operations.ListNamespacesResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - options, - )); -} - -async function $do( - client: ScalarCore, - options?: RequestOptions, -): Promise< - [ - Result< - operations.ListNamespacesResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const path = pathToFunc("/v1/namespaces")(); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "listNamespaces", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.ListNamespacesResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.ListNamespacesResponse$inboundSchema, { - key: "strings", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/registryAddApiDocumentAccessGroup.ts b/src/funcs/registryAddApiDocumentAccessGroup.ts deleted file mode 100644 index d19fa33..0000000 --- a/src/funcs/registryAddApiDocumentAccessGroup.ts +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Add access group - * - * @remarks - * Add an access group to an API document. - */ -export function registryAddApiDocumentAccessGroup( - client: ScalarCore, - request: operations.AddApiDocumentAccessGroupRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.AddApiDocumentAccessGroupResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.AddApiDocumentAccessGroupRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.AddApiDocumentAccessGroupResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.AddApiDocumentAccessGroupRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload["access-group"], { explode: true }); - - const pathParams = { - namespace: encodeSimple("namespace", payload.namespace, { - explode: false, - charEncoding: "percent", - }), - slug: encodeSimple("slug", payload.slug, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/apis/{namespace}/{slug}/access-group")( - pathParams, - ); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "addApiDocumentAccessGroup", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.AddApiDocumentAccessGroupResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.AddApiDocumentAccessGroupResponse$inboundSchema, { - key: "any", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/registryCreateApiDocument.ts b/src/funcs/registryCreateApiDocument.ts deleted file mode 100644 index 6b918bf..0000000 --- a/src/funcs/registryCreateApiDocument.ts +++ /dev/null @@ -1,198 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Create API Document - * - * @remarks - * Create an API document. - */ -export function registryCreateApiDocument( - client: ScalarCore, - request: operations.CreateApiDocumentRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.CreateApiDocumentResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.CreateApiDocumentRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.CreateApiDocumentResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.CreateApiDocumentRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.RequestBody, { explode: true }); - - const pathParams = { - namespace: encodeSimple("namespace", payload.namespace, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/apis/{namespace}")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "createApiDocument", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.CreateApiDocumentResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.CreateApiDocumentResponse$inboundSchema, { - key: "object", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/registryCreateApiDocumentVersion.ts b/src/funcs/registryCreateApiDocumentVersion.ts deleted file mode 100644 index 4c76409..0000000 --- a/src/funcs/registryCreateApiDocumentVersion.ts +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Create API Document version - * - * @remarks - * Create a new API document version. - */ -export function registryCreateApiDocumentVersion( - client: ScalarCore, - request: operations.CreateApiDocumentVersionRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.CreateApiDocumentVersionResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.CreateApiDocumentVersionRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.CreateApiDocumentVersionResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.CreateApiDocumentVersionRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.RequestBody, { explode: true }); - - const pathParams = { - namespace: encodeSimple("namespace", payload.namespace, { - explode: false, - charEncoding: "percent", - }), - slug: encodeSimple("slug", payload.slug, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/apis/{namespace}/{slug}/version")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "createApiDocumentVersion", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.CreateApiDocumentVersionResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.CreateApiDocumentVersionResponse$inboundSchema, { - key: "managed-doc-version", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/registryDeleteApiDocument.ts b/src/funcs/registryDeleteApiDocument.ts deleted file mode 100644 index 474fba6..0000000 --- a/src/funcs/registryDeleteApiDocument.ts +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Delete API Document - * - * @remarks - * Delete an API document and all versions. - */ -export function registryDeleteApiDocument( - client: ScalarCore, - request: operations.DeleteApiDocumentRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.DeleteApiDocumentResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.DeleteApiDocumentRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.DeleteApiDocumentResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.DeleteApiDocumentRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - namespace: encodeSimple("namespace", payload.namespace, { - explode: false, - charEncoding: "percent", - }), - slug: encodeSimple("slug", payload.slug, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/apis/{namespace}/{slug}")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "deleteApiDocument", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "DELETE", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.DeleteApiDocumentResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.DeleteApiDocumentResponse$inboundSchema, { - key: "any", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/registryDeleteApiDocumentVersion.ts b/src/funcs/registryDeleteApiDocumentVersion.ts deleted file mode 100644 index 42c1eae..0000000 --- a/src/funcs/registryDeleteApiDocumentVersion.ts +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Delete API Document version - * - * @remarks - * Delete a specific API document version. - */ -export function registryDeleteApiDocumentVersion( - client: ScalarCore, - request: operations.DeleteApiDocumentVersionRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.DeleteApiDocumentVersionResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.DeleteApiDocumentVersionRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.DeleteApiDocumentVersionResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.DeleteApiDocumentVersionRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - namespace: encodeSimple("namespace", payload.namespace, { - explode: false, - charEncoding: "percent", - }), - semver: encodeSimple("semver", payload.semver, { - explode: false, - charEncoding: "percent", - }), - slug: encodeSimple("slug", payload.slug, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/apis/{namespace}/{slug}/version/{semver}")( - pathParams, - ); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "deleteApiDocumentVersion", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "DELETE", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.DeleteApiDocumentVersionResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.DeleteApiDocumentVersionResponse$inboundSchema, { - key: "any", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/registryGetApiDocumentVersion.ts b/src/funcs/registryGetApiDocumentVersion.ts deleted file mode 100644 index c121cb7..0000000 --- a/src/funcs/registryGetApiDocumentVersion.ts +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Get API Document - * - * @remarks - * Get a specific API document version. - */ -export function registryGetApiDocumentVersion( - client: ScalarCore, - request: operations.GetApiDocumentVersionRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.GetApiDocumentVersionResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.GetApiDocumentVersionRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.GetApiDocumentVersionResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.GetApiDocumentVersionRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - namespace: encodeSimple("namespace", payload.namespace, { - explode: false, - charEncoding: "percent", - }), - semver: encodeSimple("semver", payload.semver, { - explode: false, - charEncoding: "percent", - }), - slug: encodeSimple("slug", payload.slug, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/apis/{namespace}/{slug}/version/{semver}")( - pathParams, - ); - - const headers = new Headers(compactMap({ - Accept: "text/plain", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "getApiDocumentVersion", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.GetApiDocumentVersionResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.text(200, operations.GetApiDocumentVersionResponse$inboundSchema, { - key: "res", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/registryGetApiDocumentVersionMetadata.ts b/src/funcs/registryGetApiDocumentVersionMetadata.ts deleted file mode 100644 index 863f3b9..0000000 --- a/src/funcs/registryGetApiDocumentVersionMetadata.ts +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Get API Document version metadata - * - * @remarks - * Get metadata (uid, content shas, version sha, tags) for a specific API document version. - */ -export function registryGetApiDocumentVersionMetadata( - client: ScalarCore, - request: operations.GetApiDocumentVersionMetadataRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.GetApiDocumentVersionMetadataResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.GetApiDocumentVersionMetadataRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.GetApiDocumentVersionMetadataResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.GetApiDocumentVersionMetadataRequest$outboundSchema.parse( - value, - ), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - namespace: encodeSimple("namespace", payload.namespace, { - explode: false, - charEncoding: "percent", - }), - semver: encodeSimple("semver", payload.semver, { - explode: false, - charEncoding: "percent", - }), - slug: encodeSimple("slug", payload.slug, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc( - "/v1/apis/{namespace}/{slug}/version/{semver}/metadata", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "getApiDocumentVersionMetadata", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.GetApiDocumentVersionMetadataResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json( - 200, - operations.GetApiDocumentVersionMetadataResponse$inboundSchema, - { key: "managed-doc-version" }, - ), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/registryListAllApiDocuments.ts b/src/funcs/registryListAllApiDocuments.ts deleted file mode 100644 index dad95f5..0000000 --- a/src/funcs/registryListAllApiDocuments.ts +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * List all API Documents - * - * @remarks - * List all API documents across every namespace the caller can access. - */ -export function registryListAllApiDocuments( - client: ScalarCore, - options?: RequestOptions, -): APIPromise< - Result< - operations.ListAllApiDocumentsResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - options, - )); -} - -async function $do( - client: ScalarCore, - options?: RequestOptions, -): Promise< - [ - Result< - operations.ListAllApiDocumentsResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const path = pathToFunc("/v1/apis")(); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "listAllApiDocuments", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.ListAllApiDocumentsResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.ListAllApiDocumentsResponse$inboundSchema, { - key: "api-documents", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/registryListApiDocuments.ts b/src/funcs/registryListApiDocuments.ts deleted file mode 100644 index 8613a1b..0000000 --- a/src/funcs/registryListApiDocuments.ts +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * List API Documents in a namespace - * - * @remarks - * List API documents in a namespace. - */ -export function registryListApiDocuments( - client: ScalarCore, - request: operations.ListApiDocumentsRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.ListApiDocumentsResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.ListApiDocumentsRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.ListApiDocumentsResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.ListApiDocumentsRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - namespace: encodeSimple("namespace", payload.namespace, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/apis/{namespace}")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "listApiDocuments", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.ListApiDocumentsResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.ListApiDocumentsResponse$inboundSchema, { - key: "api-documents", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/registryRemoveApiDocumentAccessGroup.ts b/src/funcs/registryRemoveApiDocumentAccessGroup.ts deleted file mode 100644 index 4cb06d5..0000000 --- a/src/funcs/registryRemoveApiDocumentAccessGroup.ts +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Remove access group - * - * @remarks - * Remove an access group from an API document. - */ -export function registryRemoveApiDocumentAccessGroup( - client: ScalarCore, - request: operations.RemoveApiDocumentAccessGroupRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.RemoveApiDocumentAccessGroupResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.RemoveApiDocumentAccessGroupRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.RemoveApiDocumentAccessGroupResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.RemoveApiDocumentAccessGroupRequest$outboundSchema.parse( - value, - ), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload["access-group"], { explode: true }); - - const pathParams = { - namespace: encodeSimple("namespace", payload.namespace, { - explode: false, - charEncoding: "percent", - }), - slug: encodeSimple("slug", payload.slug, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/apis/{namespace}/{slug}/access-group")( - pathParams, - ); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "removeApiDocumentAccessGroup", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "DELETE", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.RemoveApiDocumentAccessGroupResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.RemoveApiDocumentAccessGroupResponse$inboundSchema, { - key: "any", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/registryUpdateApiDocument.ts b/src/funcs/registryUpdateApiDocument.ts deleted file mode 100644 index 1b591c8..0000000 --- a/src/funcs/registryUpdateApiDocument.ts +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Update API Document metadata - * - * @remarks - * Update metadata for an API document. - */ -export function registryUpdateApiDocument( - client: ScalarCore, - request: operations.UpdateApiDocumentRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.UpdateApiDocumentResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.UpdateApiDocumentRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.UpdateApiDocumentResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.UpdateApiDocumentRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.RequestBody, { explode: true }); - - const pathParams = { - namespace: encodeSimple("namespace", payload.namespace, { - explode: false, - charEncoding: "percent", - }), - slug: encodeSimple("slug", payload.slug, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/apis/{namespace}/{slug}")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "updateApiDocument", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PATCH", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.UpdateApiDocumentResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.UpdateApiDocumentResponse$inboundSchema, { - key: "any", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/registryUpdateApiDocumentVersion.ts b/src/funcs/registryUpdateApiDocumentVersion.ts deleted file mode 100644 index 58e1c76..0000000 --- a/src/funcs/registryUpdateApiDocumentVersion.ts +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Update API Document version - * - * @remarks - * Update the registry file content for an API document version. - */ -export function registryUpdateApiDocumentVersion( - client: ScalarCore, - request: operations.UpdateApiDocumentVersionRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.UpdateApiDocumentVersionResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.UpdateApiDocumentVersionRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.UpdateApiDocumentVersionResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.UpdateApiDocumentVersionRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.RequestBody, { explode: true }); - - const pathParams = { - namespace: encodeSimple("namespace", payload.namespace, { - explode: false, - charEncoding: "percent", - }), - semver: encodeSimple("semver", payload.semver, { - explode: false, - charEncoding: "percent", - }), - slug: encodeSimple("slug", payload.slug, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/apis/{namespace}/{slug}/version/{semver}")( - pathParams, - ); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "updateApiDocumentVersion", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PATCH", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.UpdateApiDocumentVersionResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.UpdateApiDocumentVersionResponse$inboundSchema, { - key: "object", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/rulesAddRulesetAccessGroup.ts b/src/funcs/rulesAddRulesetAccessGroup.ts deleted file mode 100644 index a4c0388..0000000 --- a/src/funcs/rulesAddRulesetAccessGroup.ts +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Add rule access group - * - * @remarks - * Grant an access group to a rule. - */ -export function rulesAddRulesetAccessGroup( - client: ScalarCore, - request: operations.AddRulesetAccessGroupRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.AddRulesetAccessGroupResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.AddRulesetAccessGroupRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.AddRulesetAccessGroupResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.AddRulesetAccessGroupRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload["access-group"], { explode: true }); - - const pathParams = { - namespace: encodeSimple("namespace", payload.namespace, { - explode: false, - charEncoding: "percent", - }), - slug: encodeSimple("slug", payload.slug, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/rulesets/{namespace}/{slug}/access-group")( - pathParams, - ); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "addRulesetAccessGroup", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.AddRulesetAccessGroupResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.AddRulesetAccessGroupResponse$inboundSchema, { - key: "any", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/rulesCreateRuleset.ts b/src/funcs/rulesCreateRuleset.ts deleted file mode 100644 index e066497..0000000 --- a/src/funcs/rulesCreateRuleset.ts +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Create a rule - * - * @remarks - * Create a rule in a namespace. - */ -export function rulesCreateRuleset( - client: ScalarCore, - request: operations.CreateRulesetRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.CreateRulesetResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.CreateRulesetRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.CreateRulesetResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.CreateRulesetRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.RequestBody, { explode: true }); - - const pathParams = { - namespace: encodeSimple("namespace", payload.namespace, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/rulesets/{namespace}")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "createRuleset", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.CreateRulesetResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.CreateRulesetResponse$inboundSchema, { key: "uid" }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/rulesDeleteRuleset.ts b/src/funcs/rulesDeleteRuleset.ts deleted file mode 100644 index e551a27..0000000 --- a/src/funcs/rulesDeleteRuleset.ts +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Delete a rule - * - * @remarks - * Delete a rule by slug. - */ -export function rulesDeleteRuleset( - client: ScalarCore, - request: operations.DeleteRulesetRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.DeleteRulesetResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.DeleteRulesetRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.DeleteRulesetResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.DeleteRulesetRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - namespace: encodeSimple("namespace", payload.namespace, { - explode: false, - charEncoding: "percent", - }), - slug: encodeSimple("slug", payload.slug, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/rulesets/{namespace}/{slug}")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "deleteRuleset", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "DELETE", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.DeleteRulesetResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.DeleteRulesetResponse$inboundSchema, { key: "any" }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/rulesGetRulesetDocument.ts b/src/funcs/rulesGetRulesetDocument.ts deleted file mode 100644 index e470234..0000000 --- a/src/funcs/rulesGetRulesetDocument.ts +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Get a rule - * - * @remarks - * Get a rule document by slug. - */ -export function rulesGetRulesetDocument( - client: ScalarCore, - request: operations.GetRulesetDocumentRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.GetRulesetDocumentResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.GetRulesetDocumentRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.GetRulesetDocumentResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.GetRulesetDocumentRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - namespace: encodeSimple("namespace", payload.namespace, { - explode: false, - charEncoding: "percent", - }), - slug: encodeSimple("slug", payload.slug, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/rulesets/{namespace}/{slug}")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "text/plain", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "getRulesetDocument", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.GetRulesetDocumentResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.text(200, operations.GetRulesetDocumentResponse$inboundSchema, { - key: "res", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/rulesListRulesets.ts b/src/funcs/rulesListRulesets.ts deleted file mode 100644 index 5564b45..0000000 --- a/src/funcs/rulesListRulesets.ts +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * List all rules - * - * @remarks - * List all rulesets in a namespace. - */ -export function rulesListRulesets( - client: ScalarCore, - request: operations.ListRulesetsRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.ListRulesetsResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.ListRulesetsRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.ListRulesetsResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.ListRulesetsRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - namespace: encodeSimple("namespace", payload.namespace, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/rulesets/{namespace}")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "listRulesets", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.ListRulesetsResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.ListRulesetsResponse$inboundSchema, { - key: "rules", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/rulesRemoveRulesetAccessGroup.ts b/src/funcs/rulesRemoveRulesetAccessGroup.ts deleted file mode 100644 index cc14ddb..0000000 --- a/src/funcs/rulesRemoveRulesetAccessGroup.ts +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Remove rule access group - * - * @remarks - * Remove an access group from a rule. - */ -export function rulesRemoveRulesetAccessGroup( - client: ScalarCore, - request: operations.RemoveRulesetAccessGroupRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.RemoveRulesetAccessGroupResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.RemoveRulesetAccessGroupRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.RemoveRulesetAccessGroupResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.RemoveRulesetAccessGroupRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload["access-group"], { explode: true }); - - const pathParams = { - namespace: encodeSimple("namespace", payload.namespace, { - explode: false, - charEncoding: "percent", - }), - slug: encodeSimple("slug", payload.slug, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/rulesets/{namespace}/{slug}/access-group")( - pathParams, - ); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "removeRulesetAccessGroup", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "DELETE", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.RemoveRulesetAccessGroupResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.RemoveRulesetAccessGroupResponse$inboundSchema, { - key: "any", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/rulesUpdateRuleset.ts b/src/funcs/rulesUpdateRuleset.ts deleted file mode 100644 index 381cad9..0000000 --- a/src/funcs/rulesUpdateRuleset.ts +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Update rule metadata - * - * @remarks - * Update rule metadata by slug. - */ -export function rulesUpdateRuleset( - client: ScalarCore, - request: operations.UpdateRulesetRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.UpdateRulesetResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.UpdateRulesetRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.UpdateRulesetResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.UpdateRulesetRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.RequestBody, { explode: true }); - - const pathParams = { - namespace: encodeSimple("namespace", payload.namespace, { - explode: false, - charEncoding: "percent", - }), - slug: encodeSimple("slug", payload.slug, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/rulesets/{namespace}/{slug}")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "updateRuleset", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PATCH", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.UpdateRulesetResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.UpdateRulesetResponse$inboundSchema, { key: "any" }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/scalarDocsCreateGuide.ts b/src/funcs/scalarDocsCreateGuide.ts deleted file mode 100644 index b0cd796..0000000 --- a/src/funcs/scalarDocsCreateGuide.ts +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeJSON } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Create a project - * - * @remarks - * Create a guide project. - */ -export function scalarDocsCreateGuide( - client: ScalarCore, - request: operations.CreateGuideRequestBody, - options?: RequestOptions, -): APIPromise< - Result< - operations.CreateGuideResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.CreateGuideRequestBody, - options?: RequestOptions, -): Promise< - [ - Result< - operations.CreateGuideResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.CreateGuideRequestBody$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload, { explode: true }); - - const path = pathToFunc("/v1/guides")(); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "createGuide", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.CreateGuideResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.CreateGuideResponse$inboundSchema, { - key: "object", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/scalarDocsListGuides.ts b/src/funcs/scalarDocsListGuides.ts deleted file mode 100644 index b1170e4..0000000 --- a/src/funcs/scalarDocsListGuides.ts +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * List all projects - * - * @remarks - * List all guide projects. - */ -export function scalarDocsListGuides( - client: ScalarCore, - options?: RequestOptions, -): APIPromise< - Result< - operations.ListGuidesResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - options, - )); -} - -async function $do( - client: ScalarCore, - options?: RequestOptions, -): Promise< - [ - Result< - operations.ListGuidesResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const path = pathToFunc("/v1/guides")(); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "listGuides", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.ListGuidesResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.ListGuidesResponse$inboundSchema, { - key: "github-projects", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/scalarDocsPublishGuide.ts b/src/funcs/scalarDocsPublishGuide.ts deleted file mode 100644 index bfa9c0f..0000000 --- a/src/funcs/scalarDocsPublishGuide.ts +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Publish a project - * - * @remarks - * Start a new publish process. - */ -export function scalarDocsPublishGuide( - client: ScalarCore, - request: operations.PublishGuideRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.PublishGuideResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.PublishGuideRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.PublishGuideResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.PublishGuideRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - slug: encodeSimple("slug", payload.slug, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/guides/{slug}/publish")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "publishGuide", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.PublishGuideResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.PublishGuideResponse$inboundSchema, { - key: "object", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/schemasAddSchemaAccessGroup.ts b/src/funcs/schemasAddSchemaAccessGroup.ts deleted file mode 100644 index a1a2bda..0000000 --- a/src/funcs/schemasAddSchemaAccessGroup.ts +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Add shared component access group - * - * @remarks - * Add an access group to a schema. - */ -export function schemasAddSchemaAccessGroup( - client: ScalarCore, - request: operations.AddSchemaAccessGroupRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.AddSchemaAccessGroupResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.AddSchemaAccessGroupRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.AddSchemaAccessGroupResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.AddSchemaAccessGroupRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload["access-group"], { explode: true }); - - const pathParams = { - namespace: encodeSimple("namespace", payload.namespace, { - explode: false, - charEncoding: "percent", - }), - slug: encodeSimple("slug", payload.slug, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/schemas/{namespace}/{slug}/access-group")( - pathParams, - ); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "addSchemaAccessGroup", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.AddSchemaAccessGroupResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.AddSchemaAccessGroupResponse$inboundSchema, { - key: "any", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/schemasCreateSchema.ts b/src/funcs/schemasCreateSchema.ts deleted file mode 100644 index 65e9f09..0000000 --- a/src/funcs/schemasCreateSchema.ts +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Create a shared component - * - * @remarks - * Create a schema in a namespace. - */ -export function schemasCreateSchema( - client: ScalarCore, - request: operations.CreateSchemaRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.CreateSchemaResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.CreateSchemaRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.CreateSchemaResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.CreateSchemaRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.RequestBody, { explode: true }); - - const pathParams = { - namespace: encodeSimple("namespace", payload.namespace, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/schemas/{namespace}")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "createSchema", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.CreateSchemaResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.CreateSchemaResponse$inboundSchema, { key: "uid" }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/schemasCreateSchemaVersion.ts b/src/funcs/schemasCreateSchemaVersion.ts deleted file mode 100644 index ed74613..0000000 --- a/src/funcs/schemasCreateSchemaVersion.ts +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Create a shared component version - * - * @remarks - * Create a schema version. - */ -export function schemasCreateSchemaVersion( - client: ScalarCore, - request: operations.CreateSchemaVersionRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.CreateSchemaVersionResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.CreateSchemaVersionRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.CreateSchemaVersionResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.CreateSchemaVersionRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.RequestBody, { explode: true }); - - const pathParams = { - namespace: encodeSimple("namespace", payload.namespace, { - explode: false, - charEncoding: "percent", - }), - slug: encodeSimple("slug", payload.slug, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/schemas/{namespace}/{slug}/version")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "createSchemaVersion", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.CreateSchemaVersionResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.CreateSchemaVersionResponse$inboundSchema, { - key: "uid", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/schemasDeleteSchema.ts b/src/funcs/schemasDeleteSchema.ts deleted file mode 100644 index 724c24e..0000000 --- a/src/funcs/schemasDeleteSchema.ts +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Delete a shared component - * - * @remarks - * Delete a schema and all related versions. - */ -export function schemasDeleteSchema( - client: ScalarCore, - request: operations.DeleteSchemaRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.DeleteSchemaResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.DeleteSchemaRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.DeleteSchemaResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.DeleteSchemaRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - namespace: encodeSimple("namespace", payload.namespace, { - explode: false, - charEncoding: "percent", - }), - slug: encodeSimple("slug", payload.slug, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/schemas/{namespace}/{slug}")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "deleteSchema", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "DELETE", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.DeleteSchemaResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.DeleteSchemaResponse$inboundSchema, { key: "any" }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/schemasDeleteSchemaVersion.ts b/src/funcs/schemasDeleteSchemaVersion.ts deleted file mode 100644 index 5f2fc71..0000000 --- a/src/funcs/schemasDeleteSchemaVersion.ts +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Delete a shared component version - * - * @remarks - * Delete a schema version. - */ -export function schemasDeleteSchemaVersion( - client: ScalarCore, - request: operations.DeleteSchemaVersionRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.DeleteSchemaVersionResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.DeleteSchemaVersionRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.DeleteSchemaVersionResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.DeleteSchemaVersionRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - namespace: encodeSimple("namespace", payload.namespace, { - explode: false, - charEncoding: "percent", - }), - semver: encodeSimple("semver", payload.semver, { - explode: false, - charEncoding: "percent", - }), - slug: encodeSimple("slug", payload.slug, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/schemas/{namespace}/{slug}/version/{semver}")( - pathParams, - ); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "deleteSchemaVersion", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "DELETE", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.DeleteSchemaVersionResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.DeleteSchemaVersionResponse$inboundSchema, { - key: "any", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/schemasGetSchemaVersion.ts b/src/funcs/schemasGetSchemaVersion.ts deleted file mode 100644 index 439a823..0000000 --- a/src/funcs/schemasGetSchemaVersion.ts +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Get a shared component document - * - * @remarks - * Get a specific schema version document. - */ -export function schemasGetSchemaVersion( - client: ScalarCore, - request: operations.GetSchemaVersionRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.GetSchemaVersionResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.GetSchemaVersionRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.GetSchemaVersionResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.GetSchemaVersionRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - namespace: encodeSimple("namespace", payload.namespace, { - explode: false, - charEncoding: "percent", - }), - semver: encodeSimple("semver", payload.semver, { - explode: false, - charEncoding: "percent", - }), - slug: encodeSimple("slug", payload.slug, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/schemas/{namespace}/{slug}/version/{semver}")( - pathParams, - ); - - const headers = new Headers(compactMap({ - Accept: "text/plain", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "getSchemaVersion", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.GetSchemaVersionResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.text(200, operations.GetSchemaVersionResponse$inboundSchema, { - key: "res", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/schemasListSchemas.ts b/src/funcs/schemasListSchemas.ts deleted file mode 100644 index 0d5e898..0000000 --- a/src/funcs/schemasListSchemas.ts +++ /dev/null @@ -1,197 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * List all shared components - * - * @remarks - * List schemas in a namespace. - */ -export function schemasListSchemas( - client: ScalarCore, - request: operations.ListSchemasRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.ListSchemasResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.ListSchemasRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.ListSchemasResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.ListSchemasRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - namespace: encodeSimple("namespace", payload.namespace, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/schemas/{namespace}")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "listSchemas", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.ListSchemasResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.ListSchemasResponse$inboundSchema, { - key: "schemata", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/schemasRemoveSchemaAccessGroup.ts b/src/funcs/schemasRemoveSchemaAccessGroup.ts deleted file mode 100644 index ad92b07..0000000 --- a/src/funcs/schemasRemoveSchemaAccessGroup.ts +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Remove shared component access group - * - * @remarks - * Remove an access group from a schema. - */ -export function schemasRemoveSchemaAccessGroup( - client: ScalarCore, - request: operations.RemoveSchemaAccessGroupRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.RemoveSchemaAccessGroupResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.RemoveSchemaAccessGroupRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.RemoveSchemaAccessGroupResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.RemoveSchemaAccessGroupRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload["access-group"], { explode: true }); - - const pathParams = { - namespace: encodeSimple("namespace", payload.namespace, { - explode: false, - charEncoding: "percent", - }), - slug: encodeSimple("slug", payload.slug, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/schemas/{namespace}/{slug}/access-group")( - pathParams, - ); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "removeSchemaAccessGroup", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "DELETE", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.RemoveSchemaAccessGroupResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.RemoveSchemaAccessGroupResponse$inboundSchema, { - key: "any", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/schemasUpdateSchema.ts b/src/funcs/schemasUpdateSchema.ts deleted file mode 100644 index 8311959..0000000 --- a/src/funcs/schemasUpdateSchema.ts +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Update shared component metadata - * - * @remarks - * Update schema metadata. - */ -export function schemasUpdateSchema( - client: ScalarCore, - request: operations.UpdateSchemaRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.UpdateSchemaResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.UpdateSchemaRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.UpdateSchemaResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.UpdateSchemaRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.RequestBody, { explode: true }); - - const pathParams = { - namespace: encodeSimple("namespace", payload.namespace, { - explode: false, - charEncoding: "percent", - }), - slug: encodeSimple("slug", payload.slug, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/schemas/{namespace}/{slug}")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "updateSchema", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PATCH", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.UpdateSchemaResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.UpdateSchemaResponse$inboundSchema, { key: "any" }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/teamsListTeams.ts b/src/funcs/teamsListTeams.ts deleted file mode 100644 index 564bf6d..0000000 --- a/src/funcs/teamsListTeams.ts +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * List teams - * - * @remarks - * List all available teams - */ -export function teamsListTeams( - client: ScalarCore, - options?: RequestOptions, -): APIPromise< - Result< - operations.ListTeamsResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - options, - )); -} - -async function $do( - client: ScalarCore, - options?: RequestOptions, -): Promise< - [ - Result< - operations.ListTeamsResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const path = pathToFunc("/v1/teams")(); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "listTeams", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.ListTeamsResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.ListTeamsResponse$inboundSchema, { key: "teams" }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/themesCreateTheme.ts b/src/funcs/themesCreateTheme.ts deleted file mode 100644 index 06a2be4..0000000 --- a/src/funcs/themesCreateTheme.ts +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeJSON } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Create a theme - * - * @remarks - * Create a team theme. - */ -export function themesCreateTheme( - client: ScalarCore, - request: operations.CreateThemeRequestBody, - options?: RequestOptions, -): APIPromise< - Result< - operations.CreateThemeResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.CreateThemeRequestBody, - options?: RequestOptions, -): Promise< - [ - Result< - operations.CreateThemeResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.CreateThemeRequestBody$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload, { explode: true }); - - const path = pathToFunc("/v1/themes")(); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "createTheme", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.CreateThemeResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.CreateThemeResponse$inboundSchema, { key: "uid" }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/themesDeleteTheme.ts b/src/funcs/themesDeleteTheme.ts deleted file mode 100644 index 4339ff3..0000000 --- a/src/funcs/themesDeleteTheme.ts +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Delete a theme - * - * @remarks - * Delete a theme by slug. - */ -export function themesDeleteTheme( - client: ScalarCore, - request: operations.DeleteThemeRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.DeleteThemeResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.DeleteThemeRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.DeleteThemeResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.DeleteThemeRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - slug: encodeSimple("slug", payload.slug, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/themes/{slug}")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "deleteTheme", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "DELETE", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.DeleteThemeResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.DeleteThemeResponse$inboundSchema, { key: "any" }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/themesGetTheme.ts b/src/funcs/themesGetTheme.ts deleted file mode 100644 index 53ae358..0000000 --- a/src/funcs/themesGetTheme.ts +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Get a theme - * - * @remarks - * Get the theme document by slug. - */ -export function themesGetTheme( - client: ScalarCore, - request: operations.GetThemeRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.GetThemeResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.GetThemeRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.GetThemeResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.GetThemeRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - slug: encodeSimple("slug", payload.slug, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/themes/{slug}")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "text/plain", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "getTheme", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.GetThemeResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.text(200, operations.GetThemeResponse$inboundSchema, { key: "res" }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/themesListThemes.ts b/src/funcs/themesListThemes.ts deleted file mode 100644 index befc9ca..0000000 --- a/src/funcs/themesListThemes.ts +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * List all themes - * - * @remarks - * List all team themes. - */ -export function themesListThemes( - client: ScalarCore, - options?: RequestOptions, -): APIPromise< - Result< - operations.ListThemesResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - options, - )); -} - -async function $do( - client: ScalarCore, - options?: RequestOptions, -): Promise< - [ - Result< - operations.ListThemesResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const path = pathToFunc("/v1/themes")(); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "listThemes", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.ListThemesResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.ListThemesResponse$inboundSchema, { key: "themes" }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/themesReplaceThemeDocument.ts b/src/funcs/themesReplaceThemeDocument.ts deleted file mode 100644 index b1f30d0..0000000 --- a/src/funcs/themesReplaceThemeDocument.ts +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Update theme document - * - * @remarks - * Replace the theme document. - */ -export function themesReplaceThemeDocument( - client: ScalarCore, - request: operations.ReplaceThemeDocumentRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.ReplaceThemeDocumentResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.ReplaceThemeDocumentRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.ReplaceThemeDocumentResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.ReplaceThemeDocumentRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.RequestBody, { explode: true }); - - const pathParams = { - slug: encodeSimple("slug", payload.slug, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/themes/{slug}")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "replaceThemeDocument", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PUT", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.ReplaceThemeDocumentResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.ReplaceThemeDocumentResponse$inboundSchema, { - key: "any", - }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/funcs/themesUpdateTheme.ts b/src/funcs/themesUpdateTheme.ts deleted file mode 100644 index d3d5244..0000000 --- a/src/funcs/themesUpdateTheme.ts +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import * as errors from "../models/errors/index.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ScalarError } from "../models/errors/scalarerror.js"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import * as operations from "../models/operations/index.js"; -import { APICall, APIPromise } from "../types/async.js"; -import { Result } from "../types/fp.js"; - -/** - * Update theme metadata - * - * @remarks - * Update theme metadata. - */ -export function themesUpdateTheme( - client: ScalarCore, - request: operations.UpdateThemeRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.UpdateThemeResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: ScalarCore, - request: operations.UpdateThemeRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.UpdateThemeResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.UpdateThemeRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.RequestBody, { explode: true }); - - const pathParams = { - slug: encodeSimple("slug", payload.slug, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/themes/{slug}")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.bearerAuth); - const securityInput = secConfig == null ? {} : { bearerAuth: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "updateTheme", - oAuth2Scopes: [], - - resolvedSecurity: requestSecurity, - - securitySource: client._options.bearerAuth, - retryConfig: options?.retries - || client._options.retryConfig - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PATCH", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "403", "404", "422", "4XX", "500", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.UpdateThemeResponse, - | errors.FourHundred - | errors.FourHundredAndOne - | errors.FourHundredAndThree - | errors.FourHundredAndFour - | errors.FourHundredAndTwentyTwo - | errors.FiveHundred - | ScalarError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.UpdateThemeResponse$inboundSchema, { key: "any" }), - M.jsonErr(400, errors.FourHundred$inboundSchema), - M.jsonErr(401, errors.FourHundredAndOne$inboundSchema), - M.jsonErr(403, errors.FourHundredAndThree$inboundSchema), - M.jsonErr(404, errors.FourHundredAndFour$inboundSchema), - M.jsonErr(422, errors.FourHundredAndTwentyTwo$inboundSchema), - M.jsonErr(500, errors.FiveHundred$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; -} diff --git a/src/hooks/hooks.ts b/src/hooks/hooks.ts deleted file mode 100644 index 7ed9e04..0000000 --- a/src/hooks/hooks.ts +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { SDKOptions } from "../lib/config.js"; -import { RequestInput } from "../lib/http.js"; -import { - AfterErrorContext, - AfterErrorHook, - AfterSuccessContext, - AfterSuccessHook, - BeforeCreateRequestContext, - BeforeCreateRequestHook, - BeforeRequestContext, - BeforeRequestHook, - Hook, - Hooks, - SDKInitHook, -} from "./types.js"; - -import { initHooks } from "./registration.js"; - -export class SDKHooks implements Hooks { - sdkInitHooks: SDKInitHook[] = []; - beforeCreateRequestHooks: BeforeCreateRequestHook[] = []; - beforeRequestHooks: BeforeRequestHook[] = []; - afterSuccessHooks: AfterSuccessHook[] = []; - afterErrorHooks: AfterErrorHook[] = []; - - constructor() { - const presetHooks: Array = []; - - for (const hook of presetHooks) { - if ("sdkInit" in hook) { - this.registerSDKInitHook(hook); - } - if ("beforeCreateRequest" in hook) { - this.registerBeforeCreateRequestHook(hook); - } - if ("beforeRequest" in hook) { - this.registerBeforeRequestHook(hook); - } - if ("afterSuccess" in hook) { - this.registerAfterSuccessHook(hook); - } - if ("afterError" in hook) { - this.registerAfterErrorHook(hook); - } - } - 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: SDKOptions): SDKOptions { - 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 deleted file mode 100644 index f60ec7a..0000000 --- a/src/hooks/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export * from "./hooks.js"; -export * from "./types.js"; diff --git a/src/hooks/registration.ts b/src/hooks/registration.ts deleted file mode 100644 index 7064973..0000000 --- a/src/hooks/registration.ts +++ /dev/null @@ -1,14 +0,0 @@ -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 deleted file mode 100644 index 9c36bf0..0000000 --- a/src/hooks/types.ts +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { SDKOptions } from "../lib/config.js"; -import { RequestInput } from "../lib/http.js"; -import { RetryConfig } from "../lib/retries.js"; -import { SecurityState } from "../lib/security.js"; - -export type HookContext = { - baseURL: string | URL; - operationID: string; - oAuth2Scopes: string[] | null; - securitySource?: any | (() => Promise); - retryConfig: RetryConfig; - resolvedSecurity: SecurityState | null; - options: SDKOptions; -}; - -export type Awaitable = T | Promise; - -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: SDKOptions) => SDKOptions; -} - -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; -} - -export type Hook = - | SDKInitHook - | BeforeCreateRequestHook - | BeforeRequestHook - | AfterSuccessHook - | AfterErrorHook; diff --git a/src/index.ts b/src/index.ts index dbcba16..fae12bb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,9 +1,22 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +// File generated from our OpenAPI spec by Scalar. See README.md for details. -export * from "./lib/config.js"; -export * as files from "./lib/files.js"; -export { HTTPClient } from "./lib/http.js"; -export type { Fetcher, HTTPClientOptions } from "./lib/http.js"; -export * from "./sdk/sdk.js"; +export { ScalarApi as default } from './client.js'; + +export { type Uploadable, toFile } from './uploads'; +export { APIPromise } from './api-promise'; +export { ScalarApi, type ClientOptions, type ScalarApiOptions, type Logger, type LogLevel } from './client.js'; +export { + ScalarApiError, + APIError, + APIConnectionError, + APIConnectionTimeoutError, + APIUserAbortError, + NotFoundError, + ConflictError, + RateLimitError, + BadRequestError, + AuthenticationError, + InternalServerError, + PermissionDeniedError, + UnprocessableEntityError, +} from './error'; diff --git a/src/internal/builtin-types.ts b/src/internal/builtin-types.ts new file mode 100644 index 0000000..042186f --- /dev/null +++ b/src/internal/builtin-types.ts @@ -0,0 +1,6 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +export type Fetch = typeof fetch; +export type RequestInfo = globalThis.RequestInfo; +export type RequestInit = globalThis.RequestInit; +export type BodyInit = globalThis.BodyInit; diff --git a/src/internal/headers.ts b/src/internal/headers.ts new file mode 100644 index 0000000..4f3e283 --- /dev/null +++ b/src/internal/headers.ts @@ -0,0 +1,6 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +export type HeadersLike = HeadersInit; +export type NullableHeaders = Record; + +export const buildHeaders = (values: readonly (HeadersInit | Record | undefined)[]): HeadersInit => Object.assign({}, ...values.filter(Boolean)); diff --git a/src/internal/request-options.ts b/src/internal/request-options.ts new file mode 100644 index 0000000..ab4584e --- /dev/null +++ b/src/internal/request-options.ts @@ -0,0 +1,23 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +import type { HTTPMethod, MergedRequestInit } from './types.js'; + +export type RequestOptions = { + method?: HTTPMethod | undefined; + path?: string | undefined; + headers?: HeadersInit | Record | undefined; + query?: Record | undefined | null; + body?: unknown; + timeout?: number | undefined; + maxRetries?: number | undefined; + stream?: boolean | undefined; + signal?: AbortSignal | undefined | null; + fetchOptions?: MergedRequestInit | undefined; + idempotencyKey?: string | undefined; + __binaryResponse?: boolean | undefined; +}; + +export type FinalRequestOptions = RequestOptions & { + method: HTTPMethod; + path: string; +}; diff --git a/src/internal/types.ts b/src/internal/types.ts new file mode 100644 index 0000000..1a2a037 --- /dev/null +++ b/src/internal/types.ts @@ -0,0 +1,5 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +export type HTTPMethod = 'get' | 'put' | 'post' | 'delete' | 'options' | 'head' | 'patch' | 'trace'; +export type PromiseOrValue = T | Promise; +export type MergedRequestInit = RequestInit; diff --git a/src/internal/utils/env.ts b/src/internal/utils/env.ts new file mode 100644 index 0000000..2e26466 --- /dev/null +++ b/src/internal/utils/env.ts @@ -0,0 +1,6 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +export const readEnv = (name: string): string | undefined => { + const env = globalThis as typeof globalThis & { process?: { env?: Record } }; + return env.process?.env?.[name]; +}; diff --git a/src/internal/utils/path.ts b/src/internal/utils/path.ts new file mode 100644 index 0000000..96a723d --- /dev/null +++ b/src/internal/utils/path.ts @@ -0,0 +1,4 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +export const path = (strings: TemplateStringsArray, ...values: readonly unknown[]): string => + strings.reduce((result, part, index) => `${result}${part}${index < values.length ? encodeURIComponent(String(values[index])) : ''}`, ''); diff --git a/src/lib/base64.ts b/src/lib/base64.ts deleted file mode 100644 index c2d5b38..0000000 --- a/src/lib/base64.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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 deleted file mode 100644 index e499ab1..0000000 --- a/src/lib/config.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { HTTPClient } from "./http.js"; -import { Logger } from "./logger.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://access.scalar.com", -] as const; - -export type SDKOptions = { - bearerAuth?: string | (() => Promise) | undefined; - - httpClient?: HTTPClient; - /** - * Allows overriding the default server used by the SDK - */ - serverIdx?: number | undefined; - /** - * Allows overriding the default server URL used by the SDK - */ - serverURL?: string | undefined; - /** - * Allows overriding the default user agent used by the SDK - */ - userAgent?: string | undefined; - /** - * Allows overriding the default retry config used by the SDK - */ - retryConfig?: RetryConfig; - timeoutMs?: number; - debugLogger?: Logger; -}; - -export function serverURLFromOptions(options: SDKOptions): URL | null { - let serverURL = options.serverURL; - - const 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] || ""; - } - - const u = pathToFunc(serverURL)(params); - return new URL(u); -} - -export const SDK_METADATA = { - language: "typescript", - openapiDocVersion: "0.1.5", - sdkVersion: "0.1.5", - genVersion: "2.634.2", - userAgent: "speakeasy-sdk/typescript 0.1.5 2.634.2 0.1.5 @scalar/sdk", -} as const; diff --git a/src/lib/dlv.ts b/src/lib/dlv.ts deleted file mode 100644 index e81091f..0000000 --- a/src/lib/dlv.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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 deleted file mode 100644 index 25c9dcb..0000000 --- a/src/lib/encodings.ts +++ /dev/null @@ -1,483 +0,0 @@ -/* - * 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 | undefined { - let out = ""; - const pairs: [string, unknown][] = options?.explode - ? explode(key, value) - : [[key, value]]; - - if (pairs.every(([_, v]) => v == null)) { - return; - } - - 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: string | null | undefined = null; - - if (pv == null) { - return; - } else if (Array.isArray(pv)) { - encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(","); - } else if (isPlainObject(pv)) { - const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => { - return `,${encodeString(k)},${encodeValue(v)}`; - }); - encValue = mapped?.join("").slice(1); - } else { - encValue = `${encodeValue(pv)}`; - } - - if (encValue == null) { - return; - } - - 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 | undefined { - let out = ""; - const pairs: [string, unknown][] = options?.explode - ? explode(key, value) - : [[key, value]]; - - if (pairs.every(([_, v]) => v == null)) { - return; - } - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - const encodeValue = (v: unknown) => encodeString(serializeValue(v)); - - pairs.forEach(([pk, pv]) => { - let encValue: string | null | undefined = ""; - - if (pv == null) { - return; - } else if (Array.isArray(pv)) { - encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join("."); - } else if (isPlainObject(pv)) { - const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => { - return `.${encodeString(k)}.${encodeValue(v)}`; - }); - encValue = mapped?.join("").slice(1); - } else { - const k = - options?.explode && isPlainObject(value) ? `${encodeString(pk)}=` : ""; - encValue = `${k}${encodeValue(pv)}`; - } - - out += encValue == null ? "" : `.${encValue}`; - }); - - return out; -} - -type FormEncoder = ( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -) => string | undefined; - -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]]; - - if (pairs.every(([_, v]) => v == null)) { - return; - } - - 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: string | null | undefined = null; - - if (pv == null) { - 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)}`; - } - - if (encValue == null) { - return; - } - - 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 == null) { - 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 | undefined { - if (value == null) { - return; - } - - if (!isPlainObject(value)) { - throw new EncodingError( - `Value of parameter '${key}' which uses deepObject encoding must be an object or null`, - ); - } - - return encodeDeepObjectObject(key, value, options); -} - -export function encodeDeepObjectObject( - key: string, - value: unknown, - options?: { charEncoding?: "percent" | "none" }, -): string | undefined { - 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 == null) { - return; - } - - const pk = `${key}[${ck}]`; - - if (isPlainObject(cv)) { - const objOut = encodeDeepObjectObject(pk, cv, options); - - out += objOut == null ? "" : `&${objOut}`; - - return; - } - - const pairs: unknown[] = Array.isArray(cv) ? cv : [cv]; - const encoded = mapDefined(pairs, (v) => { - return `${encodeString(pk)}=${encodeString(serializeValue(v))}`; - })?.join("&"); - - out += encoded == null ? "" : `&${encoded}`; - }); - - return out.slice(1); -} - -export function encodeJSON( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -): string | undefined { - 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 | undefined => { - let out = ""; - const pairs: [string, unknown][] = options?.explode - ? explode(key, value) - : [[key, value]]; - - if (pairs.every(([_, v]) => v == null)) { - return; - } - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - const encodeValue = (v: unknown) => encodeString(serializeValue(v)); - - pairs.forEach(([pk, pv]) => { - let tmp: string | null | undefined = ""; - - if (pv == null) { - return; - } else if (Array.isArray(pv)) { - tmp = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(","); - } else if (isPlainObject(pv)) { - const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => { - return `,${encodeString(k)},${encodeValue(v)}`; - }); - tmp = mapped?.join("").slice(1); - } else { - const k = options?.explode && isPlainObject(value) ? `${pk}=` : ""; - tmp = `${k}${encodeValue(pv)}`; - } - - out += tmp ? `,${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 ""; - } 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[] | null { - const res = inp.reduce((acc, v) => { - if (v == null) { - return acc; - } - - const m = mapper(v); - if (m == null) { - return acc; - } - - acc.push(m); - - return acc; - }, []); - - return res.length ? res : null; -} - -function mapDefinedEntries( - inp: Iterable<[K, V]>, - mapper: (v: [K, V]) => R, -): R[] | null { - const acc: R[] = []; - for (const [k, v] of inp) { - if (v == null) { - continue; - } - - const m = mapper([k, v]); - if (m == null) { - continue; - } - - acc.push(m); - } - - return acc.length ? acc : null; -} - -export function queryJoin(...args: (string | undefined)[]): string { - return args.filter(Boolean).join("&"); -} - -type QueryEncoderOptions = { - explode?: boolean; - charEncoding?: "percent" | "none"; -}; - -type QueryEncoder = ( - key: string, - value: unknown, - options?: QueryEncoderOptions, -) => string | undefined; - -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); - -export function appendForm( - fd: FormData, - key: string, - value: unknown, - fileName?: string, -): void { - if (value == null) { - return; - } else if (value instanceof Blob && fileName) { - fd.append(key, value, fileName); - } else if (value instanceof Blob) { - fd.append(key, value); - } else { - fd.append(key, String(value)); - } -} diff --git a/src/lib/files.ts b/src/lib/files.ts deleted file mode 100644 index 0344cd0..0000000 --- a/src/lib/files.ts +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** - * Consumes a stream and returns a concatenated array buffer. Useful in - * situations where we need to read the whole file because it forms part of a - * larger payload containing other fields, and we can't modify the underlying - * request structure. - */ -export async function readableStreamToArrayBuffer( - readable: ReadableStream, -): Promise { - const reader = readable.getReader(); - const chunks: Uint8Array[] = []; - - let totalLength = 0; - let done = false; - - while (!done) { - const { value, done: doneReading } = await reader.read(); - - if (doneReading) { - done = true; - } else { - chunks.push(value); - totalLength += value.length; - } - } - - const concatenatedChunks = new Uint8Array(totalLength); - let offset = 0; - - for (const chunk of chunks) { - concatenatedChunks.set(chunk, offset); - offset += chunk.length; - } - - return concatenatedChunks.buffer as ArrayBuffer; -} - -/** - * Determines the MIME content type based on a file's extension. - * Returns null if the extension is not recognized. - */ -export function getContentTypeFromFileName(fileName: string): string | null { - if (!fileName) return null; - - const ext = fileName.toLowerCase().split(".").pop(); - if (!ext) return null; - - const mimeTypes: Record = { - json: "application/json", - xml: "application/xml", - html: "text/html", - htm: "text/html", - txt: "text/plain", - csv: "text/csv", - pdf: "application/pdf", - png: "image/png", - jpg: "image/jpeg", - jpeg: "image/jpeg", - gif: "image/gif", - svg: "image/svg+xml", - js: "application/javascript", - css: "text/css", - zip: "application/zip", - tar: "application/x-tar", - gz: "application/gzip", - mp4: "video/mp4", - mp3: "audio/mpeg", - wav: "audio/wav", - webp: "image/webp", - ico: "image/x-icon", - woff: "font/woff", - woff2: "font/woff2", - ttf: "font/ttf", - otf: "font/otf", - }; - - return mimeTypes[ext] || null; -} diff --git a/src/lib/http.ts b/src/lib/http.ts deleted file mode 100644 index 13cf1fd..0000000 --- a/src/lib/http.ts +++ /dev/null @@ -1,323 +0,0 @@ -/* - * 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; - -export 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 deleted file mode 100644 index 61070d3..0000000 --- a/src/lib/is-plain-object.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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/logger.ts b/src/lib/logger.ts deleted file mode 100644 index d181f29..0000000 --- a/src/lib/logger.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export interface Logger { - group(label?: string): void; - groupEnd(): void; - log(message: any, ...args: any[]): void; -} diff --git a/src/lib/matchers.ts b/src/lib/matchers.ts deleted file mode 100644 index f7392e5..0000000 --- a/src/lib/matchers.ts +++ /dev/null @@ -1,342 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { APIError } from "../models/errors/apierror.js"; -import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; -import { ERR, OK, Result } from "../types/fp.js"; -import { matchResponse, matchStatusCode, StatusCodePredicate } from "./http.js"; -import { isPlainObject } from "./is-plain-object.js"; - -export type Encoding = - | "jsonl" - | "json" - | "text" - | "bytes" - | "stream" - | "sse" - | "nil" - | "fail"; - -const DEFAULT_CONTENT_TYPES: Record = { - jsonl: "application/jsonl", - 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 jsonl( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "jsonl", codes, schema }; -} - -export function jsonlErr( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "jsonl", 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, - request: Request, - options?: { resultKey?: string; extraFields?: Record }, -) => Promise<[result: Result, raw: unknown]>; - -export function match( - ...matchers: Array> -): MatchFunc { - return async function matchFunc( - response: Response, - request: Request, - 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) { - return [{ - ok: false, - error: new APIError("Unexpected Status or Content-Type", { - response, - request, - body: await response.text().catch(() => ""), - }), - }, raw]; - } - - const encoding = matcher.enc; - let body = ""; - switch (encoding) { - case "json": - body = await response.text(); - raw = JSON.parse(body); - break; - case "jsonl": - raw = response.body; - break; - case "bytes": - raw = new Uint8Array(await response.arrayBuffer()); - break; - case "stream": - raw = response.body; - break; - case "text": - body = await response.text(); - raw = body; - break; - case "sse": - raw = response.body; - break; - case "nil": - body = await response.text(); - raw = undefined; - break; - case "fail": - body = await response.text(); - raw = undefined; - break; - default: - encoding satisfies never; - throw new Error(`Unsupported response type: ${encoding}`); - } - - if (matcher.enc === "fail") { - return [{ - ok: false, - error: new APIError("API error occurred", { request, response, body }), - }, 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), - request$: request, - response$: response, - body$: body, - }; - } else if (resultKey) { - data = { - ...options?.extraFields, - ...(matcher.hdrs ? { Headers: unpackHeaders(response.headers) } : null), - [resultKey]: raw, - }; - } else { - data = { - ...options?.extraFields, - ...(matcher.hdrs ? { Headers: unpackHeaders(response.headers) } : null), - }; - } - - if ("err" in matcher) { - const result = safeParseResponse( - data, - (v: unknown) => matcher.schema.parse(v), - "Response validation failed", - { request, response, body }, - ); - return [result.ok ? { ok: false, error: result.value } : result, raw]; - } else { - return [ - safeParseResponse( - data, - (v: unknown) => matcher.schema.parse(v), - "Response validation failed", - { request, response, body }, - ), - 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; -} - -function safeParseResponse( - rawValue: Inp, - fn: (value: Inp) => Out, - errorMessage: string, - httpMeta: { response: Response; request: Request; body: string }, -): Result { - try { - return OK(fn(rawValue)); - } catch (err) { - return ERR( - new ResponseValidationError(errorMessage, { - cause: err, - rawValue, - rawMessage: errorMessage, - ...httpMeta, - }), - ); - } -} diff --git a/src/lib/primitives.ts b/src/lib/primitives.ts deleted file mode 100644 index d21f1dc..0000000 --- a/src/lib/primitives.ts +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -class InvariantError extends Error { - constructor(message: string) { - super(message); - this.name = "InvariantError"; - } -} - -export function invariant( - condition: unknown, - message: string, -): asserts condition { - if (!condition) { - throw new InvariantError(message); - } -} - -export type ExactPartial = { - [P in keyof T]?: T[P] | undefined; -}; - -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; -} - -export function combineSignals( - ...signals: Array -): AbortSignal | null { - const filtered: AbortSignal[] = []; - for (const signal of signals) { - if (signal) { - filtered.push(signal); - } - } - - switch (filtered.length) { - case 0: - case 1: - return filtered[0] || null; - default: - if ("any" in AbortSignal && typeof AbortSignal.any === "function") { - return AbortSignal.any(filtered); - } - return abortSignalAny(filtered); - } -} - -export function abortSignalAny(signals: AbortSignal[]): AbortSignal { - const controller = new AbortController(); - const result = controller.signal; - if (!signals.length) { - return controller.signal; - } - - if (signals.length === 1) { - return signals[0] || controller.signal; - } - - for (const signal of signals) { - if (signal.aborted) { - return signal; - } - } - - function abort(this: AbortSignal) { - controller.abort(this.reason); - clean(); - } - - const signalRefs: WeakRef[] = []; - function clean() { - for (const signalRef of signalRefs) { - const signal = signalRef.deref(); - if (signal) { - signal.removeEventListener("abort", abort); - } - } - } - - for (const signal of signals) { - signalRefs.push(new WeakRef(signal)); - signal.addEventListener("abort", abort); - } - - return result; -} - -export function compactMap( - values: Record, -): Record { - const out: Record = {}; - - for (const [k, v] of Object.entries(values)) { - if (typeof v !== "undefined") { - out[k] = v; - } - } - - return out; -} - -export function allRequired>( - v: V, -): - | { - [K in keyof V]: NonNullable; - } - | undefined { - if (Object.values(v).every((x) => x == null)) { - return void 0; - } - - return v as ReturnType>; -} diff --git a/src/lib/retries.ts b/src/lib/retries.ts deleted file mode 100644 index e3ce9ab..0000000 --- a/src/lib/retries.ts +++ /dev/null @@ -1,218 +0,0 @@ -/* - * 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; - }; - -/** - * PermanentError is an error that is not recoverable. Throwing this error will - * cause a retry loop to terminate. - */ -export class PermanentError extends Error { - /** The underlying cause of the error. */ - override readonly cause: unknown; - - constructor(message: string, options?: { cause?: unknown }) { - let msg = message; - if (options?.cause) { - msg += `: ${options.cause}`; - } - - super(msg, options); - this.name = "PermanentError"; - // In older runtimes, the cause field would not have been assigned through - // the super() call. - if (typeof this.cause === "undefined") { - this.cause = options?.cause; - } - - Object.setPrototypeOf(this, PermanentError.prototype); - } -} - -/** - * TemporaryError is an error is used to signal that an HTTP request can be - * retried as part of a retry loop. If retry attempts are exhausted and this - * error is thrown, the response will be returned to the caller. - */ -export class TemporaryError extends Error { - response: Response; - - constructor(message: string, response: Response) { - super(message); - this.response = response; - this.name = "TemporaryError"; - - 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( - "Response failed with retryable status code", - res, - ); - } - - return res; - } catch (err: unknown) { - if (err instanceof TemporaryError) { - throw err; - } - - if ( - options.retryConnectionErrors && - (isTimeoutError(err) || isConnectionError(err)) - ) { - throw err; - } - - throw new PermanentError("Permanent error", { cause: 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; - - while (true) { - try { - const res = await fn(); - return res; - } catch (err: unknown) { - if (err instanceof PermanentError) { - throw err.cause; - } - const elapsed = Date.now() - start; - if (elapsed > maxElapsedTime) { - if (err instanceof TemporaryError) { - return err.response; - } - - throw err; - } - - let retryInterval = 0; - if (err instanceof TemporaryError) { - retryInterval = retryIntervalFromResponse(err.response); - } - - if (retryInterval <= 0) { - retryInterval = - initialInterval * Math.pow(x, exponent) + Math.random() * 1000; - } - - const d = Math.min(retryInterval, maxInterval); - - await delay(d); - x++; - } - } -} - -function retryIntervalFromResponse(res: Response): number { - const retryVal = res.headers.get("retry-after") || ""; - if (!retryVal) { - return 0; - } - - const parsedNumber = Number(retryVal); - if (Number.isInteger(parsedNumber)) { - return parsedNumber * 1000; - } - - const parsedDate = Date.parse(retryVal); - if (Number.isInteger(parsedDate)) { - const deltaMS = parsedDate - Date.now(); - return deltaMS > 0 ? Math.ceil(deltaMS) : 0; - } - - return 0; -} - -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 deleted file mode 100644 index 0e340b7..0000000 --- a/src/lib/schemas.ts +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { - output, - ZodEffects, - ZodError, - ZodObject, - ZodRawShape, - ZodTypeAny, -} from "zod"; -import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; -import { ERR, OK, Result } from "../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, - optional: boolean, -): 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]; - } - - if (optional && Object.keys(extras).length === 0) { - return val; - } - - return { ...val, [extrasKey]: extras }; - }); -} diff --git a/src/lib/sdks.ts b/src/lib/sdks.ts deleted file mode 100644 index fb7e9ac..0000000 --- a/src/lib/sdks.ts +++ /dev/null @@ -1,402 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { SDKHooks } from "../hooks/hooks.js"; -import { HookContext } from "../hooks/types.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../models/errors/httpclienterrors.js"; -import { ERR, OK, Result } from "../types/fp.js"; -import { stringToBase64 } from "./base64.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "./config.js"; -import { encodeForm } from "./encodings.js"; -import { - HTTPClient, - isAbortError, - isConnectionError, - isTimeoutError, - matchContentType, - matchStatusCode, -} from "./http.js"; -import { Logger } from "./logger.js"; -import { retry, RetryConfig } from "./retries.js"; -import { SecurityState } from "./security.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[]; - /** - * Overrides the base server URL that will be used by an operation. - */ - serverURL?: string | URL; - /** - * @deprecated `fetchOptions` has been flattened into `RequestOptions`. - * - * 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; -} & Omit; - -type RequestConfig = { - method: string; - path: string; - baseURL?: string | URL | undefined; - query?: string; - body?: RequestInit["body"]; - headers?: HeadersInit; - security?: SecurityState | null; - uaHeader?: string; - userAgent?: string | undefined; - 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 { - readonly #httpClient: HTTPClient; - readonly #hooks: SDKHooks; - readonly #logger?: Logger | undefined; - public readonly _baseURL: URL | null; - 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(); - } - const defaultHttpClient = new HTTPClient(); - options.httpClient = options.httpClient || defaultHttpClient; - options = this.#hooks.sdkInit(options); - - const url = serverURLFromOptions(options); - if (url) { - url.pathname = url.pathname.replace(/\/+$/, "") + "/"; - } - this._baseURL = url; - this.#httpClient = options.httpClient || defaultHttpClient; - - this._options = { ...options, hooks: this.#hooks }; - - this.#logger = this._options.debugLogger; - } - - 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 += reqURL.pathname.endsWith("/") ? "" : "/"; - reqURL.pathname += inputURL.pathname.replace(/^\/+/, ""); - } - - let finalQuery = query || ""; - - const secQuery: string[] = []; - for (const [k, v] of Object.entries(security?.queryParams || {})) { - const q = encodeForm(k, v, { charEncoding: "percent" }); - if (typeof q !== "undefined") { - secQuery.push(q); - } - } - 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?.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", - conf.userAgent ?? SDK_METADATA.userAgent, - ); - } - - const fetchOptions: Omit = { - ...options?.fetchOptions, - ...options, - }; - if (!fetchOptions?.signal && conf.timeoutMs && conf.timeoutMs > 0) { - const timeoutSignal = AbortSignal.timeout(conf.timeoutMs); - fetchOptions.signal = timeoutSignal; - } - - if (conf.body instanceof ReadableStream) { - Object.assign(fetchOptions, { duplex: "half" }); - } - - 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; - retryCodes: string[]; - }, - ): Promise< - Result< - Response, - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - | UnexpectedClientError - > - > { - const { context, errorCodes } = options; - - return retry( - async () => { - const req = await this.#hooks.beforeRequest(context, request.clone()); - await logRequest(this.#logger, req).catch((e) => - this.#logger?.log("Failed to log request:", e) - ); - - let response = await this.#httpClient.request(req); - - try { - 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); - } - } finally { - await logResponse(this.#logger, response, req) - .catch(e => this.#logger?.log("Failed to log response:", e)); - } - - return response; - }, - { config: options.retryConfig, statusCodes: options.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, - }), - ); - } - }, - ); - } -} - -const jsonLikeContentTypeRE = /(application|text)\/.*?\+*json.*/; -const jsonlLikeContentTypeRE = - /(application|text)\/(.*?\+*\bjsonl\b.*|.*?\+*\bx-ndjson\b.*)/; -async function logRequest(logger: Logger | undefined, req: Request) { - if (!logger) { - return; - } - - const contentType = req.headers.get("content-type"); - const ct = contentType?.split(";")[0] || ""; - - logger.group(`> Request: ${req.method} ${req.url}`); - - logger.group("Headers:"); - for (const [k, v] of req.headers.entries()) { - logger.log(`${k}: ${v}`); - } - logger.groupEnd(); - - logger.group("Body:"); - switch (true) { - case jsonLikeContentTypeRE.test(ct): - logger.log(await req.clone().json()); - break; - case ct.startsWith("text/"): - logger.log(await req.clone().text()); - break; - case ct === "multipart/form-data": { - const body = await req.clone().formData(); - for (const [k, v] of body) { - const vlabel = v instanceof Blob ? "" : v; - logger.log(`${k}: ${vlabel}`); - } - break; - } - default: - logger.log(`<${contentType}>`); - break; - } - logger.groupEnd(); - - logger.groupEnd(); -} - -async function logResponse( - logger: Logger | undefined, - res: Response, - req: Request, -) { - if (!logger) { - return; - } - - const contentType = res.headers.get("content-type"); - const ct = contentType?.split(";")[0] || ""; - - logger.group(`< Response: ${req.method} ${req.url}`); - logger.log("Status Code:", res.status, res.statusText); - - logger.group("Headers:"); - for (const [k, v] of res.headers.entries()) { - logger.log(`${k}: ${v}`); - } - logger.groupEnd(); - - logger.group("Body:"); - switch (true) { - case matchContentType(res, "application/json") - || jsonLikeContentTypeRE.test(ct) && !jsonlLikeContentTypeRE.test(ct): - logger.log(await res.clone().json()); - break; - case matchContentType(res, "application/jsonl") - || jsonlLikeContentTypeRE.test(ct): - logger.log(await res.clone().text()); - break; - case matchContentType(res, "text/event-stream"): - logger.log(`<${contentType}>`); - break; - case matchContentType(res, "text/*"): - logger.log(await res.clone().text()); - break; - case matchContentType(res, "multipart/form-data"): { - const body = await res.clone().formData(); - for (const [k, v] of body) { - const vlabel = v instanceof Blob ? "" : v; - logger.log(`${k}: ${vlabel}`); - } - break; - } - default: - logger.log(`<${contentType}>`); - break; - } - logger.groupEnd(); - - logger.groupEnd(); -} diff --git a/src/lib/security.ts b/src/lib/security.ts deleted file mode 100644 index 7f58945..0000000 --- a/src/lib/security.ts +++ /dev/null @@ -1,260 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as components from "../models/components/index.js"; - -type OAuth2PasswordFlow = { - username: string; - password: string; - clientID?: string | undefined; - clientSecret?: string | undefined; - tokenURL: string; -}; - -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; - oauth2: ({ type: "password" } & OAuth2PasswordFlow) | { type: "none" }; -}; - -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 - | string - | undefined; - fieldName?: string; -}; - -type SecurityInputOAuth2PasswordCredentials = { - type: "oauth2:password"; - value: - | string - | null - | undefined; - fieldName?: string; -}; - -type SecurityInputCustom = { - type: "http:custom"; - value: any | null | undefined; - fieldName?: string; -}; - -export type SecurityInput = - | SecurityInputBasic - | SecurityInputBearer - | SecurityInputAPIKey - | SecurityInputOAuth2 - | SecurityInputOAuth2ClientCredentials - | SecurityInputOAuth2PasswordCredentials - | SecurityInputOIDC - | SecurityInputCustom; - -export function resolveSecurity( - ...options: SecurityInput[][] -): SecurityState | null { - const state: SecurityState = { - basic: {}, - headers: {}, - queryParams: {}, - cookies: {}, - oauth2: { type: "none" }, - }; - - 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 === "http:custom") { - return null; - } else if (o.type === "oauth2:password") { - return ( - typeof o.value === "string" && !!o.value - ); - } else if (o.type === "oauth2:client_credentials") { - if (typeof o.value == "string") { - return !!o.value; - } - 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:custom": - break; - case "http:bearer": - applyBearer(state, spec); - break; - case "oauth2": - applyBearer(state, spec); - break; - case "oauth2:password": - 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 - | SecurityInputOAuth2PasswordCredentials, -) { - if (typeof spec.value !== "string" || !spec.value) { - return; - } - - let value = spec.value; - if (value.slice(0, 7).toLowerCase() !== "bearer ") { - value = `Bearer ${value}`; - } - - if (spec.fieldName !== undefined) { - state.headers[spec.fieldName] = value; - } -} - -export function resolveGlobalSecurity( - security: Partial | null | undefined, -): SecurityState | null { - return resolveSecurity( - [ - { - fieldName: "Authorization", - type: "http:bearer", - value: security?.bearerAuth, - }, - ], - ); -} - -export async function extractSecurity< - T extends string | Record, ->(sec: T | (() => Promise) | undefined): Promise { - if (sec == null) { - return; - } - - return typeof sec === "function" ? sec() : sec; -} diff --git a/src/lib/url.ts b/src/lib/url.ts deleted file mode 100644 index 6bc6356..0000000 --- a/src/lib/url.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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/models/components/accessgroup.ts b/src/models/components/accessgroup.ts deleted file mode 100644 index b030ee9..0000000 --- a/src/models/components/accessgroup.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type AccessGroup = { - accessGroupSlug: string; -}; - -/** @internal */ -export const AccessGroup$inboundSchema: z.ZodType< - AccessGroup, - z.ZodTypeDef, - unknown -> = z.object({ - accessGroupSlug: z.string(), -}); - -/** @internal */ -export type AccessGroup$Outbound = { - accessGroupSlug: string; -}; - -/** @internal */ -export const AccessGroup$outboundSchema: z.ZodType< - AccessGroup$Outbound, - z.ZodTypeDef, - AccessGroup -> = z.object({ - accessGroupSlug: 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 AccessGroup$ { - /** @deprecated use `AccessGroup$inboundSchema` instead. */ - export const inboundSchema = AccessGroup$inboundSchema; - /** @deprecated use `AccessGroup$outboundSchema` instead. */ - export const outboundSchema = AccessGroup$outboundSchema; - /** @deprecated use `AccessGroup$Outbound` instead. */ - export type Outbound = AccessGroup$Outbound; -} - -export function accessGroupToJSON(accessGroup: AccessGroup): string { - return JSON.stringify(AccessGroup$outboundSchema.parse(accessGroup)); -} - -export function accessGroupFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => AccessGroup$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'AccessGroup' from JSON`, - ); -} diff --git a/src/models/components/activedeployment.ts b/src/models/components/activedeployment.ts deleted file mode 100644 index 113823a..0000000 --- a/src/models/components/activedeployment.ts +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type ActiveDeployment = { - uid: string; - domain: string; - publishedAt: number; -}; - -/** @internal */ -export const ActiveDeployment$inboundSchema: z.ZodType< - ActiveDeployment, - z.ZodTypeDef, - unknown -> = z.object({ - uid: z.string(), - domain: z.string(), - publishedAt: z.number().int(), -}); - -/** @internal */ -export type ActiveDeployment$Outbound = { - uid: string; - domain: string; - publishedAt: number; -}; - -/** @internal */ -export const ActiveDeployment$outboundSchema: z.ZodType< - ActiveDeployment$Outbound, - z.ZodTypeDef, - ActiveDeployment -> = z.object({ - uid: z.string(), - domain: z.string(), - publishedAt: 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 ActiveDeployment$ { - /** @deprecated use `ActiveDeployment$inboundSchema` instead. */ - export const inboundSchema = ActiveDeployment$inboundSchema; - /** @deprecated use `ActiveDeployment$outboundSchema` instead. */ - export const outboundSchema = ActiveDeployment$outboundSchema; - /** @deprecated use `ActiveDeployment$Outbound` instead. */ - export type Outbound = ActiveDeployment$Outbound; -} - -export function activeDeploymentToJSON( - activeDeployment: ActiveDeployment, -): string { - return JSON.stringify( - ActiveDeployment$outboundSchema.parse(activeDeployment), - ); -} - -export function activeDeploymentFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ActiveDeployment$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ActiveDeployment' from JSON`, - ); -} diff --git a/src/models/components/apidocument.ts b/src/models/components/apidocument.ts deleted file mode 100644 index f16a67f..0000000 --- a/src/models/components/apidocument.ts +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { - ManagedDocVersion, - ManagedDocVersion$inboundSchema, - ManagedDocVersion$Outbound, - ManagedDocVersion$outboundSchema, -} from "./manageddocversion.js"; - -export type ApiDocument = { - uid: string; - version: string; - title?: string | undefined; - slug: string; - description?: string | undefined; - namespace: string; - isPrivate?: boolean | undefined; - tags?: any | undefined; - versions: Array; -}; - -/** @internal */ -export const ApiDocument$inboundSchema: z.ZodType< - ApiDocument, - z.ZodTypeDef, - unknown -> = z.object({ - uid: z.string(), - version: z.string(), - title: z.string().default(""), - slug: z.string(), - description: z.string().default(""), - namespace: z.string(), - isPrivate: z.boolean().default(false), - tags: z.any(), - versions: z.array(ManagedDocVersion$inboundSchema), -}); - -/** @internal */ -export type ApiDocument$Outbound = { - uid: string; - version: string; - title: string; - slug: string; - description: string; - namespace: string; - isPrivate: boolean; - tags?: any; - versions: Array; -}; - -/** @internal */ -export const ApiDocument$outboundSchema: z.ZodType< - ApiDocument$Outbound, - z.ZodTypeDef, - ApiDocument -> = z.object({ - uid: z.string(), - version: z.string(), - title: z.string().default(""), - slug: z.string(), - description: z.string().default(""), - namespace: z.string(), - isPrivate: z.boolean().default(false), - tags: z.any(), - versions: z.array(ManagedDocVersion$outboundSchema), -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace ApiDocument$ { - /** @deprecated use `ApiDocument$inboundSchema` instead. */ - export const inboundSchema = ApiDocument$inboundSchema; - /** @deprecated use `ApiDocument$outboundSchema` instead. */ - export const outboundSchema = ApiDocument$outboundSchema; - /** @deprecated use `ApiDocument$Outbound` instead. */ - export type Outbound = ApiDocument$Outbound; -} - -export function apiDocumentToJSON(apiDocument: ApiDocument): string { - return JSON.stringify(ApiDocument$outboundSchema.parse(apiDocument)); -} - -export function apiDocumentFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ApiDocument$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ApiDocument' from JSON`, - ); -} diff --git a/src/models/components/githubproject.ts b/src/models/components/githubproject.ts deleted file mode 100644 index 0af13de..0000000 --- a/src/models/components/githubproject.ts +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { - ActiveDeployment, - ActiveDeployment$inboundSchema, - ActiveDeployment$Outbound, - ActiveDeployment$outboundSchema, -} from "./activedeployment.js"; -import { - GithubProjectRepository, - GithubProjectRepository$inboundSchema, - GithubProjectRepository$Outbound, - GithubProjectRepository$outboundSchema, -} from "./githubprojectrepository.js"; - -export type GithubProject = { - uid: string; - createdAt: number; - updatedAt: number; - name: string; - activeDeployment: ActiveDeployment | null; - lastPublished: number | null; - lastPublishedUid: string | null; - loginPortalUid?: string | undefined; - activeThemeId?: string | undefined; - typesenseId?: number | undefined; - isPrivate?: boolean | undefined; - agentEnabled?: boolean | undefined; - accessGroups?: any | undefined; - slug: string; - publishStatus?: string | undefined; - publishMessage?: string | undefined; - repository?: GithubProjectRepository | null | undefined; -}; - -/** @internal */ -export const GithubProject$inboundSchema: z.ZodType< - GithubProject, - z.ZodTypeDef, - unknown -> = z.object({ - uid: z.string(), - createdAt: z.number().int(), - updatedAt: z.number().int(), - name: z.string(), - activeDeployment: z.nullable(ActiveDeployment$inboundSchema), - lastPublished: z.nullable(z.number().int()), - lastPublishedUid: z.nullable(z.string()), - loginPortalUid: z.string().default(""), - activeThemeId: z.string().default(""), - typesenseId: z.number().optional(), - isPrivate: z.boolean().default(false), - agentEnabled: z.boolean().default(false), - accessGroups: z.any(), - slug: z.string(), - publishStatus: z.string().default(""), - publishMessage: z.string().default(""), - repository: z.nullable(GithubProjectRepository$inboundSchema).optional(), -}); - -/** @internal */ -export type GithubProject$Outbound = { - uid: string; - createdAt: number; - updatedAt: number; - name: string; - activeDeployment: ActiveDeployment$Outbound | null; - lastPublished: number | null; - lastPublishedUid: string | null; - loginPortalUid: string; - activeThemeId: string; - typesenseId?: number | undefined; - isPrivate: boolean; - agentEnabled: boolean; - accessGroups?: any; - slug: string; - publishStatus: string; - publishMessage: string; - repository?: GithubProjectRepository$Outbound | null | undefined; -}; - -/** @internal */ -export const GithubProject$outboundSchema: z.ZodType< - GithubProject$Outbound, - z.ZodTypeDef, - GithubProject -> = z.object({ - uid: z.string(), - createdAt: z.number().int(), - updatedAt: z.number().int(), - name: z.string(), - activeDeployment: z.nullable(ActiveDeployment$outboundSchema), - lastPublished: z.nullable(z.number().int()), - lastPublishedUid: z.nullable(z.string()), - loginPortalUid: z.string().default(""), - activeThemeId: z.string().default(""), - typesenseId: z.number().optional(), - isPrivate: z.boolean().default(false), - agentEnabled: z.boolean().default(false), - accessGroups: z.any(), - slug: z.string(), - publishStatus: z.string().default(""), - publishMessage: z.string().default(""), - repository: z.nullable(GithubProjectRepository$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 GithubProject$ { - /** @deprecated use `GithubProject$inboundSchema` instead. */ - export const inboundSchema = GithubProject$inboundSchema; - /** @deprecated use `GithubProject$outboundSchema` instead. */ - export const outboundSchema = GithubProject$outboundSchema; - /** @deprecated use `GithubProject$Outbound` instead. */ - export type Outbound = GithubProject$Outbound; -} - -export function githubProjectToJSON(githubProject: GithubProject): string { - return JSON.stringify(GithubProject$outboundSchema.parse(githubProject)); -} - -export function githubProjectFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => GithubProject$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'GithubProject' from JSON`, - ); -} diff --git a/src/models/components/githubprojectrepository.ts b/src/models/components/githubprojectrepository.ts deleted file mode 100644 index d808fe3..0000000 --- a/src/models/components/githubprojectrepository.ts +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type GithubProjectRepository = { - linkedBy: string; - id: number; - name: string; - configPath?: string | undefined; - branch?: string | undefined; - publishOnMerge?: boolean | undefined; - publishPreviews?: boolean | undefined; - prComments?: boolean | undefined; - expired?: boolean | undefined; -}; - -/** @internal */ -export const GithubProjectRepository$inboundSchema: z.ZodType< - GithubProjectRepository, - z.ZodTypeDef, - unknown -> = z.object({ - linkedBy: z.string(), - id: z.number(), - name: z.string(), - configPath: z.string().default(""), - branch: z.string().default(""), - publishOnMerge: z.boolean().default(false), - publishPreviews: z.boolean().default(false), - prComments: z.boolean().default(false), - expired: z.boolean().default(false), -}); - -/** @internal */ -export type GithubProjectRepository$Outbound = { - linkedBy: string; - id: number; - name: string; - configPath: string; - branch: string; - publishOnMerge: boolean; - publishPreviews: boolean; - prComments: boolean; - expired: boolean; -}; - -/** @internal */ -export const GithubProjectRepository$outboundSchema: z.ZodType< - GithubProjectRepository$Outbound, - z.ZodTypeDef, - GithubProjectRepository -> = z.object({ - linkedBy: z.string(), - id: z.number(), - name: z.string(), - configPath: z.string().default(""), - branch: z.string().default(""), - publishOnMerge: z.boolean().default(false), - publishPreviews: z.boolean().default(false), - prComments: z.boolean().default(false), - expired: z.boolean().default(false), -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GithubProjectRepository$ { - /** @deprecated use `GithubProjectRepository$inboundSchema` instead. */ - export const inboundSchema = GithubProjectRepository$inboundSchema; - /** @deprecated use `GithubProjectRepository$outboundSchema` instead. */ - export const outboundSchema = GithubProjectRepository$outboundSchema; - /** @deprecated use `GithubProjectRepository$Outbound` instead. */ - export type Outbound = GithubProjectRepository$Outbound; -} - -export function githubProjectRepositoryToJSON( - githubProjectRepository: GithubProjectRepository, -): string { - return JSON.stringify( - GithubProjectRepository$outboundSchema.parse(githubProjectRepository), - ); -} - -export function githubProjectRepositoryFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => GithubProjectRepository$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'GithubProjectRepository' from JSON`, - ); -} diff --git a/src/models/components/httpmetadata.ts b/src/models/components/httpmetadata.ts deleted file mode 100644 index 014bfb3..0000000 --- a/src/models/components/httpmetadata.ts +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type HTTPMetadata = { - /** - * Raw HTTP response; suitable for custom response parsing - */ - response: Response; - /** - * Raw HTTP request; suitable for debugging - */ - request: Request; -}; - -/** @internal */ -export const HTTPMetadata$inboundSchema: z.ZodType< - HTTPMetadata, - z.ZodTypeDef, - unknown -> = z.object({ - Response: z.instanceof(Response), - Request: z.instanceof(Request), -}).transform((v) => { - return remap$(v, { - "Response": "response", - "Request": "request", - }); -}); - -/** @internal */ -export type HTTPMetadata$Outbound = { - Response: never; - Request: never; -}; - -/** @internal */ -export const HTTPMetadata$outboundSchema: z.ZodType< - HTTPMetadata$Outbound, - z.ZodTypeDef, - HTTPMetadata -> = z.object({ - response: z.instanceof(Response).transform(() => { - throw new Error("Response cannot be serialized"); - }), - request: z.instanceof(Request).transform(() => { - throw new Error("Response cannot be serialized"); - }), -}).transform((v) => { - return remap$(v, { - response: "Response", - request: "Request", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace HTTPMetadata$ { - /** @deprecated use `HTTPMetadata$inboundSchema` instead. */ - export const inboundSchema = HTTPMetadata$inboundSchema; - /** @deprecated use `HTTPMetadata$outboundSchema` instead. */ - export const outboundSchema = HTTPMetadata$outboundSchema; - /** @deprecated use `HTTPMetadata$Outbound` instead. */ - export type Outbound = HTTPMetadata$Outbound; -} - -export function httpMetadataToJSON(httpMetadata: HTTPMetadata): string { - return JSON.stringify(HTTPMetadata$outboundSchema.parse(httpMetadata)); -} - -export function httpMetadataFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => HTTPMetadata$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'HTTPMetadata' from JSON`, - ); -} diff --git a/src/models/components/index.ts b/src/models/components/index.ts deleted file mode 100644 index 37552d0..0000000 --- a/src/models/components/index.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export * from "./accessgroup.js"; -export * from "./activedeployment.js"; -export * from "./apidocument.js"; -export * from "./githubproject.js"; -export * from "./githubprojectrepository.js"; -export * from "./httpmetadata.js"; -export * from "./loginportal.js"; -export * from "./loginportalemail.js"; -export * from "./loginportalpage.js"; -export * from "./manageddocversion.js"; -export * from "./managedschemaversion.js"; -export * from "./method.js"; -export * from "./rule.js"; -export * from "./schema.js"; -export * from "./security.js"; -export * from "./team.js"; -export * from "./teamsummary.js"; -export * from "./theme.js"; -export * from "./uid.js"; -export * from "./user.js"; diff --git a/src/models/components/loginportal.ts b/src/models/components/loginportal.ts deleted file mode 100644 index 1bdd683..0000000 --- a/src/models/components/loginportal.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type LoginPortal = { - uid: string; - title: string; - slug: string; -}; - -/** @internal */ -export const LoginPortal$inboundSchema: z.ZodType< - LoginPortal, - z.ZodTypeDef, - unknown -> = z.object({ - uid: z.string(), - title: z.string(), - slug: z.string(), -}); - -/** @internal */ -export type LoginPortal$Outbound = { - uid: string; - title: string; - slug: string; -}; - -/** @internal */ -export const LoginPortal$outboundSchema: z.ZodType< - LoginPortal$Outbound, - z.ZodTypeDef, - LoginPortal -> = z.object({ - uid: z.string(), - title: z.string(), - 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 LoginPortal$ { - /** @deprecated use `LoginPortal$inboundSchema` instead. */ - export const inboundSchema = LoginPortal$inboundSchema; - /** @deprecated use `LoginPortal$outboundSchema` instead. */ - export const outboundSchema = LoginPortal$outboundSchema; - /** @deprecated use `LoginPortal$Outbound` instead. */ - export type Outbound = LoginPortal$Outbound; -} - -export function loginPortalToJSON(loginPortal: LoginPortal): string { - return JSON.stringify(LoginPortal$outboundSchema.parse(loginPortal)); -} - -export function loginPortalFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => LoginPortal$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'LoginPortal' from JSON`, - ); -} diff --git a/src/models/components/loginportalemail.ts b/src/models/components/loginportalemail.ts deleted file mode 100644 index 38ae958..0000000 --- a/src/models/components/loginportalemail.ts +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type LoginPortalEmail = { - logo?: string | undefined; - logoSize?: string | undefined; - buttonText?: string | undefined; - message?: string | undefined; - title?: string | undefined; - mainColor?: string | undefined; - mainBackground?: string | undefined; - cardColor?: string | undefined; - cardBackground?: string | undefined; - buttonColor?: string | undefined; - buttonBackground?: string | undefined; -}; - -/** @internal */ -export const LoginPortalEmail$inboundSchema: z.ZodType< - LoginPortalEmail, - z.ZodTypeDef, - unknown -> = z.object({ - logo: z.string().default(""), - logoSize: z.string().default("100"), - buttonText: z.string().default("Login"), - message: z.string().default( - "Click to access private documentation hosted by scalar.com", - ), - title: z.string().default("Private Docs"), - mainColor: z.string().default("#2a2f45"), - mainBackground: z.string().default("#f6f6f6"), - cardColor: z.string().default("2a2f45"), - cardBackground: z.string().default("#fff"), - buttonColor: z.string().default("#fff"), - buttonBackground: z.string().default("#0f0f0f"), -}); - -/** @internal */ -export type LoginPortalEmail$Outbound = { - logo: string; - logoSize: string; - buttonText: string; - message: string; - title: string; - mainColor: string; - mainBackground: string; - cardColor: string; - cardBackground: string; - buttonColor: string; - buttonBackground: string; -}; - -/** @internal */ -export const LoginPortalEmail$outboundSchema: z.ZodType< - LoginPortalEmail$Outbound, - z.ZodTypeDef, - LoginPortalEmail -> = z.object({ - logo: z.string().default(""), - logoSize: z.string().default("100"), - buttonText: z.string().default("Login"), - message: z.string().default( - "Click to access private documentation hosted by scalar.com", - ), - title: z.string().default("Private Docs"), - mainColor: z.string().default("#2a2f45"), - mainBackground: z.string().default("#f6f6f6"), - cardColor: z.string().default("2a2f45"), - cardBackground: z.string().default("#fff"), - buttonColor: z.string().default("#fff"), - buttonBackground: z.string().default("#0f0f0f"), -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace LoginPortalEmail$ { - /** @deprecated use `LoginPortalEmail$inboundSchema` instead. */ - export const inboundSchema = LoginPortalEmail$inboundSchema; - /** @deprecated use `LoginPortalEmail$outboundSchema` instead. */ - export const outboundSchema = LoginPortalEmail$outboundSchema; - /** @deprecated use `LoginPortalEmail$Outbound` instead. */ - export type Outbound = LoginPortalEmail$Outbound; -} - -export function loginPortalEmailToJSON( - loginPortalEmail: LoginPortalEmail, -): string { - return JSON.stringify( - LoginPortalEmail$outboundSchema.parse(loginPortalEmail), - ); -} - -export function loginPortalEmailFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => LoginPortalEmail$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'LoginPortalEmail' from JSON`, - ); -} diff --git a/src/models/components/loginportalpage.ts b/src/models/components/loginportalpage.ts deleted file mode 100644 index c96d1a1..0000000 --- a/src/models/components/loginportalpage.ts +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type LoginPortalPage = { - title?: string | undefined; - description?: string | undefined; - head?: string | undefined; - script?: string | undefined; - theme?: string | undefined; - companyName?: string | undefined; - logo?: string | undefined; - logoURL?: string | undefined; - favicon?: string | undefined; - termsLink?: string | undefined; - privacyLink?: string | undefined; - formTitle?: string | undefined; - formDescription?: string | undefined; - formImage?: string | undefined; -}; - -/** @internal */ -export const LoginPortalPage$inboundSchema: z.ZodType< - LoginPortalPage, - z.ZodTypeDef, - unknown -> = z.object({ - title: z.string().default("Scalar Private Docs"), - description: z.string().default("Login to access your documentation"), - head: z.string().default(""), - script: z.string().default(""), - theme: z.string().default(""), - companyName: z.string().default(""), - logo: z.string().default(""), - logoURL: z.string().default(""), - favicon: z.string().default(""), - termsLink: z.string().default(""), - privacyLink: z.string().default(""), - formTitle: z.string().default("Scalar Private Docs"), - formDescription: z.string().default("Login to access your documentation"), - formImage: z.string().default(""), -}); - -/** @internal */ -export type LoginPortalPage$Outbound = { - title: string; - description: string; - head: string; - script: string; - theme: string; - companyName: string; - logo: string; - logoURL: string; - favicon: string; - termsLink: string; - privacyLink: string; - formTitle: string; - formDescription: string; - formImage: string; -}; - -/** @internal */ -export const LoginPortalPage$outboundSchema: z.ZodType< - LoginPortalPage$Outbound, - z.ZodTypeDef, - LoginPortalPage -> = z.object({ - title: z.string().default("Scalar Private Docs"), - description: z.string().default("Login to access your documentation"), - head: z.string().default(""), - script: z.string().default(""), - theme: z.string().default(""), - companyName: z.string().default(""), - logo: z.string().default(""), - logoURL: z.string().default(""), - favicon: z.string().default(""), - termsLink: z.string().default(""), - privacyLink: z.string().default(""), - formTitle: z.string().default("Scalar Private Docs"), - formDescription: z.string().default("Login to access your documentation"), - formImage: z.string().default(""), -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace LoginPortalPage$ { - /** @deprecated use `LoginPortalPage$inboundSchema` instead. */ - export const inboundSchema = LoginPortalPage$inboundSchema; - /** @deprecated use `LoginPortalPage$outboundSchema` instead. */ - export const outboundSchema = LoginPortalPage$outboundSchema; - /** @deprecated use `LoginPortalPage$Outbound` instead. */ - export type Outbound = LoginPortalPage$Outbound; -} - -export function loginPortalPageToJSON( - loginPortalPage: LoginPortalPage, -): string { - return JSON.stringify(LoginPortalPage$outboundSchema.parse(loginPortalPage)); -} - -export function loginPortalPageFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => LoginPortalPage$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'LoginPortalPage' from JSON`, - ); -} diff --git a/src/models/components/manageddocversion.ts b/src/models/components/manageddocversion.ts deleted file mode 100644 index d2d81e4..0000000 --- a/src/models/components/manageddocversion.ts +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { safeParse } from "../../lib/schemas.js"; -import { ClosedEnum } from "../../types/enums.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { - Method, - Method$inboundSchema, - Method$outboundSchema, -} from "./method.js"; - -export const EmbedStatus = { - Complete: "complete", - Failed: "failed", -} as const; -export type EmbedStatus = ClosedEnum; - -export const EnabledTools = { - ExecuteRequest: "execute-request", - GetMiniOpenapiSpec: "get-mini-openapi-spec", -} as const; -export type EnabledTools = ClosedEnum; - -export type Tools = { - path: string; - method: Method; - enabledTools: Array; -}; - -export type ManagedDocVersion = { - uid: string; - createdAt: number; - version: string; - upgraded?: boolean | undefined; - embedStatus: EmbedStatus | null; - tags: Array; - tools?: Array | undefined; - yamlSha?: string | undefined; - jsonSha?: string | undefined; - versionSha?: string | undefined; -}; - -/** @internal */ -export const EmbedStatus$inboundSchema: z.ZodNativeEnum = z - .nativeEnum(EmbedStatus); - -/** @internal */ -export const EmbedStatus$outboundSchema: z.ZodNativeEnum = - EmbedStatus$inboundSchema; - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace EmbedStatus$ { - /** @deprecated use `EmbedStatus$inboundSchema` instead. */ - export const inboundSchema = EmbedStatus$inboundSchema; - /** @deprecated use `EmbedStatus$outboundSchema` instead. */ - export const outboundSchema = EmbedStatus$outboundSchema; -} - -/** @internal */ -export const EnabledTools$inboundSchema: z.ZodNativeEnum = - z.nativeEnum(EnabledTools); - -/** @internal */ -export const EnabledTools$outboundSchema: z.ZodNativeEnum = - EnabledTools$inboundSchema; - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace EnabledTools$ { - /** @deprecated use `EnabledTools$inboundSchema` instead. */ - export const inboundSchema = EnabledTools$inboundSchema; - /** @deprecated use `EnabledTools$outboundSchema` instead. */ - export const outboundSchema = EnabledTools$outboundSchema; -} - -/** @internal */ -export const Tools$inboundSchema: z.ZodType = z - .object({ - path: z.string(), - method: Method$inboundSchema, - enabledTools: z.array(EnabledTools$inboundSchema), - }); - -/** @internal */ -export type Tools$Outbound = { - path: string; - method: string; - enabledTools: Array; -}; - -/** @internal */ -export const Tools$outboundSchema: z.ZodType< - Tools$Outbound, - z.ZodTypeDef, - Tools -> = z.object({ - path: z.string(), - method: Method$outboundSchema, - enabledTools: z.array(EnabledTools$outboundSchema), -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace Tools$ { - /** @deprecated use `Tools$inboundSchema` instead. */ - export const inboundSchema = Tools$inboundSchema; - /** @deprecated use `Tools$outboundSchema` instead. */ - export const outboundSchema = Tools$outboundSchema; - /** @deprecated use `Tools$Outbound` instead. */ - export type Outbound = Tools$Outbound; -} - -export function toolsToJSON(tools: Tools): string { - return JSON.stringify(Tools$outboundSchema.parse(tools)); -} - -export function toolsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Tools$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Tools' from JSON`, - ); -} - -/** @internal */ -export const ManagedDocVersion$inboundSchema: z.ZodType< - ManagedDocVersion, - z.ZodTypeDef, - unknown -> = z.object({ - uid: z.string(), - createdAt: z.number(), - version: z.string(), - upgraded: z.boolean().default(false), - embedStatus: z.nullable(EmbedStatus$inboundSchema), - tags: z.array(z.string()), - tools: z.array(z.lazy(() => Tools$inboundSchema)).optional(), - yamlSha: z.string().optional(), - jsonSha: z.string().optional(), - versionSha: z.string().optional(), -}); - -/** @internal */ -export type ManagedDocVersion$Outbound = { - uid: string; - createdAt: number; - version: string; - upgraded: boolean; - embedStatus: string | null; - tags: Array; - tools?: Array | undefined; - yamlSha?: string | undefined; - jsonSha?: string | undefined; - versionSha?: string | undefined; -}; - -/** @internal */ -export const ManagedDocVersion$outboundSchema: z.ZodType< - ManagedDocVersion$Outbound, - z.ZodTypeDef, - ManagedDocVersion -> = z.object({ - uid: z.string(), - createdAt: z.number(), - version: z.string(), - upgraded: z.boolean().default(false), - embedStatus: z.nullable(EmbedStatus$outboundSchema), - tags: z.array(z.string()), - tools: z.array(z.lazy(() => Tools$outboundSchema)).optional(), - yamlSha: z.string().optional(), - jsonSha: z.string().optional(), - versionSha: 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 ManagedDocVersion$ { - /** @deprecated use `ManagedDocVersion$inboundSchema` instead. */ - export const inboundSchema = ManagedDocVersion$inboundSchema; - /** @deprecated use `ManagedDocVersion$outboundSchema` instead. */ - export const outboundSchema = ManagedDocVersion$outboundSchema; - /** @deprecated use `ManagedDocVersion$Outbound` instead. */ - export type Outbound = ManagedDocVersion$Outbound; -} - -export function managedDocVersionToJSON( - managedDocVersion: ManagedDocVersion, -): string { - return JSON.stringify( - ManagedDocVersion$outboundSchema.parse(managedDocVersion), - ); -} - -export function managedDocVersionFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ManagedDocVersion$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ManagedDocVersion' from JSON`, - ); -} diff --git a/src/models/components/managedschemaversion.ts b/src/models/components/managedschemaversion.ts deleted file mode 100644 index 384835b..0000000 --- a/src/models/components/managedschemaversion.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type ManagedSchemaVersion = { - uid: string; - createdAt: number; - updatedAt: number; - version: string; -}; - -/** @internal */ -export const ManagedSchemaVersion$inboundSchema: z.ZodType< - ManagedSchemaVersion, - z.ZodTypeDef, - unknown -> = z.object({ - uid: z.string(), - createdAt: z.number().int(), - updatedAt: z.number().int(), - version: z.string(), -}); - -/** @internal */ -export type ManagedSchemaVersion$Outbound = { - uid: string; - createdAt: number; - updatedAt: number; - version: string; -}; - -/** @internal */ -export const ManagedSchemaVersion$outboundSchema: z.ZodType< - ManagedSchemaVersion$Outbound, - z.ZodTypeDef, - ManagedSchemaVersion -> = z.object({ - uid: z.string(), - createdAt: z.number().int(), - updatedAt: z.number().int(), - version: 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 ManagedSchemaVersion$ { - /** @deprecated use `ManagedSchemaVersion$inboundSchema` instead. */ - export const inboundSchema = ManagedSchemaVersion$inboundSchema; - /** @deprecated use `ManagedSchemaVersion$outboundSchema` instead. */ - export const outboundSchema = ManagedSchemaVersion$outboundSchema; - /** @deprecated use `ManagedSchemaVersion$Outbound` instead. */ - export type Outbound = ManagedSchemaVersion$Outbound; -} - -export function managedSchemaVersionToJSON( - managedSchemaVersion: ManagedSchemaVersion, -): string { - return JSON.stringify( - ManagedSchemaVersion$outboundSchema.parse(managedSchemaVersion), - ); -} - -export function managedSchemaVersionFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ManagedSchemaVersion$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ManagedSchemaVersion' from JSON`, - ); -} diff --git a/src/models/components/method.ts b/src/models/components/method.ts deleted file mode 100644 index 09ddb78..0000000 --- a/src/models/components/method.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { ClosedEnum } from "../../types/enums.js"; - -export const Method = { - Delete: "delete", - Get: "get", - Head: "head", - Options: "options", - Patch: "patch", - Post: "post", - Put: "put", - Trace: "trace", -} as const; -export type Method = ClosedEnum; - -/** @internal */ -export const Method$inboundSchema: z.ZodNativeEnum = z - .nativeEnum(Method); - -/** @internal */ -export const Method$outboundSchema: z.ZodNativeEnum = - Method$inboundSchema; - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace Method$ { - /** @deprecated use `Method$inboundSchema` instead. */ - export const inboundSchema = Method$inboundSchema; - /** @deprecated use `Method$outboundSchema` instead. */ - export const outboundSchema = Method$outboundSchema; -} diff --git a/src/models/components/rule.ts b/src/models/components/rule.ts deleted file mode 100644 index 6dce7b3..0000000 --- a/src/models/components/rule.ts +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type Rule = { - uid: string; - title?: string | undefined; - description?: string | undefined; - slug: string; - namespace: string; - isPrivate?: boolean | undefined; -}; - -/** @internal */ -export const Rule$inboundSchema: z.ZodType = z - .object({ - uid: z.string(), - title: z.string().default(""), - description: z.string().default(""), - slug: z.string(), - namespace: z.string(), - isPrivate: z.boolean().default(false), - }); - -/** @internal */ -export type Rule$Outbound = { - uid: string; - title: string; - description: string; - slug: string; - namespace: string; - isPrivate: boolean; -}; - -/** @internal */ -export const Rule$outboundSchema: z.ZodType = - z.object({ - uid: z.string(), - title: z.string().default(""), - description: z.string().default(""), - slug: z.string(), - namespace: z.string(), - isPrivate: z.boolean().default(false), - }); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace Rule$ { - /** @deprecated use `Rule$inboundSchema` instead. */ - export const inboundSchema = Rule$inboundSchema; - /** @deprecated use `Rule$outboundSchema` instead. */ - export const outboundSchema = Rule$outboundSchema; - /** @deprecated use `Rule$Outbound` instead. */ - export type Outbound = Rule$Outbound; -} - -export function ruleToJSON(rule: Rule): string { - return JSON.stringify(Rule$outboundSchema.parse(rule)); -} - -export function ruleFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Rule$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Rule' from JSON`, - ); -} diff --git a/src/models/components/schema.ts b/src/models/components/schema.ts deleted file mode 100644 index 9b6c68b..0000000 --- a/src/models/components/schema.ts +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { - ManagedSchemaVersion, - ManagedSchemaVersion$inboundSchema, - ManagedSchemaVersion$Outbound, - ManagedSchemaVersion$outboundSchema, -} from "./managedschemaversion.js"; - -export type Schema = { - uid: string; - title?: string | undefined; - description?: string | undefined; - slug: string; - namespace: string; - isPrivate?: boolean | undefined; - versions: Array; -}; - -/** @internal */ -export const Schema$inboundSchema: z.ZodType = z - .object({ - uid: z.string(), - title: z.string().default(""), - description: z.string().default(""), - slug: z.string(), - namespace: z.string(), - isPrivate: z.boolean().default(false), - versions: z.array(ManagedSchemaVersion$inboundSchema), - }); - -/** @internal */ -export type Schema$Outbound = { - uid: string; - title: string; - description: string; - slug: string; - namespace: string; - isPrivate: boolean; - versions: Array; -}; - -/** @internal */ -export const Schema$outboundSchema: z.ZodType< - Schema$Outbound, - z.ZodTypeDef, - Schema -> = z.object({ - uid: z.string(), - title: z.string().default(""), - description: z.string().default(""), - slug: z.string(), - namespace: z.string(), - isPrivate: z.boolean().default(false), - versions: z.array(ManagedSchemaVersion$outboundSchema), -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace Schema$ { - /** @deprecated use `Schema$inboundSchema` instead. */ - export const inboundSchema = Schema$inboundSchema; - /** @deprecated use `Schema$outboundSchema` instead. */ - export const outboundSchema = Schema$outboundSchema; - /** @deprecated use `Schema$Outbound` instead. */ - export type Outbound = Schema$Outbound; -} - -export function schemaToJSON(schema: Schema): string { - return JSON.stringify(Schema$outboundSchema.parse(schema)); -} - -export function schemaFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Schema$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Schema' from JSON`, - ); -} diff --git a/src/models/components/security.ts b/src/models/components/security.ts deleted file mode 100644 index c88c60c..0000000 --- a/src/models/components/security.ts +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type Security = { - bearerAuth?: string | undefined; -}; - -/** @internal */ -export const Security$inboundSchema: z.ZodType< - Security, - z.ZodTypeDef, - unknown -> = z.object({ - BearerAuth: z.string().optional(), -}).transform((v) => { - return remap$(v, { - "BearerAuth": "bearerAuth", - }); -}); - -/** @internal */ -export type Security$Outbound = { - BearerAuth?: string | undefined; -}; - -/** @internal */ -export const Security$outboundSchema: z.ZodType< - Security$Outbound, - z.ZodTypeDef, - Security -> = z.object({ - bearerAuth: z.string().optional(), -}).transform((v) => { - return remap$(v, { - bearerAuth: "BearerAuth", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace Security$ { - /** @deprecated use `Security$inboundSchema` instead. */ - export const inboundSchema = Security$inboundSchema; - /** @deprecated use `Security$outboundSchema` instead. */ - export const outboundSchema = Security$outboundSchema; - /** @deprecated use `Security$Outbound` instead. */ - export type Outbound = Security$Outbound; -} - -export function securityToJSON(security: Security): string { - return JSON.stringify(Security$outboundSchema.parse(security)); -} - -export function securityFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Security$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Security' from JSON`, - ); -} diff --git a/src/models/components/team.ts b/src/models/components/team.ts deleted file mode 100644 index ec0c011..0000000 --- a/src/models/components/team.ts +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type Team = { - uid: string; - name: string; - imageUri?: string | undefined; - slug: string; - theme: string; -}; - -/** @internal */ -export const Team$inboundSchema: z.ZodType = z - .object({ - uid: z.string(), - name: z.string(), - imageUri: z.string().optional(), - slug: z.string(), - theme: z.string(), - }); - -/** @internal */ -export type Team$Outbound = { - uid: string; - name: string; - imageUri?: string | undefined; - slug: string; - theme: string; -}; - -/** @internal */ -export const Team$outboundSchema: z.ZodType = - z.object({ - uid: z.string(), - name: z.string(), - imageUri: z.string().optional(), - slug: z.string(), - theme: 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 Team$ { - /** @deprecated use `Team$inboundSchema` instead. */ - export const inboundSchema = Team$inboundSchema; - /** @deprecated use `Team$outboundSchema` instead. */ - export const outboundSchema = Team$outboundSchema; - /** @deprecated use `Team$Outbound` instead. */ - export type Outbound = Team$Outbound; -} - -export function teamToJSON(team: Team): string { - return JSON.stringify(Team$outboundSchema.parse(team)); -} - -export function teamFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Team$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Team' from JSON`, - ); -} diff --git a/src/models/components/teamsummary.ts b/src/models/components/teamsummary.ts deleted file mode 100644 index aa67cc0..0000000 --- a/src/models/components/teamsummary.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type TeamSummary = { - uid: string; - name: string; - imageUri?: string | undefined; -}; - -/** @internal */ -export const TeamSummary$inboundSchema: z.ZodType< - TeamSummary, - z.ZodTypeDef, - unknown -> = z.object({ - uid: z.string(), - name: z.string(), - imageUri: z.string().optional(), -}); - -/** @internal */ -export type TeamSummary$Outbound = { - uid: string; - name: string; - imageUri?: string | undefined; -}; - -/** @internal */ -export const TeamSummary$outboundSchema: z.ZodType< - TeamSummary$Outbound, - z.ZodTypeDef, - TeamSummary -> = z.object({ - uid: z.string(), - name: z.string(), - imageUri: 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 TeamSummary$ { - /** @deprecated use `TeamSummary$inboundSchema` instead. */ - export const inboundSchema = TeamSummary$inboundSchema; - /** @deprecated use `TeamSummary$outboundSchema` instead. */ - export const outboundSchema = TeamSummary$outboundSchema; - /** @deprecated use `TeamSummary$Outbound` instead. */ - export type Outbound = TeamSummary$Outbound; -} - -export function teamSummaryToJSON(teamSummary: TeamSummary): string { - return JSON.stringify(TeamSummary$outboundSchema.parse(teamSummary)); -} - -export function teamSummaryFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => TeamSummary$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'TeamSummary' from JSON`, - ); -} diff --git a/src/models/components/theme.ts b/src/models/components/theme.ts deleted file mode 100644 index e9688c5..0000000 --- a/src/models/components/theme.ts +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type Theme = { - uid: string; - name: string; - description: string; - slug: string; -}; - -/** @internal */ -export const Theme$inboundSchema: z.ZodType = z - .object({ - uid: z.string(), - name: z.string(), - description: z.string(), - slug: z.string(), - }); - -/** @internal */ -export type Theme$Outbound = { - uid: string; - name: string; - description: string; - slug: string; -}; - -/** @internal */ -export const Theme$outboundSchema: z.ZodType< - Theme$Outbound, - z.ZodTypeDef, - Theme -> = z.object({ - uid: z.string(), - name: z.string(), - description: z.string(), - 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 Theme$ { - /** @deprecated use `Theme$inboundSchema` instead. */ - export const inboundSchema = Theme$inboundSchema; - /** @deprecated use `Theme$outboundSchema` instead. */ - export const outboundSchema = Theme$outboundSchema; - /** @deprecated use `Theme$Outbound` instead. */ - export type Outbound = Theme$Outbound; -} - -export function themeToJSON(theme: Theme): string { - return JSON.stringify(Theme$outboundSchema.parse(theme)); -} - -export function themeFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Theme$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Theme' from JSON`, - ); -} diff --git a/src/models/components/uid.ts b/src/models/components/uid.ts deleted file mode 100644 index e182eff..0000000 --- a/src/models/components/uid.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type Uid = { - uid: string; -}; - -/** @internal */ -export const Uid$inboundSchema: z.ZodType = z - .object({ - uid: z.string(), - }); - -/** @internal */ -export type Uid$Outbound = { - uid: string; -}; - -/** @internal */ -export const Uid$outboundSchema: z.ZodType = z - .object({ - uid: 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 Uid$ { - /** @deprecated use `Uid$inboundSchema` instead. */ - export const inboundSchema = Uid$inboundSchema; - /** @deprecated use `Uid$outboundSchema` instead. */ - export const outboundSchema = Uid$outboundSchema; - /** @deprecated use `Uid$Outbound` instead. */ - export type Outbound = Uid$Outbound; -} - -export function uidToJSON(uid: Uid): string { - return JSON.stringify(Uid$outboundSchema.parse(uid)); -} - -export function uidFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Uid$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Uid' from JSON`, - ); -} diff --git a/src/models/components/user.ts b/src/models/components/user.ts deleted file mode 100644 index a0bb69d..0000000 --- a/src/models/components/user.ts +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { - TeamSummary, - TeamSummary$inboundSchema, - TeamSummary$Outbound, - TeamSummary$outboundSchema, -} from "./teamsummary.js"; - -export type User = { - uid: string; - createdAt: number; - updatedAt: number; - email: string; - theme?: string | undefined; - activeTeamId: string | null; - hasGithub?: boolean | undefined; - teams: Array; -}; - -/** @internal */ -export const User$inboundSchema: z.ZodType = z - .object({ - uid: z.string(), - createdAt: z.number().int(), - updatedAt: z.number().int(), - email: z.string(), - theme: z.string().optional(), - activeTeamId: z.nullable(z.string()), - hasGithub: z.boolean().default(false), - teams: z.array(TeamSummary$inboundSchema), - }); - -/** @internal */ -export type User$Outbound = { - uid: string; - createdAt: number; - updatedAt: number; - email: string; - theme?: string | undefined; - activeTeamId: string | null; - hasGithub: boolean; - teams: Array; -}; - -/** @internal */ -export const User$outboundSchema: z.ZodType = - z.object({ - uid: z.string(), - createdAt: z.number().int(), - updatedAt: z.number().int(), - email: z.string(), - theme: z.string().optional(), - activeTeamId: z.nullable(z.string()), - hasGithub: z.boolean().default(false), - teams: z.array(TeamSummary$outboundSchema), - }); - -/** - * @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; -} - -export function userToJSON(user: User): string { - return JSON.stringify(User$outboundSchema.parse(user)); -} - -export function userFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => User$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'User' from JSON`, - ); -} diff --git a/src/models/errors/apierror.ts b/src/models/errors/apierror.ts deleted file mode 100644 index 8d3d0e8..0000000 --- a/src/models/errors/apierror.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ScalarError } from "./scalarerror.js"; - -/** The fallback error class if no more specific error class is matched */ -export class APIError extends ScalarError { - constructor( - message: string, - httpMeta: { - response: Response; - request: Request; - body: string; - }, - ) { - if (message) { - message += `: `; - } - message += `Status ${httpMeta.response.status}`; - const contentType = httpMeta.response.headers.get("content-type") || `""`; - if (contentType !== "application/json") { - message += ` Content-Type ${ - contentType.includes(" ") ? `"${contentType}"` : contentType - }`; - } - const body = httpMeta.body || `""`; - message += body.length > 100 ? "\n" : " "; - message += `Body ${body}`; - message = message.trim(); - super(message, httpMeta); - this.name = "APIError"; - } -} diff --git a/src/models/errors/fivehundred.ts b/src/models/errors/fivehundred.ts deleted file mode 100644 index 93e249b..0000000 --- a/src/models/errors/fivehundred.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { ScalarError } from "./scalarerror.js"; - -export type FiveHundredData = { - message: string; - code: string; -}; - -export class FiveHundred extends ScalarError { - code: string; - - /** The original data that was passed to this error instance. */ - data$: FiveHundredData; - - constructor( - err: FiveHundredData, - httpMeta: { response: Response; request: Request; body: string }, - ) { - const message = "message" in err && typeof err.message === "string" - ? err.message - : `API error occurred: ${JSON.stringify(err)}`; - super(message, httpMeta); - this.data$ = err; - this.code = err.code; - - this.name = "FiveHundred"; - } -} - -/** @internal */ -export const FiveHundred$inboundSchema: z.ZodType< - FiveHundred, - z.ZodTypeDef, - unknown -> = z.object({ - message: z.string(), - code: z.string(), - request$: z.instanceof(Request), - response$: z.instanceof(Response), - body$: z.string(), -}) - .transform((v) => { - return new FiveHundred(v, { - request: v.request$, - response: v.response$, - body: v.body$, - }); - }); - -/** @internal */ -export type FiveHundred$Outbound = { - message: string; - code: string; -}; - -/** @internal */ -export const FiveHundred$outboundSchema: z.ZodType< - FiveHundred$Outbound, - z.ZodTypeDef, - FiveHundred -> = z.instanceof(FiveHundred) - .transform(v => v.data$) - .pipe(z.object({ - message: z.string(), - code: 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 FiveHundred$ { - /** @deprecated use `FiveHundred$inboundSchema` instead. */ - export const inboundSchema = FiveHundred$inboundSchema; - /** @deprecated use `FiveHundred$outboundSchema` instead. */ - export const outboundSchema = FiveHundred$outboundSchema; - /** @deprecated use `FiveHundred$Outbound` instead. */ - export type Outbound = FiveHundred$Outbound; -} diff --git a/src/models/errors/fourhundred.ts b/src/models/errors/fourhundred.ts deleted file mode 100644 index b39b338..0000000 --- a/src/models/errors/fourhundred.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { ScalarError } from "./scalarerror.js"; - -export type FourHundredData = { - message: string; - code: string; -}; - -export class FourHundred extends ScalarError { - code: string; - - /** The original data that was passed to this error instance. */ - data$: FourHundredData; - - constructor( - err: FourHundredData, - httpMeta: { response: Response; request: Request; body: string }, - ) { - const message = "message" in err && typeof err.message === "string" - ? err.message - : `API error occurred: ${JSON.stringify(err)}`; - super(message, httpMeta); - this.data$ = err; - this.code = err.code; - - this.name = "FourHundred"; - } -} - -/** @internal */ -export const FourHundred$inboundSchema: z.ZodType< - FourHundred, - z.ZodTypeDef, - unknown -> = z.object({ - message: z.string(), - code: z.string(), - request$: z.instanceof(Request), - response$: z.instanceof(Response), - body$: z.string(), -}) - .transform((v) => { - return new FourHundred(v, { - request: v.request$, - response: v.response$, - body: v.body$, - }); - }); - -/** @internal */ -export type FourHundred$Outbound = { - message: string; - code: string; -}; - -/** @internal */ -export const FourHundred$outboundSchema: z.ZodType< - FourHundred$Outbound, - z.ZodTypeDef, - FourHundred -> = z.instanceof(FourHundred) - .transform(v => v.data$) - .pipe(z.object({ - message: z.string(), - code: 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 FourHundred$ { - /** @deprecated use `FourHundred$inboundSchema` instead. */ - export const inboundSchema = FourHundred$inboundSchema; - /** @deprecated use `FourHundred$outboundSchema` instead. */ - export const outboundSchema = FourHundred$outboundSchema; - /** @deprecated use `FourHundred$Outbound` instead. */ - export type Outbound = FourHundred$Outbound; -} diff --git a/src/models/errors/fourhundredandfour.ts b/src/models/errors/fourhundredandfour.ts deleted file mode 100644 index cda8b06..0000000 --- a/src/models/errors/fourhundredandfour.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { ScalarError } from "./scalarerror.js"; - -export type FourHundredAndFourData = { - message: string; - code: string; -}; - -export class FourHundredAndFour extends ScalarError { - code: string; - - /** The original data that was passed to this error instance. */ - data$: FourHundredAndFourData; - - constructor( - err: FourHundredAndFourData, - httpMeta: { response: Response; request: Request; body: string }, - ) { - const message = "message" in err && typeof err.message === "string" - ? err.message - : `API error occurred: ${JSON.stringify(err)}`; - super(message, httpMeta); - this.data$ = err; - this.code = err.code; - - this.name = "FourHundredAndFour"; - } -} - -/** @internal */ -export const FourHundredAndFour$inboundSchema: z.ZodType< - FourHundredAndFour, - z.ZodTypeDef, - unknown -> = z.object({ - message: z.string(), - code: z.string(), - request$: z.instanceof(Request), - response$: z.instanceof(Response), - body$: z.string(), -}) - .transform((v) => { - return new FourHundredAndFour(v, { - request: v.request$, - response: v.response$, - body: v.body$, - }); - }); - -/** @internal */ -export type FourHundredAndFour$Outbound = { - message: string; - code: string; -}; - -/** @internal */ -export const FourHundredAndFour$outboundSchema: z.ZodType< - FourHundredAndFour$Outbound, - z.ZodTypeDef, - FourHundredAndFour -> = z.instanceof(FourHundredAndFour) - .transform(v => v.data$) - .pipe(z.object({ - message: z.string(), - code: 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 FourHundredAndFour$ { - /** @deprecated use `FourHundredAndFour$inboundSchema` instead. */ - export const inboundSchema = FourHundredAndFour$inboundSchema; - /** @deprecated use `FourHundredAndFour$outboundSchema` instead. */ - export const outboundSchema = FourHundredAndFour$outboundSchema; - /** @deprecated use `FourHundredAndFour$Outbound` instead. */ - export type Outbound = FourHundredAndFour$Outbound; -} diff --git a/src/models/errors/fourhundredandone.ts b/src/models/errors/fourhundredandone.ts deleted file mode 100644 index 41980a9..0000000 --- a/src/models/errors/fourhundredandone.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { ScalarError } from "./scalarerror.js"; - -export type FourHundredAndOneData = { - message: string; - code: string; -}; - -export class FourHundredAndOne extends ScalarError { - code: string; - - /** The original data that was passed to this error instance. */ - data$: FourHundredAndOneData; - - constructor( - err: FourHundredAndOneData, - httpMeta: { response: Response; request: Request; body: string }, - ) { - const message = "message" in err && typeof err.message === "string" - ? err.message - : `API error occurred: ${JSON.stringify(err)}`; - super(message, httpMeta); - this.data$ = err; - this.code = err.code; - - this.name = "FourHundredAndOne"; - } -} - -/** @internal */ -export const FourHundredAndOne$inboundSchema: z.ZodType< - FourHundredAndOne, - z.ZodTypeDef, - unknown -> = z.object({ - message: z.string(), - code: z.string(), - request$: z.instanceof(Request), - response$: z.instanceof(Response), - body$: z.string(), -}) - .transform((v) => { - return new FourHundredAndOne(v, { - request: v.request$, - response: v.response$, - body: v.body$, - }); - }); - -/** @internal */ -export type FourHundredAndOne$Outbound = { - message: string; - code: string; -}; - -/** @internal */ -export const FourHundredAndOne$outboundSchema: z.ZodType< - FourHundredAndOne$Outbound, - z.ZodTypeDef, - FourHundredAndOne -> = z.instanceof(FourHundredAndOne) - .transform(v => v.data$) - .pipe(z.object({ - message: z.string(), - code: 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 FourHundredAndOne$ { - /** @deprecated use `FourHundredAndOne$inboundSchema` instead. */ - export const inboundSchema = FourHundredAndOne$inboundSchema; - /** @deprecated use `FourHundredAndOne$outboundSchema` instead. */ - export const outboundSchema = FourHundredAndOne$outboundSchema; - /** @deprecated use `FourHundredAndOne$Outbound` instead. */ - export type Outbound = FourHundredAndOne$Outbound; -} diff --git a/src/models/errors/fourhundredandthree.ts b/src/models/errors/fourhundredandthree.ts deleted file mode 100644 index 9f66293..0000000 --- a/src/models/errors/fourhundredandthree.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { ScalarError } from "./scalarerror.js"; - -export type FourHundredAndThreeData = { - message: string; - code: string; -}; - -export class FourHundredAndThree extends ScalarError { - code: string; - - /** The original data that was passed to this error instance. */ - data$: FourHundredAndThreeData; - - constructor( - err: FourHundredAndThreeData, - httpMeta: { response: Response; request: Request; body: string }, - ) { - const message = "message" in err && typeof err.message === "string" - ? err.message - : `API error occurred: ${JSON.stringify(err)}`; - super(message, httpMeta); - this.data$ = err; - this.code = err.code; - - this.name = "FourHundredAndThree"; - } -} - -/** @internal */ -export const FourHundredAndThree$inboundSchema: z.ZodType< - FourHundredAndThree, - z.ZodTypeDef, - unknown -> = z.object({ - message: z.string(), - code: z.string(), - request$: z.instanceof(Request), - response$: z.instanceof(Response), - body$: z.string(), -}) - .transform((v) => { - return new FourHundredAndThree(v, { - request: v.request$, - response: v.response$, - body: v.body$, - }); - }); - -/** @internal */ -export type FourHundredAndThree$Outbound = { - message: string; - code: string; -}; - -/** @internal */ -export const FourHundredAndThree$outboundSchema: z.ZodType< - FourHundredAndThree$Outbound, - z.ZodTypeDef, - FourHundredAndThree -> = z.instanceof(FourHundredAndThree) - .transform(v => v.data$) - .pipe(z.object({ - message: z.string(), - code: 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 FourHundredAndThree$ { - /** @deprecated use `FourHundredAndThree$inboundSchema` instead. */ - export const inboundSchema = FourHundredAndThree$inboundSchema; - /** @deprecated use `FourHundredAndThree$outboundSchema` instead. */ - export const outboundSchema = FourHundredAndThree$outboundSchema; - /** @deprecated use `FourHundredAndThree$Outbound` instead. */ - export type Outbound = FourHundredAndThree$Outbound; -} diff --git a/src/models/errors/fourhundredandtwentytwo.ts b/src/models/errors/fourhundredandtwentytwo.ts deleted file mode 100644 index aa80ee2..0000000 --- a/src/models/errors/fourhundredandtwentytwo.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { ScalarError } from "./scalarerror.js"; - -export type FourHundredAndTwentyTwoData = { - message: string; - code: string; -}; - -export class FourHundredAndTwentyTwo extends ScalarError { - code: string; - - /** The original data that was passed to this error instance. */ - data$: FourHundredAndTwentyTwoData; - - constructor( - err: FourHundredAndTwentyTwoData, - httpMeta: { response: Response; request: Request; body: string }, - ) { - const message = "message" in err && typeof err.message === "string" - ? err.message - : `API error occurred: ${JSON.stringify(err)}`; - super(message, httpMeta); - this.data$ = err; - this.code = err.code; - - this.name = "FourHundredAndTwentyTwo"; - } -} - -/** @internal */ -export const FourHundredAndTwentyTwo$inboundSchema: z.ZodType< - FourHundredAndTwentyTwo, - z.ZodTypeDef, - unknown -> = z.object({ - message: z.string(), - code: z.string(), - request$: z.instanceof(Request), - response$: z.instanceof(Response), - body$: z.string(), -}) - .transform((v) => { - return new FourHundredAndTwentyTwo(v, { - request: v.request$, - response: v.response$, - body: v.body$, - }); - }); - -/** @internal */ -export type FourHundredAndTwentyTwo$Outbound = { - message: string; - code: string; -}; - -/** @internal */ -export const FourHundredAndTwentyTwo$outboundSchema: z.ZodType< - FourHundredAndTwentyTwo$Outbound, - z.ZodTypeDef, - FourHundredAndTwentyTwo -> = z.instanceof(FourHundredAndTwentyTwo) - .transform(v => v.data$) - .pipe(z.object({ - message: z.string(), - code: 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 FourHundredAndTwentyTwo$ { - /** @deprecated use `FourHundredAndTwentyTwo$inboundSchema` instead. */ - export const inboundSchema = FourHundredAndTwentyTwo$inboundSchema; - /** @deprecated use `FourHundredAndTwentyTwo$outboundSchema` instead. */ - export const outboundSchema = FourHundredAndTwentyTwo$outboundSchema; - /** @deprecated use `FourHundredAndTwentyTwo$Outbound` instead. */ - export type Outbound = FourHundredAndTwentyTwo$Outbound; -} diff --git a/src/models/errors/httpclienterrors.ts b/src/models/errors/httpclienterrors.ts deleted file mode 100644 index b34f612..0000000 --- a/src/models/errors/httpclienterrors.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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/models/errors/index.ts b/src/models/errors/index.ts deleted file mode 100644 index b198fcc..0000000 --- a/src/models/errors/index.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export * from "./apierror.js"; -export * from "./fivehundred.js"; -export * from "./fourhundred.js"; -export * from "./fourhundredandfour.js"; -export * from "./fourhundredandone.js"; -export * from "./fourhundredandthree.js"; -export * from "./fourhundredandtwentytwo.js"; -export * from "./httpclienterrors.js"; -export * from "./responsevalidationerror.js"; -export * from "./sdkvalidationerror.js"; diff --git a/src/models/errors/responsevalidationerror.ts b/src/models/errors/responsevalidationerror.ts deleted file mode 100644 index e494c36..0000000 --- a/src/models/errors/responsevalidationerror.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { ScalarError } from "./scalarerror.js"; -import { formatZodError } from "./sdkvalidationerror.js"; - -export class ResponseValidationError extends ScalarError { - /** - * The raw value that failed validation. - */ - public readonly rawValue: unknown; - - /** - * The raw message that failed validation. - */ - public readonly rawMessage: unknown; - - constructor( - message: string, - extra: { - response: Response; - request: Request; - body: string; - cause: unknown; - rawValue: unknown; - rawMessage: unknown; - }, - ) { - super(message, extra); - this.name = "ResponseValidationError"; - this.cause = extra.cause; - this.rawValue = extra.rawValue; - this.rawMessage = extra.rawMessage; - } - - /** - * 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.rawMessage}\n${formatZodError(this.cause)}`; - } else { - return this.toString(); - } - } -} diff --git a/src/models/errors/scalarerror.ts b/src/models/errors/scalarerror.ts deleted file mode 100644 index 78c9ebf..0000000 --- a/src/models/errors/scalarerror.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/** The base class for all HTTP error responses */ -export class ScalarError extends Error { - /** HTTP meta data */ - public readonly httpMeta: { - response: Response; - request: Request; - body: string; - }; - - constructor( - message: string, - httpMeta: { - response: Response; - request: Request; - body: string; - }, - ) { - super(message); - this.httpMeta = httpMeta; - - this.name = "ScalarError"; - } -} diff --git a/src/models/errors/sdkvalidationerror.ts b/src/models/errors/sdkvalidationerror.ts deleted file mode 100644 index 37face8..0000000 --- a/src/models/errors/sdkvalidationerror.ts +++ /dev/null @@ -1,109 +0,0 @@ -/* - * 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; - - /** - * The raw message that failed validation. - */ - public readonly rawMessage: unknown; - - // Allows for backwards compatibility for `instanceof` checks of `ResponseValidationError` - static override [Symbol.hasInstance]( - instance: unknown, - ): instance is SDKValidationError { - if (!(instance instanceof Error)) return false; - if (!("rawValue" in instance)) return false; - if (!("rawMessage" in instance)) return false; - if (!("pretty" in instance)) return false; - if (typeof instance.pretty !== "function") return false; - return true; - } - - constructor(message: string, cause: unknown, rawValue: unknown) { - super(`${message}: ${cause}`); - this.name = "SDKValidationError"; - this.cause = cause; - this.rawValue = rawValue; - this.rawMessage = message; - } - - /** - * 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.rawMessage}\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/models/operations/addapidocumentaccessgroup.ts b/src/models/operations/addapidocumentaccessgroup.ts deleted file mode 100644 index fd8e813..0000000 --- a/src/models/operations/addapidocumentaccessgroup.ts +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type AddApiDocumentAccessGroupRequest = { - namespace: string; - slug: string; - accessGroup: components.AccessGroup; -}; - -export type AddApiDocumentAccessGroupResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - any?: any | null | undefined; -}; - -/** @internal */ -export const AddApiDocumentAccessGroupRequest$inboundSchema: z.ZodType< - AddApiDocumentAccessGroupRequest, - z.ZodTypeDef, - unknown -> = z.object({ - namespace: z.string(), - slug: z.string(), - "access-group": components.AccessGroup$inboundSchema, -}).transform((v) => { - return remap$(v, { - "access-group": "accessGroup", - }); -}); - -/** @internal */ -export type AddApiDocumentAccessGroupRequest$Outbound = { - namespace: string; - slug: string; - "access-group": components.AccessGroup$Outbound; -}; - -/** @internal */ -export const AddApiDocumentAccessGroupRequest$outboundSchema: z.ZodType< - AddApiDocumentAccessGroupRequest$Outbound, - z.ZodTypeDef, - AddApiDocumentAccessGroupRequest -> = z.object({ - namespace: z.string(), - slug: z.string(), - accessGroup: components.AccessGroup$outboundSchema, -}).transform((v) => { - return remap$(v, { - accessGroup: "access-group", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace AddApiDocumentAccessGroupRequest$ { - /** @deprecated use `AddApiDocumentAccessGroupRequest$inboundSchema` instead. */ - export const inboundSchema = AddApiDocumentAccessGroupRequest$inboundSchema; - /** @deprecated use `AddApiDocumentAccessGroupRequest$outboundSchema` instead. */ - export const outboundSchema = AddApiDocumentAccessGroupRequest$outboundSchema; - /** @deprecated use `AddApiDocumentAccessGroupRequest$Outbound` instead. */ - export type Outbound = AddApiDocumentAccessGroupRequest$Outbound; -} - -export function addApiDocumentAccessGroupRequestToJSON( - addApiDocumentAccessGroupRequest: AddApiDocumentAccessGroupRequest, -): string { - return JSON.stringify( - AddApiDocumentAccessGroupRequest$outboundSchema.parse( - addApiDocumentAccessGroupRequest, - ), - ); -} - -export function addApiDocumentAccessGroupRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => AddApiDocumentAccessGroupRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'AddApiDocumentAccessGroupRequest' from JSON`, - ); -} - -/** @internal */ -export const AddApiDocumentAccessGroupResponse$inboundSchema: z.ZodType< - AddApiDocumentAccessGroupResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type AddApiDocumentAccessGroupResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - any?: any | null | undefined; -}; - -/** @internal */ -export const AddApiDocumentAccessGroupResponse$outboundSchema: z.ZodType< - AddApiDocumentAccessGroupResponse$Outbound, - z.ZodTypeDef, - AddApiDocumentAccessGroupResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace AddApiDocumentAccessGroupResponse$ { - /** @deprecated use `AddApiDocumentAccessGroupResponse$inboundSchema` instead. */ - export const inboundSchema = AddApiDocumentAccessGroupResponse$inboundSchema; - /** @deprecated use `AddApiDocumentAccessGroupResponse$outboundSchema` instead. */ - export const outboundSchema = - AddApiDocumentAccessGroupResponse$outboundSchema; - /** @deprecated use `AddApiDocumentAccessGroupResponse$Outbound` instead. */ - export type Outbound = AddApiDocumentAccessGroupResponse$Outbound; -} - -export function addApiDocumentAccessGroupResponseToJSON( - addApiDocumentAccessGroupResponse: AddApiDocumentAccessGroupResponse, -): string { - return JSON.stringify( - AddApiDocumentAccessGroupResponse$outboundSchema.parse( - addApiDocumentAccessGroupResponse, - ), - ); -} - -export function addApiDocumentAccessGroupResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => AddApiDocumentAccessGroupResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'AddApiDocumentAccessGroupResponse' from JSON`, - ); -} diff --git a/src/models/operations/addrulesetaccessgroup.ts b/src/models/operations/addrulesetaccessgroup.ts deleted file mode 100644 index a2f50c3..0000000 --- a/src/models/operations/addrulesetaccessgroup.ts +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type AddRulesetAccessGroupRequest = { - namespace: string; - slug: string; - accessGroup: components.AccessGroup; -}; - -export type AddRulesetAccessGroupResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - any?: any | null | undefined; -}; - -/** @internal */ -export const AddRulesetAccessGroupRequest$inboundSchema: z.ZodType< - AddRulesetAccessGroupRequest, - z.ZodTypeDef, - unknown -> = z.object({ - namespace: z.string(), - slug: z.string(), - "access-group": components.AccessGroup$inboundSchema, -}).transform((v) => { - return remap$(v, { - "access-group": "accessGroup", - }); -}); - -/** @internal */ -export type AddRulesetAccessGroupRequest$Outbound = { - namespace: string; - slug: string; - "access-group": components.AccessGroup$Outbound; -}; - -/** @internal */ -export const AddRulesetAccessGroupRequest$outboundSchema: z.ZodType< - AddRulesetAccessGroupRequest$Outbound, - z.ZodTypeDef, - AddRulesetAccessGroupRequest -> = z.object({ - namespace: z.string(), - slug: z.string(), - accessGroup: components.AccessGroup$outboundSchema, -}).transform((v) => { - return remap$(v, { - accessGroup: "access-group", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace AddRulesetAccessGroupRequest$ { - /** @deprecated use `AddRulesetAccessGroupRequest$inboundSchema` instead. */ - export const inboundSchema = AddRulesetAccessGroupRequest$inboundSchema; - /** @deprecated use `AddRulesetAccessGroupRequest$outboundSchema` instead. */ - export const outboundSchema = AddRulesetAccessGroupRequest$outboundSchema; - /** @deprecated use `AddRulesetAccessGroupRequest$Outbound` instead. */ - export type Outbound = AddRulesetAccessGroupRequest$Outbound; -} - -export function addRulesetAccessGroupRequestToJSON( - addRulesetAccessGroupRequest: AddRulesetAccessGroupRequest, -): string { - return JSON.stringify( - AddRulesetAccessGroupRequest$outboundSchema.parse( - addRulesetAccessGroupRequest, - ), - ); -} - -export function addRulesetAccessGroupRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => AddRulesetAccessGroupRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'AddRulesetAccessGroupRequest' from JSON`, - ); -} - -/** @internal */ -export const AddRulesetAccessGroupResponse$inboundSchema: z.ZodType< - AddRulesetAccessGroupResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type AddRulesetAccessGroupResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - any?: any | null | undefined; -}; - -/** @internal */ -export const AddRulesetAccessGroupResponse$outboundSchema: z.ZodType< - AddRulesetAccessGroupResponse$Outbound, - z.ZodTypeDef, - AddRulesetAccessGroupResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace AddRulesetAccessGroupResponse$ { - /** @deprecated use `AddRulesetAccessGroupResponse$inboundSchema` instead. */ - export const inboundSchema = AddRulesetAccessGroupResponse$inboundSchema; - /** @deprecated use `AddRulesetAccessGroupResponse$outboundSchema` instead. */ - export const outboundSchema = AddRulesetAccessGroupResponse$outboundSchema; - /** @deprecated use `AddRulesetAccessGroupResponse$Outbound` instead. */ - export type Outbound = AddRulesetAccessGroupResponse$Outbound; -} - -export function addRulesetAccessGroupResponseToJSON( - addRulesetAccessGroupResponse: AddRulesetAccessGroupResponse, -): string { - return JSON.stringify( - AddRulesetAccessGroupResponse$outboundSchema.parse( - addRulesetAccessGroupResponse, - ), - ); -} - -export function addRulesetAccessGroupResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => AddRulesetAccessGroupResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'AddRulesetAccessGroupResponse' from JSON`, - ); -} diff --git a/src/models/operations/addschemaaccessgroup.ts b/src/models/operations/addschemaaccessgroup.ts deleted file mode 100644 index c920583..0000000 --- a/src/models/operations/addschemaaccessgroup.ts +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type AddSchemaAccessGroupRequest = { - namespace: string; - slug: string; - accessGroup: components.AccessGroup; -}; - -export type AddSchemaAccessGroupResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - any?: any | null | undefined; -}; - -/** @internal */ -export const AddSchemaAccessGroupRequest$inboundSchema: z.ZodType< - AddSchemaAccessGroupRequest, - z.ZodTypeDef, - unknown -> = z.object({ - namespace: z.string(), - slug: z.string(), - "access-group": components.AccessGroup$inboundSchema, -}).transform((v) => { - return remap$(v, { - "access-group": "accessGroup", - }); -}); - -/** @internal */ -export type AddSchemaAccessGroupRequest$Outbound = { - namespace: string; - slug: string; - "access-group": components.AccessGroup$Outbound; -}; - -/** @internal */ -export const AddSchemaAccessGroupRequest$outboundSchema: z.ZodType< - AddSchemaAccessGroupRequest$Outbound, - z.ZodTypeDef, - AddSchemaAccessGroupRequest -> = z.object({ - namespace: z.string(), - slug: z.string(), - accessGroup: components.AccessGroup$outboundSchema, -}).transform((v) => { - return remap$(v, { - accessGroup: "access-group", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace AddSchemaAccessGroupRequest$ { - /** @deprecated use `AddSchemaAccessGroupRequest$inboundSchema` instead. */ - export const inboundSchema = AddSchemaAccessGroupRequest$inboundSchema; - /** @deprecated use `AddSchemaAccessGroupRequest$outboundSchema` instead. */ - export const outboundSchema = AddSchemaAccessGroupRequest$outboundSchema; - /** @deprecated use `AddSchemaAccessGroupRequest$Outbound` instead. */ - export type Outbound = AddSchemaAccessGroupRequest$Outbound; -} - -export function addSchemaAccessGroupRequestToJSON( - addSchemaAccessGroupRequest: AddSchemaAccessGroupRequest, -): string { - return JSON.stringify( - AddSchemaAccessGroupRequest$outboundSchema.parse( - addSchemaAccessGroupRequest, - ), - ); -} - -export function addSchemaAccessGroupRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => AddSchemaAccessGroupRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'AddSchemaAccessGroupRequest' from JSON`, - ); -} - -/** @internal */ -export const AddSchemaAccessGroupResponse$inboundSchema: z.ZodType< - AddSchemaAccessGroupResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type AddSchemaAccessGroupResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - any?: any | null | undefined; -}; - -/** @internal */ -export const AddSchemaAccessGroupResponse$outboundSchema: z.ZodType< - AddSchemaAccessGroupResponse$Outbound, - z.ZodTypeDef, - AddSchemaAccessGroupResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace AddSchemaAccessGroupResponse$ { - /** @deprecated use `AddSchemaAccessGroupResponse$inboundSchema` instead. */ - export const inboundSchema = AddSchemaAccessGroupResponse$inboundSchema; - /** @deprecated use `AddSchemaAccessGroupResponse$outboundSchema` instead. */ - export const outboundSchema = AddSchemaAccessGroupResponse$outboundSchema; - /** @deprecated use `AddSchemaAccessGroupResponse$Outbound` instead. */ - export type Outbound = AddSchemaAccessGroupResponse$Outbound; -} - -export function addSchemaAccessGroupResponseToJSON( - addSchemaAccessGroupResponse: AddSchemaAccessGroupResponse, -): string { - return JSON.stringify( - AddSchemaAccessGroupResponse$outboundSchema.parse( - addSchemaAccessGroupResponse, - ), - ); -} - -export function addSchemaAccessGroupResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => AddSchemaAccessGroupResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'AddSchemaAccessGroupResponse' from JSON`, - ); -} diff --git a/src/models/operations/createapidocument.ts b/src/models/operations/createapidocument.ts deleted file mode 100644 index d2e7c1c..0000000 --- a/src/models/operations/createapidocument.ts +++ /dev/null @@ -1,320 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type CreateApiDocumentRequestBody = { - title: string; - description?: string | undefined; - version: string; - slug: string; - ruleset?: string | undefined; - isPrivate?: boolean | undefined; - document: string; -}; - -export type CreateApiDocumentRequest = { - namespace: string; - requestBody: CreateApiDocumentRequestBody; -}; - -/** - * Default Response - */ -export type CreateApiDocumentResponseBody = { - uid: string; - versionUid: string; - title: string; - jsonSha: string; - yamlSha: string; - versionSha: string; -}; - -export type CreateApiDocumentResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - object?: CreateApiDocumentResponseBody | undefined; -}; - -/** @internal */ -export const CreateApiDocumentRequestBody$inboundSchema: z.ZodType< - CreateApiDocumentRequestBody, - z.ZodTypeDef, - unknown -> = z.object({ - title: z.string(), - description: z.string().optional(), - version: z.string(), - slug: z.string(), - ruleset: z.string().optional(), - isPrivate: z.boolean().optional(), - document: z.string(), -}); - -/** @internal */ -export type CreateApiDocumentRequestBody$Outbound = { - title: string; - description?: string | undefined; - version: string; - slug: string; - ruleset?: string | undefined; - isPrivate?: boolean | undefined; - document: string; -}; - -/** @internal */ -export const CreateApiDocumentRequestBody$outboundSchema: z.ZodType< - CreateApiDocumentRequestBody$Outbound, - z.ZodTypeDef, - CreateApiDocumentRequestBody -> = z.object({ - title: z.string(), - description: z.string().optional(), - version: z.string(), - slug: z.string(), - ruleset: z.string().optional(), - isPrivate: z.boolean().optional(), - document: 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 CreateApiDocumentRequestBody$ { - /** @deprecated use `CreateApiDocumentRequestBody$inboundSchema` instead. */ - export const inboundSchema = CreateApiDocumentRequestBody$inboundSchema; - /** @deprecated use `CreateApiDocumentRequestBody$outboundSchema` instead. */ - export const outboundSchema = CreateApiDocumentRequestBody$outboundSchema; - /** @deprecated use `CreateApiDocumentRequestBody$Outbound` instead. */ - export type Outbound = CreateApiDocumentRequestBody$Outbound; -} - -export function createApiDocumentRequestBodyToJSON( - createApiDocumentRequestBody: CreateApiDocumentRequestBody, -): string { - return JSON.stringify( - CreateApiDocumentRequestBody$outboundSchema.parse( - createApiDocumentRequestBody, - ), - ); -} - -export function createApiDocumentRequestBodyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateApiDocumentRequestBody$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateApiDocumentRequestBody' from JSON`, - ); -} - -/** @internal */ -export const CreateApiDocumentRequest$inboundSchema: z.ZodType< - CreateApiDocumentRequest, - z.ZodTypeDef, - unknown -> = z.object({ - namespace: z.string(), - RequestBody: z.lazy(() => CreateApiDocumentRequestBody$inboundSchema), -}).transform((v) => { - return remap$(v, { - "RequestBody": "requestBody", - }); -}); - -/** @internal */ -export type CreateApiDocumentRequest$Outbound = { - namespace: string; - RequestBody: CreateApiDocumentRequestBody$Outbound; -}; - -/** @internal */ -export const CreateApiDocumentRequest$outboundSchema: z.ZodType< - CreateApiDocumentRequest$Outbound, - z.ZodTypeDef, - CreateApiDocumentRequest -> = z.object({ - namespace: z.string(), - requestBody: z.lazy(() => CreateApiDocumentRequestBody$outboundSchema), -}).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 CreateApiDocumentRequest$ { - /** @deprecated use `CreateApiDocumentRequest$inboundSchema` instead. */ - export const inboundSchema = CreateApiDocumentRequest$inboundSchema; - /** @deprecated use `CreateApiDocumentRequest$outboundSchema` instead. */ - export const outboundSchema = CreateApiDocumentRequest$outboundSchema; - /** @deprecated use `CreateApiDocumentRequest$Outbound` instead. */ - export type Outbound = CreateApiDocumentRequest$Outbound; -} - -export function createApiDocumentRequestToJSON( - createApiDocumentRequest: CreateApiDocumentRequest, -): string { - return JSON.stringify( - CreateApiDocumentRequest$outboundSchema.parse(createApiDocumentRequest), - ); -} - -export function createApiDocumentRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateApiDocumentRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateApiDocumentRequest' from JSON`, - ); -} - -/** @internal */ -export const CreateApiDocumentResponseBody$inboundSchema: z.ZodType< - CreateApiDocumentResponseBody, - z.ZodTypeDef, - unknown -> = z.object({ - uid: z.string(), - versionUid: z.string(), - title: z.string(), - jsonSha: z.string(), - yamlSha: z.string(), - versionSha: z.string(), -}); - -/** @internal */ -export type CreateApiDocumentResponseBody$Outbound = { - uid: string; - versionUid: string; - title: string; - jsonSha: string; - yamlSha: string; - versionSha: string; -}; - -/** @internal */ -export const CreateApiDocumentResponseBody$outboundSchema: z.ZodType< - CreateApiDocumentResponseBody$Outbound, - z.ZodTypeDef, - CreateApiDocumentResponseBody -> = z.object({ - uid: z.string(), - versionUid: z.string(), - title: z.string(), - jsonSha: z.string(), - yamlSha: z.string(), - versionSha: 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 CreateApiDocumentResponseBody$ { - /** @deprecated use `CreateApiDocumentResponseBody$inboundSchema` instead. */ - export const inboundSchema = CreateApiDocumentResponseBody$inboundSchema; - /** @deprecated use `CreateApiDocumentResponseBody$outboundSchema` instead. */ - export const outboundSchema = CreateApiDocumentResponseBody$outboundSchema; - /** @deprecated use `CreateApiDocumentResponseBody$Outbound` instead. */ - export type Outbound = CreateApiDocumentResponseBody$Outbound; -} - -export function createApiDocumentResponseBodyToJSON( - createApiDocumentResponseBody: CreateApiDocumentResponseBody, -): string { - return JSON.stringify( - CreateApiDocumentResponseBody$outboundSchema.parse( - createApiDocumentResponseBody, - ), - ); -} - -export function createApiDocumentResponseBodyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateApiDocumentResponseBody$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateApiDocumentResponseBody' from JSON`, - ); -} - -/** @internal */ -export const CreateApiDocumentResponse$inboundSchema: z.ZodType< - CreateApiDocumentResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - object: z.lazy(() => CreateApiDocumentResponseBody$inboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type CreateApiDocumentResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - object?: CreateApiDocumentResponseBody$Outbound | undefined; -}; - -/** @internal */ -export const CreateApiDocumentResponse$outboundSchema: z.ZodType< - CreateApiDocumentResponse$Outbound, - z.ZodTypeDef, - CreateApiDocumentResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - object: z.lazy(() => CreateApiDocumentResponseBody$outboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace CreateApiDocumentResponse$ { - /** @deprecated use `CreateApiDocumentResponse$inboundSchema` instead. */ - export const inboundSchema = CreateApiDocumentResponse$inboundSchema; - /** @deprecated use `CreateApiDocumentResponse$outboundSchema` instead. */ - export const outboundSchema = CreateApiDocumentResponse$outboundSchema; - /** @deprecated use `CreateApiDocumentResponse$Outbound` instead. */ - export type Outbound = CreateApiDocumentResponse$Outbound; -} - -export function createApiDocumentResponseToJSON( - createApiDocumentResponse: CreateApiDocumentResponse, -): string { - return JSON.stringify( - CreateApiDocumentResponse$outboundSchema.parse(createApiDocumentResponse), - ); -} - -export function createApiDocumentResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateApiDocumentResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateApiDocumentResponse' from JSON`, - ); -} diff --git a/src/models/operations/createapidocumentversion.ts b/src/models/operations/createapidocumentversion.ts deleted file mode 100644 index 78e2757..0000000 --- a/src/models/operations/createapidocumentversion.ts +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type CreateApiDocumentVersionRequestBody = { - version: string; - document: string; - force?: boolean | undefined; - lastKnownVersionSha?: string | undefined; -}; - -export type CreateApiDocumentVersionRequest = { - namespace: string; - slug: string; - requestBody: CreateApiDocumentVersionRequestBody; -}; - -export type CreateApiDocumentVersionResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - managedDocVersion?: components.ManagedDocVersion | undefined; -}; - -/** @internal */ -export const CreateApiDocumentVersionRequestBody$inboundSchema: z.ZodType< - CreateApiDocumentVersionRequestBody, - z.ZodTypeDef, - unknown -> = z.object({ - version: z.string(), - document: z.string(), - force: z.boolean().optional(), - lastKnownVersionSha: z.string().optional(), -}); - -/** @internal */ -export type CreateApiDocumentVersionRequestBody$Outbound = { - version: string; - document: string; - force?: boolean | undefined; - lastKnownVersionSha?: string | undefined; -}; - -/** @internal */ -export const CreateApiDocumentVersionRequestBody$outboundSchema: z.ZodType< - CreateApiDocumentVersionRequestBody$Outbound, - z.ZodTypeDef, - CreateApiDocumentVersionRequestBody -> = z.object({ - version: z.string(), - document: z.string(), - force: z.boolean().optional(), - lastKnownVersionSha: 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 CreateApiDocumentVersionRequestBody$ { - /** @deprecated use `CreateApiDocumentVersionRequestBody$inboundSchema` instead. */ - export const inboundSchema = - CreateApiDocumentVersionRequestBody$inboundSchema; - /** @deprecated use `CreateApiDocumentVersionRequestBody$outboundSchema` instead. */ - export const outboundSchema = - CreateApiDocumentVersionRequestBody$outboundSchema; - /** @deprecated use `CreateApiDocumentVersionRequestBody$Outbound` instead. */ - export type Outbound = CreateApiDocumentVersionRequestBody$Outbound; -} - -export function createApiDocumentVersionRequestBodyToJSON( - createApiDocumentVersionRequestBody: CreateApiDocumentVersionRequestBody, -): string { - return JSON.stringify( - CreateApiDocumentVersionRequestBody$outboundSchema.parse( - createApiDocumentVersionRequestBody, - ), - ); -} - -export function createApiDocumentVersionRequestBodyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => - CreateApiDocumentVersionRequestBody$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateApiDocumentVersionRequestBody' from JSON`, - ); -} - -/** @internal */ -export const CreateApiDocumentVersionRequest$inboundSchema: z.ZodType< - CreateApiDocumentVersionRequest, - z.ZodTypeDef, - unknown -> = z.object({ - namespace: z.string(), - slug: z.string(), - RequestBody: z.lazy(() => CreateApiDocumentVersionRequestBody$inboundSchema), -}).transform((v) => { - return remap$(v, { - "RequestBody": "requestBody", - }); -}); - -/** @internal */ -export type CreateApiDocumentVersionRequest$Outbound = { - namespace: string; - slug: string; - RequestBody: CreateApiDocumentVersionRequestBody$Outbound; -}; - -/** @internal */ -export const CreateApiDocumentVersionRequest$outboundSchema: z.ZodType< - CreateApiDocumentVersionRequest$Outbound, - z.ZodTypeDef, - CreateApiDocumentVersionRequest -> = z.object({ - namespace: z.string(), - slug: z.string(), - requestBody: z.lazy(() => CreateApiDocumentVersionRequestBody$outboundSchema), -}).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 CreateApiDocumentVersionRequest$ { - /** @deprecated use `CreateApiDocumentVersionRequest$inboundSchema` instead. */ - export const inboundSchema = CreateApiDocumentVersionRequest$inboundSchema; - /** @deprecated use `CreateApiDocumentVersionRequest$outboundSchema` instead. */ - export const outboundSchema = CreateApiDocumentVersionRequest$outboundSchema; - /** @deprecated use `CreateApiDocumentVersionRequest$Outbound` instead. */ - export type Outbound = CreateApiDocumentVersionRequest$Outbound; -} - -export function createApiDocumentVersionRequestToJSON( - createApiDocumentVersionRequest: CreateApiDocumentVersionRequest, -): string { - return JSON.stringify( - CreateApiDocumentVersionRequest$outboundSchema.parse( - createApiDocumentVersionRequest, - ), - ); -} - -export function createApiDocumentVersionRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateApiDocumentVersionRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateApiDocumentVersionRequest' from JSON`, - ); -} - -/** @internal */ -export const CreateApiDocumentVersionResponse$inboundSchema: z.ZodType< - CreateApiDocumentVersionResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - "managed-doc-version": components.ManagedDocVersion$inboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - "managed-doc-version": "managedDocVersion", - }); -}); - -/** @internal */ -export type CreateApiDocumentVersionResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - "managed-doc-version"?: components.ManagedDocVersion$Outbound | undefined; -}; - -/** @internal */ -export const CreateApiDocumentVersionResponse$outboundSchema: z.ZodType< - CreateApiDocumentVersionResponse$Outbound, - z.ZodTypeDef, - CreateApiDocumentVersionResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - managedDocVersion: components.ManagedDocVersion$outboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - managedDocVersion: "managed-doc-version", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace CreateApiDocumentVersionResponse$ { - /** @deprecated use `CreateApiDocumentVersionResponse$inboundSchema` instead. */ - export const inboundSchema = CreateApiDocumentVersionResponse$inboundSchema; - /** @deprecated use `CreateApiDocumentVersionResponse$outboundSchema` instead. */ - export const outboundSchema = CreateApiDocumentVersionResponse$outboundSchema; - /** @deprecated use `CreateApiDocumentVersionResponse$Outbound` instead. */ - export type Outbound = CreateApiDocumentVersionResponse$Outbound; -} - -export function createApiDocumentVersionResponseToJSON( - createApiDocumentVersionResponse: CreateApiDocumentVersionResponse, -): string { - return JSON.stringify( - CreateApiDocumentVersionResponse$outboundSchema.parse( - createApiDocumentVersionResponse, - ), - ); -} - -export function createApiDocumentVersionResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateApiDocumentVersionResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateApiDocumentVersionResponse' from JSON`, - ); -} diff --git a/src/models/operations/createguide.ts b/src/models/operations/createguide.ts deleted file mode 100644 index 61afe08..0000000 --- a/src/models/operations/createguide.ts +++ /dev/null @@ -1,222 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type CreateGuideRequestBody = { - name: string; - slug?: string | undefined; - isPrivate?: boolean | undefined; - allowedUsers: Array; - allowedDomains: Array; -}; - -/** - * Default Response - */ -export type CreateGuideResponseBody = { - uid: string; - slug: string; -}; - -export type CreateGuideResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - object?: CreateGuideResponseBody | undefined; -}; - -/** @internal */ -export const CreateGuideRequestBody$inboundSchema: z.ZodType< - CreateGuideRequestBody, - z.ZodTypeDef, - unknown -> = z.object({ - name: z.string(), - slug: z.string().optional(), - isPrivate: z.boolean().default(false), - allowedUsers: z.array(z.string()), - allowedDomains: z.array(z.string()), -}); - -/** @internal */ -export type CreateGuideRequestBody$Outbound = { - name: string; - slug?: string | undefined; - isPrivate: boolean; - allowedUsers: Array; - allowedDomains: Array; -}; - -/** @internal */ -export const CreateGuideRequestBody$outboundSchema: z.ZodType< - CreateGuideRequestBody$Outbound, - z.ZodTypeDef, - CreateGuideRequestBody -> = z.object({ - name: z.string(), - slug: z.string().optional(), - isPrivate: z.boolean().default(false), - allowedUsers: z.array(z.string()), - allowedDomains: z.array(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 CreateGuideRequestBody$ { - /** @deprecated use `CreateGuideRequestBody$inboundSchema` instead. */ - export const inboundSchema = CreateGuideRequestBody$inboundSchema; - /** @deprecated use `CreateGuideRequestBody$outboundSchema` instead. */ - export const outboundSchema = CreateGuideRequestBody$outboundSchema; - /** @deprecated use `CreateGuideRequestBody$Outbound` instead. */ - export type Outbound = CreateGuideRequestBody$Outbound; -} - -export function createGuideRequestBodyToJSON( - createGuideRequestBody: CreateGuideRequestBody, -): string { - return JSON.stringify( - CreateGuideRequestBody$outboundSchema.parse(createGuideRequestBody), - ); -} - -export function createGuideRequestBodyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateGuideRequestBody$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateGuideRequestBody' from JSON`, - ); -} - -/** @internal */ -export const CreateGuideResponseBody$inboundSchema: z.ZodType< - CreateGuideResponseBody, - z.ZodTypeDef, - unknown -> = z.object({ - uid: z.string(), - slug: z.string(), -}); - -/** @internal */ -export type CreateGuideResponseBody$Outbound = { - uid: string; - slug: string; -}; - -/** @internal */ -export const CreateGuideResponseBody$outboundSchema: z.ZodType< - CreateGuideResponseBody$Outbound, - z.ZodTypeDef, - CreateGuideResponseBody -> = z.object({ - uid: z.string(), - 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 CreateGuideResponseBody$ { - /** @deprecated use `CreateGuideResponseBody$inboundSchema` instead. */ - export const inboundSchema = CreateGuideResponseBody$inboundSchema; - /** @deprecated use `CreateGuideResponseBody$outboundSchema` instead. */ - export const outboundSchema = CreateGuideResponseBody$outboundSchema; - /** @deprecated use `CreateGuideResponseBody$Outbound` instead. */ - export type Outbound = CreateGuideResponseBody$Outbound; -} - -export function createGuideResponseBodyToJSON( - createGuideResponseBody: CreateGuideResponseBody, -): string { - return JSON.stringify( - CreateGuideResponseBody$outboundSchema.parse(createGuideResponseBody), - ); -} - -export function createGuideResponseBodyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateGuideResponseBody$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateGuideResponseBody' from JSON`, - ); -} - -/** @internal */ -export const CreateGuideResponse$inboundSchema: z.ZodType< - CreateGuideResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - object: z.lazy(() => CreateGuideResponseBody$inboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type CreateGuideResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - object?: CreateGuideResponseBody$Outbound | undefined; -}; - -/** @internal */ -export const CreateGuideResponse$outboundSchema: z.ZodType< - CreateGuideResponse$Outbound, - z.ZodTypeDef, - CreateGuideResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - object: z.lazy(() => CreateGuideResponseBody$outboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace CreateGuideResponse$ { - /** @deprecated use `CreateGuideResponse$inboundSchema` instead. */ - export const inboundSchema = CreateGuideResponse$inboundSchema; - /** @deprecated use `CreateGuideResponse$outboundSchema` instead. */ - export const outboundSchema = CreateGuideResponse$outboundSchema; - /** @deprecated use `CreateGuideResponse$Outbound` instead. */ - export type Outbound = CreateGuideResponse$Outbound; -} - -export function createGuideResponseToJSON( - createGuideResponse: CreateGuideResponse, -): string { - return JSON.stringify( - CreateGuideResponse$outboundSchema.parse(createGuideResponse), - ); -} - -export function createGuideResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateGuideResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateGuideResponse' from JSON`, - ); -} diff --git a/src/models/operations/createloginportal.ts b/src/models/operations/createloginportal.ts deleted file mode 100644 index e1a0b93..0000000 --- a/src/models/operations/createloginportal.ts +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type CreateLoginPortalRequestBody = { - title: string; - slug: string; - email: components.LoginPortalEmail; - page: components.LoginPortalPage; -}; - -export type CreateLoginPortalResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - uid?: components.Uid | undefined; -}; - -/** @internal */ -export const CreateLoginPortalRequestBody$inboundSchema: z.ZodType< - CreateLoginPortalRequestBody, - z.ZodTypeDef, - unknown -> = z.object({ - title: z.string(), - slug: z.string(), - email: components.LoginPortalEmail$inboundSchema, - page: components.LoginPortalPage$inboundSchema, -}); - -/** @internal */ -export type CreateLoginPortalRequestBody$Outbound = { - title: string; - slug: string; - email: components.LoginPortalEmail$Outbound; - page: components.LoginPortalPage$Outbound; -}; - -/** @internal */ -export const CreateLoginPortalRequestBody$outboundSchema: z.ZodType< - CreateLoginPortalRequestBody$Outbound, - z.ZodTypeDef, - CreateLoginPortalRequestBody -> = z.object({ - title: z.string(), - slug: z.string(), - email: components.LoginPortalEmail$outboundSchema, - page: components.LoginPortalPage$outboundSchema, -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace CreateLoginPortalRequestBody$ { - /** @deprecated use `CreateLoginPortalRequestBody$inboundSchema` instead. */ - export const inboundSchema = CreateLoginPortalRequestBody$inboundSchema; - /** @deprecated use `CreateLoginPortalRequestBody$outboundSchema` instead. */ - export const outboundSchema = CreateLoginPortalRequestBody$outboundSchema; - /** @deprecated use `CreateLoginPortalRequestBody$Outbound` instead. */ - export type Outbound = CreateLoginPortalRequestBody$Outbound; -} - -export function createLoginPortalRequestBodyToJSON( - createLoginPortalRequestBody: CreateLoginPortalRequestBody, -): string { - return JSON.stringify( - CreateLoginPortalRequestBody$outboundSchema.parse( - createLoginPortalRequestBody, - ), - ); -} - -export function createLoginPortalRequestBodyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateLoginPortalRequestBody$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateLoginPortalRequestBody' from JSON`, - ); -} - -/** @internal */ -export const CreateLoginPortalResponse$inboundSchema: z.ZodType< - CreateLoginPortalResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - uid: components.Uid$inboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type CreateLoginPortalResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - uid?: components.Uid$Outbound | undefined; -}; - -/** @internal */ -export const CreateLoginPortalResponse$outboundSchema: z.ZodType< - CreateLoginPortalResponse$Outbound, - z.ZodTypeDef, - CreateLoginPortalResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - uid: components.Uid$outboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace CreateLoginPortalResponse$ { - /** @deprecated use `CreateLoginPortalResponse$inboundSchema` instead. */ - export const inboundSchema = CreateLoginPortalResponse$inboundSchema; - /** @deprecated use `CreateLoginPortalResponse$outboundSchema` instead. */ - export const outboundSchema = CreateLoginPortalResponse$outboundSchema; - /** @deprecated use `CreateLoginPortalResponse$Outbound` instead. */ - export type Outbound = CreateLoginPortalResponse$Outbound; -} - -export function createLoginPortalResponseToJSON( - createLoginPortalResponse: CreateLoginPortalResponse, -): string { - return JSON.stringify( - CreateLoginPortalResponse$outboundSchema.parse(createLoginPortalResponse), - ); -} - -export function createLoginPortalResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateLoginPortalResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateLoginPortalResponse' from JSON`, - ); -} diff --git a/src/models/operations/createruleset.ts b/src/models/operations/createruleset.ts deleted file mode 100644 index 7243663..0000000 --- a/src/models/operations/createruleset.ts +++ /dev/null @@ -1,227 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type CreateRulesetRequestBody = { - title: string; - description?: string | undefined; - slug: string; - isPrivate?: boolean | undefined; - document: string; -}; - -export type CreateRulesetRequest = { - namespace: string; - requestBody: CreateRulesetRequestBody; -}; - -export type CreateRulesetResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - uid?: components.Uid | undefined; -}; - -/** @internal */ -export const CreateRulesetRequestBody$inboundSchema: z.ZodType< - CreateRulesetRequestBody, - z.ZodTypeDef, - unknown -> = z.object({ - title: z.string(), - description: z.string().optional(), - slug: z.string(), - isPrivate: z.boolean().optional(), - document: z.string(), -}); - -/** @internal */ -export type CreateRulesetRequestBody$Outbound = { - title: string; - description?: string | undefined; - slug: string; - isPrivate?: boolean | undefined; - document: string; -}; - -/** @internal */ -export const CreateRulesetRequestBody$outboundSchema: z.ZodType< - CreateRulesetRequestBody$Outbound, - z.ZodTypeDef, - CreateRulesetRequestBody -> = z.object({ - title: z.string(), - description: z.string().optional(), - slug: z.string(), - isPrivate: z.boolean().optional(), - document: 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 CreateRulesetRequestBody$ { - /** @deprecated use `CreateRulesetRequestBody$inboundSchema` instead. */ - export const inboundSchema = CreateRulesetRequestBody$inboundSchema; - /** @deprecated use `CreateRulesetRequestBody$outboundSchema` instead. */ - export const outboundSchema = CreateRulesetRequestBody$outboundSchema; - /** @deprecated use `CreateRulesetRequestBody$Outbound` instead. */ - export type Outbound = CreateRulesetRequestBody$Outbound; -} - -export function createRulesetRequestBodyToJSON( - createRulesetRequestBody: CreateRulesetRequestBody, -): string { - return JSON.stringify( - CreateRulesetRequestBody$outboundSchema.parse(createRulesetRequestBody), - ); -} - -export function createRulesetRequestBodyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateRulesetRequestBody$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateRulesetRequestBody' from JSON`, - ); -} - -/** @internal */ -export const CreateRulesetRequest$inboundSchema: z.ZodType< - CreateRulesetRequest, - z.ZodTypeDef, - unknown -> = z.object({ - namespace: z.string(), - RequestBody: z.lazy(() => CreateRulesetRequestBody$inboundSchema), -}).transform((v) => { - return remap$(v, { - "RequestBody": "requestBody", - }); -}); - -/** @internal */ -export type CreateRulesetRequest$Outbound = { - namespace: string; - RequestBody: CreateRulesetRequestBody$Outbound; -}; - -/** @internal */ -export const CreateRulesetRequest$outboundSchema: z.ZodType< - CreateRulesetRequest$Outbound, - z.ZodTypeDef, - CreateRulesetRequest -> = z.object({ - namespace: z.string(), - requestBody: z.lazy(() => CreateRulesetRequestBody$outboundSchema), -}).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 CreateRulesetRequest$ { - /** @deprecated use `CreateRulesetRequest$inboundSchema` instead. */ - export const inboundSchema = CreateRulesetRequest$inboundSchema; - /** @deprecated use `CreateRulesetRequest$outboundSchema` instead. */ - export const outboundSchema = CreateRulesetRequest$outboundSchema; - /** @deprecated use `CreateRulesetRequest$Outbound` instead. */ - export type Outbound = CreateRulesetRequest$Outbound; -} - -export function createRulesetRequestToJSON( - createRulesetRequest: CreateRulesetRequest, -): string { - return JSON.stringify( - CreateRulesetRequest$outboundSchema.parse(createRulesetRequest), - ); -} - -export function createRulesetRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateRulesetRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateRulesetRequest' from JSON`, - ); -} - -/** @internal */ -export const CreateRulesetResponse$inboundSchema: z.ZodType< - CreateRulesetResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - uid: components.Uid$inboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type CreateRulesetResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - uid?: components.Uid$Outbound | undefined; -}; - -/** @internal */ -export const CreateRulesetResponse$outboundSchema: z.ZodType< - CreateRulesetResponse$Outbound, - z.ZodTypeDef, - CreateRulesetResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - uid: components.Uid$outboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace CreateRulesetResponse$ { - /** @deprecated use `CreateRulesetResponse$inboundSchema` instead. */ - export const inboundSchema = CreateRulesetResponse$inboundSchema; - /** @deprecated use `CreateRulesetResponse$outboundSchema` instead. */ - export const outboundSchema = CreateRulesetResponse$outboundSchema; - /** @deprecated use `CreateRulesetResponse$Outbound` instead. */ - export type Outbound = CreateRulesetResponse$Outbound; -} - -export function createRulesetResponseToJSON( - createRulesetResponse: CreateRulesetResponse, -): string { - return JSON.stringify( - CreateRulesetResponse$outboundSchema.parse(createRulesetResponse), - ); -} - -export function createRulesetResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateRulesetResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateRulesetResponse' from JSON`, - ); -} diff --git a/src/models/operations/createschema.ts b/src/models/operations/createschema.ts deleted file mode 100644 index 1a79159..0000000 --- a/src/models/operations/createschema.ts +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type CreateSchemaRequestBody = { - title: string; - description?: string | undefined; - version: string; - slug: string; - isPrivate?: boolean | undefined; - document: string; -}; - -export type CreateSchemaRequest = { - namespace: string; - requestBody: CreateSchemaRequestBody; -}; - -export type CreateSchemaResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - uid?: components.Uid | undefined; -}; - -/** @internal */ -export const CreateSchemaRequestBody$inboundSchema: z.ZodType< - CreateSchemaRequestBody, - z.ZodTypeDef, - unknown -> = z.object({ - title: z.string(), - description: z.string().optional(), - version: z.string(), - slug: z.string(), - isPrivate: z.boolean().optional(), - document: z.string(), -}); - -/** @internal */ -export type CreateSchemaRequestBody$Outbound = { - title: string; - description?: string | undefined; - version: string; - slug: string; - isPrivate?: boolean | undefined; - document: string; -}; - -/** @internal */ -export const CreateSchemaRequestBody$outboundSchema: z.ZodType< - CreateSchemaRequestBody$Outbound, - z.ZodTypeDef, - CreateSchemaRequestBody -> = z.object({ - title: z.string(), - description: z.string().optional(), - version: z.string(), - slug: z.string(), - isPrivate: z.boolean().optional(), - document: 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 CreateSchemaRequestBody$ { - /** @deprecated use `CreateSchemaRequestBody$inboundSchema` instead. */ - export const inboundSchema = CreateSchemaRequestBody$inboundSchema; - /** @deprecated use `CreateSchemaRequestBody$outboundSchema` instead. */ - export const outboundSchema = CreateSchemaRequestBody$outboundSchema; - /** @deprecated use `CreateSchemaRequestBody$Outbound` instead. */ - export type Outbound = CreateSchemaRequestBody$Outbound; -} - -export function createSchemaRequestBodyToJSON( - createSchemaRequestBody: CreateSchemaRequestBody, -): string { - return JSON.stringify( - CreateSchemaRequestBody$outboundSchema.parse(createSchemaRequestBody), - ); -} - -export function createSchemaRequestBodyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateSchemaRequestBody$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateSchemaRequestBody' from JSON`, - ); -} - -/** @internal */ -export const CreateSchemaRequest$inboundSchema: z.ZodType< - CreateSchemaRequest, - z.ZodTypeDef, - unknown -> = z.object({ - namespace: z.string(), - RequestBody: z.lazy(() => CreateSchemaRequestBody$inboundSchema), -}).transform((v) => { - return remap$(v, { - "RequestBody": "requestBody", - }); -}); - -/** @internal */ -export type CreateSchemaRequest$Outbound = { - namespace: string; - RequestBody: CreateSchemaRequestBody$Outbound; -}; - -/** @internal */ -export const CreateSchemaRequest$outboundSchema: z.ZodType< - CreateSchemaRequest$Outbound, - z.ZodTypeDef, - CreateSchemaRequest -> = z.object({ - namespace: z.string(), - requestBody: z.lazy(() => CreateSchemaRequestBody$outboundSchema), -}).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 CreateSchemaRequest$ { - /** @deprecated use `CreateSchemaRequest$inboundSchema` instead. */ - export const inboundSchema = CreateSchemaRequest$inboundSchema; - /** @deprecated use `CreateSchemaRequest$outboundSchema` instead. */ - export const outboundSchema = CreateSchemaRequest$outboundSchema; - /** @deprecated use `CreateSchemaRequest$Outbound` instead. */ - export type Outbound = CreateSchemaRequest$Outbound; -} - -export function createSchemaRequestToJSON( - createSchemaRequest: CreateSchemaRequest, -): string { - return JSON.stringify( - CreateSchemaRequest$outboundSchema.parse(createSchemaRequest), - ); -} - -export function createSchemaRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateSchemaRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateSchemaRequest' from JSON`, - ); -} - -/** @internal */ -export const CreateSchemaResponse$inboundSchema: z.ZodType< - CreateSchemaResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - uid: components.Uid$inboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type CreateSchemaResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - uid?: components.Uid$Outbound | undefined; -}; - -/** @internal */ -export const CreateSchemaResponse$outboundSchema: z.ZodType< - CreateSchemaResponse$Outbound, - z.ZodTypeDef, - CreateSchemaResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - uid: components.Uid$outboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace CreateSchemaResponse$ { - /** @deprecated use `CreateSchemaResponse$inboundSchema` instead. */ - export const inboundSchema = CreateSchemaResponse$inboundSchema; - /** @deprecated use `CreateSchemaResponse$outboundSchema` instead. */ - export const outboundSchema = CreateSchemaResponse$outboundSchema; - /** @deprecated use `CreateSchemaResponse$Outbound` instead. */ - export type Outbound = CreateSchemaResponse$Outbound; -} - -export function createSchemaResponseToJSON( - createSchemaResponse: CreateSchemaResponse, -): string { - return JSON.stringify( - CreateSchemaResponse$outboundSchema.parse(createSchemaResponse), - ); -} - -export function createSchemaResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateSchemaResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateSchemaResponse' from JSON`, - ); -} diff --git a/src/models/operations/createschemaversion.ts b/src/models/operations/createschemaversion.ts deleted file mode 100644 index b4df998..0000000 --- a/src/models/operations/createschemaversion.ts +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type CreateSchemaVersionRequestBody = { - version: string; - document: string; -}; - -export type CreateSchemaVersionRequest = { - namespace: string; - slug: string; - requestBody: CreateSchemaVersionRequestBody; -}; - -export type CreateSchemaVersionResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - uid?: components.Uid | undefined; -}; - -/** @internal */ -export const CreateSchemaVersionRequestBody$inboundSchema: z.ZodType< - CreateSchemaVersionRequestBody, - z.ZodTypeDef, - unknown -> = z.object({ - version: z.string(), - document: z.string(), -}); - -/** @internal */ -export type CreateSchemaVersionRequestBody$Outbound = { - version: string; - document: string; -}; - -/** @internal */ -export const CreateSchemaVersionRequestBody$outboundSchema: z.ZodType< - CreateSchemaVersionRequestBody$Outbound, - z.ZodTypeDef, - CreateSchemaVersionRequestBody -> = z.object({ - version: z.string(), - document: 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 CreateSchemaVersionRequestBody$ { - /** @deprecated use `CreateSchemaVersionRequestBody$inboundSchema` instead. */ - export const inboundSchema = CreateSchemaVersionRequestBody$inboundSchema; - /** @deprecated use `CreateSchemaVersionRequestBody$outboundSchema` instead. */ - export const outboundSchema = CreateSchemaVersionRequestBody$outboundSchema; - /** @deprecated use `CreateSchemaVersionRequestBody$Outbound` instead. */ - export type Outbound = CreateSchemaVersionRequestBody$Outbound; -} - -export function createSchemaVersionRequestBodyToJSON( - createSchemaVersionRequestBody: CreateSchemaVersionRequestBody, -): string { - return JSON.stringify( - CreateSchemaVersionRequestBody$outboundSchema.parse( - createSchemaVersionRequestBody, - ), - ); -} - -export function createSchemaVersionRequestBodyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateSchemaVersionRequestBody$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateSchemaVersionRequestBody' from JSON`, - ); -} - -/** @internal */ -export const CreateSchemaVersionRequest$inboundSchema: z.ZodType< - CreateSchemaVersionRequest, - z.ZodTypeDef, - unknown -> = z.object({ - namespace: z.string(), - slug: z.string(), - RequestBody: z.lazy(() => CreateSchemaVersionRequestBody$inboundSchema), -}).transform((v) => { - return remap$(v, { - "RequestBody": "requestBody", - }); -}); - -/** @internal */ -export type CreateSchemaVersionRequest$Outbound = { - namespace: string; - slug: string; - RequestBody: CreateSchemaVersionRequestBody$Outbound; -}; - -/** @internal */ -export const CreateSchemaVersionRequest$outboundSchema: z.ZodType< - CreateSchemaVersionRequest$Outbound, - z.ZodTypeDef, - CreateSchemaVersionRequest -> = z.object({ - namespace: z.string(), - slug: z.string(), - requestBody: z.lazy(() => CreateSchemaVersionRequestBody$outboundSchema), -}).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 CreateSchemaVersionRequest$ { - /** @deprecated use `CreateSchemaVersionRequest$inboundSchema` instead. */ - export const inboundSchema = CreateSchemaVersionRequest$inboundSchema; - /** @deprecated use `CreateSchemaVersionRequest$outboundSchema` instead. */ - export const outboundSchema = CreateSchemaVersionRequest$outboundSchema; - /** @deprecated use `CreateSchemaVersionRequest$Outbound` instead. */ - export type Outbound = CreateSchemaVersionRequest$Outbound; -} - -export function createSchemaVersionRequestToJSON( - createSchemaVersionRequest: CreateSchemaVersionRequest, -): string { - return JSON.stringify( - CreateSchemaVersionRequest$outboundSchema.parse(createSchemaVersionRequest), - ); -} - -export function createSchemaVersionRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateSchemaVersionRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateSchemaVersionRequest' from JSON`, - ); -} - -/** @internal */ -export const CreateSchemaVersionResponse$inboundSchema: z.ZodType< - CreateSchemaVersionResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - uid: components.Uid$inboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type CreateSchemaVersionResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - uid?: components.Uid$Outbound | undefined; -}; - -/** @internal */ -export const CreateSchemaVersionResponse$outboundSchema: z.ZodType< - CreateSchemaVersionResponse$Outbound, - z.ZodTypeDef, - CreateSchemaVersionResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - uid: components.Uid$outboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace CreateSchemaVersionResponse$ { - /** @deprecated use `CreateSchemaVersionResponse$inboundSchema` instead. */ - export const inboundSchema = CreateSchemaVersionResponse$inboundSchema; - /** @deprecated use `CreateSchemaVersionResponse$outboundSchema` instead. */ - export const outboundSchema = CreateSchemaVersionResponse$outboundSchema; - /** @deprecated use `CreateSchemaVersionResponse$Outbound` instead. */ - export type Outbound = CreateSchemaVersionResponse$Outbound; -} - -export function createSchemaVersionResponseToJSON( - createSchemaVersionResponse: CreateSchemaVersionResponse, -): string { - return JSON.stringify( - CreateSchemaVersionResponse$outboundSchema.parse( - createSchemaVersionResponse, - ), - ); -} - -export function createSchemaVersionResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateSchemaVersionResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateSchemaVersionResponse' from JSON`, - ); -} diff --git a/src/models/operations/createtheme.ts b/src/models/operations/createtheme.ts deleted file mode 100644 index 26afe77..0000000 --- a/src/models/operations/createtheme.ts +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type CreateThemeRequestBody = { - name: string; - description?: string | undefined; - slug: string; - document: string; -}; - -export type CreateThemeResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - uid?: components.Uid | undefined; -}; - -/** @internal */ -export const CreateThemeRequestBody$inboundSchema: z.ZodType< - CreateThemeRequestBody, - z.ZodTypeDef, - unknown -> = z.object({ - name: z.string(), - description: z.string().optional(), - slug: z.string(), - document: z.string(), -}); - -/** @internal */ -export type CreateThemeRequestBody$Outbound = { - name: string; - description?: string | undefined; - slug: string; - document: string; -}; - -/** @internal */ -export const CreateThemeRequestBody$outboundSchema: z.ZodType< - CreateThemeRequestBody$Outbound, - z.ZodTypeDef, - CreateThemeRequestBody -> = z.object({ - name: z.string(), - description: z.string().optional(), - slug: z.string(), - document: 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 CreateThemeRequestBody$ { - /** @deprecated use `CreateThemeRequestBody$inboundSchema` instead. */ - export const inboundSchema = CreateThemeRequestBody$inboundSchema; - /** @deprecated use `CreateThemeRequestBody$outboundSchema` instead. */ - export const outboundSchema = CreateThemeRequestBody$outboundSchema; - /** @deprecated use `CreateThemeRequestBody$Outbound` instead. */ - export type Outbound = CreateThemeRequestBody$Outbound; -} - -export function createThemeRequestBodyToJSON( - createThemeRequestBody: CreateThemeRequestBody, -): string { - return JSON.stringify( - CreateThemeRequestBody$outboundSchema.parse(createThemeRequestBody), - ); -} - -export function createThemeRequestBodyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateThemeRequestBody$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateThemeRequestBody' from JSON`, - ); -} - -/** @internal */ -export const CreateThemeResponse$inboundSchema: z.ZodType< - CreateThemeResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - uid: components.Uid$inboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type CreateThemeResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - uid?: components.Uid$Outbound | undefined; -}; - -/** @internal */ -export const CreateThemeResponse$outboundSchema: z.ZodType< - CreateThemeResponse$Outbound, - z.ZodTypeDef, - CreateThemeResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - uid: components.Uid$outboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace CreateThemeResponse$ { - /** @deprecated use `CreateThemeResponse$inboundSchema` instead. */ - export const inboundSchema = CreateThemeResponse$inboundSchema; - /** @deprecated use `CreateThemeResponse$outboundSchema` instead. */ - export const outboundSchema = CreateThemeResponse$outboundSchema; - /** @deprecated use `CreateThemeResponse$Outbound` instead. */ - export type Outbound = CreateThemeResponse$Outbound; -} - -export function createThemeResponseToJSON( - createThemeResponse: CreateThemeResponse, -): string { - return JSON.stringify( - CreateThemeResponse$outboundSchema.parse(createThemeResponse), - ); -} - -export function createThemeResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateThemeResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateThemeResponse' from JSON`, - ); -} diff --git a/src/models/operations/deleteapidocument.ts b/src/models/operations/deleteapidocument.ts deleted file mode 100644 index 1a872c7..0000000 --- a/src/models/operations/deleteapidocument.ts +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type DeleteApiDocumentRequest = { - namespace: string; - slug: string; -}; - -export type DeleteApiDocumentResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - any?: any | null | undefined; -}; - -/** @internal */ -export const DeleteApiDocumentRequest$inboundSchema: z.ZodType< - DeleteApiDocumentRequest, - z.ZodTypeDef, - unknown -> = z.object({ - namespace: z.string(), - slug: z.string(), -}); - -/** @internal */ -export type DeleteApiDocumentRequest$Outbound = { - namespace: string; - slug: string; -}; - -/** @internal */ -export const DeleteApiDocumentRequest$outboundSchema: z.ZodType< - DeleteApiDocumentRequest$Outbound, - z.ZodTypeDef, - DeleteApiDocumentRequest -> = z.object({ - namespace: z.string(), - 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 DeleteApiDocumentRequest$ { - /** @deprecated use `DeleteApiDocumentRequest$inboundSchema` instead. */ - export const inboundSchema = DeleteApiDocumentRequest$inboundSchema; - /** @deprecated use `DeleteApiDocumentRequest$outboundSchema` instead. */ - export const outboundSchema = DeleteApiDocumentRequest$outboundSchema; - /** @deprecated use `DeleteApiDocumentRequest$Outbound` instead. */ - export type Outbound = DeleteApiDocumentRequest$Outbound; -} - -export function deleteApiDocumentRequestToJSON( - deleteApiDocumentRequest: DeleteApiDocumentRequest, -): string { - return JSON.stringify( - DeleteApiDocumentRequest$outboundSchema.parse(deleteApiDocumentRequest), - ); -} - -export function deleteApiDocumentRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => DeleteApiDocumentRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'DeleteApiDocumentRequest' from JSON`, - ); -} - -/** @internal */ -export const DeleteApiDocumentResponse$inboundSchema: z.ZodType< - DeleteApiDocumentResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type DeleteApiDocumentResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - any?: any | null | undefined; -}; - -/** @internal */ -export const DeleteApiDocumentResponse$outboundSchema: z.ZodType< - DeleteApiDocumentResponse$Outbound, - z.ZodTypeDef, - DeleteApiDocumentResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace DeleteApiDocumentResponse$ { - /** @deprecated use `DeleteApiDocumentResponse$inboundSchema` instead. */ - export const inboundSchema = DeleteApiDocumentResponse$inboundSchema; - /** @deprecated use `DeleteApiDocumentResponse$outboundSchema` instead. */ - export const outboundSchema = DeleteApiDocumentResponse$outboundSchema; - /** @deprecated use `DeleteApiDocumentResponse$Outbound` instead. */ - export type Outbound = DeleteApiDocumentResponse$Outbound; -} - -export function deleteApiDocumentResponseToJSON( - deleteApiDocumentResponse: DeleteApiDocumentResponse, -): string { - return JSON.stringify( - DeleteApiDocumentResponse$outboundSchema.parse(deleteApiDocumentResponse), - ); -} - -export function deleteApiDocumentResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => DeleteApiDocumentResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'DeleteApiDocumentResponse' from JSON`, - ); -} diff --git a/src/models/operations/deleteapidocumentversion.ts b/src/models/operations/deleteapidocumentversion.ts deleted file mode 100644 index e7a67ad..0000000 --- a/src/models/operations/deleteapidocumentversion.ts +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type DeleteApiDocumentVersionRequest = { - namespace: string; - slug: string; - semver: string; -}; - -export type DeleteApiDocumentVersionResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - any?: any | null | undefined; -}; - -/** @internal */ -export const DeleteApiDocumentVersionRequest$inboundSchema: z.ZodType< - DeleteApiDocumentVersionRequest, - z.ZodTypeDef, - unknown -> = z.object({ - namespace: z.string(), - slug: z.string(), - semver: z.string(), -}); - -/** @internal */ -export type DeleteApiDocumentVersionRequest$Outbound = { - namespace: string; - slug: string; - semver: string; -}; - -/** @internal */ -export const DeleteApiDocumentVersionRequest$outboundSchema: z.ZodType< - DeleteApiDocumentVersionRequest$Outbound, - z.ZodTypeDef, - DeleteApiDocumentVersionRequest -> = z.object({ - namespace: z.string(), - slug: z.string(), - semver: 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 DeleteApiDocumentVersionRequest$ { - /** @deprecated use `DeleteApiDocumentVersionRequest$inboundSchema` instead. */ - export const inboundSchema = DeleteApiDocumentVersionRequest$inboundSchema; - /** @deprecated use `DeleteApiDocumentVersionRequest$outboundSchema` instead. */ - export const outboundSchema = DeleteApiDocumentVersionRequest$outboundSchema; - /** @deprecated use `DeleteApiDocumentVersionRequest$Outbound` instead. */ - export type Outbound = DeleteApiDocumentVersionRequest$Outbound; -} - -export function deleteApiDocumentVersionRequestToJSON( - deleteApiDocumentVersionRequest: DeleteApiDocumentVersionRequest, -): string { - return JSON.stringify( - DeleteApiDocumentVersionRequest$outboundSchema.parse( - deleteApiDocumentVersionRequest, - ), - ); -} - -export function deleteApiDocumentVersionRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => DeleteApiDocumentVersionRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'DeleteApiDocumentVersionRequest' from JSON`, - ); -} - -/** @internal */ -export const DeleteApiDocumentVersionResponse$inboundSchema: z.ZodType< - DeleteApiDocumentVersionResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type DeleteApiDocumentVersionResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - any?: any | null | undefined; -}; - -/** @internal */ -export const DeleteApiDocumentVersionResponse$outboundSchema: z.ZodType< - DeleteApiDocumentVersionResponse$Outbound, - z.ZodTypeDef, - DeleteApiDocumentVersionResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace DeleteApiDocumentVersionResponse$ { - /** @deprecated use `DeleteApiDocumentVersionResponse$inboundSchema` instead. */ - export const inboundSchema = DeleteApiDocumentVersionResponse$inboundSchema; - /** @deprecated use `DeleteApiDocumentVersionResponse$outboundSchema` instead. */ - export const outboundSchema = DeleteApiDocumentVersionResponse$outboundSchema; - /** @deprecated use `DeleteApiDocumentVersionResponse$Outbound` instead. */ - export type Outbound = DeleteApiDocumentVersionResponse$Outbound; -} - -export function deleteApiDocumentVersionResponseToJSON( - deleteApiDocumentVersionResponse: DeleteApiDocumentVersionResponse, -): string { - return JSON.stringify( - DeleteApiDocumentVersionResponse$outboundSchema.parse( - deleteApiDocumentVersionResponse, - ), - ); -} - -export function deleteApiDocumentVersionResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => DeleteApiDocumentVersionResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'DeleteApiDocumentVersionResponse' from JSON`, - ); -} diff --git a/src/models/operations/deleteloginportal.ts b/src/models/operations/deleteloginportal.ts deleted file mode 100644 index 166c7e1..0000000 --- a/src/models/operations/deleteloginportal.ts +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type DeleteLoginPortalRequest = { - slug: string; -}; - -export type DeleteLoginPortalResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - any?: any | null | undefined; -}; - -/** @internal */ -export const DeleteLoginPortalRequest$inboundSchema: z.ZodType< - DeleteLoginPortalRequest, - z.ZodTypeDef, - unknown -> = z.object({ - slug: z.string(), -}); - -/** @internal */ -export type DeleteLoginPortalRequest$Outbound = { - slug: string; -}; - -/** @internal */ -export const DeleteLoginPortalRequest$outboundSchema: z.ZodType< - DeleteLoginPortalRequest$Outbound, - z.ZodTypeDef, - DeleteLoginPortalRequest -> = z.object({ - 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 DeleteLoginPortalRequest$ { - /** @deprecated use `DeleteLoginPortalRequest$inboundSchema` instead. */ - export const inboundSchema = DeleteLoginPortalRequest$inboundSchema; - /** @deprecated use `DeleteLoginPortalRequest$outboundSchema` instead. */ - export const outboundSchema = DeleteLoginPortalRequest$outboundSchema; - /** @deprecated use `DeleteLoginPortalRequest$Outbound` instead. */ - export type Outbound = DeleteLoginPortalRequest$Outbound; -} - -export function deleteLoginPortalRequestToJSON( - deleteLoginPortalRequest: DeleteLoginPortalRequest, -): string { - return JSON.stringify( - DeleteLoginPortalRequest$outboundSchema.parse(deleteLoginPortalRequest), - ); -} - -export function deleteLoginPortalRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => DeleteLoginPortalRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'DeleteLoginPortalRequest' from JSON`, - ); -} - -/** @internal */ -export const DeleteLoginPortalResponse$inboundSchema: z.ZodType< - DeleteLoginPortalResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type DeleteLoginPortalResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - any?: any | null | undefined; -}; - -/** @internal */ -export const DeleteLoginPortalResponse$outboundSchema: z.ZodType< - DeleteLoginPortalResponse$Outbound, - z.ZodTypeDef, - DeleteLoginPortalResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace DeleteLoginPortalResponse$ { - /** @deprecated use `DeleteLoginPortalResponse$inboundSchema` instead. */ - export const inboundSchema = DeleteLoginPortalResponse$inboundSchema; - /** @deprecated use `DeleteLoginPortalResponse$outboundSchema` instead. */ - export const outboundSchema = DeleteLoginPortalResponse$outboundSchema; - /** @deprecated use `DeleteLoginPortalResponse$Outbound` instead. */ - export type Outbound = DeleteLoginPortalResponse$Outbound; -} - -export function deleteLoginPortalResponseToJSON( - deleteLoginPortalResponse: DeleteLoginPortalResponse, -): string { - return JSON.stringify( - DeleteLoginPortalResponse$outboundSchema.parse(deleteLoginPortalResponse), - ); -} - -export function deleteLoginPortalResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => DeleteLoginPortalResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'DeleteLoginPortalResponse' from JSON`, - ); -} diff --git a/src/models/operations/deleteruleset.ts b/src/models/operations/deleteruleset.ts deleted file mode 100644 index d3551fe..0000000 --- a/src/models/operations/deleteruleset.ts +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type DeleteRulesetRequest = { - namespace: string; - slug: string; -}; - -export type DeleteRulesetResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - any?: any | null | undefined; -}; - -/** @internal */ -export const DeleteRulesetRequest$inboundSchema: z.ZodType< - DeleteRulesetRequest, - z.ZodTypeDef, - unknown -> = z.object({ - namespace: z.string(), - slug: z.string(), -}); - -/** @internal */ -export type DeleteRulesetRequest$Outbound = { - namespace: string; - slug: string; -}; - -/** @internal */ -export const DeleteRulesetRequest$outboundSchema: z.ZodType< - DeleteRulesetRequest$Outbound, - z.ZodTypeDef, - DeleteRulesetRequest -> = z.object({ - namespace: z.string(), - 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 DeleteRulesetRequest$ { - /** @deprecated use `DeleteRulesetRequest$inboundSchema` instead. */ - export const inboundSchema = DeleteRulesetRequest$inboundSchema; - /** @deprecated use `DeleteRulesetRequest$outboundSchema` instead. */ - export const outboundSchema = DeleteRulesetRequest$outboundSchema; - /** @deprecated use `DeleteRulesetRequest$Outbound` instead. */ - export type Outbound = DeleteRulesetRequest$Outbound; -} - -export function deleteRulesetRequestToJSON( - deleteRulesetRequest: DeleteRulesetRequest, -): string { - return JSON.stringify( - DeleteRulesetRequest$outboundSchema.parse(deleteRulesetRequest), - ); -} - -export function deleteRulesetRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => DeleteRulesetRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'DeleteRulesetRequest' from JSON`, - ); -} - -/** @internal */ -export const DeleteRulesetResponse$inboundSchema: z.ZodType< - DeleteRulesetResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type DeleteRulesetResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - any?: any | null | undefined; -}; - -/** @internal */ -export const DeleteRulesetResponse$outboundSchema: z.ZodType< - DeleteRulesetResponse$Outbound, - z.ZodTypeDef, - DeleteRulesetResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace DeleteRulesetResponse$ { - /** @deprecated use `DeleteRulesetResponse$inboundSchema` instead. */ - export const inboundSchema = DeleteRulesetResponse$inboundSchema; - /** @deprecated use `DeleteRulesetResponse$outboundSchema` instead. */ - export const outboundSchema = DeleteRulesetResponse$outboundSchema; - /** @deprecated use `DeleteRulesetResponse$Outbound` instead. */ - export type Outbound = DeleteRulesetResponse$Outbound; -} - -export function deleteRulesetResponseToJSON( - deleteRulesetResponse: DeleteRulesetResponse, -): string { - return JSON.stringify( - DeleteRulesetResponse$outboundSchema.parse(deleteRulesetResponse), - ); -} - -export function deleteRulesetResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => DeleteRulesetResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'DeleteRulesetResponse' from JSON`, - ); -} diff --git a/src/models/operations/deleteschema.ts b/src/models/operations/deleteschema.ts deleted file mode 100644 index 5bf4b1d..0000000 --- a/src/models/operations/deleteschema.ts +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type DeleteSchemaRequest = { - namespace: string; - slug: string; -}; - -export type DeleteSchemaResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - any?: any | null | undefined; -}; - -/** @internal */ -export const DeleteSchemaRequest$inboundSchema: z.ZodType< - DeleteSchemaRequest, - z.ZodTypeDef, - unknown -> = z.object({ - namespace: z.string(), - slug: z.string(), -}); - -/** @internal */ -export type DeleteSchemaRequest$Outbound = { - namespace: string; - slug: string; -}; - -/** @internal */ -export const DeleteSchemaRequest$outboundSchema: z.ZodType< - DeleteSchemaRequest$Outbound, - z.ZodTypeDef, - DeleteSchemaRequest -> = z.object({ - namespace: z.string(), - 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 DeleteSchemaRequest$ { - /** @deprecated use `DeleteSchemaRequest$inboundSchema` instead. */ - export const inboundSchema = DeleteSchemaRequest$inboundSchema; - /** @deprecated use `DeleteSchemaRequest$outboundSchema` instead. */ - export const outboundSchema = DeleteSchemaRequest$outboundSchema; - /** @deprecated use `DeleteSchemaRequest$Outbound` instead. */ - export type Outbound = DeleteSchemaRequest$Outbound; -} - -export function deleteSchemaRequestToJSON( - deleteSchemaRequest: DeleteSchemaRequest, -): string { - return JSON.stringify( - DeleteSchemaRequest$outboundSchema.parse(deleteSchemaRequest), - ); -} - -export function deleteSchemaRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => DeleteSchemaRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'DeleteSchemaRequest' from JSON`, - ); -} - -/** @internal */ -export const DeleteSchemaResponse$inboundSchema: z.ZodType< - DeleteSchemaResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type DeleteSchemaResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - any?: any | null | undefined; -}; - -/** @internal */ -export const DeleteSchemaResponse$outboundSchema: z.ZodType< - DeleteSchemaResponse$Outbound, - z.ZodTypeDef, - DeleteSchemaResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace DeleteSchemaResponse$ { - /** @deprecated use `DeleteSchemaResponse$inboundSchema` instead. */ - export const inboundSchema = DeleteSchemaResponse$inboundSchema; - /** @deprecated use `DeleteSchemaResponse$outboundSchema` instead. */ - export const outboundSchema = DeleteSchemaResponse$outboundSchema; - /** @deprecated use `DeleteSchemaResponse$Outbound` instead. */ - export type Outbound = DeleteSchemaResponse$Outbound; -} - -export function deleteSchemaResponseToJSON( - deleteSchemaResponse: DeleteSchemaResponse, -): string { - return JSON.stringify( - DeleteSchemaResponse$outboundSchema.parse(deleteSchemaResponse), - ); -} - -export function deleteSchemaResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => DeleteSchemaResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'DeleteSchemaResponse' from JSON`, - ); -} diff --git a/src/models/operations/deleteschemaversion.ts b/src/models/operations/deleteschemaversion.ts deleted file mode 100644 index 3204d73..0000000 --- a/src/models/operations/deleteschemaversion.ts +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type DeleteSchemaVersionRequest = { - namespace: string; - slug: string; - semver: string; -}; - -export type DeleteSchemaVersionResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - any?: any | null | undefined; -}; - -/** @internal */ -export const DeleteSchemaVersionRequest$inboundSchema: z.ZodType< - DeleteSchemaVersionRequest, - z.ZodTypeDef, - unknown -> = z.object({ - namespace: z.string(), - slug: z.string(), - semver: z.string(), -}); - -/** @internal */ -export type DeleteSchemaVersionRequest$Outbound = { - namespace: string; - slug: string; - semver: string; -}; - -/** @internal */ -export const DeleteSchemaVersionRequest$outboundSchema: z.ZodType< - DeleteSchemaVersionRequest$Outbound, - z.ZodTypeDef, - DeleteSchemaVersionRequest -> = z.object({ - namespace: z.string(), - slug: z.string(), - semver: 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 DeleteSchemaVersionRequest$ { - /** @deprecated use `DeleteSchemaVersionRequest$inboundSchema` instead. */ - export const inboundSchema = DeleteSchemaVersionRequest$inboundSchema; - /** @deprecated use `DeleteSchemaVersionRequest$outboundSchema` instead. */ - export const outboundSchema = DeleteSchemaVersionRequest$outboundSchema; - /** @deprecated use `DeleteSchemaVersionRequest$Outbound` instead. */ - export type Outbound = DeleteSchemaVersionRequest$Outbound; -} - -export function deleteSchemaVersionRequestToJSON( - deleteSchemaVersionRequest: DeleteSchemaVersionRequest, -): string { - return JSON.stringify( - DeleteSchemaVersionRequest$outboundSchema.parse(deleteSchemaVersionRequest), - ); -} - -export function deleteSchemaVersionRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => DeleteSchemaVersionRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'DeleteSchemaVersionRequest' from JSON`, - ); -} - -/** @internal */ -export const DeleteSchemaVersionResponse$inboundSchema: z.ZodType< - DeleteSchemaVersionResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type DeleteSchemaVersionResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - any?: any | null | undefined; -}; - -/** @internal */ -export const DeleteSchemaVersionResponse$outboundSchema: z.ZodType< - DeleteSchemaVersionResponse$Outbound, - z.ZodTypeDef, - DeleteSchemaVersionResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace DeleteSchemaVersionResponse$ { - /** @deprecated use `DeleteSchemaVersionResponse$inboundSchema` instead. */ - export const inboundSchema = DeleteSchemaVersionResponse$inboundSchema; - /** @deprecated use `DeleteSchemaVersionResponse$outboundSchema` instead. */ - export const outboundSchema = DeleteSchemaVersionResponse$outboundSchema; - /** @deprecated use `DeleteSchemaVersionResponse$Outbound` instead. */ - export type Outbound = DeleteSchemaVersionResponse$Outbound; -} - -export function deleteSchemaVersionResponseToJSON( - deleteSchemaVersionResponse: DeleteSchemaVersionResponse, -): string { - return JSON.stringify( - DeleteSchemaVersionResponse$outboundSchema.parse( - deleteSchemaVersionResponse, - ), - ); -} - -export function deleteSchemaVersionResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => DeleteSchemaVersionResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'DeleteSchemaVersionResponse' from JSON`, - ); -} diff --git a/src/models/operations/deletetheme.ts b/src/models/operations/deletetheme.ts deleted file mode 100644 index a0ba3a1..0000000 --- a/src/models/operations/deletetheme.ts +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type DeleteThemeRequest = { - slug: string; -}; - -export type DeleteThemeResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - any?: any | null | undefined; -}; - -/** @internal */ -export const DeleteThemeRequest$inboundSchema: z.ZodType< - DeleteThemeRequest, - z.ZodTypeDef, - unknown -> = z.object({ - slug: z.string(), -}); - -/** @internal */ -export type DeleteThemeRequest$Outbound = { - slug: string; -}; - -/** @internal */ -export const DeleteThemeRequest$outboundSchema: z.ZodType< - DeleteThemeRequest$Outbound, - z.ZodTypeDef, - DeleteThemeRequest -> = z.object({ - 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 DeleteThemeRequest$ { - /** @deprecated use `DeleteThemeRequest$inboundSchema` instead. */ - export const inboundSchema = DeleteThemeRequest$inboundSchema; - /** @deprecated use `DeleteThemeRequest$outboundSchema` instead. */ - export const outboundSchema = DeleteThemeRequest$outboundSchema; - /** @deprecated use `DeleteThemeRequest$Outbound` instead. */ - export type Outbound = DeleteThemeRequest$Outbound; -} - -export function deleteThemeRequestToJSON( - deleteThemeRequest: DeleteThemeRequest, -): string { - return JSON.stringify( - DeleteThemeRequest$outboundSchema.parse(deleteThemeRequest), - ); -} - -export function deleteThemeRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => DeleteThemeRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'DeleteThemeRequest' from JSON`, - ); -} - -/** @internal */ -export const DeleteThemeResponse$inboundSchema: z.ZodType< - DeleteThemeResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type DeleteThemeResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - any?: any | null | undefined; -}; - -/** @internal */ -export const DeleteThemeResponse$outboundSchema: z.ZodType< - DeleteThemeResponse$Outbound, - z.ZodTypeDef, - DeleteThemeResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace DeleteThemeResponse$ { - /** @deprecated use `DeleteThemeResponse$inboundSchema` instead. */ - export const inboundSchema = DeleteThemeResponse$inboundSchema; - /** @deprecated use `DeleteThemeResponse$outboundSchema` instead. */ - export const outboundSchema = DeleteThemeResponse$outboundSchema; - /** @deprecated use `DeleteThemeResponse$Outbound` instead. */ - export type Outbound = DeleteThemeResponse$Outbound; -} - -export function deleteThemeResponseToJSON( - deleteThemeResponse: DeleteThemeResponse, -): string { - return JSON.stringify( - DeleteThemeResponse$outboundSchema.parse(deleteThemeResponse), - ); -} - -export function deleteThemeResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => DeleteThemeResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'DeleteThemeResponse' from JSON`, - ); -} diff --git a/src/models/operations/exchangepersonaltoken.ts b/src/models/operations/exchangepersonaltoken.ts deleted file mode 100644 index ce978f8..0000000 --- a/src/models/operations/exchangepersonaltoken.ts +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type ExchangePersonalTokenRequestBody = { - personalToken: string; -}; - -/** - * Default Response - */ -export type ExchangePersonalTokenResponseBody = { - accessToken: string; -}; - -export type ExchangePersonalTokenResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - object?: ExchangePersonalTokenResponseBody | undefined; -}; - -/** @internal */ -export const ExchangePersonalTokenRequestBody$inboundSchema: z.ZodType< - ExchangePersonalTokenRequestBody, - z.ZodTypeDef, - unknown -> = z.object({ - personalToken: z.string(), -}); - -/** @internal */ -export type ExchangePersonalTokenRequestBody$Outbound = { - personalToken: string; -}; - -/** @internal */ -export const ExchangePersonalTokenRequestBody$outboundSchema: z.ZodType< - ExchangePersonalTokenRequestBody$Outbound, - z.ZodTypeDef, - ExchangePersonalTokenRequestBody -> = z.object({ - personalToken: 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 ExchangePersonalTokenRequestBody$ { - /** @deprecated use `ExchangePersonalTokenRequestBody$inboundSchema` instead. */ - export const inboundSchema = ExchangePersonalTokenRequestBody$inboundSchema; - /** @deprecated use `ExchangePersonalTokenRequestBody$outboundSchema` instead. */ - export const outboundSchema = ExchangePersonalTokenRequestBody$outboundSchema; - /** @deprecated use `ExchangePersonalTokenRequestBody$Outbound` instead. */ - export type Outbound = ExchangePersonalTokenRequestBody$Outbound; -} - -export function exchangePersonalTokenRequestBodyToJSON( - exchangePersonalTokenRequestBody: ExchangePersonalTokenRequestBody, -): string { - return JSON.stringify( - ExchangePersonalTokenRequestBody$outboundSchema.parse( - exchangePersonalTokenRequestBody, - ), - ); -} - -export function exchangePersonalTokenRequestBodyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ExchangePersonalTokenRequestBody$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ExchangePersonalTokenRequestBody' from JSON`, - ); -} - -/** @internal */ -export const ExchangePersonalTokenResponseBody$inboundSchema: z.ZodType< - ExchangePersonalTokenResponseBody, - z.ZodTypeDef, - unknown -> = z.object({ - accessToken: z.string(), -}); - -/** @internal */ -export type ExchangePersonalTokenResponseBody$Outbound = { - accessToken: string; -}; - -/** @internal */ -export const ExchangePersonalTokenResponseBody$outboundSchema: z.ZodType< - ExchangePersonalTokenResponseBody$Outbound, - z.ZodTypeDef, - ExchangePersonalTokenResponseBody -> = z.object({ - accessToken: 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 ExchangePersonalTokenResponseBody$ { - /** @deprecated use `ExchangePersonalTokenResponseBody$inboundSchema` instead. */ - export const inboundSchema = ExchangePersonalTokenResponseBody$inboundSchema; - /** @deprecated use `ExchangePersonalTokenResponseBody$outboundSchema` instead. */ - export const outboundSchema = - ExchangePersonalTokenResponseBody$outboundSchema; - /** @deprecated use `ExchangePersonalTokenResponseBody$Outbound` instead. */ - export type Outbound = ExchangePersonalTokenResponseBody$Outbound; -} - -export function exchangePersonalTokenResponseBodyToJSON( - exchangePersonalTokenResponseBody: ExchangePersonalTokenResponseBody, -): string { - return JSON.stringify( - ExchangePersonalTokenResponseBody$outboundSchema.parse( - exchangePersonalTokenResponseBody, - ), - ); -} - -export function exchangePersonalTokenResponseBodyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ExchangePersonalTokenResponseBody$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ExchangePersonalTokenResponseBody' from JSON`, - ); -} - -/** @internal */ -export const ExchangePersonalTokenResponse$inboundSchema: z.ZodType< - ExchangePersonalTokenResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - object: z.lazy(() => ExchangePersonalTokenResponseBody$inboundSchema) - .optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type ExchangePersonalTokenResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - object?: ExchangePersonalTokenResponseBody$Outbound | undefined; -}; - -/** @internal */ -export const ExchangePersonalTokenResponse$outboundSchema: z.ZodType< - ExchangePersonalTokenResponse$Outbound, - z.ZodTypeDef, - ExchangePersonalTokenResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - object: z.lazy(() => ExchangePersonalTokenResponseBody$outboundSchema) - .optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace ExchangePersonalTokenResponse$ { - /** @deprecated use `ExchangePersonalTokenResponse$inboundSchema` instead. */ - export const inboundSchema = ExchangePersonalTokenResponse$inboundSchema; - /** @deprecated use `ExchangePersonalTokenResponse$outboundSchema` instead. */ - export const outboundSchema = ExchangePersonalTokenResponse$outboundSchema; - /** @deprecated use `ExchangePersonalTokenResponse$Outbound` instead. */ - export type Outbound = ExchangePersonalTokenResponse$Outbound; -} - -export function exchangePersonalTokenResponseToJSON( - exchangePersonalTokenResponse: ExchangePersonalTokenResponse, -): string { - return JSON.stringify( - ExchangePersonalTokenResponse$outboundSchema.parse( - exchangePersonalTokenResponse, - ), - ); -} - -export function exchangePersonalTokenResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ExchangePersonalTokenResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ExchangePersonalTokenResponse' from JSON`, - ); -} diff --git a/src/models/operations/getapidocumentversion.ts b/src/models/operations/getapidocumentversion.ts deleted file mode 100644 index 05722ae..0000000 --- a/src/models/operations/getapidocumentversion.ts +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type GetApiDocumentVersionRequest = { - namespace: string; - slug: string; - semver: string; -}; - -export type GetApiDocumentVersionResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - res?: string | undefined; -}; - -/** @internal */ -export const GetApiDocumentVersionRequest$inboundSchema: z.ZodType< - GetApiDocumentVersionRequest, - z.ZodTypeDef, - unknown -> = z.object({ - namespace: z.string(), - slug: z.string(), - semver: z.string(), -}); - -/** @internal */ -export type GetApiDocumentVersionRequest$Outbound = { - namespace: string; - slug: string; - semver: string; -}; - -/** @internal */ -export const GetApiDocumentVersionRequest$outboundSchema: z.ZodType< - GetApiDocumentVersionRequest$Outbound, - z.ZodTypeDef, - GetApiDocumentVersionRequest -> = z.object({ - namespace: z.string(), - slug: z.string(), - semver: 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 GetApiDocumentVersionRequest$ { - /** @deprecated use `GetApiDocumentVersionRequest$inboundSchema` instead. */ - export const inboundSchema = GetApiDocumentVersionRequest$inboundSchema; - /** @deprecated use `GetApiDocumentVersionRequest$outboundSchema` instead. */ - export const outboundSchema = GetApiDocumentVersionRequest$outboundSchema; - /** @deprecated use `GetApiDocumentVersionRequest$Outbound` instead. */ - export type Outbound = GetApiDocumentVersionRequest$Outbound; -} - -export function getApiDocumentVersionRequestToJSON( - getApiDocumentVersionRequest: GetApiDocumentVersionRequest, -): string { - return JSON.stringify( - GetApiDocumentVersionRequest$outboundSchema.parse( - getApiDocumentVersionRequest, - ), - ); -} - -export function getApiDocumentVersionRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => GetApiDocumentVersionRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'GetApiDocumentVersionRequest' from JSON`, - ); -} - -/** @internal */ -export const GetApiDocumentVersionResponse$inboundSchema: z.ZodType< - GetApiDocumentVersionResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - res: z.string().optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type GetApiDocumentVersionResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - res?: string | undefined; -}; - -/** @internal */ -export const GetApiDocumentVersionResponse$outboundSchema: z.ZodType< - GetApiDocumentVersionResponse$Outbound, - z.ZodTypeDef, - GetApiDocumentVersionResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - res: z.string().optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetApiDocumentVersionResponse$ { - /** @deprecated use `GetApiDocumentVersionResponse$inboundSchema` instead. */ - export const inboundSchema = GetApiDocumentVersionResponse$inboundSchema; - /** @deprecated use `GetApiDocumentVersionResponse$outboundSchema` instead. */ - export const outboundSchema = GetApiDocumentVersionResponse$outboundSchema; - /** @deprecated use `GetApiDocumentVersionResponse$Outbound` instead. */ - export type Outbound = GetApiDocumentVersionResponse$Outbound; -} - -export function getApiDocumentVersionResponseToJSON( - getApiDocumentVersionResponse: GetApiDocumentVersionResponse, -): string { - return JSON.stringify( - GetApiDocumentVersionResponse$outboundSchema.parse( - getApiDocumentVersionResponse, - ), - ); -} - -export function getApiDocumentVersionResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => GetApiDocumentVersionResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'GetApiDocumentVersionResponse' from JSON`, - ); -} diff --git a/src/models/operations/getapidocumentversionmetadata.ts b/src/models/operations/getapidocumentversionmetadata.ts deleted file mode 100644 index 4807933..0000000 --- a/src/models/operations/getapidocumentversionmetadata.ts +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type GetApiDocumentVersionMetadataRequest = { - namespace: string; - slug: string; - semver: string; -}; - -export type GetApiDocumentVersionMetadataResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - managedDocVersion?: components.ManagedDocVersion | undefined; -}; - -/** @internal */ -export const GetApiDocumentVersionMetadataRequest$inboundSchema: z.ZodType< - GetApiDocumentVersionMetadataRequest, - z.ZodTypeDef, - unknown -> = z.object({ - namespace: z.string(), - slug: z.string(), - semver: z.string(), -}); - -/** @internal */ -export type GetApiDocumentVersionMetadataRequest$Outbound = { - namespace: string; - slug: string; - semver: string; -}; - -/** @internal */ -export const GetApiDocumentVersionMetadataRequest$outboundSchema: z.ZodType< - GetApiDocumentVersionMetadataRequest$Outbound, - z.ZodTypeDef, - GetApiDocumentVersionMetadataRequest -> = z.object({ - namespace: z.string(), - slug: z.string(), - semver: 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 GetApiDocumentVersionMetadataRequest$ { - /** @deprecated use `GetApiDocumentVersionMetadataRequest$inboundSchema` instead. */ - export const inboundSchema = - GetApiDocumentVersionMetadataRequest$inboundSchema; - /** @deprecated use `GetApiDocumentVersionMetadataRequest$outboundSchema` instead. */ - export const outboundSchema = - GetApiDocumentVersionMetadataRequest$outboundSchema; - /** @deprecated use `GetApiDocumentVersionMetadataRequest$Outbound` instead. */ - export type Outbound = GetApiDocumentVersionMetadataRequest$Outbound; -} - -export function getApiDocumentVersionMetadataRequestToJSON( - getApiDocumentVersionMetadataRequest: GetApiDocumentVersionMetadataRequest, -): string { - return JSON.stringify( - GetApiDocumentVersionMetadataRequest$outboundSchema.parse( - getApiDocumentVersionMetadataRequest, - ), - ); -} - -export function getApiDocumentVersionMetadataRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => - GetApiDocumentVersionMetadataRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'GetApiDocumentVersionMetadataRequest' from JSON`, - ); -} - -/** @internal */ -export const GetApiDocumentVersionMetadataResponse$inboundSchema: z.ZodType< - GetApiDocumentVersionMetadataResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - "managed-doc-version": components.ManagedDocVersion$inboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - "managed-doc-version": "managedDocVersion", - }); -}); - -/** @internal */ -export type GetApiDocumentVersionMetadataResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - "managed-doc-version"?: components.ManagedDocVersion$Outbound | undefined; -}; - -/** @internal */ -export const GetApiDocumentVersionMetadataResponse$outboundSchema: z.ZodType< - GetApiDocumentVersionMetadataResponse$Outbound, - z.ZodTypeDef, - GetApiDocumentVersionMetadataResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - managedDocVersion: components.ManagedDocVersion$outboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - managedDocVersion: "managed-doc-version", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetApiDocumentVersionMetadataResponse$ { - /** @deprecated use `GetApiDocumentVersionMetadataResponse$inboundSchema` instead. */ - export const inboundSchema = - GetApiDocumentVersionMetadataResponse$inboundSchema; - /** @deprecated use `GetApiDocumentVersionMetadataResponse$outboundSchema` instead. */ - export const outboundSchema = - GetApiDocumentVersionMetadataResponse$outboundSchema; - /** @deprecated use `GetApiDocumentVersionMetadataResponse$Outbound` instead. */ - export type Outbound = GetApiDocumentVersionMetadataResponse$Outbound; -} - -export function getApiDocumentVersionMetadataResponseToJSON( - getApiDocumentVersionMetadataResponse: GetApiDocumentVersionMetadataResponse, -): string { - return JSON.stringify( - GetApiDocumentVersionMetadataResponse$outboundSchema.parse( - getApiDocumentVersionMetadataResponse, - ), - ); -} - -export function getApiDocumentVersionMetadataResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => - GetApiDocumentVersionMetadataResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'GetApiDocumentVersionMetadataResponse' from JSON`, - ); -} diff --git a/src/models/operations/getcurrentuser.ts b/src/models/operations/getcurrentuser.ts deleted file mode 100644 index 3034c32..0000000 --- a/src/models/operations/getcurrentuser.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type GetCurrentUserResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - user?: components.User | undefined; -}; - -/** @internal */ -export const GetCurrentUserResponse$inboundSchema: z.ZodType< - GetCurrentUserResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - user: components.User$inboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type GetCurrentUserResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - user?: components.User$Outbound | undefined; -}; - -/** @internal */ -export const GetCurrentUserResponse$outboundSchema: z.ZodType< - GetCurrentUserResponse$Outbound, - z.ZodTypeDef, - GetCurrentUserResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - user: components.User$outboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetCurrentUserResponse$ { - /** @deprecated use `GetCurrentUserResponse$inboundSchema` instead. */ - export const inboundSchema = GetCurrentUserResponse$inboundSchema; - /** @deprecated use `GetCurrentUserResponse$outboundSchema` instead. */ - export const outboundSchema = GetCurrentUserResponse$outboundSchema; - /** @deprecated use `GetCurrentUserResponse$Outbound` instead. */ - export type Outbound = GetCurrentUserResponse$Outbound; -} - -export function getCurrentUserResponseToJSON( - getCurrentUserResponse: GetCurrentUserResponse, -): string { - return JSON.stringify( - GetCurrentUserResponse$outboundSchema.parse(getCurrentUserResponse), - ); -} - -export function getCurrentUserResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => GetCurrentUserResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'GetCurrentUserResponse' from JSON`, - ); -} diff --git a/src/models/operations/getloginportal.ts b/src/models/operations/getloginportal.ts deleted file mode 100644 index bbc4fcf..0000000 --- a/src/models/operations/getloginportal.ts +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type GetLoginPortalRequest = { - slug: string; -}; - -/** - * Default Response - */ -export type GetLoginPortalResponseBody = { - uid: string; - title: string; - slug: string; - email: components.LoginPortalEmail; - page: components.LoginPortalPage; -}; - -export type GetLoginPortalResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - object?: GetLoginPortalResponseBody | undefined; -}; - -/** @internal */ -export const GetLoginPortalRequest$inboundSchema: z.ZodType< - GetLoginPortalRequest, - z.ZodTypeDef, - unknown -> = z.object({ - slug: z.string(), -}); - -/** @internal */ -export type GetLoginPortalRequest$Outbound = { - slug: string; -}; - -/** @internal */ -export const GetLoginPortalRequest$outboundSchema: z.ZodType< - GetLoginPortalRequest$Outbound, - z.ZodTypeDef, - GetLoginPortalRequest -> = z.object({ - 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 GetLoginPortalRequest$ { - /** @deprecated use `GetLoginPortalRequest$inboundSchema` instead. */ - export const inboundSchema = GetLoginPortalRequest$inboundSchema; - /** @deprecated use `GetLoginPortalRequest$outboundSchema` instead. */ - export const outboundSchema = GetLoginPortalRequest$outboundSchema; - /** @deprecated use `GetLoginPortalRequest$Outbound` instead. */ - export type Outbound = GetLoginPortalRequest$Outbound; -} - -export function getLoginPortalRequestToJSON( - getLoginPortalRequest: GetLoginPortalRequest, -): string { - return JSON.stringify( - GetLoginPortalRequest$outboundSchema.parse(getLoginPortalRequest), - ); -} - -export function getLoginPortalRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => GetLoginPortalRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'GetLoginPortalRequest' from JSON`, - ); -} - -/** @internal */ -export const GetLoginPortalResponseBody$inboundSchema: z.ZodType< - GetLoginPortalResponseBody, - z.ZodTypeDef, - unknown -> = z.object({ - uid: z.string(), - title: z.string(), - slug: z.string(), - email: components.LoginPortalEmail$inboundSchema, - page: components.LoginPortalPage$inboundSchema, -}); - -/** @internal */ -export type GetLoginPortalResponseBody$Outbound = { - uid: string; - title: string; - slug: string; - email: components.LoginPortalEmail$Outbound; - page: components.LoginPortalPage$Outbound; -}; - -/** @internal */ -export const GetLoginPortalResponseBody$outboundSchema: z.ZodType< - GetLoginPortalResponseBody$Outbound, - z.ZodTypeDef, - GetLoginPortalResponseBody -> = z.object({ - uid: z.string(), - title: z.string(), - slug: z.string(), - email: components.LoginPortalEmail$outboundSchema, - page: components.LoginPortalPage$outboundSchema, -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetLoginPortalResponseBody$ { - /** @deprecated use `GetLoginPortalResponseBody$inboundSchema` instead. */ - export const inboundSchema = GetLoginPortalResponseBody$inboundSchema; - /** @deprecated use `GetLoginPortalResponseBody$outboundSchema` instead. */ - export const outboundSchema = GetLoginPortalResponseBody$outboundSchema; - /** @deprecated use `GetLoginPortalResponseBody$Outbound` instead. */ - export type Outbound = GetLoginPortalResponseBody$Outbound; -} - -export function getLoginPortalResponseBodyToJSON( - getLoginPortalResponseBody: GetLoginPortalResponseBody, -): string { - return JSON.stringify( - GetLoginPortalResponseBody$outboundSchema.parse(getLoginPortalResponseBody), - ); -} - -export function getLoginPortalResponseBodyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => GetLoginPortalResponseBody$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'GetLoginPortalResponseBody' from JSON`, - ); -} - -/** @internal */ -export const GetLoginPortalResponse$inboundSchema: z.ZodType< - GetLoginPortalResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - object: z.lazy(() => GetLoginPortalResponseBody$inboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type GetLoginPortalResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - object?: GetLoginPortalResponseBody$Outbound | undefined; -}; - -/** @internal */ -export const GetLoginPortalResponse$outboundSchema: z.ZodType< - GetLoginPortalResponse$Outbound, - z.ZodTypeDef, - GetLoginPortalResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - object: z.lazy(() => GetLoginPortalResponseBody$outboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetLoginPortalResponse$ { - /** @deprecated use `GetLoginPortalResponse$inboundSchema` instead. */ - export const inboundSchema = GetLoginPortalResponse$inboundSchema; - /** @deprecated use `GetLoginPortalResponse$outboundSchema` instead. */ - export const outboundSchema = GetLoginPortalResponse$outboundSchema; - /** @deprecated use `GetLoginPortalResponse$Outbound` instead. */ - export type Outbound = GetLoginPortalResponse$Outbound; -} - -export function getLoginPortalResponseToJSON( - getLoginPortalResponse: GetLoginPortalResponse, -): string { - return JSON.stringify( - GetLoginPortalResponse$outboundSchema.parse(getLoginPortalResponse), - ); -} - -export function getLoginPortalResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => GetLoginPortalResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'GetLoginPortalResponse' from JSON`, - ); -} diff --git a/src/models/operations/getrulesetdocument.ts b/src/models/operations/getrulesetdocument.ts deleted file mode 100644 index 9aa6984..0000000 --- a/src/models/operations/getrulesetdocument.ts +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type GetRulesetDocumentRequest = { - namespace: string; - slug: string; -}; - -export type GetRulesetDocumentResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - res?: string | undefined; -}; - -/** @internal */ -export const GetRulesetDocumentRequest$inboundSchema: z.ZodType< - GetRulesetDocumentRequest, - z.ZodTypeDef, - unknown -> = z.object({ - namespace: z.string(), - slug: z.string(), -}); - -/** @internal */ -export type GetRulesetDocumentRequest$Outbound = { - namespace: string; - slug: string; -}; - -/** @internal */ -export const GetRulesetDocumentRequest$outboundSchema: z.ZodType< - GetRulesetDocumentRequest$Outbound, - z.ZodTypeDef, - GetRulesetDocumentRequest -> = z.object({ - namespace: z.string(), - 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 GetRulesetDocumentRequest$ { - /** @deprecated use `GetRulesetDocumentRequest$inboundSchema` instead. */ - export const inboundSchema = GetRulesetDocumentRequest$inboundSchema; - /** @deprecated use `GetRulesetDocumentRequest$outboundSchema` instead. */ - export const outboundSchema = GetRulesetDocumentRequest$outboundSchema; - /** @deprecated use `GetRulesetDocumentRequest$Outbound` instead. */ - export type Outbound = GetRulesetDocumentRequest$Outbound; -} - -export function getRulesetDocumentRequestToJSON( - getRulesetDocumentRequest: GetRulesetDocumentRequest, -): string { - return JSON.stringify( - GetRulesetDocumentRequest$outboundSchema.parse(getRulesetDocumentRequest), - ); -} - -export function getRulesetDocumentRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => GetRulesetDocumentRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'GetRulesetDocumentRequest' from JSON`, - ); -} - -/** @internal */ -export const GetRulesetDocumentResponse$inboundSchema: z.ZodType< - GetRulesetDocumentResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - res: z.string().optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type GetRulesetDocumentResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - res?: string | undefined; -}; - -/** @internal */ -export const GetRulesetDocumentResponse$outboundSchema: z.ZodType< - GetRulesetDocumentResponse$Outbound, - z.ZodTypeDef, - GetRulesetDocumentResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - res: z.string().optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetRulesetDocumentResponse$ { - /** @deprecated use `GetRulesetDocumentResponse$inboundSchema` instead. */ - export const inboundSchema = GetRulesetDocumentResponse$inboundSchema; - /** @deprecated use `GetRulesetDocumentResponse$outboundSchema` instead. */ - export const outboundSchema = GetRulesetDocumentResponse$outboundSchema; - /** @deprecated use `GetRulesetDocumentResponse$Outbound` instead. */ - export type Outbound = GetRulesetDocumentResponse$Outbound; -} - -export function getRulesetDocumentResponseToJSON( - getRulesetDocumentResponse: GetRulesetDocumentResponse, -): string { - return JSON.stringify( - GetRulesetDocumentResponse$outboundSchema.parse(getRulesetDocumentResponse), - ); -} - -export function getRulesetDocumentResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => GetRulesetDocumentResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'GetRulesetDocumentResponse' from JSON`, - ); -} diff --git a/src/models/operations/getschemaversion.ts b/src/models/operations/getschemaversion.ts deleted file mode 100644 index 1cacc17..0000000 --- a/src/models/operations/getschemaversion.ts +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type GetSchemaVersionRequest = { - namespace: string; - slug: string; - semver: string; -}; - -export type GetSchemaVersionResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - res?: string | undefined; -}; - -/** @internal */ -export const GetSchemaVersionRequest$inboundSchema: z.ZodType< - GetSchemaVersionRequest, - z.ZodTypeDef, - unknown -> = z.object({ - namespace: z.string(), - slug: z.string(), - semver: z.string(), -}); - -/** @internal */ -export type GetSchemaVersionRequest$Outbound = { - namespace: string; - slug: string; - semver: string; -}; - -/** @internal */ -export const GetSchemaVersionRequest$outboundSchema: z.ZodType< - GetSchemaVersionRequest$Outbound, - z.ZodTypeDef, - GetSchemaVersionRequest -> = z.object({ - namespace: z.string(), - slug: z.string(), - semver: 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 GetSchemaVersionRequest$ { - /** @deprecated use `GetSchemaVersionRequest$inboundSchema` instead. */ - export const inboundSchema = GetSchemaVersionRequest$inboundSchema; - /** @deprecated use `GetSchemaVersionRequest$outboundSchema` instead. */ - export const outboundSchema = GetSchemaVersionRequest$outboundSchema; - /** @deprecated use `GetSchemaVersionRequest$Outbound` instead. */ - export type Outbound = GetSchemaVersionRequest$Outbound; -} - -export function getSchemaVersionRequestToJSON( - getSchemaVersionRequest: GetSchemaVersionRequest, -): string { - return JSON.stringify( - GetSchemaVersionRequest$outboundSchema.parse(getSchemaVersionRequest), - ); -} - -export function getSchemaVersionRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => GetSchemaVersionRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'GetSchemaVersionRequest' from JSON`, - ); -} - -/** @internal */ -export const GetSchemaVersionResponse$inboundSchema: z.ZodType< - GetSchemaVersionResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - res: z.string().optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type GetSchemaVersionResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - res?: string | undefined; -}; - -/** @internal */ -export const GetSchemaVersionResponse$outboundSchema: z.ZodType< - GetSchemaVersionResponse$Outbound, - z.ZodTypeDef, - GetSchemaVersionResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - res: z.string().optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetSchemaVersionResponse$ { - /** @deprecated use `GetSchemaVersionResponse$inboundSchema` instead. */ - export const inboundSchema = GetSchemaVersionResponse$inboundSchema; - /** @deprecated use `GetSchemaVersionResponse$outboundSchema` instead. */ - export const outboundSchema = GetSchemaVersionResponse$outboundSchema; - /** @deprecated use `GetSchemaVersionResponse$Outbound` instead. */ - export type Outbound = GetSchemaVersionResponse$Outbound; -} - -export function getSchemaVersionResponseToJSON( - getSchemaVersionResponse: GetSchemaVersionResponse, -): string { - return JSON.stringify( - GetSchemaVersionResponse$outboundSchema.parse(getSchemaVersionResponse), - ); -} - -export function getSchemaVersionResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => GetSchemaVersionResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'GetSchemaVersionResponse' from JSON`, - ); -} diff --git a/src/models/operations/gettheme.ts b/src/models/operations/gettheme.ts deleted file mode 100644 index 8a83f39..0000000 --- a/src/models/operations/gettheme.ts +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type GetThemeRequest = { - slug: string; -}; - -export type GetThemeResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - res?: string | undefined; -}; - -/** @internal */ -export const GetThemeRequest$inboundSchema: z.ZodType< - GetThemeRequest, - z.ZodTypeDef, - unknown -> = z.object({ - slug: z.string(), -}); - -/** @internal */ -export type GetThemeRequest$Outbound = { - slug: string; -}; - -/** @internal */ -export const GetThemeRequest$outboundSchema: z.ZodType< - GetThemeRequest$Outbound, - z.ZodTypeDef, - GetThemeRequest -> = z.object({ - 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 GetThemeRequest$ { - /** @deprecated use `GetThemeRequest$inboundSchema` instead. */ - export const inboundSchema = GetThemeRequest$inboundSchema; - /** @deprecated use `GetThemeRequest$outboundSchema` instead. */ - export const outboundSchema = GetThemeRequest$outboundSchema; - /** @deprecated use `GetThemeRequest$Outbound` instead. */ - export type Outbound = GetThemeRequest$Outbound; -} - -export function getThemeRequestToJSON( - getThemeRequest: GetThemeRequest, -): string { - return JSON.stringify(GetThemeRequest$outboundSchema.parse(getThemeRequest)); -} - -export function getThemeRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => GetThemeRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'GetThemeRequest' from JSON`, - ); -} - -/** @internal */ -export const GetThemeResponse$inboundSchema: z.ZodType< - GetThemeResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - res: z.string().optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type GetThemeResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - res?: string | undefined; -}; - -/** @internal */ -export const GetThemeResponse$outboundSchema: z.ZodType< - GetThemeResponse$Outbound, - z.ZodTypeDef, - GetThemeResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - res: z.string().optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetThemeResponse$ { - /** @deprecated use `GetThemeResponse$inboundSchema` instead. */ - export const inboundSchema = GetThemeResponse$inboundSchema; - /** @deprecated use `GetThemeResponse$outboundSchema` instead. */ - export const outboundSchema = GetThemeResponse$outboundSchema; - /** @deprecated use `GetThemeResponse$Outbound` instead. */ - export type Outbound = GetThemeResponse$Outbound; -} - -export function getThemeResponseToJSON( - getThemeResponse: GetThemeResponse, -): string { - return JSON.stringify( - GetThemeResponse$outboundSchema.parse(getThemeResponse), - ); -} - -export function getThemeResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => GetThemeResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'GetThemeResponse' from JSON`, - ); -} diff --git a/src/models/operations/index.ts b/src/models/operations/index.ts deleted file mode 100644 index 4e038ff..0000000 --- a/src/models/operations/index.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export * from "./addapidocumentaccessgroup.js"; -export * from "./addrulesetaccessgroup.js"; -export * from "./addschemaaccessgroup.js"; -export * from "./createapidocument.js"; -export * from "./createapidocumentversion.js"; -export * from "./createguide.js"; -export * from "./createloginportal.js"; -export * from "./createruleset.js"; -export * from "./createschema.js"; -export * from "./createschemaversion.js"; -export * from "./createtheme.js"; -export * from "./deleteapidocument.js"; -export * from "./deleteapidocumentversion.js"; -export * from "./deleteloginportal.js"; -export * from "./deleteruleset.js"; -export * from "./deleteschema.js"; -export * from "./deleteschemaversion.js"; -export * from "./deletetheme.js"; -export * from "./exchangepersonaltoken.js"; -export * from "./getapidocumentversion.js"; -export * from "./getapidocumentversionmetadata.js"; -export * from "./getcurrentuser.js"; -export * from "./getloginportal.js"; -export * from "./getrulesetdocument.js"; -export * from "./getschemaversion.js"; -export * from "./gettheme.js"; -export * from "./listallapidocuments.js"; -export * from "./listapidocuments.js"; -export * from "./listguides.js"; -export * from "./listloginportals.js"; -export * from "./listnamespaces.js"; -export * from "./listrulesets.js"; -export * from "./listschemas.js"; -export * from "./listteams.js"; -export * from "./listthemes.js"; -export * from "./publishguide.js"; -export * from "./removeapidocumentaccessgroup.js"; -export * from "./removerulesetaccessgroup.js"; -export * from "./removeschemaaccessgroup.js"; -export * from "./replacethemedocument.js"; -export * from "./updateapidocument.js"; -export * from "./updateapidocumentversion.js"; -export * from "./updateloginportal.js"; -export * from "./updateruleset.js"; -export * from "./updateschema.js"; -export * from "./updatetheme.js"; diff --git a/src/models/operations/listallapidocuments.ts b/src/models/operations/listallapidocuments.ts deleted file mode 100644 index c0a2cc7..0000000 --- a/src/models/operations/listallapidocuments.ts +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type ListAllApiDocumentsResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - apiDocuments?: Array | undefined; -}; - -/** @internal */ -export const ListAllApiDocumentsResponse$inboundSchema: z.ZodType< - ListAllApiDocumentsResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - "api-documents": z.array(components.ApiDocument$inboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - "api-documents": "apiDocuments", - }); -}); - -/** @internal */ -export type ListAllApiDocumentsResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - "api-documents"?: Array | undefined; -}; - -/** @internal */ -export const ListAllApiDocumentsResponse$outboundSchema: z.ZodType< - ListAllApiDocumentsResponse$Outbound, - z.ZodTypeDef, - ListAllApiDocumentsResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - apiDocuments: z.array(components.ApiDocument$outboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - apiDocuments: "api-documents", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace ListAllApiDocumentsResponse$ { - /** @deprecated use `ListAllApiDocumentsResponse$inboundSchema` instead. */ - export const inboundSchema = ListAllApiDocumentsResponse$inboundSchema; - /** @deprecated use `ListAllApiDocumentsResponse$outboundSchema` instead. */ - export const outboundSchema = ListAllApiDocumentsResponse$outboundSchema; - /** @deprecated use `ListAllApiDocumentsResponse$Outbound` instead. */ - export type Outbound = ListAllApiDocumentsResponse$Outbound; -} - -export function listAllApiDocumentsResponseToJSON( - listAllApiDocumentsResponse: ListAllApiDocumentsResponse, -): string { - return JSON.stringify( - ListAllApiDocumentsResponse$outboundSchema.parse( - listAllApiDocumentsResponse, - ), - ); -} - -export function listAllApiDocumentsResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ListAllApiDocumentsResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ListAllApiDocumentsResponse' from JSON`, - ); -} diff --git a/src/models/operations/listapidocuments.ts b/src/models/operations/listapidocuments.ts deleted file mode 100644 index 70bea5d..0000000 --- a/src/models/operations/listapidocuments.ts +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type ListApiDocumentsRequest = { - namespace: string; -}; - -export type ListApiDocumentsResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - apiDocuments?: Array | undefined; -}; - -/** @internal */ -export const ListApiDocumentsRequest$inboundSchema: z.ZodType< - ListApiDocumentsRequest, - z.ZodTypeDef, - unknown -> = z.object({ - namespace: z.string(), -}); - -/** @internal */ -export type ListApiDocumentsRequest$Outbound = { - namespace: string; -}; - -/** @internal */ -export const ListApiDocumentsRequest$outboundSchema: z.ZodType< - ListApiDocumentsRequest$Outbound, - z.ZodTypeDef, - ListApiDocumentsRequest -> = z.object({ - namespace: 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 ListApiDocumentsRequest$ { - /** @deprecated use `ListApiDocumentsRequest$inboundSchema` instead. */ - export const inboundSchema = ListApiDocumentsRequest$inboundSchema; - /** @deprecated use `ListApiDocumentsRequest$outboundSchema` instead. */ - export const outboundSchema = ListApiDocumentsRequest$outboundSchema; - /** @deprecated use `ListApiDocumentsRequest$Outbound` instead. */ - export type Outbound = ListApiDocumentsRequest$Outbound; -} - -export function listApiDocumentsRequestToJSON( - listApiDocumentsRequest: ListApiDocumentsRequest, -): string { - return JSON.stringify( - ListApiDocumentsRequest$outboundSchema.parse(listApiDocumentsRequest), - ); -} - -export function listApiDocumentsRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ListApiDocumentsRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ListApiDocumentsRequest' from JSON`, - ); -} - -/** @internal */ -export const ListApiDocumentsResponse$inboundSchema: z.ZodType< - ListApiDocumentsResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - "api-documents": z.array(components.ApiDocument$inboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - "api-documents": "apiDocuments", - }); -}); - -/** @internal */ -export type ListApiDocumentsResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - "api-documents"?: Array | undefined; -}; - -/** @internal */ -export const ListApiDocumentsResponse$outboundSchema: z.ZodType< - ListApiDocumentsResponse$Outbound, - z.ZodTypeDef, - ListApiDocumentsResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - apiDocuments: z.array(components.ApiDocument$outboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - apiDocuments: "api-documents", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace ListApiDocumentsResponse$ { - /** @deprecated use `ListApiDocumentsResponse$inboundSchema` instead. */ - export const inboundSchema = ListApiDocumentsResponse$inboundSchema; - /** @deprecated use `ListApiDocumentsResponse$outboundSchema` instead. */ - export const outboundSchema = ListApiDocumentsResponse$outboundSchema; - /** @deprecated use `ListApiDocumentsResponse$Outbound` instead. */ - export type Outbound = ListApiDocumentsResponse$Outbound; -} - -export function listApiDocumentsResponseToJSON( - listApiDocumentsResponse: ListApiDocumentsResponse, -): string { - return JSON.stringify( - ListApiDocumentsResponse$outboundSchema.parse(listApiDocumentsResponse), - ); -} - -export function listApiDocumentsResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ListApiDocumentsResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ListApiDocumentsResponse' from JSON`, - ); -} diff --git a/src/models/operations/listguides.ts b/src/models/operations/listguides.ts deleted file mode 100644 index a09fcb8..0000000 --- a/src/models/operations/listguides.ts +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type ListGuidesResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - githubProjects?: Array | undefined; -}; - -/** @internal */ -export const ListGuidesResponse$inboundSchema: z.ZodType< - ListGuidesResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - "github-projects": z.array(components.GithubProject$inboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - "github-projects": "githubProjects", - }); -}); - -/** @internal */ -export type ListGuidesResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - "github-projects"?: Array | undefined; -}; - -/** @internal */ -export const ListGuidesResponse$outboundSchema: z.ZodType< - ListGuidesResponse$Outbound, - z.ZodTypeDef, - ListGuidesResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - githubProjects: z.array(components.GithubProject$outboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - githubProjects: "github-projects", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace ListGuidesResponse$ { - /** @deprecated use `ListGuidesResponse$inboundSchema` instead. */ - export const inboundSchema = ListGuidesResponse$inboundSchema; - /** @deprecated use `ListGuidesResponse$outboundSchema` instead. */ - export const outboundSchema = ListGuidesResponse$outboundSchema; - /** @deprecated use `ListGuidesResponse$Outbound` instead. */ - export type Outbound = ListGuidesResponse$Outbound; -} - -export function listGuidesResponseToJSON( - listGuidesResponse: ListGuidesResponse, -): string { - return JSON.stringify( - ListGuidesResponse$outboundSchema.parse(listGuidesResponse), - ); -} - -export function listGuidesResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ListGuidesResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ListGuidesResponse' from JSON`, - ); -} diff --git a/src/models/operations/listloginportals.ts b/src/models/operations/listloginportals.ts deleted file mode 100644 index e3ad38c..0000000 --- a/src/models/operations/listloginportals.ts +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type ListLoginPortalsResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - loginPortals?: Array | undefined; -}; - -/** @internal */ -export const ListLoginPortalsResponse$inboundSchema: z.ZodType< - ListLoginPortalsResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - "login-portals": z.array(components.LoginPortal$inboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - "login-portals": "loginPortals", - }); -}); - -/** @internal */ -export type ListLoginPortalsResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - "login-portals"?: Array | undefined; -}; - -/** @internal */ -export const ListLoginPortalsResponse$outboundSchema: z.ZodType< - ListLoginPortalsResponse$Outbound, - z.ZodTypeDef, - ListLoginPortalsResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - loginPortals: z.array(components.LoginPortal$outboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - loginPortals: "login-portals", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace ListLoginPortalsResponse$ { - /** @deprecated use `ListLoginPortalsResponse$inboundSchema` instead. */ - export const inboundSchema = ListLoginPortalsResponse$inboundSchema; - /** @deprecated use `ListLoginPortalsResponse$outboundSchema` instead. */ - export const outboundSchema = ListLoginPortalsResponse$outboundSchema; - /** @deprecated use `ListLoginPortalsResponse$Outbound` instead. */ - export type Outbound = ListLoginPortalsResponse$Outbound; -} - -export function listLoginPortalsResponseToJSON( - listLoginPortalsResponse: ListLoginPortalsResponse, -): string { - return JSON.stringify( - ListLoginPortalsResponse$outboundSchema.parse(listLoginPortalsResponse), - ); -} - -export function listLoginPortalsResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ListLoginPortalsResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ListLoginPortalsResponse' from JSON`, - ); -} diff --git a/src/models/operations/listnamespaces.ts b/src/models/operations/listnamespaces.ts deleted file mode 100644 index 8ec7a5c..0000000 --- a/src/models/operations/listnamespaces.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type ListNamespacesResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - strings?: Array | undefined; -}; - -/** @internal */ -export const ListNamespacesResponse$inboundSchema: z.ZodType< - ListNamespacesResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - strings: z.array(z.string()).optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type ListNamespacesResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - strings?: Array | undefined; -}; - -/** @internal */ -export const ListNamespacesResponse$outboundSchema: z.ZodType< - ListNamespacesResponse$Outbound, - z.ZodTypeDef, - ListNamespacesResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - strings: z.array(z.string()).optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace ListNamespacesResponse$ { - /** @deprecated use `ListNamespacesResponse$inboundSchema` instead. */ - export const inboundSchema = ListNamespacesResponse$inboundSchema; - /** @deprecated use `ListNamespacesResponse$outboundSchema` instead. */ - export const outboundSchema = ListNamespacesResponse$outboundSchema; - /** @deprecated use `ListNamespacesResponse$Outbound` instead. */ - export type Outbound = ListNamespacesResponse$Outbound; -} - -export function listNamespacesResponseToJSON( - listNamespacesResponse: ListNamespacesResponse, -): string { - return JSON.stringify( - ListNamespacesResponse$outboundSchema.parse(listNamespacesResponse), - ); -} - -export function listNamespacesResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ListNamespacesResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ListNamespacesResponse' from JSON`, - ); -} diff --git a/src/models/operations/listrulesets.ts b/src/models/operations/listrulesets.ts deleted file mode 100644 index a3e6709..0000000 --- a/src/models/operations/listrulesets.ts +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type ListRulesetsRequest = { - namespace: string; -}; - -export type ListRulesetsResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - rules?: Array | undefined; -}; - -/** @internal */ -export const ListRulesetsRequest$inboundSchema: z.ZodType< - ListRulesetsRequest, - z.ZodTypeDef, - unknown -> = z.object({ - namespace: z.string(), -}); - -/** @internal */ -export type ListRulesetsRequest$Outbound = { - namespace: string; -}; - -/** @internal */ -export const ListRulesetsRequest$outboundSchema: z.ZodType< - ListRulesetsRequest$Outbound, - z.ZodTypeDef, - ListRulesetsRequest -> = z.object({ - namespace: 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 ListRulesetsRequest$ { - /** @deprecated use `ListRulesetsRequest$inboundSchema` instead. */ - export const inboundSchema = ListRulesetsRequest$inboundSchema; - /** @deprecated use `ListRulesetsRequest$outboundSchema` instead. */ - export const outboundSchema = ListRulesetsRequest$outboundSchema; - /** @deprecated use `ListRulesetsRequest$Outbound` instead. */ - export type Outbound = ListRulesetsRequest$Outbound; -} - -export function listRulesetsRequestToJSON( - listRulesetsRequest: ListRulesetsRequest, -): string { - return JSON.stringify( - ListRulesetsRequest$outboundSchema.parse(listRulesetsRequest), - ); -} - -export function listRulesetsRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ListRulesetsRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ListRulesetsRequest' from JSON`, - ); -} - -/** @internal */ -export const ListRulesetsResponse$inboundSchema: z.ZodType< - ListRulesetsResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - rules: z.array(components.Rule$inboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type ListRulesetsResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - rules?: Array | undefined; -}; - -/** @internal */ -export const ListRulesetsResponse$outboundSchema: z.ZodType< - ListRulesetsResponse$Outbound, - z.ZodTypeDef, - ListRulesetsResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - rules: z.array(components.Rule$outboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace ListRulesetsResponse$ { - /** @deprecated use `ListRulesetsResponse$inboundSchema` instead. */ - export const inboundSchema = ListRulesetsResponse$inboundSchema; - /** @deprecated use `ListRulesetsResponse$outboundSchema` instead. */ - export const outboundSchema = ListRulesetsResponse$outboundSchema; - /** @deprecated use `ListRulesetsResponse$Outbound` instead. */ - export type Outbound = ListRulesetsResponse$Outbound; -} - -export function listRulesetsResponseToJSON( - listRulesetsResponse: ListRulesetsResponse, -): string { - return JSON.stringify( - ListRulesetsResponse$outboundSchema.parse(listRulesetsResponse), - ); -} - -export function listRulesetsResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ListRulesetsResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ListRulesetsResponse' from JSON`, - ); -} diff --git a/src/models/operations/listschemas.ts b/src/models/operations/listschemas.ts deleted file mode 100644 index c0346c4..0000000 --- a/src/models/operations/listschemas.ts +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type ListSchemasRequest = { - namespace: string; -}; - -export type ListSchemasResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - schemata?: Array | undefined; -}; - -/** @internal */ -export const ListSchemasRequest$inboundSchema: z.ZodType< - ListSchemasRequest, - z.ZodTypeDef, - unknown -> = z.object({ - namespace: z.string(), -}); - -/** @internal */ -export type ListSchemasRequest$Outbound = { - namespace: string; -}; - -/** @internal */ -export const ListSchemasRequest$outboundSchema: z.ZodType< - ListSchemasRequest$Outbound, - z.ZodTypeDef, - ListSchemasRequest -> = z.object({ - namespace: 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 ListSchemasRequest$ { - /** @deprecated use `ListSchemasRequest$inboundSchema` instead. */ - export const inboundSchema = ListSchemasRequest$inboundSchema; - /** @deprecated use `ListSchemasRequest$outboundSchema` instead. */ - export const outboundSchema = ListSchemasRequest$outboundSchema; - /** @deprecated use `ListSchemasRequest$Outbound` instead. */ - export type Outbound = ListSchemasRequest$Outbound; -} - -export function listSchemasRequestToJSON( - listSchemasRequest: ListSchemasRequest, -): string { - return JSON.stringify( - ListSchemasRequest$outboundSchema.parse(listSchemasRequest), - ); -} - -export function listSchemasRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ListSchemasRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ListSchemasRequest' from JSON`, - ); -} - -/** @internal */ -export const ListSchemasResponse$inboundSchema: z.ZodType< - ListSchemasResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - schemata: z.array(components.Schema$inboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type ListSchemasResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - schemata?: Array | undefined; -}; - -/** @internal */ -export const ListSchemasResponse$outboundSchema: z.ZodType< - ListSchemasResponse$Outbound, - z.ZodTypeDef, - ListSchemasResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - schemata: z.array(components.Schema$outboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace ListSchemasResponse$ { - /** @deprecated use `ListSchemasResponse$inboundSchema` instead. */ - export const inboundSchema = ListSchemasResponse$inboundSchema; - /** @deprecated use `ListSchemasResponse$outboundSchema` instead. */ - export const outboundSchema = ListSchemasResponse$outboundSchema; - /** @deprecated use `ListSchemasResponse$Outbound` instead. */ - export type Outbound = ListSchemasResponse$Outbound; -} - -export function listSchemasResponseToJSON( - listSchemasResponse: ListSchemasResponse, -): string { - return JSON.stringify( - ListSchemasResponse$outboundSchema.parse(listSchemasResponse), - ); -} - -export function listSchemasResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ListSchemasResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ListSchemasResponse' from JSON`, - ); -} diff --git a/src/models/operations/listteams.ts b/src/models/operations/listteams.ts deleted file mode 100644 index 9ab86ce..0000000 --- a/src/models/operations/listteams.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type ListTeamsResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - teams?: Array | undefined; -}; - -/** @internal */ -export const ListTeamsResponse$inboundSchema: z.ZodType< - ListTeamsResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - teams: z.array(components.Team$inboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type ListTeamsResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - teams?: Array | undefined; -}; - -/** @internal */ -export const ListTeamsResponse$outboundSchema: z.ZodType< - ListTeamsResponse$Outbound, - z.ZodTypeDef, - ListTeamsResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - teams: z.array(components.Team$outboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace ListTeamsResponse$ { - /** @deprecated use `ListTeamsResponse$inboundSchema` instead. */ - export const inboundSchema = ListTeamsResponse$inboundSchema; - /** @deprecated use `ListTeamsResponse$outboundSchema` instead. */ - export const outboundSchema = ListTeamsResponse$outboundSchema; - /** @deprecated use `ListTeamsResponse$Outbound` instead. */ - export type Outbound = ListTeamsResponse$Outbound; -} - -export function listTeamsResponseToJSON( - listTeamsResponse: ListTeamsResponse, -): string { - return JSON.stringify( - ListTeamsResponse$outboundSchema.parse(listTeamsResponse), - ); -} - -export function listTeamsResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ListTeamsResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ListTeamsResponse' from JSON`, - ); -} diff --git a/src/models/operations/listthemes.ts b/src/models/operations/listthemes.ts deleted file mode 100644 index 88497bb..0000000 --- a/src/models/operations/listthemes.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type ListThemesResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - themes?: Array | undefined; -}; - -/** @internal */ -export const ListThemesResponse$inboundSchema: z.ZodType< - ListThemesResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - themes: z.array(components.Theme$inboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type ListThemesResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - themes?: Array | undefined; -}; - -/** @internal */ -export const ListThemesResponse$outboundSchema: z.ZodType< - ListThemesResponse$Outbound, - z.ZodTypeDef, - ListThemesResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - themes: z.array(components.Theme$outboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace ListThemesResponse$ { - /** @deprecated use `ListThemesResponse$inboundSchema` instead. */ - export const inboundSchema = ListThemesResponse$inboundSchema; - /** @deprecated use `ListThemesResponse$outboundSchema` instead. */ - export const outboundSchema = ListThemesResponse$outboundSchema; - /** @deprecated use `ListThemesResponse$Outbound` instead. */ - export type Outbound = ListThemesResponse$Outbound; -} - -export function listThemesResponseToJSON( - listThemesResponse: ListThemesResponse, -): string { - return JSON.stringify( - ListThemesResponse$outboundSchema.parse(listThemesResponse), - ); -} - -export function listThemesResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ListThemesResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ListThemesResponse' from JSON`, - ); -} diff --git a/src/models/operations/publishguide.ts b/src/models/operations/publishguide.ts deleted file mode 100644 index c2e3405..0000000 --- a/src/models/operations/publishguide.ts +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type PublishGuideRequest = { - slug: string; -}; - -/** - * Default Response - */ -export type PublishGuideResponseBody = { - publishUid: string; -}; - -export type PublishGuideResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - object?: PublishGuideResponseBody | undefined; -}; - -/** @internal */ -export const PublishGuideRequest$inboundSchema: z.ZodType< - PublishGuideRequest, - z.ZodTypeDef, - unknown -> = z.object({ - slug: z.string(), -}); - -/** @internal */ -export type PublishGuideRequest$Outbound = { - slug: string; -}; - -/** @internal */ -export const PublishGuideRequest$outboundSchema: z.ZodType< - PublishGuideRequest$Outbound, - z.ZodTypeDef, - PublishGuideRequest -> = z.object({ - 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 PublishGuideRequest$ { - /** @deprecated use `PublishGuideRequest$inboundSchema` instead. */ - export const inboundSchema = PublishGuideRequest$inboundSchema; - /** @deprecated use `PublishGuideRequest$outboundSchema` instead. */ - export const outboundSchema = PublishGuideRequest$outboundSchema; - /** @deprecated use `PublishGuideRequest$Outbound` instead. */ - export type Outbound = PublishGuideRequest$Outbound; -} - -export function publishGuideRequestToJSON( - publishGuideRequest: PublishGuideRequest, -): string { - return JSON.stringify( - PublishGuideRequest$outboundSchema.parse(publishGuideRequest), - ); -} - -export function publishGuideRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PublishGuideRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PublishGuideRequest' from JSON`, - ); -} - -/** @internal */ -export const PublishGuideResponseBody$inboundSchema: z.ZodType< - PublishGuideResponseBody, - z.ZodTypeDef, - unknown -> = z.object({ - publishUid: z.string(), -}); - -/** @internal */ -export type PublishGuideResponseBody$Outbound = { - publishUid: string; -}; - -/** @internal */ -export const PublishGuideResponseBody$outboundSchema: z.ZodType< - PublishGuideResponseBody$Outbound, - z.ZodTypeDef, - PublishGuideResponseBody -> = z.object({ - publishUid: 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 PublishGuideResponseBody$ { - /** @deprecated use `PublishGuideResponseBody$inboundSchema` instead. */ - export const inboundSchema = PublishGuideResponseBody$inboundSchema; - /** @deprecated use `PublishGuideResponseBody$outboundSchema` instead. */ - export const outboundSchema = PublishGuideResponseBody$outboundSchema; - /** @deprecated use `PublishGuideResponseBody$Outbound` instead. */ - export type Outbound = PublishGuideResponseBody$Outbound; -} - -export function publishGuideResponseBodyToJSON( - publishGuideResponseBody: PublishGuideResponseBody, -): string { - return JSON.stringify( - PublishGuideResponseBody$outboundSchema.parse(publishGuideResponseBody), - ); -} - -export function publishGuideResponseBodyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PublishGuideResponseBody$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PublishGuideResponseBody' from JSON`, - ); -} - -/** @internal */ -export const PublishGuideResponse$inboundSchema: z.ZodType< - PublishGuideResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - object: z.lazy(() => PublishGuideResponseBody$inboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type PublishGuideResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - object?: PublishGuideResponseBody$Outbound | undefined; -}; - -/** @internal */ -export const PublishGuideResponse$outboundSchema: z.ZodType< - PublishGuideResponse$Outbound, - z.ZodTypeDef, - PublishGuideResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - object: z.lazy(() => PublishGuideResponseBody$outboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace PublishGuideResponse$ { - /** @deprecated use `PublishGuideResponse$inboundSchema` instead. */ - export const inboundSchema = PublishGuideResponse$inboundSchema; - /** @deprecated use `PublishGuideResponse$outboundSchema` instead. */ - export const outboundSchema = PublishGuideResponse$outboundSchema; - /** @deprecated use `PublishGuideResponse$Outbound` instead. */ - export type Outbound = PublishGuideResponse$Outbound; -} - -export function publishGuideResponseToJSON( - publishGuideResponse: PublishGuideResponse, -): string { - return JSON.stringify( - PublishGuideResponse$outboundSchema.parse(publishGuideResponse), - ); -} - -export function publishGuideResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PublishGuideResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PublishGuideResponse' from JSON`, - ); -} diff --git a/src/models/operations/removeapidocumentaccessgroup.ts b/src/models/operations/removeapidocumentaccessgroup.ts deleted file mode 100644 index b68f044..0000000 --- a/src/models/operations/removeapidocumentaccessgroup.ts +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type RemoveApiDocumentAccessGroupRequest = { - namespace: string; - slug: string; - accessGroup: components.AccessGroup; -}; - -export type RemoveApiDocumentAccessGroupResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - any?: any | null | undefined; -}; - -/** @internal */ -export const RemoveApiDocumentAccessGroupRequest$inboundSchema: z.ZodType< - RemoveApiDocumentAccessGroupRequest, - z.ZodTypeDef, - unknown -> = z.object({ - namespace: z.string(), - slug: z.string(), - "access-group": components.AccessGroup$inboundSchema, -}).transform((v) => { - return remap$(v, { - "access-group": "accessGroup", - }); -}); - -/** @internal */ -export type RemoveApiDocumentAccessGroupRequest$Outbound = { - namespace: string; - slug: string; - "access-group": components.AccessGroup$Outbound; -}; - -/** @internal */ -export const RemoveApiDocumentAccessGroupRequest$outboundSchema: z.ZodType< - RemoveApiDocumentAccessGroupRequest$Outbound, - z.ZodTypeDef, - RemoveApiDocumentAccessGroupRequest -> = z.object({ - namespace: z.string(), - slug: z.string(), - accessGroup: components.AccessGroup$outboundSchema, -}).transform((v) => { - return remap$(v, { - accessGroup: "access-group", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace RemoveApiDocumentAccessGroupRequest$ { - /** @deprecated use `RemoveApiDocumentAccessGroupRequest$inboundSchema` instead. */ - export const inboundSchema = - RemoveApiDocumentAccessGroupRequest$inboundSchema; - /** @deprecated use `RemoveApiDocumentAccessGroupRequest$outboundSchema` instead. */ - export const outboundSchema = - RemoveApiDocumentAccessGroupRequest$outboundSchema; - /** @deprecated use `RemoveApiDocumentAccessGroupRequest$Outbound` instead. */ - export type Outbound = RemoveApiDocumentAccessGroupRequest$Outbound; -} - -export function removeApiDocumentAccessGroupRequestToJSON( - removeApiDocumentAccessGroupRequest: RemoveApiDocumentAccessGroupRequest, -): string { - return JSON.stringify( - RemoveApiDocumentAccessGroupRequest$outboundSchema.parse( - removeApiDocumentAccessGroupRequest, - ), - ); -} - -export function removeApiDocumentAccessGroupRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => - RemoveApiDocumentAccessGroupRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'RemoveApiDocumentAccessGroupRequest' from JSON`, - ); -} - -/** @internal */ -export const RemoveApiDocumentAccessGroupResponse$inboundSchema: z.ZodType< - RemoveApiDocumentAccessGroupResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type RemoveApiDocumentAccessGroupResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - any?: any | null | undefined; -}; - -/** @internal */ -export const RemoveApiDocumentAccessGroupResponse$outboundSchema: z.ZodType< - RemoveApiDocumentAccessGroupResponse$Outbound, - z.ZodTypeDef, - RemoveApiDocumentAccessGroupResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace RemoveApiDocumentAccessGroupResponse$ { - /** @deprecated use `RemoveApiDocumentAccessGroupResponse$inboundSchema` instead. */ - export const inboundSchema = - RemoveApiDocumentAccessGroupResponse$inboundSchema; - /** @deprecated use `RemoveApiDocumentAccessGroupResponse$outboundSchema` instead. */ - export const outboundSchema = - RemoveApiDocumentAccessGroupResponse$outboundSchema; - /** @deprecated use `RemoveApiDocumentAccessGroupResponse$Outbound` instead. */ - export type Outbound = RemoveApiDocumentAccessGroupResponse$Outbound; -} - -export function removeApiDocumentAccessGroupResponseToJSON( - removeApiDocumentAccessGroupResponse: RemoveApiDocumentAccessGroupResponse, -): string { - return JSON.stringify( - RemoveApiDocumentAccessGroupResponse$outboundSchema.parse( - removeApiDocumentAccessGroupResponse, - ), - ); -} - -export function removeApiDocumentAccessGroupResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => - RemoveApiDocumentAccessGroupResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'RemoveApiDocumentAccessGroupResponse' from JSON`, - ); -} diff --git a/src/models/operations/removerulesetaccessgroup.ts b/src/models/operations/removerulesetaccessgroup.ts deleted file mode 100644 index 85a22c5..0000000 --- a/src/models/operations/removerulesetaccessgroup.ts +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type RemoveRulesetAccessGroupRequest = { - namespace: string; - slug: string; - accessGroup: components.AccessGroup; -}; - -export type RemoveRulesetAccessGroupResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - any?: any | null | undefined; -}; - -/** @internal */ -export const RemoveRulesetAccessGroupRequest$inboundSchema: z.ZodType< - RemoveRulesetAccessGroupRequest, - z.ZodTypeDef, - unknown -> = z.object({ - namespace: z.string(), - slug: z.string(), - "access-group": components.AccessGroup$inboundSchema, -}).transform((v) => { - return remap$(v, { - "access-group": "accessGroup", - }); -}); - -/** @internal */ -export type RemoveRulesetAccessGroupRequest$Outbound = { - namespace: string; - slug: string; - "access-group": components.AccessGroup$Outbound; -}; - -/** @internal */ -export const RemoveRulesetAccessGroupRequest$outboundSchema: z.ZodType< - RemoveRulesetAccessGroupRequest$Outbound, - z.ZodTypeDef, - RemoveRulesetAccessGroupRequest -> = z.object({ - namespace: z.string(), - slug: z.string(), - accessGroup: components.AccessGroup$outboundSchema, -}).transform((v) => { - return remap$(v, { - accessGroup: "access-group", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace RemoveRulesetAccessGroupRequest$ { - /** @deprecated use `RemoveRulesetAccessGroupRequest$inboundSchema` instead. */ - export const inboundSchema = RemoveRulesetAccessGroupRequest$inboundSchema; - /** @deprecated use `RemoveRulesetAccessGroupRequest$outboundSchema` instead. */ - export const outboundSchema = RemoveRulesetAccessGroupRequest$outboundSchema; - /** @deprecated use `RemoveRulesetAccessGroupRequest$Outbound` instead. */ - export type Outbound = RemoveRulesetAccessGroupRequest$Outbound; -} - -export function removeRulesetAccessGroupRequestToJSON( - removeRulesetAccessGroupRequest: RemoveRulesetAccessGroupRequest, -): string { - return JSON.stringify( - RemoveRulesetAccessGroupRequest$outboundSchema.parse( - removeRulesetAccessGroupRequest, - ), - ); -} - -export function removeRulesetAccessGroupRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => RemoveRulesetAccessGroupRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'RemoveRulesetAccessGroupRequest' from JSON`, - ); -} - -/** @internal */ -export const RemoveRulesetAccessGroupResponse$inboundSchema: z.ZodType< - RemoveRulesetAccessGroupResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type RemoveRulesetAccessGroupResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - any?: any | null | undefined; -}; - -/** @internal */ -export const RemoveRulesetAccessGroupResponse$outboundSchema: z.ZodType< - RemoveRulesetAccessGroupResponse$Outbound, - z.ZodTypeDef, - RemoveRulesetAccessGroupResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace RemoveRulesetAccessGroupResponse$ { - /** @deprecated use `RemoveRulesetAccessGroupResponse$inboundSchema` instead. */ - export const inboundSchema = RemoveRulesetAccessGroupResponse$inboundSchema; - /** @deprecated use `RemoveRulesetAccessGroupResponse$outboundSchema` instead. */ - export const outboundSchema = RemoveRulesetAccessGroupResponse$outboundSchema; - /** @deprecated use `RemoveRulesetAccessGroupResponse$Outbound` instead. */ - export type Outbound = RemoveRulesetAccessGroupResponse$Outbound; -} - -export function removeRulesetAccessGroupResponseToJSON( - removeRulesetAccessGroupResponse: RemoveRulesetAccessGroupResponse, -): string { - return JSON.stringify( - RemoveRulesetAccessGroupResponse$outboundSchema.parse( - removeRulesetAccessGroupResponse, - ), - ); -} - -export function removeRulesetAccessGroupResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => RemoveRulesetAccessGroupResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'RemoveRulesetAccessGroupResponse' from JSON`, - ); -} diff --git a/src/models/operations/removeschemaaccessgroup.ts b/src/models/operations/removeschemaaccessgroup.ts deleted file mode 100644 index 8f82bc3..0000000 --- a/src/models/operations/removeschemaaccessgroup.ts +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type RemoveSchemaAccessGroupRequest = { - namespace: string; - slug: string; - accessGroup: components.AccessGroup; -}; - -export type RemoveSchemaAccessGroupResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - any?: any | null | undefined; -}; - -/** @internal */ -export const RemoveSchemaAccessGroupRequest$inboundSchema: z.ZodType< - RemoveSchemaAccessGroupRequest, - z.ZodTypeDef, - unknown -> = z.object({ - namespace: z.string(), - slug: z.string(), - "access-group": components.AccessGroup$inboundSchema, -}).transform((v) => { - return remap$(v, { - "access-group": "accessGroup", - }); -}); - -/** @internal */ -export type RemoveSchemaAccessGroupRequest$Outbound = { - namespace: string; - slug: string; - "access-group": components.AccessGroup$Outbound; -}; - -/** @internal */ -export const RemoveSchemaAccessGroupRequest$outboundSchema: z.ZodType< - RemoveSchemaAccessGroupRequest$Outbound, - z.ZodTypeDef, - RemoveSchemaAccessGroupRequest -> = z.object({ - namespace: z.string(), - slug: z.string(), - accessGroup: components.AccessGroup$outboundSchema, -}).transform((v) => { - return remap$(v, { - accessGroup: "access-group", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace RemoveSchemaAccessGroupRequest$ { - /** @deprecated use `RemoveSchemaAccessGroupRequest$inboundSchema` instead. */ - export const inboundSchema = RemoveSchemaAccessGroupRequest$inboundSchema; - /** @deprecated use `RemoveSchemaAccessGroupRequest$outboundSchema` instead. */ - export const outboundSchema = RemoveSchemaAccessGroupRequest$outboundSchema; - /** @deprecated use `RemoveSchemaAccessGroupRequest$Outbound` instead. */ - export type Outbound = RemoveSchemaAccessGroupRequest$Outbound; -} - -export function removeSchemaAccessGroupRequestToJSON( - removeSchemaAccessGroupRequest: RemoveSchemaAccessGroupRequest, -): string { - return JSON.stringify( - RemoveSchemaAccessGroupRequest$outboundSchema.parse( - removeSchemaAccessGroupRequest, - ), - ); -} - -export function removeSchemaAccessGroupRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => RemoveSchemaAccessGroupRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'RemoveSchemaAccessGroupRequest' from JSON`, - ); -} - -/** @internal */ -export const RemoveSchemaAccessGroupResponse$inboundSchema: z.ZodType< - RemoveSchemaAccessGroupResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type RemoveSchemaAccessGroupResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - any?: any | null | undefined; -}; - -/** @internal */ -export const RemoveSchemaAccessGroupResponse$outboundSchema: z.ZodType< - RemoveSchemaAccessGroupResponse$Outbound, - z.ZodTypeDef, - RemoveSchemaAccessGroupResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace RemoveSchemaAccessGroupResponse$ { - /** @deprecated use `RemoveSchemaAccessGroupResponse$inboundSchema` instead. */ - export const inboundSchema = RemoveSchemaAccessGroupResponse$inboundSchema; - /** @deprecated use `RemoveSchemaAccessGroupResponse$outboundSchema` instead. */ - export const outboundSchema = RemoveSchemaAccessGroupResponse$outboundSchema; - /** @deprecated use `RemoveSchemaAccessGroupResponse$Outbound` instead. */ - export type Outbound = RemoveSchemaAccessGroupResponse$Outbound; -} - -export function removeSchemaAccessGroupResponseToJSON( - removeSchemaAccessGroupResponse: RemoveSchemaAccessGroupResponse, -): string { - return JSON.stringify( - RemoveSchemaAccessGroupResponse$outboundSchema.parse( - removeSchemaAccessGroupResponse, - ), - ); -} - -export function removeSchemaAccessGroupResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => RemoveSchemaAccessGroupResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'RemoveSchemaAccessGroupResponse' from JSON`, - ); -} diff --git a/src/models/operations/replacethemedocument.ts b/src/models/operations/replacethemedocument.ts deleted file mode 100644 index 86b88c9..0000000 --- a/src/models/operations/replacethemedocument.ts +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type ReplaceThemeDocumentRequestBody = { - document: string; -}; - -export type ReplaceThemeDocumentRequest = { - slug: string; - requestBody: ReplaceThemeDocumentRequestBody; -}; - -export type ReplaceThemeDocumentResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - any?: any | null | undefined; -}; - -/** @internal */ -export const ReplaceThemeDocumentRequestBody$inboundSchema: z.ZodType< - ReplaceThemeDocumentRequestBody, - z.ZodTypeDef, - unknown -> = z.object({ - document: z.string(), -}); - -/** @internal */ -export type ReplaceThemeDocumentRequestBody$Outbound = { - document: string; -}; - -/** @internal */ -export const ReplaceThemeDocumentRequestBody$outboundSchema: z.ZodType< - ReplaceThemeDocumentRequestBody$Outbound, - z.ZodTypeDef, - ReplaceThemeDocumentRequestBody -> = z.object({ - document: 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 ReplaceThemeDocumentRequestBody$ { - /** @deprecated use `ReplaceThemeDocumentRequestBody$inboundSchema` instead. */ - export const inboundSchema = ReplaceThemeDocumentRequestBody$inboundSchema; - /** @deprecated use `ReplaceThemeDocumentRequestBody$outboundSchema` instead. */ - export const outboundSchema = ReplaceThemeDocumentRequestBody$outboundSchema; - /** @deprecated use `ReplaceThemeDocumentRequestBody$Outbound` instead. */ - export type Outbound = ReplaceThemeDocumentRequestBody$Outbound; -} - -export function replaceThemeDocumentRequestBodyToJSON( - replaceThemeDocumentRequestBody: ReplaceThemeDocumentRequestBody, -): string { - return JSON.stringify( - ReplaceThemeDocumentRequestBody$outboundSchema.parse( - replaceThemeDocumentRequestBody, - ), - ); -} - -export function replaceThemeDocumentRequestBodyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ReplaceThemeDocumentRequestBody$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ReplaceThemeDocumentRequestBody' from JSON`, - ); -} - -/** @internal */ -export const ReplaceThemeDocumentRequest$inboundSchema: z.ZodType< - ReplaceThemeDocumentRequest, - z.ZodTypeDef, - unknown -> = z.object({ - slug: z.string(), - RequestBody: z.lazy(() => ReplaceThemeDocumentRequestBody$inboundSchema), -}).transform((v) => { - return remap$(v, { - "RequestBody": "requestBody", - }); -}); - -/** @internal */ -export type ReplaceThemeDocumentRequest$Outbound = { - slug: string; - RequestBody: ReplaceThemeDocumentRequestBody$Outbound; -}; - -/** @internal */ -export const ReplaceThemeDocumentRequest$outboundSchema: z.ZodType< - ReplaceThemeDocumentRequest$Outbound, - z.ZodTypeDef, - ReplaceThemeDocumentRequest -> = z.object({ - slug: z.string(), - requestBody: z.lazy(() => ReplaceThemeDocumentRequestBody$outboundSchema), -}).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 ReplaceThemeDocumentRequest$ { - /** @deprecated use `ReplaceThemeDocumentRequest$inboundSchema` instead. */ - export const inboundSchema = ReplaceThemeDocumentRequest$inboundSchema; - /** @deprecated use `ReplaceThemeDocumentRequest$outboundSchema` instead. */ - export const outboundSchema = ReplaceThemeDocumentRequest$outboundSchema; - /** @deprecated use `ReplaceThemeDocumentRequest$Outbound` instead. */ - export type Outbound = ReplaceThemeDocumentRequest$Outbound; -} - -export function replaceThemeDocumentRequestToJSON( - replaceThemeDocumentRequest: ReplaceThemeDocumentRequest, -): string { - return JSON.stringify( - ReplaceThemeDocumentRequest$outboundSchema.parse( - replaceThemeDocumentRequest, - ), - ); -} - -export function replaceThemeDocumentRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ReplaceThemeDocumentRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ReplaceThemeDocumentRequest' from JSON`, - ); -} - -/** @internal */ -export const ReplaceThemeDocumentResponse$inboundSchema: z.ZodType< - ReplaceThemeDocumentResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type ReplaceThemeDocumentResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - any?: any | null | undefined; -}; - -/** @internal */ -export const ReplaceThemeDocumentResponse$outboundSchema: z.ZodType< - ReplaceThemeDocumentResponse$Outbound, - z.ZodTypeDef, - ReplaceThemeDocumentResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace ReplaceThemeDocumentResponse$ { - /** @deprecated use `ReplaceThemeDocumentResponse$inboundSchema` instead. */ - export const inboundSchema = ReplaceThemeDocumentResponse$inboundSchema; - /** @deprecated use `ReplaceThemeDocumentResponse$outboundSchema` instead. */ - export const outboundSchema = ReplaceThemeDocumentResponse$outboundSchema; - /** @deprecated use `ReplaceThemeDocumentResponse$Outbound` instead. */ - export type Outbound = ReplaceThemeDocumentResponse$Outbound; -} - -export function replaceThemeDocumentResponseToJSON( - replaceThemeDocumentResponse: ReplaceThemeDocumentResponse, -): string { - return JSON.stringify( - ReplaceThemeDocumentResponse$outboundSchema.parse( - replaceThemeDocumentResponse, - ), - ); -} - -export function replaceThemeDocumentResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ReplaceThemeDocumentResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ReplaceThemeDocumentResponse' from JSON`, - ); -} diff --git a/src/models/operations/updateapidocument.ts b/src/models/operations/updateapidocument.ts deleted file mode 100644 index 5ea5d4b..0000000 --- a/src/models/operations/updateapidocument.ts +++ /dev/null @@ -1,229 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type UpdateApiDocumentRequestBody = { - title?: string | undefined; - description?: string | undefined; - isPrivate?: boolean | undefined; - ruleset?: string | undefined; -}; - -export type UpdateApiDocumentRequest = { - namespace: string; - slug: string; - requestBody: UpdateApiDocumentRequestBody; -}; - -export type UpdateApiDocumentResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - any?: any | null | undefined; -}; - -/** @internal */ -export const UpdateApiDocumentRequestBody$inboundSchema: z.ZodType< - UpdateApiDocumentRequestBody, - z.ZodTypeDef, - unknown -> = z.object({ - title: z.string().optional(), - description: z.string().optional(), - isPrivate: z.boolean().optional(), - ruleset: z.string().optional(), -}); - -/** @internal */ -export type UpdateApiDocumentRequestBody$Outbound = { - title?: string | undefined; - description?: string | undefined; - isPrivate?: boolean | undefined; - ruleset?: string | undefined; -}; - -/** @internal */ -export const UpdateApiDocumentRequestBody$outboundSchema: z.ZodType< - UpdateApiDocumentRequestBody$Outbound, - z.ZodTypeDef, - UpdateApiDocumentRequestBody -> = z.object({ - title: z.string().optional(), - description: z.string().optional(), - isPrivate: z.boolean().optional(), - ruleset: 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 UpdateApiDocumentRequestBody$ { - /** @deprecated use `UpdateApiDocumentRequestBody$inboundSchema` instead. */ - export const inboundSchema = UpdateApiDocumentRequestBody$inboundSchema; - /** @deprecated use `UpdateApiDocumentRequestBody$outboundSchema` instead. */ - export const outboundSchema = UpdateApiDocumentRequestBody$outboundSchema; - /** @deprecated use `UpdateApiDocumentRequestBody$Outbound` instead. */ - export type Outbound = UpdateApiDocumentRequestBody$Outbound; -} - -export function updateApiDocumentRequestBodyToJSON( - updateApiDocumentRequestBody: UpdateApiDocumentRequestBody, -): string { - return JSON.stringify( - UpdateApiDocumentRequestBody$outboundSchema.parse( - updateApiDocumentRequestBody, - ), - ); -} - -export function updateApiDocumentRequestBodyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => UpdateApiDocumentRequestBody$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'UpdateApiDocumentRequestBody' from JSON`, - ); -} - -/** @internal */ -export const UpdateApiDocumentRequest$inboundSchema: z.ZodType< - UpdateApiDocumentRequest, - z.ZodTypeDef, - unknown -> = z.object({ - namespace: z.string(), - slug: z.string(), - RequestBody: z.lazy(() => UpdateApiDocumentRequestBody$inboundSchema), -}).transform((v) => { - return remap$(v, { - "RequestBody": "requestBody", - }); -}); - -/** @internal */ -export type UpdateApiDocumentRequest$Outbound = { - namespace: string; - slug: string; - RequestBody: UpdateApiDocumentRequestBody$Outbound; -}; - -/** @internal */ -export const UpdateApiDocumentRequest$outboundSchema: z.ZodType< - UpdateApiDocumentRequest$Outbound, - z.ZodTypeDef, - UpdateApiDocumentRequest -> = z.object({ - namespace: z.string(), - slug: z.string(), - requestBody: z.lazy(() => UpdateApiDocumentRequestBody$outboundSchema), -}).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 UpdateApiDocumentRequest$ { - /** @deprecated use `UpdateApiDocumentRequest$inboundSchema` instead. */ - export const inboundSchema = UpdateApiDocumentRequest$inboundSchema; - /** @deprecated use `UpdateApiDocumentRequest$outboundSchema` instead. */ - export const outboundSchema = UpdateApiDocumentRequest$outboundSchema; - /** @deprecated use `UpdateApiDocumentRequest$Outbound` instead. */ - export type Outbound = UpdateApiDocumentRequest$Outbound; -} - -export function updateApiDocumentRequestToJSON( - updateApiDocumentRequest: UpdateApiDocumentRequest, -): string { - return JSON.stringify( - UpdateApiDocumentRequest$outboundSchema.parse(updateApiDocumentRequest), - ); -} - -export function updateApiDocumentRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => UpdateApiDocumentRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'UpdateApiDocumentRequest' from JSON`, - ); -} - -/** @internal */ -export const UpdateApiDocumentResponse$inboundSchema: z.ZodType< - UpdateApiDocumentResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type UpdateApiDocumentResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - any?: any | null | undefined; -}; - -/** @internal */ -export const UpdateApiDocumentResponse$outboundSchema: z.ZodType< - UpdateApiDocumentResponse$Outbound, - z.ZodTypeDef, - UpdateApiDocumentResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace UpdateApiDocumentResponse$ { - /** @deprecated use `UpdateApiDocumentResponse$inboundSchema` instead. */ - export const inboundSchema = UpdateApiDocumentResponse$inboundSchema; - /** @deprecated use `UpdateApiDocumentResponse$outboundSchema` instead. */ - export const outboundSchema = UpdateApiDocumentResponse$outboundSchema; - /** @deprecated use `UpdateApiDocumentResponse$Outbound` instead. */ - export type Outbound = UpdateApiDocumentResponse$Outbound; -} - -export function updateApiDocumentResponseToJSON( - updateApiDocumentResponse: UpdateApiDocumentResponse, -): string { - return JSON.stringify( - UpdateApiDocumentResponse$outboundSchema.parse(updateApiDocumentResponse), - ); -} - -export function updateApiDocumentResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => UpdateApiDocumentResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'UpdateApiDocumentResponse' from JSON`, - ); -} diff --git a/src/models/operations/updateapidocumentversion.ts b/src/models/operations/updateapidocumentversion.ts deleted file mode 100644 index c3ce3a3..0000000 --- a/src/models/operations/updateapidocumentversion.ts +++ /dev/null @@ -1,308 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type UpdateApiDocumentVersionRequestBody = { - document: string; - lastKnownVersionSha?: string | undefined; -}; - -export type UpdateApiDocumentVersionRequest = { - namespace: string; - slug: string; - semver: string; - requestBody: UpdateApiDocumentVersionRequestBody; -}; - -/** - * Default Response - */ -export type UpdateApiDocumentVersionResponseBody = { - jsonSha: string; - yamlSha: string; - versionSha: string; -}; - -export type UpdateApiDocumentVersionResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - object?: UpdateApiDocumentVersionResponseBody | undefined; -}; - -/** @internal */ -export const UpdateApiDocumentVersionRequestBody$inboundSchema: z.ZodType< - UpdateApiDocumentVersionRequestBody, - z.ZodTypeDef, - unknown -> = z.object({ - document: z.string(), - lastKnownVersionSha: z.string().optional(), -}); - -/** @internal */ -export type UpdateApiDocumentVersionRequestBody$Outbound = { - document: string; - lastKnownVersionSha?: string | undefined; -}; - -/** @internal */ -export const UpdateApiDocumentVersionRequestBody$outboundSchema: z.ZodType< - UpdateApiDocumentVersionRequestBody$Outbound, - z.ZodTypeDef, - UpdateApiDocumentVersionRequestBody -> = z.object({ - document: z.string(), - lastKnownVersionSha: 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 UpdateApiDocumentVersionRequestBody$ { - /** @deprecated use `UpdateApiDocumentVersionRequestBody$inboundSchema` instead. */ - export const inboundSchema = - UpdateApiDocumentVersionRequestBody$inboundSchema; - /** @deprecated use `UpdateApiDocumentVersionRequestBody$outboundSchema` instead. */ - export const outboundSchema = - UpdateApiDocumentVersionRequestBody$outboundSchema; - /** @deprecated use `UpdateApiDocumentVersionRequestBody$Outbound` instead. */ - export type Outbound = UpdateApiDocumentVersionRequestBody$Outbound; -} - -export function updateApiDocumentVersionRequestBodyToJSON( - updateApiDocumentVersionRequestBody: UpdateApiDocumentVersionRequestBody, -): string { - return JSON.stringify( - UpdateApiDocumentVersionRequestBody$outboundSchema.parse( - updateApiDocumentVersionRequestBody, - ), - ); -} - -export function updateApiDocumentVersionRequestBodyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => - UpdateApiDocumentVersionRequestBody$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'UpdateApiDocumentVersionRequestBody' from JSON`, - ); -} - -/** @internal */ -export const UpdateApiDocumentVersionRequest$inboundSchema: z.ZodType< - UpdateApiDocumentVersionRequest, - z.ZodTypeDef, - unknown -> = z.object({ - namespace: z.string(), - slug: z.string(), - semver: z.string(), - RequestBody: z.lazy(() => UpdateApiDocumentVersionRequestBody$inboundSchema), -}).transform((v) => { - return remap$(v, { - "RequestBody": "requestBody", - }); -}); - -/** @internal */ -export type UpdateApiDocumentVersionRequest$Outbound = { - namespace: string; - slug: string; - semver: string; - RequestBody: UpdateApiDocumentVersionRequestBody$Outbound; -}; - -/** @internal */ -export const UpdateApiDocumentVersionRequest$outboundSchema: z.ZodType< - UpdateApiDocumentVersionRequest$Outbound, - z.ZodTypeDef, - UpdateApiDocumentVersionRequest -> = z.object({ - namespace: z.string(), - slug: z.string(), - semver: z.string(), - requestBody: z.lazy(() => UpdateApiDocumentVersionRequestBody$outboundSchema), -}).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 UpdateApiDocumentVersionRequest$ { - /** @deprecated use `UpdateApiDocumentVersionRequest$inboundSchema` instead. */ - export const inboundSchema = UpdateApiDocumentVersionRequest$inboundSchema; - /** @deprecated use `UpdateApiDocumentVersionRequest$outboundSchema` instead. */ - export const outboundSchema = UpdateApiDocumentVersionRequest$outboundSchema; - /** @deprecated use `UpdateApiDocumentVersionRequest$Outbound` instead. */ - export type Outbound = UpdateApiDocumentVersionRequest$Outbound; -} - -export function updateApiDocumentVersionRequestToJSON( - updateApiDocumentVersionRequest: UpdateApiDocumentVersionRequest, -): string { - return JSON.stringify( - UpdateApiDocumentVersionRequest$outboundSchema.parse( - updateApiDocumentVersionRequest, - ), - ); -} - -export function updateApiDocumentVersionRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => UpdateApiDocumentVersionRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'UpdateApiDocumentVersionRequest' from JSON`, - ); -} - -/** @internal */ -export const UpdateApiDocumentVersionResponseBody$inboundSchema: z.ZodType< - UpdateApiDocumentVersionResponseBody, - z.ZodTypeDef, - unknown -> = z.object({ - jsonSha: z.string(), - yamlSha: z.string(), - versionSha: z.string(), -}); - -/** @internal */ -export type UpdateApiDocumentVersionResponseBody$Outbound = { - jsonSha: string; - yamlSha: string; - versionSha: string; -}; - -/** @internal */ -export const UpdateApiDocumentVersionResponseBody$outboundSchema: z.ZodType< - UpdateApiDocumentVersionResponseBody$Outbound, - z.ZodTypeDef, - UpdateApiDocumentVersionResponseBody -> = z.object({ - jsonSha: z.string(), - yamlSha: z.string(), - versionSha: 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 UpdateApiDocumentVersionResponseBody$ { - /** @deprecated use `UpdateApiDocumentVersionResponseBody$inboundSchema` instead. */ - export const inboundSchema = - UpdateApiDocumentVersionResponseBody$inboundSchema; - /** @deprecated use `UpdateApiDocumentVersionResponseBody$outboundSchema` instead. */ - export const outboundSchema = - UpdateApiDocumentVersionResponseBody$outboundSchema; - /** @deprecated use `UpdateApiDocumentVersionResponseBody$Outbound` instead. */ - export type Outbound = UpdateApiDocumentVersionResponseBody$Outbound; -} - -export function updateApiDocumentVersionResponseBodyToJSON( - updateApiDocumentVersionResponseBody: UpdateApiDocumentVersionResponseBody, -): string { - return JSON.stringify( - UpdateApiDocumentVersionResponseBody$outboundSchema.parse( - updateApiDocumentVersionResponseBody, - ), - ); -} - -export function updateApiDocumentVersionResponseBodyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => - UpdateApiDocumentVersionResponseBody$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'UpdateApiDocumentVersionResponseBody' from JSON`, - ); -} - -/** @internal */ -export const UpdateApiDocumentVersionResponse$inboundSchema: z.ZodType< - UpdateApiDocumentVersionResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - object: z.lazy(() => UpdateApiDocumentVersionResponseBody$inboundSchema) - .optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type UpdateApiDocumentVersionResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - object?: UpdateApiDocumentVersionResponseBody$Outbound | undefined; -}; - -/** @internal */ -export const UpdateApiDocumentVersionResponse$outboundSchema: z.ZodType< - UpdateApiDocumentVersionResponse$Outbound, - z.ZodTypeDef, - UpdateApiDocumentVersionResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - object: z.lazy(() => UpdateApiDocumentVersionResponseBody$outboundSchema) - .optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace UpdateApiDocumentVersionResponse$ { - /** @deprecated use `UpdateApiDocumentVersionResponse$inboundSchema` instead. */ - export const inboundSchema = UpdateApiDocumentVersionResponse$inboundSchema; - /** @deprecated use `UpdateApiDocumentVersionResponse$outboundSchema` instead. */ - export const outboundSchema = UpdateApiDocumentVersionResponse$outboundSchema; - /** @deprecated use `UpdateApiDocumentVersionResponse$Outbound` instead. */ - export type Outbound = UpdateApiDocumentVersionResponse$Outbound; -} - -export function updateApiDocumentVersionResponseToJSON( - updateApiDocumentVersionResponse: UpdateApiDocumentVersionResponse, -): string { - return JSON.stringify( - UpdateApiDocumentVersionResponse$outboundSchema.parse( - updateApiDocumentVersionResponse, - ), - ); -} - -export function updateApiDocumentVersionResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => UpdateApiDocumentVersionResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'UpdateApiDocumentVersionResponse' from JSON`, - ); -} diff --git a/src/models/operations/updateloginportal.ts b/src/models/operations/updateloginportal.ts deleted file mode 100644 index 92f9e99..0000000 --- a/src/models/operations/updateloginportal.ts +++ /dev/null @@ -1,213 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type UpdateLoginPortalRequestBody = { - title?: string | undefined; -}; - -export type UpdateLoginPortalRequest = { - slug: string; - requestBody: UpdateLoginPortalRequestBody; -}; - -export type UpdateLoginPortalResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - any?: any | null | undefined; -}; - -/** @internal */ -export const UpdateLoginPortalRequestBody$inboundSchema: z.ZodType< - UpdateLoginPortalRequestBody, - z.ZodTypeDef, - unknown -> = z.object({ - title: z.string().optional(), -}); - -/** @internal */ -export type UpdateLoginPortalRequestBody$Outbound = { - title?: string | undefined; -}; - -/** @internal */ -export const UpdateLoginPortalRequestBody$outboundSchema: z.ZodType< - UpdateLoginPortalRequestBody$Outbound, - z.ZodTypeDef, - UpdateLoginPortalRequestBody -> = z.object({ - title: 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 UpdateLoginPortalRequestBody$ { - /** @deprecated use `UpdateLoginPortalRequestBody$inboundSchema` instead. */ - export const inboundSchema = UpdateLoginPortalRequestBody$inboundSchema; - /** @deprecated use `UpdateLoginPortalRequestBody$outboundSchema` instead. */ - export const outboundSchema = UpdateLoginPortalRequestBody$outboundSchema; - /** @deprecated use `UpdateLoginPortalRequestBody$Outbound` instead. */ - export type Outbound = UpdateLoginPortalRequestBody$Outbound; -} - -export function updateLoginPortalRequestBodyToJSON( - updateLoginPortalRequestBody: UpdateLoginPortalRequestBody, -): string { - return JSON.stringify( - UpdateLoginPortalRequestBody$outboundSchema.parse( - updateLoginPortalRequestBody, - ), - ); -} - -export function updateLoginPortalRequestBodyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => UpdateLoginPortalRequestBody$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'UpdateLoginPortalRequestBody' from JSON`, - ); -} - -/** @internal */ -export const UpdateLoginPortalRequest$inboundSchema: z.ZodType< - UpdateLoginPortalRequest, - z.ZodTypeDef, - unknown -> = z.object({ - slug: z.string(), - RequestBody: z.lazy(() => UpdateLoginPortalRequestBody$inboundSchema), -}).transform((v) => { - return remap$(v, { - "RequestBody": "requestBody", - }); -}); - -/** @internal */ -export type UpdateLoginPortalRequest$Outbound = { - slug: string; - RequestBody: UpdateLoginPortalRequestBody$Outbound; -}; - -/** @internal */ -export const UpdateLoginPortalRequest$outboundSchema: z.ZodType< - UpdateLoginPortalRequest$Outbound, - z.ZodTypeDef, - UpdateLoginPortalRequest -> = z.object({ - slug: z.string(), - requestBody: z.lazy(() => UpdateLoginPortalRequestBody$outboundSchema), -}).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 UpdateLoginPortalRequest$ { - /** @deprecated use `UpdateLoginPortalRequest$inboundSchema` instead. */ - export const inboundSchema = UpdateLoginPortalRequest$inboundSchema; - /** @deprecated use `UpdateLoginPortalRequest$outboundSchema` instead. */ - export const outboundSchema = UpdateLoginPortalRequest$outboundSchema; - /** @deprecated use `UpdateLoginPortalRequest$Outbound` instead. */ - export type Outbound = UpdateLoginPortalRequest$Outbound; -} - -export function updateLoginPortalRequestToJSON( - updateLoginPortalRequest: UpdateLoginPortalRequest, -): string { - return JSON.stringify( - UpdateLoginPortalRequest$outboundSchema.parse(updateLoginPortalRequest), - ); -} - -export function updateLoginPortalRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => UpdateLoginPortalRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'UpdateLoginPortalRequest' from JSON`, - ); -} - -/** @internal */ -export const UpdateLoginPortalResponse$inboundSchema: z.ZodType< - UpdateLoginPortalResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type UpdateLoginPortalResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - any?: any | null | undefined; -}; - -/** @internal */ -export const UpdateLoginPortalResponse$outboundSchema: z.ZodType< - UpdateLoginPortalResponse$Outbound, - z.ZodTypeDef, - UpdateLoginPortalResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace UpdateLoginPortalResponse$ { - /** @deprecated use `UpdateLoginPortalResponse$inboundSchema` instead. */ - export const inboundSchema = UpdateLoginPortalResponse$inboundSchema; - /** @deprecated use `UpdateLoginPortalResponse$outboundSchema` instead. */ - export const outboundSchema = UpdateLoginPortalResponse$outboundSchema; - /** @deprecated use `UpdateLoginPortalResponse$Outbound` instead. */ - export type Outbound = UpdateLoginPortalResponse$Outbound; -} - -export function updateLoginPortalResponseToJSON( - updateLoginPortalResponse: UpdateLoginPortalResponse, -): string { - return JSON.stringify( - UpdateLoginPortalResponse$outboundSchema.parse(updateLoginPortalResponse), - ); -} - -export function updateLoginPortalResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => UpdateLoginPortalResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'UpdateLoginPortalResponse' from JSON`, - ); -} diff --git a/src/models/operations/updateruleset.ts b/src/models/operations/updateruleset.ts deleted file mode 100644 index cca700e..0000000 --- a/src/models/operations/updateruleset.ts +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type UpdateRulesetRequestBody = { - namespace?: string | undefined; - slug?: string | undefined; - title?: string | undefined; - description?: string | undefined; - isPrivate?: boolean | undefined; -}; - -export type UpdateRulesetRequest = { - namespace: string; - slug: string; - requestBody: UpdateRulesetRequestBody; -}; - -export type UpdateRulesetResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - any?: any | null | undefined; -}; - -/** @internal */ -export const UpdateRulesetRequestBody$inboundSchema: z.ZodType< - UpdateRulesetRequestBody, - z.ZodTypeDef, - unknown -> = z.object({ - namespace: z.string().optional(), - slug: z.string().optional(), - title: z.string().optional(), - description: z.string().optional(), - isPrivate: z.boolean().optional(), -}); - -/** @internal */ -export type UpdateRulesetRequestBody$Outbound = { - namespace?: string | undefined; - slug?: string | undefined; - title?: string | undefined; - description?: string | undefined; - isPrivate?: boolean | undefined; -}; - -/** @internal */ -export const UpdateRulesetRequestBody$outboundSchema: z.ZodType< - UpdateRulesetRequestBody$Outbound, - z.ZodTypeDef, - UpdateRulesetRequestBody -> = z.object({ - namespace: z.string().optional(), - slug: z.string().optional(), - title: z.string().optional(), - description: z.string().optional(), - isPrivate: 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 UpdateRulesetRequestBody$ { - /** @deprecated use `UpdateRulesetRequestBody$inboundSchema` instead. */ - export const inboundSchema = UpdateRulesetRequestBody$inboundSchema; - /** @deprecated use `UpdateRulesetRequestBody$outboundSchema` instead. */ - export const outboundSchema = UpdateRulesetRequestBody$outboundSchema; - /** @deprecated use `UpdateRulesetRequestBody$Outbound` instead. */ - export type Outbound = UpdateRulesetRequestBody$Outbound; -} - -export function updateRulesetRequestBodyToJSON( - updateRulesetRequestBody: UpdateRulesetRequestBody, -): string { - return JSON.stringify( - UpdateRulesetRequestBody$outboundSchema.parse(updateRulesetRequestBody), - ); -} - -export function updateRulesetRequestBodyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => UpdateRulesetRequestBody$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'UpdateRulesetRequestBody' from JSON`, - ); -} - -/** @internal */ -export const UpdateRulesetRequest$inboundSchema: z.ZodType< - UpdateRulesetRequest, - z.ZodTypeDef, - unknown -> = z.object({ - namespace: z.string(), - slug: z.string(), - RequestBody: z.lazy(() => UpdateRulesetRequestBody$inboundSchema), -}).transform((v) => { - return remap$(v, { - "RequestBody": "requestBody", - }); -}); - -/** @internal */ -export type UpdateRulesetRequest$Outbound = { - namespace: string; - slug: string; - RequestBody: UpdateRulesetRequestBody$Outbound; -}; - -/** @internal */ -export const UpdateRulesetRequest$outboundSchema: z.ZodType< - UpdateRulesetRequest$Outbound, - z.ZodTypeDef, - UpdateRulesetRequest -> = z.object({ - namespace: z.string(), - slug: z.string(), - requestBody: z.lazy(() => UpdateRulesetRequestBody$outboundSchema), -}).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 UpdateRulesetRequest$ { - /** @deprecated use `UpdateRulesetRequest$inboundSchema` instead. */ - export const inboundSchema = UpdateRulesetRequest$inboundSchema; - /** @deprecated use `UpdateRulesetRequest$outboundSchema` instead. */ - export const outboundSchema = UpdateRulesetRequest$outboundSchema; - /** @deprecated use `UpdateRulesetRequest$Outbound` instead. */ - export type Outbound = UpdateRulesetRequest$Outbound; -} - -export function updateRulesetRequestToJSON( - updateRulesetRequest: UpdateRulesetRequest, -): string { - return JSON.stringify( - UpdateRulesetRequest$outboundSchema.parse(updateRulesetRequest), - ); -} - -export function updateRulesetRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => UpdateRulesetRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'UpdateRulesetRequest' from JSON`, - ); -} - -/** @internal */ -export const UpdateRulesetResponse$inboundSchema: z.ZodType< - UpdateRulesetResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type UpdateRulesetResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - any?: any | null | undefined; -}; - -/** @internal */ -export const UpdateRulesetResponse$outboundSchema: z.ZodType< - UpdateRulesetResponse$Outbound, - z.ZodTypeDef, - UpdateRulesetResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace UpdateRulesetResponse$ { - /** @deprecated use `UpdateRulesetResponse$inboundSchema` instead. */ - export const inboundSchema = UpdateRulesetResponse$inboundSchema; - /** @deprecated use `UpdateRulesetResponse$outboundSchema` instead. */ - export const outboundSchema = UpdateRulesetResponse$outboundSchema; - /** @deprecated use `UpdateRulesetResponse$Outbound` instead. */ - export type Outbound = UpdateRulesetResponse$Outbound; -} - -export function updateRulesetResponseToJSON( - updateRulesetResponse: UpdateRulesetResponse, -): string { - return JSON.stringify( - UpdateRulesetResponse$outboundSchema.parse(updateRulesetResponse), - ); -} - -export function updateRulesetResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => UpdateRulesetResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'UpdateRulesetResponse' from JSON`, - ); -} diff --git a/src/models/operations/updateschema.ts b/src/models/operations/updateschema.ts deleted file mode 100644 index 9e7ab80..0000000 --- a/src/models/operations/updateschema.ts +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type UpdateSchemaRequestBody = { - title?: string | undefined; - description?: string | undefined; - isPrivate?: boolean | undefined; -}; - -export type UpdateSchemaRequest = { - namespace: string; - slug: string; - requestBody: UpdateSchemaRequestBody; -}; - -export type UpdateSchemaResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - any?: any | null | undefined; -}; - -/** @internal */ -export const UpdateSchemaRequestBody$inboundSchema: z.ZodType< - UpdateSchemaRequestBody, - z.ZodTypeDef, - unknown -> = z.object({ - title: z.string().optional(), - description: z.string().optional(), - isPrivate: z.boolean().optional(), -}); - -/** @internal */ -export type UpdateSchemaRequestBody$Outbound = { - title?: string | undefined; - description?: string | undefined; - isPrivate?: boolean | undefined; -}; - -/** @internal */ -export const UpdateSchemaRequestBody$outboundSchema: z.ZodType< - UpdateSchemaRequestBody$Outbound, - z.ZodTypeDef, - UpdateSchemaRequestBody -> = z.object({ - title: z.string().optional(), - description: z.string().optional(), - isPrivate: 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 UpdateSchemaRequestBody$ { - /** @deprecated use `UpdateSchemaRequestBody$inboundSchema` instead. */ - export const inboundSchema = UpdateSchemaRequestBody$inboundSchema; - /** @deprecated use `UpdateSchemaRequestBody$outboundSchema` instead. */ - export const outboundSchema = UpdateSchemaRequestBody$outboundSchema; - /** @deprecated use `UpdateSchemaRequestBody$Outbound` instead. */ - export type Outbound = UpdateSchemaRequestBody$Outbound; -} - -export function updateSchemaRequestBodyToJSON( - updateSchemaRequestBody: UpdateSchemaRequestBody, -): string { - return JSON.stringify( - UpdateSchemaRequestBody$outboundSchema.parse(updateSchemaRequestBody), - ); -} - -export function updateSchemaRequestBodyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => UpdateSchemaRequestBody$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'UpdateSchemaRequestBody' from JSON`, - ); -} - -/** @internal */ -export const UpdateSchemaRequest$inboundSchema: z.ZodType< - UpdateSchemaRequest, - z.ZodTypeDef, - unknown -> = z.object({ - namespace: z.string(), - slug: z.string(), - RequestBody: z.lazy(() => UpdateSchemaRequestBody$inboundSchema), -}).transform((v) => { - return remap$(v, { - "RequestBody": "requestBody", - }); -}); - -/** @internal */ -export type UpdateSchemaRequest$Outbound = { - namespace: string; - slug: string; - RequestBody: UpdateSchemaRequestBody$Outbound; -}; - -/** @internal */ -export const UpdateSchemaRequest$outboundSchema: z.ZodType< - UpdateSchemaRequest$Outbound, - z.ZodTypeDef, - UpdateSchemaRequest -> = z.object({ - namespace: z.string(), - slug: z.string(), - requestBody: z.lazy(() => UpdateSchemaRequestBody$outboundSchema), -}).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 UpdateSchemaRequest$ { - /** @deprecated use `UpdateSchemaRequest$inboundSchema` instead. */ - export const inboundSchema = UpdateSchemaRequest$inboundSchema; - /** @deprecated use `UpdateSchemaRequest$outboundSchema` instead. */ - export const outboundSchema = UpdateSchemaRequest$outboundSchema; - /** @deprecated use `UpdateSchemaRequest$Outbound` instead. */ - export type Outbound = UpdateSchemaRequest$Outbound; -} - -export function updateSchemaRequestToJSON( - updateSchemaRequest: UpdateSchemaRequest, -): string { - return JSON.stringify( - UpdateSchemaRequest$outboundSchema.parse(updateSchemaRequest), - ); -} - -export function updateSchemaRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => UpdateSchemaRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'UpdateSchemaRequest' from JSON`, - ); -} - -/** @internal */ -export const UpdateSchemaResponse$inboundSchema: z.ZodType< - UpdateSchemaResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type UpdateSchemaResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - any?: any | null | undefined; -}; - -/** @internal */ -export const UpdateSchemaResponse$outboundSchema: z.ZodType< - UpdateSchemaResponse$Outbound, - z.ZodTypeDef, - UpdateSchemaResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace UpdateSchemaResponse$ { - /** @deprecated use `UpdateSchemaResponse$inboundSchema` instead. */ - export const inboundSchema = UpdateSchemaResponse$inboundSchema; - /** @deprecated use `UpdateSchemaResponse$outboundSchema` instead. */ - export const outboundSchema = UpdateSchemaResponse$outboundSchema; - /** @deprecated use `UpdateSchemaResponse$Outbound` instead. */ - export type Outbound = UpdateSchemaResponse$Outbound; -} - -export function updateSchemaResponseToJSON( - updateSchemaResponse: UpdateSchemaResponse, -): string { - return JSON.stringify( - UpdateSchemaResponse$outboundSchema.parse(updateSchemaResponse), - ); -} - -export function updateSchemaResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => UpdateSchemaResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'UpdateSchemaResponse' from JSON`, - ); -} diff --git a/src/models/operations/updatetheme.ts b/src/models/operations/updatetheme.ts deleted file mode 100644 index 50aca87..0000000 --- a/src/models/operations/updatetheme.ts +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { remap as remap$ } from "../../lib/primitives.js"; -import { safeParse } from "../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import * as components from "../components/index.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type UpdateThemeRequestBody = { - name?: string | undefined; - description?: string | undefined; -}; - -export type UpdateThemeRequest = { - slug: string; - requestBody: UpdateThemeRequestBody; -}; - -export type UpdateThemeResponse = { - httpMeta: components.HTTPMetadata; - /** - * Default Response - */ - any?: any | null | undefined; -}; - -/** @internal */ -export const UpdateThemeRequestBody$inboundSchema: z.ZodType< - UpdateThemeRequestBody, - z.ZodTypeDef, - unknown -> = z.object({ - name: z.string().optional(), - description: z.string().optional(), -}); - -/** @internal */ -export type UpdateThemeRequestBody$Outbound = { - name?: string | undefined; - description?: string | undefined; -}; - -/** @internal */ -export const UpdateThemeRequestBody$outboundSchema: z.ZodType< - UpdateThemeRequestBody$Outbound, - z.ZodTypeDef, - UpdateThemeRequestBody -> = z.object({ - name: z.string().optional(), - description: 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 UpdateThemeRequestBody$ { - /** @deprecated use `UpdateThemeRequestBody$inboundSchema` instead. */ - export const inboundSchema = UpdateThemeRequestBody$inboundSchema; - /** @deprecated use `UpdateThemeRequestBody$outboundSchema` instead. */ - export const outboundSchema = UpdateThemeRequestBody$outboundSchema; - /** @deprecated use `UpdateThemeRequestBody$Outbound` instead. */ - export type Outbound = UpdateThemeRequestBody$Outbound; -} - -export function updateThemeRequestBodyToJSON( - updateThemeRequestBody: UpdateThemeRequestBody, -): string { - return JSON.stringify( - UpdateThemeRequestBody$outboundSchema.parse(updateThemeRequestBody), - ); -} - -export function updateThemeRequestBodyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => UpdateThemeRequestBody$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'UpdateThemeRequestBody' from JSON`, - ); -} - -/** @internal */ -export const UpdateThemeRequest$inboundSchema: z.ZodType< - UpdateThemeRequest, - z.ZodTypeDef, - unknown -> = z.object({ - slug: z.string(), - RequestBody: z.lazy(() => UpdateThemeRequestBody$inboundSchema), -}).transform((v) => { - return remap$(v, { - "RequestBody": "requestBody", - }); -}); - -/** @internal */ -export type UpdateThemeRequest$Outbound = { - slug: string; - RequestBody: UpdateThemeRequestBody$Outbound; -}; - -/** @internal */ -export const UpdateThemeRequest$outboundSchema: z.ZodType< - UpdateThemeRequest$Outbound, - z.ZodTypeDef, - UpdateThemeRequest -> = z.object({ - slug: z.string(), - requestBody: z.lazy(() => UpdateThemeRequestBody$outboundSchema), -}).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 UpdateThemeRequest$ { - /** @deprecated use `UpdateThemeRequest$inboundSchema` instead. */ - export const inboundSchema = UpdateThemeRequest$inboundSchema; - /** @deprecated use `UpdateThemeRequest$outboundSchema` instead. */ - export const outboundSchema = UpdateThemeRequest$outboundSchema; - /** @deprecated use `UpdateThemeRequest$Outbound` instead. */ - export type Outbound = UpdateThemeRequest$Outbound; -} - -export function updateThemeRequestToJSON( - updateThemeRequest: UpdateThemeRequest, -): string { - return JSON.stringify( - UpdateThemeRequest$outboundSchema.parse(updateThemeRequest), - ); -} - -export function updateThemeRequestFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => UpdateThemeRequest$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'UpdateThemeRequest' from JSON`, - ); -} - -/** @internal */ -export const UpdateThemeResponse$inboundSchema: z.ZodType< - UpdateThemeResponse, - z.ZodTypeDef, - unknown -> = z.object({ - HttpMeta: components.HTTPMetadata$inboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - "HttpMeta": "httpMeta", - }); -}); - -/** @internal */ -export type UpdateThemeResponse$Outbound = { - HttpMeta: components.HTTPMetadata$Outbound; - any?: any | null | undefined; -}; - -/** @internal */ -export const UpdateThemeResponse$outboundSchema: z.ZodType< - UpdateThemeResponse$Outbound, - z.ZodTypeDef, - UpdateThemeResponse -> = z.object({ - httpMeta: components.HTTPMetadata$outboundSchema, - any: z.nullable(z.any()).optional(), -}).transform((v) => { - return remap$(v, { - httpMeta: "HttpMeta", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace UpdateThemeResponse$ { - /** @deprecated use `UpdateThemeResponse$inboundSchema` instead. */ - export const inboundSchema = UpdateThemeResponse$inboundSchema; - /** @deprecated use `UpdateThemeResponse$outboundSchema` instead. */ - export const outboundSchema = UpdateThemeResponse$outboundSchema; - /** @deprecated use `UpdateThemeResponse$Outbound` instead. */ - export type Outbound = UpdateThemeResponse$Outbound; -} - -export function updateThemeResponseToJSON( - updateThemeResponse: UpdateThemeResponse, -): string { - return JSON.stringify( - UpdateThemeResponse$outboundSchema.parse(updateThemeResponse), - ); -} - -export function updateThemeResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => UpdateThemeResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'UpdateThemeResponse' from JSON`, - ); -} diff --git a/src/resource.ts b/src/resource.ts new file mode 100644 index 0000000..804965b --- /dev/null +++ b/src/resource.ts @@ -0,0 +1,11 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +import type { ScalarApi } from './client.js'; + +export class APIResource { + protected _client: ScalarApi; + + constructor(client: ScalarApi) { + this._client = client; + } +} diff --git a/src/resources/authentication.ts b/src/resources/authentication.ts new file mode 100644 index 0000000..3751dfd --- /dev/null +++ b/src/resources/authentication.ts @@ -0,0 +1,159 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +import { APIResource } from "../resource"; +import { APIPromise } from "../api-promise"; +import type { RequestOptions } from "../internal/request-options"; + +export class AuthenticationResource extends APIResource { + /** + * Exchange an API key for an access token. + */ + exchangePersonalToken(body: AuthenticationExchangePersonalTokenParams, options?: RequestOptions): APIPromise { + return this._client.post("/v1/auth/exchange", { body: body, ...options }); + } + /** + * Get the authenticated user, including their available teams and theme. + */ + listCurrentUser(options?: RequestOptions): APIPromise { + return this._client.get("/v1/auth/me", options); + } +} + +/** + * Bad request error response. + */ +export interface Value400 { + message: string; + code: string; +} + +/** + * Unauthorized error response. + */ +export interface Value401 { + message: string; + code: string; +} + +/** + * Forbidden error response. + */ +export interface Value403 { + message: string; + code: string; +} + +/** + * Not found error response. + */ +export interface Value404 { + message: string; + code: string; +} + +/** + * Validation error response. + */ +export interface Value422 { + message: string; + code: string; +} + +/** + * Internal server error response. + */ +export interface Value500 { + message: string; + code: string; +} + +/** + * Authenticated user profile. + */ +export interface User { + /** + * Unique Nano ID identifier. + */ + uid: Nanoid; + /** + * Unix timestamp in milliseconds. + */ + createdAt: Timestamp; + /** + * Unix timestamp in milliseconds. + */ + updatedAt: Timestamp; + /** + * Email address. + */ + email: Email; + /** + * Currently active team ID. + */ + activeTeamId: string | null; + /** + * Whether the user has connected GitHub. + */ + hasGithub: boolean; + /** + * Teams available to the user. + */ + teams: Array; + /** + * Theme identifier or theme settings. + */ + theme?: string; +} + +/** + * Unique Nano ID identifier. + */ +export type Nanoid = string; + +/** + * Unix timestamp in milliseconds. + */ +export type Timestamp = number; + +/** + * Email address. + */ +export type Email = string; + +/** + * Team summary. + */ +export interface TeamSummary { + /** + * Unique Nano ID identifier. + */ + uid: Nanoid; + /** + * Team display name. + */ + name: TeamName; + /** + * Team image URL. + */ + imageUri?: TeamImage; +} + +/** + * Team display name. + */ +export type TeamName = string; + +/** + * Team image URL. + */ +export type TeamImage = string; + +export interface AuthenticationExchangePersonalTokenParams { + /** + * Personal access token to exchange. + */ + personalToken: string; +} + +export type AuthenticationExchangePersonalTokenResponse = { accessToken: string }; + diff --git a/src/resources/index.ts b/src/resources/index.ts new file mode 100644 index 0000000..5feca81 --- /dev/null +++ b/src/resources/index.ts @@ -0,0 +1,11 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +export { RegistryResource } from "./registry"; +export { SchemaResource } from "./schemas"; +export { LoginPortalResource } from "./login-portals"; +export { RuleResource } from "./rules"; +export { ThemeResource } from "./themes"; +export { TeamResource } from "./teams"; +export { ScalarDocResource } from "./scalar-docs"; +export { NamespaceResource } from "./namespaces"; +export { AuthenticationResource } from "./authentication"; diff --git a/src/resources/login-portals.ts b/src/resources/login-portals.ts new file mode 100644 index 0000000..e20e761 --- /dev/null +++ b/src/resources/login-portals.ts @@ -0,0 +1,247 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +import { APIResource } from "../resource"; +import { APIPromise } from "../api-promise"; +import type { RequestOptions } from "../internal/request-options"; +import { path as __scalarPath } from "../internal/utils/path"; + +export class LoginPortalResource extends APIResource { + /** + * Get a login portal by slug. + */ + loginPortals(slug: string, options?: RequestOptions): APIPromise { + return this._client.get(__scalarPath`/v1/login-portals/${slug}`, options); + } + /** + * Delete a login portal. + */ + loginPortals3(slug: string, options?: RequestOptions): APIPromise { + return this._client.delete(__scalarPath`/v1/login-portals/${slug}`, options); + } + /** + * Update metadata for a login portal. + */ + loginPortals2(slug: string, body: LoginPortals2Params, options?: RequestOptions): APIPromise { + return this._client.patch(__scalarPath`/v1/login-portals/${slug}`, { body: body, ...options }); + } + /** + * List all login portals for the current team. + */ + loginPortals5(options?: RequestOptions): APIPromise { + return this._client.get("/v1/login-portals", options); + } + /** + * Create a login portal for the current team. + */ + loginPortals4(body: LoginPortals4Params, options?: RequestOptions): APIPromise { + return this._client.post("/v1/login-portals", { body: body, ...options }); + } +} + +/** + * Login portal email appearance settings. + */ +export interface LoginPortalEmail { + /** + * Logo image URL or data URI. + */ + logo: string; + /** + * Rendered logo size. + */ + logoSize: string; + /** + * Call-to-action button text. + */ + buttonText: string; + message: string; + title: string; + /** + * Primary foreground color. + */ + mainColor: string; + /** + * Primary background color. + */ + mainBackground: string; + /** + * Card foreground color. + */ + cardColor: string; + /** + * Card background color. + */ + cardBackground: string; + /** + * Button foreground color. + */ + buttonColor: string; + /** + * Button background color. + */ + buttonBackground: string; +} + +/** + * Login portal page appearance and content settings. + */ +export interface LoginPortalPage { + title: string; + description: string; + /** + * Custom HTML inserted into the page head. + */ + head: string; + /** + * Custom script content for the page. + */ + script: string; + /** + * Theme identifier or theme settings. + */ + theme: string; + /** + * Company name shown on the page. + */ + companyName: string; + /** + * Logo image URL or data URI. + */ + logo: string; + /** + * URL the logo links to. + */ + logoURL: string; + /** + * Favicon URL. + */ + favicon: string; + /** + * Terms of service URL. + */ + termsLink: string; + /** + * Privacy policy URL. + */ + privacyLink: string; + /** + * Title shown above the form. + */ + formTitle: string; + /** + * Description shown above the form. + */ + formDescription: string; + /** + * Image shown with the form. + */ + formImage: string; +} + +/** + * Bad request error response. + */ +export interface Value400 { + message: string; + code: string; +} + +/** + * Unauthorized error response. + */ +export interface Value401 { + message: string; + code: string; +} + +/** + * Forbidden error response. + */ +export interface Value403 { + message: string; + code: string; +} + +/** + * Not found error response. + */ +export interface Value404 { + message: string; + code: string; +} + +/** + * Validation error response. + */ +export interface Value422 { + message: string; + code: string; +} + +/** + * Internal server error response. + */ +export interface Value500 { + message: string; + code: string; +} + +/** + * Login portal summary. + */ +export interface LoginPortal { + /** + * Unique Nano ID identifier. + */ + uid: Nanoid; + title: string; + /** + * URL-safe slug identifier. + */ + slug: Slug; +} + +/** + * Unique Nano ID identifier. + */ +export type Nanoid = string; + +/** + * URL-safe slug identifier. + */ +export type Slug = string; + +/** + * Object UID wrapper. + */ +export interface Uid { + /** + * Unique Nano ID identifier. + */ + uid: Nanoid; +} + +export type LoginPortalsResponse = { uid: string; title: string; slug: string; email: LoginPortalEmail; page: LoginPortalPage }; + +export interface LoginPortals2Params { + title?: string; +} + +export type LoginPortals5Response = Array; + +export interface LoginPortals4Params { + title: string; + /** + * URL-safe resource slug. + */ + slug: string; + /** + * Login portal email appearance settings. + */ + email: LoginPortalEmail; + /** + * Login portal page appearance and content settings. + */ + page: LoginPortalPage; +} + diff --git a/src/resources/namespaces.ts b/src/resources/namespaces.ts new file mode 100644 index 0000000..e94ce62 --- /dev/null +++ b/src/resources/namespaces.ts @@ -0,0 +1,65 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +import { APIResource } from "../resource"; +import { APIPromise } from "../api-promise"; +import type { RequestOptions } from "../internal/request-options"; + +export class NamespaceResource extends APIResource { + /** + * Get all namespaces for the current team + */ + list(options?: RequestOptions): APIPromise { + return this._client.get("/v1/namespaces", options); + } +} + +/** + * Bad request error response. + */ +export interface Value400 { + message: string; + code: string; +} + +/** + * Unauthorized error response. + */ +export interface Value401 { + message: string; + code: string; +} + +/** + * Forbidden error response. + */ +export interface Value403 { + message: string; + code: string; +} + +/** + * Not found error response. + */ +export interface Value404 { + message: string; + code: string; +} + +/** + * Validation error response. + */ +export interface Value422 { + message: string; + code: string; +} + +/** + * Internal server error response. + */ +export interface Value500 { + message: string; + code: string; +} + +export type NamespaceListResponse = Array; + diff --git a/src/resources/registry.ts b/src/resources/registry.ts new file mode 100644 index 0000000..303a4b8 --- /dev/null +++ b/src/resources/registry.ts @@ -0,0 +1,337 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +import { APIResource } from "../resource"; +import { APIPromise } from "../api-promise"; +import type { RequestOptions } from "../internal/request-options"; +import { path as __scalarPath } from "../internal/utils/path"; + +export class RegistryResource extends APIResource { + /** + * List all API documents across every namespace the caller can access. + */ + listAllApiDocuments(options?: RequestOptions): APIPromise { + return this._client.get("/v1/apis", options); + } + /** + * List API documents in a namespace. + */ + listApiDocuments(namespace_: string, options?: RequestOptions): APIPromise { + return this._client.get(__scalarPath`/v1/apis/${namespace_}`, options); + } + /** + * Create an API document. + */ + createApiDocument(namespace_: string, body: RegistryCreateApiDocumentParams, options?: RequestOptions): APIPromise { + return this._client.post(__scalarPath`/v1/apis/${namespace_}`, { body: body, ...options }); + } + /** + * Delete an API document and all versions. + */ + deleteApiDocument(namespace_: string, slug: string, options?: RequestOptions): APIPromise { + return this._client.delete(__scalarPath`/v1/apis/${namespace_}/${slug}`, options); + } + /** + * Update metadata for an API document. + */ + updateApiDocument(namespace_: string, slug: string, body: RegistryUpdateApiDocumentParams, options?: RequestOptions): APIPromise { + return this._client.patch(__scalarPath`/v1/apis/${namespace_}/${slug}`, { body: body, ...options }); + } + /** + * Get a specific API document version. + */ + retrieveApiDocumentVersion(namespace_: string, slug: string, semver: string, options?: RequestOptions): APIPromise { + return this._client.get(__scalarPath`/v1/apis/${namespace_}/${slug}/version/${semver}`, options); + } + /** + * Delete a specific API document version. + */ + deleteApiDocumentVersion(namespace_: string, slug: string, semver: string, options?: RequestOptions): APIPromise { + return this._client.delete(__scalarPath`/v1/apis/${namespace_}/${slug}/version/${semver}`, options); + } + /** + * Update the registry file content for an API document version. + */ + updateApiDocumentVersion(namespace_: string, slug: string, semver: string, body: RegistryUpdateApiDocumentVersionParams, options?: RequestOptions): APIPromise { + return this._client.patch(__scalarPath`/v1/apis/${namespace_}/${slug}/version/${semver}`, { body: body, ...options }); + } + /** + * Get metadata (uid, content shas, version sha, tags) for a specific API document version. + */ + listApiDocumentVersionMetadata(namespace_: string, slug: string, semver: string, options?: RequestOptions): APIPromise { + return this._client.get(__scalarPath`/v1/apis/${namespace_}/${slug}/version/${semver}/metadata`, options); + } + /** + * Create a new API document version. + */ + createApiDocumentVersion(namespace_: string, slug: string, body: RegistryCreateApiDocumentVersionParams, options?: RequestOptions): APIPromise { + return this._client.post(__scalarPath`/v1/apis/${namespace_}/${slug}/version`, { body: body, ...options }); + } + /** + * Add an access group to an API document. + */ + createApiDocumentAccessGroup(namespace_: string, slug: string, body: AccessGroup, options?: RequestOptions): APIPromise { + return this._client.post(__scalarPath`/v1/apis/${namespace_}/${slug}/access-group`, { body: body, ...options }); + } + /** + * Remove an access group from an API document. + */ + deleteApiDocumentAccessGroup(namespace_: string, slug: string, body: AccessGroup, options?: RequestOptions): APIPromise { + return this._client.delete(__scalarPath`/v1/apis/${namespace_}/${slug}/access-group`, { body: body, ...options }); + } +} + +/** + * Semantic or display version string. + */ +export type Version = string; + +/** + * Access group assignment payload. + */ +export interface AccessGroup { + /** + * URL-safe slug identifier. + */ + accessGroupSlug: Slug; +} + +/** + * API document metadata. + */ +export interface ApiDocument { + /** + * Unique Nano ID identifier. + */ + uid: Nanoid; + /** + * Semantic or display version string. + */ + version: Version; + title: string; + /** + * URL-safe slug identifier. + */ + slug: Slug; + description: string; + /** + * Workspace namespace identifier. + */ + namespace: Namespace; + /** + * Whether the resource is private. + */ + isPrivate: boolean; + /** + * Tags associated with the resource. + */ + tags: string; + /** + * Available versions for the resource. + */ + versions: Array; +} + +/** + * Unique Nano ID identifier. + */ +export type Nanoid = string; + +/** + * URL-safe slug identifier. + */ +export type Slug = string; + +/** + * Workspace namespace identifier. + */ +export type Namespace = string; + +/** + * Managed API document version metadata. + */ +export interface ManagedDocVersion { + /** + * Unique Nano ID identifier. + */ + uid: Nanoid; + /** + * Timestamp when the resource was created. + */ + createdAt: number; + /** + * Semantic or display version string. + */ + version: Version; + /** + * Whether the version was upgraded. + */ + upgraded: boolean; + /** + * Current embedding status. + */ + embedStatus: "complete" | "failed" | null; + /** + * Tags associated with the resource. + */ + tags: Array; + /** + * Tool configuration for documented operations. + */ + tools?: Array<{ path: string; method: Method; enabledTools: Array<"execute-request" | "get-mini-openapi-spec"> }>; + /** + * SHA hash of the YAML document. + */ + yamlSha?: string; + /** + * SHA hash of the JSON document. + */ + jsonSha?: string; + /** + * SHA hash of the version contents. + */ + versionSha?: string; +} + +/** + * HTTP method. + */ +export type Method = "delete" | "get" | "head" | "options" | "patch" | "post" | "put" | "trace"; + +/** + * Bad request error response. + */ +export interface Value400 { + message: string; + code: string; +} + +/** + * Unauthorized error response. + */ +export interface Value401 { + message: string; + code: string; +} + +/** + * Forbidden error response. + */ +export interface Value403 { + message: string; + code: string; +} + +/** + * Not found error response. + */ +export interface Value404 { + message: string; + code: string; +} + +/** + * Validation error response. + */ +export interface Value422 { + message: string; + code: string; +} + +/** + * Internal server error response. + */ +export interface Value500 { + message: string; + code: string; +} + +export type RegistryListAllApiDocumentsResponse = Array; + +export type RegistryListApiDocumentsResponse = Array; + +export interface RegistryCreateApiDocumentParams { + title: string; + /** + * Semantic or display version string. + */ + version: Version; + /** + * URL-safe resource slug. + */ + slug: string; + /** + * OpenAPI, schema, theme, or guide document contents. + */ + document: string; + description?: string; + /** + * Ruleset contents. + */ + ruleset?: string; + /** + * Whether the resource is private. + */ + isPrivate?: boolean; +} + +export type RegistryCreateApiDocumentResponse = { uid: string; versionUid: string; title: string; jsonSha: string; yamlSha: string; versionSha: string }; + +export interface RegistryUpdateApiDocumentParams { + title?: string; + description?: string; + /** + * Whether the resource is private. + */ + isPrivate?: boolean; + /** + * Ruleset contents. + */ + ruleset?: string; +} + +export interface RegistryUpdateApiDocumentVersionParams { + /** + * OpenAPI, schema, theme, or guide document contents. + */ + document: string; + /** + * Last known version SHA used for optimistic concurrency. + */ + lastKnownVersionSha?: string; +} + +export type RegistryUpdateApiDocumentVersionResponse = { jsonSha: string; yamlSha: string; versionSha: string }; + +export interface RegistryCreateApiDocumentVersionParams { + /** + * Semantic or display version string. + */ + version: Version; + /** + * OpenAPI, schema, theme, or guide document contents. + */ + document: string; + /** + * Whether to force the operation. + */ + force?: boolean; + /** + * Last known version SHA used for optimistic concurrency. + */ + lastKnownVersionSha?: string; +} + +export interface RegistryCreateApiDocumentAccessGroupParams { + /** + * URL-safe slug identifier. + */ + accessGroupSlug: Slug; +} + +export interface RegistryDeleteApiDocumentAccessGroupParams { + /** + * URL-safe slug identifier. + */ + accessGroupSlug: Slug; +} + diff --git a/src/resources/rules.ts b/src/resources/rules.ts new file mode 100644 index 0000000..79b9301 --- /dev/null +++ b/src/resources/rules.ts @@ -0,0 +1,209 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +import { APIResource } from "../resource"; +import { APIPromise } from "../api-promise"; +import type { RequestOptions } from "../internal/request-options"; +import { path as __scalarPath } from "../internal/utils/path"; + +export class RuleResource extends APIResource { + /** + * List all rulesets in a namespace. + */ + listRulesets(namespace_: string, options?: RequestOptions): APIPromise { + return this._client.get(__scalarPath`/v1/rulesets/${namespace_}`, options); + } + /** + * Create a rule in a namespace. + */ + createRuleset(namespace_: string, body: RuleCreateRulesetParams, options?: RequestOptions): APIPromise { + return this._client.post(__scalarPath`/v1/rulesets/${namespace_}`, { body: body, ...options }); + } + /** + * Get a rule document by slug. + */ + retrieveRulesetDocument(namespace_: string, slug: string, options?: RequestOptions): APIPromise { + return this._client.get(__scalarPath`/v1/rulesets/${namespace_}/${slug}`, options); + } + /** + * Delete a rule by slug. + */ + deleteRuleset(namespace_: string, slug: string, options?: RequestOptions): APIPromise { + return this._client.delete(__scalarPath`/v1/rulesets/${namespace_}/${slug}`, options); + } + /** + * Update rule metadata by slug. + */ + updateRuleset(namespace_: string, slug: string, body: RuleUpdateRulesetParams, options?: RequestOptions): APIPromise { + return this._client.patch(__scalarPath`/v1/rulesets/${namespace_}/${slug}`, { body: body, ...options }); + } + /** + * Grant an access group to a rule. + */ + createRulesetAccessGroup(namespace_: string, slug: string, body: AccessGroup, options?: RequestOptions): APIPromise { + return this._client.post(__scalarPath`/v1/rulesets/${namespace_}/${slug}/access-group`, { body: body, ...options }); + } + /** + * Remove an access group from a rule. + */ + deleteRulesetAccessGroup(namespace_: string, slug: string, body: AccessGroup, options?: RequestOptions): APIPromise { + return this._client.delete(__scalarPath`/v1/rulesets/${namespace_}/${slug}/access-group`, { body: body, ...options }); + } +} + +/** + * Ruleset metadata. + */ +export interface Rule { + /** + * Unique Nano ID identifier. + */ + uid: Nanoid; + title: string; + description: string; + /** + * URL-safe slug identifier. + */ + slug: Slug; + /** + * Workspace namespace identifier. + */ + namespace: Namespace; + /** + * Whether the resource is private. + */ + isPrivate: boolean; +} + +/** + * Unique Nano ID identifier. + */ +export type Nanoid = string; + +/** + * URL-safe slug identifier. + */ +export type Slug = string; + +/** + * Workspace namespace identifier. + */ +export type Namespace = string; + +/** + * Bad request error response. + */ +export interface Value400 { + message: string; + code: string; +} + +/** + * Unauthorized error response. + */ +export interface Value401 { + message: string; + code: string; +} + +/** + * Forbidden error response. + */ +export interface Value403 { + message: string; + code: string; +} + +/** + * Not found error response. + */ +export interface Value404 { + message: string; + code: string; +} + +/** + * Validation error response. + */ +export interface Value422 { + message: string; + code: string; +} + +/** + * Internal server error response. + */ +export interface Value500 { + message: string; + code: string; +} + +/** + * Object UID wrapper. + */ +export interface Uid { + /** + * Unique Nano ID identifier. + */ + uid: Nanoid; +} + +/** + * Access group assignment payload. + */ +export interface AccessGroup { + /** + * URL-safe slug identifier. + */ + accessGroupSlug: Slug; +} + +export type RuleListRulesetsResponse = Array; + +export interface RuleCreateRulesetParams { + title: string; + /** + * URL-safe resource slug. + */ + slug: string; + /** + * OpenAPI, schema, theme, or guide document contents. + */ + document: string; + description?: string; + /** + * Whether the resource is private. + */ + isPrivate?: boolean; +} + +export interface RuleUpdateRulesetParams { + /** + * Workspace namespace that owns the resource. + */ + namespace?: string; + /** + * URL-safe resource slug. + */ + slug?: string; + title?: string; + description?: string; + /** + * Whether the resource is private. + */ + isPrivate?: boolean; +} + +export interface RuleCreateRulesetAccessGroupParams { + /** + * URL-safe slug identifier. + */ + accessGroupSlug: Slug; +} + +export interface RuleDeleteRulesetAccessGroupParams { + /** + * URL-safe slug identifier. + */ + accessGroupSlug: Slug; +} + diff --git a/src/resources/scalar-docs.ts b/src/resources/scalar-docs.ts new file mode 100644 index 0000000..f0db185 --- /dev/null +++ b/src/resources/scalar-docs.ts @@ -0,0 +1,245 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +import { APIResource } from "../resource"; +import { APIPromise } from "../api-promise"; +import type { RequestOptions } from "../internal/request-options"; +import { path as __scalarPath } from "../internal/utils/path"; + +export class ScalarDocResource extends APIResource { + /** + * List all guide projects. + */ + listGuides(options?: RequestOptions): APIPromise { + return this._client.get("/v1/guides", options); + } + /** + * Create a guide project. + */ + createGuide(body: ScalarDocCreateGuideParams, options?: RequestOptions): APIPromise { + return this._client.post("/v1/guides", { body: body, ...options }); + } + /** + * Start a new publish process. + */ + publishGuide(slug: string, options?: RequestOptions): APIPromise { + return this._client.post(__scalarPath`/v1/guides/${slug}/publish`, options); + } +} + +/** + * URL-safe slug identifier. + */ +export type Slug = string; + +/** + * GitHub-backed project metadata. + */ +export interface GithubProject { + /** + * Unique Nano ID identifier. + */ + uid: Nanoid; + /** + * Unix timestamp in milliseconds. + */ + createdAt: Timestamp; + /** + * Unix timestamp in milliseconds. + */ + updatedAt: Timestamp; + name: string; + /** + * Currently active deployment. + */ + activeDeployment: ActiveDeployment | null; + /** + * Timestamp of the most recent publish. + */ + lastPublished: Timestamp | null; + /** + * UID of the most recent publish. + */ + lastPublishedUid: string | null; + /** + * Associated login portal UID. + */ + loginPortalUid: string; + /** + * Active theme identifier. + */ + activeThemeId: string; + /** + * Whether the resource is private. + */ + isPrivate: boolean; + /** + * Whether the agent experience is enabled. + */ + agentEnabled: boolean; + /** + * Access groups allowed to access the resource. + */ + accessGroups: string; + /** + * URL-safe slug identifier. + */ + slug: Slug; + /** + * Current publish status. + */ + publishStatus: string; + /** + * Message describing the latest publish status. + */ + publishMessage: string; + /** + * Typesense search index identifier. + */ + typesenseId?: number; + /** + * Linked GitHub repository. + */ + repository?: GithubProjectRepository | null; +} + +/** + * Unique Nano ID identifier. + */ +export type Nanoid = string; + +/** + * Unix timestamp in milliseconds. + */ +export type Timestamp = number; + +/** + * Active deployment metadata. + */ +export interface ActiveDeployment { + /** + * Unique identifier for the resource. + */ + uid: string; + /** + * Published domain. + */ + domain: string; + /** + * Unix timestamp in milliseconds. + */ + publishedAt: Timestamp; +} + +/** + * Linked GitHub repository settings. + */ +export interface GithubProjectRepository { + /** + * User or integration that linked the repository. + */ + linkedBy: string; + /** + * Provider-specific identifier. + */ + id: number; + name: string; + /** + * Path to the Scalar configuration file. + */ + configPath: string; + /** + * Git branch used for publishing. + */ + branch: string; + /** + * Whether merges trigger publishing. + */ + publishOnMerge: boolean; + /** + * Whether preview deployments are published. + */ + publishPreviews: boolean; + /** + * Whether pull request comments are enabled. + */ + prComments: boolean; + /** + * Whether the repository link has expired. + */ + expired: boolean; +} + +/** + * Bad request error response. + */ +export interface Value400 { + message: string; + code: string; +} + +/** + * Unauthorized error response. + */ +export interface Value401 { + message: string; + code: string; +} + +/** + * Forbidden error response. + */ +export interface Value403 { + message: string; + code: string; +} + +/** + * Not found error response. + */ +export interface Value404 { + message: string; + code: string; +} + +/** + * Validation error response. + */ +export interface Value422 { + message: string; + code: string; +} + +/** + * Internal server error response. + */ +export interface Value500 { + message: string; + code: string; +} + +export type ScalarDocListGuidesResponse = Array; + +export interface ScalarDocCreateGuideParams { + name: string; + /** + * Whether the resource is private. + */ + isPrivate: boolean; + /** + * Email addresses allowed to access the guide. + */ + allowedUsers: Array; + /** + * Email domains allowed to access the guide. + */ + allowedDomains: Array; + /** + * URL-safe slug identifier. + */ + slug?: Slug; +} + +export type ScalarDocCreateGuideResponse = { uid: string; slug: string }; + +export type ScalarDocPublishGuideResponse = { publishUid: string }; + diff --git a/src/resources/schemas.ts b/src/resources/schemas.ts new file mode 100644 index 0000000..6a1fd7b --- /dev/null +++ b/src/resources/schemas.ts @@ -0,0 +1,264 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +import { APIResource } from "../resource"; +import { APIPromise } from "../api-promise"; +import type { RequestOptions } from "../internal/request-options"; +import { path as __scalarPath } from "../internal/utils/path"; + +export class SchemaResource extends APIResource { + /** + * List schemas in a namespace. + */ + list(namespace_: string, options?: RequestOptions): APIPromise { + return this._client.get(__scalarPath`/v1/schemas/${namespace_}`, options); + } + /** + * Create a schema in a namespace. + */ + create(namespace_: string, body: SchemaCreateParams, options?: RequestOptions): APIPromise { + return this._client.post(__scalarPath`/v1/schemas/${namespace_}`, { body: body, ...options }); + } + /** + * Delete a schema and all related versions. + */ + delete(namespace_: string, slug: string, options?: RequestOptions): APIPromise { + return this._client.delete(__scalarPath`/v1/schemas/${namespace_}/${slug}`, options); + } + /** + * Update schema metadata. + */ + update(namespace_: string, slug: string, body: SchemaUpdateParams, options?: RequestOptions): APIPromise { + return this._client.patch(__scalarPath`/v1/schemas/${namespace_}/${slug}`, { body: body, ...options }); + } + /** + * Get a specific schema version document. + */ + retrieveVersion(namespace_: string, slug: string, semver: string, options?: RequestOptions): APIPromise { + return this._client.get(__scalarPath`/v1/schemas/${namespace_}/${slug}/version/${semver}`, options); + } + /** + * Delete a schema version. + */ + deleteVersion(namespace_: string, slug: string, semver: string, options?: RequestOptions): APIPromise { + return this._client.delete(__scalarPath`/v1/schemas/${namespace_}/${slug}/version/${semver}`, options); + } + /** + * Create a schema version. + */ + createVersion(namespace_: string, slug: string, body: SchemaCreateVersionParams, options?: RequestOptions): APIPromise { + return this._client.post(__scalarPath`/v1/schemas/${namespace_}/${slug}/version`, { body: body, ...options }); + } + /** + * Add an access group to a schema. + */ + createAccessGroup(namespace_: string, slug: string, body: AccessGroup, options?: RequestOptions): APIPromise { + return this._client.post(__scalarPath`/v1/schemas/${namespace_}/${slug}/access-group`, { body: body, ...options }); + } + /** + * Remove an access group from a schema. + */ + deleteAccessGroup(namespace_: string, slug: string, body: AccessGroup, options?: RequestOptions): APIPromise { + return this._client.delete(__scalarPath`/v1/schemas/${namespace_}/${slug}/access-group`, { body: body, ...options }); + } +} + +/** + * Schema metadata. + */ +export interface Schema { + /** + * Unique Nano ID identifier. + */ + uid: Nanoid; + title: string; + description: string; + /** + * URL-safe slug identifier. + */ + slug: Slug; + /** + * Workspace namespace identifier. + */ + namespace: Namespace; + /** + * Whether the resource is private. + */ + isPrivate: boolean; + /** + * Available versions for the resource. + */ + versions: Array; +} + +/** + * Unique Nano ID identifier. + */ +export type Nanoid = string; + +/** + * URL-safe slug identifier. + */ +export type Slug = string; + +/** + * Workspace namespace identifier. + */ +export type Namespace = string; + +/** + * Managed schema version metadata. + */ +export interface ManagedSchemaVersion { + /** + * Unique Nano ID identifier. + */ + uid: Nanoid; + /** + * Unix timestamp in milliseconds. + */ + createdAt: Timestamp; + /** + * Unix timestamp in milliseconds. + */ + updatedAt: Timestamp; + /** + * Semantic or display version string. + */ + version: Version; +} + +/** + * Unix timestamp in milliseconds. + */ +export type Timestamp = number; + +/** + * Semantic or display version string. + */ +export type Version = string; + +/** + * Bad request error response. + */ +export interface Value400 { + message: string; + code: string; +} + +/** + * Unauthorized error response. + */ +export interface Value401 { + message: string; + code: string; +} + +/** + * Forbidden error response. + */ +export interface Value403 { + message: string; + code: string; +} + +/** + * Not found error response. + */ +export interface Value404 { + message: string; + code: string; +} + +/** + * Validation error response. + */ +export interface Value422 { + message: string; + code: string; +} + +/** + * Internal server error response. + */ +export interface Value500 { + message: string; + code: string; +} + +/** + * Object UID wrapper. + */ +export interface Uid { + /** + * Unique Nano ID identifier. + */ + uid: Nanoid; +} + +/** + * Access group assignment payload. + */ +export interface AccessGroup { + /** + * URL-safe slug identifier. + */ + accessGroupSlug: Slug; +} + +export type SchemaListResponse = Array; + +export interface SchemaCreateParams { + title: string; + /** + * Semantic or display version string. + */ + version: Version; + /** + * URL-safe resource slug. + */ + slug: string; + /** + * OpenAPI, schema, theme, or guide document contents. + */ + document: string; + description?: string; + /** + * Whether the resource is private. + */ + isPrivate?: boolean; +} + +export interface SchemaUpdateParams { + title?: string; + description?: string; + /** + * Whether the resource is private. + */ + isPrivate?: boolean; +} + +export interface SchemaCreateVersionParams { + /** + * Semantic or display version string. + */ + version: Version; + /** + * OpenAPI, schema, theme, or guide document contents. + */ + document: string; +} + +export interface SchemaCreateAccessGroupParams { + /** + * URL-safe slug identifier. + */ + accessGroupSlug: Slug; +} + +export interface SchemaDeleteAccessGroupParams { + /** + * URL-safe slug identifier. + */ + accessGroupSlug: Slug; +} + diff --git a/src/resources/teams.ts b/src/resources/teams.ts new file mode 100644 index 0000000..0daa280 --- /dev/null +++ b/src/resources/teams.ts @@ -0,0 +1,111 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +import { APIResource } from "../resource"; +import { APIPromise } from "../api-promise"; +import type { RequestOptions } from "../internal/request-options"; + +export class TeamResource extends APIResource { + /** + * List all available teams + */ + list(options?: RequestOptions): APIPromise { + return this._client.get("/v1/teams", options); + } +} + +/** + * Team metadata. + */ +export interface Team { + /** + * Unique Nano ID identifier. + */ + uid: Nanoid; + /** + * Team display name. + */ + name: TeamName; + /** + * URL-safe slug identifier. + */ + slug: Slug; + /** + * Theme identifier or theme settings. + */ + theme: string; + /** + * Team image URL. + */ + imageUri?: TeamImage; +} + +/** + * Unique Nano ID identifier. + */ +export type Nanoid = string; + +/** + * Team display name. + */ +export type TeamName = string; + +/** + * Team image URL. + */ +export type TeamImage = string; + +/** + * URL-safe slug identifier. + */ +export type Slug = string; + +/** + * Bad request error response. + */ +export interface Value400 { + message: string; + code: string; +} + +/** + * Unauthorized error response. + */ +export interface Value401 { + message: string; + code: string; +} + +/** + * Forbidden error response. + */ +export interface Value403 { + message: string; + code: string; +} + +/** + * Not found error response. + */ +export interface Value404 { + message: string; + code: string; +} + +/** + * Validation error response. + */ +export interface Value422 { + message: string; + code: string; +} + +/** + * Internal server error response. + */ +export interface Value500 { + message: string; + code: string; +} + +export type TeamListResponse = Array; + diff --git a/src/resources/themes.ts b/src/resources/themes.ts new file mode 100644 index 0000000..2f70717 --- /dev/null +++ b/src/resources/themes.ts @@ -0,0 +1,157 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +import { APIResource } from "../resource"; +import { APIPromise } from "../api-promise"; +import type { RequestOptions } from "../internal/request-options"; +import { path as __scalarPath } from "../internal/utils/path"; + +export class ThemeResource extends APIResource { + /** + * List all team themes. + */ + list(options?: RequestOptions): APIPromise { + return this._client.get("/v1/themes", options); + } + /** + * Create a team theme. + */ + create(body: ThemeCreateParams, options?: RequestOptions): APIPromise { + return this._client.post("/v1/themes", { body: body, ...options }); + } + /** + * Get the theme document by slug. + */ + retrieve(slug: string, options?: RequestOptions): APIPromise { + return this._client.get(__scalarPath`/v1/themes/${slug}`, options); + } + /** + * Replace the theme document. + */ + replaceDocument(slug: string, body: ThemeReplaceDocumentParams, options?: RequestOptions): APIPromise { + return this._client.put(__scalarPath`/v1/themes/${slug}`, { body: body, ...options }); + } + /** + * Delete a theme by slug. + */ + delete(slug: string, options?: RequestOptions): APIPromise { + return this._client.delete(__scalarPath`/v1/themes/${slug}`, options); + } + /** + * Update theme metadata. + */ + update(slug: string, body: ThemeUpdateParams, options?: RequestOptions): APIPromise { + return this._client.patch(__scalarPath`/v1/themes/${slug}`, { body: body, ...options }); + } +} + +/** + * Theme metadata. + */ +export interface Theme { + /** + * Unique Nano ID identifier. + */ + uid: Nanoid; + name: string; + description: string; + /** + * URL-safe slug identifier. + */ + slug: Slug; +} + +/** + * Unique Nano ID identifier. + */ +export type Nanoid = string; + +/** + * URL-safe slug identifier. + */ +export type Slug = string; + +/** + * Bad request error response. + */ +export interface Value400 { + message: string; + code: string; +} + +/** + * Unauthorized error response. + */ +export interface Value401 { + message: string; + code: string; +} + +/** + * Forbidden error response. + */ +export interface Value403 { + message: string; + code: string; +} + +/** + * Not found error response. + */ +export interface Value404 { + message: string; + code: string; +} + +/** + * Validation error response. + */ +export interface Value422 { + message: string; + code: string; +} + +/** + * Internal server error response. + */ +export interface Value500 { + message: string; + code: string; +} + +/** + * Object UID wrapper. + */ +export interface Uid { + /** + * Unique Nano ID identifier. + */ + uid: Nanoid; +} + +export type ThemeListResponse = Array; + +export interface ThemeCreateParams { + name: string; + /** + * URL-safe resource slug. + */ + slug: string; + /** + * OpenAPI, schema, theme, or guide document contents. + */ + document: string; + description?: string; +} + +export interface ThemeReplaceDocumentParams { + /** + * OpenAPI, schema, theme, or guide document contents. + */ + document: string; +} + +export interface ThemeUpdateParams { + name?: string; + description?: string; +} + diff --git a/src/sdk/authentication.ts b/src/sdk/authentication.ts deleted file mode 100644 index 0fac97f..0000000 --- a/src/sdk/authentication.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { authenticationExchangePersonalToken } from "../funcs/authenticationExchangePersonalToken.js"; -import { authenticationGetCurrentUser } from "../funcs/authenticationGetCurrentUser.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "../models/operations/index.js"; -import { unwrapAsync } from "../types/fp.js"; - -export class Authentication extends ClientSDK { - /** - * Exchange token - * - * @remarks - * Exchange an API key for an access token. - */ - async exchangePersonalToken( - request: operations.ExchangePersonalTokenRequestBody, - options?: RequestOptions, - ): Promise { - return unwrapAsync(authenticationExchangePersonalToken( - this, - request, - options, - )); - } - - /** - * Get current user - * - * @remarks - * Get the authenticated user, including their available teams and theme. - */ - async getCurrentUser( - options?: RequestOptions, - ): Promise { - return unwrapAsync(authenticationGetCurrentUser( - this, - options, - )); - } -} diff --git a/src/sdk/index.ts b/src/sdk/index.ts deleted file mode 100644 index ecac226..0000000 --- a/src/sdk/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export * from "./sdk.js"; diff --git a/src/sdk/loginportals.ts b/src/sdk/loginportals.ts deleted file mode 100644 index 4ae96e3..0000000 --- a/src/sdk/loginportals.ts +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { loginPortalsCreateLoginPortal } from "../funcs/loginPortalsCreateLoginPortal.js"; -import { loginPortalsDeleteLoginPortal } from "../funcs/loginPortalsDeleteLoginPortal.js"; -import { loginPortalsGetLoginPortal } from "../funcs/loginPortalsGetLoginPortal.js"; -import { loginPortalsListLoginPortals } from "../funcs/loginPortalsListLoginPortals.js"; -import { loginPortalsUpdateLoginPortal } from "../funcs/loginPortalsUpdateLoginPortal.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "../models/operations/index.js"; -import { unwrapAsync } from "../types/fp.js"; - -export class LoginPortals extends ClientSDK { - /** - * Get a login portal - * - * @remarks - * Get a login portal by slug. - */ - async getLoginPortal( - request: operations.GetLoginPortalRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(loginPortalsGetLoginPortal( - this, - request, - options, - )); - } - - /** - * Update portal metadata - * - * @remarks - * Update metadata for a login portal. - */ - async updateLoginPortal( - request: operations.UpdateLoginPortalRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(loginPortalsUpdateLoginPortal( - this, - request, - options, - )); - } - - /** - * Delete a login portal - * - * @remarks - * Delete a login portal. - */ - async deleteLoginPortal( - request: operations.DeleteLoginPortalRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(loginPortalsDeleteLoginPortal( - this, - request, - options, - )); - } - - /** - * Create a portal - * - * @remarks - * Create a login portal for the current team. - */ - async createLoginPortal( - request: operations.CreateLoginPortalRequestBody, - options?: RequestOptions, - ): Promise { - return unwrapAsync(loginPortalsCreateLoginPortal( - this, - request, - options, - )); - } - - /** - * List all portals - * - * @remarks - * List all login portals for the current team. - */ - async listLoginPortals( - options?: RequestOptions, - ): Promise { - return unwrapAsync(loginPortalsListLoginPortals( - this, - options, - )); - } -} diff --git a/src/sdk/namespaces.ts b/src/sdk/namespaces.ts deleted file mode 100644 index 61d6217..0000000 --- a/src/sdk/namespaces.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { namespacesListNamespaces } from "../funcs/namespacesListNamespaces.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "../models/operations/index.js"; -import { unwrapAsync } from "../types/fp.js"; - -export class Namespaces extends ClientSDK { - /** - * List namespaces - * - * @remarks - * Get all namespaces for the current team - */ - async listNamespaces( - options?: RequestOptions, - ): Promise { - return unwrapAsync(namespacesListNamespaces( - this, - options, - )); - } -} diff --git a/src/sdk/registry.ts b/src/sdk/registry.ts deleted file mode 100644 index 1ec2cc9..0000000 --- a/src/sdk/registry.ts +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { registryAddApiDocumentAccessGroup } from "../funcs/registryAddApiDocumentAccessGroup.js"; -import { registryCreateApiDocument } from "../funcs/registryCreateApiDocument.js"; -import { registryCreateApiDocumentVersion } from "../funcs/registryCreateApiDocumentVersion.js"; -import { registryDeleteApiDocument } from "../funcs/registryDeleteApiDocument.js"; -import { registryDeleteApiDocumentVersion } from "../funcs/registryDeleteApiDocumentVersion.js"; -import { registryGetApiDocumentVersion } from "../funcs/registryGetApiDocumentVersion.js"; -import { registryGetApiDocumentVersionMetadata } from "../funcs/registryGetApiDocumentVersionMetadata.js"; -import { registryListAllApiDocuments } from "../funcs/registryListAllApiDocuments.js"; -import { registryListApiDocuments } from "../funcs/registryListApiDocuments.js"; -import { registryRemoveApiDocumentAccessGroup } from "../funcs/registryRemoveApiDocumentAccessGroup.js"; -import { registryUpdateApiDocument } from "../funcs/registryUpdateApiDocument.js"; -import { registryUpdateApiDocumentVersion } from "../funcs/registryUpdateApiDocumentVersion.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "../models/operations/index.js"; -import { unwrapAsync } from "../types/fp.js"; - -export class Registry extends ClientSDK { - /** - * List all API Documents - * - * @remarks - * List all API documents across every namespace the caller can access. - */ - async listAllApiDocuments( - options?: RequestOptions, - ): Promise { - return unwrapAsync(registryListAllApiDocuments( - this, - options, - )); - } - - /** - * List API Documents in a namespace - * - * @remarks - * List API documents in a namespace. - */ - async listApiDocuments( - request: operations.ListApiDocumentsRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(registryListApiDocuments( - this, - request, - options, - )); - } - - /** - * Create API Document - * - * @remarks - * Create an API document. - */ - async createApiDocument( - request: operations.CreateApiDocumentRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(registryCreateApiDocument( - this, - request, - options, - )); - } - - /** - * Update API Document metadata - * - * @remarks - * Update metadata for an API document. - */ - async updateApiDocument( - request: operations.UpdateApiDocumentRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(registryUpdateApiDocument( - this, - request, - options, - )); - } - - /** - * Delete API Document - * - * @remarks - * Delete an API document and all versions. - */ - async deleteApiDocument( - request: operations.DeleteApiDocumentRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(registryDeleteApiDocument( - this, - request, - options, - )); - } - - /** - * Get API Document - * - * @remarks - * Get a specific API document version. - */ - async getApiDocumentVersion( - request: operations.GetApiDocumentVersionRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(registryGetApiDocumentVersion( - this, - request, - options, - )); - } - - /** - * Update API Document version - * - * @remarks - * Update the registry file content for an API document version. - */ - async updateApiDocumentVersion( - request: operations.UpdateApiDocumentVersionRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(registryUpdateApiDocumentVersion( - this, - request, - options, - )); - } - - /** - * Delete API Document version - * - * @remarks - * Delete a specific API document version. - */ - async deleteApiDocumentVersion( - request: operations.DeleteApiDocumentVersionRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(registryDeleteApiDocumentVersion( - this, - request, - options, - )); - } - - /** - * Get API Document version metadata - * - * @remarks - * Get metadata (uid, content shas, version sha, tags) for a specific API document version. - */ - async getApiDocumentVersionMetadata( - request: operations.GetApiDocumentVersionMetadataRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(registryGetApiDocumentVersionMetadata( - this, - request, - options, - )); - } - - /** - * Create API Document version - * - * @remarks - * Create a new API document version. - */ - async createApiDocumentVersion( - request: operations.CreateApiDocumentVersionRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(registryCreateApiDocumentVersion( - this, - request, - options, - )); - } - - /** - * Add access group - * - * @remarks - * Add an access group to an API document. - */ - async addApiDocumentAccessGroup( - request: operations.AddApiDocumentAccessGroupRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(registryAddApiDocumentAccessGroup( - this, - request, - options, - )); - } - - /** - * Remove access group - * - * @remarks - * Remove an access group from an API document. - */ - async removeApiDocumentAccessGroup( - request: operations.RemoveApiDocumentAccessGroupRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(registryRemoveApiDocumentAccessGroup( - this, - request, - options, - )); - } -} diff --git a/src/sdk/rules.ts b/src/sdk/rules.ts deleted file mode 100644 index 5a5bee4..0000000 --- a/src/sdk/rules.ts +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { rulesAddRulesetAccessGroup } from "../funcs/rulesAddRulesetAccessGroup.js"; -import { rulesCreateRuleset } from "../funcs/rulesCreateRuleset.js"; -import { rulesDeleteRuleset } from "../funcs/rulesDeleteRuleset.js"; -import { rulesGetRulesetDocument } from "../funcs/rulesGetRulesetDocument.js"; -import { rulesListRulesets } from "../funcs/rulesListRulesets.js"; -import { rulesRemoveRulesetAccessGroup } from "../funcs/rulesRemoveRulesetAccessGroup.js"; -import { rulesUpdateRuleset } from "../funcs/rulesUpdateRuleset.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "../models/operations/index.js"; -import { unwrapAsync } from "../types/fp.js"; - -export class Rules extends ClientSDK { - /** - * List all rules - * - * @remarks - * List all rulesets in a namespace. - */ - async listRulesets( - request: operations.ListRulesetsRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(rulesListRulesets( - this, - request, - options, - )); - } - - /** - * Create a rule - * - * @remarks - * Create a rule in a namespace. - */ - async createRuleset( - request: operations.CreateRulesetRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(rulesCreateRuleset( - this, - request, - options, - )); - } - - /** - * Update rule metadata - * - * @remarks - * Update rule metadata by slug. - */ - async updateRuleset( - request: operations.UpdateRulesetRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(rulesUpdateRuleset( - this, - request, - options, - )); - } - - /** - * Delete a rule - * - * @remarks - * Delete a rule by slug. - */ - async deleteRuleset( - request: operations.DeleteRulesetRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(rulesDeleteRuleset( - this, - request, - options, - )); - } - - /** - * Get a rule - * - * @remarks - * Get a rule document by slug. - */ - async getRulesetDocument( - request: operations.GetRulesetDocumentRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(rulesGetRulesetDocument( - this, - request, - options, - )); - } - - /** - * Add rule access group - * - * @remarks - * Grant an access group to a rule. - */ - async addRulesetAccessGroup( - request: operations.AddRulesetAccessGroupRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(rulesAddRulesetAccessGroup( - this, - request, - options, - )); - } - - /** - * Remove rule access group - * - * @remarks - * Remove an access group from a rule. - */ - async removeRulesetAccessGroup( - request: operations.RemoveRulesetAccessGroupRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(rulesRemoveRulesetAccessGroup( - this, - request, - options, - )); - } -} diff --git a/src/sdk/scalardocs.ts b/src/sdk/scalardocs.ts deleted file mode 100644 index 905d22a..0000000 --- a/src/sdk/scalardocs.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { scalarDocsCreateGuide } from "../funcs/scalarDocsCreateGuide.js"; -import { scalarDocsListGuides } from "../funcs/scalarDocsListGuides.js"; -import { scalarDocsPublishGuide } from "../funcs/scalarDocsPublishGuide.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "../models/operations/index.js"; -import { unwrapAsync } from "../types/fp.js"; - -export class ScalarDocs extends ClientSDK { - /** - * List all projects - * - * @remarks - * List all guide projects. - */ - async listGuides( - options?: RequestOptions, - ): Promise { - return unwrapAsync(scalarDocsListGuides( - this, - options, - )); - } - - /** - * Create a project - * - * @remarks - * Create a guide project. - */ - async createGuide( - request: operations.CreateGuideRequestBody, - options?: RequestOptions, - ): Promise { - return unwrapAsync(scalarDocsCreateGuide( - this, - request, - options, - )); - } - - /** - * Publish a project - * - * @remarks - * Start a new publish process. - */ - async publishGuide( - request: operations.PublishGuideRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(scalarDocsPublishGuide( - this, - request, - options, - )); - } -} diff --git a/src/sdk/schemas.ts b/src/sdk/schemas.ts deleted file mode 100644 index e180381..0000000 --- a/src/sdk/schemas.ts +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { schemasAddSchemaAccessGroup } from "../funcs/schemasAddSchemaAccessGroup.js"; -import { schemasCreateSchema } from "../funcs/schemasCreateSchema.js"; -import { schemasCreateSchemaVersion } from "../funcs/schemasCreateSchemaVersion.js"; -import { schemasDeleteSchema } from "../funcs/schemasDeleteSchema.js"; -import { schemasDeleteSchemaVersion } from "../funcs/schemasDeleteSchemaVersion.js"; -import { schemasGetSchemaVersion } from "../funcs/schemasGetSchemaVersion.js"; -import { schemasListSchemas } from "../funcs/schemasListSchemas.js"; -import { schemasRemoveSchemaAccessGroup } from "../funcs/schemasRemoveSchemaAccessGroup.js"; -import { schemasUpdateSchema } from "../funcs/schemasUpdateSchema.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "../models/operations/index.js"; -import { unwrapAsync } from "../types/fp.js"; - -export class Schemas extends ClientSDK { - /** - * List all shared components - * - * @remarks - * List schemas in a namespace. - */ - async listSchemas( - request: operations.ListSchemasRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(schemasListSchemas( - this, - request, - options, - )); - } - - /** - * Create a shared component - * - * @remarks - * Create a schema in a namespace. - */ - async createSchema( - request: operations.CreateSchemaRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(schemasCreateSchema( - this, - request, - options, - )); - } - - /** - * Update shared component metadata - * - * @remarks - * Update schema metadata. - */ - async updateSchema( - request: operations.UpdateSchemaRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(schemasUpdateSchema( - this, - request, - options, - )); - } - - /** - * Delete a shared component - * - * @remarks - * Delete a schema and all related versions. - */ - async deleteSchema( - request: operations.DeleteSchemaRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(schemasDeleteSchema( - this, - request, - options, - )); - } - - /** - * Get a shared component document - * - * @remarks - * Get a specific schema version document. - */ - async getSchemaVersion( - request: operations.GetSchemaVersionRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(schemasGetSchemaVersion( - this, - request, - options, - )); - } - - /** - * Delete a shared component version - * - * @remarks - * Delete a schema version. - */ - async deleteSchemaVersion( - request: operations.DeleteSchemaVersionRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(schemasDeleteSchemaVersion( - this, - request, - options, - )); - } - - /** - * Create a shared component version - * - * @remarks - * Create a schema version. - */ - async createSchemaVersion( - request: operations.CreateSchemaVersionRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(schemasCreateSchemaVersion( - this, - request, - options, - )); - } - - /** - * Add shared component access group - * - * @remarks - * Add an access group to a schema. - */ - async addSchemaAccessGroup( - request: operations.AddSchemaAccessGroupRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(schemasAddSchemaAccessGroup( - this, - request, - options, - )); - } - - /** - * Remove shared component access group - * - * @remarks - * Remove an access group from a schema. - */ - async removeSchemaAccessGroup( - request: operations.RemoveSchemaAccessGroupRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(schemasRemoveSchemaAccessGroup( - this, - request, - options, - )); - } -} diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts deleted file mode 100644 index fafce7d..0000000 --- a/src/sdk/sdk.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ClientSDK } from "../lib/sdks.js"; -import { Authentication } from "./authentication.js"; -import { LoginPortals } from "./loginportals.js"; -import { Namespaces } from "./namespaces.js"; -import { Registry } from "./registry.js"; -import { Rules } from "./rules.js"; -import { ScalarDocs } from "./scalardocs.js"; -import { Schemas } from "./schemas.js"; -import { Teams } from "./teams.js"; -import { Themes } from "./themes.js"; - -export class Scalar extends ClientSDK { - private _registry?: Registry; - get registry(): Registry { - return (this._registry ??= new Registry(this._options)); - } - - private _schemas?: Schemas; - get schemas(): Schemas { - return (this._schemas ??= new Schemas(this._options)); - } - - private _loginPortals?: LoginPortals; - get loginPortals(): LoginPortals { - return (this._loginPortals ??= new LoginPortals(this._options)); - } - - private _rules?: Rules; - get rules(): Rules { - return (this._rules ??= new Rules(this._options)); - } - - private _themes?: Themes; - get themes(): Themes { - return (this._themes ??= new Themes(this._options)); - } - - private _teams?: Teams; - get teams(): Teams { - return (this._teams ??= new Teams(this._options)); - } - - private _scalarDocs?: ScalarDocs; - get scalarDocs(): ScalarDocs { - return (this._scalarDocs ??= new ScalarDocs(this._options)); - } - - private _namespaces?: Namespaces; - get namespaces(): Namespaces { - return (this._namespaces ??= new Namespaces(this._options)); - } - - private _authentication?: Authentication; - get authentication(): Authentication { - return (this._authentication ??= new Authentication(this._options)); - } -} diff --git a/src/sdk/teams.ts b/src/sdk/teams.ts deleted file mode 100644 index de51e8b..0000000 --- a/src/sdk/teams.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { teamsListTeams } from "../funcs/teamsListTeams.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "../models/operations/index.js"; -import { unwrapAsync } from "../types/fp.js"; - -export class Teams extends ClientSDK { - /** - * List teams - * - * @remarks - * List all available teams - */ - async listTeams( - options?: RequestOptions, - ): Promise { - return unwrapAsync(teamsListTeams( - this, - options, - )); - } -} diff --git a/src/sdk/themes.ts b/src/sdk/themes.ts deleted file mode 100644 index a1062da..0000000 --- a/src/sdk/themes.ts +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { themesCreateTheme } from "../funcs/themesCreateTheme.js"; -import { themesDeleteTheme } from "../funcs/themesDeleteTheme.js"; -import { themesGetTheme } from "../funcs/themesGetTheme.js"; -import { themesListThemes } from "../funcs/themesListThemes.js"; -import { themesReplaceThemeDocument } from "../funcs/themesReplaceThemeDocument.js"; -import { themesUpdateTheme } from "../funcs/themesUpdateTheme.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "../models/operations/index.js"; -import { unwrapAsync } from "../types/fp.js"; - -export class Themes extends ClientSDK { - /** - * List all themes - * - * @remarks - * List all team themes. - */ - async listThemes( - options?: RequestOptions, - ): Promise { - return unwrapAsync(themesListThemes( - this, - options, - )); - } - - /** - * Create a theme - * - * @remarks - * Create a team theme. - */ - async createTheme( - request: operations.CreateThemeRequestBody, - options?: RequestOptions, - ): Promise { - return unwrapAsync(themesCreateTheme( - this, - request, - options, - )); - } - - /** - * Update theme metadata - * - * @remarks - * Update theme metadata. - */ - async updateTheme( - request: operations.UpdateThemeRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(themesUpdateTheme( - this, - request, - options, - )); - } - - /** - * Update theme document - * - * @remarks - * Replace the theme document. - */ - async replaceThemeDocument( - request: operations.ReplaceThemeDocumentRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(themesReplaceThemeDocument( - this, - request, - options, - )); - } - - /** - * Delete a theme - * - * @remarks - * Delete a theme by slug. - */ - async deleteTheme( - request: operations.DeleteThemeRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(themesDeleteTheme( - this, - request, - options, - )); - } - - /** - * Get a theme - * - * @remarks - * Get the theme document by slug. - */ - async getTheme( - request: operations.GetThemeRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(themesGetTheme( - this, - request, - options, - )); - } -} diff --git a/src/types/async.ts b/src/types/async.ts deleted file mode 100644 index 689dba5..0000000 --- a/src/types/async.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type APICall = - | { - status: "complete"; - request: Request; - response: Response; - } - | { - status: "request-error"; - request: Request; - response?: undefined; - } - | { - status: "invalid"; - request?: undefined; - response?: undefined; - }; - -export class APIPromise implements Promise { - readonly #promise: Promise<[T, APICall]>; - readonly #unwrapped: Promise; - - readonly [Symbol.toStringTag] = "APIPromise"; - - constructor(p: [T, APICall] | Promise<[T, APICall]>) { - this.#promise = p instanceof Promise ? p : Promise.resolve(p); - this.#unwrapped = - p instanceof Promise - ? this.#promise.then(([value]) => value) - : Promise.resolve(p[0]); - } - - then( - onfulfilled?: - | ((value: T) => TResult1 | PromiseLike) - | null - | undefined, - onrejected?: - | ((reason: any) => TResult2 | PromiseLike) - | null - | undefined, - ): Promise { - return this.#promise.then( - onfulfilled ? ([value]) => onfulfilled(value) : void 0, - onrejected, - ); - } - - catch( - onrejected?: - | ((reason: any) => TResult | PromiseLike) - | null - | undefined, - ): Promise { - return this.#unwrapped.catch(onrejected); - } - - finally(onfinally?: (() => void) | null | undefined): Promise { - return this.#unwrapped.finally(onfinally); - } - - $inspect(): Promise<[T, APICall]> { - return this.#promise; - } -} diff --git a/src/types/blobs.ts b/src/types/blobs.ts deleted file mode 100644 index 4ce8460..0000000 --- a/src/types/blobs.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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/types/constdatetime.ts b/src/types/constdatetime.ts deleted file mode 100644 index eeff4dd..0000000 --- a/src/types/constdatetime.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; - -export function constDateTime( - val: string, -): z.ZodType { - return z.custom((v) => { - return ( - typeof v === "string" && new Date(v).getTime() === new Date(val).getTime() - ); - }, `Value must be equivalent to ${val}`); -} diff --git a/src/types/enums.ts b/src/types/enums.ts deleted file mode 100644 index 6fb6d91..0000000 --- a/src/types/enums.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * 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/types/fp.ts b/src/types/fp.ts deleted file mode 100644 index ccbe51e..0000000 --- a/src/types/fp.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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/types/index.ts b/src/types/index.ts deleted file mode 100644 index e124e81..0000000 --- a/src/types/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export { blobLikeSchema, isBlobLike } from "./blobs.js"; -export { catchUnrecognizedEnum } from "./enums.js"; -export type { ClosedEnum, OpenEnum, Unrecognized } from "./enums.js"; -export type { Result } from "./fp.js"; -export type { PageIterator, Paginator } from "./operations.js"; -export { createPageIterator } from "./operations.js"; -export { RFCDate } from "./rfcdate.js"; diff --git a/src/types/operations.ts b/src/types/operations.ts deleted file mode 100644 index beb81e1..0000000 --- a/src/types/operations.ts +++ /dev/null @@ -1,105 +0,0 @@ -/* - * 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; - "~next"?: PageState | undefined; -}; - -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, PageState>>, -): Promise> { - const resultIter = await iteratorPromise; - - if (!resultIter.ok) { - throw resultIter.error; - } - - return { - ...resultIter.value, - next: unwrapPaginator(resultIter.next), - "~next": 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; - }); - }; -} - -export const URL_OVERRIDE = Symbol("URL_OVERRIDE"); diff --git a/src/types/rfcdate.ts b/src/types/rfcdate.ts deleted file mode 100644 index c79b3f5..0000000 --- a/src/types/rfcdate.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -const dateRE = /^\d{4}-\d{2}-\d{2}$/; - -export class RFCDate { - private serialized: string; - - /** - * 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, - ); - } - - const value = new Date(date); - if (isNaN(+value)) { - throw new RangeError("RFCDate: invalid date provided: " + 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}`, - ); - } - } - - toJSON(): string { - return this.toString(); - } - - toString(): string { - return this.serialized; - } -} diff --git a/src/types/streams.ts b/src/types/streams.ts deleted file mode 100644 index a0163e7..0000000 --- a/src/types/streams.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export function isReadableStream( - val: unknown, -): val is ReadableStream { - if (typeof val !== "object" || val === null) { - return false; - } - - // Check for the presence of methods specific to ReadableStream - const stream = val as ReadableStream; - - // ReadableStream has methods like getReader, cancel, and tee - return ( - typeof stream.getReader === "function" && - typeof stream.cancel === "function" && - typeof stream.tee === "function" - ); -} diff --git a/src/uploads.ts b/src/uploads.ts new file mode 100644 index 0000000..ae41029 --- /dev/null +++ b/src/uploads.ts @@ -0,0 +1,9 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +export type Uploadable = Blob | File | ArrayBuffer; + +export const toFile = async (value: Uploadable, name?: string): Promise => { + if (typeof File !== 'undefined' && value instanceof File) return value; + if (value instanceof Blob) return value; + return new Blob([value], name ? { type: 'application/octet-stream' } : undefined); +}; diff --git a/src/version.ts b/src/version.ts new file mode 100644 index 0000000..1bee298 --- /dev/null +++ b/src/version.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Scalar. See README.md for details. + +export const VERSION = "0.0.1"; diff --git a/tsconfig.cjs.json b/tsconfig.cjs.json new file mode 100644 index 0000000..ace7601 --- /dev/null +++ b/tsconfig.cjs.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "target": "ES2023", + "module": "CommonJS", + "lib": [ + "ES2023", + "DOM" + ], + "rootDir": "src", + "outDir": "./dist/cjs", + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "strict": true, + "noUncheckedIndexedAccess": true, + "exactOptionalPropertyTypes": true, + "forceConsistentCasingInFileNames": true, + "skipLibCheck": true + }, + "include": [ + "src/**/*.ts" + ] +} diff --git a/tsconfig.json b/tsconfig.json index 94d81a3..a30b112 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,41 +1,24 @@ { "compilerOptions": { - "incremental": true, - "tsBuildInfoFile": ".tsbuildinfo", - "target": "ES2020", - "lib": ["ES2022", "DOM", "DOM.Iterable"], - "jsx": "react-jsx", - - "module": "Node16", - "moduleResolution": "Node16", - - "allowJs": true, - + "target": "ES2023", + "module": "ES2022", + "moduleResolution": "Bundler", + "lib": [ + "ES2023", + "DOM" + ], + "rootDir": "src", + "outDir": "./dist/esm", "declaration": true, "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 + "exactOptionalPropertyTypes": true, + "forceConsistentCasingInFileNames": true, + "skipLibCheck": true }, - "include": ["src"], - "exclude": ["node_modules"] + "include": [ + "src/**/*.ts" + ] } From 18121a0f66ca5b520accc8d4b11bf6afe5aee20b Mon Sep 17 00:00:00 2001 From: Amrit Date: Fri, 29 May 2026 18:42:22 -0700 Subject: [PATCH 2/5] chore: bring ig back --- .gitignore | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ccddd9f --- /dev/null +++ b/.gitignore @@ -0,0 +1,26 @@ +/models +/models/errors +/types +/node_modules +/lib +/sdk +/funcs +/react-query +/mcp-server +/hooks +/index.* +/core.* +/bin +/cjs +/esm +/dist +/.tsbuildinfo +/.eslintcache +/.tshy +/.tshy-* +/__tests__ +.DS_Store +**/.speakeasy/temp/ +**/.speakeasy/logs/ +.DS_Store +/.speakeasy/reports From 548013d9a0adfcefa9a5138148b89121289018c0 Mon Sep 17 00:00:00 2001 From: Amrit Date: Fri, 29 May 2026 18:48:05 -0700 Subject: [PATCH 3/5] chore: maybe --- .github/workflows/ci.yaml | 26 ++++++++++++++++++++------ package.json | 6 +++++- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 10da471..f85a315 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,4 +1,5 @@ name: CI + on: push: branches: @@ -6,7 +7,22 @@ on: pull_request: workflow_dispatch: null jobs: - build: + check: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '20.x' + cache: npm + - run: npm ci + - run: npm run check + + publish: + needs: check + if: github.event_name == 'push' && github.ref == 'refs/heads/main' runs-on: ubuntu-latest concurrency: group: npm-publish @@ -16,14 +32,12 @@ jobs: id-token: write steps: - uses: actions/checkout@v4 - # Setup .npmrc file to publish to npm - uses: actions/setup-node@v4 with: node-version: '20.x' registry-url: 'https://registry.npmjs.org' - - run: npm install - - run: npm run prepublishOnly - - run: npm publish --access public - if: github.event_name != 'pull_request' + cache: npm + - run: npm ci + - run: npm publish --access public --provenance env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index f67d05e..baacb0e 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,11 @@ "dist" ], "scripts": { - "build": "tsc -p tsconfig.json && tsc -p tsconfig.cjs.json && node scripts/finalize-build.mjs", + "build": "npm run clean && tsc -p tsconfig.json && tsc -p tsconfig.cjs.json && node scripts/finalize-build.mjs", + "check": "npm run typecheck && npm run build && npm run smoke && npm pack --dry-run --ignore-scripts", + "clean": "rm -rf dist", + "prepack": "npm run build", + "smoke": "node -e \"require('./dist/cjs/index.js')\" && node --input-type=module -e \"await import('./dist/esm/index.js')\"", "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.cjs.json --noEmit" }, "dependencies": {}, From 442417b32886ed72d59cf9596b7aec43cdf384ae Mon Sep 17 00:00:00 2001 From: Amrit Date: Fri, 29 May 2026 18:50:28 -0700 Subject: [PATCH 4/5] chore: no more cache --- .github/workflows/ci.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f85a315..78b6bde 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -16,8 +16,7 @@ jobs: - uses: actions/setup-node@v4 with: node-version: '20.x' - cache: npm - - run: npm ci + - run: npm install - run: npm run check publish: @@ -36,8 +35,7 @@ jobs: with: node-version: '20.x' registry-url: 'https://registry.npmjs.org' - cache: npm - - run: npm ci + - run: npm install - run: npm publish --access public --provenance env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} From c9305515d192533e50f24a96afdce4374d6b7cde Mon Sep 17 00:00:00 2001 From: Amrit Date: Fri, 29 May 2026 22:45:02 -0700 Subject: [PATCH 5/5] chore: removed --- README.md | 363 ------------------------------------------------------ 1 file changed, 363 deletions(-) diff --git a/README.md b/README.md index cabc02c..2b7f79e 100644 --- a/README.md +++ b/README.md @@ -96,21 +96,12 @@ Declared schemes: ## Resources -Every operation below includes its HTTP route, generated types, documented error statuses, and a code sample when one can be generated. - ### `Registry` #### List all API Documents List all API documents across every namespace the caller can access. -| Field | Value | -| --- | --- | -| HTTP | `GET /v1/apis` | -| Response | `APIPromise>` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -133,14 +124,6 @@ main(); List API documents in a namespace. -| Field | Value | -| --- | --- | -| HTTP | `GET /v1/apis/{namespace}` | -| Input | `namespace: string` | -| Response | `APIPromise>` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -165,14 +148,6 @@ main(); Create an API document. -| Field | Value | -| --- | --- | -| HTTP | `POST /v1/apis/{namespace}` | -| Input | `namespace: string`, `RegistryCreateApiDocumentParams` | -| Response | `APIPromise<{ uid: string; versionUid: string; title: string; jsonSha: string; yamlSha: string; versionSha: string }>` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -203,14 +178,6 @@ main(); Delete an API document and all versions. -| Field | Value | -| --- | --- | -| HTTP | `DELETE /v1/apis/{namespace}/{slug}` | -| Input | `namespace: string`, `slug: string` | -| Response | `APIPromise` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -236,14 +203,6 @@ main(); Update metadata for an API document. -| Field | Value | -| --- | --- | -| HTTP | `PATCH /v1/apis/{namespace}/{slug}` | -| Input | `namespace: string`, `slug: string`, `RegistryUpdateApiDocumentParams` | -| Response | `APIPromise` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -270,14 +229,6 @@ main(); Get a specific API document version. -| Field | Value | -| --- | --- | -| HTTP | `GET /v1/apis/{namespace}/{slug}/version/{semver}` | -| Input | `namespace: string`, `slug: string`, `semver: string` | -| Response | `APIPromise` | -| Content-Type | `text/plain` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -304,14 +255,6 @@ main(); Delete a specific API document version. -| Field | Value | -| --- | --- | -| HTTP | `DELETE /v1/apis/{namespace}/{slug}/version/{semver}` | -| Input | `namespace: string`, `slug: string`, `semver: string` | -| Response | `APIPromise` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -338,14 +281,6 @@ main(); Update the registry file content for an API document version. -| Field | Value | -| --- | --- | -| HTTP | `PATCH /v1/apis/{namespace}/{slug}/version/{semver}` | -| Input | `namespace: string`, `slug: string`, `semver: string`, `RegistryUpdateApiDocumentVersionParams` | -| Response | `APIPromise<{ jsonSha: string; yamlSha: string; versionSha: string }>` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -375,14 +310,6 @@ main(); Get metadata (uid, content shas, version sha, tags) for a specific API document version. -| Field | Value | -| --- | --- | -| HTTP | `GET /v1/apis/{namespace}/{slug}/version/{semver}/metadata` | -| Input | `namespace: string`, `slug: string`, `semver: string` | -| Response | `APIPromise` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -409,14 +336,6 @@ main(); Create a new API document version. -| Field | Value | -| --- | --- | -| HTTP | `POST /v1/apis/{namespace}/{slug}/version` | -| Input | `namespace: string`, `slug: string`, `RegistryCreateApiDocumentVersionParams` | -| Response | `APIPromise` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -446,14 +365,6 @@ main(); Add an access group to an API document. -| Field | Value | -| --- | --- | -| HTTP | `POST /v1/apis/{namespace}/{slug}/access-group` | -| Input | `namespace: string`, `slug: string`, `RegistryCreateApiDocumentAccessGroupParams` | -| Response | `APIPromise` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -482,14 +393,6 @@ main(); Remove an access group from an API document. -| Field | Value | -| --- | --- | -| HTTP | `DELETE /v1/apis/{namespace}/{slug}/access-group` | -| Input | `namespace: string`, `slug: string`, `RegistryDeleteApiDocumentAccessGroupParams` | -| Response | `APIPromise` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -518,14 +421,6 @@ main(); List schemas in a namespace. -| Field | Value | -| --- | --- | -| HTTP | `GET /v1/schemas/{namespace}` | -| Input | `namespace: string` | -| Response | `APIPromise>` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -550,14 +445,6 @@ main(); Create a schema in a namespace. -| Field | Value | -| --- | --- | -| HTTP | `POST /v1/schemas/{namespace}` | -| Input | `namespace: string`, `SchemaCreateParams` | -| Response | `APIPromise` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -588,14 +475,6 @@ main(); Delete a schema and all related versions. -| Field | Value | -| --- | --- | -| HTTP | `DELETE /v1/schemas/{namespace}/{slug}` | -| Input | `namespace: string`, `slug: string` | -| Response | `APIPromise` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -621,14 +500,6 @@ main(); Update schema metadata. -| Field | Value | -| --- | --- | -| HTTP | `PATCH /v1/schemas/{namespace}/{slug}` | -| Input | `namespace: string`, `slug: string`, `SchemaUpdateParams` | -| Response | `APIPromise` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -655,14 +526,6 @@ main(); Get a specific schema version document. -| Field | Value | -| --- | --- | -| HTTP | `GET /v1/schemas/{namespace}/{slug}/version/{semver}` | -| Input | `namespace: string`, `slug: string`, `semver: string` | -| Response | `APIPromise` | -| Content-Type | `text/plain` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -689,14 +552,6 @@ main(); Delete a schema version. -| Field | Value | -| --- | --- | -| HTTP | `DELETE /v1/schemas/{namespace}/{slug}/version/{semver}` | -| Input | `namespace: string`, `slug: string`, `semver: string` | -| Response | `APIPromise` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -723,14 +578,6 @@ main(); Create a schema version. -| Field | Value | -| --- | --- | -| HTTP | `POST /v1/schemas/{namespace}/{slug}/version` | -| Input | `namespace: string`, `slug: string`, `SchemaCreateVersionParams` | -| Response | `APIPromise` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -760,14 +607,6 @@ main(); Add an access group to a schema. -| Field | Value | -| --- | --- | -| HTTP | `POST /v1/schemas/{namespace}/{slug}/access-group` | -| Input | `namespace: string`, `slug: string`, `SchemaCreateAccessGroupParams` | -| Response | `APIPromise` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -796,14 +635,6 @@ main(); Remove an access group from a schema. -| Field | Value | -| --- | --- | -| HTTP | `DELETE /v1/schemas/{namespace}/{slug}/access-group` | -| Input | `namespace: string`, `slug: string`, `SchemaDeleteAccessGroupParams` | -| Response | `APIPromise` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -832,14 +663,6 @@ main(); Get a login portal by slug. -| Field | Value | -| --- | --- | -| HTTP | `GET /v1/login-portals/{slug}` | -| Input | `slug: string` | -| Response | `APIPromise<{ uid: string; title: string; slug: string; email: LoginPortalEmail; page: LoginPortalPage }>` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -864,14 +687,6 @@ main(); Delete a login portal. -| Field | Value | -| --- | --- | -| HTTP | `DELETE /v1/login-portals/{slug}` | -| Input | `slug: string` | -| Response | `APIPromise` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -896,14 +711,6 @@ main(); Update metadata for a login portal. -| Field | Value | -| --- | --- | -| HTTP | `PATCH /v1/login-portals/{slug}` | -| Input | `slug: string`, `LoginPortals2Params` | -| Response | `APIPromise` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -929,13 +736,6 @@ main(); List all login portals for the current team. -| Field | Value | -| --- | --- | -| HTTP | `GET /v1/login-portals` | -| Response | `APIPromise>` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -958,14 +758,6 @@ main(); Create a login portal for the current team. -| Field | Value | -| --- | --- | -| HTTP | `POST /v1/login-portals` | -| Input | `LoginPortals4Params` | -| Response | `APIPromise` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -1022,14 +814,6 @@ main(); List all rulesets in a namespace. -| Field | Value | -| --- | --- | -| HTTP | `GET /v1/rulesets/{namespace}` | -| Input | `namespace: string` | -| Response | `APIPromise>` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -1054,14 +838,6 @@ main(); Create a rule in a namespace. -| Field | Value | -| --- | --- | -| HTTP | `POST /v1/rulesets/{namespace}` | -| Input | `namespace: string`, `RuleCreateRulesetParams` | -| Response | `APIPromise` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -1091,14 +867,6 @@ main(); Get a rule document by slug. -| Field | Value | -| --- | --- | -| HTTP | `GET /v1/rulesets/{namespace}/{slug}` | -| Input | `namespace: string`, `slug: string` | -| Response | `APIPromise` | -| Content-Type | `text/plain` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -1124,14 +892,6 @@ main(); Delete a rule by slug. -| Field | Value | -| --- | --- | -| HTTP | `DELETE /v1/rulesets/{namespace}/{slug}` | -| Input | `namespace: string`, `slug: string` | -| Response | `APIPromise` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -1157,14 +917,6 @@ main(); Update rule metadata by slug. -| Field | Value | -| --- | --- | -| HTTP | `PATCH /v1/rulesets/{namespace}/{slug}` | -| Input | `namespace: string`, `slug: string`, `RuleUpdateRulesetParams` | -| Response | `APIPromise` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -1191,14 +943,6 @@ main(); Grant an access group to a rule. -| Field | Value | -| --- | --- | -| HTTP | `POST /v1/rulesets/{namespace}/{slug}/access-group` | -| Input | `namespace: string`, `slug: string`, `RuleCreateRulesetAccessGroupParams` | -| Response | `APIPromise` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -1227,14 +971,6 @@ main(); Remove an access group from a rule. -| Field | Value | -| --- | --- | -| HTTP | `DELETE /v1/rulesets/{namespace}/{slug}/access-group` | -| Input | `namespace: string`, `slug: string`, `RuleDeleteRulesetAccessGroupParams` | -| Response | `APIPromise` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -1263,13 +999,6 @@ main(); List all team themes. -| Field | Value | -| --- | --- | -| HTTP | `GET /v1/themes` | -| Response | `APIPromise>` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -1292,14 +1021,6 @@ main(); Create a team theme. -| Field | Value | -| --- | --- | -| HTTP | `POST /v1/themes` | -| Input | `ThemeCreateParams` | -| Response | `APIPromise` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -1328,14 +1049,6 @@ main(); Get the theme document by slug. -| Field | Value | -| --- | --- | -| HTTP | `GET /v1/themes/{slug}` | -| Input | `slug: string` | -| Response | `APIPromise` | -| Content-Type | `text/plain` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -1360,14 +1073,6 @@ main(); Replace the theme document. -| Field | Value | -| --- | --- | -| HTTP | `PUT /v1/themes/{slug}` | -| Input | `slug: string`, `ThemeReplaceDocumentParams` | -| Response | `APIPromise` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -1395,14 +1100,6 @@ main(); Delete a theme by slug. -| Field | Value | -| --- | --- | -| HTTP | `DELETE /v1/themes/{slug}` | -| Input | `slug: string` | -| Response | `APIPromise` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -1427,14 +1124,6 @@ main(); Update theme metadata. -| Field | Value | -| --- | --- | -| HTTP | `PATCH /v1/themes/{slug}` | -| Input | `slug: string`, `ThemeUpdateParams` | -| Response | `APIPromise` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -1460,13 +1149,6 @@ main(); List all available teams -| Field | Value | -| --- | --- | -| HTTP | `GET /v1/teams` | -| Response | `APIPromise>` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -1489,13 +1171,6 @@ main(); List all guide projects. -| Field | Value | -| --- | --- | -| HTTP | `GET /v1/guides` | -| Response | `APIPromise>` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -1518,14 +1193,6 @@ main(); Create a guide project. -| Field | Value | -| --- | --- | -| HTTP | `POST /v1/guides` | -| Input | `ScalarDocCreateGuideParams` | -| Response | `APIPromise<{ uid: string; slug: string }>` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -1555,14 +1222,6 @@ main(); Start a new publish process. -| Field | Value | -| --- | --- | -| HTTP | `POST /v1/guides/{slug}/publish` | -| Input | `slug: string` | -| Response | `APIPromise<{ publishUid: string }>` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -1587,13 +1246,6 @@ main(); Get all namespaces for the current team -| Field | Value | -| --- | --- | -| HTTP | `GET /v1/namespaces` | -| Response | `APIPromise>` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -1616,14 +1268,6 @@ main(); Exchange an API key for an access token. -| Field | Value | -| --- | --- | -| HTTP | `POST /v1/auth/exchange` | -| Input | `AuthenticationExchangePersonalTokenParams` | -| Response | `APIPromise<{ accessToken: string }>` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk"; @@ -1650,13 +1294,6 @@ main(); Get the authenticated user, including their available teams and theme. -| Field | Value | -| --- | --- | -| HTTP | `GET /v1/auth/me` | -| Response | `APIPromise` | -| Content-Type | `application/json` | -| Error statuses | `400`, `401`, `403`, `404`, `422`, `500` | - ```ts import ScalarApi from "@scalar/sdk";