diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index 4d160bd2..00000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,28 +0,0 @@ -/* eslint-env node */ -module.exports = { - root: true, - extends: [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "plugin:import/recommended", - "plugin:import/typescript", - ], - parser: "@typescript-eslint/parser", - plugins: ["@typescript-eslint"], - settings: { - "import/resolver": { - typescript: true, - node: true, - }, - }, - rules: { - // Handled by typescript compiler - "@typescript-eslint/no-unused-vars": "off", - "@typescript-eslint/ban-types": "off", - "@typescript-eslint/no-namespace": "off", - "@typescript-eslint/no-explicit-any": "off", - "import/no-named-as-default-member": "off", - - "import/no-default-export": "error", - }, -}; diff --git a/.gitignore b/.gitignore index eea1dcb2..82f6df00 100755 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ +/react-query +/mcp-server +/bin +/.eslintcache +/.speakeasy/reports /funcs /core.* /__tests__ diff --git a/.npmignore b/.npmignore index 06cd8abf..cf98a6bf 100644 --- a/.npmignore +++ b/.npmignore @@ -1,9 +1,14 @@ **/* +!/FUNCTIONS.md +!/RUNTIMES.md +!/REACT_QUERY.md !/**/*.ts !/**/*.js +!/**/*.mjs +!/**/*.json !/**/*.map -/.eslintrc.js +/eslint.config.mjs /cjs /.tshy /.tshy-* diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 97e020d1..331171e5 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 89968bf0-a755-4d50-9acb-d47410010f05 management: - docChecksum: ff0251877ad0819b7ae028e9d209320c - docVersion: 0.4.0 . - speakeasyVersion: 1.414.1 - generationVersion: 2.437.1 - releaseVersion: 4.0.0-rc.2 - configChecksum: 57c81290703b8da0324b8ed555fced12 + docChecksum: 9bac3df452724b208c1bfd26a9444437 + docVersion: 0.4.0 + speakeasyVersion: 1.531.0 + generationVersion: 2.568.2 + releaseVersion: 4.0.0-rc.3 + configChecksum: 9043554d3a36057e40f8f81ba0daa91c repoURL: https://github.com/speakeasy-api/speakeasy-client-sdk-typescript.git repoSubDirectory: . installationURL: https://github.com/speakeasy-api/speakeasy-client-sdk-typescript @@ -15,83 +15,70 @@ features: typescript: acceptHeaders: 2.81.2 additionalDependencies: 0.1.0 - core: 3.18.2 + constsAndDefaults: 0.1.11 + core: 3.21.5 + deepObjectParams: 0.1.0 defaultEnabledRetries: 0.1.0 deprecations: 2.81.1 downloadStreams: 0.1.1 enumUnions: 0.1.0 - envVarSecurityUsage: 0.1.1 - examples: 2.81.4 - globalSecurity: 2.82.11 + envVarSecurityUsage: 0.1.2 + globalSecurity: 2.82.13 globalSecurityCallbacks: 0.1.0 globalServerURLs: 2.82.4 - globals: 2.82.1 - inputOutputModels: 2.82.0 + globals: 2.82.2 + mcpServer: 0.9.1 nameOverrides: 2.81.2 - nullables: 0.1.0 + nullables: 0.1.1 openEnums: 0.1.1 responseFormat: 0.2.3 retries: 2.83.0 - sdkHooks: 0.1.0 - serverEventsSentinels: 0.1.0 + sdkHooks: 0.2.0 serverIDs: 2.81.2 uploadStreams: 0.1.0 generatedFiles: - - .eslintrc.cjs - .gitattributes - .npmignore - - CONTRIBUTING.md - FUNCTIONS.md - RUNTIMES.md - USAGE.md - docs/lib/utils/retryconfig.md + - docs/sdk/models/operations/activatesubscriptionnamespacerequest.md + - docs/sdk/models/operations/archivenamespacerequest.md + - docs/sdk/models/operations/archivenamespacerequestbody.md - docs/sdk/models/operations/checkgithubaccessrequest.md + - docs/sdk/models/operations/createbillingaddonsresponse.md - docs/sdk/models/operations/createorganizationresponse.md - docs/sdk/models/operations/createrequestbody.md + - docs/sdk/models/operations/createschemastoreitemrequestbody.md + - docs/sdk/models/operations/createschemastoreitemresponse.md - docs/sdk/models/operations/createworkspaceresponse.md + - docs/sdk/models/operations/createworkspacetokenglobals.md - docs/sdk/models/operations/createworkspacetokenrequest.md - - docs/sdk/models/operations/deleteapiendpointrequest.md - - docs/sdk/models/operations/deleteapirequest.md - - docs/sdk/models/operations/deleteschemarequest.md - - docs/sdk/models/operations/deleteversionmetadatarequest.md + - docs/sdk/models/operations/deletebillingaddonrequest.md + - docs/sdk/models/operations/deleteworkspacetokenglobals.md - docs/sdk/models/operations/deleteworkspacetokenrequest.md - - docs/sdk/models/operations/downloadschemarequest.md - - docs/sdk/models/operations/downloadschemaresponse.md - - docs/sdk/models/operations/downloadschemarevisionrequest.md - - docs/sdk/models/operations/downloadschemarevisionresponse.md - docs/sdk/models/operations/filet.md - - docs/sdk/models/operations/findapiendpointrequest.md - - docs/sdk/models/operations/findapiendpointresponse.md - - docs/sdk/models/operations/generateopenapispecforapiendpointrequest.md - - docs/sdk/models/operations/generateopenapispecforapiendpointresponse.md - - docs/sdk/models/operations/generateopenapispecrequest.md - - docs/sdk/models/operations/generateopenapispecresponse.md - - docs/sdk/models/operations/generatepostmancollectionforapiendpointrequest.md - - docs/sdk/models/operations/generatepostmancollectionforapiendpointresponse.md - - docs/sdk/models/operations/generatepostmancollectionrequest.md - - docs/sdk/models/operations/generatepostmancollectionresponse.md - - docs/sdk/models/operations/generaterequestpostmancollectionrequest.md - - docs/sdk/models/operations/generaterequestpostmancollectionresponse.md + - docs/sdk/models/operations/format.md + - docs/sdk/models/operations/generatecodesamplepreviewasyncresponse.md + - docs/sdk/models/operations/generatecodesamplepreviewasyncresponsebody.md + - docs/sdk/models/operations/generatecodesamplepreviewresponse.md - docs/sdk/models/operations/getaccesstokenrequest.md - docs/sdk/models/operations/getaccesstokenresponse.md - - docs/sdk/models/operations/getallapiendpointsrequest.md - - docs/sdk/models/operations/getallapiendpointsresponse.md - - docs/sdk/models/operations/getallapiversionsrequest.md - - docs/sdk/models/operations/getallapiversionsresponse.md - - docs/sdk/models/operations/getallforversionapiendpointsrequest.md - - docs/sdk/models/operations/getallforversionapiendpointsresponse.md - - docs/sdk/models/operations/getapiendpointrequest.md - - docs/sdk/models/operations/getapiendpointresponse.md - - docs/sdk/models/operations/getapisrequest.md - - docs/sdk/models/operations/getapisresponse.md + - docs/sdk/models/operations/getbillingaddonsresponse.md - docs/sdk/models/operations/getblobrequest.md - docs/sdk/models/operations/getblobresponse.md - docs/sdk/models/operations/getchangesreportsignedurlrequest.md - docs/sdk/models/operations/getchangesreportsignedurlsignedaccess.md - - docs/sdk/models/operations/getembedaccesstokenrequest.md - - docs/sdk/models/operations/getembedaccesstokenresponse.md + - docs/sdk/models/operations/getcodesamplepreviewasyncrequest.md + - docs/sdk/models/operations/getcodesamplepreviewasyncresponse.md + - docs/sdk/models/operations/getcodesamplepreviewasyncresponsebody.md + - docs/sdk/models/operations/getcodesamplesrequest.md + - docs/sdk/models/operations/getcodesamplesresponse.md - docs/sdk/models/operations/getgithubactionrequest.md - docs/sdk/models/operations/getgithubactionresponse.md + - docs/sdk/models/operations/getgithubsetupstaterequest.md + - docs/sdk/models/operations/getgithubsetupstateresponse.md - docs/sdk/models/operations/getlintingreportsignedurlrequest.md - docs/sdk/models/operations/getlintingreportsignedurlsignedaccess.md - docs/sdk/models/operations/getmanifestrequest.md @@ -101,41 +88,35 @@ generatedFiles: - docs/sdk/models/operations/getorganizationresponse.md - docs/sdk/models/operations/getorganizationsresponse.md - docs/sdk/models/operations/getorganizationusageresponse.md - - docs/sdk/models/operations/getrequestfromeventlogrequest.md - - docs/sdk/models/operations/getrequestfromeventlogresponse.md - docs/sdk/models/operations/getrevisionsrequest.md - docs/sdk/models/operations/getrevisionsresponse.md - - docs/sdk/models/operations/getschemadiffrequest.md - - docs/sdk/models/operations/getschemadiffresponse.md - - docs/sdk/models/operations/getschemarequest.md - - docs/sdk/models/operations/getschemaresponse.md - - docs/sdk/models/operations/getschemarevisionrequest.md - - docs/sdk/models/operations/getschemarevisionresponse.md - - docs/sdk/models/operations/getschemasrequest.md - - docs/sdk/models/operations/getschemasresponse.md - docs/sdk/models/operations/gettagsrequest.md - docs/sdk/models/operations/gettagsresponse.md - docs/sdk/models/operations/getuserresponse.md - - docs/sdk/models/operations/getvalidembedaccesstokensresponse.md - - docs/sdk/models/operations/getversionmetadatarequest.md - - docs/sdk/models/operations/getversionmetadataresponse.md - docs/sdk/models/operations/getworkspaceaccessrequest.md - docs/sdk/models/operations/getworkspacebycontextresponse.md + - docs/sdk/models/operations/getworkspaceeventsbytargetglobals.md - docs/sdk/models/operations/getworkspaceeventsbytargetrequest.md - docs/sdk/models/operations/getworkspaceeventsbytargetresponse.md + - docs/sdk/models/operations/getworkspacefeatureflagsglobals.md - docs/sdk/models/operations/getworkspacefeatureflagsrequest.md - docs/sdk/models/operations/getworkspacefeatureflagsresponse.md + - docs/sdk/models/operations/getworkspaceglobals.md - docs/sdk/models/operations/getworkspacerequest.md - docs/sdk/models/operations/getworkspaceresponse.md + - docs/sdk/models/operations/getworkspacesettingsglobals.md - docs/sdk/models/operations/getworkspacesettingsrequest.md - docs/sdk/models/operations/getworkspacesettingsresponse.md - docs/sdk/models/operations/getworkspacesresponse.md + - docs/sdk/models/operations/getworkspacetargetsdeprecatedglobals.md - docs/sdk/models/operations/getworkspacetargetsdeprecatedrequest.md - docs/sdk/models/operations/getworkspacetargetsdeprecatedresponse.md - docs/sdk/models/operations/getworkspacetargetsrequest.md - docs/sdk/models/operations/getworkspacetargetsresponse.md + - docs/sdk/models/operations/getworkspaceteamglobals.md - docs/sdk/models/operations/getworkspaceteamrequest.md - docs/sdk/models/operations/getworkspaceteamresponse.md + - docs/sdk/models/operations/getworkspacetokensglobals.md - docs/sdk/models/operations/getworkspacetokensrequest.md - docs/sdk/models/operations/getworkspacetokensresponse.md - docs/sdk/models/operations/githubcheckpublishingprsrequest.md @@ -143,62 +124,58 @@ generatedFiles: - docs/sdk/models/operations/githubcheckpublishingsecretsrequest.md - docs/sdk/models/operations/githubcheckpublishingsecretsresponse.md - docs/sdk/models/operations/githubconfigurecodesamplesresponse.md + - docs/sdk/models/operations/grantuseraccesstoworkspaceglobals.md - docs/sdk/models/operations/grantuseraccesstoworkspacerequest.md - docs/sdk/models/operations/grantuseraccesstoworkspaceresponse.md - - docs/sdk/models/operations/insertversionmetadatarequest.md - - docs/sdk/models/operations/insertversionmetadataresponse.md - - docs/sdk/models/operations/op.md + - docs/sdk/models/operations/ignoresubscriptionnamespacerequest.md + - docs/sdk/models/operations/linkgithubaccessrequest.md + - docs/sdk/models/operations/listremotesourcesrequest.md + - docs/sdk/models/operations/listremotesourcesresponse.md + - docs/sdk/models/operations/methodpaths.md - docs/sdk/models/operations/posttagsrequest.md + - docs/sdk/models/operations/postworkspaceeventsglobals.md - docs/sdk/models/operations/postworkspaceeventsrequest.md - docs/sdk/models/operations/preflightresponse.md - - docs/sdk/models/operations/queryeventlogrequest.md - - docs/sdk/models/operations/queryeventlogresponse.md - - docs/sdk/models/operations/queryparamop.md - - docs/sdk/models/operations/registerschemafile.md - - docs/sdk/models/operations/registerschemarequest.md - - docs/sdk/models/operations/registerschemarequestbody.md - - docs/sdk/models/operations/revokeembedaccesstokenrequest.md + - docs/sdk/models/operations/revokeuseraccesstoworkspaceglobals.md - docs/sdk/models/operations/revokeuseraccesstoworkspacerequest.md - docs/sdk/models/operations/schema.md + - docs/sdk/models/operations/searchworkspaceeventsglobals.md - docs/sdk/models/operations/searchworkspaceeventsrequest.md - docs/sdk/models/operations/searchworkspaceeventsresponse.md + - docs/sdk/models/operations/setvisibilityrequest.md + - docs/sdk/models/operations/setvisibilityrequestbody.md + - docs/sdk/models/operations/setworkspacefeatureflagsresponse.md - docs/sdk/models/operations/suggestopenapiregistryrequest.md - docs/sdk/models/operations/suggestopenapirequest.md - docs/sdk/models/operations/suggestopenapirequestbody.md - docs/sdk/models/operations/suggestrequest.md + - docs/sdk/models/operations/updateworkspacedetailsglobals.md - docs/sdk/models/operations/updateworkspacedetailsrequest.md + - docs/sdk/models/operations/updateworkspacesettingsglobals.md - docs/sdk/models/operations/updateworkspacesettingsrequest.md - docs/sdk/models/operations/uploadreportrequestbody.md - docs/sdk/models/operations/uploadreportuploadedreport.md - - docs/sdk/models/operations/upsertapiendpointrequest.md - - docs/sdk/models/operations/upsertapiendpointresponse.md - - docs/sdk/models/operations/upsertapirequest.md - - docs/sdk/models/operations/upsertapiresponse.md - docs/sdk/models/operations/validateapikeyresponse.md - docs/sdk/models/shared/accessdetails.md - docs/sdk/models/shared/accesstoken.md - docs/sdk/models/shared/accesstokenuser.md - docs/sdk/models/shared/accounttype.md + - docs/sdk/models/shared/actions.md - docs/sdk/models/shared/addtags.md - docs/sdk/models/shared/annotations.md - - docs/sdk/models/shared/api.md - - docs/sdk/models/shared/apiendpoint.md - - docs/sdk/models/shared/apiendpointinput.md - - docs/sdk/models/shared/apiinput.md - docs/sdk/models/shared/apikeydetails.md - docs/sdk/models/shared/auth.md - - docs/sdk/models/shared/boundedrequest.md + - docs/sdk/models/shared/billingaddon.md - docs/sdk/models/shared/claims.md - docs/sdk/models/shared/clievent.md + - docs/sdk/models/shared/codesampleschemainput.md + - docs/sdk/models/shared/codesamplesjobstatus.md + - docs/sdk/models/shared/compositespecmetadata.md - docs/sdk/models/shared/diagnostic.md - - docs/sdk/models/shared/embedaccesstokenresponse.md - - docs/sdk/models/shared/embedtoken.md - docs/sdk/models/shared/errort.md - docs/sdk/models/shared/featureflag.md - - docs/sdk/models/shared/filter.md - - docs/sdk/models/shared/filters.md + - docs/sdk/models/shared/format.md - docs/sdk/models/shared/generatebumptype.md - - docs/sdk/models/shared/generateopenapispecdiff.md - docs/sdk/models/shared/getnamespacesresponse.md - docs/sdk/models/shared/getrevisionsresponse.md - docs/sdk/models/shared/gettagsresponse.md @@ -209,8 +186,10 @@ generatedFiles: - docs/sdk/models/shared/githubgetactionresponse.md - docs/sdk/models/shared/githubmissingpublishingsecretsresponse.md - docs/sdk/models/shared/githubpublishingprresponse.md + - docs/sdk/models/shared/githubsetupstateresponse.md - docs/sdk/models/shared/githubstorepublishingsecretsrequest.md - docs/sdk/models/shared/githubtriggeractionrequest.md + - docs/sdk/models/shared/httpmethod.md - docs/sdk/models/shared/interactiontype.md - docs/sdk/models/shared/level.md - docs/sdk/models/shared/license.md @@ -221,88 +200,86 @@ generatedFiles: - docs/sdk/models/shared/oassummary.md - docs/sdk/models/shared/openapidiffbumptype.md - docs/sdk/models/shared/organization.md + - docs/sdk/models/shared/organizationbillingaddonrequest.md + - docs/sdk/models/shared/organizationbillingaddonresponse.md - docs/sdk/models/shared/organizationusage.md - docs/sdk/models/shared/organizationusageresponse.md - docs/sdk/models/shared/preflightrequest.md - docs/sdk/models/shared/preflighttoken.md + - docs/sdk/models/shared/pullrequestmetadata.md - docs/sdk/models/shared/relationship.md + - docs/sdk/models/shared/remotedocument.md + - docs/sdk/models/shared/remotesource.md + - docs/sdk/models/shared/remotesourcesubscriptionsettings.md - docs/sdk/models/shared/report.md - - docs/sdk/models/shared/requestmetadata.md - docs/sdk/models/shared/revision.md - - docs/sdk/models/shared/schema.md - - docs/sdk/models/shared/schemadiff.md + - docs/sdk/models/shared/revisioncontentsmetadata.md + - docs/sdk/models/shared/revisioncontentsmetadatatype.md + - docs/sdk/models/shared/schemafile.md + - docs/sdk/models/shared/schemastoreitem.md + - docs/sdk/models/shared/secrets.md - docs/sdk/models/shared/security.md - docs/sdk/models/shared/shorturl.md - docs/sdk/models/shared/ssometadata.md - docs/sdk/models/shared/suggestiontype.md + - docs/sdk/models/shared/suggestitemsrequestbody.md - docs/sdk/models/shared/suggestoptsold.md - docs/sdk/models/shared/suggestrequestbody.md - docs/sdk/models/shared/suggestrequestbodysuggestiontype.md - docs/sdk/models/shared/tag.md - docs/sdk/models/shared/targetsdk.md - docs/sdk/models/shared/type.md - - docs/sdk/models/shared/unboundedrequest.md + - docs/sdk/models/shared/usagesnippet.md + - docs/sdk/models/shared/usagesnippets.md - docs/sdk/models/shared/user.md - docs/sdk/models/shared/v2descriptor.md - - docs/sdk/models/shared/valuechange.md - - docs/sdk/models/shared/versionmetadata.md - - docs/sdk/models/shared/versionmetadatainput.md - docs/sdk/models/shared/workflowdocument.md - docs/sdk/models/shared/workspace.md - docs/sdk/models/shared/workspaceandorganization.md + - docs/sdk/models/shared/workspacefeatureflag.md + - docs/sdk/models/shared/workspacefeatureflagrequest.md - docs/sdk/models/shared/workspacefeatureflagresponse.md - docs/sdk/models/shared/workspaceinviteresponse.md - docs/sdk/models/shared/workspaces.md - docs/sdk/models/shared/workspacesettings.md - docs/sdk/models/shared/workspaceteamresponse.md - docs/sdk/models/shared/workspacetoken.md - - docs/sdks/apiendpoints/README.md - - docs/sdks/apis/README.md - docs/sdks/artifacts/README.md - docs/sdks/auth/README.md - - docs/sdks/embeds/README.md + - docs/sdks/codesamples/README.md - docs/sdks/events/README.md - docs/sdks/github/README.md - - docs/sdks/metadata/README.md - docs/sdks/organizations/README.md - docs/sdks/reports/README.md - - docs/sdks/requests/README.md - - docs/sdks/schemas/README.md + - docs/sdks/schemastore/README.md - docs/sdks/shorturls/README.md - docs/sdks/speakeasy/README.md + - docs/sdks/subscriptions/README.md - docs/sdks/suggest/README.md - docs/sdks/workspaces/README.md + - eslint.config.mjs - jsr.json - package.json - src/core.ts - - src/funcs/apiEndpointsDeleteApiEndpoint.ts - - src/funcs/apiEndpointsFindApiEndpoint.ts - - src/funcs/apiEndpointsGenerateOpenApiSpecForApiEndpoint.ts - - src/funcs/apiEndpointsGeneratePostmanCollectionForApiEndpoint.ts - - src/funcs/apiEndpointsGetAllApiEndpoints.ts - - src/funcs/apiEndpointsGetAllForVersionApiEndpoints.ts - - src/funcs/apiEndpointsGetApiEndpoint.ts - - src/funcs/apiEndpointsUpsertApiEndpoint.ts - - src/funcs/apisDeleteApi.ts - - src/funcs/apisGenerateOpenApiSpec.ts - - src/funcs/apisGeneratePostmanCollection.ts - - src/funcs/apisGetAllApiVersions.ts - - src/funcs/apisGetApis.ts - - src/funcs/apisUpsertApi.ts + - src/funcs/artifactsCreateRemoteSource.ts - src/funcs/artifactsGetBlob.ts - src/funcs/artifactsGetManifest.ts - src/funcs/artifactsGetNamespaces.ts - src/funcs/artifactsGetRevisions.ts - src/funcs/artifactsGetTags.ts + - src/funcs/artifactsListRemoteSources.ts - src/funcs/artifactsPostTags.ts - src/funcs/artifactsPreflight.ts + - src/funcs/artifactsSetArchived.ts + - src/funcs/artifactsSetVisibility.ts - src/funcs/authGetAccess.ts - src/funcs/authGetAccessToken.ts - src/funcs/authGetUser.ts - src/funcs/authValidateApiKey.ts - - src/funcs/embedsGetEmbedAccessToken.ts - - src/funcs/embedsGetValidEmbedAccessTokens.ts - - src/funcs/embedsRevokeEmbedAccessToken.ts + - src/funcs/codeSamplesGenerateCodeSamplePreview.ts + - src/funcs/codeSamplesGenerateCodeSamplePreviewAsync.ts + - src/funcs/codeSamplesGet.ts + - src/funcs/codeSamplesGetCodeSamplePreviewAsync.ts - src/funcs/eventsGetEventsByTarget.ts - src/funcs/eventsGetTargets.ts - src/funcs/eventsGetTargetsDeprecated.ts @@ -315,32 +292,27 @@ generatedFiles: - src/funcs/githubConfigureMintlifyRepo.ts - src/funcs/githubConfigureTarget.ts - src/funcs/githubGetAction.ts + - src/funcs/githubGetSetup.ts + - src/funcs/githubLinkGithub.ts - src/funcs/githubStorePublishingSecrets.ts - src/funcs/githubTriggerAction.ts - - src/funcs/metadataDeleteVersionMetadata.ts - - src/funcs/metadataGetVersionMetadata.ts - - src/funcs/metadataInsertVersionMetadata.ts - src/funcs/organizationsCreate.ts + - src/funcs/organizationsCreateBillingAddOns.ts - src/funcs/organizationsCreateFreeTrial.ts + - src/funcs/organizationsDeleteBillingAddOn.ts - src/funcs/organizationsGet.ts - src/funcs/organizationsGetAll.ts + - src/funcs/organizationsGetBillingAddOns.ts - src/funcs/organizationsGetUsage.ts - src/funcs/reportsGetChangesReportSignedUrl.ts - src/funcs/reportsGetLintingReportSignedUrl.ts - src/funcs/reportsUploadReport.ts - - src/funcs/requestsGenerateRequestPostmanCollection.ts - - src/funcs/requestsGetRequestFromEventLog.ts - - src/funcs/requestsQueryEventLog.ts - - src/funcs/schemasDeleteSchema.ts - - src/funcs/schemasDownloadSchema.ts - - src/funcs/schemasDownloadSchemaRevision.ts - - src/funcs/schemasGetSchema.ts - - src/funcs/schemasGetSchemaDiff.ts - - src/funcs/schemasGetSchemaRevision.ts - - src/funcs/schemasGetSchemas.ts - - src/funcs/schemasRegisterSchema.ts + - src/funcs/schemaStoreCreateSchemaStoreItem.ts - src/funcs/shortURLsCreate.ts + - src/funcs/subscriptionsActivateSubscriptionNamespace.ts + - src/funcs/subscriptionsIgnoreSubscriptionNamespace.ts - src/funcs/suggestSuggest.ts + - src/funcs/suggestSuggestItems.ts - src/funcs/suggestSuggestOpenAPI.ts - src/funcs/suggestSuggestOpenAPIRegistry.ts - src/funcs/workspacesCreate.ts @@ -355,6 +327,7 @@ generatedFiles: - src/funcs/workspacesGetTokens.ts - src/funcs/workspacesGrantAccess.ts - src/funcs/workspacesRevokeAccess.ts + - src/funcs/workspacesSetFeatureFlags.ts - src/funcs/workspacesUpdate.ts - src/funcs/workspacesUpdateSettings.ts - src/hooks/hooks.ts @@ -376,63 +349,128 @@ generatedFiles: - src/lib/sdks.ts - src/lib/security.ts - src/lib/url.ts - - src/sdk/apiendpoints.ts - - src/sdk/apis.ts + - src/mcp-server/build.mts + - src/mcp-server/cli.ts + - src/mcp-server/cli/start/command.ts + - src/mcp-server/cli/start/impl.ts + - src/mcp-server/console-logger.ts + - src/mcp-server/extensions.ts + - src/mcp-server/mcp-server.ts + - src/mcp-server/prompts.ts + - src/mcp-server/resources.ts + - src/mcp-server/scopes.ts + - src/mcp-server/server.ts + - src/mcp-server/shared.ts + - src/mcp-server/tools.ts + - src/mcp-server/tools/artifactsCreateRemoteSource.ts + - src/mcp-server/tools/artifactsGetBlob.ts + - src/mcp-server/tools/artifactsGetManifest.ts + - src/mcp-server/tools/artifactsGetNamespaces.ts + - src/mcp-server/tools/artifactsGetRevisions.ts + - src/mcp-server/tools/artifactsGetTags.ts + - src/mcp-server/tools/artifactsListRemoteSources.ts + - src/mcp-server/tools/artifactsPostTags.ts + - src/mcp-server/tools/artifactsPreflight.ts + - src/mcp-server/tools/artifactsSetArchived.ts + - src/mcp-server/tools/artifactsSetVisibility.ts + - src/mcp-server/tools/authGetAccess.ts + - src/mcp-server/tools/authGetAccessToken.ts + - src/mcp-server/tools/authGetUser.ts + - src/mcp-server/tools/authValidateApiKey.ts + - src/mcp-server/tools/codeSamplesGenerateCodeSamplePreview.ts + - src/mcp-server/tools/codeSamplesGenerateCodeSamplePreviewAsync.ts + - src/mcp-server/tools/codeSamplesGet.ts + - src/mcp-server/tools/codeSamplesGetCodeSamplePreviewAsync.ts + - src/mcp-server/tools/eventsGetEventsByTarget.ts + - src/mcp-server/tools/eventsGetTargets.ts + - src/mcp-server/tools/eventsGetTargetsDeprecated.ts + - src/mcp-server/tools/eventsPost.ts + - src/mcp-server/tools/eventsSearch.ts + - src/mcp-server/tools/githubCheckAccess.ts + - src/mcp-server/tools/githubCheckPublishingPRs.ts + - src/mcp-server/tools/githubCheckPublishingSecrets.ts + - src/mcp-server/tools/githubConfigureCodeSamples.ts + - src/mcp-server/tools/githubConfigureMintlifyRepo.ts + - src/mcp-server/tools/githubConfigureTarget.ts + - src/mcp-server/tools/githubGetAction.ts + - src/mcp-server/tools/githubGetSetup.ts + - src/mcp-server/tools/githubLinkGithub.ts + - src/mcp-server/tools/githubStorePublishingSecrets.ts + - src/mcp-server/tools/githubTriggerAction.ts + - src/mcp-server/tools/organizationsCreate.ts + - src/mcp-server/tools/organizationsCreateBillingAddOns.ts + - src/mcp-server/tools/organizationsCreateFreeTrial.ts + - src/mcp-server/tools/organizationsDeleteBillingAddOn.ts + - src/mcp-server/tools/organizationsGet.ts + - src/mcp-server/tools/organizationsGetAll.ts + - src/mcp-server/tools/organizationsGetBillingAddOns.ts + - src/mcp-server/tools/organizationsGetUsage.ts + - src/mcp-server/tools/reportsGetChangesReportSignedUrl.ts + - src/mcp-server/tools/reportsGetLintingReportSignedUrl.ts + - src/mcp-server/tools/reportsUploadReport.ts + - src/mcp-server/tools/schemaStoreCreateSchemaStoreItem.ts + - src/mcp-server/tools/shortURLsCreate.ts + - src/mcp-server/tools/subscriptionsActivateSubscriptionNamespace.ts + - src/mcp-server/tools/subscriptionsIgnoreSubscriptionNamespace.ts + - src/mcp-server/tools/suggestSuggest.ts + - src/mcp-server/tools/suggestSuggestItems.ts + - src/mcp-server/tools/suggestSuggestOpenAPI.ts + - src/mcp-server/tools/suggestSuggestOpenAPIRegistry.ts + - src/mcp-server/tools/workspacesCreate.ts + - src/mcp-server/tools/workspacesCreateToken.ts + - src/mcp-server/tools/workspacesDeleteToken.ts + - src/mcp-server/tools/workspacesGet.ts + - src/mcp-server/tools/workspacesGetAll.ts + - src/mcp-server/tools/workspacesGetByID.ts + - src/mcp-server/tools/workspacesGetFeatureFlags.ts + - src/mcp-server/tools/workspacesGetSettings.ts + - src/mcp-server/tools/workspacesGetTeam.ts + - src/mcp-server/tools/workspacesGetTokens.ts + - src/mcp-server/tools/workspacesGrantAccess.ts + - src/mcp-server/tools/workspacesRevokeAccess.ts + - src/mcp-server/tools/workspacesSetFeatureFlags.ts + - src/mcp-server/tools/workspacesUpdate.ts + - src/mcp-server/tools/workspacesUpdateSettings.ts - src/sdk/artifacts.ts - src/sdk/auth.ts - - src/sdk/embeds.ts + - src/sdk/codesamples.ts - src/sdk/events.ts - src/sdk/github.ts - src/sdk/index.ts - - src/sdk/metadata.ts - src/sdk/models/errors/httpclienterrors.ts - src/sdk/models/errors/index.ts - src/sdk/models/errors/sdkerror.ts - src/sdk/models/errors/sdkvalidationerror.ts + - src/sdk/models/operations/activatesubscriptionnamespace.ts + - src/sdk/models/operations/archivenamespace.ts - src/sdk/models/operations/checkgithubaccess.ts - src/sdk/models/operations/create.ts + - src/sdk/models/operations/createbillingaddons.ts - src/sdk/models/operations/createorganization.ts + - src/sdk/models/operations/createschemastoreitem.ts - src/sdk/models/operations/createworkspace.ts - src/sdk/models/operations/createworkspacetoken.ts - - src/sdk/models/operations/deleteapi.ts - - src/sdk/models/operations/deleteapiendpoint.ts - - src/sdk/models/operations/deleteschema.ts - - src/sdk/models/operations/deleteversionmetadata.ts + - src/sdk/models/operations/deletebillingaddon.ts - src/sdk/models/operations/deleteworkspacetoken.ts - - src/sdk/models/operations/downloadschema.ts - - src/sdk/models/operations/downloadschemarevision.ts - - src/sdk/models/operations/findapiendpoint.ts - - src/sdk/models/operations/generateopenapispec.ts - - src/sdk/models/operations/generateopenapispecforapiendpoint.ts - - src/sdk/models/operations/generatepostmancollection.ts - - src/sdk/models/operations/generatepostmancollectionforapiendpoint.ts - - src/sdk/models/operations/generaterequestpostmancollection.ts + - src/sdk/models/operations/generatecodesamplepreview.ts + - src/sdk/models/operations/generatecodesamplepreviewasync.ts - src/sdk/models/operations/getaccesstoken.ts - - src/sdk/models/operations/getallapiendpoints.ts - - src/sdk/models/operations/getallapiversions.ts - - src/sdk/models/operations/getallforversionapiendpoints.ts - - src/sdk/models/operations/getapiendpoint.ts - - src/sdk/models/operations/getapis.ts + - src/sdk/models/operations/getbillingaddons.ts - src/sdk/models/operations/getblob.ts - src/sdk/models/operations/getchangesreportsignedurl.ts - - src/sdk/models/operations/getembedaccesstoken.ts + - src/sdk/models/operations/getcodesamplepreviewasync.ts + - src/sdk/models/operations/getcodesamples.ts - src/sdk/models/operations/getgithubaction.ts + - src/sdk/models/operations/getgithubsetupstate.ts - src/sdk/models/operations/getlintingreportsignedurl.ts - src/sdk/models/operations/getmanifest.ts - src/sdk/models/operations/getnamespaces.ts - src/sdk/models/operations/getorganization.ts - src/sdk/models/operations/getorganizations.ts - src/sdk/models/operations/getorganizationusage.ts - - src/sdk/models/operations/getrequestfromeventlog.ts - src/sdk/models/operations/getrevisions.ts - - src/sdk/models/operations/getschema.ts - - src/sdk/models/operations/getschemadiff.ts - - src/sdk/models/operations/getschemarevision.ts - - src/sdk/models/operations/getschemas.ts - src/sdk/models/operations/gettags.ts - src/sdk/models/operations/getuser.ts - - src/sdk/models/operations/getvalidembedaccesstokens.ts - - src/sdk/models/operations/getversionmetadata.ts - src/sdk/models/operations/getworkspace.ts - src/sdk/models/operations/getworkspaceaccess.ts - src/sdk/models/operations/getworkspacebycontext.ts @@ -448,45 +486,37 @@ generatedFiles: - src/sdk/models/operations/githubcheckpublishingsecrets.ts - src/sdk/models/operations/githubconfigurecodesamples.ts - src/sdk/models/operations/grantuseraccesstoworkspace.ts + - src/sdk/models/operations/ignoresubscriptionnamespace.ts - src/sdk/models/operations/index.ts - - src/sdk/models/operations/insertversionmetadata.ts + - src/sdk/models/operations/linkgithubaccess.ts + - src/sdk/models/operations/listremotesources.ts - src/sdk/models/operations/posttags.ts - src/sdk/models/operations/postworkspaceevents.ts - src/sdk/models/operations/preflight.ts - - src/sdk/models/operations/queryeventlog.ts - - src/sdk/models/operations/registerschema.ts - - src/sdk/models/operations/revokeembedaccesstoken.ts - src/sdk/models/operations/revokeuseraccesstoworkspace.ts - src/sdk/models/operations/searchworkspaceevents.ts + - src/sdk/models/operations/setvisibility.ts + - src/sdk/models/operations/setworkspacefeatureflags.ts - src/sdk/models/operations/suggest.ts - src/sdk/models/operations/suggestopenapi.ts - src/sdk/models/operations/suggestopenapiregistry.ts - src/sdk/models/operations/updateworkspacedetails.ts - src/sdk/models/operations/updateworkspacesettings.ts - src/sdk/models/operations/uploadreport.ts - - src/sdk/models/operations/upsertapi.ts - - src/sdk/models/operations/upsertapiendpoint.ts - src/sdk/models/operations/validateapikey.ts - src/sdk/models/shared/accessdetails.ts - src/sdk/models/shared/accesstoken.ts - src/sdk/models/shared/accounttype.ts - src/sdk/models/shared/addtags.ts - src/sdk/models/shared/annotations.ts - - src/sdk/models/shared/api.ts - - src/sdk/models/shared/apiendpoint.ts - - src/sdk/models/shared/apiendpointinput.ts - - src/sdk/models/shared/apiinput.ts - src/sdk/models/shared/apikeydetails.ts - - src/sdk/models/shared/boundedrequest.ts + - src/sdk/models/shared/billingaddon.ts - src/sdk/models/shared/clievent.ts + - src/sdk/models/shared/codesampleschemainput.ts + - src/sdk/models/shared/codesamplesjobstatus.ts - src/sdk/models/shared/diagnostic.ts - - src/sdk/models/shared/embedaccesstokenresponse.ts - - src/sdk/models/shared/embedtoken.ts - src/sdk/models/shared/error.ts - src/sdk/models/shared/featureflag.ts - - src/sdk/models/shared/filter.ts - - src/sdk/models/shared/filters.ts - - src/sdk/models/shared/generateopenapispecdiff.ts - src/sdk/models/shared/getnamespacesresponse.ts - src/sdk/models/shared/getrevisionsresponse.ts - src/sdk/models/shared/gettagsresponse.ts @@ -497,8 +527,10 @@ generatedFiles: - src/sdk/models/shared/githubgetactionresponse.ts - src/sdk/models/shared/githubmissingpublishingsecretsresponse.ts - src/sdk/models/shared/githubpublishingprresponse.ts + - src/sdk/models/shared/githubsetupstateresponse.ts - src/sdk/models/shared/githubstorepublishingsecretsrequest.ts - src/sdk/models/shared/githubtriggeractionrequest.ts + - src/sdk/models/shared/httpmethod.ts - src/sdk/models/shared/index.ts - src/sdk/models/shared/interactiontype.ts - src/sdk/models/shared/manifest.ts @@ -507,30 +539,36 @@ generatedFiles: - src/sdk/models/shared/oasoperation.ts - src/sdk/models/shared/oassummary.ts - src/sdk/models/shared/organization.ts + - src/sdk/models/shared/organizationbillingaddonrequest.ts + - src/sdk/models/shared/organizationbillingaddonresponse.ts - src/sdk/models/shared/organizationusage.ts - src/sdk/models/shared/organizationusageresponse.ts - src/sdk/models/shared/preflightrequest.ts - src/sdk/models/shared/preflighttoken.ts + - src/sdk/models/shared/remotedocument.ts + - src/sdk/models/shared/remotesource.ts + - src/sdk/models/shared/remotesourcesubscriptionsettings.ts - src/sdk/models/shared/report.ts - - src/sdk/models/shared/requestmetadata.ts - src/sdk/models/shared/revision.ts - - src/sdk/models/shared/schema.ts - - src/sdk/models/shared/schemadiff.ts + - src/sdk/models/shared/revisioncontentsmetadata.ts + - src/sdk/models/shared/schemastoreitem.ts - src/sdk/models/shared/security.ts - src/sdk/models/shared/shorturl.ts - src/sdk/models/shared/ssometadata.ts + - src/sdk/models/shared/suggestitemsrequestbody.ts - src/sdk/models/shared/suggestoptsold.ts - src/sdk/models/shared/suggestrequestbody.ts - src/sdk/models/shared/tag.ts - src/sdk/models/shared/targetsdk.ts - - src/sdk/models/shared/unboundedrequest.ts + - src/sdk/models/shared/usagesnippet.ts + - src/sdk/models/shared/usagesnippets.ts - src/sdk/models/shared/user.ts - src/sdk/models/shared/v2descriptor.ts - - src/sdk/models/shared/versionmetadata.ts - - src/sdk/models/shared/versionmetadatainput.ts - src/sdk/models/shared/workflowdocument.ts - src/sdk/models/shared/workspace.ts - src/sdk/models/shared/workspaceandorganization.ts + - src/sdk/models/shared/workspacefeatureflag.ts + - src/sdk/models/shared/workspacefeatureflagrequest.ts - src/sdk/models/shared/workspacefeatureflagresponse.ts - src/sdk/models/shared/workspaceinviteresponse.ts - src/sdk/models/shared/workspacesettings.ts @@ -538,11 +576,12 @@ generatedFiles: - src/sdk/models/shared/workspacetoken.ts - src/sdk/organizations.ts - src/sdk/reports.ts - - src/sdk/requests.ts - - src/sdk/schemas.ts + - src/sdk/schemastore.ts - src/sdk/sdk.ts - src/sdk/shorturls.ts + - src/sdk/subscriptions.ts - src/sdk/suggest.ts + - src/sdk/types/async.ts - src/sdk/types/blobs.ts - src/sdk/types/constdatetime.ts - src/sdk/types/enums.ts @@ -554,278 +593,11 @@ generatedFiles: - src/sdk/workspaces.ts - tsconfig.json examples: - deleteApi: - speakeasy-default-delete-api: - parameters: - path: - apiID: "" - versionID: "" - responses: - 4XX: - application/json: {"message": "", "status_code": 875451} - generateOpenApiSpec: - speakeasy-default-generate-open-api-spec: - parameters: - path: - apiID: "" - versionID: "" - responses: - 2XX: - application/json: {"current_schema": "", "new_schema": ""} - 4XX: - application/json: {"message": "", "status_code": 871055} - generatePostmanCollection: - speakeasy-default-generate-postman-collection: - parameters: - path: - apiID: "" - versionID: "" - responses: - 4XX: - application/json: {"message": "", "status_code": 623581} - getAllApiVersions: - speakeasy-default-get-all-api-versions: - parameters: - path: - apiID: "" - query: {} - responses: - 2XX: - application/json: [{"api_id": "", "created_at": "2022-12-01T14:20:45.655Z", "description": "cavernous so continually qua", "updated_at": "2023-05-30T05:25:29.047Z", "version_id": "", "workspace_id": ""}, {"api_id": "", "created_at": "2023-04-23T11:41:22.396Z", "description": "readmit chubby oof gym sedately micromanage trench", "updated_at": "2022-10-16T03:11:00.742Z", "version_id": "", "workspace_id": ""}, {"api_id": "", "created_at": "2023-03-06T08:55:20.384Z", "description": "aw even but peter abaft", "updated_at": "2024-07-27T04:38:48.315Z", "version_id": "", "workspace_id": ""}] - 4XX: - application/json: {"message": "", "status_code": 873085} - getApis: - speakeasy-default-get-apis: - responses: - 2XX: - application/json: [] - 4XX: - application/json: {"message": "", "status_code": 107838} - upsertApi: - speakeasy-default-upsert-api: - parameters: - path: - apiID: "" - requestBody: - application/json: {"api_id": "", "description": "consequently brr happily yowza however gosh investigate joyfully direct", "version_id": ""} - responses: - 2XX: - application/json: {"api_id": "", "created_at": "2023-12-28T17:35:28.584Z", "description": "handful finally jaunty ouch same as pfft meh shoulder under", "updated_at": "2023-05-07T09:17:47.683Z", "version_id": "", "workspace_id": ""} - 4XX: - application/json: {"message": "", "status_code": 225619} - deleteApiEndpoint: - speakeasy-default-delete-api-endpoint: - parameters: - path: - apiID: "" - versionID: "" - apiEndpointID: "" - responses: - 4XX: - application/json: {"message": "", "status_code": 788324} - findApiEndpoint: - speakeasy-default-find-api-endpoint: - parameters: - path: - apiID: "" - versionID: "" - displayName: "Don_Kihn39" - responses: - 2XX: - application/json: {"api_endpoint_id": "", "api_id": "", "created_at": "2023-10-16T19:23:50.697Z", "description": "axe pro between plus aw highly", "display_name": "Floyd.Collier78", "method": "", "path": "/home/user", "updated_at": "2024-11-03T17:06:00.965Z", "version_id": "", "workspace_id": ""} - 4XX: - application/json: {"message": "", "status_code": 834695} - generateOpenApiSpecForApiEndpoint: - speakeasy-default-generate-open-api-spec-for-api-endpoint: - parameters: - path: - apiID: "" - versionID: "" - apiEndpointID: "" - responses: - 2XX: - application/json: {"current_schema": "", "new_schema": ""} - 4XX: - application/json: {"message": "", "status_code": 833540} - generatePostmanCollectionForApiEndpoint: - speakeasy-default-generate-postman-collection-for-api-endpoint: - parameters: - path: - apiID: "" - versionID: "" - apiEndpointID: "" - responses: - 4XX: - application/json: {"message": "", "status_code": 786917} - getAllApiEndpoints: - speakeasy-default-get-all-api-endpoints: - parameters: - path: - apiID: "" - responses: - 2XX: - application/json: [{"api_endpoint_id": "", "api_id": "", "created_at": "2023-01-29T03:25:40.769Z", "description": "proliferate anenst gadzooks gosh without frightfully", "display_name": "Mireille.Wolff", "method": "", "path": "/boot/defaults", "updated_at": "2023-01-23T16:26:38.331Z", "version_id": "", "workspace_id": ""}, {"api_endpoint_id": "", "api_id": "", "created_at": "2022-09-08T17:07:17.627Z", "description": "remark whoever for ignorance yahoo integer competent really tempting", "display_name": "Aliya.Hammes", "method": "", "path": "/boot", "updated_at": "2024-01-01T08:51:16.176Z", "version_id": "", "workspace_id": ""}, {"api_endpoint_id": "", "api_id": "", "created_at": "2024-05-10T15:45:00.302Z", "description": "rudely acclaimed sentimental aircraft book", "display_name": "Cathrine_Cummerata", "method": "", "path": "/opt/lib", "updated_at": "2024-11-01T08:41:53.910Z", "version_id": "", "workspace_id": ""}] - 4XX: - application/json: {"message": "", "status_code": 87408} - getAllForVersionApiEndpoints: - speakeasy-default-get-all-for-version-api-endpoints: - parameters: - path: - apiID: "" - versionID: "" - responses: - 2XX: - application/json: [{"api_endpoint_id": "", "api_id": "", "created_at": "2024-06-17T00:07:30.468Z", "description": "cutover knottily productive thump scrabble abaft gracious pulp", "display_name": "Alek.Kunze41", "method": "", "path": "/home/user", "updated_at": "2024-07-27T06:29:44.391Z", "version_id": "", "workspace_id": ""}, {"api_endpoint_id": "", "api_id": "", "created_at": "2022-06-22T07:41:12.922Z", "description": "sparse obligation er honorable offensively shallow", "display_name": "Jarrell82", "method": "", "path": "/sys", "updated_at": "2024-08-17T07:17:55.780Z", "version_id": "", "workspace_id": ""}, {"api_endpoint_id": "", "api_id": "", "created_at": "2023-06-20T19:40:53.688Z", "description": "yieldingly widow blah phooey uh-huh corny fess", "display_name": "Moshe.Streich", "method": "", "path": "/selinux", "updated_at": "2023-07-07T21:35:49.283Z", "version_id": "", "workspace_id": ""}] - 4XX: - application/json: {"message": "", "status_code": 321615} - getApiEndpoint: - speakeasy-default-get-api-endpoint: - parameters: - path: - apiID: "" - versionID: "" - apiEndpointID: "" - responses: - 2XX: - application/json: {"api_endpoint_id": "", "api_id": "", "created_at": "2024-12-16T12:54:48.841Z", "description": "self-reliant till before and pick openly boo", "display_name": "Frankie_Brown", "method": "", "path": "/media", "updated_at": "2022-12-01T02:36:45.697Z", "version_id": "", "workspace_id": ""} - 4XX: - application/json: {"message": "", "status_code": 497683} - upsertApiEndpoint: - speakeasy-default-upsert-api-endpoint: - parameters: - path: - apiID: "" - versionID: "" - apiEndpointID: "" - requestBody: - application/json: {"api_endpoint_id": "", "description": "commandeer equate pish psst hoot ugh frankly supposing", "display_name": "Eliseo.Little15", "method": "", "path": "/etc/defaults", "version_id": ""} - responses: - 2XX: - application/json: {"api_endpoint_id": "", "api_id": "", "created_at": "2024-02-14T10:37:57.359Z", "description": "loftily wasabi upbeat dense promptly supposing publication eek ultimately brand", "display_name": "Destiney84", "method": "", "path": "/Library", "updated_at": "2024-03-29T21:25:21.729Z", "version_id": "", "workspace_id": ""} - 4XX: - application/json: {"message": "", "status_code": 105983} - deleteVersionMetadata: - speakeasy-default-delete-version-metadata: - parameters: - path: - apiID: "" - versionID: "" - metaKey: "" - metaValue: "" - responses: - 4XX: - application/json: {"message": "", "status_code": 730807} - getVersionMetadata: - speakeasy-default-get-version-metadata: - parameters: - path: - apiID: "" - versionID: "" - responses: - 2XX: - application/json: [{"api_id": "", "created_at": "2022-06-27T04:40:43.913Z", "meta_key": "", "meta_value": "", "version_id": "", "workspace_id": ""}] - 4XX: - application/json: {"message": "", "status_code": 359814} - insertVersionMetadata: - speakeasy-default-insert-version-metadata: - parameters: - path: - apiID: "" - versionID: "" - requestBody: - application/json: {"meta_key": "", "meta_value": ""} - responses: - 2XX: - application/json: {"api_id": "", "created_at": "2022-03-18T13:32:09.275Z", "meta_key": "", "meta_value": "", "version_id": "", "workspace_id": ""} - 4XX: - application/json: {"message": "", "status_code": 734322} - deleteSchema: - speakeasy-default-delete-schema: - parameters: - path: - apiID: "" - versionID: "" - revisionID: "" - responses: - 4XX: - application/json: {"message": "", "status_code": 9376} - downloadSchema: - speakeasy-default-download-schema: - parameters: - path: - apiID: "" - versionID: "" - responses: - 4XX: - application/json: {"message": "", "status_code": 477436} - downloadSchemaRevision: - speakeasy-default-download-schema-revision: - parameters: - path: - apiID: "" - versionID: "" - revisionID: "" - responses: - 4XX: - application/json: {"message": "", "status_code": 859820} - getSchema: - speakeasy-default-get-schema: - parameters: - path: - apiID: "" - versionID: "" - responses: - 2XX: - application/json: {"api_id": "", "created_at": "2022-09-09T00:58:17.727Z", "description": "polyester instead slowly than safely meh appropriate heroine free", "revision_id": "", "version_id": "", "workspace_id": ""} - 4XX: - application/json: {"message": "", "status_code": 333689} - getSchemaDiff: - speakeasy-default-get-schema-diff: - parameters: - path: - apiID: "" - versionID: "" - baseRevisionID: "" - targetRevisionID: "" - responses: - 2XX: - application/json: {"additions": [], "deletions": ["", ""], "modifications": {}} - 4XX: - application/json: {"message": "", "status_code": 842381} - getSchemaRevision: - speakeasy-default-get-schema-revision: - parameters: - path: - apiID: "" - versionID: "" - revisionID: "" - responses: - 2XX: - application/json: {"api_id": "", "created_at": "2022-01-23T10:21:45.479Z", "description": "woot neaten whoever submitter upon altruistic regarding", "revision_id": "", "version_id": "", "workspace_id": ""} - 4XX: - application/json: {"message": "", "status_code": 907219} - getSchemas: - speakeasy-default-get-schemas: - parameters: - path: - apiID: "" - versionID: "" - responses: - 2XX: - application/json: [] - 4XX: - application/json: {"message": "", "status_code": 235379} - registerSchema: - speakeasy-default-register-schema: - parameters: - path: - apiID: "" - versionID: "" - requestBody: - multipart/form-data: {"file": {"": "example.file"}} + createRemoteSource: + speakeasy-default-create-remote-source: responses: 4XX: - application/json: {"message": "", "status_code": 822243} + application/json: {"message": "", "status_code": 580557} getBlob: speakeasy-default-get-blob: parameters: @@ -835,6 +607,8 @@ examples: namespace_name: "" digest: "" responses: + 2XX: + application/octet-stream: "x-file: example.file" 4XX: application/json: {"message": "", "status_code": 115307} getManifest: @@ -854,7 +628,7 @@ examples: speakeasy-default-get-namespaces: responses: 2XX: - application/json: {"items": [{"created_at": "2024-01-20T10:11:46.428Z", "id": "", "name": "", "updated_at": "2022-01-07T04:43:36.873Z"}, {"created_at": "2023-07-06T07:26:30.970Z", "id": "", "name": "", "updated_at": "2024-01-31T11:34:19.590Z"}, {"created_at": "2022-08-10T13:43:30.983Z", "id": "", "name": "", "updated_at": "2022-07-15T08:41:36.371Z"}]} + application/json: {"items": [{"created_at": "2025-01-19T10:11:46.428Z", "id": "", "name": "", "updated_at": "2023-01-07T04:43:36.873Z"}, {"created_at": "2024-07-05T07:26:30.970Z", "id": "", "name": "", "updated_at": "2025-01-30T11:34:19.590Z"}, {"created_at": "2023-08-10T13:43:30.983Z", "id": "", "name": "", "updated_at": "2023-07-15T08:41:36.371Z"}]} 4XX: application/json: {"message": "", "status_code": 305198} getRevisions: @@ -865,7 +639,7 @@ examples: query: {} responses: 2XX: - application/json: {"items": [{"created_at": "2024-09-16T19:17:04.361Z", "digest": "sha256:6d1ef012b5674ad8a127ecfa9b5e6f5178d171b90ee462846974177fd9bdd39f", "id": "", "namespace_name": "", "tags": [""], "updated_at": "2023-12-06T05:58:38.953Z"}], "next_page_token": ""} + application/json: {"items": [{"created_at": "2025-09-16T19:17:04.361Z", "digest": "sha256:6d1ef012b5674ad8a127ecfa9b5e6f5178d171b90ee462846974177fd9bdd39f", "id": "", "namespace_name": "", "tags": [""], "updated_at": "2024-12-05T05:58:38.953Z"}], "next_page_token": ""} 4XX: application/json: {"message": "", "status_code": 414389} getTags: @@ -878,6 +652,16 @@ examples: application/json: {"items": []} 4XX: application/json: {"message": "", "status_code": 50428} + listRemoteSources: + speakeasy-default-list-remote-sources: + parameters: + query: + namespace_name: "" + responses: + 2XX: + application/json: {"inputs": [{"registry_url": "https://well-lit-cap.net"}, {"registry_url": "https://vibrant-labourer.net"}], "output": {"registry_url": "https://unfit-minor.biz"}} + 4XX: + application/json: {"message": "", "status_code": 754391} postTags: speakeasy-default-post-tags: parameters: @@ -889,8 +673,26 @@ examples: preflight: speakeasy-default-preflight: responses: + 2XX: + application/json: {} 4XX: application/json: {"message": "", "status_code": 820828} + archiveNamespace: + speakeasy-default-archive-namespace: + parameters: + path: + namespace_name: "" + responses: + 4XX: + application/json: {"message": "", "status_code": 334009} + setVisibility: + speakeasy-default-set-visibility: + parameters: + path: + namespace_name: "" + responses: + 4XX: + application/json: {"message": "", "status_code": 651364} getWorkspaceAccess: speakeasy-default-get-workspace-access: responses: @@ -903,48 +705,72 @@ examples: workspace_id: "" responses: 2XX: - application/json: {"access_token": ""} + application/json: {"access_token": "", "claims": {}, "user": {}} 4XX: application/json: {"message": "", "status_code": 299050} getUser: speakeasy-default-get-user: responses: 2XX: - application/json: {"admin": false, "confirmed": true, "created_at": "2024-09-05T08:59:40.988Z", "display_name": "Tianna_Prohaska", "email": "Morton82@gmail.com", "email_verified": false, "id": "", "updated_at": "2022-08-28T03:26:52.335Z", "whitelisted": true} + application/json: {"admin": false, "confirmed": true, "created_at": "2025-09-05T08:59:40.988Z", "display_name": "Tianna_Prohaska", "email": "Morton82@gmail.com", "email_verified": false, "id": "", "updated_at": "2023-08-28T03:26:52.335Z", "whitelisted": true} 4XX: application/json: {"message": "", "status_code": 237845} validateApiKey: speakeasy-default-validate-api-key: responses: 2XX: - application/json: {"account_type_v2": "enterprise", "enabled_features": ["", "", ""], "org_slug": "", "telemetry_disabled": true, "workspace_id": "", "workspace_slug": ""} + application/json: {"account_type_v2": "enterprise", "billing_add_ons": ["webhooks", "sdk_testing", "webhooks"], "enabled_features": ["", "", ""], "org_slug": "", "telemetry_disabled": false, "workspace_created_at": "2024-02-23T05:39:14.801Z", "workspace_id": "", "workspace_slug": ""} 4XX: - application/json: {"message": "", "status_code": 365836} - generateRequestPostmanCollection: - speakeasy-default-generate-request-postman-collection: - parameters: - path: - requestID: "" + application/json: {"message": "", "status_code": 380984} + generateCodeSamplePreview: + default: + requestBody: + multipart/form-data: {"language": "", "schema_file": {"": "example.file"}} responses: + 2XX: + application/json: {"snippets": [{"code": "import { Petstore } from \"petstore-sdk\";\n\nconst petstore = new Petstore({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await petstore.pet.getById({\n id: 137396,\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();", "language": "typescript", "method": "get", "operationId": "getPetById", "path": "/pet/{id}"}]} + generateCodeSamplePreviewAsync: + speakeasy-default-generate-code-sample-preview-async: + requestBody: + multipart/form-data: {"language": "", "schema_file": {"": "example.file"}} + responses: + "202": + application/json: {"job_id": "", "status": "running"} 4XX: - application/json: {"message": "", "status_code": 681461} - getRequestFromEventLog: - speakeasy-default-get-request-from-event-log: + application/json: {"message": "", "status_code": 885038} + 5XX: + application/json: {"message": "", "status_code": 242219} + getCodeSamples: + "": parameters: - path: - requestID: "" + query: + registry_url: "https://spec.speakeasy.com/my-org/my-workspace/my-source" + operation_ids: ["getPets"] + method_paths: [{"method": "get", "path": "/pets"}] + languages: ["python", "javascript"] responses: 2XX: - application/json: {"created_at": "2024-07-06T20:33:24.477Z", "har": "", "har_size_bytes": 659422, "request_id": "", "workspace_id": ""} + application/json: {"snippets": [{"code": "", "language": "", "method": "", "operationId": "", "path": "/sbin"}, {"code": "", "language": "", "method": "", "operationId": "", "path": "/root"}]} 4XX: - application/json: {"message": "", "status_code": 799548} - queryEventLog: - speakeasy-default-query-event-log: + application/json: {"message": "", "status_code": 521235} + default: + parameters: + query: + registry_url: "https://spec.speakeasy.com/my-org/my-workspace/my-source" + operation_ids: ["getPets"] + method_paths: [{"method": "get", "path": "/pets"}] + languages: ["python", "javascript"] responses: 2XX: - application/json: [] - 4XX: - application/json: {"message": "", "status_code": 621062} + application/json: {"snippets": [{"code": "import { Petstore } from \"petstore-sdk\";\n\nconst petstore = new Petstore({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await petstore.pet.getById({\n id: 137396,\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();", "language": "typescript", "method": "get", "operationId": "getPetById", "path": "/pet/{id}"}]} + getCodeSamplePreviewAsync: + default: + parameters: + path: + jobID: "" + responses: + 2XX: + application/json: {"snippets": [{"code": "import { Petstore } from \"petstore-sdk\";\n\nconst petstore = new Petstore({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await petstore.pet.getById({\n id: 137396,\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();", "language": "typescript", "method": "get", "operationId": "getPetById", "path": "/pet/{id}"}]} checkGithubAccess: speakeasy-default-check-github-access: parameters: @@ -962,6 +788,8 @@ examples: org: "" repo: "" responses: + 2XX: + application/json: {} 4XX: application/json: {"message": "", "status_code": 670562} githubCheckPublishingSecrets: @@ -970,6 +798,8 @@ examples: query: generate_gen_lock_id: "" responses: + 2XX: + application/json: {} 4XX: application/json: {"message": "", "status_code": 749379} githubConfigureCodeSamples: @@ -1002,8 +832,27 @@ examples: org: "" repo: "" responses: + 2XX: + application/json: {} 4XX: application/json: {"message": "", "status_code": 252330} + getGithubSetupState: + speakeasy-default-get-github-setup-state: + parameters: + query: + org: "" + repo: "" + generate_gen_lock_id: "" + responses: + 2XX: + application/json: {"actions": {"generation_action_configured": false, "publish_action_configured": false}, "app_installed": false, "secrets": {"api_key_configured": true, "publishing_secrets_configured": true}} + 4XX: + application/json: {"message": "", "status_code": 743106} + linkGithubAccess: + speakeasy-default-link-github-access: + responses: + 4XX: + application/json: {"message": "", "status_code": 774553} githubStorePublishingSecrets: speakeasy-default-github-store-publishing-secrets: requestBody: @@ -1021,17 +870,34 @@ examples: createOrganization: speakeasy-default-create-organization: requestBody: - application/json: {"account_type": "scale-up", "created_at": "2023-12-01T17:06:07.804Z", "id": "", "name": "", "slug": "", "telemetry_disabled": true, "updated_at": "2022-05-28T06:20:22.766Z"} + application/json: {"account_type": "scale-up", "created_at": "2024-11-30T17:06:07.804Z", "id": "", "name": "", "slug": "", "sso_activated": true, "telemetry_disabled": true, "updated_at": "2023-03-17T15:39:20.911Z"} responses: 2XX: - application/json: {"account_type": "free", "created_at": "2024-05-22T22:27:14.379Z", "id": "", "name": "", "slug": "", "telemetry_disabled": false, "updated_at": "2022-01-01T02:16:41.381Z"} + application/json: {"account_type": "enterprise", "created_at": "2025-11-08T08:43:39.394Z", "id": "", "name": "", "slug": "", "sso_activated": true, "telemetry_disabled": true, "updated_at": "2023-04-09T14:25:29.356Z"} 4XX: - application/json: {"message": "", "status_code": 169727} + application/json: {"message": "", "status_code": 792620} + createBillingAddOns: + speakeasy-default-create-billing-add-ons: + requestBody: + application/json: {"add_ons": ["sdk_testing", "sdk_testing", "webhooks"]} + responses: + "200": + application/json: {"add_ons": ["custom_code_regions", "custom_code_regions", "sdk_testing"]} + 5XX: + application/json: {"message": "", "status_code": 518517} createFreeTrial: speakeasy-default-create-free-trial: responses: 4XX: application/json: {"message": "", "status_code": 728627} + deleteBillingAddOn: + speakeasy-default-delete-billing-add-on: + parameters: + path: + add_on: "custom_code_regions" + responses: + 5XX: + application/json: {"message": "", "status_code": 783245} getOrganization: speakeasy-default-get-organization: parameters: @@ -1039,23 +905,30 @@ examples: organizationID: "" responses: 2XX: - application/json: {"account_type": "business", "created_at": "2023-09-05T11:33:52.011Z", "id": "", "name": "", "slug": "", "telemetry_disabled": false, "updated_at": "2023-07-26T06:33:15.810Z"} + application/json: {"account_type": "business", "created_at": "2024-09-04T11:33:52.011Z", "id": "", "name": "", "slug": "", "sso_activated": false, "telemetry_disabled": false, "updated_at": "2025-11-29T01:50:48.954Z"} 4XX: - application/json: {"message": "", "status_code": 969961} + application/json: {"message": "", "status_code": 458049} getOrganizations: speakeasy-default-get-organizations: responses: 2XX: - application/json: [{"account_type": "free", "created_at": "2023-10-18T22:25:06.537Z", "id": "", "name": "", "slug": "", "telemetry_disabled": false, "updated_at": "2022-01-18T20:59:19.735Z"}] + application/json: [{"account_type": "free", "created_at": "2024-10-17T22:25:06.537Z", "id": "", "name": "", "slug": "", "sso_activated": false, "telemetry_disabled": true, "updated_at": "2024-05-22T13:01:16.115Z"}, {"account_type": "business", "created_at": "2023-03-09T16:25:53.264Z", "id": "", "name": "", "slug": "", "sso_activated": false, "telemetry_disabled": false, "updated_at": "2023-06-16T08:07:08.454Z"}] 4XX: - application/json: {"message": "", "status_code": 463086} + application/json: {"message": "", "status_code": 217828} + getBillingAddOns: + speakeasy-default-get-billing-add-ons: + responses: + "200": + application/json: {"add_ons": []} + 5XX: + application/json: {"message": "", "status_code": 697034} getOrganizationUsage: speakeasy-default-get-organization-usage: responses: 2XX: - application/json: {"allowed_languages": [], "total_allowed_languages": 863126, "usage": [{"accessible": false, "accessible_features": [""], "gen_lock_ids": ["", "", ""], "language": "", "number_of_operations": 939867, "used_features": ["", "", ""], "workspaces": [""]}, {"accessible": false, "accessible_features": [""], "gen_lock_ids": ["", "", ""], "language": "", "number_of_operations": 478406, "used_features": ["", ""], "workspaces": [""]}]} + application/json: {"allowed_languages": [], "total_allowed_languages": 863126, "usage": [{"accessible": false, "accessible_features": [""], "gen_lock_ids": ["", "", ""], "language": "", "max_operations": 939867, "number_of_operations": 881790, "used_features": [""], "workspaces": ["", ""]}, {"accessible": true, "accessible_features": ["", "", ""], "gen_lock_ids": [""], "language": "", "max_operations": 593645, "number_of_operations": 369818, "used_features": [""], "workspaces": []}]} 4XX: - application/json: {"message": "", "status_code": 378127} + application/json: {"message": "", "status_code": 804495} getChangesReportSignedUrl: speakeasy-default-get-changes-report-signed-url: parameters: @@ -1075,10 +948,19 @@ examples: uploadReport: speakeasy-default-upload-report: requestBody: - multipart/form-data: {"file": {"": "example.file"}} + multipart/form-data: {"data": {}, "file": {"": "example.file"}} responses: 2XX: application/json: {"url": "https://cluttered-stall.info"} + createSchemaStoreItem: + speakeasy-default-create-schema-store-item: + requestBody: + application/json: {"format": "yaml", "packageName": "", "sdkClassname": "", "spec": ""} + responses: + 2XX: + application/json: {"created_at": "2024-08-06T03:45:46.936Z", "format": "json", "id": "", "packageName": "", "sdkClassname": "", "spec": ""} + 4XX: + application/json: {"message": "", "status_code": 769739} create: speakeasy-default-create: requestBody: @@ -1086,13 +968,41 @@ examples: responses: 2XX: application/json: {"full_url": "https://standard-utilization.com/", "short_url": "https://brisk-seafood.net/"} + activateSubscriptionNamespace: + speakeasy-default-activate-subscription-namespace: + parameters: + path: + subscriptionID: "" + namespaceName: "" + responses: + 4XX: + application/json: {"message": "", "status_code": 566510} + ignoreSubscriptionNamespace: + speakeasy-default-ignore-subscription-namespace: + parameters: + path: + subscriptionID: "" + namespaceName: "" + responses: + 4XX: + application/json: {"message": "", "status_code": 844164} suggest: speakeasy-default-suggest: parameters: header: x-session-id: "" requestBody: - application/json: {"diagnostics": [{"message": "", "path": ["/opt/include", "/opt/share"], "type": ""}, {"message": "", "path": [], "type": ""}], "oas_summary": {"info": {"description": "amid traffic the unfortunately underneath what father lovely out", "summary": "", "title": "", "version": ""}, "operations": [{"description": "times dull than except", "method": "", "operation_id": "", "path": "/mnt", "tags": ["", ""]}]}, "suggestion_type": "diagnostics-only"} + application/json: {"diagnostics": [{"message": "", "path": ["/opt/include", "/opt/share"], "type": ""}, {"message": "", "path": [], "type": ""}], "oas_summary": {"info": {"description": "amid traffic the unfortunately underneath what father lovely out", "license": {}, "summary": "", "title": "", "version": ""}, "operations": [{"description": "times dull than except", "method": "", "operation_id": "", "path": "/mnt", "tags": ["", ""]}]}, "suggestion_type": "diagnostics-only"} + responses: + 2XX: + application/json: "x-file: example.file" + suggestItems: + speakeasy-default-suggest-items: + requestBody: + application/json: {"items": [], "prompt": ""} + responses: + 2XX: + application/json: ["", ""] suggestOpenAPI: speakeasy-default-suggest-open-API: parameters: @@ -1100,6 +1010,9 @@ examples: x-session-id: "" requestBody: multipart/form-data: {"schema": {"": "example.file"}} + responses: + 2XX: + application/json: "x-file: example.file" suggestOpenAPIRegistry: speakeasy-default-suggest-open-API-registry: parameters: @@ -1108,25 +1021,28 @@ examples: revision_reference: "" header: x-session-id: "" + responses: + 2XX: + application/json: "x-file: example.file" createWorkspace: speakeasy-default-create-workspace: requestBody: - application/json: {"created_at": "2023-06-18T07:14:55.338Z", "id": "", "name": "", "organization_id": "", "slug": "", "telemetry_disabled": false, "updated_at": "2023-04-03T12:48:32.253Z", "verified": true} + application/json: {"created_at": "2024-06-17T07:14:55.338Z", "id": "", "name": "", "organization_id": "", "slug": "", "updated_at": "2024-11-30T17:06:07.804Z", "verified": true} responses: 2XX: - application/json: {"created_at": "2022-03-17T15:39:20.911Z", "id": "", "name": "", "organization_id": "", "slug": "", "telemetry_disabled": false, "updated_at": "2024-11-08T08:43:39.394Z", "verified": true} + application/json: {"created_at": "2023-05-28T06:20:22.766Z", "id": "", "name": "", "organization_id": "", "slug": "", "updated_at": "2023-03-17T15:39:20.911Z", "verified": false} 4XX: - application/json: {"message": "", "status_code": 169727} + application/json: {"message": "", "status_code": 951062} createWorkspaceToken: speakeasy-default-create-workspace-token: parameters: path: workspace_id: "" requestBody: - application/json: {"alg": "", "created_at": "", "id": "", "key": "", "name": ""} + application/json: {"alg": "", "created_at": "2023-08-16T02:33:00.784Z", "id": "", "key": "", "name": "", "workspace_id": ""} responses: 4XX: - application/json: {"message": "", "status_code": 207213} + application/json: {"message": "", "status_code": 966454} deleteWorkspaceToken: speakeasy-default-delete-workspace-token: parameters: @@ -1140,16 +1056,16 @@ examples: speakeasy-default-get-workspace-by-context: responses: 2XX: - application/json: {"organization": {"account_type": "business", "created_at": "2023-09-05T11:33:52.011Z", "id": "", "name": "", "slug": "", "telemetry_disabled": false, "updated_at": "2023-07-26T06:33:15.810Z"}, "workspace": {"created_at": "2024-11-29T01:50:48.954Z", "id": "", "name": "", "organization_id": "", "slug": "", "telemetry_disabled": true, "updated_at": "2023-05-10T02:28:23.533Z", "verified": true}} + application/json: {"organization": {"account_type": "business", "created_at": "2024-09-04T11:33:52.011Z", "id": "", "name": "", "slug": "", "sso_activated": false, "telemetry_disabled": false, "updated_at": "2025-11-29T01:50:48.954Z"}, "workspace": {"created_at": "2024-05-17T00:32:02.244Z", "id": "", "name": "", "organization_id": "", "slug": "", "updated_at": "2024-05-09T02:28:23.533Z", "verified": true}} 4XX: application/json: {"message": "", "status_code": 213457} getWorkspaces: speakeasy-default-get-workspaces: responses: 2XX: - application/json: [{"created_at": "2022-03-06T21:36:22.528Z", "id": "", "name": "", "organization_id": "", "slug": "", "telemetry_disabled": false, "updated_at": "2023-12-15T17:14:28.501Z", "verified": true}] + application/json: [{"created_at": "2023-03-06T21:36:22.528Z", "id": "", "name": "", "organization_id": "", "slug": "", "updated_at": "2024-10-17T22:25:06.537Z", "verified": false}, {"created_at": "2023-01-18T20:59:19.735Z", "id": "", "name": "", "organization_id": "", "slug": "", "updated_at": "2024-05-22T13:01:16.115Z", "verified": false}] 4XX: - application/json: {"message": "", "status_code": 463086} + application/json: {"message": "", "status_code": 61756} getWorkspace: speakeasy-default-get-workspace: parameters: @@ -1157,15 +1073,17 @@ examples: workspace_id: "" responses: 2XX: - application/json: {"created_at": "2024-11-17T10:14:22.985Z", "id": "", "name": "", "organization_id": "", "slug": "", "telemetry_disabled": false, "updated_at": "2024-10-23T07:17:30.329Z", "verified": false} + application/json: {"created_at": "2025-11-17T10:14:22.985Z", "id": "", "name": "", "organization_id": "", "slug": "", "updated_at": "2025-07-28T15:04:25.117Z", "verified": false} 4XX: - application/json: {"message": "", "status_code": 627126} + application/json: {"message": "", "status_code": 868924} getWorkspaceFeatureFlags: speakeasy-default-get-workspace-feature-flags: parameters: path: workspace_id: "" responses: + "200": + application/json: {} 5XX: application/json: {"message": "", "status_code": 104495} getWorkspaceSettings: @@ -1175,9 +1093,9 @@ examples: workspace_id: "" responses: 2XX: - application/json: {"workspace_id": ""} + application/json: {"created_at": "2025-05-29T22:34:47.605Z", "updated_at": "2024-02-24T21:50:01.663Z", "webhook_url": "https://different-amendment.com/", "workspace_id": ""} 4XX: - application/json: {"message": "", "status_code": 802866} + application/json: {"message": "", "status_code": 864485} getWorkspaceTeam: speakeasy-default-get-workspace-team: parameters: @@ -1195,9 +1113,9 @@ examples: workspace_id: "" responses: 2XX: - application/json: [{"alg": "", "created_at": "", "id": "", "key": "", "name": ""}, {"alg": "", "created_at": "", "id": "", "key": "", "name": ""}, {"alg": "", "created_at": "", "id": "", "key": "", "name": ""}] + application/json: [{"alg": "", "created_at": "2024-06-30T03:05:24.969Z", "id": "", "key": "", "name": "", "workspace_id": ""}, {"alg": "", "created_at": "2024-11-09T11:33:52.654Z", "id": "", "key": "", "name": "", "workspace_id": ""}, {"alg": "", "created_at": "2024-11-05T09:03:46.133Z", "id": "", "key": "", "name": "", "workspace_id": ""}] 4XX: - application/json: {"message": "", "status_code": 498293} + application/json: {"message": "", "status_code": 858647} grantUserAccessToWorkspace: speakeasy-default-grant-user-access-to-workspace: parameters: @@ -1218,48 +1136,35 @@ examples: responses: 4XX: application/json: {"message": "", "status_code": 243814} + setWorkspaceFeatureFlags: + speakeasy-default-set-workspace-feature-flags: + requestBody: + application/json: {"feature_flags": ["skip_schema_registry", "webhooks"]} + responses: + "200": + application/json: {} + 5XX: + application/json: {"message": "", "status_code": 264889} updateWorkspaceDetails: speakeasy-default-update-workspace-details: parameters: path: workspace_id: "" requestBody: - application/json: {"created_at": "2024-07-28T19:04:48.565Z", "id": "", "name": "", "organization_id": "", "slug": "", "telemetry_disabled": false, "updated_at": "2023-01-13T16:52:57.274Z", "verified": false} + application/json: {"created_at": "2025-07-28T19:04:48.565Z", "id": "", "name": "", "organization_id": "", "slug": "", "updated_at": "2024-10-16T10:52:42.015Z", "verified": true} responses: 4XX: - application/json: {"message": "", "status_code": 627690} + application/json: {"message": "", "status_code": 991464} updateWorkspaceSettings: speakeasy-default-update-workspace-settings: parameters: path: workspace_id: "" requestBody: - application/json: {"workspace_id": ""} - responses: - 4XX: - application/json: {"message": "", "status_code": 169241} - getEmbedAccessToken: - speakeasy-default-get-embed-access-token: - responses: - 2XX: - application/json: {"access_token": ""} - 4XX: - application/json: {"message": "", "status_code": 964408} - getValidEmbedAccessTokens: - speakeasy-default-get-valid-embed-access-tokens: - responses: - 2XX: - application/json: [{"created_at": "2023-04-01T02:00:55.877Z", "created_by": "", "description": "tedious impossible circa", "expires_at": "2022-07-22T15:28:07.761Z", "filters": "", "id": "", "workspace_id": ""}, {"created_at": "2022-12-26T20:48:17.803Z", "created_by": "", "description": "lest whoa before jaunty", "expires_at": "2023-07-27T09:40:38.504Z", "filters": "", "id": "", "workspace_id": ""}, {"created_at": "2022-05-24T13:57:56.058Z", "created_by": "", "description": "after pace supplier reclassify", "expires_at": "2024-03-28T04:21:31.912Z", "filters": "", "id": "", "workspace_id": ""}] - 4XX: - application/json: {"message": "", "status_code": 942675} - revokeEmbedAccessToken: - speakeasy-default-revoke-embed-access-token: - parameters: - path: - tokenID: "" + application/json: {"created_at": "2023-07-05T11:43:28.305Z", "updated_at": "2024-05-14T05:39:21.874Z", "webhook_url": "https://grown-pharmacopoeia.net", "workspace_id": ""} responses: 4XX: - application/json: {"message": "", "status_code": 217594} + application/json: {"message": "", "status_code": 54657} getWorkspaceEventsByTarget: speakeasy-default-get-workspace-events-by-target: parameters: @@ -1269,14 +1174,14 @@ examples: query: {} responses: "200": - application/json: [] + application/json: [{"created_at": "2023-11-22T11:46:52.430Z", "execution_id": "", "id": "", "interaction_type": "QUICKSTART", "local_started_at": "2023-09-25T12:14:43.566Z", "speakeasy_api_key_name": "", "speakeasy_version": "", "success": true, "workspace_id": ""}] 5XX: - application/json: {"message": "", "status_code": 296981} + application/json: {"message": "", "status_code": 858330} getWorkspaceTargets: speakeasy-default-get-workspace-targets: responses: "200": - application/json: [{"generate_gen_lock_id": "", "generate_target": "", "id": "", "last_event_created_at": "2024-12-14T05:15:52.449Z", "last_event_id": "", "last_event_interaction_type": "TARGET_GENERATE"}, {"generate_gen_lock_id": "", "generate_target": "", "id": "", "last_event_created_at": "2022-05-31T08:33:28.499Z", "last_event_id": "", "last_event_interaction_type": "CLI_EXEC"}] + application/json: [{"generate_gen_lock_id": "", "generate_target": "", "id": "", "last_event_created_at": "2025-12-14T05:15:52.449Z", "last_event_id": "", "last_event_interaction_type": "TARGET_GENERATE"}, {"generate_gen_lock_id": "", "generate_target": "", "id": "", "last_event_created_at": "2023-05-31T08:33:28.499Z", "last_event_id": "", "last_event_interaction_type": "CLI_EXEC"}] 5XX: application/json: {"message": "", "status_code": 801192} getWorkspaceTargetsDeprecated: @@ -1287,16 +1192,16 @@ examples: query: {} responses: "200": - application/json: [] + application/json: [{"generate_gen_lock_id": "", "generate_target": "", "id": "", "last_event_created_at": "2023-10-08T11:47:38.510Z", "last_event_id": "", "last_event_interaction_type": "TOMBSTONE"}] 5XX: - application/json: {"message": "", "status_code": 255923} + application/json: {"message": "", "status_code": 264673} postWorkspaceEvents: speakeasy-default-post-workspace-events: parameters: path: workspace_id: "" requestBody: - application/json: [{"created_at": "2024-03-02T10:07:28.113Z", "execution_id": "", "id": "", "interaction_type": "AUTHENTICATE", "local_started_at": "2024-08-12T17:54:17.538Z", "speakeasy_api_key_name": "", "speakeasy_version": "", "success": true, "workspace_id": ""}] + application/json: [{"created_at": "2025-03-02T10:07:28.113Z", "execution_id": "", "id": "", "interaction_type": "AUTHENTICATE", "local_started_at": "2025-08-12T17:54:17.538Z", "speakeasy_api_key_name": "", "speakeasy_version": "", "success": true, "workspace_id": ""}] responses: 5XX: application/json: {"message": "", "status_code": 630719} @@ -1308,6 +1213,8 @@ examples: query: {} responses: "200": - application/json: [{"created_at": "2023-01-24T23:49:11.608Z", "execution_id": "", "id": "", "interaction_type": "LINT", "local_started_at": "2022-03-09T07:00:10.489Z", "speakeasy_api_key_name": "", "speakeasy_version": "", "success": true, "workspace_id": ""}] + application/json: [{"created_at": "2024-01-24T23:49:11.608Z", "execution_id": "", "id": "", "interaction_type": "LINT", "local_started_at": "2023-03-09T07:00:10.489Z", "speakeasy_api_key_name": "", "speakeasy_version": "", "success": true, "workspace_id": ""}] 5XX: application/json: {"message": "", "status_code": 238575} +examplesVersion: 1.0.1 +generatedTests: {} diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 892e52a8..803b9789 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,18 +1,21 @@ -speakeasyVersion: 1.414.1 +speakeasyVersion: 1.531.0 sources: my-source: sourceNamespace: my-source - sourceRevisionDigest: sha256:1028a5681cdb95a67b15df8dbdc317bb263a1a3777b8f0a01adfa4cf681d5ac4 - sourceBlobDigest: sha256:09998bda13d2cfb8f8b4358ed65c6a132bd8a5f7fc1825bf153dec19b1c89744 + sourceRevisionDigest: sha256:bdfc64e4f20ef8c14cfecee6bae014b270763cecef359b0d9849f770b94aba61 + sourceBlobDigest: sha256:7d89bc5d5d174d4b21964c5c8e198e1910b6a2753080cc7c73a8cbede420c980 tags: - latest - - main + - speakeasy-sdk-regen-1736295504 + - 0.4.0 targets: speakeasy-client-sdk-typescript: source: my-source sourceNamespace: my-source - sourceRevisionDigest: sha256:1028a5681cdb95a67b15df8dbdc317bb263a1a3777b8f0a01adfa4cf681d5ac4 - sourceBlobDigest: sha256:09998bda13d2cfb8f8b4358ed65c6a132bd8a5f7fc1825bf153dec19b1c89744 + sourceRevisionDigest: sha256:bdfc64e4f20ef8c14cfecee6bae014b270763cecef359b0d9849f770b94aba61 + sourceBlobDigest: sha256:7d89bc5d5d174d4b21964c5c8e198e1910b6a2753080cc7c73a8cbede420c980 + codeSamplesNamespace: my-source-typescript-code-samples + codeSamplesRevisionDigest: sha256:ec105a64429440d67e7413f89582069c0049b24587804b6a69d4658e54a00d31 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest @@ -29,3 +32,9 @@ workflow: publish: npm: token: $npm_token + codeSamples: + registry: + location: registry.speakeasyapi.dev/speakeasy-self/speakeasy-self/my-source-typescript-code-samples + labelOverride: + fixedValue: Typescript (SDK) + blocking: false diff --git a/.speakeasy/workflow.yaml b/.speakeasy/workflow.yaml index 41c33f41..4e929230 100644 --- a/.speakeasy/workflow.yaml +++ b/.speakeasy/workflow.yaml @@ -13,3 +13,9 @@ targets: publish: npm: token: $npm_token + codeSamples: + registry: + location: registry.speakeasyapi.dev/speakeasy-self/speakeasy-self/my-source-typescript-code-samples + labelOverride: + fixedValue: Typescript (SDK) + blocking: false diff --git a/FUNCTIONS.md b/FUNCTIONS.md index 582c28fc..62187f9f 100644 --- a/FUNCTIONS.md +++ b/FUNCTIONS.md @@ -20,7 +20,7 @@ specific category of applications. ```typescript import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; -import { apisGetApis } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/apisGetApis.js"; +import { artifactsCreateRemoteSource } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/artifactsCreateRemoteSource.js"; import { SDKValidationError } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/errors/sdkvalidationerror.js"; // Use `SpeakeasyCore` for best tree-shaking performance. @@ -32,7 +32,7 @@ const speakeasy = new SpeakeasyCore({ }); async function run() { - const res = await apisGetApis(speakeasy, {}); + const res = await artifactsCreateRemoteSource(speakeasy); switch (true) { case res.ok: diff --git a/README.md b/README.md index e56a3dae..c0118721 100644 --- a/README.md +++ b/README.md @@ -20,26 +20,28 @@ ## Summary -Speakeasy API: The Speakeasy API allows teams to manage common operations with their APIs +Speakeasy API: The Subscriptions API manages subscriptions for CLI and registry events For more information about the API: [The Speakeasy Platform Documentation](/docs) ## Table of Contents + + * [SDK Installation](#sdk-installation) + * [SDK Example Usage](#sdk-example-usage) + * [Available Resources and Operations](#available-resources-and-operations) + * [Error Handling](#error-handling) + * [Server Selection](#server-selection) + * [Custom HTTP Client](#custom-http-client) + * [Authentication](#authentication) + * [Retries](#retries) + * [Requirements](#requirements) + * [Standalone functions](#standalone-functions) + * [Global Parameters](#global-parameters) + * [File uploads](#file-uploads) + * [Debugging](#debugging) -* [SDK Installation](#sdk-installation) -* [Requirements](#requirements) -* [SDK Example Usage](#sdk-example-usage) -* [Available Resources and Operations](#available-resources-and-operations) -* [Standalone functions](#standalone-functions) -* [File uploads](#file-uploads) -* [Retries](#retries) -* [Error Handling](#error-handling) -* [Server Selection](#server-selection) -* [Custom HTTP Client](#custom-http-client) -* [Authentication](#authentication) -* [Debugging](#debugging) @@ -73,6 +75,97 @@ yarn add @speakeasy-api/speakeasy-client-sdk-typescript zod # Note that Yarn does not install peer dependencies automatically. You will need # to install zod as shown above. ``` + + + +### Model Context Protocol (MCP) Server + +This SDK is also an installable MCP server where the various SDK methods are +exposed as tools that can be invoked by AI applications. + +> Node.js v20 or greater is required to run the MCP server from npm. + +
+Claude installation steps + +Add the following server definition to your `claude_desktop_config.json` file: + +```json +{ + "mcpServers": { + "Speakeasy": { + "command": "npx", + "args": [ + "-y", "--package", "@speakeasy-api/speakeasy-client-sdk-typescript", + "--", + "mcp", "start", + "--api-key", "...", + "--bearer", "...", + "--workspace-identifier", "...", + "--workspace-id", "..." + ] + } + } +} +``` + +
+ +
+Cursor installation steps + +Create a `.cursor/mcp.json` file in your project root with the following content: + +```json +{ + "mcpServers": { + "Speakeasy": { + "command": "npx", + "args": [ + "-y", "--package", "@speakeasy-api/speakeasy-client-sdk-typescript", + "--", + "mcp", "start", + "--api-key", "...", + "--bearer", "...", + "--workspace-identifier", "...", + "--workspace-id", "..." + ] + } + } +} +``` + +
+ +You can also run MCP servers as a standalone binary with no additional dependencies. You must pull these binaries from available Github releases: + +```bash +curl -L -o mcp-server \ + https://github.com/{org}/{repo}/releases/download/{tag}/mcp-server-bun-darwin-arm64 && \ +chmod +x mcp-server +``` + +If the repo is a private repo you must add your Github PAT to download a release `-H "Authorization: Bearer {GITHUB_PAT}"`. + + +```json +{ + "mcpServers": { + "Todos": { + "command": "./DOWNLOAD/PATH/mcp-server", + "args": [ + "start" + ] + } + } +} +``` + +For a full list of server arguments, run: + +```sh +npx -y --package @speakeasy-api/speakeasy-client-sdk-typescript -- mcp start --help +``` @@ -90,7 +183,7 @@ const speakeasy = new Speakeasy({ }); async function run() { - const result = await speakeasy.apis.getApis({}); + const result = await speakeasy.artifacts.createRemoteSource(); // Handle the result console.log(result); @@ -107,35 +200,19 @@ run();
Available methods -### [apiEndpoints](docs/sdks/apiendpoints/README.md) - -* [deleteApiEndpoint](docs/sdks/apiendpoints/README.md#deleteapiendpoint) - Delete an ApiEndpoint. -* [findApiEndpoint](docs/sdks/apiendpoints/README.md#findapiendpoint) - Find an ApiEndpoint via its displayName. -* [generateOpenApiSpecForApiEndpoint](docs/sdks/apiendpoints/README.md#generateopenapispecforapiendpoint) - Generate an OpenAPI specification for a particular ApiEndpoint. -* [generatePostmanCollectionForApiEndpoint](docs/sdks/apiendpoints/README.md#generatepostmancollectionforapiendpoint) - Generate a Postman collection for a particular ApiEndpoint. -* [getAllApiEndpoints](docs/sdks/apiendpoints/README.md#getallapiendpoints) - Get all Api endpoints for a particular apiID. -* [getAllForVersionApiEndpoints](docs/sdks/apiendpoints/README.md#getallforversionapiendpoints) - Get all ApiEndpoints for a particular apiID and versionID. -* [getApiEndpoint](docs/sdks/apiendpoints/README.md#getapiendpoint) - Get an ApiEndpoint. -* [upsertApiEndpoint](docs/sdks/apiendpoints/README.md#upsertapiendpoint) - Upsert an ApiEndpoint. - -### [apis](docs/sdks/apis/README.md) - -* [deleteApi](docs/sdks/apis/README.md#deleteapi) - Delete an Api. -* [generateOpenApiSpec](docs/sdks/apis/README.md#generateopenapispec) - Generate an OpenAPI specification for a particular Api. -* [generatePostmanCollection](docs/sdks/apis/README.md#generatepostmancollection) - Generate a Postman collection for a particular Api. -* [getAllApiVersions](docs/sdks/apis/README.md#getallapiversions) - Get all Api versions for a particular ApiEndpoint. -* [getApis](docs/sdks/apis/README.md#getapis) - Get a list of Apis for a given workspace -* [upsertApi](docs/sdks/apis/README.md#upsertapi) - Upsert an Api - ### [artifacts](docs/sdks/artifacts/README.md) +* [createRemoteSource](docs/sdks/artifacts/README.md#createremotesource) - Configure a new remote source * [getBlob](docs/sdks/artifacts/README.md#getblob) - Get blob for a particular digest * [getManifest](docs/sdks/artifacts/README.md#getmanifest) - Get manifest for a particular reference * [getNamespaces](docs/sdks/artifacts/README.md#getnamespaces) - Each namespace contains many revisions. * [getRevisions](docs/sdks/artifacts/README.md#getrevisions) * [getTags](docs/sdks/artifacts/README.md#gettags) +* [listRemoteSources](docs/sdks/artifacts/README.md#listremotesources) - Get remote sources attached to a particular namespace * [postTags](docs/sdks/artifacts/README.md#posttags) - Add tags to an existing revision * [preflight](docs/sdks/artifacts/README.md#preflight) - Get access token for communicating with OCI distribution endpoints +* [setArchived](docs/sdks/artifacts/README.md#setarchived) - Set whether a namespace is archived +* [setVisibility](docs/sdks/artifacts/README.md#setvisibility) - Set visibility of a namespace with an existing metadata entry ### [auth](docs/sdks/auth/README.md) @@ -144,11 +221,12 @@ run(); * [getUser](docs/sdks/auth/README.md#getuser) - Get information about the current user. * [validateApiKey](docs/sdks/auth/README.md#validateapikey) - Validate the current api key. -### [embeds](docs/sdks/embeds/README.md) +### [codeSamples](docs/sdks/codesamples/README.md) -* [getEmbedAccessToken](docs/sdks/embeds/README.md#getembedaccesstoken) - Get an embed access token for the current workspace. -* [getValidEmbedAccessTokens](docs/sdks/embeds/README.md#getvalidembedaccesstokens) - Get all valid embed access tokens for the current workspace. -* [revokeEmbedAccessToken](docs/sdks/embeds/README.md#revokeembedaccesstoken) - Revoke an embed access EmbedToken. +* [generateCodeSamplePreview](docs/sdks/codesamples/README.md#generatecodesamplepreview) - Generate Code Sample previews from a file and configuration parameters. +* [generateCodeSamplePreviewAsync](docs/sdks/codesamples/README.md#generatecodesamplepreviewasync) - Initiate asynchronous Code Sample preview generation from a file and configuration parameters, receiving an async JobID response for polling. +* [get](docs/sdks/codesamples/README.md#get) - Retrieve usage snippets +* [getCodeSamplePreviewAsync](docs/sdks/codesamples/README.md#getcodesamplepreviewasync) - Poll for the result of an asynchronous Code Sample preview generation. ### [events](docs/sdks/events/README.md) @@ -167,21 +245,20 @@ run(); * [configureMintlifyRepo](docs/sdks/github/README.md#configuremintlifyrepo) * [configureTarget](docs/sdks/github/README.md#configuretarget) * [getAction](docs/sdks/github/README.md#getaction) +* [getSetup](docs/sdks/github/README.md#getsetup) +* [linkGithub](docs/sdks/github/README.md#linkgithub) * [storePublishingSecrets](docs/sdks/github/README.md#storepublishingsecrets) * [triggerAction](docs/sdks/github/README.md#triggeraction) -### [metadata](docs/sdks/metadata/README.md) - -* [deleteVersionMetadata](docs/sdks/metadata/README.md#deleteversionmetadata) - Delete metadata for a particular apiID and versionID. -* [getVersionMetadata](docs/sdks/metadata/README.md#getversionmetadata) - Get all metadata for a particular apiID and versionID. -* [insertVersionMetadata](docs/sdks/metadata/README.md#insertversionmetadata) - Insert metadata for a particular apiID and versionID. - ### [organizations](docs/sdks/organizations/README.md) * [create](docs/sdks/organizations/README.md#create) - Create an organization +* [createBillingAddOns](docs/sdks/organizations/README.md#createbillingaddons) - Create billing add ons * [createFreeTrial](docs/sdks/organizations/README.md#createfreetrial) - Create a free trial for an organization +* [deleteBillingAddOn](docs/sdks/organizations/README.md#deletebillingaddon) - Delete billing add ons * [get](docs/sdks/organizations/README.md#get) - Get organization * [getAll](docs/sdks/organizations/README.md#getall) - Get organizations for a user +* [getBillingAddOns](docs/sdks/organizations/README.md#getbillingaddons) - Get billing add ons * [getUsage](docs/sdks/organizations/README.md#getusage) - Get billing usage summary for a particular organization ### [reports](docs/sdks/reports/README.md) @@ -190,31 +267,24 @@ run(); * [getLintingReportSignedUrl](docs/sdks/reports/README.md#getlintingreportsignedurl) - Get the signed access url for the linting reports for a particular document. * [uploadReport](docs/sdks/reports/README.md#uploadreport) - Upload a report. -### [requests](docs/sdks/requests/README.md) - -* [generateRequestPostmanCollection](docs/sdks/requests/README.md#generaterequestpostmancollection) - Generate a Postman collection for a particular request. -* [getRequestFromEventLog](docs/sdks/requests/README.md#getrequestfromeventlog) - Get information about a particular request. -* [queryEventLog](docs/sdks/requests/README.md#queryeventlog) - Query the event log to retrieve a list of requests. +### [schemaStore](docs/sdks/schemastore/README.md) -### [schemas](docs/sdks/schemas/README.md) - -* [deleteSchema](docs/sdks/schemas/README.md#deleteschema) - Delete a particular schema revision for an Api. -* [downloadSchema](docs/sdks/schemas/README.md#downloadschema) - Download the latest schema for a particular apiID. -* [downloadSchemaRevision](docs/sdks/schemas/README.md#downloadschemarevision) - Download a particular schema revision for an Api. -* [getSchema](docs/sdks/schemas/README.md#getschema) - Get information about the latest schema. -* [getSchemaDiff](docs/sdks/schemas/README.md#getschemadiff) - Get a diff of two schema revisions for an Api. -* [getSchemaRevision](docs/sdks/schemas/README.md#getschemarevision) - Get information about a particular schema revision for an Api. -* [getSchemas](docs/sdks/schemas/README.md#getschemas) - Get information about all schemas associated with a particular apiID. -* [registerSchema](docs/sdks/schemas/README.md#registerschema) - Register a schema. +* [createSchemaStoreItem](docs/sdks/schemastore/README.md#createschemastoreitem) - Create a schema in the schema store ### [shortURLs](docs/sdks/shorturls/README.md) * [create](docs/sdks/shorturls/README.md#create) - Shorten a URL. +### [subscriptions](docs/sdks/subscriptions/README.md) + +* [activateSubscriptionNamespace](docs/sdks/subscriptions/README.md#activatesubscriptionnamespace) - Activate an ignored namespace for a subscription +* [ignoreSubscriptionNamespace](docs/sdks/subscriptions/README.md#ignoresubscriptionnamespace) - Ignored a namespace for a subscription + ### [suggest](docs/sdks/suggest/README.md) * [suggest](docs/sdks/suggest/README.md#suggest) - Generate suggestions for improving an OpenAPI document. +* [suggestItems](docs/sdks/suggest/README.md#suggestitems) - Generate generic suggestions for a list of items. * [suggestOpenAPI](docs/sdks/suggest/README.md#suggestopenapi) - (DEPRECATED) Generate suggestions for improving an OpenAPI document. * [suggestOpenAPIRegistry](docs/sdks/suggest/README.md#suggestopenapiregistry) - Generate suggestions for improving an OpenAPI document stored in the registry. @@ -232,6 +302,7 @@ run(); * [getTokens](docs/sdks/workspaces/README.md#gettokens) - Get tokens for a particular workspace * [grantAccess](docs/sdks/workspaces/README.md#grantaccess) - Grant a user access to a particular workspace * [revokeAccess](docs/sdks/workspaces/README.md#revokeaccess) - Revoke a user's access to a particular workspace +* [setFeatureFlags](docs/sdks/workspaces/README.md#setfeatureflags) - Set workspace feature flags * [update](docs/sdks/workspaces/README.md#update) - Update workspace details * [updateSettings](docs/sdks/workspaces/README.md#updatesettings) - Update workspace settings @@ -247,23 +318,11 @@ run(); ## Error Handling -All SDK methods return a response object or throw an error. By default, an API error will throw a `errors.SDKError`. - -If a HTTP request fails, an operation my also throw an error from the `sdk/models/errors/httpclienterrors.ts` module: - -| HTTP Client Error | Description | -| ---------------------------------------------------- | ---------------------------------------------------- | -| RequestAbortedError | HTTP request was aborted by the client | -| RequestTimeoutError | HTTP request timed out due to an AbortSignal signal | -| ConnectionError | HTTP client was unable to make a request to a server | -| InvalidRequestError | Any input used to create a request is invalid | -| UnexpectedClientError | Unrecognised or unexpected error | - -In addition, when custom error responses are specified for an operation, the SDK may throw their associated Error type. You can refer to respective *Errors* tables in SDK docs for more details on possible error types for each operation. For example, the `deleteApi` method may throw the following errors: +If the request fails due to, for example 4XX or 5XX status codes, it will throw a `SDKError`. -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4XX, 5XX | \*/\* | +| Error Type | Status Code | Content Type | +| --------------- | ----------- | ------------ | +| errors.SDKError | 4XX, 5XX | \*/\* | ```typescript import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; @@ -278,23 +337,30 @@ const speakeasy = new Speakeasy({ async function run() { let result; try { - result = await speakeasy.apis.deleteApi({ - apiID: "", - versionID: "", - }); + result = await speakeasy.artifacts.createRemoteSource(); // Handle the result console.log(result); } catch (err) { switch (true) { - case (err instanceof SDKValidationError): { - // Validation errors can be pretty-printed - console.error(err.pretty()); - // Raw value may also be inspected - console.error(err.rawValue); + // The server response does not match the expected SDK schema + case (err instanceof SDKValidationError): + { + // Pretty-print will provide a human-readable multi-line error message + console.error(err.pretty()); + // Raw value may also be inspected + console.error(err.rawValue); + return; + } + sdkerror.js; + // Server returned an error status code or an unknown content type + case (err instanceof SDKError): { + console.error(err.statusCode); + console.error(err.rawResponse.body); return; } default: { + // Other errors such as network errors, see HTTPClientErrors for more details throw err; } } @@ -305,7 +371,17 @@ run(); ``` -Validation errors can also occur when either method arguments or data returned from the server do not match the expected format. The `SDKValidationError` that is thrown as a result will capture the raw value that failed validation in an attribute called `rawValue`. Additionally, a `pretty()` method is available on this error that can be used to log a nicely formatted string since validation errors can list many issues and the plain error string may be difficult read when debugging. +Validation errors can also occur when either method arguments or data returned from the server do not match the expected format. The `SDKValidationError` that is thrown as a result will capture the raw value that failed validation in an attribute called `rawValue`. Additionally, a `pretty()` method is available on this error that can be used to log a nicely formatted multi-line string since validation errors can list many issues and the plain error string may be difficult read when debugging. + +In some rare cases, the SDK can fail to get a response from the server or even make the request due to unexpected circumstances such as network conditions. These types of errors are captured in the `sdk/models/errors/httpclienterrors.ts` module: + +| HTTP Client Error | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | +| RequestAbortedError | HTTP request was aborted by the client | +| RequestTimeoutError | HTTP request timed out due to an AbortSignal signal | +| ConnectionError | HTTP client was unable to make a request to a server | +| InvalidRequestError | Any input used to create a request is invalid | +| UnexpectedClientError | Unrecognised or unexpected error | @@ -315,11 +391,13 @@ Validation errors can also occur when either method arguments or data returned f ### Select Server by Name -You can override the default server globally by passing a server name to the `server` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the names associated with the available servers: +You can override the default server globally by passing a server name to the `server: keyof typeof ServerList` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the names associated with the available servers: + +| Name | Server | Description | +| ------ | ----------------------------------- | ----------- | +| `prod` | `https://api.prod.speakeasyapi.dev` | | -| Name | Server | Variables | -| ----- | ------ | --------- | -| `prod` | `https://api.prod.speakeasyapi.dev` | None | +#### Example ```typescript import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; @@ -332,10 +410,7 @@ const speakeasy = new Speakeasy({ }); async function run() { - const result = await speakeasy.apis.deleteApi({ - apiID: "", - versionID: "", - }); + const result = await speakeasy.artifacts.createRemoteSource(); // Handle the result console.log(result); @@ -345,11 +420,9 @@ run(); ``` - ### Override Server URL Per-Client -The default server can also be overridden globally by passing a URL to the `serverURL` optional parameter when initializing the SDK client instance. For example: - +The default server can also be overridden globally by passing a URL to the `serverURL: string` optional parameter when initializing the SDK client instance. For example: ```typescript import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; @@ -361,10 +434,7 @@ const speakeasy = new Speakeasy({ }); async function run() { - const result = await speakeasy.apis.deleteApi({ - apiID: "", - versionID: "", - }); + const result = await speakeasy.artifacts.createRemoteSource(); // Handle the result console.log(result); @@ -435,11 +505,11 @@ const sdk = new Speakeasy({ httpClient }); This SDK supports the following security schemes globally: -| Name | Type | Scheme | -| --------------------- | --------------------- | --------------------- | -| `apiKey` | apiKey | API key | -| `bearer` | http | HTTP Bearer | -| `workspaceIdentifier` | apiKey | API key | +| Name | Type | Scheme | +| --------------------- | ------ | ----------- | +| `apiKey` | apiKey | API key | +| `bearer` | http | HTTP Bearer | +| `workspaceIdentifier` | apiKey | API key | You can set the security parameters through the `security` optional parameter when initializing the SDK client instance. The selected scheme will be used by default to authenticate with the API for all operations that support it. For example: ```typescript @@ -452,10 +522,7 @@ const speakeasy = new Speakeasy({ }); async function run() { - const result = await speakeasy.apis.deleteApi({ - apiID: "", - versionID: "", - }); + const result = await speakeasy.artifacts.createRemoteSource(); // Handle the result console.log(result); @@ -482,10 +549,7 @@ const speakeasy = new Speakeasy({ }); async function run() { - const result = await speakeasy.apis.deleteApi({ - apiID: "", - versionID: "", - }, { + const result = await speakeasy.artifacts.createRemoteSource({ retries: { strategy: "backoff", backoff: { @@ -527,10 +591,7 @@ const speakeasy = new Speakeasy({ }); async function run() { - const result = await speakeasy.apis.deleteApi({ - apiID: "", - versionID: "", - }); + const result = await speakeasy.artifacts.createRemoteSource(); // Handle the result console.log(result); @@ -562,34 +623,25 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). Available standalone functions -- [`apiEndpointsDeleteApiEndpoint`](docs/sdks/apiendpoints/README.md#deleteapiendpoint) - Delete an ApiEndpoint. -- [`apiEndpointsFindApiEndpoint`](docs/sdks/apiendpoints/README.md#findapiendpoint) - Find an ApiEndpoint via its displayName. -- [`apiEndpointsGenerateOpenApiSpecForApiEndpoint`](docs/sdks/apiendpoints/README.md#generateopenapispecforapiendpoint) - Generate an OpenAPI specification for a particular ApiEndpoint. -- [`apiEndpointsGeneratePostmanCollectionForApiEndpoint`](docs/sdks/apiendpoints/README.md#generatepostmancollectionforapiendpoint) - Generate a Postman collection for a particular ApiEndpoint. -- [`apiEndpointsGetAllApiEndpoints`](docs/sdks/apiendpoints/README.md#getallapiendpoints) - Get all Api endpoints for a particular apiID. -- [`apiEndpointsGetAllForVersionApiEndpoints`](docs/sdks/apiendpoints/README.md#getallforversionapiendpoints) - Get all ApiEndpoints for a particular apiID and versionID. -- [`apiEndpointsGetApiEndpoint`](docs/sdks/apiendpoints/README.md#getapiendpoint) - Get an ApiEndpoint. -- [`apiEndpointsUpsertApiEndpoint`](docs/sdks/apiendpoints/README.md#upsertapiendpoint) - Upsert an ApiEndpoint. -- [`apisDeleteApi`](docs/sdks/apis/README.md#deleteapi) - Delete an Api. -- [`apisGenerateOpenApiSpec`](docs/sdks/apis/README.md#generateopenapispec) - Generate an OpenAPI specification for a particular Api. -- [`apisGeneratePostmanCollection`](docs/sdks/apis/README.md#generatepostmancollection) - Generate a Postman collection for a particular Api. -- [`apisGetAllApiVersions`](docs/sdks/apis/README.md#getallapiversions) - Get all Api versions for a particular ApiEndpoint. -- [`apisGetApis`](docs/sdks/apis/README.md#getapis) - Get a list of Apis for a given workspace -- [`apisUpsertApi`](docs/sdks/apis/README.md#upsertapi) - Upsert an Api +- [`artifactsCreateRemoteSource`](docs/sdks/artifacts/README.md#createremotesource) - Configure a new remote source - [`artifactsGetBlob`](docs/sdks/artifacts/README.md#getblob) - Get blob for a particular digest - [`artifactsGetManifest`](docs/sdks/artifacts/README.md#getmanifest) - Get manifest for a particular reference - [`artifactsGetNamespaces`](docs/sdks/artifacts/README.md#getnamespaces) - Each namespace contains many revisions. - [`artifactsGetRevisions`](docs/sdks/artifacts/README.md#getrevisions) - [`artifactsGetTags`](docs/sdks/artifacts/README.md#gettags) +- [`artifactsListRemoteSources`](docs/sdks/artifacts/README.md#listremotesources) - Get remote sources attached to a particular namespace - [`artifactsPostTags`](docs/sdks/artifacts/README.md#posttags) - Add tags to an existing revision - [`artifactsPreflight`](docs/sdks/artifacts/README.md#preflight) - Get access token for communicating with OCI distribution endpoints +- [`artifactsSetArchived`](docs/sdks/artifacts/README.md#setarchived) - Set whether a namespace is archived +- [`artifactsSetVisibility`](docs/sdks/artifacts/README.md#setvisibility) - Set visibility of a namespace with an existing metadata entry - [`authGetAccess`](docs/sdks/auth/README.md#getaccess) - Get access allowances for a particular workspace - [`authGetAccessToken`](docs/sdks/auth/README.md#getaccesstoken) - Get or refresh an access token for the current workspace. - [`authGetUser`](docs/sdks/auth/README.md#getuser) - Get information about the current user. - [`authValidateApiKey`](docs/sdks/auth/README.md#validateapikey) - Validate the current api key. -- [`embedsGetEmbedAccessToken`](docs/sdks/embeds/README.md#getembedaccesstoken) - Get an embed access token for the current workspace. -- [`embedsGetValidEmbedAccessTokens`](docs/sdks/embeds/README.md#getvalidembedaccesstokens) - Get all valid embed access tokens for the current workspace. -- [`embedsRevokeEmbedAccessToken`](docs/sdks/embeds/README.md#revokeembedaccesstoken) - Revoke an embed access EmbedToken. +- [`codeSamplesGenerateCodeSamplePreview`](docs/sdks/codesamples/README.md#generatecodesamplepreview) - Generate Code Sample previews from a file and configuration parameters. +- [`codeSamplesGenerateCodeSamplePreviewAsync`](docs/sdks/codesamples/README.md#generatecodesamplepreviewasync) - Initiate asynchronous Code Sample preview generation from a file and configuration parameters, receiving an async JobID response for polling. +- [`codeSamplesGet`](docs/sdks/codesamples/README.md#get) - Retrieve usage snippets +- [`codeSamplesGetCodeSamplePreviewAsync`](docs/sdks/codesamples/README.md#getcodesamplepreviewasync) - Poll for the result of an asynchronous Code Sample preview generation. - [`eventsGetEventsByTarget`](docs/sdks/events/README.md#geteventsbytarget) - Load recent events for a particular workspace - [`eventsGetTargets`](docs/sdks/events/README.md#gettargets) - Load targets for a particular workspace - [`eventsGetTargetsDeprecated`](docs/sdks/events/README.md#gettargetsdeprecated) - Load targets for a particular workspace @@ -602,32 +654,27 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). - [`githubConfigureMintlifyRepo`](docs/sdks/github/README.md#configuremintlifyrepo) - [`githubConfigureTarget`](docs/sdks/github/README.md#configuretarget) - [`githubGetAction`](docs/sdks/github/README.md#getaction) +- [`githubGetSetup`](docs/sdks/github/README.md#getsetup) +- [`githubLinkGithub`](docs/sdks/github/README.md#linkgithub) - [`githubStorePublishingSecrets`](docs/sdks/github/README.md#storepublishingsecrets) - [`githubTriggerAction`](docs/sdks/github/README.md#triggeraction) -- [`metadataDeleteVersionMetadata`](docs/sdks/metadata/README.md#deleteversionmetadata) - Delete metadata for a particular apiID and versionID. -- [`metadataGetVersionMetadata`](docs/sdks/metadata/README.md#getversionmetadata) - Get all metadata for a particular apiID and versionID. -- [`metadataInsertVersionMetadata`](docs/sdks/metadata/README.md#insertversionmetadata) - Insert metadata for a particular apiID and versionID. - [`organizationsCreate`](docs/sdks/organizations/README.md#create) - Create an organization +- [`organizationsCreateBillingAddOns`](docs/sdks/organizations/README.md#createbillingaddons) - Create billing add ons - [`organizationsCreateFreeTrial`](docs/sdks/organizations/README.md#createfreetrial) - Create a free trial for an organization +- [`organizationsDeleteBillingAddOn`](docs/sdks/organizations/README.md#deletebillingaddon) - Delete billing add ons - [`organizationsGet`](docs/sdks/organizations/README.md#get) - Get organization - [`organizationsGetAll`](docs/sdks/organizations/README.md#getall) - Get organizations for a user +- [`organizationsGetBillingAddOns`](docs/sdks/organizations/README.md#getbillingaddons) - Get billing add ons - [`organizationsGetUsage`](docs/sdks/organizations/README.md#getusage) - Get billing usage summary for a particular organization - [`reportsGetChangesReportSignedUrl`](docs/sdks/reports/README.md#getchangesreportsignedurl) - Get the signed access url for the change reports for a particular document. - [`reportsGetLintingReportSignedUrl`](docs/sdks/reports/README.md#getlintingreportsignedurl) - Get the signed access url for the linting reports for a particular document. - [`reportsUploadReport`](docs/sdks/reports/README.md#uploadreport) - Upload a report. -- [`requestsGenerateRequestPostmanCollection`](docs/sdks/requests/README.md#generaterequestpostmancollection) - Generate a Postman collection for a particular request. -- [`requestsGetRequestFromEventLog`](docs/sdks/requests/README.md#getrequestfromeventlog) - Get information about a particular request. -- [`requestsQueryEventLog`](docs/sdks/requests/README.md#queryeventlog) - Query the event log to retrieve a list of requests. -- [`schemasDeleteSchema`](docs/sdks/schemas/README.md#deleteschema) - Delete a particular schema revision for an Api. -- [`schemasDownloadSchema`](docs/sdks/schemas/README.md#downloadschema) - Download the latest schema for a particular apiID. -- [`schemasDownloadSchemaRevision`](docs/sdks/schemas/README.md#downloadschemarevision) - Download a particular schema revision for an Api. -- [`schemasGetSchema`](docs/sdks/schemas/README.md#getschema) - Get information about the latest schema. -- [`schemasGetSchemaDiff`](docs/sdks/schemas/README.md#getschemadiff) - Get a diff of two schema revisions for an Api. -- [`schemasGetSchemaRevision`](docs/sdks/schemas/README.md#getschemarevision) - Get information about a particular schema revision for an Api. -- [`schemasGetSchemas`](docs/sdks/schemas/README.md#getschemas) - Get information about all schemas associated with a particular apiID. -- [`schemasRegisterSchema`](docs/sdks/schemas/README.md#registerschema) - Register a schema. +- [`schemaStoreCreateSchemaStoreItem`](docs/sdks/schemastore/README.md#createschemastoreitem) - Create a schema in the schema store - [`shortURLsCreate`](docs/sdks/shorturls/README.md#create) - Shorten a URL. +- [`subscriptionsActivateSubscriptionNamespace`](docs/sdks/subscriptions/README.md#activatesubscriptionnamespace) - Activate an ignored namespace for a subscription +- [`subscriptionsIgnoreSubscriptionNamespace`](docs/sdks/subscriptions/README.md#ignoresubscriptionnamespace) - Ignored a namespace for a subscription - [`suggestSuggest`](docs/sdks/suggest/README.md#suggest) - Generate suggestions for improving an OpenAPI document. +- [`suggestSuggestItems`](docs/sdks/suggest/README.md#suggestitems) - Generate generic suggestions for a list of items. - [`suggestSuggestOpenAPI`](docs/sdks/suggest/README.md#suggestopenapi) - (DEPRECATED) Generate suggestions for improving an OpenAPI document. - [`suggestSuggestOpenAPIRegistry`](docs/sdks/suggest/README.md#suggestopenapiregistry) - Generate suggestions for improving an OpenAPI document stored in the registry. - [`workspacesCreate`](docs/sdks/workspaces/README.md#create) - Create a workspace @@ -642,12 +689,50 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). - [`workspacesGetTokens`](docs/sdks/workspaces/README.md#gettokens) - Get tokens for a particular workspace - [`workspacesGrantAccess`](docs/sdks/workspaces/README.md#grantaccess) - Grant a user access to a particular workspace - [`workspacesRevokeAccess`](docs/sdks/workspaces/README.md#revokeaccess) - Revoke a user's access to a particular workspace +- [`workspacesSetFeatureFlags`](docs/sdks/workspaces/README.md#setfeatureflags) - Set workspace feature flags - [`workspacesUpdate`](docs/sdks/workspaces/README.md#update) - Update workspace details - [`workspacesUpdateSettings`](docs/sdks/workspaces/README.md#updatesettings) - Update workspace settings
+ +## Global Parameters + +A parameter is configured globally. This parameter may be set on the SDK client instance itself during initialization. When configured as an option during SDK initialization, This global value will be used as the default on the operations that use it. When such operations are called, there is a place in each to override the global value, if needed. + +For example, you can set `workspace_id` to `""` at SDK initialization and then you do not have to pass the same value on calls to operations like `getAccessToken`. But if you want to do so you may, which will locally override the global setting. See the example code below for a demonstration. + + +### Available Globals + +The following global parameter is available. + +| Name | Type | Description | +| ----------- | ------ | -------------------------- | +| workspaceId | string | The workspaceId parameter. | + +### Example + +```typescript +import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; + +const speakeasy = new Speakeasy(); + +async function run() { + const result = await speakeasy.auth.getAccessToken({ + workspaceId: "", + }); + + // Handle the result + console.log(result); +} + +run(); + +``` + + ## File uploads @@ -673,12 +758,9 @@ const speakeasy = new Speakeasy({ }); async function run() { - const result = await speakeasy.schemas.registerSchema({ - apiID: "", - versionID: "", - requestBody: { - file: await openAsBlob("example.file"), - }, + const result = await speakeasy.codeSamples.generateCodeSamplePreview({ + language: "", + schemaFile: await openAsBlob("example.file"), }); // Handle the result diff --git a/RELEASES.md b/RELEASES.md index 21f7a74b..e2bddec6 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1656,4 +1656,14 @@ Based on: ### Generated - [typescript v4.0.0-rc.2] . ### Releases -- [NPM v4.0.0-rc.2] https://www.npmjs.com/package/@speakeasy-api/speakeasy-client-sdk-typescript/v/4.0.0-rc.2 - . \ No newline at end of file +- [NPM v4.0.0-rc.2] https://www.npmjs.com/package/@speakeasy-api/speakeasy-client-sdk-typescript/v/4.0.0-rc.2 - . + +## 2025-04-08 00:19:40 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.531.0 (2.568.2) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v4.0.0-rc.3] . +### Releases +- [NPM v4.0.0-rc.3] https://www.npmjs.com/package/@speakeasy-api/speakeasy-client-sdk-typescript/v/4.0.0-rc.3 - . \ No newline at end of file diff --git a/RUNTIMES.md b/RUNTIMES.md index d08a0c07..db7ea942 100644 --- a/RUNTIMES.md +++ b/RUNTIMES.md @@ -1,6 +1,6 @@ # Supported JavaScript runtimes -This SDK is intended to be used in JavaScript runtimes that support the following features: +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` @@ -20,3 +20,29 @@ Runtime environments that are explicitly supported are: - 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 index 1a97cabe..d5bdfbbd 100644 --- a/USAGE.md +++ b/USAGE.md @@ -9,7 +9,7 @@ const speakeasy = new Speakeasy({ }); async function run() { - const result = await speakeasy.apis.getApis({}); + const result = await speakeasy.artifacts.createRemoteSource(); // Handle the result console.log(result); diff --git a/docs/sdk/models/operations/activatesubscriptionnamespacerequest.md b/docs/sdk/models/operations/activatesubscriptionnamespacerequest.md new file mode 100644 index 00000000..427000f7 --- /dev/null +++ b/docs/sdk/models/operations/activatesubscriptionnamespacerequest.md @@ -0,0 +1,19 @@ +# ActivateSubscriptionNamespaceRequest + +## Example Usage + +```typescript +import { ActivateSubscriptionNamespaceRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; + +let value: ActivateSubscriptionNamespaceRequest = { + subscriptionID: "", + namespaceName: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `subscriptionID` | *string* | :heavy_check_mark: | The existing subscription ID | +| `namespaceName` | *string* | :heavy_check_mark: | The namespace name | \ No newline at end of file diff --git a/docs/sdk/models/operations/archivenamespacerequest.md b/docs/sdk/models/operations/archivenamespacerequest.md new file mode 100644 index 00000000..2d935fca --- /dev/null +++ b/docs/sdk/models/operations/archivenamespacerequest.md @@ -0,0 +1,18 @@ +# ArchiveNamespaceRequest + +## Example Usage + +```typescript +import { ArchiveNamespaceRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; + +let value: ArchiveNamespaceRequest = { + namespaceName: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `namespaceName` | *string* | :heavy_check_mark: | N/A | +| `requestBody` | [operations.ArchiveNamespaceRequestBody](../../../sdk/models/operations/archivenamespacerequestbody.md) | :heavy_minus_sign: | Archived status | \ No newline at end of file diff --git a/docs/sdk/models/operations/archivenamespacerequestbody.md b/docs/sdk/models/operations/archivenamespacerequestbody.md new file mode 100644 index 00000000..a3cf23e6 --- /dev/null +++ b/docs/sdk/models/operations/archivenamespacerequestbody.md @@ -0,0 +1,17 @@ +# ArchiveNamespaceRequestBody + +Archived status + +## Example Usage + +```typescript +import { ArchiveNamespaceRequestBody } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; + +let value: ArchiveNamespaceRequestBody = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `archived` | *boolean* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/createbillingaddonsresponse.md b/docs/sdk/models/operations/createbillingaddonsresponse.md new file mode 100644 index 00000000..9b1a1906 --- /dev/null +++ b/docs/sdk/models/operations/createbillingaddonsresponse.md @@ -0,0 +1,24 @@ +# CreateBillingAddOnsResponse + + +## Supported Types + +### `shared.ErrorT` + +```typescript +const value: shared.ErrorT = { + message: "", + statusCode: 101, +}; +``` + +### `shared.OrganizationBillingAddOnResponse` + +```typescript +const value: shared.OrganizationBillingAddOnResponse = { + addOns: [ + "webhooks", + ], +}; +``` + diff --git a/docs/sdk/models/operations/createorganizationresponse.md b/docs/sdk/models/operations/createorganizationresponse.md index 39116287..1c127793 100644 --- a/docs/sdk/models/operations/createorganizationresponse.md +++ b/docs/sdk/models/operations/createorganizationresponse.md @@ -8,7 +8,7 @@ ```typescript const value: shared.ErrorT = { message: "", - statusCode: 501, + statusCode: 101, }; ``` @@ -16,13 +16,14 @@ const value: shared.ErrorT = { ```typescript const value: shared.Organization = { - accountType: "enterprise", - createdAt: new Date("2022-11-19T12:22:37.852Z"), + accountType: "business", + createdAt: new Date("2023-04-12T21:16:03.393Z"), id: "", name: "", slug: "", + ssoActivated: false, telemetryDisabled: false, - updatedAt: new Date("2023-04-23T03:32:15.282Z"), + updatedAt: new Date("2023-10-01T20:16:55.643Z"), }; ``` diff --git a/docs/sdk/models/operations/createrequestbody.md b/docs/sdk/models/operations/createrequestbody.md index d9088412..189bfa04 100644 --- a/docs/sdk/models/operations/createrequestbody.md +++ b/docs/sdk/models/operations/createrequestbody.md @@ -6,7 +6,7 @@ import { CreateRequestBody } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; let value: CreateRequestBody = { - url: "https://fruitful-masterpiece.org", + url: "https://ajar-finger.biz/", }; ``` diff --git a/docs/sdk/models/operations/createschemastoreitemrequestbody.md b/docs/sdk/models/operations/createschemastoreitemrequestbody.md new file mode 100644 index 00000000..51554b18 --- /dev/null +++ b/docs/sdk/models/operations/createschemastoreitemrequestbody.md @@ -0,0 +1,23 @@ +# CreateSchemaStoreItemRequestBody + +## Example Usage + +```typescript +import { CreateSchemaStoreItemRequestBody } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; + +let value: CreateSchemaStoreItemRequestBody = { + format: "yaml", + packageName: "", + sdkClassname: "", + spec: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `format` | [operations.Format](../../../sdk/models/operations/format.md) | :heavy_check_mark: | The format of the OpenAPI specification. | +| `packageName` | *string* | :heavy_check_mark: | The package name to use in code snippets / quickstart. | +| `sdkClassname` | *string* | :heavy_check_mark: | The classname of the SDK to use in code snippets / quickstart. | +| `spec` | *string* | :heavy_check_mark: | The OpenAPI specification to store. | \ No newline at end of file diff --git a/docs/sdk/models/operations/createschemastoreitemresponse.md b/docs/sdk/models/operations/createschemastoreitemresponse.md new file mode 100644 index 00000000..0b6b7393 --- /dev/null +++ b/docs/sdk/models/operations/createschemastoreitemresponse.md @@ -0,0 +1,27 @@ +# CreateSchemaStoreItemResponse + + +## Supported Types + +### `shared.ErrorT` + +```typescript +const value: shared.ErrorT = { + message: "", + statusCode: 101, +}; +``` + +### `shared.SchemaStoreItem` + +```typescript +const value: shared.SchemaStoreItem = { + createdAt: new Date("2024-08-22T16:33:40.564Z"), + format: "yaml", + id: "", + packageName: "", + sdkClassname: "", + spec: "", +}; +``` + diff --git a/docs/sdk/models/operations/createworkspaceresponse.md b/docs/sdk/models/operations/createworkspaceresponse.md index 18a5cbf1..be5c53c1 100644 --- a/docs/sdk/models/operations/createworkspaceresponse.md +++ b/docs/sdk/models/operations/createworkspaceresponse.md @@ -8,7 +8,7 @@ ```typescript const value: shared.ErrorT = { message: "", - statusCode: 408, + statusCode: 101, }; ``` @@ -16,13 +16,12 @@ const value: shared.ErrorT = { ```typescript const value: shared.Workspace = { - createdAt: new Date("2022-04-24T23:18:08.610Z"), + createdAt: new Date("2023-03-19T14:22:57.730Z"), id: "", name: "", organizationId: "", slug: "", - telemetryDisabled: false, - updatedAt: new Date("2024-09-22T01:21:39.695Z"), + updatedAt: new Date("2024-02-24T06:22:04.519Z"), verified: false, }; ``` diff --git a/docs/sdk/models/operations/createworkspacetokenglobals.md b/docs/sdk/models/operations/createworkspacetokenglobals.md new file mode 100644 index 00000000..b1d89647 --- /dev/null +++ b/docs/sdk/models/operations/createworkspacetokenglobals.md @@ -0,0 +1,17 @@ +# CreateWorkspaceTokenGlobals + +## Example Usage + +```typescript +import { CreateWorkspaceTokenGlobals } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; + +let value: CreateWorkspaceTokenGlobals = { + workspaceId: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `workspaceId` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/createworkspacetokenrequest.md b/docs/sdk/models/operations/createworkspacetokenrequest.md index 00b4c7d4..d8b8a757 100644 --- a/docs/sdk/models/operations/createworkspacetokenrequest.md +++ b/docs/sdk/models/operations/createworkspacetokenrequest.md @@ -9,10 +9,11 @@ let value: CreateWorkspaceTokenRequest = { workspaceId: "", workspaceToken: { alg: "", - createdAt: "", + createdAt: new Date("2023-10-18T04:12:26.286Z"), id: "", key: "", name: "", + workspaceId: "", }, }; ``` @@ -21,5 +22,5 @@ let value: CreateWorkspaceTokenRequest = { | Field | Type | Required | Description | | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `workspaceId` | *string* | :heavy_check_mark: | Unique identifier of the workspace. | +| `workspaceId` | *string* | :heavy_minus_sign: | Unique identifier of the workspace. | | `workspaceToken` | [shared.WorkspaceToken](../../../sdk/models/shared/workspacetoken.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/deleteapiendpointrequest.md b/docs/sdk/models/operations/deleteapiendpointrequest.md deleted file mode 100644 index f89e48a4..00000000 --- a/docs/sdk/models/operations/deleteapiendpointrequest.md +++ /dev/null @@ -1,21 +0,0 @@ -# DeleteApiEndpointRequest - -## Example Usage - -```typescript -import { DeleteApiEndpointRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -let value: DeleteApiEndpointRequest = { - apiID: "", - versionID: "", - apiEndpointID: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `apiID` | *string* | :heavy_check_mark: | The ID of the Api the ApiEndpoint belongs to. | -| `versionID` | *string* | :heavy_check_mark: | The version ID of the Api the ApiEndpoint belongs to. | -| `apiEndpointID` | *string* | :heavy_check_mark: | The ID of the ApiEndpoint to delete. | \ No newline at end of file diff --git a/docs/sdk/models/operations/deleteapirequest.md b/docs/sdk/models/operations/deleteapirequest.md deleted file mode 100644 index 0e5e1538..00000000 --- a/docs/sdk/models/operations/deleteapirequest.md +++ /dev/null @@ -1,19 +0,0 @@ -# DeleteApiRequest - -## Example Usage - -```typescript -import { DeleteApiRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -let value: DeleteApiRequest = { - apiID: "", - versionID: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `apiID` | *string* | :heavy_check_mark: | The ID of the Api to delete. | -| `versionID` | *string* | :heavy_check_mark: | The version ID of the Api to delete. | \ No newline at end of file diff --git a/docs/sdk/models/operations/deletebillingaddonrequest.md b/docs/sdk/models/operations/deletebillingaddonrequest.md new file mode 100644 index 00000000..52b96962 --- /dev/null +++ b/docs/sdk/models/operations/deletebillingaddonrequest.md @@ -0,0 +1,17 @@ +# DeleteBillingAddOnRequest + +## Example Usage + +```typescript +import { DeleteBillingAddOnRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; + +let value: DeleteBillingAddOnRequest = { + addOn: "custom_code_regions", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `addOn` | [shared.BillingAddOn](../../../sdk/models/shared/billingaddon.md) | :heavy_check_mark: | The specific add-on to delete. | \ No newline at end of file diff --git a/docs/sdk/models/operations/deleteschemarequest.md b/docs/sdk/models/operations/deleteschemarequest.md deleted file mode 100644 index 47fd42ae..00000000 --- a/docs/sdk/models/operations/deleteschemarequest.md +++ /dev/null @@ -1,21 +0,0 @@ -# DeleteSchemaRequest - -## Example Usage - -```typescript -import { DeleteSchemaRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -let value: DeleteSchemaRequest = { - apiID: "", - versionID: "", - revisionID: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | -| `apiID` | *string* | :heavy_check_mark: | The ID of the Api to delete schemas for. | -| `versionID` | *string* | :heavy_check_mark: | The version ID of the Api to delete metadata for. | -| `revisionID` | *string* | :heavy_check_mark: | The revision ID of the schema to delete. | \ No newline at end of file diff --git a/docs/sdk/models/operations/deleteversionmetadatarequest.md b/docs/sdk/models/operations/deleteversionmetadatarequest.md deleted file mode 100644 index 72167f89..00000000 --- a/docs/sdk/models/operations/deleteversionmetadatarequest.md +++ /dev/null @@ -1,23 +0,0 @@ -# DeleteVersionMetadataRequest - -## Example Usage - -```typescript -import { DeleteVersionMetadataRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -let value: DeleteVersionMetadataRequest = { - apiID: "", - versionID: "", - metaKey: "", - metaValue: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | -| `apiID` | *string* | :heavy_check_mark: | The ID of the Api to delete metadata for. | -| `versionID` | *string* | :heavy_check_mark: | The version ID of the Api to delete metadata for. | -| `metaKey` | *string* | :heavy_check_mark: | The key of the metadata to delete. | -| `metaValue` | *string* | :heavy_check_mark: | The value of the metadata to delete. | \ No newline at end of file diff --git a/docs/sdk/models/operations/deleteworkspacetokenglobals.md b/docs/sdk/models/operations/deleteworkspacetokenglobals.md new file mode 100644 index 00000000..383a6023 --- /dev/null +++ b/docs/sdk/models/operations/deleteworkspacetokenglobals.md @@ -0,0 +1,17 @@ +# DeleteWorkspaceTokenGlobals + +## Example Usage + +```typescript +import { DeleteWorkspaceTokenGlobals } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; + +let value: DeleteWorkspaceTokenGlobals = { + workspaceId: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `workspaceId` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/deleteworkspacetokenrequest.md b/docs/sdk/models/operations/deleteworkspacetokenrequest.md index 931504a5..45831d23 100644 --- a/docs/sdk/models/operations/deleteworkspacetokenrequest.md +++ b/docs/sdk/models/operations/deleteworkspacetokenrequest.md @@ -15,5 +15,5 @@ let value: DeleteWorkspaceTokenRequest = { | Field | Type | Required | Description | | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `workspaceId` | *string* | :heavy_check_mark: | Unique identifier of the workspace. | +| `workspaceId` | *string* | :heavy_minus_sign: | Unique identifier of the workspace. | | `tokenID` | *string* | :heavy_check_mark: | Unique identifier of the token. | \ No newline at end of file diff --git a/docs/sdk/models/operations/downloadschemarequest.md b/docs/sdk/models/operations/downloadschemarequest.md deleted file mode 100644 index 84963bd1..00000000 --- a/docs/sdk/models/operations/downloadschemarequest.md +++ /dev/null @@ -1,19 +0,0 @@ -# DownloadSchemaRequest - -## Example Usage - -```typescript -import { DownloadSchemaRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -let value: DownloadSchemaRequest = { - apiID: "", - versionID: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | -| `apiID` | *string* | :heavy_check_mark: | The ID of the Api to download the schema for. | -| `versionID` | *string* | :heavy_check_mark: | The version ID of the Api to delete metadata for. | \ No newline at end of file diff --git a/docs/sdk/models/operations/downloadschemaresponse.md b/docs/sdk/models/operations/downloadschemaresponse.md deleted file mode 100644 index b4962d35..00000000 --- a/docs/sdk/models/operations/downloadschemaresponse.md +++ /dev/null @@ -1,26 +0,0 @@ -# DownloadSchemaResponse - - -## Supported Types - -### `ReadableStream` - -```typescript -const value: ReadableStream = await openAsBlob("example.file"); -``` - -### `ReadableStream` - -```typescript -const value: ReadableStream = await openAsBlob("example.file"); -``` - -### `shared.ErrorT` - -```typescript -const value: shared.ErrorT = { - message: "", - statusCode: 510, -}; -``` - diff --git a/docs/sdk/models/operations/downloadschemarevisionrequest.md b/docs/sdk/models/operations/downloadschemarevisionrequest.md deleted file mode 100644 index 477847af..00000000 --- a/docs/sdk/models/operations/downloadschemarevisionrequest.md +++ /dev/null @@ -1,21 +0,0 @@ -# DownloadSchemaRevisionRequest - -## Example Usage - -```typescript -import { DownloadSchemaRevisionRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -let value: DownloadSchemaRevisionRequest = { - apiID: "", - versionID: "", - revisionID: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | -| `apiID` | *string* | :heavy_check_mark: | The ID of the Api to retrieve schemas for. | -| `versionID` | *string* | :heavy_check_mark: | The version ID of the Api to delete metadata for. | -| `revisionID` | *string* | :heavy_check_mark: | The revision ID of the schema to retrieve. | \ No newline at end of file diff --git a/docs/sdk/models/operations/downloadschemarevisionresponse.md b/docs/sdk/models/operations/downloadschemarevisionresponse.md deleted file mode 100644 index 3efbd2d5..00000000 --- a/docs/sdk/models/operations/downloadschemarevisionresponse.md +++ /dev/null @@ -1,26 +0,0 @@ -# DownloadSchemaRevisionResponse - - -## Supported Types - -### `ReadableStream` - -```typescript -const value: ReadableStream = await openAsBlob("example.file"); -``` - -### `ReadableStream` - -```typescript -const value: ReadableStream = await openAsBlob("example.file"); -``` - -### `shared.ErrorT` - -```typescript -const value: shared.ErrorT = { - message: "", - statusCode: 401, -}; -``` - diff --git a/docs/sdk/models/operations/findapiendpointrequest.md b/docs/sdk/models/operations/findapiendpointrequest.md deleted file mode 100644 index 82c58355..00000000 --- a/docs/sdk/models/operations/findapiendpointrequest.md +++ /dev/null @@ -1,21 +0,0 @@ -# FindApiEndpointRequest - -## Example Usage - -```typescript -import { FindApiEndpointRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -let value: FindApiEndpointRequest = { - apiID: "", - versionID: "", - displayName: "Myriam_Powlowski71", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | -| `apiID` | *string* | :heavy_check_mark: | The ID of the Api the ApiEndpoint belongs to. | -| `versionID` | *string* | :heavy_check_mark: | The version ID of the Api the ApiEndpoint belongs to. | -| `displayName` | *string* | :heavy_check_mark: | The displayName of the ApiEndpoint to find (set by operationId from OpenAPI schema). | \ No newline at end of file diff --git a/docs/sdk/models/operations/findapiendpointresponse.md b/docs/sdk/models/operations/findapiendpointresponse.md deleted file mode 100644 index af31601f..00000000 --- a/docs/sdk/models/operations/findapiendpointresponse.md +++ /dev/null @@ -1,31 +0,0 @@ -# FindApiEndpointResponse - - -## Supported Types - -### `shared.ApiEndpoint` - -```typescript -const value: shared.ApiEndpoint = { - apiEndpointId: "", - apiId: "", - createdAt: new Date("2023-06-14T22:27:38.966Z"), - description: "whole aw shameful scotch", - displayName: "Myah.Streich", - method: "", - path: "/selinux", - updatedAt: new Date("2023-11-12T19:14:09.178Z"), - versionId: "", - workspaceId: "", -}; -``` - -### `shared.ErrorT` - -```typescript -const value: shared.ErrorT = { - message: "", - statusCode: 307, -}; -``` - diff --git a/docs/sdk/models/operations/format.md b/docs/sdk/models/operations/format.md new file mode 100644 index 00000000..a0e551a9 --- /dev/null +++ b/docs/sdk/models/operations/format.md @@ -0,0 +1,17 @@ +# Format + +The format of the OpenAPI specification. + +## Example Usage + +```typescript +import { Format } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; + +let value: Format = "json"; +``` + +## Values + +```typescript +"json" | "yaml" +``` \ No newline at end of file diff --git a/docs/sdk/models/operations/generatecodesamplepreviewasyncresponse.md b/docs/sdk/models/operations/generatecodesamplepreviewasyncresponse.md new file mode 100644 index 00000000..a3bc0c0c --- /dev/null +++ b/docs/sdk/models/operations/generatecodesamplepreviewasyncresponse.md @@ -0,0 +1,23 @@ +# GenerateCodeSamplePreviewAsyncResponse + + +## Supported Types + +### `shared.ErrorT` + +```typescript +const value: shared.ErrorT = { + message: "", + statusCode: 101, +}; +``` + +### `operations.GenerateCodeSamplePreviewAsyncResponseBody` + +```typescript +const value: operations.GenerateCodeSamplePreviewAsyncResponseBody = { + jobId: "", + status: "running", +}; +``` + diff --git a/docs/sdk/models/operations/generatecodesamplepreviewasyncresponsebody.md b/docs/sdk/models/operations/generatecodesamplepreviewasyncresponsebody.md new file mode 100644 index 00000000..d0a94650 --- /dev/null +++ b/docs/sdk/models/operations/generatecodesamplepreviewasyncresponsebody.md @@ -0,0 +1,21 @@ +# GenerateCodeSamplePreviewAsyncResponseBody + +Job accepted, returns a job ID to poll for status and result + +## Example Usage + +```typescript +import { GenerateCodeSamplePreviewAsyncResponseBody } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; + +let value: GenerateCodeSamplePreviewAsyncResponseBody = { + jobId: "", + status: "pending", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `jobId` | *string* | :heavy_check_mark: | The job ID for polling | +| `status` | [shared.CodeSamplesJobStatus](../../../sdk/models/shared/codesamplesjobstatus.md) | :heavy_check_mark: | The current status of the job. Possible values are `pending` or `running`. | \ No newline at end of file diff --git a/docs/sdk/models/operations/generatecodesamplepreviewresponse.md b/docs/sdk/models/operations/generatecodesamplepreviewresponse.md new file mode 100644 index 00000000..41354a35 --- /dev/null +++ b/docs/sdk/models/operations/generatecodesamplepreviewresponse.md @@ -0,0 +1,30 @@ +# GenerateCodeSamplePreviewResponse + + +## Supported Types + +### `shared.ErrorT` + +```typescript +const value: shared.ErrorT = { + message: "", + statusCode: 101, +}; +``` + +### `shared.UsageSnippets` + +```typescript +const value: shared.UsageSnippets = { + snippets: [ + { + code: "", + language: "", + method: "", + operationId: "", + path: "/home/user/dir", + }, + ], +}; +``` + diff --git a/docs/sdk/models/operations/generateopenapispecforapiendpointrequest.md b/docs/sdk/models/operations/generateopenapispecforapiendpointrequest.md deleted file mode 100644 index 94c95e1f..00000000 --- a/docs/sdk/models/operations/generateopenapispecforapiendpointrequest.md +++ /dev/null @@ -1,21 +0,0 @@ -# GenerateOpenApiSpecForApiEndpointRequest - -## Example Usage - -```typescript -import { GenerateOpenApiSpecForApiEndpointRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -let value: GenerateOpenApiSpecForApiEndpointRequest = { - apiID: "", - versionID: "", - apiEndpointID: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `apiID` | *string* | :heavy_check_mark: | The ID of the Api to generate an OpenAPI specification for. | -| `versionID` | *string* | :heavy_check_mark: | The version ID of the Api to generate an OpenAPI specification for. | -| `apiEndpointID` | *string* | :heavy_check_mark: | The ID of the ApiEndpoint to generate an OpenAPI specification for. | \ No newline at end of file diff --git a/docs/sdk/models/operations/generateopenapispecforapiendpointresponse.md b/docs/sdk/models/operations/generateopenapispecforapiendpointresponse.md deleted file mode 100644 index 5d3e7b40..00000000 --- a/docs/sdk/models/operations/generateopenapispecforapiendpointresponse.md +++ /dev/null @@ -1,23 +0,0 @@ -# GenerateOpenApiSpecForApiEndpointResponse - - -## Supported Types - -### `shared.ErrorT` - -```typescript -const value: shared.ErrorT = { - message: "", - statusCode: 411, -}; -``` - -### `shared.GenerateOpenApiSpecDiff` - -```typescript -const value: shared.GenerateOpenApiSpecDiff = { - currentSchema: "", - newSchema: "", -}; -``` - diff --git a/docs/sdk/models/operations/generateopenapispecrequest.md b/docs/sdk/models/operations/generateopenapispecrequest.md deleted file mode 100644 index b4d53da1..00000000 --- a/docs/sdk/models/operations/generateopenapispecrequest.md +++ /dev/null @@ -1,19 +0,0 @@ -# GenerateOpenApiSpecRequest - -## Example Usage - -```typescript -import { GenerateOpenApiSpecRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -let value: GenerateOpenApiSpecRequest = { - apiID: "", - versionID: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `apiID` | *string* | :heavy_check_mark: | The ID of the Api to generate an OpenAPI specification for. | -| `versionID` | *string* | :heavy_check_mark: | The version ID of the Api to generate an OpenAPI specification for. | \ No newline at end of file diff --git a/docs/sdk/models/operations/generateopenapispecresponse.md b/docs/sdk/models/operations/generateopenapispecresponse.md deleted file mode 100644 index 350bc690..00000000 --- a/docs/sdk/models/operations/generateopenapispecresponse.md +++ /dev/null @@ -1,23 +0,0 @@ -# GenerateOpenApiSpecResponse - - -## Supported Types - -### `shared.ErrorT` - -```typescript -const value: shared.ErrorT = { - message: "", - statusCode: 204, -}; -``` - -### `shared.GenerateOpenApiSpecDiff` - -```typescript -const value: shared.GenerateOpenApiSpecDiff = { - currentSchema: "", - newSchema: "", -}; -``` - diff --git a/docs/sdk/models/operations/generatepostmancollectionforapiendpointrequest.md b/docs/sdk/models/operations/generatepostmancollectionforapiendpointrequest.md deleted file mode 100644 index 273c2276..00000000 --- a/docs/sdk/models/operations/generatepostmancollectionforapiendpointrequest.md +++ /dev/null @@ -1,21 +0,0 @@ -# GeneratePostmanCollectionForApiEndpointRequest - -## Example Usage - -```typescript -import { GeneratePostmanCollectionForApiEndpointRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -let value: GeneratePostmanCollectionForApiEndpointRequest = { - apiID: "", - versionID: "", - apiEndpointID: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | -| `apiID` | *string* | :heavy_check_mark: | The ID of the Api to generate a Postman collection for. | -| `versionID` | *string* | :heavy_check_mark: | The version ID of the Api to generate a Postman collection for. | -| `apiEndpointID` | *string* | :heavy_check_mark: | The ID of the ApiEndpoint to generate a Postman collection for. | \ No newline at end of file diff --git a/docs/sdk/models/operations/generatepostmancollectionforapiendpointresponse.md b/docs/sdk/models/operations/generatepostmancollectionforapiendpointresponse.md deleted file mode 100644 index 2b64500c..00000000 --- a/docs/sdk/models/operations/generatepostmancollectionforapiendpointresponse.md +++ /dev/null @@ -1,20 +0,0 @@ -# GeneratePostmanCollectionForApiEndpointResponse - - -## Supported Types - -### `shared.ErrorT` - -```typescript -const value: shared.ErrorT = { - message: "", - statusCode: 307, -}; -``` - -### `ReadableStream` - -```typescript -const value: ReadableStream = await openAsBlob("example.file"); -``` - diff --git a/docs/sdk/models/operations/generatepostmancollectionrequest.md b/docs/sdk/models/operations/generatepostmancollectionrequest.md deleted file mode 100644 index e2eb4bd4..00000000 --- a/docs/sdk/models/operations/generatepostmancollectionrequest.md +++ /dev/null @@ -1,19 +0,0 @@ -# GeneratePostmanCollectionRequest - -## Example Usage - -```typescript -import { GeneratePostmanCollectionRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -let value: GeneratePostmanCollectionRequest = { - apiID: "", - versionID: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | -| `apiID` | *string* | :heavy_check_mark: | The ID of the Api to generate a Postman collection for. | -| `versionID` | *string* | :heavy_check_mark: | The version ID of the Api to generate a Postman collection for. | \ No newline at end of file diff --git a/docs/sdk/models/operations/generatepostmancollectionresponse.md b/docs/sdk/models/operations/generatepostmancollectionresponse.md deleted file mode 100644 index c8ef6150..00000000 --- a/docs/sdk/models/operations/generatepostmancollectionresponse.md +++ /dev/null @@ -1,20 +0,0 @@ -# GeneratePostmanCollectionResponse - - -## Supported Types - -### `shared.ErrorT` - -```typescript -const value: shared.ErrorT = { - message: "", - statusCode: 402, -}; -``` - -### `ReadableStream` - -```typescript -const value: ReadableStream = await openAsBlob("example.file"); -``` - diff --git a/docs/sdk/models/operations/generaterequestpostmancollectionrequest.md b/docs/sdk/models/operations/generaterequestpostmancollectionrequest.md deleted file mode 100644 index f63e3b5e..00000000 --- a/docs/sdk/models/operations/generaterequestpostmancollectionrequest.md +++ /dev/null @@ -1,17 +0,0 @@ -# GenerateRequestPostmanCollectionRequest - -## Example Usage - -```typescript -import { GenerateRequestPostmanCollectionRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -let value: GenerateRequestPostmanCollectionRequest = { - requestID: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | -| `requestID` | *string* | :heavy_check_mark: | The ID of the request to retrieve. | \ No newline at end of file diff --git a/docs/sdk/models/operations/generaterequestpostmancollectionresponse.md b/docs/sdk/models/operations/generaterequestpostmancollectionresponse.md deleted file mode 100644 index f8c880df..00000000 --- a/docs/sdk/models/operations/generaterequestpostmancollectionresponse.md +++ /dev/null @@ -1,20 +0,0 @@ -# GenerateRequestPostmanCollectionResponse - - -## Supported Types - -### `shared.ErrorT` - -```typescript -const value: shared.ErrorT = { - message: "", - statusCode: 414, -}; -``` - -### `ReadableStream` - -```typescript -const value: ReadableStream = await openAsBlob("example.file"); -``` - diff --git a/docs/sdk/models/operations/getaccesstokenresponse.md b/docs/sdk/models/operations/getaccesstokenresponse.md index 6f6da484..dbbd5c7c 100644 --- a/docs/sdk/models/operations/getaccesstokenresponse.md +++ b/docs/sdk/models/operations/getaccesstokenresponse.md @@ -18,7 +18,7 @@ const value: shared.AccessToken = { ```typescript const value: shared.ErrorT = { message: "", - statusCode: 416, + statusCode: 101, }; ``` diff --git a/docs/sdk/models/operations/getallapiendpointsrequest.md b/docs/sdk/models/operations/getallapiendpointsrequest.md deleted file mode 100644 index b8755d07..00000000 --- a/docs/sdk/models/operations/getallapiendpointsrequest.md +++ /dev/null @@ -1,17 +0,0 @@ -# GetAllApiEndpointsRequest - -## Example Usage - -```typescript -import { GetAllApiEndpointsRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -let value: GetAllApiEndpointsRequest = { - apiID: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | ----------------------------------------------- | -| `apiID` | *string* | :heavy_check_mark: | The ID of the Api to retrieve ApiEndpoints for. | \ No newline at end of file diff --git a/docs/sdk/models/operations/getallapiendpointsresponse.md b/docs/sdk/models/operations/getallapiendpointsresponse.md deleted file mode 100644 index 10c8f2cf..00000000 --- a/docs/sdk/models/operations/getallapiendpointsresponse.md +++ /dev/null @@ -1,33 +0,0 @@ -# GetAllApiEndpointsResponse - - -## Supported Types - -### `shared.ApiEndpoint[]` - -```typescript -const value: shared.ApiEndpoint[] = [ - { - apiEndpointId: "", - apiId: "", - createdAt: new Date("2023-01-17T14:50:27.103Z"), - description: "before hm zowie utterly", - displayName: "Ally.Bradtke82", - method: "", - path: "/etc/periodic", - updatedAt: new Date("2022-12-28T23:20:38.785Z"), - versionId: "", - workspaceId: "", - }, -]; -``` - -### `shared.ErrorT` - -```typescript -const value: shared.ErrorT = { - message: "", - statusCode: 501, -}; -``` - diff --git a/docs/sdk/models/operations/getallapiversionsrequest.md b/docs/sdk/models/operations/getallapiversionsrequest.md deleted file mode 100644 index 6ca31af5..00000000 --- a/docs/sdk/models/operations/getallapiversionsrequest.md +++ /dev/null @@ -1,19 +0,0 @@ -# GetAllApiVersionsRequest - -## Example Usage - -```typescript -import { GetAllApiVersionsRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -let value: GetAllApiVersionsRequest = { - apiID: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `apiID` | *string* | :heavy_check_mark: | The ID of the Api to retrieve. | -| `op` | [operations.Op](../../../sdk/models/operations/op.md) | :heavy_minus_sign: | Configuration for filter operations | -| `metadata` | Record | :heavy_minus_sign: | Metadata to filter Apis on | \ No newline at end of file diff --git a/docs/sdk/models/operations/getallapiversionsresponse.md b/docs/sdk/models/operations/getallapiversionsresponse.md deleted file mode 100644 index cbcd715c..00000000 --- a/docs/sdk/models/operations/getallapiversionsresponse.md +++ /dev/null @@ -1,29 +0,0 @@ -# GetAllApiVersionsResponse - - -## Supported Types - -### `shared.Api[]` - -```typescript -const value: shared.Api[] = [ - { - apiId: "", - createdAt: new Date("2024-06-20T08:35:12.645Z"), - description: "although cap cope against even noisily harangue huge", - updatedAt: new Date("2023-02-04T22:38:27.365Z"), - versionId: "", - workspaceId: "", - }, -]; -``` - -### `shared.ErrorT` - -```typescript -const value: shared.ErrorT = { - message: "", - statusCode: 204, -}; -``` - diff --git a/docs/sdk/models/operations/getallforversionapiendpointsrequest.md b/docs/sdk/models/operations/getallforversionapiendpointsrequest.md deleted file mode 100644 index cb9828e7..00000000 --- a/docs/sdk/models/operations/getallforversionapiendpointsrequest.md +++ /dev/null @@ -1,19 +0,0 @@ -# GetAllForVersionApiEndpointsRequest - -## Example Usage - -```typescript -import { GetAllForVersionApiEndpointsRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -let value: GetAllForVersionApiEndpointsRequest = { - apiID: "", - versionID: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | -| `apiID` | *string* | :heavy_check_mark: | The ID of the Api to retrieve ApiEndpoints for. | -| `versionID` | *string* | :heavy_check_mark: | The version ID of the Api to retrieve ApiEndpoints for. | \ No newline at end of file diff --git a/docs/sdk/models/operations/getallforversionapiendpointsresponse.md b/docs/sdk/models/operations/getallforversionapiendpointsresponse.md deleted file mode 100644 index 8545666d..00000000 --- a/docs/sdk/models/operations/getallforversionapiendpointsresponse.md +++ /dev/null @@ -1,33 +0,0 @@ -# GetAllForVersionApiEndpointsResponse - - -## Supported Types - -### `shared.ApiEndpoint[]` - -```typescript -const value: shared.ApiEndpoint[] = [ - { - apiEndpointId: "", - apiId: "", - createdAt: new Date("2022-09-07T04:32:30.698Z"), - description: "submissive meh nor", - displayName: "Ena6", - method: "", - path: "/usr/lib", - updatedAt: new Date("2022-07-13T10:38:23.731Z"), - versionId: "", - workspaceId: "", - }, -]; -``` - -### `shared.ErrorT` - -```typescript -const value: shared.ErrorT = { - message: "", - statusCode: 505, -}; -``` - diff --git a/docs/sdk/models/operations/getapiendpointrequest.md b/docs/sdk/models/operations/getapiendpointrequest.md deleted file mode 100644 index 29105f5d..00000000 --- a/docs/sdk/models/operations/getapiendpointrequest.md +++ /dev/null @@ -1,21 +0,0 @@ -# GetApiEndpointRequest - -## Example Usage - -```typescript -import { GetApiEndpointRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -let value: GetApiEndpointRequest = { - apiID: "", - versionID: "", - apiEndpointID: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `apiID` | *string* | :heavy_check_mark: | The ID of the Api the ApiEndpoint belongs to. | -| `versionID` | *string* | :heavy_check_mark: | The version ID of the Api the ApiEndpoint belongs to. | -| `apiEndpointID` | *string* | :heavy_check_mark: | The ID of the ApiEndpoint to retrieve. | \ No newline at end of file diff --git a/docs/sdk/models/operations/getapiendpointresponse.md b/docs/sdk/models/operations/getapiendpointresponse.md deleted file mode 100644 index 3e774cf6..00000000 --- a/docs/sdk/models/operations/getapiendpointresponse.md +++ /dev/null @@ -1,31 +0,0 @@ -# GetApiEndpointResponse - - -## Supported Types - -### `shared.ApiEndpoint` - -```typescript -const value: shared.ApiEndpoint = { - apiEndpointId: "", - apiId: "", - createdAt: new Date("2024-12-31T18:57:53.420Z"), - description: "separate stealthily lawmaker per", - displayName: "Alva22", - method: "", - path: "/selinux", - updatedAt: new Date("2022-04-28T18:57:30.321Z"), - versionId: "", - workspaceId: "", -}; -``` - -### `shared.ErrorT` - -```typescript -const value: shared.ErrorT = { - message: "", - statusCode: 204, -}; -``` - diff --git a/docs/sdk/models/operations/getapisrequest.md b/docs/sdk/models/operations/getapisrequest.md deleted file mode 100644 index 09e40edf..00000000 --- a/docs/sdk/models/operations/getapisrequest.md +++ /dev/null @@ -1,16 +0,0 @@ -# GetApisRequest - -## Example Usage - -```typescript -import { GetApisRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -let value: GetApisRequest = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `op` | [operations.QueryParamOp](../../../sdk/models/operations/queryparamop.md) | :heavy_minus_sign: | Configuration for filter operations | -| `metadata` | Record | :heavy_minus_sign: | Metadata to filter Apis on | \ No newline at end of file diff --git a/docs/sdk/models/operations/getapisresponse.md b/docs/sdk/models/operations/getapisresponse.md deleted file mode 100644 index 061755c5..00000000 --- a/docs/sdk/models/operations/getapisresponse.md +++ /dev/null @@ -1,29 +0,0 @@ -# GetApisResponse - - -## Supported Types - -### `shared.Api[]` - -```typescript -const value: shared.Api[] = [ - { - apiId: "", - createdAt: new Date("2024-01-18T04:29:15.055Z"), - description: "doubtfully beneath abscond which exhausted", - updatedAt: new Date("2022-08-26T05:41:30.450Z"), - versionId: "", - workspaceId: "", - }, -]; -``` - -### `shared.ErrorT` - -```typescript -const value: shared.ErrorT = { - message: "", - statusCode: 103, -}; -``` - diff --git a/docs/sdk/models/operations/getbillingaddonsresponse.md b/docs/sdk/models/operations/getbillingaddonsresponse.md new file mode 100644 index 00000000..2fcce133 --- /dev/null +++ b/docs/sdk/models/operations/getbillingaddonsresponse.md @@ -0,0 +1,24 @@ +# GetBillingAddOnsResponse + + +## Supported Types + +### `shared.ErrorT` + +```typescript +const value: shared.ErrorT = { + message: "", + statusCode: 101, +}; +``` + +### `shared.OrganizationBillingAddOnResponse` + +```typescript +const value: shared.OrganizationBillingAddOnResponse = { + addOns: [ + "webhooks", + ], +}; +``` + diff --git a/docs/sdk/models/operations/getchangesreportsignedurlsignedaccess.md b/docs/sdk/models/operations/getchangesreportsignedurlsignedaccess.md index fd93d49e..cafa873e 100644 --- a/docs/sdk/models/operations/getchangesreportsignedurlsignedaccess.md +++ b/docs/sdk/models/operations/getchangesreportsignedurlsignedaccess.md @@ -8,7 +8,7 @@ OK import { GetChangesReportSignedUrlSignedAccess } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; let value: GetChangesReportSignedUrlSignedAccess = { - url: "https://sorrowful-yarmulke.name", + url: "https://esteemed-oil.name", }; ``` diff --git a/docs/sdk/models/operations/getcodesamplepreviewasyncrequest.md b/docs/sdk/models/operations/getcodesamplepreviewasyncrequest.md new file mode 100644 index 00000000..28d97a72 --- /dev/null +++ b/docs/sdk/models/operations/getcodesamplepreviewasyncrequest.md @@ -0,0 +1,17 @@ +# GetCodeSamplePreviewAsyncRequest + +## Example Usage + +```typescript +import { GetCodeSamplePreviewAsyncRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; + +let value: GetCodeSamplePreviewAsyncRequest = { + jobID: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `jobID` | *string* | :heavy_check_mark: | The ID of the job to check the status and retrieve results | \ No newline at end of file diff --git a/docs/sdk/models/operations/getcodesamplepreviewasyncresponse.md b/docs/sdk/models/operations/getcodesamplepreviewasyncresponse.md new file mode 100644 index 00000000..7b7ea979 --- /dev/null +++ b/docs/sdk/models/operations/getcodesamplepreviewasyncresponse.md @@ -0,0 +1,38 @@ +# GetCodeSamplePreviewAsyncResponse + + +## Supported Types + +### `shared.ErrorT` + +```typescript +const value: shared.ErrorT = { + message: "", + statusCode: 101, +}; +``` + +### `shared.UsageSnippets` + +```typescript +const value: shared.UsageSnippets = { + snippets: [ + { + code: "", + language: "", + method: "", + operationId: "", + path: "/home/user/dir", + }, + ], +}; +``` + +### `operations.GetCodeSamplePreviewAsyncResponseBody` + +```typescript +const value: operations.GetCodeSamplePreviewAsyncResponseBody = { + status: "running", +}; +``` + diff --git a/docs/sdk/models/operations/getcodesamplepreviewasyncresponsebody.md b/docs/sdk/models/operations/getcodesamplepreviewasyncresponsebody.md new file mode 100644 index 00000000..dc370d70 --- /dev/null +++ b/docs/sdk/models/operations/getcodesamplepreviewasyncresponsebody.md @@ -0,0 +1,19 @@ +# GetCodeSamplePreviewAsyncResponseBody + +Job is still in progress + +## Example Usage + +```typescript +import { GetCodeSamplePreviewAsyncResponseBody } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; + +let value: GetCodeSamplePreviewAsyncResponseBody = { + status: "running", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `status` | [shared.CodeSamplesJobStatus](../../../sdk/models/shared/codesamplesjobstatus.md) | :heavy_check_mark: | The current status of the job. Possible values are `pending` or `running`. | \ No newline at end of file diff --git a/docs/sdk/models/operations/getcodesamplesrequest.md b/docs/sdk/models/operations/getcodesamplesrequest.md new file mode 100644 index 00000000..268608c0 --- /dev/null +++ b/docs/sdk/models/operations/getcodesamplesrequest.md @@ -0,0 +1,33 @@ +# GetCodeSamplesRequest + +## Example Usage + +```typescript +import { GetCodeSamplesRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; + +let value: GetCodeSamplesRequest = { + registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", + operationIds: [ + "getPets", + ], + methodPaths: [ + { + method: "get", + path: "/pets", + }, + ], + languages: [ + "python", + "javascript", + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `registryUrl` | *string* | :heavy_check_mark: | The registry URL from which to retrieve the snippets. | https://spec.speakeasy.com/my-org/my-workspace/my-source | +| `operationIds` | *string*[] | :heavy_minus_sign: | The operation IDs to retrieve snippets for. | getPets | +| `methodPaths` | [operations.MethodPaths](../../../sdk/models/operations/methodpaths.md)[] | :heavy_minus_sign: | The method paths to retrieve snippets for. | [
{
"method": "get",
"path": "/pets"
}
] | +| `languages` | *string*[] | :heavy_minus_sign: | The languages to retrieve snippets for. | [
"python",
"javascript"
] | \ No newline at end of file diff --git a/docs/sdk/models/operations/getcodesamplesresponse.md b/docs/sdk/models/operations/getcodesamplesresponse.md new file mode 100644 index 00000000..d97ab43c --- /dev/null +++ b/docs/sdk/models/operations/getcodesamplesresponse.md @@ -0,0 +1,30 @@ +# GetCodeSamplesResponse + + +## Supported Types + +### `shared.ErrorT` + +```typescript +const value: shared.ErrorT = { + message: "", + statusCode: 101, +}; +``` + +### `shared.UsageSnippets` + +```typescript +const value: shared.UsageSnippets = { + snippets: [ + { + code: "", + language: "", + method: "", + operationId: "", + path: "/home/user/dir", + }, + ], +}; +``` + diff --git a/docs/sdk/models/operations/getembedaccesstokenrequest.md b/docs/sdk/models/operations/getembedaccesstokenrequest.md deleted file mode 100644 index 6ecb95af..00000000 --- a/docs/sdk/models/operations/getembedaccesstokenrequest.md +++ /dev/null @@ -1,17 +0,0 @@ -# GetEmbedAccessTokenRequest - -## Example Usage - -```typescript -import { GetEmbedAccessTokenRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -let value: GetEmbedAccessTokenRequest = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | -| `description` | *string* | :heavy_minus_sign: | The description of the embed access token. | -| `duration` | *number* | :heavy_minus_sign: | The duration (in minutes) of the embed access token. | -| `filters` | [shared.Filters](../../../sdk/models/shared/filters.md) | :heavy_minus_sign: | The filter to apply to the query. | \ No newline at end of file diff --git a/docs/sdk/models/operations/getembedaccesstokenresponse.md b/docs/sdk/models/operations/getembedaccesstokenresponse.md deleted file mode 100644 index 33f00bec..00000000 --- a/docs/sdk/models/operations/getembedaccesstokenresponse.md +++ /dev/null @@ -1,22 +0,0 @@ -# GetEmbedAccessTokenResponse - - -## Supported Types - -### `shared.EmbedAccessTokenResponse` - -```typescript -const value: shared.EmbedAccessTokenResponse = { - accessToken: "", -}; -``` - -### `shared.ErrorT` - -```typescript -const value: shared.ErrorT = { - message: "", - statusCode: 100, -}; -``` - diff --git a/docs/sdk/models/operations/getgithubactionresponse.md b/docs/sdk/models/operations/getgithubactionresponse.md index 292e71b0..4d0b6a06 100644 --- a/docs/sdk/models/operations/getgithubactionresponse.md +++ b/docs/sdk/models/operations/getgithubactionresponse.md @@ -8,7 +8,7 @@ ```typescript const value: shared.ErrorT = { message: "", - statusCode: 404, + statusCode: 101, }; ``` diff --git a/docs/sdk/models/operations/getgithubsetupstaterequest.md b/docs/sdk/models/operations/getgithubsetupstaterequest.md new file mode 100644 index 00000000..b08d6abf --- /dev/null +++ b/docs/sdk/models/operations/getgithubsetupstaterequest.md @@ -0,0 +1,21 @@ +# GetGithubSetupStateRequest + +## Example Usage + +```typescript +import { GetGithubSetupStateRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; + +let value: GetGithubSetupStateRequest = { + org: "", + repo: "", + generateGenLockId: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------- | ------------------- | ------------------- | ------------------- | +| `org` | *string* | :heavy_check_mark: | N/A | +| `repo` | *string* | :heavy_check_mark: | N/A | +| `generateGenLockId` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/getgithubsetupstateresponse.md b/docs/sdk/models/operations/getgithubsetupstateresponse.md new file mode 100644 index 00000000..73a48628 --- /dev/null +++ b/docs/sdk/models/operations/getgithubsetupstateresponse.md @@ -0,0 +1,30 @@ +# GetGithubSetupStateResponse + + +## Supported Types + +### `shared.ErrorT` + +```typescript +const value: shared.ErrorT = { + message: "", + statusCode: 101, +}; +``` + +### `shared.GithubSetupStateResponse` + +```typescript +const value: shared.GithubSetupStateResponse = { + actions: { + generationActionConfigured: false, + publishActionConfigured: false, + }, + appInstalled: false, + secrets: { + apiKeyConfigured: false, + publishingSecretsConfigured: false, + }, +}; +``` + diff --git a/docs/sdk/models/operations/getlintingreportsignedurlsignedaccess.md b/docs/sdk/models/operations/getlintingreportsignedurlsignedaccess.md index 593b179a..35beebbe 100644 --- a/docs/sdk/models/operations/getlintingreportsignedurlsignedaccess.md +++ b/docs/sdk/models/operations/getlintingreportsignedurlsignedaccess.md @@ -8,7 +8,7 @@ OK import { GetLintingReportSignedUrlSignedAccess } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; let value: GetLintingReportSignedUrlSignedAccess = { - url: "https://aged-flint.net/", + url: "https://spherical-luck.com", }; ``` diff --git a/docs/sdk/models/operations/getmanifestresponse.md b/docs/sdk/models/operations/getmanifestresponse.md index 3fb6c49f..a29c6d01 100644 --- a/docs/sdk/models/operations/getmanifestresponse.md +++ b/docs/sdk/models/operations/getmanifestresponse.md @@ -8,7 +8,7 @@ ```typescript const value: shared.ErrorT = { message: "", - statusCode: 411, + statusCode: 101, }; ``` diff --git a/docs/sdk/models/operations/getnamespacesresponse.md b/docs/sdk/models/operations/getnamespacesresponse.md index bafd0820..50598299 100644 --- a/docs/sdk/models/operations/getnamespacesresponse.md +++ b/docs/sdk/models/operations/getnamespacesresponse.md @@ -8,7 +8,7 @@ ```typescript const value: shared.ErrorT = { message: "", - statusCode: 100, + statusCode: 101, }; ``` @@ -18,10 +18,10 @@ const value: shared.ErrorT = { const value: shared.GetNamespacesResponse = { items: [ { - createdAt: new Date("2022-11-01T19:34:36.306Z"), + createdAt: new Date("2024-07-15T16:01:05.415Z"), id: "", name: "", - updatedAt: new Date("2022-07-05T13:36:03.643Z"), + updatedAt: new Date("2023-10-21T04:39:59.936Z"), }, ], }; diff --git a/docs/sdk/models/operations/getorganizationresponse.md b/docs/sdk/models/operations/getorganizationresponse.md index 627de9ec..7f761a3e 100644 --- a/docs/sdk/models/operations/getorganizationresponse.md +++ b/docs/sdk/models/operations/getorganizationresponse.md @@ -8,7 +8,7 @@ ```typescript const value: shared.ErrorT = { message: "", - statusCode: 421, + statusCode: 101, }; ``` @@ -16,13 +16,14 @@ const value: shared.ErrorT = { ```typescript const value: shared.Organization = { - accountType: "enterprise", - createdAt: new Date("2023-11-12T18:28:30.435Z"), + accountType: "business", + createdAt: new Date("2023-04-12T21:16:03.393Z"), id: "", name: "", slug: "", + ssoActivated: false, telemetryDisabled: false, - updatedAt: new Date("2022-04-18T04:47:54.555Z"), + updatedAt: new Date("2023-10-01T20:16:55.643Z"), }; ``` diff --git a/docs/sdk/models/operations/getorganizationsresponse.md b/docs/sdk/models/operations/getorganizationsresponse.md index e7db3671..afbddc8c 100644 --- a/docs/sdk/models/operations/getorganizationsresponse.md +++ b/docs/sdk/models/operations/getorganizationsresponse.md @@ -8,7 +8,7 @@ ```typescript const value: shared.ErrorT = { message: "", - statusCode: 508, + statusCode: 101, }; ``` @@ -17,13 +17,14 @@ const value: shared.ErrorT = { ```typescript const value: shared.Organization[] = [ { - accountType: "business", - createdAt: new Date("2022-02-28T21:24:26.026Z"), + accountType: "free", + createdAt: new Date("2024-09-21T04:23:38.427Z"), id: "", name: "", slug: "", + ssoActivated: false, telemetryDisabled: false, - updatedAt: new Date("2023-03-11T06:14:35.072Z"), + updatedAt: new Date("2023-11-20T20:33:02.845Z"), }, ]; ``` diff --git a/docs/sdk/models/operations/getorganizationusageresponse.md b/docs/sdk/models/operations/getorganizationusageresponse.md index 0aaa8a4a..7d05bf0d 100644 --- a/docs/sdk/models/operations/getorganizationusageresponse.md +++ b/docs/sdk/models/operations/getorganizationusageresponse.md @@ -8,7 +8,7 @@ ```typescript const value: shared.ErrorT = { message: "", - statusCode: 103, + statusCode: 101, }; ``` @@ -19,7 +19,7 @@ const value: shared.OrganizationUsageResponse = { allowedLanguages: [ "", ], - totalAllowedLanguages: 700529, + totalAllowedLanguages: 799125, usage: [ { accessible: false, @@ -30,7 +30,8 @@ const value: shared.OrganizationUsageResponse = { "", ], language: "", - numberOfOperations: 883078, + maxOperations: 399888, + numberOfOperations: 167967, usedFeatures: [ "", ], diff --git a/docs/sdk/models/operations/getrequestfromeventlogrequest.md b/docs/sdk/models/operations/getrequestfromeventlogrequest.md deleted file mode 100644 index 9a5e18e1..00000000 --- a/docs/sdk/models/operations/getrequestfromeventlogrequest.md +++ /dev/null @@ -1,17 +0,0 @@ -# GetRequestFromEventLogRequest - -## Example Usage - -```typescript -import { GetRequestFromEventLogRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -let value: GetRequestFromEventLogRequest = { - requestID: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------- | ---------------------------------- | ---------------------------------- | ---------------------------------- | -| `requestID` | *string* | :heavy_check_mark: | The ID of the request to retrieve. | \ No newline at end of file diff --git a/docs/sdk/models/operations/getrequestfromeventlogresponse.md b/docs/sdk/models/operations/getrequestfromeventlogresponse.md deleted file mode 100644 index 27e03862..00000000 --- a/docs/sdk/models/operations/getrequestfromeventlogresponse.md +++ /dev/null @@ -1,26 +0,0 @@ -# GetRequestFromEventLogResponse - - -## Supported Types - -### `shared.ErrorT` - -```typescript -const value: shared.ErrorT = { - message: "", - statusCode: 423, -}; -``` - -### `shared.UnboundedRequest` - -```typescript -const value: shared.UnboundedRequest = { - createdAt: new Date("2024-05-19T17:59:45.777Z"), - har: "", - harSizeBytes: 300651, - requestId: "", - workspaceId: "", -}; -``` - diff --git a/docs/sdk/models/operations/getrevisionsresponse.md b/docs/sdk/models/operations/getrevisionsresponse.md index 9b01c058..e4f79c23 100644 --- a/docs/sdk/models/operations/getrevisionsresponse.md +++ b/docs/sdk/models/operations/getrevisionsresponse.md @@ -8,7 +8,7 @@ ```typescript const value: shared.ErrorT = { message: "", - statusCode: 501, + statusCode: 101, }; ``` @@ -18,7 +18,7 @@ const value: shared.ErrorT = { const value: shared.GetRevisionsResponse = { items: [ { - createdAt: new Date("2024-06-01T18:53:02.233Z"), + createdAt: new Date("2023-09-14T02:05:36.319Z"), digest: "sha256:6d1ef012b5674ad8a127ecfa9b5e6f5178d171b90ee462846974177fd9bdd39f", id: "", @@ -26,7 +26,7 @@ const value: shared.GetRevisionsResponse = { tags: [ "", ], - updatedAt: new Date("2023-10-05T08:58:59.878Z"), + updatedAt: new Date("2025-04-21T14:27:39.206Z"), }, ], nextPageToken: "", diff --git a/docs/sdk/models/operations/getschemadiffrequest.md b/docs/sdk/models/operations/getschemadiffrequest.md deleted file mode 100644 index 09dd17a1..00000000 --- a/docs/sdk/models/operations/getschemadiffrequest.md +++ /dev/null @@ -1,23 +0,0 @@ -# GetSchemaDiffRequest - -## Example Usage - -```typescript -import { GetSchemaDiffRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -let value: GetSchemaDiffRequest = { - apiID: "", - versionID: "", - baseRevisionID: "", - targetRevisionID: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | -| `apiID` | *string* | :heavy_check_mark: | The ID of the Api to retrieve schemas for. | -| `versionID` | *string* | :heavy_check_mark: | The version ID of the Api to delete metadata for. | -| `baseRevisionID` | *string* | :heavy_check_mark: | The base revision ID of the schema to retrieve. | -| `targetRevisionID` | *string* | :heavy_check_mark: | The target revision ID of the schema to retrieve. | \ No newline at end of file diff --git a/docs/sdk/models/operations/getschemadiffresponse.md b/docs/sdk/models/operations/getschemadiffresponse.md deleted file mode 100644 index 9d851284..00000000 --- a/docs/sdk/models/operations/getschemadiffresponse.md +++ /dev/null @@ -1,33 +0,0 @@ -# GetSchemaDiffResponse - - -## Supported Types - -### `shared.ErrorT` - -```typescript -const value: shared.ErrorT = { - message: "", - statusCode: 506, -}; -``` - -### `shared.SchemaDiff` - -```typescript -const value: shared.SchemaDiff = { - additions: [ - "", - ], - deletions: [ - "", - ], - modifications: { - "key": { - from: "", - to: "", - }, - }, -}; -``` - diff --git a/docs/sdk/models/operations/getschemarequest.md b/docs/sdk/models/operations/getschemarequest.md deleted file mode 100644 index 0c2c6fc3..00000000 --- a/docs/sdk/models/operations/getschemarequest.md +++ /dev/null @@ -1,19 +0,0 @@ -# GetSchemaRequest - -## Example Usage - -```typescript -import { GetSchemaRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -let value: GetSchemaRequest = { - apiID: "", - versionID: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | -| `apiID` | *string* | :heavy_check_mark: | The ID of the Api to get the schema for. | -| `versionID` | *string* | :heavy_check_mark: | The version ID of the Api to delete metadata for. | \ No newline at end of file diff --git a/docs/sdk/models/operations/getschemaresponse.md b/docs/sdk/models/operations/getschemaresponse.md deleted file mode 100644 index b5476fea..00000000 --- a/docs/sdk/models/operations/getschemaresponse.md +++ /dev/null @@ -1,27 +0,0 @@ -# GetSchemaResponse - - -## Supported Types - -### `shared.ErrorT` - -```typescript -const value: shared.ErrorT = { - message: "", - statusCode: 429, -}; -``` - -### `shared.Schema` - -```typescript -const value: shared.Schema = { - apiId: "", - createdAt: new Date("2023-07-29T22:28:30.659Z"), - description: "wisely yet likewise testing yet", - revisionId: "", - versionId: "", - workspaceId: "", -}; -``` - diff --git a/docs/sdk/models/operations/getschemarevisionrequest.md b/docs/sdk/models/operations/getschemarevisionrequest.md deleted file mode 100644 index 62f912b9..00000000 --- a/docs/sdk/models/operations/getschemarevisionrequest.md +++ /dev/null @@ -1,21 +0,0 @@ -# GetSchemaRevisionRequest - -## Example Usage - -```typescript -import { GetSchemaRevisionRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -let value: GetSchemaRevisionRequest = { - apiID: "", - versionID: "", - revisionID: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | -| `apiID` | *string* | :heavy_check_mark: | The ID of the Api to retrieve schemas for. | -| `versionID` | *string* | :heavy_check_mark: | The version ID of the Api to delete metadata for. | -| `revisionID` | *string* | :heavy_check_mark: | The revision ID of the schema to retrieve. | \ No newline at end of file diff --git a/docs/sdk/models/operations/getschemarevisionresponse.md b/docs/sdk/models/operations/getschemarevisionresponse.md deleted file mode 100644 index 252f727b..00000000 --- a/docs/sdk/models/operations/getschemarevisionresponse.md +++ /dev/null @@ -1,27 +0,0 @@ -# GetSchemaRevisionResponse - - -## Supported Types - -### `shared.ErrorT` - -```typescript -const value: shared.ErrorT = { - message: "", - statusCode: 102, -}; -``` - -### `shared.Schema` - -```typescript -const value: shared.Schema = { - apiId: "", - createdAt: new Date("2022-01-03T06:18:29.426Z"), - description: "graceful grouper at bah", - revisionId: "", - versionId: "", - workspaceId: "", -}; -``` - diff --git a/docs/sdk/models/operations/getschemasrequest.md b/docs/sdk/models/operations/getschemasrequest.md deleted file mode 100644 index 0549ae40..00000000 --- a/docs/sdk/models/operations/getschemasrequest.md +++ /dev/null @@ -1,19 +0,0 @@ -# GetSchemasRequest - -## Example Usage - -```typescript -import { GetSchemasRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -let value: GetSchemasRequest = { - apiID: "", - versionID: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | -| `apiID` | *string* | :heavy_check_mark: | The ID of the Api to retrieve schemas for. | -| `versionID` | *string* | :heavy_check_mark: | The version ID of the Api to delete metadata for. | \ No newline at end of file diff --git a/docs/sdk/models/operations/getschemasresponse.md b/docs/sdk/models/operations/getschemasresponse.md deleted file mode 100644 index e4a10a9d..00000000 --- a/docs/sdk/models/operations/getschemasresponse.md +++ /dev/null @@ -1,30 +0,0 @@ -# GetSchemasResponse - - -## Supported Types - -### `shared.ErrorT` - -```typescript -const value: shared.ErrorT = { - message: "", - statusCode: 404, -}; -``` - -### `shared.Schema[]` - -```typescript -const value: shared.Schema[] = [ - { - apiId: "", - createdAt: new Date("2023-04-12T21:34:00.499Z"), - description: - "beneath frankly for unwelcome aftermath grown whereas merit loosely fumigate", - revisionId: "", - versionId: "", - workspaceId: "", - }, -]; -``` - diff --git a/docs/sdk/models/operations/gettagsresponse.md b/docs/sdk/models/operations/gettagsresponse.md index 243c1839..8a1972a0 100644 --- a/docs/sdk/models/operations/gettagsresponse.md +++ b/docs/sdk/models/operations/gettagsresponse.md @@ -8,7 +8,7 @@ ```typescript const value: shared.ErrorT = { message: "", - statusCode: 304, + statusCode: 101, }; ``` diff --git a/docs/sdk/models/operations/getuserresponse.md b/docs/sdk/models/operations/getuserresponse.md index 961441ce..3d81b6a8 100644 --- a/docs/sdk/models/operations/getuserresponse.md +++ b/docs/sdk/models/operations/getuserresponse.md @@ -8,7 +8,7 @@ ```typescript const value: shared.ErrorT = { message: "", - statusCode: 226, + statusCode: 101, }; ``` @@ -18,12 +18,12 @@ const value: shared.ErrorT = { const value: shared.User = { admin: false, confirmed: false, - createdAt: new Date("2023-10-18T18:06:11.730Z"), - displayName: "Blair_Sauer91", - email: "Jaida_Wilkinson@hotmail.com", + createdAt: new Date("2023-10-31T21:24:40.077Z"), + displayName: "Ari_Quitzon13", + email: "Maddison.Johnson@hotmail.com", emailVerified: false, id: "", - updatedAt: new Date("2024-08-30T22:04:58.019Z"), + updatedAt: new Date("2023-05-08T00:50:53.195Z"), whitelisted: false, }; ``` diff --git a/docs/sdk/models/operations/getvalidembedaccesstokensresponse.md b/docs/sdk/models/operations/getvalidembedaccesstokensresponse.md deleted file mode 100644 index 2480ebd6..00000000 --- a/docs/sdk/models/operations/getvalidembedaccesstokensresponse.md +++ /dev/null @@ -1,30 +0,0 @@ -# GetValidEmbedAccessTokensResponse - - -## Supported Types - -### `shared.EmbedToken[]` - -```typescript -const value: shared.EmbedToken[] = [ - { - createdAt: new Date("2022-02-16T10:20:38.020Z"), - createdBy: "", - description: "steel promptly pull optimistically", - expiresAt: new Date("2023-04-15T12:04:06.271Z"), - filters: "", - id: "", - workspaceId: "", - }, -]; -``` - -### `shared.ErrorT` - -```typescript -const value: shared.ErrorT = { - message: "", - statusCode: 501, -}; -``` - diff --git a/docs/sdk/models/operations/getversionmetadatarequest.md b/docs/sdk/models/operations/getversionmetadatarequest.md deleted file mode 100644 index a7dcc945..00000000 --- a/docs/sdk/models/operations/getversionmetadatarequest.md +++ /dev/null @@ -1,19 +0,0 @@ -# GetVersionMetadataRequest - -## Example Usage - -```typescript -import { GetVersionMetadataRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -let value: GetVersionMetadataRequest = { - apiID: "", - versionID: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | -| `apiID` | *string* | :heavy_check_mark: | The ID of the Api to retrieve metadata for. | -| `versionID` | *string* | :heavy_check_mark: | The version ID of the Api to retrieve metadata for. | \ No newline at end of file diff --git a/docs/sdk/models/operations/getversionmetadataresponse.md b/docs/sdk/models/operations/getversionmetadataresponse.md deleted file mode 100644 index 355b0d08..00000000 --- a/docs/sdk/models/operations/getversionmetadataresponse.md +++ /dev/null @@ -1,29 +0,0 @@ -# GetVersionMetadataResponse - - -## Supported Types - -### `shared.ErrorT` - -```typescript -const value: shared.ErrorT = { - message: "", - statusCode: 507, -}; -``` - -### `shared.VersionMetadata[]` - -```typescript -const value: shared.VersionMetadata[] = [ - { - apiId: "", - createdAt: new Date("2023-07-25T15:54:31.058Z"), - metaKey: "", - metaValue: "", - versionId: "", - workspaceId: "", - }, -]; -``` - diff --git a/docs/sdk/models/operations/getworkspacebycontextresponse.md b/docs/sdk/models/operations/getworkspacebycontextresponse.md index 38ffd0db..0a036fef 100644 --- a/docs/sdk/models/operations/getworkspacebycontextresponse.md +++ b/docs/sdk/models/operations/getworkspacebycontextresponse.md @@ -8,7 +8,7 @@ ```typescript const value: shared.ErrorT = { message: "", - statusCode: 417, + statusCode: 101, }; ``` @@ -17,22 +17,22 @@ const value: shared.ErrorT = { ```typescript const value: shared.WorkspaceAndOrganization = { organization: { - accountType: "enterprise", - createdAt: new Date("2024-07-04T20:50:00.142Z"), + accountType: "free", + createdAt: new Date("2023-04-05T20:24:21.250Z"), id: "", name: "", slug: "", + ssoActivated: false, telemetryDisabled: false, - updatedAt: new Date("2023-06-14T20:54:19.756Z"), + updatedAt: new Date("2025-06-29T14:04:22.500Z"), }, workspace: { - createdAt: new Date("2024-08-23T18:46:32.755Z"), + createdAt: new Date("2025-04-28T04:14:14.464Z"), id: "", name: "", organizationId: "", slug: "", - telemetryDisabled: false, - updatedAt: new Date("2024-10-01T09:29:08.367Z"), + updatedAt: new Date("2023-01-28T11:26:04.678Z"), verified: false, }, }; diff --git a/docs/sdk/models/operations/getworkspaceeventsbytargetglobals.md b/docs/sdk/models/operations/getworkspaceeventsbytargetglobals.md new file mode 100644 index 00000000..a0079599 --- /dev/null +++ b/docs/sdk/models/operations/getworkspaceeventsbytargetglobals.md @@ -0,0 +1,17 @@ +# GetWorkspaceEventsByTargetGlobals + +## Example Usage + +```typescript +import { GetWorkspaceEventsByTargetGlobals } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; + +let value: GetWorkspaceEventsByTargetGlobals = { + workspaceId: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `workspaceId` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/getworkspaceeventsbytargetrequest.md b/docs/sdk/models/operations/getworkspaceeventsbytargetrequest.md index b107acf9..0d3c4035 100644 --- a/docs/sdk/models/operations/getworkspaceeventsbytargetrequest.md +++ b/docs/sdk/models/operations/getworkspaceeventsbytargetrequest.md @@ -15,6 +15,6 @@ let value: GetWorkspaceEventsByTargetRequest = { | Field | Type | Required | Description | | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -| `workspaceId` | *string* | :heavy_check_mark: | Unique identifier of the workspace. | +| `workspaceId` | *string* | :heavy_minus_sign: | Unique identifier of the workspace. | | `targetId` | *string* | :heavy_check_mark: | Filter to only return events corresponding to a particular gen_lock_id (gen_lock_id uniquely identifies a target) | | `afterCreatedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | Filter to only return events created after this timestamp | \ No newline at end of file diff --git a/docs/sdk/models/operations/getworkspaceeventsbytargetresponse.md b/docs/sdk/models/operations/getworkspaceeventsbytargetresponse.md index 7cbeeab5..dccbb8ee 100644 --- a/docs/sdk/models/operations/getworkspaceeventsbytargetresponse.md +++ b/docs/sdk/models/operations/getworkspaceeventsbytargetresponse.md @@ -8,11 +8,11 @@ ```typescript const value: shared.CliEvent[] = [ { - createdAt: new Date("2024-12-12T21:37:24.845Z"), + createdAt: new Date("2023-04-16T16:05:21.382Z"), executionId: "", id: "", - interactionType: "CONFIGURE", - localStartedAt: new Date("2022-03-22T21:55:35.437Z"), + interactionType: "OPENAPI_DIFF", + localStartedAt: new Date("2024-04-12T11:08:17.716Z"), speakeasyApiKeyName: "", speakeasyVersion: "", success: false, @@ -26,7 +26,7 @@ const value: shared.CliEvent[] = [ ```typescript const value: shared.ErrorT = { message: "", - statusCode: 306, + statusCode: 101, }; ``` diff --git a/docs/sdk/models/operations/getworkspacefeatureflagsglobals.md b/docs/sdk/models/operations/getworkspacefeatureflagsglobals.md new file mode 100644 index 00000000..39351936 --- /dev/null +++ b/docs/sdk/models/operations/getworkspacefeatureflagsglobals.md @@ -0,0 +1,17 @@ +# GetWorkspaceFeatureFlagsGlobals + +## Example Usage + +```typescript +import { GetWorkspaceFeatureFlagsGlobals } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; + +let value: GetWorkspaceFeatureFlagsGlobals = { + workspaceId: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `workspaceId` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/getworkspacefeatureflagsrequest.md b/docs/sdk/models/operations/getworkspacefeatureflagsrequest.md index 5b852bef..e3f0420c 100644 --- a/docs/sdk/models/operations/getworkspacefeatureflagsrequest.md +++ b/docs/sdk/models/operations/getworkspacefeatureflagsrequest.md @@ -14,4 +14,4 @@ let value: GetWorkspaceFeatureFlagsRequest = { | Field | Type | Required | Description | | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `workspaceId` | *string* | :heavy_check_mark: | Unique identifier of the workspace. | \ No newline at end of file +| `workspaceId` | *string* | :heavy_minus_sign: | Unique identifier of the workspace. | \ No newline at end of file diff --git a/docs/sdk/models/operations/getworkspacefeatureflagsresponse.md b/docs/sdk/models/operations/getworkspacefeatureflagsresponse.md index d35f9065..9f41a5fd 100644 --- a/docs/sdk/models/operations/getworkspacefeatureflagsresponse.md +++ b/docs/sdk/models/operations/getworkspacefeatureflagsresponse.md @@ -8,7 +8,7 @@ ```typescript const value: shared.ErrorT = { message: "", - statusCode: 307, + statusCode: 101, }; ``` diff --git a/docs/sdk/models/operations/getworkspaceglobals.md b/docs/sdk/models/operations/getworkspaceglobals.md new file mode 100644 index 00000000..e6fffcfd --- /dev/null +++ b/docs/sdk/models/operations/getworkspaceglobals.md @@ -0,0 +1,17 @@ +# GetWorkspaceGlobals + +## Example Usage + +```typescript +import { GetWorkspaceGlobals } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; + +let value: GetWorkspaceGlobals = { + workspaceId: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `workspaceId` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/getworkspacerequest.md b/docs/sdk/models/operations/getworkspacerequest.md index aab63825..6722ffce 100644 --- a/docs/sdk/models/operations/getworkspacerequest.md +++ b/docs/sdk/models/operations/getworkspacerequest.md @@ -14,4 +14,4 @@ let value: GetWorkspaceRequest = { | Field | Type | Required | Description | | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `workspaceId` | *string* | :heavy_check_mark: | Unique identifier of the workspace. | \ No newline at end of file +| `workspaceId` | *string* | :heavy_minus_sign: | Unique identifier of the workspace. | \ No newline at end of file diff --git a/docs/sdk/models/operations/getworkspaceresponse.md b/docs/sdk/models/operations/getworkspaceresponse.md index 6283282d..a952d9d2 100644 --- a/docs/sdk/models/operations/getworkspaceresponse.md +++ b/docs/sdk/models/operations/getworkspaceresponse.md @@ -8,7 +8,7 @@ ```typescript const value: shared.ErrorT = { message: "", - statusCode: 503, + statusCode: 101, }; ``` @@ -16,13 +16,12 @@ const value: shared.ErrorT = { ```typescript const value: shared.Workspace = { - createdAt: new Date("2024-12-13T20:14:50.509Z"), + createdAt: new Date("2023-03-19T14:22:57.730Z"), id: "", name: "", organizationId: "", slug: "", - telemetryDisabled: false, - updatedAt: new Date("2024-09-15T17:39:34.108Z"), + updatedAt: new Date("2024-02-24T06:22:04.519Z"), verified: false, }; ``` diff --git a/docs/sdk/models/operations/getworkspacesettingsglobals.md b/docs/sdk/models/operations/getworkspacesettingsglobals.md new file mode 100644 index 00000000..adc3de29 --- /dev/null +++ b/docs/sdk/models/operations/getworkspacesettingsglobals.md @@ -0,0 +1,17 @@ +# GetWorkspaceSettingsGlobals + +## Example Usage + +```typescript +import { GetWorkspaceSettingsGlobals } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; + +let value: GetWorkspaceSettingsGlobals = { + workspaceId: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `workspaceId` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/getworkspacesettingsrequest.md b/docs/sdk/models/operations/getworkspacesettingsrequest.md index 85811fc0..bf74cc1c 100644 --- a/docs/sdk/models/operations/getworkspacesettingsrequest.md +++ b/docs/sdk/models/operations/getworkspacesettingsrequest.md @@ -14,4 +14,4 @@ let value: GetWorkspaceSettingsRequest = { | Field | Type | Required | Description | | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `workspaceId` | *string* | :heavy_check_mark: | Unique identifier of the workspace. | \ No newline at end of file +| `workspaceId` | *string* | :heavy_minus_sign: | Unique identifier of the workspace. | \ No newline at end of file diff --git a/docs/sdk/models/operations/getworkspacesettingsresponse.md b/docs/sdk/models/operations/getworkspacesettingsresponse.md index d3467da9..d6f3067e 100644 --- a/docs/sdk/models/operations/getworkspacesettingsresponse.md +++ b/docs/sdk/models/operations/getworkspacesettingsresponse.md @@ -8,7 +8,7 @@ ```typescript const value: shared.ErrorT = { message: "", - statusCode: 421, + statusCode: 101, }; ``` @@ -16,6 +16,9 @@ const value: shared.ErrorT = { ```typescript const value: shared.WorkspaceSettings = { + createdAt: new Date("2024-09-26T14:00:33.663Z"), + updatedAt: new Date("2023-05-06T20:08:51.714Z"), + webhookUrl: "https://roasted-diversity.net", workspaceId: "", }; ``` diff --git a/docs/sdk/models/operations/getworkspacesresponse.md b/docs/sdk/models/operations/getworkspacesresponse.md index 2b06e789..a0429b80 100644 --- a/docs/sdk/models/operations/getworkspacesresponse.md +++ b/docs/sdk/models/operations/getworkspacesresponse.md @@ -8,7 +8,7 @@ ```typescript const value: shared.ErrorT = { message: "", - statusCode: 206, + statusCode: 101, }; ``` @@ -17,13 +17,12 @@ const value: shared.ErrorT = { ```typescript const value: shared.Workspace[] = [ { - createdAt: new Date("2023-08-01T03:15:58.659Z"), + createdAt: new Date("2025-10-27T08:36:49.118Z"), id: "", name: "", organizationId: "", slug: "", - telemetryDisabled: false, - updatedAt: new Date("2023-08-13T14:07:32.789Z"), + updatedAt: new Date("2024-02-10T17:25:23.117Z"), verified: false, }, ]; diff --git a/docs/sdk/models/operations/getworkspacetargetsdeprecatedglobals.md b/docs/sdk/models/operations/getworkspacetargetsdeprecatedglobals.md new file mode 100644 index 00000000..cd31a70c --- /dev/null +++ b/docs/sdk/models/operations/getworkspacetargetsdeprecatedglobals.md @@ -0,0 +1,17 @@ +# GetWorkspaceTargetsDeprecatedGlobals + +## Example Usage + +```typescript +import { GetWorkspaceTargetsDeprecatedGlobals } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; + +let value: GetWorkspaceTargetsDeprecatedGlobals = { + workspaceId: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `workspaceId` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/getworkspacetargetsdeprecatedrequest.md b/docs/sdk/models/operations/getworkspacetargetsdeprecatedrequest.md index 7fc4ce55..5e1cb7a0 100644 --- a/docs/sdk/models/operations/getworkspacetargetsdeprecatedrequest.md +++ b/docs/sdk/models/operations/getworkspacetargetsdeprecatedrequest.md @@ -14,5 +14,5 @@ let value: GetWorkspaceTargetsDeprecatedRequest = { | Field | Type | Required | Description | | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `workspaceId` | *string* | :heavy_check_mark: | Unique identifier of the workspace. | +| `workspaceId` | *string* | :heavy_minus_sign: | Unique identifier of the workspace. | | `afterLastEventCreatedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | Filter to only return targets with events created after this timestamp | \ No newline at end of file diff --git a/docs/sdk/models/operations/getworkspacetargetsdeprecatedresponse.md b/docs/sdk/models/operations/getworkspacetargetsdeprecatedresponse.md index fb0632c1..35c5f8c4 100644 --- a/docs/sdk/models/operations/getworkspacetargetsdeprecatedresponse.md +++ b/docs/sdk/models/operations/getworkspacetargetsdeprecatedresponse.md @@ -8,7 +8,7 @@ ```typescript const value: shared.ErrorT = { message: "", - statusCode: 306, + statusCode: 101, }; ``` @@ -20,9 +20,9 @@ const value: shared.TargetSDK[] = [ generateGenLockId: "", generateTarget: "", id: "", - lastEventCreatedAt: new Date("2022-06-01T17:26:33.631Z"), + lastEventCreatedAt: new Date("2024-07-10T09:16:24.321Z"), lastEventId: "", - lastEventInteractionType: "LINT", + lastEventInteractionType: "PUBLISH", }, ]; ``` diff --git a/docs/sdk/models/operations/getworkspacetargetsresponse.md b/docs/sdk/models/operations/getworkspacetargetsresponse.md index 73b00c1f..ee0d9166 100644 --- a/docs/sdk/models/operations/getworkspacetargetsresponse.md +++ b/docs/sdk/models/operations/getworkspacetargetsresponse.md @@ -8,7 +8,7 @@ ```typescript const value: shared.ErrorT = { message: "", - statusCode: 429, + statusCode: 101, }; ``` @@ -20,9 +20,9 @@ const value: shared.TargetSDK[] = [ generateGenLockId: "", generateTarget: "", id: "", - lastEventCreatedAt: new Date("2024-05-26T15:39:37.504Z"), + lastEventCreatedAt: new Date("2024-07-10T09:16:24.321Z"), lastEventId: "", - lastEventInteractionType: "OPENAPI_DIFF", + lastEventInteractionType: "PUBLISH", }, ]; ``` diff --git a/docs/sdk/models/operations/getworkspaceteamglobals.md b/docs/sdk/models/operations/getworkspaceteamglobals.md new file mode 100644 index 00000000..1670a595 --- /dev/null +++ b/docs/sdk/models/operations/getworkspaceteamglobals.md @@ -0,0 +1,17 @@ +# GetWorkspaceTeamGlobals + +## Example Usage + +```typescript +import { GetWorkspaceTeamGlobals } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; + +let value: GetWorkspaceTeamGlobals = { + workspaceId: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `workspaceId` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/getworkspaceteamrequest.md b/docs/sdk/models/operations/getworkspaceteamrequest.md index 2ee68484..dd5b41ee 100644 --- a/docs/sdk/models/operations/getworkspaceteamrequest.md +++ b/docs/sdk/models/operations/getworkspaceteamrequest.md @@ -14,4 +14,4 @@ let value: GetWorkspaceTeamRequest = { | Field | Type | Required | Description | | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `workspaceId` | *string* | :heavy_check_mark: | Unique identifier of the workspace. | \ No newline at end of file +| `workspaceId` | *string* | :heavy_minus_sign: | Unique identifier of the workspace. | \ No newline at end of file diff --git a/docs/sdk/models/operations/getworkspaceteamresponse.md b/docs/sdk/models/operations/getworkspaceteamresponse.md index 94d6f737..53682763 100644 --- a/docs/sdk/models/operations/getworkspaceteamresponse.md +++ b/docs/sdk/models/operations/getworkspaceteamresponse.md @@ -8,7 +8,7 @@ ```typescript const value: shared.ErrorT = { message: "", - statusCode: 201, + statusCode: 101, }; ``` @@ -20,12 +20,12 @@ const value: shared.WorkspaceTeamResponse = { { admin: false, confirmed: false, - createdAt: new Date("2024-01-06T23:51:52.329Z"), - displayName: "Rosa.Nolan89", - email: "Jordi_Ratke5@yahoo.com", + createdAt: new Date("2024-09-05T22:56:29.908Z"), + displayName: "Darron76", + email: "Telly.Abernathy@hotmail.com", emailVerified: false, id: "", - updatedAt: new Date("2022-02-11T16:43:38.291Z"), + updatedAt: new Date("2024-12-14T19:25:48.501Z"), whitelisted: false, }, ], diff --git a/docs/sdk/models/operations/getworkspacetokensglobals.md b/docs/sdk/models/operations/getworkspacetokensglobals.md new file mode 100644 index 00000000..17971164 --- /dev/null +++ b/docs/sdk/models/operations/getworkspacetokensglobals.md @@ -0,0 +1,17 @@ +# GetWorkspaceTokensGlobals + +## Example Usage + +```typescript +import { GetWorkspaceTokensGlobals } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; + +let value: GetWorkspaceTokensGlobals = { + workspaceId: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `workspaceId` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/getworkspacetokensrequest.md b/docs/sdk/models/operations/getworkspacetokensrequest.md index f7381805..a5915d89 100644 --- a/docs/sdk/models/operations/getworkspacetokensrequest.md +++ b/docs/sdk/models/operations/getworkspacetokensrequest.md @@ -14,4 +14,4 @@ let value: GetWorkspaceTokensRequest = { | Field | Type | Required | Description | | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `workspaceId` | *string* | :heavy_check_mark: | Unique identifier of the workspace. | \ No newline at end of file +| `workspaceId` | *string* | :heavy_minus_sign: | Unique identifier of the workspace. | \ No newline at end of file diff --git a/docs/sdk/models/operations/getworkspacetokensresponse.md b/docs/sdk/models/operations/getworkspacetokensresponse.md index 174cefd0..9be2acbd 100644 --- a/docs/sdk/models/operations/getworkspacetokensresponse.md +++ b/docs/sdk/models/operations/getworkspacetokensresponse.md @@ -8,7 +8,7 @@ ```typescript const value: shared.ErrorT = { message: "", - statusCode: 507, + statusCode: 101, }; ``` @@ -18,10 +18,11 @@ const value: shared.ErrorT = { const value: shared.WorkspaceToken[] = [ { alg: "", - createdAt: "", + createdAt: new Date("2024-01-16T20:24:07.744Z"), id: "", key: "", name: "", + workspaceId: "", }, ]; ``` diff --git a/docs/sdk/models/operations/githubconfigurecodesamplesresponse.md b/docs/sdk/models/operations/githubconfigurecodesamplesresponse.md index a15b4056..4e85ac1e 100644 --- a/docs/sdk/models/operations/githubconfigurecodesamplesresponse.md +++ b/docs/sdk/models/operations/githubconfigurecodesamplesresponse.md @@ -8,7 +8,7 @@ ```typescript const value: shared.ErrorT = { message: "", - statusCode: 226, + statusCode: 101, }; ``` @@ -16,7 +16,7 @@ const value: shared.ErrorT = { ```typescript const value: shared.GithubConfigureCodeSamplesResponse = { - codeSampleOverlayRegistryURL: "https://icy-airmail.net", + codeSampleOverlayRegistryURL: "https://monthly-galoshes.biz/", source: { location: "", }, diff --git a/docs/sdk/models/operations/grantuseraccesstoworkspaceglobals.md b/docs/sdk/models/operations/grantuseraccesstoworkspaceglobals.md new file mode 100644 index 00000000..234b1e59 --- /dev/null +++ b/docs/sdk/models/operations/grantuseraccesstoworkspaceglobals.md @@ -0,0 +1,17 @@ +# GrantUserAccessToWorkspaceGlobals + +## Example Usage + +```typescript +import { GrantUserAccessToWorkspaceGlobals } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; + +let value: GrantUserAccessToWorkspaceGlobals = { + workspaceId: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `workspaceId` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/grantuseraccesstoworkspacerequest.md b/docs/sdk/models/operations/grantuseraccesstoworkspacerequest.md index 777982af..ae3eceea 100644 --- a/docs/sdk/models/operations/grantuseraccesstoworkspacerequest.md +++ b/docs/sdk/models/operations/grantuseraccesstoworkspacerequest.md @@ -7,7 +7,7 @@ import { GrantUserAccessToWorkspaceRequest } from "@speakeasy-api/speakeasy-clie let value: GrantUserAccessToWorkspaceRequest = { workspaceId: "", - email: "Justyn.Hirthe@hotmail.com", + email: "Sebastian.Paucek6@yahoo.com", }; ``` @@ -15,5 +15,5 @@ let value: GrantUserAccessToWorkspaceRequest = { | Field | Type | Required | Description | | ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | -| `workspaceId` | *string* | :heavy_check_mark: | Unique identifier of the workspace. | +| `workspaceId` | *string* | :heavy_minus_sign: | Unique identifier of the workspace. | | `email` | *string* | :heavy_check_mark: | Email of the user to grant access to. | \ No newline at end of file diff --git a/docs/sdk/models/operations/grantuseraccesstoworkspaceresponse.md b/docs/sdk/models/operations/grantuseraccesstoworkspaceresponse.md index cdc8ec3d..b51a4e07 100644 --- a/docs/sdk/models/operations/grantuseraccesstoworkspaceresponse.md +++ b/docs/sdk/models/operations/grantuseraccesstoworkspaceresponse.md @@ -8,7 +8,7 @@ ```typescript const value: shared.ErrorT = { message: "", - statusCode: 226, + statusCode: 101, }; ``` diff --git a/docs/sdk/models/operations/ignoresubscriptionnamespacerequest.md b/docs/sdk/models/operations/ignoresubscriptionnamespacerequest.md new file mode 100644 index 00000000..f34007df --- /dev/null +++ b/docs/sdk/models/operations/ignoresubscriptionnamespacerequest.md @@ -0,0 +1,19 @@ +# IgnoreSubscriptionNamespaceRequest + +## Example Usage + +```typescript +import { IgnoreSubscriptionNamespaceRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; + +let value: IgnoreSubscriptionNamespaceRequest = { + subscriptionID: "", + namespaceName: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `subscriptionID` | *string* | :heavy_check_mark: | The existing subscription ID | +| `namespaceName` | *string* | :heavy_check_mark: | The namespace name | \ No newline at end of file diff --git a/docs/sdk/models/operations/insertversionmetadatarequest.md b/docs/sdk/models/operations/insertversionmetadatarequest.md deleted file mode 100644 index 12f035fe..00000000 --- a/docs/sdk/models/operations/insertversionmetadatarequest.md +++ /dev/null @@ -1,24 +0,0 @@ -# InsertVersionMetadataRequest - -## Example Usage - -```typescript -import { InsertVersionMetadataRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -let value: InsertVersionMetadataRequest = { - apiID: "", - versionID: "", - versionMetadata: { - metaKey: "", - metaValue: "", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -| `apiID` | *string* | :heavy_check_mark: | The ID of the Api to insert metadata for. | -| `versionID` | *string* | :heavy_check_mark: | The version ID of the Api to insert metadata for. | -| `versionMetadata` | [shared.VersionMetadataInput](../../../sdk/models/shared/versionmetadatainput.md) | :heavy_check_mark: | A JSON representation of the metadata to insert. | \ No newline at end of file diff --git a/docs/sdk/models/operations/insertversionmetadataresponse.md b/docs/sdk/models/operations/insertversionmetadataresponse.md deleted file mode 100644 index f921f3ab..00000000 --- a/docs/sdk/models/operations/insertversionmetadataresponse.md +++ /dev/null @@ -1,27 +0,0 @@ -# InsertVersionMetadataResponse - - -## Supported Types - -### `shared.ErrorT` - -```typescript -const value: shared.ErrorT = { - message: "", - statusCode: 207, -}; -``` - -### `shared.VersionMetadata` - -```typescript -const value: shared.VersionMetadata = { - apiId: "", - createdAt: new Date("2022-06-04T11:44:43.665Z"), - metaKey: "", - metaValue: "", - versionId: "", - workspaceId: "", -}; -``` - diff --git a/docs/sdk/models/operations/linkgithubaccessrequest.md b/docs/sdk/models/operations/linkgithubaccessrequest.md new file mode 100644 index 00000000..ae2431c8 --- /dev/null +++ b/docs/sdk/models/operations/linkgithubaccessrequest.md @@ -0,0 +1,17 @@ +# LinkGithubAccessRequest + +## Example Usage + +```typescript +import { LinkGithubAccessRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; + +let value: LinkGithubAccessRequest = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `installationId` | *string* | :heavy_minus_sign: | N/A | +| `githubOrg` | *string* | :heavy_minus_sign: | N/A | +| `githubOidcToken` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/listremotesourcesrequest.md b/docs/sdk/models/operations/listremotesourcesrequest.md new file mode 100644 index 00000000..1b65095d --- /dev/null +++ b/docs/sdk/models/operations/listremotesourcesrequest.md @@ -0,0 +1,17 @@ +# ListRemoteSourcesRequest + +## Example Usage + +```typescript +import { ListRemoteSourcesRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; + +let value: ListRemoteSourcesRequest = { + namespaceName: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `namespaceName` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/listremotesourcesresponse.md b/docs/sdk/models/operations/listremotesourcesresponse.md new file mode 100644 index 00000000..d99ed623 --- /dev/null +++ b/docs/sdk/models/operations/listremotesourcesresponse.md @@ -0,0 +1,29 @@ +# ListRemoteSourcesResponse + + +## Supported Types + +### `shared.ErrorT` + +```typescript +const value: shared.ErrorT = { + message: "", + statusCode: 101, +}; +``` + +### `shared.RemoteSource` + +```typescript +const value: shared.RemoteSource = { + inputs: [ + { + registryUrl: "https://puzzled-juggernaut.info/", + }, + ], + output: { + registryUrl: "https://outlying-cinema.com", + }, +}; +``` + diff --git a/docs/sdk/models/operations/methodpaths.md b/docs/sdk/models/operations/methodpaths.md new file mode 100644 index 00000000..145aa282 --- /dev/null +++ b/docs/sdk/models/operations/methodpaths.md @@ -0,0 +1,19 @@ +# MethodPaths + +## Example Usage + +```typescript +import { MethodPaths } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; + +let value: MethodPaths = { + method: "put", + path: "/rescue", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | ------------------------------------------------------------- | +| `method` | [shared.HttpMethod](../../../sdk/models/shared/httpmethod.md) | :heavy_check_mark: | N/A | +| `path` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/op.md b/docs/sdk/models/operations/op.md deleted file mode 100644 index 9786582b..00000000 --- a/docs/sdk/models/operations/op.md +++ /dev/null @@ -1,19 +0,0 @@ -# Op - -Configuration for filter operations - -## Example Usage - -```typescript -import { Op } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -let value: Op = { - and: false, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -| `and` | *boolean* | :heavy_check_mark: | Whether to AND or OR the filters | \ No newline at end of file diff --git a/docs/sdk/models/operations/postworkspaceeventsglobals.md b/docs/sdk/models/operations/postworkspaceeventsglobals.md new file mode 100644 index 00000000..ecf238fa --- /dev/null +++ b/docs/sdk/models/operations/postworkspaceeventsglobals.md @@ -0,0 +1,17 @@ +# PostWorkspaceEventsGlobals + +## Example Usage + +```typescript +import { PostWorkspaceEventsGlobals } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; + +let value: PostWorkspaceEventsGlobals = { + workspaceId: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `workspaceId` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/postworkspaceeventsrequest.md b/docs/sdk/models/operations/postworkspaceeventsrequest.md index 72fc7aa8..52b653ff 100644 --- a/docs/sdk/models/operations/postworkspaceeventsrequest.md +++ b/docs/sdk/models/operations/postworkspaceeventsrequest.md @@ -9,11 +9,11 @@ let value: PostWorkspaceEventsRequest = { workspaceId: "", requestBody: [ { - createdAt: new Date("2023-06-12T05:20:25.998Z"), + createdAt: new Date("2025-11-05T20:35:28.386Z"), executionId: "", id: "", - interactionType: "OPENAPI_DIFF", - localStartedAt: new Date("2024-08-03T08:45:30.623Z"), + interactionType: "TOMBSTONE", + localStartedAt: new Date("2024-04-20T05:34:53.347Z"), speakeasyApiKeyName: "", speakeasyVersion: "", success: false, @@ -27,5 +27,5 @@ let value: PostWorkspaceEventsRequest = { | Field | Type | Required | Description | | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | -| `workspaceId` | *string* | :heavy_check_mark: | Unique identifier of the workspace. | +| `workspaceId` | *string* | :heavy_minus_sign: | Unique identifier of the workspace. | | `requestBody` | [shared.CliEvent](../../../sdk/models/shared/clievent.md)[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/preflightresponse.md b/docs/sdk/models/operations/preflightresponse.md index a9a4c9d7..1dc4a540 100644 --- a/docs/sdk/models/operations/preflightresponse.md +++ b/docs/sdk/models/operations/preflightresponse.md @@ -8,7 +8,7 @@ ```typescript const value: shared.ErrorT = { message: "", - statusCode: 504, + statusCode: 101, }; ``` diff --git a/docs/sdk/models/operations/queryeventlogrequest.md b/docs/sdk/models/operations/queryeventlogrequest.md deleted file mode 100644 index 1a1666a9..00000000 --- a/docs/sdk/models/operations/queryeventlogrequest.md +++ /dev/null @@ -1,15 +0,0 @@ -# QueryEventLogRequest - -## Example Usage - -```typescript -import { QueryEventLogRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -let value: QueryEventLogRequest = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | -| `filters` | [shared.Filters](../../../sdk/models/shared/filters.md) | :heavy_minus_sign: | The filter to apply to the query. | \ No newline at end of file diff --git a/docs/sdk/models/operations/queryeventlogresponse.md b/docs/sdk/models/operations/queryeventlogresponse.md deleted file mode 100644 index 60df8bb9..00000000 --- a/docs/sdk/models/operations/queryeventlogresponse.md +++ /dev/null @@ -1,36 +0,0 @@ -# QueryEventLogResponse - - -## Supported Types - -### `shared.BoundedRequest[]` - -```typescript -const value: shared.BoundedRequest[] = [ - { - apiEndpointId: "", - apiId: "", - createdAt: new Date("2024-05-27T16:12:22.860Z"), - customerId: "", - latency: 548846, - method: "", - path: "/private/tmp", - requestFinishTime: new Date("2024-01-10T22:30:43.334Z"), - requestId: "", - requestStartTime: new Date("2022-01-24T09:49:07.665Z"), - status: 102316, - versionId: "", - workspaceId: "", - }, -]; -``` - -### `shared.ErrorT` - -```typescript -const value: shared.ErrorT = { - message: "", - statusCode: 226, -}; -``` - diff --git a/docs/sdk/models/operations/queryparamop.md b/docs/sdk/models/operations/queryparamop.md deleted file mode 100644 index 15aabab1..00000000 --- a/docs/sdk/models/operations/queryparamop.md +++ /dev/null @@ -1,19 +0,0 @@ -# QueryParamOp - -Configuration for filter operations - -## Example Usage - -```typescript -import { QueryParamOp } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -let value: QueryParamOp = { - and: false, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -| `and` | *boolean* | :heavy_check_mark: | Whether to AND or OR the filters | \ No newline at end of file diff --git a/docs/sdk/models/operations/registerschemarequest.md b/docs/sdk/models/operations/registerschemarequest.md deleted file mode 100644 index a17b16ad..00000000 --- a/docs/sdk/models/operations/registerschemarequest.md +++ /dev/null @@ -1,17 +0,0 @@ -# RegisterSchemaRequest - -## Example Usage - -```typescript -import { RegisterSchemaRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -// No examples available for this model -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -| `apiID` | *string* | :heavy_check_mark: | The ID of the Api to get the schema for. | -| `versionID` | *string* | :heavy_check_mark: | The version ID of the Api to delete metadata for. | -| `requestBody` | [operations.RegisterSchemaRequestBody](../../../sdk/models/operations/registerschemarequestbody.md) | :heavy_check_mark: | The schema file to upload provided as a multipart/form-data file segment. | \ No newline at end of file diff --git a/docs/sdk/models/operations/registerschemarequestbody.md b/docs/sdk/models/operations/registerschemarequestbody.md deleted file mode 100644 index 54f2fa58..00000000 --- a/docs/sdk/models/operations/registerschemarequestbody.md +++ /dev/null @@ -1,17 +0,0 @@ -# RegisterSchemaRequestBody - -The schema file to upload provided as a multipart/form-data file segment. - -## Example Usage - -```typescript -import { RegisterSchemaRequestBody } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -// No examples available for this model -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `file` | [File](https://developer.mozilla.org/en-US/docs/Web/API/File) \| [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) \| [operations.RegisterSchemaFile](../../../sdk/models/operations/registerschemafile.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/revokeembedaccesstokenrequest.md b/docs/sdk/models/operations/revokeembedaccesstokenrequest.md deleted file mode 100644 index c89c1066..00000000 --- a/docs/sdk/models/operations/revokeembedaccesstokenrequest.md +++ /dev/null @@ -1,17 +0,0 @@ -# RevokeEmbedAccessTokenRequest - -## Example Usage - -```typescript -import { RevokeEmbedAccessTokenRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -let value: RevokeEmbedAccessTokenRequest = { - tokenID: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `tokenID` | *string* | :heavy_check_mark: | The ID of the EmbedToken to revoke. | \ No newline at end of file diff --git a/docs/sdk/models/operations/revokeuseraccesstoworkspaceglobals.md b/docs/sdk/models/operations/revokeuseraccesstoworkspaceglobals.md new file mode 100644 index 00000000..05368142 --- /dev/null +++ b/docs/sdk/models/operations/revokeuseraccesstoworkspaceglobals.md @@ -0,0 +1,17 @@ +# RevokeUserAccessToWorkspaceGlobals + +## Example Usage + +```typescript +import { RevokeUserAccessToWorkspaceGlobals } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; + +let value: RevokeUserAccessToWorkspaceGlobals = { + workspaceId: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `workspaceId` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/revokeuseraccesstoworkspacerequest.md b/docs/sdk/models/operations/revokeuseraccesstoworkspacerequest.md index 1126c139..766d9546 100644 --- a/docs/sdk/models/operations/revokeuseraccesstoworkspacerequest.md +++ b/docs/sdk/models/operations/revokeuseraccesstoworkspacerequest.md @@ -15,5 +15,5 @@ let value: RevokeUserAccessToWorkspaceRequest = { | Field | Type | Required | Description | | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `workspaceId` | *string* | :heavy_check_mark: | Unique identifier of the workspace. | +| `workspaceId` | *string* | :heavy_minus_sign: | Unique identifier of the workspace. | | `userId` | *string* | :heavy_check_mark: | Unique identifier of the user. | \ No newline at end of file diff --git a/docs/sdk/models/operations/searchworkspaceeventsglobals.md b/docs/sdk/models/operations/searchworkspaceeventsglobals.md new file mode 100644 index 00000000..bce5a488 --- /dev/null +++ b/docs/sdk/models/operations/searchworkspaceeventsglobals.md @@ -0,0 +1,17 @@ +# SearchWorkspaceEventsGlobals + +## Example Usage + +```typescript +import { SearchWorkspaceEventsGlobals } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; + +let value: SearchWorkspaceEventsGlobals = { + workspaceId: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `workspaceId` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/searchworkspaceeventsrequest.md b/docs/sdk/models/operations/searchworkspaceeventsrequest.md index d740936e..03b88909 100644 --- a/docs/sdk/models/operations/searchworkspaceeventsrequest.md +++ b/docs/sdk/models/operations/searchworkspaceeventsrequest.md @@ -14,9 +14,12 @@ let value: SearchWorkspaceEventsRequest = { | Field | Type | Required | Description | | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| `workspaceId` | *string* | :heavy_check_mark: | Unique identifier of the workspace. | +| `workspaceId` | *string* | :heavy_minus_sign: | Unique identifier of the workspace. | | `sourceRevisionDigest` | *string* | :heavy_minus_sign: | Unique identifier of the source revision digest. | | `lintReportDigest` | *string* | :heavy_minus_sign: | Unique identifier of the lint report digest. | | `openapiDiffReportDigest` | *string* | :heavy_minus_sign: | Unique identifier of the openapi diff report digest. | | `interactionType` | [shared.InteractionType](../../../sdk/models/shared/interactiontype.md) | :heavy_minus_sign: | Specified interaction type for events. | -| `generateGenLockId` | *string* | :heavy_minus_sign: | A specific gen lock ID for the events. | \ No newline at end of file +| `generateGenLockId` | *string* | :heavy_minus_sign: | A specific gen lock ID for the events. | +| `executionId` | *string* | :heavy_minus_sign: | Shared execution ID for cli events across a single action. | +| `success` | *boolean* | :heavy_minus_sign: | Whether the event was successful or not. | +| `limit` | *number* | :heavy_minus_sign: | Number of results to return. | \ No newline at end of file diff --git a/docs/sdk/models/operations/searchworkspaceeventsresponse.md b/docs/sdk/models/operations/searchworkspaceeventsresponse.md index 0a8c1115..9497f80d 100644 --- a/docs/sdk/models/operations/searchworkspaceeventsresponse.md +++ b/docs/sdk/models/operations/searchworkspaceeventsresponse.md @@ -8,11 +8,11 @@ ```typescript const value: shared.CliEvent[] = [ { - createdAt: new Date("2023-10-05T13:26:19.195Z"), + createdAt: new Date("2023-04-16T16:05:21.382Z"), executionId: "", id: "", interactionType: "OPENAPI_DIFF", - localStartedAt: new Date("2024-07-19T07:42:14.060Z"), + localStartedAt: new Date("2024-04-12T11:08:17.716Z"), speakeasyApiKeyName: "", speakeasyVersion: "", success: false, @@ -26,7 +26,7 @@ const value: shared.CliEvent[] = [ ```typescript const value: shared.ErrorT = { message: "", - statusCode: 511, + statusCode: 101, }; ``` diff --git a/docs/sdk/models/operations/setvisibilityrequest.md b/docs/sdk/models/operations/setvisibilityrequest.md new file mode 100644 index 00000000..7fe0078f --- /dev/null +++ b/docs/sdk/models/operations/setvisibilityrequest.md @@ -0,0 +1,18 @@ +# SetVisibilityRequest + +## Example Usage + +```typescript +import { SetVisibilityRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; + +let value: SetVisibilityRequest = { + namespaceName: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `namespaceName` | *string* | :heavy_check_mark: | N/A | +| `requestBody` | [operations.SetVisibilityRequestBody](../../../sdk/models/operations/setvisibilityrequestbody.md) | :heavy_minus_sign: | Namespace visibility | \ No newline at end of file diff --git a/docs/sdk/models/operations/setvisibilityrequestbody.md b/docs/sdk/models/operations/setvisibilityrequestbody.md new file mode 100644 index 00000000..155f15d0 --- /dev/null +++ b/docs/sdk/models/operations/setvisibilityrequestbody.md @@ -0,0 +1,19 @@ +# SetVisibilityRequestBody + +Namespace visibility + +## Example Usage + +```typescript +import { SetVisibilityRequestBody } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; + +let value: SetVisibilityRequestBody = { + public: false, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `public` | *boolean* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/setworkspacefeatureflagsresponse.md b/docs/sdk/models/operations/setworkspacefeatureflagsresponse.md new file mode 100644 index 00000000..42aca2a8 --- /dev/null +++ b/docs/sdk/models/operations/setworkspacefeatureflagsresponse.md @@ -0,0 +1,20 @@ +# SetWorkspaceFeatureFlagsResponse + + +## Supported Types + +### `shared.ErrorT` + +```typescript +const value: shared.ErrorT = { + message: "", + statusCode: 101, +}; +``` + +### `shared.WorkspaceFeatureFlagResponse` + +```typescript +const value: shared.WorkspaceFeatureFlagResponse = {}; +``` + diff --git a/docs/sdk/models/operations/suggestopenapirequestbody.md b/docs/sdk/models/operations/suggestopenapirequestbody.md index 43fdd718..955c21a3 100644 --- a/docs/sdk/models/operations/suggestopenapirequestbody.md +++ b/docs/sdk/models/operations/suggestopenapirequestbody.md @@ -14,5 +14,5 @@ import { SuggestOpenAPIRequestBody } from "@speakeasy-api/speakeasy-client-sdk-t | Field | Type | Required | Description | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `schema` | [File](https://developer.mozilla.org/en-US/docs/Web/API/File) \| [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) \| [operations.Schema](../../../sdk/models/operations/schema.md) | :heavy_check_mark: | N/A | -| `opts` | [shared.SuggestOptsOld](../../../sdk/models/shared/suggestoptsold.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| `opts` | [shared.SuggestOptsOld](../../../sdk/models/shared/suggestoptsold.md) | :heavy_minus_sign: | N/A | +| `schema` | [File](https://developer.mozilla.org/en-US/docs/Web/API/File) \| [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) \| [operations.Schema](../../../sdk/models/operations/schema.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/suggestrequest.md b/docs/sdk/models/operations/suggestrequest.md index 3c48ca3a..55695381 100644 --- a/docs/sdk/models/operations/suggestrequest.md +++ b/docs/sdk/models/operations/suggestrequest.md @@ -12,15 +12,14 @@ let value: SuggestRequest = { { message: "", path: [ - "/opt/lib", + "/var/mail", ], type: "", }, ], oasSummary: { info: { - description: - "obediently kissingly blue enfold though because intermarry colonialism", + description: "circa excepting upon", license: {}, summary: "", title: "", @@ -28,17 +27,18 @@ let value: SuggestRequest = { }, operations: [ { - description: "unhappy zowie bah over ouch beneath lumpy", + description: + "even oddly overconfidently spanish wherever strait knowledgeably hopeful huzzah", method: "", operationId: "", - path: "/etc/mail", + path: "/home/user/dir", tags: [ "", ], }, ], }, - suggestionType: "method-names", + suggestionType: "diagnostics-only", }, }; ``` diff --git a/docs/sdk/models/operations/updateworkspacedetailsglobals.md b/docs/sdk/models/operations/updateworkspacedetailsglobals.md new file mode 100644 index 00000000..d6b44711 --- /dev/null +++ b/docs/sdk/models/operations/updateworkspacedetailsglobals.md @@ -0,0 +1,17 @@ +# UpdateWorkspaceDetailsGlobals + +## Example Usage + +```typescript +import { UpdateWorkspaceDetailsGlobals } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; + +let value: UpdateWorkspaceDetailsGlobals = { + workspaceId: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `workspaceId` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/updateworkspacedetailsrequest.md b/docs/sdk/models/operations/updateworkspacedetailsrequest.md index 418ef683..bf56b2a7 100644 --- a/docs/sdk/models/operations/updateworkspacedetailsrequest.md +++ b/docs/sdk/models/operations/updateworkspacedetailsrequest.md @@ -8,13 +8,12 @@ import { UpdateWorkspaceDetailsRequest } from "@speakeasy-api/speakeasy-client-s let value: UpdateWorkspaceDetailsRequest = { workspaceId: "", workspace: { - createdAt: new Date("2024-12-13T16:03:43.381Z"), + createdAt: new Date("2023-11-16T00:00:08.537Z"), id: "", name: "", organizationId: "", slug: "", - telemetryDisabled: false, - updatedAt: new Date("2022-02-03T08:20:20.613Z"), + updatedAt: new Date("2024-06-14T01:29:49.528Z"), verified: false, }, }; @@ -24,5 +23,5 @@ let value: UpdateWorkspaceDetailsRequest = { | Field | Type | Required | Description | | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | -| `workspaceId` | *string* | :heavy_check_mark: | Unique identifier of the workspace. | +| `workspaceId` | *string* | :heavy_minus_sign: | Unique identifier of the workspace. | | `workspace` | [shared.Workspace](../../../sdk/models/shared/workspace.md) | :heavy_check_mark: | The workspace details to update. | \ No newline at end of file diff --git a/docs/sdk/models/operations/updateworkspacesettingsglobals.md b/docs/sdk/models/operations/updateworkspacesettingsglobals.md new file mode 100644 index 00000000..8af94ef4 --- /dev/null +++ b/docs/sdk/models/operations/updateworkspacesettingsglobals.md @@ -0,0 +1,17 @@ +# UpdateWorkspaceSettingsGlobals + +## Example Usage + +```typescript +import { UpdateWorkspaceSettingsGlobals } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; + +let value: UpdateWorkspaceSettingsGlobals = { + workspaceId: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `workspaceId` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/operations/updateworkspacesettingsrequest.md b/docs/sdk/models/operations/updateworkspacesettingsrequest.md index d7e227b4..585fca7b 100644 --- a/docs/sdk/models/operations/updateworkspacesettingsrequest.md +++ b/docs/sdk/models/operations/updateworkspacesettingsrequest.md @@ -8,6 +8,9 @@ import { UpdateWorkspaceSettingsRequest } from "@speakeasy-api/speakeasy-client- let value: UpdateWorkspaceSettingsRequest = { workspaceId: "", workspaceSettings: { + createdAt: new Date("2024-01-11T14:49:22.396Z"), + updatedAt: new Date("2023-02-11T06:08:15.713Z"), + webhookUrl: "https://damaged-role.org", workspaceId: "", }, }; @@ -17,5 +20,5 @@ let value: UpdateWorkspaceSettingsRequest = { | Field | Type | Required | Description | | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `workspaceId` | *string* | :heavy_check_mark: | Unique identifier of the workspace. | +| `workspaceId` | *string* | :heavy_minus_sign: | Unique identifier of the workspace. | | `workspaceSettings` | [shared.WorkspaceSettings](../../../sdk/models/shared/workspacesettings.md) | :heavy_check_mark: | The workspace settings to update. | \ No newline at end of file diff --git a/docs/sdk/models/operations/uploadreportuploadedreport.md b/docs/sdk/models/operations/uploadreportuploadedreport.md index e7a8b60e..b751982f 100644 --- a/docs/sdk/models/operations/uploadreportuploadedreport.md +++ b/docs/sdk/models/operations/uploadreportuploadedreport.md @@ -8,7 +8,7 @@ OK import { UploadReportUploadedReport } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; let value: UploadReportUploadedReport = { - url: "https://whirlwind-baseboard.com", + url: "https://sleepy-cinder.info", }; ``` diff --git a/docs/sdk/models/operations/upsertapiendpointrequest.md b/docs/sdk/models/operations/upsertapiendpointrequest.md deleted file mode 100644 index 9a17319f..00000000 --- a/docs/sdk/models/operations/upsertapiendpointrequest.md +++ /dev/null @@ -1,30 +0,0 @@ -# UpsertApiEndpointRequest - -## Example Usage - -```typescript -import { UpsertApiEndpointRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -let value: UpsertApiEndpointRequest = { - apiID: "", - versionID: "", - apiEndpointID: "", - apiEndpoint: { - apiEndpointId: "", - description: "oil yet following", - displayName: "Deonte_Champlin14", - method: "", - path: "/System", - versionId: "", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `apiID` | *string* | :heavy_check_mark: | The ID of the Api the ApiEndpoint belongs to. | -| `versionID` | *string* | :heavy_check_mark: | The version ID of the Api the ApiEndpoint belongs to. | -| `apiEndpointID` | *string* | :heavy_check_mark: | The ID of the ApiEndpoint to upsert. | -| `apiEndpoint` | [shared.ApiEndpointInput](../../../sdk/models/shared/apiendpointinput.md) | :heavy_check_mark: | A JSON representation of the ApiEndpoint to upsert. | \ No newline at end of file diff --git a/docs/sdk/models/operations/upsertapiendpointresponse.md b/docs/sdk/models/operations/upsertapiendpointresponse.md deleted file mode 100644 index b6f70949..00000000 --- a/docs/sdk/models/operations/upsertapiendpointresponse.md +++ /dev/null @@ -1,31 +0,0 @@ -# UpsertApiEndpointResponse - - -## Supported Types - -### `shared.ApiEndpoint` - -```typescript -const value: shared.ApiEndpoint = { - apiEndpointId: "", - apiId: "", - createdAt: new Date("2024-03-08T09:18:25.584Z"), - description: "abaft until against", - displayName: "Amelia.Stokes-Corwin94", - method: "", - path: "/home", - updatedAt: new Date("2024-01-28T21:25:45.366Z"), - versionId: "", - workspaceId: "", -}; -``` - -### `shared.ErrorT` - -```typescript -const value: shared.ErrorT = { - message: "", - statusCode: 101, -}; -``` - diff --git a/docs/sdk/models/operations/upsertapirequest.md b/docs/sdk/models/operations/upsertapirequest.md deleted file mode 100644 index 44d97243..00000000 --- a/docs/sdk/models/operations/upsertapirequest.md +++ /dev/null @@ -1,23 +0,0 @@ -# UpsertApiRequest - -## Example Usage - -```typescript -import { UpsertApiRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; - -let value: UpsertApiRequest = { - apiID: "", - api: { - apiId: "", - description: "ultimately boo ham gift harmful", - versionId: "", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | -| `apiID` | *string* | :heavy_check_mark: | The ID of the Api to upsert. | -| `api` | [shared.ApiInput](../../../sdk/models/shared/apiinput.md) | :heavy_check_mark: | A JSON representation of the Api to upsert | \ No newline at end of file diff --git a/docs/sdk/models/operations/upsertapiresponse.md b/docs/sdk/models/operations/upsertapiresponse.md deleted file mode 100644 index c8d6a8d6..00000000 --- a/docs/sdk/models/operations/upsertapiresponse.md +++ /dev/null @@ -1,27 +0,0 @@ -# UpsertApiResponse - - -## Supported Types - -### `shared.Api` - -```typescript -const value: shared.Api = { - apiId: "", - createdAt: new Date("2023-11-13T08:17:15.506Z"), - description: "aw cutover bah hunt during", - updatedAt: new Date("2023-02-14T08:50:01.379Z"), - versionId: "", - workspaceId: "", -}; -``` - -### `shared.ErrorT` - -```typescript -const value: shared.ErrorT = { - message: "", - statusCode: 308, -}; -``` - diff --git a/docs/sdk/models/operations/validateapikeyresponse.md b/docs/sdk/models/operations/validateapikeyresponse.md index d5dab2f6..b0e6930f 100644 --- a/docs/sdk/models/operations/validateapikeyresponse.md +++ b/docs/sdk/models/operations/validateapikeyresponse.md @@ -8,11 +8,15 @@ ```typescript const value: shared.ApiKeyDetails = { accountTypeV2: "business", + billingAddOns: [ + "webhooks", + ], enabledFeatures: [ "", ], orgSlug: "", telemetryDisabled: false, + workspaceCreatedAt: new Date("2025-01-05T19:28:32.013Z"), workspaceId: "", workspaceSlug: "", }; @@ -23,7 +27,7 @@ const value: shared.ApiKeyDetails = { ```typescript const value: shared.ErrorT = { message: "", - statusCode: 300, + statusCode: 101, }; ``` diff --git a/docs/sdk/models/shared/accounttype.md b/docs/sdk/models/shared/accounttype.md index a2352e9a..85ee68ec 100644 --- a/docs/sdk/models/shared/accounttype.md +++ b/docs/sdk/models/shared/accounttype.md @@ -5,7 +5,7 @@ ```typescript import { AccountType } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; -let value: AccountType = "free"; +let value: AccountType = "enterprise"; ``` ## Values diff --git a/docs/sdk/models/shared/actions.md b/docs/sdk/models/shared/actions.md new file mode 100644 index 00000000..dc7346d7 --- /dev/null +++ b/docs/sdk/models/shared/actions.md @@ -0,0 +1,19 @@ +# Actions + +## Example Usage + +```typescript +import { Actions } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; + +let value: Actions = { + generationActionConfigured: false, + publishActionConfigured: false, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | +| `generationActionConfigured` | *boolean* | :heavy_check_mark: | N/A | +| `publishActionConfigured` | *boolean* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/shared/api.md b/docs/sdk/models/shared/api.md deleted file mode 100644 index ce545c61..00000000 --- a/docs/sdk/models/shared/api.md +++ /dev/null @@ -1,31 +0,0 @@ -# Api - -An Api is representation of a API (a collection of API Endpoints) within the Speakeasy Platform. - -## Example Usage - -```typescript -import { Api } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; - -let value: Api = { - apiId: "", - createdAt: new Date("2023-10-23T15:05:16.239Z"), - description: "sweetly triumphantly close phew typewriter gadzooks yet", - updatedAt: new Date("2022-04-22T20:11:12.127Z"), - versionId: "", - workspaceId: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -| `apiId` | *string* | :heavy_check_mark: | The ID of this Api. This is a human-readable name (subject to change). | -| `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | Creation timestamp. | -| `description` | *string* | :heavy_check_mark: | A detailed description of the Api. | -| `matched` | *boolean* | :heavy_minus_sign: | Determines if all the endpoints within the Api are found in the OpenAPI spec associated with the Api. | -| `metaData` | Record | :heavy_minus_sign: | A set of values associated with a meta_data key. This field is only set on get requests. | -| `updatedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | Last update timestamp. | -| `versionId` | *string* | :heavy_check_mark: | The version ID of this Api. This is semantic version identifier. | -| `workspaceId` | *string* | :heavy_check_mark: | The workspace ID this Api belongs to. | \ No newline at end of file diff --git a/docs/sdk/models/shared/apiendpoint.md b/docs/sdk/models/shared/apiendpoint.md deleted file mode 100644 index 4b68c9cc..00000000 --- a/docs/sdk/models/shared/apiendpoint.md +++ /dev/null @@ -1,38 +0,0 @@ -# ApiEndpoint - -An ApiEndpoint is a description of an Endpoint for an API. - -## Example Usage - -```typescript -import { ApiEndpoint } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; - -let value: ApiEndpoint = { - apiEndpointId: "", - apiId: "", - createdAt: new Date("2024-01-29T22:47:11.861Z"), - description: "rally wherever minus runny rough agreeable beneath", - displayName: "Kevon_Marvin", - method: "", - path: "/usr/src", - updatedAt: new Date("2023-02-07T20:20:50.747Z"), - versionId: "", - workspaceId: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `apiEndpointId` | *string* | :heavy_check_mark: | The ID of this ApiEndpoint. This is a hash of the method and path. | -| `apiId` | *string* | :heavy_check_mark: | The ID of the Api this ApiEndpoint belongs to. | -| `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | Creation timestamp. | -| `description` | *string* | :heavy_check_mark: | A detailed description of the ApiEndpoint. | -| `displayName` | *string* | :heavy_check_mark: | A human-readable name for the ApiEndpoint. | -| `matched` | *boolean* | :heavy_minus_sign: | Determines if the endpoint was found in the OpenAPI spec associated with the parent Api. | -| `method` | *string* | :heavy_check_mark: | HTTP verb. | -| `path` | *string* | :heavy_check_mark: | Path that handles this Api. | -| `updatedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | Last update timestamp. | -| `versionId` | *string* | :heavy_check_mark: | The version ID of the Api this ApiEndpoint belongs to. | -| `workspaceId` | *string* | :heavy_check_mark: | The workspace ID this ApiEndpoint belongs to. | \ No newline at end of file diff --git a/docs/sdk/models/shared/apiendpointinput.md b/docs/sdk/models/shared/apiendpointinput.md deleted file mode 100644 index d684f3d6..00000000 --- a/docs/sdk/models/shared/apiendpointinput.md +++ /dev/null @@ -1,29 +0,0 @@ -# ApiEndpointInput - -An ApiEndpoint is a description of an Endpoint for an API. - -## Example Usage - -```typescript -import { ApiEndpointInput } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; - -let value: ApiEndpointInput = { - apiEndpointId: "", - description: "worth uh-huh substitution psst upon er", - displayName: "Lessie_McLaughlin", - method: "", - path: "/home/user", - versionId: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | -| `apiEndpointId` | *string* | :heavy_check_mark: | The ID of this ApiEndpoint. This is a hash of the method and path. | -| `description` | *string* | :heavy_check_mark: | A detailed description of the ApiEndpoint. | -| `displayName` | *string* | :heavy_check_mark: | A human-readable name for the ApiEndpoint. | -| `method` | *string* | :heavy_check_mark: | HTTP verb. | -| `path` | *string* | :heavy_check_mark: | Path that handles this Api. | -| `versionId` | *string* | :heavy_check_mark: | The version ID of the Api this ApiEndpoint belongs to. | \ No newline at end of file diff --git a/docs/sdk/models/shared/apiinput.md b/docs/sdk/models/shared/apiinput.md deleted file mode 100644 index 6d05bf26..00000000 --- a/docs/sdk/models/shared/apiinput.md +++ /dev/null @@ -1,24 +0,0 @@ -# ApiInput - -An Api is representation of a API (a collection of API Endpoints) within the Speakeasy Platform. - -## Example Usage - -```typescript -import { ApiInput } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; - -let value: ApiInput = { - apiId: "", - description: "amid gosh arraign barracks", - versionId: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `apiId` | *string* | :heavy_check_mark: | The ID of this Api. This is a human-readable name (subject to change). | -| `description` | *string* | :heavy_check_mark: | A detailed description of the Api. | -| `metaData` | Record | :heavy_minus_sign: | A set of values associated with a meta_data key. This field is only set on get requests. | -| `versionId` | *string* | :heavy_check_mark: | The version ID of this Api. This is semantic version identifier. | \ No newline at end of file diff --git a/docs/sdk/models/shared/apikeydetails.md b/docs/sdk/models/shared/apikeydetails.md index 8fabebe1..d43b1563 100644 --- a/docs/sdk/models/shared/apikeydetails.md +++ b/docs/sdk/models/shared/apikeydetails.md @@ -7,11 +7,15 @@ import { ApiKeyDetails } from "@speakeasy-api/speakeasy-client-sdk-typescript/sd let value: ApiKeyDetails = { accountTypeV2: "enterprise", + billingAddOns: [ + "sdk_testing", + ], enabledFeatures: [ "", ], orgSlug: "", telemetryDisabled: false, + workspaceCreatedAt: new Date("2025-06-14T11:09:37.293Z"), workspaceId: "", workspaceSlug: "", }; @@ -22,10 +26,12 @@ let value: ApiKeyDetails = { | Field | Type | Required | Description | | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | | `accountTypeV2` | [shared.AccountType](../../../sdk/models/shared/accounttype.md) | :heavy_check_mark: | N/A | +| `billingAddOns` | [shared.BillingAddOn](../../../sdk/models/shared/billingaddon.md)[] | :heavy_check_mark: | N/A | | `enabledFeatures` | *string*[] | :heavy_check_mark: | N/A | | ~~`featureFlags`~~ | *string*[] | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | | `generationAccessUnlimited` | *boolean* | :heavy_minus_sign: | N/A | | `orgSlug` | *string* | :heavy_check_mark: | N/A | | `telemetryDisabled` | *boolean* | :heavy_check_mark: | N/A | +| `workspaceCreatedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | Workspace creation timestamp. | | `workspaceId` | *string* | :heavy_check_mark: | N/A | | `workspaceSlug` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/shared/billingaddon.md b/docs/sdk/models/shared/billingaddon.md new file mode 100644 index 00000000..a8dca11c --- /dev/null +++ b/docs/sdk/models/shared/billingaddon.md @@ -0,0 +1,17 @@ +# BillingAddOn + +## Example Usage + +```typescript +import { BillingAddOn } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; + +let value: BillingAddOn = "sdk_testing"; +``` + +## Values + +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + +```typescript +"webhooks" | "sdk_testing" | "custom_code_regions" | Unrecognized +``` \ No newline at end of file diff --git a/docs/sdk/models/shared/boundedrequest.md b/docs/sdk/models/shared/boundedrequest.md deleted file mode 100644 index b8d132fd..00000000 --- a/docs/sdk/models/shared/boundedrequest.md +++ /dev/null @@ -1,44 +0,0 @@ -# BoundedRequest - -A BoundedRequest is a request that has been logged by the Speakeasy without the contents of the request. - -## Example Usage - -```typescript -import { BoundedRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; - -let value: BoundedRequest = { - apiEndpointId: "", - apiId: "", - createdAt: new Date("2022-11-18T03:36:20.029Z"), - customerId: "", - latency: 848944, - method: "", - path: "/System", - requestFinishTime: new Date("2022-01-15T12:10:56.303Z"), - requestId: "", - requestStartTime: new Date("2023-01-16T13:37:49.640Z"), - status: 148141, - versionId: "", - workspaceId: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `apiEndpointId` | *string* | :heavy_check_mark: | The ID of the ApiEndpoint this request was made to. | -| `apiId` | *string* | :heavy_check_mark: | The ID of the Api this request was made to. | -| `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | Creation timestamp. | -| `customerId` | *string* | :heavy_check_mark: | The ID of the customer that made this request. | -| `latency` | *number* | :heavy_check_mark: | The latency of the request. | -| `metadata` | [shared.RequestMetadata](../../../sdk/models/shared/requestmetadata.md)[] | :heavy_minus_sign: | Metadata associated with this request | -| `method` | *string* | :heavy_check_mark: | HTTP verb. | -| `path` | *string* | :heavy_check_mark: | The path of the request. | -| `requestFinishTime` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | The time the request finished. | -| `requestId` | *string* | :heavy_check_mark: | The ID of this request. | -| `requestStartTime` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | The time the request was made. | -| `status` | *number* | :heavy_check_mark: | The status code of the request. | -| `versionId` | *string* | :heavy_check_mark: | The version ID of the Api this request was made to. | -| `workspaceId` | *string* | :heavy_check_mark: | The workspace ID this request was made to. | \ No newline at end of file diff --git a/docs/sdk/models/shared/clievent.md b/docs/sdk/models/shared/clievent.md index 7902ed13..d878a9de 100644 --- a/docs/sdk/models/shared/clievent.md +++ b/docs/sdk/models/shared/clievent.md @@ -6,11 +6,11 @@ import { CliEvent } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; let value: CliEvent = { - createdAt: new Date("2023-03-19T13:21:51.302Z"), + createdAt: new Date("2023-06-30T13:14:36.159Z"), executionId: "", id: "", - interactionType: "TARGET_GENERATE", - localStartedAt: new Date("2024-01-06T20:04:15.683Z"), + interactionType: "CONFIGURE", + localStartedAt: new Date("2025-12-31T06:45:11.818Z"), speakeasyApiKeyName: "", speakeasyVersion: "", success: false, @@ -47,6 +47,7 @@ let value: CliEvent = { | `generateGenLockPreVersion` | *string* | :heavy_minus_sign: | Artifact version for the Previous Generation | | `generateNumberOfOperationsIgnored` | *number* | :heavy_minus_sign: | The number of operations ignored in generation. | | `generateNumberOfOperationsUsed` | *number* | :heavy_minus_sign: | The number of operations used in generation. | +| `generateNumberOfTerraformResources` | *number* | :heavy_minus_sign: | The number of terraform resources used in generation. | | `generateOutputTests` | *boolean* | :heavy_minus_sign: | Indicates whether tests were output. | | `generatePublished` | *boolean* | :heavy_minus_sign: | Indicates whether the target was considered published. | | `generateRepoUrl` | *string* | :heavy_minus_sign: | Expected Repo URL, for use in documentation generation. | @@ -59,7 +60,8 @@ let value: CliEvent = { | `ghActionRepository` | *string* | :heavy_minus_sign: | GitHub repository of the action. | | `ghActionRunLink` | *string* | :heavy_minus_sign: | Link to the GitHub action run. | | `ghActionVersion` | *string* | :heavy_minus_sign: | Version of the GitHub action. | -| `ghPullRequest` | *string* | :heavy_minus_sign: | The reference to a created pull request. | +| `ghChangesCommitted` | *boolean* | :heavy_minus_sign: | Whether or not changes were committed from generation in the Github Action. | +| `ghPullRequest` | *string* | :heavy_minus_sign: | The reference to a created pull request URL. | | `gitRelativeCwd` | *string* | :heavy_minus_sign: | Current working directory relative to the git root. | | `gitRemoteDefaultOwner` | *string* | :heavy_minus_sign: | Default owner for git remote. | | `gitRemoteDefaultRepo` | *string* | :heavy_minus_sign: | Default repository name for git remote. | @@ -96,6 +98,7 @@ let value: CliEvent = { | `speakeasyApiKeyName` | *string* | :heavy_check_mark: | Identifier of the Speakeasy API key. | | `speakeasyVersion` | *string* | :heavy_check_mark: | Version of the Speakeasy CLI. | | `success` | *boolean* | :heavy_check_mark: | Indicates whether the event was successful. | +| `testReportRaw` | *string* | :heavy_minus_sign: | The raw test report xml | | `workflowLockPostRaw` | *string* | :heavy_minus_sign: | Workflow lock file (post execution) | | `workflowLockPreRaw` | *string* | :heavy_minus_sign: | Workflow lock file (prior to execution) | | `workflowPostRaw` | *string* | :heavy_minus_sign: | Workflow file (post execution) | diff --git a/docs/sdk/models/shared/codesampleschemainput.md b/docs/sdk/models/shared/codesampleschemainput.md new file mode 100644 index 00000000..44f9e870 --- /dev/null +++ b/docs/sdk/models/shared/codesampleschemainput.md @@ -0,0 +1,19 @@ +# CodeSampleSchemaInput + +## Example Usage + +```typescript +import { CodeSampleSchemaInput } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; + +// No examples available for this model +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `language` | *string* | :heavy_check_mark: | The language to generate code samples for | +| `operationIds` | *string*[] | :heavy_minus_sign: | A list of operations IDs to generate code samples for | +| `packageName` | *string* | :heavy_minus_sign: | The name of the package | +| `schemaFile` | [File](https://developer.mozilla.org/en-US/docs/Web/API/File) \| [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) \| [shared.SchemaFile](../../../sdk/models/shared/schemafile.md) | :heavy_check_mark: | The OpenAPI file to be uploaded | +| `sdkClassName` | *string* | :heavy_minus_sign: | The SDK class name | \ No newline at end of file diff --git a/docs/sdk/models/shared/codesamplesjobstatus.md b/docs/sdk/models/shared/codesamplesjobstatus.md new file mode 100644 index 00000000..9160aa53 --- /dev/null +++ b/docs/sdk/models/shared/codesamplesjobstatus.md @@ -0,0 +1,17 @@ +# CodeSamplesJobStatus + +The current status of the job. Possible values are `pending` or `running`. + +## Example Usage + +```typescript +import { CodeSamplesJobStatus } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; + +let value: CodeSamplesJobStatus = "running"; +``` + +## Values + +```typescript +"pending" | "running" +``` \ No newline at end of file diff --git a/docs/sdk/models/shared/compositespecmetadata.md b/docs/sdk/models/shared/compositespecmetadata.md new file mode 100644 index 00000000..f7a80a77 --- /dev/null +++ b/docs/sdk/models/shared/compositespecmetadata.md @@ -0,0 +1,27 @@ +# CompositeSpecMetadata + +## Example Usage + +```typescript +import { CompositeSpecMetadata } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; + +let value: CompositeSpecMetadata = { + subscriptionId: "", + subscriptionSettings: { + baseSpecNamespaces: [ + "", + ], + outputNamespace: "", + overlayNamespaces: [ + "", + ], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `subscriptionId` | *string* | :heavy_check_mark: | The subscription ID for the remote source subscription, if applicable. This indicates that the namespace is created by a remote source and thus is composite. | +| `subscriptionSettings` | [shared.RemoteSourceSubscriptionSettings](../../../sdk/models/shared/remotesourcesubscriptionsettings.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/shared/diagnostic.md b/docs/sdk/models/shared/diagnostic.md index 26c045d8..f68a535a 100644 --- a/docs/sdk/models/shared/diagnostic.md +++ b/docs/sdk/models/shared/diagnostic.md @@ -8,7 +8,7 @@ import { Diagnostic } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/m let value: Diagnostic = { message: "", path: [ - "/usr", + "/var", ], type: "", }; diff --git a/docs/sdk/models/shared/embedaccesstokenresponse.md b/docs/sdk/models/shared/embedaccesstokenresponse.md deleted file mode 100644 index 72f5eccd..00000000 --- a/docs/sdk/models/shared/embedaccesstokenresponse.md +++ /dev/null @@ -1,19 +0,0 @@ -# EmbedAccessTokenResponse - -An EmbedAccessTokenResponse contains a token that can be used to embed a Speakeasy dashboard. - -## Example Usage - -```typescript -import { EmbedAccessTokenResponse } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; - -let value: EmbedAccessTokenResponse = { - accessToken: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `accessToken` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/shared/embedtoken.md b/docs/sdk/models/shared/embedtoken.md deleted file mode 100644 index 6ae6818d..00000000 --- a/docs/sdk/models/shared/embedtoken.md +++ /dev/null @@ -1,34 +0,0 @@ -# EmbedToken - -A representation of an embed token granted for working with Speakeasy components. - -## Example Usage - -```typescript -import { EmbedToken } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; - -let value: EmbedToken = { - createdAt: new Date("2023-12-24T10:58:40.496Z"), - createdBy: "", - description: "uniform industrialize when till even woot", - expiresAt: new Date("2024-07-28T09:48:49.789Z"), - filters: "", - id: "", - workspaceId: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | Creation timestamp. | -| `createdBy` | *string* | :heavy_check_mark: | The ID of the user that created this token. | -| `description` | *string* | :heavy_check_mark: | A detailed description of the EmbedToken. | -| `expiresAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | The time this token expires. | -| `filters` | *string* | :heavy_check_mark: | The filters applied to this token. | -| `id` | *string* | :heavy_check_mark: | The ID of this EmbedToken. | -| `lastUsed` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | The last time this token was used. | -| `revokedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | The time this token was revoked. | -| `revokedBy` | *string* | :heavy_minus_sign: | The ID of the user that revoked this token. | -| `workspaceId` | *string* | :heavy_check_mark: | The workspace ID this token belongs to. | \ No newline at end of file diff --git a/docs/sdk/models/shared/errort.md b/docs/sdk/models/shared/errort.md index c331a43b..4a76bb0d 100644 --- a/docs/sdk/models/shared/errort.md +++ b/docs/sdk/models/shared/errort.md @@ -9,7 +9,7 @@ import { ErrorT } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/model let value: ErrorT = { message: "", - statusCode: 306, + statusCode: 103, }; ``` diff --git a/docs/sdk/models/shared/featureflag.md b/docs/sdk/models/shared/featureflag.md index 5fb29e9f..ce999d1a 100644 --- a/docs/sdk/models/shared/featureflag.md +++ b/docs/sdk/models/shared/featureflag.md @@ -8,7 +8,7 @@ A feature flag is a key-value pair that can be used to enable or disable feature import { FeatureFlag } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; let value: FeatureFlag = { - featureFlag: "", + featureFlag: "changes_report", }; ``` @@ -16,5 +16,5 @@ let value: FeatureFlag = { | Field | Type | Required | Description | | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `featureFlag` | *string* | :heavy_check_mark: | N/A | +| `featureFlag` | [shared.WorkspaceFeatureFlag](../../../sdk/models/shared/workspacefeatureflag.md) | :heavy_check_mark: | enum value workspace feature flag | | `trialEndsAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/shared/filter.md b/docs/sdk/models/shared/filter.md deleted file mode 100644 index 0e8c01fb..00000000 --- a/docs/sdk/models/shared/filter.md +++ /dev/null @@ -1,23 +0,0 @@ -# Filter - -A filter is a key-value pair that can be used to filter a list of requests. - -## Example Usage - -```typescript -import { Filter } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; - -let value: Filter = { - key: "", - operator: "", - value: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------- | --------------------------- | --------------------------- | --------------------------- | -| `key` | *string* | :heavy_check_mark: | The key of the filter. | -| `operator` | *string* | :heavy_check_mark: | The operator of the filter. | -| `value` | *string* | :heavy_check_mark: | The value of the filter. | \ No newline at end of file diff --git a/docs/sdk/models/shared/filters.md b/docs/sdk/models/shared/filters.md deleted file mode 100644 index 3e412084..00000000 --- a/docs/sdk/models/shared/filters.md +++ /dev/null @@ -1,31 +0,0 @@ -# Filters - -Filters are used to query requests. - -## Example Usage - -```typescript -import { Filters } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; - -let value: Filters = { - filters: [ - { - key: "", - operator: "", - value: "", - }, - ], - limit: 981830, - offset: 478370, - operator: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | -| `filters` | [shared.Filter](../../../sdk/models/shared/filter.md)[] | :heavy_check_mark: | A list of filters to apply to the query. | -| `limit` | *number* | :heavy_check_mark: | The maximum number of results to return. | -| `offset` | *number* | :heavy_check_mark: | The offset to start the query from. | -| `operator` | *string* | :heavy_check_mark: | The operator to use when combining filters. | \ No newline at end of file diff --git a/docs/sdk/models/shared/format.md b/docs/sdk/models/shared/format.md new file mode 100644 index 00000000..3655eb24 --- /dev/null +++ b/docs/sdk/models/shared/format.md @@ -0,0 +1,15 @@ +# Format + +## Example Usage + +```typescript +import { Format } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; + +let value: Format = "json"; +``` + +## Values + +```typescript +"json" | "yaml" +``` \ No newline at end of file diff --git a/docs/sdk/models/shared/generatebumptype.md b/docs/sdk/models/shared/generatebumptype.md index 2127366c..23940159 100644 --- a/docs/sdk/models/shared/generatebumptype.md +++ b/docs/sdk/models/shared/generatebumptype.md @@ -7,7 +7,7 @@ Bump type of the lock file (calculated semver delta, custom change (manual relea ```typescript import { GenerateBumpType } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; -let value: GenerateBumpType = "major"; +let value: GenerateBumpType = "custom"; ``` ## Values diff --git a/docs/sdk/models/shared/generateopenapispecdiff.md b/docs/sdk/models/shared/generateopenapispecdiff.md deleted file mode 100644 index d449e2f9..00000000 --- a/docs/sdk/models/shared/generateopenapispecdiff.md +++ /dev/null @@ -1,19 +0,0 @@ -# GenerateOpenApiSpecDiff - -## Example Usage - -```typescript -import { GenerateOpenApiSpecDiff } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; - -let value: GenerateOpenApiSpecDiff = { - currentSchema: "", - newSchema: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `currentSchema` | *string* | :heavy_check_mark: | N/A | -| `newSchema` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/shared/getnamespacesresponse.md b/docs/sdk/models/shared/getnamespacesresponse.md index 06ae92e1..1db776aa 100644 --- a/docs/sdk/models/shared/getnamespacesresponse.md +++ b/docs/sdk/models/shared/getnamespacesresponse.md @@ -8,10 +8,10 @@ import { GetNamespacesResponse } from "@speakeasy-api/speakeasy-client-sdk-types let value: GetNamespacesResponse = { items: [ { - createdAt: new Date("2024-10-27T17:07:18.797Z"), + createdAt: new Date("2025-11-06T02:22:29.445Z"), id: "", name: "", - updatedAt: new Date("2024-04-18T19:06:55.714Z"), + updatedAt: new Date("2023-10-19T10:46:32.430Z"), }, ], }; diff --git a/docs/sdk/models/shared/getrevisionsresponse.md b/docs/sdk/models/shared/getrevisionsresponse.md index 88b46452..a5a5a21d 100644 --- a/docs/sdk/models/shared/getrevisionsresponse.md +++ b/docs/sdk/models/shared/getrevisionsresponse.md @@ -8,7 +8,7 @@ import { GetRevisionsResponse } from "@speakeasy-api/speakeasy-client-sdk-typesc let value: GetRevisionsResponse = { items: [ { - createdAt: new Date("2022-04-02T10:20:37.470Z"), + createdAt: new Date("2024-01-20T07:01:46.379Z"), digest: "sha256:6d1ef012b5674ad8a127ecfa9b5e6f5178d171b90ee462846974177fd9bdd39f", id: "", @@ -16,7 +16,7 @@ let value: GetRevisionsResponse = { tags: [ "", ], - updatedAt: new Date("2023-08-29T04:52:14.624Z"), + updatedAt: new Date("2024-07-08T03:34:57.970Z"), }, ], nextPageToken: "", diff --git a/docs/sdk/models/shared/githubconfigurecodesamplesresponse.md b/docs/sdk/models/shared/githubconfigurecodesamplesresponse.md index 3038a0cc..81de6444 100644 --- a/docs/sdk/models/shared/githubconfigurecodesamplesresponse.md +++ b/docs/sdk/models/shared/githubconfigurecodesamplesresponse.md @@ -8,7 +8,7 @@ A response to configure GitHub code samples import { GithubConfigureCodeSamplesResponse } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; let value: GithubConfigureCodeSamplesResponse = { - codeSampleOverlayRegistryURL: "https://productive-fundraising.com/", + codeSampleOverlayRegistryURL: "https://gullible-pillbox.com", source: { location: "", }, diff --git a/docs/sdk/models/shared/githubpublishingprresponse.md b/docs/sdk/models/shared/githubpublishingprresponse.md index 1d0a5043..da5720f2 100644 --- a/docs/sdk/models/shared/githubpublishingprresponse.md +++ b/docs/sdk/models/shared/githubpublishingprresponse.md @@ -12,7 +12,8 @@ let value: GithubPublishingPRResponse = {}; ## Fields -| Field | Type | Required | Description | -| ----------------------- | ----------------------- | ----------------------- | ----------------------- | -| `generationPullRequest` | *string* | :heavy_minus_sign: | N/A | -| `pendingVersion` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `pendingVersion` | *string* | :heavy_minus_sign: | N/A | +| `pullRequest` | *string* | :heavy_minus_sign: | N/A | +| `pullRequestMetadata` | [shared.PullRequestMetadata](../../../sdk/models/shared/pullrequestmetadata.md) | :heavy_minus_sign: | This can only be populated when the github app is installed for a repo | \ No newline at end of file diff --git a/docs/sdk/models/shared/githubsetupstateresponse.md b/docs/sdk/models/shared/githubsetupstateresponse.md new file mode 100644 index 00000000..64442a9a --- /dev/null +++ b/docs/sdk/models/shared/githubsetupstateresponse.md @@ -0,0 +1,29 @@ +# GithubSetupStateResponse + +The state of a particular SDK targets github setup + +## Example Usage + +```typescript +import { GithubSetupStateResponse } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; + +let value: GithubSetupStateResponse = { + actions: { + generationActionConfigured: false, + publishActionConfigured: false, + }, + appInstalled: false, + secrets: { + apiKeyConfigured: false, + publishingSecretsConfigured: false, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `actions` | [shared.Actions](../../../sdk/models/shared/actions.md) | :heavy_check_mark: | N/A | +| `appInstalled` | *boolean* | :heavy_check_mark: | N/A | +| `secrets` | [shared.Secrets](../../../sdk/models/shared/secrets.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/shared/httpmethod.md b/docs/sdk/models/shared/httpmethod.md new file mode 100644 index 00000000..9411b3a3 --- /dev/null +++ b/docs/sdk/models/shared/httpmethod.md @@ -0,0 +1,15 @@ +# HttpMethod + +## Example Usage + +```typescript +import { HttpMethod } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; + +let value: HttpMethod = "options"; +``` + +## Values + +```typescript +"get" | "post" | "put" | "patch" | "delete" | "head" | "options" | "trace" +``` \ No newline at end of file diff --git a/docs/sdk/models/shared/interactiontype.md b/docs/sdk/models/shared/interactiontype.md index b94ed4b0..b3c6790a 100644 --- a/docs/sdk/models/shared/interactiontype.md +++ b/docs/sdk/models/shared/interactiontype.md @@ -7,11 +7,11 @@ Type of interaction. ```typescript import { InteractionType } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; -let value: InteractionType = "OPENAPI_DIFF"; +let value: InteractionType = "TARGET_GENERATE"; ``` ## Values ```typescript -"CI_EXEC" | "CLI_EXEC" | "LINT" | "OPENAPI_DIFF" | "TARGET_GENERATE" | "TOMBSTONE" | "AUTHENTICATE" | "QUICKSTART" | "RUN" | "CONFIGURE" | "PUBLISH" +"CI_EXEC" | "CLI_EXEC" | "LINT" | "OPENAPI_DIFF" | "TARGET_GENERATE" | "TOMBSTONE" | "AUTHENTICATE" | "QUICKSTART" | "RUN" | "CONFIGURE" | "PUBLISH" | "TEST" ``` \ No newline at end of file diff --git a/docs/sdk/models/shared/level.md b/docs/sdk/models/shared/level.md index 23d222a1..8f749c48 100644 --- a/docs/sdk/models/shared/level.md +++ b/docs/sdk/models/shared/level.md @@ -5,7 +5,7 @@ ```typescript import { Level } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; -let value: Level = "allowed"; +let value: Level = "warning"; ``` ## Values diff --git a/docs/sdk/models/shared/namespace.md b/docs/sdk/models/shared/namespace.md index 58e1f1e0..7a05bf38 100644 --- a/docs/sdk/models/shared/namespace.md +++ b/docs/sdk/models/shared/namespace.md @@ -8,10 +8,10 @@ A namespace contains many revisions. import { Namespace } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; let value: Namespace = { - createdAt: new Date("2024-03-31T12:50:52.284Z"), + createdAt: new Date("2025-01-28T08:46:24.999Z"), id: "", name: "", - updatedAt: new Date("2024-09-17T11:26:38.524Z"), + updatedAt: new Date("2023-12-30T01:59:14.256Z"), }; ``` @@ -19,7 +19,11 @@ let value: Namespace = { | Field | Type | Required | Description | | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `archivedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | N/A | +| `compositeSpecMetadata` | [shared.CompositeSpecMetadata](../../../sdk/models/shared/compositespecmetadata.md) | :heavy_minus_sign: | N/A | | `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | N/A | | `id` | *string* | :heavy_check_mark: | {organization_slug}/{workspace_slug}/{namespace_name} | +| `latestRevisionMetadata` | [shared.RevisionContentsMetadata](../../../sdk/models/shared/revisioncontentsmetadata.md) | :heavy_minus_sign: | N/A | | `name` | *string* | :heavy_check_mark: | A human-readable name for the namespace. | +| `public` | *boolean* | :heavy_minus_sign: | Indicates whether the namespace is publicly accessible | | `updatedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/shared/oasinfo.md b/docs/sdk/models/shared/oasinfo.md index d0945003..e7c67704 100644 --- a/docs/sdk/models/shared/oasinfo.md +++ b/docs/sdk/models/shared/oasinfo.md @@ -6,7 +6,7 @@ import { OASInfo } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; let value: OASInfo = { - description: "fidget faithfully under usable synergy redact zowie", + description: "into sheepishly meanwhile", license: {}, summary: "", title: "", diff --git a/docs/sdk/models/shared/oasoperation.md b/docs/sdk/models/shared/oasoperation.md index 4222cc23..8ee9e056 100644 --- a/docs/sdk/models/shared/oasoperation.md +++ b/docs/sdk/models/shared/oasoperation.md @@ -6,10 +6,10 @@ import { OASOperation } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; let value: OASOperation = { - description: "digestive traffic ouch substantiate into ew a", + description: "barring against victoriously larva profitable orient", method: "", operationId: "", - path: "/tmp", + path: "/usr/local/bin", tags: [ "", ], diff --git a/docs/sdk/models/shared/oassummary.md b/docs/sdk/models/shared/oassummary.md index c8c3136d..12ca9c09 100644 --- a/docs/sdk/models/shared/oassummary.md +++ b/docs/sdk/models/shared/oassummary.md @@ -7,7 +7,7 @@ import { OASSummary } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/m let value: OASSummary = { info: { - description: "summer horde whoa once hence", + description: "tensely transplant quip over meh jaggedly", license: {}, summary: "", title: "", @@ -15,10 +15,10 @@ let value: OASSummary = { }, operations: [ { - description: "fuss um unit grade soap sizzling huzzah like", + description: "worth owlishly yowza hmph finally through fast", method: "", operationId: "", - path: "/lost+found", + path: "/opt/lib", tags: [ "", ], diff --git a/docs/sdk/models/shared/openapidiffbumptype.md b/docs/sdk/models/shared/openapidiffbumptype.md index cb1790e0..46bb338c 100644 --- a/docs/sdk/models/shared/openapidiffbumptype.md +++ b/docs/sdk/models/shared/openapidiffbumptype.md @@ -7,7 +7,7 @@ Bump type of the lock file (calculated semver delta, or a custom change (manual ```typescript import { OpenapiDiffBumpType } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; -let value: OpenapiDiffBumpType = "minor"; +let value: OpenapiDiffBumpType = "major"; ``` ## Values diff --git a/docs/sdk/models/shared/organization.md b/docs/sdk/models/shared/organization.md index c9f80dc8..73bbc5a2 100644 --- a/docs/sdk/models/shared/organization.md +++ b/docs/sdk/models/shared/organization.md @@ -9,12 +9,13 @@ import { Organization } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk let value: Organization = { accountType: "enterprise", - createdAt: new Date("2022-07-28T01:45:34.109Z"), + createdAt: new Date("2023-06-29T18:21:41.585Z"), id: "", name: "", slug: "", + ssoActivated: false, telemetryDisabled: false, - updatedAt: new Date("2023-07-15T09:44:04.261Z"), + updatedAt: new Date("2024-09-21T03:00:08.692Z"), }; ``` @@ -26,7 +27,10 @@ let value: Organization = { | `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | N/A | | `freeTrialExpiry` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | N/A | | `id` | *string* | :heavy_check_mark: | N/A | +| `internal` | *boolean* | :heavy_minus_sign: | N/A | | `name` | *string* | :heavy_check_mark: | N/A | | `slug` | *string* | :heavy_check_mark: | N/A | +| `ssoActivated` | *boolean* | :heavy_check_mark: | N/A | +| `ssoConnectionId` | *string* | :heavy_minus_sign: | N/A | | `telemetryDisabled` | *boolean* | :heavy_check_mark: | N/A | | `updatedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/shared/organizationbillingaddonrequest.md b/docs/sdk/models/shared/organizationbillingaddonrequest.md new file mode 100644 index 00000000..012e3532 --- /dev/null +++ b/docs/sdk/models/shared/organizationbillingaddonrequest.md @@ -0,0 +1,21 @@ +# OrganizationBillingAddOnRequest + +A request to add billing add ons + +## Example Usage + +```typescript +import { OrganizationBillingAddOnRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; + +let value: OrganizationBillingAddOnRequest = { + addOns: [ + "custom_code_regions", + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `addOns` | [shared.BillingAddOn](../../../sdk/models/shared/billingaddon.md)[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/shared/organizationbillingaddonresponse.md b/docs/sdk/models/shared/organizationbillingaddonresponse.md new file mode 100644 index 00000000..01dd3a51 --- /dev/null +++ b/docs/sdk/models/shared/organizationbillingaddonresponse.md @@ -0,0 +1,21 @@ +# OrganizationBillingAddOnResponse + +Billing add on response + +## Example Usage + +```typescript +import { OrganizationBillingAddOnResponse } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; + +let value: OrganizationBillingAddOnResponse = { + addOns: [ + "custom_code_regions", + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `addOns` | [shared.BillingAddOn](../../../sdk/models/shared/billingaddon.md)[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/shared/organizationusage.md b/docs/sdk/models/shared/organizationusage.md index ff597587..746a1c55 100644 --- a/docs/sdk/models/shared/organizationusage.md +++ b/docs/sdk/models/shared/organizationusage.md @@ -14,7 +14,8 @@ let value: OrganizationUsage = { "", ], language: "", - numberOfOperations: 862192, + maxOperations: 894069, + numberOfOperations: 286038, usedFeatures: [ "", ], @@ -26,12 +27,13 @@ let value: OrganizationUsage = { ## Fields -| Field | Type | Required | Description | -| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | -| `accessible` | *boolean* | :heavy_check_mark: | Indicates if the features are accessible | -| `accessibleFeatures` | *string*[] | :heavy_check_mark: | Features that are accessible | -| `genLockIds` | *string*[] | :heavy_check_mark: | List of generation lock IDs | -| `language` | *string* | :heavy_check_mark: | The programming language used | -| `numberOfOperations` | *number* | :heavy_check_mark: | Number of operations performed | -| `usedFeatures` | *string*[] | :heavy_check_mark: | Features that have been used | -| `workspaces` | *string*[] | :heavy_check_mark: | List of workspace IDs | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `accessible` | *boolean* | :heavy_check_mark: | Indicates if the features are accessible | +| `accessibleFeatures` | *string*[] | :heavy_check_mark: | Features that are accessible | +| `genLockIds` | *string*[] | :heavy_check_mark: | List of generation lock IDs | +| `language` | *string* | :heavy_check_mark: | The programming language used | +| `maxOperations` | *number* | :heavy_check_mark: | Maximum Number of operations per SDK specific in contract | +| `numberOfOperations` | *number* | :heavy_check_mark: | Number of operations performed | +| `usedFeatures` | *string*[] | :heavy_check_mark: | Features that have been used | +| `workspaces` | *string*[] | :heavy_check_mark: | List of workspace IDs | \ No newline at end of file diff --git a/docs/sdk/models/shared/organizationusageresponse.md b/docs/sdk/models/shared/organizationusageresponse.md index 47f5b2de..444ff79e 100644 --- a/docs/sdk/models/shared/organizationusageresponse.md +++ b/docs/sdk/models/shared/organizationusageresponse.md @@ -11,7 +11,7 @@ let value: OrganizationUsageResponse = { allowedLanguages: [ "", ], - totalAllowedLanguages: 224317, + totalAllowedLanguages: 562064, usage: [ { accessible: false, @@ -22,7 +22,8 @@ let value: OrganizationUsageResponse = { "", ], language: "", - numberOfOperations: 97844, + maxOperations: 522206, + numberOfOperations: 165177, usedFeatures: [ "", ], diff --git a/docs/sdk/models/shared/pullrequestmetadata.md b/docs/sdk/models/shared/pullrequestmetadata.md new file mode 100644 index 00000000..57763b86 --- /dev/null +++ b/docs/sdk/models/shared/pullrequestmetadata.md @@ -0,0 +1,25 @@ +# PullRequestMetadata + +This can only be populated when the github app is installed for a repo + +## Example Usage + +```typescript +import { PullRequestMetadata } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; + +let value: PullRequestMetadata = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `baseBranch` | *string* | :heavy_minus_sign: | N/A | +| `canMerge` | *boolean* | :heavy_minus_sign: | N/A | +| `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | N/A | +| `description` | *string* | :heavy_minus_sign: | truncated to first 1000 characters | +| `headBranch` | *string* | :heavy_minus_sign: | N/A | +| `labels` | *string*[] | :heavy_minus_sign: | List of github labels | +| `requestedReviewers` | *string*[] | :heavy_minus_sign: | List of github handles | +| `status` | *string* | :heavy_minus_sign: | N/A | +| `title` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/shared/remotedocument.md b/docs/sdk/models/shared/remotedocument.md new file mode 100644 index 00000000..40229555 --- /dev/null +++ b/docs/sdk/models/shared/remotedocument.md @@ -0,0 +1,19 @@ +# RemoteDocument + +A document hosted in the registry + +## Example Usage + +```typescript +import { RemoteDocument } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; + +let value: RemoteDocument = { + registryUrl: "https://free-bran.com", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `registryUrl` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/shared/remotesource.md b/docs/sdk/models/shared/remotesource.md new file mode 100644 index 00000000..6cc0d1ec --- /dev/null +++ b/docs/sdk/models/shared/remotesource.md @@ -0,0 +1,28 @@ +# RemoteSource + +Remote source configuration + +## Example Usage + +```typescript +import { RemoteSource } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; + +let value: RemoteSource = { + inputs: [ + { + registryUrl: "https://unknown-testimonial.org", + }, + ], + output: { + registryUrl: "https://cluttered-cellar.biz", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `inputs` | [shared.RemoteDocument](../../../sdk/models/shared/remotedocument.md)[] | :heavy_check_mark: | N/A | +| `output` | [shared.RemoteDocument](../../../sdk/models/shared/remotedocument.md) | :heavy_check_mark: | A document hosted in the registry | +| `overlays` | [shared.RemoteDocument](../../../sdk/models/shared/remotedocument.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/shared/remotesourcesubscriptionsettings.md b/docs/sdk/models/shared/remotesourcesubscriptionsettings.md new file mode 100644 index 00000000..9a4d689d --- /dev/null +++ b/docs/sdk/models/shared/remotesourcesubscriptionsettings.md @@ -0,0 +1,26 @@ +# RemoteSourceSubscriptionSettings + +## Example Usage + +```typescript +import { RemoteSourceSubscriptionSettings } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; + +let value: RemoteSourceSubscriptionSettings = { + baseSpecNamespaces: [ + "", + ], + outputNamespace: "", + overlayNamespaces: [ + "", + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `baseSpecNamespaces` | *string*[] | :heavy_check_mark: | N/A | +| `ignoredNamespaces` | *string*[] | :heavy_minus_sign: | N/A | +| `outputNamespace` | *string* | :heavy_check_mark: | N/A | +| `overlayNamespaces` | *string*[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/shared/requestmetadata.md b/docs/sdk/models/shared/requestmetadata.md deleted file mode 100644 index 85e37daa..00000000 --- a/docs/sdk/models/shared/requestmetadata.md +++ /dev/null @@ -1,18 +0,0 @@ -# RequestMetadata - -Key-Value pairs associated with a request - -## Example Usage - -```typescript -import { RequestMetadata } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; - -let value: RequestMetadata = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `key` | *string* | :heavy_minus_sign: | N/A | -| `value` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/shared/revision.md b/docs/sdk/models/shared/revision.md index d6c15222..af31fa8b 100644 --- a/docs/sdk/models/shared/revision.md +++ b/docs/sdk/models/shared/revision.md @@ -6,7 +6,7 @@ import { Revision } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; let value: Revision = { - createdAt: new Date("2023-10-03T14:03:30.664Z"), + createdAt: new Date("2025-01-14T03:58:52.058Z"), digest: "sha256:6d1ef012b5674ad8a127ecfa9b5e6f5178d171b90ee462846974177fd9bdd39f", id: "", @@ -14,7 +14,7 @@ let value: Revision = { tags: [ "", ], - updatedAt: new Date("2024-11-20T06:46:28.205Z"), + updatedAt: new Date("2024-12-29T21:20:56.889Z"), }; ``` @@ -22,6 +22,7 @@ let value: Revision = { | Field | Type | Required | Description | Example | | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `contentsMetadata` | [shared.RevisionContentsMetadata](../../../sdk/models/shared/revisioncontentsmetadata.md) | :heavy_minus_sign: | N/A | | | `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | N/A | | | `digest` | *string* | :heavy_check_mark: | N/A | sha256:6d1ef012b5674ad8a127ecfa9b5e6f5178d171b90ee462846974177fd9bdd39f | | `id` | *string* | :heavy_check_mark: | Format {namespace_id}/{revision_digest} | | diff --git a/docs/sdk/models/shared/revisioncontentsmetadata.md b/docs/sdk/models/shared/revisioncontentsmetadata.md new file mode 100644 index 00000000..3bd2bf61 --- /dev/null +++ b/docs/sdk/models/shared/revisioncontentsmetadata.md @@ -0,0 +1,46 @@ +# RevisionContentsMetadata + +## Example Usage + +```typescript +import { RevisionContentsMetadata } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; + +let value: RevisionContentsMetadata = { + containsCodeSamples: false, + createdAt: new Date("2023-03-29T23:52:27.454Z"), + description: + "among jubilantly fireplace physical rebuild per definitive gracefully failing unfinished", + hash: "", + namespace: "", + numOverlayActions: 955994, + operationIds: [ + "", + ], + revisionDigest: "", + tags: [ + "", + ], + title: "", + type: "OPENAPI_BUNDLE", + version: "", + workspaceId: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `containsCodeSamples` | *boolean* | :heavy_check_mark: | Whether the OAS contains code samples. | +| `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | N/A | +| `description` | *string* | :heavy_check_mark: | The OAS description | +| `hash` | *string* | :heavy_check_mark: | The hash of the contents | +| `namespace` | *string* | :heavy_check_mark: | The fully qualified namespace | +| `numOverlayActions` | *number* | :heavy_check_mark: | The number of overlay actions in the OAS. Will be 0 if the OAS is not an overlay. | +| `operationIds` | *string*[] | :heavy_check_mark: | The operation IDs contained in the OAS. Will be empty if the OAS is an overlay. | +| `revisionDigest` | *string* | :heavy_check_mark: | The digest of the parent bundle | +| `tags` | *string*[] | :heavy_check_mark: | The tags contained in the OAS -- NOT the OCI tags. Will be empty if the OAS is an overlay. | +| `title` | *string* | :heavy_check_mark: | The OAS title | +| `type` | [shared.RevisionContentsMetadataType](../../../sdk/models/shared/revisioncontentsmetadatatype.md) | :heavy_check_mark: | N/A | +| `version` | *string* | :heavy_check_mark: | The OAS version | +| `workspaceId` | *string* | :heavy_check_mark: | The workspace ID | \ No newline at end of file diff --git a/docs/sdk/models/shared/revisioncontentsmetadatatype.md b/docs/sdk/models/shared/revisioncontentsmetadatatype.md new file mode 100644 index 00000000..d60db1b7 --- /dev/null +++ b/docs/sdk/models/shared/revisioncontentsmetadatatype.md @@ -0,0 +1,15 @@ +# RevisionContentsMetadataType + +## Example Usage + +```typescript +import { RevisionContentsMetadataType } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; + +let value: RevisionContentsMetadataType = "OPENAPI_BUNDLE"; +``` + +## Values + +```typescript +"OPENAPI_BUNDLE" | "OPENAPI_OVERLAY" +``` \ No newline at end of file diff --git a/docs/sdk/models/shared/schema.md b/docs/sdk/models/shared/schema.md deleted file mode 100644 index 0b49c0b1..00000000 --- a/docs/sdk/models/shared/schema.md +++ /dev/null @@ -1,29 +0,0 @@ -# Schema - -A Schema represents an API schema for a particular Api and Version. - -## Example Usage - -```typescript -import { Schema } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; - -let value: Schema = { - apiId: "", - createdAt: new Date("2024-11-01T00:46:16.847Z"), - description: "unless lest reward firsthand mmm concerning ceramics instantly", - revisionId: "", - versionId: "", - workspaceId: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `apiId` | *string* | :heavy_check_mark: | The ID of the Api this Schema belongs to. | -| `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | Creation timestamp. | -| `description` | *string* | :heavy_check_mark: | A detailed description of the Schema. | -| `revisionId` | *string* | :heavy_check_mark: | An ID referencing this particular revision of the Schema. | -| `versionId` | *string* | :heavy_check_mark: | The version ID of the Api this Schema belongs to. | -| `workspaceId` | *string* | :heavy_check_mark: | The workspace ID this Schema belongs to. | \ No newline at end of file diff --git a/docs/sdk/models/shared/schemadiff.md b/docs/sdk/models/shared/schemadiff.md deleted file mode 100644 index 1cb70df4..00000000 --- a/docs/sdk/models/shared/schemadiff.md +++ /dev/null @@ -1,32 +0,0 @@ -# SchemaDiff - -A SchemaDiff represents a diff of two Schemas. - -## Example Usage - -```typescript -import { SchemaDiff } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; - -let value: SchemaDiff = { - additions: [ - "", - ], - deletions: [ - "", - ], - modifications: { - "key": { - from: "", - to: "", - }, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | -| `additions` | *string*[] | :heavy_check_mark: | Holds every addition change in the diff. | -| `deletions` | *string*[] | :heavy_check_mark: | Holds every deletion change in the diff. | -| `modifications` | Record | :heavy_check_mark: | Holds every modification change in the diff. | \ No newline at end of file diff --git a/docs/sdk/models/operations/registerschemafile.md b/docs/sdk/models/shared/schemafile.md similarity index 82% rename from docs/sdk/models/operations/registerschemafile.md rename to docs/sdk/models/shared/schemafile.md index 8d5859fd..ebe17619 100644 --- a/docs/sdk/models/operations/registerschemafile.md +++ b/docs/sdk/models/shared/schemafile.md @@ -1,9 +1,9 @@ -# RegisterSchemaFile +# SchemaFile ## Example Usage ```typescript -import { RegisterSchemaFile } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/operations"; +import { SchemaFile } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; // No examples available for this model ``` diff --git a/docs/sdk/models/shared/versionmetadata.md b/docs/sdk/models/shared/schemastoreitem.md similarity index 60% rename from docs/sdk/models/shared/versionmetadata.md rename to docs/sdk/models/shared/schemastoreitem.md index ef941c34..bc0d8f73 100644 --- a/docs/sdk/models/shared/versionmetadata.md +++ b/docs/sdk/models/shared/schemastoreitem.md @@ -1,19 +1,17 @@ -# VersionMetadata - -A set of keys and associated values, attached to a particular version of an Api. +# SchemaStoreItem ## Example Usage ```typescript -import { VersionMetadata } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; +import { SchemaStoreItem } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; -let value: VersionMetadata = { - apiId: "", - createdAt: new Date("2022-07-24T01:37:14.976Z"), - metaKey: "", - metaValue: "", - versionId: "", - workspaceId: "", +let value: SchemaStoreItem = { + createdAt: new Date("2024-09-29T22:06:43.079Z"), + format: "json", + id: "", + packageName: "", + sdkClassname: "", + spec: "", }; ``` @@ -21,9 +19,9 @@ let value: VersionMetadata = { | Field | Type | Required | Description | | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `apiId` | *string* | :heavy_check_mark: | The ID of the Api this Metadata belongs to. | -| `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | Creation timestamp. | -| `metaKey` | *string* | :heavy_check_mark: | The key for this metadata. | -| `metaValue` | *string* | :heavy_check_mark: | One of the values for this metadata. | -| `versionId` | *string* | :heavy_check_mark: | The version ID of the Api this Metadata belongs to. | -| `workspaceId` | *string* | :heavy_check_mark: | The workspace ID this Metadata belongs to. | \ No newline at end of file +| `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | N/A | +| `format` | [shared.Format](../../../sdk/models/shared/format.md) | :heavy_check_mark: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | +| `packageName` | *string* | :heavy_check_mark: | N/A | +| `sdkClassname` | *string* | :heavy_check_mark: | N/A | +| `spec` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/shared/secrets.md b/docs/sdk/models/shared/secrets.md new file mode 100644 index 00000000..3f948658 --- /dev/null +++ b/docs/sdk/models/shared/secrets.md @@ -0,0 +1,19 @@ +# Secrets + +## Example Usage + +```typescript +import { Secrets } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; + +let value: Secrets = { + apiKeyConfigured: false, + publishingSecretsConfigured: false, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------- | ----------------------------- | ----------------------------- | ----------------------------- | +| `apiKeyConfigured` | *boolean* | :heavy_check_mark: | N/A | +| `publishingSecretsConfigured` | *boolean* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/shared/shorturl.md b/docs/sdk/models/shared/shorturl.md index 0c9cc7d7..7af800ad 100644 --- a/docs/sdk/models/shared/shorturl.md +++ b/docs/sdk/models/shared/shorturl.md @@ -6,8 +6,8 @@ import { ShortURL } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; let value: ShortURL = { - fullUrl: "https://untimely-sand.biz", - shortUrl: "https://impure-department.com/", + fullUrl: "https://dead-bump.name/", + shortUrl: "https://free-stitcher.com", }; ``` diff --git a/docs/sdk/models/shared/suggestitemsrequestbody.md b/docs/sdk/models/shared/suggestitemsrequestbody.md new file mode 100644 index 00000000..18d4c4d6 --- /dev/null +++ b/docs/sdk/models/shared/suggestitemsrequestbody.md @@ -0,0 +1,21 @@ +# SuggestItemsRequestBody + +## Example Usage + +```typescript +import { SuggestItemsRequestBody } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; + +let value: SuggestItemsRequestBody = { + items: [ + "", + ], + prompt: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `items` | *string*[] | :heavy_check_mark: | The list of "things" to get suggestions for. One suggestion will be returned for each item in the list. | +| `prompt` | *string* | :heavy_check_mark: | The prompt to use for the suggestion. Think of this as the "preamble". | \ No newline at end of file diff --git a/docs/sdk/models/shared/suggestoptsold.md b/docs/sdk/models/shared/suggestoptsold.md index c01f8e57..996c8433 100644 --- a/docs/sdk/models/shared/suggestoptsold.md +++ b/docs/sdk/models/shared/suggestoptsold.md @@ -6,7 +6,7 @@ import { SuggestOptsOld } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; let value: SuggestOptsOld = { - suggestionType: "method-names", + suggestionType: "diagnostics-only", }; ``` diff --git a/docs/sdk/models/shared/suggestrequestbody.md b/docs/sdk/models/shared/suggestrequestbody.md index 06f3c969..47473fdc 100644 --- a/docs/sdk/models/shared/suggestrequestbody.md +++ b/docs/sdk/models/shared/suggestrequestbody.md @@ -10,14 +10,15 @@ let value: SuggestRequestBody = { { message: "", path: [ - "/usr/include", + "/srv", ], type: "", }, ], oasSummary: { info: { - description: "knottily ethyl covenant", + description: + "opposite dowse strategy peppery lest incidentally shiny although", license: {}, summary: "", title: "", @@ -25,11 +26,10 @@ let value: SuggestRequestBody = { }, operations: [ { - description: - "politely after horst vanadyl mmm ownership toward curly about", + description: "whose flashy lazy along how punctually strictly ha", method: "", operationId: "", - path: "/var/spool", + path: "/private/var", tags: [ "", ], diff --git a/docs/sdk/models/shared/targetsdk.md b/docs/sdk/models/shared/targetsdk.md index 3a835970..f43548d2 100644 --- a/docs/sdk/models/shared/targetsdk.md +++ b/docs/sdk/models/shared/targetsdk.md @@ -9,9 +9,9 @@ let value: TargetSDK = { generateGenLockId: "", generateTarget: "", id: "", - lastEventCreatedAt: new Date("2024-02-22T06:55:25.344Z"), + lastEventCreatedAt: new Date("2024-07-24T09:31:04.168Z"), lastEventId: "", - lastEventInteractionType: "QUICKSTART", + lastEventInteractionType: "CI_EXEC", }; ``` @@ -29,6 +29,7 @@ let value: TargetSDK = { | `generateGenLockPreVersion` | *string* | :heavy_minus_sign: | Artifact version for the Previous Generation | | `generateNumberOfOperationsIgnored` | *number* | :heavy_minus_sign: | The number of operations ignored in generation. | | `generateNumberOfOperationsUsed` | *number* | :heavy_minus_sign: | The number of operations used in generation. | +| `generateNumberOfTerraformResources` | *number* | :heavy_minus_sign: | The number of terraform resources used in generation. | | `generatePublished` | *boolean* | :heavy_minus_sign: | Indicates whether the target was considered published. | | `generateTarget` | *string* | :heavy_check_mark: | eg `typescript`, `terraform`, `python` | | `generateTargetName` | *string* | :heavy_minus_sign: | The workflow name of the target. | @@ -48,6 +49,8 @@ let value: TargetSDK = { | `lastEventCreatedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | Timestamp when the event was created in the database. | | `lastEventId` | *string* | :heavy_check_mark: | Unique identifier of the last event for the target | | `lastEventInteractionType` | [shared.InteractionType](../../../sdk/models/shared/interactiontype.md) | :heavy_check_mark: | Type of interaction. | +| `lastPublishCreatedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | Timestamp when the last publishing event was created. | +| `lastPublishGhActionRunLink` | *string* | :heavy_minus_sign: | Link to the GitHub action run for the last publishing event. | | `publishPackageName` | *string* | :heavy_minus_sign: | Name of the published package. | | `publishPackageRegistryName` | *string* | :heavy_minus_sign: | Name of the registry where the package was published. | | `publishPackageUrl` | *string* | :heavy_minus_sign: | URL of the published package. | @@ -57,5 +60,7 @@ let value: TargetSDK = { | `sourceNamespaceName` | *string* | :heavy_minus_sign: | The namespace name of the source. | | `sourceRevisionDigest` | *string* | :heavy_minus_sign: | The revision digest of the source. | | `success` | *boolean* | :heavy_minus_sign: | Indicates whether the event was successful. | +| `workflowLockPostRaw` | *string* | :heavy_minus_sign: | Workflow lock file (post execution) | +| `workflowLockPreRaw` | *string* | :heavy_minus_sign: | Workflow lock file (prior to execution) | | `workflowPostRaw` | *string* | :heavy_minus_sign: | Workflow file (post execution) | | `workflowPreRaw` | *string* | :heavy_minus_sign: | Workflow file (prior to execution) | \ No newline at end of file diff --git a/docs/sdk/models/shared/type.md b/docs/sdk/models/shared/type.md index 1debf2fc..141ad1d3 100644 --- a/docs/sdk/models/shared/type.md +++ b/docs/sdk/models/shared/type.md @@ -5,7 +5,7 @@ ```typescript import { Type } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; -let value: Type = "changes"; +let value: Type = "linting"; ``` ## Values diff --git a/docs/sdk/models/shared/unboundedrequest.md b/docs/sdk/models/shared/unboundedrequest.md deleted file mode 100644 index 8bc617df..00000000 --- a/docs/sdk/models/shared/unboundedrequest.md +++ /dev/null @@ -1,27 +0,0 @@ -# UnboundedRequest - -An UnboundedRequest represents the HAR content capture by Speakeasy when logging a request. - -## Example Usage - -```typescript -import { UnboundedRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; - -let value: UnboundedRequest = { - createdAt: new Date("2023-11-22T23:18:09.113Z"), - har: "", - harSizeBytes: 874288, - requestId: "", - workspaceId: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | Creation timestamp. | -| `har` | *string* | :heavy_check_mark: | The HAR content of the request. | -| `harSizeBytes` | *number* | :heavy_check_mark: | The size of the HAR content in bytes. | -| `requestId` | *string* | :heavy_check_mark: | The ID of this request. | -| `workspaceId` | *string* | :heavy_check_mark: | The workspace ID this request was made to. | \ No newline at end of file diff --git a/docs/sdk/models/shared/usagesnippet.md b/docs/sdk/models/shared/usagesnippet.md new file mode 100644 index 00000000..062dcc9c --- /dev/null +++ b/docs/sdk/models/shared/usagesnippet.md @@ -0,0 +1,25 @@ +# UsageSnippet + +## Example Usage + +```typescript +import { UsageSnippet } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; + +let value: UsageSnippet = { + code: "", + language: "", + method: "", + operationId: "", + path: "/private/tmp", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `code` | *string* | :heavy_check_mark: | The code snippet | +| `language` | *string* | :heavy_check_mark: | The language of the snippet | +| `method` | *any* | :heavy_check_mark: | The HTTP method of the operation | +| `operationId` | *string* | :heavy_check_mark: | The operation ID for the snippet | +| `path` | *string* | :heavy_check_mark: | The path of the operation | \ No newline at end of file diff --git a/docs/sdk/models/shared/usagesnippets.md b/docs/sdk/models/shared/usagesnippets.md new file mode 100644 index 00000000..1792b665 --- /dev/null +++ b/docs/sdk/models/shared/usagesnippets.md @@ -0,0 +1,25 @@ +# UsageSnippets + +## Example Usage + +```typescript +import { UsageSnippets } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; + +let value: UsageSnippets = { + snippets: [ + { + code: "", + language: "", + method: "", + operationId: "", + path: "/Library", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `snippets` | [shared.UsageSnippet](../../../sdk/models/shared/usagesnippet.md)[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/shared/user.md b/docs/sdk/models/shared/user.md index 67121afa..3d449299 100644 --- a/docs/sdk/models/shared/user.md +++ b/docs/sdk/models/shared/user.md @@ -8,12 +8,12 @@ import { User } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/ let value: User = { admin: false, confirmed: false, - createdAt: new Date("2022-04-20T22:07:54.686Z"), - displayName: "Agnes_Ortiz", - email: "Jeanette23@gmail.com", + createdAt: new Date("2024-07-05T21:57:00.508Z"), + displayName: "Carissa_Lehner", + email: "Eusebio.Fritsch17@hotmail.com", emailVerified: false, id: "", - updatedAt: new Date("2024-10-28T17:59:56.921Z"), + updatedAt: new Date("2023-05-05T07:56:21.227Z"), whitelisted: false, }; ``` @@ -30,8 +30,11 @@ let value: User = { | `email` | *string* | :heavy_check_mark: | Email address of the user. | | `emailVerified` | *boolean* | :heavy_check_mark: | Indicates whether the email address has been verified. | | `githubHandle` | *string* | :heavy_minus_sign: | GitHub handle of the user. | +| `hasCreatedApiKey` | *boolean* | :heavy_minus_sign: | Indicates whether the user has created an API key. Not always populated | | `id` | *string* | :heavy_check_mark: | Unique identifier for the user. | +| `internal` | *boolean* | :heavy_minus_sign: | Indicates whether the user is internal. | | `lastLoginAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | Timestamp of the last login. | | `photoUrl` | *string* | :heavy_minus_sign: | URL of the user's photo. | +| `pylonIdentityHash` | *string* | :heavy_minus_sign: | Hash used for pylon identity verification returned on v1/user. | | `updatedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | Timestamp of the user's last update. | | `whitelisted` | *boolean* | :heavy_check_mark: | Indicates whether the user has been whitelisted. | \ No newline at end of file diff --git a/docs/sdk/models/shared/valuechange.md b/docs/sdk/models/shared/valuechange.md deleted file mode 100644 index 144a0278..00000000 --- a/docs/sdk/models/shared/valuechange.md +++ /dev/null @@ -1,19 +0,0 @@ -# ValueChange - -## Example Usage - -```typescript -import { ValueChange } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; - -let value: ValueChange = { - from: "", - to: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | -| `from` | *string* | :heavy_check_mark: | Represents the previous value of the element. | -| `to` | *string* | :heavy_check_mark: | Represents the current value of the element. | \ No newline at end of file diff --git a/docs/sdk/models/shared/versionmetadatainput.md b/docs/sdk/models/shared/versionmetadatainput.md deleted file mode 100644 index e46c1b6a..00000000 --- a/docs/sdk/models/shared/versionmetadatainput.md +++ /dev/null @@ -1,21 +0,0 @@ -# VersionMetadataInput - -A set of keys and associated values, attached to a particular version of an Api. - -## Example Usage - -```typescript -import { VersionMetadataInput } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; - -let value: VersionMetadataInput = { - metaKey: "", - metaValue: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `metaKey` | *string* | :heavy_check_mark: | The key for this metadata. | -| `metaValue` | *string* | :heavy_check_mark: | One of the values for this metadata. | \ No newline at end of file diff --git a/docs/sdk/models/shared/workspace.md b/docs/sdk/models/shared/workspace.md index 59123363..f0a800ad 100644 --- a/docs/sdk/models/shared/workspace.md +++ b/docs/sdk/models/shared/workspace.md @@ -8,28 +8,26 @@ A speakeasy workspace import { Workspace } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; let value: Workspace = { - createdAt: new Date("2024-12-29T18:23:56.613Z"), + createdAt: new Date("2024-09-06T14:20:55.891Z"), id: "", name: "", organizationId: "", slug: "", - telemetryDisabled: false, - updatedAt: new Date("2023-02-01T23:01:15.623Z"), + updatedAt: new Date("2024-12-30T03:33:44.776Z"), verified: false, }; ``` ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | N/A | -| `id` | *string* | :heavy_check_mark: | N/A | -| `name` | *string* | :heavy_check_mark: | N/A | -| `ociRepo` | *string* | :heavy_minus_sign: | N/A | -| `ociRepoCreatedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | N/A | -| `organizationId` | *string* | :heavy_check_mark: | N/A | -| `slug` | *string* | :heavy_check_mark: | N/A | -| `telemetryDisabled` | *boolean* | :heavy_check_mark: | N/A | -| `updatedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | N/A | -| `verified` | *boolean* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | +| `inactive` | *boolean* | :heavy_minus_sign: | N/A | +| `name` | *string* | :heavy_check_mark: | N/A | +| `organizationId` | *string* | :heavy_check_mark: | N/A | +| `slug` | *string* | :heavy_check_mark: | N/A | +| ~~`telemetryDisabled`~~ | *boolean* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated. Use organization.telemetry_disabled instead. | +| `updatedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | N/A | +| `verified` | *boolean* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/shared/workspaceandorganization.md b/docs/sdk/models/shared/workspaceandorganization.md index 9eaca5e1..3a7d9d9a 100644 --- a/docs/sdk/models/shared/workspaceandorganization.md +++ b/docs/sdk/models/shared/workspaceandorganization.md @@ -9,22 +9,22 @@ import { WorkspaceAndOrganization } from "@speakeasy-api/speakeasy-client-sdk-ty let value: WorkspaceAndOrganization = { organization: { - accountType: "scale-up", - createdAt: new Date("2023-02-19T13:21:39.892Z"), + accountType: "business", + createdAt: new Date("2023-06-23T09:04:56.583Z"), id: "", name: "", slug: "", + ssoActivated: false, telemetryDisabled: false, - updatedAt: new Date("2024-12-09T13:28:34.858Z"), + updatedAt: new Date("2023-05-06T16:26:41.472Z"), }, workspace: { - createdAt: new Date("2022-07-11T10:12:51.010Z"), + createdAt: new Date("2025-08-27T07:37:11.693Z"), id: "", name: "", organizationId: "", slug: "", - telemetryDisabled: false, - updatedAt: new Date("2022-12-26T11:23:46.953Z"), + updatedAt: new Date("2023-04-29T03:38:38.048Z"), verified: false, }, }; diff --git a/docs/sdk/models/shared/workspacefeatureflag.md b/docs/sdk/models/shared/workspacefeatureflag.md new file mode 100644 index 00000000..d69cf1ab --- /dev/null +++ b/docs/sdk/models/shared/workspacefeatureflag.md @@ -0,0 +1,19 @@ +# WorkspaceFeatureFlag + +enum value workspace feature flag + +## Example Usage + +```typescript +import { WorkspaceFeatureFlag } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; + +let value: WorkspaceFeatureFlag = "schema_registry"; +``` + +## Values + +This is an open enum. Unrecognized values will be captured as the `Unrecognized` branded type. + +```typescript +"schema_registry" | "changes_report" | "skip_schema_registry" | "webhooks" | Unrecognized +``` \ No newline at end of file diff --git a/docs/sdk/models/shared/workspacefeatureflagrequest.md b/docs/sdk/models/shared/workspacefeatureflagrequest.md new file mode 100644 index 00000000..1129381b --- /dev/null +++ b/docs/sdk/models/shared/workspacefeatureflagrequest.md @@ -0,0 +1,21 @@ +# WorkspaceFeatureFlagRequest + +A request to add workspace feature flags + +## Example Usage + +```typescript +import { WorkspaceFeatureFlagRequest } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; + +let value: WorkspaceFeatureFlagRequest = { + featureFlags: [ + "schema_registry", + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `featureFlags` | [shared.WorkspaceFeatureFlag](../../../sdk/models/shared/workspacefeatureflag.md)[] | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/shared/workspacesettings.md b/docs/sdk/models/shared/workspacesettings.md index d349f161..baa09bc9 100644 --- a/docs/sdk/models/shared/workspacesettings.md +++ b/docs/sdk/models/shared/workspacesettings.md @@ -6,13 +6,18 @@ import { WorkspaceSettings } from "@speakeasy-api/speakeasy-client-sdk-typescript/sdk/models/shared"; let value: WorkspaceSettings = { + createdAt: new Date("2024-11-08T04:34:18.582Z"), + updatedAt: new Date("2024-05-30T20:33:26.649Z"), + webhookUrl: "https://anguished-eggplant.name", workspaceId: "", }; ``` ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `webhookUrl` | *string* | :heavy_minus_sign: | N/A | -| `workspaceId` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | N/A | +| `updatedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | N/A | +| `webhookUrl` | *string* | :heavy_check_mark: | N/A | +| `workspaceId` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdk/models/shared/workspaceteamresponse.md b/docs/sdk/models/shared/workspaceteamresponse.md index fabc64da..975575fa 100644 --- a/docs/sdk/models/shared/workspaceteamresponse.md +++ b/docs/sdk/models/shared/workspaceteamresponse.md @@ -12,12 +12,12 @@ let value: WorkspaceTeamResponse = { { admin: false, confirmed: false, - createdAt: new Date("2024-01-16T15:53:28.719Z"), - displayName: "Angus.Kreiger", - email: "Jaclyn.Witting@yahoo.com", + createdAt: new Date("2024-11-24T21:10:46.683Z"), + displayName: "Elvera.Mohr", + email: "Maud59@gmail.com", emailVerified: false, id: "", - updatedAt: new Date("2023-10-10T18:22:17.762Z"), + updatedAt: new Date("2024-01-02T05:13:39.423Z"), whitelisted: false, }, ], diff --git a/docs/sdk/models/shared/workspacetoken.md b/docs/sdk/models/shared/workspacetoken.md index 44a2d437..8fff3622 100644 --- a/docs/sdk/models/shared/workspacetoken.md +++ b/docs/sdk/models/shared/workspacetoken.md @@ -9,23 +9,26 @@ import { WorkspaceToken } from "@speakeasy-api/speakeasy-client-sdk-typescript/s let value: WorkspaceToken = { alg: "", - createdAt: "", + createdAt: new Date("2024-04-19T04:59:33.478Z"), id: "", key: "", name: "", + workspaceId: "", }; ``` ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `alg` | *string* | :heavy_check_mark: | N/A | -| `createdAt` | *string* | :heavy_check_mark: | N/A | -| `createdBy` | *string* | :heavy_minus_sign: | N/A | -| `email` | *string* | :heavy_minus_sign: | N/A | -| `id` | *string* | :heavy_check_mark: | N/A | -| `key` | *string* | :heavy_check_mark: | N/A | -| `lastUsed` | *string* | :heavy_minus_sign: | N/A | -| `name` | *string* | :heavy_check_mark: | N/A | -| `workspaceId` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `alg` | *string* | :heavy_check_mark: | N/A | +| `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | N/A | +| `createdBy` | *string* | :heavy_minus_sign: | N/A | +| `createdByName` | *string* | :heavy_minus_sign: | N/A | +| `createdByPhotoUrl` | *string* | :heavy_minus_sign: | N/A | +| `email` | *string* | :heavy_minus_sign: | N/A | +| `id` | *string* | :heavy_check_mark: | N/A | +| `key` | *string* | :heavy_check_mark: | N/A | +| `lastUsed` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | N/A | +| `name` | *string* | :heavy_check_mark: | N/A | +| `workspaceId` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdks/apiendpoints/README.md b/docs/sdks/apiendpoints/README.md deleted file mode 100644 index c1d553ad..00000000 --- a/docs/sdks/apiendpoints/README.md +++ /dev/null @@ -1,701 +0,0 @@ -# ApiEndpoints -(*apiEndpoints*) - -## Overview - -REST APIs for managing ApiEndpoint entities - -### Available Operations - -* [deleteApiEndpoint](#deleteapiendpoint) - Delete an ApiEndpoint. -* [findApiEndpoint](#findapiendpoint) - Find an ApiEndpoint via its displayName. -* [generateOpenApiSpecForApiEndpoint](#generateopenapispecforapiendpoint) - Generate an OpenAPI specification for a particular ApiEndpoint. -* [generatePostmanCollectionForApiEndpoint](#generatepostmancollectionforapiendpoint) - Generate a Postman collection for a particular ApiEndpoint. -* [getAllApiEndpoints](#getallapiendpoints) - Get all Api endpoints for a particular apiID. -* [getAllForVersionApiEndpoints](#getallforversionapiendpoints) - Get all ApiEndpoints for a particular apiID and versionID. -* [getApiEndpoint](#getapiendpoint) - Get an ApiEndpoint. -* [upsertApiEndpoint](#upsertapiendpoint) - Upsert an ApiEndpoint. - -## deleteApiEndpoint - -Delete an ApiEndpoint. This will also delete all associated Request Logs (if using a Postgres datastore). - -### Example Usage - -```typescript -import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; - -const speakeasy = new Speakeasy({ - security: { - apiKey: "", - }, -}); - -async function run() { - const result = await speakeasy.apiEndpoints.deleteApiEndpoint({ - apiID: "", - versionID: "", - apiEndpointID: "", - }); - - // Handle the result - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; -import { apiEndpointsDeleteApiEndpoint } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/apiEndpointsDeleteApiEndpoint.js"; - -// Use `SpeakeasyCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const speakeasy = new SpeakeasyCore({ - security: { - apiKey: "", - }, -}); - -async function run() { - const res = await apiEndpointsDeleteApiEndpoint(speakeasy, { - apiID: "", - versionID: "", - apiEndpointID: "", - }); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result); -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.DeleteApiEndpointRequest](../../sdk/models/operations/deleteapiendpointrequest.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\<[shared.ErrorT](../../sdk/models/shared/errort.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## findApiEndpoint - -Find an ApiEndpoint via its displayName (set by operationId from a registered OpenAPI schema). -This is useful for finding the ID of an ApiEndpoint to use in the /v1/apis/{apiID}/version/{versionID}/api_endpoints/{apiEndpointID} endpoints. - -### Example Usage - -```typescript -import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; - -const speakeasy = new Speakeasy({ - security: { - apiKey: "", - }, -}); - -async function run() { - const result = await speakeasy.apiEndpoints.findApiEndpoint({ - apiID: "", - versionID: "", - displayName: "Don_Kihn39", - }); - - // Handle the result - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; -import { apiEndpointsFindApiEndpoint } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/apiEndpointsFindApiEndpoint.js"; - -// Use `SpeakeasyCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const speakeasy = new SpeakeasyCore({ - security: { - apiKey: "", - }, -}); - -async function run() { - const res = await apiEndpointsFindApiEndpoint(speakeasy, { - apiID: "", - versionID: "", - displayName: "Don_Kihn39", - }); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result); -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.FindApiEndpointRequest](../../sdk/models/operations/findapiendpointrequest.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.FindApiEndpointResponse](../../sdk/models/operations/findapiendpointresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## generateOpenApiSpecForApiEndpoint - -This endpoint will generate a new operation in any registered OpenAPI document if the operation does not already exist in the document. -Returns the original document and the newly generated document allowing a diff to be performed to see what has changed. - -### Example Usage - -```typescript -import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; - -const speakeasy = new Speakeasy({ - security: { - apiKey: "", - }, -}); - -async function run() { - const result = await speakeasy.apiEndpoints.generateOpenApiSpecForApiEndpoint({ - apiID: "", - versionID: "", - apiEndpointID: "", - }); - - // Handle the result - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; -import { apiEndpointsGenerateOpenApiSpecForApiEndpoint } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/apiEndpointsGenerateOpenApiSpecForApiEndpoint.js"; - -// Use `SpeakeasyCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const speakeasy = new SpeakeasyCore({ - security: { - apiKey: "", - }, -}); - -async function run() { - const res = await apiEndpointsGenerateOpenApiSpecForApiEndpoint(speakeasy, { - apiID: "", - versionID: "", - apiEndpointID: "", - }); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result); -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GenerateOpenApiSpecForApiEndpointRequest](../../sdk/models/operations/generateopenapispecforapiendpointrequest.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.GenerateOpenApiSpecForApiEndpointResponse](../../sdk/models/operations/generateopenapispecforapiendpointresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## generatePostmanCollectionForApiEndpoint - -Generates a postman collection that allows the endpoint to be called from postman variables produced for any path/query/header parameters included in the OpenAPI document. - -### Example Usage - -```typescript -import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; - -const speakeasy = new Speakeasy({ - security: { - apiKey: "", - }, -}); - -async function run() { - const result = await speakeasy.apiEndpoints.generatePostmanCollectionForApiEndpoint({ - apiID: "", - versionID: "", - apiEndpointID: "", - }); - - // Handle the result - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; -import { apiEndpointsGeneratePostmanCollectionForApiEndpoint } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/apiEndpointsGeneratePostmanCollectionForApiEndpoint.js"; - -// Use `SpeakeasyCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const speakeasy = new SpeakeasyCore({ - security: { - apiKey: "", - }, -}); - -async function run() { - const res = await apiEndpointsGeneratePostmanCollectionForApiEndpoint(speakeasy, { - apiID: "", - versionID: "", - apiEndpointID: "", - }); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result); -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GeneratePostmanCollectionForApiEndpointRequest](../../sdk/models/operations/generatepostmancollectionforapiendpointrequest.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.GeneratePostmanCollectionForApiEndpointResponse](../../sdk/models/operations/generatepostmancollectionforapiendpointresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## getAllApiEndpoints - -Get all Api endpoints for a particular apiID. - -### Example Usage - -```typescript -import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; - -const speakeasy = new Speakeasy({ - security: { - apiKey: "", - }, -}); - -async function run() { - const result = await speakeasy.apiEndpoints.getAllApiEndpoints({ - apiID: "", - }); - - // Handle the result - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; -import { apiEndpointsGetAllApiEndpoints } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/apiEndpointsGetAllApiEndpoints.js"; - -// Use `SpeakeasyCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const speakeasy = new SpeakeasyCore({ - security: { - apiKey: "", - }, -}); - -async function run() { - const res = await apiEndpointsGetAllApiEndpoints(speakeasy, { - apiID: "", - }); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result); -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetAllApiEndpointsRequest](../../sdk/models/operations/getallapiendpointsrequest.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.GetAllApiEndpointsResponse](../../sdk/models/operations/getallapiendpointsresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## getAllForVersionApiEndpoints - -Get all ApiEndpoints for a particular apiID and versionID. - -### Example Usage - -```typescript -import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; - -const speakeasy = new Speakeasy({ - security: { - apiKey: "", - }, -}); - -async function run() { - const result = await speakeasy.apiEndpoints.getAllForVersionApiEndpoints({ - apiID: "", - versionID: "", - }); - - // Handle the result - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; -import { apiEndpointsGetAllForVersionApiEndpoints } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/apiEndpointsGetAllForVersionApiEndpoints.js"; - -// Use `SpeakeasyCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const speakeasy = new SpeakeasyCore({ - security: { - apiKey: "", - }, -}); - -async function run() { - const res = await apiEndpointsGetAllForVersionApiEndpoints(speakeasy, { - apiID: "", - versionID: "", - }); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result); -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetAllForVersionApiEndpointsRequest](../../sdk/models/operations/getallforversionapiendpointsrequest.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.GetAllForVersionApiEndpointsResponse](../../sdk/models/operations/getallforversionapiendpointsresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## getApiEndpoint - -Get an ApiEndpoint. - -### Example Usage - -```typescript -import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; - -const speakeasy = new Speakeasy({ - security: { - apiKey: "", - }, -}); - -async function run() { - const result = await speakeasy.apiEndpoints.getApiEndpoint({ - apiID: "", - versionID: "", - apiEndpointID: "", - }); - - // Handle the result - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; -import { apiEndpointsGetApiEndpoint } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/apiEndpointsGetApiEndpoint.js"; - -// Use `SpeakeasyCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const speakeasy = new SpeakeasyCore({ - security: { - apiKey: "", - }, -}); - -async function run() { - const res = await apiEndpointsGetApiEndpoint(speakeasy, { - apiID: "", - versionID: "", - apiEndpointID: "", - }); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result); -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetApiEndpointRequest](../../sdk/models/operations/getapiendpointrequest.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.GetApiEndpointResponse](../../sdk/models/operations/getapiendpointresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## upsertApiEndpoint - -Upsert an ApiEndpoint. If the ApiEndpoint does not exist it will be created, otherwise it will be updated. - -### Example Usage - -```typescript -import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; - -const speakeasy = new Speakeasy({ - security: { - apiKey: "", - }, -}); - -async function run() { - const result = await speakeasy.apiEndpoints.upsertApiEndpoint({ - apiID: "", - versionID: "", - apiEndpointID: "", - apiEndpoint: { - apiEndpointId: "", - description: "commandeer equate pish psst hoot ugh frankly supposing", - displayName: "Eliseo.Little15", - method: "", - path: "/etc/defaults", - versionId: "", - }, - }); - - // Handle the result - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; -import { apiEndpointsUpsertApiEndpoint } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/apiEndpointsUpsertApiEndpoint.js"; - -// Use `SpeakeasyCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const speakeasy = new SpeakeasyCore({ - security: { - apiKey: "", - }, -}); - -async function run() { - const res = await apiEndpointsUpsertApiEndpoint(speakeasy, { - apiID: "", - versionID: "", - apiEndpointID: "", - apiEndpoint: { - apiEndpointId: "", - description: "commandeer equate pish psst hoot ugh frankly supposing", - displayName: "Eliseo.Little15", - method: "", - path: "/etc/defaults", - versionId: "", - }, - }); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result); -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.UpsertApiEndpointRequest](../../sdk/models/operations/upsertapiendpointrequest.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.UpsertApiEndpointResponse](../../sdk/models/operations/upsertapiendpointresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/apis/README.md b/docs/sdks/apis/README.md deleted file mode 100644 index 74b19662..00000000 --- a/docs/sdks/apis/README.md +++ /dev/null @@ -1,511 +0,0 @@ -# Apis -(*apis*) - -## Overview - -REST APIs for managing Api entities - -### Available Operations - -* [deleteApi](#deleteapi) - Delete an Api. -* [generateOpenApiSpec](#generateopenapispec) - Generate an OpenAPI specification for a particular Api. -* [generatePostmanCollection](#generatepostmancollection) - Generate a Postman collection for a particular Api. -* [getAllApiVersions](#getallapiversions) - Get all Api versions for a particular ApiEndpoint. -* [getApis](#getapis) - Get a list of Apis for a given workspace -* [upsertApi](#upsertapi) - Upsert an Api - -## deleteApi - -Delete a particular version of an Api. The will also delete all associated ApiEndpoints, Metadata, Schemas & Request Logs (if using a Postgres datastore). - -### Example Usage - -```typescript -import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; - -const speakeasy = new Speakeasy({ - security: { - apiKey: "", - }, -}); - -async function run() { - const result = await speakeasy.apis.deleteApi({ - apiID: "", - versionID: "", - }); - - // Handle the result - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; -import { apisDeleteApi } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/apisDeleteApi.js"; - -// Use `SpeakeasyCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const speakeasy = new SpeakeasyCore({ - security: { - apiKey: "", - }, -}); - -async function run() { - const res = await apisDeleteApi(speakeasy, { - apiID: "", - versionID: "", - }); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result); -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.DeleteApiRequest](../../sdk/models/operations/deleteapirequest.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\<[shared.ErrorT](../../sdk/models/shared/errort.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## generateOpenApiSpec - -This endpoint will generate any missing operations in any registered OpenAPI document if the operation does not already exist in the document. -Returns the original document and the newly generated document allowing a diff to be performed to see what has changed. - -### Example Usage - -```typescript -import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; - -const speakeasy = new Speakeasy({ - security: { - apiKey: "", - }, -}); - -async function run() { - const result = await speakeasy.apis.generateOpenApiSpec({ - apiID: "", - versionID: "", - }); - - // Handle the result - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; -import { apisGenerateOpenApiSpec } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/apisGenerateOpenApiSpec.js"; - -// Use `SpeakeasyCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const speakeasy = new SpeakeasyCore({ - security: { - apiKey: "", - }, -}); - -async function run() { - const res = await apisGenerateOpenApiSpec(speakeasy, { - apiID: "", - versionID: "", - }); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result); -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GenerateOpenApiSpecRequest](../../sdk/models/operations/generateopenapispecrequest.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.GenerateOpenApiSpecResponse](../../sdk/models/operations/generateopenapispecresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## generatePostmanCollection - -Generates a postman collection containing all endpoints for a particular API. Includes variables produced for any path/query/header parameters included in the OpenAPI document. - -### Example Usage - -```typescript -import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; - -const speakeasy = new Speakeasy({ - security: { - apiKey: "", - }, -}); - -async function run() { - const result = await speakeasy.apis.generatePostmanCollection({ - apiID: "", - versionID: "", - }); - - // Handle the result - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; -import { apisGeneratePostmanCollection } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/apisGeneratePostmanCollection.js"; - -// Use `SpeakeasyCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const speakeasy = new SpeakeasyCore({ - security: { - apiKey: "", - }, -}); - -async function run() { - const res = await apisGeneratePostmanCollection(speakeasy, { - apiID: "", - versionID: "", - }); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result); -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GeneratePostmanCollectionRequest](../../sdk/models/operations/generatepostmancollectionrequest.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.GeneratePostmanCollectionResponse](../../sdk/models/operations/generatepostmancollectionresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## getAllApiVersions - -Get all Api versions for a particular ApiEndpoint. -Supports filtering the versions based on metadata attributes. - -### Example Usage - -```typescript -import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; - -const speakeasy = new Speakeasy({ - security: { - apiKey: "", - }, -}); - -async function run() { - const result = await speakeasy.apis.getAllApiVersions({ - apiID: "", - }); - - // Handle the result - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; -import { apisGetAllApiVersions } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/apisGetAllApiVersions.js"; - -// Use `SpeakeasyCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const speakeasy = new SpeakeasyCore({ - security: { - apiKey: "", - }, -}); - -async function run() { - const res = await apisGetAllApiVersions(speakeasy, { - apiID: "", - }); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result); -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetAllApiVersionsRequest](../../sdk/models/operations/getallapiversionsrequest.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.GetAllApiVersionsResponse](../../sdk/models/operations/getallapiversionsresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## getApis - -Get a list of all Apis and their versions for a given workspace. -Supports filtering the APIs based on metadata attributes. - -### Example Usage - -```typescript -import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; - -const speakeasy = new Speakeasy({ - security: { - apiKey: "", - }, -}); - -async function run() { - const result = await speakeasy.apis.getApis({}); - - // Handle the result - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; -import { apisGetApis } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/apisGetApis.js"; - -// Use `SpeakeasyCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const speakeasy = new SpeakeasyCore({ - security: { - apiKey: "", - }, -}); - -async function run() { - const res = await apisGetApis(speakeasy, {}); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result); -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetApisRequest](../../sdk/models/operations/getapisrequest.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.GetApisResponse](../../sdk/models/operations/getapisresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## upsertApi - -Upsert an Api. If the Api does not exist, it will be created. -If the Api exists, it will be updated. - -### Example Usage - -```typescript -import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; - -const speakeasy = new Speakeasy({ - security: { - apiKey: "", - }, -}); - -async function run() { - const result = await speakeasy.apis.upsertApi({ - apiID: "", - api: { - apiId: "", - description: "consequently brr happily yowza however gosh investigate joyfully direct", - versionId: "", - }, - }); - - // Handle the result - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; -import { apisUpsertApi } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/apisUpsertApi.js"; - -// Use `SpeakeasyCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const speakeasy = new SpeakeasyCore({ - security: { - apiKey: "", - }, -}); - -async function run() { - const res = await apisUpsertApi(speakeasy, { - apiID: "", - api: { - apiId: "", - description: "consequently brr happily yowza however gosh investigate joyfully direct", - versionId: "", - }, - }); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result); -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.UpsertApiRequest](../../sdk/models/operations/upsertapirequest.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.UpsertApiResponse](../../sdk/models/operations/upsertapiresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/artifacts/README.md b/docs/sdks/artifacts/README.md index 8a6a8d06..119b71e4 100644 --- a/docs/sdks/artifacts/README.md +++ b/docs/sdks/artifacts/README.md @@ -7,13 +7,93 @@ REST APIs for working with Registry artifacts ### Available Operations +* [createRemoteSource](#createremotesource) - Configure a new remote source * [getBlob](#getblob) - Get blob for a particular digest * [getManifest](#getmanifest) - Get manifest for a particular reference * [getNamespaces](#getnamespaces) - Each namespace contains many revisions. * [getRevisions](#getrevisions) * [getTags](#gettags) +* [listRemoteSources](#listremotesources) - Get remote sources attached to a particular namespace * [postTags](#posttags) - Add tags to an existing revision * [preflight](#preflight) - Get access token for communicating with OCI distribution endpoints +* [setArchived](#setarchived) - Set whether a namespace is archived +* [setVisibility](#setvisibility) - Set visibility of a namespace with an existing metadata entry + +## createRemoteSource + +Configure a new remote source + +### Example Usage + +```typescript +import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; + +const speakeasy = new Speakeasy({ + security: { + apiKey: "", + }, +}); + +async function run() { + const result = await speakeasy.artifacts.createRemoteSource(); + + // Handle the result + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; +import { artifactsCreateRemoteSource } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/artifactsCreateRemoteSource.js"; + +// Use `SpeakeasyCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const speakeasy = new SpeakeasyCore({ + security: { + apiKey: "", + }, +}); + +async function run() { + const res = await artifactsCreateRemoteSource(speakeasy); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result); +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [shared.RemoteSource](../../sdk/models/shared/remotesource.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\<[shared.ErrorT](../../sdk/models/shared/errort.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | ## getBlob @@ -418,6 +498,86 @@ run(); | --------------- | --------------- | --------------- | | errors.SDKError | 4XX, 5XX | \*/\* | +## listRemoteSources + +Get remote sources attached to a particular namespace + +### Example Usage + +```typescript +import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; + +const speakeasy = new Speakeasy({ + security: { + apiKey: "", + }, +}); + +async function run() { + const result = await speakeasy.artifacts.listRemoteSources({ + namespaceName: "", + }); + + // Handle the result + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; +import { artifactsListRemoteSources } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/artifactsListRemoteSources.js"; + +// Use `SpeakeasyCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const speakeasy = new SpeakeasyCore({ + security: { + apiKey: "", + }, +}); + +async function run() { + const res = await artifactsListRemoteSources(speakeasy, { + namespaceName: "", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result); +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListRemoteSourcesRequest](../../sdk/models/operations/listremotesourcesrequest.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.ListRemoteSourcesResponse](../../sdk/models/operations/listremotesourcesresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | + ## postTags Add tags to an existing revision @@ -570,6 +730,166 @@ run(); ### Errors +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## setArchived + +Set whether a namespace is archived + +### Example Usage + +```typescript +import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; + +const speakeasy = new Speakeasy({ + security: { + apiKey: "", + }, +}); + +async function run() { + const result = await speakeasy.artifacts.setArchived({ + namespaceName: "", + }); + + // Handle the result + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; +import { artifactsSetArchived } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/artifactsSetArchived.js"; + +// Use `SpeakeasyCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const speakeasy = new SpeakeasyCore({ + security: { + apiKey: "", + }, +}); + +async function run() { + const res = await artifactsSetArchived(speakeasy, { + namespaceName: "", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result); +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ArchiveNamespaceRequest](../../sdk/models/operations/archivenamespacerequest.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\<[shared.ErrorT](../../sdk/models/shared/errort.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## setVisibility + +Set visibility of a namespace with an existing metadata entry + +### Example Usage + +```typescript +import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; + +const speakeasy = new Speakeasy({ + security: { + apiKey: "", + }, +}); + +async function run() { + const result = await speakeasy.artifacts.setVisibility({ + namespaceName: "", + }); + + // Handle the result + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; +import { artifactsSetVisibility } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/artifactsSetVisibility.js"; + +// Use `SpeakeasyCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const speakeasy = new SpeakeasyCore({ + security: { + apiKey: "", + }, +}); + +async function run() { + const res = await artifactsSetVisibility(speakeasy, { + namespaceName: "", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result); +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.SetVisibilityRequest](../../sdk/models/operations/setvisibilityrequest.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\<[shared.ErrorT](../../sdk/models/shared/errort.md)\>** + +### Errors + | Error Type | Status Code | Content Type | | --------------- | --------------- | --------------- | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/requests/README.md b/docs/sdks/codesamples/README.md similarity index 62% rename from docs/sdks/requests/README.md rename to docs/sdks/codesamples/README.md index c2f8a1cc..8757c6b0 100644 --- a/docs/sdks/requests/README.md +++ b/docs/sdks/codesamples/README.md @@ -1,25 +1,26 @@ -# Requests -(*requests*) +# CodeSamples +(*codeSamples*) ## Overview -REST APIs for retrieving request information +REST APIs for retrieving Code Samples ### Available Operations -* [generateRequestPostmanCollection](#generaterequestpostmancollection) - Generate a Postman collection for a particular request. -* [getRequestFromEventLog](#getrequestfromeventlog) - Get information about a particular request. -* [queryEventLog](#queryeventlog) - Query the event log to retrieve a list of requests. +* [generateCodeSamplePreview](#generatecodesamplepreview) - Generate Code Sample previews from a file and configuration parameters. +* [generateCodeSamplePreviewAsync](#generatecodesamplepreviewasync) - Initiate asynchronous Code Sample preview generation from a file and configuration parameters, receiving an async JobID response for polling. +* [get](#get) - Retrieve usage snippets +* [getCodeSamplePreviewAsync](#getcodesamplepreviewasync) - Poll for the result of an asynchronous Code Sample preview generation. -## generateRequestPostmanCollection +## generateCodeSamplePreview -Generates a Postman collection for a particular request. -Allowing it to be replayed with the same inputs that were captured by the SDK. +This endpoint generates Code Sample previews from a file and configuration parameters. ### Example Usage ```typescript import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; +import { openAsBlob } from "node:fs"; const speakeasy = new Speakeasy({ security: { @@ -28,8 +29,9 @@ const speakeasy = new Speakeasy({ }); async function run() { - const result = await speakeasy.requests.generateRequestPostmanCollection({ - requestID: "", + const result = await speakeasy.codeSamples.generateCodeSamplePreview({ + language: "", + schemaFile: await openAsBlob("example.file"), }); // Handle the result @@ -45,7 +47,8 @@ The standalone function version of this method: ```typescript import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; -import { requestsGenerateRequestPostmanCollection } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/requestsGenerateRequestPostmanCollection.js"; +import { codeSamplesGenerateCodeSamplePreview } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/codeSamplesGenerateCodeSamplePreview.js"; +import { openAsBlob } from "node:fs"; // Use `SpeakeasyCore` for best tree-shaking performance. // You can create one instance of it to use across an application. @@ -56,8 +59,9 @@ const speakeasy = new SpeakeasyCore({ }); async function run() { - const res = await requestsGenerateRequestPostmanCollection(speakeasy, { - requestID: "", + const res = await codeSamplesGenerateCodeSamplePreview(speakeasy, { + language: "", + schemaFile: await openAsBlob("example.file"), }); if (!res.ok) { @@ -77,14 +81,14 @@ run(); | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GenerateRequestPostmanCollectionRequest](../../sdk/models/operations/generaterequestpostmancollectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `request` | [shared.CodeSampleSchemaInput](../../sdk/models/shared/codesampleschemainput.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.GenerateRequestPostmanCollectionResponse](../../sdk/models/operations/generaterequestpostmancollectionresponse.md)\>** +**Promise\<[operations.GenerateCodeSamplePreviewResponse](../../sdk/models/operations/generatecodesamplepreviewresponse.md)\>** ### Errors @@ -92,14 +96,15 @@ run(); | --------------- | --------------- | --------------- | | errors.SDKError | 4XX, 5XX | \*/\* | -## getRequestFromEventLog +## generateCodeSamplePreviewAsync -Get information about a particular request. +This endpoint generates Code Sample previews from a file and configuration parameters, receiving an async JobID response for polling. ### Example Usage ```typescript import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; +import { openAsBlob } from "node:fs"; const speakeasy = new Speakeasy({ security: { @@ -108,8 +113,9 @@ const speakeasy = new Speakeasy({ }); async function run() { - const result = await speakeasy.requests.getRequestFromEventLog({ - requestID: "", + const result = await speakeasy.codeSamples.generateCodeSamplePreviewAsync({ + language: "", + schemaFile: await openAsBlob("example.file"), }); // Handle the result @@ -125,7 +131,8 @@ The standalone function version of this method: ```typescript import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; -import { requestsGetRequestFromEventLog } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/requestsGetRequestFromEventLog.js"; +import { codeSamplesGenerateCodeSamplePreviewAsync } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/codeSamplesGenerateCodeSamplePreviewAsync.js"; +import { openAsBlob } from "node:fs"; // Use `SpeakeasyCore` for best tree-shaking performance. // You can create one instance of it to use across an application. @@ -136,8 +143,9 @@ const speakeasy = new SpeakeasyCore({ }); async function run() { - const res = await requestsGetRequestFromEventLog(speakeasy, { - requestID: "", + const res = await codeSamplesGenerateCodeSamplePreviewAsync(speakeasy, { + language: "", + schemaFile: await openAsBlob("example.file"), }); if (!res.ok) { @@ -157,14 +165,14 @@ run(); | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetRequestFromEventLogRequest](../../sdk/models/operations/getrequestfromeventlogrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `request` | [shared.CodeSampleSchemaInput](../../sdk/models/shared/codesampleschemainput.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.GetRequestFromEventLogResponse](../../sdk/models/operations/getrequestfromeventlogresponse.md)\>** +**Promise\<[operations.GenerateCodeSamplePreviewAsyncResponse](../../sdk/models/operations/generatecodesamplepreviewasyncresponse.md)\>** ### Errors @@ -172,10 +180,9 @@ run(); | --------------- | --------------- | --------------- | | errors.SDKError | 4XX, 5XX | \*/\* | -## queryEventLog +## get -Supports retrieving a list of request captured by the SDK for this workspace. -Allows the filtering of requests on a number of criteria such as ApiID, VersionID, Path, Method, etc. +Retrieve usage snippets from an OpenAPI document stored in the registry. Supports filtering by language and operation ID. ### Example Usage @@ -189,7 +196,22 @@ const speakeasy = new Speakeasy({ }); async function run() { - const result = await speakeasy.requests.queryEventLog({}); + const result = await speakeasy.codeSamples.get({ + registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", + operationIds: [ + "getPets", + ], + methodPaths: [ + { + method: "get", + path: "/pets", + }, + ], + languages: [ + "python", + "javascript", + ], + }); // Handle the result console.log(result); @@ -204,7 +226,7 @@ The standalone function version of this method: ```typescript import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; -import { requestsQueryEventLog } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/requestsQueryEventLog.js"; +import { codeSamplesGet } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/codeSamplesGet.js"; // Use `SpeakeasyCore` for best tree-shaking performance. // You can create one instance of it to use across an application. @@ -215,7 +237,102 @@ const speakeasy = new SpeakeasyCore({ }); async function run() { - const res = await requestsQueryEventLog(speakeasy, {}); + const res = await codeSamplesGet(speakeasy, { + registryUrl: "https://spec.speakeasy.com/my-org/my-workspace/my-source", + operationIds: [ + "getPets", + ], + methodPaths: [ + { + method: "get", + path: "/pets", + }, + ], + languages: [ + "python", + "javascript", + ], + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result); +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetCodeSamplesRequest](../../sdk/models/operations/getcodesamplesrequest.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.GetCodeSamplesResponse](../../sdk/models/operations/getcodesamplesresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## getCodeSamplePreviewAsync + +Poll for the result of an asynchronous Code Sample preview generation. + +### Example Usage + +```typescript +import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; + +const speakeasy = new Speakeasy({ + security: { + apiKey: "", + }, +}); + +async function run() { + const result = await speakeasy.codeSamples.getCodeSamplePreviewAsync({ + jobID: "", + }); + + // Handle the result + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; +import { codeSamplesGetCodeSamplePreviewAsync } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/codeSamplesGetCodeSamplePreviewAsync.js"; + +// Use `SpeakeasyCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const speakeasy = new SpeakeasyCore({ + security: { + apiKey: "", + }, +}); + +async function run() { + const res = await codeSamplesGetCodeSamplePreviewAsync(speakeasy, { + jobID: "", + }); if (!res.ok) { throw res.error; @@ -234,14 +351,14 @@ run(); | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.QueryEventLogRequest](../../sdk/models/operations/queryeventlogrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `request` | [operations.GetCodeSamplePreviewAsyncRequest](../../sdk/models/operations/getcodesamplepreviewasyncrequest.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.QueryEventLogResponse](../../sdk/models/operations/queryeventlogresponse.md)\>** +**Promise\<[operations.GetCodeSamplePreviewAsyncResponse](../../sdk/models/operations/getcodesamplepreviewasyncresponse.md)\>** ### Errors diff --git a/docs/sdks/events/README.md b/docs/sdks/events/README.md index f01093e6..1da6d44f 100644 --- a/docs/sdks/events/README.md +++ b/docs/sdks/events/README.md @@ -3,7 +3,7 @@ ## Overview -REST APIs for capturing event data +REST APIs for managing events captured by a speakeasy binary (CLI, GitHub Action etc) ### Available Operations @@ -271,11 +271,11 @@ async function run() { workspaceId: "", requestBody: [ { - createdAt: new Date("2024-03-02T10:07:28.113Z"), + createdAt: new Date("2025-03-02T10:07:28.113Z"), executionId: "", id: "", interactionType: "AUTHENTICATE", - localStartedAt: new Date("2024-08-12T17:54:17.538Z"), + localStartedAt: new Date("2025-08-12T17:54:17.538Z"), speakeasyApiKeyName: "", speakeasyVersion: "", success: true, @@ -312,11 +312,11 @@ async function run() { workspaceId: "", requestBody: [ { - createdAt: new Date("2024-03-02T10:07:28.113Z"), + createdAt: new Date("2025-03-02T10:07:28.113Z"), executionId: "", id: "", interactionType: "AUTHENTICATE", - localStartedAt: new Date("2024-08-12T17:54:17.538Z"), + localStartedAt: new Date("2025-08-12T17:54:17.538Z"), speakeasyApiKeyName: "", speakeasyVersion: "", success: true, diff --git a/docs/sdks/github/README.md b/docs/sdks/github/README.md index a59e3839..d35a2652 100644 --- a/docs/sdks/github/README.md +++ b/docs/sdks/github/README.md @@ -3,6 +3,8 @@ ## Overview +REST APIs for managing the github integration + ### Available Operations * [checkAccess](#checkaccess) @@ -12,6 +14,8 @@ * [configureMintlifyRepo](#configuremintlifyrepo) * [configureTarget](#configuretarget) * [getAction](#getaction) +* [getSetup](#getsetup) +* [linkGithub](#linkgithub) * [storePublishingSecrets](#storepublishingsecrets) * [triggerAction](#triggeraction) @@ -585,6 +589,162 @@ run(); | --------------- | --------------- | --------------- | | errors.SDKError | 4XX, 5XX | \*/\* | +## getSetup + +### Example Usage + +```typescript +import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; + +const speakeasy = new Speakeasy({ + security: { + apiKey: "", + }, +}); + +async function run() { + const result = await speakeasy.github.getSetup({ + org: "", + repo: "", + generateGenLockId: "", + }); + + // Handle the result + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; +import { githubGetSetup } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/githubGetSetup.js"; + +// Use `SpeakeasyCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const speakeasy = new SpeakeasyCore({ + security: { + apiKey: "", + }, +}); + +async function run() { + const res = await githubGetSetup(speakeasy, { + org: "", + repo: "", + generateGenLockId: "", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result); +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetGithubSetupStateRequest](../../sdk/models/operations/getgithubsetupstaterequest.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.GetGithubSetupStateResponse](../../sdk/models/operations/getgithubsetupstateresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## linkGithub + +### Example Usage + +```typescript +import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; + +const speakeasy = new Speakeasy({ + security: { + apiKey: "", + }, +}); + +async function run() { + const result = await speakeasy.github.linkGithub({}); + + // Handle the result + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; +import { githubLinkGithub } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/githubLinkGithub.js"; + +// Use `SpeakeasyCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const speakeasy = new SpeakeasyCore({ + security: { + apiKey: "", + }, +}); + +async function run() { + const res = await githubLinkGithub(speakeasy, {}); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result); +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.LinkGithubAccessRequest](../../sdk/models/operations/linkgithubaccessrequest.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\<[shared.ErrorT](../../sdk/models/shared/errort.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | + ## storePublishingSecrets ### Example Usage diff --git a/docs/sdks/metadata/README.md b/docs/sdks/metadata/README.md deleted file mode 100644 index 1d98749d..00000000 --- a/docs/sdks/metadata/README.md +++ /dev/null @@ -1,270 +0,0 @@ -# Metadata -(*metadata*) - -## Overview - -REST APIs for managing Version Metadata entities - -### Available Operations - -* [deleteVersionMetadata](#deleteversionmetadata) - Delete metadata for a particular apiID and versionID. -* [getVersionMetadata](#getversionmetadata) - Get all metadata for a particular apiID and versionID. -* [insertVersionMetadata](#insertversionmetadata) - Insert metadata for a particular apiID and versionID. - -## deleteVersionMetadata - -Delete metadata for a particular apiID and versionID. - -### Example Usage - -```typescript -import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; - -const speakeasy = new Speakeasy({ - security: { - apiKey: "", - }, -}); - -async function run() { - const result = await speakeasy.metadata.deleteVersionMetadata({ - apiID: "", - versionID: "", - metaKey: "", - metaValue: "", - }); - - // Handle the result - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; -import { metadataDeleteVersionMetadata } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/metadataDeleteVersionMetadata.js"; - -// Use `SpeakeasyCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const speakeasy = new SpeakeasyCore({ - security: { - apiKey: "", - }, -}); - -async function run() { - const res = await metadataDeleteVersionMetadata(speakeasy, { - apiID: "", - versionID: "", - metaKey: "", - metaValue: "", - }); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result); -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.DeleteVersionMetadataRequest](../../sdk/models/operations/deleteversionmetadatarequest.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\<[shared.ErrorT](../../sdk/models/shared/errort.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## getVersionMetadata - -Get all metadata for a particular apiID and versionID. - -### Example Usage - -```typescript -import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; - -const speakeasy = new Speakeasy({ - security: { - apiKey: "", - }, -}); - -async function run() { - const result = await speakeasy.metadata.getVersionMetadata({ - apiID: "", - versionID: "", - }); - - // Handle the result - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; -import { metadataGetVersionMetadata } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/metadataGetVersionMetadata.js"; - -// Use `SpeakeasyCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const speakeasy = new SpeakeasyCore({ - security: { - apiKey: "", - }, -}); - -async function run() { - const res = await metadataGetVersionMetadata(speakeasy, { - apiID: "", - versionID: "", - }); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result); -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetVersionMetadataRequest](../../sdk/models/operations/getversionmetadatarequest.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.GetVersionMetadataResponse](../../sdk/models/operations/getversionmetadataresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## insertVersionMetadata - -Insert metadata for a particular apiID and versionID. - -### Example Usage - -```typescript -import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; - -const speakeasy = new Speakeasy({ - security: { - apiKey: "", - }, -}); - -async function run() { - const result = await speakeasy.metadata.insertVersionMetadata({ - apiID: "", - versionID: "", - versionMetadata: { - metaKey: "", - metaValue: "", - }, - }); - - // Handle the result - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; -import { metadataInsertVersionMetadata } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/metadataInsertVersionMetadata.js"; - -// Use `SpeakeasyCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const speakeasy = new SpeakeasyCore({ - security: { - apiKey: "", - }, -}); - -async function run() { - const res = await metadataInsertVersionMetadata(speakeasy, { - apiID: "", - versionID: "", - versionMetadata: { - metaKey: "", - metaValue: "", - }, - }); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result); -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.InsertVersionMetadataRequest](../../sdk/models/operations/insertversionmetadatarequest.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.InsertVersionMetadataResponse](../../sdk/models/operations/insertversionmetadataresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/organizations/README.md b/docs/sdks/organizations/README.md index 6e182e31..66fc4a50 100644 --- a/docs/sdks/organizations/README.md +++ b/docs/sdks/organizations/README.md @@ -3,12 +3,17 @@ ## Overview +REST APIs for managing Organizations (speakeasy L1 Tenancy construct) + ### Available Operations * [create](#create) - Create an organization +* [createBillingAddOns](#createbillingaddons) - Create billing add ons * [createFreeTrial](#createfreetrial) - Create a free trial for an organization +* [deleteBillingAddOn](#deletebillingaddon) - Delete billing add ons * [get](#get) - Get organization * [getAll](#getall) - Get organizations for a user +* [getBillingAddOns](#getbillingaddons) - Get billing add ons * [getUsage](#getusage) - Get billing usage summary for a particular organization ## create @@ -29,12 +34,13 @@ const speakeasy = new Speakeasy({ async function run() { const result = await speakeasy.organizations.create({ accountType: "scale-up", - createdAt: new Date("2023-12-01T17:06:07.804Z"), + createdAt: new Date("2024-11-30T17:06:07.804Z"), id: "", name: "", slug: "", + ssoActivated: true, telemetryDisabled: true, - updatedAt: new Date("2022-05-28T06:20:22.766Z"), + updatedAt: new Date("2023-03-17T15:39:20.911Z"), }); // Handle the result @@ -63,12 +69,13 @@ const speakeasy = new SpeakeasyCore({ async function run() { const res = await organizationsCreate(speakeasy, { accountType: "scale-up", - createdAt: new Date("2023-12-01T17:06:07.804Z"), + createdAt: new Date("2024-11-30T17:06:07.804Z"), id: "", name: "", slug: "", + ssoActivated: true, telemetryDisabled: true, - updatedAt: new Date("2022-05-28T06:20:22.766Z"), + updatedAt: new Date("2023-03-17T15:39:20.911Z"), }); if (!res.ok) { @@ -103,6 +110,94 @@ run(); | --------------- | --------------- | --------------- | | errors.SDKError | 4XX, 5XX | \*/\* | +## createBillingAddOns + +Create billing add ons + +### Example Usage + +```typescript +import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; + +const speakeasy = new Speakeasy({ + security: { + apiKey: "", + }, +}); + +async function run() { + const result = await speakeasy.organizations.createBillingAddOns({ + addOns: [ + "sdk_testing", + "sdk_testing", + "webhooks", + ], + }); + + // Handle the result + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; +import { organizationsCreateBillingAddOns } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/organizationsCreateBillingAddOns.js"; + +// Use `SpeakeasyCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const speakeasy = new SpeakeasyCore({ + security: { + apiKey: "", + }, +}); + +async function run() { + const res = await organizationsCreateBillingAddOns(speakeasy, { + addOns: [ + "sdk_testing", + "sdk_testing", + "webhooks", + ], + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result); +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [shared.OrganizationBillingAddOnRequest](../../sdk/models/shared/organizationbillingaddonrequest.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.CreateBillingAddOnsResponse](../../sdk/models/operations/createbillingaddonsresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | + ## createFreeTrial Creates a free trial for an organization @@ -178,6 +273,86 @@ run(); | --------------- | --------------- | --------------- | | errors.SDKError | 4XX, 5XX | \*/\* | +## deleteBillingAddOn + +Delete billing add ons + +### Example Usage + +```typescript +import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; + +const speakeasy = new Speakeasy({ + security: { + apiKey: "", + }, +}); + +async function run() { + const result = await speakeasy.organizations.deleteBillingAddOn({ + addOn: "custom_code_regions", + }); + + // Handle the result + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; +import { organizationsDeleteBillingAddOn } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/organizationsDeleteBillingAddOn.js"; + +// Use `SpeakeasyCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const speakeasy = new SpeakeasyCore({ + security: { + apiKey: "", + }, +}); + +async function run() { + const res = await organizationsDeleteBillingAddOn(speakeasy, { + addOn: "custom_code_regions", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result); +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.DeleteBillingAddOnRequest](../../sdk/models/operations/deletebillingaddonrequest.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\<[shared.ErrorT](../../sdk/models/shared/errort.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | + ## get Get information about a particular organization. @@ -333,6 +508,81 @@ run(); | --------------- | --------------- | --------------- | | errors.SDKError | 4XX, 5XX | \*/\* | +## getBillingAddOns + +Get billing add ons + +### Example Usage + +```typescript +import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; + +const speakeasy = new Speakeasy({ + security: { + apiKey: "", + }, +}); + +async function run() { + const result = await speakeasy.organizations.getBillingAddOns(); + + // Handle the result + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; +import { organizationsGetBillingAddOns } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/organizationsGetBillingAddOns.js"; + +// Use `SpeakeasyCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const speakeasy = new SpeakeasyCore({ + security: { + apiKey: "", + }, +}); + +async function run() { + const res = await organizationsGetBillingAddOns(speakeasy); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result); +} + +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.GetBillingAddOnsResponse](../../sdk/models/operations/getbillingaddonsresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | + ## getUsage Returns a billing usage summary by target languages for a particular organization diff --git a/docs/sdks/reports/README.md b/docs/sdks/reports/README.md index 5a74964b..507529e0 100644 --- a/docs/sdks/reports/README.md +++ b/docs/sdks/reports/README.md @@ -3,7 +3,7 @@ ## Overview -REST APIs for managing reports +REST APIs for managing reports (lint reports, change reports, etc) ### Available Operations diff --git a/docs/sdks/schemas/README.md b/docs/sdks/schemas/README.md deleted file mode 100644 index ec3362ee..00000000 --- a/docs/sdks/schemas/README.md +++ /dev/null @@ -1,695 +0,0 @@ -# Schemas -(*schemas*) - -## Overview - -REST APIs for managing Schema entities - -### Available Operations - -* [deleteSchema](#deleteschema) - Delete a particular schema revision for an Api. -* [downloadSchema](#downloadschema) - Download the latest schema for a particular apiID. -* [downloadSchemaRevision](#downloadschemarevision) - Download a particular schema revision for an Api. -* [getSchema](#getschema) - Get information about the latest schema. -* [getSchemaDiff](#getschemadiff) - Get a diff of two schema revisions for an Api. -* [getSchemaRevision](#getschemarevision) - Get information about a particular schema revision for an Api. -* [getSchemas](#getschemas) - Get information about all schemas associated with a particular apiID. -* [registerSchema](#registerschema) - Register a schema. - -## deleteSchema - -Delete a particular schema revision for an Api. - -### Example Usage - -```typescript -import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; - -const speakeasy = new Speakeasy({ - security: { - apiKey: "", - }, -}); - -async function run() { - const result = await speakeasy.schemas.deleteSchema({ - apiID: "", - versionID: "", - revisionID: "", - }); - - // Handle the result - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; -import { schemasDeleteSchema } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/schemasDeleteSchema.js"; - -// Use `SpeakeasyCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const speakeasy = new SpeakeasyCore({ - security: { - apiKey: "", - }, -}); - -async function run() { - const res = await schemasDeleteSchema(speakeasy, { - apiID: "", - versionID: "", - revisionID: "", - }); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result); -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.DeleteSchemaRequest](../../sdk/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\<[shared.ErrorT](../../sdk/models/shared/errort.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## downloadSchema - -Download the latest schema for a particular apiID. - -### Example Usage - -```typescript -import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; - -const speakeasy = new Speakeasy({ - security: { - apiKey: "", - }, -}); - -async function run() { - const result = await speakeasy.schemas.downloadSchema({ - apiID: "", - versionID: "", - }); - - // Handle the result - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; -import { schemasDownloadSchema } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/schemasDownloadSchema.js"; - -// Use `SpeakeasyCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const speakeasy = new SpeakeasyCore({ - security: { - apiKey: "", - }, -}); - -async function run() { - const res = await schemasDownloadSchema(speakeasy, { - apiID: "", - versionID: "", - }); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result); -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.DownloadSchemaRequest](../../sdk/models/operations/downloadschemarequest.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.DownloadSchemaResponse](../../sdk/models/operations/downloadschemaresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## downloadSchemaRevision - -Download a particular schema revision for an Api. - -### Example Usage - -```typescript -import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; - -const speakeasy = new Speakeasy({ - security: { - apiKey: "", - }, -}); - -async function run() { - const result = await speakeasy.schemas.downloadSchemaRevision({ - apiID: "", - versionID: "", - revisionID: "", - }); - - // Handle the result - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; -import { schemasDownloadSchemaRevision } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/schemasDownloadSchemaRevision.js"; - -// Use `SpeakeasyCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const speakeasy = new SpeakeasyCore({ - security: { - apiKey: "", - }, -}); - -async function run() { - const res = await schemasDownloadSchemaRevision(speakeasy, { - apiID: "", - versionID: "", - revisionID: "", - }); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result); -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.DownloadSchemaRevisionRequest](../../sdk/models/operations/downloadschemarevisionrequest.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.DownloadSchemaRevisionResponse](../../sdk/models/operations/downloadschemarevisionresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## getSchema - -Returns information about the last uploaded schema for a particular API version. -This won't include the schema itself, that can be retrieved via the downloadSchema operation. - -### Example Usage - -```typescript -import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; - -const speakeasy = new Speakeasy({ - security: { - apiKey: "", - }, -}); - -async function run() { - const result = await speakeasy.schemas.getSchema({ - apiID: "", - versionID: "", - }); - - // Handle the result - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; -import { schemasGetSchema } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/schemasGetSchema.js"; - -// Use `SpeakeasyCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const speakeasy = new SpeakeasyCore({ - security: { - apiKey: "", - }, -}); - -async function run() { - const res = await schemasGetSchema(speakeasy, { - apiID: "", - versionID: "", - }); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result); -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetSchemaRequest](../../sdk/models/operations/getschemarequest.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.GetSchemaResponse](../../sdk/models/operations/getschemaresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## getSchemaDiff - -Get a diff of two schema revisions for an Api. - -### Example Usage - -```typescript -import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; - -const speakeasy = new Speakeasy({ - security: { - apiKey: "", - }, -}); - -async function run() { - const result = await speakeasy.schemas.getSchemaDiff({ - apiID: "", - versionID: "", - baseRevisionID: "", - targetRevisionID: "", - }); - - // Handle the result - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; -import { schemasGetSchemaDiff } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/schemasGetSchemaDiff.js"; - -// Use `SpeakeasyCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const speakeasy = new SpeakeasyCore({ - security: { - apiKey: "", - }, -}); - -async function run() { - const res = await schemasGetSchemaDiff(speakeasy, { - apiID: "", - versionID: "", - baseRevisionID: "", - targetRevisionID: "", - }); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result); -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetSchemaDiffRequest](../../sdk/models/operations/getschemadiffrequest.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.GetSchemaDiffResponse](../../sdk/models/operations/getschemadiffresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## getSchemaRevision - -Returns information about the last uploaded schema for a particular schema revision. -This won't include the schema itself, that can be retrieved via the downloadSchema operation. - -### Example Usage - -```typescript -import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; - -const speakeasy = new Speakeasy({ - security: { - apiKey: "", - }, -}); - -async function run() { - const result = await speakeasy.schemas.getSchemaRevision({ - apiID: "", - versionID: "", - revisionID: "", - }); - - // Handle the result - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; -import { schemasGetSchemaRevision } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/schemasGetSchemaRevision.js"; - -// Use `SpeakeasyCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const speakeasy = new SpeakeasyCore({ - security: { - apiKey: "", - }, -}); - -async function run() { - const res = await schemasGetSchemaRevision(speakeasy, { - apiID: "", - versionID: "", - revisionID: "", - }); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result); -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetSchemaRevisionRequest](../../sdk/models/operations/getschemarevisionrequest.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.GetSchemaRevisionResponse](../../sdk/models/operations/getschemarevisionresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## getSchemas - -Returns information the schemas associated with a particular apiID. -This won't include the schemas themselves, they can be retrieved via the downloadSchema operation. - -### Example Usage - -```typescript -import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; - -const speakeasy = new Speakeasy({ - security: { - apiKey: "", - }, -}); - -async function run() { - const result = await speakeasy.schemas.getSchemas({ - apiID: "", - versionID: "", - }); - - // Handle the result - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; -import { schemasGetSchemas } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/schemasGetSchemas.js"; - -// Use `SpeakeasyCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const speakeasy = new SpeakeasyCore({ - security: { - apiKey: "", - }, -}); - -async function run() { - const res = await schemasGetSchemas(speakeasy, { - apiID: "", - versionID: "", - }); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result); -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetSchemasRequest](../../sdk/models/operations/getschemasrequest.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.GetSchemasResponse](../../sdk/models/operations/getschemasresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## registerSchema - -Allows uploading a schema for a particular API version. -This will be used to populate ApiEndpoints and used as a base for any schema generation if present. - -### Example Usage - -```typescript -import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; -import { openAsBlob } from "node:fs"; - -const speakeasy = new Speakeasy({ - security: { - apiKey: "", - }, -}); - -async function run() { - const result = await speakeasy.schemas.registerSchema({ - apiID: "", - versionID: "", - requestBody: { - file: await openAsBlob("example.file"), - }, - }); - - // Handle the result - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; -import { schemasRegisterSchema } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/schemasRegisterSchema.js"; -import { openAsBlob } from "node:fs"; - -// Use `SpeakeasyCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const speakeasy = new SpeakeasyCore({ - security: { - apiKey: "", - }, -}); - -async function run() { - const res = await schemasRegisterSchema(speakeasy, { - apiID: "", - versionID: "", - requestBody: { - file: await openAsBlob("example.file"), - }, - }); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result); -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.RegisterSchemaRequest](../../sdk/models/operations/registerschemarequest.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\<[shared.ErrorT](../../sdk/models/shared/errort.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/schemastore/README.md b/docs/sdks/schemastore/README.md new file mode 100644 index 00000000..e7687939 --- /dev/null +++ b/docs/sdks/schemastore/README.md @@ -0,0 +1,94 @@ +# SchemaStore +(*schemaStore*) + +## Overview + +### Available Operations + +* [createSchemaStoreItem](#createschemastoreitem) - Create a schema in the schema store + +## createSchemaStoreItem + +Create a schema in the schema store + +### Example Usage + +```typescript +import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; + +const speakeasy = new Speakeasy({ + security: { + apiKey: "", + }, +}); + +async function run() { + const result = await speakeasy.schemaStore.createSchemaStoreItem({ + format: "yaml", + packageName: "", + sdkClassname: "", + spec: "", + }); + + // Handle the result + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; +import { schemaStoreCreateSchemaStoreItem } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/schemaStoreCreateSchemaStoreItem.js"; + +// Use `SpeakeasyCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const speakeasy = new SpeakeasyCore({ + security: { + apiKey: "", + }, +}); + +async function run() { + const res = await schemaStoreCreateSchemaStoreItem(speakeasy, { + format: "yaml", + packageName: "", + sdkClassname: "", + spec: "", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result); +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateSchemaStoreItemRequestBody](../../sdk/models/operations/createschemastoreitemrequestbody.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.CreateSchemaStoreItemResponse](../../sdk/models/operations/createschemastoreitemresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/speakeasy/README.md b/docs/sdks/speakeasy/README.md index 2253e088..2c9348bc 100644 --- a/docs/sdks/speakeasy/README.md +++ b/docs/sdks/speakeasy/README.md @@ -2,7 +2,9 @@ ## Overview -Speakeasy API: The Speakeasy API allows teams to manage common operations with their APIs +Speakeasy API: The Subscriptions API manages subscriptions for CLI and registry events The Speakeasy Platform Documentation - \ No newline at end of file + + +### Available Operations diff --git a/docs/sdks/embeds/README.md b/docs/sdks/subscriptions/README.md similarity index 60% rename from docs/sdks/embeds/README.md rename to docs/sdks/subscriptions/README.md index 1be0e622..c77661af 100644 --- a/docs/sdks/embeds/README.md +++ b/docs/sdks/subscriptions/README.md @@ -1,20 +1,18 @@ -# Embeds -(*embeds*) +# Subscriptions +(*subscriptions*) ## Overview -REST APIs for managing embeds +REST APIs for managing subscriptions ### Available Operations -* [getEmbedAccessToken](#getembedaccesstoken) - Get an embed access token for the current workspace. -* [getValidEmbedAccessTokens](#getvalidembedaccesstokens) - Get all valid embed access tokens for the current workspace. -* [revokeEmbedAccessToken](#revokeembedaccesstoken) - Revoke an embed access EmbedToken. +* [activateSubscriptionNamespace](#activatesubscriptionnamespace) - Activate an ignored namespace for a subscription +* [ignoreSubscriptionNamespace](#ignoresubscriptionnamespace) - Ignored a namespace for a subscription -## getEmbedAccessToken +## activateSubscriptionNamespace -Returns an embed access token for the current workspace. This can be used to authenticate access to externally embedded content. -Filters can be applied allowing views to be filtered to things like particular customerIds. +Activate an ignored namespace for a subscription ### Example Usage @@ -28,83 +26,10 @@ const speakeasy = new Speakeasy({ }); async function run() { - const result = await speakeasy.embeds.getEmbedAccessToken({}); - - // Handle the result - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; -import { embedsGetEmbedAccessToken } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/embedsGetEmbedAccessToken.js"; - -// Use `SpeakeasyCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const speakeasy = new SpeakeasyCore({ - security: { - apiKey: "", - }, -}); - -async function run() { - const res = await embedsGetEmbedAccessToken(speakeasy, {}); - - if (!res.ok) { - throw res.error; - } - - const { value: result } = res; - - // Handle the result - console.log(result); -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetEmbedAccessTokenRequest](../../sdk/models/operations/getembedaccesstokenrequest.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.GetEmbedAccessTokenResponse](../../sdk/models/operations/getembedaccesstokenresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------- | --------------- | --------------- | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## getValidEmbedAccessTokens - -Get all valid embed access tokens for the current workspace. - -### Example Usage - -```typescript -import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; - -const speakeasy = new Speakeasy({ - security: { - apiKey: "", - }, -}); - -async function run() { - const result = await speakeasy.embeds.getValidEmbedAccessTokens(); + const result = await speakeasy.subscriptions.activateSubscriptionNamespace({ + subscriptionID: "", + namespaceName: "", + }); // Handle the result console.log(result); @@ -119,7 +44,7 @@ The standalone function version of this method: ```typescript import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; -import { embedsGetValidEmbedAccessTokens } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/embedsGetValidEmbedAccessTokens.js"; +import { subscriptionsActivateSubscriptionNamespace } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/subscriptionsActivateSubscriptionNamespace.js"; // Use `SpeakeasyCore` for best tree-shaking performance. // You can create one instance of it to use across an application. @@ -130,7 +55,10 @@ const speakeasy = new SpeakeasyCore({ }); async function run() { - const res = await embedsGetValidEmbedAccessTokens(speakeasy); + const res = await subscriptionsActivateSubscriptionNamespace(speakeasy, { + subscriptionID: "", + namespaceName: "", + }); if (!res.ok) { throw res.error; @@ -149,13 +77,14 @@ run(); | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ActivateSubscriptionNamespaceRequest](../../sdk/models/operations/activatesubscriptionnamespacerequest.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.GetValidEmbedAccessTokensResponse](../../sdk/models/operations/getvalidembedaccesstokensresponse.md)\>** +**Promise\<[shared.ErrorT](../../sdk/models/shared/errort.md)\>** ### Errors @@ -163,9 +92,9 @@ run(); | --------------- | --------------- | --------------- | | errors.SDKError | 4XX, 5XX | \*/\* | -## revokeEmbedAccessToken +## ignoreSubscriptionNamespace -Revoke an embed access EmbedToken. +Ignored a namespace for a subscription ### Example Usage @@ -179,8 +108,9 @@ const speakeasy = new Speakeasy({ }); async function run() { - const result = await speakeasy.embeds.revokeEmbedAccessToken({ - tokenID: "", + const result = await speakeasy.subscriptions.ignoreSubscriptionNamespace({ + subscriptionID: "", + namespaceName: "", }); // Handle the result @@ -196,7 +126,7 @@ The standalone function version of this method: ```typescript import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; -import { embedsRevokeEmbedAccessToken } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/embedsRevokeEmbedAccessToken.js"; +import { subscriptionsIgnoreSubscriptionNamespace } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/subscriptionsIgnoreSubscriptionNamespace.js"; // Use `SpeakeasyCore` for best tree-shaking performance. // You can create one instance of it to use across an application. @@ -207,8 +137,9 @@ const speakeasy = new SpeakeasyCore({ }); async function run() { - const res = await embedsRevokeEmbedAccessToken(speakeasy, { - tokenID: "", + const res = await subscriptionsIgnoreSubscriptionNamespace(speakeasy, { + subscriptionID: "", + namespaceName: "", }); if (!res.ok) { @@ -228,7 +159,7 @@ run(); | Parameter | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.RevokeEmbedAccessTokenRequest](../../sdk/models/operations/revokeembedaccesstokenrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `request` | [operations.IgnoreSubscriptionNamespaceRequest](../../sdk/models/operations/ignoresubscriptionnamespacerequest.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. | diff --git a/docs/sdks/suggest/README.md b/docs/sdks/suggest/README.md index 20489960..a3ae3136 100644 --- a/docs/sdks/suggest/README.md +++ b/docs/sdks/suggest/README.md @@ -8,6 +8,7 @@ REST APIs for managing LLM OAS suggestions ### Available Operations * [suggest](#suggest) - Generate suggestions for improving an OpenAPI document. +* [suggestItems](#suggestitems) - Generate generic suggestions for a list of items. * [suggestOpenAPI](#suggestopenapi) - (DEPRECATED) Generate suggestions for improving an OpenAPI document. * [suggestOpenAPIRegistry](#suggestopenapiregistry) - Generate suggestions for improving an OpenAPI document stored in the registry. @@ -42,7 +43,7 @@ async function run() { { message: "", path: [ - "/rescue", + ], type: "", }, @@ -111,7 +112,7 @@ async function run() { { message: "", path: [ - "/opt/include", + ], type: "", }, @@ -173,6 +174,92 @@ run(); | --------------- | --------------- | --------------- | | errors.SDKError | 4XX, 5XX | \*/\* | +## suggestItems + +Generate generic suggestions for a list of items. + +### Example Usage + +```typescript +import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; + +const speakeasy = new Speakeasy({ + security: { + apiKey: "", + }, +}); + +async function run() { + const result = await speakeasy.suggest.suggestItems({ + items: [ + + ], + prompt: "", + }); + + // Handle the result + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; +import { suggestSuggestItems } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/suggestSuggestItems.js"; + +// Use `SpeakeasyCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const speakeasy = new SpeakeasyCore({ + security: { + apiKey: "", + }, +}); + +async function run() { + const res = await suggestSuggestItems(speakeasy, { + items: [ + + ], + prompt: "", + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result); +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [shared.SuggestItemsRequestBody](../../sdk/models/shared/suggestitemsrequestbody.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\<[string[]](../../models/.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | + ## suggestOpenAPI Get suggestions from an LLM model for improving an OpenAPI document. diff --git a/docs/sdks/workspaces/README.md b/docs/sdks/workspaces/README.md index 3231a692..b1ff264f 100644 --- a/docs/sdks/workspaces/README.md +++ b/docs/sdks/workspaces/README.md @@ -3,6 +3,8 @@ ## Overview +REST APIs for managing Workspaces (speakeasy tenancy) + ### Available Operations * [create](#create) - Create a workspace @@ -17,6 +19,7 @@ * [getTokens](#gettokens) - Get tokens for a particular workspace * [grantAccess](#grantaccess) - Grant a user access to a particular workspace * [revokeAccess](#revokeaccess) - Revoke a user's access to a particular workspace +* [setFeatureFlags](#setfeatureflags) - Set workspace feature flags * [update](#update) - Update workspace details * [updateSettings](#updatesettings) - Update workspace settings @@ -37,13 +40,12 @@ const speakeasy = new Speakeasy({ async function run() { const result = await speakeasy.workspaces.create({ - createdAt: new Date("2023-06-18T07:14:55.338Z"), + createdAt: new Date("2024-06-17T07:14:55.338Z"), id: "", name: "", organizationId: "", slug: "", - telemetryDisabled: false, - updatedAt: new Date("2023-04-03T12:48:32.253Z"), + updatedAt: new Date("2024-11-30T17:06:07.804Z"), verified: true, }); @@ -72,13 +74,12 @@ const speakeasy = new SpeakeasyCore({ async function run() { const res = await workspacesCreate(speakeasy, { - createdAt: new Date("2023-06-18T07:14:55.338Z"), + createdAt: new Date("2024-06-17T07:14:55.338Z"), id: "", name: "", organizationId: "", slug: "", - telemetryDisabled: false, - updatedAt: new Date("2023-04-03T12:48:32.253Z"), + updatedAt: new Date("2024-11-30T17:06:07.804Z"), verified: true, }); @@ -134,10 +135,11 @@ async function run() { workspaceId: "", workspaceToken: { alg: "", - createdAt: "", + createdAt: new Date("2023-08-16T02:33:00.784Z"), id: "", key: "", name: "", + workspaceId: "", }, }); @@ -169,10 +171,11 @@ async function run() { workspaceId: "", workspaceToken: { alg: "", - createdAt: "", + createdAt: new Date("2023-08-16T02:33:00.784Z"), id: "", key: "", name: "", + workspaceId: "", }, }); @@ -1004,6 +1007,92 @@ run(); | --------------- | --------------- | --------------- | | errors.SDKError | 4XX, 5XX | \*/\* | +## setFeatureFlags + +Set workspace feature flags + +### Example Usage + +```typescript +import { Speakeasy } from "@speakeasy-api/speakeasy-client-sdk-typescript"; + +const speakeasy = new Speakeasy({ + security: { + apiKey: "", + }, +}); + +async function run() { + const result = await speakeasy.workspaces.setFeatureFlags({ + featureFlags: [ + "skip_schema_registry", + "webhooks", + ], + }); + + // Handle the result + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { SpeakeasyCore } from "@speakeasy-api/speakeasy-client-sdk-typescript/core.js"; +import { workspacesSetFeatureFlags } from "@speakeasy-api/speakeasy-client-sdk-typescript/funcs/workspacesSetFeatureFlags.js"; + +// Use `SpeakeasyCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const speakeasy = new SpeakeasyCore({ + security: { + apiKey: "", + }, +}); + +async function run() { + const res = await workspacesSetFeatureFlags(speakeasy, { + featureFlags: [ + "skip_schema_registry", + "webhooks", + ], + }); + + if (!res.ok) { + throw res.error; + } + + const { value: result } = res; + + // Handle the result + console.log(result); +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [shared.WorkspaceFeatureFlagRequest](../../sdk/models/shared/workspacefeatureflagrequest.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.SetWorkspaceFeatureFlagsResponse](../../sdk/models/operations/setworkspacefeatureflagsresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.SDKError | 4XX, 5XX | \*/\* | + ## update Update information about a particular workspace. @@ -1023,14 +1112,13 @@ async function run() { const result = await speakeasy.workspaces.update({ workspaceId: "", workspace: { - createdAt: new Date("2024-07-28T19:04:48.565Z"), + createdAt: new Date("2025-07-28T19:04:48.565Z"), id: "", name: "", organizationId: "", slug: "", - telemetryDisabled: false, - updatedAt: new Date("2023-01-13T16:52:57.274Z"), - verified: false, + updatedAt: new Date("2024-10-16T10:52:42.015Z"), + verified: true, }, }); @@ -1061,14 +1149,13 @@ async function run() { const res = await workspacesUpdate(speakeasy, { workspaceId: "", workspace: { - createdAt: new Date("2024-07-28T19:04:48.565Z"), + createdAt: new Date("2025-07-28T19:04:48.565Z"), id: "", name: "", organizationId: "", slug: "", - telemetryDisabled: false, - updatedAt: new Date("2023-01-13T16:52:57.274Z"), - verified: false, + updatedAt: new Date("2024-10-16T10:52:42.015Z"), + verified: true, }, }); @@ -1123,6 +1210,9 @@ async function run() { const result = await speakeasy.workspaces.updateSettings({ workspaceId: "", workspaceSettings: { + createdAt: new Date("2023-07-05T11:43:28.305Z"), + updatedAt: new Date("2024-05-14T05:39:21.874Z"), + webhookUrl: "https://grown-pharmacopoeia.net", workspaceId: "", }, }); @@ -1154,6 +1244,9 @@ async function run() { const res = await workspacesUpdateSettings(speakeasy, { workspaceId: "", workspaceSettings: { + createdAt: new Date("2023-07-05T11:43:28.305Z"), + updatedAt: new Date("2024-05-14T05:39:21.874Z"), + webhookUrl: "https://grown-pharmacopoeia.net", workspaceId: "", }, }); diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 00000000..3483f71b --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,21 @@ +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", + // 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/gen.yaml b/gen.yaml index 41d041bb..e975ad0e 100644 --- a/gen.yaml +++ b/gen.yaml @@ -5,12 +5,15 @@ generation: optionalPropertyRendering: withExample fixes: nameResolutionDec2023: true + nameResolutionFeb2025: false parameterOrderingFeb2024: true requestResponseComponentNamesFeb2024: true + securityFeb2025: false auth: oAuth2ClientCredentialsEnabled: false + oAuth2PasswordEnabled: false typescript: - version: 4.0.0-rc.2 + version: 4.0.0-rc.3 additionalDependencies: dependencies: {} devDependencies: {} @@ -18,6 +21,10 @@ typescript: additionalPackageJSON: {} author: Speakeasy clientServerStatusCodesAsErrors: false + defaultErrorName: SDKError + enableCustomCodeRegions: false + enableMCPServer: true + enableReactQuery: false enumFormat: union flattenGlobalSecurity: true flatteningOrder: body-first @@ -30,6 +37,7 @@ typescript: shared: sdk/models/shared webhooks: sdk/models/webhooks inputModelSuffix: input + jsonpath: legacy maxMethodParams: 0 methodArguments: require-security-and-request moduleFormat: commonjs diff --git a/jsr.json b/jsr.json index 6562b258..6e0f19fd 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@speakeasy-api/speakeasy-client-sdk-typescript", - "version": "4.0.0-rc.2", + "version": "4.0.0-rc.3", "exports": { ".": "./src/index.ts", "./sdk/models/errors": "./src/sdk/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index e8cee6f4..a78fd2ab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,23 +1,37 @@ { "name": "@speakeasy-api/speakeasy-client-sdk-typescript", - "version": "4.0.0-rc.2", + "version": "4.0.0-rc.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@speakeasy-api/speakeasy-client-sdk-typescript", - "version": "4.0.0-rc.2", + "version": "4.0.0-rc.3", + "bin": { + "mcp": "bin/mcp-server.js" + }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^7.7.1", - "@typescript-eslint/parser": "^7.7.1", - "eslint": "^8.57.0", - "eslint-import-resolver-typescript": "^3.6.1", - "eslint-plugin-import": "^2.29.1", + "@eslint/js": "^9.19.0", + "@modelcontextprotocol/sdk": "^1.5.0", + "@stricli/core": "^1.1.1", + "@types/express": "^4.17.21", + "bun": "^1.2.2", + "bun-types": "^1.2.2", + "eslint": "^9.19.0", + "express": "^4.21.2", + "globals": "^15.14.0", "typescript": "^5.4.5", + "typescript-eslint": "^8.22.0", "zod": "^3.23.4" }, "peerDependencies": { + "@modelcontextprotocol/sdk": "^1.5.0", "zod": ">= 3" + }, + "peerDependenciesMeta": { + "@modelcontextprotocol/sdk": { + "optional": true + } } }, "node_modules/@eslint-community/eslint-utils": { @@ -37,26 +51,88 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.11.0", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.0.tgz", - "integrity": "sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==", + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz", + "integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==", "dev": true, "license": "MIT", "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, + "node_modules/@eslint/config-array": { + "version": "0.20.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.20.0.tgz", + "integrity": "sha512-fxlS1kkIjx8+vy2SjuCB94q3htSNrufYTXubwiBFeaQHbH6Ipi43gFJq2zCMt6PHhImH3Xmr0NksKDvchWlpQQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.6", + "debug": "^4.3.1", + "minimatch": "^3.1.2" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-array/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.2.1.tgz", + "integrity": "sha512-RI17tsD2frtDu/3dmI7QRrD4bedNKPM08ziRYaC5AhkGrzIAJelm9kJU1TznK+apx6V+cqRz8tfpEeG3oIyjxw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/core": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.12.0.tgz", + "integrity": "sha512-cmrR6pytBuSMTaBweKoGMwu3EiHiEC+DoyupPmlZ0HxBJBtIxwe+j/E4XPIKNx+Q74c8lXKPwYawBf5glsTkHg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, "node_modules/@eslint/eslintrc": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", - "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", + "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", "dev": true, "license": "MIT", "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.6.0", - "globals": "^13.19.0", + "espree": "^10.0.1", + "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -64,7 +140,7 @@ "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -81,6 +157,19 @@ "concat-map": "0.0.1" } }, + "node_modules/@eslint/eslintrc/node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@eslint/eslintrc/node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -95,53 +184,88 @@ } }, "node_modules/@eslint/js": { - "version": "8.57.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", - "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "version": "9.24.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.24.0.tgz", + "integrity": "sha512-uIY/y3z0uvOGX8cp1C2fiC4+ZmBhp6yZWkojtHL1YEMnRt1Y63HB9TM17proGEmeG7HeUY+UP36F0aknKYTpYA==", "dev": true, "license": "MIT", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz", + "integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.11.14", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", - "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", - "deprecated": "Use @eslint/config-array instead", + "node_modules/@eslint/plugin-kit": { + "version": "0.2.8", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.8.tgz", + "integrity": "sha512-ZAoA40rNMPwSm+AeHpCq8STiNAwzWLJuP8Xv4CHIc9wv/PSuExjMrmjfYNj682vW0OOiZ1HKxzvjQr9XZIisQA==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@humanwhocodes/object-schema": "^2.0.2", - "debug": "^4.3.1", - "minimatch": "^3.0.5" + "@eslint/core": "^0.13.0", + "levn": "^0.4.1" }, "engines": { - "node": ">=10.10.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "node_modules/@eslint/plugin-kit/node_modules/@eslint/core": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.13.0.tgz", + "integrity": "sha512-yfkgDw1KR66rkT5A8ci4irzDysN7FRpq3ttJolR88OqQikAWqwA8j5VZyas+vjyBNFIJ7MfybJ9plMILI2UrCw==", "dev": true, - "license": "MIT", + "license": "Apache-2.0", "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" } }, - "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "node_modules/@humanfs/core": { + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", + "integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==", "dev": true, - "license": "ISC", + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.6", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", + "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", + "dev": true, + "license": "Apache-2.0", "dependencies": { - "brace-expansion": "^1.1.7" + "@humanfs/core": "^0.19.1", + "@humanwhocodes/retry": "^0.3.0" }, "engines": { - "node": "*" + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", + "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" } }, "node_modules/@humanwhocodes/module-importer": { @@ -158,478 +282,968 @@ "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", - "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", - "deprecated": "Use @eslint/object-schema instead", + "node_modules/@humanwhocodes/retry": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.2.tgz", + "integrity": "sha512-xeO57FpIu4p1Ri3Jq/EXq4ClRm86dVF2z/+kvFnyqVYRavTZmaFaUBbWCOuuTh0o/g7DSsk6kc2vrS4Vl5oPOQ==", "dev": true, - "license": "BSD-3-Clause" + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "node_modules/@modelcontextprotocol/sdk": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.9.0.tgz", + "integrity": "sha512-Jq2EUCQpe0iyO5FGpzVYDNFR6oR53AIrwph9yWl7uSc7IWUMsrmpmSaTGra5hQNunXpM+9oit85p924jWuHzUA==", "dev": true, "license": "MIT", "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" + "content-type": "^1.0.5", + "cors": "^2.8.5", + "cross-spawn": "^7.0.3", + "eventsource": "^3.0.2", + "express": "^5.0.1", + "express-rate-limit": "^7.5.0", + "pkce-challenge": "^5.0.0", + "raw-body": "^3.0.0", + "zod": "^3.23.8", + "zod-to-json-schema": "^3.24.1" }, "engines": { - "node": ">= 8" + "node": ">=18" } }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "node_modules/@modelcontextprotocol/sdk/node_modules/accepts": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", "dev": true, "license": "MIT", + "dependencies": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + }, "engines": { - "node": ">= 8" + "node": ">= 0.6" } }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "node_modules/@modelcontextprotocol/sdk/node_modules/body-parser": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.0.tgz", + "integrity": "sha512-02qvAaxv8tp7fBa/mw1ga98OGm+eCbqzJOKoRt70sLmfEEi+jyBYVTDGfCL/k06/4EMk/z01gCe7HoCH/f2LTg==", "dev": true, "license": "MIT", "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" + "bytes": "^3.1.2", + "content-type": "^1.0.5", + "debug": "^4.4.0", + "http-errors": "^2.0.0", + "iconv-lite": "^0.6.3", + "on-finished": "^2.4.1", + "qs": "^6.14.0", + "raw-body": "^3.0.0", + "type-is": "^2.0.0" }, "engines": { - "node": ">= 8" + "node": ">=18" } }, - "node_modules/@types/json5": { - "version": "0.0.29", - "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/@typescript-eslint/eslint-plugin": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.17.0.tgz", - "integrity": "sha512-pyiDhEuLM3PuANxH7uNYan1AaFs5XE0zw1hq69JBvGvE7gSuEoQl1ydtEe/XQeoC3GQxLXyOVa5kNOATgM638A==", + "node_modules/@modelcontextprotocol/sdk/node_modules/content-disposition": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.0.tgz", + "integrity": "sha512-Au9nRL8VNUut/XSzbQA38+M78dzP4D+eqg3gfJHMIHHYa3bg067xj1KxMUWj+VULbiZMowKngFFbKczUrNJ1mg==", "dev": true, "license": "MIT", "dependencies": { - "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "7.17.0", - "@typescript-eslint/type-utils": "7.17.0", - "@typescript-eslint/utils": "7.17.0", - "@typescript-eslint/visitor-keys": "7.17.0", - "graphemer": "^1.4.0", - "ignore": "^5.3.1", - "natural-compare": "^1.4.0", - "ts-api-utils": "^1.3.0" + "safe-buffer": "5.2.1" }, "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "@typescript-eslint/parser": "^7.0.0", - "eslint": "^8.56.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "node": ">= 0.6" } }, - "node_modules/@typescript-eslint/parser": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.17.0.tgz", - "integrity": "sha512-puiYfGeg5Ydop8eusb/Hy1k7QmOU6X3nvsqCgzrB2K4qMavK//21+PzNE8qeECgNOIoertJPUC1SpegHDI515A==", + "node_modules/@modelcontextprotocol/sdk/node_modules/cookie-signature": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", + "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", "dev": true, - "license": "BSD-2-Clause", - "dependencies": { - "@typescript-eslint/scope-manager": "7.17.0", - "@typescript-eslint/types": "7.17.0", - "@typescript-eslint/typescript-estree": "7.17.0", - "@typescript-eslint/visitor-keys": "7.17.0", - "debug": "^4.3.4" - }, + "license": "MIT", "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.56.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "node": ">=6.6.0" } }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.17.0.tgz", - "integrity": "sha512-0P2jTTqyxWp9HiKLu/Vemr2Rg1Xb5B7uHItdVZ6iAenXmPo4SZ86yOPCJwMqpCyaMiEHTNqizHfsbmCFT1x9SA==", + "node_modules/@modelcontextprotocol/sdk/node_modules/express": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/express/-/express-5.1.0.tgz", + "integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "7.17.0", - "@typescript-eslint/visitor-keys": "7.17.0" + "accepts": "^2.0.0", + "body-parser": "^2.2.0", + "content-disposition": "^1.0.0", + "content-type": "^1.0.5", + "cookie": "^0.7.1", + "cookie-signature": "^1.2.1", + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "finalhandler": "^2.1.0", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "merge-descriptors": "^2.0.0", + "mime-types": "^3.0.0", + "on-finished": "^2.4.1", + "once": "^1.4.0", + "parseurl": "^1.3.3", + "proxy-addr": "^2.0.7", + "qs": "^6.14.0", + "range-parser": "^1.2.1", + "router": "^2.2.0", + "send": "^1.1.0", + "serve-static": "^2.2.0", + "statuses": "^2.0.1", + "type-is": "^2.0.1", + "vary": "^1.1.2" }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": ">= 18" }, "funding": { "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "url": "https://opencollective.com/express" } }, - "node_modules/@typescript-eslint/type-utils": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.17.0.tgz", - "integrity": "sha512-XD3aaBt+orgkM/7Cei0XNEm1vwUxQ958AOLALzPlbPqb8C1G8PZK85tND7Jpe69Wualri81PLU+Zc48GVKIMMA==", + "node_modules/@modelcontextprotocol/sdk/node_modules/finalhandler": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.0.tgz", + "integrity": "sha512-/t88Ty3d5JWQbWYgaOGCCYfXRwV1+be02WqYYlL6h0lEiUAMPM8o8qKGO01YIkOHzka2up08wvgYD0mDiI+q3Q==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "7.17.0", - "@typescript-eslint/utils": "7.17.0", - "debug": "^4.3.4", - "ts-api-utils": "^1.3.0" + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "on-finished": "^2.4.1", + "parseurl": "^1.3.3", + "statuses": "^2.0.1" }, "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.56.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "node": ">= 0.8" } }, - "node_modules/@typescript-eslint/types": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.17.0.tgz", - "integrity": "sha512-a29Ir0EbyKTKHnZWbNsrc/gqfIBqYPwj3F2M+jWE/9bqfEHg0AMtXzkbUkOG6QgEScxh2+Pz9OXe11jHDnHR7A==", + "node_modules/@modelcontextprotocol/sdk/node_modules/fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", + "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", "dev": true, "license": "MIT", "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "node": ">= 0.8" } }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.17.0.tgz", - "integrity": "sha512-72I3TGq93t2GoSBWI093wmKo0n6/b7O4j9o8U+f65TVD0FS6bI2180X5eGEr8MA8PhKMvYe9myZJquUT2JkCZw==", + "node_modules/@modelcontextprotocol/sdk/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", "dev": true, - "license": "BSD-2-Clause", + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "7.17.0", - "@typescript-eslint/visitor-keys": "7.17.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "minimatch": "^9.0.4", - "semver": "^7.6.0", - "ts-api-utils": "^1.3.0" + "safer-buffer": ">= 2.1.2 < 3.0.0" }, "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "node": ">=0.10.0" } }, - "node_modules/@typescript-eslint/utils": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.17.0.tgz", - "integrity": "sha512-r+JFlm5NdB+JXc7aWWZ3fKSm1gn0pkswEwIYsrGPdsT2GjsRATAKXiNtp3vgAAO1xZhX8alIOEQnNMl3kbTgJw==", + "node_modules/@modelcontextprotocol/sdk/node_modules/media-typer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", + "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", "dev": true, "license": "MIT", - "dependencies": { - "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "7.17.0", - "@typescript-eslint/types": "7.17.0", - "@typescript-eslint/typescript-estree": "7.17.0" - }, "engines": { - "node": "^18.18.0 || >=20.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^8.56.0" + "node": ">= 0.8" } }, - "node_modules/@typescript-eslint/visitor-keys": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.17.0.tgz", - "integrity": "sha512-RVGC9UhPOCsfCdI9pU++K4nD7to+jTcMIbXTSOcrLqUEW6gF2pU1UUbYJKc9cvcRSK1UDeMJ7pdMxf4bhMpV/A==", + "node_modules/@modelcontextprotocol/sdk/node_modules/merge-descriptors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", + "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", "dev": true, "license": "MIT", - "dependencies": { - "@typescript-eslint/types": "7.17.0", - "eslint-visitor-keys": "^3.4.3" - }, "engines": { - "node": "^18.18.0 || >=20.0.0" + "node": ">=18" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@ungap/structured-clone": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", - "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "node_modules/@modelcontextprotocol/sdk/node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", "dev": true, - "license": "ISC" + "license": "MIT", + "engines": { + "node": ">= 0.6" + } }, - "node_modules/acorn": { - "version": "8.12.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", - "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", + "node_modules/@modelcontextprotocol/sdk/node_modules/mime-types": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.1.tgz", + "integrity": "sha512-xRc4oEhT6eaBpU1XF7AjpOFD+xQmXNB5OVKwp4tqCuBpHLS/ZbBDrc07mYTDqVMg6PfxUjjNp85O6Cd2Z/5HWA==", "dev": true, "license": "MIT", - "bin": { - "acorn": "bin/acorn" + "dependencies": { + "mime-db": "^1.54.0" }, "engines": { - "node": ">=0.4.0" + "node": ">= 0.6" } }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "node_modules/@modelcontextprotocol/sdk/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", "dev": true, "license": "MIT", - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + "engines": { + "node": ">= 0.6" } }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "node_modules/@modelcontextprotocol/sdk/node_modules/qs": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", + "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", "dev": true, - "license": "MIT", + "license": "BSD-3-Clause", "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" }, "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "node_modules/@modelcontextprotocol/sdk/node_modules/send": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/send/-/send-1.2.0.tgz", + "integrity": "sha512-uaW0WwXKpL9blXE2o0bRhoL2EGXIrZxQ2ZQ4mgcfoBxdFmQold+qWsD2jLrfZ0trjKL6vOw0j//eAwcALFjKSw==", "dev": true, "license": "MIT", + "dependencies": { + "debug": "^4.3.5", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "mime-types": "^3.0.1", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "range-parser": "^1.2.1", + "statuses": "^2.0.1" + }, "engines": { - "node": ">=8" + "node": ">= 18" } }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/@modelcontextprotocol/sdk/node_modules/serve-static": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.0.tgz", + "integrity": "sha512-61g9pCh0Vnh7IutZjtLGGpTA355+OPn2TyDv/6ivP2h/AdAVX9azsoxmg2/M6nZeQZNYBEwIcsne1mJd9oQItQ==", "dev": true, "license": "MIT", "dependencies": { - "color-convert": "^2.0.1" + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.2.0" }, "engines": { - "node": ">=8" + "node": ">= 18" + } + }, + "node_modules/@modelcontextprotocol/sdk/node_modules/type-is": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", + "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==", + "dev": true, + "license": "MIT", + "dependencies": { + "content-type": "^1.0.5", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@oven/bun-darwin-aarch64": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@oven/bun-darwin-aarch64/-/bun-darwin-aarch64-1.2.8.tgz", + "integrity": "sha512-O97RiReqBVzno5qLgoFX/dYI+xO+jSTIw0S+Cp1MRedXMZEqEgi8ql3ExWpteZyvUGBiXdvc0sQSOQwPoEwiPA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@oven/bun-darwin-x64": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@oven/bun-darwin-x64/-/bun-darwin-x64-1.2.8.tgz", + "integrity": "sha512-aofXwEl3ZzQgiOw/ITzAlXIpQiWeslvIVxol5/n/7Dv8Ekfrqhvo+j/uvEvY0KDECUn8gNIHwa839d701u/rhA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@oven/bun-darwin-x64-baseline": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@oven/bun-darwin-x64-baseline/-/bun-darwin-x64-baseline-1.2.8.tgz", + "integrity": "sha512-SqckVEKEALPJ1TLE+w1xlieZW5coRmmm2nxV5sxMs5BqUb6asrhJ+Wp51KePScvb2ctN7A00SGpROxVq2IA5GQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@oven/bun-linux-aarch64": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@oven/bun-linux-aarch64/-/bun-linux-aarch64-1.2.8.tgz", + "integrity": "sha512-BYzMj7H49xwmUBlHwfIXm/ky1D8yZyyVOnyRDNLTT+3+/odw7TTz3/+lZEBPGyet2tZ6oyBeis1xSZ9vYwSzZA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oven/bun-linux-aarch64-musl": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@oven/bun-linux-aarch64-musl/-/bun-linux-aarch64-musl-1.2.8.tgz", + "integrity": "sha512-rl15SGTFCNj1PE/I2VpUc4XvOZXDCPlqgJGTAObH7+731ET6wgclAehp0x7s2qdyDN4awPnOtold+FYvMH/g9Q==", + "cpu": [ + "aarch64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oven/bun-linux-x64": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64/-/bun-linux-x64-1.2.8.tgz", + "integrity": "sha512-AzvrOAUGsKI9U7eYIbJbgtLVq9Jhx8dExt9QY6PtCgBklUlpTBU+9T+HPgXJqtIJYGtn9C9W4EBGjq9fEgy08A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oven/bun-linux-x64-baseline": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-baseline/-/bun-linux-x64-baseline-1.2.8.tgz", + "integrity": "sha512-j0SxtM9XYCE0N7vnUzuYfnP2iFSoTsQ7pF+K0DPUr/+zmBVJ5tcZUU3xRPc4St86zSrMUD3J2tIUTNksxo81sw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oven/bun-linux-x64-musl": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-musl/-/bun-linux-x64-musl-1.2.8.tgz", + "integrity": "sha512-NgjwsqRWRbCycTlLxg2mka3ZW8cnLPwkmg/zWRe9yjMutU7TGPV0Ak8cCf9PvA6Xgmrz+/HSO1ohO6Pii6Tb3w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oven/bun-linux-x64-musl-baseline": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@oven/bun-linux-x64-musl-baseline/-/bun-linux-x64-musl-baseline-1.2.8.tgz", + "integrity": "sha512-JbkQ452sYyK/TZGCvYz5eCmnlIazhPqkuEfZDwr9K2hfaY8JGJKwkC1sLxM3yvfoXzPgDrPFvYGBU75hmrJHTQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oven/bun-windows-x64": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@oven/bun-windows-x64/-/bun-windows-x64-1.2.8.tgz", + "integrity": "sha512-9nQ45l6LCG+v0AUoBQrrSqsznO0Y36EyQ9sJmDYsI4faPmkHd+cQiyNnMFO5vIwjTXbB3Hb65ql7bjNYbP/O5g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@oven/bun-windows-x64-baseline": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@oven/bun-windows-x64-baseline/-/bun-windows-x64-baseline-1.2.8.tgz", + "integrity": "sha512-fVZ1hNhA9Gph76jToSc5lglNO7Y349v4IUwZaBH25ypenyPPrBoxH11D8v/EB95CsUej4KyWieYcxUiTNZUVmg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@stricli/core": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@stricli/core/-/core-1.1.2.tgz", + "integrity": "sha512-/yWSoHUxo9mF8rgUyZkJgdrAoyIiOOhez1jo9vHTUJa8HTZYhioQUXtQU+rhi52m/hnV9Z2VGC2ap3OTH4NvUg==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/@types/body-parser": { + "version": "1.19.5", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", + "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/@types/connect": { + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/estree": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.7.tgz", + "integrity": "sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/express": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", + "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.33", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "node_modules/@types/express-serve-static-core": { + "version": "4.19.6", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.6.tgz", + "integrity": "sha512-N4LZ2xG7DatVqhCZzOGb1Yi5lMbXSZcmdLDe9EzSndPV2HpWYWzRbaerl2n27irrm94EPpprqa8KpskPT085+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, + "node_modules/@types/http-errors": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", + "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/mime": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "22.14.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.14.0.tgz", + "integrity": "sha512-Kmpl+z84ILoG+3T/zQFyAJsU6EPTmOCj8/2+83fSN6djd6I4o7uOuGIH6vq3PrjY5BGitSbFuMN18j3iknubbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@types/qs": { + "version": "6.9.18", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.18.tgz", + "integrity": "sha512-kK7dgTYDyGqS+e2Q4aK9X3D7q234CIZ1Bv0q/7Z5IwRDoADNU81xXJK/YVyLbLTZCoIwUoDoffFeF+p/eIklAA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/range-parser": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/send": { + "version": "0.17.4", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", + "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "node_modules/@types/serve-static": { + "version": "1.15.7", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.7.tgz", + "integrity": "sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/http-errors": "*", + "@types/node": "*", + "@types/send": "*" + } + }, + "node_modules/@types/ws": { + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz", + "integrity": "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.29.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.29.1.tgz", + "integrity": "sha512-DkDUSDwZVCYN71xA4wzySqqcZsHKic53A4BLqmrWFFpOpNSoxX233lwGu/2135ymTCR04PoKiEEEvN1gFYg4Tw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/typescript-estree": "8.29.1", + "@typescript-eslint/utils": "8.29.1", + "debug": "^4.3.4", + "ts-api-utils": "^2.0.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" } }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/types": { + "version": "8.29.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.29.1.tgz", + "integrity": "sha512-VT7T1PuJF1hpYC3AGm2rCgJBjHL3nc+A/bhOp9sGMKfi5v0WufsX/sHCFBfNTx2F+zA6qBc/PD0/kLRLjdt8mQ==", "dev": true, - "license": "Python-2.0" + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } }, - "node_modules/array-buffer-byte-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz", - "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==", + "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": { + "version": "8.29.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.29.1.tgz", + "integrity": "sha512-l1enRoSaUkQxOQnbi0KPUtqeZkSiFlqrx9/3ns2rEDhGKfTa+88RmXqedC1zmVTOWrLc2e6DEJrTA51C9iLH5g==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.5", - "is-array-buffer": "^3.0.4" + "@typescript-eslint/types": "8.29.1", + "@typescript-eslint/visitor-keys": "8.29.1", + "debug": "^4.3.4", + "fast-glob": "^3.3.2", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^2.0.1" }, "engines": { - "node": ">= 0.4" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <5.9.0" } }, - "node_modules/array-includes": { - "version": "3.1.8", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz", - "integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==", + "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/visitor-keys": { + "version": "8.29.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.29.1.tgz", + "integrity": "sha512-RGLh5CRaUEf02viP5c1Vh1cMGffQscyHe7HPAzGpfmfflFg1wUz2rYxd+OZqwpeypYvZ8UxSxuIpF++fmOzEcg==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.2", - "es-object-atoms": "^1.0.0", - "get-intrinsic": "^1.2.4", - "is-string": "^1.0.7" + "@typescript-eslint/types": "8.29.1", + "eslint-visitor-keys": "^4.2.0" }, "engines": { - "node": ">= 0.4" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/array-union": { + "node_modules/@typescript-eslint/type-utils/node_modules/ts-api-utils": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", + "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", "dev": true, "license": "MIT", "engines": { - "node": ">=8" + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" } }, - "node_modules/array.prototype.findlastindex": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", - "integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==", + "node_modules/@typescript-eslint/utils": { + "version": "8.29.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.29.1.tgz", + "integrity": "sha512-QAkFEbytSaB8wnmB+DflhUPz6CLbFWE2SnSCrRMEa+KnXIzDYbpsn++1HGvnfAsUY44doDXmvRkO5shlM/3UfA==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.2", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", - "es-shim-unscopables": "^1.0.2" + "@eslint-community/eslint-utils": "^4.4.0", + "@typescript-eslint/scope-manager": "8.29.1", + "@typescript-eslint/types": "8.29.1", + "@typescript-eslint/typescript-estree": "8.29.1" }, "engines": { - "node": ">= 0.4" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" } }, - "node_modules/array.prototype.flat": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", - "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", + "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/scope-manager": { + "version": "8.29.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.29.1.tgz", + "integrity": "sha512-2nggXGX5F3YrsGN08pw4XpMLO1Rgtnn4AzTegC2MDesv6q3QaTU5yU7IbS1tf1IwCR0Hv/1EFygLn9ms6LIpDA==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "es-shim-unscopables": "^1.0.0" + "@typescript-eslint/types": "8.29.1", + "@typescript-eslint/visitor-keys": "8.29.1" }, "engines": { - "node": ">= 0.4" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/types": { + "version": "8.29.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.29.1.tgz", + "integrity": "sha512-VT7T1PuJF1hpYC3AGm2rCgJBjHL3nc+A/bhOp9sGMKfi5v0WufsX/sHCFBfNTx2F+zA6qBc/PD0/kLRLjdt8mQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/array.prototype.flatmap": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz", - "integrity": "sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==", + "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/typescript-estree": { + "version": "8.29.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.29.1.tgz", + "integrity": "sha512-l1enRoSaUkQxOQnbi0KPUtqeZkSiFlqrx9/3ns2rEDhGKfTa+88RmXqedC1zmVTOWrLc2e6DEJrTA51C9iLH5g==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "es-shim-unscopables": "^1.0.0" + "@typescript-eslint/types": "8.29.1", + "@typescript-eslint/visitor-keys": "8.29.1", + "debug": "^4.3.4", + "fast-glob": "^3.3.2", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^2.0.1" }, "engines": { - "node": ">= 0.4" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <5.9.0" } }, - "node_modules/arraybuffer.prototype.slice": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", - "integrity": "sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==", + "node_modules/@typescript-eslint/utils/node_modules/@typescript-eslint/visitor-keys": { + "version": "8.29.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.29.1.tgz", + "integrity": "sha512-RGLh5CRaUEf02viP5c1Vh1cMGffQscyHe7HPAzGpfmfflFg1wUz2rYxd+OZqwpeypYvZ8UxSxuIpF++fmOzEcg==", "dev": true, "license": "MIT", "dependencies": { - "array-buffer-byte-length": "^1.0.1", - "call-bind": "^1.0.5", - "define-properties": "^1.2.1", - "es-abstract": "^1.22.3", - "es-errors": "^1.2.1", - "get-intrinsic": "^1.2.3", - "is-array-buffer": "^3.0.4", - "is-shared-array-buffer": "^1.0.2" + "@typescript-eslint/types": "8.29.1", + "eslint-visitor-keys": "^4.2.0" }, "engines": { - "node": ">= 0.4" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/available-typed-arrays": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", - "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", + "node_modules/@typescript-eslint/utils/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/ts-api-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", + "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", "dev": true, "license": "MIT", "dependencies": { - "possible-typed-array-names": "^1.0.0" + "mime-types": "~2.1.34", + "negotiator": "0.6.3" }, "engines": { - "node": ">= 0.4" + "node": ">= 0.6" + } + }, + "node_modules/acorn": { + "version": "8.14.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", + "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", + "dev": true, + "license": "MIT" + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -637,6 +1251,64 @@ "dev": true, "license": "MIT" }, + "node_modules/body-parser": { + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", + "dev": true, + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.13.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/body-parser/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/body-parser/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true, + "license": "MIT" + }, + "node_modules/body-parser/node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "dev": true, + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", @@ -660,18 +1332,85 @@ "node": ">=8" } }, - "node_modules/call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "node_modules/bun": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/bun/-/bun-1.2.8.tgz", + "integrity": "sha512-X8r9UuXAruvpE37u/JVfvJI8KRdFf9hUdTLw00DMScnBe7Xerawd/VvmFVT9Y/NrmXDAdDp0Dm6N6bulZYTGvA==", + "cpu": [ + "arm64", + "x64", + "aarch64" + ], + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "os": [ + "darwin", + "linux", + "win32" + ], + "bin": { + "bun": "bin/bun.exe", + "bunx": "bin/bun.exe" + }, + "optionalDependencies": { + "@oven/bun-darwin-aarch64": "1.2.8", + "@oven/bun-darwin-x64": "1.2.8", + "@oven/bun-darwin-x64-baseline": "1.2.8", + "@oven/bun-linux-aarch64": "1.2.8", + "@oven/bun-linux-aarch64-musl": "1.2.8", + "@oven/bun-linux-x64": "1.2.8", + "@oven/bun-linux-x64-baseline": "1.2.8", + "@oven/bun-linux-x64-musl": "1.2.8", + "@oven/bun-linux-x64-musl-baseline": "1.2.8", + "@oven/bun-windows-x64": "1.2.8", + "@oven/bun-windows-x64-baseline": "1.2.8" + } + }, + "node_modules/bun-types": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/bun-types/-/bun-types-1.2.8.tgz", + "integrity": "sha512-D5npfxKIGuYe9dTHLK1hi4XFmbMdKYoLrgyd25rrUyCrnyU4ljmQW7vDdonvibKeyU72mZuixIhQ2J+q6uM0Mg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "@types/ws": "*" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", "dev": true, "license": "MIT", "dependencies": { - "es-define-property": "^1.0.0", "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" }, "engines": { "node": ">= 0.4" @@ -734,83 +1473,83 @@ "dev": true, "license": "MIT" }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", "dev": true, "license": "MIT", "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" + "safe-buffer": "5.2.1" }, "engines": { - "node": ">= 8" + "node": ">= 0.6" } }, - "node_modules/data-view-buffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz", - "integrity": "sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==", + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", "dev": true, "license": "MIT", - "dependencies": { - "call-bind": "^1.0.6", - "es-errors": "^1.3.0", - "is-data-view": "^1.0.1" - }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">= 0.6" } }, - "node_modules/data-view-byte-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/data-view-byte-length/-/data-view-byte-length-1.0.1.tgz", - "integrity": "sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==", + "node_modules/cookie": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz", + "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", - "es-errors": "^1.3.0", - "is-data-view": "^1.0.1" + "object-assign": "^4", + "vary": "^1" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">= 0.10" } }, - "node_modules/data-view-byte-offset": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/data-view-byte-offset/-/data-view-byte-offset-1.0.0.tgz", - "integrity": "sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==", + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.6", - "es-errors": "^1.3.0", - "is-data-view": "^1.0.1" + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">= 8" } }, "node_modules/debug": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", - "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { - "ms": "2.1.2" + "ms": "^2.1.3" }, "engines": { "node": ">=6.0" @@ -821,6 +1560,13 @@ } } }, + "node_modules/debug/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -828,152 +1574,65 @@ "dev": true, "license": "MIT" }, - "node_modules/define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", "dev": true, "license": "MIT", - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">= 0.8" } }, - "node_modules/define-properties": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.1.tgz", - "integrity": "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==", + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", "dev": true, "license": "MIT", - "dependencies": { - "define-data-property": "^1.0.1", - "has-property-descriptors": "^1.0.0", - "object-keys": "^1.1.1" - }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" } }, - "node_modules/dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", "dev": true, "license": "MIT", "dependencies": { - "path-type": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "esutils": "^2.0.2" + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" }, "engines": { - "node": ">=6.0.0" + "node": ">= 0.4" } }, - "node_modules/enhanced-resolve": { - "version": "5.17.1", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", - "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", "dev": true, - "license": "MIT", - "dependencies": { - "graceful-fs": "^4.2.4", - "tapable": "^2.2.0" - }, - "engines": { - "node": ">=10.13.0" - } + "license": "MIT" }, - "node_modules/es-abstract": { - "version": "1.23.3", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", - "integrity": "sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==", + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", "dev": true, "license": "MIT", - "dependencies": { - "array-buffer-byte-length": "^1.0.1", - "arraybuffer.prototype.slice": "^1.0.3", - "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.7", - "data-view-buffer": "^1.0.1", - "data-view-byte-length": "^1.0.1", - "data-view-byte-offset": "^1.0.0", - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", - "es-set-tostringtag": "^2.0.3", - "es-to-primitive": "^1.2.1", - "function.prototype.name": "^1.1.6", - "get-intrinsic": "^1.2.4", - "get-symbol-description": "^1.0.2", - "globalthis": "^1.0.3", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.2", - "has-proto": "^1.0.3", - "has-symbols": "^1.0.3", - "hasown": "^2.0.2", - "internal-slot": "^1.0.7", - "is-array-buffer": "^3.0.4", - "is-callable": "^1.2.7", - "is-data-view": "^1.0.1", - "is-negative-zero": "^2.0.3", - "is-regex": "^1.1.4", - "is-shared-array-buffer": "^1.0.3", - "is-string": "^1.0.7", - "is-typed-array": "^1.1.13", - "is-weakref": "^1.0.2", - "object-inspect": "^1.13.1", - "object-keys": "^1.1.1", - "object.assign": "^4.1.5", - "regexp.prototype.flags": "^1.5.2", - "safe-array-concat": "^1.1.2", - "safe-regex-test": "^1.0.3", - "string.prototype.trim": "^1.2.9", - "string.prototype.trimend": "^1.0.8", - "string.prototype.trimstart": "^1.0.8", - "typed-array-buffer": "^1.0.2", - "typed-array-byte-length": "^1.0.1", - "typed-array-byte-offset": "^1.0.2", - "typed-array-length": "^1.0.6", - "unbox-primitive": "^1.0.2", - "which-typed-array": "^1.1.15" - }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">= 0.8" } }, "node_modules/es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", "dev": true, "license": "MIT", - "dependencies": { - "get-intrinsic": "^1.2.4" - }, "engines": { "node": ">= 0.4" } @@ -989,9 +1648,9 @@ } }, "node_modules/es-object-atoms": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", - "integrity": "sha512-MZ4iQ6JwHOBQjahnjwaC1ZtIBH+2ohjamzAO3oaHcXYup7qxjF2fixyH+Q71voWHeOkI2q/TnJao/KfXYIZWbw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", "dev": true, "license": "MIT", "dependencies": { @@ -1001,48 +1660,12 @@ "node": ">= 0.4" } }, - "node_modules/es-set-tostringtag": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz", - "integrity": "sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "get-intrinsic": "^1.2.4", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.1" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-shim-unscopables": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", - "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "hasown": "^2.0.0" - } - }, - "node_modules/es-to-primitive": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", - "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", "dev": true, - "license": "MIT", - "dependencies": { - "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", - "is-symbol": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } + "license": "MIT" }, "node_modules/escape-string-regexp": { "version": "4.0.0", @@ -1058,230 +1681,70 @@ } }, "node_modules/eslint": { - "version": "8.57.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", - "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", + "version": "9.24.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.24.0.tgz", + "integrity": "sha512-eh/jxIEJyZrvbWRe4XuVclLPDYSYYYgLy5zXGGxD6j8zjSAxFEzI2fL/8xNq6O2yKqVt+eF2YhV+hxjV6UKXwQ==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", - "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.57.0", - "@humanwhocodes/config-array": "^0.11.14", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.20.0", + "@eslint/config-helpers": "^0.2.0", + "@eslint/core": "^0.12.0", + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "9.24.0", + "@eslint/plugin-kit": "^0.2.7", + "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "@ungap/structured-clone": "^1.2.0", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", + "cross-spawn": "^7.0.6", "debug": "^4.3.2", - "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.2.2", - "eslint-visitor-keys": "^3.4.3", - "espree": "^9.6.1", - "esquery": "^1.4.2", + "eslint-scope": "^8.3.0", + "eslint-visitor-keys": "^4.2.0", + "espree": "^10.3.0", + "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", + "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "graphemer": "^1.4.0", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.3", - "strip-ansi": "^6.0.1", - "text-table": "^0.2.0" + "optionator": "^0.9.3" }, "bin": { "eslint": "bin/eslint.js" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-import-resolver-node": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", - "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", - "dev": true, - "license": "MIT", - "dependencies": { - "debug": "^3.2.7", - "is-core-module": "^2.13.0", - "resolve": "^1.22.4" - } - }, - "node_modules/eslint-import-resolver-node/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/eslint-import-resolver-typescript": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.6.1.tgz", - "integrity": "sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==", - "dev": true, - "license": "ISC", - "dependencies": { - "debug": "^4.3.4", - "enhanced-resolve": "^5.12.0", - "eslint-module-utils": "^2.7.4", - "fast-glob": "^3.3.1", - "get-tsconfig": "^4.5.0", - "is-core-module": "^2.11.0", - "is-glob": "^4.0.3" - }, - "engines": { - "node": "^14.18.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://opencollective.com/unts/projects/eslint-import-resolver-ts" + "url": "https://eslint.org/donate" }, "peerDependencies": { - "eslint": "*", - "eslint-plugin-import": "*" - } - }, - "node_modules/eslint-module-utils": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.1.tgz", - "integrity": "sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==", - "dev": true, - "license": "MIT", - "dependencies": { - "debug": "^3.2.7" - }, - "engines": { - "node": ">=4" + "jiti": "*" }, "peerDependenciesMeta": { - "eslint": { + "jiti": { "optional": true } } }, - "node_modules/eslint-module-utils/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/eslint-plugin-import": { - "version": "2.29.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.29.1.tgz", - "integrity": "sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==", - "dev": true, - "license": "MIT", - "dependencies": { - "array-includes": "^3.1.7", - "array.prototype.findlastindex": "^1.2.3", - "array.prototype.flat": "^1.3.2", - "array.prototype.flatmap": "^1.3.2", - "debug": "^3.2.7", - "doctrine": "^2.1.0", - "eslint-import-resolver-node": "^0.3.9", - "eslint-module-utils": "^2.8.0", - "hasown": "^2.0.0", - "is-core-module": "^2.13.1", - "is-glob": "^4.0.3", - "minimatch": "^3.1.2", - "object.fromentries": "^2.0.7", - "object.groupby": "^1.0.1", - "object.values": "^1.1.7", - "semver": "^6.3.1", - "tsconfig-paths": "^3.15.0" - }, - "engines": { - "node": ">=4" - }, - "peerDependencies": { - "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" - } - }, - "node_modules/eslint-plugin-import/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "license": "MIT", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/eslint-plugin-import/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/eslint-plugin-import/node_modules/doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/eslint-plugin-import/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/eslint-plugin-import/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/eslint-scope": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", - "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.3.0.tgz", + "integrity": "sha512-pUNxi75F8MJ/GdeKtVLSbYg4ZI34J6C0C7sbL4YOp2exGwen7ZsuBqKzUhXd0qMQ362yET3z+uPwKeg/0C2XCQ==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -1289,7 +1752,7 @@ "estraverse": "^5.2.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -1319,6 +1782,19 @@ "concat-map": "0.0.1" } }, + "node_modules/eslint/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/eslint/node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -1333,18 +1809,31 @@ } }, "node_modules/espree": { - "version": "9.6.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", - "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", + "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", "dev": true, "license": "BSD-2-Clause", "dependencies": { - "acorn": "^8.9.0", + "acorn": "^8.14.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.4.1" + "eslint-visitor-keys": "^4.2.0" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" @@ -1396,577 +1885,327 @@ "node": ">=0.10.0" } }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, - "license": "MIT" - }, - "node_modules/fast-glob": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", - "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", - "dev": true, - "license": "MIT", - "dependencies": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - }, - "engines": { - "node": ">=8.6.0" - } - }, - "node_modules/fast-glob/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true, - "license": "MIT" - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true, - "license": "MIT" - }, - "node_modules/fastq": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", - "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", - "dev": true, - "license": "ISC", - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "license": "MIT", - "dependencies": { - "flat-cache": "^3.0.4" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dev": true, - "license": "MIT", - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "license": "MIT", - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/flat-cache": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", - "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", "dev": true, "license": "MIT", - "dependencies": { - "flatted": "^3.2.9", - "keyv": "^4.5.3", - "rimraf": "^3.0.2" - }, "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/flatted": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", - "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", - "dev": true, - "license": "ISC" - }, - "node_modules/for-each": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-callable": "^1.1.3" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true, - "license": "ISC" - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">= 0.6" } }, - "node_modules/function.prototype.name": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.6.tgz", - "integrity": "sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==", + "node_modules/eventsource": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-3.0.6.tgz", + "integrity": "sha512-l19WpE2m9hSuyP06+FbuUUf1G+R0SFLrtQfbRb9PRr+oimOfxQhgGCbVaXg5IvZyyTThJsxh6L/srkMiCeBPDA==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "functions-have-names": "^1.2.3" + "eventsource-parser": "^3.0.1" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/functions-have-names": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", - "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=18.0.0" } }, - "node_modules/get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "node_modules/eventsource-parser": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-3.0.1.tgz", + "integrity": "sha512-VARTJ9CYeuQYb0pZEPbzi740OWFgpHe7AYJ2WFZVnUDUQp5Dk2yJUgF36YsZ81cOyxT0QxmXD2EQpapAouzWVA==", "dev": true, "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" - }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=18.0.0" } }, - "node_modules/get-symbol-description": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.2.tgz", - "integrity": "sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==", + "node_modules/express": { + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.21.2.tgz", + "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.5", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4" + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.3", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.7.1", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.3.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.3", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.12", + "proxy-addr": "~2.0.7", + "qs": "6.13.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.19.0", + "serve-static": "1.16.2", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" }, "engines": { - "node": ">= 0.4" + "node": ">= 0.10.0" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "type": "opencollective", + "url": "https://opencollective.com/express" } }, - "node_modules/get-tsconfig": { - "version": "4.7.6", - "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.6.tgz", - "integrity": "sha512-ZAqrLlu18NbDdRaHq+AKXzAmqIUPswPWKUchfytdAjiRFnCe5ojG2bstg6mRiZabkKfCoL/e98pbBELIV/YCeA==", + "node_modules/express-rate-limit": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-7.5.0.tgz", + "integrity": "sha512-eB5zbQh5h+VenMPM3fh+nw1YExi5nMr6HUCR62ELSP11huvxm/Uir1H1QEyTkk5QX6A58pX6NmaTMceKZ0Eodg==", "dev": true, "license": "MIT", - "dependencies": { - "resolve-pkg-maps": "^1.0.0" - }, - "funding": { - "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" - } - }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", - "dev": true, - "license": "ISC", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, "engines": { - "node": "*" + "node": ">= 16" }, "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.3" + "url": "https://github.com/sponsors/express-rate-limit" }, - "engines": { - "node": ">=10.13.0" + "peerDependencies": { + "express": "^4.11 || 5 || ^5.0.0-beta.1" } }, - "node_modules/glob/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "node_modules/express/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "license": "MIT", "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/glob/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "license": "ISC", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" + "ms": "2.0.0" } }, - "node_modules/globals": { - "version": "13.24.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", - "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "node_modules/express/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true, - "license": "MIT", - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } + "license": "MIT" }, - "node_modules/globalthis": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz", - "integrity": "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==", + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true, - "license": "MIT", - "dependencies": { - "define-properties": "^1.2.1", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } + "license": "MIT" }, - "node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, "license": "MIT", "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8.6.0" } }, - "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, - "license": "MIT", + "license": "ISC", "dependencies": { - "get-intrinsic": "^1.1.3" + "is-glob": "^4.0.1" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">= 6" } }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "dev": true, - "license": "ISC" - }, - "node_modules/graphemer": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", - "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true, "license": "MIT" }, - "node_modules/has-bigints": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", - "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } + "license": "MIT" }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" } }, - "node_modules/has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "dev": true, "license": "MIT", "dependencies": { - "es-define-property": "^1.0.0" + "flat-cache": "^4.0.0" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", - "dev": true, - "license": "MIT", "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=16.0.0" } }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "license": "MIT", - "engines": { - "node": ">= 0.4" + "dependencies": { + "to-regex-range": "^5.0.1" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">=8" } }, - "node_modules/has-tostringtag": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", - "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "node_modules/finalhandler": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz", + "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==", "dev": true, "license": "MIT", "dependencies": { - "has-symbols": "^1.0.3" + "debug": "2.6.9", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">= 0.8" } }, - "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "node_modules/finalhandler/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "license": "MIT", "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" + "ms": "2.0.0" } }, - "node_modules/ignore": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", - "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "node_modules/finalhandler/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true, - "license": "MIT", - "engines": { - "node": ">= 4" - } + "license": "MIT" }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "license": "MIT", "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" }, "engines": { - "node": ">=6" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", "dev": true, "license": "MIT", - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", - "dev": true, - "license": "ISC", "dependencies": { - "once": "^1.3.0", - "wrappy": "1" + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" } }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "node_modules/flatted": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.3.tgz", + "integrity": "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg==", "dev": true, "license": "ISC" }, - "node_modules/internal-slot": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", - "integrity": "sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==", + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", "dev": true, "license": "MIT", - "dependencies": { - "es-errors": "^1.3.0", - "hasown": "^2.0.0", - "side-channel": "^1.0.4" - }, "engines": { - "node": ">= 0.4" + "node": ">= 0.6" } }, - "node_modules/is-array-buffer": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.4.tgz", - "integrity": "sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==", + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", "dev": true, "license": "MIT", - "dependencies": { - "call-bind": "^1.0.2", - "get-intrinsic": "^1.2.1" - }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">= 0.6" } }, - "node_modules/is-bigint": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", - "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", "dev": true, "license": "MIT", - "dependencies": { - "has-bigints": "^1.0.1" - }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-boolean-object": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", - "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" }, "engines": { "node": ">= 0.4" @@ -1975,60 +2214,52 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-callable": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", - "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", "dev": true, "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, "engines": { "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-core-module": { - "version": "2.15.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.0.tgz", - "integrity": "sha512-Dd+Lb2/zvk9SKy1TGCt1wFJFo/MWBPMX5x7KcvLajWTGuomczdQX61PvY5yK6SVACwpoexWo81IfFyoKY2QnTA==", + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, - "license": "MIT", + "license": "ISC", "dependencies": { - "hasown": "^2.0.2" + "is-glob": "^4.0.3" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=10.13.0" } }, - "node_modules/is-data-view": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-data-view/-/is-data-view-1.0.1.tgz", - "integrity": "sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==", + "node_modules/globals": { + "version": "15.15.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-15.15.0.tgz", + "integrity": "sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==", "dev": true, "license": "MIT", - "dependencies": { - "is-typed-array": "^1.1.13" - }, "engines": { - "node": ">= 0.4" + "node": ">=18" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-date-object": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", - "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", "dev": true, "license": "MIT", - "dependencies": { - "has-tostringtag": "^1.0.0" - }, "engines": { "node": ">= 0.4" }, @@ -2036,33 +2267,27 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } + "license": "MIT" }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", - "dependencies": { - "is-extglob": "^2.1.1" - }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/is-negative-zero": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", - "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", "dev": true, "license": "MIT", "engines": { @@ -2072,140 +2297,140 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", "dev": true, "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, "engines": { - "node": ">=0.12.0" + "node": ">= 0.4" } }, - "node_modules/is-number-object": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", - "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", "dev": true, "license": "MIT", "dependencies": { - "has-tostringtag": "^1.0.0" + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" }, "engines": { - "node": ">= 0.4" + "node": ">= 0.8" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">=0.10.0" } }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "node_modules/ignore": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", "dev": true, "license": "MIT", "engines": { - "node": ">=8" + "node": ">= 4" } }, - "node_modules/is-regex": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", - "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "node_modules/import-fresh": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" }, "engines": { - "node": ">= 0.4" + "node": ">=6" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-shared-array-buffer": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz", - "integrity": "sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==", + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7" - }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=0.8.19" } }, - "node_modules/is-string": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", - "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", "dev": true, "license": "MIT", - "dependencies": { - "has-tostringtag": "^1.0.0" - }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">= 0.10" } }, - "node_modules/is-symbol": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", - "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, "license": "MIT", - "dependencies": { - "has-symbols": "^1.0.2" - }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=0.10.0" } }, - "node_modules/is-typed-array": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", - "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "license": "MIT", "dependencies": { - "which-typed-array": "^1.1.14" + "is-extglob": "^2.1.1" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=0.10.0" } }, - "node_modules/is-weakref": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", - "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true, "license": "MIT", - "dependencies": { - "call-bind": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">=0.12.0" } }, - "node_modules/isarray": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", - "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==", + "node_modules/is-promise": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", "dev": true, "license": "MIT" }, @@ -2250,19 +2475,6 @@ "dev": true, "license": "MIT" }, - "node_modules/json5": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", - "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", - "dev": true, - "license": "MIT", - "dependencies": { - "minimist": "^1.2.0" - }, - "bin": { - "json5": "lib/cli.js" - } - }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -2310,6 +2522,36 @@ "dev": true, "license": "MIT" }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -2320,6 +2562,16 @@ "node": ">= 8" } }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, "node_modules/micromatch": { "version": "4.0.7", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", @@ -2334,6 +2586,42 @@ "node": ">=8.6" } }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "dev": true, + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, "node_modules/minimatch": { "version": "9.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", @@ -2350,23 +2638,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/minimist": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true, - "license": "MIT" - }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -2374,60 +2645,32 @@ "dev": true, "license": "MIT" }, - "node_modules/object-inspect": { - "version": "1.13.2", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", - "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object-keys": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", "dev": true, "license": "MIT", "engines": { - "node": ">= 0.4" + "node": ">= 0.6" } }, - "node_modules/object.assign": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.5.tgz", - "integrity": "sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==", + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", "dev": true, "license": "MIT", - "dependencies": { - "call-bind": "^1.0.5", - "define-properties": "^1.2.1", - "has-symbols": "^1.0.3", - "object-keys": "^1.1.1" - }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">=0.10.0" } }, - "node_modules/object.fromentries": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", - "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", "dev": true, "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.2", - "es-object-atoms": "^1.0.0" - }, "engines": { "node": ">= 0.4" }, @@ -2435,37 +2678,17 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/object.groupby": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", - "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.values": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.0.tgz", - "integrity": "sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==", + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0" + "ee-first": "1.1.1" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">= 0.8" } }, "node_modules/once": { @@ -2541,24 +2764,24 @@ "node": ">=6" } }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", "dev": true, "license": "MIT", "engines": { - "node": ">=8" + "node": ">= 0.8" } }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, "license": "MIT", "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, "node_modules/path-key": { @@ -2571,23 +2794,13 @@ "node": ">=8" } }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "node_modules/path-to-regexp": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz", + "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==", "dev": true, "license": "MIT" }, - "node_modules/path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", @@ -2601,14 +2814,14 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/possible-typed-array-names": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", - "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", + "node_modules/pkce-challenge": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/pkce-challenge/-/pkce-challenge-5.0.0.tgz", + "integrity": "sha512-ueGLflrrnvwB3xuo/uGob5pd5FN7l0MsLf0Z87o/UQmRtwjvfylfc9MurIxRAWywCYTgrvpXBcqjV4OfCYGCIQ==", "dev": true, "license": "MIT", "engines": { - "node": ">= 0.4" + "node": ">=16.20.0" } }, "node_modules/prelude-ls": { @@ -2621,6 +2834,20 @@ "node": ">= 0.8.0" } }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "dev": true, + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -2631,6 +2858,22 @@ "node": ">=6" } }, + "node_modules/qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -2652,41 +2895,43 @@ ], "license": "MIT" }, - "node_modules/regexp.prototype.flags": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.2.tgz", - "integrity": "sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==", + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.0.tgz", + "integrity": "sha512-RmkhL8CAyCRPXCE28MMH0z2PNWQBNk2Q09ZdxM9IOOXwxwZbN+qbWaatPkdkWIKL2ZVDImrN/pK5HTRz2PcS4g==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.6", - "define-properties": "^1.2.1", - "es-errors": "^1.3.0", - "set-function-name": "^2.0.1" + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.6.3", + "unpipe": "1.0.0" }, "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "node": ">= 0.8" } }, - "node_modules/resolve": { - "version": "1.22.8", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", - "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "node_modules/raw-body/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", "dev": true, "license": "MIT", "dependencies": { - "is-core-module": "^2.13.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" + "safer-buffer": ">= 2.1.2 < 3.0.0" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">=0.10.0" } }, "node_modules/resolve-from": { @@ -2699,16 +2944,6 @@ "node": ">=4" } }, - "node_modules/resolve-pkg-maps": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", - "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" - } - }, "node_modules/reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", @@ -2720,21 +2955,31 @@ "node": ">=0.10.0" } }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "deprecated": "Rimraf versions prior to v4 are no longer supported", + "node_modules/router": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", + "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", "dev": true, - "license": "ISC", + "license": "MIT", "dependencies": { - "glob": "^7.1.3" + "debug": "^4.4.0", + "depd": "^2.0.0", + "is-promise": "^4.0.0", + "parseurl": "^1.3.3", + "path-to-regexp": "^8.0.0" }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "engines": { + "node": ">= 18" + } + }, + "node_modules/router/node_modules/path-to-regexp": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.2.0.tgz", + "integrity": "sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16" } }, "node_modules/run-parallel": { @@ -2761,42 +3006,33 @@ "queue-microtask": "^1.2.2" } }, - "node_modules/safe-array-concat": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.1.2.tgz", - "integrity": "sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==", + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "get-intrinsic": "^1.2.4", - "has-symbols": "^1.0.3", - "isarray": "^2.0.5" - }, - "engines": { - "node": ">=0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" }, - "node_modules/safe-regex-test": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.3.tgz", - "integrity": "sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==", + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.6", - "es-errors": "^1.3.0", - "is-regex": "^1.1.4" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } + "license": "MIT" }, "node_modules/semver": { "version": "7.6.3", @@ -2811,40 +3047,88 @@ "node": ">=10" } }, - "node_modules/set-function-length": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", - "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "node_modules/send": { + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", "dev": true, "license": "MIT", "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.2" + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" }, "engines": { - "node": ">= 0.4" + "node": ">= 0.8.0" } }, - "node_modules/set-function-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/set-function-name/-/set-function-name-2.0.2.tgz", - "integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==", + "node_modules/send/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "license": "MIT", "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "functions-have-names": "^1.2.3", - "has-property-descriptors": "^1.0.2" + "ms": "2.0.0" + } + }, + "node_modules/send/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true, + "license": "MIT" + }, + "node_modules/send/node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/serve-static": { + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.2.tgz", + "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==", + "dev": true, + "license": "MIT", + "dependencies": { + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.19.0" }, "engines": { - "node": ">= 0.4" + "node": ">= 0.8.0" } }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "dev": true, + "license": "ISC" + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -2869,16 +3153,17 @@ } }, "node_modules/side-channel": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", - "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "object-inspect": "^1.13.1" + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -2887,27 +3172,15 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/slash": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - } - }, - "node_modules/string.prototype.trim": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", - "integrity": "sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==", + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.0", - "es-object-atoms": "^1.0.0" + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" }, "engines": { "node": ">= 0.4" @@ -2916,31 +3189,37 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/string.prototype.trimend": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.8.tgz", - "integrity": "sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==", + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0" + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/string.prototype.trimstart": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.8.tgz", - "integrity": "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==", + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0" + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" }, "engines": { "node": ">= 0.4" @@ -2949,27 +3228,14 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "license": "MIT", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", "dev": true, "license": "MIT", "engines": { - "node": ">=4" + "node": ">= 0.8" } }, "node_modules/strip-json-comments": { @@ -2998,206 +3264,266 @@ "node": ">=8" } }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, "license": "MIT", - "engines": { - "node": ">= 0.4" + "dependencies": { + "is-number": "^7.0.0" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">=8.0" } }, - "node_modules/tapable": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", - "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", "dev": true, "license": "MIT", "engines": { - "node": ">=6" + "node": ">=0.6" } }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true, - "license": "MIT" - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, "license": "MIT", "dependencies": { - "is-number": "^7.0.0" + "prelude-ls": "^1.2.1" }, "engines": { - "node": ">=8.0" + "node": ">= 0.8.0" } }, - "node_modules/ts-api-utils": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", - "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", "dev": true, "license": "MIT", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, "engines": { - "node": ">=16" + "node": ">= 0.6" + } + }, + "node_modules/typescript": { + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", + "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" }, - "peerDependencies": { - "typescript": ">=4.2.0" + "engines": { + "node": ">=14.17" } }, - "node_modules/tsconfig-paths": { - "version": "3.15.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", - "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", + "node_modules/typescript-eslint": { + "version": "8.29.1", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.29.1.tgz", + "integrity": "sha512-f8cDkvndhbQMPcysk6CUSGBWV+g1utqdn71P5YKwMumVMOG/5k7cHq0KyG4O52nB0oKS4aN2Tp5+wB4APJGC+w==", "dev": true, "license": "MIT", "dependencies": { - "@types/json5": "^0.0.29", - "json5": "^1.0.2", - "minimist": "^1.2.6", - "strip-bom": "^3.0.0" + "@typescript-eslint/eslint-plugin": "8.29.1", + "@typescript-eslint/parser": "8.29.1", + "@typescript-eslint/utils": "8.29.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" } }, - "node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "node_modules/typescript-eslint/node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.29.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.29.1.tgz", + "integrity": "sha512-ba0rr4Wfvg23vERs3eB+P3lfj2E+2g3lhWcCVukUuhtcdUx5lSIFZlGFEBHKr+3zizDa/TvZTptdNHVZWAkSBg==", "dev": true, "license": "MIT", "dependencies": { - "prelude-ls": "^1.2.1" + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "8.29.1", + "@typescript-eslint/type-utils": "8.29.1", + "@typescript-eslint/utils": "8.29.1", + "@typescript-eslint/visitor-keys": "8.29.1", + "graphemer": "^1.4.0", + "ignore": "^5.3.1", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.0.1" }, "engines": { - "node": ">= 0.8.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" } }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "node_modules/typescript-eslint/node_modules/@typescript-eslint/parser": { + "version": "8.29.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.29.1.tgz", + "integrity": "sha512-zczrHVEqEaTwh12gWBIJWj8nx+ayDcCJs06yoNMY0kwjMWDM6+kppljY+BxWI06d2Ja+h4+WdufDcwMnnMEWmg==", "dev": true, - "license": "(MIT OR CC0-1.0)", + "license": "MIT", + "dependencies": { + "@typescript-eslint/scope-manager": "8.29.1", + "@typescript-eslint/types": "8.29.1", + "@typescript-eslint/typescript-estree": "8.29.1", + "@typescript-eslint/visitor-keys": "8.29.1", + "debug": "^4.3.4" + }, "engines": { - "node": ">=10" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.9.0" } }, - "node_modules/typed-array-buffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz", - "integrity": "sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==", + "node_modules/typescript-eslint/node_modules/@typescript-eslint/scope-manager": { + "version": "8.29.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.29.1.tgz", + "integrity": "sha512-2nggXGX5F3YrsGN08pw4XpMLO1Rgtnn4AzTegC2MDesv6q3QaTU5yU7IbS1tf1IwCR0Hv/1EFygLn9ms6LIpDA==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", - "es-errors": "^1.3.0", - "is-typed-array": "^1.1.13" + "@typescript-eslint/types": "8.29.1", + "@typescript-eslint/visitor-keys": "8.29.1" }, "engines": { - "node": ">= 0.4" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/typed-array-byte-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz", - "integrity": "sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==", + "node_modules/typescript-eslint/node_modules/@typescript-eslint/types": { + "version": "8.29.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.29.1.tgz", + "integrity": "sha512-VT7T1PuJF1hpYC3AGm2rCgJBjHL3nc+A/bhOp9sGMKfi5v0WufsX/sHCFBfNTx2F+zA6qBc/PD0/kLRLjdt8mQ==", "dev": true, "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-proto": "^1.0.3", - "is-typed-array": "^1.1.13" - }, "engines": { - "node": ">= 0.4" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/typed-array-byte-offset": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz", - "integrity": "sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==", + "node_modules/typescript-eslint/node_modules/@typescript-eslint/typescript-estree": { + "version": "8.29.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.29.1.tgz", + "integrity": "sha512-l1enRoSaUkQxOQnbi0KPUtqeZkSiFlqrx9/3ns2rEDhGKfTa+88RmXqedC1zmVTOWrLc2e6DEJrTA51C9iLH5g==", "dev": true, "license": "MIT", "dependencies": { - "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.7", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-proto": "^1.0.3", - "is-typed-array": "^1.1.13" + "@typescript-eslint/types": "8.29.1", + "@typescript-eslint/visitor-keys": "8.29.1", + "debug": "^4.3.4", + "fast-glob": "^3.3.2", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^2.0.1" }, "engines": { - "node": ">= 0.4" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <5.9.0" } }, - "node_modules/typed-array-length": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.6.tgz", - "integrity": "sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==", + "node_modules/typescript-eslint/node_modules/@typescript-eslint/visitor-keys": { + "version": "8.29.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.29.1.tgz", + "integrity": "sha512-RGLh5CRaUEf02viP5c1Vh1cMGffQscyHe7HPAzGpfmfflFg1wUz2rYxd+OZqwpeypYvZ8UxSxuIpF++fmOzEcg==", "dev": true, "license": "MIT", "dependencies": { - "call-bind": "^1.0.7", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-proto": "^1.0.3", - "is-typed-array": "^1.1.13", - "possible-typed-array-names": "^1.0.0" + "@typescript-eslint/types": "8.29.1", + "eslint-visitor-keys": "^4.2.0" }, "engines": { - "node": ">= 0.4" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/typescript": { - "version": "5.5.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", - "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", + "node_modules/typescript-eslint/node_modules/eslint-visitor-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", + "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", "dev": true, "license": "Apache-2.0", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, "engines": { - "node": ">=14.17" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/unbox-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", - "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "node_modules/typescript-eslint/node_modules/ts-api-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz", + "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==", "dev": true, "license": "MIT", - "dependencies": { - "call-bind": "^1.0.2", - "has-bigints": "^1.0.2", - "has-symbols": "^1.0.3", - "which-boxed-primitive": "^1.0.2" + "engines": { + "node": ">=18.12" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" } }, "node_modules/uri-js": { @@ -3210,6 +3536,26 @@ "punycode": "^2.1.0" } }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -3226,43 +3572,6 @@ "node": ">= 8" } }, - "node_modules/which-boxed-primitive": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", - "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-bigint": "^1.0.1", - "is-boolean-object": "^1.1.0", - "is-number-object": "^1.0.4", - "is-string": "^1.0.5", - "is-symbol": "^1.0.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/which-typed-array": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", - "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", - "dev": true, - "license": "MIT", - "dependencies": { - "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.7", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/word-wrap": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", @@ -3294,14 +3603,24 @@ } }, "node_modules/zod": { - "version": "3.23.8", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", - "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", + "version": "3.24.2", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.2.tgz", + "integrity": "sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ==", "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" } + }, + "node_modules/zod-to-json-schema": { + "version": "3.24.5", + "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.24.5.tgz", + "integrity": "sha512-/AuWwMP+YqiPbsJx5D6TfgRTc4kTLjsh5SOcd4bLsfUg2RcEXrFMJl1DGgdHy2aCfsIA/cr/1JM0xcB2GZji8g==", + "dev": true, + "license": "ISC", + "peerDependencies": { + "zod": "^3.24.1" + } } } } diff --git a/package.json b/package.json index 52aa6ddb..3db524a9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,10 @@ { "name": "@speakeasy-api/speakeasy-client-sdk-typescript", - "version": "4.0.0-rc.2", + "version": "4.0.0-rc.3", "author": "Speakeasy", + "bin": { + "mcp": "bin/mcp-server.js" + }, "main": "./index.js", "sideEffects": false, "repository": { @@ -10,20 +13,30 @@ "directory": "." }, "scripts": { - "lint": "eslint --max-warnings=0 src", - "build": "tsc", + "lint": "eslint --cache --max-warnings=0 src", + "build:mcp": "bun src/mcp-server/build.mts", + "build": "npm run build:mcp && tsc", "prepublishOnly": "npm run build" }, "peerDependencies": { + "@modelcontextprotocol/sdk": "^1.5.0", "zod": ">= 3" }, + "peerDependenciesMeta": { + "@modelcontextprotocol/sdk": {"optional":true} + }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^7.7.1", - "@typescript-eslint/parser": "^7.7.1", - "eslint": "^8.57.0", - "eslint-import-resolver-typescript": "^3.6.1", - "eslint-plugin-import": "^2.29.1", + "@eslint/js": "^9.19.0", + "@modelcontextprotocol/sdk": "^1.5.0", + "@stricli/core": "^1.1.1", + "@types/express": "^4.17.21", + "bun": "^1.2.2", + "bun-types": "^1.2.2", + "eslint": "^9.19.0", + "express": "^4.21.2", + "globals": "^15.14.0", "typescript": "^5.4.5", + "typescript-eslint": "^8.22.0", "zod": "^3.23.4" }, "dependencies": { diff --git a/src/funcs/apiEndpointsFindApiEndpoint.ts b/src/funcs/apiEndpointsFindApiEndpoint.ts deleted file mode 100644 index dc2017ec..00000000 --- a/src/funcs/apiEndpointsFindApiEndpoint.ts +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { SpeakeasyCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.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 "../sdk/models/errors/httpclienterrors.js"; -import { SDKError } from "../sdk/models/errors/sdkerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { Result } from "../sdk/types/fp.js"; - -/** - * Find an ApiEndpoint via its displayName. - * - * @remarks - * Find an ApiEndpoint via its displayName (set by operationId from a registered OpenAPI schema). - * This is useful for finding the ID of an ApiEndpoint to use in the /v1/apis/{apiID}/version/{versionID}/api_endpoints/{apiEndpointID} endpoints. - */ -export async function apiEndpointsFindApiEndpoint( - client: SpeakeasyCore, - request: operations.FindApiEndpointRequest, - options?: RequestOptions, -): Promise< - Result< - operations.FindApiEndpointResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - > -> { - const parsed = safeParse( - request, - (value) => operations.FindApiEndpointRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return parsed; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - apiID: encodeSimple("apiID", payload.apiID, { - explode: false, - charEncoding: "percent", - }), - displayName: encodeSimple("displayName", payload.displayName, { - explode: false, - charEncoding: "percent", - }), - versionID: encodeSimple("versionID", payload.versionID, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc( - "/v1/apis/{apiID}/version/{versionID}/api_endpoints/find/{displayName}", - )(pathParams); - - const headers = new Headers({ - Accept: "application/json", - }); - - const securityInput = await extractSecurity(client._options.security); - const context = { - operationID: "findApiEndpoint", - oAuth2Scopes: [], - securitySource: client._options.security, - }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - path: path, - headers: headers, - body: body, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return requestRes; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }); - if (!doResult.ok) { - return doResult; - } - const response = doResult.value; - - const [result] = await M.match< - operations.FindApiEndpointResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - >( - M.json("2XX", operations.FindApiEndpointResponse$inboundSchema), - M.json("4XX", operations.FindApiEndpointResponse$inboundSchema), - )(response); - if (!result.ok) { - return result; - } - - return result; -} diff --git a/src/funcs/apiEndpointsGenerateOpenApiSpecForApiEndpoint.ts b/src/funcs/apiEndpointsGenerateOpenApiSpecForApiEndpoint.ts deleted file mode 100644 index b80fda66..00000000 --- a/src/funcs/apiEndpointsGenerateOpenApiSpecForApiEndpoint.ts +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { SpeakeasyCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.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 "../sdk/models/errors/httpclienterrors.js"; -import { SDKError } from "../sdk/models/errors/sdkerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { Result } from "../sdk/types/fp.js"; - -/** - * Generate an OpenAPI specification for a particular ApiEndpoint. - * - * @remarks - * This endpoint will generate a new operation in any registered OpenAPI document if the operation does not already exist in the document. - * Returns the original document and the newly generated document allowing a diff to be performed to see what has changed. - */ -export async function apiEndpointsGenerateOpenApiSpecForApiEndpoint( - client: SpeakeasyCore, - request: operations.GenerateOpenApiSpecForApiEndpointRequest, - options?: RequestOptions, -): Promise< - Result< - operations.GenerateOpenApiSpecForApiEndpointResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - > -> { - const parsed = safeParse( - request, - (value) => - operations.GenerateOpenApiSpecForApiEndpointRequest$outboundSchema.parse( - value, - ), - "Input validation failed", - ); - if (!parsed.ok) { - return parsed; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - apiEndpointID: encodeSimple("apiEndpointID", payload.apiEndpointID, { - explode: false, - charEncoding: "percent", - }), - apiID: encodeSimple("apiID", payload.apiID, { - explode: false, - charEncoding: "percent", - }), - versionID: encodeSimple("versionID", payload.versionID, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc( - "/v1/apis/{apiID}/version/{versionID}/api_endpoints/{apiEndpointID}/generate/openapi", - )(pathParams); - - const headers = new Headers({ - Accept: "application/json", - }); - - const securityInput = await extractSecurity(client._options.security); - const context = { - operationID: "generateOpenApiSpecForApiEndpoint", - oAuth2Scopes: [], - securitySource: client._options.security, - }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - path: path, - headers: headers, - body: body, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return requestRes; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }); - if (!doResult.ok) { - return doResult; - } - const response = doResult.value; - - const [result] = await M.match< - operations.GenerateOpenApiSpecForApiEndpointResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - >( - M.json( - "2XX", - operations.GenerateOpenApiSpecForApiEndpointResponse$inboundSchema, - ), - M.json( - "4XX", - operations.GenerateOpenApiSpecForApiEndpointResponse$inboundSchema, - ), - )(response); - if (!result.ok) { - return result; - } - - return result; -} diff --git a/src/funcs/apiEndpointsGeneratePostmanCollectionForApiEndpoint.ts b/src/funcs/apiEndpointsGeneratePostmanCollectionForApiEndpoint.ts deleted file mode 100644 index a0f322c7..00000000 --- a/src/funcs/apiEndpointsGeneratePostmanCollectionForApiEndpoint.ts +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { SpeakeasyCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.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 "../sdk/models/errors/httpclienterrors.js"; -import { SDKError } from "../sdk/models/errors/sdkerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { Result } from "../sdk/types/fp.js"; - -export enum GeneratePostmanCollectionForApiEndpointAcceptEnum { - applicationJson = "application/json", - applicationOctetStream = "application/octet-stream", -} - -/** - * Generate a Postman collection for a particular ApiEndpoint. - * - * @remarks - * Generates a postman collection that allows the endpoint to be called from postman variables produced for any path/query/header parameters included in the OpenAPI document. - */ -export async function apiEndpointsGeneratePostmanCollectionForApiEndpoint( - client: SpeakeasyCore, - request: operations.GeneratePostmanCollectionForApiEndpointRequest, - options?: RequestOptions & { - acceptHeaderOverride?: GeneratePostmanCollectionForApiEndpointAcceptEnum; - }, -): Promise< - Result< - operations.GeneratePostmanCollectionForApiEndpointResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - > -> { - const parsed = safeParse( - request, - (value) => - operations.GeneratePostmanCollectionForApiEndpointRequest$outboundSchema - .parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return parsed; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - apiEndpointID: encodeSimple("apiEndpointID", payload.apiEndpointID, { - explode: false, - charEncoding: "percent", - }), - apiID: encodeSimple("apiID", payload.apiID, { - explode: false, - charEncoding: "percent", - }), - versionID: encodeSimple("versionID", payload.versionID, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc( - "/v1/apis/{apiID}/version/{versionID}/api_endpoints/{apiEndpointID}/generate/postman", - )(pathParams); - - const headers = new Headers({ - Accept: options?.acceptHeaderOverride - || "application/json;q=1, application/octet-stream;q=0", - }); - - const securityInput = await extractSecurity(client._options.security); - const context = { - operationID: "generatePostmanCollectionForApiEndpoint", - oAuth2Scopes: [], - securitySource: client._options.security, - }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - path: path, - headers: headers, - body: body, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return requestRes; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }); - if (!doResult.ok) { - return doResult; - } - const response = doResult.value; - - const [result] = await M.match< - operations.GeneratePostmanCollectionForApiEndpointResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - >( - M.stream( - "2XX", - operations.GeneratePostmanCollectionForApiEndpointResponse$inboundSchema, - ), - M.json( - "4XX", - operations.GeneratePostmanCollectionForApiEndpointResponse$inboundSchema, - ), - )(response); - if (!result.ok) { - return result; - } - - return result; -} diff --git a/src/funcs/apiEndpointsGetAllApiEndpoints.ts b/src/funcs/apiEndpointsGetAllApiEndpoints.ts deleted file mode 100644 index a7bc7750..00000000 --- a/src/funcs/apiEndpointsGetAllApiEndpoints.ts +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { SpeakeasyCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.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 "../sdk/models/errors/httpclienterrors.js"; -import { SDKError } from "../sdk/models/errors/sdkerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { Result } from "../sdk/types/fp.js"; - -/** - * Get all Api endpoints for a particular apiID. - */ -export async function apiEndpointsGetAllApiEndpoints( - client: SpeakeasyCore, - request: operations.GetAllApiEndpointsRequest, - options?: RequestOptions, -): Promise< - Result< - operations.GetAllApiEndpointsResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - > -> { - const parsed = safeParse( - request, - (value) => operations.GetAllApiEndpointsRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return parsed; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - apiID: encodeSimple("apiID", payload.apiID, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/apis/{apiID}/api_endpoints")(pathParams); - - const headers = new Headers({ - Accept: "application/json", - }); - - const securityInput = await extractSecurity(client._options.security); - const context = { - operationID: "getAllApiEndpoints", - oAuth2Scopes: [], - securitySource: client._options.security, - }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - path: path, - headers: headers, - body: body, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return requestRes; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }); - if (!doResult.ok) { - return doResult; - } - const response = doResult.value; - - const [result] = await M.match< - operations.GetAllApiEndpointsResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - >( - M.json("2XX", operations.GetAllApiEndpointsResponse$inboundSchema), - M.json("4XX", operations.GetAllApiEndpointsResponse$inboundSchema), - )(response); - if (!result.ok) { - return result; - } - - return result; -} diff --git a/src/funcs/apiEndpointsGetAllForVersionApiEndpoints.ts b/src/funcs/apiEndpointsGetAllForVersionApiEndpoints.ts deleted file mode 100644 index d108bdef..00000000 --- a/src/funcs/apiEndpointsGetAllForVersionApiEndpoints.ts +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { SpeakeasyCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.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 "../sdk/models/errors/httpclienterrors.js"; -import { SDKError } from "../sdk/models/errors/sdkerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { Result } from "../sdk/types/fp.js"; - -/** - * Get all ApiEndpoints for a particular apiID and versionID. - */ -export async function apiEndpointsGetAllForVersionApiEndpoints( - client: SpeakeasyCore, - request: operations.GetAllForVersionApiEndpointsRequest, - options?: RequestOptions, -): Promise< - Result< - operations.GetAllForVersionApiEndpointsResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - > -> { - const parsed = safeParse( - request, - (value) => - operations.GetAllForVersionApiEndpointsRequest$outboundSchema.parse( - value, - ), - "Input validation failed", - ); - if (!parsed.ok) { - return parsed; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - apiID: encodeSimple("apiID", payload.apiID, { - explode: false, - charEncoding: "percent", - }), - versionID: encodeSimple("versionID", payload.versionID, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/apis/{apiID}/version/{versionID}/api_endpoints")( - pathParams, - ); - - const headers = new Headers({ - Accept: "application/json", - }); - - const securityInput = await extractSecurity(client._options.security); - const context = { - operationID: "getAllForVersionApiEndpoints", - oAuth2Scopes: [], - securitySource: client._options.security, - }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - path: path, - headers: headers, - body: body, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return requestRes; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }); - if (!doResult.ok) { - return doResult; - } - const response = doResult.value; - - const [result] = await M.match< - operations.GetAllForVersionApiEndpointsResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - >( - M.json( - "2XX", - operations.GetAllForVersionApiEndpointsResponse$inboundSchema, - ), - M.json( - "4XX", - operations.GetAllForVersionApiEndpointsResponse$inboundSchema, - ), - )(response); - if (!result.ok) { - return result; - } - - return result; -} diff --git a/src/funcs/apiEndpointsUpsertApiEndpoint.ts b/src/funcs/apiEndpointsUpsertApiEndpoint.ts deleted file mode 100644 index 8f1ce949..00000000 --- a/src/funcs/apiEndpointsUpsertApiEndpoint.ts +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { SpeakeasyCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.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 "../sdk/models/errors/httpclienterrors.js"; -import { SDKError } from "../sdk/models/errors/sdkerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { Result } from "../sdk/types/fp.js"; - -/** - * Upsert an ApiEndpoint. - * - * @remarks - * Upsert an ApiEndpoint. If the ApiEndpoint does not exist it will be created, otherwise it will be updated. - */ -export async function apiEndpointsUpsertApiEndpoint( - client: SpeakeasyCore, - request: operations.UpsertApiEndpointRequest, - options?: RequestOptions, -): Promise< - Result< - operations.UpsertApiEndpointResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - > -> { - const parsed = safeParse( - request, - (value) => operations.UpsertApiEndpointRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return parsed; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.ApiEndpoint, { explode: true }); - - const pathParams = { - apiEndpointID: encodeSimple("apiEndpointID", payload.apiEndpointID, { - explode: false, - charEncoding: "percent", - }), - apiID: encodeSimple("apiID", payload.apiID, { - explode: false, - charEncoding: "percent", - }), - versionID: encodeSimple("versionID", payload.versionID, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc( - "/v1/apis/{apiID}/version/{versionID}/api_endpoints/{apiEndpointID}", - )(pathParams); - - const headers = new Headers({ - "Content-Type": "application/json", - Accept: "application/json", - }); - - const securityInput = await extractSecurity(client._options.security); - const context = { - operationID: "upsertApiEndpoint", - oAuth2Scopes: [], - securitySource: client._options.security, - }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PUT", - path: path, - headers: headers, - body: body, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return requestRes; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }); - if (!doResult.ok) { - return doResult; - } - const response = doResult.value; - - const [result] = await M.match< - operations.UpsertApiEndpointResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - >( - M.json("2XX", operations.UpsertApiEndpointResponse$inboundSchema), - M.json("4XX", operations.UpsertApiEndpointResponse$inboundSchema), - )(response); - if (!result.ok) { - return result; - } - - return result; -} diff --git a/src/funcs/apisGeneratePostmanCollection.ts b/src/funcs/apisGeneratePostmanCollection.ts deleted file mode 100644 index 789c7373..00000000 --- a/src/funcs/apisGeneratePostmanCollection.ts +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { SpeakeasyCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.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 "../sdk/models/errors/httpclienterrors.js"; -import { SDKError } from "../sdk/models/errors/sdkerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { Result } from "../sdk/types/fp.js"; - -export enum GeneratePostmanCollectionAcceptEnum { - applicationJson = "application/json", - applicationOctetStream = "application/octet-stream", -} - -/** - * Generate a Postman collection for a particular Api. - * - * @remarks - * Generates a postman collection containing all endpoints for a particular API. Includes variables produced for any path/query/header parameters included in the OpenAPI document. - */ -export async function apisGeneratePostmanCollection( - client: SpeakeasyCore, - request: operations.GeneratePostmanCollectionRequest, - options?: RequestOptions & { - acceptHeaderOverride?: GeneratePostmanCollectionAcceptEnum; - }, -): Promise< - Result< - operations.GeneratePostmanCollectionResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - > -> { - const parsed = safeParse( - request, - (value) => - operations.GeneratePostmanCollectionRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return parsed; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - apiID: encodeSimple("apiID", payload.apiID, { - explode: false, - charEncoding: "percent", - }), - versionID: encodeSimple("versionID", payload.versionID, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc( - "/v1/apis/{apiID}/version/{versionID}/generate/postman", - )(pathParams); - - const headers = new Headers({ - Accept: options?.acceptHeaderOverride - || "application/json;q=1, application/octet-stream;q=0", - }); - - const securityInput = await extractSecurity(client._options.security); - const context = { - operationID: "generatePostmanCollection", - oAuth2Scopes: [], - securitySource: client._options.security, - }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - path: path, - headers: headers, - body: body, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return requestRes; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }); - if (!doResult.ok) { - return doResult; - } - const response = doResult.value; - - const [result] = await M.match< - operations.GeneratePostmanCollectionResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - >( - M.stream("2XX", operations.GeneratePostmanCollectionResponse$inboundSchema), - M.json("4XX", operations.GeneratePostmanCollectionResponse$inboundSchema), - )(response); - if (!result.ok) { - return result; - } - - return result; -} diff --git a/src/funcs/apisGetApis.ts b/src/funcs/apisGetApis.ts deleted file mode 100644 index bb5fc8ac..00000000 --- a/src/funcs/apisGetApis.ts +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { SpeakeasyCore } from "../core.js"; -import { encodeDeepObjectQuery } from "../lib/encodings.js"; -import * as M from "../lib/matchers.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 "../sdk/models/errors/httpclienterrors.js"; -import { SDKError } from "../sdk/models/errors/sdkerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { Result } from "../sdk/types/fp.js"; - -/** - * Get a list of Apis for a given workspace - * - * @remarks - * Get a list of all Apis and their versions for a given workspace. - * Supports filtering the APIs based on metadata attributes. - */ -export async function apisGetApis( - client: SpeakeasyCore, - request: operations.GetApisRequest, - options?: RequestOptions, -): Promise< - Result< - operations.GetApisResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - > -> { - const parsed = safeParse( - request, - (value) => operations.GetApisRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return parsed; - } - const payload = parsed.value; - const body = null; - - const path = pathToFunc("/v1/apis")(); - - const query = encodeDeepObjectQuery({ - "metadata": payload.metadata, - "op": payload.op, - }); - - const headers = new Headers({ - Accept: "application/json", - }); - - const securityInput = await extractSecurity(client._options.security); - const context = { - operationID: "getApis", - oAuth2Scopes: [], - securitySource: client._options.security, - }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - path: path, - headers: headers, - query: query, - body: body, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return requestRes; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }); - if (!doResult.ok) { - return doResult; - } - const response = doResult.value; - - const [result] = await M.match< - operations.GetApisResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - >( - M.json("2XX", operations.GetApisResponse$inboundSchema), - M.json("4XX", operations.GetApisResponse$inboundSchema), - )(response); - if (!result.ok) { - return result; - } - - return result; -} diff --git a/src/funcs/artifactsCreateRemoteSource.ts b/src/funcs/artifactsCreateRemoteSource.ts new file mode 100644 index 00000000..1af35f81 --- /dev/null +++ b/src/funcs/artifactsCreateRemoteSource.ts @@ -0,0 +1,151 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SpeakeasyCore } 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 "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as shared from "../sdk/models/shared/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Configure a new remote source + */ +export function artifactsCreateRemoteSource( + client: SpeakeasyCore, + request?: shared.RemoteSource | undefined, + options?: RequestOptions, +): APIPromise< + Result< + shared.ErrorT | undefined, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request?: shared.RemoteSource | undefined, + options?: RequestOptions, +): Promise< + [ + Result< + shared.ErrorT | undefined, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => shared.RemoteSource$outboundSchema.optional().parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = payload === undefined + ? null + : encodeJSON("body", payload, { explode: true }); + + const path = pathToFunc("/v1/artifacts/remote_sources")(); + + const headers = new Headers(compactMap({ + "Content-Type": "application/json", + Accept: "application/json", + })); + + const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "createRemoteSource", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.security, + 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, + 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: [], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const [result] = await M.match< + shared.ErrorT | undefined, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + M.nil("2XX", shared.ErrorT$inboundSchema.optional()), + M.json("4XX", shared.ErrorT$inboundSchema.optional()), + )(response); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/artifactsGetBlob.ts b/src/funcs/artifactsGetBlob.ts index c3432a6a..901a6302 100644 --- a/src/funcs/artifactsGetBlob.ts +++ b/src/funcs/artifactsGetBlob.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } 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"; @@ -19,6 +20,7 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; export enum GetBlobAcceptEnum { @@ -29,11 +31,11 @@ export enum GetBlobAcceptEnum { /** * Get blob for a particular digest */ -export async function artifactsGetBlob( +export function artifactsGetBlob( client: SpeakeasyCore, request: operations.GetBlobRequest, options?: RequestOptions & { acceptHeaderOverride?: GetBlobAcceptEnum }, -): Promise< +): APIPromise< Result< operations.GetBlobResponse, | SDKError @@ -44,6 +46,32 @@ export async function artifactsGetBlob( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.GetBlobRequest, + options?: RequestOptions & { acceptHeaderOverride?: GetBlobAcceptEnum }, +): Promise< + [ + Result< + operations.GetBlobResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -51,7 +79,7 @@ export async function artifactsGetBlob( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; @@ -80,41 +108,50 @@ export async function artifactsGetBlob( "/v1/oci/v2/{organization_slug}/{workspace_slug}/{namespace_name}/blobs/{digest}", )(pathParams); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: options?.acceptHeaderOverride || "application/json;q=1, application/octet-stream;q=0", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "getBlob", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -132,8 +169,8 @@ export async function artifactsGetBlob( M.json("4XX", operations.GetBlobResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/artifactsGetManifest.ts b/src/funcs/artifactsGetManifest.ts index 1ea437bc..51b53bc1 100644 --- a/src/funcs/artifactsGetManifest.ts +++ b/src/funcs/artifactsGetManifest.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } 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"; @@ -19,6 +20,7 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; export enum GetManifestAcceptEnum { @@ -30,11 +32,11 @@ export enum GetManifestAcceptEnum { /** * Get manifest for a particular reference */ -export async function artifactsGetManifest( +export function artifactsGetManifest( client: SpeakeasyCore, request: operations.GetManifestRequest, options?: RequestOptions & { acceptHeaderOverride?: GetManifestAcceptEnum }, -): Promise< +): APIPromise< Result< operations.GetManifestResponse, | SDKError @@ -45,6 +47,32 @@ export async function artifactsGetManifest( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.GetManifestRequest, + options?: RequestOptions & { acceptHeaderOverride?: GetManifestAcceptEnum }, +): Promise< + [ + Result< + operations.GetManifestResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -52,7 +80,7 @@ export async function artifactsGetManifest( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; @@ -82,41 +110,50 @@ export async function artifactsGetManifest( "/v1/oci/v2/{organization_slug}/{workspace_slug}/{namespace_name}/manifests/{revision_reference}", )(pathParams); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: options?.acceptHeaderOverride || "application/json;q=1, application/vnd.oci.image.manifest.v1+json;q=0", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "getManifest", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -136,8 +173,8 @@ export async function artifactsGetManifest( M.json("4XX", operations.GetManifestResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/artifactsGetNamespaces.ts b/src/funcs/artifactsGetNamespaces.ts index 0adc9df1..36e12ffe 100644 --- a/src/funcs/artifactsGetNamespaces.ts +++ b/src/funcs/artifactsGetNamespaces.ts @@ -4,6 +4,7 @@ import { SpeakeasyCore } 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"; @@ -17,15 +18,16 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** * Each namespace contains many revisions. */ -export async function artifactsGetNamespaces( +export function artifactsGetNamespaces( client: SpeakeasyCore, options?: RequestOptions, -): Promise< +): APIPromise< Result< operations.GetNamespacesResponse, | SDKError @@ -36,42 +38,75 @@ export async function artifactsGetNamespaces( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GetNamespacesResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const path = pathToFunc("/v1/artifacts/namespaces")(); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "getNamespaces", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -89,8 +124,8 @@ export async function artifactsGetNamespaces( M.json("4XX", operations.GetNamespacesResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/artifactsGetRevisions.ts b/src/funcs/artifactsGetRevisions.ts index 7ca51f84..6b61e693 100644 --- a/src/funcs/artifactsGetRevisions.ts +++ b/src/funcs/artifactsGetRevisions.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } from "../core.js"; import { encodeFormQuery, 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"; @@ -19,13 +20,14 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; -export async function artifactsGetRevisions( +export function artifactsGetRevisions( client: SpeakeasyCore, request: operations.GetRevisionsRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< operations.GetRevisionsResponse, | SDKError @@ -36,6 +38,32 @@ export async function artifactsGetRevisions( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.GetRevisionsRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GetRevisionsResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -43,7 +71,7 @@ export async function artifactsGetRevisions( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; @@ -63,21 +91,31 @@ export async function artifactsGetRevisions( "next_page_token": payload.next_page_token, }); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "getRevisions", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -85,19 +123,18 @@ export async function artifactsGetRevisions( timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -115,8 +152,8 @@ export async function artifactsGetRevisions( M.json("4XX", operations.GetRevisionsResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/artifactsGetTags.ts b/src/funcs/artifactsGetTags.ts index 91b01940..2ab39170 100644 --- a/src/funcs/artifactsGetTags.ts +++ b/src/funcs/artifactsGetTags.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } 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"; @@ -19,13 +20,14 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; -export async function artifactsGetTags( +export function artifactsGetTags( client: SpeakeasyCore, request: operations.GetTagsRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< operations.GetTagsResponse, | SDKError @@ -36,6 +38,32 @@ export async function artifactsGetTags( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.GetTagsRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GetTagsResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -43,7 +71,7 @@ export async function artifactsGetTags( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; @@ -59,40 +87,49 @@ export async function artifactsGetTags( pathParams, ); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "getTags", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -110,8 +147,8 @@ export async function artifactsGetTags( M.json("4XX", operations.GetTagsResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/apisGetAllApiVersions.ts b/src/funcs/artifactsListRemoteSources.ts similarity index 55% rename from src/funcs/apisGetAllApiVersions.ts rename to src/funcs/artifactsListRemoteSources.ts index c18f562b..fc65f09d 100644 --- a/src/funcs/apisGetAllApiVersions.ts +++ b/src/funcs/artifactsListRemoteSources.ts @@ -3,8 +3,9 @@ */ import { SpeakeasyCore } from "../core.js"; -import { encodeDeepObjectQuery, encodeSimple } from "../lib/encodings.js"; +import { encodeFormQuery } 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"; @@ -19,22 +20,19 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** - * Get all Api versions for a particular ApiEndpoint. - * - * @remarks - * Get all Api versions for a particular ApiEndpoint. - * Supports filtering the versions based on metadata attributes. + * Get remote sources attached to a particular namespace */ -export async function apisGetAllApiVersions( +export function artifactsListRemoteSources( client: SpeakeasyCore, - request: operations.GetAllApiVersionsRequest, + request: operations.ListRemoteSourcesRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< - operations.GetAllApiVersionsResponse, + operations.ListRemoteSourcesResponse, | SDKError | SDKValidationError | UnexpectedClientError @@ -43,47 +41,75 @@ export async function apisGetAllApiVersions( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.ListRemoteSourcesRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.ListRemoteSourcesResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, - (value) => operations.GetAllApiVersionsRequest$outboundSchema.parse(value), + (value) => operations.ListRemoteSourcesRequest$outboundSchema.parse(value), "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; - const pathParams = { - apiID: encodeSimple("apiID", payload.apiID, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/apis/{apiID}")(pathParams); + const path = pathToFunc("/v1/artifacts/remote_sources")(); - const query = encodeDeepObjectQuery({ - "metadata": payload.metadata, - "op": payload.op, + const query = encodeFormQuery({ + "namespace_name": payload.namespace_name, }); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { - operationID: "getAllApiVersions", + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "listRemoteSources", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -91,24 +117,23 @@ export async function apisGetAllApiVersions( timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; const [result] = await M.match< - operations.GetAllApiVersionsResponse, + operations.ListRemoteSourcesResponse, | SDKError | SDKValidationError | UnexpectedClientError @@ -117,12 +142,12 @@ export async function apisGetAllApiVersions( | RequestTimeoutError | ConnectionError >( - M.json("2XX", operations.GetAllApiVersionsResponse$inboundSchema), - M.json("4XX", operations.GetAllApiVersionsResponse$inboundSchema), + M.json("2XX", operations.ListRemoteSourcesResponse$inboundSchema), + M.json("4XX", operations.ListRemoteSourcesResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/artifactsPostTags.ts b/src/funcs/artifactsPostTags.ts index 9536be3a..b6759768 100644 --- a/src/funcs/artifactsPostTags.ts +++ b/src/funcs/artifactsPostTags.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } 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"; @@ -20,16 +21,17 @@ import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; import * as shared from "../sdk/models/shared/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** * Add tags to an existing revision */ -export async function artifactsPostTags( +export function artifactsPostTags( client: SpeakeasyCore, request: operations.PostTagsRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< shared.ErrorT | undefined, | SDKError @@ -40,6 +42,32 @@ export async function artifactsPostTags( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.PostTagsRequest, + options?: RequestOptions, +): Promise< + [ + Result< + shared.ErrorT | undefined, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -47,7 +75,7 @@ export async function artifactsPostTags( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = encodeJSON("body", payload.AddTags, { explode: true }); @@ -63,41 +91,50 @@ export async function artifactsPostTags( pathParams, ); - const headers = new Headers({ + const headers = new Headers(compactMap({ "Content-Type": "application/json", Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "postTags", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -115,8 +152,8 @@ export async function artifactsPostTags( M.json("4XX", shared.ErrorT$inboundSchema.optional()), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/artifactsPreflight.ts b/src/funcs/artifactsPreflight.ts index c3242d62..e0b25ea9 100644 --- a/src/funcs/artifactsPreflight.ts +++ b/src/funcs/artifactsPreflight.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } 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"; @@ -20,16 +21,17 @@ import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; import * as shared from "../sdk/models/shared/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** * Get access token for communicating with OCI distribution endpoints */ -export async function artifactsPreflight( +export function artifactsPreflight( client: SpeakeasyCore, request?: shared.PreflightRequest | undefined, options?: RequestOptions, -): Promise< +): APIPromise< Result< operations.PreflightResponse, | SDKError @@ -40,6 +42,32 @@ export async function artifactsPreflight( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request?: shared.PreflightRequest | undefined, + options?: RequestOptions, +): Promise< + [ + Result< + operations.PreflightResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -47,7 +75,7 @@ export async function artifactsPreflight( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = payload === undefined @@ -56,41 +84,50 @@ export async function artifactsPreflight( const path = pathToFunc("/v1/artifacts/preflight")(); - const headers = new Headers({ + const headers = new Headers(compactMap({ "Content-Type": "application/json", Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "preflight", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -108,8 +145,8 @@ export async function artifactsPreflight( M.json("4XX", operations.PreflightResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/schemasRegisterSchema.ts b/src/funcs/artifactsSetArchived.ts similarity index 59% rename from src/funcs/schemasRegisterSchema.ts rename to src/funcs/artifactsSetArchived.ts index 32ef36f7..f3768b27 100644 --- a/src/funcs/schemasRegisterSchema.ts +++ b/src/funcs/artifactsSetArchived.ts @@ -3,9 +3,9 @@ */ import { SpeakeasyCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import { readableStreamToArrayBuffer } from "../lib/files.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"; @@ -21,22 +21,17 @@ import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; import * as shared from "../sdk/models/shared/index.js"; -import { isBlobLike } from "../sdk/types/blobs.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; -import { isReadableStream } from "../sdk/types/streams.js"; /** - * Register a schema. - * - * @remarks - * Allows uploading a schema for a particular API version. - * This will be used to populate ApiEndpoints and used as a base for any schema generation if present. + * Set whether a namespace is archived */ -export async function schemasRegisterSchema( +export function artifactsSetArchived( client: SpeakeasyCore, - request: operations.RegisterSchemaRequest, + request: operations.ArchiveNamespaceRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< shared.ErrorT | undefined, | SDKError @@ -47,85 +42,99 @@ export async function schemasRegisterSchema( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.ArchiveNamespaceRequest, + options?: RequestOptions, +): Promise< + [ + Result< + shared.ErrorT | undefined, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, - (value) => operations.RegisterSchemaRequest$outboundSchema.parse(value), + (value) => operations.ArchiveNamespaceRequest$outboundSchema.parse(value), "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; - const body = new FormData(); - - if (isBlobLike(payload.RequestBody.file)) { - body.append("file", payload.RequestBody.file); - } else if (isReadableStream(payload.RequestBody.file.content)) { - const buffer = await readableStreamToArrayBuffer( - payload.RequestBody.file.content, - ); - const blob = new Blob([buffer], { type: "application/octet-stream" }); - body.append("file", blob); - } else { - body.append( - "file", - new Blob([payload.RequestBody.file.content], { - type: "application/octet-stream", - }), - payload.RequestBody.file.fileName, - ); - } + const body = encodeJSON("body", payload.RequestBody, { explode: true }); const pathParams = { - apiID: encodeSimple("apiID", payload.apiID, { - explode: false, - charEncoding: "percent", - }), - versionID: encodeSimple("versionID", payload.versionID, { + namespace_name: encodeSimple("namespace_name", payload.namespace_name, { explode: false, charEncoding: "percent", }), }; - const path = pathToFunc("/v1/apis/{apiID}/version/{versionID}/schema")( + const path = pathToFunc("/v1/artifacts/namespaces/{namespace_name}/archive")( pathParams, ); - const headers = new Headers({ + const headers = new Headers(compactMap({ + "Content-Type": "application/json", Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { - operationID: "registerSchema", + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "archiveNamespace", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -143,8 +152,8 @@ export async function schemasRegisterSchema( M.json("4XX", shared.ErrorT$inboundSchema.optional()), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/apiEndpointsDeleteApiEndpoint.ts b/src/funcs/artifactsSetVisibility.ts similarity index 59% rename from src/funcs/apiEndpointsDeleteApiEndpoint.ts rename to src/funcs/artifactsSetVisibility.ts index 51a32344..8517c7a3 100644 --- a/src/funcs/apiEndpointsDeleteApiEndpoint.ts +++ b/src/funcs/artifactsSetVisibility.ts @@ -3,8 +3,9 @@ */ import { SpeakeasyCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.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"; @@ -20,19 +21,17 @@ import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; import * as shared from "../sdk/models/shared/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** - * Delete an ApiEndpoint. - * - * @remarks - * Delete an ApiEndpoint. This will also delete all associated Request Logs (if using a Postgres datastore). + * Set visibility of a namespace with an existing metadata entry */ -export async function apiEndpointsDeleteApiEndpoint( +export function artifactsSetVisibility( client: SpeakeasyCore, - request: operations.DeleteApiEndpointRequest, + request: operations.SetVisibilityRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< shared.ErrorT | undefined, | SDKError @@ -43,71 +42,99 @@ export async function apiEndpointsDeleteApiEndpoint( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.SetVisibilityRequest, + options?: RequestOptions, +): Promise< + [ + Result< + shared.ErrorT | undefined, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, - (value) => operations.DeleteApiEndpointRequest$outboundSchema.parse(value), + (value) => operations.SetVisibilityRequest$outboundSchema.parse(value), "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; - const body = null; + const body = encodeJSON("body", payload.RequestBody, { explode: true }); const pathParams = { - apiEndpointID: encodeSimple("apiEndpointID", payload.apiEndpointID, { - explode: false, - charEncoding: "percent", - }), - apiID: encodeSimple("apiID", payload.apiID, { - explode: false, - charEncoding: "percent", - }), - versionID: encodeSimple("versionID", payload.versionID, { + namespace_name: encodeSimple("namespace_name", payload.namespace_name, { explode: false, charEncoding: "percent", }), }; const path = pathToFunc( - "/v1/apis/{apiID}/version/{versionID}/api_endpoints/{apiEndpointID}", + "/v1/artifacts/namespaces/{namespace_name}/visibility", )(pathParams); - const headers = new Headers({ + const headers = new Headers(compactMap({ + "Content-Type": "application/json", Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { - operationID: "deleteApiEndpoint", + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "setVisibility", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, - method: "DELETE", + method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -125,8 +152,8 @@ export async function apiEndpointsDeleteApiEndpoint( M.json("4XX", shared.ErrorT$inboundSchema.optional()), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/authGetAccess.ts b/src/funcs/authGetAccess.ts index 8d2e7389..0ccc05a7 100644 --- a/src/funcs/authGetAccess.ts +++ b/src/funcs/authGetAccess.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } from "../core.js"; import { encodeFormQuery } 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"; @@ -20,6 +21,7 @@ import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; import * as shared from "../sdk/models/shared/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** @@ -28,11 +30,11 @@ import { Result } from "../sdk/types/fp.js"; * @remarks * Checks if generation is permitted for a particular run of the CLI */ -export async function authGetAccess( +export function authGetAccess( client: SpeakeasyCore, request: operations.GetWorkspaceAccessRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< shared.AccessDetails, | SDKError @@ -43,6 +45,32 @@ export async function authGetAccess( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.GetWorkspaceAccessRequest, + options?: RequestOptions, +): Promise< + [ + Result< + shared.AccessDetails, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -50,7 +78,7 @@ export async function authGetAccess( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; @@ -63,21 +91,41 @@ export async function authGetAccess( "targetType": payload.targetType, }); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "getWorkspaceAccess", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 100, + maxInterval: 2000, + exponent: 1.5, + maxElapsedTime: 60000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["408", "500", "502", "503"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -85,29 +133,18 @@ export async function authGetAccess( timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 100, - maxInterval: 2000, - exponent: 1.5, - maxElapsedTime: 60000, - }, - retryConnectionErrors: true, - }, - retryCodes: options?.retryCodes || ["408", "500", "502", "503"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -124,8 +161,8 @@ export async function authGetAccess( M.json("2XX", shared.AccessDetails$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/authGetAccessToken.ts b/src/funcs/authGetAccessToken.ts index e39f6502..ab93ea4d 100644 --- a/src/funcs/authGetAccessToken.ts +++ b/src/funcs/authGetAccessToken.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } from "../core.js"; import { encodeFormQuery } 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"; @@ -18,16 +19,17 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** * Get or refresh an access token for the current workspace. */ -export async function authGetAccessToken( +export function authGetAccessToken( client: SpeakeasyCore, request: operations.GetAccessTokenRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< operations.GetAccessTokenResponse, | SDKError @@ -38,6 +40,32 @@ export async function authGetAccessToken( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.GetAccessTokenRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GetAccessTokenResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -45,7 +73,7 @@ export async function authGetAccessToken( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; @@ -56,18 +84,27 @@ export async function authGetAccessToken( "workspace_id": payload.workspace_id, }); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "getAccessToken", 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: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -75,19 +112,18 @@ export async function authGetAccessToken( timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -105,8 +141,8 @@ export async function authGetAccessToken( M.json("4XX", operations.GetAccessTokenResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/authGetUser.ts b/src/funcs/authGetUser.ts index 5e0b3178..8c9deeb9 100644 --- a/src/funcs/authGetUser.ts +++ b/src/funcs/authGetUser.ts @@ -4,6 +4,7 @@ import { SpeakeasyCore } 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"; @@ -17,15 +18,16 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** * Get information about the current user. */ -export async function authGetUser( +export function authGetUser( client: SpeakeasyCore, options?: RequestOptions, -): Promise< +): APIPromise< Result< operations.GetUserResponse, | SDKError @@ -36,42 +38,75 @@ export async function authGetUser( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GetUserResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const path = pathToFunc("/v1/user")(); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "getUser", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -89,8 +124,8 @@ export async function authGetUser( M.json("4XX", operations.GetUserResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/authValidateApiKey.ts b/src/funcs/authValidateApiKey.ts index 25528146..3f39e07b 100644 --- a/src/funcs/authValidateApiKey.ts +++ b/src/funcs/authValidateApiKey.ts @@ -4,6 +4,7 @@ import { SpeakeasyCore } 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"; @@ -17,15 +18,16 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** * Validate the current api key. */ -export async function authValidateApiKey( +export function authValidateApiKey( client: SpeakeasyCore, options?: RequestOptions, -): Promise< +): APIPromise< Result< operations.ValidateApiKeyResponse, | SDKError @@ -36,42 +38,75 @@ export async function authValidateApiKey( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + options?: RequestOptions, +): Promise< + [ + Result< + operations.ValidateApiKeyResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const path = pathToFunc("/v1/auth/validate")(); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "validateApiKey", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -89,8 +124,8 @@ export async function authValidateApiKey( M.json("4XX", operations.ValidateApiKeyResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/codeSamplesGenerateCodeSamplePreview.ts b/src/funcs/codeSamplesGenerateCodeSamplePreview.ts new file mode 100644 index 00000000..ded79261 --- /dev/null +++ b/src/funcs/codeSamplesGenerateCodeSamplePreview.ts @@ -0,0 +1,185 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SpeakeasyCore } from "../core.js"; +import { appendForm } from "../lib/encodings.js"; +import { readableStreamToArrayBuffer } from "../lib/files.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 "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import * as shared from "../sdk/models/shared/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; +import { isBlobLike } from "../sdk/types/blobs.js"; +import { Result } from "../sdk/types/fp.js"; +import { isReadableStream } from "../sdk/types/streams.js"; + +/** + * Generate Code Sample previews from a file and configuration parameters. + * + * @remarks + * This endpoint generates Code Sample previews from a file and configuration parameters. + */ +export function codeSamplesGenerateCodeSamplePreview( + client: SpeakeasyCore, + request: shared.CodeSampleSchemaInput, + options?: RequestOptions, +): APIPromise< + Result< + operations.GenerateCodeSamplePreviewResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: shared.CodeSampleSchemaInput, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GenerateCodeSamplePreviewResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => shared.CodeSampleSchemaInput$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = new FormData(); + + appendForm(body, "language", payload.language); + if (isBlobLike(payload.schema_file)) { + appendForm(body, "schema_file", payload.schema_file); + } else if (isReadableStream(payload.schema_file.content)) { + const buffer = await readableStreamToArrayBuffer( + payload.schema_file.content, + ); + const blob = new Blob([buffer], { type: "application/octet-stream" }); + appendForm(body, "schema_file", blob); + } else { + appendForm( + body, + "schema_file", + new Blob([payload.schema_file.content], { + type: "application/octet-stream", + }), + payload.schema_file.fileName, + ); + } + if (payload.operation_ids !== undefined) { + appendForm(body, "operation_ids", payload.operation_ids); + } + if (payload.package_name !== undefined) { + appendForm(body, "package_name", payload.package_name); + } + if (payload.sdk_class_name !== undefined) { + appendForm(body, "sdk_class_name", payload.sdk_class_name); + } + + const path = pathToFunc("/v1/code_sample/preview")(); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "generateCodeSamplePreview", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.security, + 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, + 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: [], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const [result] = await M.match< + operations.GenerateCodeSamplePreviewResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + M.json("2XX", operations.GenerateCodeSamplePreviewResponse$inboundSchema), + M.json("4XX", operations.GenerateCodeSamplePreviewResponse$inboundSchema), + M.json("5XX", operations.GenerateCodeSamplePreviewResponse$inboundSchema), + )(response); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/codeSamplesGenerateCodeSamplePreviewAsync.ts b/src/funcs/codeSamplesGenerateCodeSamplePreviewAsync.ts new file mode 100644 index 00000000..f18b93bf --- /dev/null +++ b/src/funcs/codeSamplesGenerateCodeSamplePreviewAsync.ts @@ -0,0 +1,194 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SpeakeasyCore } from "../core.js"; +import { appendForm } from "../lib/encodings.js"; +import { readableStreamToArrayBuffer } from "../lib/files.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 "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import * as shared from "../sdk/models/shared/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; +import { isBlobLike } from "../sdk/types/blobs.js"; +import { Result } from "../sdk/types/fp.js"; +import { isReadableStream } from "../sdk/types/streams.js"; + +/** + * Initiate asynchronous Code Sample preview generation from a file and configuration parameters, receiving an async JobID response for polling. + * + * @remarks + * This endpoint generates Code Sample previews from a file and configuration parameters, receiving an async JobID response for polling. + */ +export function codeSamplesGenerateCodeSamplePreviewAsync( + client: SpeakeasyCore, + request: shared.CodeSampleSchemaInput, + options?: RequestOptions, +): APIPromise< + Result< + operations.GenerateCodeSamplePreviewAsyncResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: shared.CodeSampleSchemaInput, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GenerateCodeSamplePreviewAsyncResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => shared.CodeSampleSchemaInput$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = new FormData(); + + appendForm(body, "language", payload.language); + if (isBlobLike(payload.schema_file)) { + appendForm(body, "schema_file", payload.schema_file); + } else if (isReadableStream(payload.schema_file.content)) { + const buffer = await readableStreamToArrayBuffer( + payload.schema_file.content, + ); + const blob = new Blob([buffer], { type: "application/octet-stream" }); + appendForm(body, "schema_file", blob); + } else { + appendForm( + body, + "schema_file", + new Blob([payload.schema_file.content], { + type: "application/octet-stream", + }), + payload.schema_file.fileName, + ); + } + if (payload.operation_ids !== undefined) { + appendForm(body, "operation_ids", payload.operation_ids); + } + if (payload.package_name !== undefined) { + appendForm(body, "package_name", payload.package_name); + } + if (payload.sdk_class_name !== undefined) { + appendForm(body, "sdk_class_name", payload.sdk_class_name); + } + + const path = pathToFunc("/v1/code_sample/preview/async")(); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "generateCodeSamplePreviewAsync", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.security, + 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, + 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: [], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const [result] = await M.match< + operations.GenerateCodeSamplePreviewAsyncResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + M.json( + 202, + operations.GenerateCodeSamplePreviewAsyncResponse$inboundSchema, + ), + M.json( + "4XX", + operations.GenerateCodeSamplePreviewAsyncResponse$inboundSchema, + ), + M.json( + "5XX", + operations.GenerateCodeSamplePreviewAsyncResponse$inboundSchema, + ), + )(response); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/requestsQueryEventLog.ts b/src/funcs/codeSamplesGet.ts similarity index 53% rename from src/funcs/requestsQueryEventLog.ts rename to src/funcs/codeSamplesGet.ts index 3e44ccbc..c06ff08b 100644 --- a/src/funcs/requestsQueryEventLog.ts +++ b/src/funcs/codeSamplesGet.ts @@ -3,8 +3,9 @@ */ import { SpeakeasyCore } from "../core.js"; -import { encodeJSONQuery } from "../lib/encodings.js"; +import { encodeFormQuery } 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"; @@ -19,22 +20,22 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** - * Query the event log to retrieve a list of requests. + * Retrieve usage snippets * * @remarks - * Supports retrieving a list of request captured by the SDK for this workspace. - * Allows the filtering of requests on a number of criteria such as ApiID, VersionID, Path, Method, etc. + * Retrieve usage snippets from an OpenAPI document stored in the registry. Supports filtering by language and operation ID. */ -export async function requestsQueryEventLog( +export function codeSamplesGet( client: SpeakeasyCore, - request: operations.QueryEventLogRequest, + request: operations.GetCodeSamplesRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< - operations.QueryEventLogResponse, + operations.GetCodeSamplesResponse, | SDKError | SDKValidationError | UnexpectedClientError @@ -43,39 +44,78 @@ export async function requestsQueryEventLog( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.GetCodeSamplesRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GetCodeSamplesResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, - (value) => operations.QueryEventLogRequest$outboundSchema.parse(value), + (value) => operations.GetCodeSamplesRequest$outboundSchema.parse(value), "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; - const path = pathToFunc("/v1/eventlog/query")(); + const path = pathToFunc("/v1/code_sample")(); - const query = encodeJSONQuery({ - "filters": payload.filters, - }, { explode: false }); + const query = encodeFormQuery({ + "languages": payload.languages, + "method_paths": payload.method_paths, + "operation_ids": payload.operation_ids, + "registry_url": payload.registry_url, + }); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { - operationID: "queryEventLog", + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "getCodeSamples", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -83,24 +123,23 @@ export async function requestsQueryEventLog( timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; const [result] = await M.match< - operations.QueryEventLogResponse, + operations.GetCodeSamplesResponse, | SDKError | SDKValidationError | UnexpectedClientError @@ -109,12 +148,12 @@ export async function requestsQueryEventLog( | RequestTimeoutError | ConnectionError >( - M.json("2XX", operations.QueryEventLogResponse$inboundSchema), - M.json("4XX", operations.QueryEventLogResponse$inboundSchema), + M.json("2XX", operations.GetCodeSamplesResponse$inboundSchema), + M.json("4XX", operations.GetCodeSamplesResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/apisGenerateOpenApiSpec.ts b/src/funcs/codeSamplesGetCodeSamplePreviewAsync.ts similarity index 53% rename from src/funcs/apisGenerateOpenApiSpec.ts rename to src/funcs/codeSamplesGetCodeSamplePreviewAsync.ts index d3864664..4bfde85c 100644 --- a/src/funcs/apisGenerateOpenApiSpec.ts +++ b/src/funcs/codeSamplesGetCodeSamplePreviewAsync.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } 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"; @@ -19,22 +20,22 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** - * Generate an OpenAPI specification for a particular Api. + * Poll for the result of an asynchronous Code Sample preview generation. * * @remarks - * This endpoint will generate any missing operations in any registered OpenAPI document if the operation does not already exist in the document. - * Returns the original document and the newly generated document allowing a diff to be performed to see what has changed. + * Poll for the result of an asynchronous Code Sample preview generation. */ -export async function apisGenerateOpenApiSpec( +export function codeSamplesGetCodeSamplePreviewAsync( client: SpeakeasyCore, - request: operations.GenerateOpenApiSpecRequest, + request: operations.GetCodeSamplePreviewAsyncRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< - operations.GenerateOpenApiSpecResponse, + operations.GetCodeSamplePreviewAsyncResponse, | SDKError | SDKValidationError | UnexpectedClientError @@ -43,73 +44,102 @@ export async function apisGenerateOpenApiSpec( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.GetCodeSamplePreviewAsyncRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GetCodeSamplePreviewAsyncResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, (value) => - operations.GenerateOpenApiSpecRequest$outboundSchema.parse(value), + operations.GetCodeSamplePreviewAsyncRequest$outboundSchema.parse(value), "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; const pathParams = { - apiID: encodeSimple("apiID", payload.apiID, { - explode: false, - charEncoding: "percent", - }), - versionID: encodeSimple("versionID", payload.versionID, { + jobID: encodeSimple("jobID", payload.jobID, { explode: false, charEncoding: "percent", }), }; - const path = pathToFunc( - "/v1/apis/{apiID}/version/{versionID}/generate/openapi", - )(pathParams); + const path = pathToFunc("/v1/code_sample/preview/async/{jobID}")(pathParams); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { - operationID: "generateOpenApiSpec", + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "getCodeSamplePreviewAsync", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; const [result] = await M.match< - operations.GenerateOpenApiSpecResponse, + operations.GetCodeSamplePreviewAsyncResponse, | SDKError | SDKValidationError | UnexpectedClientError @@ -118,12 +148,14 @@ export async function apisGenerateOpenApiSpec( | RequestTimeoutError | ConnectionError >( - M.json("2XX", operations.GenerateOpenApiSpecResponse$inboundSchema), - M.json("4XX", operations.GenerateOpenApiSpecResponse$inboundSchema), + M.json(202, operations.GetCodeSamplePreviewAsyncResponse$inboundSchema), + M.json("2XX", operations.GetCodeSamplePreviewAsyncResponse$inboundSchema), + M.json("4XX", operations.GetCodeSamplePreviewAsyncResponse$inboundSchema), + M.json("5XX", operations.GetCodeSamplePreviewAsyncResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/embedsGetValidEmbedAccessTokens.ts b/src/funcs/embedsGetValidEmbedAccessTokens.ts deleted file mode 100644 index cb6f655b..00000000 --- a/src/funcs/embedsGetValidEmbedAccessTokens.ts +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { SpeakeasyCore } from "../core.js"; -import * as M from "../lib/matchers.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 "../sdk/models/errors/httpclienterrors.js"; -import { SDKError } from "../sdk/models/errors/sdkerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { Result } from "../sdk/types/fp.js"; - -/** - * Get all valid embed access tokens for the current workspace. - */ -export async function embedsGetValidEmbedAccessTokens( - client: SpeakeasyCore, - options?: RequestOptions, -): Promise< - Result< - operations.GetValidEmbedAccessTokensResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - > -> { - const path = pathToFunc("/v1/workspace/embed-access-tokens/valid")(); - - const headers = new Headers({ - Accept: "application/json", - }); - - const securityInput = await extractSecurity(client._options.security); - const context = { - operationID: "getValidEmbedAccessTokens", - oAuth2Scopes: [], - securitySource: client._options.security, - }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - path: path, - headers: headers, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return requestRes; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }); - if (!doResult.ok) { - return doResult; - } - const response = doResult.value; - - const [result] = await M.match< - operations.GetValidEmbedAccessTokensResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - >( - M.json("2XX", operations.GetValidEmbedAccessTokensResponse$inboundSchema), - M.json("4XX", operations.GetValidEmbedAccessTokensResponse$inboundSchema), - )(response); - if (!result.ok) { - return result; - } - - return result; -} diff --git a/src/funcs/eventsGetEventsByTarget.ts b/src/funcs/eventsGetEventsByTarget.ts index 58922094..ce7eb304 100644 --- a/src/funcs/eventsGetEventsByTarget.ts +++ b/src/funcs/eventsGetEventsByTarget.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } from "../core.js"; import { encodeFormQuery, 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"; @@ -19,16 +20,17 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** * Load recent events for a particular workspace */ -export async function eventsGetEventsByTarget( +export function eventsGetEventsByTarget( client: SpeakeasyCore, request: operations.GetWorkspaceEventsByTargetRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< operations.GetWorkspaceEventsByTargetResponse, | SDKError @@ -39,6 +41,32 @@ export async function eventsGetEventsByTarget( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.GetWorkspaceEventsByTargetRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GetWorkspaceEventsByTargetResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -47,7 +75,7 @@ export async function eventsGetEventsByTarget( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; @@ -57,10 +85,11 @@ export async function eventsGetEventsByTarget( explode: false, charEncoding: "percent", }), - workspace_id: encodeSimple("workspace_id", payload.workspace_id, { - explode: false, - charEncoding: "percent", - }), + workspace_id: encodeSimple( + "workspace_id", + payload.workspace_id ?? client._options.workspaceId, + { explode: false, charEncoding: "percent" }, + ), }; const path = pathToFunc( @@ -71,21 +100,31 @@ export async function eventsGetEventsByTarget( "after_created_at": payload.after_created_at, }); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "getWorkspaceEventsByTarget", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -93,19 +132,18 @@ export async function eventsGetEventsByTarget( timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -123,8 +161,8 @@ export async function eventsGetEventsByTarget( M.json("5XX", operations.GetWorkspaceEventsByTargetResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/eventsGetTargets.ts b/src/funcs/eventsGetTargets.ts index e52b5d3d..e546c0db 100644 --- a/src/funcs/eventsGetTargets.ts +++ b/src/funcs/eventsGetTargets.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } from "../core.js"; import { encodeFormQuery } 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"; @@ -19,16 +20,17 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** * Load targets for a particular workspace */ -export async function eventsGetTargets( +export function eventsGetTargets( client: SpeakeasyCore, request: operations.GetWorkspaceTargetsRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< operations.GetWorkspaceTargetsResponse, | SDKError @@ -39,6 +41,32 @@ export async function eventsGetTargets( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.GetWorkspaceTargetsRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GetWorkspaceTargetsResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -47,7 +75,7 @@ export async function eventsGetTargets( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; @@ -58,21 +86,31 @@ export async function eventsGetTargets( "after_last_event_created_at": payload.after_last_event_created_at, }); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "getWorkspaceTargets", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -80,19 +118,18 @@ export async function eventsGetTargets( timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -110,8 +147,8 @@ export async function eventsGetTargets( M.json("5XX", operations.GetWorkspaceTargetsResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/eventsGetTargetsDeprecated.ts b/src/funcs/eventsGetTargetsDeprecated.ts index 3bf02eb6..deec2427 100644 --- a/src/funcs/eventsGetTargetsDeprecated.ts +++ b/src/funcs/eventsGetTargetsDeprecated.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } from "../core.js"; import { encodeFormQuery, 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"; @@ -19,16 +20,17 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** * Load targets for a particular workspace */ -export async function eventsGetTargetsDeprecated( +export function eventsGetTargetsDeprecated( client: SpeakeasyCore, request: operations.GetWorkspaceTargetsDeprecatedRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< operations.GetWorkspaceTargetsDeprecatedResponse, | SDKError @@ -39,6 +41,32 @@ export async function eventsGetTargetsDeprecated( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.GetWorkspaceTargetsDeprecatedRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GetWorkspaceTargetsDeprecatedResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -49,16 +77,17 @@ export async function eventsGetTargetsDeprecated( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; const pathParams = { - workspace_id: encodeSimple("workspace_id", payload.workspace_id, { - explode: false, - charEncoding: "percent", - }), + workspace_id: encodeSimple( + "workspace_id", + payload.workspace_id ?? client._options.workspaceId, + { explode: false, charEncoding: "percent" }, + ), }; const path = pathToFunc("/v1/workspace/{workspace_id}/events/targets")( @@ -69,21 +98,31 @@ export async function eventsGetTargetsDeprecated( "after_last_event_created_at": payload.after_last_event_created_at, }); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "getWorkspaceTargetsDeprecated", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -91,19 +130,18 @@ export async function eventsGetTargetsDeprecated( timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -124,8 +162,8 @@ export async function eventsGetTargetsDeprecated( ), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/eventsPost.ts b/src/funcs/eventsPost.ts index 7637b6a1..4556568e 100644 --- a/src/funcs/eventsPost.ts +++ b/src/funcs/eventsPost.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } 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"; @@ -20,6 +21,7 @@ import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; import * as shared from "../sdk/models/shared/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** @@ -28,11 +30,11 @@ import { Result } from "../sdk/types/fp.js"; * @remarks * Sends an array of events to be stored for a particular workspace. */ -export async function eventsPost( +export function eventsPost( client: SpeakeasyCore, request: operations.PostWorkspaceEventsRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< shared.ErrorT | undefined, | SDKError @@ -43,6 +45,32 @@ export async function eventsPost( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.PostWorkspaceEventsRequest, + options?: RequestOptions, +): Promise< + [ + Result< + shared.ErrorT | undefined, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -51,65 +79,75 @@ export async function eventsPost( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = encodeJSON("body", payload.RequestBody, { explode: true }); const pathParams = { - workspace_id: encodeSimple("workspace_id", payload.workspace_id, { - explode: false, - charEncoding: "percent", - }), + workspace_id: encodeSimple( + "workspace_id", + payload.workspace_id ?? client._options.workspaceId, + { explode: false, charEncoding: "percent" }, + ), }; const path = pathToFunc("/v1/workspace/{workspace_id}/events")(pathParams); - const headers = new Headers({ + const headers = new Headers(compactMap({ "Content-Type": "application/json", Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "postWorkspaceEvents", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { + strategy: "backoff", + backoff: { + initialInterval: 100, + maxInterval: 2000, + exponent: 1.5, + maxElapsedTime: 60000, + }, + retryConnectionErrors: true, + } + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["408", "500", "502", "503"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 100, - maxInterval: 2000, - exponent: 1.5, - maxElapsedTime: 60000, - }, - retryConnectionErrors: true, - }, - retryCodes: options?.retryCodes || ["408", "500", "502", "503"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -127,8 +165,8 @@ export async function eventsPost( M.json("5XX", shared.ErrorT$inboundSchema.optional()), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/eventsSearch.ts b/src/funcs/eventsSearch.ts index 5c75b182..18e67eb6 100644 --- a/src/funcs/eventsSearch.ts +++ b/src/funcs/eventsSearch.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } from "../core.js"; import { encodeFormQuery, 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"; @@ -19,16 +20,17 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** * Search events for a particular workspace by any field */ -export async function eventsSearch( +export function eventsSearch( client: SpeakeasyCore, request: operations.SearchWorkspaceEventsRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< operations.SearchWorkspaceEventsResponse, | SDKError @@ -39,6 +41,32 @@ export async function eventsSearch( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.SearchWorkspaceEventsRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.SearchWorkspaceEventsResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -47,43 +75,57 @@ export async function eventsSearch( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; const pathParams = { - workspace_id: encodeSimple("workspace_id", payload.workspace_id, { - explode: false, - charEncoding: "percent", - }), + workspace_id: encodeSimple( + "workspace_id", + payload.workspace_id ?? client._options.workspaceId, + { explode: false, charEncoding: "percent" }, + ), }; const path = pathToFunc("/v1/workspace/{workspace_id}/events")(pathParams); const query = encodeFormQuery({ + "execution_id": payload.execution_id, "generate_gen_lock_id": payload.generate_gen_lock_id, "interaction_type": payload.interaction_type, + "limit": payload.limit, "lint_report_digest": payload.lint_report_digest, "openapi_diff_report_digest": payload.openapi_diff_report_digest, "source_revision_digest": payload.source_revision_digest, + "success": payload.success, }); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "searchWorkspaceEvents", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -91,19 +133,18 @@ export async function eventsSearch( timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -121,8 +162,8 @@ export async function eventsSearch( M.json("5XX", operations.SearchWorkspaceEventsResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/githubCheckAccess.ts b/src/funcs/githubCheckAccess.ts index 5e877c38..36d526b1 100644 --- a/src/funcs/githubCheckAccess.ts +++ b/src/funcs/githubCheckAccess.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } from "../core.js"; import { encodeFormQuery } 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"; @@ -20,13 +21,14 @@ import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; import * as shared from "../sdk/models/shared/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; -export async function githubCheckAccess( +export function githubCheckAccess( client: SpeakeasyCore, request: operations.CheckGithubAccessRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< shared.ErrorT | undefined, | SDKError @@ -37,6 +39,32 @@ export async function githubCheckAccess( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.CheckGithubAccessRequest, + options?: RequestOptions, +): Promise< + [ + Result< + shared.ErrorT | undefined, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -44,7 +72,7 @@ export async function githubCheckAccess( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; @@ -56,21 +84,31 @@ export async function githubCheckAccess( "repo": payload.repo, }); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "checkGithubAccess", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -78,19 +116,18 @@ export async function githubCheckAccess( timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -108,8 +145,8 @@ export async function githubCheckAccess( M.json("4XX", shared.ErrorT$inboundSchema.optional()), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/githubCheckPublishingPRs.ts b/src/funcs/githubCheckPublishingPRs.ts index 4317ba3e..05ec2069 100644 --- a/src/funcs/githubCheckPublishingPRs.ts +++ b/src/funcs/githubCheckPublishingPRs.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } from "../core.js"; import { encodeFormQuery } 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"; @@ -19,13 +20,14 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; -export async function githubCheckPublishingPRs( +export function githubCheckPublishingPRs( client: SpeakeasyCore, request: operations.GithubCheckPublishingPRsRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< operations.GithubCheckPublishingPRsResponse, | SDKError @@ -36,6 +38,32 @@ export async function githubCheckPublishingPRs( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.GithubCheckPublishingPRsRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GithubCheckPublishingPRsResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -44,7 +72,7 @@ export async function githubCheckPublishingPRs( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; @@ -57,21 +85,31 @@ export async function githubCheckPublishingPRs( "repo": payload.repo, }); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "githubCheckPublishingPRs", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -79,19 +117,18 @@ export async function githubCheckPublishingPRs( timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -109,8 +146,8 @@ export async function githubCheckPublishingPRs( M.json("4XX", operations.GithubCheckPublishingPRsResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/githubCheckPublishingSecrets.ts b/src/funcs/githubCheckPublishingSecrets.ts index 620b242a..c53e2241 100644 --- a/src/funcs/githubCheckPublishingSecrets.ts +++ b/src/funcs/githubCheckPublishingSecrets.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } from "../core.js"; import { encodeFormQuery } 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"; @@ -19,13 +20,14 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; -export async function githubCheckPublishingSecrets( +export function githubCheckPublishingSecrets( client: SpeakeasyCore, request: operations.GithubCheckPublishingSecretsRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< operations.GithubCheckPublishingSecretsResponse, | SDKError @@ -36,6 +38,32 @@ export async function githubCheckPublishingSecrets( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.GithubCheckPublishingSecretsRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GithubCheckPublishingSecretsResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -46,7 +74,7 @@ export async function githubCheckPublishingSecrets( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; @@ -57,21 +85,31 @@ export async function githubCheckPublishingSecrets( "generate_gen_lock_id": payload.generate_gen_lock_id, }); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "githubCheckPublishingSecrets", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -79,19 +117,18 @@ export async function githubCheckPublishingSecrets( timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -115,8 +152,8 @@ export async function githubCheckPublishingSecrets( ), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/githubConfigureCodeSamples.ts b/src/funcs/githubConfigureCodeSamples.ts index 1ef8330c..5bee5bf6 100644 --- a/src/funcs/githubConfigureCodeSamples.ts +++ b/src/funcs/githubConfigureCodeSamples.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } 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"; @@ -20,13 +21,14 @@ import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; import * as shared from "../sdk/models/shared/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; -export async function githubConfigureCodeSamples( +export function githubConfigureCodeSamples( client: SpeakeasyCore, request: shared.GithubConfigureCodeSamplesRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< operations.GithubConfigureCodeSamplesResponse, | SDKError @@ -37,6 +39,32 @@ export async function githubConfigureCodeSamples( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: shared.GithubConfigureCodeSamplesRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GithubConfigureCodeSamplesResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -45,48 +73,57 @@ export async function githubConfigureCodeSamples( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = encodeJSON("body", payload, { explode: true }); const path = pathToFunc("/v1/github/configure_code_samples")(); - const headers = new Headers({ + const headers = new Headers(compactMap({ "Content-Type": "application/json", Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "githubConfigureCodeSamples", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -104,8 +141,8 @@ export async function githubConfigureCodeSamples( M.json("4XX", operations.GithubConfigureCodeSamplesResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/githubConfigureMintlifyRepo.ts b/src/funcs/githubConfigureMintlifyRepo.ts index 1e997306..1782df3c 100644 --- a/src/funcs/githubConfigureMintlifyRepo.ts +++ b/src/funcs/githubConfigureMintlifyRepo.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } 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"; @@ -19,13 +20,14 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as shared from "../sdk/models/shared/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; -export async function githubConfigureMintlifyRepo( +export function githubConfigureMintlifyRepo( client: SpeakeasyCore, request: shared.GithubConfigureMintlifyRepoRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< shared.ErrorT | undefined, | SDKError @@ -36,6 +38,32 @@ export async function githubConfigureMintlifyRepo( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: shared.GithubConfigureMintlifyRepoRequest, + options?: RequestOptions, +): Promise< + [ + Result< + shared.ErrorT | undefined, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -44,48 +72,57 @@ export async function githubConfigureMintlifyRepo( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = encodeJSON("body", payload, { explode: true }); const path = pathToFunc("/v1/github/configure_mintlify_repo")(); - const headers = new Headers({ + const headers = new Headers(compactMap({ "Content-Type": "application/json", Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "githubConfigureMintlifyRepo", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -103,8 +140,8 @@ export async function githubConfigureMintlifyRepo( M.json("4XX", shared.ErrorT$inboundSchema.optional()), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/githubConfigureTarget.ts b/src/funcs/githubConfigureTarget.ts index d3e3960c..cabd3043 100644 --- a/src/funcs/githubConfigureTarget.ts +++ b/src/funcs/githubConfigureTarget.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } 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"; @@ -19,13 +20,14 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as shared from "../sdk/models/shared/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; -export async function githubConfigureTarget( +export function githubConfigureTarget( client: SpeakeasyCore, request: shared.GithubConfigureTargetRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< shared.ErrorT | undefined, | SDKError @@ -36,6 +38,32 @@ export async function githubConfigureTarget( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: shared.GithubConfigureTargetRequest, + options?: RequestOptions, +): Promise< + [ + Result< + shared.ErrorT | undefined, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -43,48 +71,57 @@ export async function githubConfigureTarget( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = encodeJSON("body", payload, { explode: true }); const path = pathToFunc("/v1/github/configure_target")(); - const headers = new Headers({ + const headers = new Headers(compactMap({ "Content-Type": "application/json", Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "githubConfigureTarget", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -102,8 +139,8 @@ export async function githubConfigureTarget( M.json("4XX", shared.ErrorT$inboundSchema.optional()), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/githubGetAction.ts b/src/funcs/githubGetAction.ts index df4fbc03..f85a0ace 100644 --- a/src/funcs/githubGetAction.ts +++ b/src/funcs/githubGetAction.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } from "../core.js"; import { encodeFormQuery } 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"; @@ -19,13 +20,14 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; -export async function githubGetAction( +export function githubGetAction( client: SpeakeasyCore, request: operations.GetGitHubActionRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< operations.GetGitHubActionResponse, | SDKError @@ -36,6 +38,32 @@ export async function githubGetAction( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.GetGitHubActionRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GetGitHubActionResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -43,7 +71,7 @@ export async function githubGetAction( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; @@ -56,21 +84,31 @@ export async function githubGetAction( "targetName": payload.targetName, }); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "getGitHubAction", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -78,19 +116,18 @@ export async function githubGetAction( timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -108,8 +145,8 @@ export async function githubGetAction( M.json("4XX", operations.GetGitHubActionResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/embedsGetEmbedAccessToken.ts b/src/funcs/githubGetSetup.ts similarity index 55% rename from src/funcs/embedsGetEmbedAccessToken.ts rename to src/funcs/githubGetSetup.ts index f3189273..3731e538 100644 --- a/src/funcs/embedsGetEmbedAccessToken.ts +++ b/src/funcs/githubGetSetup.ts @@ -3,12 +3,9 @@ */ import { SpeakeasyCore } from "../core.js"; -import { - encodeFormQuery, - encodeJSONQuery, - queryJoin, -} from "../lib/encodings.js"; +import { encodeFormQuery } 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"; @@ -23,22 +20,16 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; -/** - * Get an embed access token for the current workspace. - * - * @remarks - * Returns an embed access token for the current workspace. This can be used to authenticate access to externally embedded content. - * Filters can be applied allowing views to be filtered to things like particular customerIds. - */ -export async function embedsGetEmbedAccessToken( +export function githubGetSetup( client: SpeakeasyCore, - request: operations.GetEmbedAccessTokenRequest, + request: operations.GetGithubSetupStateRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< - operations.GetEmbedAccessTokenResponse, + operations.GetGithubSetupStateResponse, | SDKError | SDKValidationError | UnexpectedClientError @@ -47,46 +38,78 @@ export async function embedsGetEmbedAccessToken( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.GetGithubSetupStateRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GetGithubSetupStateResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, (value) => - operations.GetEmbedAccessTokenRequest$outboundSchema.parse(value), + operations.GetGithubSetupStateRequest$outboundSchema.parse(value), "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; - const path = pathToFunc("/v1/workspace/embed-access-token")(); + const path = pathToFunc("/v1/github/setup")(); - const query = queryJoin( - encodeFormQuery({ - "description": payload.description, - "duration": payload.duration, - }), - encodeJSONQuery({ - "filters": payload.filters, - }, { explode: false }), - ); + const query = encodeFormQuery({ + "generate_gen_lock_id": payload.generate_gen_lock_id, + "org": payload.org, + "repo": payload.repo, + }); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { - operationID: "getEmbedAccessToken", + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "getGithubSetupState", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -94,24 +117,23 @@ export async function embedsGetEmbedAccessToken( timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; const [result] = await M.match< - operations.GetEmbedAccessTokenResponse, + operations.GetGithubSetupStateResponse, | SDKError | SDKValidationError | UnexpectedClientError @@ -120,12 +142,12 @@ export async function embedsGetEmbedAccessToken( | RequestTimeoutError | ConnectionError >( - M.json("2XX", operations.GetEmbedAccessTokenResponse$inboundSchema), - M.json("4XX", operations.GetEmbedAccessTokenResponse$inboundSchema), + M.json("2XX", operations.GetGithubSetupStateResponse$inboundSchema), + M.json("4XX", operations.GetGithubSetupStateResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/embedsRevokeEmbedAccessToken.ts b/src/funcs/githubLinkGithub.ts similarity index 59% rename from src/funcs/embedsRevokeEmbedAccessToken.ts rename to src/funcs/githubLinkGithub.ts index 4bc26f23..360b059c 100644 --- a/src/funcs/embedsRevokeEmbedAccessToken.ts +++ b/src/funcs/githubLinkGithub.ts @@ -3,8 +3,9 @@ */ import { SpeakeasyCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; +import { encodeFormQuery } 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"; @@ -20,16 +21,14 @@ import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; import * as shared from "../sdk/models/shared/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; -/** - * Revoke an embed access EmbedToken. - */ -export async function embedsRevokeEmbedAccessToken( +export function githubLinkGithub( client: SpeakeasyCore, - request: operations.RevokeEmbedAccessTokenRequest, + request: operations.LinkGithubAccessRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< shared.ErrorT | undefined, | SDKError @@ -40,64 +39,96 @@ export async function embedsRevokeEmbedAccessToken( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.LinkGithubAccessRequest, + options?: RequestOptions, +): Promise< + [ + Result< + shared.ErrorT | undefined, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, - (value) => - operations.RevokeEmbedAccessTokenRequest$outboundSchema.parse(value), + (value) => operations.LinkGithubAccessRequest$outboundSchema.parse(value), "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; - const pathParams = { - tokenID: encodeSimple("tokenID", payload.tokenID, { - explode: false, - charEncoding: "percent", - }), - }; + const path = pathToFunc("/v1/github/link")(); - const path = pathToFunc("/v1/workspace/embed-access-tokens/{tokenID}")( - pathParams, - ); + const query = encodeFormQuery({ + "github_oidc_token": payload.github_oidc_token, + "github_org": payload.github_org, + "installation_id": payload.installation_id, + }); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { - operationID: "revokeEmbedAccessToken", + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "linkGithubAccess", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, - method: "DELETE", + method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, + query: query, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -115,8 +146,8 @@ export async function embedsRevokeEmbedAccessToken( M.json("4XX", shared.ErrorT$inboundSchema.optional()), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/githubStorePublishingSecrets.ts b/src/funcs/githubStorePublishingSecrets.ts index 1c839f36..2d9d2155 100644 --- a/src/funcs/githubStorePublishingSecrets.ts +++ b/src/funcs/githubStorePublishingSecrets.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } 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"; @@ -19,13 +20,14 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as shared from "../sdk/models/shared/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; -export async function githubStorePublishingSecrets( +export function githubStorePublishingSecrets( client: SpeakeasyCore, request: shared.GithubStorePublishingSecretsRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< shared.ErrorT | undefined, | SDKError @@ -36,6 +38,32 @@ export async function githubStorePublishingSecrets( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: shared.GithubStorePublishingSecretsRequest, + options?: RequestOptions, +): Promise< + [ + Result< + shared.ErrorT | undefined, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -44,48 +72,57 @@ export async function githubStorePublishingSecrets( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = encodeJSON("body", payload, { explode: true }); const path = pathToFunc("/v1/github/publishing_secrets")(); - const headers = new Headers({ + const headers = new Headers(compactMap({ "Content-Type": "application/json", Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "githubStorePublishingSecrets", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -103,8 +140,8 @@ export async function githubStorePublishingSecrets( M.json("4XX", shared.ErrorT$inboundSchema.optional()), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/githubTriggerAction.ts b/src/funcs/githubTriggerAction.ts index 56f58fe1..2bee1a26 100644 --- a/src/funcs/githubTriggerAction.ts +++ b/src/funcs/githubTriggerAction.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } 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"; @@ -19,13 +20,14 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as shared from "../sdk/models/shared/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; -export async function githubTriggerAction( +export function githubTriggerAction( client: SpeakeasyCore, request: shared.GithubTriggerActionRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< shared.ErrorT | undefined, | SDKError @@ -36,6 +38,32 @@ export async function githubTriggerAction( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: shared.GithubTriggerActionRequest, + options?: RequestOptions, +): Promise< + [ + Result< + shared.ErrorT | undefined, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -43,48 +71,57 @@ export async function githubTriggerAction( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = encodeJSON("body", payload, { explode: true }); const path = pathToFunc("/v1/github/trigger_action")(); - const headers = new Headers({ + const headers = new Headers(compactMap({ "Content-Type": "application/json", Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "githubTriggerAction", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -102,8 +139,8 @@ export async function githubTriggerAction( M.json("4XX", shared.ErrorT$inboundSchema.optional()), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/metadataGetVersionMetadata.ts b/src/funcs/metadataGetVersionMetadata.ts deleted file mode 100644 index b71a2b8c..00000000 --- a/src/funcs/metadataGetVersionMetadata.ts +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { SpeakeasyCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.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 "../sdk/models/errors/httpclienterrors.js"; -import { SDKError } from "../sdk/models/errors/sdkerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { Result } from "../sdk/types/fp.js"; - -/** - * Get all metadata for a particular apiID and versionID. - */ -export async function metadataGetVersionMetadata( - client: SpeakeasyCore, - request: operations.GetVersionMetadataRequest, - options?: RequestOptions, -): Promise< - Result< - operations.GetVersionMetadataResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - > -> { - const parsed = safeParse( - request, - (value) => operations.GetVersionMetadataRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return parsed; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - apiID: encodeSimple("apiID", payload.apiID, { - explode: false, - charEncoding: "percent", - }), - versionID: encodeSimple("versionID", payload.versionID, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/apis/{apiID}/version/{versionID}/metadata")( - pathParams, - ); - - const headers = new Headers({ - Accept: "application/json", - }); - - const securityInput = await extractSecurity(client._options.security); - const context = { - operationID: "getVersionMetadata", - oAuth2Scopes: [], - securitySource: client._options.security, - }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - path: path, - headers: headers, - body: body, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return requestRes; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }); - if (!doResult.ok) { - return doResult; - } - const response = doResult.value; - - const [result] = await M.match< - operations.GetVersionMetadataResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - >( - M.json("2XX", operations.GetVersionMetadataResponse$inboundSchema), - M.json("4XX", operations.GetVersionMetadataResponse$inboundSchema), - )(response); - if (!result.ok) { - return result; - } - - return result; -} diff --git a/src/funcs/organizationsCreate.ts b/src/funcs/organizationsCreate.ts index 7f9a5418..f9e36316 100644 --- a/src/funcs/organizationsCreate.ts +++ b/src/funcs/organizationsCreate.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } 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"; @@ -20,6 +21,7 @@ import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; import * as shared from "../sdk/models/shared/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** @@ -28,11 +30,11 @@ import { Result } from "../sdk/types/fp.js"; * @remarks * Creates an organization */ -export async function organizationsCreate( +export function organizationsCreate( client: SpeakeasyCore, request: shared.Organization, options?: RequestOptions, -): Promise< +): APIPromise< Result< operations.CreateOrganizationResponse, | SDKError @@ -43,6 +45,32 @@ export async function organizationsCreate( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: shared.Organization, + options?: RequestOptions, +): Promise< + [ + Result< + operations.CreateOrganizationResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -50,48 +78,57 @@ export async function organizationsCreate( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = encodeJSON("body", payload, { explode: true }); const path = pathToFunc("/v1/organization")(); - const headers = new Headers({ + const headers = new Headers(compactMap({ "Content-Type": "application/json", Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "createOrganization", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -109,8 +146,8 @@ export async function organizationsCreate( M.json("4XX", operations.CreateOrganizationResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/organizationsCreateBillingAddOns.ts b/src/funcs/organizationsCreateBillingAddOns.ts new file mode 100644 index 00000000..86059c10 --- /dev/null +++ b/src/funcs/organizationsCreateBillingAddOns.ts @@ -0,0 +1,151 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SpeakeasyCore } 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 "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import * as shared from "../sdk/models/shared/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Create billing add ons + */ +export function organizationsCreateBillingAddOns( + client: SpeakeasyCore, + request: shared.OrganizationBillingAddOnRequest, + options?: RequestOptions, +): APIPromise< + Result< + operations.CreateBillingAddOnsResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: shared.OrganizationBillingAddOnRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.CreateBillingAddOnsResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + shared.OrganizationBillingAddOnRequest$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/organization/add_ons")(); + + const headers = new Headers(compactMap({ + "Content-Type": "application/json", + Accept: "application/json", + })); + + const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "createBillingAddOns", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.security, + 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, + 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: [], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const [result] = await M.match< + operations.CreateBillingAddOnsResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + M.json(200, operations.CreateBillingAddOnsResponse$inboundSchema), + M.json("5XX", operations.CreateBillingAddOnsResponse$inboundSchema), + )(response); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/organizationsCreateFreeTrial.ts b/src/funcs/organizationsCreateFreeTrial.ts index ba8be038..54217bed 100644 --- a/src/funcs/organizationsCreateFreeTrial.ts +++ b/src/funcs/organizationsCreateFreeTrial.ts @@ -4,6 +4,7 @@ import { SpeakeasyCore } 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"; @@ -17,6 +18,7 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as shared from "../sdk/models/shared/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** @@ -25,10 +27,10 @@ import { Result } from "../sdk/types/fp.js"; * @remarks * Creates a free trial for an organization */ -export async function organizationsCreateFreeTrial( +export function organizationsCreateFreeTrial( client: SpeakeasyCore, options?: RequestOptions, -): Promise< +): APIPromise< Result< shared.ErrorT | undefined, | SDKError @@ -39,42 +41,75 @@ export async function organizationsCreateFreeTrial( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + options?: RequestOptions, +): Promise< + [ + Result< + shared.ErrorT | undefined, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const path = pathToFunc("/v1/organization/free_trial")(); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "createFreeTrial", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -92,8 +127,8 @@ export async function organizationsCreateFreeTrial( M.json("4XX", shared.ErrorT$inboundSchema.optional()), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/apisDeleteApi.ts b/src/funcs/organizationsDeleteBillingAddOn.ts similarity index 60% rename from src/funcs/apisDeleteApi.ts rename to src/funcs/organizationsDeleteBillingAddOn.ts index d21577a3..979787ff 100644 --- a/src/funcs/apisDeleteApi.ts +++ b/src/funcs/organizationsDeleteBillingAddOn.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } 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"; @@ -20,19 +21,17 @@ import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; import * as shared from "../sdk/models/shared/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** - * Delete an Api. - * - * @remarks - * Delete a particular version of an Api. The will also delete all associated ApiEndpoints, Metadata, Schemas & Request Logs (if using a Postgres datastore). + * Delete billing add ons */ -export async function apisDeleteApi( +export function organizationsDeleteBillingAddOn( client: SpeakeasyCore, - request: operations.DeleteApiRequest, + request: operations.DeleteBillingAddOnRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< shared.ErrorT | undefined, | SDKError @@ -43,65 +42,96 @@ export async function apisDeleteApi( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.DeleteBillingAddOnRequest, + options?: RequestOptions, +): Promise< + [ + Result< + shared.ErrorT | undefined, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, - (value) => operations.DeleteApiRequest$outboundSchema.parse(value), + (value) => operations.DeleteBillingAddOnRequest$outboundSchema.parse(value), "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; const pathParams = { - apiID: encodeSimple("apiID", payload.apiID, { - explode: false, - charEncoding: "percent", - }), - versionID: encodeSimple("versionID", payload.versionID, { + add_on: encodeSimple("add_on", payload.add_on, { explode: false, charEncoding: "percent", }), }; - const path = pathToFunc("/v1/apis/{apiID}/version/{versionID}")(pathParams); + const path = pathToFunc("/v1/organization/add_ons/{add_on}")(pathParams); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { - operationID: "deleteApi", + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "deleteBillingAddOn", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "DELETE", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -115,12 +145,12 @@ export async function apisDeleteApi( | RequestTimeoutError | ConnectionError >( - M.nil("2XX", shared.ErrorT$inboundSchema.optional()), - M.json("4XX", shared.ErrorT$inboundSchema.optional()), + M.nil(200, shared.ErrorT$inboundSchema.optional()), + M.json("5XX", shared.ErrorT$inboundSchema.optional()), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/organizationsGet.ts b/src/funcs/organizationsGet.ts index 60defbdd..e4d37b8a 100644 --- a/src/funcs/organizationsGet.ts +++ b/src/funcs/organizationsGet.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } 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"; @@ -19,6 +20,7 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** @@ -27,11 +29,11 @@ import { Result } from "../sdk/types/fp.js"; * @remarks * Get information about a particular organization. */ -export async function organizationsGet( +export function organizationsGet( client: SpeakeasyCore, request: operations.GetOrganizationRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< operations.GetOrganizationResponse, | SDKError @@ -42,6 +44,32 @@ export async function organizationsGet( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.GetOrganizationRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GetOrganizationResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -49,7 +77,7 @@ export async function organizationsGet( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; @@ -63,40 +91,49 @@ export async function organizationsGet( const path = pathToFunc("/v1/organization/{organizationID}")(pathParams); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "getOrganization", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -114,8 +151,8 @@ export async function organizationsGet( M.json("4XX", operations.GetOrganizationResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/organizationsGetAll.ts b/src/funcs/organizationsGetAll.ts index 7db89b42..8d2e1282 100644 --- a/src/funcs/organizationsGetAll.ts +++ b/src/funcs/organizationsGetAll.ts @@ -4,6 +4,7 @@ import { SpeakeasyCore } 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"; @@ -17,6 +18,7 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** @@ -25,10 +27,10 @@ import { Result } from "../sdk/types/fp.js"; * @remarks * Returns a list of organizations a user has access too */ -export async function organizationsGetAll( +export function organizationsGetAll( client: SpeakeasyCore, options?: RequestOptions, -): Promise< +): APIPromise< Result< operations.GetOrganizationsResponse, | SDKError @@ -39,42 +41,75 @@ export async function organizationsGetAll( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GetOrganizationsResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const path = pathToFunc("/v1/organizations")(); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "getOrganizations", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -92,8 +127,8 @@ export async function organizationsGetAll( M.json("4XX", operations.GetOrganizationsResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/apiEndpointsGetApiEndpoint.ts b/src/funcs/organizationsGetBillingAddOns.ts similarity index 58% rename from src/funcs/apiEndpointsGetApiEndpoint.ts rename to src/funcs/organizationsGetBillingAddOns.ts index 3d21206a..11a77330 100644 --- a/src/funcs/apiEndpointsGetApiEndpoint.ts +++ b/src/funcs/organizationsGetBillingAddOns.ts @@ -3,9 +3,8 @@ */ import { SpeakeasyCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; import * as M from "../lib/matchers.js"; -import { safeParse } from "../lib/schemas.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"; @@ -19,18 +18,18 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** - * Get an ApiEndpoint. + * Get billing add ons */ -export async function apiEndpointsGetApiEndpoint( +export function organizationsGetBillingAddOns( client: SpeakeasyCore, - request: operations.GetApiEndpointRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< - operations.GetApiEndpointResponse, + operations.GetBillingAddOnsResponse, | SDKError | SDKValidationError | UnexpectedClientError @@ -40,75 +39,79 @@ export async function apiEndpointsGetApiEndpoint( | ConnectionError > > { - const parsed = safeParse( - request, - (value) => operations.GetApiEndpointRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return parsed; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - apiEndpointID: encodeSimple("apiEndpointID", payload.apiEndpointID, { - explode: false, - charEncoding: "percent", - }), - apiID: encodeSimple("apiID", payload.apiID, { - explode: false, - charEncoding: "percent", - }), - versionID: encodeSimple("versionID", payload.versionID, { - explode: false, - charEncoding: "percent", - }), - }; + return new APIPromise($do( + client, + options, + )); +} - const path = pathToFunc( - "/v1/apis/{apiID}/version/{versionID}/api_endpoints/{apiEndpointID}", - )(pathParams); +async function $do( + client: SpeakeasyCore, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GetBillingAddOnsResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] +> { + const path = pathToFunc("/v1/organization/add_ons")(); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { - operationID: "getApiEndpoint", + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "getBillingAddOns", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, - body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; const [result] = await M.match< - operations.GetApiEndpointResponse, + operations.GetBillingAddOnsResponse, | SDKError | SDKValidationError | UnexpectedClientError @@ -117,12 +120,12 @@ export async function apiEndpointsGetApiEndpoint( | RequestTimeoutError | ConnectionError >( - M.json("2XX", operations.GetApiEndpointResponse$inboundSchema), - M.json("4XX", operations.GetApiEndpointResponse$inboundSchema), + M.json(200, operations.GetBillingAddOnsResponse$inboundSchema), + M.json("5XX", operations.GetBillingAddOnsResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/organizationsGetUsage.ts b/src/funcs/organizationsGetUsage.ts index f08717f7..e67d93b4 100644 --- a/src/funcs/organizationsGetUsage.ts +++ b/src/funcs/organizationsGetUsage.ts @@ -4,6 +4,7 @@ import { SpeakeasyCore } 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"; @@ -17,6 +18,7 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** @@ -25,10 +27,10 @@ import { Result } from "../sdk/types/fp.js"; * @remarks * Returns a billing usage summary by target languages for a particular organization */ -export async function organizationsGetUsage( +export function organizationsGetUsage( client: SpeakeasyCore, options?: RequestOptions, -): Promise< +): APIPromise< Result< operations.GetOrganizationUsageResponse, | SDKError @@ -39,42 +41,75 @@ export async function organizationsGetUsage( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GetOrganizationUsageResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const path = pathToFunc("/v1/organization/usage")(); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "getOrganizationUsage", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -92,8 +127,8 @@ export async function organizationsGetUsage( M.json("4XX", operations.GetOrganizationUsageResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/reportsGetChangesReportSignedUrl.ts b/src/funcs/reportsGetChangesReportSignedUrl.ts index 8c1312e2..dc80ca62 100644 --- a/src/funcs/reportsGetChangesReportSignedUrl.ts +++ b/src/funcs/reportsGetChangesReportSignedUrl.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } 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"; @@ -19,16 +20,17 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** * Get the signed access url for the change reports for a particular document. */ -export async function reportsGetChangesReportSignedUrl( +export function reportsGetChangesReportSignedUrl( client: SpeakeasyCore, request: operations.GetChangesReportSignedUrlRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< operations.GetChangesReportSignedUrlSignedAccess, | SDKError @@ -39,6 +41,32 @@ export async function reportsGetChangesReportSignedUrl( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.GetChangesReportSignedUrlRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GetChangesReportSignedUrlSignedAccess, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -47,7 +75,7 @@ export async function reportsGetChangesReportSignedUrl( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; @@ -62,40 +90,49 @@ export async function reportsGetChangesReportSignedUrl( const path = pathToFunc("/v1/reports/changes/{documentChecksum}")(pathParams); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "getChangesReportSignedUrl", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -115,8 +152,8 @@ export async function reportsGetChangesReportSignedUrl( ), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/reportsGetLintingReportSignedUrl.ts b/src/funcs/reportsGetLintingReportSignedUrl.ts index 69525dfb..00c304b2 100644 --- a/src/funcs/reportsGetLintingReportSignedUrl.ts +++ b/src/funcs/reportsGetLintingReportSignedUrl.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } 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"; @@ -19,16 +20,17 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** * Get the signed access url for the linting reports for a particular document. */ -export async function reportsGetLintingReportSignedUrl( +export function reportsGetLintingReportSignedUrl( client: SpeakeasyCore, request: operations.GetLintingReportSignedUrlRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< operations.GetLintingReportSignedUrlSignedAccess, | SDKError @@ -39,6 +41,32 @@ export async function reportsGetLintingReportSignedUrl( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.GetLintingReportSignedUrlRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GetLintingReportSignedUrlSignedAccess, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -47,7 +75,7 @@ export async function reportsGetLintingReportSignedUrl( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; @@ -62,40 +90,49 @@ export async function reportsGetLintingReportSignedUrl( const path = pathToFunc("/v1/reports/linting/{documentChecksum}")(pathParams); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "getLintingReportSignedUrl", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -115,8 +152,8 @@ export async function reportsGetLintingReportSignedUrl( ), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/reportsUploadReport.ts b/src/funcs/reportsUploadReport.ts index 55680bd4..8eb3d45a 100644 --- a/src/funcs/reportsUploadReport.ts +++ b/src/funcs/reportsUploadReport.ts @@ -3,9 +3,10 @@ */ import { SpeakeasyCore } from "../core.js"; -import { encodeJSON } from "../lib/encodings.js"; +import { appendForm, encodeJSON } from "../lib/encodings.js"; import { readableStreamToArrayBuffer } from "../lib/files.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"; @@ -20,6 +21,7 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { isBlobLike } from "../sdk/types/blobs.js"; import { Result } from "../sdk/types/fp.js"; import { isReadableStream } from "../sdk/types/streams.js"; @@ -27,11 +29,11 @@ import { isReadableStream } from "../sdk/types/streams.js"; /** * Upload a report. */ -export async function reportsUploadReport( +export function reportsUploadReport( client: SpeakeasyCore, request: operations.UploadReportRequestBody, options?: RequestOptions, -): Promise< +): APIPromise< Result< operations.UploadReportUploadedReport, | SDKError @@ -42,6 +44,32 @@ export async function reportsUploadReport( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.UploadReportRequestBody, + options?: RequestOptions, +): Promise< + [ + Result< + operations.UploadReportUploadedReport, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -49,20 +77,21 @@ export async function reportsUploadReport( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = new FormData(); - body.append("data", encodeJSON("data", payload.data, { explode: true })); + appendForm(body, "data", encodeJSON("data", payload.data, { explode: true })); if (isBlobLike(payload.file)) { - body.append("file", payload.file); + appendForm(body, "file", payload.file); } else if (isReadableStream(payload.file.content)) { const buffer = await readableStreamToArrayBuffer(payload.file.content); const blob = new Blob([buffer], { type: "application/octet-stream" }); - body.append("file", blob); + appendForm(body, "file", blob); } else { - body.append( + appendForm( + body, "file", new Blob([payload.file.content], { type: "application/octet-stream" }), payload.file.fileName, @@ -71,40 +100,49 @@ export async function reportsUploadReport( const path = pathToFunc("/v1/reports")(); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "uploadReport", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -121,8 +159,8 @@ export async function reportsUploadReport( M.json("2XX", operations.UploadReportUploadedReport$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/requestsGenerateRequestPostmanCollection.ts b/src/funcs/requestsGenerateRequestPostmanCollection.ts deleted file mode 100644 index d36f3b87..00000000 --- a/src/funcs/requestsGenerateRequestPostmanCollection.ts +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { SpeakeasyCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.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 "../sdk/models/errors/httpclienterrors.js"; -import { SDKError } from "../sdk/models/errors/sdkerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { Result } from "../sdk/types/fp.js"; - -export enum GenerateRequestPostmanCollectionAcceptEnum { - applicationJson = "application/json", - applicationOctetStream = "application/octet-stream", -} - -/** - * Generate a Postman collection for a particular request. - * - * @remarks - * Generates a Postman collection for a particular request. - * Allowing it to be replayed with the same inputs that were captured by the SDK. - */ -export async function requestsGenerateRequestPostmanCollection( - client: SpeakeasyCore, - request: operations.GenerateRequestPostmanCollectionRequest, - options?: RequestOptions & { - acceptHeaderOverride?: GenerateRequestPostmanCollectionAcceptEnum; - }, -): Promise< - Result< - operations.GenerateRequestPostmanCollectionResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - > -> { - const parsed = safeParse( - request, - (value) => - operations.GenerateRequestPostmanCollectionRequest$outboundSchema.parse( - value, - ), - "Input validation failed", - ); - if (!parsed.ok) { - return parsed; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - requestID: encodeSimple("requestID", payload.requestID, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/eventlog/{requestID}/generate/postman")( - pathParams, - ); - - const headers = new Headers({ - Accept: options?.acceptHeaderOverride - || "application/json;q=1, application/octet-stream;q=0", - }); - - const securityInput = await extractSecurity(client._options.security); - const context = { - operationID: "generateRequestPostmanCollection", - oAuth2Scopes: [], - securitySource: client._options.security, - }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - path: path, - headers: headers, - body: body, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return requestRes; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }); - if (!doResult.ok) { - return doResult; - } - const response = doResult.value; - - const [result] = await M.match< - operations.GenerateRequestPostmanCollectionResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - >( - M.stream( - "2XX", - operations.GenerateRequestPostmanCollectionResponse$inboundSchema, - ), - M.json( - "4XX", - operations.GenerateRequestPostmanCollectionResponse$inboundSchema, - ), - )(response); - if (!result.ok) { - return result; - } - - return result; -} diff --git a/src/funcs/requestsGetRequestFromEventLog.ts b/src/funcs/requestsGetRequestFromEventLog.ts deleted file mode 100644 index c57121c1..00000000 --- a/src/funcs/requestsGetRequestFromEventLog.ts +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { SpeakeasyCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.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 "../sdk/models/errors/httpclienterrors.js"; -import { SDKError } from "../sdk/models/errors/sdkerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { Result } from "../sdk/types/fp.js"; - -/** - * Get information about a particular request. - */ -export async function requestsGetRequestFromEventLog( - client: SpeakeasyCore, - request: operations.GetRequestFromEventLogRequest, - options?: RequestOptions, -): Promise< - Result< - operations.GetRequestFromEventLogResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - > -> { - const parsed = safeParse( - request, - (value) => - operations.GetRequestFromEventLogRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return parsed; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - requestID: encodeSimple("requestID", payload.requestID, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/eventlog/{requestID}")(pathParams); - - const headers = new Headers({ - Accept: "application/json", - }); - - const securityInput = await extractSecurity(client._options.security); - const context = { - operationID: "getRequestFromEventLog", - oAuth2Scopes: [], - securitySource: client._options.security, - }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - path: path, - headers: headers, - body: body, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return requestRes; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }); - if (!doResult.ok) { - return doResult; - } - const response = doResult.value; - - const [result] = await M.match< - operations.GetRequestFromEventLogResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - >( - M.json("2XX", operations.GetRequestFromEventLogResponse$inboundSchema), - M.json("4XX", operations.GetRequestFromEventLogResponse$inboundSchema), - )(response); - if (!result.ok) { - return result; - } - - return result; -} diff --git a/src/funcs/apisUpsertApi.ts b/src/funcs/schemaStoreCreateSchemaStoreItem.ts similarity index 54% rename from src/funcs/apisUpsertApi.ts rename to src/funcs/schemaStoreCreateSchemaStoreItem.ts index e3cd1628..e7cb56b7 100644 --- a/src/funcs/apisUpsertApi.ts +++ b/src/funcs/schemaStoreCreateSchemaStoreItem.ts @@ -3,8 +3,9 @@ */ import { SpeakeasyCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.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"; @@ -19,22 +20,19 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** - * Upsert an Api - * - * @remarks - * Upsert an Api. If the Api does not exist, it will be created. - * If the Api exists, it will be updated. + * Create a schema in the schema store */ -export async function apisUpsertApi( +export function schemaStoreCreateSchemaStoreItem( client: SpeakeasyCore, - request: operations.UpsertApiRequest, + request: operations.CreateSchemaStoreItemRequestBody, options?: RequestOptions, -): Promise< +): APIPromise< Result< - operations.UpsertApiResponse, + operations.CreateSchemaStoreItemResponse, | SDKError | SDKValidationError | UnexpectedClientError @@ -43,67 +41,96 @@ export async function apisUpsertApi( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.CreateSchemaStoreItemRequestBody, + options?: RequestOptions, +): Promise< + [ + Result< + operations.CreateSchemaStoreItemResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, - (value) => operations.UpsertApiRequest$outboundSchema.parse(value), + (value) => + operations.CreateSchemaStoreItemRequestBody$outboundSchema.parse(value), "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; - const body = encodeJSON("body", payload.Api, { explode: true }); - - const pathParams = { - apiID: encodeSimple("apiID", payload.apiID, { - explode: false, - charEncoding: "percent", - }), - }; + const body = encodeJSON("body", payload, { explode: true }); - const path = pathToFunc("/v1/apis/{apiID}")(pathParams); + const path = pathToFunc("/v1/schema_store")(); - const headers = new Headers({ + const headers = new Headers(compactMap({ "Content-Type": "application/json", Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { - operationID: "upsertApi", + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "createSchemaStoreItem", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, - method: "PUT", + method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; const [result] = await M.match< - operations.UpsertApiResponse, + operations.CreateSchemaStoreItemResponse, | SDKError | SDKValidationError | UnexpectedClientError @@ -112,12 +139,12 @@ export async function apisUpsertApi( | RequestTimeoutError | ConnectionError >( - M.json("2XX", operations.UpsertApiResponse$inboundSchema), - M.json("4XX", operations.UpsertApiResponse$inboundSchema), + M.json("2XX", operations.CreateSchemaStoreItemResponse$inboundSchema), + M.json("4XX", operations.CreateSchemaStoreItemResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/schemasDownloadSchema.ts b/src/funcs/schemasDownloadSchema.ts deleted file mode 100644 index 0ee28402..00000000 --- a/src/funcs/schemasDownloadSchema.ts +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { SpeakeasyCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.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 "../sdk/models/errors/httpclienterrors.js"; -import { SDKError } from "../sdk/models/errors/sdkerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { Result } from "../sdk/types/fp.js"; - -export enum DownloadSchemaAcceptEnum { - applicationJson = "application/json", - applicationXYaml = "application/x-yaml", -} - -/** - * Download the latest schema for a particular apiID. - */ -export async function schemasDownloadSchema( - client: SpeakeasyCore, - request: operations.DownloadSchemaRequest, - options?: RequestOptions & { - acceptHeaderOverride?: DownloadSchemaAcceptEnum; - }, -): Promise< - Result< - operations.DownloadSchemaResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - > -> { - const parsed = safeParse( - request, - (value) => operations.DownloadSchemaRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return parsed; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - apiID: encodeSimple("apiID", payload.apiID, { - explode: false, - charEncoding: "percent", - }), - versionID: encodeSimple("versionID", payload.versionID, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc( - "/v1/apis/{apiID}/version/{versionID}/schema/download", - )(pathParams); - - const headers = new Headers({ - Accept: options?.acceptHeaderOverride - || "application/json;q=1, application/x-yaml;q=0", - }); - - const securityInput = await extractSecurity(client._options.security); - const context = { - operationID: "downloadSchema", - oAuth2Scopes: [], - securitySource: client._options.security, - }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - path: path, - headers: headers, - body: body, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return requestRes; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }); - if (!doResult.ok) { - return doResult; - } - const response = doResult.value; - - const [result] = await M.match< - operations.DownloadSchemaResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - >( - M.stream("2XX", operations.DownloadSchemaResponse$inboundSchema, { - ctype: "application/json", - }), - M.stream("2XX", operations.DownloadSchemaResponse$inboundSchema, { - ctype: "application/x-yaml", - }), - M.json("4XX", operations.DownloadSchemaResponse$inboundSchema), - )(response); - if (!result.ok) { - return result; - } - - return result; -} diff --git a/src/funcs/schemasDownloadSchemaRevision.ts b/src/funcs/schemasDownloadSchemaRevision.ts deleted file mode 100644 index e922b32e..00000000 --- a/src/funcs/schemasDownloadSchemaRevision.ts +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { SpeakeasyCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.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 "../sdk/models/errors/httpclienterrors.js"; -import { SDKError } from "../sdk/models/errors/sdkerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { Result } from "../sdk/types/fp.js"; - -export enum DownloadSchemaRevisionAcceptEnum { - applicationJson = "application/json", - applicationXYaml = "application/x-yaml", -} - -/** - * Download a particular schema revision for an Api. - */ -export async function schemasDownloadSchemaRevision( - client: SpeakeasyCore, - request: operations.DownloadSchemaRevisionRequest, - options?: RequestOptions & { - acceptHeaderOverride?: DownloadSchemaRevisionAcceptEnum; - }, -): Promise< - Result< - operations.DownloadSchemaRevisionResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - > -> { - const parsed = safeParse( - request, - (value) => - operations.DownloadSchemaRevisionRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return parsed; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - apiID: encodeSimple("apiID", payload.apiID, { - explode: false, - charEncoding: "percent", - }), - revisionID: encodeSimple("revisionID", payload.revisionID, { - explode: false, - charEncoding: "percent", - }), - versionID: encodeSimple("versionID", payload.versionID, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc( - "/v1/apis/{apiID}/version/{versionID}/schema/{revisionID}/download", - )(pathParams); - - const headers = new Headers({ - Accept: options?.acceptHeaderOverride - || "application/json;q=1, application/x-yaml;q=0", - }); - - const securityInput = await extractSecurity(client._options.security); - const context = { - operationID: "downloadSchemaRevision", - oAuth2Scopes: [], - securitySource: client._options.security, - }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - path: path, - headers: headers, - body: body, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return requestRes; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }); - if (!doResult.ok) { - return doResult; - } - const response = doResult.value; - - const [result] = await M.match< - operations.DownloadSchemaRevisionResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - >( - M.stream("2XX", operations.DownloadSchemaRevisionResponse$inboundSchema, { - ctype: "application/json", - }), - M.stream("2XX", operations.DownloadSchemaRevisionResponse$inboundSchema, { - ctype: "application/x-yaml", - }), - M.json("4XX", operations.DownloadSchemaRevisionResponse$inboundSchema), - )(response); - if (!result.ok) { - return result; - } - - return result; -} diff --git a/src/funcs/schemasGetSchema.ts b/src/funcs/schemasGetSchema.ts deleted file mode 100644 index 2fe4d85b..00000000 --- a/src/funcs/schemasGetSchema.ts +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { SpeakeasyCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.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 "../sdk/models/errors/httpclienterrors.js"; -import { SDKError } from "../sdk/models/errors/sdkerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { Result } from "../sdk/types/fp.js"; - -/** - * Get information about the latest schema. - * - * @remarks - * Returns information about the last uploaded schema for a particular API version. - * This won't include the schema itself, that can be retrieved via the downloadSchema operation. - */ -export async function schemasGetSchema( - client: SpeakeasyCore, - request: operations.GetSchemaRequest, - options?: RequestOptions, -): Promise< - Result< - operations.GetSchemaResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - > -> { - const parsed = safeParse( - request, - (value) => operations.GetSchemaRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return parsed; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - apiID: encodeSimple("apiID", payload.apiID, { - explode: false, - charEncoding: "percent", - }), - versionID: encodeSimple("versionID", payload.versionID, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/apis/{apiID}/version/{versionID}/schema")( - pathParams, - ); - - const headers = new Headers({ - Accept: "application/json", - }); - - const securityInput = await extractSecurity(client._options.security); - const context = { - operationID: "getSchema", - oAuth2Scopes: [], - securitySource: client._options.security, - }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - path: path, - headers: headers, - body: body, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return requestRes; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }); - if (!doResult.ok) { - return doResult; - } - const response = doResult.value; - - const [result] = await M.match< - operations.GetSchemaResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - >( - M.json("2XX", operations.GetSchemaResponse$inboundSchema), - M.json("4XX", operations.GetSchemaResponse$inboundSchema), - )(response); - if (!result.ok) { - return result; - } - - return result; -} diff --git a/src/funcs/schemasGetSchemaDiff.ts b/src/funcs/schemasGetSchemaDiff.ts deleted file mode 100644 index 3d25c208..00000000 --- a/src/funcs/schemasGetSchemaDiff.ts +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { SpeakeasyCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.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 "../sdk/models/errors/httpclienterrors.js"; -import { SDKError } from "../sdk/models/errors/sdkerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { Result } from "../sdk/types/fp.js"; - -/** - * Get a diff of two schema revisions for an Api. - */ -export async function schemasGetSchemaDiff( - client: SpeakeasyCore, - request: operations.GetSchemaDiffRequest, - options?: RequestOptions, -): Promise< - Result< - operations.GetSchemaDiffResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - > -> { - const parsed = safeParse( - request, - (value) => operations.GetSchemaDiffRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return parsed; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - apiID: encodeSimple("apiID", payload.apiID, { - explode: false, - charEncoding: "percent", - }), - baseRevisionID: encodeSimple("baseRevisionID", payload.baseRevisionID, { - explode: false, - charEncoding: "percent", - }), - targetRevisionID: encodeSimple( - "targetRevisionID", - payload.targetRevisionID, - { explode: false, charEncoding: "percent" }, - ), - versionID: encodeSimple("versionID", payload.versionID, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc( - "/v1/apis/{apiID}/version/{versionID}/schema/{baseRevisionID}/diff/{targetRevisionID}", - )(pathParams); - - const headers = new Headers({ - Accept: "application/json", - }); - - const securityInput = await extractSecurity(client._options.security); - const context = { - operationID: "getSchemaDiff", - oAuth2Scopes: [], - securitySource: client._options.security, - }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - path: path, - headers: headers, - body: body, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return requestRes; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }); - if (!doResult.ok) { - return doResult; - } - const response = doResult.value; - - const [result] = await M.match< - operations.GetSchemaDiffResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - >( - M.json("2XX", operations.GetSchemaDiffResponse$inboundSchema), - M.json("4XX", operations.GetSchemaDiffResponse$inboundSchema), - )(response); - if (!result.ok) { - return result; - } - - return result; -} diff --git a/src/funcs/schemasGetSchemaRevision.ts b/src/funcs/schemasGetSchemaRevision.ts deleted file mode 100644 index 6b58f3f7..00000000 --- a/src/funcs/schemasGetSchemaRevision.ts +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { SpeakeasyCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.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 "../sdk/models/errors/httpclienterrors.js"; -import { SDKError } from "../sdk/models/errors/sdkerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { Result } from "../sdk/types/fp.js"; - -/** - * Get information about a particular schema revision for an Api. - * - * @remarks - * Returns information about the last uploaded schema for a particular schema revision. - * This won't include the schema itself, that can be retrieved via the downloadSchema operation. - */ -export async function schemasGetSchemaRevision( - client: SpeakeasyCore, - request: operations.GetSchemaRevisionRequest, - options?: RequestOptions, -): Promise< - Result< - operations.GetSchemaRevisionResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - > -> { - const parsed = safeParse( - request, - (value) => operations.GetSchemaRevisionRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return parsed; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - apiID: encodeSimple("apiID", payload.apiID, { - explode: false, - charEncoding: "percent", - }), - revisionID: encodeSimple("revisionID", payload.revisionID, { - explode: false, - charEncoding: "percent", - }), - versionID: encodeSimple("versionID", payload.versionID, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc( - "/v1/apis/{apiID}/version/{versionID}/schema/{revisionID}", - )(pathParams); - - const headers = new Headers({ - Accept: "application/json", - }); - - const securityInput = await extractSecurity(client._options.security); - const context = { - operationID: "getSchemaRevision", - oAuth2Scopes: [], - securitySource: client._options.security, - }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - path: path, - headers: headers, - body: body, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return requestRes; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }); - if (!doResult.ok) { - return doResult; - } - const response = doResult.value; - - const [result] = await M.match< - operations.GetSchemaRevisionResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - >( - M.json("2XX", operations.GetSchemaRevisionResponse$inboundSchema), - M.json("4XX", operations.GetSchemaRevisionResponse$inboundSchema), - )(response); - if (!result.ok) { - return result; - } - - return result; -} diff --git a/src/funcs/schemasGetSchemas.ts b/src/funcs/schemasGetSchemas.ts deleted file mode 100644 index 3dbc656c..00000000 --- a/src/funcs/schemasGetSchemas.ts +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { SpeakeasyCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.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 "../sdk/models/errors/httpclienterrors.js"; -import { SDKError } from "../sdk/models/errors/sdkerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { Result } from "../sdk/types/fp.js"; - -/** - * Get information about all schemas associated with a particular apiID. - * - * @remarks - * Returns information the schemas associated with a particular apiID. - * This won't include the schemas themselves, they can be retrieved via the downloadSchema operation. - */ -export async function schemasGetSchemas( - client: SpeakeasyCore, - request: operations.GetSchemasRequest, - options?: RequestOptions, -): Promise< - Result< - operations.GetSchemasResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - > -> { - const parsed = safeParse( - request, - (value) => operations.GetSchemasRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return parsed; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - apiID: encodeSimple("apiID", payload.apiID, { - explode: false, - charEncoding: "percent", - }), - versionID: encodeSimple("versionID", payload.versionID, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/apis/{apiID}/version/{versionID}/schemas")( - pathParams, - ); - - const headers = new Headers({ - Accept: "application/json", - }); - - const securityInput = await extractSecurity(client._options.security); - const context = { - operationID: "getSchemas", - oAuth2Scopes: [], - securitySource: client._options.security, - }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - path: path, - headers: headers, - body: body, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return requestRes; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], - }); - if (!doResult.ok) { - return doResult; - } - const response = doResult.value; - - const [result] = await M.match< - operations.GetSchemasResponse, - | SDKError - | SDKValidationError - | UnexpectedClientError - | InvalidRequestError - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - >( - M.json("2XX", operations.GetSchemasResponse$inboundSchema), - M.json("4XX", operations.GetSchemasResponse$inboundSchema), - )(response); - if (!result.ok) { - return result; - } - - return result; -} diff --git a/src/funcs/shortURLsCreate.ts b/src/funcs/shortURLsCreate.ts index 4f378f37..ecbefeaf 100644 --- a/src/funcs/shortURLsCreate.ts +++ b/src/funcs/shortURLsCreate.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } 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"; @@ -20,16 +21,17 @@ import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; import * as shared from "../sdk/models/shared/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** * Shorten a URL. */ -export async function shortURLsCreate( +export function shortURLsCreate( client: SpeakeasyCore, request: operations.CreateRequestBody, options?: RequestOptions, -): Promise< +): APIPromise< Result< shared.ShortURL, | SDKError @@ -40,6 +42,32 @@ export async function shortURLsCreate( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.CreateRequestBody, + options?: RequestOptions, +): Promise< + [ + Result< + shared.ShortURL, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -47,48 +75,57 @@ export async function shortURLsCreate( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = encodeJSON("body", payload, { explode: true }); const path = pathToFunc("/v1/short_urls")(); - const headers = new Headers({ + const headers = new Headers(compactMap({ "Content-Type": "application/json", Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "create", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -105,8 +142,8 @@ export async function shortURLsCreate( M.json("2XX", shared.ShortURL$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/schemasDeleteSchema.ts b/src/funcs/subscriptionsActivateSubscriptionNamespace.ts similarity index 60% rename from src/funcs/schemasDeleteSchema.ts rename to src/funcs/subscriptionsActivateSubscriptionNamespace.ts index 8b626e0d..7faab502 100644 --- a/src/funcs/schemasDeleteSchema.ts +++ b/src/funcs/subscriptionsActivateSubscriptionNamespace.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } 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"; @@ -20,16 +21,17 @@ import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; import * as shared from "../sdk/models/shared/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** - * Delete a particular schema revision for an Api. + * Activate an ignored namespace for a subscription */ -export async function schemasDeleteSchema( +export function subscriptionsActivateSubscriptionNamespace( client: SpeakeasyCore, - request: operations.DeleteSchemaRequest, + request: operations.ActivateSubscriptionNamespaceRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< shared.ErrorT | undefined, | SDKError @@ -40,71 +42,105 @@ export async function schemasDeleteSchema( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.ActivateSubscriptionNamespaceRequest, + options?: RequestOptions, +): Promise< + [ + Result< + shared.ErrorT | undefined, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, - (value) => operations.DeleteSchemaRequest$outboundSchema.parse(value), + (value) => + operations.ActivateSubscriptionNamespaceRequest$outboundSchema.parse( + value, + ), "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; const pathParams = { - apiID: encodeSimple("apiID", payload.apiID, { - explode: false, - charEncoding: "percent", - }), - revisionID: encodeSimple("revisionID", payload.revisionID, { + namespaceName: encodeSimple("namespaceName", payload.namespaceName, { explode: false, charEncoding: "percent", }), - versionID: encodeSimple("versionID", payload.versionID, { + subscriptionID: encodeSimple("subscriptionID", payload.subscriptionID, { explode: false, charEncoding: "percent", }), }; const path = pathToFunc( - "/v1/apis/{apiID}/version/{versionID}/schema/{revisionID}", + "/v1/subscriptions/{subscriptionID}/{namespaceName}/activate", )(pathParams); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { - operationID: "deleteSchema", + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "activateSubscriptionNamespace", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, - method: "DELETE", + method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -122,8 +158,8 @@ export async function schemasDeleteSchema( M.json("4XX", shared.ErrorT$inboundSchema.optional()), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/metadataDeleteVersionMetadata.ts b/src/funcs/subscriptionsIgnoreSubscriptionNamespace.ts similarity index 61% rename from src/funcs/metadataDeleteVersionMetadata.ts rename to src/funcs/subscriptionsIgnoreSubscriptionNamespace.ts index d659e66c..81b9068a 100644 --- a/src/funcs/metadataDeleteVersionMetadata.ts +++ b/src/funcs/subscriptionsIgnoreSubscriptionNamespace.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } 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"; @@ -20,16 +21,17 @@ import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; import * as shared from "../sdk/models/shared/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** - * Delete metadata for a particular apiID and versionID. + * Ignored a namespace for a subscription */ -export async function metadataDeleteVersionMetadata( +export function subscriptionsIgnoreSubscriptionNamespace( client: SpeakeasyCore, - request: operations.DeleteVersionMetadataRequest, + request: operations.IgnoreSubscriptionNamespaceRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< shared.ErrorT | undefined, | SDKError @@ -40,76 +42,103 @@ export async function metadataDeleteVersionMetadata( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.IgnoreSubscriptionNamespaceRequest, + options?: RequestOptions, +): Promise< + [ + Result< + shared.ErrorT | undefined, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, (value) => - operations.DeleteVersionMetadataRequest$outboundSchema.parse(value), + operations.IgnoreSubscriptionNamespaceRequest$outboundSchema.parse(value), "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; const pathParams = { - apiID: encodeSimple("apiID", payload.apiID, { - explode: false, - charEncoding: "percent", - }), - metaKey: encodeSimple("metaKey", payload.metaKey, { - explode: false, - charEncoding: "percent", - }), - metaValue: encodeSimple("metaValue", payload.metaValue, { + namespaceName: encodeSimple("namespaceName", payload.namespaceName, { explode: false, charEncoding: "percent", }), - versionID: encodeSimple("versionID", payload.versionID, { + subscriptionID: encodeSimple("subscriptionID", payload.subscriptionID, { explode: false, charEncoding: "percent", }), }; const path = pathToFunc( - "/v1/apis/{apiID}/version/{versionID}/metadata/{metaKey}/{metaValue}", + "/v1/subscriptions/{subscriptionID}/{namespaceName}/ignore", )(pathParams); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { - operationID: "deleteVersionMetadata", + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "ignoreSubscriptionNamespace", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, - method: "DELETE", + method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -127,8 +156,8 @@ export async function metadataDeleteVersionMetadata( M.json("4XX", shared.ErrorT$inboundSchema.optional()), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/suggestSuggest.ts b/src/funcs/suggestSuggest.ts index e76e1083..e11a56aa 100644 --- a/src/funcs/suggestSuggest.ts +++ b/src/funcs/suggestSuggest.ts @@ -6,6 +6,7 @@ import * as z from "zod"; import { SpeakeasyCore } 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"; @@ -20,6 +21,7 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** @@ -28,11 +30,11 @@ import { Result } from "../sdk/types/fp.js"; * @remarks * Get suggestions from an LLM model for improving an OpenAPI document. */ -export async function suggestSuggest( +export function suggestSuggest( client: SpeakeasyCore, request: operations.SuggestRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< ReadableStream, | SDKError @@ -43,6 +45,32 @@ export async function suggestSuggest( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.SuggestRequest, + options?: RequestOptions, +): Promise< + [ + Result< + ReadableStream, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -50,7 +78,7 @@ export async function suggestSuggest( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = encodeJSON("body", payload.SuggestRequestBody, { @@ -59,45 +87,54 @@ export async function suggestSuggest( const path = pathToFunc("/v1/suggest/openapi_from_summary")(); - const headers = new Headers({ + const headers = new Headers(compactMap({ "Content-Type": "application/json", Accept: "application/json", "x-session-id": encodeSimple("x-session-id", payload["x-session-id"], { explode: false, charEncoding: "none", }), - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "suggest", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -116,8 +153,8 @@ export async function suggestSuggest( }), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/metadataInsertVersionMetadata.ts b/src/funcs/suggestSuggestItems.ts similarity index 56% rename from src/funcs/metadataInsertVersionMetadata.ts rename to src/funcs/suggestSuggestItems.ts index 1c484d0b..e112056c 100644 --- a/src/funcs/metadataInsertVersionMetadata.ts +++ b/src/funcs/suggestSuggestItems.ts @@ -2,9 +2,11 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ +import * as z from "zod"; import { SpeakeasyCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.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"; @@ -18,19 +20,20 @@ import { } from "../sdk/models/errors/httpclienterrors.js"; import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; +import * as shared from "../sdk/models/shared/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** - * Insert metadata for a particular apiID and versionID. + * Generate generic suggestions for a list of items. */ -export async function metadataInsertVersionMetadata( +export function suggestSuggestItems( client: SpeakeasyCore, - request: operations.InsertVersionMetadataRequest, + request: shared.SuggestItemsRequestBody, options?: RequestOptions, -): Promise< +): APIPromise< Result< - operations.InsertVersionMetadataResponse, + Array, | SDKError | SDKValidationError | UnexpectedClientError @@ -39,74 +42,95 @@ export async function metadataInsertVersionMetadata( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: shared.SuggestItemsRequestBody, + options?: RequestOptions, +): Promise< + [ + Result< + Array, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, - (value) => - operations.InsertVersionMetadataRequest$outboundSchema.parse(value), + (value) => shared.SuggestItemsRequestBody$outboundSchema.parse(value), "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; - const body = encodeJSON("body", payload.VersionMetadata, { explode: true }); + const body = encodeJSON("body", payload, { explode: true }); - const pathParams = { - apiID: encodeSimple("apiID", payload.apiID, { - explode: false, - charEncoding: "percent", - }), - versionID: encodeSimple("versionID", payload.versionID, { - explode: false, - charEncoding: "percent", - }), - }; - - const path = pathToFunc("/v1/apis/{apiID}/version/{versionID}/metadata")( - pathParams, - ); + const path = pathToFunc("/v1/suggest/items")(); - const headers = new Headers({ + const headers = new Headers(compactMap({ "Content-Type": "application/json", Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { - operationID: "insertVersionMetadata", + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "suggestItems", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; const [result] = await M.match< - operations.InsertVersionMetadataResponse, + Array, | SDKError | SDKValidationError | UnexpectedClientError @@ -115,12 +139,11 @@ export async function metadataInsertVersionMetadata( | RequestTimeoutError | ConnectionError >( - M.json("2XX", operations.InsertVersionMetadataResponse$inboundSchema), - M.json("4XX", operations.InsertVersionMetadataResponse$inboundSchema), + M.json("2XX", z.array(z.string())), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/suggestSuggestOpenAPI.ts b/src/funcs/suggestSuggestOpenAPI.ts index a0a140cd..ddbb65d0 100644 --- a/src/funcs/suggestSuggestOpenAPI.ts +++ b/src/funcs/suggestSuggestOpenAPI.ts @@ -4,9 +4,10 @@ import * as z from "zod"; import { SpeakeasyCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; +import { appendForm, encodeJSON, encodeSimple } from "../lib/encodings.js"; import { readableStreamToArrayBuffer } from "../lib/files.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"; @@ -21,6 +22,7 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { isBlobLike } from "../sdk/types/blobs.js"; import { Result } from "../sdk/types/fp.js"; import { isReadableStream } from "../sdk/types/streams.js"; @@ -31,11 +33,11 @@ import { isReadableStream } from "../sdk/types/streams.js"; * @remarks * Get suggestions from an LLM model for improving an OpenAPI document. */ -export async function suggestSuggestOpenAPI( +export function suggestSuggestOpenAPI( client: SpeakeasyCore, request: operations.SuggestOpenAPIRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< ReadableStream, | SDKError @@ -46,6 +48,32 @@ export async function suggestSuggestOpenAPI( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.SuggestOpenAPIRequest, + options?: RequestOptions, +): Promise< + [ + Result< + ReadableStream, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -53,21 +81,22 @@ export async function suggestSuggestOpenAPI( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = new FormData(); if (isBlobLike(payload.RequestBody.schema)) { - body.append("schema", payload.RequestBody.schema); + appendForm(body, "schema", payload.RequestBody.schema); } else if (isReadableStream(payload.RequestBody.schema.content)) { const buffer = await readableStreamToArrayBuffer( payload.RequestBody.schema.content, ); const blob = new Blob([buffer], { type: "application/octet-stream" }); - body.append("schema", blob); + appendForm(body, "schema", blob); } else { - body.append( + appendForm( + body, "schema", new Blob([payload.RequestBody.schema.content], { type: "application/octet-stream", @@ -76,7 +105,8 @@ export async function suggestSuggestOpenAPI( ); } if (payload.RequestBody.opts !== undefined) { - body.append( + appendForm( + body, "opts", encodeJSON("opts", payload.RequestBody.opts, { explode: true }), ); @@ -84,44 +114,53 @@ export async function suggestSuggestOpenAPI( const path = pathToFunc("/v1/suggest/openapi")(); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", "x-session-id": encodeSimple("x-session-id", payload["x-session-id"], { explode: false, charEncoding: "none", }), - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "suggestOpenAPI", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -140,8 +179,8 @@ export async function suggestSuggestOpenAPI( }), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/suggestSuggestOpenAPIRegistry.ts b/src/funcs/suggestSuggestOpenAPIRegistry.ts index c34f71c4..0098dc94 100644 --- a/src/funcs/suggestSuggestOpenAPIRegistry.ts +++ b/src/funcs/suggestSuggestOpenAPIRegistry.ts @@ -6,6 +6,7 @@ import * as z from "zod"; import { SpeakeasyCore } 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"; @@ -20,6 +21,7 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** @@ -28,11 +30,11 @@ import { Result } from "../sdk/types/fp.js"; * @remarks * Get suggestions from an LLM model for improving an OpenAPI document stored in the registry. */ -export async function suggestSuggestOpenAPIRegistry( +export function suggestSuggestOpenAPIRegistry( client: SpeakeasyCore, request: operations.SuggestOpenAPIRegistryRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< ReadableStream, | SDKError @@ -43,6 +45,32 @@ export async function suggestSuggestOpenAPIRegistry( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.SuggestOpenAPIRegistryRequest, + options?: RequestOptions, +): Promise< + [ + Result< + ReadableStream, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -51,7 +79,7 @@ export async function suggestSuggestOpenAPIRegistry( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = encodeJSON("body", payload.SuggestRequestBody, { @@ -74,45 +102,54 @@ export async function suggestSuggestOpenAPIRegistry( "/v1/suggest/openapi/{namespace_name}/{revision_reference}", )(pathParams); - const headers = new Headers({ + const headers = new Headers(compactMap({ "Content-Type": "application/json", Accept: "application/json", "x-session-id": encodeSimple("x-session-id", payload["x-session-id"], { explode: false, charEncoding: "none", }), - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "suggestOpenAPIRegistry", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -131,8 +168,8 @@ export async function suggestSuggestOpenAPIRegistry( }), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/workspacesCreate.ts b/src/funcs/workspacesCreate.ts index 1b8f2c3b..0f22a7c6 100644 --- a/src/funcs/workspacesCreate.ts +++ b/src/funcs/workspacesCreate.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } 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"; @@ -20,6 +21,7 @@ import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; import * as shared from "../sdk/models/shared/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** @@ -28,11 +30,11 @@ import { Result } from "../sdk/types/fp.js"; * @remarks * Creates a workspace */ -export async function workspacesCreate( +export function workspacesCreate( client: SpeakeasyCore, request: shared.Workspace, options?: RequestOptions, -): Promise< +): APIPromise< Result< operations.CreateWorkspaceResponse, | SDKError @@ -43,6 +45,32 @@ export async function workspacesCreate( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: shared.Workspace, + options?: RequestOptions, +): Promise< + [ + Result< + operations.CreateWorkspaceResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -50,48 +78,57 @@ export async function workspacesCreate( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = encodeJSON("body", payload, { explode: true }); const path = pathToFunc("/v1/workspace")(); - const headers = new Headers({ + const headers = new Headers(compactMap({ "Content-Type": "application/json", Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "createWorkspace", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -109,8 +146,8 @@ export async function workspacesCreate( M.json("4XX", operations.CreateWorkspaceResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/workspacesCreateToken.ts b/src/funcs/workspacesCreateToken.ts index a7e44779..678678a3 100644 --- a/src/funcs/workspacesCreateToken.ts +++ b/src/funcs/workspacesCreateToken.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } 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"; @@ -20,16 +21,17 @@ import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; import * as shared from "../sdk/models/shared/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** * Create a token for a particular workspace */ -export async function workspacesCreateToken( +export function workspacesCreateToken( client: SpeakeasyCore, request: operations.CreateWorkspaceTokenRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< shared.ErrorT | undefined, | SDKError @@ -40,6 +42,32 @@ export async function workspacesCreateToken( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.CreateWorkspaceTokenRequest, + options?: RequestOptions, +): Promise< + [ + Result< + shared.ErrorT | undefined, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -48,55 +76,65 @@ export async function workspacesCreateToken( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = encodeJSON("body", payload.WorkspaceToken, { explode: true }); const pathParams = { - workspace_id: encodeSimple("workspace_id", payload.workspace_id, { - explode: false, - charEncoding: "percent", - }), + workspace_id: encodeSimple( + "workspace_id", + payload.workspace_id ?? client._options.workspaceId, + { explode: false, charEncoding: "percent" }, + ), }; const path = pathToFunc("/v1/workspace/{workspace_id}/tokens")(pathParams); - const headers = new Headers({ + const headers = new Headers(compactMap({ "Content-Type": "application/json", Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "createWorkspaceToken", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -114,8 +152,8 @@ export async function workspacesCreateToken( M.json("4XX", shared.ErrorT$inboundSchema.optional()), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/workspacesDeleteToken.ts b/src/funcs/workspacesDeleteToken.ts index 15287679..c6ad0330 100644 --- a/src/funcs/workspacesDeleteToken.ts +++ b/src/funcs/workspacesDeleteToken.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } 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"; @@ -20,16 +21,17 @@ import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; import * as shared from "../sdk/models/shared/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** * Delete a token for a particular workspace */ -export async function workspacesDeleteToken( +export function workspacesDeleteToken( client: SpeakeasyCore, request: operations.DeleteWorkspaceTokenRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< shared.ErrorT | undefined, | SDKError @@ -40,6 +42,32 @@ export async function workspacesDeleteToken( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.DeleteWorkspaceTokenRequest, + options?: RequestOptions, +): Promise< + [ + Result< + shared.ErrorT | undefined, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -48,7 +76,7 @@ export async function workspacesDeleteToken( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; @@ -58,50 +86,60 @@ export async function workspacesDeleteToken( explode: false, charEncoding: "percent", }), - workspace_id: encodeSimple("workspace_id", payload.workspace_id, { - explode: false, - charEncoding: "percent", - }), + workspace_id: encodeSimple( + "workspace_id", + payload.workspace_id ?? client._options.workspaceId, + { explode: false, charEncoding: "percent" }, + ), }; const path = pathToFunc("/v1/workspace/{workspace_id}/tokens/{tokenID}")( pathParams, ); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "deleteWorkspaceToken", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "DELETE", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -119,8 +157,8 @@ export async function workspacesDeleteToken( M.json("4XX", shared.ErrorT$inboundSchema.optional()), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/workspacesGet.ts b/src/funcs/workspacesGet.ts index a80baaf4..43dde10c 100644 --- a/src/funcs/workspacesGet.ts +++ b/src/funcs/workspacesGet.ts @@ -4,6 +4,7 @@ import { SpeakeasyCore } 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"; @@ -17,6 +18,7 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** @@ -25,10 +27,10 @@ import { Result } from "../sdk/types/fp.js"; * @remarks * Get information about a particular workspace by context. */ -export async function workspacesGet( +export function workspacesGet( client: SpeakeasyCore, options?: RequestOptions, -): Promise< +): APIPromise< Result< operations.GetWorkspaceByContextResponse, | SDKError @@ -39,42 +41,75 @@ export async function workspacesGet( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GetWorkspaceByContextResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const path = pathToFunc("/v1/workspace")(); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "getWorkspaceByContext", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -92,8 +127,8 @@ export async function workspacesGet( M.json("4XX", operations.GetWorkspaceByContextResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/workspacesGetAll.ts b/src/funcs/workspacesGetAll.ts index d55a3636..47b785d6 100644 --- a/src/funcs/workspacesGetAll.ts +++ b/src/funcs/workspacesGetAll.ts @@ -4,6 +4,7 @@ import { SpeakeasyCore } 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"; @@ -17,6 +18,7 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** @@ -25,10 +27,10 @@ import { Result } from "../sdk/types/fp.js"; * @remarks * Returns a list of workspaces a user has access too */ -export async function workspacesGetAll( +export function workspacesGetAll( client: SpeakeasyCore, options?: RequestOptions, -): Promise< +): APIPromise< Result< operations.GetWorkspacesResponse, | SDKError @@ -39,42 +41,75 @@ export async function workspacesGetAll( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GetWorkspacesResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const path = pathToFunc("/v1/workspaces")(); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "getWorkspaces", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -92,8 +127,8 @@ export async function workspacesGetAll( M.json("4XX", operations.GetWorkspacesResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/workspacesGetByID.ts b/src/funcs/workspacesGetByID.ts index e08521b0..8b16ac30 100644 --- a/src/funcs/workspacesGetByID.ts +++ b/src/funcs/workspacesGetByID.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } 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"; @@ -19,6 +20,7 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** @@ -27,11 +29,11 @@ import { Result } from "../sdk/types/fp.js"; * @remarks * Get information about a particular workspace. */ -export async function workspacesGetByID( +export function workspacesGetByID( client: SpeakeasyCore, request: operations.GetWorkspaceRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< operations.GetWorkspaceResponse, | SDKError @@ -42,6 +44,32 @@ export async function workspacesGetByID( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.GetWorkspaceRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GetWorkspaceResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -49,54 +77,64 @@ export async function workspacesGetByID( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; const pathParams = { - workspace_id: encodeSimple("workspace_id", payload.workspace_id, { - explode: false, - charEncoding: "percent", - }), + workspace_id: encodeSimple( + "workspace_id", + payload.workspace_id ?? client._options.workspaceId, + { explode: false, charEncoding: "percent" }, + ), }; const path = pathToFunc("/v1/workspace/{workspace_id}")(pathParams); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "getWorkspace", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -114,8 +152,8 @@ export async function workspacesGetByID( M.json("4XX", operations.GetWorkspaceResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/workspacesGetFeatureFlags.ts b/src/funcs/workspacesGetFeatureFlags.ts index c85c1a35..9f405658 100644 --- a/src/funcs/workspacesGetFeatureFlags.ts +++ b/src/funcs/workspacesGetFeatureFlags.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } 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"; @@ -19,16 +20,17 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** * Get workspace feature flags */ -export async function workspacesGetFeatureFlags( +export function workspacesGetFeatureFlags( client: SpeakeasyCore, request: operations.GetWorkspaceFeatureFlagsRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< operations.GetWorkspaceFeatureFlagsResponse, | SDKError @@ -39,6 +41,32 @@ export async function workspacesGetFeatureFlags( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.GetWorkspaceFeatureFlagsRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GetWorkspaceFeatureFlagsResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -47,56 +75,66 @@ export async function workspacesGetFeatureFlags( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; const pathParams = { - workspace_id: encodeSimple("workspace_id", payload.workspace_id, { - explode: false, - charEncoding: "percent", - }), + workspace_id: encodeSimple( + "workspace_id", + payload.workspace_id ?? client._options.workspaceId, + { explode: false, charEncoding: "percent" }, + ), }; const path = pathToFunc("/v1/workspace/{workspace_id}/feature_flags")( pathParams, ); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "getWorkspaceFeatureFlags", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -114,8 +152,8 @@ export async function workspacesGetFeatureFlags( M.json("5XX", operations.GetWorkspaceFeatureFlagsResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/workspacesGetSettings.ts b/src/funcs/workspacesGetSettings.ts index bea35c9a..e100ba54 100644 --- a/src/funcs/workspacesGetSettings.ts +++ b/src/funcs/workspacesGetSettings.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } 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"; @@ -19,6 +20,7 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** @@ -27,11 +29,11 @@ import { Result } from "../sdk/types/fp.js"; * @remarks * Get settings about a particular workspace. */ -export async function workspacesGetSettings( +export function workspacesGetSettings( client: SpeakeasyCore, request: operations.GetWorkspaceSettingsRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< operations.GetWorkspaceSettingsResponse, | SDKError @@ -42,6 +44,32 @@ export async function workspacesGetSettings( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.GetWorkspaceSettingsRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GetWorkspaceSettingsResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -50,54 +78,64 @@ export async function workspacesGetSettings( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; const pathParams = { - workspace_id: encodeSimple("workspace_id", payload.workspace_id, { - explode: false, - charEncoding: "percent", - }), + workspace_id: encodeSimple( + "workspace_id", + payload.workspace_id ?? client._options.workspaceId, + { explode: false, charEncoding: "percent" }, + ), }; const path = pathToFunc("/v1/workspace/{workspace_id}/settings")(pathParams); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "getWorkspaceSettings", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -115,8 +153,8 @@ export async function workspacesGetSettings( M.json("4XX", operations.GetWorkspaceSettingsResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/workspacesGetTeam.ts b/src/funcs/workspacesGetTeam.ts index 09de74eb..256fb318 100644 --- a/src/funcs/workspacesGetTeam.ts +++ b/src/funcs/workspacesGetTeam.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } 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"; @@ -19,16 +20,17 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** * Get team members for a particular workspace */ -export async function workspacesGetTeam( +export function workspacesGetTeam( client: SpeakeasyCore, request: operations.GetWorkspaceTeamRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< operations.GetWorkspaceTeamResponse, | SDKError @@ -39,6 +41,32 @@ export async function workspacesGetTeam( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.GetWorkspaceTeamRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GetWorkspaceTeamResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -46,54 +74,64 @@ export async function workspacesGetTeam( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; const pathParams = { - workspace_id: encodeSimple("workspace_id", payload.workspace_id, { - explode: false, - charEncoding: "percent", - }), + workspace_id: encodeSimple( + "workspace_id", + payload.workspace_id ?? client._options.workspaceId, + { explode: false, charEncoding: "percent" }, + ), }; const path = pathToFunc("/v1/workspace/{workspace_id}/team")(pathParams); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "getWorkspaceTeam", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -111,8 +149,8 @@ export async function workspacesGetTeam( M.json("4XX", operations.GetWorkspaceTeamResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/workspacesGetTokens.ts b/src/funcs/workspacesGetTokens.ts index 174176f8..18bc9e38 100644 --- a/src/funcs/workspacesGetTokens.ts +++ b/src/funcs/workspacesGetTokens.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } 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"; @@ -19,16 +20,17 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** * Get tokens for a particular workspace */ -export async function workspacesGetTokens( +export function workspacesGetTokens( client: SpeakeasyCore, request: operations.GetWorkspaceTokensRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< operations.GetWorkspaceTokensResponse, | SDKError @@ -39,6 +41,32 @@ export async function workspacesGetTokens( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.GetWorkspaceTokensRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GetWorkspaceTokensResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -46,54 +74,64 @@ export async function workspacesGetTokens( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; const pathParams = { - workspace_id: encodeSimple("workspace_id", payload.workspace_id, { - explode: false, - charEncoding: "percent", - }), + workspace_id: encodeSimple( + "workspace_id", + payload.workspace_id ?? client._options.workspaceId, + { explode: false, charEncoding: "percent" }, + ), }; const path = pathToFunc("/v1/workspace/{workspace_id}/tokens")(pathParams); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "getWorkspaceTokens", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -111,8 +149,8 @@ export async function workspacesGetTokens( M.json("4XX", operations.GetWorkspaceTokensResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/workspacesGrantAccess.ts b/src/funcs/workspacesGrantAccess.ts index d0fde0ff..01fc7902 100644 --- a/src/funcs/workspacesGrantAccess.ts +++ b/src/funcs/workspacesGrantAccess.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } 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"; @@ -19,16 +20,17 @@ import { import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** * Grant a user access to a particular workspace */ -export async function workspacesGrantAccess( +export function workspacesGrantAccess( client: SpeakeasyCore, request: operations.GrantUserAccessToWorkspaceRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< operations.GrantUserAccessToWorkspaceResponse, | SDKError @@ -39,6 +41,32 @@ export async function workspacesGrantAccess( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.GrantUserAccessToWorkspaceRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.GrantUserAccessToWorkspaceResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -47,7 +75,7 @@ export async function workspacesGrantAccess( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; @@ -57,50 +85,60 @@ export async function workspacesGrantAccess( explode: false, charEncoding: "percent", }), - workspace_id: encodeSimple("workspace_id", payload.workspace_id, { - explode: false, - charEncoding: "percent", - }), + workspace_id: encodeSimple( + "workspace_id", + payload.workspace_id ?? client._options.workspaceId, + { explode: false, charEncoding: "percent" }, + ), }; const path = pathToFunc("/v1/workspace/{workspace_id}/team/email/{email}")( pathParams, ); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "grantUserAccessToWorkspace", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "PUT", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -118,8 +156,8 @@ export async function workspacesGrantAccess( M.json("4XX", operations.GrantUserAccessToWorkspaceResponse$inboundSchema), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/workspacesRevokeAccess.ts b/src/funcs/workspacesRevokeAccess.ts index d251fade..b2a2013d 100644 --- a/src/funcs/workspacesRevokeAccess.ts +++ b/src/funcs/workspacesRevokeAccess.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } 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"; @@ -20,16 +21,17 @@ import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; import * as shared from "../sdk/models/shared/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** * Revoke a user's access to a particular workspace */ -export async function workspacesRevokeAccess( +export function workspacesRevokeAccess( client: SpeakeasyCore, request: operations.RevokeUserAccessToWorkspaceRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< shared.ErrorT | undefined, | SDKError @@ -40,6 +42,32 @@ export async function workspacesRevokeAccess( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.RevokeUserAccessToWorkspaceRequest, + options?: RequestOptions, +): Promise< + [ + Result< + shared.ErrorT | undefined, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -48,7 +76,7 @@ export async function workspacesRevokeAccess( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = null; @@ -58,50 +86,60 @@ export async function workspacesRevokeAccess( explode: false, charEncoding: "percent", }), - workspace_id: encodeSimple("workspace_id", payload.workspace_id, { - explode: false, - charEncoding: "percent", - }), + workspace_id: encodeSimple( + "workspace_id", + payload.workspace_id ?? client._options.workspaceId, + { explode: false, charEncoding: "percent" }, + ), }; const path = pathToFunc("/v1/workspace/{workspace_id}/team/{userId}")( pathParams, ); - const headers = new Headers({ + const headers = new Headers(compactMap({ Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "revokeUserAccessToWorkspace", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "DELETE", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -119,8 +157,8 @@ export async function workspacesRevokeAccess( M.json("4XX", shared.ErrorT$inboundSchema.optional()), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/workspacesSetFeatureFlags.ts b/src/funcs/workspacesSetFeatureFlags.ts new file mode 100644 index 00000000..269de2f5 --- /dev/null +++ b/src/funcs/workspacesSetFeatureFlags.ts @@ -0,0 +1,150 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SpeakeasyCore } 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 "../sdk/models/errors/httpclienterrors.js"; +import { SDKError } from "../sdk/models/errors/sdkerror.js"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; +import * as operations from "../sdk/models/operations/index.js"; +import * as shared from "../sdk/models/shared/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; +import { Result } from "../sdk/types/fp.js"; + +/** + * Set workspace feature flags + */ +export function workspacesSetFeatureFlags( + client: SpeakeasyCore, + request: shared.WorkspaceFeatureFlagRequest, + options?: RequestOptions, +): APIPromise< + Result< + operations.SetWorkspaceFeatureFlagsResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: shared.WorkspaceFeatureFlagRequest, + options?: RequestOptions, +): Promise< + [ + Result< + operations.SetWorkspaceFeatureFlagsResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => shared.WorkspaceFeatureFlagRequest$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/workspace/feature_flags")(); + + const headers = new Headers(compactMap({ + "Content-Type": "application/json", + Accept: "application/json", + })); + + const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "setWorkspaceFeatureFlags", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.security, + 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, + 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: [], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const [result] = await M.match< + operations.SetWorkspaceFeatureFlagsResponse, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >( + M.json(200, operations.SetWorkspaceFeatureFlagsResponse$inboundSchema), + M.json("5XX", operations.SetWorkspaceFeatureFlagsResponse$inboundSchema), + )(response); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/workspacesUpdate.ts b/src/funcs/workspacesUpdate.ts index 157cf21d..6811d4da 100644 --- a/src/funcs/workspacesUpdate.ts +++ b/src/funcs/workspacesUpdate.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } 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"; @@ -20,6 +21,7 @@ import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; import * as shared from "../sdk/models/shared/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** @@ -28,11 +30,11 @@ import { Result } from "../sdk/types/fp.js"; * @remarks * Update information about a particular workspace. */ -export async function workspacesUpdate( +export function workspacesUpdate( client: SpeakeasyCore, request: operations.UpdateWorkspaceDetailsRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< shared.ErrorT | undefined, | SDKError @@ -43,6 +45,32 @@ export async function workspacesUpdate( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.UpdateWorkspaceDetailsRequest, + options?: RequestOptions, +): Promise< + [ + Result< + shared.ErrorT | undefined, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -51,55 +79,65 @@ export async function workspacesUpdate( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = encodeJSON("body", payload.Workspace, { explode: true }); const pathParams = { - workspace_id: encodeSimple("workspace_id", payload.workspace_id, { - explode: false, - charEncoding: "percent", - }), + workspace_id: encodeSimple( + "workspace_id", + payload.workspace_id ?? client._options.workspaceId, + { explode: false, charEncoding: "percent" }, + ), }; const path = pathToFunc("/v1/workspace/{workspace_id}/details")(pathParams); - const headers = new Headers({ + const headers = new Headers(compactMap({ "Content-Type": "application/json", Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "updateWorkspaceDetails", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -117,8 +155,8 @@ export async function workspacesUpdate( M.json("4XX", shared.ErrorT$inboundSchema.optional()), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/funcs/workspacesUpdateSettings.ts b/src/funcs/workspacesUpdateSettings.ts index c81edf1e..a0eccdcf 100644 --- a/src/funcs/workspacesUpdateSettings.ts +++ b/src/funcs/workspacesUpdateSettings.ts @@ -5,6 +5,7 @@ import { SpeakeasyCore } 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"; @@ -20,6 +21,7 @@ import { SDKError } from "../sdk/models/errors/sdkerror.js"; import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; import * as operations from "../sdk/models/operations/index.js"; import * as shared from "../sdk/models/shared/index.js"; +import { APICall, APIPromise } from "../sdk/types/async.js"; import { Result } from "../sdk/types/fp.js"; /** @@ -28,11 +30,11 @@ import { Result } from "../sdk/types/fp.js"; * @remarks * Update settings about a particular workspace. */ -export async function workspacesUpdateSettings( +export function workspacesUpdateSettings( client: SpeakeasyCore, request: operations.UpdateWorkspaceSettingsRequest, options?: RequestOptions, -): Promise< +): APIPromise< Result< shared.ErrorT | undefined, | SDKError @@ -43,6 +45,32 @@ export async function workspacesUpdateSettings( | RequestTimeoutError | ConnectionError > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: SpeakeasyCore, + request: operations.UpdateWorkspaceSettingsRequest, + options?: RequestOptions, +): Promise< + [ + Result< + shared.ErrorT | undefined, + | SDKError + | SDKValidationError + | UnexpectedClientError + | InvalidRequestError + | RequestAbortedError + | RequestTimeoutError + | ConnectionError + >, + APICall, + ] > { const parsed = safeParse( request, @@ -51,55 +79,65 @@ export async function workspacesUpdateSettings( "Input validation failed", ); if (!parsed.ok) { - return parsed; + return [parsed, { status: "invalid" }]; } const payload = parsed.value; const body = encodeJSON("body", payload.WorkspaceSettings, { explode: true }); const pathParams = { - workspace_id: encodeSimple("workspace_id", payload.workspace_id, { - explode: false, - charEncoding: "percent", - }), + workspace_id: encodeSimple( + "workspace_id", + payload.workspace_id ?? client._options.workspaceId, + { explode: false, charEncoding: "percent" }, + ), }; const path = pathToFunc("/v1/workspace/{workspace_id}/settings")(pathParams); - const headers = new Headers({ + const headers = new Headers(compactMap({ "Content-Type": "application/json", Accept: "application/json", - }); + })); const securityInput = await extractSecurity(client._options.security); + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { + baseURL: options?.serverURL ?? client._baseURL ?? "", operationID: "updateWorkspaceSettings", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.security, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "PUT", + baseURL: options?.serverURL, path: path, headers: headers, body: body, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, }, options); if (!requestRes.ok) { - return requestRes; + return [requestRes, { status: "invalid" }]; } const req = requestRes.value; const doResult = await client._do(req, { context, errorCodes: [], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { - return doResult; + return [doResult, { status: "request-error", request: req }]; } const response = doResult.value; @@ -117,8 +155,8 @@ export async function workspacesUpdateSettings( M.json("4XX", shared.ErrorT$inboundSchema.optional()), )(response); if (!result.ok) { - return result; + return [result, { status: "complete", request: req, response }]; } - return result; + return [result, { status: "complete", request: req, response }]; } diff --git a/src/hooks/hooks.ts b/src/hooks/hooks.ts index d1b3396f..d34c8849 100644 --- a/src/hooks/hooks.ts +++ b/src/hooks/hooks.ts @@ -12,6 +12,7 @@ import { BeforeCreateRequestHook, BeforeRequestContext, BeforeRequestHook, + Hook, Hooks, SDKInitHook, SDKInitOptions, @@ -27,6 +28,25 @@ export class SDKHooks implements Hooks { 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); } diff --git a/src/hooks/types.ts b/src/hooks/types.ts index 656b9e37..1d56c6f2 100644 --- a/src/hooks/types.ts +++ b/src/hooks/types.ts @@ -3,11 +3,16 @@ */ import { HTTPClient, 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[]; + oAuth2Scopes: string[] | null; securitySource?: any | (() => Promise); + retryConfig: RetryConfig; + resolvedSecurity: SecurityState | null; }; export type Awaitable = T | Promise; @@ -96,3 +101,10 @@ export interface Hooks { /** 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/lib/config.ts b/src/lib/config.ts index cc01384d..a8eb146a 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -20,22 +20,22 @@ export type SDKOptions = { /** * The security details required to authenticate the SDK */ - security?: shared.Security | (() => Promise); + security?: shared.Security | (() => Promise) | undefined; /** - * Allows setting the workspaceID parameter for all supported operations + * Allows setting the workspaceId parameter for all supported operations */ - workspaceID?: string | undefined; + workspaceId?: string | undefined; httpClient?: HTTPClient; /** * Allows overriding the default server used by the SDK */ - server?: keyof typeof ServerList; + server?: keyof typeof ServerList | undefined; /** * Allows overriding the default server URL used by the SDK */ - serverURL?: string; + serverURL?: string | undefined; /** * Allows overriding the default retry config used by the SDK */ @@ -60,9 +60,9 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", - openapiDocVersion: "0.4.0 .", - sdkVersion: "4.0.0-rc.2", - genVersion: "2.437.1", + openapiDocVersion: "0.4.0", + sdkVersion: "4.0.0-rc.3", + genVersion: "2.568.2", userAgent: - "speakeasy-sdk/typescript 4.0.0-rc.2 2.437.1 0.4.0 . @speakeasy-api/speakeasy-client-sdk-typescript", + "speakeasy-sdk/typescript 4.0.0-rc.3 2.568.2 0.4.0 @speakeasy-api/speakeasy-client-sdk-typescript", } as const; diff --git a/src/lib/encodings.ts b/src/lib/encodings.ts index 44fa7284..25c9dcba 100644 --- a/src/lib/encodings.ts +++ b/src/lib/encodings.ts @@ -16,12 +16,16 @@ export function encodeMatrix( key: string, value: unknown, options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -): string { +): 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; }; @@ -29,21 +33,25 @@ export function encodeMatrix( pairs.forEach(([pk, pv]) => { let tmp = ""; - let encValue = ""; + let encValue: string | null | undefined = null; - if (pv === undefined) { + if (pv == null) { return; } else if (Array.isArray(pv)) { - encValue = mapDefined(pv, (v) => `${encodeValue(v)}`).join(","); + encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(","); } else if (isPlainObject(pv)) { - encValue = mapDefinedEntries(Object.entries(pv), ([k, v]) => { + const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => { return `,${encodeString(k)},${encodeValue(v)}`; - }).join(""); - encValue = encValue.slice(1); + }); + 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 @@ -66,36 +74,40 @@ export function encodeLabel( key: string, value: unknown, options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -): string { +): 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 = ""; + let encValue: string | null | undefined = ""; - if (pv === undefined) { + if (pv == null) { return; } else if (Array.isArray(pv)) { - encValue = mapDefined(pv, (v) => `${encodeValue(v)}`).join("."); + encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join("."); } else if (isPlainObject(pv)) { - encValue = mapDefinedEntries(Object.entries(pv), ([k, v]) => { + const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => { return `.${encodeString(k)}.${encodeValue(v)}`; - }).join(""); - encValue = encValue.slice(1); + }); + encValue = mapped?.join("").slice(1); } else { const k = options?.explode && isPlainObject(value) ? `${encodeString(pk)}=` : ""; encValue = `${k}${encodeValue(pv)}`; } - out += `.${encValue}`; + out += encValue == null ? "" : `.${encValue}`; }); return out; @@ -105,7 +117,7 @@ type FormEncoder = ( key: string, value: unknown, options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -) => string; +) => string | undefined; function formEncoder(sep: string): FormEncoder { return ( @@ -118,6 +130,10 @@ function formEncoder(sep: string): FormEncoder { ? explode(key, value) : [[key, value]]; + if (pairs.every(([_, v]) => v == null)) { + return; + } + const encodeString = (v: string) => { return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; }; @@ -128,20 +144,24 @@ function formEncoder(sep: string): FormEncoder { pairs.forEach(([pk, pv]) => { let tmp = ""; - let encValue = ""; + let encValue: string | null | undefined = null; - if (pv === undefined) { + if (pv == null) { return; } else if (Array.isArray(pv)) { - encValue = mapDefined(pv, (v) => `${encodeValue(v)}`).join(encodedSep); + 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); + })?.join(encodedSep); } else { encValue = `${encodeValue(pv)}`; } + if (encValue == null) { + return; + } + tmp = `${encodeString(pk)}=${encValue}`; // If we end up with the nothing then skip forward @@ -180,7 +200,7 @@ export function encodeBodyForm( let tmp = ""; let encValue = ""; - if (pv === undefined) { + if (pv == null) { return; } else if (Array.isArray(pv)) { encValue = JSON.stringify(pv, jsonReplacer); @@ -207,14 +227,14 @@ export function encodeDeepObject( key: string, value: unknown, options?: { charEncoding?: "percent" | "none" }, -): string { +): string | undefined { if (value == null) { - return ""; + return; } if (!isPlainObject(value)) { throw new EncodingError( - `Value of parameter '${key}' which uses deepObject encoding must be an object`, + `Value of parameter '${key}' which uses deepObject encoding must be an object or null`, ); } @@ -225,9 +245,9 @@ export function encodeDeepObjectObject( key: string, value: unknown, options?: { charEncoding?: "percent" | "none" }, -): string { +): string | undefined { if (value == null) { - return ""; + return; } let out = ""; @@ -241,7 +261,7 @@ export function encodeDeepObjectObject( } Object.entries(value).forEach(([ck, cv]) => { - if (cv === undefined) { + if (cv == null) { return; } @@ -250,19 +270,17 @@ export function encodeDeepObjectObject( if (isPlainObject(cv)) { const objOut = encodeDeepObjectObject(pk, cv, options); - out += `&${objOut}`; + out += objOut == null ? "" : `&${objOut}`; return; } const pairs: unknown[] = Array.isArray(cv) ? cv : [cv]; - let encoded = ""; - - encoded = mapDefined(pairs, (v) => { + const encoded = mapDefined(pairs, (v) => { return `${encodeString(pk)}=${encodeString(serializeValue(v))}`; - }).join("&"); + })?.join("&"); - out += `&${encoded}`; + out += encoded == null ? "" : `&${encoded}`; }); return out.slice(1); @@ -272,9 +290,9 @@ export function encodeJSON( key: string, value: unknown, options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -): string { +): string | undefined { if (typeof value === "undefined") { - return ""; + return; } const encodeString = (v: string) => { @@ -290,40 +308,39 @@ export const encodeSimple = ( key: string, value: unknown, options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -): string => { +): 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 tmp: string | null | undefined = ""; - if (pv === undefined) { + if (pv == null) { return; } else if (Array.isArray(pv)) { - tmp = mapDefined(pv, (v) => `${encodeValue(v)}`).join(","); + tmp = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(","); } else if (isPlainObject(pv)) { - tmp = mapDefinedEntries(Object.entries(pv), ([k, v]) => { + const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => { return `,${encodeString(k)},${encodeValue(v)}`; - }).join(""); - tmp = tmp.slice(1); + }); + tmp = mapped?.join("").slice(1); } else { const k = options?.explode && isPlainObject(value) ? `${pk}=` : ""; tmp = `${k}${encodeValue(pv)}`; } - // If we end up with the nothing then skip forward - if (!tmp) { - return; - } - - out += `,${tmp}`; + out += tmp ? `,${tmp}` : ""; }); return out.slice(1); @@ -341,9 +358,7 @@ function explode(key: string, value: unknown): [string, unknown][] { } function serializeValue(value: unknown): string { - if (value === null) { - return "null"; - } else if (typeof value === "undefined") { + if (value == null) { return ""; } else if (value instanceof Date) { return value.toISOString(); @@ -364,14 +379,14 @@ function jsonReplacer(_: string, value: unknown): unknown { } } -function mapDefined(inp: T[], mapper: (v: T) => R): R[] { - return inp.reduce((acc, v) => { - if (v === undefined) { +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 === undefined) { + if (m == null) { return acc; } @@ -379,30 +394,32 @@ function mapDefined(inp: T[], mapper: (v: T) => R): R[] { return acc; }, []); + + return res.length ? res : null; } function mapDefinedEntries( inp: Iterable<[K, V]>, mapper: (v: [K, V]) => R, -): R[] { +): R[] | null { const acc: R[] = []; for (const [k, v] of inp) { - if (v === undefined) { + if (v == null) { continue; } const m = mapper([k, v]); - if (m === undefined) { + if (m == null) { continue; } acc.push(m); } - return acc; + return acc.length ? acc : null; } -export function queryJoin(...args: string[]): string { +export function queryJoin(...args: (string | undefined)[]): string { return args.filter(Boolean).join("&"); } @@ -415,7 +432,7 @@ type QueryEncoder = ( key: string, value: unknown, options?: QueryEncoderOptions, -) => string; +) => string | undefined; type BulkQueryEncoder = ( values: Record, @@ -447,3 +464,20 @@ 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 index 19e08041..59d15f09 100644 --- a/src/lib/files.ts +++ b/src/lib/files.ts @@ -36,5 +36,5 @@ export async function readableStreamToArrayBuffer( offset += chunk.length; } - return concatenatedChunks.buffer; + return concatenatedChunks.buffer as ArrayBuffer; } diff --git a/src/lib/matchers.ts b/src/lib/matchers.ts index bddfff76..948c3324 100644 --- a/src/lib/matchers.ts +++ b/src/lib/matchers.ts @@ -205,7 +205,7 @@ export function match( raw = await response.json(); break; case "bytes": - raw = await response.arrayBuffer(); + raw = new Uint8Array(await response.arrayBuffer()); break; case "stream": raw = response.body; diff --git a/src/lib/primitives.ts b/src/lib/primitives.ts index 23794a2b..d21f1dc4 100644 --- a/src/lib/primitives.ts +++ b/src/lib/primitives.ts @@ -2,6 +2,26 @@ * 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] @@ -38,3 +58,93 @@ export function remap< 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 index df3e0bc2..e3ce9aba 100644 --- a/src/lib/retries.ts +++ b/src/lib/retries.ts @@ -26,23 +26,44 @@ export type RetryConfig = retryConnectionErrors?: boolean; }; -class PermanentError extends Error { - inner: unknown; +/** + * 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}`; + } - constructor(inner: unknown) { - super("Permanent error"); - this.inner = inner; + 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); } } -class TemporaryError extends Error { - res: Response; +/** + * 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(res: Response) { - super("Temporary error"); - this.res = res; + constructor(message: string, response: Response) { + super(message); + this.response = response; + this.name = "TemporaryError"; Object.setPrototypeOf(this, TemporaryError.prototype); } @@ -80,11 +101,14 @@ function wrapFetcher( try { const res = await fn(); if (isRetryableResponse(res, options.statusCodes)) { - throw new TemporaryError(res); + throw new TemporaryError( + "Response failed with retryable status code", + res, + ); } return res; - } catch (err) { + } catch (err: unknown) { if (err instanceof TemporaryError) { throw err; } @@ -96,7 +120,7 @@ function wrapFetcher( throw err; } - throw new PermanentError(err); + throw new PermanentError("Permanent error", { cause: err }); } }; } @@ -134,42 +158,29 @@ async function retryBackoff( const start = Date.now(); let x = 0; - // eslint-disable-next-line no-constant-condition while (true) { try { const res = await fn(); return res; - } catch (err) { + } catch (err: unknown) { if (err instanceof PermanentError) { - throw err.inner; + throw err.cause; } const elapsed = Date.now() - start; if (elapsed > maxElapsedTime) { if (err instanceof TemporaryError) { - return err.res; + return err.response; } throw err; } let retryInterval = 0; - if (err instanceof TemporaryError && err.res && err.res.headers) { - const retryVal = err.res.headers.get("retry-after") || ""; - if (retryVal != "") { - const parsedNumber = Number(retryVal); - if (!isNaN(parsedNumber) && Number.isInteger(parsedNumber)) { - retryInterval = parsedNumber * 1000; - } else { - const parsedDate = Date.parse(retryVal); - if (!isNaN(parsedDate)) { - const deltaMS = parsedDate - Date.now(); - retryInterval = deltaMS > 0 ? Math.ceil(deltaMS) : 0; - } - } - } + if (err instanceof TemporaryError) { + retryInterval = retryIntervalFromResponse(err.response); } - if (retryInterval == 0) { + if (retryInterval <= 0) { retryInterval = initialInterval * Math.pow(x, exponent) + Math.random() * 1000; } @@ -182,6 +193,26 @@ async function retryBackoff( } } +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 index a2ad30da..6bfea6f6 100644 --- a/src/lib/schemas.ts +++ b/src/lib/schemas.ts @@ -57,6 +57,7 @@ export function collectExtraKeys< >( obj: ZodObject, extrasKey: K, + optional: boolean, ): ZodEffects< typeof obj, & output> @@ -81,6 +82,10 @@ export function collectExtraKeys< 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 index bfbe7a5b..78543843 100644 --- a/src/lib/sdks.ts +++ b/src/lib/sdks.ts @@ -41,6 +41,10 @@ export type RequestOptions = { * 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; /** * Sets various request options on the `fetch` call made by an SDK method. * @@ -52,7 +56,7 @@ export type RequestOptions = { type RequestConfig = { method: string; path: string; - baseURL?: string | URL; + baseURL?: string | URL | undefined; query?: string; body?: RequestInit["body"]; headers?: HeadersInit; @@ -74,7 +78,7 @@ export class ClientSDK { readonly #httpClient: HTTPClient; readonly #hooks: SDKHooks; readonly #logger?: Logger | undefined; - protected readonly _baseURL: URL | null; + public readonly _baseURL: URL | null; public readonly _options: SDKOptions & { hooks?: SDKHooks }; constructor(options: SDKOptions = {}) { @@ -119,6 +123,7 @@ export class ClientSDK { const inputURL = new URL(path, reqURL); if (path) { + reqURL.pathname += reqURL.pathname.endsWith("/") ? "" : "/"; reqURL.pathname += inputURL.pathname.replace(/^\/+/, ""); } @@ -126,7 +131,10 @@ export class ClientSDK { const secQuery: string[] = []; for (const [k, v] of Object.entries(security?.queryParams || {})) { - secQuery.push(encodeForm(k, v, { charEncoding: "percent" })); + const q = encodeForm(k, v, { charEncoding: "percent" }); + if (typeof q !== "undefined") { + secQuery.push(q); + } } if (secQuery.length) { finalQuery += `&${secQuery.join("&")}`; @@ -183,14 +191,9 @@ export class ClientSDK { if (conf.body instanceof ReadableStream) { if (!fetchOptions) { - fetchOptions = { - // @ts-expect-error see https://github.com/node-fetch/node-fetch/issues/1769 - duplex: "half", - }; - } else { - // @ts-expect-error see https://github.com/node-fetch/node-fetch/issues/1769 - fetchOptions.duplex = "half"; + fetchOptions = {}; } + Object.assign(fetchOptions, { duplex: "half" }); } let input; @@ -220,8 +223,8 @@ export class ClientSDK { options: { context: HookContext; errorCodes: number | string | (number | string)[]; - retryConfig?: RetryConfig | undefined; - retryCodes?: string[] | undefined; + retryConfig: RetryConfig; + retryCodes: string[]; }, ): Promise< Result< @@ -233,8 +236,6 @@ export class ClientSDK { > > { const { context, errorCodes } = options; - const retryConfig = options.retryConfig || { strategy: "none" }; - const retryCodes = options.retryCodes || []; return retry( async () => { @@ -245,22 +246,28 @@ export class ClientSDK { let response = await this.#httpClient.request(req); - if (matchStatusCode(response, errorCodes)) { - const result = await this.#hooks.afterError(context, response, null); - if (result.error) { - throw result.error; + 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); } - 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)); } - await logResponse(this.#logger, response, req) - .catch(e => this.#logger?.log("Failed to log response:", e)); - return response; }, - { config: retryConfig, statusCodes: retryCodes }, + { config: options.retryConfig, statusCodes: options.retryCodes }, ).then( (r) => OK(r), (err) => { diff --git a/src/lib/security.ts b/src/lib/security.ts index efe3c3b3..8273a7fe 100644 --- a/src/lib/security.ts +++ b/src/lib/security.ts @@ -4,6 +4,14 @@ import * as shared from "../sdk/models/shared/index.js"; +type OAuth2PasswordFlow = { + username: string; + password?: string | undefined; + clientID: string; + clientSecret?: string | undefined; + tokenURL: string; +}; + export enum SecurityErrorCode { Incomplete = "incomplete", UnrecognisedSecurityType = "unrecognized_security_type", @@ -37,6 +45,7 @@ export type SecurityState = { headers: Record; queryParams: Record; cookies: Record; + oauth2: ({ type: "password" } & OAuth2PasswordFlow) | { type: "none" }; }; type SecurityInputBasic = { @@ -76,13 +85,24 @@ type SecurityInputOAuth2ClientCredentials = { 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; + fieldName?: string; }; export type SecurityInput = @@ -91,6 +111,7 @@ export type SecurityInput = | SecurityInputAPIKey | SecurityInputOAuth2 | SecurityInputOAuth2ClientCredentials + | SecurityInputOAuth2PasswordCredentials | SecurityInputOIDC | SecurityInputCustom; @@ -98,10 +119,11 @@ export function resolveSecurity( ...options: SecurityInput[][] ): SecurityState | null { const state: SecurityState = { - basic: { username: "", password: "" }, + basic: {}, headers: {}, queryParams: {}, cookies: {}, + oauth2: { type: "none" }, }; const option = options.find((opts) => { @@ -112,7 +134,14 @@ export function resolveSecurity( 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; @@ -156,6 +185,9 @@ export function resolveSecurity( case "oauth2": applyBearer(state, spec); break; + case "oauth2:password": + applyBearer(state, spec); + break; case "oauth2:client_credentials": break; case "openIdConnect": @@ -183,9 +215,13 @@ function applyBasic( function applyBearer( state: SecurityState, - spec: SecurityInputBearer | SecurityInputOAuth2 | SecurityInputOIDC, + spec: + | SecurityInputBearer + | SecurityInputOAuth2 + | SecurityInputOIDC + | SecurityInputOAuth2PasswordCredentials, ) { - if (spec.value == null) { + if (typeof spec.value !== "string" || !spec.value) { return; } @@ -194,8 +230,11 @@ function applyBearer( value = `Bearer ${value}`; } - state.headers[spec.fieldName] = value; + if (spec.fieldName !== undefined) { + state.headers[spec.fieldName] = value; + } } + export function resolveGlobalSecurity( security: Partial | null | undefined, ): SecurityState | null { diff --git a/src/mcp-server/build.mts b/src/mcp-server/build.mts new file mode 100644 index 00000000..a04739f2 --- /dev/null +++ b/src/mcp-server/build.mts @@ -0,0 +1,16 @@ +/// + +import { build } from "bun"; + +const entrypoint = "./src/mcp-server/mcp-server.ts"; + +await build({ + entrypoints: [entrypoint], + outdir: "./bin", + sourcemap: "linked", + target: "node", + format: "esm", + minify: false, + throw: true, + banner: "#!/usr/bin/env node", +}); diff --git a/src/mcp-server/cli.ts b/src/mcp-server/cli.ts new file mode 100644 index 00000000..b878d8de --- /dev/null +++ b/src/mcp-server/cli.ts @@ -0,0 +1,13 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { CommandContext, StricliProcess } from "@stricli/core"; + +export interface LocalContext extends CommandContext { + readonly process: StricliProcess; +} + +export function buildContext(process: NodeJS.Process): LocalContext { + return { process: process as StricliProcess }; +} diff --git a/src/mcp-server/cli/start/command.ts b/src/mcp-server/cli/start/command.ts new file mode 100644 index 00000000..3b887a09 --- /dev/null +++ b/src/mcp-server/cli/start/command.ts @@ -0,0 +1,132 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { buildCommand } from "@stricli/core"; +import * as z from "zod"; +import { ServerList } from "../../../lib/config.js"; +import { consoleLoggerLevels } from "../../console-logger.js"; +import { mcpScopes } from "../../scopes.js"; + +export const startCommand = buildCommand({ + loader: async () => { + const { main } = await import("./impl.js"); + return main; + }, + parameters: { + flags: { + transport: { + kind: "enum", + brief: "The transport to use for communicating with the server", + default: "stdio", + values: ["stdio", "sse"], + }, + port: { + kind: "parsed", + brief: "The port to use when the SSE transport is enabled", + default: "2718", + parse: (val: string) => + z.coerce.number().int().gte(0).lt(65536).parse(val), + }, + tool: { + kind: "parsed", + brief: "Specify tools to mount on the server", + optional: true, + variadic: true, + parse: (value) => { + return z.string().parse(value); + }, + }, + ...(mcpScopes.length + ? { + scope: { + kind: "enum", + brief: + "Mount tools/resources that match given scope (repeatable flag)", + values: mcpScopes, + variadic: true, + optional: true, + }, + } + : {}), + "api-key": { + kind: "parsed", + brief: "Sets the apiKey auth field for the API", + optional: true, + parse: (value) => { + return z.string().parse(value); + }, + }, + bearer: { + kind: "parsed", + brief: "Sets the bearer auth field for the API", + optional: true, + parse: (value) => { + return z.string().parse(value); + }, + }, + "workspace-identifier": { + kind: "parsed", + brief: "Sets the workspaceIdentifier auth field for the API", + optional: true, + parse: (value) => { + return z.string().parse(value); + }, + }, + "workspace-id": { + kind: "parsed", + brief: + "Allows setting the workspaceId parameter for all supported operations", + optional: true, + parse: (value) => { + return z.string().parse(value); + }, + }, + "server-url": { + kind: "parsed", + brief: "Overrides the default server URL used by the SDK", + optional: true, + parse: (value) => new URL(value).toString(), + }, + server: { + kind: "enum", + brief: "Selects a predefined server used by the SDK", + optional: true, + values: Object.keys(ServerList) as Array, + }, + "log-level": { + kind: "enum", + brief: "The log level to use for the server", + default: "info", + values: consoleLoggerLevels, + }, + env: { + kind: "parsed", + brief: "Environment variables made available to the server", + optional: true, + variadic: true, + parse: (val: string) => { + const sepIdx = val.indexOf("="); + if (sepIdx === -1) { + throw new Error("Invalid environment variable format"); + } + + const key = val.slice(0, sepIdx); + const value = val.slice(sepIdx + 1); + + return [ + z.string().nonempty({ + message: "Environment variable key must be a non-empty string", + }).parse(key), + z.string().nonempty({ + message: "Environment variable value must be a non-empty string", + }).parse(value), + ] satisfies [string, string]; + }, + }, + }, + }, + docs: { + brief: "Run the Model Context Protocol server", + }, +}); diff --git a/src/mcp-server/cli/start/impl.ts b/src/mcp-server/cli/start/impl.ts new file mode 100644 index 00000000..933768d8 --- /dev/null +++ b/src/mcp-server/cli/start/impl.ts @@ -0,0 +1,147 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { SSEServerTransport } from "@modelcontextprotocol/sdk/server/sse.js"; +import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; +import express from "express"; +import { SDKOptions } from "../../../lib/config.js"; +import { LocalContext } from "../../cli.js"; +import { + ConsoleLoggerLevel, + createConsoleLogger, +} from "../../console-logger.js"; +import { MCPScope } from "../../scopes.js"; +import { createMCPServer } from "../../server.js"; + +interface StartCommandFlags { + readonly transport: "stdio" | "sse"; + readonly port: number; + readonly tool?: string[]; + readonly scope?: MCPScope[]; + readonly "api-key"?: string | undefined; + readonly bearer?: string | undefined; + readonly "workspace-identifier"?: string | undefined; + readonly "workspace-id"?: SDKOptions["workspaceId"] | undefined; + readonly "server-url"?: string; + readonly server?: SDKOptions["server"]; + readonly "log-level": ConsoleLoggerLevel; + readonly env?: [string, string][]; +} + +export async function main(this: LocalContext, flags: StartCommandFlags) { + flags.env?.forEach(([key, value]) => { + process.env[key] = value; + }); + + switch (flags.transport) { + case "stdio": + await startStdio(flags); + break; + case "sse": + await startSSE(flags); + break; + default: + throw new Error(`Invalid transport: ${flags.transport}`); + } +} + +async function startStdio(flags: StartCommandFlags) { + const logger = createConsoleLogger(flags["log-level"]); + const transport = new StdioServerTransport(); + const server = createMCPServer({ + logger, + allowedTools: flags.tool, + scopes: flags.scope, + security: { + apiKey: flags["api-key"], + bearer: flags.bearer, + workspaceIdentifier: flags["workspace-identifier"], + }, + workspaceId: flags["workspace-id"], + serverURL: flags["server-url"], + server: flags.server, + }); + await server.connect(transport); + + const abort = async () => { + await server.close(); + process.exit(0); + }; + process.on("SIGTERM", abort); + process.on("SIGINT", abort); +} + +async function startSSE(flags: StartCommandFlags) { + const logger = createConsoleLogger(flags["log-level"]); + const app = express(); + const mcpServer = createMCPServer({ + logger, + allowedTools: flags.tool, + scopes: flags.scope, + security: { + apiKey: flags["api-key"], + bearer: flags.bearer, + workspaceIdentifier: flags["workspace-identifier"], + }, + workspaceId: flags["workspace-id"], + serverURL: flags["server-url"], + server: flags.server, + }); + let transport: SSEServerTransport | undefined; + const controller = new AbortController(); + + app.get("/sse", async (_req, res) => { + transport = new SSEServerTransport("/message", res); + + await mcpServer.connect(transport); + + mcpServer.server.onclose = async () => { + res.end(); + }; + }); + + app.post("/message", async (req, res) => { + if (!transport) { + throw new Error("Server transport not initialized"); + } + + await transport.handlePostMessage(req, res); + }); + + const httpServer = app.listen(flags.port, "0.0.0.0", () => { + const ha = httpServer.address(); + const host = typeof ha === "string" ? ha : `${ha?.address}:${ha?.port}`; + logger.info("MCP HTTP server started", { host }); + }); + + let closing = false; + controller.signal.addEventListener("abort", async () => { + if (closing) { + logger.info("Received second signal. Forcing shutdown."); + process.exit(1); + } + closing = true; + + logger.info("Shutting down MCP server"); + + await mcpServer.close(); + + logger.info("Shutting down HTTP server"); + + const timer = setTimeout(() => { + logger.info("Forcing shutdown"); + process.exit(1); + }, 5000); + + httpServer.close(() => { + clearTimeout(timer); + logger.info("Graceful shutdown complete"); + process.exit(0); + }); + }); + + const abort = () => controller.abort(); + process.on("SIGTERM", abort); + process.on("SIGINT", abort); +} diff --git a/src/mcp-server/console-logger.ts b/src/mcp-server/console-logger.ts new file mode 100644 index 00000000..d65a295b --- /dev/null +++ b/src/mcp-server/console-logger.ts @@ -0,0 +1,71 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +export const consoleLoggerLevels = [ + "debug", + "warning", + "info", + "error", +] as const; + +export type ConsoleLoggerLevel = (typeof consoleLoggerLevels)[number]; + +export type ConsoleLogger = { + [key in ConsoleLoggerLevel]: ( + message: string, + data?: Record, + ) => void; +}; + +export function createConsoleLogger(level: ConsoleLoggerLevel): ConsoleLogger { + const min = consoleLoggerLevels.indexOf(level); + const noop = () => {}; + + const logger: ConsoleLogger = { + debug: noop, + warning: noop, + info: noop, + error: noop, + }; + + return consoleLoggerLevels.reduce((logger, level, i) => { + if (i < min) { + return logger; + } + + logger[level] = log.bind(null, level); + + return logger; + }, logger); +} + +function log( + level: ConsoleLoggerLevel, + message: string, + data?: Record, +) { + let line = ""; + const allData = [{ msg: message, l: level }, data]; + + for (const ctx of allData) { + for (const [key, value] of Object.entries(ctx || {})) { + if (value == null) { + line += ` ${key}=<${value}>`; + } else if (typeof value === "function") { + line += ` ${key}=`; + } else if (typeof value === "symbol") { + line += ` ${key}=${value.toString()}`; + } else if (typeof value === "string") { + const v = value.search(/\s/g) >= 0 ? JSON.stringify(value) : value; + line += ` ${key}=${v}`; + } else if (typeof value !== "object") { + line += ` ${key}=${value}`; + } else { + line += ` ${key}="${JSON.stringify(value)}"`; + } + } + } + + console.error(line); +} diff --git a/src/mcp-server/extensions.ts b/src/mcp-server/extensions.ts new file mode 100644 index 00000000..7aab2809 --- /dev/null +++ b/src/mcp-server/extensions.ts @@ -0,0 +1,17 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { ZodRawShape } from "zod"; +import { PromptArgsRawShape, PromptDefinition } from "./prompts.js"; +import { ResourceDefinition, ResourceTemplateDefinition } from "./resources.js"; +import { ToolDefinition } from "./tools.js"; + +export type Register = { + tool: (def: ToolDefinition) => void; + resource: (def: ResourceDefinition) => void; + resourceTemplate: (def: ResourceTemplateDefinition) => void; + prompt: ( + prompt: PromptDefinition, + ) => void; +}; diff --git a/src/mcp-server/mcp-server.ts b/src/mcp-server/mcp-server.ts new file mode 100644 index 00000000..7dcaa856 --- /dev/null +++ b/src/mcp-server/mcp-server.ts @@ -0,0 +1,26 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { buildApplication, buildRouteMap, run } from "@stricli/core"; +import process from "node:process"; +import { buildContext } from "./cli.js"; +import { startCommand } from "./cli/start/command.js"; + +const routes = buildRouteMap({ + routes: { + start: startCommand, + }, + docs: { + brief: "MCP server CLI", + }, +}); + +export const app = buildApplication(routes, { + name: "mcp", + versionInfo: { + currentVersion: "4.0.0-rc.3", + }, +}); + +run(app, process.argv.slice(2), buildContext(process)); diff --git a/src/mcp-server/prompts.ts b/src/mcp-server/prompts.ts new file mode 100644 index 00000000..7921302c --- /dev/null +++ b/src/mcp-server/prompts.ts @@ -0,0 +1,117 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; +import { RequestHandlerExtra } from "@modelcontextprotocol/sdk/shared/protocol.js"; +import { GetPromptResult } from "@modelcontextprotocol/sdk/types.js"; +import { + objectOutputType, + ZodOptional, + ZodType, + ZodTypeAny, + ZodTypeDef, +} from "zod"; +import { SpeakeasyCore } from "../core.js"; +import { ConsoleLogger } from "./console-logger.js"; +import { MCPScope } from "./scopes.js"; + +// '@modelcontextprotocol/sdk' currently does not export this type +export type PromptArgsRawShape = { + [k: string]: + | ZodType + | ZodOptional>; +}; + +export type PromptDefinition< + Args extends undefined | PromptArgsRawShape = undefined, +> = Args extends PromptArgsRawShape ? { + name: string; + description?: string; + scopes?: MCPScope[]; + args: Args; + prompt: ( + client: SpeakeasyCore, + args: objectOutputType, + extra: RequestHandlerExtra, + ) => GetPromptResult | Promise; + } + : { + name: string; + description?: string; + scopes?: MCPScope[]; + args?: undefined; + prompt: ( + client: SpeakeasyCore, + extra: RequestHandlerExtra, + ) => GetPromptResult | Promise; + }; + +// Optional function to assist with formatting prompt results +export async function formatResult(value: string): Promise { + return { + messages: [ + { + role: "user", + content: { + type: "text", + text: value, + }, + }, + ], + }; +} + +export function createRegisterPrompt( + logger: ConsoleLogger, + server: McpServer, + sdk: SpeakeasyCore, + allowedScopes: Set, +): ( + prompt: PromptDefinition, +) => void { + return ( + prompt: PromptDefinition, + ): void => { + const scopes = prompt.scopes ?? []; + if (allowedScopes.size > 0 && scopes.length === 0) { + return; + } + + if ( + allowedScopes.size > 0 + && !scopes.every((s: MCPScope) => allowedScopes.has(s)) + ) { + return; + } + + if (prompt.args) { + if (prompt.description) { + server.prompt( + prompt.name, + prompt.description, + prompt.args, + async (args, ctx) => prompt.prompt(sdk, args, ctx), + ); + } else { + server.prompt( + prompt.name, + prompt.args, + async (args, ctx) => prompt.prompt(sdk, args, ctx), + ); + } + } else { + if (prompt.description) { + server.prompt( + prompt.name, + prompt.description, + async (ctx) => prompt.prompt(sdk, ctx), + ); + } else { + server.prompt(prompt.name, async (ctx) => prompt.prompt(sdk, ctx)); + } + } + + logger.debug("Registered prompt", { name: prompt.name }); + }; +} diff --git a/src/mcp-server/resources.ts b/src/mcp-server/resources.ts new file mode 100644 index 00000000..0a0bc885 --- /dev/null +++ b/src/mcp-server/resources.ts @@ -0,0 +1,172 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { + McpServer, + ResourceMetadata, + ResourceTemplate, +} from "@modelcontextprotocol/sdk/server/mcp.js"; +import { RequestHandlerExtra } from "@modelcontextprotocol/sdk/shared/protocol.js"; +import { Variables } from "@modelcontextprotocol/sdk/shared/uriTemplate.js"; +import { ReadResourceResult } from "@modelcontextprotocol/sdk/types.js"; +import { SpeakeasyCore } from "../core.js"; +import { ConsoleLogger } from "./console-logger.js"; +import { MCPScope } from "./scopes.js"; +import { isAsyncIterable, isBinaryData, valueToBase64 } from "./shared.js"; + +export type ReadResourceCallback = ( + client: SpeakeasyCore, + uri: URL, + extra: RequestHandlerExtra, +) => ReadResourceResult | Promise; + +export type ResourceDefinition = { + name: string; + description?: string; + metadata?: ResourceMetadata; + scopes?: MCPScope[]; + resource: string; + read: ReadResourceCallback; +}; + +export type ReadResourceTemplateCallback = ( + client: SpeakeasyCore, + uri: URL, + vars: Variables, + extra: RequestHandlerExtra, +) => ReadResourceResult | Promise; + +export type ResourceTemplateDefinition = { + name: string; + description: string; + metadata?: ResourceMetadata; + scopes?: MCPScope[]; + resource: ResourceTemplate; + read: ReadResourceTemplateCallback; +}; + +// Optional function to assist with formatting resource results +export async function formatResult( + value: unknown, + uri: URL, + init: { mimeType?: string | undefined; response?: Response | undefined }, +): Promise { + if (typeof value === "undefined") { + return { contents: [] }; + } + + let contents: ReadResourceResult["contents"] = []; + + const mimeType = init.mimeType ?? init.response?.headers.get("content-type") + ?? ""; + + if (mimeType.search(/\bjson\b/g) !== -1) { + contents = [{ uri: uri.toString(), mimeType, text: JSON.stringify(value) }]; + } else if ( + mimeType.startsWith("text/event-stream") + && isAsyncIterable(value) + ) { + contents = [ + { + uri: uri.toString(), + mimeType: "application/json", + text: await stringifySSEToJSON(value), + }, + ]; + } else if ( + (mimeType.startsWith("text/") || mimeType.startsWith("application/")) + && typeof value === "string" + ) { + contents = [{ uri: uri.toString(), mimeType, text: value }]; + } else if (isBinaryData(value)) { + const blob = await valueToBase64(value); + contents = blob == null ? [] : [{ uri: uri.toString(), blob, mimeType }]; + } else { + throw new Error(`Unsupported content type: "${mimeType}"`); + } + + return { contents }; +} + +async function stringifySSEToJSON( + value: AsyncIterable, +): Promise { + const payloads = []; + + for await (const chunk of value) { + payloads.push(chunk); + } + + return JSON.stringify(payloads); +} + +export function createRegisterResource( + logger: ConsoleLogger, + server: McpServer, + sdk: SpeakeasyCore, + allowedScopes: Set, +): (resource: ResourceDefinition) => void { + return (resource: ResourceDefinition): void => { + const scopes = resource.scopes ?? []; + if (allowedScopes.size > 0 && scopes.length === 0) { + return; + } + + if ( + allowedScopes.size > 0 + && !scopes.every((s: MCPScope) => allowedScopes.has(s)) + ) { + return; + } + + const metadata: ResourceMetadata = { + ...resource.metadata, + description: resource.description, + }; + + server.resource( + resource.name, + resource.resource, + metadata, + async (uri, ctx) => resource.read(sdk, uri, ctx), + ); + + logger.debug("Registered resource", { name: resource.name }); + }; +} + +export function createRegisterResourceTemplate( + logger: ConsoleLogger, + server: McpServer, + sdk: SpeakeasyCore, + allowedScopes: Set, +): (resource: ResourceTemplateDefinition) => void { + return (resource: ResourceTemplateDefinition): void => { + const scopes = resource.scopes ?? []; + if (allowedScopes.size > 0 && scopes.length === 0) { + return; + } + + if ( + allowedScopes.size > 0 + && !scopes.every((s: MCPScope) => allowedScopes.has(s)) + ) { + return; + } + + const metadata: ResourceMetadata = { + ...resource.metadata, + description: resource.description, + }; + + server.resource( + resource.name, + resource.resource, + metadata, + async (uri, vars, ctx) => resource.read(sdk, uri, vars, ctx), + ); + + logger.debug("Registered resource template", { name: resource.name }); + }; +} diff --git a/src/mcp-server/scopes.ts b/src/mcp-server/scopes.ts new file mode 100644 index 00000000..c25696d4 --- /dev/null +++ b/src/mcp-server/scopes.ts @@ -0,0 +1,7 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +export const mcpScopes = [] as const; + +export type MCPScope = (typeof mcpScopes)[number]; diff --git a/src/mcp-server/server.ts b/src/mcp-server/server.ts new file mode 100644 index 00000000..ba4e1f2e --- /dev/null +++ b/src/mcp-server/server.ts @@ -0,0 +1,199 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; +import { SpeakeasyCore } from "../core.js"; +import { SDKOptions } from "../lib/config.js"; +import type { ConsoleLogger } from "./console-logger.js"; +import { createRegisterPrompt } from "./prompts.js"; +import { + createRegisterResource, + createRegisterResourceTemplate, +} from "./resources.js"; +import { MCPScope } from "./scopes.js"; +import { createRegisterTool } from "./tools.js"; +import { tool$artifactsCreateRemoteSource } from "./tools/artifactsCreateRemoteSource.js"; +import { tool$artifactsGetBlob } from "./tools/artifactsGetBlob.js"; +import { tool$artifactsGetManifest } from "./tools/artifactsGetManifest.js"; +import { tool$artifactsGetNamespaces } from "./tools/artifactsGetNamespaces.js"; +import { tool$artifactsGetRevisions } from "./tools/artifactsGetRevisions.js"; +import { tool$artifactsGetTags } from "./tools/artifactsGetTags.js"; +import { tool$artifactsListRemoteSources } from "./tools/artifactsListRemoteSources.js"; +import { tool$artifactsPostTags } from "./tools/artifactsPostTags.js"; +import { tool$artifactsPreflight } from "./tools/artifactsPreflight.js"; +import { tool$artifactsSetArchived } from "./tools/artifactsSetArchived.js"; +import { tool$artifactsSetVisibility } from "./tools/artifactsSetVisibility.js"; +import { tool$authGetAccess } from "./tools/authGetAccess.js"; +import { tool$authGetAccessToken } from "./tools/authGetAccessToken.js"; +import { tool$authGetUser } from "./tools/authGetUser.js"; +import { tool$authValidateApiKey } from "./tools/authValidateApiKey.js"; +import { tool$codeSamplesGenerateCodeSamplePreview } from "./tools/codeSamplesGenerateCodeSamplePreview.js"; +import { tool$codeSamplesGenerateCodeSamplePreviewAsync } from "./tools/codeSamplesGenerateCodeSamplePreviewAsync.js"; +import { tool$codeSamplesGet } from "./tools/codeSamplesGet.js"; +import { tool$codeSamplesGetCodeSamplePreviewAsync } from "./tools/codeSamplesGetCodeSamplePreviewAsync.js"; +import { tool$eventsGetEventsByTarget } from "./tools/eventsGetEventsByTarget.js"; +import { tool$eventsGetTargets } from "./tools/eventsGetTargets.js"; +import { tool$eventsGetTargetsDeprecated } from "./tools/eventsGetTargetsDeprecated.js"; +import { tool$eventsPost } from "./tools/eventsPost.js"; +import { tool$eventsSearch } from "./tools/eventsSearch.js"; +import { tool$githubCheckAccess } from "./tools/githubCheckAccess.js"; +import { tool$githubCheckPublishingPRs } from "./tools/githubCheckPublishingPRs.js"; +import { tool$githubCheckPublishingSecrets } from "./tools/githubCheckPublishingSecrets.js"; +import { tool$githubConfigureCodeSamples } from "./tools/githubConfigureCodeSamples.js"; +import { tool$githubConfigureMintlifyRepo } from "./tools/githubConfigureMintlifyRepo.js"; +import { tool$githubConfigureTarget } from "./tools/githubConfigureTarget.js"; +import { tool$githubGetAction } from "./tools/githubGetAction.js"; +import { tool$githubGetSetup } from "./tools/githubGetSetup.js"; +import { tool$githubLinkGithub } from "./tools/githubLinkGithub.js"; +import { tool$githubStorePublishingSecrets } from "./tools/githubStorePublishingSecrets.js"; +import { tool$githubTriggerAction } from "./tools/githubTriggerAction.js"; +import { tool$organizationsCreate } from "./tools/organizationsCreate.js"; +import { tool$organizationsCreateBillingAddOns } from "./tools/organizationsCreateBillingAddOns.js"; +import { tool$organizationsCreateFreeTrial } from "./tools/organizationsCreateFreeTrial.js"; +import { tool$organizationsDeleteBillingAddOn } from "./tools/organizationsDeleteBillingAddOn.js"; +import { tool$organizationsGet } from "./tools/organizationsGet.js"; +import { tool$organizationsGetAll } from "./tools/organizationsGetAll.js"; +import { tool$organizationsGetBillingAddOns } from "./tools/organizationsGetBillingAddOns.js"; +import { tool$organizationsGetUsage } from "./tools/organizationsGetUsage.js"; +import { tool$reportsGetChangesReportSignedUrl } from "./tools/reportsGetChangesReportSignedUrl.js"; +import { tool$reportsGetLintingReportSignedUrl } from "./tools/reportsGetLintingReportSignedUrl.js"; +import { tool$reportsUploadReport } from "./tools/reportsUploadReport.js"; +import { tool$schemaStoreCreateSchemaStoreItem } from "./tools/schemaStoreCreateSchemaStoreItem.js"; +import { tool$shortURLsCreate } from "./tools/shortURLsCreate.js"; +import { tool$subscriptionsActivateSubscriptionNamespace } from "./tools/subscriptionsActivateSubscriptionNamespace.js"; +import { tool$subscriptionsIgnoreSubscriptionNamespace } from "./tools/subscriptionsIgnoreSubscriptionNamespace.js"; +import { tool$suggestSuggest } from "./tools/suggestSuggest.js"; +import { tool$suggestSuggestItems } from "./tools/suggestSuggestItems.js"; +import { tool$suggestSuggestOpenAPI } from "./tools/suggestSuggestOpenAPI.js"; +import { tool$suggestSuggestOpenAPIRegistry } from "./tools/suggestSuggestOpenAPIRegistry.js"; +import { tool$workspacesCreate } from "./tools/workspacesCreate.js"; +import { tool$workspacesCreateToken } from "./tools/workspacesCreateToken.js"; +import { tool$workspacesDeleteToken } from "./tools/workspacesDeleteToken.js"; +import { tool$workspacesGet } from "./tools/workspacesGet.js"; +import { tool$workspacesGetAll } from "./tools/workspacesGetAll.js"; +import { tool$workspacesGetByID } from "./tools/workspacesGetByID.js"; +import { tool$workspacesGetFeatureFlags } from "./tools/workspacesGetFeatureFlags.js"; +import { tool$workspacesGetSettings } from "./tools/workspacesGetSettings.js"; +import { tool$workspacesGetTeam } from "./tools/workspacesGetTeam.js"; +import { tool$workspacesGetTokens } from "./tools/workspacesGetTokens.js"; +import { tool$workspacesGrantAccess } from "./tools/workspacesGrantAccess.js"; +import { tool$workspacesRevokeAccess } from "./tools/workspacesRevokeAccess.js"; +import { tool$workspacesSetFeatureFlags } from "./tools/workspacesSetFeatureFlags.js"; +import { tool$workspacesUpdate } from "./tools/workspacesUpdate.js"; +import { tool$workspacesUpdateSettings } from "./tools/workspacesUpdateSettings.js"; + +export function createMCPServer(deps: { + logger: ConsoleLogger; + allowedTools?: string[] | undefined; + scopes?: MCPScope[] | undefined; + serverURL?: string | undefined; + security?: SDKOptions["security"] | undefined; + workspaceId?: SDKOptions["workspaceId"] | undefined; + server?: SDKOptions["server"] | undefined; +}) { + const server = new McpServer({ + name: "Speakeasy", + version: "4.0.0-rc.3", + }); + + const client = new SpeakeasyCore({ + security: deps.security, + workspaceId: deps.workspaceId, + serverURL: deps.serverURL, + server: deps.server, + }); + + const scopes = new Set(deps.scopes); + + const allowedTools = deps.allowedTools && new Set(deps.allowedTools); + const tool = createRegisterTool( + deps.logger, + server, + client, + scopes, + allowedTools, + ); + const resource = createRegisterResource(deps.logger, server, client, scopes); + const resourceTemplate = createRegisterResourceTemplate( + deps.logger, + server, + client, + scopes, + ); + const prompt = createRegisterPrompt(deps.logger, server, client, scopes); + const register = { tool, resource, resourceTemplate, prompt }; + void register; // suppress unused warnings + + tool(tool$artifactsCreateRemoteSource); + tool(tool$artifactsGetBlob); + tool(tool$artifactsGetManifest); + tool(tool$artifactsGetNamespaces); + tool(tool$artifactsGetRevisions); + tool(tool$artifactsGetTags); + tool(tool$artifactsListRemoteSources); + tool(tool$artifactsPostTags); + tool(tool$artifactsPreflight); + tool(tool$artifactsSetArchived); + tool(tool$artifactsSetVisibility); + tool(tool$authGetAccess); + tool(tool$authGetAccessToken); + tool(tool$authGetUser); + tool(tool$authValidateApiKey); + tool(tool$codeSamplesGenerateCodeSamplePreview); + tool(tool$codeSamplesGenerateCodeSamplePreviewAsync); + tool(tool$codeSamplesGet); + tool(tool$codeSamplesGetCodeSamplePreviewAsync); + tool(tool$githubCheckAccess); + tool(tool$githubCheckPublishingPRs); + tool(tool$githubCheckPublishingSecrets); + tool(tool$githubConfigureCodeSamples); + tool(tool$githubConfigureMintlifyRepo); + tool(tool$githubConfigureTarget); + tool(tool$githubGetAction); + tool(tool$githubGetSetup); + tool(tool$githubLinkGithub); + tool(tool$githubStorePublishingSecrets); + tool(tool$githubTriggerAction); + tool(tool$organizationsCreate); + tool(tool$organizationsCreateBillingAddOns); + tool(tool$organizationsCreateFreeTrial); + tool(tool$organizationsDeleteBillingAddOn); + tool(tool$organizationsGet); + tool(tool$organizationsGetAll); + tool(tool$organizationsGetBillingAddOns); + tool(tool$organizationsGetUsage); + tool(tool$reportsGetChangesReportSignedUrl); + tool(tool$reportsGetLintingReportSignedUrl); + tool(tool$reportsUploadReport); + tool(tool$schemaStoreCreateSchemaStoreItem); + tool(tool$shortURLsCreate); + tool(tool$subscriptionsActivateSubscriptionNamespace); + tool(tool$subscriptionsIgnoreSubscriptionNamespace); + tool(tool$suggestSuggest); + tool(tool$suggestSuggestItems); + tool(tool$suggestSuggestOpenAPI); + tool(tool$suggestSuggestOpenAPIRegistry); + tool(tool$workspacesCreate); + tool(tool$workspacesCreateToken); + tool(tool$workspacesDeleteToken); + tool(tool$workspacesGet); + tool(tool$workspacesGetAll); + tool(tool$workspacesGetByID); + tool(tool$workspacesGetFeatureFlags); + tool(tool$workspacesGetSettings); + tool(tool$workspacesGetTeam); + tool(tool$workspacesGetTokens); + tool(tool$workspacesGrantAccess); + tool(tool$workspacesRevokeAccess); + tool(tool$workspacesSetFeatureFlags); + tool(tool$workspacesUpdate); + tool(tool$workspacesUpdateSettings); + tool(tool$eventsGetEventsByTarget); + tool(tool$eventsGetTargets); + tool(tool$eventsGetTargetsDeprecated); + tool(tool$eventsPost); + tool(tool$eventsSearch); + + return server; +} diff --git a/src/mcp-server/shared.ts b/src/mcp-server/shared.ts new file mode 100644 index 00000000..9dc6d2f6 --- /dev/null +++ b/src/mcp-server/shared.ts @@ -0,0 +1,75 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { bytesToBase64 } from "../lib/base64.js"; + +type BinaryData = + | Uint8Array + | ArrayBuffer + | Blob + | ReadableStream + | Response + | string; + +export async function consumeStream( + stream: ReadableStream, +): Promise { + const reader = stream.getReader(); + const chunks: Uint8Array[] = []; + + try { + while (true) { + const { done, value } = await reader.read(); + if (value != null) chunks.push(value); + if (done) break; + } + } finally { + reader.releaseLock(); + } + + return new Uint8Array(await new Blob(chunks).arrayBuffer()); +} + +export function isAsyncIterable( + value: unknown, +): value is AsyncIterable { + return ( + typeof value === "object" && value != null && Symbol.asyncIterator in value + ); +} + +export function isBinaryData(value: unknown): value is BinaryData { + return ( + value instanceof Uint8Array + || value instanceof ArrayBuffer + || value instanceof Blob + || value instanceof ReadableStream + || value instanceof Response + || typeof value === "string" + ); +} + +const base64Schema = z.string().base64(); + +export async function valueToBase64( + value: BinaryData | null | undefined, +): Promise { + if (value == null) { + return null; + } else if (value instanceof Uint8Array) { + return bytesToBase64(value); + } else if (value instanceof ArrayBuffer) { + return bytesToBase64(new Uint8Array(value)); + } else if (value instanceof Response || value instanceof Blob) { + return bytesToBase64(new Uint8Array(await value.arrayBuffer())); + } else if (value instanceof ReadableStream) { + return bytesToBase64(await consumeStream(value)); + } else if (typeof value === "string") { + return base64Schema.parse(value); + } else { + value satisfies never; + throw new Error(`Unsupported image value type: ${typeof value}`); + } +} diff --git a/src/mcp-server/tools.ts b/src/mcp-server/tools.ts new file mode 100644 index 00000000..4d8b5175 --- /dev/null +++ b/src/mcp-server/tools.ts @@ -0,0 +1,129 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; +import { RequestHandlerExtra } from "@modelcontextprotocol/sdk/shared/protocol.js"; +import { CallToolResult } from "@modelcontextprotocol/sdk/types.js"; +import { objectOutputType, ZodRawShape, ZodTypeAny } from "zod"; +import { SpeakeasyCore } from "../core.js"; +import { ConsoleLogger } from "./console-logger.js"; +import { MCPScope } from "./scopes.js"; +import { isAsyncIterable, isBinaryData, valueToBase64 } from "./shared.js"; + +export type ToolDefinition = + Args extends ZodRawShape ? { + name: string; + description: string; + scopes?: MCPScope[]; + args: Args; + tool: ( + client: SpeakeasyCore, + args: objectOutputType, + extra: RequestHandlerExtra, + ) => CallToolResult | Promise; + } + : { + name: string; + description: string; + scopes?: MCPScope[]; + args?: undefined; + tool: ( + client: SpeakeasyCore, + extra: RequestHandlerExtra, + ) => CallToolResult | Promise; + }; + +// Optional function to assist with formatting tool results +export async function formatResult( + value: unknown, + init: { response?: Response | undefined }, +): Promise { + if (typeof value === "undefined") { + return { content: [] }; + } + + const { response } = init; + const contentType = response?.headers.get("content-type") ?? ""; + let content: CallToolResult["content"] = []; + + if (contentType.search(/\bjson\b/g)) { + content = [{ type: "text", text: JSON.stringify(value) }]; + } else if ( + contentType.startsWith("text/event-stream") + && isAsyncIterable(value) + ) { + content = await consumeSSE(value); + } else if (contentType.startsWith("text/") && typeof value === "string") { + content = [{ type: "text", text: value }]; + } else if (isBinaryData(value) && contentType.startsWith("image/")) { + const data = await valueToBase64(value); + content = data == null + ? [] + : [{ type: "image", data, mimeType: contentType }]; + } else { + return { + content: [{ + type: "text", + text: `Unsupported content type: "${contentType}"`, + }], + isError: true, + }; + } + + return { content }; +} + +async function consumeSSE( + value: AsyncIterable, +): Promise { + const content: CallToolResult["content"] = []; + + for await (const chunk of value) { + if (typeof chunk === "string") { + content.push({ type: "text", text: chunk }); + } else { + content.push({ type: "text", text: JSON.stringify(chunk) }); + } + } + + return content; +} + +export function createRegisterTool( + logger: ConsoleLogger, + server: McpServer, + sdk: SpeakeasyCore, + allowedScopes: Set, + allowedTools?: Set, +): (tool: ToolDefinition) => void { + return (tool: ToolDefinition): void => { + if (allowedTools && !allowedTools.has(tool.name)) { + return; + } + + const scopes = tool.scopes ?? []; + if (allowedScopes.size > 0 && scopes.length === 0) { + return; + } + + if ( + allowedScopes.size > 0 + && !scopes.every((s: MCPScope) => allowedScopes.has(s)) + ) { + return; + } + + if (tool.args) { + server.tool(tool.name, tool.description, tool.args, async (args, ctx) => { + return tool.tool(sdk, args, ctx); + }); + } else { + server.tool(tool.name, tool.description, async (ctx) => { + return tool.tool(sdk, ctx); + }); + } + + logger.debug("Registered tool", { name: tool.name }); + }; +} diff --git a/src/mcp-server/tools/artifactsCreateRemoteSource.ts b/src/mcp-server/tools/artifactsCreateRemoteSource.ts new file mode 100644 index 00000000..a7f0c52b --- /dev/null +++ b/src/mcp-server/tools/artifactsCreateRemoteSource.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { artifactsCreateRemoteSource } from "../../funcs/artifactsCreateRemoteSource.js"; +import * as shared from "../../sdk/models/shared/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: shared.RemoteSource$inboundSchema.optional(), +}; + +export const tool$artifactsCreateRemoteSource: ToolDefinition = { + name: "artifacts-create-remote-source", + description: `Configure a new remote source`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await artifactsCreateRemoteSource( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/artifactsGetBlob.ts b/src/mcp-server/tools/artifactsGetBlob.ts new file mode 100644 index 00000000..85d6b595 --- /dev/null +++ b/src/mcp-server/tools/artifactsGetBlob.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { artifactsGetBlob } from "../../funcs/artifactsGetBlob.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.GetBlobRequest$inboundSchema, +}; + +export const tool$artifactsGetBlob: ToolDefinition = { + name: "artifacts-get-blob", + description: `Get blob for a particular digest`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await artifactsGetBlob( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/artifactsGetManifest.ts b/src/mcp-server/tools/artifactsGetManifest.ts new file mode 100644 index 00000000..9c96e4d2 --- /dev/null +++ b/src/mcp-server/tools/artifactsGetManifest.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { artifactsGetManifest } from "../../funcs/artifactsGetManifest.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.GetManifestRequest$inboundSchema, +}; + +export const tool$artifactsGetManifest: ToolDefinition = { + name: "artifacts-get-manifest", + description: `Get manifest for a particular reference`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await artifactsGetManifest( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/artifactsGetNamespaces.ts b/src/mcp-server/tools/artifactsGetNamespaces.ts new file mode 100644 index 00000000..c10ffd70 --- /dev/null +++ b/src/mcp-server/tools/artifactsGetNamespaces.ts @@ -0,0 +1,28 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { artifactsGetNamespaces } from "../../funcs/artifactsGetNamespaces.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +export const tool$artifactsGetNamespaces: ToolDefinition = { + name: "artifacts-get-namespaces", + description: `Each namespace contains many revisions.`, + tool: async (client, ctx) => { + const [result, apiCall] = await artifactsGetNamespaces( + client, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/artifactsGetRevisions.ts b/src/mcp-server/tools/artifactsGetRevisions.ts new file mode 100644 index 00000000..e3be3c45 --- /dev/null +++ b/src/mcp-server/tools/artifactsGetRevisions.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { artifactsGetRevisions } from "../../funcs/artifactsGetRevisions.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.GetRevisionsRequest$inboundSchema, +}; + +export const tool$artifactsGetRevisions: ToolDefinition = { + name: "artifacts-get-revisions", + description: ``, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await artifactsGetRevisions( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/artifactsGetTags.ts b/src/mcp-server/tools/artifactsGetTags.ts new file mode 100644 index 00000000..2948350c --- /dev/null +++ b/src/mcp-server/tools/artifactsGetTags.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { artifactsGetTags } from "../../funcs/artifactsGetTags.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.GetTagsRequest$inboundSchema, +}; + +export const tool$artifactsGetTags: ToolDefinition = { + name: "artifacts-get-tags", + description: ``, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await artifactsGetTags( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/artifactsListRemoteSources.ts b/src/mcp-server/tools/artifactsListRemoteSources.ts new file mode 100644 index 00000000..92b520c1 --- /dev/null +++ b/src/mcp-server/tools/artifactsListRemoteSources.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { artifactsListRemoteSources } from "../../funcs/artifactsListRemoteSources.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.ListRemoteSourcesRequest$inboundSchema, +}; + +export const tool$artifactsListRemoteSources: ToolDefinition = { + name: "artifacts-list-remote-sources", + description: `Get remote sources attached to a particular namespace`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await artifactsListRemoteSources( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/artifactsPostTags.ts b/src/mcp-server/tools/artifactsPostTags.ts new file mode 100644 index 00000000..556865a9 --- /dev/null +++ b/src/mcp-server/tools/artifactsPostTags.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { artifactsPostTags } from "../../funcs/artifactsPostTags.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.PostTagsRequest$inboundSchema, +}; + +export const tool$artifactsPostTags: ToolDefinition = { + name: "artifacts-post-tags", + description: `Add tags to an existing revision`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await artifactsPostTags( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/artifactsPreflight.ts b/src/mcp-server/tools/artifactsPreflight.ts new file mode 100644 index 00000000..54588b47 --- /dev/null +++ b/src/mcp-server/tools/artifactsPreflight.ts @@ -0,0 +1,36 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { artifactsPreflight } from "../../funcs/artifactsPreflight.js"; +import * as shared from "../../sdk/models/shared/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: shared.PreflightRequest$inboundSchema.optional(), +}; + +export const tool$artifactsPreflight: ToolDefinition = { + name: "artifacts-preflight", + description: + `Get access token for communicating with OCI distribution endpoints`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await artifactsPreflight( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/artifactsSetArchived.ts b/src/mcp-server/tools/artifactsSetArchived.ts new file mode 100644 index 00000000..6bd48621 --- /dev/null +++ b/src/mcp-server/tools/artifactsSetArchived.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { artifactsSetArchived } from "../../funcs/artifactsSetArchived.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.ArchiveNamespaceRequest$inboundSchema, +}; + +export const tool$artifactsSetArchived: ToolDefinition = { + name: "artifacts-set-archived", + description: `Set whether a namespace is archived`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await artifactsSetArchived( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/artifactsSetVisibility.ts b/src/mcp-server/tools/artifactsSetVisibility.ts new file mode 100644 index 00000000..251b1fcf --- /dev/null +++ b/src/mcp-server/tools/artifactsSetVisibility.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { artifactsSetVisibility } from "../../funcs/artifactsSetVisibility.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.SetVisibilityRequest$inboundSchema, +}; + +export const tool$artifactsSetVisibility: ToolDefinition = { + name: "artifacts-set-visibility", + description: `Set visibility of a namespace with an existing metadata entry`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await artifactsSetVisibility( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/authGetAccess.ts b/src/mcp-server/tools/authGetAccess.ts new file mode 100644 index 00000000..07623cca --- /dev/null +++ b/src/mcp-server/tools/authGetAccess.ts @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { authGetAccess } from "../../funcs/authGetAccess.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.GetWorkspaceAccessRequest$inboundSchema, +}; + +export const tool$authGetAccess: ToolDefinition = { + name: "auth-get-access", + description: `Get access allowances for a particular workspace + +Checks if generation is permitted for a particular run of the CLI`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await authGetAccess( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/authGetAccessToken.ts b/src/mcp-server/tools/authGetAccessToken.ts new file mode 100644 index 00000000..0114d595 --- /dev/null +++ b/src/mcp-server/tools/authGetAccessToken.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { authGetAccessToken } from "../../funcs/authGetAccessToken.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.GetAccessTokenRequest$inboundSchema, +}; + +export const tool$authGetAccessToken: ToolDefinition = { + name: "auth-get-access-token", + description: `Get or refresh an access token for the current workspace.`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await authGetAccessToken( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/authGetUser.ts b/src/mcp-server/tools/authGetUser.ts new file mode 100644 index 00000000..7f1205dd --- /dev/null +++ b/src/mcp-server/tools/authGetUser.ts @@ -0,0 +1,28 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { authGetUser } from "../../funcs/authGetUser.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +export const tool$authGetUser: ToolDefinition = { + name: "auth-get-user", + description: `Get information about the current user.`, + tool: async (client, ctx) => { + const [result, apiCall] = await authGetUser( + client, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/authValidateApiKey.ts b/src/mcp-server/tools/authValidateApiKey.ts new file mode 100644 index 00000000..479fc5af --- /dev/null +++ b/src/mcp-server/tools/authValidateApiKey.ts @@ -0,0 +1,28 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { authValidateApiKey } from "../../funcs/authValidateApiKey.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +export const tool$authValidateApiKey: ToolDefinition = { + name: "auth-validate-api-key", + description: `Validate the current api key.`, + tool: async (client, ctx) => { + const [result, apiCall] = await authValidateApiKey( + client, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/codeSamplesGenerateCodeSamplePreview.ts b/src/mcp-server/tools/codeSamplesGenerateCodeSamplePreview.ts new file mode 100644 index 00000000..77dda3ed --- /dev/null +++ b/src/mcp-server/tools/codeSamplesGenerateCodeSamplePreview.ts @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { codeSamplesGenerateCodeSamplePreview } from "../../funcs/codeSamplesGenerateCodeSamplePreview.js"; +import * as shared from "../../sdk/models/shared/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: shared.CodeSampleSchemaInput$inboundSchema, +}; + +export const tool$codeSamplesGenerateCodeSamplePreview: ToolDefinition< + typeof args +> = { + name: "code-samples-generate-code-sample-preview", + description: + `Generate Code Sample previews from a file and configuration parameters. + +This endpoint generates Code Sample previews from a file and configuration parameters.`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await codeSamplesGenerateCodeSamplePreview( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/codeSamplesGenerateCodeSamplePreviewAsync.ts b/src/mcp-server/tools/codeSamplesGenerateCodeSamplePreviewAsync.ts new file mode 100644 index 00000000..5d5c5f41 --- /dev/null +++ b/src/mcp-server/tools/codeSamplesGenerateCodeSamplePreviewAsync.ts @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { codeSamplesGenerateCodeSamplePreviewAsync } from "../../funcs/codeSamplesGenerateCodeSamplePreviewAsync.js"; +import * as shared from "../../sdk/models/shared/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: shared.CodeSampleSchemaInput$inboundSchema, +}; + +export const tool$codeSamplesGenerateCodeSamplePreviewAsync: ToolDefinition< + typeof args +> = { + name: "code-samples-generate-code-sample-preview-async", + description: + `Initiate asynchronous Code Sample preview generation from a file and configuration parameters, receiving an async JobID response for polling. + +This endpoint generates Code Sample previews from a file and configuration parameters, receiving an async JobID response for polling.`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await codeSamplesGenerateCodeSamplePreviewAsync( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/codeSamplesGet.ts b/src/mcp-server/tools/codeSamplesGet.ts new file mode 100644 index 00000000..9167de7a --- /dev/null +++ b/src/mcp-server/tools/codeSamplesGet.ts @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { codeSamplesGet } from "../../funcs/codeSamplesGet.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.GetCodeSamplesRequest$inboundSchema, +}; + +export const tool$codeSamplesGet: ToolDefinition = { + name: "code-samples-get", + description: `Retrieve usage snippets + +Retrieve usage snippets from an OpenAPI document stored in the registry. Supports filtering by language and operation ID.`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await codeSamplesGet( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/codeSamplesGetCodeSamplePreviewAsync.ts b/src/mcp-server/tools/codeSamplesGetCodeSamplePreviewAsync.ts new file mode 100644 index 00000000..ddde7d03 --- /dev/null +++ b/src/mcp-server/tools/codeSamplesGetCodeSamplePreviewAsync.ts @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { codeSamplesGetCodeSamplePreviewAsync } from "../../funcs/codeSamplesGetCodeSamplePreviewAsync.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.GetCodeSamplePreviewAsyncRequest$inboundSchema, +}; + +export const tool$codeSamplesGetCodeSamplePreviewAsync: ToolDefinition< + typeof args +> = { + name: "code-samples-get-code-sample-preview-async", + description: + `Poll for the result of an asynchronous Code Sample preview generation. + +Poll for the result of an asynchronous Code Sample preview generation.`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await codeSamplesGetCodeSamplePreviewAsync( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/eventsGetEventsByTarget.ts b/src/mcp-server/tools/eventsGetEventsByTarget.ts new file mode 100644 index 00000000..c04bcc44 --- /dev/null +++ b/src/mcp-server/tools/eventsGetEventsByTarget.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { eventsGetEventsByTarget } from "../../funcs/eventsGetEventsByTarget.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.GetWorkspaceEventsByTargetRequest$inboundSchema, +}; + +export const tool$eventsGetEventsByTarget: ToolDefinition = { + name: "events-get-events-by-target", + description: `Load recent events for a particular workspace`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await eventsGetEventsByTarget( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/eventsGetTargets.ts b/src/mcp-server/tools/eventsGetTargets.ts new file mode 100644 index 00000000..e4a15982 --- /dev/null +++ b/src/mcp-server/tools/eventsGetTargets.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { eventsGetTargets } from "../../funcs/eventsGetTargets.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.GetWorkspaceTargetsRequest$inboundSchema, +}; + +export const tool$eventsGetTargets: ToolDefinition = { + name: "events-get-targets", + description: `Load targets for a particular workspace`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await eventsGetTargets( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/eventsGetTargetsDeprecated.ts b/src/mcp-server/tools/eventsGetTargetsDeprecated.ts new file mode 100644 index 00000000..4455a89e --- /dev/null +++ b/src/mcp-server/tools/eventsGetTargetsDeprecated.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { eventsGetTargetsDeprecated } from "../../funcs/eventsGetTargetsDeprecated.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.GetWorkspaceTargetsDeprecatedRequest$inboundSchema, +}; + +export const tool$eventsGetTargetsDeprecated: ToolDefinition = { + name: "events-get-targets-deprecated", + description: `Load targets for a particular workspace`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await eventsGetTargetsDeprecated( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/eventsPost.ts b/src/mcp-server/tools/eventsPost.ts new file mode 100644 index 00000000..269a184c --- /dev/null +++ b/src/mcp-server/tools/eventsPost.ts @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { eventsPost } from "../../funcs/eventsPost.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.PostWorkspaceEventsRequest$inboundSchema, +}; + +export const tool$eventsPost: ToolDefinition = { + name: "events-post", + description: `Post events for a specific workspace + +Sends an array of events to be stored for a particular workspace.`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await eventsPost( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/eventsSearch.ts b/src/mcp-server/tools/eventsSearch.ts new file mode 100644 index 00000000..f33a4efe --- /dev/null +++ b/src/mcp-server/tools/eventsSearch.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { eventsSearch } from "../../funcs/eventsSearch.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.SearchWorkspaceEventsRequest$inboundSchema, +}; + +export const tool$eventsSearch: ToolDefinition = { + name: "events-search", + description: `Search events for a particular workspace by any field`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await eventsSearch( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/githubCheckAccess.ts b/src/mcp-server/tools/githubCheckAccess.ts new file mode 100644 index 00000000..83bc0a42 --- /dev/null +++ b/src/mcp-server/tools/githubCheckAccess.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { githubCheckAccess } from "../../funcs/githubCheckAccess.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.CheckGithubAccessRequest$inboundSchema, +}; + +export const tool$githubCheckAccess: ToolDefinition = { + name: "github-check-access", + description: ``, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await githubCheckAccess( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/githubCheckPublishingPRs.ts b/src/mcp-server/tools/githubCheckPublishingPRs.ts new file mode 100644 index 00000000..788f5f74 --- /dev/null +++ b/src/mcp-server/tools/githubCheckPublishingPRs.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { githubCheckPublishingPRs } from "../../funcs/githubCheckPublishingPRs.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.GithubCheckPublishingPRsRequest$inboundSchema, +}; + +export const tool$githubCheckPublishingPRs: ToolDefinition = { + name: "github-check-publishing-P-rs", + description: ``, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await githubCheckPublishingPRs( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/githubCheckPublishingSecrets.ts b/src/mcp-server/tools/githubCheckPublishingSecrets.ts new file mode 100644 index 00000000..406db7cf --- /dev/null +++ b/src/mcp-server/tools/githubCheckPublishingSecrets.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { githubCheckPublishingSecrets } from "../../funcs/githubCheckPublishingSecrets.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.GithubCheckPublishingSecretsRequest$inboundSchema, +}; + +export const tool$githubCheckPublishingSecrets: ToolDefinition = { + name: "github-check-publishing-secrets", + description: ``, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await githubCheckPublishingSecrets( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/githubConfigureCodeSamples.ts b/src/mcp-server/tools/githubConfigureCodeSamples.ts new file mode 100644 index 00000000..cc8a5021 --- /dev/null +++ b/src/mcp-server/tools/githubConfigureCodeSamples.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { githubConfigureCodeSamples } from "../../funcs/githubConfigureCodeSamples.js"; +import * as shared from "../../sdk/models/shared/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: shared.GithubConfigureCodeSamplesRequest$inboundSchema, +}; + +export const tool$githubConfigureCodeSamples: ToolDefinition = { + name: "github-configure-code-samples", + description: ``, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await githubConfigureCodeSamples( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/githubConfigureMintlifyRepo.ts b/src/mcp-server/tools/githubConfigureMintlifyRepo.ts new file mode 100644 index 00000000..ecb11b23 --- /dev/null +++ b/src/mcp-server/tools/githubConfigureMintlifyRepo.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { githubConfigureMintlifyRepo } from "../../funcs/githubConfigureMintlifyRepo.js"; +import * as shared from "../../sdk/models/shared/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: shared.GithubConfigureMintlifyRepoRequest$inboundSchema, +}; + +export const tool$githubConfigureMintlifyRepo: ToolDefinition = { + name: "github-configure-mintlify-repo", + description: ``, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await githubConfigureMintlifyRepo( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/githubConfigureTarget.ts b/src/mcp-server/tools/githubConfigureTarget.ts new file mode 100644 index 00000000..2fa0ddb1 --- /dev/null +++ b/src/mcp-server/tools/githubConfigureTarget.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { githubConfigureTarget } from "../../funcs/githubConfigureTarget.js"; +import * as shared from "../../sdk/models/shared/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: shared.GithubConfigureTargetRequest$inboundSchema, +}; + +export const tool$githubConfigureTarget: ToolDefinition = { + name: "github-configure-target", + description: ``, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await githubConfigureTarget( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/githubGetAction.ts b/src/mcp-server/tools/githubGetAction.ts new file mode 100644 index 00000000..bca5d81b --- /dev/null +++ b/src/mcp-server/tools/githubGetAction.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { githubGetAction } from "../../funcs/githubGetAction.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.GetGitHubActionRequest$inboundSchema, +}; + +export const tool$githubGetAction: ToolDefinition = { + name: "github-get-action", + description: ``, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await githubGetAction( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/githubGetSetup.ts b/src/mcp-server/tools/githubGetSetup.ts new file mode 100644 index 00000000..0b84ed31 --- /dev/null +++ b/src/mcp-server/tools/githubGetSetup.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { githubGetSetup } from "../../funcs/githubGetSetup.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.GetGithubSetupStateRequest$inboundSchema, +}; + +export const tool$githubGetSetup: ToolDefinition = { + name: "github-get-setup", + description: ``, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await githubGetSetup( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/githubLinkGithub.ts b/src/mcp-server/tools/githubLinkGithub.ts new file mode 100644 index 00000000..0d266fc0 --- /dev/null +++ b/src/mcp-server/tools/githubLinkGithub.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { githubLinkGithub } from "../../funcs/githubLinkGithub.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.LinkGithubAccessRequest$inboundSchema, +}; + +export const tool$githubLinkGithub: ToolDefinition = { + name: "github-link-github", + description: ``, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await githubLinkGithub( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/githubStorePublishingSecrets.ts b/src/mcp-server/tools/githubStorePublishingSecrets.ts new file mode 100644 index 00000000..71f26f07 --- /dev/null +++ b/src/mcp-server/tools/githubStorePublishingSecrets.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { githubStorePublishingSecrets } from "../../funcs/githubStorePublishingSecrets.js"; +import * as shared from "../../sdk/models/shared/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: shared.GithubStorePublishingSecretsRequest$inboundSchema, +}; + +export const tool$githubStorePublishingSecrets: ToolDefinition = { + name: "github-store-publishing-secrets", + description: ``, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await githubStorePublishingSecrets( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/githubTriggerAction.ts b/src/mcp-server/tools/githubTriggerAction.ts new file mode 100644 index 00000000..4309bf05 --- /dev/null +++ b/src/mcp-server/tools/githubTriggerAction.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { githubTriggerAction } from "../../funcs/githubTriggerAction.js"; +import * as shared from "../../sdk/models/shared/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: shared.GithubTriggerActionRequest$inboundSchema, +}; + +export const tool$githubTriggerAction: ToolDefinition = { + name: "github-trigger-action", + description: ``, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await githubTriggerAction( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/organizationsCreate.ts b/src/mcp-server/tools/organizationsCreate.ts new file mode 100644 index 00000000..b3e0163d --- /dev/null +++ b/src/mcp-server/tools/organizationsCreate.ts @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { organizationsCreate } from "../../funcs/organizationsCreate.js"; +import * as shared from "../../sdk/models/shared/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: shared.Organization$inboundSchema, +}; + +export const tool$organizationsCreate: ToolDefinition = { + name: "organizations-create", + description: `Create an organization + +Creates an organization`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await organizationsCreate( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/organizationsCreateBillingAddOns.ts b/src/mcp-server/tools/organizationsCreateBillingAddOns.ts new file mode 100644 index 00000000..12919e24 --- /dev/null +++ b/src/mcp-server/tools/organizationsCreateBillingAddOns.ts @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { organizationsCreateBillingAddOns } from "../../funcs/organizationsCreateBillingAddOns.js"; +import * as shared from "../../sdk/models/shared/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: shared.OrganizationBillingAddOnRequest$inboundSchema, +}; + +export const tool$organizationsCreateBillingAddOns: ToolDefinition< + typeof args +> = { + name: "organizations-create-billing-add-ons", + description: `Create billing add ons`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await organizationsCreateBillingAddOns( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/organizationsCreateFreeTrial.ts b/src/mcp-server/tools/organizationsCreateFreeTrial.ts new file mode 100644 index 00000000..e7132cd4 --- /dev/null +++ b/src/mcp-server/tools/organizationsCreateFreeTrial.ts @@ -0,0 +1,30 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { organizationsCreateFreeTrial } from "../../funcs/organizationsCreateFreeTrial.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +export const tool$organizationsCreateFreeTrial: ToolDefinition = { + name: "organizations-create-free-trial", + description: `Create a free trial for an organization + +Creates a free trial for an organization`, + tool: async (client, ctx) => { + const [result, apiCall] = await organizationsCreateFreeTrial( + client, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/organizationsDeleteBillingAddOn.ts b/src/mcp-server/tools/organizationsDeleteBillingAddOn.ts new file mode 100644 index 00000000..d34ce4d2 --- /dev/null +++ b/src/mcp-server/tools/organizationsDeleteBillingAddOn.ts @@ -0,0 +1,36 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { organizationsDeleteBillingAddOn } from "../../funcs/organizationsDeleteBillingAddOn.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.DeleteBillingAddOnRequest$inboundSchema, +}; + +export const tool$organizationsDeleteBillingAddOn: ToolDefinition = + { + name: "organizations-delete-billing-add-on", + description: `Delete billing add ons`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await organizationsDeleteBillingAddOn( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, + }; diff --git a/src/mcp-server/tools/organizationsGet.ts b/src/mcp-server/tools/organizationsGet.ts new file mode 100644 index 00000000..e4d466a6 --- /dev/null +++ b/src/mcp-server/tools/organizationsGet.ts @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { organizationsGet } from "../../funcs/organizationsGet.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.GetOrganizationRequest$inboundSchema, +}; + +export const tool$organizationsGet: ToolDefinition = { + name: "organizations-get", + description: `Get organization + +Get information about a particular organization.`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await organizationsGet( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/organizationsGetAll.ts b/src/mcp-server/tools/organizationsGetAll.ts new file mode 100644 index 00000000..1662163c --- /dev/null +++ b/src/mcp-server/tools/organizationsGetAll.ts @@ -0,0 +1,30 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { organizationsGetAll } from "../../funcs/organizationsGetAll.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +export const tool$organizationsGetAll: ToolDefinition = { + name: "organizations-get-all", + description: `Get organizations for a user + +Returns a list of organizations a user has access too`, + tool: async (client, ctx) => { + const [result, apiCall] = await organizationsGetAll( + client, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/organizationsGetBillingAddOns.ts b/src/mcp-server/tools/organizationsGetBillingAddOns.ts new file mode 100644 index 00000000..0d2c601e --- /dev/null +++ b/src/mcp-server/tools/organizationsGetBillingAddOns.ts @@ -0,0 +1,28 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { organizationsGetBillingAddOns } from "../../funcs/organizationsGetBillingAddOns.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +export const tool$organizationsGetBillingAddOns: ToolDefinition = { + name: "organizations-get-billing-add-ons", + description: `Get billing add ons`, + tool: async (client, ctx) => { + const [result, apiCall] = await organizationsGetBillingAddOns( + client, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/organizationsGetUsage.ts b/src/mcp-server/tools/organizationsGetUsage.ts new file mode 100644 index 00000000..92b86f4a --- /dev/null +++ b/src/mcp-server/tools/organizationsGetUsage.ts @@ -0,0 +1,30 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { organizationsGetUsage } from "../../funcs/organizationsGetUsage.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +export const tool$organizationsGetUsage: ToolDefinition = { + name: "organizations-get-usage", + description: `Get billing usage summary for a particular organization + +Returns a billing usage summary by target languages for a particular organization`, + tool: async (client, ctx) => { + const [result, apiCall] = await organizationsGetUsage( + client, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/reportsGetChangesReportSignedUrl.ts b/src/mcp-server/tools/reportsGetChangesReportSignedUrl.ts new file mode 100644 index 00000000..576bb03a --- /dev/null +++ b/src/mcp-server/tools/reportsGetChangesReportSignedUrl.ts @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { reportsGetChangesReportSignedUrl } from "../../funcs/reportsGetChangesReportSignedUrl.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.GetChangesReportSignedUrlRequest$inboundSchema, +}; + +export const tool$reportsGetChangesReportSignedUrl: ToolDefinition< + typeof args +> = { + name: "reports-get-changes-report-signed-url", + description: + `Get the signed access url for the change reports for a particular document.`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await reportsGetChangesReportSignedUrl( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/reportsGetLintingReportSignedUrl.ts b/src/mcp-server/tools/reportsGetLintingReportSignedUrl.ts new file mode 100644 index 00000000..50b70769 --- /dev/null +++ b/src/mcp-server/tools/reportsGetLintingReportSignedUrl.ts @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { reportsGetLintingReportSignedUrl } from "../../funcs/reportsGetLintingReportSignedUrl.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.GetLintingReportSignedUrlRequest$inboundSchema, +}; + +export const tool$reportsGetLintingReportSignedUrl: ToolDefinition< + typeof args +> = { + name: "reports-get-linting-report-signed-url", + description: + `Get the signed access url for the linting reports for a particular document.`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await reportsGetLintingReportSignedUrl( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/reportsUploadReport.ts b/src/mcp-server/tools/reportsUploadReport.ts new file mode 100644 index 00000000..4ad94fcc --- /dev/null +++ b/src/mcp-server/tools/reportsUploadReport.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { reportsUploadReport } from "../../funcs/reportsUploadReport.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.UploadReportRequestBody$inboundSchema, +}; + +export const tool$reportsUploadReport: ToolDefinition = { + name: "reports-upload-report", + description: `Upload a report.`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await reportsUploadReport( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/schemaStoreCreateSchemaStoreItem.ts b/src/mcp-server/tools/schemaStoreCreateSchemaStoreItem.ts new file mode 100644 index 00000000..504c0a99 --- /dev/null +++ b/src/mcp-server/tools/schemaStoreCreateSchemaStoreItem.ts @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { schemaStoreCreateSchemaStoreItem } from "../../funcs/schemaStoreCreateSchemaStoreItem.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.CreateSchemaStoreItemRequestBody$inboundSchema, +}; + +export const tool$schemaStoreCreateSchemaStoreItem: ToolDefinition< + typeof args +> = { + name: "schema-store-create-schema-store-item", + description: `Create a schema in the schema store`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await schemaStoreCreateSchemaStoreItem( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/shortURLsCreate.ts b/src/mcp-server/tools/shortURLsCreate.ts new file mode 100644 index 00000000..083115f5 --- /dev/null +++ b/src/mcp-server/tools/shortURLsCreate.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { shortURLsCreate } from "../../funcs/shortURLsCreate.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.CreateRequestBody$inboundSchema, +}; + +export const tool$shortURLsCreate: ToolDefinition = { + name: "short-UR-ls-create", + description: `Shorten a URL.`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await shortURLsCreate( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/subscriptionsActivateSubscriptionNamespace.ts b/src/mcp-server/tools/subscriptionsActivateSubscriptionNamespace.ts new file mode 100644 index 00000000..df07f8dc --- /dev/null +++ b/src/mcp-server/tools/subscriptionsActivateSubscriptionNamespace.ts @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { subscriptionsActivateSubscriptionNamespace } from "../../funcs/subscriptionsActivateSubscriptionNamespace.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.ActivateSubscriptionNamespaceRequest$inboundSchema, +}; + +export const tool$subscriptionsActivateSubscriptionNamespace: ToolDefinition< + typeof args +> = { + name: "subscriptions-activate-subscription-namespace", + description: `Activate an ignored namespace for a subscription`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await subscriptionsActivateSubscriptionNamespace( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/subscriptionsIgnoreSubscriptionNamespace.ts b/src/mcp-server/tools/subscriptionsIgnoreSubscriptionNamespace.ts new file mode 100644 index 00000000..6dfdade8 --- /dev/null +++ b/src/mcp-server/tools/subscriptionsIgnoreSubscriptionNamespace.ts @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { subscriptionsIgnoreSubscriptionNamespace } from "../../funcs/subscriptionsIgnoreSubscriptionNamespace.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.IgnoreSubscriptionNamespaceRequest$inboundSchema, +}; + +export const tool$subscriptionsIgnoreSubscriptionNamespace: ToolDefinition< + typeof args +> = { + name: "subscriptions-ignore-subscription-namespace", + description: `Ignored a namespace for a subscription`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await subscriptionsIgnoreSubscriptionNamespace( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/suggestSuggest.ts b/src/mcp-server/tools/suggestSuggest.ts new file mode 100644 index 00000000..8cb5bac6 --- /dev/null +++ b/src/mcp-server/tools/suggestSuggest.ts @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { suggestSuggest } from "../../funcs/suggestSuggest.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.SuggestRequest$inboundSchema, +}; + +export const tool$suggestSuggest: ToolDefinition = { + name: "suggest-suggest", + description: `Generate suggestions for improving an OpenAPI document. + +Get suggestions from an LLM model for improving an OpenAPI document.`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await suggestSuggest( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/suggestSuggestItems.ts b/src/mcp-server/tools/suggestSuggestItems.ts new file mode 100644 index 00000000..b7a1246c --- /dev/null +++ b/src/mcp-server/tools/suggestSuggestItems.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { suggestSuggestItems } from "../../funcs/suggestSuggestItems.js"; +import * as shared from "../../sdk/models/shared/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: shared.SuggestItemsRequestBody$inboundSchema, +}; + +export const tool$suggestSuggestItems: ToolDefinition = { + name: "suggest-suggest-items", + description: `Generate generic suggestions for a list of items.`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await suggestSuggestItems( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/suggestSuggestOpenAPI.ts b/src/mcp-server/tools/suggestSuggestOpenAPI.ts new file mode 100644 index 00000000..619f4294 --- /dev/null +++ b/src/mcp-server/tools/suggestSuggestOpenAPI.ts @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { suggestSuggestOpenAPI } from "../../funcs/suggestSuggestOpenAPI.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.SuggestOpenAPIRequest$inboundSchema, +}; + +export const tool$suggestSuggestOpenAPI: ToolDefinition = { + name: "suggest-suggest-open-API", + description: + `(DEPRECATED) Generate suggestions for improving an OpenAPI document. + +Get suggestions from an LLM model for improving an OpenAPI document.`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await suggestSuggestOpenAPI( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/suggestSuggestOpenAPIRegistry.ts b/src/mcp-server/tools/suggestSuggestOpenAPIRegistry.ts new file mode 100644 index 00000000..814130e9 --- /dev/null +++ b/src/mcp-server/tools/suggestSuggestOpenAPIRegistry.ts @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { suggestSuggestOpenAPIRegistry } from "../../funcs/suggestSuggestOpenAPIRegistry.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.SuggestOpenAPIRegistryRequest$inboundSchema, +}; + +export const tool$suggestSuggestOpenAPIRegistry: ToolDefinition = { + name: "suggest-suggest-open-API-registry", + description: + `Generate suggestions for improving an OpenAPI document stored in the registry. + +Get suggestions from an LLM model for improving an OpenAPI document stored in the registry.`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await suggestSuggestOpenAPIRegistry( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/workspacesCreate.ts b/src/mcp-server/tools/workspacesCreate.ts new file mode 100644 index 00000000..f1572b85 --- /dev/null +++ b/src/mcp-server/tools/workspacesCreate.ts @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { workspacesCreate } from "../../funcs/workspacesCreate.js"; +import * as shared from "../../sdk/models/shared/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: shared.Workspace$inboundSchema, +}; + +export const tool$workspacesCreate: ToolDefinition = { + name: "workspaces-create", + description: `Create a workspace + +Creates a workspace`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await workspacesCreate( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/workspacesCreateToken.ts b/src/mcp-server/tools/workspacesCreateToken.ts new file mode 100644 index 00000000..2d5e83dc --- /dev/null +++ b/src/mcp-server/tools/workspacesCreateToken.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { workspacesCreateToken } from "../../funcs/workspacesCreateToken.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.CreateWorkspaceTokenRequest$inboundSchema, +}; + +export const tool$workspacesCreateToken: ToolDefinition = { + name: "workspaces-create-token", + description: `Create a token for a particular workspace`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await workspacesCreateToken( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/workspacesDeleteToken.ts b/src/mcp-server/tools/workspacesDeleteToken.ts new file mode 100644 index 00000000..2ea7b5fc --- /dev/null +++ b/src/mcp-server/tools/workspacesDeleteToken.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { workspacesDeleteToken } from "../../funcs/workspacesDeleteToken.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.DeleteWorkspaceTokenRequest$inboundSchema, +}; + +export const tool$workspacesDeleteToken: ToolDefinition = { + name: "workspaces-delete-token", + description: `Delete a token for a particular workspace`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await workspacesDeleteToken( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/workspacesGet.ts b/src/mcp-server/tools/workspacesGet.ts new file mode 100644 index 00000000..4adfc599 --- /dev/null +++ b/src/mcp-server/tools/workspacesGet.ts @@ -0,0 +1,30 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { workspacesGet } from "../../funcs/workspacesGet.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +export const tool$workspacesGet: ToolDefinition = { + name: "workspaces-get", + description: `Get workspace by context + +Get information about a particular workspace by context.`, + tool: async (client, ctx) => { + const [result, apiCall] = await workspacesGet( + client, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/workspacesGetAll.ts b/src/mcp-server/tools/workspacesGetAll.ts new file mode 100644 index 00000000..2059ea4b --- /dev/null +++ b/src/mcp-server/tools/workspacesGetAll.ts @@ -0,0 +1,30 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { workspacesGetAll } from "../../funcs/workspacesGetAll.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +export const tool$workspacesGetAll: ToolDefinition = { + name: "workspaces-get-all", + description: `Get workspaces for a user + +Returns a list of workspaces a user has access too`, + tool: async (client, ctx) => { + const [result, apiCall] = await workspacesGetAll( + client, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/workspacesGetByID.ts b/src/mcp-server/tools/workspacesGetByID.ts new file mode 100644 index 00000000..c865da3b --- /dev/null +++ b/src/mcp-server/tools/workspacesGetByID.ts @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { workspacesGetByID } from "../../funcs/workspacesGetByID.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.GetWorkspaceRequest$inboundSchema, +}; + +export const tool$workspacesGetByID: ToolDefinition = { + name: "workspaces-get-by-ID", + description: `Get workspace + +Get information about a particular workspace.`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await workspacesGetByID( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/workspacesGetFeatureFlags.ts b/src/mcp-server/tools/workspacesGetFeatureFlags.ts new file mode 100644 index 00000000..2241ec5c --- /dev/null +++ b/src/mcp-server/tools/workspacesGetFeatureFlags.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { workspacesGetFeatureFlags } from "../../funcs/workspacesGetFeatureFlags.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.GetWorkspaceFeatureFlagsRequest$inboundSchema, +}; + +export const tool$workspacesGetFeatureFlags: ToolDefinition = { + name: "workspaces-get-feature-flags", + description: `Get workspace feature flags`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await workspacesGetFeatureFlags( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/workspacesGetSettings.ts b/src/mcp-server/tools/workspacesGetSettings.ts new file mode 100644 index 00000000..2289360f --- /dev/null +++ b/src/mcp-server/tools/workspacesGetSettings.ts @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { workspacesGetSettings } from "../../funcs/workspacesGetSettings.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.GetWorkspaceSettingsRequest$inboundSchema, +}; + +export const tool$workspacesGetSettings: ToolDefinition = { + name: "workspaces-get-settings", + description: `Get workspace settings + +Get settings about a particular workspace.`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await workspacesGetSettings( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/workspacesGetTeam.ts b/src/mcp-server/tools/workspacesGetTeam.ts new file mode 100644 index 00000000..8af39925 --- /dev/null +++ b/src/mcp-server/tools/workspacesGetTeam.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { workspacesGetTeam } from "../../funcs/workspacesGetTeam.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.GetWorkspaceTeamRequest$inboundSchema, +}; + +export const tool$workspacesGetTeam: ToolDefinition = { + name: "workspaces-get-team", + description: `Get team members for a particular workspace`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await workspacesGetTeam( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/workspacesGetTokens.ts b/src/mcp-server/tools/workspacesGetTokens.ts new file mode 100644 index 00000000..125a47a8 --- /dev/null +++ b/src/mcp-server/tools/workspacesGetTokens.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { workspacesGetTokens } from "../../funcs/workspacesGetTokens.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.GetWorkspaceTokensRequest$inboundSchema, +}; + +export const tool$workspacesGetTokens: ToolDefinition = { + name: "workspaces-get-tokens", + description: `Get tokens for a particular workspace`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await workspacesGetTokens( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/workspacesGrantAccess.ts b/src/mcp-server/tools/workspacesGrantAccess.ts new file mode 100644 index 00000000..4b61487c --- /dev/null +++ b/src/mcp-server/tools/workspacesGrantAccess.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { workspacesGrantAccess } from "../../funcs/workspacesGrantAccess.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.GrantUserAccessToWorkspaceRequest$inboundSchema, +}; + +export const tool$workspacesGrantAccess: ToolDefinition = { + name: "workspaces-grant-access", + description: `Grant a user access to a particular workspace`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await workspacesGrantAccess( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/workspacesRevokeAccess.ts b/src/mcp-server/tools/workspacesRevokeAccess.ts new file mode 100644 index 00000000..d0fe3726 --- /dev/null +++ b/src/mcp-server/tools/workspacesRevokeAccess.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { workspacesRevokeAccess } from "../../funcs/workspacesRevokeAccess.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.RevokeUserAccessToWorkspaceRequest$inboundSchema, +}; + +export const tool$workspacesRevokeAccess: ToolDefinition = { + name: "workspaces-revoke-access", + description: `Revoke a user's access to a particular workspace`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await workspacesRevokeAccess( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/workspacesSetFeatureFlags.ts b/src/mcp-server/tools/workspacesSetFeatureFlags.ts new file mode 100644 index 00000000..d6caab32 --- /dev/null +++ b/src/mcp-server/tools/workspacesSetFeatureFlags.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { workspacesSetFeatureFlags } from "../../funcs/workspacesSetFeatureFlags.js"; +import * as shared from "../../sdk/models/shared/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: shared.WorkspaceFeatureFlagRequest$inboundSchema, +}; + +export const tool$workspacesSetFeatureFlags: ToolDefinition = { + name: "workspaces-set-feature-flags", + description: `Set workspace feature flags`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await workspacesSetFeatureFlags( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/workspacesUpdate.ts b/src/mcp-server/tools/workspacesUpdate.ts new file mode 100644 index 00000000..4b456dcd --- /dev/null +++ b/src/mcp-server/tools/workspacesUpdate.ts @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { workspacesUpdate } from "../../funcs/workspacesUpdate.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.UpdateWorkspaceDetailsRequest$inboundSchema, +}; + +export const tool$workspacesUpdate: ToolDefinition = { + name: "workspaces-update", + description: `Update workspace details + +Update information about a particular workspace.`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await workspacesUpdate( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/workspacesUpdateSettings.ts b/src/mcp-server/tools/workspacesUpdateSettings.ts new file mode 100644 index 00000000..7f5b48f1 --- /dev/null +++ b/src/mcp-server/tools/workspacesUpdateSettings.ts @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { workspacesUpdateSettings } from "../../funcs/workspacesUpdateSettings.js"; +import * as operations from "../../sdk/models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.UpdateWorkspaceSettingsRequest$inboundSchema, +}; + +export const tool$workspacesUpdateSettings: ToolDefinition = { + name: "workspaces-update-settings", + description: `Update workspace settings + +Update settings about a particular workspace.`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await workspacesUpdateSettings( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/sdk/apiendpoints.ts b/src/sdk/apiendpoints.ts deleted file mode 100644 index 25bd9170..00000000 --- a/src/sdk/apiendpoints.ts +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { apiEndpointsDeleteApiEndpoint } from "../funcs/apiEndpointsDeleteApiEndpoint.js"; -import { apiEndpointsFindApiEndpoint } from "../funcs/apiEndpointsFindApiEndpoint.js"; -import { apiEndpointsGenerateOpenApiSpecForApiEndpoint } from "../funcs/apiEndpointsGenerateOpenApiSpecForApiEndpoint.js"; -import { - apiEndpointsGeneratePostmanCollectionForApiEndpoint, - GeneratePostmanCollectionForApiEndpointAcceptEnum, -} from "../funcs/apiEndpointsGeneratePostmanCollectionForApiEndpoint.js"; -import { apiEndpointsGetAllApiEndpoints } from "../funcs/apiEndpointsGetAllApiEndpoints.js"; -import { apiEndpointsGetAllForVersionApiEndpoints } from "../funcs/apiEndpointsGetAllForVersionApiEndpoints.js"; -import { apiEndpointsGetApiEndpoint } from "../funcs/apiEndpointsGetApiEndpoint.js"; -import { apiEndpointsUpsertApiEndpoint } from "../funcs/apiEndpointsUpsertApiEndpoint.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export { GeneratePostmanCollectionForApiEndpointAcceptEnum } from "../funcs/apiEndpointsGeneratePostmanCollectionForApiEndpoint.js"; - -export class ApiEndpoints extends ClientSDK { - /** - * Delete an ApiEndpoint. - * - * @remarks - * Delete an ApiEndpoint. This will also delete all associated Request Logs (if using a Postgres datastore). - */ - async deleteApiEndpoint( - request: operations.DeleteApiEndpointRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(apiEndpointsDeleteApiEndpoint( - this, - request, - options, - )); - } - - /** - * Find an ApiEndpoint via its displayName. - * - * @remarks - * Find an ApiEndpoint via its displayName (set by operationId from a registered OpenAPI schema). - * This is useful for finding the ID of an ApiEndpoint to use in the /v1/apis/{apiID}/version/{versionID}/api_endpoints/{apiEndpointID} endpoints. - */ - async findApiEndpoint( - request: operations.FindApiEndpointRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(apiEndpointsFindApiEndpoint( - this, - request, - options, - )); - } - - /** - * Generate an OpenAPI specification for a particular ApiEndpoint. - * - * @remarks - * This endpoint will generate a new operation in any registered OpenAPI document if the operation does not already exist in the document. - * Returns the original document and the newly generated document allowing a diff to be performed to see what has changed. - */ - async generateOpenApiSpecForApiEndpoint( - request: operations.GenerateOpenApiSpecForApiEndpointRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(apiEndpointsGenerateOpenApiSpecForApiEndpoint( - this, - request, - options, - )); - } - - /** - * Generate a Postman collection for a particular ApiEndpoint. - * - * @remarks - * Generates a postman collection that allows the endpoint to be called from postman variables produced for any path/query/header parameters included in the OpenAPI document. - */ - async generatePostmanCollectionForApiEndpoint( - request: operations.GeneratePostmanCollectionForApiEndpointRequest, - options?: RequestOptions & { - acceptHeaderOverride?: GeneratePostmanCollectionForApiEndpointAcceptEnum; - }, - ): Promise { - return unwrapAsync(apiEndpointsGeneratePostmanCollectionForApiEndpoint( - this, - request, - options, - )); - } - - /** - * Get all Api endpoints for a particular apiID. - */ - async getAllApiEndpoints( - request: operations.GetAllApiEndpointsRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(apiEndpointsGetAllApiEndpoints( - this, - request, - options, - )); - } - - /** - * Get all ApiEndpoints for a particular apiID and versionID. - */ - async getAllForVersionApiEndpoints( - request: operations.GetAllForVersionApiEndpointsRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(apiEndpointsGetAllForVersionApiEndpoints( - this, - request, - options, - )); - } - - /** - * Get an ApiEndpoint. - */ - async getApiEndpoint( - request: operations.GetApiEndpointRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(apiEndpointsGetApiEndpoint( - this, - request, - options, - )); - } - - /** - * Upsert an ApiEndpoint. - * - * @remarks - * Upsert an ApiEndpoint. If the ApiEndpoint does not exist it will be created, otherwise it will be updated. - */ - async upsertApiEndpoint( - request: operations.UpsertApiEndpointRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(apiEndpointsUpsertApiEndpoint( - this, - request, - options, - )); - } -} diff --git a/src/sdk/apis.ts b/src/sdk/apis.ts deleted file mode 100644 index 72531b34..00000000 --- a/src/sdk/apis.ts +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { apisDeleteApi } from "../funcs/apisDeleteApi.js"; -import { apisGenerateOpenApiSpec } from "../funcs/apisGenerateOpenApiSpec.js"; -import { - apisGeneratePostmanCollection, - GeneratePostmanCollectionAcceptEnum, -} from "../funcs/apisGeneratePostmanCollection.js"; -import { apisGetAllApiVersions } from "../funcs/apisGetAllApiVersions.js"; -import { apisGetApis } from "../funcs/apisGetApis.js"; -import { apisUpsertApi } from "../funcs/apisUpsertApi.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export { GeneratePostmanCollectionAcceptEnum } from "../funcs/apisGeneratePostmanCollection.js"; - -export class Apis extends ClientSDK { - /** - * Delete an Api. - * - * @remarks - * Delete a particular version of an Api. The will also delete all associated ApiEndpoints, Metadata, Schemas & Request Logs (if using a Postgres datastore). - */ - async deleteApi( - request: operations.DeleteApiRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(apisDeleteApi( - this, - request, - options, - )); - } - - /** - * Generate an OpenAPI specification for a particular Api. - * - * @remarks - * This endpoint will generate any missing operations in any registered OpenAPI document if the operation does not already exist in the document. - * Returns the original document and the newly generated document allowing a diff to be performed to see what has changed. - */ - async generateOpenApiSpec( - request: operations.GenerateOpenApiSpecRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(apisGenerateOpenApiSpec( - this, - request, - options, - )); - } - - /** - * Generate a Postman collection for a particular Api. - * - * @remarks - * Generates a postman collection containing all endpoints for a particular API. Includes variables produced for any path/query/header parameters included in the OpenAPI document. - */ - async generatePostmanCollection( - request: operations.GeneratePostmanCollectionRequest, - options?: RequestOptions & { - acceptHeaderOverride?: GeneratePostmanCollectionAcceptEnum; - }, - ): Promise { - return unwrapAsync(apisGeneratePostmanCollection( - this, - request, - options, - )); - } - - /** - * Get all Api versions for a particular ApiEndpoint. - * - * @remarks - * Get all Api versions for a particular ApiEndpoint. - * Supports filtering the versions based on metadata attributes. - */ - async getAllApiVersions( - request: operations.GetAllApiVersionsRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(apisGetAllApiVersions( - this, - request, - options, - )); - } - - /** - * Get a list of Apis for a given workspace - * - * @remarks - * Get a list of all Apis and their versions for a given workspace. - * Supports filtering the APIs based on metadata attributes. - */ - async getApis( - request: operations.GetApisRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(apisGetApis( - this, - request, - options, - )); - } - - /** - * Upsert an Api - * - * @remarks - * Upsert an Api. If the Api does not exist, it will be created. - * If the Api exists, it will be updated. - */ - async upsertApi( - request: operations.UpsertApiRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(apisUpsertApi( - this, - request, - options, - )); - } -} diff --git a/src/sdk/artifacts.ts b/src/sdk/artifacts.ts index 50314c43..43ac24b9 100644 --- a/src/sdk/artifacts.ts +++ b/src/sdk/artifacts.ts @@ -2,6 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ +import { artifactsCreateRemoteSource } from "../funcs/artifactsCreateRemoteSource.js"; import { artifactsGetBlob, GetBlobAcceptEnum, @@ -13,8 +14,11 @@ import { import { artifactsGetNamespaces } from "../funcs/artifactsGetNamespaces.js"; import { artifactsGetRevisions } from "../funcs/artifactsGetRevisions.js"; import { artifactsGetTags } from "../funcs/artifactsGetTags.js"; +import { artifactsListRemoteSources } from "../funcs/artifactsListRemoteSources.js"; import { artifactsPostTags } from "../funcs/artifactsPostTags.js"; import { artifactsPreflight } from "../funcs/artifactsPreflight.js"; +import { artifactsSetArchived } from "../funcs/artifactsSetArchived.js"; +import { artifactsSetVisibility } from "../funcs/artifactsSetVisibility.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as operations from "./models/operations/index.js"; import * as shared from "./models/shared/index.js"; @@ -25,6 +29,20 @@ export { GetBlobAcceptEnum } from "../funcs/artifactsGetBlob.js"; export { GetManifestAcceptEnum } from "../funcs/artifactsGetManifest.js"; export class Artifacts extends ClientSDK { + /** + * Configure a new remote source + */ + async createRemoteSource( + request?: shared.RemoteSource | undefined, + options?: RequestOptions, + ): Promise { + return unwrapAsync(artifactsCreateRemoteSource( + this, + request, + options, + )); + } + /** * Get blob for a particular digest */ @@ -87,6 +105,20 @@ export class Artifacts extends ClientSDK { )); } + /** + * Get remote sources attached to a particular namespace + */ + async listRemoteSources( + request: operations.ListRemoteSourcesRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(artifactsListRemoteSources( + this, + request, + options, + )); + } + /** * Add tags to an existing revision */ @@ -114,4 +146,32 @@ export class Artifacts extends ClientSDK { options, )); } + + /** + * Set whether a namespace is archived + */ + async setArchived( + request: operations.ArchiveNamespaceRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(artifactsSetArchived( + this, + request, + options, + )); + } + + /** + * Set visibility of a namespace with an existing metadata entry + */ + async setVisibility( + request: operations.SetVisibilityRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(artifactsSetVisibility( + this, + request, + options, + )); + } } diff --git a/src/sdk/codesamples.ts b/src/sdk/codesamples.ts new file mode 100644 index 00000000..6e6d5f31 --- /dev/null +++ b/src/sdk/codesamples.ts @@ -0,0 +1,82 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { codeSamplesGenerateCodeSamplePreview } from "../funcs/codeSamplesGenerateCodeSamplePreview.js"; +import { codeSamplesGenerateCodeSamplePreviewAsync } from "../funcs/codeSamplesGenerateCodeSamplePreviewAsync.js"; +import { codeSamplesGet } from "../funcs/codeSamplesGet.js"; +import { codeSamplesGetCodeSamplePreviewAsync } from "../funcs/codeSamplesGetCodeSamplePreviewAsync.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as operations from "./models/operations/index.js"; +import * as shared from "./models/shared/index.js"; +import { unwrapAsync } from "./types/fp.js"; + +export class CodeSamples extends ClientSDK { + /** + * Generate Code Sample previews from a file and configuration parameters. + * + * @remarks + * This endpoint generates Code Sample previews from a file and configuration parameters. + */ + async generateCodeSamplePreview( + request: shared.CodeSampleSchemaInput, + options?: RequestOptions, + ): Promise { + return unwrapAsync(codeSamplesGenerateCodeSamplePreview( + this, + request, + options, + )); + } + + /** + * Initiate asynchronous Code Sample preview generation from a file and configuration parameters, receiving an async JobID response for polling. + * + * @remarks + * This endpoint generates Code Sample previews from a file and configuration parameters, receiving an async JobID response for polling. + */ + async generateCodeSamplePreviewAsync( + request: shared.CodeSampleSchemaInput, + options?: RequestOptions, + ): Promise { + return unwrapAsync(codeSamplesGenerateCodeSamplePreviewAsync( + this, + request, + options, + )); + } + + /** + * Retrieve usage snippets + * + * @remarks + * Retrieve usage snippets from an OpenAPI document stored in the registry. Supports filtering by language and operation ID. + */ + async get( + request: operations.GetCodeSamplesRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(codeSamplesGet( + this, + request, + options, + )); + } + + /** + * Poll for the result of an asynchronous Code Sample preview generation. + * + * @remarks + * Poll for the result of an asynchronous Code Sample preview generation. + */ + async getCodeSamplePreviewAsync( + request: operations.GetCodeSamplePreviewAsyncRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(codeSamplesGetCodeSamplePreviewAsync( + this, + request, + options, + )); + } +} diff --git a/src/sdk/embeds.ts b/src/sdk/embeds.ts deleted file mode 100644 index 04d8b801..00000000 --- a/src/sdk/embeds.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { embedsGetEmbedAccessToken } from "../funcs/embedsGetEmbedAccessToken.js"; -import { embedsGetValidEmbedAccessTokens } from "../funcs/embedsGetValidEmbedAccessTokens.js"; -import { embedsRevokeEmbedAccessToken } from "../funcs/embedsRevokeEmbedAccessToken.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class Embeds extends ClientSDK { - /** - * Get an embed access token for the current workspace. - * - * @remarks - * Returns an embed access token for the current workspace. This can be used to authenticate access to externally embedded content. - * Filters can be applied allowing views to be filtered to things like particular customerIds. - */ - async getEmbedAccessToken( - request: operations.GetEmbedAccessTokenRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(embedsGetEmbedAccessToken( - this, - request, - options, - )); - } - - /** - * Get all valid embed access tokens for the current workspace. - */ - async getValidEmbedAccessTokens( - options?: RequestOptions, - ): Promise { - return unwrapAsync(embedsGetValidEmbedAccessTokens( - this, - options, - )); - } - - /** - * Revoke an embed access EmbedToken. - */ - async revokeEmbedAccessToken( - request: operations.RevokeEmbedAccessTokenRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(embedsRevokeEmbedAccessToken( - this, - request, - options, - )); - } -} diff --git a/src/sdk/github.ts b/src/sdk/github.ts index 8b0baa58..dd3fa4a6 100644 --- a/src/sdk/github.ts +++ b/src/sdk/github.ts @@ -9,6 +9,8 @@ import { githubConfigureCodeSamples } from "../funcs/githubConfigureCodeSamples. import { githubConfigureMintlifyRepo } from "../funcs/githubConfigureMintlifyRepo.js"; import { githubConfigureTarget } from "../funcs/githubConfigureTarget.js"; import { githubGetAction } from "../funcs/githubGetAction.js"; +import { githubGetSetup } from "../funcs/githubGetSetup.js"; +import { githubLinkGithub } from "../funcs/githubLinkGithub.js"; import { githubStorePublishingSecrets } from "../funcs/githubStorePublishingSecrets.js"; import { githubTriggerAction } from "../funcs/githubTriggerAction.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; @@ -94,6 +96,28 @@ export class Github extends ClientSDK { )); } + async getSetup( + request: operations.GetGithubSetupStateRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(githubGetSetup( + this, + request, + options, + )); + } + + async linkGithub( + request: operations.LinkGithubAccessRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(githubLinkGithub( + this, + request, + options, + )); + } + async storePublishingSecrets( request: shared.GithubStorePublishingSecretsRequest, options?: RequestOptions, diff --git a/src/sdk/metadata.ts b/src/sdk/metadata.ts deleted file mode 100644 index 0f12d377..00000000 --- a/src/sdk/metadata.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { metadataDeleteVersionMetadata } from "../funcs/metadataDeleteVersionMetadata.js"; -import { metadataGetVersionMetadata } from "../funcs/metadataGetVersionMetadata.js"; -import { metadataInsertVersionMetadata } from "../funcs/metadataInsertVersionMetadata.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class Metadata extends ClientSDK { - /** - * Delete metadata for a particular apiID and versionID. - */ - async deleteVersionMetadata( - request: operations.DeleteVersionMetadataRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(metadataDeleteVersionMetadata( - this, - request, - options, - )); - } - - /** - * Get all metadata for a particular apiID and versionID. - */ - async getVersionMetadata( - request: operations.GetVersionMetadataRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(metadataGetVersionMetadata( - this, - request, - options, - )); - } - - /** - * Insert metadata for a particular apiID and versionID. - */ - async insertVersionMetadata( - request: operations.InsertVersionMetadataRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(metadataInsertVersionMetadata( - this, - request, - options, - )); - } -} diff --git a/src/sdk/models/operations/activatesubscriptionnamespace.ts b/src/sdk/models/operations/activatesubscriptionnamespace.ts new file mode 100644 index 00000000..6c0975fa --- /dev/null +++ b/src/sdk/models/operations/activatesubscriptionnamespace.ts @@ -0,0 +1,81 @@ +/* + * 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 ActivateSubscriptionNamespaceRequest = { + /** + * The existing subscription ID + */ + subscriptionID: string; + /** + * The namespace name + */ + namespaceName: string; +}; + +/** @internal */ +export const ActivateSubscriptionNamespaceRequest$inboundSchema: z.ZodType< + ActivateSubscriptionNamespaceRequest, + z.ZodTypeDef, + unknown +> = z.object({ + subscriptionID: z.string(), + namespaceName: z.string(), +}); + +/** @internal */ +export type ActivateSubscriptionNamespaceRequest$Outbound = { + subscriptionID: string; + namespaceName: string; +}; + +/** @internal */ +export const ActivateSubscriptionNamespaceRequest$outboundSchema: z.ZodType< + ActivateSubscriptionNamespaceRequest$Outbound, + z.ZodTypeDef, + ActivateSubscriptionNamespaceRequest +> = z.object({ + subscriptionID: z.string(), + namespaceName: 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 ActivateSubscriptionNamespaceRequest$ { + /** @deprecated use `ActivateSubscriptionNamespaceRequest$inboundSchema` instead. */ + export const inboundSchema = + ActivateSubscriptionNamespaceRequest$inboundSchema; + /** @deprecated use `ActivateSubscriptionNamespaceRequest$outboundSchema` instead. */ + export const outboundSchema = + ActivateSubscriptionNamespaceRequest$outboundSchema; + /** @deprecated use `ActivateSubscriptionNamespaceRequest$Outbound` instead. */ + export type Outbound = ActivateSubscriptionNamespaceRequest$Outbound; +} + +export function activateSubscriptionNamespaceRequestToJSON( + activateSubscriptionNamespaceRequest: ActivateSubscriptionNamespaceRequest, +): string { + return JSON.stringify( + ActivateSubscriptionNamespaceRequest$outboundSchema.parse( + activateSubscriptionNamespaceRequest, + ), + ); +} + +export function activateSubscriptionNamespaceRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + ActivateSubscriptionNamespaceRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ActivateSubscriptionNamespaceRequest' from JSON`, + ); +} diff --git a/src/sdk/models/operations/archivenamespace.ts b/src/sdk/models/operations/archivenamespace.ts new file mode 100644 index 00000000..97d3aa57 --- /dev/null +++ b/src/sdk/models/operations/archivenamespace.ts @@ -0,0 +1,149 @@ +/* + * 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"; + +/** + * Archived status + */ +export type ArchiveNamespaceRequestBody = { + archived?: boolean | undefined; +}; + +export type ArchiveNamespaceRequest = { + namespaceName: string; + /** + * Archived status + */ + requestBody?: ArchiveNamespaceRequestBody | undefined; +}; + +/** @internal */ +export const ArchiveNamespaceRequestBody$inboundSchema: z.ZodType< + ArchiveNamespaceRequestBody, + z.ZodTypeDef, + unknown +> = z.object({ + archived: z.boolean().default(true), +}); + +/** @internal */ +export type ArchiveNamespaceRequestBody$Outbound = { + archived: boolean; +}; + +/** @internal */ +export const ArchiveNamespaceRequestBody$outboundSchema: z.ZodType< + ArchiveNamespaceRequestBody$Outbound, + z.ZodTypeDef, + ArchiveNamespaceRequestBody +> = z.object({ + archived: z.boolean().default(true), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ArchiveNamespaceRequestBody$ { + /** @deprecated use `ArchiveNamespaceRequestBody$inboundSchema` instead. */ + export const inboundSchema = ArchiveNamespaceRequestBody$inboundSchema; + /** @deprecated use `ArchiveNamespaceRequestBody$outboundSchema` instead. */ + export const outboundSchema = ArchiveNamespaceRequestBody$outboundSchema; + /** @deprecated use `ArchiveNamespaceRequestBody$Outbound` instead. */ + export type Outbound = ArchiveNamespaceRequestBody$Outbound; +} + +export function archiveNamespaceRequestBodyToJSON( + archiveNamespaceRequestBody: ArchiveNamespaceRequestBody, +): string { + return JSON.stringify( + ArchiveNamespaceRequestBody$outboundSchema.parse( + archiveNamespaceRequestBody, + ), + ); +} + +export function archiveNamespaceRequestBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ArchiveNamespaceRequestBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ArchiveNamespaceRequestBody' from JSON`, + ); +} + +/** @internal */ +export const ArchiveNamespaceRequest$inboundSchema: z.ZodType< + ArchiveNamespaceRequest, + z.ZodTypeDef, + unknown +> = z.object({ + namespace_name: z.string(), + RequestBody: z.lazy(() => ArchiveNamespaceRequestBody$inboundSchema) + .optional(), +}).transform((v) => { + return remap$(v, { + "namespace_name": "namespaceName", + "RequestBody": "requestBody", + }); +}); + +/** @internal */ +export type ArchiveNamespaceRequest$Outbound = { + namespace_name: string; + RequestBody?: ArchiveNamespaceRequestBody$Outbound | undefined; +}; + +/** @internal */ +export const ArchiveNamespaceRequest$outboundSchema: z.ZodType< + ArchiveNamespaceRequest$Outbound, + z.ZodTypeDef, + ArchiveNamespaceRequest +> = z.object({ + namespaceName: z.string(), + requestBody: z.lazy(() => ArchiveNamespaceRequestBody$outboundSchema) + .optional(), +}).transform((v) => { + return remap$(v, { + namespaceName: "namespace_name", + 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 ArchiveNamespaceRequest$ { + /** @deprecated use `ArchiveNamespaceRequest$inboundSchema` instead. */ + export const inboundSchema = ArchiveNamespaceRequest$inboundSchema; + /** @deprecated use `ArchiveNamespaceRequest$outboundSchema` instead. */ + export const outboundSchema = ArchiveNamespaceRequest$outboundSchema; + /** @deprecated use `ArchiveNamespaceRequest$Outbound` instead. */ + export type Outbound = ArchiveNamespaceRequest$Outbound; +} + +export function archiveNamespaceRequestToJSON( + archiveNamespaceRequest: ArchiveNamespaceRequest, +): string { + return JSON.stringify( + ArchiveNamespaceRequest$outboundSchema.parse(archiveNamespaceRequest), + ); +} + +export function archiveNamespaceRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ArchiveNamespaceRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ArchiveNamespaceRequest' from JSON`, + ); +} diff --git a/src/sdk/models/operations/checkgithubaccess.ts b/src/sdk/models/operations/checkgithubaccess.ts index 03eb720f..fc7d54c1 100644 --- a/src/sdk/models/operations/checkgithubaccess.ts +++ b/src/sdk/models/operations/checkgithubaccess.ts @@ -3,6 +3,9 @@ */ 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 CheckGithubAccessRequest = { org: string; @@ -47,3 +50,21 @@ export namespace CheckGithubAccessRequest$ { /** @deprecated use `CheckGithubAccessRequest$Outbound` instead. */ export type Outbound = CheckGithubAccessRequest$Outbound; } + +export function checkGithubAccessRequestToJSON( + checkGithubAccessRequest: CheckGithubAccessRequest, +): string { + return JSON.stringify( + CheckGithubAccessRequest$outboundSchema.parse(checkGithubAccessRequest), + ); +} + +export function checkGithubAccessRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CheckGithubAccessRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CheckGithubAccessRequest' from JSON`, + ); +} diff --git a/src/sdk/models/operations/create.ts b/src/sdk/models/operations/create.ts index 97053938..42a0b794 100644 --- a/src/sdk/models/operations/create.ts +++ b/src/sdk/models/operations/create.ts @@ -3,6 +3,9 @@ */ 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 CreateRequestBody = { /** @@ -46,3 +49,21 @@ export namespace CreateRequestBody$ { /** @deprecated use `CreateRequestBody$Outbound` instead. */ export type Outbound = CreateRequestBody$Outbound; } + +export function createRequestBodyToJSON( + createRequestBody: CreateRequestBody, +): string { + return JSON.stringify( + CreateRequestBody$outboundSchema.parse(createRequestBody), + ); +} + +export function createRequestBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CreateRequestBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreateRequestBody' from JSON`, + ); +} diff --git a/src/sdk/models/operations/createbillingaddons.ts b/src/sdk/models/operations/createbillingaddons.ts new file mode 100644 index 00000000..e637c80e --- /dev/null +++ b/src/sdk/models/operations/createbillingaddons.ts @@ -0,0 +1,71 @@ +/* + * 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 * as shared from "../shared/index.js"; + +export type CreateBillingAddOnsResponse = + | shared.OrganizationBillingAddOnResponse + | shared.ErrorT; + +/** @internal */ +export const CreateBillingAddOnsResponse$inboundSchema: z.ZodType< + CreateBillingAddOnsResponse, + z.ZodTypeDef, + unknown +> = z.union([ + shared.OrganizationBillingAddOnResponse$inboundSchema, + shared.ErrorT$inboundSchema, +]); + +/** @internal */ +export type CreateBillingAddOnsResponse$Outbound = + | shared.OrganizationBillingAddOnResponse$Outbound + | shared.ErrorT$Outbound; + +/** @internal */ +export const CreateBillingAddOnsResponse$outboundSchema: z.ZodType< + CreateBillingAddOnsResponse$Outbound, + z.ZodTypeDef, + CreateBillingAddOnsResponse +> = z.union([ + shared.OrganizationBillingAddOnResponse$outboundSchema, + shared.ErrorT$outboundSchema, +]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateBillingAddOnsResponse$ { + /** @deprecated use `CreateBillingAddOnsResponse$inboundSchema` instead. */ + export const inboundSchema = CreateBillingAddOnsResponse$inboundSchema; + /** @deprecated use `CreateBillingAddOnsResponse$outboundSchema` instead. */ + export const outboundSchema = CreateBillingAddOnsResponse$outboundSchema; + /** @deprecated use `CreateBillingAddOnsResponse$Outbound` instead. */ + export type Outbound = CreateBillingAddOnsResponse$Outbound; +} + +export function createBillingAddOnsResponseToJSON( + createBillingAddOnsResponse: CreateBillingAddOnsResponse, +): string { + return JSON.stringify( + CreateBillingAddOnsResponse$outboundSchema.parse( + createBillingAddOnsResponse, + ), + ); +} + +export function createBillingAddOnsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CreateBillingAddOnsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreateBillingAddOnsResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/createorganization.ts b/src/sdk/models/operations/createorganization.ts index c65b1b78..e9464628 100644 --- a/src/sdk/models/operations/createorganization.ts +++ b/src/sdk/models/operations/createorganization.ts @@ -3,6 +3,9 @@ */ 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 * as shared from "../shared/index.js"; export type CreateOrganizationResponse = shared.ErrorT | shared.Organization; @@ -38,3 +41,21 @@ export namespace CreateOrganizationResponse$ { /** @deprecated use `CreateOrganizationResponse$Outbound` instead. */ export type Outbound = CreateOrganizationResponse$Outbound; } + +export function createOrganizationResponseToJSON( + createOrganizationResponse: CreateOrganizationResponse, +): string { + return JSON.stringify( + CreateOrganizationResponse$outboundSchema.parse(createOrganizationResponse), + ); +} + +export function createOrganizationResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CreateOrganizationResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreateOrganizationResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/createschemastoreitem.ts b/src/sdk/models/operations/createschemastoreitem.ts new file mode 100644 index 00000000..f6a8c079 --- /dev/null +++ b/src/sdk/models/operations/createschemastoreitem.ts @@ -0,0 +1,187 @@ +/* + * 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 * as shared from "../shared/index.js"; + +/** + * The format of the OpenAPI specification. + */ +export const Format = { + Json: "json", + Yaml: "yaml", +} as const; +/** + * The format of the OpenAPI specification. + */ +export type Format = ClosedEnum; + +export type CreateSchemaStoreItemRequestBody = { + /** + * The format of the OpenAPI specification. + */ + format: Format; + /** + * The package name to use in code snippets / quickstart. + */ + packageName: string; + /** + * The classname of the SDK to use in code snippets / quickstart. + */ + sdkClassname: string; + /** + * The OpenAPI specification to store. + */ + spec: string; +}; + +export type CreateSchemaStoreItemResponse = + | shared.ErrorT + | shared.SchemaStoreItem; + +/** @internal */ +export const Format$inboundSchema: z.ZodNativeEnum = z + .nativeEnum(Format); + +/** @internal */ +export const Format$outboundSchema: z.ZodNativeEnum = + Format$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Format$ { + /** @deprecated use `Format$inboundSchema` instead. */ + export const inboundSchema = Format$inboundSchema; + /** @deprecated use `Format$outboundSchema` instead. */ + export const outboundSchema = Format$outboundSchema; +} + +/** @internal */ +export const CreateSchemaStoreItemRequestBody$inboundSchema: z.ZodType< + CreateSchemaStoreItemRequestBody, + z.ZodTypeDef, + unknown +> = z.object({ + format: Format$inboundSchema, + packageName: z.string(), + sdkClassname: z.string(), + spec: z.string(), +}); + +/** @internal */ +export type CreateSchemaStoreItemRequestBody$Outbound = { + format: string; + packageName: string; + sdkClassname: string; + spec: string; +}; + +/** @internal */ +export const CreateSchemaStoreItemRequestBody$outboundSchema: z.ZodType< + CreateSchemaStoreItemRequestBody$Outbound, + z.ZodTypeDef, + CreateSchemaStoreItemRequestBody +> = z.object({ + format: Format$outboundSchema, + packageName: z.string(), + sdkClassname: z.string(), + spec: 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 CreateSchemaStoreItemRequestBody$ { + /** @deprecated use `CreateSchemaStoreItemRequestBody$inboundSchema` instead. */ + export const inboundSchema = CreateSchemaStoreItemRequestBody$inboundSchema; + /** @deprecated use `CreateSchemaStoreItemRequestBody$outboundSchema` instead. */ + export const outboundSchema = CreateSchemaStoreItemRequestBody$outboundSchema; + /** @deprecated use `CreateSchemaStoreItemRequestBody$Outbound` instead. */ + export type Outbound = CreateSchemaStoreItemRequestBody$Outbound; +} + +export function createSchemaStoreItemRequestBodyToJSON( + createSchemaStoreItemRequestBody: CreateSchemaStoreItemRequestBody, +): string { + return JSON.stringify( + CreateSchemaStoreItemRequestBody$outboundSchema.parse( + createSchemaStoreItemRequestBody, + ), + ); +} + +export function createSchemaStoreItemRequestBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CreateSchemaStoreItemRequestBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreateSchemaStoreItemRequestBody' from JSON`, + ); +} + +/** @internal */ +export const CreateSchemaStoreItemResponse$inboundSchema: z.ZodType< + CreateSchemaStoreItemResponse, + z.ZodTypeDef, + unknown +> = z.union([ + shared.ErrorT$inboundSchema, + shared.SchemaStoreItem$inboundSchema, +]); + +/** @internal */ +export type CreateSchemaStoreItemResponse$Outbound = + | shared.ErrorT$Outbound + | shared.SchemaStoreItem$Outbound; + +/** @internal */ +export const CreateSchemaStoreItemResponse$outboundSchema: z.ZodType< + CreateSchemaStoreItemResponse$Outbound, + z.ZodTypeDef, + CreateSchemaStoreItemResponse +> = z.union([ + shared.ErrorT$outboundSchema, + shared.SchemaStoreItem$outboundSchema, +]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateSchemaStoreItemResponse$ { + /** @deprecated use `CreateSchemaStoreItemResponse$inboundSchema` instead. */ + export const inboundSchema = CreateSchemaStoreItemResponse$inboundSchema; + /** @deprecated use `CreateSchemaStoreItemResponse$outboundSchema` instead. */ + export const outboundSchema = CreateSchemaStoreItemResponse$outboundSchema; + /** @deprecated use `CreateSchemaStoreItemResponse$Outbound` instead. */ + export type Outbound = CreateSchemaStoreItemResponse$Outbound; +} + +export function createSchemaStoreItemResponseToJSON( + createSchemaStoreItemResponse: CreateSchemaStoreItemResponse, +): string { + return JSON.stringify( + CreateSchemaStoreItemResponse$outboundSchema.parse( + createSchemaStoreItemResponse, + ), + ); +} + +export function createSchemaStoreItemResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CreateSchemaStoreItemResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreateSchemaStoreItemResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/createworkspace.ts b/src/sdk/models/operations/createworkspace.ts index c2e04dff..d25d686f 100644 --- a/src/sdk/models/operations/createworkspace.ts +++ b/src/sdk/models/operations/createworkspace.ts @@ -3,6 +3,9 @@ */ 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 * as shared from "../shared/index.js"; export type CreateWorkspaceResponse = shared.ErrorT | shared.Workspace; @@ -38,3 +41,21 @@ export namespace CreateWorkspaceResponse$ { /** @deprecated use `CreateWorkspaceResponse$Outbound` instead. */ export type Outbound = CreateWorkspaceResponse$Outbound; } + +export function createWorkspaceResponseToJSON( + createWorkspaceResponse: CreateWorkspaceResponse, +): string { + return JSON.stringify( + CreateWorkspaceResponse$outboundSchema.parse(createWorkspaceResponse), + ); +} + +export function createWorkspaceResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CreateWorkspaceResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreateWorkspaceResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/createworkspacetoken.ts b/src/sdk/models/operations/createworkspacetoken.ts index 0edeeadb..25093d0a 100644 --- a/src/sdk/models/operations/createworkspacetoken.ts +++ b/src/sdk/models/operations/createworkspacetoken.ts @@ -4,23 +4,94 @@ 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"; import * as shared from "../shared/index.js"; +export type CreateWorkspaceTokenGlobals = { + workspaceId?: string | undefined; +}; + export type CreateWorkspaceTokenRequest = { /** * Unique identifier of the workspace. */ - workspaceId: string; + workspaceId?: string | undefined; workspaceToken: shared.WorkspaceToken; }; +/** @internal */ +export const CreateWorkspaceTokenGlobals$inboundSchema: z.ZodType< + CreateWorkspaceTokenGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + workspace_id: z.string().optional(), +}).transform((v) => { + return remap$(v, { + "workspace_id": "workspaceId", + }); +}); + +/** @internal */ +export type CreateWorkspaceTokenGlobals$Outbound = { + workspace_id?: string | undefined; +}; + +/** @internal */ +export const CreateWorkspaceTokenGlobals$outboundSchema: z.ZodType< + CreateWorkspaceTokenGlobals$Outbound, + z.ZodTypeDef, + CreateWorkspaceTokenGlobals +> = z.object({ + workspaceId: z.string().optional(), +}).transform((v) => { + return remap$(v, { + workspaceId: "workspace_id", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateWorkspaceTokenGlobals$ { + /** @deprecated use `CreateWorkspaceTokenGlobals$inboundSchema` instead. */ + export const inboundSchema = CreateWorkspaceTokenGlobals$inboundSchema; + /** @deprecated use `CreateWorkspaceTokenGlobals$outboundSchema` instead. */ + export const outboundSchema = CreateWorkspaceTokenGlobals$outboundSchema; + /** @deprecated use `CreateWorkspaceTokenGlobals$Outbound` instead. */ + export type Outbound = CreateWorkspaceTokenGlobals$Outbound; +} + +export function createWorkspaceTokenGlobalsToJSON( + createWorkspaceTokenGlobals: CreateWorkspaceTokenGlobals, +): string { + return JSON.stringify( + CreateWorkspaceTokenGlobals$outboundSchema.parse( + createWorkspaceTokenGlobals, + ), + ); +} + +export function createWorkspaceTokenGlobalsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CreateWorkspaceTokenGlobals$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreateWorkspaceTokenGlobals' from JSON`, + ); +} + /** @internal */ export const CreateWorkspaceTokenRequest$inboundSchema: z.ZodType< CreateWorkspaceTokenRequest, z.ZodTypeDef, unknown > = z.object({ - workspace_id: z.string(), + workspace_id: z.string().optional(), WorkspaceToken: shared.WorkspaceToken$inboundSchema, }).transform((v) => { return remap$(v, { @@ -31,7 +102,7 @@ export const CreateWorkspaceTokenRequest$inboundSchema: z.ZodType< /** @internal */ export type CreateWorkspaceTokenRequest$Outbound = { - workspace_id: string; + workspace_id?: string | undefined; WorkspaceToken: shared.WorkspaceToken$Outbound; }; @@ -41,7 +112,7 @@ export const CreateWorkspaceTokenRequest$outboundSchema: z.ZodType< z.ZodTypeDef, CreateWorkspaceTokenRequest > = z.object({ - workspaceId: z.string(), + workspaceId: z.string().optional(), workspaceToken: shared.WorkspaceToken$outboundSchema, }).transform((v) => { return remap$(v, { @@ -62,3 +133,23 @@ export namespace CreateWorkspaceTokenRequest$ { /** @deprecated use `CreateWorkspaceTokenRequest$Outbound` instead. */ export type Outbound = CreateWorkspaceTokenRequest$Outbound; } + +export function createWorkspaceTokenRequestToJSON( + createWorkspaceTokenRequest: CreateWorkspaceTokenRequest, +): string { + return JSON.stringify( + CreateWorkspaceTokenRequest$outboundSchema.parse( + createWorkspaceTokenRequest, + ), + ); +} + +export function createWorkspaceTokenRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CreateWorkspaceTokenRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreateWorkspaceTokenRequest' from JSON`, + ); +} diff --git a/src/sdk/models/operations/deleteapi.ts b/src/sdk/models/operations/deleteapi.ts deleted file mode 100644 index 4f7bc6d5..00000000 --- a/src/sdk/models/operations/deleteapi.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; - -export type DeleteApiRequest = { - /** - * The ID of the Api to delete. - */ - apiID: string; - /** - * The version ID of the Api to delete. - */ - versionID: string; -}; - -/** @internal */ -export const DeleteApiRequest$inboundSchema: z.ZodType< - DeleteApiRequest, - z.ZodTypeDef, - unknown -> = z.object({ - apiID: z.string(), - versionID: z.string(), -}); - -/** @internal */ -export type DeleteApiRequest$Outbound = { - apiID: string; - versionID: string; -}; - -/** @internal */ -export const DeleteApiRequest$outboundSchema: z.ZodType< - DeleteApiRequest$Outbound, - z.ZodTypeDef, - DeleteApiRequest -> = z.object({ - apiID: z.string(), - versionID: 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 DeleteApiRequest$ { - /** @deprecated use `DeleteApiRequest$inboundSchema` instead. */ - export const inboundSchema = DeleteApiRequest$inboundSchema; - /** @deprecated use `DeleteApiRequest$outboundSchema` instead. */ - export const outboundSchema = DeleteApiRequest$outboundSchema; - /** @deprecated use `DeleteApiRequest$Outbound` instead. */ - export type Outbound = DeleteApiRequest$Outbound; -} diff --git a/src/sdk/models/operations/deleteapiendpoint.ts b/src/sdk/models/operations/deleteapiendpoint.ts deleted file mode 100644 index 5eae8592..00000000 --- a/src/sdk/models/operations/deleteapiendpoint.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; - -export type DeleteApiEndpointRequest = { - /** - * The ID of the Api the ApiEndpoint belongs to. - */ - apiID: string; - /** - * The version ID of the Api the ApiEndpoint belongs to. - */ - versionID: string; - /** - * The ID of the ApiEndpoint to delete. - */ - apiEndpointID: string; -}; - -/** @internal */ -export const DeleteApiEndpointRequest$inboundSchema: z.ZodType< - DeleteApiEndpointRequest, - z.ZodTypeDef, - unknown -> = z.object({ - apiID: z.string(), - versionID: z.string(), - apiEndpointID: z.string(), -}); - -/** @internal */ -export type DeleteApiEndpointRequest$Outbound = { - apiID: string; - versionID: string; - apiEndpointID: string; -}; - -/** @internal */ -export const DeleteApiEndpointRequest$outboundSchema: z.ZodType< - DeleteApiEndpointRequest$Outbound, - z.ZodTypeDef, - DeleteApiEndpointRequest -> = z.object({ - apiID: z.string(), - versionID: z.string(), - apiEndpointID: 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 DeleteApiEndpointRequest$ { - /** @deprecated use `DeleteApiEndpointRequest$inboundSchema` instead. */ - export const inboundSchema = DeleteApiEndpointRequest$inboundSchema; - /** @deprecated use `DeleteApiEndpointRequest$outboundSchema` instead. */ - export const outboundSchema = DeleteApiEndpointRequest$outboundSchema; - /** @deprecated use `DeleteApiEndpointRequest$Outbound` instead. */ - export type Outbound = DeleteApiEndpointRequest$Outbound; -} diff --git a/src/sdk/models/operations/deletebillingaddon.ts b/src/sdk/models/operations/deletebillingaddon.ts new file mode 100644 index 00000000..f57b4c98 --- /dev/null +++ b/src/sdk/models/operations/deletebillingaddon.ts @@ -0,0 +1,79 @@ +/* + * 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"; +import * as shared from "../shared/index.js"; + +export type DeleteBillingAddOnRequest = { + /** + * The specific add-on to delete. + */ + addOn: shared.BillingAddOn; +}; + +/** @internal */ +export const DeleteBillingAddOnRequest$inboundSchema: z.ZodType< + DeleteBillingAddOnRequest, + z.ZodTypeDef, + unknown +> = z.object({ + add_on: shared.BillingAddOn$inboundSchema, +}).transform((v) => { + return remap$(v, { + "add_on": "addOn", + }); +}); + +/** @internal */ +export type DeleteBillingAddOnRequest$Outbound = { + add_on: string; +}; + +/** @internal */ +export const DeleteBillingAddOnRequest$outboundSchema: z.ZodType< + DeleteBillingAddOnRequest$Outbound, + z.ZodTypeDef, + DeleteBillingAddOnRequest +> = z.object({ + addOn: shared.BillingAddOn$outboundSchema, +}).transform((v) => { + return remap$(v, { + addOn: "add_on", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DeleteBillingAddOnRequest$ { + /** @deprecated use `DeleteBillingAddOnRequest$inboundSchema` instead. */ + export const inboundSchema = DeleteBillingAddOnRequest$inboundSchema; + /** @deprecated use `DeleteBillingAddOnRequest$outboundSchema` instead. */ + export const outboundSchema = DeleteBillingAddOnRequest$outboundSchema; + /** @deprecated use `DeleteBillingAddOnRequest$Outbound` instead. */ + export type Outbound = DeleteBillingAddOnRequest$Outbound; +} + +export function deleteBillingAddOnRequestToJSON( + deleteBillingAddOnRequest: DeleteBillingAddOnRequest, +): string { + return JSON.stringify( + DeleteBillingAddOnRequest$outboundSchema.parse(deleteBillingAddOnRequest), + ); +} + +export function deleteBillingAddOnRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => DeleteBillingAddOnRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'DeleteBillingAddOnRequest' from JSON`, + ); +} diff --git a/src/sdk/models/operations/deleteschema.ts b/src/sdk/models/operations/deleteschema.ts deleted file mode 100644 index 5109279e..00000000 --- a/src/sdk/models/operations/deleteschema.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; - -export type DeleteSchemaRequest = { - /** - * The ID of the Api to delete schemas for. - */ - apiID: string; - /** - * The version ID of the Api to delete metadata for. - */ - versionID: string; - /** - * The revision ID of the schema to delete. - */ - revisionID: string; -}; - -/** @internal */ -export const DeleteSchemaRequest$inboundSchema: z.ZodType< - DeleteSchemaRequest, - z.ZodTypeDef, - unknown -> = z.object({ - apiID: z.string(), - versionID: z.string(), - revisionID: z.string(), -}); - -/** @internal */ -export type DeleteSchemaRequest$Outbound = { - apiID: string; - versionID: string; - revisionID: string; -}; - -/** @internal */ -export const DeleteSchemaRequest$outboundSchema: z.ZodType< - DeleteSchemaRequest$Outbound, - z.ZodTypeDef, - DeleteSchemaRequest -> = z.object({ - apiID: z.string(), - versionID: z.string(), - revisionID: 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; -} diff --git a/src/sdk/models/operations/deleteversionmetadata.ts b/src/sdk/models/operations/deleteversionmetadata.ts deleted file mode 100644 index f8281629..00000000 --- a/src/sdk/models/operations/deleteversionmetadata.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; - -export type DeleteVersionMetadataRequest = { - /** - * The ID of the Api to delete metadata for. - */ - apiID: string; - /** - * The version ID of the Api to delete metadata for. - */ - versionID: string; - /** - * The key of the metadata to delete. - */ - metaKey: string; - /** - * The value of the metadata to delete. - */ - metaValue: string; -}; - -/** @internal */ -export const DeleteVersionMetadataRequest$inboundSchema: z.ZodType< - DeleteVersionMetadataRequest, - z.ZodTypeDef, - unknown -> = z.object({ - apiID: z.string(), - versionID: z.string(), - metaKey: z.string(), - metaValue: z.string(), -}); - -/** @internal */ -export type DeleteVersionMetadataRequest$Outbound = { - apiID: string; - versionID: string; - metaKey: string; - metaValue: string; -}; - -/** @internal */ -export const DeleteVersionMetadataRequest$outboundSchema: z.ZodType< - DeleteVersionMetadataRequest$Outbound, - z.ZodTypeDef, - DeleteVersionMetadataRequest -> = z.object({ - apiID: z.string(), - versionID: z.string(), - metaKey: z.string(), - metaValue: 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 DeleteVersionMetadataRequest$ { - /** @deprecated use `DeleteVersionMetadataRequest$inboundSchema` instead. */ - export const inboundSchema = DeleteVersionMetadataRequest$inboundSchema; - /** @deprecated use `DeleteVersionMetadataRequest$outboundSchema` instead. */ - export const outboundSchema = DeleteVersionMetadataRequest$outboundSchema; - /** @deprecated use `DeleteVersionMetadataRequest$Outbound` instead. */ - export type Outbound = DeleteVersionMetadataRequest$Outbound; -} diff --git a/src/sdk/models/operations/deleteworkspacetoken.ts b/src/sdk/models/operations/deleteworkspacetoken.ts index e086e2b3..187ba9e7 100644 --- a/src/sdk/models/operations/deleteworkspacetoken.ts +++ b/src/sdk/models/operations/deleteworkspacetoken.ts @@ -4,25 +4,96 @@ 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 DeleteWorkspaceTokenGlobals = { + workspaceId?: string | undefined; +}; export type DeleteWorkspaceTokenRequest = { /** * Unique identifier of the workspace. */ - workspaceId: string; + workspaceId?: string | undefined; /** * Unique identifier of the token. */ tokenID: string; }; +/** @internal */ +export const DeleteWorkspaceTokenGlobals$inboundSchema: z.ZodType< + DeleteWorkspaceTokenGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + workspace_id: z.string().optional(), +}).transform((v) => { + return remap$(v, { + "workspace_id": "workspaceId", + }); +}); + +/** @internal */ +export type DeleteWorkspaceTokenGlobals$Outbound = { + workspace_id?: string | undefined; +}; + +/** @internal */ +export const DeleteWorkspaceTokenGlobals$outboundSchema: z.ZodType< + DeleteWorkspaceTokenGlobals$Outbound, + z.ZodTypeDef, + DeleteWorkspaceTokenGlobals +> = z.object({ + workspaceId: z.string().optional(), +}).transform((v) => { + return remap$(v, { + workspaceId: "workspace_id", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DeleteWorkspaceTokenGlobals$ { + /** @deprecated use `DeleteWorkspaceTokenGlobals$inboundSchema` instead. */ + export const inboundSchema = DeleteWorkspaceTokenGlobals$inboundSchema; + /** @deprecated use `DeleteWorkspaceTokenGlobals$outboundSchema` instead. */ + export const outboundSchema = DeleteWorkspaceTokenGlobals$outboundSchema; + /** @deprecated use `DeleteWorkspaceTokenGlobals$Outbound` instead. */ + export type Outbound = DeleteWorkspaceTokenGlobals$Outbound; +} + +export function deleteWorkspaceTokenGlobalsToJSON( + deleteWorkspaceTokenGlobals: DeleteWorkspaceTokenGlobals, +): string { + return JSON.stringify( + DeleteWorkspaceTokenGlobals$outboundSchema.parse( + deleteWorkspaceTokenGlobals, + ), + ); +} + +export function deleteWorkspaceTokenGlobalsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => DeleteWorkspaceTokenGlobals$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'DeleteWorkspaceTokenGlobals' from JSON`, + ); +} + /** @internal */ export const DeleteWorkspaceTokenRequest$inboundSchema: z.ZodType< DeleteWorkspaceTokenRequest, z.ZodTypeDef, unknown > = z.object({ - workspace_id: z.string(), + workspace_id: z.string().optional(), tokenID: z.string(), }).transform((v) => { return remap$(v, { @@ -32,7 +103,7 @@ export const DeleteWorkspaceTokenRequest$inboundSchema: z.ZodType< /** @internal */ export type DeleteWorkspaceTokenRequest$Outbound = { - workspace_id: string; + workspace_id?: string | undefined; tokenID: string; }; @@ -42,7 +113,7 @@ export const DeleteWorkspaceTokenRequest$outboundSchema: z.ZodType< z.ZodTypeDef, DeleteWorkspaceTokenRequest > = z.object({ - workspaceId: z.string(), + workspaceId: z.string().optional(), tokenID: z.string(), }).transform((v) => { return remap$(v, { @@ -62,3 +133,23 @@ export namespace DeleteWorkspaceTokenRequest$ { /** @deprecated use `DeleteWorkspaceTokenRequest$Outbound` instead. */ export type Outbound = DeleteWorkspaceTokenRequest$Outbound; } + +export function deleteWorkspaceTokenRequestToJSON( + deleteWorkspaceTokenRequest: DeleteWorkspaceTokenRequest, +): string { + return JSON.stringify( + DeleteWorkspaceTokenRequest$outboundSchema.parse( + deleteWorkspaceTokenRequest, + ), + ); +} + +export function deleteWorkspaceTokenRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => DeleteWorkspaceTokenRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'DeleteWorkspaceTokenRequest' from JSON`, + ); +} diff --git a/src/sdk/models/operations/downloadschema.ts b/src/sdk/models/operations/downloadschema.ts deleted file mode 100644 index df13c75f..00000000 --- a/src/sdk/models/operations/downloadschema.ts +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import * as shared from "../shared/index.js"; - -export type DownloadSchemaRequest = { - /** - * The ID of the Api to download the schema for. - */ - apiID: string; - /** - * The version ID of the Api to delete metadata for. - */ - versionID: string; -}; - -export type DownloadSchemaResponse = - | shared.ErrorT - | ReadableStream - | ReadableStream; - -/** @internal */ -export const DownloadSchemaRequest$inboundSchema: z.ZodType< - DownloadSchemaRequest, - z.ZodTypeDef, - unknown -> = z.object({ - apiID: z.string(), - versionID: z.string(), -}); - -/** @internal */ -export type DownloadSchemaRequest$Outbound = { - apiID: string; - versionID: string; -}; - -/** @internal */ -export const DownloadSchemaRequest$outboundSchema: z.ZodType< - DownloadSchemaRequest$Outbound, - z.ZodTypeDef, - DownloadSchemaRequest -> = z.object({ - apiID: z.string(), - versionID: 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 DownloadSchemaRequest$ { - /** @deprecated use `DownloadSchemaRequest$inboundSchema` instead. */ - export const inboundSchema = DownloadSchemaRequest$inboundSchema; - /** @deprecated use `DownloadSchemaRequest$outboundSchema` instead. */ - export const outboundSchema = DownloadSchemaRequest$outboundSchema; - /** @deprecated use `DownloadSchemaRequest$Outbound` instead. */ - export type Outbound = DownloadSchemaRequest$Outbound; -} - -/** @internal */ -export const DownloadSchemaResponse$inboundSchema: z.ZodType< - DownloadSchemaResponse, - z.ZodTypeDef, - unknown -> = z.union([ - shared.ErrorT$inboundSchema, - z.instanceof(ReadableStream), - z.instanceof(ReadableStream), -]); - -/** @internal */ -export type DownloadSchemaResponse$Outbound = - | shared.ErrorT$Outbound - | ReadableStream - | ReadableStream; - -/** @internal */ -export const DownloadSchemaResponse$outboundSchema: z.ZodType< - DownloadSchemaResponse$Outbound, - z.ZodTypeDef, - DownloadSchemaResponse -> = z.union([ - shared.ErrorT$outboundSchema, - z.instanceof(ReadableStream), - z.instanceof(ReadableStream), -]); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace DownloadSchemaResponse$ { - /** @deprecated use `DownloadSchemaResponse$inboundSchema` instead. */ - export const inboundSchema = DownloadSchemaResponse$inboundSchema; - /** @deprecated use `DownloadSchemaResponse$outboundSchema` instead. */ - export const outboundSchema = DownloadSchemaResponse$outboundSchema; - /** @deprecated use `DownloadSchemaResponse$Outbound` instead. */ - export type Outbound = DownloadSchemaResponse$Outbound; -} diff --git a/src/sdk/models/operations/downloadschemarevision.ts b/src/sdk/models/operations/downloadschemarevision.ts deleted file mode 100644 index 8a6019b3..00000000 --- a/src/sdk/models/operations/downloadschemarevision.ts +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import * as shared from "../shared/index.js"; - -export type DownloadSchemaRevisionRequest = { - /** - * The ID of the Api to retrieve schemas for. - */ - apiID: string; - /** - * The version ID of the Api to delete metadata for. - */ - versionID: string; - /** - * The revision ID of the schema to retrieve. - */ - revisionID: string; -}; - -export type DownloadSchemaRevisionResponse = - | shared.ErrorT - | ReadableStream - | ReadableStream; - -/** @internal */ -export const DownloadSchemaRevisionRequest$inboundSchema: z.ZodType< - DownloadSchemaRevisionRequest, - z.ZodTypeDef, - unknown -> = z.object({ - apiID: z.string(), - versionID: z.string(), - revisionID: z.string(), -}); - -/** @internal */ -export type DownloadSchemaRevisionRequest$Outbound = { - apiID: string; - versionID: string; - revisionID: string; -}; - -/** @internal */ -export const DownloadSchemaRevisionRequest$outboundSchema: z.ZodType< - DownloadSchemaRevisionRequest$Outbound, - z.ZodTypeDef, - DownloadSchemaRevisionRequest -> = z.object({ - apiID: z.string(), - versionID: z.string(), - revisionID: 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 DownloadSchemaRevisionRequest$ { - /** @deprecated use `DownloadSchemaRevisionRequest$inboundSchema` instead. */ - export const inboundSchema = DownloadSchemaRevisionRequest$inboundSchema; - /** @deprecated use `DownloadSchemaRevisionRequest$outboundSchema` instead. */ - export const outboundSchema = DownloadSchemaRevisionRequest$outboundSchema; - /** @deprecated use `DownloadSchemaRevisionRequest$Outbound` instead. */ - export type Outbound = DownloadSchemaRevisionRequest$Outbound; -} - -/** @internal */ -export const DownloadSchemaRevisionResponse$inboundSchema: z.ZodType< - DownloadSchemaRevisionResponse, - z.ZodTypeDef, - unknown -> = z.union([ - shared.ErrorT$inboundSchema, - z.instanceof(ReadableStream), - z.instanceof(ReadableStream), -]); - -/** @internal */ -export type DownloadSchemaRevisionResponse$Outbound = - | shared.ErrorT$Outbound - | ReadableStream - | ReadableStream; - -/** @internal */ -export const DownloadSchemaRevisionResponse$outboundSchema: z.ZodType< - DownloadSchemaRevisionResponse$Outbound, - z.ZodTypeDef, - DownloadSchemaRevisionResponse -> = z.union([ - shared.ErrorT$outboundSchema, - z.instanceof(ReadableStream), - z.instanceof(ReadableStream), -]); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace DownloadSchemaRevisionResponse$ { - /** @deprecated use `DownloadSchemaRevisionResponse$inboundSchema` instead. */ - export const inboundSchema = DownloadSchemaRevisionResponse$inboundSchema; - /** @deprecated use `DownloadSchemaRevisionResponse$outboundSchema` instead. */ - export const outboundSchema = DownloadSchemaRevisionResponse$outboundSchema; - /** @deprecated use `DownloadSchemaRevisionResponse$Outbound` instead. */ - export type Outbound = DownloadSchemaRevisionResponse$Outbound; -} diff --git a/src/sdk/models/operations/findapiendpoint.ts b/src/sdk/models/operations/findapiendpoint.ts deleted file mode 100644 index 31c3f623..00000000 --- a/src/sdk/models/operations/findapiendpoint.ts +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import * as shared from "../shared/index.js"; - -export type FindApiEndpointRequest = { - /** - * The ID of the Api the ApiEndpoint belongs to. - */ - apiID: string; - /** - * The version ID of the Api the ApiEndpoint belongs to. - */ - versionID: string; - /** - * The displayName of the ApiEndpoint to find (set by operationId from OpenAPI schema). - */ - displayName: string; -}; - -export type FindApiEndpointResponse = shared.ErrorT | shared.ApiEndpoint; - -/** @internal */ -export const FindApiEndpointRequest$inboundSchema: z.ZodType< - FindApiEndpointRequest, - z.ZodTypeDef, - unknown -> = z.object({ - apiID: z.string(), - versionID: z.string(), - displayName: z.string(), -}); - -/** @internal */ -export type FindApiEndpointRequest$Outbound = { - apiID: string; - versionID: string; - displayName: string; -}; - -/** @internal */ -export const FindApiEndpointRequest$outboundSchema: z.ZodType< - FindApiEndpointRequest$Outbound, - z.ZodTypeDef, - FindApiEndpointRequest -> = z.object({ - apiID: z.string(), - versionID: z.string(), - displayName: 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 FindApiEndpointRequest$ { - /** @deprecated use `FindApiEndpointRequest$inboundSchema` instead. */ - export const inboundSchema = FindApiEndpointRequest$inboundSchema; - /** @deprecated use `FindApiEndpointRequest$outboundSchema` instead. */ - export const outboundSchema = FindApiEndpointRequest$outboundSchema; - /** @deprecated use `FindApiEndpointRequest$Outbound` instead. */ - export type Outbound = FindApiEndpointRequest$Outbound; -} - -/** @internal */ -export const FindApiEndpointResponse$inboundSchema: z.ZodType< - FindApiEndpointResponse, - z.ZodTypeDef, - unknown -> = z.union([shared.ErrorT$inboundSchema, shared.ApiEndpoint$inboundSchema]); - -/** @internal */ -export type FindApiEndpointResponse$Outbound = - | shared.ErrorT$Outbound - | shared.ApiEndpoint$Outbound; - -/** @internal */ -export const FindApiEndpointResponse$outboundSchema: z.ZodType< - FindApiEndpointResponse$Outbound, - z.ZodTypeDef, - FindApiEndpointResponse -> = z.union([shared.ErrorT$outboundSchema, shared.ApiEndpoint$outboundSchema]); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace FindApiEndpointResponse$ { - /** @deprecated use `FindApiEndpointResponse$inboundSchema` instead. */ - export const inboundSchema = FindApiEndpointResponse$inboundSchema; - /** @deprecated use `FindApiEndpointResponse$outboundSchema` instead. */ - export const outboundSchema = FindApiEndpointResponse$outboundSchema; - /** @deprecated use `FindApiEndpointResponse$Outbound` instead. */ - export type Outbound = FindApiEndpointResponse$Outbound; -} diff --git a/src/sdk/models/operations/generatecodesamplepreview.ts b/src/sdk/models/operations/generatecodesamplepreview.ts new file mode 100644 index 00000000..dfcd077e --- /dev/null +++ b/src/sdk/models/operations/generatecodesamplepreview.ts @@ -0,0 +1,69 @@ +/* + * 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 * as shared from "../shared/index.js"; + +export type GenerateCodeSamplePreviewResponse = + | shared.UsageSnippets + | shared.ErrorT; + +/** @internal */ +export const GenerateCodeSamplePreviewResponse$inboundSchema: z.ZodType< + GenerateCodeSamplePreviewResponse, + z.ZodTypeDef, + unknown +> = z.union([shared.UsageSnippets$inboundSchema, shared.ErrorT$inboundSchema]); + +/** @internal */ +export type GenerateCodeSamplePreviewResponse$Outbound = + | shared.UsageSnippets$Outbound + | shared.ErrorT$Outbound; + +/** @internal */ +export const GenerateCodeSamplePreviewResponse$outboundSchema: z.ZodType< + GenerateCodeSamplePreviewResponse$Outbound, + z.ZodTypeDef, + GenerateCodeSamplePreviewResponse +> = z.union([ + shared.UsageSnippets$outboundSchema, + shared.ErrorT$outboundSchema, +]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GenerateCodeSamplePreviewResponse$ { + /** @deprecated use `GenerateCodeSamplePreviewResponse$inboundSchema` instead. */ + export const inboundSchema = GenerateCodeSamplePreviewResponse$inboundSchema; + /** @deprecated use `GenerateCodeSamplePreviewResponse$outboundSchema` instead. */ + export const outboundSchema = + GenerateCodeSamplePreviewResponse$outboundSchema; + /** @deprecated use `GenerateCodeSamplePreviewResponse$Outbound` instead. */ + export type Outbound = GenerateCodeSamplePreviewResponse$Outbound; +} + +export function generateCodeSamplePreviewResponseToJSON( + generateCodeSamplePreviewResponse: GenerateCodeSamplePreviewResponse, +): string { + return JSON.stringify( + GenerateCodeSamplePreviewResponse$outboundSchema.parse( + generateCodeSamplePreviewResponse, + ), + ); +} + +export function generateCodeSamplePreviewResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GenerateCodeSamplePreviewResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GenerateCodeSamplePreviewResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/generatecodesamplepreviewasync.ts b/src/sdk/models/operations/generatecodesamplepreviewasync.ts new file mode 100644 index 00000000..467ad8e7 --- /dev/null +++ b/src/sdk/models/operations/generatecodesamplepreviewasync.ts @@ -0,0 +1,165 @@ +/* + * 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"; +import * as shared from "../shared/index.js"; + +/** + * Job accepted, returns a job ID to poll for status and result + */ +export type GenerateCodeSamplePreviewAsyncResponseBody = { + /** + * The job ID for polling + */ + jobId: string; + /** + * The current status of the job. Possible values are `pending` or `running`. + */ + status: shared.CodeSamplesJobStatus; +}; + +export type GenerateCodeSamplePreviewAsyncResponse = + | shared.ErrorT + | GenerateCodeSamplePreviewAsyncResponseBody; + +/** @internal */ +export const GenerateCodeSamplePreviewAsyncResponseBody$inboundSchema: + z.ZodType = + z.object({ + job_id: z.string(), + status: shared.CodeSamplesJobStatus$inboundSchema, + }).transform((v) => { + return remap$(v, { + "job_id": "jobId", + }); + }); + +/** @internal */ +export type GenerateCodeSamplePreviewAsyncResponseBody$Outbound = { + job_id: string; + status: string; +}; + +/** @internal */ +export const GenerateCodeSamplePreviewAsyncResponseBody$outboundSchema: + z.ZodType< + GenerateCodeSamplePreviewAsyncResponseBody$Outbound, + z.ZodTypeDef, + GenerateCodeSamplePreviewAsyncResponseBody + > = z.object({ + jobId: z.string(), + status: shared.CodeSamplesJobStatus$outboundSchema, + }).transform((v) => { + return remap$(v, { + jobId: "job_id", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GenerateCodeSamplePreviewAsyncResponseBody$ { + /** @deprecated use `GenerateCodeSamplePreviewAsyncResponseBody$inboundSchema` instead. */ + export const inboundSchema = + GenerateCodeSamplePreviewAsyncResponseBody$inboundSchema; + /** @deprecated use `GenerateCodeSamplePreviewAsyncResponseBody$outboundSchema` instead. */ + export const outboundSchema = + GenerateCodeSamplePreviewAsyncResponseBody$outboundSchema; + /** @deprecated use `GenerateCodeSamplePreviewAsyncResponseBody$Outbound` instead. */ + export type Outbound = GenerateCodeSamplePreviewAsyncResponseBody$Outbound; +} + +export function generateCodeSamplePreviewAsyncResponseBodyToJSON( + generateCodeSamplePreviewAsyncResponseBody: + GenerateCodeSamplePreviewAsyncResponseBody, +): string { + return JSON.stringify( + GenerateCodeSamplePreviewAsyncResponseBody$outboundSchema.parse( + generateCodeSamplePreviewAsyncResponseBody, + ), + ); +} + +export function generateCodeSamplePreviewAsyncResponseBodyFromJSON( + jsonString: string, +): SafeParseResult< + GenerateCodeSamplePreviewAsyncResponseBody, + SDKValidationError +> { + return safeParse( + jsonString, + (x) => + GenerateCodeSamplePreviewAsyncResponseBody$inboundSchema.parse( + JSON.parse(x), + ), + `Failed to parse 'GenerateCodeSamplePreviewAsyncResponseBody' from JSON`, + ); +} + +/** @internal */ +export const GenerateCodeSamplePreviewAsyncResponse$inboundSchema: z.ZodType< + GenerateCodeSamplePreviewAsyncResponse, + z.ZodTypeDef, + unknown +> = z.union([ + shared.ErrorT$inboundSchema, + z.lazy(() => GenerateCodeSamplePreviewAsyncResponseBody$inboundSchema), +]); + +/** @internal */ +export type GenerateCodeSamplePreviewAsyncResponse$Outbound = + | shared.ErrorT$Outbound + | GenerateCodeSamplePreviewAsyncResponseBody$Outbound; + +/** @internal */ +export const GenerateCodeSamplePreviewAsyncResponse$outboundSchema: z.ZodType< + GenerateCodeSamplePreviewAsyncResponse$Outbound, + z.ZodTypeDef, + GenerateCodeSamplePreviewAsyncResponse +> = z.union([ + shared.ErrorT$outboundSchema, + z.lazy(() => GenerateCodeSamplePreviewAsyncResponseBody$outboundSchema), +]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GenerateCodeSamplePreviewAsyncResponse$ { + /** @deprecated use `GenerateCodeSamplePreviewAsyncResponse$inboundSchema` instead. */ + export const inboundSchema = + GenerateCodeSamplePreviewAsyncResponse$inboundSchema; + /** @deprecated use `GenerateCodeSamplePreviewAsyncResponse$outboundSchema` instead. */ + export const outboundSchema = + GenerateCodeSamplePreviewAsyncResponse$outboundSchema; + /** @deprecated use `GenerateCodeSamplePreviewAsyncResponse$Outbound` instead. */ + export type Outbound = GenerateCodeSamplePreviewAsyncResponse$Outbound; +} + +export function generateCodeSamplePreviewAsyncResponseToJSON( + generateCodeSamplePreviewAsyncResponse: + GenerateCodeSamplePreviewAsyncResponse, +): string { + return JSON.stringify( + GenerateCodeSamplePreviewAsyncResponse$outboundSchema.parse( + generateCodeSamplePreviewAsyncResponse, + ), + ); +} + +export function generateCodeSamplePreviewAsyncResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GenerateCodeSamplePreviewAsyncResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GenerateCodeSamplePreviewAsyncResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/generateopenapispec.ts b/src/sdk/models/operations/generateopenapispec.ts deleted file mode 100644 index 31c1b986..00000000 --- a/src/sdk/models/operations/generateopenapispec.ts +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import * as shared from "../shared/index.js"; - -export type GenerateOpenApiSpecRequest = { - /** - * The ID of the Api to generate an OpenAPI specification for. - */ - apiID: string; - /** - * The version ID of the Api to generate an OpenAPI specification for. - */ - versionID: string; -}; - -export type GenerateOpenApiSpecResponse = - | shared.ErrorT - | shared.GenerateOpenApiSpecDiff; - -/** @internal */ -export const GenerateOpenApiSpecRequest$inboundSchema: z.ZodType< - GenerateOpenApiSpecRequest, - z.ZodTypeDef, - unknown -> = z.object({ - apiID: z.string(), - versionID: z.string(), -}); - -/** @internal */ -export type GenerateOpenApiSpecRequest$Outbound = { - apiID: string; - versionID: string; -}; - -/** @internal */ -export const GenerateOpenApiSpecRequest$outboundSchema: z.ZodType< - GenerateOpenApiSpecRequest$Outbound, - z.ZodTypeDef, - GenerateOpenApiSpecRequest -> = z.object({ - apiID: z.string(), - versionID: 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 GenerateOpenApiSpecRequest$ { - /** @deprecated use `GenerateOpenApiSpecRequest$inboundSchema` instead. */ - export const inboundSchema = GenerateOpenApiSpecRequest$inboundSchema; - /** @deprecated use `GenerateOpenApiSpecRequest$outboundSchema` instead. */ - export const outboundSchema = GenerateOpenApiSpecRequest$outboundSchema; - /** @deprecated use `GenerateOpenApiSpecRequest$Outbound` instead. */ - export type Outbound = GenerateOpenApiSpecRequest$Outbound; -} - -/** @internal */ -export const GenerateOpenApiSpecResponse$inboundSchema: z.ZodType< - GenerateOpenApiSpecResponse, - z.ZodTypeDef, - unknown -> = z.union([ - shared.ErrorT$inboundSchema, - shared.GenerateOpenApiSpecDiff$inboundSchema, -]); - -/** @internal */ -export type GenerateOpenApiSpecResponse$Outbound = - | shared.ErrorT$Outbound - | shared.GenerateOpenApiSpecDiff$Outbound; - -/** @internal */ -export const GenerateOpenApiSpecResponse$outboundSchema: z.ZodType< - GenerateOpenApiSpecResponse$Outbound, - z.ZodTypeDef, - GenerateOpenApiSpecResponse -> = z.union([ - shared.ErrorT$outboundSchema, - shared.GenerateOpenApiSpecDiff$outboundSchema, -]); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GenerateOpenApiSpecResponse$ { - /** @deprecated use `GenerateOpenApiSpecResponse$inboundSchema` instead. */ - export const inboundSchema = GenerateOpenApiSpecResponse$inboundSchema; - /** @deprecated use `GenerateOpenApiSpecResponse$outboundSchema` instead. */ - export const outboundSchema = GenerateOpenApiSpecResponse$outboundSchema; - /** @deprecated use `GenerateOpenApiSpecResponse$Outbound` instead. */ - export type Outbound = GenerateOpenApiSpecResponse$Outbound; -} diff --git a/src/sdk/models/operations/generateopenapispecforapiendpoint.ts b/src/sdk/models/operations/generateopenapispecforapiendpoint.ts deleted file mode 100644 index 0ced3e47..00000000 --- a/src/sdk/models/operations/generateopenapispecforapiendpoint.ts +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import * as shared from "../shared/index.js"; - -export type GenerateOpenApiSpecForApiEndpointRequest = { - /** - * The ID of the Api to generate an OpenAPI specification for. - */ - apiID: string; - /** - * The version ID of the Api to generate an OpenAPI specification for. - */ - versionID: string; - /** - * The ID of the ApiEndpoint to generate an OpenAPI specification for. - */ - apiEndpointID: string; -}; - -export type GenerateOpenApiSpecForApiEndpointResponse = - | shared.ErrorT - | shared.GenerateOpenApiSpecDiff; - -/** @internal */ -export const GenerateOpenApiSpecForApiEndpointRequest$inboundSchema: z.ZodType< - GenerateOpenApiSpecForApiEndpointRequest, - z.ZodTypeDef, - unknown -> = z.object({ - apiID: z.string(), - versionID: z.string(), - apiEndpointID: z.string(), -}); - -/** @internal */ -export type GenerateOpenApiSpecForApiEndpointRequest$Outbound = { - apiID: string; - versionID: string; - apiEndpointID: string; -}; - -/** @internal */ -export const GenerateOpenApiSpecForApiEndpointRequest$outboundSchema: z.ZodType< - GenerateOpenApiSpecForApiEndpointRequest$Outbound, - z.ZodTypeDef, - GenerateOpenApiSpecForApiEndpointRequest -> = z.object({ - apiID: z.string(), - versionID: z.string(), - apiEndpointID: 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 GenerateOpenApiSpecForApiEndpointRequest$ { - /** @deprecated use `GenerateOpenApiSpecForApiEndpointRequest$inboundSchema` instead. */ - export const inboundSchema = - GenerateOpenApiSpecForApiEndpointRequest$inboundSchema; - /** @deprecated use `GenerateOpenApiSpecForApiEndpointRequest$outboundSchema` instead. */ - export const outboundSchema = - GenerateOpenApiSpecForApiEndpointRequest$outboundSchema; - /** @deprecated use `GenerateOpenApiSpecForApiEndpointRequest$Outbound` instead. */ - export type Outbound = GenerateOpenApiSpecForApiEndpointRequest$Outbound; -} - -/** @internal */ -export const GenerateOpenApiSpecForApiEndpointResponse$inboundSchema: z.ZodType< - GenerateOpenApiSpecForApiEndpointResponse, - z.ZodTypeDef, - unknown -> = z.union([ - shared.ErrorT$inboundSchema, - shared.GenerateOpenApiSpecDiff$inboundSchema, -]); - -/** @internal */ -export type GenerateOpenApiSpecForApiEndpointResponse$Outbound = - | shared.ErrorT$Outbound - | shared.GenerateOpenApiSpecDiff$Outbound; - -/** @internal */ -export const GenerateOpenApiSpecForApiEndpointResponse$outboundSchema: - z.ZodType< - GenerateOpenApiSpecForApiEndpointResponse$Outbound, - z.ZodTypeDef, - GenerateOpenApiSpecForApiEndpointResponse - > = z.union([ - shared.ErrorT$outboundSchema, - shared.GenerateOpenApiSpecDiff$outboundSchema, - ]); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GenerateOpenApiSpecForApiEndpointResponse$ { - /** @deprecated use `GenerateOpenApiSpecForApiEndpointResponse$inboundSchema` instead. */ - export const inboundSchema = - GenerateOpenApiSpecForApiEndpointResponse$inboundSchema; - /** @deprecated use `GenerateOpenApiSpecForApiEndpointResponse$outboundSchema` instead. */ - export const outboundSchema = - GenerateOpenApiSpecForApiEndpointResponse$outboundSchema; - /** @deprecated use `GenerateOpenApiSpecForApiEndpointResponse$Outbound` instead. */ - export type Outbound = GenerateOpenApiSpecForApiEndpointResponse$Outbound; -} diff --git a/src/sdk/models/operations/generatepostmancollection.ts b/src/sdk/models/operations/generatepostmancollection.ts deleted file mode 100644 index b6eac210..00000000 --- a/src/sdk/models/operations/generatepostmancollection.ts +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import * as shared from "../shared/index.js"; - -export type GeneratePostmanCollectionRequest = { - /** - * The ID of the Api to generate a Postman collection for. - */ - apiID: string; - /** - * The version ID of the Api to generate a Postman collection for. - */ - versionID: string; -}; - -export type GeneratePostmanCollectionResponse = - | shared.ErrorT - | ReadableStream; - -/** @internal */ -export const GeneratePostmanCollectionRequest$inboundSchema: z.ZodType< - GeneratePostmanCollectionRequest, - z.ZodTypeDef, - unknown -> = z.object({ - apiID: z.string(), - versionID: z.string(), -}); - -/** @internal */ -export type GeneratePostmanCollectionRequest$Outbound = { - apiID: string; - versionID: string; -}; - -/** @internal */ -export const GeneratePostmanCollectionRequest$outboundSchema: z.ZodType< - GeneratePostmanCollectionRequest$Outbound, - z.ZodTypeDef, - GeneratePostmanCollectionRequest -> = z.object({ - apiID: z.string(), - versionID: 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 GeneratePostmanCollectionRequest$ { - /** @deprecated use `GeneratePostmanCollectionRequest$inboundSchema` instead. */ - export const inboundSchema = GeneratePostmanCollectionRequest$inboundSchema; - /** @deprecated use `GeneratePostmanCollectionRequest$outboundSchema` instead. */ - export const outboundSchema = GeneratePostmanCollectionRequest$outboundSchema; - /** @deprecated use `GeneratePostmanCollectionRequest$Outbound` instead. */ - export type Outbound = GeneratePostmanCollectionRequest$Outbound; -} - -/** @internal */ -export const GeneratePostmanCollectionResponse$inboundSchema: z.ZodType< - GeneratePostmanCollectionResponse, - z.ZodTypeDef, - unknown -> = z.union([ - shared.ErrorT$inboundSchema, - z.instanceof(ReadableStream), -]); - -/** @internal */ -export type GeneratePostmanCollectionResponse$Outbound = - | shared.ErrorT$Outbound - | ReadableStream; - -/** @internal */ -export const GeneratePostmanCollectionResponse$outboundSchema: z.ZodType< - GeneratePostmanCollectionResponse$Outbound, - z.ZodTypeDef, - GeneratePostmanCollectionResponse -> = z.union([ - shared.ErrorT$outboundSchema, - z.instanceof(ReadableStream), -]); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GeneratePostmanCollectionResponse$ { - /** @deprecated use `GeneratePostmanCollectionResponse$inboundSchema` instead. */ - export const inboundSchema = GeneratePostmanCollectionResponse$inboundSchema; - /** @deprecated use `GeneratePostmanCollectionResponse$outboundSchema` instead. */ - export const outboundSchema = - GeneratePostmanCollectionResponse$outboundSchema; - /** @deprecated use `GeneratePostmanCollectionResponse$Outbound` instead. */ - export type Outbound = GeneratePostmanCollectionResponse$Outbound; -} diff --git a/src/sdk/models/operations/generatepostmancollectionforapiendpoint.ts b/src/sdk/models/operations/generatepostmancollectionforapiendpoint.ts deleted file mode 100644 index dd43bbb3..00000000 --- a/src/sdk/models/operations/generatepostmancollectionforapiendpoint.ts +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import * as shared from "../shared/index.js"; - -export type GeneratePostmanCollectionForApiEndpointRequest = { - /** - * The ID of the Api to generate a Postman collection for. - */ - apiID: string; - /** - * The version ID of the Api to generate a Postman collection for. - */ - versionID: string; - /** - * The ID of the ApiEndpoint to generate a Postman collection for. - */ - apiEndpointID: string; -}; - -export type GeneratePostmanCollectionForApiEndpointResponse = - | shared.ErrorT - | ReadableStream; - -/** @internal */ -export const GeneratePostmanCollectionForApiEndpointRequest$inboundSchema: - z.ZodType< - GeneratePostmanCollectionForApiEndpointRequest, - z.ZodTypeDef, - unknown - > = z.object({ - apiID: z.string(), - versionID: z.string(), - apiEndpointID: z.string(), - }); - -/** @internal */ -export type GeneratePostmanCollectionForApiEndpointRequest$Outbound = { - apiID: string; - versionID: string; - apiEndpointID: string; -}; - -/** @internal */ -export const GeneratePostmanCollectionForApiEndpointRequest$outboundSchema: - z.ZodType< - GeneratePostmanCollectionForApiEndpointRequest$Outbound, - z.ZodTypeDef, - GeneratePostmanCollectionForApiEndpointRequest - > = z.object({ - apiID: z.string(), - versionID: z.string(), - apiEndpointID: 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 GeneratePostmanCollectionForApiEndpointRequest$ { - /** @deprecated use `GeneratePostmanCollectionForApiEndpointRequest$inboundSchema` instead. */ - export const inboundSchema = - GeneratePostmanCollectionForApiEndpointRequest$inboundSchema; - /** @deprecated use `GeneratePostmanCollectionForApiEndpointRequest$outboundSchema` instead. */ - export const outboundSchema = - GeneratePostmanCollectionForApiEndpointRequest$outboundSchema; - /** @deprecated use `GeneratePostmanCollectionForApiEndpointRequest$Outbound` instead. */ - export type Outbound = - GeneratePostmanCollectionForApiEndpointRequest$Outbound; -} - -/** @internal */ -export const GeneratePostmanCollectionForApiEndpointResponse$inboundSchema: - z.ZodType< - GeneratePostmanCollectionForApiEndpointResponse, - z.ZodTypeDef, - unknown - > = z.union([ - shared.ErrorT$inboundSchema, - z.instanceof(ReadableStream), - ]); - -/** @internal */ -export type GeneratePostmanCollectionForApiEndpointResponse$Outbound = - | shared.ErrorT$Outbound - | ReadableStream; - -/** @internal */ -export const GeneratePostmanCollectionForApiEndpointResponse$outboundSchema: - z.ZodType< - GeneratePostmanCollectionForApiEndpointResponse$Outbound, - z.ZodTypeDef, - GeneratePostmanCollectionForApiEndpointResponse - > = z.union([ - shared.ErrorT$outboundSchema, - z.instanceof(ReadableStream), - ]); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GeneratePostmanCollectionForApiEndpointResponse$ { - /** @deprecated use `GeneratePostmanCollectionForApiEndpointResponse$inboundSchema` instead. */ - export const inboundSchema = - GeneratePostmanCollectionForApiEndpointResponse$inboundSchema; - /** @deprecated use `GeneratePostmanCollectionForApiEndpointResponse$outboundSchema` instead. */ - export const outboundSchema = - GeneratePostmanCollectionForApiEndpointResponse$outboundSchema; - /** @deprecated use `GeneratePostmanCollectionForApiEndpointResponse$Outbound` instead. */ - export type Outbound = - GeneratePostmanCollectionForApiEndpointResponse$Outbound; -} diff --git a/src/sdk/models/operations/generaterequestpostmancollection.ts b/src/sdk/models/operations/generaterequestpostmancollection.ts deleted file mode 100644 index ebcaaf29..00000000 --- a/src/sdk/models/operations/generaterequestpostmancollection.ts +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import * as shared from "../shared/index.js"; - -export type GenerateRequestPostmanCollectionRequest = { - /** - * The ID of the request to retrieve. - */ - requestID: string; -}; - -export type GenerateRequestPostmanCollectionResponse = - | shared.ErrorT - | ReadableStream; - -/** @internal */ -export const GenerateRequestPostmanCollectionRequest$inboundSchema: z.ZodType< - GenerateRequestPostmanCollectionRequest, - z.ZodTypeDef, - unknown -> = z.object({ - requestID: z.string(), -}); - -/** @internal */ -export type GenerateRequestPostmanCollectionRequest$Outbound = { - requestID: string; -}; - -/** @internal */ -export const GenerateRequestPostmanCollectionRequest$outboundSchema: z.ZodType< - GenerateRequestPostmanCollectionRequest$Outbound, - z.ZodTypeDef, - GenerateRequestPostmanCollectionRequest -> = z.object({ - requestID: 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 GenerateRequestPostmanCollectionRequest$ { - /** @deprecated use `GenerateRequestPostmanCollectionRequest$inboundSchema` instead. */ - export const inboundSchema = - GenerateRequestPostmanCollectionRequest$inboundSchema; - /** @deprecated use `GenerateRequestPostmanCollectionRequest$outboundSchema` instead. */ - export const outboundSchema = - GenerateRequestPostmanCollectionRequest$outboundSchema; - /** @deprecated use `GenerateRequestPostmanCollectionRequest$Outbound` instead. */ - export type Outbound = GenerateRequestPostmanCollectionRequest$Outbound; -} - -/** @internal */ -export const GenerateRequestPostmanCollectionResponse$inboundSchema: z.ZodType< - GenerateRequestPostmanCollectionResponse, - z.ZodTypeDef, - unknown -> = z.union([ - shared.ErrorT$inboundSchema, - z.instanceof(ReadableStream), -]); - -/** @internal */ -export type GenerateRequestPostmanCollectionResponse$Outbound = - | shared.ErrorT$Outbound - | ReadableStream; - -/** @internal */ -export const GenerateRequestPostmanCollectionResponse$outboundSchema: z.ZodType< - GenerateRequestPostmanCollectionResponse$Outbound, - z.ZodTypeDef, - GenerateRequestPostmanCollectionResponse -> = z.union([ - shared.ErrorT$outboundSchema, - z.instanceof(ReadableStream), -]); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GenerateRequestPostmanCollectionResponse$ { - /** @deprecated use `GenerateRequestPostmanCollectionResponse$inboundSchema` instead. */ - export const inboundSchema = - GenerateRequestPostmanCollectionResponse$inboundSchema; - /** @deprecated use `GenerateRequestPostmanCollectionResponse$outboundSchema` instead. */ - export const outboundSchema = - GenerateRequestPostmanCollectionResponse$outboundSchema; - /** @deprecated use `GenerateRequestPostmanCollectionResponse$Outbound` instead. */ - export type Outbound = GenerateRequestPostmanCollectionResponse$Outbound; -} diff --git a/src/sdk/models/operations/getaccesstoken.ts b/src/sdk/models/operations/getaccesstoken.ts index 08c2198a..9b6c8727 100644 --- a/src/sdk/models/operations/getaccesstoken.ts +++ b/src/sdk/models/operations/getaccesstoken.ts @@ -4,6 +4,9 @@ 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"; import * as shared from "../shared/index.js"; export type GetAccessTokenRequest = { @@ -59,6 +62,24 @@ export namespace GetAccessTokenRequest$ { export type Outbound = GetAccessTokenRequest$Outbound; } +export function getAccessTokenRequestToJSON( + getAccessTokenRequest: GetAccessTokenRequest, +): string { + return JSON.stringify( + GetAccessTokenRequest$outboundSchema.parse(getAccessTokenRequest), + ); +} + +export function getAccessTokenRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetAccessTokenRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetAccessTokenRequest' from JSON`, + ); +} + /** @internal */ export const GetAccessTokenResponse$inboundSchema: z.ZodType< GetAccessTokenResponse, @@ -90,3 +111,21 @@ export namespace GetAccessTokenResponse$ { /** @deprecated use `GetAccessTokenResponse$Outbound` instead. */ export type Outbound = GetAccessTokenResponse$Outbound; } + +export function getAccessTokenResponseToJSON( + getAccessTokenResponse: GetAccessTokenResponse, +): string { + return JSON.stringify( + GetAccessTokenResponse$outboundSchema.parse(getAccessTokenResponse), + ); +} + +export function getAccessTokenResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetAccessTokenResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetAccessTokenResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getallapiendpoints.ts b/src/sdk/models/operations/getallapiendpoints.ts deleted file mode 100644 index 19cd522d..00000000 --- a/src/sdk/models/operations/getallapiendpoints.ts +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import * as shared from "../shared/index.js"; - -export type GetAllApiEndpointsRequest = { - /** - * The ID of the Api to retrieve ApiEndpoints for. - */ - apiID: string; -}; - -export type GetAllApiEndpointsResponse = - | shared.ErrorT - | Array; - -/** @internal */ -export const GetAllApiEndpointsRequest$inboundSchema: z.ZodType< - GetAllApiEndpointsRequest, - z.ZodTypeDef, - unknown -> = z.object({ - apiID: z.string(), -}); - -/** @internal */ -export type GetAllApiEndpointsRequest$Outbound = { - apiID: string; -}; - -/** @internal */ -export const GetAllApiEndpointsRequest$outboundSchema: z.ZodType< - GetAllApiEndpointsRequest$Outbound, - z.ZodTypeDef, - GetAllApiEndpointsRequest -> = z.object({ - apiID: 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 GetAllApiEndpointsRequest$ { - /** @deprecated use `GetAllApiEndpointsRequest$inboundSchema` instead. */ - export const inboundSchema = GetAllApiEndpointsRequest$inboundSchema; - /** @deprecated use `GetAllApiEndpointsRequest$outboundSchema` instead. */ - export const outboundSchema = GetAllApiEndpointsRequest$outboundSchema; - /** @deprecated use `GetAllApiEndpointsRequest$Outbound` instead. */ - export type Outbound = GetAllApiEndpointsRequest$Outbound; -} - -/** @internal */ -export const GetAllApiEndpointsResponse$inboundSchema: z.ZodType< - GetAllApiEndpointsResponse, - z.ZodTypeDef, - unknown -> = z.union([ - shared.ErrorT$inboundSchema, - z.array(shared.ApiEndpoint$inboundSchema), -]); - -/** @internal */ -export type GetAllApiEndpointsResponse$Outbound = - | shared.ErrorT$Outbound - | Array; - -/** @internal */ -export const GetAllApiEndpointsResponse$outboundSchema: z.ZodType< - GetAllApiEndpointsResponse$Outbound, - z.ZodTypeDef, - GetAllApiEndpointsResponse -> = z.union([ - shared.ErrorT$outboundSchema, - z.array(shared.ApiEndpoint$outboundSchema), -]); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetAllApiEndpointsResponse$ { - /** @deprecated use `GetAllApiEndpointsResponse$inboundSchema` instead. */ - export const inboundSchema = GetAllApiEndpointsResponse$inboundSchema; - /** @deprecated use `GetAllApiEndpointsResponse$outboundSchema` instead. */ - export const outboundSchema = GetAllApiEndpointsResponse$outboundSchema; - /** @deprecated use `GetAllApiEndpointsResponse$Outbound` instead. */ - export type Outbound = GetAllApiEndpointsResponse$Outbound; -} diff --git a/src/sdk/models/operations/getallapiversions.ts b/src/sdk/models/operations/getallapiversions.ts deleted file mode 100644 index 13de6e24..00000000 --- a/src/sdk/models/operations/getallapiversions.ts +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import * as shared from "../shared/index.js"; - -/** - * Configuration for filter operations - */ -export type Op = { - /** - * Whether to AND or OR the filters - */ - and: boolean; -}; - -export type GetAllApiVersionsRequest = { - /** - * The ID of the Api to retrieve. - */ - apiID: string; - /** - * Configuration for filter operations - */ - op?: Op | undefined; - /** - * Metadata to filter Apis on - */ - metadata?: { [k: string]: Array } | undefined; -}; - -export type GetAllApiVersionsResponse = shared.ErrorT | Array; - -/** @internal */ -export const Op$inboundSchema: z.ZodType = z.object({ - and: z.boolean(), -}); - -/** @internal */ -export type Op$Outbound = { - and: boolean; -}; - -/** @internal */ -export const Op$outboundSchema: z.ZodType = z - .object({ - and: z.boolean(), - }); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace Op$ { - /** @deprecated use `Op$inboundSchema` instead. */ - export const inboundSchema = Op$inboundSchema; - /** @deprecated use `Op$outboundSchema` instead. */ - export const outboundSchema = Op$outboundSchema; - /** @deprecated use `Op$Outbound` instead. */ - export type Outbound = Op$Outbound; -} - -/** @internal */ -export const GetAllApiVersionsRequest$inboundSchema: z.ZodType< - GetAllApiVersionsRequest, - z.ZodTypeDef, - unknown -> = z.object({ - apiID: z.string(), - op: z.lazy(() => Op$inboundSchema).optional(), - metadata: z.record(z.array(z.string())).optional(), -}); - -/** @internal */ -export type GetAllApiVersionsRequest$Outbound = { - apiID: string; - op?: Op$Outbound | undefined; - metadata?: { [k: string]: Array } | undefined; -}; - -/** @internal */ -export const GetAllApiVersionsRequest$outboundSchema: z.ZodType< - GetAllApiVersionsRequest$Outbound, - z.ZodTypeDef, - GetAllApiVersionsRequest -> = z.object({ - apiID: z.string(), - op: z.lazy(() => Op$outboundSchema).optional(), - metadata: z.record(z.array(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 GetAllApiVersionsRequest$ { - /** @deprecated use `GetAllApiVersionsRequest$inboundSchema` instead. */ - export const inboundSchema = GetAllApiVersionsRequest$inboundSchema; - /** @deprecated use `GetAllApiVersionsRequest$outboundSchema` instead. */ - export const outboundSchema = GetAllApiVersionsRequest$outboundSchema; - /** @deprecated use `GetAllApiVersionsRequest$Outbound` instead. */ - export type Outbound = GetAllApiVersionsRequest$Outbound; -} - -/** @internal */ -export const GetAllApiVersionsResponse$inboundSchema: z.ZodType< - GetAllApiVersionsResponse, - z.ZodTypeDef, - unknown -> = z.union([shared.ErrorT$inboundSchema, z.array(shared.Api$inboundSchema)]); - -/** @internal */ -export type GetAllApiVersionsResponse$Outbound = - | shared.ErrorT$Outbound - | Array; - -/** @internal */ -export const GetAllApiVersionsResponse$outboundSchema: z.ZodType< - GetAllApiVersionsResponse$Outbound, - z.ZodTypeDef, - GetAllApiVersionsResponse -> = z.union([shared.ErrorT$outboundSchema, z.array(shared.Api$outboundSchema)]); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetAllApiVersionsResponse$ { - /** @deprecated use `GetAllApiVersionsResponse$inboundSchema` instead. */ - export const inboundSchema = GetAllApiVersionsResponse$inboundSchema; - /** @deprecated use `GetAllApiVersionsResponse$outboundSchema` instead. */ - export const outboundSchema = GetAllApiVersionsResponse$outboundSchema; - /** @deprecated use `GetAllApiVersionsResponse$Outbound` instead. */ - export type Outbound = GetAllApiVersionsResponse$Outbound; -} diff --git a/src/sdk/models/operations/getallforversionapiendpoints.ts b/src/sdk/models/operations/getallforversionapiendpoints.ts deleted file mode 100644 index 6cc79353..00000000 --- a/src/sdk/models/operations/getallforversionapiendpoints.ts +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import * as shared from "../shared/index.js"; - -export type GetAllForVersionApiEndpointsRequest = { - /** - * The ID of the Api to retrieve ApiEndpoints for. - */ - apiID: string; - /** - * The version ID of the Api to retrieve ApiEndpoints for. - */ - versionID: string; -}; - -export type GetAllForVersionApiEndpointsResponse = - | shared.ErrorT - | Array; - -/** @internal */ -export const GetAllForVersionApiEndpointsRequest$inboundSchema: z.ZodType< - GetAllForVersionApiEndpointsRequest, - z.ZodTypeDef, - unknown -> = z.object({ - apiID: z.string(), - versionID: z.string(), -}); - -/** @internal */ -export type GetAllForVersionApiEndpointsRequest$Outbound = { - apiID: string; - versionID: string; -}; - -/** @internal */ -export const GetAllForVersionApiEndpointsRequest$outboundSchema: z.ZodType< - GetAllForVersionApiEndpointsRequest$Outbound, - z.ZodTypeDef, - GetAllForVersionApiEndpointsRequest -> = z.object({ - apiID: z.string(), - versionID: 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 GetAllForVersionApiEndpointsRequest$ { - /** @deprecated use `GetAllForVersionApiEndpointsRequest$inboundSchema` instead. */ - export const inboundSchema = - GetAllForVersionApiEndpointsRequest$inboundSchema; - /** @deprecated use `GetAllForVersionApiEndpointsRequest$outboundSchema` instead. */ - export const outboundSchema = - GetAllForVersionApiEndpointsRequest$outboundSchema; - /** @deprecated use `GetAllForVersionApiEndpointsRequest$Outbound` instead. */ - export type Outbound = GetAllForVersionApiEndpointsRequest$Outbound; -} - -/** @internal */ -export const GetAllForVersionApiEndpointsResponse$inboundSchema: z.ZodType< - GetAllForVersionApiEndpointsResponse, - z.ZodTypeDef, - unknown -> = z.union([ - shared.ErrorT$inboundSchema, - z.array(shared.ApiEndpoint$inboundSchema), -]); - -/** @internal */ -export type GetAllForVersionApiEndpointsResponse$Outbound = - | shared.ErrorT$Outbound - | Array; - -/** @internal */ -export const GetAllForVersionApiEndpointsResponse$outboundSchema: z.ZodType< - GetAllForVersionApiEndpointsResponse$Outbound, - z.ZodTypeDef, - GetAllForVersionApiEndpointsResponse -> = z.union([ - shared.ErrorT$outboundSchema, - z.array(shared.ApiEndpoint$outboundSchema), -]); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetAllForVersionApiEndpointsResponse$ { - /** @deprecated use `GetAllForVersionApiEndpointsResponse$inboundSchema` instead. */ - export const inboundSchema = - GetAllForVersionApiEndpointsResponse$inboundSchema; - /** @deprecated use `GetAllForVersionApiEndpointsResponse$outboundSchema` instead. */ - export const outboundSchema = - GetAllForVersionApiEndpointsResponse$outboundSchema; - /** @deprecated use `GetAllForVersionApiEndpointsResponse$Outbound` instead. */ - export type Outbound = GetAllForVersionApiEndpointsResponse$Outbound; -} diff --git a/src/sdk/models/operations/getapiendpoint.ts b/src/sdk/models/operations/getapiendpoint.ts deleted file mode 100644 index 6ad61b6d..00000000 --- a/src/sdk/models/operations/getapiendpoint.ts +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import * as shared from "../shared/index.js"; - -export type GetApiEndpointRequest = { - /** - * The ID of the Api the ApiEndpoint belongs to. - */ - apiID: string; - /** - * The version ID of the Api the ApiEndpoint belongs to. - */ - versionID: string; - /** - * The ID of the ApiEndpoint to retrieve. - */ - apiEndpointID: string; -}; - -export type GetApiEndpointResponse = shared.ErrorT | shared.ApiEndpoint; - -/** @internal */ -export const GetApiEndpointRequest$inboundSchema: z.ZodType< - GetApiEndpointRequest, - z.ZodTypeDef, - unknown -> = z.object({ - apiID: z.string(), - versionID: z.string(), - apiEndpointID: z.string(), -}); - -/** @internal */ -export type GetApiEndpointRequest$Outbound = { - apiID: string; - versionID: string; - apiEndpointID: string; -}; - -/** @internal */ -export const GetApiEndpointRequest$outboundSchema: z.ZodType< - GetApiEndpointRequest$Outbound, - z.ZodTypeDef, - GetApiEndpointRequest -> = z.object({ - apiID: z.string(), - versionID: z.string(), - apiEndpointID: 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 GetApiEndpointRequest$ { - /** @deprecated use `GetApiEndpointRequest$inboundSchema` instead. */ - export const inboundSchema = GetApiEndpointRequest$inboundSchema; - /** @deprecated use `GetApiEndpointRequest$outboundSchema` instead. */ - export const outboundSchema = GetApiEndpointRequest$outboundSchema; - /** @deprecated use `GetApiEndpointRequest$Outbound` instead. */ - export type Outbound = GetApiEndpointRequest$Outbound; -} - -/** @internal */ -export const GetApiEndpointResponse$inboundSchema: z.ZodType< - GetApiEndpointResponse, - z.ZodTypeDef, - unknown -> = z.union([shared.ErrorT$inboundSchema, shared.ApiEndpoint$inboundSchema]); - -/** @internal */ -export type GetApiEndpointResponse$Outbound = - | shared.ErrorT$Outbound - | shared.ApiEndpoint$Outbound; - -/** @internal */ -export const GetApiEndpointResponse$outboundSchema: z.ZodType< - GetApiEndpointResponse$Outbound, - z.ZodTypeDef, - GetApiEndpointResponse -> = z.union([shared.ErrorT$outboundSchema, shared.ApiEndpoint$outboundSchema]); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetApiEndpointResponse$ { - /** @deprecated use `GetApiEndpointResponse$inboundSchema` instead. */ - export const inboundSchema = GetApiEndpointResponse$inboundSchema; - /** @deprecated use `GetApiEndpointResponse$outboundSchema` instead. */ - export const outboundSchema = GetApiEndpointResponse$outboundSchema; - /** @deprecated use `GetApiEndpointResponse$Outbound` instead. */ - export type Outbound = GetApiEndpointResponse$Outbound; -} diff --git a/src/sdk/models/operations/getapis.ts b/src/sdk/models/operations/getapis.ts deleted file mode 100644 index 1c1763fe..00000000 --- a/src/sdk/models/operations/getapis.ts +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import * as shared from "../shared/index.js"; - -/** - * Configuration for filter operations - */ -export type QueryParamOp = { - /** - * Whether to AND or OR the filters - */ - and: boolean; -}; - -export type GetApisRequest = { - /** - * Configuration for filter operations - */ - op?: QueryParamOp | undefined; - /** - * Metadata to filter Apis on - */ - metadata?: { [k: string]: Array } | undefined; -}; - -export type GetApisResponse = shared.ErrorT | Array; - -/** @internal */ -export const QueryParamOp$inboundSchema: z.ZodType< - QueryParamOp, - z.ZodTypeDef, - unknown -> = z.object({ - and: z.boolean(), -}); - -/** @internal */ -export type QueryParamOp$Outbound = { - and: boolean; -}; - -/** @internal */ -export const QueryParamOp$outboundSchema: z.ZodType< - QueryParamOp$Outbound, - z.ZodTypeDef, - QueryParamOp -> = z.object({ - and: z.boolean(), -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace QueryParamOp$ { - /** @deprecated use `QueryParamOp$inboundSchema` instead. */ - export const inboundSchema = QueryParamOp$inboundSchema; - /** @deprecated use `QueryParamOp$outboundSchema` instead. */ - export const outboundSchema = QueryParamOp$outboundSchema; - /** @deprecated use `QueryParamOp$Outbound` instead. */ - export type Outbound = QueryParamOp$Outbound; -} - -/** @internal */ -export const GetApisRequest$inboundSchema: z.ZodType< - GetApisRequest, - z.ZodTypeDef, - unknown -> = z.object({ - op: z.lazy(() => QueryParamOp$inboundSchema).optional(), - metadata: z.record(z.array(z.string())).optional(), -}); - -/** @internal */ -export type GetApisRequest$Outbound = { - op?: QueryParamOp$Outbound | undefined; - metadata?: { [k: string]: Array } | undefined; -}; - -/** @internal */ -export const GetApisRequest$outboundSchema: z.ZodType< - GetApisRequest$Outbound, - z.ZodTypeDef, - GetApisRequest -> = z.object({ - op: z.lazy(() => QueryParamOp$outboundSchema).optional(), - metadata: z.record(z.array(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 GetApisRequest$ { - /** @deprecated use `GetApisRequest$inboundSchema` instead. */ - export const inboundSchema = GetApisRequest$inboundSchema; - /** @deprecated use `GetApisRequest$outboundSchema` instead. */ - export const outboundSchema = GetApisRequest$outboundSchema; - /** @deprecated use `GetApisRequest$Outbound` instead. */ - export type Outbound = GetApisRequest$Outbound; -} - -/** @internal */ -export const GetApisResponse$inboundSchema: z.ZodType< - GetApisResponse, - z.ZodTypeDef, - unknown -> = z.union([shared.ErrorT$inboundSchema, z.array(shared.Api$inboundSchema)]); - -/** @internal */ -export type GetApisResponse$Outbound = - | shared.ErrorT$Outbound - | Array; - -/** @internal */ -export const GetApisResponse$outboundSchema: z.ZodType< - GetApisResponse$Outbound, - z.ZodTypeDef, - GetApisResponse -> = z.union([shared.ErrorT$outboundSchema, z.array(shared.Api$outboundSchema)]); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetApisResponse$ { - /** @deprecated use `GetApisResponse$inboundSchema` instead. */ - export const inboundSchema = GetApisResponse$inboundSchema; - /** @deprecated use `GetApisResponse$outboundSchema` instead. */ - export const outboundSchema = GetApisResponse$outboundSchema; - /** @deprecated use `GetApisResponse$Outbound` instead. */ - export type Outbound = GetApisResponse$Outbound; -} diff --git a/src/sdk/models/operations/getbillingaddons.ts b/src/sdk/models/operations/getbillingaddons.ts new file mode 100644 index 00000000..e78633d6 --- /dev/null +++ b/src/sdk/models/operations/getbillingaddons.ts @@ -0,0 +1,69 @@ +/* + * 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 * as shared from "../shared/index.js"; + +export type GetBillingAddOnsResponse = + | shared.OrganizationBillingAddOnResponse + | shared.ErrorT; + +/** @internal */ +export const GetBillingAddOnsResponse$inboundSchema: z.ZodType< + GetBillingAddOnsResponse, + z.ZodTypeDef, + unknown +> = z.union([ + shared.OrganizationBillingAddOnResponse$inboundSchema, + shared.ErrorT$inboundSchema, +]); + +/** @internal */ +export type GetBillingAddOnsResponse$Outbound = + | shared.OrganizationBillingAddOnResponse$Outbound + | shared.ErrorT$Outbound; + +/** @internal */ +export const GetBillingAddOnsResponse$outboundSchema: z.ZodType< + GetBillingAddOnsResponse$Outbound, + z.ZodTypeDef, + GetBillingAddOnsResponse +> = z.union([ + shared.OrganizationBillingAddOnResponse$outboundSchema, + shared.ErrorT$outboundSchema, +]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetBillingAddOnsResponse$ { + /** @deprecated use `GetBillingAddOnsResponse$inboundSchema` instead. */ + export const inboundSchema = GetBillingAddOnsResponse$inboundSchema; + /** @deprecated use `GetBillingAddOnsResponse$outboundSchema` instead. */ + export const outboundSchema = GetBillingAddOnsResponse$outboundSchema; + /** @deprecated use `GetBillingAddOnsResponse$Outbound` instead. */ + export type Outbound = GetBillingAddOnsResponse$Outbound; +} + +export function getBillingAddOnsResponseToJSON( + getBillingAddOnsResponse: GetBillingAddOnsResponse, +): string { + return JSON.stringify( + GetBillingAddOnsResponse$outboundSchema.parse(getBillingAddOnsResponse), + ); +} + +export function getBillingAddOnsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetBillingAddOnsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetBillingAddOnsResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getblob.ts b/src/sdk/models/operations/getblob.ts index 306fbbe7..9ba1cca2 100644 --- a/src/sdk/models/operations/getblob.ts +++ b/src/sdk/models/operations/getblob.ts @@ -4,6 +4,9 @@ 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"; import * as shared from "../shared/index.js"; export type GetBlobRequest = { @@ -72,6 +75,20 @@ export namespace GetBlobRequest$ { export type Outbound = GetBlobRequest$Outbound; } +export function getBlobRequestToJSON(getBlobRequest: GetBlobRequest): string { + return JSON.stringify(GetBlobRequest$outboundSchema.parse(getBlobRequest)); +} + +export function getBlobRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetBlobRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetBlobRequest' from JSON`, + ); +} + /** @internal */ export const GetBlobResponse$inboundSchema: z.ZodType< GetBlobResponse, @@ -109,3 +126,19 @@ export namespace GetBlobResponse$ { /** @deprecated use `GetBlobResponse$Outbound` instead. */ export type Outbound = GetBlobResponse$Outbound; } + +export function getBlobResponseToJSON( + getBlobResponse: GetBlobResponse, +): string { + return JSON.stringify(GetBlobResponse$outboundSchema.parse(getBlobResponse)); +} + +export function getBlobResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetBlobResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetBlobResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getchangesreportsignedurl.ts b/src/sdk/models/operations/getchangesreportsignedurl.ts index f0bb8a6d..a6c6c59a 100644 --- a/src/sdk/models/operations/getchangesreportsignedurl.ts +++ b/src/sdk/models/operations/getchangesreportsignedurl.ts @@ -3,6 +3,9 @@ */ 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 GetChangesReportSignedUrlRequest = { /** @@ -54,6 +57,26 @@ export namespace GetChangesReportSignedUrlRequest$ { export type Outbound = GetChangesReportSignedUrlRequest$Outbound; } +export function getChangesReportSignedUrlRequestToJSON( + getChangesReportSignedUrlRequest: GetChangesReportSignedUrlRequest, +): string { + return JSON.stringify( + GetChangesReportSignedUrlRequest$outboundSchema.parse( + getChangesReportSignedUrlRequest, + ), + ); +} + +export function getChangesReportSignedUrlRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetChangesReportSignedUrlRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetChangesReportSignedUrlRequest' from JSON`, + ); +} + /** @internal */ export const GetChangesReportSignedUrlSignedAccess$inboundSchema: z.ZodType< GetChangesReportSignedUrlSignedAccess, @@ -91,3 +114,24 @@ export namespace GetChangesReportSignedUrlSignedAccess$ { /** @deprecated use `GetChangesReportSignedUrlSignedAccess$Outbound` instead. */ export type Outbound = GetChangesReportSignedUrlSignedAccess$Outbound; } + +export function getChangesReportSignedUrlSignedAccessToJSON( + getChangesReportSignedUrlSignedAccess: GetChangesReportSignedUrlSignedAccess, +): string { + return JSON.stringify( + GetChangesReportSignedUrlSignedAccess$outboundSchema.parse( + getChangesReportSignedUrlSignedAccess, + ), + ); +} + +export function getChangesReportSignedUrlSignedAccessFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetChangesReportSignedUrlSignedAccess$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetChangesReportSignedUrlSignedAccess' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getcodesamplepreviewasync.ts b/src/sdk/models/operations/getcodesamplepreviewasync.ts new file mode 100644 index 00000000..7c7a0468 --- /dev/null +++ b/src/sdk/models/operations/getcodesamplepreviewasync.ts @@ -0,0 +1,208 @@ +/* + * 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 * as shared from "../shared/index.js"; + +export type GetCodeSamplePreviewAsyncRequest = { + /** + * The ID of the job to check the status and retrieve results + */ + jobID: string; +}; + +/** + * Job is still in progress + */ +export type GetCodeSamplePreviewAsyncResponseBody = { + /** + * The current status of the job. Possible values are `pending` or `running`. + */ + status: shared.CodeSamplesJobStatus; +}; + +export type GetCodeSamplePreviewAsyncResponse = + | shared.UsageSnippets + | GetCodeSamplePreviewAsyncResponseBody + | shared.ErrorT; + +/** @internal */ +export const GetCodeSamplePreviewAsyncRequest$inboundSchema: z.ZodType< + GetCodeSamplePreviewAsyncRequest, + z.ZodTypeDef, + unknown +> = z.object({ + jobID: z.string(), +}); + +/** @internal */ +export type GetCodeSamplePreviewAsyncRequest$Outbound = { + jobID: string; +}; + +/** @internal */ +export const GetCodeSamplePreviewAsyncRequest$outboundSchema: z.ZodType< + GetCodeSamplePreviewAsyncRequest$Outbound, + z.ZodTypeDef, + GetCodeSamplePreviewAsyncRequest +> = z.object({ + jobID: 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 GetCodeSamplePreviewAsyncRequest$ { + /** @deprecated use `GetCodeSamplePreviewAsyncRequest$inboundSchema` instead. */ + export const inboundSchema = GetCodeSamplePreviewAsyncRequest$inboundSchema; + /** @deprecated use `GetCodeSamplePreviewAsyncRequest$outboundSchema` instead. */ + export const outboundSchema = GetCodeSamplePreviewAsyncRequest$outboundSchema; + /** @deprecated use `GetCodeSamplePreviewAsyncRequest$Outbound` instead. */ + export type Outbound = GetCodeSamplePreviewAsyncRequest$Outbound; +} + +export function getCodeSamplePreviewAsyncRequestToJSON( + getCodeSamplePreviewAsyncRequest: GetCodeSamplePreviewAsyncRequest, +): string { + return JSON.stringify( + GetCodeSamplePreviewAsyncRequest$outboundSchema.parse( + getCodeSamplePreviewAsyncRequest, + ), + ); +} + +export function getCodeSamplePreviewAsyncRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetCodeSamplePreviewAsyncRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetCodeSamplePreviewAsyncRequest' from JSON`, + ); +} + +/** @internal */ +export const GetCodeSamplePreviewAsyncResponseBody$inboundSchema: z.ZodType< + GetCodeSamplePreviewAsyncResponseBody, + z.ZodTypeDef, + unknown +> = z.object({ + status: shared.CodeSamplesJobStatus$inboundSchema, +}); + +/** @internal */ +export type GetCodeSamplePreviewAsyncResponseBody$Outbound = { + status: string; +}; + +/** @internal */ +export const GetCodeSamplePreviewAsyncResponseBody$outboundSchema: z.ZodType< + GetCodeSamplePreviewAsyncResponseBody$Outbound, + z.ZodTypeDef, + GetCodeSamplePreviewAsyncResponseBody +> = z.object({ + status: shared.CodeSamplesJobStatus$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetCodeSamplePreviewAsyncResponseBody$ { + /** @deprecated use `GetCodeSamplePreviewAsyncResponseBody$inboundSchema` instead. */ + export const inboundSchema = + GetCodeSamplePreviewAsyncResponseBody$inboundSchema; + /** @deprecated use `GetCodeSamplePreviewAsyncResponseBody$outboundSchema` instead. */ + export const outboundSchema = + GetCodeSamplePreviewAsyncResponseBody$outboundSchema; + /** @deprecated use `GetCodeSamplePreviewAsyncResponseBody$Outbound` instead. */ + export type Outbound = GetCodeSamplePreviewAsyncResponseBody$Outbound; +} + +export function getCodeSamplePreviewAsyncResponseBodyToJSON( + getCodeSamplePreviewAsyncResponseBody: GetCodeSamplePreviewAsyncResponseBody, +): string { + return JSON.stringify( + GetCodeSamplePreviewAsyncResponseBody$outboundSchema.parse( + getCodeSamplePreviewAsyncResponseBody, + ), + ); +} + +export function getCodeSamplePreviewAsyncResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetCodeSamplePreviewAsyncResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetCodeSamplePreviewAsyncResponseBody' from JSON`, + ); +} + +/** @internal */ +export const GetCodeSamplePreviewAsyncResponse$inboundSchema: z.ZodType< + GetCodeSamplePreviewAsyncResponse, + z.ZodTypeDef, + unknown +> = z.union([ + shared.UsageSnippets$inboundSchema, + z.lazy(() => GetCodeSamplePreviewAsyncResponseBody$inboundSchema), + shared.ErrorT$inboundSchema, +]); + +/** @internal */ +export type GetCodeSamplePreviewAsyncResponse$Outbound = + | shared.UsageSnippets$Outbound + | GetCodeSamplePreviewAsyncResponseBody$Outbound + | shared.ErrorT$Outbound; + +/** @internal */ +export const GetCodeSamplePreviewAsyncResponse$outboundSchema: z.ZodType< + GetCodeSamplePreviewAsyncResponse$Outbound, + z.ZodTypeDef, + GetCodeSamplePreviewAsyncResponse +> = z.union([ + shared.UsageSnippets$outboundSchema, + z.lazy(() => GetCodeSamplePreviewAsyncResponseBody$outboundSchema), + shared.ErrorT$outboundSchema, +]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetCodeSamplePreviewAsyncResponse$ { + /** @deprecated use `GetCodeSamplePreviewAsyncResponse$inboundSchema` instead. */ + export const inboundSchema = GetCodeSamplePreviewAsyncResponse$inboundSchema; + /** @deprecated use `GetCodeSamplePreviewAsyncResponse$outboundSchema` instead. */ + export const outboundSchema = + GetCodeSamplePreviewAsyncResponse$outboundSchema; + /** @deprecated use `GetCodeSamplePreviewAsyncResponse$Outbound` instead. */ + export type Outbound = GetCodeSamplePreviewAsyncResponse$Outbound; +} + +export function getCodeSamplePreviewAsyncResponseToJSON( + getCodeSamplePreviewAsyncResponse: GetCodeSamplePreviewAsyncResponse, +): string { + return JSON.stringify( + GetCodeSamplePreviewAsyncResponse$outboundSchema.parse( + getCodeSamplePreviewAsyncResponse, + ), + ); +} + +export function getCodeSamplePreviewAsyncResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetCodeSamplePreviewAsyncResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetCodeSamplePreviewAsyncResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getcodesamples.ts b/src/sdk/models/operations/getcodesamples.ts new file mode 100644 index 00000000..9bab1aa7 --- /dev/null +++ b/src/sdk/models/operations/getcodesamples.ts @@ -0,0 +1,217 @@ +/* + * 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"; +import * as shared from "../shared/index.js"; + +export type MethodPaths = { + method: shared.HttpMethod; + path: string; +}; + +export type GetCodeSamplesRequest = { + /** + * The registry URL from which to retrieve the snippets. + */ + registryUrl: string; + /** + * The operation IDs to retrieve snippets for. + */ + operationIds?: Array | undefined; + /** + * The method paths to retrieve snippets for. + */ + methodPaths?: Array | undefined; + /** + * The languages to retrieve snippets for. + */ + languages?: Array | undefined; +}; + +export type GetCodeSamplesResponse = shared.UsageSnippets | shared.ErrorT; + +/** @internal */ +export const MethodPaths$inboundSchema: z.ZodType< + MethodPaths, + z.ZodTypeDef, + unknown +> = z.object({ + method: shared.HttpMethod$inboundSchema, + path: z.string(), +}); + +/** @internal */ +export type MethodPaths$Outbound = { + method: string; + path: string; +}; + +/** @internal */ +export const MethodPaths$outboundSchema: z.ZodType< + MethodPaths$Outbound, + z.ZodTypeDef, + MethodPaths +> = z.object({ + method: shared.HttpMethod$outboundSchema, + path: 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 MethodPaths$ { + /** @deprecated use `MethodPaths$inboundSchema` instead. */ + export const inboundSchema = MethodPaths$inboundSchema; + /** @deprecated use `MethodPaths$outboundSchema` instead. */ + export const outboundSchema = MethodPaths$outboundSchema; + /** @deprecated use `MethodPaths$Outbound` instead. */ + export type Outbound = MethodPaths$Outbound; +} + +export function methodPathsToJSON(methodPaths: MethodPaths): string { + return JSON.stringify(MethodPaths$outboundSchema.parse(methodPaths)); +} + +export function methodPathsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => MethodPaths$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'MethodPaths' from JSON`, + ); +} + +/** @internal */ +export const GetCodeSamplesRequest$inboundSchema: z.ZodType< + GetCodeSamplesRequest, + z.ZodTypeDef, + unknown +> = z.object({ + registry_url: z.string(), + operation_ids: z.array(z.string()).optional(), + method_paths: z.array(z.lazy(() => MethodPaths$inboundSchema)).optional(), + languages: z.array(z.string()).optional(), +}).transform((v) => { + return remap$(v, { + "registry_url": "registryUrl", + "operation_ids": "operationIds", + "method_paths": "methodPaths", + }); +}); + +/** @internal */ +export type GetCodeSamplesRequest$Outbound = { + registry_url: string; + operation_ids?: Array | undefined; + method_paths?: Array | undefined; + languages?: Array | undefined; +}; + +/** @internal */ +export const GetCodeSamplesRequest$outboundSchema: z.ZodType< + GetCodeSamplesRequest$Outbound, + z.ZodTypeDef, + GetCodeSamplesRequest +> = z.object({ + registryUrl: z.string(), + operationIds: z.array(z.string()).optional(), + methodPaths: z.array(z.lazy(() => MethodPaths$outboundSchema)).optional(), + languages: z.array(z.string()).optional(), +}).transform((v) => { + return remap$(v, { + registryUrl: "registry_url", + operationIds: "operation_ids", + methodPaths: "method_paths", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetCodeSamplesRequest$ { + /** @deprecated use `GetCodeSamplesRequest$inboundSchema` instead. */ + export const inboundSchema = GetCodeSamplesRequest$inboundSchema; + /** @deprecated use `GetCodeSamplesRequest$outboundSchema` instead. */ + export const outboundSchema = GetCodeSamplesRequest$outboundSchema; + /** @deprecated use `GetCodeSamplesRequest$Outbound` instead. */ + export type Outbound = GetCodeSamplesRequest$Outbound; +} + +export function getCodeSamplesRequestToJSON( + getCodeSamplesRequest: GetCodeSamplesRequest, +): string { + return JSON.stringify( + GetCodeSamplesRequest$outboundSchema.parse(getCodeSamplesRequest), + ); +} + +export function getCodeSamplesRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetCodeSamplesRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetCodeSamplesRequest' from JSON`, + ); +} + +/** @internal */ +export const GetCodeSamplesResponse$inboundSchema: z.ZodType< + GetCodeSamplesResponse, + z.ZodTypeDef, + unknown +> = z.union([shared.UsageSnippets$inboundSchema, shared.ErrorT$inboundSchema]); + +/** @internal */ +export type GetCodeSamplesResponse$Outbound = + | shared.UsageSnippets$Outbound + | shared.ErrorT$Outbound; + +/** @internal */ +export const GetCodeSamplesResponse$outboundSchema: z.ZodType< + GetCodeSamplesResponse$Outbound, + z.ZodTypeDef, + GetCodeSamplesResponse +> = z.union([ + shared.UsageSnippets$outboundSchema, + shared.ErrorT$outboundSchema, +]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetCodeSamplesResponse$ { + /** @deprecated use `GetCodeSamplesResponse$inboundSchema` instead. */ + export const inboundSchema = GetCodeSamplesResponse$inboundSchema; + /** @deprecated use `GetCodeSamplesResponse$outboundSchema` instead. */ + export const outboundSchema = GetCodeSamplesResponse$outboundSchema; + /** @deprecated use `GetCodeSamplesResponse$Outbound` instead. */ + export type Outbound = GetCodeSamplesResponse$Outbound; +} + +export function getCodeSamplesResponseToJSON( + getCodeSamplesResponse: GetCodeSamplesResponse, +): string { + return JSON.stringify( + GetCodeSamplesResponse$outboundSchema.parse(getCodeSamplesResponse), + ); +} + +export function getCodeSamplesResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetCodeSamplesResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetCodeSamplesResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getembedaccesstoken.ts b/src/sdk/models/operations/getembedaccesstoken.ts deleted file mode 100644 index ed8291c4..00000000 --- a/src/sdk/models/operations/getembedaccesstoken.ts +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import * as shared from "../shared/index.js"; - -export type GetEmbedAccessTokenRequest = { - /** - * The description of the embed access token. - */ - description?: string | undefined; - /** - * The duration (in minutes) of the embed access token. - */ - duration?: number | undefined; - /** - * The filter to apply to the query. - */ - filters?: shared.Filters | undefined; -}; - -export type GetEmbedAccessTokenResponse = - | shared.EmbedAccessTokenResponse - | shared.ErrorT; - -/** @internal */ -export const GetEmbedAccessTokenRequest$inboundSchema: z.ZodType< - GetEmbedAccessTokenRequest, - z.ZodTypeDef, - unknown -> = z.object({ - description: z.string().optional(), - duration: z.number().int().optional(), - filters: shared.Filters$inboundSchema.optional(), -}); - -/** @internal */ -export type GetEmbedAccessTokenRequest$Outbound = { - description?: string | undefined; - duration?: number | undefined; - filters?: shared.Filters$Outbound | undefined; -}; - -/** @internal */ -export const GetEmbedAccessTokenRequest$outboundSchema: z.ZodType< - GetEmbedAccessTokenRequest$Outbound, - z.ZodTypeDef, - GetEmbedAccessTokenRequest -> = z.object({ - description: z.string().optional(), - duration: z.number().int().optional(), - filters: shared.Filters$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 GetEmbedAccessTokenRequest$ { - /** @deprecated use `GetEmbedAccessTokenRequest$inboundSchema` instead. */ - export const inboundSchema = GetEmbedAccessTokenRequest$inboundSchema; - /** @deprecated use `GetEmbedAccessTokenRequest$outboundSchema` instead. */ - export const outboundSchema = GetEmbedAccessTokenRequest$outboundSchema; - /** @deprecated use `GetEmbedAccessTokenRequest$Outbound` instead. */ - export type Outbound = GetEmbedAccessTokenRequest$Outbound; -} - -/** @internal */ -export const GetEmbedAccessTokenResponse$inboundSchema: z.ZodType< - GetEmbedAccessTokenResponse, - z.ZodTypeDef, - unknown -> = z.union([ - shared.EmbedAccessTokenResponse$inboundSchema, - shared.ErrorT$inboundSchema, -]); - -/** @internal */ -export type GetEmbedAccessTokenResponse$Outbound = - | shared.EmbedAccessTokenResponse$Outbound - | shared.ErrorT$Outbound; - -/** @internal */ -export const GetEmbedAccessTokenResponse$outboundSchema: z.ZodType< - GetEmbedAccessTokenResponse$Outbound, - z.ZodTypeDef, - GetEmbedAccessTokenResponse -> = z.union([ - shared.EmbedAccessTokenResponse$outboundSchema, - shared.ErrorT$outboundSchema, -]); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetEmbedAccessTokenResponse$ { - /** @deprecated use `GetEmbedAccessTokenResponse$inboundSchema` instead. */ - export const inboundSchema = GetEmbedAccessTokenResponse$inboundSchema; - /** @deprecated use `GetEmbedAccessTokenResponse$outboundSchema` instead. */ - export const outboundSchema = GetEmbedAccessTokenResponse$outboundSchema; - /** @deprecated use `GetEmbedAccessTokenResponse$Outbound` instead. */ - export type Outbound = GetEmbedAccessTokenResponse$Outbound; -} diff --git a/src/sdk/models/operations/getgithubaction.ts b/src/sdk/models/operations/getgithubaction.ts index 1fb173a5..c41c4b3d 100644 --- a/src/sdk/models/operations/getgithubaction.ts +++ b/src/sdk/models/operations/getgithubaction.ts @@ -3,6 +3,9 @@ */ 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 * as shared from "../shared/index.js"; export type GetGitHubActionRequest = { @@ -60,6 +63,24 @@ export namespace GetGitHubActionRequest$ { export type Outbound = GetGitHubActionRequest$Outbound; } +export function getGitHubActionRequestToJSON( + getGitHubActionRequest: GetGitHubActionRequest, +): string { + return JSON.stringify( + GetGitHubActionRequest$outboundSchema.parse(getGitHubActionRequest), + ); +} + +export function getGitHubActionRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetGitHubActionRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetGitHubActionRequest' from JSON`, + ); +} + /** @internal */ export const GetGitHubActionResponse$inboundSchema: z.ZodType< GetGitHubActionResponse, @@ -97,3 +118,21 @@ export namespace GetGitHubActionResponse$ { /** @deprecated use `GetGitHubActionResponse$Outbound` instead. */ export type Outbound = GetGitHubActionResponse$Outbound; } + +export function getGitHubActionResponseToJSON( + getGitHubActionResponse: GetGitHubActionResponse, +): string { + return JSON.stringify( + GetGitHubActionResponse$outboundSchema.parse(getGitHubActionResponse), + ); +} + +export function getGitHubActionResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetGitHubActionResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetGitHubActionResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getgithubsetupstate.ts b/src/sdk/models/operations/getgithubsetupstate.ts new file mode 100644 index 00000000..f17fec59 --- /dev/null +++ b/src/sdk/models/operations/getgithubsetupstate.ts @@ -0,0 +1,146 @@ +/* + * 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"; +import * as shared from "../shared/index.js"; + +export type GetGithubSetupStateRequest = { + org: string; + repo: string; + generateGenLockId: string; +}; + +export type GetGithubSetupStateResponse = + | shared.ErrorT + | shared.GithubSetupStateResponse; + +/** @internal */ +export const GetGithubSetupStateRequest$inboundSchema: z.ZodType< + GetGithubSetupStateRequest, + z.ZodTypeDef, + unknown +> = z.object({ + org: z.string(), + repo: z.string(), + generate_gen_lock_id: z.string(), +}).transform((v) => { + return remap$(v, { + "generate_gen_lock_id": "generateGenLockId", + }); +}); + +/** @internal */ +export type GetGithubSetupStateRequest$Outbound = { + org: string; + repo: string; + generate_gen_lock_id: string; +}; + +/** @internal */ +export const GetGithubSetupStateRequest$outboundSchema: z.ZodType< + GetGithubSetupStateRequest$Outbound, + z.ZodTypeDef, + GetGithubSetupStateRequest +> = z.object({ + org: z.string(), + repo: z.string(), + generateGenLockId: z.string(), +}).transform((v) => { + return remap$(v, { + generateGenLockId: "generate_gen_lock_id", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetGithubSetupStateRequest$ { + /** @deprecated use `GetGithubSetupStateRequest$inboundSchema` instead. */ + export const inboundSchema = GetGithubSetupStateRequest$inboundSchema; + /** @deprecated use `GetGithubSetupStateRequest$outboundSchema` instead. */ + export const outboundSchema = GetGithubSetupStateRequest$outboundSchema; + /** @deprecated use `GetGithubSetupStateRequest$Outbound` instead. */ + export type Outbound = GetGithubSetupStateRequest$Outbound; +} + +export function getGithubSetupStateRequestToJSON( + getGithubSetupStateRequest: GetGithubSetupStateRequest, +): string { + return JSON.stringify( + GetGithubSetupStateRequest$outboundSchema.parse(getGithubSetupStateRequest), + ); +} + +export function getGithubSetupStateRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetGithubSetupStateRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetGithubSetupStateRequest' from JSON`, + ); +} + +/** @internal */ +export const GetGithubSetupStateResponse$inboundSchema: z.ZodType< + GetGithubSetupStateResponse, + z.ZodTypeDef, + unknown +> = z.union([ + shared.ErrorT$inboundSchema, + shared.GithubSetupStateResponse$inboundSchema, +]); + +/** @internal */ +export type GetGithubSetupStateResponse$Outbound = + | shared.ErrorT$Outbound + | shared.GithubSetupStateResponse$Outbound; + +/** @internal */ +export const GetGithubSetupStateResponse$outboundSchema: z.ZodType< + GetGithubSetupStateResponse$Outbound, + z.ZodTypeDef, + GetGithubSetupStateResponse +> = z.union([ + shared.ErrorT$outboundSchema, + shared.GithubSetupStateResponse$outboundSchema, +]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetGithubSetupStateResponse$ { + /** @deprecated use `GetGithubSetupStateResponse$inboundSchema` instead. */ + export const inboundSchema = GetGithubSetupStateResponse$inboundSchema; + /** @deprecated use `GetGithubSetupStateResponse$outboundSchema` instead. */ + export const outboundSchema = GetGithubSetupStateResponse$outboundSchema; + /** @deprecated use `GetGithubSetupStateResponse$Outbound` instead. */ + export type Outbound = GetGithubSetupStateResponse$Outbound; +} + +export function getGithubSetupStateResponseToJSON( + getGithubSetupStateResponse: GetGithubSetupStateResponse, +): string { + return JSON.stringify( + GetGithubSetupStateResponse$outboundSchema.parse( + getGithubSetupStateResponse, + ), + ); +} + +export function getGithubSetupStateResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetGithubSetupStateResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetGithubSetupStateResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getlintingreportsignedurl.ts b/src/sdk/models/operations/getlintingreportsignedurl.ts index 305101c3..cfad5aad 100644 --- a/src/sdk/models/operations/getlintingreportsignedurl.ts +++ b/src/sdk/models/operations/getlintingreportsignedurl.ts @@ -3,6 +3,9 @@ */ 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 GetLintingReportSignedUrlRequest = { /** @@ -54,6 +57,26 @@ export namespace GetLintingReportSignedUrlRequest$ { export type Outbound = GetLintingReportSignedUrlRequest$Outbound; } +export function getLintingReportSignedUrlRequestToJSON( + getLintingReportSignedUrlRequest: GetLintingReportSignedUrlRequest, +): string { + return JSON.stringify( + GetLintingReportSignedUrlRequest$outboundSchema.parse( + getLintingReportSignedUrlRequest, + ), + ); +} + +export function getLintingReportSignedUrlRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLintingReportSignedUrlRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLintingReportSignedUrlRequest' from JSON`, + ); +} + /** @internal */ export const GetLintingReportSignedUrlSignedAccess$inboundSchema: z.ZodType< GetLintingReportSignedUrlSignedAccess, @@ -91,3 +114,24 @@ export namespace GetLintingReportSignedUrlSignedAccess$ { /** @deprecated use `GetLintingReportSignedUrlSignedAccess$Outbound` instead. */ export type Outbound = GetLintingReportSignedUrlSignedAccess$Outbound; } + +export function getLintingReportSignedUrlSignedAccessToJSON( + getLintingReportSignedUrlSignedAccess: GetLintingReportSignedUrlSignedAccess, +): string { + return JSON.stringify( + GetLintingReportSignedUrlSignedAccess$outboundSchema.parse( + getLintingReportSignedUrlSignedAccess, + ), + ); +} + +export function getLintingReportSignedUrlSignedAccessFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetLintingReportSignedUrlSignedAccess$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLintingReportSignedUrlSignedAccess' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getmanifest.ts b/src/sdk/models/operations/getmanifest.ts index bd34701d..714bdeb1 100644 --- a/src/sdk/models/operations/getmanifest.ts +++ b/src/sdk/models/operations/getmanifest.ts @@ -4,6 +4,9 @@ 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"; import * as shared from "../shared/index.js"; export type GetManifestRequest = { @@ -77,6 +80,24 @@ export namespace GetManifestRequest$ { export type Outbound = GetManifestRequest$Outbound; } +export function getManifestRequestToJSON( + getManifestRequest: GetManifestRequest, +): string { + return JSON.stringify( + GetManifestRequest$outboundSchema.parse(getManifestRequest), + ); +} + +export function getManifestRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetManifestRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetManifestRequest' from JSON`, + ); +} + /** @internal */ export const GetManifestResponse$inboundSchema: z.ZodType< GetManifestResponse, @@ -108,3 +129,21 @@ export namespace GetManifestResponse$ { /** @deprecated use `GetManifestResponse$Outbound` instead. */ export type Outbound = GetManifestResponse$Outbound; } + +export function getManifestResponseToJSON( + getManifestResponse: GetManifestResponse, +): string { + return JSON.stringify( + GetManifestResponse$outboundSchema.parse(getManifestResponse), + ); +} + +export function getManifestResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetManifestResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetManifestResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getnamespaces.ts b/src/sdk/models/operations/getnamespaces.ts index 1ddd656b..08cf455e 100644 --- a/src/sdk/models/operations/getnamespaces.ts +++ b/src/sdk/models/operations/getnamespaces.ts @@ -3,6 +3,9 @@ */ 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 * as shared from "../shared/index.js"; export type GetNamespacesResponse = @@ -46,3 +49,21 @@ export namespace GetNamespacesResponse$ { /** @deprecated use `GetNamespacesResponse$Outbound` instead. */ export type Outbound = GetNamespacesResponse$Outbound; } + +export function getNamespacesResponseToJSON( + getNamespacesResponse: GetNamespacesResponse, +): string { + return JSON.stringify( + GetNamespacesResponse$outboundSchema.parse(getNamespacesResponse), + ); +} + +export function getNamespacesResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetNamespacesResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetNamespacesResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getorganization.ts b/src/sdk/models/operations/getorganization.ts index c8282e59..e78d13f2 100644 --- a/src/sdk/models/operations/getorganization.ts +++ b/src/sdk/models/operations/getorganization.ts @@ -3,6 +3,9 @@ */ 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 * as shared from "../shared/index.js"; export type GetOrganizationRequest = { @@ -50,6 +53,24 @@ export namespace GetOrganizationRequest$ { export type Outbound = GetOrganizationRequest$Outbound; } +export function getOrganizationRequestToJSON( + getOrganizationRequest: GetOrganizationRequest, +): string { + return JSON.stringify( + GetOrganizationRequest$outboundSchema.parse(getOrganizationRequest), + ); +} + +export function getOrganizationRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetOrganizationRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetOrganizationRequest' from JSON`, + ); +} + /** @internal */ export const GetOrganizationResponse$inboundSchema: z.ZodType< GetOrganizationResponse, @@ -81,3 +102,21 @@ export namespace GetOrganizationResponse$ { /** @deprecated use `GetOrganizationResponse$Outbound` instead. */ export type Outbound = GetOrganizationResponse$Outbound; } + +export function getOrganizationResponseToJSON( + getOrganizationResponse: GetOrganizationResponse, +): string { + return JSON.stringify( + GetOrganizationResponse$outboundSchema.parse(getOrganizationResponse), + ); +} + +export function getOrganizationResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetOrganizationResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetOrganizationResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getorganizations.ts b/src/sdk/models/operations/getorganizations.ts index 45a9c1c8..5490e5a6 100644 --- a/src/sdk/models/operations/getorganizations.ts +++ b/src/sdk/models/operations/getorganizations.ts @@ -3,6 +3,9 @@ */ 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 * as shared from "../shared/index.js"; export type GetOrganizationsResponse = @@ -46,3 +49,21 @@ export namespace GetOrganizationsResponse$ { /** @deprecated use `GetOrganizationsResponse$Outbound` instead. */ export type Outbound = GetOrganizationsResponse$Outbound; } + +export function getOrganizationsResponseToJSON( + getOrganizationsResponse: GetOrganizationsResponse, +): string { + return JSON.stringify( + GetOrganizationsResponse$outboundSchema.parse(getOrganizationsResponse), + ); +} + +export function getOrganizationsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetOrganizationsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetOrganizationsResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getorganizationusage.ts b/src/sdk/models/operations/getorganizationusage.ts index 56eb7a91..46bfc9a9 100644 --- a/src/sdk/models/operations/getorganizationusage.ts +++ b/src/sdk/models/operations/getorganizationusage.ts @@ -3,6 +3,9 @@ */ 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 * as shared from "../shared/index.js"; export type GetOrganizationUsageResponse = @@ -46,3 +49,23 @@ export namespace GetOrganizationUsageResponse$ { /** @deprecated use `GetOrganizationUsageResponse$Outbound` instead. */ export type Outbound = GetOrganizationUsageResponse$Outbound; } + +export function getOrganizationUsageResponseToJSON( + getOrganizationUsageResponse: GetOrganizationUsageResponse, +): string { + return JSON.stringify( + GetOrganizationUsageResponse$outboundSchema.parse( + getOrganizationUsageResponse, + ), + ); +} + +export function getOrganizationUsageResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetOrganizationUsageResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetOrganizationUsageResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getrequestfromeventlog.ts b/src/sdk/models/operations/getrequestfromeventlog.ts deleted file mode 100644 index acce20a3..00000000 --- a/src/sdk/models/operations/getrequestfromeventlog.ts +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import * as shared from "../shared/index.js"; - -export type GetRequestFromEventLogRequest = { - /** - * The ID of the request to retrieve. - */ - requestID: string; -}; - -export type GetRequestFromEventLogResponse = - | shared.ErrorT - | shared.UnboundedRequest; - -/** @internal */ -export const GetRequestFromEventLogRequest$inboundSchema: z.ZodType< - GetRequestFromEventLogRequest, - z.ZodTypeDef, - unknown -> = z.object({ - requestID: z.string(), -}); - -/** @internal */ -export type GetRequestFromEventLogRequest$Outbound = { - requestID: string; -}; - -/** @internal */ -export const GetRequestFromEventLogRequest$outboundSchema: z.ZodType< - GetRequestFromEventLogRequest$Outbound, - z.ZodTypeDef, - GetRequestFromEventLogRequest -> = z.object({ - requestID: 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 GetRequestFromEventLogRequest$ { - /** @deprecated use `GetRequestFromEventLogRequest$inboundSchema` instead. */ - export const inboundSchema = GetRequestFromEventLogRequest$inboundSchema; - /** @deprecated use `GetRequestFromEventLogRequest$outboundSchema` instead. */ - export const outboundSchema = GetRequestFromEventLogRequest$outboundSchema; - /** @deprecated use `GetRequestFromEventLogRequest$Outbound` instead. */ - export type Outbound = GetRequestFromEventLogRequest$Outbound; -} - -/** @internal */ -export const GetRequestFromEventLogResponse$inboundSchema: z.ZodType< - GetRequestFromEventLogResponse, - z.ZodTypeDef, - unknown -> = z.union([ - shared.ErrorT$inboundSchema, - shared.UnboundedRequest$inboundSchema, -]); - -/** @internal */ -export type GetRequestFromEventLogResponse$Outbound = - | shared.ErrorT$Outbound - | shared.UnboundedRequest$Outbound; - -/** @internal */ -export const GetRequestFromEventLogResponse$outboundSchema: z.ZodType< - GetRequestFromEventLogResponse$Outbound, - z.ZodTypeDef, - GetRequestFromEventLogResponse -> = z.union([ - shared.ErrorT$outboundSchema, - shared.UnboundedRequest$outboundSchema, -]); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetRequestFromEventLogResponse$ { - /** @deprecated use `GetRequestFromEventLogResponse$inboundSchema` instead. */ - export const inboundSchema = GetRequestFromEventLogResponse$inboundSchema; - /** @deprecated use `GetRequestFromEventLogResponse$outboundSchema` instead. */ - export const outboundSchema = GetRequestFromEventLogResponse$outboundSchema; - /** @deprecated use `GetRequestFromEventLogResponse$Outbound` instead. */ - export type Outbound = GetRequestFromEventLogResponse$Outbound; -} diff --git a/src/sdk/models/operations/getrevisions.ts b/src/sdk/models/operations/getrevisions.ts index bd4918c6..69e01cd1 100644 --- a/src/sdk/models/operations/getrevisions.ts +++ b/src/sdk/models/operations/getrevisions.ts @@ -4,6 +4,9 @@ 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"; import * as shared from "../shared/index.js"; export type GetRevisionsRequest = { @@ -65,6 +68,24 @@ export namespace GetRevisionsRequest$ { export type Outbound = GetRevisionsRequest$Outbound; } +export function getRevisionsRequestToJSON( + getRevisionsRequest: GetRevisionsRequest, +): string { + return JSON.stringify( + GetRevisionsRequest$outboundSchema.parse(getRevisionsRequest), + ); +} + +export function getRevisionsRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetRevisionsRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRevisionsRequest' from JSON`, + ); +} + /** @internal */ export const GetRevisionsResponse$inboundSchema: z.ZodType< GetRevisionsResponse, @@ -102,3 +123,21 @@ export namespace GetRevisionsResponse$ { /** @deprecated use `GetRevisionsResponse$Outbound` instead. */ export type Outbound = GetRevisionsResponse$Outbound; } + +export function getRevisionsResponseToJSON( + getRevisionsResponse: GetRevisionsResponse, +): string { + return JSON.stringify( + GetRevisionsResponse$outboundSchema.parse(getRevisionsResponse), + ); +} + +export function getRevisionsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetRevisionsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRevisionsResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getschema.ts b/src/sdk/models/operations/getschema.ts deleted file mode 100644 index 2539ab33..00000000 --- a/src/sdk/models/operations/getschema.ts +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import * as shared from "../shared/index.js"; - -export type GetSchemaRequest = { - /** - * The ID of the Api to get the schema for. - */ - apiID: string; - /** - * The version ID of the Api to delete metadata for. - */ - versionID: string; -}; - -export type GetSchemaResponse = shared.ErrorT | shared.Schema; - -/** @internal */ -export const GetSchemaRequest$inboundSchema: z.ZodType< - GetSchemaRequest, - z.ZodTypeDef, - unknown -> = z.object({ - apiID: z.string(), - versionID: z.string(), -}); - -/** @internal */ -export type GetSchemaRequest$Outbound = { - apiID: string; - versionID: string; -}; - -/** @internal */ -export const GetSchemaRequest$outboundSchema: z.ZodType< - GetSchemaRequest$Outbound, - z.ZodTypeDef, - GetSchemaRequest -> = z.object({ - apiID: z.string(), - versionID: 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 GetSchemaRequest$ { - /** @deprecated use `GetSchemaRequest$inboundSchema` instead. */ - export const inboundSchema = GetSchemaRequest$inboundSchema; - /** @deprecated use `GetSchemaRequest$outboundSchema` instead. */ - export const outboundSchema = GetSchemaRequest$outboundSchema; - /** @deprecated use `GetSchemaRequest$Outbound` instead. */ - export type Outbound = GetSchemaRequest$Outbound; -} - -/** @internal */ -export const GetSchemaResponse$inboundSchema: z.ZodType< - GetSchemaResponse, - z.ZodTypeDef, - unknown -> = z.union([shared.ErrorT$inboundSchema, shared.Schema$inboundSchema]); - -/** @internal */ -export type GetSchemaResponse$Outbound = - | shared.ErrorT$Outbound - | shared.Schema$Outbound; - -/** @internal */ -export const GetSchemaResponse$outboundSchema: z.ZodType< - GetSchemaResponse$Outbound, - z.ZodTypeDef, - GetSchemaResponse -> = z.union([shared.ErrorT$outboundSchema, shared.Schema$outboundSchema]); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetSchemaResponse$ { - /** @deprecated use `GetSchemaResponse$inboundSchema` instead. */ - export const inboundSchema = GetSchemaResponse$inboundSchema; - /** @deprecated use `GetSchemaResponse$outboundSchema` instead. */ - export const outboundSchema = GetSchemaResponse$outboundSchema; - /** @deprecated use `GetSchemaResponse$Outbound` instead. */ - export type Outbound = GetSchemaResponse$Outbound; -} diff --git a/src/sdk/models/operations/getschemadiff.ts b/src/sdk/models/operations/getschemadiff.ts deleted file mode 100644 index 2929d0cc..00000000 --- a/src/sdk/models/operations/getschemadiff.ts +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import * as shared from "../shared/index.js"; - -export type GetSchemaDiffRequest = { - /** - * The ID of the Api to retrieve schemas for. - */ - apiID: string; - /** - * The version ID of the Api to delete metadata for. - */ - versionID: string; - /** - * The base revision ID of the schema to retrieve. - */ - baseRevisionID: string; - /** - * The target revision ID of the schema to retrieve. - */ - targetRevisionID: string; -}; - -export type GetSchemaDiffResponse = shared.ErrorT | shared.SchemaDiff; - -/** @internal */ -export const GetSchemaDiffRequest$inboundSchema: z.ZodType< - GetSchemaDiffRequest, - z.ZodTypeDef, - unknown -> = z.object({ - apiID: z.string(), - versionID: z.string(), - baseRevisionID: z.string(), - targetRevisionID: z.string(), -}); - -/** @internal */ -export type GetSchemaDiffRequest$Outbound = { - apiID: string; - versionID: string; - baseRevisionID: string; - targetRevisionID: string; -}; - -/** @internal */ -export const GetSchemaDiffRequest$outboundSchema: z.ZodType< - GetSchemaDiffRequest$Outbound, - z.ZodTypeDef, - GetSchemaDiffRequest -> = z.object({ - apiID: z.string(), - versionID: z.string(), - baseRevisionID: z.string(), - targetRevisionID: 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 GetSchemaDiffRequest$ { - /** @deprecated use `GetSchemaDiffRequest$inboundSchema` instead. */ - export const inboundSchema = GetSchemaDiffRequest$inboundSchema; - /** @deprecated use `GetSchemaDiffRequest$outboundSchema` instead. */ - export const outboundSchema = GetSchemaDiffRequest$outboundSchema; - /** @deprecated use `GetSchemaDiffRequest$Outbound` instead. */ - export type Outbound = GetSchemaDiffRequest$Outbound; -} - -/** @internal */ -export const GetSchemaDiffResponse$inboundSchema: z.ZodType< - GetSchemaDiffResponse, - z.ZodTypeDef, - unknown -> = z.union([shared.ErrorT$inboundSchema, shared.SchemaDiff$inboundSchema]); - -/** @internal */ -export type GetSchemaDiffResponse$Outbound = - | shared.ErrorT$Outbound - | shared.SchemaDiff$Outbound; - -/** @internal */ -export const GetSchemaDiffResponse$outboundSchema: z.ZodType< - GetSchemaDiffResponse$Outbound, - z.ZodTypeDef, - GetSchemaDiffResponse -> = z.union([shared.ErrorT$outboundSchema, shared.SchemaDiff$outboundSchema]); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetSchemaDiffResponse$ { - /** @deprecated use `GetSchemaDiffResponse$inboundSchema` instead. */ - export const inboundSchema = GetSchemaDiffResponse$inboundSchema; - /** @deprecated use `GetSchemaDiffResponse$outboundSchema` instead. */ - export const outboundSchema = GetSchemaDiffResponse$outboundSchema; - /** @deprecated use `GetSchemaDiffResponse$Outbound` instead. */ - export type Outbound = GetSchemaDiffResponse$Outbound; -} diff --git a/src/sdk/models/operations/getschemarevision.ts b/src/sdk/models/operations/getschemarevision.ts deleted file mode 100644 index 8f0c01a2..00000000 --- a/src/sdk/models/operations/getschemarevision.ts +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import * as shared from "../shared/index.js"; - -export type GetSchemaRevisionRequest = { - /** - * The ID of the Api to retrieve schemas for. - */ - apiID: string; - /** - * The version ID of the Api to delete metadata for. - */ - versionID: string; - /** - * The revision ID of the schema to retrieve. - */ - revisionID: string; -}; - -export type GetSchemaRevisionResponse = shared.ErrorT | shared.Schema; - -/** @internal */ -export const GetSchemaRevisionRequest$inboundSchema: z.ZodType< - GetSchemaRevisionRequest, - z.ZodTypeDef, - unknown -> = z.object({ - apiID: z.string(), - versionID: z.string(), - revisionID: z.string(), -}); - -/** @internal */ -export type GetSchemaRevisionRequest$Outbound = { - apiID: string; - versionID: string; - revisionID: string; -}; - -/** @internal */ -export const GetSchemaRevisionRequest$outboundSchema: z.ZodType< - GetSchemaRevisionRequest$Outbound, - z.ZodTypeDef, - GetSchemaRevisionRequest -> = z.object({ - apiID: z.string(), - versionID: z.string(), - revisionID: 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 GetSchemaRevisionRequest$ { - /** @deprecated use `GetSchemaRevisionRequest$inboundSchema` instead. */ - export const inboundSchema = GetSchemaRevisionRequest$inboundSchema; - /** @deprecated use `GetSchemaRevisionRequest$outboundSchema` instead. */ - export const outboundSchema = GetSchemaRevisionRequest$outboundSchema; - /** @deprecated use `GetSchemaRevisionRequest$Outbound` instead. */ - export type Outbound = GetSchemaRevisionRequest$Outbound; -} - -/** @internal */ -export const GetSchemaRevisionResponse$inboundSchema: z.ZodType< - GetSchemaRevisionResponse, - z.ZodTypeDef, - unknown -> = z.union([shared.ErrorT$inboundSchema, shared.Schema$inboundSchema]); - -/** @internal */ -export type GetSchemaRevisionResponse$Outbound = - | shared.ErrorT$Outbound - | shared.Schema$Outbound; - -/** @internal */ -export const GetSchemaRevisionResponse$outboundSchema: z.ZodType< - GetSchemaRevisionResponse$Outbound, - z.ZodTypeDef, - GetSchemaRevisionResponse -> = z.union([shared.ErrorT$outboundSchema, shared.Schema$outboundSchema]); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetSchemaRevisionResponse$ { - /** @deprecated use `GetSchemaRevisionResponse$inboundSchema` instead. */ - export const inboundSchema = GetSchemaRevisionResponse$inboundSchema; - /** @deprecated use `GetSchemaRevisionResponse$outboundSchema` instead. */ - export const outboundSchema = GetSchemaRevisionResponse$outboundSchema; - /** @deprecated use `GetSchemaRevisionResponse$Outbound` instead. */ - export type Outbound = GetSchemaRevisionResponse$Outbound; -} diff --git a/src/sdk/models/operations/getschemas.ts b/src/sdk/models/operations/getschemas.ts deleted file mode 100644 index cc164307..00000000 --- a/src/sdk/models/operations/getschemas.ts +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import * as shared from "../shared/index.js"; - -export type GetSchemasRequest = { - /** - * The ID of the Api to retrieve schemas for. - */ - apiID: string; - /** - * The version ID of the Api to delete metadata for. - */ - versionID: string; -}; - -export type GetSchemasResponse = shared.ErrorT | Array; - -/** @internal */ -export const GetSchemasRequest$inboundSchema: z.ZodType< - GetSchemasRequest, - z.ZodTypeDef, - unknown -> = z.object({ - apiID: z.string(), - versionID: z.string(), -}); - -/** @internal */ -export type GetSchemasRequest$Outbound = { - apiID: string; - versionID: string; -}; - -/** @internal */ -export const GetSchemasRequest$outboundSchema: z.ZodType< - GetSchemasRequest$Outbound, - z.ZodTypeDef, - GetSchemasRequest -> = z.object({ - apiID: z.string(), - versionID: 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 GetSchemasRequest$ { - /** @deprecated use `GetSchemasRequest$inboundSchema` instead. */ - export const inboundSchema = GetSchemasRequest$inboundSchema; - /** @deprecated use `GetSchemasRequest$outboundSchema` instead. */ - export const outboundSchema = GetSchemasRequest$outboundSchema; - /** @deprecated use `GetSchemasRequest$Outbound` instead. */ - export type Outbound = GetSchemasRequest$Outbound; -} - -/** @internal */ -export const GetSchemasResponse$inboundSchema: z.ZodType< - GetSchemasResponse, - z.ZodTypeDef, - unknown -> = z.union([ - shared.ErrorT$inboundSchema, - z.array(shared.Schema$inboundSchema), -]); - -/** @internal */ -export type GetSchemasResponse$Outbound = - | shared.ErrorT$Outbound - | Array; - -/** @internal */ -export const GetSchemasResponse$outboundSchema: z.ZodType< - GetSchemasResponse$Outbound, - z.ZodTypeDef, - GetSchemasResponse -> = z.union([ - shared.ErrorT$outboundSchema, - z.array(shared.Schema$outboundSchema), -]); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetSchemasResponse$ { - /** @deprecated use `GetSchemasResponse$inboundSchema` instead. */ - export const inboundSchema = GetSchemasResponse$inboundSchema; - /** @deprecated use `GetSchemasResponse$outboundSchema` instead. */ - export const outboundSchema = GetSchemasResponse$outboundSchema; - /** @deprecated use `GetSchemasResponse$Outbound` instead. */ - export type Outbound = GetSchemasResponse$Outbound; -} diff --git a/src/sdk/models/operations/gettags.ts b/src/sdk/models/operations/gettags.ts index 1fdb2ec3..5f8fc90a 100644 --- a/src/sdk/models/operations/gettags.ts +++ b/src/sdk/models/operations/gettags.ts @@ -4,6 +4,9 @@ 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"; import * as shared from "../shared/index.js"; export type GetTagsRequest = { @@ -56,6 +59,20 @@ export namespace GetTagsRequest$ { export type Outbound = GetTagsRequest$Outbound; } +export function getTagsRequestToJSON(getTagsRequest: GetTagsRequest): string { + return JSON.stringify(GetTagsRequest$outboundSchema.parse(getTagsRequest)); +} + +export function getTagsRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTagsRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTagsRequest' from JSON`, + ); +} + /** @internal */ export const GetTagsResponse$inboundSchema: z.ZodType< GetTagsResponse, @@ -93,3 +110,19 @@ export namespace GetTagsResponse$ { /** @deprecated use `GetTagsResponse$Outbound` instead. */ export type Outbound = GetTagsResponse$Outbound; } + +export function getTagsResponseToJSON( + getTagsResponse: GetTagsResponse, +): string { + return JSON.stringify(GetTagsResponse$outboundSchema.parse(getTagsResponse)); +} + +export function getTagsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTagsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTagsResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getuser.ts b/src/sdk/models/operations/getuser.ts index e48a8418..973fdf4a 100644 --- a/src/sdk/models/operations/getuser.ts +++ b/src/sdk/models/operations/getuser.ts @@ -3,6 +3,9 @@ */ 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 * as shared from "../shared/index.js"; export type GetUserResponse = shared.ErrorT | shared.User; @@ -38,3 +41,19 @@ export namespace GetUserResponse$ { /** @deprecated use `GetUserResponse$Outbound` instead. */ export type Outbound = GetUserResponse$Outbound; } + +export function getUserResponseToJSON( + getUserResponse: GetUserResponse, +): string { + return JSON.stringify(GetUserResponse$outboundSchema.parse(getUserResponse)); +} + +export function getUserResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetUserResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetUserResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getvalidembedaccesstokens.ts b/src/sdk/models/operations/getvalidembedaccesstokens.ts deleted file mode 100644 index 6a806207..00000000 --- a/src/sdk/models/operations/getvalidembedaccesstokens.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import * as shared from "../shared/index.js"; - -export type GetValidEmbedAccessTokensResponse = - | shared.ErrorT - | Array; - -/** @internal */ -export const GetValidEmbedAccessTokensResponse$inboundSchema: z.ZodType< - GetValidEmbedAccessTokensResponse, - z.ZodTypeDef, - unknown -> = z.union([ - shared.ErrorT$inboundSchema, - z.array(shared.EmbedToken$inboundSchema), -]); - -/** @internal */ -export type GetValidEmbedAccessTokensResponse$Outbound = - | shared.ErrorT$Outbound - | Array; - -/** @internal */ -export const GetValidEmbedAccessTokensResponse$outboundSchema: z.ZodType< - GetValidEmbedAccessTokensResponse$Outbound, - z.ZodTypeDef, - GetValidEmbedAccessTokensResponse -> = z.union([ - shared.ErrorT$outboundSchema, - z.array(shared.EmbedToken$outboundSchema), -]); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetValidEmbedAccessTokensResponse$ { - /** @deprecated use `GetValidEmbedAccessTokensResponse$inboundSchema` instead. */ - export const inboundSchema = GetValidEmbedAccessTokensResponse$inboundSchema; - /** @deprecated use `GetValidEmbedAccessTokensResponse$outboundSchema` instead. */ - export const outboundSchema = - GetValidEmbedAccessTokensResponse$outboundSchema; - /** @deprecated use `GetValidEmbedAccessTokensResponse$Outbound` instead. */ - export type Outbound = GetValidEmbedAccessTokensResponse$Outbound; -} diff --git a/src/sdk/models/operations/getversionmetadata.ts b/src/sdk/models/operations/getversionmetadata.ts deleted file mode 100644 index 085f5d68..00000000 --- a/src/sdk/models/operations/getversionmetadata.ts +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import * as shared from "../shared/index.js"; - -export type GetVersionMetadataRequest = { - /** - * The ID of the Api to retrieve metadata for. - */ - apiID: string; - /** - * The version ID of the Api to retrieve metadata for. - */ - versionID: string; -}; - -export type GetVersionMetadataResponse = - | shared.ErrorT - | Array; - -/** @internal */ -export const GetVersionMetadataRequest$inboundSchema: z.ZodType< - GetVersionMetadataRequest, - z.ZodTypeDef, - unknown -> = z.object({ - apiID: z.string(), - versionID: z.string(), -}); - -/** @internal */ -export type GetVersionMetadataRequest$Outbound = { - apiID: string; - versionID: string; -}; - -/** @internal */ -export const GetVersionMetadataRequest$outboundSchema: z.ZodType< - GetVersionMetadataRequest$Outbound, - z.ZodTypeDef, - GetVersionMetadataRequest -> = z.object({ - apiID: z.string(), - versionID: 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 GetVersionMetadataRequest$ { - /** @deprecated use `GetVersionMetadataRequest$inboundSchema` instead. */ - export const inboundSchema = GetVersionMetadataRequest$inboundSchema; - /** @deprecated use `GetVersionMetadataRequest$outboundSchema` instead. */ - export const outboundSchema = GetVersionMetadataRequest$outboundSchema; - /** @deprecated use `GetVersionMetadataRequest$Outbound` instead. */ - export type Outbound = GetVersionMetadataRequest$Outbound; -} - -/** @internal */ -export const GetVersionMetadataResponse$inboundSchema: z.ZodType< - GetVersionMetadataResponse, - z.ZodTypeDef, - unknown -> = z.union([ - shared.ErrorT$inboundSchema, - z.array(shared.VersionMetadata$inboundSchema), -]); - -/** @internal */ -export type GetVersionMetadataResponse$Outbound = - | shared.ErrorT$Outbound - | Array; - -/** @internal */ -export const GetVersionMetadataResponse$outboundSchema: z.ZodType< - GetVersionMetadataResponse$Outbound, - z.ZodTypeDef, - GetVersionMetadataResponse -> = z.union([ - shared.ErrorT$outboundSchema, - z.array(shared.VersionMetadata$outboundSchema), -]); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetVersionMetadataResponse$ { - /** @deprecated use `GetVersionMetadataResponse$inboundSchema` instead. */ - export const inboundSchema = GetVersionMetadataResponse$inboundSchema; - /** @deprecated use `GetVersionMetadataResponse$outboundSchema` instead. */ - export const outboundSchema = GetVersionMetadataResponse$outboundSchema; - /** @deprecated use `GetVersionMetadataResponse$Outbound` instead. */ - export type Outbound = GetVersionMetadataResponse$Outbound; -} diff --git a/src/sdk/models/operations/getworkspace.ts b/src/sdk/models/operations/getworkspace.ts index 0b4fb5db..7fec2ad7 100644 --- a/src/sdk/models/operations/getworkspace.ts +++ b/src/sdk/models/operations/getworkspace.ts @@ -4,24 +4,93 @@ 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"; import * as shared from "../shared/index.js"; +export type GetWorkspaceGlobals = { + workspaceId?: string | undefined; +}; + export type GetWorkspaceRequest = { /** * Unique identifier of the workspace. */ - workspaceId: string; + workspaceId?: string | undefined; }; export type GetWorkspaceResponse = shared.ErrorT | shared.Workspace; +/** @internal */ +export const GetWorkspaceGlobals$inboundSchema: z.ZodType< + GetWorkspaceGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + workspace_id: z.string().optional(), +}).transform((v) => { + return remap$(v, { + "workspace_id": "workspaceId", + }); +}); + +/** @internal */ +export type GetWorkspaceGlobals$Outbound = { + workspace_id?: string | undefined; +}; + +/** @internal */ +export const GetWorkspaceGlobals$outboundSchema: z.ZodType< + GetWorkspaceGlobals$Outbound, + z.ZodTypeDef, + GetWorkspaceGlobals +> = z.object({ + workspaceId: z.string().optional(), +}).transform((v) => { + return remap$(v, { + workspaceId: "workspace_id", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetWorkspaceGlobals$ { + /** @deprecated use `GetWorkspaceGlobals$inboundSchema` instead. */ + export const inboundSchema = GetWorkspaceGlobals$inboundSchema; + /** @deprecated use `GetWorkspaceGlobals$outboundSchema` instead. */ + export const outboundSchema = GetWorkspaceGlobals$outboundSchema; + /** @deprecated use `GetWorkspaceGlobals$Outbound` instead. */ + export type Outbound = GetWorkspaceGlobals$Outbound; +} + +export function getWorkspaceGlobalsToJSON( + getWorkspaceGlobals: GetWorkspaceGlobals, +): string { + return JSON.stringify( + GetWorkspaceGlobals$outboundSchema.parse(getWorkspaceGlobals), + ); +} + +export function getWorkspaceGlobalsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceGlobals$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceGlobals' from JSON`, + ); +} + /** @internal */ export const GetWorkspaceRequest$inboundSchema: z.ZodType< GetWorkspaceRequest, z.ZodTypeDef, unknown > = z.object({ - workspace_id: z.string(), + workspace_id: z.string().optional(), }).transform((v) => { return remap$(v, { "workspace_id": "workspaceId", @@ -30,7 +99,7 @@ export const GetWorkspaceRequest$inboundSchema: z.ZodType< /** @internal */ export type GetWorkspaceRequest$Outbound = { - workspace_id: string; + workspace_id?: string | undefined; }; /** @internal */ @@ -39,7 +108,7 @@ export const GetWorkspaceRequest$outboundSchema: z.ZodType< z.ZodTypeDef, GetWorkspaceRequest > = z.object({ - workspaceId: z.string(), + workspaceId: z.string().optional(), }).transform((v) => { return remap$(v, { workspaceId: "workspace_id", @@ -59,6 +128,24 @@ export namespace GetWorkspaceRequest$ { export type Outbound = GetWorkspaceRequest$Outbound; } +export function getWorkspaceRequestToJSON( + getWorkspaceRequest: GetWorkspaceRequest, +): string { + return JSON.stringify( + GetWorkspaceRequest$outboundSchema.parse(getWorkspaceRequest), + ); +} + +export function getWorkspaceRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceRequest' from JSON`, + ); +} + /** @internal */ export const GetWorkspaceResponse$inboundSchema: z.ZodType< GetWorkspaceResponse, @@ -90,3 +177,21 @@ export namespace GetWorkspaceResponse$ { /** @deprecated use `GetWorkspaceResponse$Outbound` instead. */ export type Outbound = GetWorkspaceResponse$Outbound; } + +export function getWorkspaceResponseToJSON( + getWorkspaceResponse: GetWorkspaceResponse, +): string { + return JSON.stringify( + GetWorkspaceResponse$outboundSchema.parse(getWorkspaceResponse), + ); +} + +export function getWorkspaceResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getworkspaceaccess.ts b/src/sdk/models/operations/getworkspaceaccess.ts index fa97c8fc..9e531f2a 100644 --- a/src/sdk/models/operations/getworkspaceaccess.ts +++ b/src/sdk/models/operations/getworkspaceaccess.ts @@ -3,6 +3,9 @@ */ 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 GetWorkspaceAccessRequest = { /** @@ -60,3 +63,21 @@ export namespace GetWorkspaceAccessRequest$ { /** @deprecated use `GetWorkspaceAccessRequest$Outbound` instead. */ export type Outbound = GetWorkspaceAccessRequest$Outbound; } + +export function getWorkspaceAccessRequestToJSON( + getWorkspaceAccessRequest: GetWorkspaceAccessRequest, +): string { + return JSON.stringify( + GetWorkspaceAccessRequest$outboundSchema.parse(getWorkspaceAccessRequest), + ); +} + +export function getWorkspaceAccessRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceAccessRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceAccessRequest' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getworkspacebycontext.ts b/src/sdk/models/operations/getworkspacebycontext.ts index 377c680b..2b7eaf76 100644 --- a/src/sdk/models/operations/getworkspacebycontext.ts +++ b/src/sdk/models/operations/getworkspacebycontext.ts @@ -3,6 +3,9 @@ */ 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 * as shared from "../shared/index.js"; export type GetWorkspaceByContextResponse = @@ -46,3 +49,23 @@ export namespace GetWorkspaceByContextResponse$ { /** @deprecated use `GetWorkspaceByContextResponse$Outbound` instead. */ export type Outbound = GetWorkspaceByContextResponse$Outbound; } + +export function getWorkspaceByContextResponseToJSON( + getWorkspaceByContextResponse: GetWorkspaceByContextResponse, +): string { + return JSON.stringify( + GetWorkspaceByContextResponse$outboundSchema.parse( + getWorkspaceByContextResponse, + ), + ); +} + +export function getWorkspaceByContextResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceByContextResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceByContextResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getworkspaceeventsbytarget.ts b/src/sdk/models/operations/getworkspaceeventsbytarget.ts index 1ef2207d..5a1d2d54 100644 --- a/src/sdk/models/operations/getworkspaceeventsbytarget.ts +++ b/src/sdk/models/operations/getworkspaceeventsbytarget.ts @@ -4,13 +4,20 @@ 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"; import * as shared from "../shared/index.js"; +export type GetWorkspaceEventsByTargetGlobals = { + workspaceId?: string | undefined; +}; + export type GetWorkspaceEventsByTargetRequest = { /** * Unique identifier of the workspace. */ - workspaceId: string; + workspaceId?: string | undefined; /** * Filter to only return events corresponding to a particular gen_lock_id (gen_lock_id uniquely identifies a target) */ @@ -25,13 +32,78 @@ export type GetWorkspaceEventsByTargetResponse = | shared.ErrorT | Array; +/** @internal */ +export const GetWorkspaceEventsByTargetGlobals$inboundSchema: z.ZodType< + GetWorkspaceEventsByTargetGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + workspace_id: z.string().optional(), +}).transform((v) => { + return remap$(v, { + "workspace_id": "workspaceId", + }); +}); + +/** @internal */ +export type GetWorkspaceEventsByTargetGlobals$Outbound = { + workspace_id?: string | undefined; +}; + +/** @internal */ +export const GetWorkspaceEventsByTargetGlobals$outboundSchema: z.ZodType< + GetWorkspaceEventsByTargetGlobals$Outbound, + z.ZodTypeDef, + GetWorkspaceEventsByTargetGlobals +> = z.object({ + workspaceId: z.string().optional(), +}).transform((v) => { + return remap$(v, { + workspaceId: "workspace_id", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetWorkspaceEventsByTargetGlobals$ { + /** @deprecated use `GetWorkspaceEventsByTargetGlobals$inboundSchema` instead. */ + export const inboundSchema = GetWorkspaceEventsByTargetGlobals$inboundSchema; + /** @deprecated use `GetWorkspaceEventsByTargetGlobals$outboundSchema` instead. */ + export const outboundSchema = + GetWorkspaceEventsByTargetGlobals$outboundSchema; + /** @deprecated use `GetWorkspaceEventsByTargetGlobals$Outbound` instead. */ + export type Outbound = GetWorkspaceEventsByTargetGlobals$Outbound; +} + +export function getWorkspaceEventsByTargetGlobalsToJSON( + getWorkspaceEventsByTargetGlobals: GetWorkspaceEventsByTargetGlobals, +): string { + return JSON.stringify( + GetWorkspaceEventsByTargetGlobals$outboundSchema.parse( + getWorkspaceEventsByTargetGlobals, + ), + ); +} + +export function getWorkspaceEventsByTargetGlobalsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceEventsByTargetGlobals$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceEventsByTargetGlobals' from JSON`, + ); +} + /** @internal */ export const GetWorkspaceEventsByTargetRequest$inboundSchema: z.ZodType< GetWorkspaceEventsByTargetRequest, z.ZodTypeDef, unknown > = z.object({ - workspace_id: z.string(), + workspace_id: z.string().optional(), target_id: z.string(), after_created_at: z.string().datetime({ offset: true }).transform(v => new Date(v) @@ -46,7 +118,7 @@ export const GetWorkspaceEventsByTargetRequest$inboundSchema: z.ZodType< /** @internal */ export type GetWorkspaceEventsByTargetRequest$Outbound = { - workspace_id: string; + workspace_id?: string | undefined; target_id: string; after_created_at?: string | undefined; }; @@ -57,7 +129,7 @@ export const GetWorkspaceEventsByTargetRequest$outboundSchema: z.ZodType< z.ZodTypeDef, GetWorkspaceEventsByTargetRequest > = z.object({ - workspaceId: z.string(), + workspaceId: z.string().optional(), targetId: z.string(), afterCreatedAt: z.date().transform(v => v.toISOString()).optional(), }).transform((v) => { @@ -82,6 +154,26 @@ export namespace GetWorkspaceEventsByTargetRequest$ { export type Outbound = GetWorkspaceEventsByTargetRequest$Outbound; } +export function getWorkspaceEventsByTargetRequestToJSON( + getWorkspaceEventsByTargetRequest: GetWorkspaceEventsByTargetRequest, +): string { + return JSON.stringify( + GetWorkspaceEventsByTargetRequest$outboundSchema.parse( + getWorkspaceEventsByTargetRequest, + ), + ); +} + +export function getWorkspaceEventsByTargetRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceEventsByTargetRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceEventsByTargetRequest' from JSON`, + ); +} + /** @internal */ export const GetWorkspaceEventsByTargetResponse$inboundSchema: z.ZodType< GetWorkspaceEventsByTargetResponse, @@ -120,3 +212,24 @@ export namespace GetWorkspaceEventsByTargetResponse$ { /** @deprecated use `GetWorkspaceEventsByTargetResponse$Outbound` instead. */ export type Outbound = GetWorkspaceEventsByTargetResponse$Outbound; } + +export function getWorkspaceEventsByTargetResponseToJSON( + getWorkspaceEventsByTargetResponse: GetWorkspaceEventsByTargetResponse, +): string { + return JSON.stringify( + GetWorkspaceEventsByTargetResponse$outboundSchema.parse( + getWorkspaceEventsByTargetResponse, + ), + ); +} + +export function getWorkspaceEventsByTargetResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetWorkspaceEventsByTargetResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceEventsByTargetResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getworkspacefeatureflags.ts b/src/sdk/models/operations/getworkspacefeatureflags.ts index cee30e64..11e17dc9 100644 --- a/src/sdk/models/operations/getworkspacefeatureflags.ts +++ b/src/sdk/models/operations/getworkspacefeatureflags.ts @@ -4,26 +4,97 @@ 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"; import * as shared from "../shared/index.js"; +export type GetWorkspaceFeatureFlagsGlobals = { + workspaceId?: string | undefined; +}; + export type GetWorkspaceFeatureFlagsRequest = { /** * Unique identifier of the workspace. */ - workspaceId: string; + workspaceId?: string | undefined; }; export type GetWorkspaceFeatureFlagsResponse = | shared.WorkspaceFeatureFlagResponse | shared.ErrorT; +/** @internal */ +export const GetWorkspaceFeatureFlagsGlobals$inboundSchema: z.ZodType< + GetWorkspaceFeatureFlagsGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + workspace_id: z.string().optional(), +}).transform((v) => { + return remap$(v, { + "workspace_id": "workspaceId", + }); +}); + +/** @internal */ +export type GetWorkspaceFeatureFlagsGlobals$Outbound = { + workspace_id?: string | undefined; +}; + +/** @internal */ +export const GetWorkspaceFeatureFlagsGlobals$outboundSchema: z.ZodType< + GetWorkspaceFeatureFlagsGlobals$Outbound, + z.ZodTypeDef, + GetWorkspaceFeatureFlagsGlobals +> = z.object({ + workspaceId: z.string().optional(), +}).transform((v) => { + return remap$(v, { + workspaceId: "workspace_id", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetWorkspaceFeatureFlagsGlobals$ { + /** @deprecated use `GetWorkspaceFeatureFlagsGlobals$inboundSchema` instead. */ + export const inboundSchema = GetWorkspaceFeatureFlagsGlobals$inboundSchema; + /** @deprecated use `GetWorkspaceFeatureFlagsGlobals$outboundSchema` instead. */ + export const outboundSchema = GetWorkspaceFeatureFlagsGlobals$outboundSchema; + /** @deprecated use `GetWorkspaceFeatureFlagsGlobals$Outbound` instead. */ + export type Outbound = GetWorkspaceFeatureFlagsGlobals$Outbound; +} + +export function getWorkspaceFeatureFlagsGlobalsToJSON( + getWorkspaceFeatureFlagsGlobals: GetWorkspaceFeatureFlagsGlobals, +): string { + return JSON.stringify( + GetWorkspaceFeatureFlagsGlobals$outboundSchema.parse( + getWorkspaceFeatureFlagsGlobals, + ), + ); +} + +export function getWorkspaceFeatureFlagsGlobalsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceFeatureFlagsGlobals$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceFeatureFlagsGlobals' from JSON`, + ); +} + /** @internal */ export const GetWorkspaceFeatureFlagsRequest$inboundSchema: z.ZodType< GetWorkspaceFeatureFlagsRequest, z.ZodTypeDef, unknown > = z.object({ - workspace_id: z.string(), + workspace_id: z.string().optional(), }).transform((v) => { return remap$(v, { "workspace_id": "workspaceId", @@ -32,7 +103,7 @@ export const GetWorkspaceFeatureFlagsRequest$inboundSchema: z.ZodType< /** @internal */ export type GetWorkspaceFeatureFlagsRequest$Outbound = { - workspace_id: string; + workspace_id?: string | undefined; }; /** @internal */ @@ -41,7 +112,7 @@ export const GetWorkspaceFeatureFlagsRequest$outboundSchema: z.ZodType< z.ZodTypeDef, GetWorkspaceFeatureFlagsRequest > = z.object({ - workspaceId: z.string(), + workspaceId: z.string().optional(), }).transform((v) => { return remap$(v, { workspaceId: "workspace_id", @@ -61,6 +132,26 @@ export namespace GetWorkspaceFeatureFlagsRequest$ { export type Outbound = GetWorkspaceFeatureFlagsRequest$Outbound; } +export function getWorkspaceFeatureFlagsRequestToJSON( + getWorkspaceFeatureFlagsRequest: GetWorkspaceFeatureFlagsRequest, +): string { + return JSON.stringify( + GetWorkspaceFeatureFlagsRequest$outboundSchema.parse( + getWorkspaceFeatureFlagsRequest, + ), + ); +} + +export function getWorkspaceFeatureFlagsRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceFeatureFlagsRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceFeatureFlagsRequest' from JSON`, + ); +} + /** @internal */ export const GetWorkspaceFeatureFlagsResponse$inboundSchema: z.ZodType< GetWorkspaceFeatureFlagsResponse, @@ -98,3 +189,23 @@ export namespace GetWorkspaceFeatureFlagsResponse$ { /** @deprecated use `GetWorkspaceFeatureFlagsResponse$Outbound` instead. */ export type Outbound = GetWorkspaceFeatureFlagsResponse$Outbound; } + +export function getWorkspaceFeatureFlagsResponseToJSON( + getWorkspaceFeatureFlagsResponse: GetWorkspaceFeatureFlagsResponse, +): string { + return JSON.stringify( + GetWorkspaceFeatureFlagsResponse$outboundSchema.parse( + getWorkspaceFeatureFlagsResponse, + ), + ); +} + +export function getWorkspaceFeatureFlagsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceFeatureFlagsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceFeatureFlagsResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getworkspaces.ts b/src/sdk/models/operations/getworkspaces.ts index cdee21b3..8171ff26 100644 --- a/src/sdk/models/operations/getworkspaces.ts +++ b/src/sdk/models/operations/getworkspaces.ts @@ -3,6 +3,9 @@ */ 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 * as shared from "../shared/index.js"; export type GetWorkspacesResponse = shared.ErrorT | Array; @@ -44,3 +47,21 @@ export namespace GetWorkspacesResponse$ { /** @deprecated use `GetWorkspacesResponse$Outbound` instead. */ export type Outbound = GetWorkspacesResponse$Outbound; } + +export function getWorkspacesResponseToJSON( + getWorkspacesResponse: GetWorkspacesResponse, +): string { + return JSON.stringify( + GetWorkspacesResponse$outboundSchema.parse(getWorkspacesResponse), + ); +} + +export function getWorkspacesResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspacesResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspacesResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getworkspacesettings.ts b/src/sdk/models/operations/getworkspacesettings.ts index 8182d426..51fc6518 100644 --- a/src/sdk/models/operations/getworkspacesettings.ts +++ b/src/sdk/models/operations/getworkspacesettings.ts @@ -4,26 +4,97 @@ 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"; import * as shared from "../shared/index.js"; +export type GetWorkspaceSettingsGlobals = { + workspaceId?: string | undefined; +}; + export type GetWorkspaceSettingsRequest = { /** * Unique identifier of the workspace. */ - workspaceId: string; + workspaceId?: string | undefined; }; export type GetWorkspaceSettingsResponse = | shared.ErrorT | shared.WorkspaceSettings; +/** @internal */ +export const GetWorkspaceSettingsGlobals$inboundSchema: z.ZodType< + GetWorkspaceSettingsGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + workspace_id: z.string().optional(), +}).transform((v) => { + return remap$(v, { + "workspace_id": "workspaceId", + }); +}); + +/** @internal */ +export type GetWorkspaceSettingsGlobals$Outbound = { + workspace_id?: string | undefined; +}; + +/** @internal */ +export const GetWorkspaceSettingsGlobals$outboundSchema: z.ZodType< + GetWorkspaceSettingsGlobals$Outbound, + z.ZodTypeDef, + GetWorkspaceSettingsGlobals +> = z.object({ + workspaceId: z.string().optional(), +}).transform((v) => { + return remap$(v, { + workspaceId: "workspace_id", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetWorkspaceSettingsGlobals$ { + /** @deprecated use `GetWorkspaceSettingsGlobals$inboundSchema` instead. */ + export const inboundSchema = GetWorkspaceSettingsGlobals$inboundSchema; + /** @deprecated use `GetWorkspaceSettingsGlobals$outboundSchema` instead. */ + export const outboundSchema = GetWorkspaceSettingsGlobals$outboundSchema; + /** @deprecated use `GetWorkspaceSettingsGlobals$Outbound` instead. */ + export type Outbound = GetWorkspaceSettingsGlobals$Outbound; +} + +export function getWorkspaceSettingsGlobalsToJSON( + getWorkspaceSettingsGlobals: GetWorkspaceSettingsGlobals, +): string { + return JSON.stringify( + GetWorkspaceSettingsGlobals$outboundSchema.parse( + getWorkspaceSettingsGlobals, + ), + ); +} + +export function getWorkspaceSettingsGlobalsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceSettingsGlobals$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceSettingsGlobals' from JSON`, + ); +} + /** @internal */ export const GetWorkspaceSettingsRequest$inboundSchema: z.ZodType< GetWorkspaceSettingsRequest, z.ZodTypeDef, unknown > = z.object({ - workspace_id: z.string(), + workspace_id: z.string().optional(), }).transform((v) => { return remap$(v, { "workspace_id": "workspaceId", @@ -32,7 +103,7 @@ export const GetWorkspaceSettingsRequest$inboundSchema: z.ZodType< /** @internal */ export type GetWorkspaceSettingsRequest$Outbound = { - workspace_id: string; + workspace_id?: string | undefined; }; /** @internal */ @@ -41,7 +112,7 @@ export const GetWorkspaceSettingsRequest$outboundSchema: z.ZodType< z.ZodTypeDef, GetWorkspaceSettingsRequest > = z.object({ - workspaceId: z.string(), + workspaceId: z.string().optional(), }).transform((v) => { return remap$(v, { workspaceId: "workspace_id", @@ -61,6 +132,26 @@ export namespace GetWorkspaceSettingsRequest$ { export type Outbound = GetWorkspaceSettingsRequest$Outbound; } +export function getWorkspaceSettingsRequestToJSON( + getWorkspaceSettingsRequest: GetWorkspaceSettingsRequest, +): string { + return JSON.stringify( + GetWorkspaceSettingsRequest$outboundSchema.parse( + getWorkspaceSettingsRequest, + ), + ); +} + +export function getWorkspaceSettingsRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceSettingsRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceSettingsRequest' from JSON`, + ); +} + /** @internal */ export const GetWorkspaceSettingsResponse$inboundSchema: z.ZodType< GetWorkspaceSettingsResponse, @@ -98,3 +189,23 @@ export namespace GetWorkspaceSettingsResponse$ { /** @deprecated use `GetWorkspaceSettingsResponse$Outbound` instead. */ export type Outbound = GetWorkspaceSettingsResponse$Outbound; } + +export function getWorkspaceSettingsResponseToJSON( + getWorkspaceSettingsResponse: GetWorkspaceSettingsResponse, +): string { + return JSON.stringify( + GetWorkspaceSettingsResponse$outboundSchema.parse( + getWorkspaceSettingsResponse, + ), + ); +} + +export function getWorkspaceSettingsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceSettingsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceSettingsResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getworkspacetargets.ts b/src/sdk/models/operations/getworkspacetargets.ts index 76b55b40..fe71c436 100644 --- a/src/sdk/models/operations/getworkspacetargets.ts +++ b/src/sdk/models/operations/getworkspacetargets.ts @@ -4,6 +4,9 @@ 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"; import * as shared from "../shared/index.js"; export type GetWorkspaceTargetsRequest = { @@ -63,6 +66,24 @@ export namespace GetWorkspaceTargetsRequest$ { export type Outbound = GetWorkspaceTargetsRequest$Outbound; } +export function getWorkspaceTargetsRequestToJSON( + getWorkspaceTargetsRequest: GetWorkspaceTargetsRequest, +): string { + return JSON.stringify( + GetWorkspaceTargetsRequest$outboundSchema.parse(getWorkspaceTargetsRequest), + ); +} + +export function getWorkspaceTargetsRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceTargetsRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceTargetsRequest' from JSON`, + ); +} + /** @internal */ export const GetWorkspaceTargetsResponse$inboundSchema: z.ZodType< GetWorkspaceTargetsResponse, @@ -100,3 +121,23 @@ export namespace GetWorkspaceTargetsResponse$ { /** @deprecated use `GetWorkspaceTargetsResponse$Outbound` instead. */ export type Outbound = GetWorkspaceTargetsResponse$Outbound; } + +export function getWorkspaceTargetsResponseToJSON( + getWorkspaceTargetsResponse: GetWorkspaceTargetsResponse, +): string { + return JSON.stringify( + GetWorkspaceTargetsResponse$outboundSchema.parse( + getWorkspaceTargetsResponse, + ), + ); +} + +export function getWorkspaceTargetsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceTargetsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceTargetsResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getworkspacetargetsdeprecated.ts b/src/sdk/models/operations/getworkspacetargetsdeprecated.ts index 18d524af..c8c8c7f4 100644 --- a/src/sdk/models/operations/getworkspacetargetsdeprecated.ts +++ b/src/sdk/models/operations/getworkspacetargetsdeprecated.ts @@ -4,13 +4,20 @@ 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"; import * as shared from "../shared/index.js"; +export type GetWorkspaceTargetsDeprecatedGlobals = { + workspaceId?: string | undefined; +}; + export type GetWorkspaceTargetsDeprecatedRequest = { /** * Unique identifier of the workspace. */ - workspaceId: string; + workspaceId?: string | undefined; /** * Filter to only return targets with events created after this timestamp */ @@ -21,13 +28,80 @@ export type GetWorkspaceTargetsDeprecatedResponse = | shared.ErrorT | Array; +/** @internal */ +export const GetWorkspaceTargetsDeprecatedGlobals$inboundSchema: z.ZodType< + GetWorkspaceTargetsDeprecatedGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + workspace_id: z.string().optional(), +}).transform((v) => { + return remap$(v, { + "workspace_id": "workspaceId", + }); +}); + +/** @internal */ +export type GetWorkspaceTargetsDeprecatedGlobals$Outbound = { + workspace_id?: string | undefined; +}; + +/** @internal */ +export const GetWorkspaceTargetsDeprecatedGlobals$outboundSchema: z.ZodType< + GetWorkspaceTargetsDeprecatedGlobals$Outbound, + z.ZodTypeDef, + GetWorkspaceTargetsDeprecatedGlobals +> = z.object({ + workspaceId: z.string().optional(), +}).transform((v) => { + return remap$(v, { + workspaceId: "workspace_id", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetWorkspaceTargetsDeprecatedGlobals$ { + /** @deprecated use `GetWorkspaceTargetsDeprecatedGlobals$inboundSchema` instead. */ + export const inboundSchema = + GetWorkspaceTargetsDeprecatedGlobals$inboundSchema; + /** @deprecated use `GetWorkspaceTargetsDeprecatedGlobals$outboundSchema` instead. */ + export const outboundSchema = + GetWorkspaceTargetsDeprecatedGlobals$outboundSchema; + /** @deprecated use `GetWorkspaceTargetsDeprecatedGlobals$Outbound` instead. */ + export type Outbound = GetWorkspaceTargetsDeprecatedGlobals$Outbound; +} + +export function getWorkspaceTargetsDeprecatedGlobalsToJSON( + getWorkspaceTargetsDeprecatedGlobals: GetWorkspaceTargetsDeprecatedGlobals, +): string { + return JSON.stringify( + GetWorkspaceTargetsDeprecatedGlobals$outboundSchema.parse( + getWorkspaceTargetsDeprecatedGlobals, + ), + ); +} + +export function getWorkspaceTargetsDeprecatedGlobalsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetWorkspaceTargetsDeprecatedGlobals$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceTargetsDeprecatedGlobals' from JSON`, + ); +} + /** @internal */ export const GetWorkspaceTargetsDeprecatedRequest$inboundSchema: z.ZodType< GetWorkspaceTargetsDeprecatedRequest, z.ZodTypeDef, unknown > = z.object({ - workspace_id: z.string(), + workspace_id: z.string().optional(), after_last_event_created_at: z.string().datetime({ offset: true }).transform( v => new Date(v) ).optional(), @@ -40,7 +114,7 @@ export const GetWorkspaceTargetsDeprecatedRequest$inboundSchema: z.ZodType< /** @internal */ export type GetWorkspaceTargetsDeprecatedRequest$Outbound = { - workspace_id: string; + workspace_id?: string | undefined; after_last_event_created_at?: string | undefined; }; @@ -50,7 +124,7 @@ export const GetWorkspaceTargetsDeprecatedRequest$outboundSchema: z.ZodType< z.ZodTypeDef, GetWorkspaceTargetsDeprecatedRequest > = z.object({ - workspaceId: z.string(), + workspaceId: z.string().optional(), afterLastEventCreatedAt: z.date().transform(v => v.toISOString()).optional(), }).transform((v) => { return remap$(v, { @@ -74,6 +148,27 @@ export namespace GetWorkspaceTargetsDeprecatedRequest$ { export type Outbound = GetWorkspaceTargetsDeprecatedRequest$Outbound; } +export function getWorkspaceTargetsDeprecatedRequestToJSON( + getWorkspaceTargetsDeprecatedRequest: GetWorkspaceTargetsDeprecatedRequest, +): string { + return JSON.stringify( + GetWorkspaceTargetsDeprecatedRequest$outboundSchema.parse( + getWorkspaceTargetsDeprecatedRequest, + ), + ); +} + +export function getWorkspaceTargetsDeprecatedRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetWorkspaceTargetsDeprecatedRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceTargetsDeprecatedRequest' from JSON`, + ); +} + /** @internal */ export const GetWorkspaceTargetsDeprecatedResponse$inboundSchema: z.ZodType< GetWorkspaceTargetsDeprecatedResponse, @@ -113,3 +208,24 @@ export namespace GetWorkspaceTargetsDeprecatedResponse$ { /** @deprecated use `GetWorkspaceTargetsDeprecatedResponse$Outbound` instead. */ export type Outbound = GetWorkspaceTargetsDeprecatedResponse$Outbound; } + +export function getWorkspaceTargetsDeprecatedResponseToJSON( + getWorkspaceTargetsDeprecatedResponse: GetWorkspaceTargetsDeprecatedResponse, +): string { + return JSON.stringify( + GetWorkspaceTargetsDeprecatedResponse$outboundSchema.parse( + getWorkspaceTargetsDeprecatedResponse, + ), + ); +} + +export function getWorkspaceTargetsDeprecatedResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetWorkspaceTargetsDeprecatedResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceTargetsDeprecatedResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getworkspaceteam.ts b/src/sdk/models/operations/getworkspaceteam.ts index b2780937..d75f6995 100644 --- a/src/sdk/models/operations/getworkspaceteam.ts +++ b/src/sdk/models/operations/getworkspaceteam.ts @@ -4,26 +4,95 @@ 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"; import * as shared from "../shared/index.js"; +export type GetWorkspaceTeamGlobals = { + workspaceId?: string | undefined; +}; + export type GetWorkspaceTeamRequest = { /** * Unique identifier of the workspace. */ - workspaceId: string; + workspaceId?: string | undefined; }; export type GetWorkspaceTeamResponse = | shared.ErrorT | shared.WorkspaceTeamResponse; +/** @internal */ +export const GetWorkspaceTeamGlobals$inboundSchema: z.ZodType< + GetWorkspaceTeamGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + workspace_id: z.string().optional(), +}).transform((v) => { + return remap$(v, { + "workspace_id": "workspaceId", + }); +}); + +/** @internal */ +export type GetWorkspaceTeamGlobals$Outbound = { + workspace_id?: string | undefined; +}; + +/** @internal */ +export const GetWorkspaceTeamGlobals$outboundSchema: z.ZodType< + GetWorkspaceTeamGlobals$Outbound, + z.ZodTypeDef, + GetWorkspaceTeamGlobals +> = z.object({ + workspaceId: z.string().optional(), +}).transform((v) => { + return remap$(v, { + workspaceId: "workspace_id", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetWorkspaceTeamGlobals$ { + /** @deprecated use `GetWorkspaceTeamGlobals$inboundSchema` instead. */ + export const inboundSchema = GetWorkspaceTeamGlobals$inboundSchema; + /** @deprecated use `GetWorkspaceTeamGlobals$outboundSchema` instead. */ + export const outboundSchema = GetWorkspaceTeamGlobals$outboundSchema; + /** @deprecated use `GetWorkspaceTeamGlobals$Outbound` instead. */ + export type Outbound = GetWorkspaceTeamGlobals$Outbound; +} + +export function getWorkspaceTeamGlobalsToJSON( + getWorkspaceTeamGlobals: GetWorkspaceTeamGlobals, +): string { + return JSON.stringify( + GetWorkspaceTeamGlobals$outboundSchema.parse(getWorkspaceTeamGlobals), + ); +} + +export function getWorkspaceTeamGlobalsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceTeamGlobals$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceTeamGlobals' from JSON`, + ); +} + /** @internal */ export const GetWorkspaceTeamRequest$inboundSchema: z.ZodType< GetWorkspaceTeamRequest, z.ZodTypeDef, unknown > = z.object({ - workspace_id: z.string(), + workspace_id: z.string().optional(), }).transform((v) => { return remap$(v, { "workspace_id": "workspaceId", @@ -32,7 +101,7 @@ export const GetWorkspaceTeamRequest$inboundSchema: z.ZodType< /** @internal */ export type GetWorkspaceTeamRequest$Outbound = { - workspace_id: string; + workspace_id?: string | undefined; }; /** @internal */ @@ -41,7 +110,7 @@ export const GetWorkspaceTeamRequest$outboundSchema: z.ZodType< z.ZodTypeDef, GetWorkspaceTeamRequest > = z.object({ - workspaceId: z.string(), + workspaceId: z.string().optional(), }).transform((v) => { return remap$(v, { workspaceId: "workspace_id", @@ -61,6 +130,24 @@ export namespace GetWorkspaceTeamRequest$ { export type Outbound = GetWorkspaceTeamRequest$Outbound; } +export function getWorkspaceTeamRequestToJSON( + getWorkspaceTeamRequest: GetWorkspaceTeamRequest, +): string { + return JSON.stringify( + GetWorkspaceTeamRequest$outboundSchema.parse(getWorkspaceTeamRequest), + ); +} + +export function getWorkspaceTeamRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceTeamRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceTeamRequest' from JSON`, + ); +} + /** @internal */ export const GetWorkspaceTeamResponse$inboundSchema: z.ZodType< GetWorkspaceTeamResponse, @@ -98,3 +185,21 @@ export namespace GetWorkspaceTeamResponse$ { /** @deprecated use `GetWorkspaceTeamResponse$Outbound` instead. */ export type Outbound = GetWorkspaceTeamResponse$Outbound; } + +export function getWorkspaceTeamResponseToJSON( + getWorkspaceTeamResponse: GetWorkspaceTeamResponse, +): string { + return JSON.stringify( + GetWorkspaceTeamResponse$outboundSchema.parse(getWorkspaceTeamResponse), + ); +} + +export function getWorkspaceTeamResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceTeamResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceTeamResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getworkspacetokens.ts b/src/sdk/models/operations/getworkspacetokens.ts index 9aea8991..b102d472 100644 --- a/src/sdk/models/operations/getworkspacetokens.ts +++ b/src/sdk/models/operations/getworkspacetokens.ts @@ -4,26 +4,95 @@ 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"; import * as shared from "../shared/index.js"; +export type GetWorkspaceTokensGlobals = { + workspaceId?: string | undefined; +}; + export type GetWorkspaceTokensRequest = { /** * Unique identifier of the workspace. */ - workspaceId: string; + workspaceId?: string | undefined; }; export type GetWorkspaceTokensResponse = | shared.ErrorT | Array; +/** @internal */ +export const GetWorkspaceTokensGlobals$inboundSchema: z.ZodType< + GetWorkspaceTokensGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + workspace_id: z.string().optional(), +}).transform((v) => { + return remap$(v, { + "workspace_id": "workspaceId", + }); +}); + +/** @internal */ +export type GetWorkspaceTokensGlobals$Outbound = { + workspace_id?: string | undefined; +}; + +/** @internal */ +export const GetWorkspaceTokensGlobals$outboundSchema: z.ZodType< + GetWorkspaceTokensGlobals$Outbound, + z.ZodTypeDef, + GetWorkspaceTokensGlobals +> = z.object({ + workspaceId: z.string().optional(), +}).transform((v) => { + return remap$(v, { + workspaceId: "workspace_id", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetWorkspaceTokensGlobals$ { + /** @deprecated use `GetWorkspaceTokensGlobals$inboundSchema` instead. */ + export const inboundSchema = GetWorkspaceTokensGlobals$inboundSchema; + /** @deprecated use `GetWorkspaceTokensGlobals$outboundSchema` instead. */ + export const outboundSchema = GetWorkspaceTokensGlobals$outboundSchema; + /** @deprecated use `GetWorkspaceTokensGlobals$Outbound` instead. */ + export type Outbound = GetWorkspaceTokensGlobals$Outbound; +} + +export function getWorkspaceTokensGlobalsToJSON( + getWorkspaceTokensGlobals: GetWorkspaceTokensGlobals, +): string { + return JSON.stringify( + GetWorkspaceTokensGlobals$outboundSchema.parse(getWorkspaceTokensGlobals), + ); +} + +export function getWorkspaceTokensGlobalsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceTokensGlobals$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceTokensGlobals' from JSON`, + ); +} + /** @internal */ export const GetWorkspaceTokensRequest$inboundSchema: z.ZodType< GetWorkspaceTokensRequest, z.ZodTypeDef, unknown > = z.object({ - workspace_id: z.string(), + workspace_id: z.string().optional(), }).transform((v) => { return remap$(v, { "workspace_id": "workspaceId", @@ -32,7 +101,7 @@ export const GetWorkspaceTokensRequest$inboundSchema: z.ZodType< /** @internal */ export type GetWorkspaceTokensRequest$Outbound = { - workspace_id: string; + workspace_id?: string | undefined; }; /** @internal */ @@ -41,7 +110,7 @@ export const GetWorkspaceTokensRequest$outboundSchema: z.ZodType< z.ZodTypeDef, GetWorkspaceTokensRequest > = z.object({ - workspaceId: z.string(), + workspaceId: z.string().optional(), }).transform((v) => { return remap$(v, { workspaceId: "workspace_id", @@ -61,6 +130,24 @@ export namespace GetWorkspaceTokensRequest$ { export type Outbound = GetWorkspaceTokensRequest$Outbound; } +export function getWorkspaceTokensRequestToJSON( + getWorkspaceTokensRequest: GetWorkspaceTokensRequest, +): string { + return JSON.stringify( + GetWorkspaceTokensRequest$outboundSchema.parse(getWorkspaceTokensRequest), + ); +} + +export function getWorkspaceTokensRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceTokensRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceTokensRequest' from JSON`, + ); +} + /** @internal */ export const GetWorkspaceTokensResponse$inboundSchema: z.ZodType< GetWorkspaceTokensResponse, @@ -98,3 +185,21 @@ export namespace GetWorkspaceTokensResponse$ { /** @deprecated use `GetWorkspaceTokensResponse$Outbound` instead. */ export type Outbound = GetWorkspaceTokensResponse$Outbound; } + +export function getWorkspaceTokensResponseToJSON( + getWorkspaceTokensResponse: GetWorkspaceTokensResponse, +): string { + return JSON.stringify( + GetWorkspaceTokensResponse$outboundSchema.parse(getWorkspaceTokensResponse), + ); +} + +export function getWorkspaceTokensResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWorkspaceTokensResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWorkspaceTokensResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/githubcheckpublishingprs.ts b/src/sdk/models/operations/githubcheckpublishingprs.ts index e58c457c..43f249a5 100644 --- a/src/sdk/models/operations/githubcheckpublishingprs.ts +++ b/src/sdk/models/operations/githubcheckpublishingprs.ts @@ -4,6 +4,9 @@ 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"; import * as shared from "../shared/index.js"; export type GithubCheckPublishingPRsRequest = { @@ -66,6 +69,26 @@ export namespace GithubCheckPublishingPRsRequest$ { export type Outbound = GithubCheckPublishingPRsRequest$Outbound; } +export function githubCheckPublishingPRsRequestToJSON( + githubCheckPublishingPRsRequest: GithubCheckPublishingPRsRequest, +): string { + return JSON.stringify( + GithubCheckPublishingPRsRequest$outboundSchema.parse( + githubCheckPublishingPRsRequest, + ), + ); +} + +export function githubCheckPublishingPRsRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GithubCheckPublishingPRsRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GithubCheckPublishingPRsRequest' from JSON`, + ); +} + /** @internal */ export const GithubCheckPublishingPRsResponse$inboundSchema: z.ZodType< GithubCheckPublishingPRsResponse, @@ -103,3 +126,23 @@ export namespace GithubCheckPublishingPRsResponse$ { /** @deprecated use `GithubCheckPublishingPRsResponse$Outbound` instead. */ export type Outbound = GithubCheckPublishingPRsResponse$Outbound; } + +export function githubCheckPublishingPRsResponseToJSON( + githubCheckPublishingPRsResponse: GithubCheckPublishingPRsResponse, +): string { + return JSON.stringify( + GithubCheckPublishingPRsResponse$outboundSchema.parse( + githubCheckPublishingPRsResponse, + ), + ); +} + +export function githubCheckPublishingPRsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GithubCheckPublishingPRsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GithubCheckPublishingPRsResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/githubcheckpublishingsecrets.ts b/src/sdk/models/operations/githubcheckpublishingsecrets.ts index f7df4de3..72dd8f00 100644 --- a/src/sdk/models/operations/githubcheckpublishingsecrets.ts +++ b/src/sdk/models/operations/githubcheckpublishingsecrets.ts @@ -4,6 +4,9 @@ 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"; import * as shared from "../shared/index.js"; export type GithubCheckPublishingSecretsRequest = { @@ -60,6 +63,27 @@ export namespace GithubCheckPublishingSecretsRequest$ { export type Outbound = GithubCheckPublishingSecretsRequest$Outbound; } +export function githubCheckPublishingSecretsRequestToJSON( + githubCheckPublishingSecretsRequest: GithubCheckPublishingSecretsRequest, +): string { + return JSON.stringify( + GithubCheckPublishingSecretsRequest$outboundSchema.parse( + githubCheckPublishingSecretsRequest, + ), + ); +} + +export function githubCheckPublishingSecretsRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GithubCheckPublishingSecretsRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GithubCheckPublishingSecretsRequest' from JSON`, + ); +} + /** @internal */ export const GithubCheckPublishingSecretsResponse$inboundSchema: z.ZodType< GithubCheckPublishingSecretsResponse, @@ -99,3 +123,24 @@ export namespace GithubCheckPublishingSecretsResponse$ { /** @deprecated use `GithubCheckPublishingSecretsResponse$Outbound` instead. */ export type Outbound = GithubCheckPublishingSecretsResponse$Outbound; } + +export function githubCheckPublishingSecretsResponseToJSON( + githubCheckPublishingSecretsResponse: GithubCheckPublishingSecretsResponse, +): string { + return JSON.stringify( + GithubCheckPublishingSecretsResponse$outboundSchema.parse( + githubCheckPublishingSecretsResponse, + ), + ); +} + +export function githubCheckPublishingSecretsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GithubCheckPublishingSecretsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GithubCheckPublishingSecretsResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/githubconfigurecodesamples.ts b/src/sdk/models/operations/githubconfigurecodesamples.ts index 10d17431..7a4a3cac 100644 --- a/src/sdk/models/operations/githubconfigurecodesamples.ts +++ b/src/sdk/models/operations/githubconfigurecodesamples.ts @@ -3,6 +3,9 @@ */ 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 * as shared from "../shared/index.js"; export type GithubConfigureCodeSamplesResponse = @@ -47,3 +50,24 @@ export namespace GithubConfigureCodeSamplesResponse$ { /** @deprecated use `GithubConfigureCodeSamplesResponse$Outbound` instead. */ export type Outbound = GithubConfigureCodeSamplesResponse$Outbound; } + +export function githubConfigureCodeSamplesResponseToJSON( + githubConfigureCodeSamplesResponse: GithubConfigureCodeSamplesResponse, +): string { + return JSON.stringify( + GithubConfigureCodeSamplesResponse$outboundSchema.parse( + githubConfigureCodeSamplesResponse, + ), + ); +} + +export function githubConfigureCodeSamplesResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GithubConfigureCodeSamplesResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GithubConfigureCodeSamplesResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/grantuseraccesstoworkspace.ts b/src/sdk/models/operations/grantuseraccesstoworkspace.ts index 5697aadb..398d141d 100644 --- a/src/sdk/models/operations/grantuseraccesstoworkspace.ts +++ b/src/sdk/models/operations/grantuseraccesstoworkspace.ts @@ -4,13 +4,20 @@ 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"; import * as shared from "../shared/index.js"; +export type GrantUserAccessToWorkspaceGlobals = { + workspaceId?: string | undefined; +}; + export type GrantUserAccessToWorkspaceRequest = { /** * Unique identifier of the workspace. */ - workspaceId: string; + workspaceId?: string | undefined; /** * Email of the user to grant access to. */ @@ -21,13 +28,78 @@ export type GrantUserAccessToWorkspaceResponse = | shared.ErrorT | shared.WorkspaceInviteResponse; +/** @internal */ +export const GrantUserAccessToWorkspaceGlobals$inboundSchema: z.ZodType< + GrantUserAccessToWorkspaceGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + workspace_id: z.string().optional(), +}).transform((v) => { + return remap$(v, { + "workspace_id": "workspaceId", + }); +}); + +/** @internal */ +export type GrantUserAccessToWorkspaceGlobals$Outbound = { + workspace_id?: string | undefined; +}; + +/** @internal */ +export const GrantUserAccessToWorkspaceGlobals$outboundSchema: z.ZodType< + GrantUserAccessToWorkspaceGlobals$Outbound, + z.ZodTypeDef, + GrantUserAccessToWorkspaceGlobals +> = z.object({ + workspaceId: z.string().optional(), +}).transform((v) => { + return remap$(v, { + workspaceId: "workspace_id", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GrantUserAccessToWorkspaceGlobals$ { + /** @deprecated use `GrantUserAccessToWorkspaceGlobals$inboundSchema` instead. */ + export const inboundSchema = GrantUserAccessToWorkspaceGlobals$inboundSchema; + /** @deprecated use `GrantUserAccessToWorkspaceGlobals$outboundSchema` instead. */ + export const outboundSchema = + GrantUserAccessToWorkspaceGlobals$outboundSchema; + /** @deprecated use `GrantUserAccessToWorkspaceGlobals$Outbound` instead. */ + export type Outbound = GrantUserAccessToWorkspaceGlobals$Outbound; +} + +export function grantUserAccessToWorkspaceGlobalsToJSON( + grantUserAccessToWorkspaceGlobals: GrantUserAccessToWorkspaceGlobals, +): string { + return JSON.stringify( + GrantUserAccessToWorkspaceGlobals$outboundSchema.parse( + grantUserAccessToWorkspaceGlobals, + ), + ); +} + +export function grantUserAccessToWorkspaceGlobalsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GrantUserAccessToWorkspaceGlobals$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GrantUserAccessToWorkspaceGlobals' from JSON`, + ); +} + /** @internal */ export const GrantUserAccessToWorkspaceRequest$inboundSchema: z.ZodType< GrantUserAccessToWorkspaceRequest, z.ZodTypeDef, unknown > = z.object({ - workspace_id: z.string(), + workspace_id: z.string().optional(), email: z.string(), }).transform((v) => { return remap$(v, { @@ -37,7 +109,7 @@ export const GrantUserAccessToWorkspaceRequest$inboundSchema: z.ZodType< /** @internal */ export type GrantUserAccessToWorkspaceRequest$Outbound = { - workspace_id: string; + workspace_id?: string | undefined; email: string; }; @@ -47,7 +119,7 @@ export const GrantUserAccessToWorkspaceRequest$outboundSchema: z.ZodType< z.ZodTypeDef, GrantUserAccessToWorkspaceRequest > = z.object({ - workspaceId: z.string(), + workspaceId: z.string().optional(), email: z.string(), }).transform((v) => { return remap$(v, { @@ -69,6 +141,26 @@ export namespace GrantUserAccessToWorkspaceRequest$ { export type Outbound = GrantUserAccessToWorkspaceRequest$Outbound; } +export function grantUserAccessToWorkspaceRequestToJSON( + grantUserAccessToWorkspaceRequest: GrantUserAccessToWorkspaceRequest, +): string { + return JSON.stringify( + GrantUserAccessToWorkspaceRequest$outboundSchema.parse( + grantUserAccessToWorkspaceRequest, + ), + ); +} + +export function grantUserAccessToWorkspaceRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GrantUserAccessToWorkspaceRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GrantUserAccessToWorkspaceRequest' from JSON`, + ); +} + /** @internal */ export const GrantUserAccessToWorkspaceResponse$inboundSchema: z.ZodType< GrantUserAccessToWorkspaceResponse, @@ -107,3 +199,24 @@ export namespace GrantUserAccessToWorkspaceResponse$ { /** @deprecated use `GrantUserAccessToWorkspaceResponse$Outbound` instead. */ export type Outbound = GrantUserAccessToWorkspaceResponse$Outbound; } + +export function grantUserAccessToWorkspaceResponseToJSON( + grantUserAccessToWorkspaceResponse: GrantUserAccessToWorkspaceResponse, +): string { + return JSON.stringify( + GrantUserAccessToWorkspaceResponse$outboundSchema.parse( + grantUserAccessToWorkspaceResponse, + ), + ); +} + +export function grantUserAccessToWorkspaceResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GrantUserAccessToWorkspaceResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GrantUserAccessToWorkspaceResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/ignoresubscriptionnamespace.ts b/src/sdk/models/operations/ignoresubscriptionnamespace.ts new file mode 100644 index 00000000..65a9626f --- /dev/null +++ b/src/sdk/models/operations/ignoresubscriptionnamespace.ts @@ -0,0 +1,80 @@ +/* + * 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 IgnoreSubscriptionNamespaceRequest = { + /** + * The existing subscription ID + */ + subscriptionID: string; + /** + * The namespace name + */ + namespaceName: string; +}; + +/** @internal */ +export const IgnoreSubscriptionNamespaceRequest$inboundSchema: z.ZodType< + IgnoreSubscriptionNamespaceRequest, + z.ZodTypeDef, + unknown +> = z.object({ + subscriptionID: z.string(), + namespaceName: z.string(), +}); + +/** @internal */ +export type IgnoreSubscriptionNamespaceRequest$Outbound = { + subscriptionID: string; + namespaceName: string; +}; + +/** @internal */ +export const IgnoreSubscriptionNamespaceRequest$outboundSchema: z.ZodType< + IgnoreSubscriptionNamespaceRequest$Outbound, + z.ZodTypeDef, + IgnoreSubscriptionNamespaceRequest +> = z.object({ + subscriptionID: z.string(), + namespaceName: 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 IgnoreSubscriptionNamespaceRequest$ { + /** @deprecated use `IgnoreSubscriptionNamespaceRequest$inboundSchema` instead. */ + export const inboundSchema = IgnoreSubscriptionNamespaceRequest$inboundSchema; + /** @deprecated use `IgnoreSubscriptionNamespaceRequest$outboundSchema` instead. */ + export const outboundSchema = + IgnoreSubscriptionNamespaceRequest$outboundSchema; + /** @deprecated use `IgnoreSubscriptionNamespaceRequest$Outbound` instead. */ + export type Outbound = IgnoreSubscriptionNamespaceRequest$Outbound; +} + +export function ignoreSubscriptionNamespaceRequestToJSON( + ignoreSubscriptionNamespaceRequest: IgnoreSubscriptionNamespaceRequest, +): string { + return JSON.stringify( + IgnoreSubscriptionNamespaceRequest$outboundSchema.parse( + ignoreSubscriptionNamespaceRequest, + ), + ); +} + +export function ignoreSubscriptionNamespaceRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + IgnoreSubscriptionNamespaceRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'IgnoreSubscriptionNamespaceRequest' from JSON`, + ); +} diff --git a/src/sdk/models/operations/index.ts b/src/sdk/models/operations/index.ts index eb2995e9..6105c158 100644 --- a/src/sdk/models/operations/index.ts +++ b/src/sdk/models/operations/index.ts @@ -2,50 +2,36 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ +export * from "./activatesubscriptionnamespace.js"; +export * from "./archivenamespace.js"; export * from "./checkgithubaccess.js"; export * from "./create.js"; +export * from "./createbillingaddons.js"; export * from "./createorganization.js"; +export * from "./createschemastoreitem.js"; export * from "./createworkspace.js"; export * from "./createworkspacetoken.js"; -export * from "./deleteapi.js"; -export * from "./deleteapiendpoint.js"; -export * from "./deleteschema.js"; -export * from "./deleteversionmetadata.js"; +export * from "./deletebillingaddon.js"; export * from "./deleteworkspacetoken.js"; -export * from "./downloadschema.js"; -export * from "./downloadschemarevision.js"; -export * from "./findapiendpoint.js"; -export * from "./generateopenapispec.js"; -export * from "./generateopenapispecforapiendpoint.js"; -export * from "./generatepostmancollection.js"; -export * from "./generatepostmancollectionforapiendpoint.js"; -export * from "./generaterequestpostmancollection.js"; +export * from "./generatecodesamplepreview.js"; +export * from "./generatecodesamplepreviewasync.js"; export * from "./getaccesstoken.js"; -export * from "./getallapiendpoints.js"; -export * from "./getallapiversions.js"; -export * from "./getallforversionapiendpoints.js"; -export * from "./getapiendpoint.js"; -export * from "./getapis.js"; +export * from "./getbillingaddons.js"; export * from "./getblob.js"; export * from "./getchangesreportsignedurl.js"; -export * from "./getembedaccesstoken.js"; +export * from "./getcodesamplepreviewasync.js"; +export * from "./getcodesamples.js"; export * from "./getgithubaction.js"; +export * from "./getgithubsetupstate.js"; export * from "./getlintingreportsignedurl.js"; export * from "./getmanifest.js"; export * from "./getnamespaces.js"; export * from "./getorganization.js"; export * from "./getorganizations.js"; export * from "./getorganizationusage.js"; -export * from "./getrequestfromeventlog.js"; export * from "./getrevisions.js"; -export * from "./getschema.js"; -export * from "./getschemadiff.js"; -export * from "./getschemarevision.js"; -export * from "./getschemas.js"; export * from "./gettags.js"; export * from "./getuser.js"; -export * from "./getvalidembedaccesstokens.js"; -export * from "./getversionmetadata.js"; export * from "./getworkspace.js"; export * from "./getworkspaceaccess.js"; export * from "./getworkspacebycontext.js"; @@ -61,21 +47,20 @@ export * from "./githubcheckpublishingprs.js"; export * from "./githubcheckpublishingsecrets.js"; export * from "./githubconfigurecodesamples.js"; export * from "./grantuseraccesstoworkspace.js"; -export * from "./insertversionmetadata.js"; +export * from "./ignoresubscriptionnamespace.js"; +export * from "./linkgithubaccess.js"; +export * from "./listremotesources.js"; export * from "./posttags.js"; export * from "./postworkspaceevents.js"; export * from "./preflight.js"; -export * from "./queryeventlog.js"; -export * from "./registerschema.js"; -export * from "./revokeembedaccesstoken.js"; export * from "./revokeuseraccesstoworkspace.js"; export * from "./searchworkspaceevents.js"; +export * from "./setvisibility.js"; +export * from "./setworkspacefeatureflags.js"; export * from "./suggest.js"; export * from "./suggestopenapi.js"; export * from "./suggestopenapiregistry.js"; export * from "./updateworkspacedetails.js"; export * from "./updateworkspacesettings.js"; export * from "./uploadreport.js"; -export * from "./upsertapi.js"; -export * from "./upsertapiendpoint.js"; export * from "./validateapikey.js"; diff --git a/src/sdk/models/operations/insertversionmetadata.ts b/src/sdk/models/operations/insertversionmetadata.ts deleted file mode 100644 index 075c6e37..00000000 --- a/src/sdk/models/operations/insertversionmetadata.ts +++ /dev/null @@ -1,114 +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 * as shared from "../shared/index.js"; - -export type InsertVersionMetadataRequest = { - /** - * The ID of the Api to insert metadata for. - */ - apiID: string; - /** - * The version ID of the Api to insert metadata for. - */ - versionID: string; - /** - * A JSON representation of the metadata to insert. - */ - versionMetadata: shared.VersionMetadataInput; -}; - -export type InsertVersionMetadataResponse = - | shared.ErrorT - | shared.VersionMetadata; - -/** @internal */ -export const InsertVersionMetadataRequest$inboundSchema: z.ZodType< - InsertVersionMetadataRequest, - z.ZodTypeDef, - unknown -> = z.object({ - apiID: z.string(), - versionID: z.string(), - VersionMetadata: shared.VersionMetadataInput$inboundSchema, -}).transform((v) => { - return remap$(v, { - "VersionMetadata": "versionMetadata", - }); -}); - -/** @internal */ -export type InsertVersionMetadataRequest$Outbound = { - apiID: string; - versionID: string; - VersionMetadata: shared.VersionMetadataInput$Outbound; -}; - -/** @internal */ -export const InsertVersionMetadataRequest$outboundSchema: z.ZodType< - InsertVersionMetadataRequest$Outbound, - z.ZodTypeDef, - InsertVersionMetadataRequest -> = z.object({ - apiID: z.string(), - versionID: z.string(), - versionMetadata: shared.VersionMetadataInput$outboundSchema, -}).transform((v) => { - return remap$(v, { - versionMetadata: "VersionMetadata", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace InsertVersionMetadataRequest$ { - /** @deprecated use `InsertVersionMetadataRequest$inboundSchema` instead. */ - export const inboundSchema = InsertVersionMetadataRequest$inboundSchema; - /** @deprecated use `InsertVersionMetadataRequest$outboundSchema` instead. */ - export const outboundSchema = InsertVersionMetadataRequest$outboundSchema; - /** @deprecated use `InsertVersionMetadataRequest$Outbound` instead. */ - export type Outbound = InsertVersionMetadataRequest$Outbound; -} - -/** @internal */ -export const InsertVersionMetadataResponse$inboundSchema: z.ZodType< - InsertVersionMetadataResponse, - z.ZodTypeDef, - unknown -> = z.union([ - shared.ErrorT$inboundSchema, - shared.VersionMetadata$inboundSchema, -]); - -/** @internal */ -export type InsertVersionMetadataResponse$Outbound = - | shared.ErrorT$Outbound - | shared.VersionMetadata$Outbound; - -/** @internal */ -export const InsertVersionMetadataResponse$outboundSchema: z.ZodType< - InsertVersionMetadataResponse$Outbound, - z.ZodTypeDef, - InsertVersionMetadataResponse -> = z.union([ - shared.ErrorT$outboundSchema, - shared.VersionMetadata$outboundSchema, -]); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace InsertVersionMetadataResponse$ { - /** @deprecated use `InsertVersionMetadataResponse$inboundSchema` instead. */ - export const inboundSchema = InsertVersionMetadataResponse$inboundSchema; - /** @deprecated use `InsertVersionMetadataResponse$outboundSchema` instead. */ - export const outboundSchema = InsertVersionMetadataResponse$outboundSchema; - /** @deprecated use `InsertVersionMetadataResponse$Outbound` instead. */ - export type Outbound = InsertVersionMetadataResponse$Outbound; -} diff --git a/src/sdk/models/operations/linkgithubaccess.ts b/src/sdk/models/operations/linkgithubaccess.ts new file mode 100644 index 00000000..d4528518 --- /dev/null +++ b/src/sdk/models/operations/linkgithubaccess.ts @@ -0,0 +1,87 @@ +/* + * 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 LinkGithubAccessRequest = { + installationId?: string | undefined; + githubOrg?: string | undefined; + githubOidcToken?: string | undefined; +}; + +/** @internal */ +export const LinkGithubAccessRequest$inboundSchema: z.ZodType< + LinkGithubAccessRequest, + z.ZodTypeDef, + unknown +> = z.object({ + installation_id: z.string().optional(), + github_org: z.string().optional(), + github_oidc_token: z.string().optional(), +}).transform((v) => { + return remap$(v, { + "installation_id": "installationId", + "github_org": "githubOrg", + "github_oidc_token": "githubOidcToken", + }); +}); + +/** @internal */ +export type LinkGithubAccessRequest$Outbound = { + installation_id?: string | undefined; + github_org?: string | undefined; + github_oidc_token?: string | undefined; +}; + +/** @internal */ +export const LinkGithubAccessRequest$outboundSchema: z.ZodType< + LinkGithubAccessRequest$Outbound, + z.ZodTypeDef, + LinkGithubAccessRequest +> = z.object({ + installationId: z.string().optional(), + githubOrg: z.string().optional(), + githubOidcToken: z.string().optional(), +}).transform((v) => { + return remap$(v, { + installationId: "installation_id", + githubOrg: "github_org", + githubOidcToken: "github_oidc_token", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace LinkGithubAccessRequest$ { + /** @deprecated use `LinkGithubAccessRequest$inboundSchema` instead. */ + export const inboundSchema = LinkGithubAccessRequest$inboundSchema; + /** @deprecated use `LinkGithubAccessRequest$outboundSchema` instead. */ + export const outboundSchema = LinkGithubAccessRequest$outboundSchema; + /** @deprecated use `LinkGithubAccessRequest$Outbound` instead. */ + export type Outbound = LinkGithubAccessRequest$Outbound; +} + +export function linkGithubAccessRequestToJSON( + linkGithubAccessRequest: LinkGithubAccessRequest, +): string { + return JSON.stringify( + LinkGithubAccessRequest$outboundSchema.parse(linkGithubAccessRequest), + ); +} + +export function linkGithubAccessRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => LinkGithubAccessRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'LinkGithubAccessRequest' from JSON`, + ); +} diff --git a/src/sdk/models/operations/listremotesources.ts b/src/sdk/models/operations/listremotesources.ts new file mode 100644 index 00000000..04f531bc --- /dev/null +++ b/src/sdk/models/operations/listremotesources.ts @@ -0,0 +1,128 @@ +/* + * 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"; +import * as shared from "../shared/index.js"; + +export type ListRemoteSourcesRequest = { + namespaceName: string; +}; + +export type ListRemoteSourcesResponse = shared.ErrorT | shared.RemoteSource; + +/** @internal */ +export const ListRemoteSourcesRequest$inboundSchema: z.ZodType< + ListRemoteSourcesRequest, + z.ZodTypeDef, + unknown +> = z.object({ + namespace_name: z.string(), +}).transform((v) => { + return remap$(v, { + "namespace_name": "namespaceName", + }); +}); + +/** @internal */ +export type ListRemoteSourcesRequest$Outbound = { + namespace_name: string; +}; + +/** @internal */ +export const ListRemoteSourcesRequest$outboundSchema: z.ZodType< + ListRemoteSourcesRequest$Outbound, + z.ZodTypeDef, + ListRemoteSourcesRequest +> = z.object({ + namespaceName: z.string(), +}).transform((v) => { + return remap$(v, { + namespaceName: "namespace_name", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListRemoteSourcesRequest$ { + /** @deprecated use `ListRemoteSourcesRequest$inboundSchema` instead. */ + export const inboundSchema = ListRemoteSourcesRequest$inboundSchema; + /** @deprecated use `ListRemoteSourcesRequest$outboundSchema` instead. */ + export const outboundSchema = ListRemoteSourcesRequest$outboundSchema; + /** @deprecated use `ListRemoteSourcesRequest$Outbound` instead. */ + export type Outbound = ListRemoteSourcesRequest$Outbound; +} + +export function listRemoteSourcesRequestToJSON( + listRemoteSourcesRequest: ListRemoteSourcesRequest, +): string { + return JSON.stringify( + ListRemoteSourcesRequest$outboundSchema.parse(listRemoteSourcesRequest), + ); +} + +export function listRemoteSourcesRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ListRemoteSourcesRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ListRemoteSourcesRequest' from JSON`, + ); +} + +/** @internal */ +export const ListRemoteSourcesResponse$inboundSchema: z.ZodType< + ListRemoteSourcesResponse, + z.ZodTypeDef, + unknown +> = z.union([shared.ErrorT$inboundSchema, shared.RemoteSource$inboundSchema]); + +/** @internal */ +export type ListRemoteSourcesResponse$Outbound = + | shared.ErrorT$Outbound + | shared.RemoteSource$Outbound; + +/** @internal */ +export const ListRemoteSourcesResponse$outboundSchema: z.ZodType< + ListRemoteSourcesResponse$Outbound, + z.ZodTypeDef, + ListRemoteSourcesResponse +> = z.union([shared.ErrorT$outboundSchema, shared.RemoteSource$outboundSchema]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListRemoteSourcesResponse$ { + /** @deprecated use `ListRemoteSourcesResponse$inboundSchema` instead. */ + export const inboundSchema = ListRemoteSourcesResponse$inboundSchema; + /** @deprecated use `ListRemoteSourcesResponse$outboundSchema` instead. */ + export const outboundSchema = ListRemoteSourcesResponse$outboundSchema; + /** @deprecated use `ListRemoteSourcesResponse$Outbound` instead. */ + export type Outbound = ListRemoteSourcesResponse$Outbound; +} + +export function listRemoteSourcesResponseToJSON( + listRemoteSourcesResponse: ListRemoteSourcesResponse, +): string { + return JSON.stringify( + ListRemoteSourcesResponse$outboundSchema.parse(listRemoteSourcesResponse), + ); +} + +export function listRemoteSourcesResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ListRemoteSourcesResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ListRemoteSourcesResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/posttags.ts b/src/sdk/models/operations/posttags.ts index 9c44d884..4263b61a 100644 --- a/src/sdk/models/operations/posttags.ts +++ b/src/sdk/models/operations/posttags.ts @@ -4,6 +4,9 @@ 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"; import * as shared from "../shared/index.js"; export type PostTagsRequest = { @@ -62,3 +65,19 @@ export namespace PostTagsRequest$ { /** @deprecated use `PostTagsRequest$Outbound` instead. */ export type Outbound = PostTagsRequest$Outbound; } + +export function postTagsRequestToJSON( + postTagsRequest: PostTagsRequest, +): string { + return JSON.stringify(PostTagsRequest$outboundSchema.parse(postTagsRequest)); +} + +export function postTagsRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PostTagsRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PostTagsRequest' from JSON`, + ); +} diff --git a/src/sdk/models/operations/postworkspaceevents.ts b/src/sdk/models/operations/postworkspaceevents.ts index 1c276a46..adb29e13 100644 --- a/src/sdk/models/operations/postworkspaceevents.ts +++ b/src/sdk/models/operations/postworkspaceevents.ts @@ -4,23 +4,92 @@ 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"; import * as shared from "../shared/index.js"; +export type PostWorkspaceEventsGlobals = { + workspaceId?: string | undefined; +}; + export type PostWorkspaceEventsRequest = { /** * Unique identifier of the workspace. */ - workspaceId: string; + workspaceId?: string | undefined; requestBody: Array; }; +/** @internal */ +export const PostWorkspaceEventsGlobals$inboundSchema: z.ZodType< + PostWorkspaceEventsGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + workspace_id: z.string().optional(), +}).transform((v) => { + return remap$(v, { + "workspace_id": "workspaceId", + }); +}); + +/** @internal */ +export type PostWorkspaceEventsGlobals$Outbound = { + workspace_id?: string | undefined; +}; + +/** @internal */ +export const PostWorkspaceEventsGlobals$outboundSchema: z.ZodType< + PostWorkspaceEventsGlobals$Outbound, + z.ZodTypeDef, + PostWorkspaceEventsGlobals +> = z.object({ + workspaceId: z.string().optional(), +}).transform((v) => { + return remap$(v, { + workspaceId: "workspace_id", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PostWorkspaceEventsGlobals$ { + /** @deprecated use `PostWorkspaceEventsGlobals$inboundSchema` instead. */ + export const inboundSchema = PostWorkspaceEventsGlobals$inboundSchema; + /** @deprecated use `PostWorkspaceEventsGlobals$outboundSchema` instead. */ + export const outboundSchema = PostWorkspaceEventsGlobals$outboundSchema; + /** @deprecated use `PostWorkspaceEventsGlobals$Outbound` instead. */ + export type Outbound = PostWorkspaceEventsGlobals$Outbound; +} + +export function postWorkspaceEventsGlobalsToJSON( + postWorkspaceEventsGlobals: PostWorkspaceEventsGlobals, +): string { + return JSON.stringify( + PostWorkspaceEventsGlobals$outboundSchema.parse(postWorkspaceEventsGlobals), + ); +} + +export function postWorkspaceEventsGlobalsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PostWorkspaceEventsGlobals$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PostWorkspaceEventsGlobals' from JSON`, + ); +} + /** @internal */ export const PostWorkspaceEventsRequest$inboundSchema: z.ZodType< PostWorkspaceEventsRequest, z.ZodTypeDef, unknown > = z.object({ - workspace_id: z.string(), + workspace_id: z.string().optional(), RequestBody: z.array(shared.CliEvent$inboundSchema), }).transform((v) => { return remap$(v, { @@ -31,7 +100,7 @@ export const PostWorkspaceEventsRequest$inboundSchema: z.ZodType< /** @internal */ export type PostWorkspaceEventsRequest$Outbound = { - workspace_id: string; + workspace_id?: string | undefined; RequestBody: Array; }; @@ -41,7 +110,7 @@ export const PostWorkspaceEventsRequest$outboundSchema: z.ZodType< z.ZodTypeDef, PostWorkspaceEventsRequest > = z.object({ - workspaceId: z.string(), + workspaceId: z.string().optional(), requestBody: z.array(shared.CliEvent$outboundSchema), }).transform((v) => { return remap$(v, { @@ -62,3 +131,21 @@ export namespace PostWorkspaceEventsRequest$ { /** @deprecated use `PostWorkspaceEventsRequest$Outbound` instead. */ export type Outbound = PostWorkspaceEventsRequest$Outbound; } + +export function postWorkspaceEventsRequestToJSON( + postWorkspaceEventsRequest: PostWorkspaceEventsRequest, +): string { + return JSON.stringify( + PostWorkspaceEventsRequest$outboundSchema.parse(postWorkspaceEventsRequest), + ); +} + +export function postWorkspaceEventsRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PostWorkspaceEventsRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PostWorkspaceEventsRequest' from JSON`, + ); +} diff --git a/src/sdk/models/operations/preflight.ts b/src/sdk/models/operations/preflight.ts index 3c5b1ef4..d263a0e9 100644 --- a/src/sdk/models/operations/preflight.ts +++ b/src/sdk/models/operations/preflight.ts @@ -3,6 +3,9 @@ */ 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 * as shared from "../shared/index.js"; export type PreflightResponse = shared.PreflightToken | shared.ErrorT; @@ -41,3 +44,21 @@ export namespace PreflightResponse$ { /** @deprecated use `PreflightResponse$Outbound` instead. */ export type Outbound = PreflightResponse$Outbound; } + +export function preflightResponseToJSON( + preflightResponse: PreflightResponse, +): string { + return JSON.stringify( + PreflightResponse$outboundSchema.parse(preflightResponse), + ); +} + +export function preflightResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PreflightResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PreflightResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/queryeventlog.ts b/src/sdk/models/operations/queryeventlog.ts deleted file mode 100644 index fbe6716b..00000000 --- a/src/sdk/models/operations/queryeventlog.ts +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import * as shared from "../shared/index.js"; - -export type QueryEventLogRequest = { - /** - * The filter to apply to the query. - */ - filters?: shared.Filters | undefined; -}; - -export type QueryEventLogResponse = - | shared.ErrorT - | Array; - -/** @internal */ -export const QueryEventLogRequest$inboundSchema: z.ZodType< - QueryEventLogRequest, - z.ZodTypeDef, - unknown -> = z.object({ - filters: shared.Filters$inboundSchema.optional(), -}); - -/** @internal */ -export type QueryEventLogRequest$Outbound = { - filters?: shared.Filters$Outbound | undefined; -}; - -/** @internal */ -export const QueryEventLogRequest$outboundSchema: z.ZodType< - QueryEventLogRequest$Outbound, - z.ZodTypeDef, - QueryEventLogRequest -> = z.object({ - filters: shared.Filters$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 QueryEventLogRequest$ { - /** @deprecated use `QueryEventLogRequest$inboundSchema` instead. */ - export const inboundSchema = QueryEventLogRequest$inboundSchema; - /** @deprecated use `QueryEventLogRequest$outboundSchema` instead. */ - export const outboundSchema = QueryEventLogRequest$outboundSchema; - /** @deprecated use `QueryEventLogRequest$Outbound` instead. */ - export type Outbound = QueryEventLogRequest$Outbound; -} - -/** @internal */ -export const QueryEventLogResponse$inboundSchema: z.ZodType< - QueryEventLogResponse, - z.ZodTypeDef, - unknown -> = z.union([ - shared.ErrorT$inboundSchema, - z.array(shared.BoundedRequest$inboundSchema), -]); - -/** @internal */ -export type QueryEventLogResponse$Outbound = - | shared.ErrorT$Outbound - | Array; - -/** @internal */ -export const QueryEventLogResponse$outboundSchema: z.ZodType< - QueryEventLogResponse$Outbound, - z.ZodTypeDef, - QueryEventLogResponse -> = z.union([ - shared.ErrorT$outboundSchema, - z.array(shared.BoundedRequest$outboundSchema), -]); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace QueryEventLogResponse$ { - /** @deprecated use `QueryEventLogResponse$inboundSchema` instead. */ - export const inboundSchema = QueryEventLogResponse$inboundSchema; - /** @deprecated use `QueryEventLogResponse$outboundSchema` instead. */ - export const outboundSchema = QueryEventLogResponse$outboundSchema; - /** @deprecated use `QueryEventLogResponse$Outbound` instead. */ - export type Outbound = QueryEventLogResponse$Outbound; -} diff --git a/src/sdk/models/operations/registerschema.ts b/src/sdk/models/operations/registerschema.ts deleted file mode 100644 index 364077d7..00000000 --- a/src/sdk/models/operations/registerschema.ts +++ /dev/null @@ -1,169 +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 { blobLikeSchema } from "../../types/blobs.js"; - -export type RegisterSchemaFile = { - content: ReadableStream | Blob | ArrayBuffer | Uint8Array; - fileName: string; -}; - -/** - * The schema file to upload provided as a multipart/form-data file segment. - */ -export type RegisterSchemaRequestBody = { - file: RegisterSchemaFile | Blob; -}; - -export type RegisterSchemaRequest = { - /** - * The ID of the Api to get the schema for. - */ - apiID: string; - /** - * The version ID of the Api to delete metadata for. - */ - versionID: string; - /** - * The schema file to upload provided as a multipart/form-data file segment. - */ - requestBody: RegisterSchemaRequestBody; -}; - -/** @internal */ -export const RegisterSchemaFile$inboundSchema: z.ZodType< - RegisterSchemaFile, - z.ZodTypeDef, - unknown -> = z.object({ - content: z.union([ - z.instanceof(ReadableStream), - z.instanceof(Blob), - z.instanceof(ArrayBuffer), - z.instanceof(Uint8Array), - ]), - fileName: z.string(), -}); - -/** @internal */ -export type RegisterSchemaFile$Outbound = { - content: ReadableStream | Blob | ArrayBuffer | Uint8Array; - fileName: string; -}; - -/** @internal */ -export const RegisterSchemaFile$outboundSchema: z.ZodType< - RegisterSchemaFile$Outbound, - z.ZodTypeDef, - RegisterSchemaFile -> = z.object({ - content: z.union([ - z.instanceof(ReadableStream), - z.instanceof(Blob), - z.instanceof(ArrayBuffer), - z.instanceof(Uint8Array), - ]), - fileName: z.string(), -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace RegisterSchemaFile$ { - /** @deprecated use `RegisterSchemaFile$inboundSchema` instead. */ - export const inboundSchema = RegisterSchemaFile$inboundSchema; - /** @deprecated use `RegisterSchemaFile$outboundSchema` instead. */ - export const outboundSchema = RegisterSchemaFile$outboundSchema; - /** @deprecated use `RegisterSchemaFile$Outbound` instead. */ - export type Outbound = RegisterSchemaFile$Outbound; -} - -/** @internal */ -export const RegisterSchemaRequestBody$inboundSchema: z.ZodType< - RegisterSchemaRequestBody, - z.ZodTypeDef, - unknown -> = z.object({ - file: z.lazy(() => RegisterSchemaFile$inboundSchema), -}); - -/** @internal */ -export type RegisterSchemaRequestBody$Outbound = { - file: RegisterSchemaFile$Outbound | Blob; -}; - -/** @internal */ -export const RegisterSchemaRequestBody$outboundSchema: z.ZodType< - RegisterSchemaRequestBody$Outbound, - z.ZodTypeDef, - RegisterSchemaRequestBody -> = z.object({ - file: z.lazy(() => RegisterSchemaFile$outboundSchema).or(blobLikeSchema), -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace RegisterSchemaRequestBody$ { - /** @deprecated use `RegisterSchemaRequestBody$inboundSchema` instead. */ - export const inboundSchema = RegisterSchemaRequestBody$inboundSchema; - /** @deprecated use `RegisterSchemaRequestBody$outboundSchema` instead. */ - export const outboundSchema = RegisterSchemaRequestBody$outboundSchema; - /** @deprecated use `RegisterSchemaRequestBody$Outbound` instead. */ - export type Outbound = RegisterSchemaRequestBody$Outbound; -} - -/** @internal */ -export const RegisterSchemaRequest$inboundSchema: z.ZodType< - RegisterSchemaRequest, - z.ZodTypeDef, - unknown -> = z.object({ - apiID: z.string(), - versionID: z.string(), - RequestBody: z.lazy(() => RegisterSchemaRequestBody$inboundSchema), -}).transform((v) => { - return remap$(v, { - "RequestBody": "requestBody", - }); -}); - -/** @internal */ -export type RegisterSchemaRequest$Outbound = { - apiID: string; - versionID: string; - RequestBody: RegisterSchemaRequestBody$Outbound; -}; - -/** @internal */ -export const RegisterSchemaRequest$outboundSchema: z.ZodType< - RegisterSchemaRequest$Outbound, - z.ZodTypeDef, - RegisterSchemaRequest -> = z.object({ - apiID: z.string(), - versionID: z.string(), - requestBody: z.lazy(() => RegisterSchemaRequestBody$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 RegisterSchemaRequest$ { - /** @deprecated use `RegisterSchemaRequest$inboundSchema` instead. */ - export const inboundSchema = RegisterSchemaRequest$inboundSchema; - /** @deprecated use `RegisterSchemaRequest$outboundSchema` instead. */ - export const outboundSchema = RegisterSchemaRequest$outboundSchema; - /** @deprecated use `RegisterSchemaRequest$Outbound` instead. */ - export type Outbound = RegisterSchemaRequest$Outbound; -} diff --git a/src/sdk/models/operations/revokeembedaccesstoken.ts b/src/sdk/models/operations/revokeembedaccesstoken.ts deleted file mode 100644 index 659c31e2..00000000 --- a/src/sdk/models/operations/revokeembedaccesstoken.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; - -export type RevokeEmbedAccessTokenRequest = { - /** - * The ID of the EmbedToken to revoke. - */ - tokenID: string; -}; - -/** @internal */ -export const RevokeEmbedAccessTokenRequest$inboundSchema: z.ZodType< - RevokeEmbedAccessTokenRequest, - z.ZodTypeDef, - unknown -> = z.object({ - tokenID: z.string(), -}); - -/** @internal */ -export type RevokeEmbedAccessTokenRequest$Outbound = { - tokenID: string; -}; - -/** @internal */ -export const RevokeEmbedAccessTokenRequest$outboundSchema: z.ZodType< - RevokeEmbedAccessTokenRequest$Outbound, - z.ZodTypeDef, - RevokeEmbedAccessTokenRequest -> = z.object({ - tokenID: 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 RevokeEmbedAccessTokenRequest$ { - /** @deprecated use `RevokeEmbedAccessTokenRequest$inboundSchema` instead. */ - export const inboundSchema = RevokeEmbedAccessTokenRequest$inboundSchema; - /** @deprecated use `RevokeEmbedAccessTokenRequest$outboundSchema` instead. */ - export const outboundSchema = RevokeEmbedAccessTokenRequest$outboundSchema; - /** @deprecated use `RevokeEmbedAccessTokenRequest$Outbound` instead. */ - export type Outbound = RevokeEmbedAccessTokenRequest$Outbound; -} diff --git a/src/sdk/models/operations/revokeuseraccesstoworkspace.ts b/src/sdk/models/operations/revokeuseraccesstoworkspace.ts index 155eed8b..e593ad79 100644 --- a/src/sdk/models/operations/revokeuseraccesstoworkspace.ts +++ b/src/sdk/models/operations/revokeuseraccesstoworkspace.ts @@ -4,25 +4,98 @@ 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 RevokeUserAccessToWorkspaceGlobals = { + workspaceId?: string | undefined; +}; export type RevokeUserAccessToWorkspaceRequest = { /** * Unique identifier of the workspace. */ - workspaceId: string; + workspaceId?: string | undefined; /** * Unique identifier of the user. */ userId: string; }; +/** @internal */ +export const RevokeUserAccessToWorkspaceGlobals$inboundSchema: z.ZodType< + RevokeUserAccessToWorkspaceGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + workspace_id: z.string().optional(), +}).transform((v) => { + return remap$(v, { + "workspace_id": "workspaceId", + }); +}); + +/** @internal */ +export type RevokeUserAccessToWorkspaceGlobals$Outbound = { + workspace_id?: string | undefined; +}; + +/** @internal */ +export const RevokeUserAccessToWorkspaceGlobals$outboundSchema: z.ZodType< + RevokeUserAccessToWorkspaceGlobals$Outbound, + z.ZodTypeDef, + RevokeUserAccessToWorkspaceGlobals +> = z.object({ + workspaceId: z.string().optional(), +}).transform((v) => { + return remap$(v, { + workspaceId: "workspace_id", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace RevokeUserAccessToWorkspaceGlobals$ { + /** @deprecated use `RevokeUserAccessToWorkspaceGlobals$inboundSchema` instead. */ + export const inboundSchema = RevokeUserAccessToWorkspaceGlobals$inboundSchema; + /** @deprecated use `RevokeUserAccessToWorkspaceGlobals$outboundSchema` instead. */ + export const outboundSchema = + RevokeUserAccessToWorkspaceGlobals$outboundSchema; + /** @deprecated use `RevokeUserAccessToWorkspaceGlobals$Outbound` instead. */ + export type Outbound = RevokeUserAccessToWorkspaceGlobals$Outbound; +} + +export function revokeUserAccessToWorkspaceGlobalsToJSON( + revokeUserAccessToWorkspaceGlobals: RevokeUserAccessToWorkspaceGlobals, +): string { + return JSON.stringify( + RevokeUserAccessToWorkspaceGlobals$outboundSchema.parse( + revokeUserAccessToWorkspaceGlobals, + ), + ); +} + +export function revokeUserAccessToWorkspaceGlobalsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + RevokeUserAccessToWorkspaceGlobals$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'RevokeUserAccessToWorkspaceGlobals' from JSON`, + ); +} + /** @internal */ export const RevokeUserAccessToWorkspaceRequest$inboundSchema: z.ZodType< RevokeUserAccessToWorkspaceRequest, z.ZodTypeDef, unknown > = z.object({ - workspace_id: z.string(), + workspace_id: z.string().optional(), userId: z.string(), }).transform((v) => { return remap$(v, { @@ -32,7 +105,7 @@ export const RevokeUserAccessToWorkspaceRequest$inboundSchema: z.ZodType< /** @internal */ export type RevokeUserAccessToWorkspaceRequest$Outbound = { - workspace_id: string; + workspace_id?: string | undefined; userId: string; }; @@ -42,7 +115,7 @@ export const RevokeUserAccessToWorkspaceRequest$outboundSchema: z.ZodType< z.ZodTypeDef, RevokeUserAccessToWorkspaceRequest > = z.object({ - workspaceId: z.string(), + workspaceId: z.string().optional(), userId: z.string(), }).transform((v) => { return remap$(v, { @@ -63,3 +136,24 @@ export namespace RevokeUserAccessToWorkspaceRequest$ { /** @deprecated use `RevokeUserAccessToWorkspaceRequest$Outbound` instead. */ export type Outbound = RevokeUserAccessToWorkspaceRequest$Outbound; } + +export function revokeUserAccessToWorkspaceRequestToJSON( + revokeUserAccessToWorkspaceRequest: RevokeUserAccessToWorkspaceRequest, +): string { + return JSON.stringify( + RevokeUserAccessToWorkspaceRequest$outboundSchema.parse( + revokeUserAccessToWorkspaceRequest, + ), + ); +} + +export function revokeUserAccessToWorkspaceRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + RevokeUserAccessToWorkspaceRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'RevokeUserAccessToWorkspaceRequest' from JSON`, + ); +} diff --git a/src/sdk/models/operations/searchworkspaceevents.ts b/src/sdk/models/operations/searchworkspaceevents.ts index 08413bc6..9dae08bf 100644 --- a/src/sdk/models/operations/searchworkspaceevents.ts +++ b/src/sdk/models/operations/searchworkspaceevents.ts @@ -4,13 +4,20 @@ 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"; import * as shared from "../shared/index.js"; +export type SearchWorkspaceEventsGlobals = { + workspaceId?: string | undefined; +}; + export type SearchWorkspaceEventsRequest = { /** * Unique identifier of the workspace. */ - workspaceId: string; + workspaceId?: string | undefined; /** * Unique identifier of the source revision digest. */ @@ -31,24 +38,103 @@ export type SearchWorkspaceEventsRequest = { * A specific gen lock ID for the events. */ generateGenLockId?: string | undefined; + /** + * Shared execution ID for cli events across a single action. + */ + executionId?: string | undefined; + /** + * Whether the event was successful or not. + */ + success?: boolean | undefined; + /** + * Number of results to return. + */ + limit?: number | undefined; }; export type SearchWorkspaceEventsResponse = | shared.ErrorT | Array; +/** @internal */ +export const SearchWorkspaceEventsGlobals$inboundSchema: z.ZodType< + SearchWorkspaceEventsGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + workspace_id: z.string().optional(), +}).transform((v) => { + return remap$(v, { + "workspace_id": "workspaceId", + }); +}); + +/** @internal */ +export type SearchWorkspaceEventsGlobals$Outbound = { + workspace_id?: string | undefined; +}; + +/** @internal */ +export const SearchWorkspaceEventsGlobals$outboundSchema: z.ZodType< + SearchWorkspaceEventsGlobals$Outbound, + z.ZodTypeDef, + SearchWorkspaceEventsGlobals +> = z.object({ + workspaceId: z.string().optional(), +}).transform((v) => { + return remap$(v, { + workspaceId: "workspace_id", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SearchWorkspaceEventsGlobals$ { + /** @deprecated use `SearchWorkspaceEventsGlobals$inboundSchema` instead. */ + export const inboundSchema = SearchWorkspaceEventsGlobals$inboundSchema; + /** @deprecated use `SearchWorkspaceEventsGlobals$outboundSchema` instead. */ + export const outboundSchema = SearchWorkspaceEventsGlobals$outboundSchema; + /** @deprecated use `SearchWorkspaceEventsGlobals$Outbound` instead. */ + export type Outbound = SearchWorkspaceEventsGlobals$Outbound; +} + +export function searchWorkspaceEventsGlobalsToJSON( + searchWorkspaceEventsGlobals: SearchWorkspaceEventsGlobals, +): string { + return JSON.stringify( + SearchWorkspaceEventsGlobals$outboundSchema.parse( + searchWorkspaceEventsGlobals, + ), + ); +} + +export function searchWorkspaceEventsGlobalsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => SearchWorkspaceEventsGlobals$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'SearchWorkspaceEventsGlobals' from JSON`, + ); +} + /** @internal */ export const SearchWorkspaceEventsRequest$inboundSchema: z.ZodType< SearchWorkspaceEventsRequest, z.ZodTypeDef, unknown > = z.object({ - workspace_id: z.string(), + workspace_id: z.string().optional(), source_revision_digest: z.string().optional(), lint_report_digest: z.string().optional(), openapi_diff_report_digest: z.string().optional(), interaction_type: shared.InteractionType$inboundSchema.optional(), generate_gen_lock_id: z.string().optional(), + execution_id: z.string().optional(), + success: z.boolean().optional(), + limit: z.number().int().optional(), }).transform((v) => { return remap$(v, { "workspace_id": "workspaceId", @@ -57,17 +143,21 @@ export const SearchWorkspaceEventsRequest$inboundSchema: z.ZodType< "openapi_diff_report_digest": "openapiDiffReportDigest", "interaction_type": "interactionType", "generate_gen_lock_id": "generateGenLockId", + "execution_id": "executionId", }); }); /** @internal */ export type SearchWorkspaceEventsRequest$Outbound = { - workspace_id: string; + workspace_id?: string | undefined; source_revision_digest?: string | undefined; lint_report_digest?: string | undefined; openapi_diff_report_digest?: string | undefined; interaction_type?: string | undefined; generate_gen_lock_id?: string | undefined; + execution_id?: string | undefined; + success?: boolean | undefined; + limit?: number | undefined; }; /** @internal */ @@ -76,12 +166,15 @@ export const SearchWorkspaceEventsRequest$outboundSchema: z.ZodType< z.ZodTypeDef, SearchWorkspaceEventsRequest > = z.object({ - workspaceId: z.string(), + workspaceId: z.string().optional(), sourceRevisionDigest: z.string().optional(), lintReportDigest: z.string().optional(), openapiDiffReportDigest: z.string().optional(), interactionType: shared.InteractionType$outboundSchema.optional(), generateGenLockId: z.string().optional(), + executionId: z.string().optional(), + success: z.boolean().optional(), + limit: z.number().int().optional(), }).transform((v) => { return remap$(v, { workspaceId: "workspace_id", @@ -90,6 +183,7 @@ export const SearchWorkspaceEventsRequest$outboundSchema: z.ZodType< openapiDiffReportDigest: "openapi_diff_report_digest", interactionType: "interaction_type", generateGenLockId: "generate_gen_lock_id", + executionId: "execution_id", }); }); @@ -106,6 +200,26 @@ export namespace SearchWorkspaceEventsRequest$ { export type Outbound = SearchWorkspaceEventsRequest$Outbound; } +export function searchWorkspaceEventsRequestToJSON( + searchWorkspaceEventsRequest: SearchWorkspaceEventsRequest, +): string { + return JSON.stringify( + SearchWorkspaceEventsRequest$outboundSchema.parse( + searchWorkspaceEventsRequest, + ), + ); +} + +export function searchWorkspaceEventsRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => SearchWorkspaceEventsRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'SearchWorkspaceEventsRequest' from JSON`, + ); +} + /** @internal */ export const SearchWorkspaceEventsResponse$inboundSchema: z.ZodType< SearchWorkspaceEventsResponse, @@ -143,3 +257,23 @@ export namespace SearchWorkspaceEventsResponse$ { /** @deprecated use `SearchWorkspaceEventsResponse$Outbound` instead. */ export type Outbound = SearchWorkspaceEventsResponse$Outbound; } + +export function searchWorkspaceEventsResponseToJSON( + searchWorkspaceEventsResponse: SearchWorkspaceEventsResponse, +): string { + return JSON.stringify( + SearchWorkspaceEventsResponse$outboundSchema.parse( + searchWorkspaceEventsResponse, + ), + ); +} + +export function searchWorkspaceEventsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => SearchWorkspaceEventsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'SearchWorkspaceEventsResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/setvisibility.ts b/src/sdk/models/operations/setvisibility.ts new file mode 100644 index 00000000..6dd84694 --- /dev/null +++ b/src/sdk/models/operations/setvisibility.ts @@ -0,0 +1,145 @@ +/* + * 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"; + +/** + * Namespace visibility + */ +export type SetVisibilityRequestBody = { + public: boolean; +}; + +export type SetVisibilityRequest = { + namespaceName: string; + /** + * Namespace visibility + */ + requestBody?: SetVisibilityRequestBody | undefined; +}; + +/** @internal */ +export const SetVisibilityRequestBody$inboundSchema: z.ZodType< + SetVisibilityRequestBody, + z.ZodTypeDef, + unknown +> = z.object({ + public: z.boolean(), +}); + +/** @internal */ +export type SetVisibilityRequestBody$Outbound = { + public: boolean; +}; + +/** @internal */ +export const SetVisibilityRequestBody$outboundSchema: z.ZodType< + SetVisibilityRequestBody$Outbound, + z.ZodTypeDef, + SetVisibilityRequestBody +> = z.object({ + public: z.boolean(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SetVisibilityRequestBody$ { + /** @deprecated use `SetVisibilityRequestBody$inboundSchema` instead. */ + export const inboundSchema = SetVisibilityRequestBody$inboundSchema; + /** @deprecated use `SetVisibilityRequestBody$outboundSchema` instead. */ + export const outboundSchema = SetVisibilityRequestBody$outboundSchema; + /** @deprecated use `SetVisibilityRequestBody$Outbound` instead. */ + export type Outbound = SetVisibilityRequestBody$Outbound; +} + +export function setVisibilityRequestBodyToJSON( + setVisibilityRequestBody: SetVisibilityRequestBody, +): string { + return JSON.stringify( + SetVisibilityRequestBody$outboundSchema.parse(setVisibilityRequestBody), + ); +} + +export function setVisibilityRequestBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => SetVisibilityRequestBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'SetVisibilityRequestBody' from JSON`, + ); +} + +/** @internal */ +export const SetVisibilityRequest$inboundSchema: z.ZodType< + SetVisibilityRequest, + z.ZodTypeDef, + unknown +> = z.object({ + namespace_name: z.string(), + RequestBody: z.lazy(() => SetVisibilityRequestBody$inboundSchema).optional(), +}).transform((v) => { + return remap$(v, { + "namespace_name": "namespaceName", + "RequestBody": "requestBody", + }); +}); + +/** @internal */ +export type SetVisibilityRequest$Outbound = { + namespace_name: string; + RequestBody?: SetVisibilityRequestBody$Outbound | undefined; +}; + +/** @internal */ +export const SetVisibilityRequest$outboundSchema: z.ZodType< + SetVisibilityRequest$Outbound, + z.ZodTypeDef, + SetVisibilityRequest +> = z.object({ + namespaceName: z.string(), + requestBody: z.lazy(() => SetVisibilityRequestBody$outboundSchema).optional(), +}).transform((v) => { + return remap$(v, { + namespaceName: "namespace_name", + 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 SetVisibilityRequest$ { + /** @deprecated use `SetVisibilityRequest$inboundSchema` instead. */ + export const inboundSchema = SetVisibilityRequest$inboundSchema; + /** @deprecated use `SetVisibilityRequest$outboundSchema` instead. */ + export const outboundSchema = SetVisibilityRequest$outboundSchema; + /** @deprecated use `SetVisibilityRequest$Outbound` instead. */ + export type Outbound = SetVisibilityRequest$Outbound; +} + +export function setVisibilityRequestToJSON( + setVisibilityRequest: SetVisibilityRequest, +): string { + return JSON.stringify( + SetVisibilityRequest$outboundSchema.parse(setVisibilityRequest), + ); +} + +export function setVisibilityRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => SetVisibilityRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'SetVisibilityRequest' from JSON`, + ); +} diff --git a/src/sdk/models/operations/setworkspacefeatureflags.ts b/src/sdk/models/operations/setworkspacefeatureflags.ts new file mode 100644 index 00000000..8d124aae --- /dev/null +++ b/src/sdk/models/operations/setworkspacefeatureflags.ts @@ -0,0 +1,71 @@ +/* + * 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 * as shared from "../shared/index.js"; + +export type SetWorkspaceFeatureFlagsResponse = + | shared.WorkspaceFeatureFlagResponse + | shared.ErrorT; + +/** @internal */ +export const SetWorkspaceFeatureFlagsResponse$inboundSchema: z.ZodType< + SetWorkspaceFeatureFlagsResponse, + z.ZodTypeDef, + unknown +> = z.union([ + shared.WorkspaceFeatureFlagResponse$inboundSchema, + shared.ErrorT$inboundSchema, +]); + +/** @internal */ +export type SetWorkspaceFeatureFlagsResponse$Outbound = + | shared.WorkspaceFeatureFlagResponse$Outbound + | shared.ErrorT$Outbound; + +/** @internal */ +export const SetWorkspaceFeatureFlagsResponse$outboundSchema: z.ZodType< + SetWorkspaceFeatureFlagsResponse$Outbound, + z.ZodTypeDef, + SetWorkspaceFeatureFlagsResponse +> = z.union([ + shared.WorkspaceFeatureFlagResponse$outboundSchema, + shared.ErrorT$outboundSchema, +]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SetWorkspaceFeatureFlagsResponse$ { + /** @deprecated use `SetWorkspaceFeatureFlagsResponse$inboundSchema` instead. */ + export const inboundSchema = SetWorkspaceFeatureFlagsResponse$inboundSchema; + /** @deprecated use `SetWorkspaceFeatureFlagsResponse$outboundSchema` instead. */ + export const outboundSchema = SetWorkspaceFeatureFlagsResponse$outboundSchema; + /** @deprecated use `SetWorkspaceFeatureFlagsResponse$Outbound` instead. */ + export type Outbound = SetWorkspaceFeatureFlagsResponse$Outbound; +} + +export function setWorkspaceFeatureFlagsResponseToJSON( + setWorkspaceFeatureFlagsResponse: SetWorkspaceFeatureFlagsResponse, +): string { + return JSON.stringify( + SetWorkspaceFeatureFlagsResponse$outboundSchema.parse( + setWorkspaceFeatureFlagsResponse, + ), + ); +} + +export function setWorkspaceFeatureFlagsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => SetWorkspaceFeatureFlagsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'SetWorkspaceFeatureFlagsResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/suggest.ts b/src/sdk/models/operations/suggest.ts index 153d28fa..ad261c0c 100644 --- a/src/sdk/models/operations/suggest.ts +++ b/src/sdk/models/operations/suggest.ts @@ -4,6 +4,9 @@ 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"; import * as shared from "../shared/index.js"; export type SuggestRequest = { @@ -62,3 +65,17 @@ export namespace SuggestRequest$ { /** @deprecated use `SuggestRequest$Outbound` instead. */ export type Outbound = SuggestRequest$Outbound; } + +export function suggestRequestToJSON(suggestRequest: SuggestRequest): string { + return JSON.stringify(SuggestRequest$outboundSchema.parse(suggestRequest)); +} + +export function suggestRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => SuggestRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'SuggestRequest' from JSON`, + ); +} diff --git a/src/sdk/models/operations/suggestopenapi.ts b/src/sdk/models/operations/suggestopenapi.ts index 0a06a6c5..e24661a7 100644 --- a/src/sdk/models/operations/suggestopenapi.ts +++ b/src/sdk/models/operations/suggestopenapi.ts @@ -4,7 +4,10 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; import { blobLikeSchema } from "../../types/blobs.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import * as shared from "../shared/index.js"; export type Schema = { @@ -16,8 +19,8 @@ export type Schema = { * The schema file to upload provided as a multipart/form-data file segment. */ export type SuggestOpenAPIRequestBody = { - schema: Schema | Blob; opts?: shared.SuggestOptsOld | undefined; + schema: Schema | Blob; }; export type SuggestOpenAPIRequest = { @@ -74,20 +77,34 @@ export namespace Schema$ { 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`, + ); +} + /** @internal */ export const SuggestOpenAPIRequestBody$inboundSchema: z.ZodType< SuggestOpenAPIRequestBody, z.ZodTypeDef, unknown > = z.object({ - schema: z.lazy(() => Schema$inboundSchema), opts: shared.SuggestOptsOld$inboundSchema.optional(), + schema: z.lazy(() => Schema$inboundSchema), }); /** @internal */ export type SuggestOpenAPIRequestBody$Outbound = { - schema: Schema$Outbound | Blob; opts?: shared.SuggestOptsOld$Outbound | undefined; + schema: Schema$Outbound | Blob; }; /** @internal */ @@ -96,8 +113,8 @@ export const SuggestOpenAPIRequestBody$outboundSchema: z.ZodType< z.ZodTypeDef, SuggestOpenAPIRequestBody > = z.object({ - schema: z.lazy(() => Schema$outboundSchema).or(blobLikeSchema), opts: shared.SuggestOptsOld$outboundSchema.optional(), + schema: z.lazy(() => Schema$outboundSchema).or(blobLikeSchema), }); /** @@ -113,6 +130,24 @@ export namespace SuggestOpenAPIRequestBody$ { export type Outbound = SuggestOpenAPIRequestBody$Outbound; } +export function suggestOpenAPIRequestBodyToJSON( + suggestOpenAPIRequestBody: SuggestOpenAPIRequestBody, +): string { + return JSON.stringify( + SuggestOpenAPIRequestBody$outboundSchema.parse(suggestOpenAPIRequestBody), + ); +} + +export function suggestOpenAPIRequestBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => SuggestOpenAPIRequestBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'SuggestOpenAPIRequestBody' from JSON`, + ); +} + /** @internal */ export const SuggestOpenAPIRequest$inboundSchema: z.ZodType< SuggestOpenAPIRequest, @@ -161,3 +196,21 @@ export namespace SuggestOpenAPIRequest$ { /** @deprecated use `SuggestOpenAPIRequest$Outbound` instead. */ export type Outbound = SuggestOpenAPIRequest$Outbound; } + +export function suggestOpenAPIRequestToJSON( + suggestOpenAPIRequest: SuggestOpenAPIRequest, +): string { + return JSON.stringify( + SuggestOpenAPIRequest$outboundSchema.parse(suggestOpenAPIRequest), + ); +} + +export function suggestOpenAPIRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => SuggestOpenAPIRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'SuggestOpenAPIRequest' from JSON`, + ); +} diff --git a/src/sdk/models/operations/suggestopenapiregistry.ts b/src/sdk/models/operations/suggestopenapiregistry.ts index 93015527..135888d9 100644 --- a/src/sdk/models/operations/suggestopenapiregistry.ts +++ b/src/sdk/models/operations/suggestopenapiregistry.ts @@ -4,6 +4,9 @@ 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"; import * as shared from "../shared/index.js"; export type SuggestOpenAPIRegistryRequest = { @@ -77,3 +80,23 @@ export namespace SuggestOpenAPIRegistryRequest$ { /** @deprecated use `SuggestOpenAPIRegistryRequest$Outbound` instead. */ export type Outbound = SuggestOpenAPIRegistryRequest$Outbound; } + +export function suggestOpenAPIRegistryRequestToJSON( + suggestOpenAPIRegistryRequest: SuggestOpenAPIRegistryRequest, +): string { + return JSON.stringify( + SuggestOpenAPIRegistryRequest$outboundSchema.parse( + suggestOpenAPIRegistryRequest, + ), + ); +} + +export function suggestOpenAPIRegistryRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => SuggestOpenAPIRegistryRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'SuggestOpenAPIRegistryRequest' from JSON`, + ); +} diff --git a/src/sdk/models/operations/updateworkspacedetails.ts b/src/sdk/models/operations/updateworkspacedetails.ts index 7a66d11d..9ee7c090 100644 --- a/src/sdk/models/operations/updateworkspacedetails.ts +++ b/src/sdk/models/operations/updateworkspacedetails.ts @@ -4,26 +4,97 @@ 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"; import * as shared from "../shared/index.js"; +export type UpdateWorkspaceDetailsGlobals = { + workspaceId?: string | undefined; +}; + export type UpdateWorkspaceDetailsRequest = { /** * Unique identifier of the workspace. */ - workspaceId: string; + workspaceId?: string | undefined; /** * The workspace details to update. */ workspace: shared.Workspace; }; +/** @internal */ +export const UpdateWorkspaceDetailsGlobals$inboundSchema: z.ZodType< + UpdateWorkspaceDetailsGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + workspace_id: z.string().optional(), +}).transform((v) => { + return remap$(v, { + "workspace_id": "workspaceId", + }); +}); + +/** @internal */ +export type UpdateWorkspaceDetailsGlobals$Outbound = { + workspace_id?: string | undefined; +}; + +/** @internal */ +export const UpdateWorkspaceDetailsGlobals$outboundSchema: z.ZodType< + UpdateWorkspaceDetailsGlobals$Outbound, + z.ZodTypeDef, + UpdateWorkspaceDetailsGlobals +> = z.object({ + workspaceId: z.string().optional(), +}).transform((v) => { + return remap$(v, { + workspaceId: "workspace_id", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateWorkspaceDetailsGlobals$ { + /** @deprecated use `UpdateWorkspaceDetailsGlobals$inboundSchema` instead. */ + export const inboundSchema = UpdateWorkspaceDetailsGlobals$inboundSchema; + /** @deprecated use `UpdateWorkspaceDetailsGlobals$outboundSchema` instead. */ + export const outboundSchema = UpdateWorkspaceDetailsGlobals$outboundSchema; + /** @deprecated use `UpdateWorkspaceDetailsGlobals$Outbound` instead. */ + export type Outbound = UpdateWorkspaceDetailsGlobals$Outbound; +} + +export function updateWorkspaceDetailsGlobalsToJSON( + updateWorkspaceDetailsGlobals: UpdateWorkspaceDetailsGlobals, +): string { + return JSON.stringify( + UpdateWorkspaceDetailsGlobals$outboundSchema.parse( + updateWorkspaceDetailsGlobals, + ), + ); +} + +export function updateWorkspaceDetailsGlobalsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UpdateWorkspaceDetailsGlobals$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UpdateWorkspaceDetailsGlobals' from JSON`, + ); +} + /** @internal */ export const UpdateWorkspaceDetailsRequest$inboundSchema: z.ZodType< UpdateWorkspaceDetailsRequest, z.ZodTypeDef, unknown > = z.object({ - workspace_id: z.string(), + workspace_id: z.string().optional(), Workspace: shared.Workspace$inboundSchema, }).transform((v) => { return remap$(v, { @@ -34,7 +105,7 @@ export const UpdateWorkspaceDetailsRequest$inboundSchema: z.ZodType< /** @internal */ export type UpdateWorkspaceDetailsRequest$Outbound = { - workspace_id: string; + workspace_id?: string | undefined; Workspace: shared.Workspace$Outbound; }; @@ -44,7 +115,7 @@ export const UpdateWorkspaceDetailsRequest$outboundSchema: z.ZodType< z.ZodTypeDef, UpdateWorkspaceDetailsRequest > = z.object({ - workspaceId: z.string(), + workspaceId: z.string().optional(), workspace: shared.Workspace$outboundSchema, }).transform((v) => { return remap$(v, { @@ -65,3 +136,23 @@ export namespace UpdateWorkspaceDetailsRequest$ { /** @deprecated use `UpdateWorkspaceDetailsRequest$Outbound` instead. */ export type Outbound = UpdateWorkspaceDetailsRequest$Outbound; } + +export function updateWorkspaceDetailsRequestToJSON( + updateWorkspaceDetailsRequest: UpdateWorkspaceDetailsRequest, +): string { + return JSON.stringify( + UpdateWorkspaceDetailsRequest$outboundSchema.parse( + updateWorkspaceDetailsRequest, + ), + ); +} + +export function updateWorkspaceDetailsRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UpdateWorkspaceDetailsRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UpdateWorkspaceDetailsRequest' from JSON`, + ); +} diff --git a/src/sdk/models/operations/updateworkspacesettings.ts b/src/sdk/models/operations/updateworkspacesettings.ts index e2c85506..3299bf61 100644 --- a/src/sdk/models/operations/updateworkspacesettings.ts +++ b/src/sdk/models/operations/updateworkspacesettings.ts @@ -4,26 +4,97 @@ 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"; import * as shared from "../shared/index.js"; +export type UpdateWorkspaceSettingsGlobals = { + workspaceId?: string | undefined; +}; + export type UpdateWorkspaceSettingsRequest = { /** * Unique identifier of the workspace. */ - workspaceId: string; + workspaceId?: string | undefined; /** * The workspace settings to update. */ workspaceSettings: shared.WorkspaceSettings; }; +/** @internal */ +export const UpdateWorkspaceSettingsGlobals$inboundSchema: z.ZodType< + UpdateWorkspaceSettingsGlobals, + z.ZodTypeDef, + unknown +> = z.object({ + workspace_id: z.string().optional(), +}).transform((v) => { + return remap$(v, { + "workspace_id": "workspaceId", + }); +}); + +/** @internal */ +export type UpdateWorkspaceSettingsGlobals$Outbound = { + workspace_id?: string | undefined; +}; + +/** @internal */ +export const UpdateWorkspaceSettingsGlobals$outboundSchema: z.ZodType< + UpdateWorkspaceSettingsGlobals$Outbound, + z.ZodTypeDef, + UpdateWorkspaceSettingsGlobals +> = z.object({ + workspaceId: z.string().optional(), +}).transform((v) => { + return remap$(v, { + workspaceId: "workspace_id", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateWorkspaceSettingsGlobals$ { + /** @deprecated use `UpdateWorkspaceSettingsGlobals$inboundSchema` instead. */ + export const inboundSchema = UpdateWorkspaceSettingsGlobals$inboundSchema; + /** @deprecated use `UpdateWorkspaceSettingsGlobals$outboundSchema` instead. */ + export const outboundSchema = UpdateWorkspaceSettingsGlobals$outboundSchema; + /** @deprecated use `UpdateWorkspaceSettingsGlobals$Outbound` instead. */ + export type Outbound = UpdateWorkspaceSettingsGlobals$Outbound; +} + +export function updateWorkspaceSettingsGlobalsToJSON( + updateWorkspaceSettingsGlobals: UpdateWorkspaceSettingsGlobals, +): string { + return JSON.stringify( + UpdateWorkspaceSettingsGlobals$outboundSchema.parse( + updateWorkspaceSettingsGlobals, + ), + ); +} + +export function updateWorkspaceSettingsGlobalsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UpdateWorkspaceSettingsGlobals$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UpdateWorkspaceSettingsGlobals' from JSON`, + ); +} + /** @internal */ export const UpdateWorkspaceSettingsRequest$inboundSchema: z.ZodType< UpdateWorkspaceSettingsRequest, z.ZodTypeDef, unknown > = z.object({ - workspace_id: z.string(), + workspace_id: z.string().optional(), WorkspaceSettings: shared.WorkspaceSettings$inboundSchema, }).transform((v) => { return remap$(v, { @@ -34,7 +105,7 @@ export const UpdateWorkspaceSettingsRequest$inboundSchema: z.ZodType< /** @internal */ export type UpdateWorkspaceSettingsRequest$Outbound = { - workspace_id: string; + workspace_id?: string | undefined; WorkspaceSettings: shared.WorkspaceSettings$Outbound; }; @@ -44,7 +115,7 @@ export const UpdateWorkspaceSettingsRequest$outboundSchema: z.ZodType< z.ZodTypeDef, UpdateWorkspaceSettingsRequest > = z.object({ - workspaceId: z.string(), + workspaceId: z.string().optional(), workspaceSettings: shared.WorkspaceSettings$outboundSchema, }).transform((v) => { return remap$(v, { @@ -65,3 +136,23 @@ export namespace UpdateWorkspaceSettingsRequest$ { /** @deprecated use `UpdateWorkspaceSettingsRequest$Outbound` instead. */ export type Outbound = UpdateWorkspaceSettingsRequest$Outbound; } + +export function updateWorkspaceSettingsRequestToJSON( + updateWorkspaceSettingsRequest: UpdateWorkspaceSettingsRequest, +): string { + return JSON.stringify( + UpdateWorkspaceSettingsRequest$outboundSchema.parse( + updateWorkspaceSettingsRequest, + ), + ); +} + +export function updateWorkspaceSettingsRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UpdateWorkspaceSettingsRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UpdateWorkspaceSettingsRequest' from JSON`, + ); +} diff --git a/src/sdk/models/operations/uploadreport.ts b/src/sdk/models/operations/uploadreport.ts index af8eb3f4..193449ec 100644 --- a/src/sdk/models/operations/uploadreport.ts +++ b/src/sdk/models/operations/uploadreport.ts @@ -3,7 +3,10 @@ */ import * as z from "zod"; +import { safeParse } from "../../../lib/schemas.js"; import { blobLikeSchema } from "../../types/blobs.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import * as shared from "../shared/index.js"; export type FileT = { @@ -72,6 +75,20 @@ export namespace FileT$ { export type Outbound = FileT$Outbound; } +export function fileToJSON(fileT: FileT): string { + return JSON.stringify(FileT$outboundSchema.parse(fileT)); +} + +export function fileFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => FileT$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'FileT' from JSON`, + ); +} + /** @internal */ export const UploadReportRequestBody$inboundSchema: z.ZodType< UploadReportRequestBody, @@ -111,6 +128,24 @@ export namespace UploadReportRequestBody$ { export type Outbound = UploadReportRequestBody$Outbound; } +export function uploadReportRequestBodyToJSON( + uploadReportRequestBody: UploadReportRequestBody, +): string { + return JSON.stringify( + UploadReportRequestBody$outboundSchema.parse(uploadReportRequestBody), + ); +} + +export function uploadReportRequestBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UploadReportRequestBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UploadReportRequestBody' from JSON`, + ); +} + /** @internal */ export const UploadReportUploadedReport$inboundSchema: z.ZodType< UploadReportUploadedReport, @@ -146,3 +181,21 @@ export namespace UploadReportUploadedReport$ { /** @deprecated use `UploadReportUploadedReport$Outbound` instead. */ export type Outbound = UploadReportUploadedReport$Outbound; } + +export function uploadReportUploadedReportToJSON( + uploadReportUploadedReport: UploadReportUploadedReport, +): string { + return JSON.stringify( + UploadReportUploadedReport$outboundSchema.parse(uploadReportUploadedReport), + ); +} + +export function uploadReportUploadedReportFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UploadReportUploadedReport$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UploadReportUploadedReport' from JSON`, + ); +} diff --git a/src/sdk/models/operations/upsertapi.ts b/src/sdk/models/operations/upsertapi.ts deleted file mode 100644 index 4d8497ed..00000000 --- a/src/sdk/models/operations/upsertapi.ts +++ /dev/null @@ -1,99 +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 * as shared from "../shared/index.js"; - -export type UpsertApiRequest = { - /** - * The ID of the Api to upsert. - */ - apiID: string; - /** - * A JSON representation of the Api to upsert - */ - api: shared.ApiInput; -}; - -export type UpsertApiResponse = shared.ErrorT | shared.Api; - -/** @internal */ -export const UpsertApiRequest$inboundSchema: z.ZodType< - UpsertApiRequest, - z.ZodTypeDef, - unknown -> = z.object({ - apiID: z.string(), - Api: shared.ApiInput$inboundSchema, -}).transform((v) => { - return remap$(v, { - "Api": "api", - }); -}); - -/** @internal */ -export type UpsertApiRequest$Outbound = { - apiID: string; - Api: shared.ApiInput$Outbound; -}; - -/** @internal */ -export const UpsertApiRequest$outboundSchema: z.ZodType< - UpsertApiRequest$Outbound, - z.ZodTypeDef, - UpsertApiRequest -> = z.object({ - apiID: z.string(), - api: shared.ApiInput$outboundSchema, -}).transform((v) => { - return remap$(v, { - api: "Api", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace UpsertApiRequest$ { - /** @deprecated use `UpsertApiRequest$inboundSchema` instead. */ - export const inboundSchema = UpsertApiRequest$inboundSchema; - /** @deprecated use `UpsertApiRequest$outboundSchema` instead. */ - export const outboundSchema = UpsertApiRequest$outboundSchema; - /** @deprecated use `UpsertApiRequest$Outbound` instead. */ - export type Outbound = UpsertApiRequest$Outbound; -} - -/** @internal */ -export const UpsertApiResponse$inboundSchema: z.ZodType< - UpsertApiResponse, - z.ZodTypeDef, - unknown -> = z.union([shared.ErrorT$inboundSchema, shared.Api$inboundSchema]); - -/** @internal */ -export type UpsertApiResponse$Outbound = - | shared.ErrorT$Outbound - | shared.Api$Outbound; - -/** @internal */ -export const UpsertApiResponse$outboundSchema: z.ZodType< - UpsertApiResponse$Outbound, - z.ZodTypeDef, - UpsertApiResponse -> = z.union([shared.ErrorT$outboundSchema, shared.Api$outboundSchema]); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace UpsertApiResponse$ { - /** @deprecated use `UpsertApiResponse$inboundSchema` instead. */ - export const inboundSchema = UpsertApiResponse$inboundSchema; - /** @deprecated use `UpsertApiResponse$outboundSchema` instead. */ - export const outboundSchema = UpsertApiResponse$outboundSchema; - /** @deprecated use `UpsertApiResponse$Outbound` instead. */ - export type Outbound = UpsertApiResponse$Outbound; -} diff --git a/src/sdk/models/operations/upsertapiendpoint.ts b/src/sdk/models/operations/upsertapiendpoint.ts deleted file mode 100644 index 0e4a2188..00000000 --- a/src/sdk/models/operations/upsertapiendpoint.ts +++ /dev/null @@ -1,113 +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 * as shared from "../shared/index.js"; - -export type UpsertApiEndpointRequest = { - /** - * The ID of the Api the ApiEndpoint belongs to. - */ - apiID: string; - /** - * The version ID of the Api the ApiEndpoint belongs to. - */ - versionID: string; - /** - * The ID of the ApiEndpoint to upsert. - */ - apiEndpointID: string; - /** - * A JSON representation of the ApiEndpoint to upsert. - */ - apiEndpoint: shared.ApiEndpointInput; -}; - -export type UpsertApiEndpointResponse = shared.ErrorT | shared.ApiEndpoint; - -/** @internal */ -export const UpsertApiEndpointRequest$inboundSchema: z.ZodType< - UpsertApiEndpointRequest, - z.ZodTypeDef, - unknown -> = z.object({ - apiID: z.string(), - versionID: z.string(), - apiEndpointID: z.string(), - ApiEndpoint: shared.ApiEndpointInput$inboundSchema, -}).transform((v) => { - return remap$(v, { - "ApiEndpoint": "apiEndpoint", - }); -}); - -/** @internal */ -export type UpsertApiEndpointRequest$Outbound = { - apiID: string; - versionID: string; - apiEndpointID: string; - ApiEndpoint: shared.ApiEndpointInput$Outbound; -}; - -/** @internal */ -export const UpsertApiEndpointRequest$outboundSchema: z.ZodType< - UpsertApiEndpointRequest$Outbound, - z.ZodTypeDef, - UpsertApiEndpointRequest -> = z.object({ - apiID: z.string(), - versionID: z.string(), - apiEndpointID: z.string(), - apiEndpoint: shared.ApiEndpointInput$outboundSchema, -}).transform((v) => { - return remap$(v, { - apiEndpoint: "ApiEndpoint", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace UpsertApiEndpointRequest$ { - /** @deprecated use `UpsertApiEndpointRequest$inboundSchema` instead. */ - export const inboundSchema = UpsertApiEndpointRequest$inboundSchema; - /** @deprecated use `UpsertApiEndpointRequest$outboundSchema` instead. */ - export const outboundSchema = UpsertApiEndpointRequest$outboundSchema; - /** @deprecated use `UpsertApiEndpointRequest$Outbound` instead. */ - export type Outbound = UpsertApiEndpointRequest$Outbound; -} - -/** @internal */ -export const UpsertApiEndpointResponse$inboundSchema: z.ZodType< - UpsertApiEndpointResponse, - z.ZodTypeDef, - unknown -> = z.union([shared.ErrorT$inboundSchema, shared.ApiEndpoint$inboundSchema]); - -/** @internal */ -export type UpsertApiEndpointResponse$Outbound = - | shared.ErrorT$Outbound - | shared.ApiEndpoint$Outbound; - -/** @internal */ -export const UpsertApiEndpointResponse$outboundSchema: z.ZodType< - UpsertApiEndpointResponse$Outbound, - z.ZodTypeDef, - UpsertApiEndpointResponse -> = z.union([shared.ErrorT$outboundSchema, shared.ApiEndpoint$outboundSchema]); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace UpsertApiEndpointResponse$ { - /** @deprecated use `UpsertApiEndpointResponse$inboundSchema` instead. */ - export const inboundSchema = UpsertApiEndpointResponse$inboundSchema; - /** @deprecated use `UpsertApiEndpointResponse$outboundSchema` instead. */ - export const outboundSchema = UpsertApiEndpointResponse$outboundSchema; - /** @deprecated use `UpsertApiEndpointResponse$Outbound` instead. */ - export type Outbound = UpsertApiEndpointResponse$Outbound; -} diff --git a/src/sdk/models/operations/validateapikey.ts b/src/sdk/models/operations/validateapikey.ts index 4fe123b8..fd9ea70e 100644 --- a/src/sdk/models/operations/validateapikey.ts +++ b/src/sdk/models/operations/validateapikey.ts @@ -3,6 +3,9 @@ */ 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 * as shared from "../shared/index.js"; export type ValidateApiKeyResponse = shared.ErrorT | shared.ApiKeyDetails; @@ -41,3 +44,21 @@ export namespace ValidateApiKeyResponse$ { /** @deprecated use `ValidateApiKeyResponse$Outbound` instead. */ export type Outbound = ValidateApiKeyResponse$Outbound; } + +export function validateApiKeyResponseToJSON( + validateApiKeyResponse: ValidateApiKeyResponse, +): string { + return JSON.stringify( + ValidateApiKeyResponse$outboundSchema.parse(validateApiKeyResponse), + ); +} + +export function validateApiKeyResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ValidateApiKeyResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ValidateApiKeyResponse' from JSON`, + ); +} diff --git a/src/sdk/models/shared/accessdetails.ts b/src/sdk/models/shared/accessdetails.ts index 219e8780..adf8acf4 100644 --- a/src/sdk/models/shared/accessdetails.ts +++ b/src/sdk/models/shared/accessdetails.ts @@ -4,7 +4,10 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +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"; export const Level = { Allowed: "allowed", @@ -88,3 +91,17 @@ export namespace AccessDetails$ { /** @deprecated use `AccessDetails$Outbound` instead. */ export type Outbound = AccessDetails$Outbound; } + +export function accessDetailsToJSON(accessDetails: AccessDetails): string { + return JSON.stringify(AccessDetails$outboundSchema.parse(accessDetails)); +} + +export function accessDetailsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AccessDetails$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AccessDetails' from JSON`, + ); +} diff --git a/src/sdk/models/shared/accesstoken.ts b/src/sdk/models/shared/accesstoken.ts index b7d2cafe..91a4a93b 100644 --- a/src/sdk/models/shared/accesstoken.ts +++ b/src/sdk/models/shared/accesstoken.ts @@ -4,6 +4,9 @@ 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"; import { AccountType, AccountType$inboundSchema, @@ -72,6 +75,20 @@ export namespace Claims$ { export type Outbound = Claims$Outbound; } +export function claimsToJSON(claims: Claims): string { + return JSON.stringify(Claims$outboundSchema.parse(claims)); +} + +export function claimsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Claims$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Claims' from JSON`, + ); +} + /** @internal */ export const AccessTokenUser$inboundSchema: z.ZodType< AccessTokenUser, @@ -136,6 +153,22 @@ export namespace AccessTokenUser$ { export type Outbound = AccessTokenUser$Outbound; } +export function accessTokenUserToJSON( + accessTokenUser: AccessTokenUser, +): string { + return JSON.stringify(AccessTokenUser$outboundSchema.parse(accessTokenUser)); +} + +export function accessTokenUserFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AccessTokenUser$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AccessTokenUser' from JSON`, + ); +} + /** @internal */ export const Workspaces$inboundSchema: z.ZodType< Workspaces, @@ -192,6 +225,20 @@ export namespace Workspaces$ { export type Outbound = Workspaces$Outbound; } +export function workspacesToJSON(workspaces: Workspaces): string { + return JSON.stringify(Workspaces$outboundSchema.parse(workspaces)); +} + +export function workspacesFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Workspaces$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Workspaces' from JSON`, + ); +} + /** @internal */ export const AccessToken$inboundSchema: z.ZodType< AccessToken, @@ -249,3 +296,17 @@ export namespace AccessToken$ { /** @deprecated use `AccessToken$Outbound` instead. */ export type Outbound = AccessToken$Outbound; } + +export function accessTokenToJSON(accessToken: AccessToken): string { + return JSON.stringify(AccessToken$outboundSchema.parse(accessToken)); +} + +export function accessTokenFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AccessToken$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AccessToken' from JSON`, + ); +} diff --git a/src/sdk/models/shared/addtags.ts b/src/sdk/models/shared/addtags.ts index 67834286..dab978a8 100644 --- a/src/sdk/models/shared/addtags.ts +++ b/src/sdk/models/shared/addtags.ts @@ -4,6 +4,9 @@ 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"; /** * Request body of tags to add to a revision @@ -62,3 +65,17 @@ export namespace AddTags$ { /** @deprecated use `AddTags$Outbound` instead. */ export type Outbound = AddTags$Outbound; } + +export function addTagsToJSON(addTags: AddTags): string { + return JSON.stringify(AddTags$outboundSchema.parse(addTags)); +} + +export function addTagsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AddTags$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AddTags' from JSON`, + ); +} diff --git a/src/sdk/models/shared/annotations.ts b/src/sdk/models/shared/annotations.ts index bbe5d932..f77406ba 100644 --- a/src/sdk/models/shared/annotations.ts +++ b/src/sdk/models/shared/annotations.ts @@ -4,6 +4,9 @@ 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"; /** * Annotations @@ -156,3 +159,17 @@ export namespace Annotations$ { /** @deprecated use `Annotations$Outbound` instead. */ export type Outbound = Annotations$Outbound; } + +export function annotationsToJSON(annotations: Annotations): string { + return JSON.stringify(Annotations$outboundSchema.parse(annotations)); +} + +export function annotationsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Annotations$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Annotations' from JSON`, + ); +} diff --git a/src/sdk/models/shared/api.ts b/src/sdk/models/shared/api.ts deleted file mode 100644 index 49e79d79..00000000 --- a/src/sdk/models/shared/api.ts +++ /dev/null @@ -1,117 +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"; - -/** - * An Api is representation of a API (a collection of API Endpoints) within the Speakeasy Platform. - */ -export type Api = { - /** - * The ID of this Api. This is a human-readable name (subject to change). - */ - apiId: string; - /** - * Creation timestamp. - */ - createdAt: Date; - /** - * A detailed description of the Api. - */ - description: string; - /** - * Determines if all the endpoints within the Api are found in the OpenAPI spec associated with the Api. - */ - matched?: boolean | undefined; - /** - * A set of values associated with a meta_data key. This field is only set on get requests. - */ - metaData?: { [k: string]: Array } | undefined; - /** - * Last update timestamp. - */ - updatedAt: Date; - /** - * The version ID of this Api. This is semantic version identifier. - */ - versionId: string; - /** - * The workspace ID this Api belongs to. - */ - workspaceId: string; -}; - -/** @internal */ -export const Api$inboundSchema: z.ZodType = z - .object({ - api_id: z.string(), - created_at: z.string().datetime({ offset: true }).transform(v => - new Date(v) - ), - description: z.string(), - matched: z.boolean().optional(), - meta_data: z.record(z.array(z.string())).optional(), - updated_at: z.string().datetime({ offset: true }).transform(v => - new Date(v) - ), - version_id: z.string(), - workspace_id: z.string(), - }).transform((v) => { - return remap$(v, { - "api_id": "apiId", - "created_at": "createdAt", - "meta_data": "metaData", - "updated_at": "updatedAt", - "version_id": "versionId", - "workspace_id": "workspaceId", - }); - }); - -/** @internal */ -export type Api$Outbound = { - api_id: string; - created_at: string; - description: string; - matched?: boolean | undefined; - meta_data?: { [k: string]: Array } | undefined; - updated_at: string; - version_id: string; - workspace_id: string; -}; - -/** @internal */ -export const Api$outboundSchema: z.ZodType = z - .object({ - apiId: z.string(), - createdAt: z.date().transform(v => v.toISOString()), - description: z.string(), - matched: z.boolean().optional(), - metaData: z.record(z.array(z.string())).optional(), - updatedAt: z.date().transform(v => v.toISOString()), - versionId: z.string(), - workspaceId: z.string(), - }).transform((v) => { - return remap$(v, { - apiId: "api_id", - createdAt: "created_at", - metaData: "meta_data", - updatedAt: "updated_at", - versionId: "version_id", - workspaceId: "workspace_id", - }); - }); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace Api$ { - /** @deprecated use `Api$inboundSchema` instead. */ - export const inboundSchema = Api$inboundSchema; - /** @deprecated use `Api$outboundSchema` instead. */ - export const outboundSchema = Api$outboundSchema; - /** @deprecated use `Api$Outbound` instead. */ - export type Outbound = Api$Outbound; -} diff --git a/src/sdk/models/shared/apiendpoint.ts b/src/sdk/models/shared/apiendpoint.ts deleted file mode 100644 index d0629321..00000000 --- a/src/sdk/models/shared/apiendpoint.ts +++ /dev/null @@ -1,142 +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"; - -/** - * An ApiEndpoint is a description of an Endpoint for an API. - */ -export type ApiEndpoint = { - /** - * The ID of this ApiEndpoint. This is a hash of the method and path. - */ - apiEndpointId: string; - /** - * The ID of the Api this ApiEndpoint belongs to. - */ - apiId: string; - /** - * Creation timestamp. - */ - createdAt: Date; - /** - * A detailed description of the ApiEndpoint. - */ - description: string; - /** - * A human-readable name for the ApiEndpoint. - */ - displayName: string; - /** - * Determines if the endpoint was found in the OpenAPI spec associated with the parent Api. - */ - matched?: boolean | undefined; - /** - * HTTP verb. - */ - method: string; - /** - * Path that handles this Api. - */ - path: string; - /** - * Last update timestamp. - */ - updatedAt: Date; - /** - * The version ID of the Api this ApiEndpoint belongs to. - */ - versionId: string; - /** - * The workspace ID this ApiEndpoint belongs to. - */ - workspaceId: string; -}; - -/** @internal */ -export const ApiEndpoint$inboundSchema: z.ZodType< - ApiEndpoint, - z.ZodTypeDef, - unknown -> = z.object({ - api_endpoint_id: z.string(), - api_id: z.string(), - created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), - description: z.string(), - display_name: z.string(), - matched: z.boolean().optional(), - method: z.string(), - path: z.string(), - updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), - version_id: z.string(), - workspace_id: z.string(), -}).transform((v) => { - return remap$(v, { - "api_endpoint_id": "apiEndpointId", - "api_id": "apiId", - "created_at": "createdAt", - "display_name": "displayName", - "updated_at": "updatedAt", - "version_id": "versionId", - "workspace_id": "workspaceId", - }); -}); - -/** @internal */ -export type ApiEndpoint$Outbound = { - api_endpoint_id: string; - api_id: string; - created_at: string; - description: string; - display_name: string; - matched?: boolean | undefined; - method: string; - path: string; - updated_at: string; - version_id: string; - workspace_id: string; -}; - -/** @internal */ -export const ApiEndpoint$outboundSchema: z.ZodType< - ApiEndpoint$Outbound, - z.ZodTypeDef, - ApiEndpoint -> = z.object({ - apiEndpointId: z.string(), - apiId: z.string(), - createdAt: z.date().transform(v => v.toISOString()), - description: z.string(), - displayName: z.string(), - matched: z.boolean().optional(), - method: z.string(), - path: z.string(), - updatedAt: z.date().transform(v => v.toISOString()), - versionId: z.string(), - workspaceId: z.string(), -}).transform((v) => { - return remap$(v, { - apiEndpointId: "api_endpoint_id", - apiId: "api_id", - createdAt: "created_at", - displayName: "display_name", - updatedAt: "updated_at", - versionId: "version_id", - workspaceId: "workspace_id", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace ApiEndpoint$ { - /** @deprecated use `ApiEndpoint$inboundSchema` instead. */ - export const inboundSchema = ApiEndpoint$inboundSchema; - /** @deprecated use `ApiEndpoint$outboundSchema` instead. */ - export const outboundSchema = ApiEndpoint$outboundSchema; - /** @deprecated use `ApiEndpoint$Outbound` instead. */ - export type Outbound = ApiEndpoint$Outbound; -} diff --git a/src/sdk/models/shared/apiendpointinput.ts b/src/sdk/models/shared/apiendpointinput.ts deleted file mode 100644 index 8a5b4951..00000000 --- a/src/sdk/models/shared/apiendpointinput.ts +++ /dev/null @@ -1,99 +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"; - -/** - * An ApiEndpoint is a description of an Endpoint for an API. - */ -export type ApiEndpointInput = { - /** - * The ID of this ApiEndpoint. This is a hash of the method and path. - */ - apiEndpointId: string; - /** - * A detailed description of the ApiEndpoint. - */ - description: string; - /** - * A human-readable name for the ApiEndpoint. - */ - displayName: string; - /** - * HTTP verb. - */ - method: string; - /** - * Path that handles this Api. - */ - path: string; - /** - * The version ID of the Api this ApiEndpoint belongs to. - */ - versionId: string; -}; - -/** @internal */ -export const ApiEndpointInput$inboundSchema: z.ZodType< - ApiEndpointInput, - z.ZodTypeDef, - unknown -> = z.object({ - api_endpoint_id: z.string(), - description: z.string(), - display_name: z.string(), - method: z.string(), - path: z.string(), - version_id: z.string(), -}).transform((v) => { - return remap$(v, { - "api_endpoint_id": "apiEndpointId", - "display_name": "displayName", - "version_id": "versionId", - }); -}); - -/** @internal */ -export type ApiEndpointInput$Outbound = { - api_endpoint_id: string; - description: string; - display_name: string; - method: string; - path: string; - version_id: string; -}; - -/** @internal */ -export const ApiEndpointInput$outboundSchema: z.ZodType< - ApiEndpointInput$Outbound, - z.ZodTypeDef, - ApiEndpointInput -> = z.object({ - apiEndpointId: z.string(), - description: z.string(), - displayName: z.string(), - method: z.string(), - path: z.string(), - versionId: z.string(), -}).transform((v) => { - return remap$(v, { - apiEndpointId: "api_endpoint_id", - displayName: "display_name", - versionId: "version_id", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace ApiEndpointInput$ { - /** @deprecated use `ApiEndpointInput$inboundSchema` instead. */ - export const inboundSchema = ApiEndpointInput$inboundSchema; - /** @deprecated use `ApiEndpointInput$outboundSchema` instead. */ - export const outboundSchema = ApiEndpointInput$outboundSchema; - /** @deprecated use `ApiEndpointInput$Outbound` instead. */ - export type Outbound = ApiEndpointInput$Outbound; -} diff --git a/src/sdk/models/shared/apiinput.ts b/src/sdk/models/shared/apiinput.ts deleted file mode 100644 index 74cd16bd..00000000 --- a/src/sdk/models/shared/apiinput.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"; - -/** - * An Api is representation of a API (a collection of API Endpoints) within the Speakeasy Platform. - */ -export type ApiInput = { - /** - * The ID of this Api. This is a human-readable name (subject to change). - */ - apiId: string; - /** - * A detailed description of the Api. - */ - description: string; - /** - * A set of values associated with a meta_data key. This field is only set on get requests. - */ - metaData?: { [k: string]: Array } | undefined; - /** - * The version ID of this Api. This is semantic version identifier. - */ - versionId: string; -}; - -/** @internal */ -export const ApiInput$inboundSchema: z.ZodType< - ApiInput, - z.ZodTypeDef, - unknown -> = z.object({ - api_id: z.string(), - description: z.string(), - meta_data: z.record(z.array(z.string())).optional(), - version_id: z.string(), -}).transform((v) => { - return remap$(v, { - "api_id": "apiId", - "meta_data": "metaData", - "version_id": "versionId", - }); -}); - -/** @internal */ -export type ApiInput$Outbound = { - api_id: string; - description: string; - meta_data?: { [k: string]: Array } | undefined; - version_id: string; -}; - -/** @internal */ -export const ApiInput$outboundSchema: z.ZodType< - ApiInput$Outbound, - z.ZodTypeDef, - ApiInput -> = z.object({ - apiId: z.string(), - description: z.string(), - metaData: z.record(z.array(z.string())).optional(), - versionId: z.string(), -}).transform((v) => { - return remap$(v, { - apiId: "api_id", - metaData: "meta_data", - versionId: "version_id", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace ApiInput$ { - /** @deprecated use `ApiInput$inboundSchema` instead. */ - export const inboundSchema = ApiInput$inboundSchema; - /** @deprecated use `ApiInput$outboundSchema` instead. */ - export const outboundSchema = ApiInput$outboundSchema; - /** @deprecated use `ApiInput$Outbound` instead. */ - export type Outbound = ApiInput$Outbound; -} diff --git a/src/sdk/models/shared/apikeydetails.ts b/src/sdk/models/shared/apikeydetails.ts index c224f237..2678b239 100644 --- a/src/sdk/models/shared/apikeydetails.ts +++ b/src/sdk/models/shared/apikeydetails.ts @@ -4,14 +4,23 @@ 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"; import { AccountType, AccountType$inboundSchema, AccountType$outboundSchema, } from "./accounttype.js"; +import { + BillingAddOn, + BillingAddOn$inboundSchema, + BillingAddOn$outboundSchema, +} from "./billingaddon.js"; export type ApiKeyDetails = { accountTypeV2: AccountType; + billingAddOns: Array; enabledFeatures: Array; /** * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. @@ -20,6 +29,10 @@ export type ApiKeyDetails = { generationAccessUnlimited?: boolean | undefined; orgSlug: string; telemetryDisabled: boolean; + /** + * Workspace creation timestamp. + */ + workspaceCreatedAt: Date; workspaceId: string; workspaceSlug: string; }; @@ -31,21 +44,27 @@ export const ApiKeyDetails$inboundSchema: z.ZodType< unknown > = z.object({ account_type_v2: AccountType$inboundSchema, + billing_add_ons: z.array(BillingAddOn$inboundSchema), enabled_features: z.array(z.string()), feature_flags: z.array(z.string()).optional(), generation_access_unlimited: z.boolean().optional(), org_slug: z.string(), telemetry_disabled: z.boolean(), + workspace_created_at: z.string().datetime({ offset: true }).transform(v => + new Date(v) + ), workspace_id: z.string(), workspace_slug: z.string(), }).transform((v) => { return remap$(v, { "account_type_v2": "accountTypeV2", + "billing_add_ons": "billingAddOns", "enabled_features": "enabledFeatures", "feature_flags": "featureFlags", "generation_access_unlimited": "generationAccessUnlimited", "org_slug": "orgSlug", "telemetry_disabled": "telemetryDisabled", + "workspace_created_at": "workspaceCreatedAt", "workspace_id": "workspaceId", "workspace_slug": "workspaceSlug", }); @@ -54,11 +73,13 @@ export const ApiKeyDetails$inboundSchema: z.ZodType< /** @internal */ export type ApiKeyDetails$Outbound = { account_type_v2: string; + billing_add_ons: Array; enabled_features: Array; feature_flags?: Array | undefined; generation_access_unlimited?: boolean | undefined; org_slug: string; telemetry_disabled: boolean; + workspace_created_at: string; workspace_id: string; workspace_slug: string; }; @@ -70,21 +91,25 @@ export const ApiKeyDetails$outboundSchema: z.ZodType< ApiKeyDetails > = z.object({ accountTypeV2: AccountType$outboundSchema, + billingAddOns: z.array(BillingAddOn$outboundSchema), enabledFeatures: z.array(z.string()), featureFlags: z.array(z.string()).optional(), generationAccessUnlimited: z.boolean().optional(), orgSlug: z.string(), telemetryDisabled: z.boolean(), + workspaceCreatedAt: z.date().transform(v => v.toISOString()), workspaceId: z.string(), workspaceSlug: z.string(), }).transform((v) => { return remap$(v, { accountTypeV2: "account_type_v2", + billingAddOns: "billing_add_ons", enabledFeatures: "enabled_features", featureFlags: "feature_flags", generationAccessUnlimited: "generation_access_unlimited", orgSlug: "org_slug", telemetryDisabled: "telemetry_disabled", + workspaceCreatedAt: "workspace_created_at", workspaceId: "workspace_id", workspaceSlug: "workspace_slug", }); @@ -102,3 +127,17 @@ export namespace ApiKeyDetails$ { /** @deprecated use `ApiKeyDetails$Outbound` instead. */ export type Outbound = ApiKeyDetails$Outbound; } + +export function apiKeyDetailsToJSON(apiKeyDetails: ApiKeyDetails): string { + return JSON.stringify(ApiKeyDetails$outboundSchema.parse(apiKeyDetails)); +} + +export function apiKeyDetailsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ApiKeyDetails$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ApiKeyDetails' from JSON`, + ); +} diff --git a/src/sdk/models/shared/billingaddon.ts b/src/sdk/models/shared/billingaddon.ts new file mode 100644 index 00000000..5af82de9 --- /dev/null +++ b/src/sdk/models/shared/billingaddon.ts @@ -0,0 +1,49 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { + catchUnrecognizedEnum, + OpenEnum, + Unrecognized, +} from "../../types/enums.js"; + +export const BillingAddOn = { + Webhooks: "webhooks", + SDKTesting: "sdk_testing", + CustomCodeRegions: "custom_code_regions", +} as const; +export type BillingAddOn = OpenEnum; + +/** @internal */ +export const BillingAddOn$inboundSchema: z.ZodType< + BillingAddOn, + z.ZodTypeDef, + unknown +> = z + .union([ + z.nativeEnum(BillingAddOn), + z.string().transform(catchUnrecognizedEnum), + ]); + +/** @internal */ +export const BillingAddOn$outboundSchema: z.ZodType< + BillingAddOn, + z.ZodTypeDef, + BillingAddOn +> = z.union([ + z.nativeEnum(BillingAddOn), + z.string().and(z.custom>()), +]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace BillingAddOn$ { + /** @deprecated use `BillingAddOn$inboundSchema` instead. */ + export const inboundSchema = BillingAddOn$inboundSchema; + /** @deprecated use `BillingAddOn$outboundSchema` instead. */ + export const outboundSchema = BillingAddOn$outboundSchema; +} diff --git a/src/sdk/models/shared/boundedrequest.ts b/src/sdk/models/shared/boundedrequest.ts deleted file mode 100644 index bf2af83f..00000000 --- a/src/sdk/models/shared/boundedrequest.ts +++ /dev/null @@ -1,177 +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 { - RequestMetadata, - RequestMetadata$inboundSchema, - RequestMetadata$Outbound, - RequestMetadata$outboundSchema, -} from "./requestmetadata.js"; - -/** - * A BoundedRequest is a request that has been logged by the Speakeasy without the contents of the request. - */ -export type BoundedRequest = { - /** - * The ID of the ApiEndpoint this request was made to. - */ - apiEndpointId: string; - /** - * The ID of the Api this request was made to. - */ - apiId: string; - /** - * Creation timestamp. - */ - createdAt: Date; - /** - * The ID of the customer that made this request. - */ - customerId: string; - /** - * The latency of the request. - */ - latency: number; - /** - * Metadata associated with this request - */ - metadata?: Array | undefined; - /** - * HTTP verb. - */ - method: string; - /** - * The path of the request. - */ - path: string; - /** - * The time the request finished. - */ - requestFinishTime: Date; - /** - * The ID of this request. - */ - requestId: string; - /** - * The time the request was made. - */ - requestStartTime: Date; - /** - * The status code of the request. - */ - status: number; - /** - * The version ID of the Api this request was made to. - */ - versionId: string; - /** - * The workspace ID this request was made to. - */ - workspaceId: string; -}; - -/** @internal */ -export const BoundedRequest$inboundSchema: z.ZodType< - BoundedRequest, - z.ZodTypeDef, - unknown -> = z.object({ - api_endpoint_id: z.string(), - api_id: z.string(), - created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), - customer_id: z.string(), - latency: z.number().int(), - metadata: z.array(RequestMetadata$inboundSchema).optional(), - method: z.string(), - path: z.string(), - request_finish_time: z.string().datetime({ offset: true }).transform(v => - new Date(v) - ), - request_id: z.string(), - request_start_time: z.string().datetime({ offset: true }).transform(v => - new Date(v) - ), - status: z.number().int(), - version_id: z.string(), - workspace_id: z.string(), -}).transform((v) => { - return remap$(v, { - "api_endpoint_id": "apiEndpointId", - "api_id": "apiId", - "created_at": "createdAt", - "customer_id": "customerId", - "request_finish_time": "requestFinishTime", - "request_id": "requestId", - "request_start_time": "requestStartTime", - "version_id": "versionId", - "workspace_id": "workspaceId", - }); -}); - -/** @internal */ -export type BoundedRequest$Outbound = { - api_endpoint_id: string; - api_id: string; - created_at: string; - customer_id: string; - latency: number; - metadata?: Array | undefined; - method: string; - path: string; - request_finish_time: string; - request_id: string; - request_start_time: string; - status: number; - version_id: string; - workspace_id: string; -}; - -/** @internal */ -export const BoundedRequest$outboundSchema: z.ZodType< - BoundedRequest$Outbound, - z.ZodTypeDef, - BoundedRequest -> = z.object({ - apiEndpointId: z.string(), - apiId: z.string(), - createdAt: z.date().transform(v => v.toISOString()), - customerId: z.string(), - latency: z.number().int(), - metadata: z.array(RequestMetadata$outboundSchema).optional(), - method: z.string(), - path: z.string(), - requestFinishTime: z.date().transform(v => v.toISOString()), - requestId: z.string(), - requestStartTime: z.date().transform(v => v.toISOString()), - status: z.number().int(), - versionId: z.string(), - workspaceId: z.string(), -}).transform((v) => { - return remap$(v, { - apiEndpointId: "api_endpoint_id", - apiId: "api_id", - createdAt: "created_at", - customerId: "customer_id", - requestFinishTime: "request_finish_time", - requestId: "request_id", - requestStartTime: "request_start_time", - versionId: "version_id", - workspaceId: "workspace_id", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace BoundedRequest$ { - /** @deprecated use `BoundedRequest$inboundSchema` instead. */ - export const inboundSchema = BoundedRequest$inboundSchema; - /** @deprecated use `BoundedRequest$outboundSchema` instead. */ - export const outboundSchema = BoundedRequest$outboundSchema; - /** @deprecated use `BoundedRequest$Outbound` instead. */ - export type Outbound = BoundedRequest$Outbound; -} diff --git a/src/sdk/models/shared/clievent.ts b/src/sdk/models/shared/clievent.ts index 1409acaa..67142f50 100644 --- a/src/sdk/models/shared/clievent.ts +++ b/src/sdk/models/shared/clievent.ts @@ -4,7 +4,10 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +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 { InteractionType, InteractionType$inboundSchema, @@ -143,6 +146,10 @@ export type CliEvent = { * The number of operations used in generation. */ generateNumberOfOperationsUsed?: number | undefined; + /** + * The number of terraform resources used in generation. + */ + generateNumberOfTerraformResources?: number | undefined; /** * Indicates whether tests were output. */ @@ -192,7 +199,11 @@ export type CliEvent = { */ ghActionVersion?: string | undefined; /** - * The reference to a created pull request. + * Whether or not changes were committed from generation in the Github Action. + */ + ghChangesCommitted?: boolean | undefined; + /** + * The reference to a created pull request URL. */ ghPullRequest?: string | undefined; /** @@ -339,6 +350,10 @@ export type CliEvent = { * Indicates whether the event was successful. */ success: boolean; + /** + * The raw test report xml + */ + testReportRaw?: string | undefined; /** * Workflow lock file (post execution) */ @@ -434,6 +449,7 @@ export const CliEvent$inboundSchema: z.ZodType< generate_gen_lock_pre_version: z.string().optional(), generate_number_of_operations_ignored: z.number().int().optional(), generate_number_of_operations_used: z.number().int().optional(), + generate_number_of_terraform_resources: z.number().int().optional(), generate_output_tests: z.boolean().optional(), generate_published: z.boolean().optional(), generate_repo_url: z.string().optional(), @@ -446,6 +462,7 @@ export const CliEvent$inboundSchema: z.ZodType< gh_action_repository: z.string().optional(), gh_action_run_link: z.string().optional(), gh_action_version: z.string().optional(), + gh_changes_committed: z.boolean().optional(), gh_pull_request: z.string().optional(), git_relative_cwd: z.string().optional(), git_remote_default_owner: z.string().optional(), @@ -487,6 +504,7 @@ export const CliEvent$inboundSchema: z.ZodType< speakeasy_api_key_name: z.string(), speakeasy_version: z.string(), success: z.boolean(), + test_report_raw: z.string().optional(), workflow_lock_post_raw: z.string().optional(), workflow_lock_pre_raw: z.string().optional(), workflow_post_raw: z.string().optional(), @@ -519,6 +537,8 @@ export const CliEvent$inboundSchema: z.ZodType< "generate_number_of_operations_ignored": "generateNumberOfOperationsIgnored", "generate_number_of_operations_used": "generateNumberOfOperationsUsed", + "generate_number_of_terraform_resources": + "generateNumberOfTerraformResources", "generate_output_tests": "generateOutputTests", "generate_published": "generatePublished", "generate_repo_url": "generateRepoUrl", @@ -531,6 +551,7 @@ export const CliEvent$inboundSchema: z.ZodType< "gh_action_repository": "ghActionRepository", "gh_action_run_link": "ghActionRunLink", "gh_action_version": "ghActionVersion", + "gh_changes_committed": "ghChangesCommitted", "gh_pull_request": "ghPullRequest", "git_relative_cwd": "gitRelativeCwd", "git_remote_default_owner": "gitRemoteDefaultOwner", @@ -567,6 +588,7 @@ export const CliEvent$inboundSchema: z.ZodType< "source_revision_digest": "sourceRevisionDigest", "speakeasy_api_key_name": "speakeasyApiKeyName", "speakeasy_version": "speakeasyVersion", + "test_report_raw": "testReportRaw", "workflow_lock_post_raw": "workflowLockPostRaw", "workflow_lock_pre_raw": "workflowLockPreRaw", "workflow_post_raw": "workflowPostRaw", @@ -602,6 +624,7 @@ export type CliEvent$Outbound = { generate_gen_lock_pre_version?: string | undefined; generate_number_of_operations_ignored?: number | undefined; generate_number_of_operations_used?: number | undefined; + generate_number_of_terraform_resources?: number | undefined; generate_output_tests?: boolean | undefined; generate_published?: boolean | undefined; generate_repo_url?: string | undefined; @@ -614,6 +637,7 @@ export type CliEvent$Outbound = { gh_action_repository?: string | undefined; gh_action_run_link?: string | undefined; gh_action_version?: string | undefined; + gh_changes_committed?: boolean | undefined; gh_pull_request?: string | undefined; git_relative_cwd?: string | undefined; git_remote_default_owner?: string | undefined; @@ -651,6 +675,7 @@ export type CliEvent$Outbound = { speakeasy_api_key_name: string; speakeasy_version: string; success: boolean; + test_report_raw?: string | undefined; workflow_lock_post_raw?: string | undefined; workflow_lock_pre_raw?: string | undefined; workflow_post_raw?: string | undefined; @@ -689,6 +714,7 @@ export const CliEvent$outboundSchema: z.ZodType< generateGenLockPreVersion: z.string().optional(), generateNumberOfOperationsIgnored: z.number().int().optional(), generateNumberOfOperationsUsed: z.number().int().optional(), + generateNumberOfTerraformResources: z.number().int().optional(), generateOutputTests: z.boolean().optional(), generatePublished: z.boolean().optional(), generateRepoUrl: z.string().optional(), @@ -701,6 +727,7 @@ export const CliEvent$outboundSchema: z.ZodType< ghActionRepository: z.string().optional(), ghActionRunLink: z.string().optional(), ghActionVersion: z.string().optional(), + ghChangesCommitted: z.boolean().optional(), ghPullRequest: z.string().optional(), gitRelativeCwd: z.string().optional(), gitRemoteDefaultOwner: z.string().optional(), @@ -738,6 +765,7 @@ export const CliEvent$outboundSchema: z.ZodType< speakeasyApiKeyName: z.string(), speakeasyVersion: z.string(), success: z.boolean(), + testReportRaw: z.string().optional(), workflowLockPostRaw: z.string().optional(), workflowLockPreRaw: z.string().optional(), workflowPostRaw: z.string().optional(), @@ -769,6 +797,8 @@ export const CliEvent$outboundSchema: z.ZodType< generateGenLockPreVersion: "generate_gen_lock_pre_version", generateNumberOfOperationsIgnored: "generate_number_of_operations_ignored", generateNumberOfOperationsUsed: "generate_number_of_operations_used", + generateNumberOfTerraformResources: + "generate_number_of_terraform_resources", generateOutputTests: "generate_output_tests", generatePublished: "generate_published", generateRepoUrl: "generate_repo_url", @@ -781,6 +811,7 @@ export const CliEvent$outboundSchema: z.ZodType< ghActionRepository: "gh_action_repository", ghActionRunLink: "gh_action_run_link", ghActionVersion: "gh_action_version", + ghChangesCommitted: "gh_changes_committed", ghPullRequest: "gh_pull_request", gitRelativeCwd: "git_relative_cwd", gitRemoteDefaultOwner: "git_remote_default_owner", @@ -817,6 +848,7 @@ export const CliEvent$outboundSchema: z.ZodType< sourceRevisionDigest: "source_revision_digest", speakeasyApiKeyName: "speakeasy_api_key_name", speakeasyVersion: "speakeasy_version", + testReportRaw: "test_report_raw", workflowLockPostRaw: "workflow_lock_post_raw", workflowLockPreRaw: "workflow_lock_pre_raw", workflowPostRaw: "workflow_post_raw", @@ -837,3 +869,17 @@ export namespace CliEvent$ { /** @deprecated use `CliEvent$Outbound` instead. */ export type Outbound = CliEvent$Outbound; } + +export function cliEventToJSON(cliEvent: CliEvent): string { + return JSON.stringify(CliEvent$outboundSchema.parse(cliEvent)); +} + +export function cliEventFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CliEvent$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CliEvent' from JSON`, + ); +} diff --git a/src/sdk/models/shared/codesampleschemainput.ts b/src/sdk/models/shared/codesampleschemainput.ts new file mode 100644 index 00000000..391c77de --- /dev/null +++ b/src/sdk/models/shared/codesampleschemainput.ts @@ -0,0 +1,181 @@ +/* + * 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 { blobLikeSchema } from "../../types/blobs.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type SchemaFile = { + content: ReadableStream | Blob | ArrayBuffer | Uint8Array; + fileName: string; +}; + +export type CodeSampleSchemaInput = { + /** + * The language to generate code samples for + */ + language: string; + /** + * A list of operations IDs to generate code samples for + */ + operationIds?: Array | undefined; + /** + * The name of the package + */ + packageName?: string | undefined; + /** + * The OpenAPI file to be uploaded + */ + schemaFile: SchemaFile | Blob; + /** + * The SDK class name + */ + sdkClassName?: string | undefined; +}; + +/** @internal */ +export const SchemaFile$inboundSchema: z.ZodType< + SchemaFile, + z.ZodTypeDef, + unknown +> = z.object({ + content: z.union([ + z.instanceof(ReadableStream), + z.instanceof(Blob), + z.instanceof(ArrayBuffer), + z.instanceof(Uint8Array), + ]), + fileName: z.string(), +}); + +/** @internal */ +export type SchemaFile$Outbound = { + content: ReadableStream | Blob | ArrayBuffer | Uint8Array; + fileName: string; +}; + +/** @internal */ +export const SchemaFile$outboundSchema: z.ZodType< + SchemaFile$Outbound, + z.ZodTypeDef, + SchemaFile +> = z.object({ + content: z.union([ + z.instanceof(ReadableStream), + z.instanceof(Blob), + z.instanceof(ArrayBuffer), + z.instanceof(Uint8Array), + ]), + fileName: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SchemaFile$ { + /** @deprecated use `SchemaFile$inboundSchema` instead. */ + export const inboundSchema = SchemaFile$inboundSchema; + /** @deprecated use `SchemaFile$outboundSchema` instead. */ + export const outboundSchema = SchemaFile$outboundSchema; + /** @deprecated use `SchemaFile$Outbound` instead. */ + export type Outbound = SchemaFile$Outbound; +} + +export function schemaFileToJSON(schemaFile: SchemaFile): string { + return JSON.stringify(SchemaFile$outboundSchema.parse(schemaFile)); +} + +export function schemaFileFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => SchemaFile$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'SchemaFile' from JSON`, + ); +} + +/** @internal */ +export const CodeSampleSchemaInput$inboundSchema: z.ZodType< + CodeSampleSchemaInput, + z.ZodTypeDef, + unknown +> = z.object({ + language: z.string(), + operation_ids: z.array(z.string()).optional(), + package_name: z.string().optional(), + schema_file: z.lazy(() => SchemaFile$inboundSchema), + sdk_class_name: z.string().optional(), +}).transform((v) => { + return remap$(v, { + "operation_ids": "operationIds", + "package_name": "packageName", + "schema_file": "schemaFile", + "sdk_class_name": "sdkClassName", + }); +}); + +/** @internal */ +export type CodeSampleSchemaInput$Outbound = { + language: string; + operation_ids?: Array | undefined; + package_name?: string | undefined; + schema_file: SchemaFile$Outbound | Blob; + sdk_class_name?: string | undefined; +}; + +/** @internal */ +export const CodeSampleSchemaInput$outboundSchema: z.ZodType< + CodeSampleSchemaInput$Outbound, + z.ZodTypeDef, + CodeSampleSchemaInput +> = z.object({ + language: z.string(), + operationIds: z.array(z.string()).optional(), + packageName: z.string().optional(), + schemaFile: z.lazy(() => SchemaFile$outboundSchema).or(blobLikeSchema), + sdkClassName: z.string().optional(), +}).transform((v) => { + return remap$(v, { + operationIds: "operation_ids", + packageName: "package_name", + schemaFile: "schema_file", + sdkClassName: "sdk_class_name", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CodeSampleSchemaInput$ { + /** @deprecated use `CodeSampleSchemaInput$inboundSchema` instead. */ + export const inboundSchema = CodeSampleSchemaInput$inboundSchema; + /** @deprecated use `CodeSampleSchemaInput$outboundSchema` instead. */ + export const outboundSchema = CodeSampleSchemaInput$outboundSchema; + /** @deprecated use `CodeSampleSchemaInput$Outbound` instead. */ + export type Outbound = CodeSampleSchemaInput$Outbound; +} + +export function codeSampleSchemaInputToJSON( + codeSampleSchemaInput: CodeSampleSchemaInput, +): string { + return JSON.stringify( + CodeSampleSchemaInput$outboundSchema.parse(codeSampleSchemaInput), + ); +} + +export function codeSampleSchemaInputFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CodeSampleSchemaInput$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CodeSampleSchemaInput' from JSON`, + ); +} diff --git a/src/sdk/models/shared/codesamplesjobstatus.ts b/src/sdk/models/shared/codesamplesjobstatus.ts new file mode 100644 index 00000000..b05f6bc2 --- /dev/null +++ b/src/sdk/models/shared/codesamplesjobstatus.ts @@ -0,0 +1,39 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { ClosedEnum } from "../../types/enums.js"; + +/** + * The current status of the job. Possible values are `pending` or `running`. + */ +export const CodeSamplesJobStatus = { + Pending: "pending", + Running: "running", +} as const; +/** + * The current status of the job. Possible values are `pending` or `running`. + */ +export type CodeSamplesJobStatus = ClosedEnum; + +/** @internal */ +export const CodeSamplesJobStatus$inboundSchema: z.ZodNativeEnum< + typeof CodeSamplesJobStatus +> = z.nativeEnum(CodeSamplesJobStatus); + +/** @internal */ +export const CodeSamplesJobStatus$outboundSchema: z.ZodNativeEnum< + typeof CodeSamplesJobStatus +> = CodeSamplesJobStatus$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CodeSamplesJobStatus$ { + /** @deprecated use `CodeSamplesJobStatus$inboundSchema` instead. */ + export const inboundSchema = CodeSamplesJobStatus$inboundSchema; + /** @deprecated use `CodeSamplesJobStatus$outboundSchema` instead. */ + export const outboundSchema = CodeSamplesJobStatus$outboundSchema; +} diff --git a/src/sdk/models/shared/diagnostic.ts b/src/sdk/models/shared/diagnostic.ts index 7dabff2d..9a6df620 100644 --- a/src/sdk/models/shared/diagnostic.ts +++ b/src/sdk/models/shared/diagnostic.ts @@ -3,6 +3,9 @@ */ 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 Diagnostic = { /** @@ -67,3 +70,17 @@ export namespace Diagnostic$ { /** @deprecated use `Diagnostic$Outbound` instead. */ export type Outbound = Diagnostic$Outbound; } + +export function diagnosticToJSON(diagnostic: Diagnostic): string { + return JSON.stringify(Diagnostic$outboundSchema.parse(diagnostic)); +} + +export function diagnosticFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Diagnostic$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Diagnostic' from JSON`, + ); +} diff --git a/src/sdk/models/shared/embedaccesstokenresponse.ts b/src/sdk/models/shared/embedaccesstokenresponse.ts deleted file mode 100644 index a85d6d12..00000000 --- a/src/sdk/models/shared/embedaccesstokenresponse.ts +++ /dev/null @@ -1,57 +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"; - -/** - * An EmbedAccessTokenResponse contains a token that can be used to embed a Speakeasy dashboard. - */ -export type EmbedAccessTokenResponse = { - accessToken: string; -}; - -/** @internal */ -export const EmbedAccessTokenResponse$inboundSchema: z.ZodType< - EmbedAccessTokenResponse, - z.ZodTypeDef, - unknown -> = z.object({ - access_token: z.string(), -}).transform((v) => { - return remap$(v, { - "access_token": "accessToken", - }); -}); - -/** @internal */ -export type EmbedAccessTokenResponse$Outbound = { - access_token: string; -}; - -/** @internal */ -export const EmbedAccessTokenResponse$outboundSchema: z.ZodType< - EmbedAccessTokenResponse$Outbound, - z.ZodTypeDef, - EmbedAccessTokenResponse -> = z.object({ - accessToken: z.string(), -}).transform((v) => { - return remap$(v, { - accessToken: "access_token", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace EmbedAccessTokenResponse$ { - /** @deprecated use `EmbedAccessTokenResponse$inboundSchema` instead. */ - export const inboundSchema = EmbedAccessTokenResponse$inboundSchema; - /** @deprecated use `EmbedAccessTokenResponse$outboundSchema` instead. */ - export const outboundSchema = EmbedAccessTokenResponse$outboundSchema; - /** @deprecated use `EmbedAccessTokenResponse$Outbound` instead. */ - export type Outbound = EmbedAccessTokenResponse$Outbound; -} diff --git a/src/sdk/models/shared/embedtoken.ts b/src/sdk/models/shared/embedtoken.ts deleted file mode 100644 index 1c5b4bd4..00000000 --- a/src/sdk/models/shared/embedtoken.ts +++ /dev/null @@ -1,137 +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"; - -/** - * A representation of an embed token granted for working with Speakeasy components. - */ -export type EmbedToken = { - /** - * Creation timestamp. - */ - createdAt: Date; - /** - * The ID of the user that created this token. - */ - createdBy: string; - /** - * A detailed description of the EmbedToken. - */ - description: string; - /** - * The time this token expires. - */ - expiresAt: Date; - /** - * The filters applied to this token. - */ - filters: string; - /** - * The ID of this EmbedToken. - */ - id: string; - /** - * The last time this token was used. - */ - lastUsed?: Date | undefined; - /** - * The time this token was revoked. - */ - revokedAt?: Date | undefined; - /** - * The ID of the user that revoked this token. - */ - revokedBy?: string | undefined; - /** - * The workspace ID this token belongs to. - */ - workspaceId: string; -}; - -/** @internal */ -export const EmbedToken$inboundSchema: z.ZodType< - EmbedToken, - z.ZodTypeDef, - unknown -> = z.object({ - created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), - created_by: z.string(), - description: z.string(), - expires_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), - filters: z.string(), - id: z.string(), - last_used: z.string().datetime({ offset: true }).transform(v => new Date(v)) - .optional(), - revoked_at: z.string().datetime({ offset: true }).transform(v => new Date(v)) - .optional(), - revoked_by: z.string().optional(), - workspace_id: z.string(), -}).transform((v) => { - return remap$(v, { - "created_at": "createdAt", - "created_by": "createdBy", - "expires_at": "expiresAt", - "last_used": "lastUsed", - "revoked_at": "revokedAt", - "revoked_by": "revokedBy", - "workspace_id": "workspaceId", - }); -}); - -/** @internal */ -export type EmbedToken$Outbound = { - created_at: string; - created_by: string; - description: string; - expires_at: string; - filters: string; - id: string; - last_used?: string | undefined; - revoked_at?: string | undefined; - revoked_by?: string | undefined; - workspace_id: string; -}; - -/** @internal */ -export const EmbedToken$outboundSchema: z.ZodType< - EmbedToken$Outbound, - z.ZodTypeDef, - EmbedToken -> = z.object({ - createdAt: z.date().transform(v => v.toISOString()), - createdBy: z.string(), - description: z.string(), - expiresAt: z.date().transform(v => v.toISOString()), - filters: z.string(), - id: z.string(), - lastUsed: z.date().transform(v => v.toISOString()).optional(), - revokedAt: z.date().transform(v => v.toISOString()).optional(), - revokedBy: z.string().optional(), - workspaceId: z.string(), -}).transform((v) => { - return remap$(v, { - createdAt: "created_at", - createdBy: "created_by", - expiresAt: "expires_at", - lastUsed: "last_used", - revokedAt: "revoked_at", - revokedBy: "revoked_by", - workspaceId: "workspace_id", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace EmbedToken$ { - /** @deprecated use `EmbedToken$inboundSchema` instead. */ - export const inboundSchema = EmbedToken$inboundSchema; - /** @deprecated use `EmbedToken$outboundSchema` instead. */ - export const outboundSchema = EmbedToken$outboundSchema; - /** @deprecated use `EmbedToken$Outbound` instead. */ - export type Outbound = EmbedToken$Outbound; -} diff --git a/src/sdk/models/shared/error.ts b/src/sdk/models/shared/error.ts index 89f6ee8c..856b1038 100644 --- a/src/sdk/models/shared/error.ts +++ b/src/sdk/models/shared/error.ts @@ -4,6 +4,9 @@ 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"; /** * The `Status` type defines a logical error model @@ -62,3 +65,17 @@ export namespace ErrorT$ { /** @deprecated use `ErrorT$Outbound` instead. */ export type Outbound = ErrorT$Outbound; } + +export function errorToJSON(errorT: ErrorT): string { + return JSON.stringify(ErrorT$outboundSchema.parse(errorT)); +} + +export function errorFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ErrorT$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ErrorT' from JSON`, + ); +} diff --git a/src/sdk/models/shared/featureflag.ts b/src/sdk/models/shared/featureflag.ts index e4b8589c..4a2b900f 100644 --- a/src/sdk/models/shared/featureflag.ts +++ b/src/sdk/models/shared/featureflag.ts @@ -4,12 +4,23 @@ 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"; +import { + WorkspaceFeatureFlag, + WorkspaceFeatureFlag$inboundSchema, + WorkspaceFeatureFlag$outboundSchema, +} from "./workspacefeatureflag.js"; /** * A feature flag is a key-value pair that can be used to enable or disable features. */ export type FeatureFlag = { - featureFlag: string; + /** + * enum value workspace feature flag + */ + featureFlag: WorkspaceFeatureFlag; trialEndsAt?: Date | null | undefined; }; @@ -19,7 +30,7 @@ export const FeatureFlag$inboundSchema: z.ZodType< z.ZodTypeDef, unknown > = z.object({ - feature_flag: z.string(), + feature_flag: WorkspaceFeatureFlag$inboundSchema, trial_ends_at: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ).optional(), @@ -42,7 +53,7 @@ export const FeatureFlag$outboundSchema: z.ZodType< z.ZodTypeDef, FeatureFlag > = z.object({ - featureFlag: z.string(), + featureFlag: WorkspaceFeatureFlag$outboundSchema, trialEndsAt: z.nullable(z.date().transform(v => v.toISOString())).optional(), }).transform((v) => { return remap$(v, { @@ -63,3 +74,17 @@ export namespace FeatureFlag$ { /** @deprecated use `FeatureFlag$Outbound` instead. */ export type Outbound = FeatureFlag$Outbound; } + +export function featureFlagToJSON(featureFlag: FeatureFlag): string { + return JSON.stringify(FeatureFlag$outboundSchema.parse(featureFlag)); +} + +export function featureFlagFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => FeatureFlag$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'FeatureFlag' from JSON`, + ); +} diff --git a/src/sdk/models/shared/filter.ts b/src/sdk/models/shared/filter.ts deleted file mode 100644 index de4b8d42..00000000 --- a/src/sdk/models/shared/filter.ts +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; - -/** - * A filter is a key-value pair that can be used to filter a list of requests. - */ -export type Filter = { - /** - * The key of the filter. - */ - key: string; - /** - * The operator of the filter. - */ - operator: string; - /** - * The value of the filter. - */ - value: string; -}; - -/** @internal */ -export const Filter$inboundSchema: z.ZodType = z - .object({ - key: z.string(), - operator: z.string(), - value: z.string(), - }); - -/** @internal */ -export type Filter$Outbound = { - key: string; - operator: string; - value: string; -}; - -/** @internal */ -export const Filter$outboundSchema: z.ZodType< - Filter$Outbound, - z.ZodTypeDef, - Filter -> = z.object({ - key: z.string(), - operator: z.string(), - value: 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 Filter$ { - /** @deprecated use `Filter$inboundSchema` instead. */ - export const inboundSchema = Filter$inboundSchema; - /** @deprecated use `Filter$outboundSchema` instead. */ - export const outboundSchema = Filter$outboundSchema; - /** @deprecated use `Filter$Outbound` instead. */ - export type Outbound = Filter$Outbound; -} diff --git a/src/sdk/models/shared/filters.ts b/src/sdk/models/shared/filters.ts deleted file mode 100644 index d913b2cd..00000000 --- a/src/sdk/models/shared/filters.ts +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; -import { - Filter, - Filter$inboundSchema, - Filter$Outbound, - Filter$outboundSchema, -} from "./filter.js"; - -/** - * Filters are used to query requests. - */ -export type Filters = { - /** - * A list of filters to apply to the query. - */ - filters: Array; - /** - * The maximum number of results to return. - */ - limit: number; - /** - * The offset to start the query from. - */ - offset: number; - /** - * The operator to use when combining filters. - */ - operator: string; -}; - -/** @internal */ -export const Filters$inboundSchema: z.ZodType = - z.object({ - filters: z.array(Filter$inboundSchema), - limit: z.number().int(), - offset: z.number().int(), - operator: z.string(), - }); - -/** @internal */ -export type Filters$Outbound = { - filters: Array; - limit: number; - offset: number; - operator: string; -}; - -/** @internal */ -export const Filters$outboundSchema: z.ZodType< - Filters$Outbound, - z.ZodTypeDef, - Filters -> = z.object({ - filters: z.array(Filter$outboundSchema), - limit: z.number().int(), - offset: z.number().int(), - operator: 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 Filters$ { - /** @deprecated use `Filters$inboundSchema` instead. */ - export const inboundSchema = Filters$inboundSchema; - /** @deprecated use `Filters$outboundSchema` instead. */ - export const outboundSchema = Filters$outboundSchema; - /** @deprecated use `Filters$Outbound` instead. */ - export type Outbound = Filters$Outbound; -} diff --git a/src/sdk/models/shared/generateopenapispecdiff.ts b/src/sdk/models/shared/generateopenapispecdiff.ts deleted file mode 100644 index b7e65c13..00000000 --- a/src/sdk/models/shared/generateopenapispecdiff.ts +++ /dev/null @@ -1,60 +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"; - -export type GenerateOpenApiSpecDiff = { - currentSchema: string; - newSchema: string; -}; - -/** @internal */ -export const GenerateOpenApiSpecDiff$inboundSchema: z.ZodType< - GenerateOpenApiSpecDiff, - z.ZodTypeDef, - unknown -> = z.object({ - current_schema: z.string(), - new_schema: z.string(), -}).transform((v) => { - return remap$(v, { - "current_schema": "currentSchema", - "new_schema": "newSchema", - }); -}); - -/** @internal */ -export type GenerateOpenApiSpecDiff$Outbound = { - current_schema: string; - new_schema: string; -}; - -/** @internal */ -export const GenerateOpenApiSpecDiff$outboundSchema: z.ZodType< - GenerateOpenApiSpecDiff$Outbound, - z.ZodTypeDef, - GenerateOpenApiSpecDiff -> = z.object({ - currentSchema: z.string(), - newSchema: z.string(), -}).transform((v) => { - return remap$(v, { - currentSchema: "current_schema", - newSchema: "new_schema", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GenerateOpenApiSpecDiff$ { - /** @deprecated use `GenerateOpenApiSpecDiff$inboundSchema` instead. */ - export const inboundSchema = GenerateOpenApiSpecDiff$inboundSchema; - /** @deprecated use `GenerateOpenApiSpecDiff$outboundSchema` instead. */ - export const outboundSchema = GenerateOpenApiSpecDiff$outboundSchema; - /** @deprecated use `GenerateOpenApiSpecDiff$Outbound` instead. */ - export type Outbound = GenerateOpenApiSpecDiff$Outbound; -} diff --git a/src/sdk/models/shared/getnamespacesresponse.ts b/src/sdk/models/shared/getnamespacesresponse.ts index 13791f15..c4914718 100644 --- a/src/sdk/models/shared/getnamespacesresponse.ts +++ b/src/sdk/models/shared/getnamespacesresponse.ts @@ -3,6 +3,9 @@ */ 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 { Namespace, Namespace$inboundSchema, @@ -49,3 +52,21 @@ export namespace GetNamespacesResponse$ { /** @deprecated use `GetNamespacesResponse$Outbound` instead. */ export type Outbound = GetNamespacesResponse$Outbound; } + +export function getNamespacesResponseToJSON( + getNamespacesResponse: GetNamespacesResponse, +): string { + return JSON.stringify( + GetNamespacesResponse$outboundSchema.parse(getNamespacesResponse), + ); +} + +export function getNamespacesResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetNamespacesResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetNamespacesResponse' from JSON`, + ); +} diff --git a/src/sdk/models/shared/getrevisionsresponse.ts b/src/sdk/models/shared/getrevisionsresponse.ts index df211e79..af83c576 100644 --- a/src/sdk/models/shared/getrevisionsresponse.ts +++ b/src/sdk/models/shared/getrevisionsresponse.ts @@ -4,6 +4,9 @@ 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"; import { Revision, Revision$inboundSchema, @@ -62,3 +65,21 @@ export namespace GetRevisionsResponse$ { /** @deprecated use `GetRevisionsResponse$Outbound` instead. */ export type Outbound = GetRevisionsResponse$Outbound; } + +export function getRevisionsResponseToJSON( + getRevisionsResponse: GetRevisionsResponse, +): string { + return JSON.stringify( + GetRevisionsResponse$outboundSchema.parse(getRevisionsResponse), + ); +} + +export function getRevisionsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetRevisionsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRevisionsResponse' from JSON`, + ); +} diff --git a/src/sdk/models/shared/gettagsresponse.ts b/src/sdk/models/shared/gettagsresponse.ts index 2d094220..131749c8 100644 --- a/src/sdk/models/shared/gettagsresponse.ts +++ b/src/sdk/models/shared/gettagsresponse.ts @@ -3,6 +3,9 @@ */ 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 { Tag, Tag$inboundSchema, @@ -49,3 +52,19 @@ export namespace GetTagsResponse$ { /** @deprecated use `GetTagsResponse$Outbound` instead. */ export type Outbound = GetTagsResponse$Outbound; } + +export function getTagsResponseToJSON( + getTagsResponse: GetTagsResponse, +): string { + return JSON.stringify(GetTagsResponse$outboundSchema.parse(getTagsResponse)); +} + +export function getTagsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTagsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTagsResponse' from JSON`, + ); +} diff --git a/src/sdk/models/shared/githubconfigurecodesamplesrequest.ts b/src/sdk/models/shared/githubconfigurecodesamplesrequest.ts index 8bfa63e6..f3893afc 100644 --- a/src/sdk/models/shared/githubconfigurecodesamplesrequest.ts +++ b/src/sdk/models/shared/githubconfigurecodesamplesrequest.ts @@ -3,6 +3,9 @@ */ 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"; /** * A request to configure GitHub code samples @@ -64,3 +67,23 @@ export namespace GithubConfigureCodeSamplesRequest$ { /** @deprecated use `GithubConfigureCodeSamplesRequest$Outbound` instead. */ export type Outbound = GithubConfigureCodeSamplesRequest$Outbound; } + +export function githubConfigureCodeSamplesRequestToJSON( + githubConfigureCodeSamplesRequest: GithubConfigureCodeSamplesRequest, +): string { + return JSON.stringify( + GithubConfigureCodeSamplesRequest$outboundSchema.parse( + githubConfigureCodeSamplesRequest, + ), + ); +} + +export function githubConfigureCodeSamplesRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GithubConfigureCodeSamplesRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GithubConfigureCodeSamplesRequest' from JSON`, + ); +} diff --git a/src/sdk/models/shared/githubconfigurecodesamplesresponse.ts b/src/sdk/models/shared/githubconfigurecodesamplesresponse.ts index 32245a3f..34ffe223 100644 --- a/src/sdk/models/shared/githubconfigurecodesamplesresponse.ts +++ b/src/sdk/models/shared/githubconfigurecodesamplesresponse.ts @@ -3,6 +3,9 @@ */ 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 { WorkflowDocument, WorkflowDocument$inboundSchema, @@ -70,3 +73,24 @@ export namespace GithubConfigureCodeSamplesResponse$ { /** @deprecated use `GithubConfigureCodeSamplesResponse$Outbound` instead. */ export type Outbound = GithubConfigureCodeSamplesResponse$Outbound; } + +export function githubConfigureCodeSamplesResponseToJSON( + githubConfigureCodeSamplesResponse: GithubConfigureCodeSamplesResponse, +): string { + return JSON.stringify( + GithubConfigureCodeSamplesResponse$outboundSchema.parse( + githubConfigureCodeSamplesResponse, + ), + ); +} + +export function githubConfigureCodeSamplesResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GithubConfigureCodeSamplesResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GithubConfigureCodeSamplesResponse' from JSON`, + ); +} diff --git a/src/sdk/models/shared/githubconfiguremintlifyreporequest.ts b/src/sdk/models/shared/githubconfiguremintlifyreporequest.ts index ec04994f..8bd0e5f4 100644 --- a/src/sdk/models/shared/githubconfiguremintlifyreporequest.ts +++ b/src/sdk/models/shared/githubconfiguremintlifyreporequest.ts @@ -3,6 +3,9 @@ */ 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"; /** * A request to configure a GitHub repository for mintlify @@ -78,3 +81,24 @@ export namespace GithubConfigureMintlifyRepoRequest$ { /** @deprecated use `GithubConfigureMintlifyRepoRequest$Outbound` instead. */ export type Outbound = GithubConfigureMintlifyRepoRequest$Outbound; } + +export function githubConfigureMintlifyRepoRequestToJSON( + githubConfigureMintlifyRepoRequest: GithubConfigureMintlifyRepoRequest, +): string { + return JSON.stringify( + GithubConfigureMintlifyRepoRequest$outboundSchema.parse( + githubConfigureMintlifyRepoRequest, + ), + ); +} + +export function githubConfigureMintlifyRepoRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GithubConfigureMintlifyRepoRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GithubConfigureMintlifyRepoRequest' from JSON`, + ); +} diff --git a/src/sdk/models/shared/githubconfiguretargetrequest.ts b/src/sdk/models/shared/githubconfiguretargetrequest.ts index 69ff2298..3662efc0 100644 --- a/src/sdk/models/shared/githubconfiguretargetrequest.ts +++ b/src/sdk/models/shared/githubconfiguretargetrequest.ts @@ -4,6 +4,9 @@ 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"; /** * A request to configure a GitHub target @@ -65,3 +68,23 @@ export namespace GithubConfigureTargetRequest$ { /** @deprecated use `GithubConfigureTargetRequest$Outbound` instead. */ export type Outbound = GithubConfigureTargetRequest$Outbound; } + +export function githubConfigureTargetRequestToJSON( + githubConfigureTargetRequest: GithubConfigureTargetRequest, +): string { + return JSON.stringify( + GithubConfigureTargetRequest$outboundSchema.parse( + githubConfigureTargetRequest, + ), + ); +} + +export function githubConfigureTargetRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GithubConfigureTargetRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GithubConfigureTargetRequest' from JSON`, + ); +} diff --git a/src/sdk/models/shared/githubgetactionresponse.ts b/src/sdk/models/shared/githubgetactionresponse.ts index 09d8b4a6..85664e04 100644 --- a/src/sdk/models/shared/githubgetactionresponse.ts +++ b/src/sdk/models/shared/githubgetactionresponse.ts @@ -4,6 +4,9 @@ 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"; /** * response to a getting the latest action run on a GitHub request @@ -67,3 +70,21 @@ export namespace GithubGetActionResponse$ { /** @deprecated use `GithubGetActionResponse$Outbound` instead. */ export type Outbound = GithubGetActionResponse$Outbound; } + +export function githubGetActionResponseToJSON( + githubGetActionResponse: GithubGetActionResponse, +): string { + return JSON.stringify( + GithubGetActionResponse$outboundSchema.parse(githubGetActionResponse), + ); +} + +export function githubGetActionResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GithubGetActionResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GithubGetActionResponse' from JSON`, + ); +} diff --git a/src/sdk/models/shared/githubmissingpublishingsecretsresponse.ts b/src/sdk/models/shared/githubmissingpublishingsecretsresponse.ts index 82afd7b7..11556156 100644 --- a/src/sdk/models/shared/githubmissingpublishingsecretsresponse.ts +++ b/src/sdk/models/shared/githubmissingpublishingsecretsresponse.ts @@ -4,6 +4,9 @@ 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"; /** * A valid response containing MISSING publishing secret keys for a github target @@ -57,3 +60,25 @@ export namespace GithubMissingPublishingSecretsResponse$ { /** @deprecated use `GithubMissingPublishingSecretsResponse$Outbound` instead. */ export type Outbound = GithubMissingPublishingSecretsResponse$Outbound; } + +export function githubMissingPublishingSecretsResponseToJSON( + githubMissingPublishingSecretsResponse: + GithubMissingPublishingSecretsResponse, +): string { + return JSON.stringify( + GithubMissingPublishingSecretsResponse$outboundSchema.parse( + githubMissingPublishingSecretsResponse, + ), + ); +} + +export function githubMissingPublishingSecretsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GithubMissingPublishingSecretsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GithubMissingPublishingSecretsResponse' from JSON`, + ); +} diff --git a/src/sdk/models/shared/githubpublishingprresponse.ts b/src/sdk/models/shared/githubpublishingprresponse.ts index c52096b6..3c8b4ddc 100644 --- a/src/sdk/models/shared/githubpublishingprresponse.ts +++ b/src/sdk/models/shared/githubpublishingprresponse.ts @@ -4,34 +4,164 @@ 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"; + +/** + * This can only be populated when the github app is installed for a repo + */ +export type PullRequestMetadata = { + baseBranch?: string | undefined; + canMerge?: boolean | undefined; + createdAt?: Date | undefined; + /** + * truncated to first 1000 characters + */ + description?: string | undefined; + headBranch?: string | undefined; + /** + * List of github labels + */ + labels?: Array | undefined; + /** + * List of github handles + */ + requestedReviewers?: Array | undefined; + status?: string | undefined; + title?: string | undefined; +}; /** * Open generation PRs pending publishing */ export type GithubPublishingPRResponse = { - generationPullRequest?: string | undefined; pendingVersion?: string | undefined; + pullRequest?: string | undefined; + /** + * This can only be populated when the github app is installed for a repo + */ + pullRequestMetadata?: PullRequestMetadata | undefined; }; +/** @internal */ +export const PullRequestMetadata$inboundSchema: z.ZodType< + PullRequestMetadata, + z.ZodTypeDef, + unknown +> = z.object({ + base_branch: z.string().optional(), + can_merge: z.boolean().optional(), + created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)) + .optional(), + description: z.string().optional(), + head_branch: z.string().optional(), + labels: z.array(z.string()).optional(), + requested_reviewers: z.array(z.string()).optional(), + status: z.string().optional(), + title: z.string().optional(), +}).transform((v) => { + return remap$(v, { + "base_branch": "baseBranch", + "can_merge": "canMerge", + "created_at": "createdAt", + "head_branch": "headBranch", + "requested_reviewers": "requestedReviewers", + }); +}); + +/** @internal */ +export type PullRequestMetadata$Outbound = { + base_branch?: string | undefined; + can_merge?: boolean | undefined; + created_at?: string | undefined; + description?: string | undefined; + head_branch?: string | undefined; + labels?: Array | undefined; + requested_reviewers?: Array | undefined; + status?: string | undefined; + title?: string | undefined; +}; + +/** @internal */ +export const PullRequestMetadata$outboundSchema: z.ZodType< + PullRequestMetadata$Outbound, + z.ZodTypeDef, + PullRequestMetadata +> = z.object({ + baseBranch: z.string().optional(), + canMerge: z.boolean().optional(), + createdAt: z.date().transform(v => v.toISOString()).optional(), + description: z.string().optional(), + headBranch: z.string().optional(), + labels: z.array(z.string()).optional(), + requestedReviewers: z.array(z.string()).optional(), + status: z.string().optional(), + title: z.string().optional(), +}).transform((v) => { + return remap$(v, { + baseBranch: "base_branch", + canMerge: "can_merge", + createdAt: "created_at", + headBranch: "head_branch", + requestedReviewers: "requested_reviewers", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PullRequestMetadata$ { + /** @deprecated use `PullRequestMetadata$inboundSchema` instead. */ + export const inboundSchema = PullRequestMetadata$inboundSchema; + /** @deprecated use `PullRequestMetadata$outboundSchema` instead. */ + export const outboundSchema = PullRequestMetadata$outboundSchema; + /** @deprecated use `PullRequestMetadata$Outbound` instead. */ + export type Outbound = PullRequestMetadata$Outbound; +} + +export function pullRequestMetadataToJSON( + pullRequestMetadata: PullRequestMetadata, +): string { + return JSON.stringify( + PullRequestMetadata$outboundSchema.parse(pullRequestMetadata), + ); +} + +export function pullRequestMetadataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PullRequestMetadata$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PullRequestMetadata' from JSON`, + ); +} + /** @internal */ export const GithubPublishingPRResponse$inboundSchema: z.ZodType< GithubPublishingPRResponse, z.ZodTypeDef, unknown > = z.object({ - generation_pull_request: z.string().optional(), pending_version: z.string().optional(), + pull_request: z.string().optional(), + pull_request_metadata: z.lazy(() => PullRequestMetadata$inboundSchema) + .optional(), }).transform((v) => { return remap$(v, { - "generation_pull_request": "generationPullRequest", "pending_version": "pendingVersion", + "pull_request": "pullRequest", + "pull_request_metadata": "pullRequestMetadata", }); }); /** @internal */ export type GithubPublishingPRResponse$Outbound = { - generation_pull_request?: string | undefined; pending_version?: string | undefined; + pull_request?: string | undefined; + pull_request_metadata?: PullRequestMetadata$Outbound | undefined; }; /** @internal */ @@ -40,12 +170,15 @@ export const GithubPublishingPRResponse$outboundSchema: z.ZodType< z.ZodTypeDef, GithubPublishingPRResponse > = z.object({ - generationPullRequest: z.string().optional(), pendingVersion: z.string().optional(), + pullRequest: z.string().optional(), + pullRequestMetadata: z.lazy(() => PullRequestMetadata$outboundSchema) + .optional(), }).transform((v) => { return remap$(v, { - generationPullRequest: "generation_pull_request", pendingVersion: "pending_version", + pullRequest: "pull_request", + pullRequestMetadata: "pull_request_metadata", }); }); @@ -61,3 +194,21 @@ export namespace GithubPublishingPRResponse$ { /** @deprecated use `GithubPublishingPRResponse$Outbound` instead. */ export type Outbound = GithubPublishingPRResponse$Outbound; } + +export function githubPublishingPRResponseToJSON( + githubPublishingPRResponse: GithubPublishingPRResponse, +): string { + return JSON.stringify( + GithubPublishingPRResponse$outboundSchema.parse(githubPublishingPRResponse), + ); +} + +export function githubPublishingPRResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GithubPublishingPRResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GithubPublishingPRResponse' from JSON`, + ); +} diff --git a/src/sdk/models/shared/githubsetupstateresponse.ts b/src/sdk/models/shared/githubsetupstateresponse.ts new file mode 100644 index 00000000..bbfc8281 --- /dev/null +++ b/src/sdk/models/shared/githubsetupstateresponse.ts @@ -0,0 +1,216 @@ +/* + * 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 Actions = { + generationActionConfigured: boolean; + publishActionConfigured: boolean; +}; + +export type Secrets = { + apiKeyConfigured: boolean; + publishingSecretsConfigured: boolean; +}; + +/** + * The state of a particular SDK targets github setup + */ +export type GithubSetupStateResponse = { + actions: Actions; + appInstalled: boolean; + secrets: Secrets; +}; + +/** @internal */ +export const Actions$inboundSchema: z.ZodType = + z.object({ + generation_action_configured: z.boolean(), + publish_action_configured: z.boolean(), + }).transform((v) => { + return remap$(v, { + "generation_action_configured": "generationActionConfigured", + "publish_action_configured": "publishActionConfigured", + }); + }); + +/** @internal */ +export type Actions$Outbound = { + generation_action_configured: boolean; + publish_action_configured: boolean; +}; + +/** @internal */ +export const Actions$outboundSchema: z.ZodType< + Actions$Outbound, + z.ZodTypeDef, + Actions +> = z.object({ + generationActionConfigured: z.boolean(), + publishActionConfigured: z.boolean(), +}).transform((v) => { + return remap$(v, { + generationActionConfigured: "generation_action_configured", + publishActionConfigured: "publish_action_configured", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Actions$ { + /** @deprecated use `Actions$inboundSchema` instead. */ + export const inboundSchema = Actions$inboundSchema; + /** @deprecated use `Actions$outboundSchema` instead. */ + export const outboundSchema = Actions$outboundSchema; + /** @deprecated use `Actions$Outbound` instead. */ + export type Outbound = Actions$Outbound; +} + +export function actionsToJSON(actions: Actions): string { + return JSON.stringify(Actions$outboundSchema.parse(actions)); +} + +export function actionsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Actions$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Actions' from JSON`, + ); +} + +/** @internal */ +export const Secrets$inboundSchema: z.ZodType = + z.object({ + api_key_configured: z.boolean(), + publishing_secrets_configured: z.boolean(), + }).transform((v) => { + return remap$(v, { + "api_key_configured": "apiKeyConfigured", + "publishing_secrets_configured": "publishingSecretsConfigured", + }); + }); + +/** @internal */ +export type Secrets$Outbound = { + api_key_configured: boolean; + publishing_secrets_configured: boolean; +}; + +/** @internal */ +export const Secrets$outboundSchema: z.ZodType< + Secrets$Outbound, + z.ZodTypeDef, + Secrets +> = z.object({ + apiKeyConfigured: z.boolean(), + publishingSecretsConfigured: z.boolean(), +}).transform((v) => { + return remap$(v, { + apiKeyConfigured: "api_key_configured", + publishingSecretsConfigured: "publishing_secrets_configured", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Secrets$ { + /** @deprecated use `Secrets$inboundSchema` instead. */ + export const inboundSchema = Secrets$inboundSchema; + /** @deprecated use `Secrets$outboundSchema` instead. */ + export const outboundSchema = Secrets$outboundSchema; + /** @deprecated use `Secrets$Outbound` instead. */ + export type Outbound = Secrets$Outbound; +} + +export function secretsToJSON(secrets: Secrets): string { + return JSON.stringify(Secrets$outboundSchema.parse(secrets)); +} + +export function secretsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Secrets$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Secrets' from JSON`, + ); +} + +/** @internal */ +export const GithubSetupStateResponse$inboundSchema: z.ZodType< + GithubSetupStateResponse, + z.ZodTypeDef, + unknown +> = z.object({ + actions: z.lazy(() => Actions$inboundSchema), + app_installed: z.boolean(), + secrets: z.lazy(() => Secrets$inboundSchema), +}).transform((v) => { + return remap$(v, { + "app_installed": "appInstalled", + }); +}); + +/** @internal */ +export type GithubSetupStateResponse$Outbound = { + actions: Actions$Outbound; + app_installed: boolean; + secrets: Secrets$Outbound; +}; + +/** @internal */ +export const GithubSetupStateResponse$outboundSchema: z.ZodType< + GithubSetupStateResponse$Outbound, + z.ZodTypeDef, + GithubSetupStateResponse +> = z.object({ + actions: z.lazy(() => Actions$outboundSchema), + appInstalled: z.boolean(), + secrets: z.lazy(() => Secrets$outboundSchema), +}).transform((v) => { + return remap$(v, { + appInstalled: "app_installed", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GithubSetupStateResponse$ { + /** @deprecated use `GithubSetupStateResponse$inboundSchema` instead. */ + export const inboundSchema = GithubSetupStateResponse$inboundSchema; + /** @deprecated use `GithubSetupStateResponse$outboundSchema` instead. */ + export const outboundSchema = GithubSetupStateResponse$outboundSchema; + /** @deprecated use `GithubSetupStateResponse$Outbound` instead. */ + export type Outbound = GithubSetupStateResponse$Outbound; +} + +export function githubSetupStateResponseToJSON( + githubSetupStateResponse: GithubSetupStateResponse, +): string { + return JSON.stringify( + GithubSetupStateResponse$outboundSchema.parse(githubSetupStateResponse), + ); +} + +export function githubSetupStateResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GithubSetupStateResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GithubSetupStateResponse' from JSON`, + ); +} diff --git a/src/sdk/models/shared/githubstorepublishingsecretsrequest.ts b/src/sdk/models/shared/githubstorepublishingsecretsrequest.ts index 0f1664eb..88284cf3 100644 --- a/src/sdk/models/shared/githubstorepublishingsecretsrequest.ts +++ b/src/sdk/models/shared/githubstorepublishingsecretsrequest.ts @@ -4,6 +4,9 @@ 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"; /** * A request to store publishing secrets for a github target @@ -67,3 +70,24 @@ export namespace GithubStorePublishingSecretsRequest$ { /** @deprecated use `GithubStorePublishingSecretsRequest$Outbound` instead. */ export type Outbound = GithubStorePublishingSecretsRequest$Outbound; } + +export function githubStorePublishingSecretsRequestToJSON( + githubStorePublishingSecretsRequest: GithubStorePublishingSecretsRequest, +): string { + return JSON.stringify( + GithubStorePublishingSecretsRequest$outboundSchema.parse( + githubStorePublishingSecretsRequest, + ), + ); +} + +export function githubStorePublishingSecretsRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GithubStorePublishingSecretsRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GithubStorePublishingSecretsRequest' from JSON`, + ); +} diff --git a/src/sdk/models/shared/githubtriggeractionrequest.ts b/src/sdk/models/shared/githubtriggeractionrequest.ts index 47d33ceb..2bab613a 100644 --- a/src/sdk/models/shared/githubtriggeractionrequest.ts +++ b/src/sdk/models/shared/githubtriggeractionrequest.ts @@ -4,6 +4,9 @@ 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"; /** * A request to trigger an action on a GitHub target @@ -99,3 +102,21 @@ export namespace GithubTriggerActionRequest$ { /** @deprecated use `GithubTriggerActionRequest$Outbound` instead. */ export type Outbound = GithubTriggerActionRequest$Outbound; } + +export function githubTriggerActionRequestToJSON( + githubTriggerActionRequest: GithubTriggerActionRequest, +): string { + return JSON.stringify( + GithubTriggerActionRequest$outboundSchema.parse(githubTriggerActionRequest), + ); +} + +export function githubTriggerActionRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GithubTriggerActionRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GithubTriggerActionRequest' from JSON`, + ); +} diff --git a/src/sdk/models/shared/httpmethod.ts b/src/sdk/models/shared/httpmethod.ts new file mode 100644 index 00000000..ab8a1253 --- /dev/null +++ b/src/sdk/models/shared/httpmethod.ts @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { ClosedEnum } from "../../types/enums.js"; + +export const HttpMethod = { + Get: "get", + Post: "post", + Put: "put", + Patch: "patch", + Delete: "delete", + Head: "head", + Options: "options", + Trace: "trace", +} as const; +export type HttpMethod = ClosedEnum; + +/** @internal */ +export const HttpMethod$inboundSchema: z.ZodNativeEnum = z + .nativeEnum(HttpMethod); + +/** @internal */ +export const HttpMethod$outboundSchema: z.ZodNativeEnum = + HttpMethod$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace HttpMethod$ { + /** @deprecated use `HttpMethod$inboundSchema` instead. */ + export const inboundSchema = HttpMethod$inboundSchema; + /** @deprecated use `HttpMethod$outboundSchema` instead. */ + export const outboundSchema = HttpMethod$outboundSchema; +} diff --git a/src/sdk/models/shared/index.ts b/src/sdk/models/shared/index.ts index 13036f55..1bdc59d7 100644 --- a/src/sdk/models/shared/index.ts +++ b/src/sdk/models/shared/index.ts @@ -7,21 +7,14 @@ export * from "./accesstoken.js"; export * from "./accounttype.js"; export * from "./addtags.js"; export * from "./annotations.js"; -export * from "./api.js"; -export * from "./apiendpoint.js"; -export * from "./apiendpointinput.js"; -export * from "./apiinput.js"; export * from "./apikeydetails.js"; -export * from "./boundedrequest.js"; +export * from "./billingaddon.js"; export * from "./clievent.js"; +export * from "./codesampleschemainput.js"; +export * from "./codesamplesjobstatus.js"; export * from "./diagnostic.js"; -export * from "./embedaccesstokenresponse.js"; -export * from "./embedtoken.js"; export * from "./error.js"; export * from "./featureflag.js"; -export * from "./filter.js"; -export * from "./filters.js"; -export * from "./generateopenapispecdiff.js"; export * from "./getnamespacesresponse.js"; export * from "./getrevisionsresponse.js"; export * from "./gettagsresponse.js"; @@ -32,8 +25,10 @@ export * from "./githubconfiguretargetrequest.js"; export * from "./githubgetactionresponse.js"; export * from "./githubmissingpublishingsecretsresponse.js"; export * from "./githubpublishingprresponse.js"; +export * from "./githubsetupstateresponse.js"; export * from "./githubstorepublishingsecretsrequest.js"; export * from "./githubtriggeractionrequest.js"; +export * from "./httpmethod.js"; export * from "./interactiontype.js"; export * from "./manifest.js"; export * from "./namespace.js"; @@ -41,30 +36,36 @@ export * from "./oasinfo.js"; export * from "./oasoperation.js"; export * from "./oassummary.js"; export * from "./organization.js"; +export * from "./organizationbillingaddonrequest.js"; +export * from "./organizationbillingaddonresponse.js"; export * from "./organizationusage.js"; export * from "./organizationusageresponse.js"; export * from "./preflightrequest.js"; export * from "./preflighttoken.js"; +export * from "./remotedocument.js"; +export * from "./remotesource.js"; +export * from "./remotesourcesubscriptionsettings.js"; export * from "./report.js"; -export * from "./requestmetadata.js"; export * from "./revision.js"; -export * from "./schema.js"; -export * from "./schemadiff.js"; +export * from "./revisioncontentsmetadata.js"; +export * from "./schemastoreitem.js"; export * from "./security.js"; export * from "./shorturl.js"; export * from "./ssometadata.js"; +export * from "./suggestitemsrequestbody.js"; export * from "./suggestoptsold.js"; export * from "./suggestrequestbody.js"; export * from "./tag.js"; export * from "./targetsdk.js"; -export * from "./unboundedrequest.js"; +export * from "./usagesnippet.js"; +export * from "./usagesnippets.js"; export * from "./user.js"; export * from "./v2descriptor.js"; -export * from "./versionmetadata.js"; -export * from "./versionmetadatainput.js"; export * from "./workflowdocument.js"; export * from "./workspace.js"; export * from "./workspaceandorganization.js"; +export * from "./workspacefeatureflag.js"; +export * from "./workspacefeatureflagrequest.js"; export * from "./workspacefeatureflagresponse.js"; export * from "./workspaceinviteresponse.js"; export * from "./workspacesettings.js"; diff --git a/src/sdk/models/shared/interactiontype.ts b/src/sdk/models/shared/interactiontype.ts index 8139d6cf..776c09f2 100644 --- a/src/sdk/models/shared/interactiontype.ts +++ b/src/sdk/models/shared/interactiontype.ts @@ -20,6 +20,7 @@ export const InteractionType = { Run: "RUN", Configure: "CONFIGURE", Publish: "PUBLISH", + Test: "TEST", } as const; /** * Type of interaction. diff --git a/src/sdk/models/shared/manifest.ts b/src/sdk/models/shared/manifest.ts index 0c1590fe..48d8d3e3 100644 --- a/src/sdk/models/shared/manifest.ts +++ b/src/sdk/models/shared/manifest.ts @@ -3,6 +3,9 @@ */ 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 { Annotations, Annotations$inboundSchema, @@ -89,3 +92,17 @@ export namespace Manifest$ { /** @deprecated use `Manifest$Outbound` instead. */ export type Outbound = Manifest$Outbound; } + +export function manifestToJSON(manifest: Manifest): string { + return JSON.stringify(Manifest$outboundSchema.parse(manifest)); +} + +export function manifestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Manifest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Manifest' from JSON`, + ); +} diff --git a/src/sdk/models/shared/namespace.ts b/src/sdk/models/shared/namespace.ts index 02b4f397..023cb29f 100644 --- a/src/sdk/models/shared/namespace.ts +++ b/src/sdk/models/shared/namespace.ts @@ -4,45 +4,155 @@ 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"; +import { + RemoteSourceSubscriptionSettings, + RemoteSourceSubscriptionSettings$inboundSchema, + RemoteSourceSubscriptionSettings$Outbound, + RemoteSourceSubscriptionSettings$outboundSchema, +} from "./remotesourcesubscriptionsettings.js"; +import { + RevisionContentsMetadata, + RevisionContentsMetadata$inboundSchema, + RevisionContentsMetadata$Outbound, + RevisionContentsMetadata$outboundSchema, +} from "./revisioncontentsmetadata.js"; + +export type CompositeSpecMetadata = { + /** + * The subscription ID for the remote source subscription, if applicable. This indicates that the namespace is created by a remote source and thus is composite. + */ + subscriptionId: string; + subscriptionSettings: RemoteSourceSubscriptionSettings; +}; /** * A namespace contains many revisions. */ export type Namespace = { + archivedAt?: Date | undefined; + compositeSpecMetadata?: CompositeSpecMetadata | undefined; createdAt: Date; /** * {organization_slug}/{workspace_slug}/{namespace_name} */ id: string; + latestRevisionMetadata?: RevisionContentsMetadata | undefined; /** * A human-readable name for the namespace. */ name: string; + /** + * Indicates whether the namespace is publicly accessible + */ + public?: boolean | undefined; updatedAt: Date; }; +/** @internal */ +export const CompositeSpecMetadata$inboundSchema: z.ZodType< + CompositeSpecMetadata, + z.ZodTypeDef, + unknown +> = z.object({ + subscription_id: z.string(), + subscription_settings: RemoteSourceSubscriptionSettings$inboundSchema, +}).transform((v) => { + return remap$(v, { + "subscription_id": "subscriptionId", + "subscription_settings": "subscriptionSettings", + }); +}); + +/** @internal */ +export type CompositeSpecMetadata$Outbound = { + subscription_id: string; + subscription_settings: RemoteSourceSubscriptionSettings$Outbound; +}; + +/** @internal */ +export const CompositeSpecMetadata$outboundSchema: z.ZodType< + CompositeSpecMetadata$Outbound, + z.ZodTypeDef, + CompositeSpecMetadata +> = z.object({ + subscriptionId: z.string(), + subscriptionSettings: RemoteSourceSubscriptionSettings$outboundSchema, +}).transform((v) => { + return remap$(v, { + subscriptionId: "subscription_id", + subscriptionSettings: "subscription_settings", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CompositeSpecMetadata$ { + /** @deprecated use `CompositeSpecMetadata$inboundSchema` instead. */ + export const inboundSchema = CompositeSpecMetadata$inboundSchema; + /** @deprecated use `CompositeSpecMetadata$outboundSchema` instead. */ + export const outboundSchema = CompositeSpecMetadata$outboundSchema; + /** @deprecated use `CompositeSpecMetadata$Outbound` instead. */ + export type Outbound = CompositeSpecMetadata$Outbound; +} + +export function compositeSpecMetadataToJSON( + compositeSpecMetadata: CompositeSpecMetadata, +): string { + return JSON.stringify( + CompositeSpecMetadata$outboundSchema.parse(compositeSpecMetadata), + ); +} + +export function compositeSpecMetadataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CompositeSpecMetadata$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CompositeSpecMetadata' from JSON`, + ); +} + /** @internal */ export const Namespace$inboundSchema: z.ZodType< Namespace, z.ZodTypeDef, unknown > = z.object({ + archived_at: z.string().datetime({ offset: true }).transform(v => new Date(v)) + .optional(), + composite_spec_metadata: z.lazy(() => CompositeSpecMetadata$inboundSchema) + .optional(), created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), id: z.string(), + latest_revision_metadata: RevisionContentsMetadata$inboundSchema.optional(), name: z.string(), + public: z.boolean().optional(), updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), }).transform((v) => { return remap$(v, { + "archived_at": "archivedAt", + "composite_spec_metadata": "compositeSpecMetadata", "created_at": "createdAt", + "latest_revision_metadata": "latestRevisionMetadata", "updated_at": "updatedAt", }); }); /** @internal */ export type Namespace$Outbound = { + archived_at?: string | undefined; + composite_spec_metadata?: CompositeSpecMetadata$Outbound | undefined; created_at: string; id: string; + latest_revision_metadata?: RevisionContentsMetadata$Outbound | undefined; name: string; + public?: boolean | undefined; updated_at: string; }; @@ -52,13 +162,21 @@ export const Namespace$outboundSchema: z.ZodType< z.ZodTypeDef, Namespace > = z.object({ + archivedAt: z.date().transform(v => v.toISOString()).optional(), + compositeSpecMetadata: z.lazy(() => CompositeSpecMetadata$outboundSchema) + .optional(), createdAt: z.date().transform(v => v.toISOString()), id: z.string(), + latestRevisionMetadata: RevisionContentsMetadata$outboundSchema.optional(), name: z.string(), + public: z.boolean().optional(), updatedAt: z.date().transform(v => v.toISOString()), }).transform((v) => { return remap$(v, { + archivedAt: "archived_at", + compositeSpecMetadata: "composite_spec_metadata", createdAt: "created_at", + latestRevisionMetadata: "latest_revision_metadata", updatedAt: "updated_at", }); }); @@ -75,3 +193,17 @@ export namespace Namespace$ { /** @deprecated use `Namespace$Outbound` instead. */ export type Outbound = Namespace$Outbound; } + +export function namespaceToJSON(namespace: Namespace): string { + return JSON.stringify(Namespace$outboundSchema.parse(namespace)); +} + +export function namespaceFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Namespace$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Namespace' from JSON`, + ); +} diff --git a/src/sdk/models/shared/oasinfo.ts b/src/sdk/models/shared/oasinfo.ts index 43ffc661..e02e0095 100644 --- a/src/sdk/models/shared/oasinfo.ts +++ b/src/sdk/models/shared/oasinfo.ts @@ -3,6 +3,9 @@ */ 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 License = { identifier?: string | undefined; @@ -49,6 +52,20 @@ export namespace License$ { export type Outbound = License$Outbound; } +export function licenseToJSON(license: License): string { + return JSON.stringify(License$outboundSchema.parse(license)); +} + +export function licenseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => License$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'License' from JSON`, + ); +} + /** @internal */ export const OASInfo$inboundSchema: z.ZodType = z.object({ @@ -93,3 +110,17 @@ export namespace OASInfo$ { /** @deprecated use `OASInfo$Outbound` instead. */ export type Outbound = OASInfo$Outbound; } + +export function oasInfoToJSON(oasInfo: OASInfo): string { + return JSON.stringify(OASInfo$outboundSchema.parse(oasInfo)); +} + +export function oasInfoFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => OASInfo$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'OASInfo' from JSON`, + ); +} diff --git a/src/sdk/models/shared/oasoperation.ts b/src/sdk/models/shared/oasoperation.ts index 839e3051..c84adfae 100644 --- a/src/sdk/models/shared/oasoperation.ts +++ b/src/sdk/models/shared/oasoperation.ts @@ -4,6 +4,9 @@ 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 OASOperation = { description: string; @@ -80,3 +83,17 @@ export namespace OASOperation$ { /** @deprecated use `OASOperation$Outbound` instead. */ export type Outbound = OASOperation$Outbound; } + +export function oasOperationToJSON(oasOperation: OASOperation): string { + return JSON.stringify(OASOperation$outboundSchema.parse(oasOperation)); +} + +export function oasOperationFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => OASOperation$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'OASOperation' from JSON`, + ); +} diff --git a/src/sdk/models/shared/oassummary.ts b/src/sdk/models/shared/oassummary.ts index 84ca37aa..51158bd8 100644 --- a/src/sdk/models/shared/oassummary.ts +++ b/src/sdk/models/shared/oassummary.ts @@ -3,6 +3,9 @@ */ 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 { OASInfo, OASInfo$inboundSchema, @@ -59,3 +62,17 @@ export namespace OASSummary$ { /** @deprecated use `OASSummary$Outbound` instead. */ export type Outbound = OASSummary$Outbound; } + +export function oasSummaryToJSON(oasSummary: OASSummary): string { + return JSON.stringify(OASSummary$outboundSchema.parse(oasSummary)); +} + +export function oasSummaryFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => OASSummary$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'OASSummary' from JSON`, + ); +} diff --git a/src/sdk/models/shared/organization.ts b/src/sdk/models/shared/organization.ts index bdccbc54..74959b18 100644 --- a/src/sdk/models/shared/organization.ts +++ b/src/sdk/models/shared/organization.ts @@ -4,6 +4,9 @@ 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"; import { AccountType, AccountType$inboundSchema, @@ -18,8 +21,11 @@ export type Organization = { createdAt: Date; freeTrialExpiry?: Date | null | undefined; id: string; + internal?: boolean | undefined; name: string; slug: string; + ssoActivated: boolean; + ssoConnectionId?: string | null | undefined; telemetryDisabled: boolean; updatedAt: Date; }; @@ -36,8 +42,11 @@ export const Organization$inboundSchema: z.ZodType< z.string().datetime({ offset: true }).transform(v => new Date(v)), ).optional(), id: z.string(), + internal: z.boolean().optional(), name: z.string(), slug: z.string(), + sso_activated: z.boolean(), + sso_connection_id: z.nullable(z.string()).optional(), telemetry_disabled: z.boolean(), updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), }).transform((v) => { @@ -45,6 +54,8 @@ export const Organization$inboundSchema: z.ZodType< "account_type": "accountType", "created_at": "createdAt", "free_trial_expiry": "freeTrialExpiry", + "sso_activated": "ssoActivated", + "sso_connection_id": "ssoConnectionId", "telemetry_disabled": "telemetryDisabled", "updated_at": "updatedAt", }); @@ -56,8 +67,11 @@ export type Organization$Outbound = { created_at: string; free_trial_expiry?: string | null | undefined; id: string; + internal?: boolean | undefined; name: string; slug: string; + sso_activated: boolean; + sso_connection_id?: string | null | undefined; telemetry_disabled: boolean; updated_at: string; }; @@ -73,8 +87,11 @@ export const Organization$outboundSchema: z.ZodType< freeTrialExpiry: z.nullable(z.date().transform(v => v.toISOString())) .optional(), id: z.string(), + internal: z.boolean().optional(), name: z.string(), slug: z.string(), + ssoActivated: z.boolean(), + ssoConnectionId: z.nullable(z.string()).optional(), telemetryDisabled: z.boolean(), updatedAt: z.date().transform(v => v.toISOString()), }).transform((v) => { @@ -82,6 +99,8 @@ export const Organization$outboundSchema: z.ZodType< accountType: "account_type", createdAt: "created_at", freeTrialExpiry: "free_trial_expiry", + ssoActivated: "sso_activated", + ssoConnectionId: "sso_connection_id", telemetryDisabled: "telemetry_disabled", updatedAt: "updated_at", }); @@ -99,3 +118,17 @@ export namespace Organization$ { /** @deprecated use `Organization$Outbound` instead. */ export type Outbound = Organization$Outbound; } + +export function organizationToJSON(organization: Organization): string { + return JSON.stringify(Organization$outboundSchema.parse(organization)); +} + +export function organizationFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Organization$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Organization' from JSON`, + ); +} diff --git a/src/sdk/models/shared/organizationbillingaddonrequest.ts b/src/sdk/models/shared/organizationbillingaddonrequest.ts new file mode 100644 index 00000000..38ac6b0f --- /dev/null +++ b/src/sdk/models/shared/organizationbillingaddonrequest.ts @@ -0,0 +1,85 @@ +/* + * 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"; +import { + BillingAddOn, + BillingAddOn$inboundSchema, + BillingAddOn$outboundSchema, +} from "./billingaddon.js"; + +/** + * A request to add billing add ons + */ +export type OrganizationBillingAddOnRequest = { + addOns: Array; +}; + +/** @internal */ +export const OrganizationBillingAddOnRequest$inboundSchema: z.ZodType< + OrganizationBillingAddOnRequest, + z.ZodTypeDef, + unknown +> = z.object({ + add_ons: z.array(BillingAddOn$inboundSchema), +}).transform((v) => { + return remap$(v, { + "add_ons": "addOns", + }); +}); + +/** @internal */ +export type OrganizationBillingAddOnRequest$Outbound = { + add_ons: Array; +}; + +/** @internal */ +export const OrganizationBillingAddOnRequest$outboundSchema: z.ZodType< + OrganizationBillingAddOnRequest$Outbound, + z.ZodTypeDef, + OrganizationBillingAddOnRequest +> = z.object({ + addOns: z.array(BillingAddOn$outboundSchema), +}).transform((v) => { + return remap$(v, { + addOns: "add_ons", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace OrganizationBillingAddOnRequest$ { + /** @deprecated use `OrganizationBillingAddOnRequest$inboundSchema` instead. */ + export const inboundSchema = OrganizationBillingAddOnRequest$inboundSchema; + /** @deprecated use `OrganizationBillingAddOnRequest$outboundSchema` instead. */ + export const outboundSchema = OrganizationBillingAddOnRequest$outboundSchema; + /** @deprecated use `OrganizationBillingAddOnRequest$Outbound` instead. */ + export type Outbound = OrganizationBillingAddOnRequest$Outbound; +} + +export function organizationBillingAddOnRequestToJSON( + organizationBillingAddOnRequest: OrganizationBillingAddOnRequest, +): string { + return JSON.stringify( + OrganizationBillingAddOnRequest$outboundSchema.parse( + organizationBillingAddOnRequest, + ), + ); +} + +export function organizationBillingAddOnRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => OrganizationBillingAddOnRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'OrganizationBillingAddOnRequest' from JSON`, + ); +} diff --git a/src/sdk/models/shared/organizationbillingaddonresponse.ts b/src/sdk/models/shared/organizationbillingaddonresponse.ts new file mode 100644 index 00000000..b27810be --- /dev/null +++ b/src/sdk/models/shared/organizationbillingaddonresponse.ts @@ -0,0 +1,85 @@ +/* + * 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"; +import { + BillingAddOn, + BillingAddOn$inboundSchema, + BillingAddOn$outboundSchema, +} from "./billingaddon.js"; + +/** + * Billing add on response + */ +export type OrganizationBillingAddOnResponse = { + addOns: Array; +}; + +/** @internal */ +export const OrganizationBillingAddOnResponse$inboundSchema: z.ZodType< + OrganizationBillingAddOnResponse, + z.ZodTypeDef, + unknown +> = z.object({ + add_ons: z.array(BillingAddOn$inboundSchema), +}).transform((v) => { + return remap$(v, { + "add_ons": "addOns", + }); +}); + +/** @internal */ +export type OrganizationBillingAddOnResponse$Outbound = { + add_ons: Array; +}; + +/** @internal */ +export const OrganizationBillingAddOnResponse$outboundSchema: z.ZodType< + OrganizationBillingAddOnResponse$Outbound, + z.ZodTypeDef, + OrganizationBillingAddOnResponse +> = z.object({ + addOns: z.array(BillingAddOn$outboundSchema), +}).transform((v) => { + return remap$(v, { + addOns: "add_ons", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace OrganizationBillingAddOnResponse$ { + /** @deprecated use `OrganizationBillingAddOnResponse$inboundSchema` instead. */ + export const inboundSchema = OrganizationBillingAddOnResponse$inboundSchema; + /** @deprecated use `OrganizationBillingAddOnResponse$outboundSchema` instead. */ + export const outboundSchema = OrganizationBillingAddOnResponse$outboundSchema; + /** @deprecated use `OrganizationBillingAddOnResponse$Outbound` instead. */ + export type Outbound = OrganizationBillingAddOnResponse$Outbound; +} + +export function organizationBillingAddOnResponseToJSON( + organizationBillingAddOnResponse: OrganizationBillingAddOnResponse, +): string { + return JSON.stringify( + OrganizationBillingAddOnResponse$outboundSchema.parse( + organizationBillingAddOnResponse, + ), + ); +} + +export function organizationBillingAddOnResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => OrganizationBillingAddOnResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'OrganizationBillingAddOnResponse' from JSON`, + ); +} diff --git a/src/sdk/models/shared/organizationusage.ts b/src/sdk/models/shared/organizationusage.ts index 1f4ee3f0..08aa5972 100644 --- a/src/sdk/models/shared/organizationusage.ts +++ b/src/sdk/models/shared/organizationusage.ts @@ -4,6 +4,9 @@ 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 OrganizationUsage = { /** @@ -22,6 +25,10 @@ export type OrganizationUsage = { * The programming language used */ language: string; + /** + * Maximum Number of operations per SDK specific in contract + */ + maxOperations: number; /** * Number of operations performed */ @@ -46,6 +53,7 @@ export const OrganizationUsage$inboundSchema: z.ZodType< accessible_features: z.array(z.string()), gen_lock_ids: z.array(z.string()), language: z.string(), + max_operations: z.number().int(), number_of_operations: z.number().int(), used_features: z.array(z.string()), workspaces: z.array(z.string()), @@ -53,6 +61,7 @@ export const OrganizationUsage$inboundSchema: z.ZodType< return remap$(v, { "accessible_features": "accessibleFeatures", "gen_lock_ids": "genLockIds", + "max_operations": "maxOperations", "number_of_operations": "numberOfOperations", "used_features": "usedFeatures", }); @@ -64,6 +73,7 @@ export type OrganizationUsage$Outbound = { accessible_features: Array; gen_lock_ids: Array; language: string; + max_operations: number; number_of_operations: number; used_features: Array; workspaces: Array; @@ -79,6 +89,7 @@ export const OrganizationUsage$outboundSchema: z.ZodType< accessibleFeatures: z.array(z.string()), genLockIds: z.array(z.string()), language: z.string(), + maxOperations: z.number().int(), numberOfOperations: z.number().int(), usedFeatures: z.array(z.string()), workspaces: z.array(z.string()), @@ -86,6 +97,7 @@ export const OrganizationUsage$outboundSchema: z.ZodType< return remap$(v, { accessibleFeatures: "accessible_features", genLockIds: "gen_lock_ids", + maxOperations: "max_operations", numberOfOperations: "number_of_operations", usedFeatures: "used_features", }); @@ -103,3 +115,21 @@ export namespace OrganizationUsage$ { /** @deprecated use `OrganizationUsage$Outbound` instead. */ export type Outbound = OrganizationUsage$Outbound; } + +export function organizationUsageToJSON( + organizationUsage: OrganizationUsage, +): string { + return JSON.stringify( + OrganizationUsage$outboundSchema.parse(organizationUsage), + ); +} + +export function organizationUsageFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => OrganizationUsage$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'OrganizationUsage' from JSON`, + ); +} diff --git a/src/sdk/models/shared/organizationusageresponse.ts b/src/sdk/models/shared/organizationusageresponse.ts index af06b914..85324345 100644 --- a/src/sdk/models/shared/organizationusageresponse.ts +++ b/src/sdk/models/shared/organizationusageresponse.ts @@ -4,6 +4,9 @@ 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"; import { OrganizationUsage, OrganizationUsage$inboundSchema, @@ -88,3 +91,21 @@ export namespace OrganizationUsageResponse$ { /** @deprecated use `OrganizationUsageResponse$Outbound` instead. */ export type Outbound = OrganizationUsageResponse$Outbound; } + +export function organizationUsageResponseToJSON( + organizationUsageResponse: OrganizationUsageResponse, +): string { + return JSON.stringify( + OrganizationUsageResponse$outboundSchema.parse(organizationUsageResponse), + ); +} + +export function organizationUsageResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => OrganizationUsageResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'OrganizationUsageResponse' from JSON`, + ); +} diff --git a/src/sdk/models/shared/preflightrequest.ts b/src/sdk/models/shared/preflightrequest.ts index be806f31..443a9219 100644 --- a/src/sdk/models/shared/preflightrequest.ts +++ b/src/sdk/models/shared/preflightrequest.ts @@ -4,6 +4,9 @@ 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 PreflightRequest = { namespaceName: string; @@ -52,3 +55,21 @@ export namespace PreflightRequest$ { /** @deprecated use `PreflightRequest$Outbound` instead. */ export type Outbound = PreflightRequest$Outbound; } + +export function preflightRequestToJSON( + preflightRequest: PreflightRequest, +): string { + return JSON.stringify( + PreflightRequest$outboundSchema.parse(preflightRequest), + ); +} + +export function preflightRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PreflightRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PreflightRequest' from JSON`, + ); +} diff --git a/src/sdk/models/shared/preflighttoken.ts b/src/sdk/models/shared/preflighttoken.ts index 4018dcf9..488d2eca 100644 --- a/src/sdk/models/shared/preflighttoken.ts +++ b/src/sdk/models/shared/preflighttoken.ts @@ -4,6 +4,9 @@ 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"; /** * A PreflightToken is a token that allows access to the OCI distribution endpoints. @@ -55,3 +58,17 @@ export namespace PreflightToken$ { /** @deprecated use `PreflightToken$Outbound` instead. */ export type Outbound = PreflightToken$Outbound; } + +export function preflightTokenToJSON(preflightToken: PreflightToken): string { + return JSON.stringify(PreflightToken$outboundSchema.parse(preflightToken)); +} + +export function preflightTokenFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PreflightToken$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PreflightToken' from JSON`, + ); +} diff --git a/src/sdk/models/shared/remotedocument.ts b/src/sdk/models/shared/remotedocument.ts new file mode 100644 index 00000000..0de7657f --- /dev/null +++ b/src/sdk/models/shared/remotedocument.ts @@ -0,0 +1,74 @@ +/* + * 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"; + +/** + * A document hosted in the registry + */ +export type RemoteDocument = { + registryUrl: string; +}; + +/** @internal */ +export const RemoteDocument$inboundSchema: z.ZodType< + RemoteDocument, + z.ZodTypeDef, + unknown +> = z.object({ + registry_url: z.string(), +}).transform((v) => { + return remap$(v, { + "registry_url": "registryUrl", + }); +}); + +/** @internal */ +export type RemoteDocument$Outbound = { + registry_url: string; +}; + +/** @internal */ +export const RemoteDocument$outboundSchema: z.ZodType< + RemoteDocument$Outbound, + z.ZodTypeDef, + RemoteDocument +> = z.object({ + registryUrl: z.string(), +}).transform((v) => { + return remap$(v, { + registryUrl: "registry_url", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace RemoteDocument$ { + /** @deprecated use `RemoteDocument$inboundSchema` instead. */ + export const inboundSchema = RemoteDocument$inboundSchema; + /** @deprecated use `RemoteDocument$outboundSchema` instead. */ + export const outboundSchema = RemoteDocument$outboundSchema; + /** @deprecated use `RemoteDocument$Outbound` instead. */ + export type Outbound = RemoteDocument$Outbound; +} + +export function remoteDocumentToJSON(remoteDocument: RemoteDocument): string { + return JSON.stringify(RemoteDocument$outboundSchema.parse(remoteDocument)); +} + +export function remoteDocumentFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => RemoteDocument$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'RemoteDocument' from JSON`, + ); +} diff --git a/src/sdk/models/shared/remotesource.ts b/src/sdk/models/shared/remotesource.ts new file mode 100644 index 00000000..f06027ed --- /dev/null +++ b/src/sdk/models/shared/remotesource.ts @@ -0,0 +1,82 @@ +/* + * 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 { + RemoteDocument, + RemoteDocument$inboundSchema, + RemoteDocument$Outbound, + RemoteDocument$outboundSchema, +} from "./remotedocument.js"; + +/** + * Remote source configuration + */ +export type RemoteSource = { + inputs: Array; + /** + * A document hosted in the registry + */ + output: RemoteDocument; + overlays?: Array | undefined; +}; + +/** @internal */ +export const RemoteSource$inboundSchema: z.ZodType< + RemoteSource, + z.ZodTypeDef, + unknown +> = z.object({ + inputs: z.array(RemoteDocument$inboundSchema), + output: RemoteDocument$inboundSchema, + overlays: z.array(RemoteDocument$inboundSchema).optional(), +}); + +/** @internal */ +export type RemoteSource$Outbound = { + inputs: Array; + output: RemoteDocument$Outbound; + overlays?: Array | undefined; +}; + +/** @internal */ +export const RemoteSource$outboundSchema: z.ZodType< + RemoteSource$Outbound, + z.ZodTypeDef, + RemoteSource +> = z.object({ + inputs: z.array(RemoteDocument$outboundSchema), + output: RemoteDocument$outboundSchema, + overlays: z.array(RemoteDocument$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 RemoteSource$ { + /** @deprecated use `RemoteSource$inboundSchema` instead. */ + export const inboundSchema = RemoteSource$inboundSchema; + /** @deprecated use `RemoteSource$outboundSchema` instead. */ + export const outboundSchema = RemoteSource$outboundSchema; + /** @deprecated use `RemoteSource$Outbound` instead. */ + export type Outbound = RemoteSource$Outbound; +} + +export function remoteSourceToJSON(remoteSource: RemoteSource): string { + return JSON.stringify(RemoteSource$outboundSchema.parse(remoteSource)); +} + +export function remoteSourceFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => RemoteSource$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'RemoteSource' from JSON`, + ); +} diff --git a/src/sdk/models/shared/remotesourcesubscriptionsettings.ts b/src/sdk/models/shared/remotesourcesubscriptionsettings.ts new file mode 100644 index 00000000..f4d060dd --- /dev/null +++ b/src/sdk/models/shared/remotesourcesubscriptionsettings.ts @@ -0,0 +1,95 @@ +/* + * 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 RemoteSourceSubscriptionSettings = { + baseSpecNamespaces: Array; + ignoredNamespaces?: Array | undefined; + outputNamespace: string; + overlayNamespaces: Array; +}; + +/** @internal */ +export const RemoteSourceSubscriptionSettings$inboundSchema: z.ZodType< + RemoteSourceSubscriptionSettings, + z.ZodTypeDef, + unknown +> = z.object({ + base_spec_namespaces: z.array(z.string()), + ignored_namespaces: z.array(z.string()).optional(), + output_namespace: z.string(), + overlay_namespaces: z.array(z.string()), +}).transform((v) => { + return remap$(v, { + "base_spec_namespaces": "baseSpecNamespaces", + "ignored_namespaces": "ignoredNamespaces", + "output_namespace": "outputNamespace", + "overlay_namespaces": "overlayNamespaces", + }); +}); + +/** @internal */ +export type RemoteSourceSubscriptionSettings$Outbound = { + base_spec_namespaces: Array; + ignored_namespaces?: Array | undefined; + output_namespace: string; + overlay_namespaces: Array; +}; + +/** @internal */ +export const RemoteSourceSubscriptionSettings$outboundSchema: z.ZodType< + RemoteSourceSubscriptionSettings$Outbound, + z.ZodTypeDef, + RemoteSourceSubscriptionSettings +> = z.object({ + baseSpecNamespaces: z.array(z.string()), + ignoredNamespaces: z.array(z.string()).optional(), + outputNamespace: z.string(), + overlayNamespaces: z.array(z.string()), +}).transform((v) => { + return remap$(v, { + baseSpecNamespaces: "base_spec_namespaces", + ignoredNamespaces: "ignored_namespaces", + outputNamespace: "output_namespace", + overlayNamespaces: "overlay_namespaces", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace RemoteSourceSubscriptionSettings$ { + /** @deprecated use `RemoteSourceSubscriptionSettings$inboundSchema` instead. */ + export const inboundSchema = RemoteSourceSubscriptionSettings$inboundSchema; + /** @deprecated use `RemoteSourceSubscriptionSettings$outboundSchema` instead. */ + export const outboundSchema = RemoteSourceSubscriptionSettings$outboundSchema; + /** @deprecated use `RemoteSourceSubscriptionSettings$Outbound` instead. */ + export type Outbound = RemoteSourceSubscriptionSettings$Outbound; +} + +export function remoteSourceSubscriptionSettingsToJSON( + remoteSourceSubscriptionSettings: RemoteSourceSubscriptionSettings, +): string { + return JSON.stringify( + RemoteSourceSubscriptionSettings$outboundSchema.parse( + remoteSourceSubscriptionSettings, + ), + ); +} + +export function remoteSourceSubscriptionSettingsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => RemoteSourceSubscriptionSettings$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'RemoteSourceSubscriptionSettings' from JSON`, + ); +} diff --git a/src/sdk/models/shared/report.ts b/src/sdk/models/shared/report.ts index 6935236e..12dad274 100644 --- a/src/sdk/models/shared/report.ts +++ b/src/sdk/models/shared/report.ts @@ -3,7 +3,10 @@ */ 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"; export const Type = { Linting: "linting", @@ -67,3 +70,17 @@ export namespace Report$ { /** @deprecated use `Report$Outbound` instead. */ export type Outbound = Report$Outbound; } + +export function reportToJSON(report: Report): string { + return JSON.stringify(Report$outboundSchema.parse(report)); +} + +export function reportFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Report$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Report' from JSON`, + ); +} diff --git a/src/sdk/models/shared/requestmetadata.ts b/src/sdk/models/shared/requestmetadata.ts deleted file mode 100644 index cd500da1..00000000 --- a/src/sdk/models/shared/requestmetadata.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod"; - -/** - * Key-Value pairs associated with a request - */ -export type RequestMetadata = { - key?: string | undefined; - value?: string | undefined; -}; - -/** @internal */ -export const RequestMetadata$inboundSchema: z.ZodType< - RequestMetadata, - z.ZodTypeDef, - unknown -> = z.object({ - key: z.string().optional(), - value: z.string().optional(), -}); - -/** @internal */ -export type RequestMetadata$Outbound = { - key?: string | undefined; - value?: string | undefined; -}; - -/** @internal */ -export const RequestMetadata$outboundSchema: z.ZodType< - RequestMetadata$Outbound, - z.ZodTypeDef, - RequestMetadata -> = z.object({ - key: z.string().optional(), - value: 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 RequestMetadata$ { - /** @deprecated use `RequestMetadata$inboundSchema` instead. */ - export const inboundSchema = RequestMetadata$inboundSchema; - /** @deprecated use `RequestMetadata$outboundSchema` instead. */ - export const outboundSchema = RequestMetadata$outboundSchema; - /** @deprecated use `RequestMetadata$Outbound` instead. */ - export type Outbound = RequestMetadata$Outbound; -} diff --git a/src/sdk/models/shared/revision.ts b/src/sdk/models/shared/revision.ts index 5d27cd29..090cb51f 100644 --- a/src/sdk/models/shared/revision.ts +++ b/src/sdk/models/shared/revision.ts @@ -4,8 +4,18 @@ 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"; +import { + RevisionContentsMetadata, + RevisionContentsMetadata$inboundSchema, + RevisionContentsMetadata$Outbound, + RevisionContentsMetadata$outboundSchema, +} from "./revisioncontentsmetadata.js"; export type Revision = { + contentsMetadata?: RevisionContentsMetadata | undefined; createdAt: Date; digest: string; /** @@ -23,6 +33,7 @@ export const Revision$inboundSchema: z.ZodType< z.ZodTypeDef, unknown > = z.object({ + contents_metadata: RevisionContentsMetadata$inboundSchema.optional(), created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), digest: z.string(), id: z.string(), @@ -31,6 +42,7 @@ export const Revision$inboundSchema: z.ZodType< updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), }).transform((v) => { return remap$(v, { + "contents_metadata": "contentsMetadata", "created_at": "createdAt", "namespace_name": "namespaceName", "updated_at": "updatedAt", @@ -39,6 +51,7 @@ export const Revision$inboundSchema: z.ZodType< /** @internal */ export type Revision$Outbound = { + contents_metadata?: RevisionContentsMetadata$Outbound | undefined; created_at: string; digest: string; id: string; @@ -53,6 +66,7 @@ export const Revision$outboundSchema: z.ZodType< z.ZodTypeDef, Revision > = z.object({ + contentsMetadata: RevisionContentsMetadata$outboundSchema.optional(), createdAt: z.date().transform(v => v.toISOString()), digest: z.string(), id: z.string(), @@ -61,6 +75,7 @@ export const Revision$outboundSchema: z.ZodType< updatedAt: z.date().transform(v => v.toISOString()), }).transform((v) => { return remap$(v, { + contentsMetadata: "contents_metadata", createdAt: "created_at", namespaceName: "namespace_name", updatedAt: "updated_at", @@ -79,3 +94,17 @@ export namespace Revision$ { /** @deprecated use `Revision$Outbound` instead. */ export type Outbound = Revision$Outbound; } + +export function revisionToJSON(revision: Revision): string { + return JSON.stringify(Revision$outboundSchema.parse(revision)); +} + +export function revisionFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Revision$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Revision' from JSON`, + ); +} diff --git a/src/sdk/models/shared/revisioncontentsmetadata.ts b/src/sdk/models/shared/revisioncontentsmetadata.ts new file mode 100644 index 00000000..098d1349 --- /dev/null +++ b/src/sdk/models/shared/revisioncontentsmetadata.ts @@ -0,0 +1,196 @@ +/* + * 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 { ClosedEnum } from "../../types/enums.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export const RevisionContentsMetadataType = { + OpenapiBundle: "OPENAPI_BUNDLE", + OpenapiOverlay: "OPENAPI_OVERLAY", +} as const; +export type RevisionContentsMetadataType = ClosedEnum< + typeof RevisionContentsMetadataType +>; + +export type RevisionContentsMetadata = { + /** + * Whether the OAS contains code samples. + */ + containsCodeSamples: boolean; + createdAt: Date; + /** + * The OAS description + */ + description: string; + /** + * The hash of the contents + */ + hash: string; + /** + * The fully qualified namespace + */ + namespace: string; + /** + * The number of overlay actions in the OAS. Will be 0 if the OAS is not an overlay. + */ + numOverlayActions: number; + /** + * The operation IDs contained in the OAS. Will be empty if the OAS is an overlay. + */ + operationIds: Array; + /** + * The digest of the parent bundle + */ + revisionDigest: string; + /** + * The tags contained in the OAS -- NOT the OCI tags. Will be empty if the OAS is an overlay. + */ + tags: Array; + /** + * The OAS title + */ + title: string; + type: RevisionContentsMetadataType; + /** + * The OAS version + */ + version: string; + /** + * The workspace ID + */ + workspaceId: string; +}; + +/** @internal */ +export const RevisionContentsMetadataType$inboundSchema: z.ZodNativeEnum< + typeof RevisionContentsMetadataType +> = z.nativeEnum(RevisionContentsMetadataType); + +/** @internal */ +export const RevisionContentsMetadataType$outboundSchema: z.ZodNativeEnum< + typeof RevisionContentsMetadataType +> = RevisionContentsMetadataType$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace RevisionContentsMetadataType$ { + /** @deprecated use `RevisionContentsMetadataType$inboundSchema` instead. */ + export const inboundSchema = RevisionContentsMetadataType$inboundSchema; + /** @deprecated use `RevisionContentsMetadataType$outboundSchema` instead. */ + export const outboundSchema = RevisionContentsMetadataType$outboundSchema; +} + +/** @internal */ +export const RevisionContentsMetadata$inboundSchema: z.ZodType< + RevisionContentsMetadata, + z.ZodTypeDef, + unknown +> = z.object({ + contains_code_samples: z.boolean(), + created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), + description: z.string(), + hash: z.string(), + namespace: z.string(), + num_overlay_actions: z.number().int(), + operation_ids: z.array(z.string()), + revision_digest: z.string(), + tags: z.array(z.string()), + title: z.string(), + type: RevisionContentsMetadataType$inboundSchema, + version: z.string(), + workspace_id: z.string(), +}).transform((v) => { + return remap$(v, { + "contains_code_samples": "containsCodeSamples", + "created_at": "createdAt", + "num_overlay_actions": "numOverlayActions", + "operation_ids": "operationIds", + "revision_digest": "revisionDigest", + "workspace_id": "workspaceId", + }); +}); + +/** @internal */ +export type RevisionContentsMetadata$Outbound = { + contains_code_samples: boolean; + created_at: string; + description: string; + hash: string; + namespace: string; + num_overlay_actions: number; + operation_ids: Array; + revision_digest: string; + tags: Array; + title: string; + type: string; + version: string; + workspace_id: string; +}; + +/** @internal */ +export const RevisionContentsMetadata$outboundSchema: z.ZodType< + RevisionContentsMetadata$Outbound, + z.ZodTypeDef, + RevisionContentsMetadata +> = z.object({ + containsCodeSamples: z.boolean(), + createdAt: z.date().transform(v => v.toISOString()), + description: z.string(), + hash: z.string(), + namespace: z.string(), + numOverlayActions: z.number().int(), + operationIds: z.array(z.string()), + revisionDigest: z.string(), + tags: z.array(z.string()), + title: z.string(), + type: RevisionContentsMetadataType$outboundSchema, + version: z.string(), + workspaceId: z.string(), +}).transform((v) => { + return remap$(v, { + containsCodeSamples: "contains_code_samples", + createdAt: "created_at", + numOverlayActions: "num_overlay_actions", + operationIds: "operation_ids", + revisionDigest: "revision_digest", + workspaceId: "workspace_id", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace RevisionContentsMetadata$ { + /** @deprecated use `RevisionContentsMetadata$inboundSchema` instead. */ + export const inboundSchema = RevisionContentsMetadata$inboundSchema; + /** @deprecated use `RevisionContentsMetadata$outboundSchema` instead. */ + export const outboundSchema = RevisionContentsMetadata$outboundSchema; + /** @deprecated use `RevisionContentsMetadata$Outbound` instead. */ + export type Outbound = RevisionContentsMetadata$Outbound; +} + +export function revisionContentsMetadataToJSON( + revisionContentsMetadata: RevisionContentsMetadata, +): string { + return JSON.stringify( + RevisionContentsMetadata$outboundSchema.parse(revisionContentsMetadata), + ); +} + +export function revisionContentsMetadataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => RevisionContentsMetadata$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'RevisionContentsMetadata' from JSON`, + ); +} diff --git a/src/sdk/models/shared/schema.ts b/src/sdk/models/shared/schema.ts deleted file mode 100644 index c4ef808e..00000000 --- a/src/sdk/models/shared/schema.ts +++ /dev/null @@ -1,102 +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"; - -/** - * A Schema represents an API schema for a particular Api and Version. - */ -export type Schema = { - /** - * The ID of the Api this Schema belongs to. - */ - apiId: string; - /** - * Creation timestamp. - */ - createdAt: Date; - /** - * A detailed description of the Schema. - */ - description: string; - /** - * An ID referencing this particular revision of the Schema. - */ - revisionId: string; - /** - * The version ID of the Api this Schema belongs to. - */ - versionId: string; - /** - * The workspace ID this Schema belongs to. - */ - workspaceId: string; -}; - -/** @internal */ -export const Schema$inboundSchema: z.ZodType = z - .object({ - api_id: z.string(), - created_at: z.string().datetime({ offset: true }).transform(v => - new Date(v) - ), - description: z.string(), - revision_id: z.string(), - version_id: z.string(), - workspace_id: z.string(), - }).transform((v) => { - return remap$(v, { - "api_id": "apiId", - "created_at": "createdAt", - "revision_id": "revisionId", - "version_id": "versionId", - "workspace_id": "workspaceId", - }); - }); - -/** @internal */ -export type Schema$Outbound = { - api_id: string; - created_at: string; - description: string; - revision_id: string; - version_id: string; - workspace_id: string; -}; - -/** @internal */ -export const Schema$outboundSchema: z.ZodType< - Schema$Outbound, - z.ZodTypeDef, - Schema -> = z.object({ - apiId: z.string(), - createdAt: z.date().transform(v => v.toISOString()), - description: z.string(), - revisionId: z.string(), - versionId: z.string(), - workspaceId: z.string(), -}).transform((v) => { - return remap$(v, { - apiId: "api_id", - createdAt: "created_at", - revisionId: "revision_id", - versionId: "version_id", - workspaceId: "workspace_id", - }); -}); - -/** - * @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; -} diff --git a/src/sdk/models/shared/schemadiff.ts b/src/sdk/models/shared/schemadiff.ts deleted file mode 100644 index 9c347312..00000000 --- a/src/sdk/models/shared/schemadiff.ts +++ /dev/null @@ -1,126 +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"; - -export type ValueChange = { - /** - * Represents the previous value of the element. - */ - from: string; - /** - * Represents the current value of the element. - */ - to: string; -}; - -/** - * A SchemaDiff represents a diff of two Schemas. - */ -export type SchemaDiff = { - /** - * Holds every addition change in the diff. - */ - additions: Array; - /** - * Holds every deletion change in the diff. - */ - deletions: Array; - /** - * Holds every modification change in the diff. - */ - modifications: { [k: string]: ValueChange }; -}; - -/** @internal */ -export const ValueChange$inboundSchema: z.ZodType< - ValueChange, - z.ZodTypeDef, - unknown -> = z.object({ - From: z.string(), - To: z.string(), -}).transform((v) => { - return remap$(v, { - "From": "from", - "To": "to", - }); -}); - -/** @internal */ -export type ValueChange$Outbound = { - From: string; - To: string; -}; - -/** @internal */ -export const ValueChange$outboundSchema: z.ZodType< - ValueChange$Outbound, - z.ZodTypeDef, - ValueChange -> = z.object({ - from: z.string(), - to: z.string(), -}).transform((v) => { - return remap$(v, { - from: "From", - to: "To", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace ValueChange$ { - /** @deprecated use `ValueChange$inboundSchema` instead. */ - export const inboundSchema = ValueChange$inboundSchema; - /** @deprecated use `ValueChange$outboundSchema` instead. */ - export const outboundSchema = ValueChange$outboundSchema; - /** @deprecated use `ValueChange$Outbound` instead. */ - export type Outbound = ValueChange$Outbound; -} - -/** @internal */ -export const SchemaDiff$inboundSchema: z.ZodType< - SchemaDiff, - z.ZodTypeDef, - unknown -> = z.object({ - additions: z.array(z.string()), - deletions: z.array(z.string()), - modifications: z.record(z.lazy(() => ValueChange$inboundSchema)), -}); - -/** @internal */ -export type SchemaDiff$Outbound = { - additions: Array; - deletions: Array; - modifications: { [k: string]: ValueChange$Outbound }; -}; - -/** @internal */ -export const SchemaDiff$outboundSchema: z.ZodType< - SchemaDiff$Outbound, - z.ZodTypeDef, - SchemaDiff -> = z.object({ - additions: z.array(z.string()), - deletions: z.array(z.string()), - modifications: z.record(z.lazy(() => ValueChange$outboundSchema)), -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace SchemaDiff$ { - /** @deprecated use `SchemaDiff$inboundSchema` instead. */ - export const inboundSchema = SchemaDiff$inboundSchema; - /** @deprecated use `SchemaDiff$outboundSchema` instead. */ - export const outboundSchema = SchemaDiff$outboundSchema; - /** @deprecated use `SchemaDiff$Outbound` instead. */ - export type Outbound = SchemaDiff$Outbound; -} diff --git a/src/sdk/models/shared/schemastoreitem.ts b/src/sdk/models/shared/schemastoreitem.ts new file mode 100644 index 00000000..5dd7348c --- /dev/null +++ b/src/sdk/models/shared/schemastoreitem.ts @@ -0,0 +1,119 @@ +/* + * 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 { ClosedEnum } from "../../types/enums.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export const Format = { + Json: "json", + Yaml: "yaml", +} as const; +export type Format = ClosedEnum; + +export type SchemaStoreItem = { + createdAt: Date; + format: Format; + id: string; + packageName: string; + sdkClassname: string; + spec: string; +}; + +/** @internal */ +export const Format$inboundSchema: z.ZodNativeEnum = z + .nativeEnum(Format); + +/** @internal */ +export const Format$outboundSchema: z.ZodNativeEnum = + Format$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Format$ { + /** @deprecated use `Format$inboundSchema` instead. */ + export const inboundSchema = Format$inboundSchema; + /** @deprecated use `Format$outboundSchema` instead. */ + export const outboundSchema = Format$outboundSchema; +} + +/** @internal */ +export const SchemaStoreItem$inboundSchema: z.ZodType< + SchemaStoreItem, + z.ZodTypeDef, + unknown +> = z.object({ + created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), + format: Format$inboundSchema, + id: z.string(), + packageName: z.string(), + sdkClassname: z.string(), + spec: z.string(), +}).transform((v) => { + return remap$(v, { + "created_at": "createdAt", + }); +}); + +/** @internal */ +export type SchemaStoreItem$Outbound = { + created_at: string; + format: string; + id: string; + packageName: string; + sdkClassname: string; + spec: string; +}; + +/** @internal */ +export const SchemaStoreItem$outboundSchema: z.ZodType< + SchemaStoreItem$Outbound, + z.ZodTypeDef, + SchemaStoreItem +> = z.object({ + createdAt: z.date().transform(v => v.toISOString()), + format: Format$outboundSchema, + id: z.string(), + packageName: z.string(), + sdkClassname: z.string(), + spec: z.string(), +}).transform((v) => { + return remap$(v, { + createdAt: "created_at", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SchemaStoreItem$ { + /** @deprecated use `SchemaStoreItem$inboundSchema` instead. */ + export const inboundSchema = SchemaStoreItem$inboundSchema; + /** @deprecated use `SchemaStoreItem$outboundSchema` instead. */ + export const outboundSchema = SchemaStoreItem$outboundSchema; + /** @deprecated use `SchemaStoreItem$Outbound` instead. */ + export type Outbound = SchemaStoreItem$Outbound; +} + +export function schemaStoreItemToJSON( + schemaStoreItem: SchemaStoreItem, +): string { + return JSON.stringify(SchemaStoreItem$outboundSchema.parse(schemaStoreItem)); +} + +export function schemaStoreItemFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => SchemaStoreItem$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'SchemaStoreItem' from JSON`, + ); +} diff --git a/src/sdk/models/shared/security.ts b/src/sdk/models/shared/security.ts index 0a131433..ee05901d 100644 --- a/src/sdk/models/shared/security.ts +++ b/src/sdk/models/shared/security.ts @@ -4,6 +4,9 @@ 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 = { apiKey?: string | undefined; @@ -64,3 +67,17 @@ export namespace Security$ { /** @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/sdk/models/shared/shorturl.ts b/src/sdk/models/shared/shorturl.ts index d6106810..285fd026 100644 --- a/src/sdk/models/shared/shorturl.ts +++ b/src/sdk/models/shared/shorturl.ts @@ -4,6 +4,9 @@ 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 ShortURL = { fullUrl: string; @@ -58,3 +61,17 @@ export namespace ShortURL$ { /** @deprecated use `ShortURL$Outbound` instead. */ export type Outbound = ShortURL$Outbound; } + +export function shortURLToJSON(shortURL: ShortURL): string { + return JSON.stringify(ShortURL$outboundSchema.parse(shortURL)); +} + +export function shortURLFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ShortURL$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ShortURL' from JSON`, + ); +} diff --git a/src/sdk/models/shared/ssometadata.ts b/src/sdk/models/shared/ssometadata.ts index c8e1c8cf..1ec2e5ec 100644 --- a/src/sdk/models/shared/ssometadata.ts +++ b/src/sdk/models/shared/ssometadata.ts @@ -4,6 +4,9 @@ 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"; /** * SSO metadata for a workspace @@ -61,3 +64,17 @@ export namespace SSOMetadata$ { /** @deprecated use `SSOMetadata$Outbound` instead. */ export type Outbound = SSOMetadata$Outbound; } + +export function ssoMetadataToJSON(ssoMetadata: SSOMetadata): string { + return JSON.stringify(SSOMetadata$outboundSchema.parse(ssoMetadata)); +} + +export function ssoMetadataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => SSOMetadata$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'SSOMetadata' from JSON`, + ); +} diff --git a/src/sdk/models/shared/suggestitemsrequestbody.ts b/src/sdk/models/shared/suggestitemsrequestbody.ts new file mode 100644 index 00000000..d8feee07 --- /dev/null +++ b/src/sdk/models/shared/suggestitemsrequestbody.ts @@ -0,0 +1,76 @@ +/* + * 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 SuggestItemsRequestBody = { + /** + * The list of "things" to get suggestions for. One suggestion will be returned for each item in the list. + */ + items: Array; + /** + * The prompt to use for the suggestion. Think of this as the "preamble". + */ + prompt: string; +}; + +/** @internal */ +export const SuggestItemsRequestBody$inboundSchema: z.ZodType< + SuggestItemsRequestBody, + z.ZodTypeDef, + unknown +> = z.object({ + items: z.array(z.string()), + prompt: z.string(), +}); + +/** @internal */ +export type SuggestItemsRequestBody$Outbound = { + items: Array; + prompt: string; +}; + +/** @internal */ +export const SuggestItemsRequestBody$outboundSchema: z.ZodType< + SuggestItemsRequestBody$Outbound, + z.ZodTypeDef, + SuggestItemsRequestBody +> = z.object({ + items: z.array(z.string()), + prompt: 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 SuggestItemsRequestBody$ { + /** @deprecated use `SuggestItemsRequestBody$inboundSchema` instead. */ + export const inboundSchema = SuggestItemsRequestBody$inboundSchema; + /** @deprecated use `SuggestItemsRequestBody$outboundSchema` instead. */ + export const outboundSchema = SuggestItemsRequestBody$outboundSchema; + /** @deprecated use `SuggestItemsRequestBody$Outbound` instead. */ + export type Outbound = SuggestItemsRequestBody$Outbound; +} + +export function suggestItemsRequestBodyToJSON( + suggestItemsRequestBody: SuggestItemsRequestBody, +): string { + return JSON.stringify( + SuggestItemsRequestBody$outboundSchema.parse(suggestItemsRequestBody), + ); +} + +export function suggestItemsRequestBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => SuggestItemsRequestBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'SuggestItemsRequestBody' from JSON`, + ); +} diff --git a/src/sdk/models/shared/suggestoptsold.ts b/src/sdk/models/shared/suggestoptsold.ts index f58c1cba..0d8f6527 100644 --- a/src/sdk/models/shared/suggestoptsold.ts +++ b/src/sdk/models/shared/suggestoptsold.ts @@ -4,7 +4,10 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +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 { Diagnostic, Diagnostic$inboundSchema, @@ -90,3 +93,17 @@ export namespace SuggestOptsOld$ { /** @deprecated use `SuggestOptsOld$Outbound` instead. */ export type Outbound = SuggestOptsOld$Outbound; } + +export function suggestOptsOldToJSON(suggestOptsOld: SuggestOptsOld): string { + return JSON.stringify(SuggestOptsOld$outboundSchema.parse(suggestOptsOld)); +} + +export function suggestOptsOldFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => SuggestOptsOld$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'SuggestOptsOld' from JSON`, + ); +} diff --git a/src/sdk/models/shared/suggestrequestbody.ts b/src/sdk/models/shared/suggestrequestbody.ts index dadfd70a..d8e391be 100644 --- a/src/sdk/models/shared/suggestrequestbody.ts +++ b/src/sdk/models/shared/suggestrequestbody.ts @@ -4,7 +4,10 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +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 { Diagnostic, Diagnostic$inboundSchema, @@ -104,3 +107,21 @@ export namespace SuggestRequestBody$ { /** @deprecated use `SuggestRequestBody$Outbound` instead. */ export type Outbound = SuggestRequestBody$Outbound; } + +export function suggestRequestBodyToJSON( + suggestRequestBody: SuggestRequestBody, +): string { + return JSON.stringify( + SuggestRequestBody$outboundSchema.parse(suggestRequestBody), + ); +} + +export function suggestRequestBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => SuggestRequestBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'SuggestRequestBody' from JSON`, + ); +} diff --git a/src/sdk/models/shared/tag.ts b/src/sdk/models/shared/tag.ts index 058a40fd..391719d3 100644 --- a/src/sdk/models/shared/tag.ts +++ b/src/sdk/models/shared/tag.ts @@ -4,6 +4,9 @@ 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 Tag = { /** @@ -66,3 +69,17 @@ export namespace Tag$ { /** @deprecated use `Tag$Outbound` instead. */ export type Outbound = Tag$Outbound; } + +export function tagToJSON(tag: Tag): string { + return JSON.stringify(Tag$outboundSchema.parse(tag)); +} + +export function tagFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Tag$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Tag' from JSON`, + ); +} diff --git a/src/sdk/models/shared/targetsdk.ts b/src/sdk/models/shared/targetsdk.ts index 751f7dfa..884a7c11 100644 --- a/src/sdk/models/shared/targetsdk.ts +++ b/src/sdk/models/shared/targetsdk.ts @@ -4,6 +4,9 @@ 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"; import { InteractionType, InteractionType$inboundSchema, @@ -51,6 +54,10 @@ export type TargetSDK = { * The number of operations used in generation. */ generateNumberOfOperationsUsed?: number | undefined; + /** + * The number of terraform resources used in generation. + */ + generateNumberOfTerraformResources?: number | undefined; /** * Indicates whether the target was considered published. */ @@ -127,6 +134,14 @@ export type TargetSDK = { * Type of interaction. */ lastEventInteractionType: InteractionType; + /** + * Timestamp when the last publishing event was created. + */ + lastPublishCreatedAt?: Date | undefined; + /** + * Link to the GitHub action run for the last publishing event. + */ + lastPublishGhActionRunLink?: string | undefined; /** * Name of the published package. */ @@ -163,6 +178,14 @@ export type TargetSDK = { * Indicates whether the event was successful. */ success?: boolean | undefined; + /** + * Workflow lock file (post execution) + */ + workflowLockPostRaw?: string | undefined; + /** + * Workflow lock file (prior to execution) + */ + workflowLockPreRaw?: string | undefined; /** * Workflow file (post execution) */ @@ -189,6 +212,7 @@ export const TargetSDK$inboundSchema: z.ZodType< generate_gen_lock_pre_version: z.string().optional(), generate_number_of_operations_ignored: z.number().int().optional(), generate_number_of_operations_used: z.number().int().optional(), + generate_number_of_terraform_resources: z.number().int().optional(), generate_published: z.boolean().optional(), generate_target: z.string(), generate_target_name: z.string().optional(), @@ -210,6 +234,10 @@ export const TargetSDK$inboundSchema: z.ZodType< ), last_event_id: z.string(), last_event_interaction_type: InteractionType$inboundSchema, + last_publish_created_at: z.string().datetime({ offset: true }).transform(v => + new Date(v) + ).optional(), + last_publish_gh_action_run_link: z.string().optional(), publish_package_name: z.string().optional(), publish_package_registry_name: z.string().optional(), publish_package_url: z.string().optional(), @@ -219,6 +247,8 @@ export const TargetSDK$inboundSchema: z.ZodType< source_namespace_name: z.string().optional(), source_revision_digest: z.string().optional(), success: z.boolean().optional(), + workflow_lock_post_raw: z.string().optional(), + workflow_lock_pre_raw: z.string().optional(), workflow_post_raw: z.string().optional(), workflow_pre_raw: z.string().optional(), }).transform((v) => { @@ -233,6 +263,8 @@ export const TargetSDK$inboundSchema: z.ZodType< "generate_number_of_operations_ignored": "generateNumberOfOperationsIgnored", "generate_number_of_operations_used": "generateNumberOfOperationsUsed", + "generate_number_of_terraform_resources": + "generateNumberOfTerraformResources", "generate_published": "generatePublished", "generate_target": "generateTarget", "generate_target_name": "generateTargetName", @@ -250,6 +282,8 @@ export const TargetSDK$inboundSchema: z.ZodType< "last_event_created_at": "lastEventCreatedAt", "last_event_id": "lastEventId", "last_event_interaction_type": "lastEventInteractionType", + "last_publish_created_at": "lastPublishCreatedAt", + "last_publish_gh_action_run_link": "lastPublishGhActionRunLink", "publish_package_name": "publishPackageName", "publish_package_registry_name": "publishPackageRegistryName", "publish_package_url": "publishPackageUrl", @@ -258,6 +292,8 @@ export const TargetSDK$inboundSchema: z.ZodType< "source_blob_digest": "sourceBlobDigest", "source_namespace_name": "sourceNamespaceName", "source_revision_digest": "sourceRevisionDigest", + "workflow_lock_post_raw": "workflowLockPostRaw", + "workflow_lock_pre_raw": "workflowLockPreRaw", "workflow_post_raw": "workflowPostRaw", "workflow_pre_raw": "workflowPreRaw", }); @@ -275,6 +311,7 @@ export type TargetSDK$Outbound = { generate_gen_lock_pre_version?: string | undefined; generate_number_of_operations_ignored?: number | undefined; generate_number_of_operations_used?: number | undefined; + generate_number_of_terraform_resources?: number | undefined; generate_published?: boolean | undefined; generate_target: string; generate_target_name?: string | undefined; @@ -294,6 +331,8 @@ export type TargetSDK$Outbound = { last_event_created_at: string; last_event_id: string; last_event_interaction_type: string; + last_publish_created_at?: string | undefined; + last_publish_gh_action_run_link?: string | undefined; publish_package_name?: string | undefined; publish_package_registry_name?: string | undefined; publish_package_url?: string | undefined; @@ -303,6 +342,8 @@ export type TargetSDK$Outbound = { source_namespace_name?: string | undefined; source_revision_digest?: string | undefined; success?: boolean | undefined; + workflow_lock_post_raw?: string | undefined; + workflow_lock_pre_raw?: string | undefined; workflow_post_raw?: string | undefined; workflow_pre_raw?: string | undefined; }; @@ -323,6 +364,7 @@ export const TargetSDK$outboundSchema: z.ZodType< generateGenLockPreVersion: z.string().optional(), generateNumberOfOperationsIgnored: z.number().int().optional(), generateNumberOfOperationsUsed: z.number().int().optional(), + generateNumberOfTerraformResources: z.number().int().optional(), generatePublished: z.boolean().optional(), generateTarget: z.string(), generateTargetName: z.string().optional(), @@ -342,6 +384,8 @@ export const TargetSDK$outboundSchema: z.ZodType< lastEventCreatedAt: z.date().transform(v => v.toISOString()), lastEventId: z.string(), lastEventInteractionType: InteractionType$outboundSchema, + lastPublishCreatedAt: z.date().transform(v => v.toISOString()).optional(), + lastPublishGhActionRunLink: z.string().optional(), publishPackageName: z.string().optional(), publishPackageRegistryName: z.string().optional(), publishPackageUrl: z.string().optional(), @@ -351,6 +395,8 @@ export const TargetSDK$outboundSchema: z.ZodType< sourceNamespaceName: z.string().optional(), sourceRevisionDigest: z.string().optional(), success: z.boolean().optional(), + workflowLockPostRaw: z.string().optional(), + workflowLockPreRaw: z.string().optional(), workflowPostRaw: z.string().optional(), workflowPreRaw: z.string().optional(), }).transform((v) => { @@ -364,6 +410,8 @@ export const TargetSDK$outboundSchema: z.ZodType< generateGenLockPreVersion: "generate_gen_lock_pre_version", generateNumberOfOperationsIgnored: "generate_number_of_operations_ignored", generateNumberOfOperationsUsed: "generate_number_of_operations_used", + generateNumberOfTerraformResources: + "generate_number_of_terraform_resources", generatePublished: "generate_published", generateTarget: "generate_target", generateTargetName: "generate_target_name", @@ -381,6 +429,8 @@ export const TargetSDK$outboundSchema: z.ZodType< lastEventCreatedAt: "last_event_created_at", lastEventId: "last_event_id", lastEventInteractionType: "last_event_interaction_type", + lastPublishCreatedAt: "last_publish_created_at", + lastPublishGhActionRunLink: "last_publish_gh_action_run_link", publishPackageName: "publish_package_name", publishPackageRegistryName: "publish_package_registry_name", publishPackageUrl: "publish_package_url", @@ -389,6 +439,8 @@ export const TargetSDK$outboundSchema: z.ZodType< sourceBlobDigest: "source_blob_digest", sourceNamespaceName: "source_namespace_name", sourceRevisionDigest: "source_revision_digest", + workflowLockPostRaw: "workflow_lock_post_raw", + workflowLockPreRaw: "workflow_lock_pre_raw", workflowPostRaw: "workflow_post_raw", workflowPreRaw: "workflow_pre_raw", }); @@ -406,3 +458,17 @@ export namespace TargetSDK$ { /** @deprecated use `TargetSDK$Outbound` instead. */ export type Outbound = TargetSDK$Outbound; } + +export function targetSDKToJSON(targetSDK: TargetSDK): string { + return JSON.stringify(TargetSDK$outboundSchema.parse(targetSDK)); +} + +export function targetSDKFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => TargetSDK$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'TargetSDK' from JSON`, + ); +} diff --git a/src/sdk/models/shared/unboundedrequest.ts b/src/sdk/models/shared/unboundedrequest.ts deleted file mode 100644 index c66e9a7e..00000000 --- a/src/sdk/models/shared/unboundedrequest.ts +++ /dev/null @@ -1,94 +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"; - -/** - * An UnboundedRequest represents the HAR content capture by Speakeasy when logging a request. - */ -export type UnboundedRequest = { - /** - * Creation timestamp. - */ - createdAt: Date; - /** - * The HAR content of the request. - */ - har: string; - /** - * The size of the HAR content in bytes. - */ - harSizeBytes: number; - /** - * The ID of this request. - */ - requestId: string; - /** - * The workspace ID this request was made to. - */ - workspaceId: string; -}; - -/** @internal */ -export const UnboundedRequest$inboundSchema: z.ZodType< - UnboundedRequest, - z.ZodTypeDef, - unknown -> = z.object({ - created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), - har: z.string(), - har_size_bytes: z.number().int(), - request_id: z.string(), - workspace_id: z.string(), -}).transform((v) => { - return remap$(v, { - "created_at": "createdAt", - "har_size_bytes": "harSizeBytes", - "request_id": "requestId", - "workspace_id": "workspaceId", - }); -}); - -/** @internal */ -export type UnboundedRequest$Outbound = { - created_at: string; - har: string; - har_size_bytes: number; - request_id: string; - workspace_id: string; -}; - -/** @internal */ -export const UnboundedRequest$outboundSchema: z.ZodType< - UnboundedRequest$Outbound, - z.ZodTypeDef, - UnboundedRequest -> = z.object({ - createdAt: z.date().transform(v => v.toISOString()), - har: z.string(), - harSizeBytes: z.number().int(), - requestId: z.string(), - workspaceId: z.string(), -}).transform((v) => { - return remap$(v, { - createdAt: "created_at", - harSizeBytes: "har_size_bytes", - requestId: "request_id", - workspaceId: "workspace_id", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace UnboundedRequest$ { - /** @deprecated use `UnboundedRequest$inboundSchema` instead. */ - export const inboundSchema = UnboundedRequest$inboundSchema; - /** @deprecated use `UnboundedRequest$outboundSchema` instead. */ - export const outboundSchema = UnboundedRequest$outboundSchema; - /** @deprecated use `UnboundedRequest$Outbound` instead. */ - export type Outbound = UnboundedRequest$Outbound; -} diff --git a/src/sdk/models/shared/usagesnippet.ts b/src/sdk/models/shared/usagesnippet.ts new file mode 100644 index 00000000..c98cf036 --- /dev/null +++ b/src/sdk/models/shared/usagesnippet.ts @@ -0,0 +1,93 @@ +/* + * 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 UsageSnippet = { + /** + * The code snippet + */ + code: string; + /** + * The language of the snippet + */ + language: string; + /** + * The HTTP method of the operation + */ + method?: any | undefined; + /** + * The operation ID for the snippet + */ + operationId: string; + /** + * The path of the operation + */ + path: string; +}; + +/** @internal */ +export const UsageSnippet$inboundSchema: z.ZodType< + UsageSnippet, + z.ZodTypeDef, + unknown +> = z.object({ + code: z.string(), + language: z.string(), + method: z.any().optional(), + operationId: z.string(), + path: z.string(), +}); + +/** @internal */ +export type UsageSnippet$Outbound = { + code: string; + language: string; + method?: any | undefined; + operationId: string; + path: string; +}; + +/** @internal */ +export const UsageSnippet$outboundSchema: z.ZodType< + UsageSnippet$Outbound, + z.ZodTypeDef, + UsageSnippet +> = z.object({ + code: z.string(), + language: z.string(), + method: z.any().optional(), + operationId: z.string(), + path: 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 UsageSnippet$ { + /** @deprecated use `UsageSnippet$inboundSchema` instead. */ + export const inboundSchema = UsageSnippet$inboundSchema; + /** @deprecated use `UsageSnippet$outboundSchema` instead. */ + export const outboundSchema = UsageSnippet$outboundSchema; + /** @deprecated use `UsageSnippet$Outbound` instead. */ + export type Outbound = UsageSnippet$Outbound; +} + +export function usageSnippetToJSON(usageSnippet: UsageSnippet): string { + return JSON.stringify(UsageSnippet$outboundSchema.parse(usageSnippet)); +} + +export function usageSnippetFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UsageSnippet$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UsageSnippet' from JSON`, + ); +} diff --git a/src/sdk/models/shared/usagesnippets.ts b/src/sdk/models/shared/usagesnippets.ts new file mode 100644 index 00000000..216b5cee --- /dev/null +++ b/src/sdk/models/shared/usagesnippets.ts @@ -0,0 +1,68 @@ +/* + * 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 { + UsageSnippet, + UsageSnippet$inboundSchema, + UsageSnippet$Outbound, + UsageSnippet$outboundSchema, +} from "./usagesnippet.js"; + +export type UsageSnippets = { + snippets: Array; +}; + +/** @internal */ +export const UsageSnippets$inboundSchema: z.ZodType< + UsageSnippets, + z.ZodTypeDef, + unknown +> = z.object({ + snippets: z.array(UsageSnippet$inboundSchema), +}); + +/** @internal */ +export type UsageSnippets$Outbound = { + snippets: Array; +}; + +/** @internal */ +export const UsageSnippets$outboundSchema: z.ZodType< + UsageSnippets$Outbound, + z.ZodTypeDef, + UsageSnippets +> = z.object({ + snippets: z.array(UsageSnippet$outboundSchema), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UsageSnippets$ { + /** @deprecated use `UsageSnippets$inboundSchema` instead. */ + export const inboundSchema = UsageSnippets$inboundSchema; + /** @deprecated use `UsageSnippets$outboundSchema` instead. */ + export const outboundSchema = UsageSnippets$outboundSchema; + /** @deprecated use `UsageSnippets$Outbound` instead. */ + export type Outbound = UsageSnippets$Outbound; +} + +export function usageSnippetsToJSON(usageSnippets: UsageSnippets): string { + return JSON.stringify(UsageSnippets$outboundSchema.parse(usageSnippets)); +} + +export function usageSnippetsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UsageSnippets$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UsageSnippets' from JSON`, + ); +} diff --git a/src/sdk/models/shared/user.ts b/src/sdk/models/shared/user.ts index 590acf8e..8af246e8 100644 --- a/src/sdk/models/shared/user.ts +++ b/src/sdk/models/shared/user.ts @@ -4,6 +4,9 @@ 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 User = { /** @@ -38,10 +41,18 @@ export type User = { * GitHub handle of the user. */ githubHandle?: string | null | undefined; + /** + * Indicates whether the user has created an API key. Not always populated + */ + hasCreatedApiKey?: boolean | undefined; /** * Unique identifier for the user. */ id: string; + /** + * Indicates whether the user is internal. + */ + internal?: boolean | undefined; /** * Timestamp of the last login. */ @@ -50,6 +61,10 @@ export type User = { * URL of the user's photo. */ photoUrl?: string | null | undefined; + /** + * Hash used for pylon identity verification returned on v1/user. + */ + pylonIdentityHash?: string | undefined; /** * Timestamp of the user's last update. */ @@ -73,11 +88,14 @@ export const User$inboundSchema: z.ZodType = z email: z.string(), email_verified: z.boolean(), github_handle: z.nullable(z.string()).optional(), + has_created_api_key: z.boolean().optional(), id: z.string(), + internal: z.boolean().optional(), last_login_at: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ).optional(), photo_url: z.nullable(z.string()).optional(), + pylon_identity_hash: z.string().optional(), updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v) ), @@ -89,8 +107,10 @@ export const User$inboundSchema: z.ZodType = z "display_name": "displayName", "email_verified": "emailVerified", "github_handle": "githubHandle", + "has_created_api_key": "hasCreatedApiKey", "last_login_at": "lastLoginAt", "photo_url": "photoUrl", + "pylon_identity_hash": "pylonIdentityHash", "updated_at": "updatedAt", }); }); @@ -105,9 +125,12 @@ export type User$Outbound = { email: string; email_verified: boolean; github_handle?: string | null | undefined; + has_created_api_key?: boolean | undefined; id: string; + internal?: boolean | undefined; last_login_at?: string | null | undefined; photo_url?: string | null | undefined; + pylon_identity_hash?: string | undefined; updated_at: string; whitelisted: boolean; }; @@ -123,10 +146,13 @@ export const User$outboundSchema: z.ZodType = email: z.string(), emailVerified: z.boolean(), githubHandle: z.nullable(z.string()).optional(), + hasCreatedApiKey: z.boolean().optional(), id: z.string(), + internal: z.boolean().optional(), lastLoginAt: z.nullable(z.date().transform(v => v.toISOString())) .optional(), photoUrl: z.nullable(z.string()).optional(), + pylonIdentityHash: z.string().optional(), updatedAt: z.date().transform(v => v.toISOString()), whitelisted: z.boolean(), }).transform((v) => { @@ -136,8 +162,10 @@ export const User$outboundSchema: z.ZodType = displayName: "display_name", emailVerified: "email_verified", githubHandle: "github_handle", + hasCreatedApiKey: "has_created_api_key", lastLoginAt: "last_login_at", photoUrl: "photo_url", + pylonIdentityHash: "pylon_identity_hash", updatedAt: "updated_at", }); }); @@ -154,3 +182,17 @@ export namespace User$ { /** @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/sdk/models/shared/v2descriptor.ts b/src/sdk/models/shared/v2descriptor.ts index 3c6e8ccb..781484cc 100644 --- a/src/sdk/models/shared/v2descriptor.ts +++ b/src/sdk/models/shared/v2descriptor.ts @@ -3,6 +3,9 @@ */ 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 { Annotations, Annotations$inboundSchema, @@ -76,3 +79,17 @@ export namespace V2Descriptor$ { /** @deprecated use `V2Descriptor$Outbound` instead. */ export type Outbound = V2Descriptor$Outbound; } + +export function v2DescriptorToJSON(v2Descriptor: V2Descriptor): string { + return JSON.stringify(V2Descriptor$outboundSchema.parse(v2Descriptor)); +} + +export function v2DescriptorFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => V2Descriptor$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'V2Descriptor' from JSON`, + ); +} diff --git a/src/sdk/models/shared/versionmetadata.ts b/src/sdk/models/shared/versionmetadata.ts deleted file mode 100644 index 95b25e7a..00000000 --- a/src/sdk/models/shared/versionmetadata.ts +++ /dev/null @@ -1,105 +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"; - -/** - * A set of keys and associated values, attached to a particular version of an Api. - */ -export type VersionMetadata = { - /** - * The ID of the Api this Metadata belongs to. - */ - apiId: string; - /** - * Creation timestamp. - */ - createdAt: Date; - /** - * The key for this metadata. - */ - metaKey: string; - /** - * One of the values for this metadata. - */ - metaValue: string; - /** - * The version ID of the Api this Metadata belongs to. - */ - versionId: string; - /** - * The workspace ID this Metadata belongs to. - */ - workspaceId: string; -}; - -/** @internal */ -export const VersionMetadata$inboundSchema: z.ZodType< - VersionMetadata, - z.ZodTypeDef, - unknown -> = z.object({ - api_id: z.string(), - created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), - meta_key: z.string(), - meta_value: z.string(), - version_id: z.string(), - workspace_id: z.string(), -}).transform((v) => { - return remap$(v, { - "api_id": "apiId", - "created_at": "createdAt", - "meta_key": "metaKey", - "meta_value": "metaValue", - "version_id": "versionId", - "workspace_id": "workspaceId", - }); -}); - -/** @internal */ -export type VersionMetadata$Outbound = { - api_id: string; - created_at: string; - meta_key: string; - meta_value: string; - version_id: string; - workspace_id: string; -}; - -/** @internal */ -export const VersionMetadata$outboundSchema: z.ZodType< - VersionMetadata$Outbound, - z.ZodTypeDef, - VersionMetadata -> = z.object({ - apiId: z.string(), - createdAt: z.date().transform(v => v.toISOString()), - metaKey: z.string(), - metaValue: z.string(), - versionId: z.string(), - workspaceId: z.string(), -}).transform((v) => { - return remap$(v, { - apiId: "api_id", - createdAt: "created_at", - metaKey: "meta_key", - metaValue: "meta_value", - versionId: "version_id", - workspaceId: "workspace_id", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace VersionMetadata$ { - /** @deprecated use `VersionMetadata$inboundSchema` instead. */ - export const inboundSchema = VersionMetadata$inboundSchema; - /** @deprecated use `VersionMetadata$outboundSchema` instead. */ - export const outboundSchema = VersionMetadata$outboundSchema; - /** @deprecated use `VersionMetadata$Outbound` instead. */ - export type Outbound = VersionMetadata$Outbound; -} diff --git a/src/sdk/models/shared/versionmetadatainput.ts b/src/sdk/models/shared/versionmetadatainput.ts deleted file mode 100644 index 8ac91124..00000000 --- a/src/sdk/models/shared/versionmetadatainput.ts +++ /dev/null @@ -1,69 +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"; - -/** - * A set of keys and associated values, attached to a particular version of an Api. - */ -export type VersionMetadataInput = { - /** - * The key for this metadata. - */ - metaKey: string; - /** - * One of the values for this metadata. - */ - metaValue: string; -}; - -/** @internal */ -export const VersionMetadataInput$inboundSchema: z.ZodType< - VersionMetadataInput, - z.ZodTypeDef, - unknown -> = z.object({ - meta_key: z.string(), - meta_value: z.string(), -}).transform((v) => { - return remap$(v, { - "meta_key": "metaKey", - "meta_value": "metaValue", - }); -}); - -/** @internal */ -export type VersionMetadataInput$Outbound = { - meta_key: string; - meta_value: string; -}; - -/** @internal */ -export const VersionMetadataInput$outboundSchema: z.ZodType< - VersionMetadataInput$Outbound, - z.ZodTypeDef, - VersionMetadataInput -> = z.object({ - metaKey: z.string(), - metaValue: z.string(), -}).transform((v) => { - return remap$(v, { - metaKey: "meta_key", - metaValue: "meta_value", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace VersionMetadataInput$ { - /** @deprecated use `VersionMetadataInput$inboundSchema` instead. */ - export const inboundSchema = VersionMetadataInput$inboundSchema; - /** @deprecated use `VersionMetadataInput$outboundSchema` instead. */ - export const outboundSchema = VersionMetadataInput$outboundSchema; - /** @deprecated use `VersionMetadataInput$Outbound` instead. */ - export type Outbound = VersionMetadataInput$Outbound; -} diff --git a/src/sdk/models/shared/workflowdocument.ts b/src/sdk/models/shared/workflowdocument.ts index aac27ec8..ef018ea6 100644 --- a/src/sdk/models/shared/workflowdocument.ts +++ b/src/sdk/models/shared/workflowdocument.ts @@ -3,6 +3,9 @@ */ 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 Auth = { header: string; @@ -50,6 +53,20 @@ export namespace Auth$ { export type Outbound = Auth$Outbound; } +export function authToJSON(auth: Auth): string { + return JSON.stringify(Auth$outboundSchema.parse(auth)); +} + +export function authFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Auth$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Auth' from JSON`, + ); +} + /** @internal */ export const WorkflowDocument$inboundSchema: z.ZodType< WorkflowDocument, @@ -88,3 +105,21 @@ export namespace WorkflowDocument$ { /** @deprecated use `WorkflowDocument$Outbound` instead. */ export type Outbound = WorkflowDocument$Outbound; } + +export function workflowDocumentToJSON( + workflowDocument: WorkflowDocument, +): string { + return JSON.stringify( + WorkflowDocument$outboundSchema.parse(workflowDocument), + ); +} + +export function workflowDocumentFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => WorkflowDocument$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'WorkflowDocument' from JSON`, + ); +} diff --git a/src/sdk/models/shared/workspace.ts b/src/sdk/models/shared/workspace.ts index a44e8f58..cdf9a0d9 100644 --- a/src/sdk/models/shared/workspace.ts +++ b/src/sdk/models/shared/workspace.ts @@ -4,6 +4,9 @@ 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"; /** * A speakeasy workspace @@ -11,12 +14,16 @@ import { remap as remap$ } from "../../../lib/primitives.js"; export type Workspace = { createdAt: Date; id: string; + inactive?: boolean | undefined; name: string; - ociRepo?: string | null | undefined; - ociRepoCreatedAt?: Date | null | undefined; organizationId: string; slug: string; - telemetryDisabled: boolean; + /** + * Deprecated. Use organization.telemetry_disabled instead. + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + telemetryDisabled?: boolean | undefined; updatedAt: Date; verified: boolean; }; @@ -29,21 +36,16 @@ export const Workspace$inboundSchema: z.ZodType< > = z.object({ created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), id: z.string(), + inactive: z.boolean().optional(), name: z.string(), - oci_repo: z.nullable(z.string()).optional(), - oci_repo_created_at: z.nullable( - z.string().datetime({ offset: true }).transform(v => new Date(v)), - ).optional(), organization_id: z.string(), slug: z.string(), - telemetry_disabled: z.boolean(), + telemetry_disabled: z.boolean().optional(), updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), verified: z.boolean(), }).transform((v) => { return remap$(v, { "created_at": "createdAt", - "oci_repo": "ociRepo", - "oci_repo_created_at": "ociRepoCreatedAt", "organization_id": "organizationId", "telemetry_disabled": "telemetryDisabled", "updated_at": "updatedAt", @@ -54,12 +56,11 @@ export const Workspace$inboundSchema: z.ZodType< export type Workspace$Outbound = { created_at: string; id: string; + inactive?: boolean | undefined; name: string; - oci_repo?: string | null | undefined; - oci_repo_created_at?: string | null | undefined; organization_id: string; slug: string; - telemetry_disabled: boolean; + telemetry_disabled?: boolean | undefined; updated_at: string; verified: boolean; }; @@ -72,20 +73,16 @@ export const Workspace$outboundSchema: z.ZodType< > = z.object({ createdAt: z.date().transform(v => v.toISOString()), id: z.string(), + inactive: z.boolean().optional(), name: z.string(), - ociRepo: z.nullable(z.string()).optional(), - ociRepoCreatedAt: z.nullable(z.date().transform(v => v.toISOString())) - .optional(), organizationId: z.string(), slug: z.string(), - telemetryDisabled: z.boolean(), + telemetryDisabled: z.boolean().optional(), updatedAt: z.date().transform(v => v.toISOString()), verified: z.boolean(), }).transform((v) => { return remap$(v, { createdAt: "created_at", - ociRepo: "oci_repo", - ociRepoCreatedAt: "oci_repo_created_at", organizationId: "organization_id", telemetryDisabled: "telemetry_disabled", updatedAt: "updated_at", @@ -104,3 +101,17 @@ export namespace Workspace$ { /** @deprecated use `Workspace$Outbound` instead. */ export type Outbound = Workspace$Outbound; } + +export function workspaceToJSON(workspace: Workspace): string { + return JSON.stringify(Workspace$outboundSchema.parse(workspace)); +} + +export function workspaceFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Workspace$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Workspace' from JSON`, + ); +} diff --git a/src/sdk/models/shared/workspaceandorganization.ts b/src/sdk/models/shared/workspaceandorganization.ts index cf9ec331..33d221f5 100644 --- a/src/sdk/models/shared/workspaceandorganization.ts +++ b/src/sdk/models/shared/workspaceandorganization.ts @@ -3,6 +3,9 @@ */ 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 { Organization, Organization$inboundSchema, @@ -68,3 +71,21 @@ export namespace WorkspaceAndOrganization$ { /** @deprecated use `WorkspaceAndOrganization$Outbound` instead. */ export type Outbound = WorkspaceAndOrganization$Outbound; } + +export function workspaceAndOrganizationToJSON( + workspaceAndOrganization: WorkspaceAndOrganization, +): string { + return JSON.stringify( + WorkspaceAndOrganization$outboundSchema.parse(workspaceAndOrganization), + ); +} + +export function workspaceAndOrganizationFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => WorkspaceAndOrganization$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'WorkspaceAndOrganization' from JSON`, + ); +} diff --git a/src/sdk/models/shared/workspacefeatureflag.ts b/src/sdk/models/shared/workspacefeatureflag.ts new file mode 100644 index 00000000..e7ae8cbf --- /dev/null +++ b/src/sdk/models/shared/workspacefeatureflag.ts @@ -0,0 +1,56 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { + catchUnrecognizedEnum, + OpenEnum, + Unrecognized, +} from "../../types/enums.js"; + +/** + * enum value workspace feature flag + */ +export const WorkspaceFeatureFlag = { + SchemaRegistry: "schema_registry", + ChangesReport: "changes_report", + SkipSchemaRegistry: "skip_schema_registry", + Webhooks: "webhooks", +} as const; +/** + * enum value workspace feature flag + */ +export type WorkspaceFeatureFlag = OpenEnum; + +/** @internal */ +export const WorkspaceFeatureFlag$inboundSchema: z.ZodType< + WorkspaceFeatureFlag, + z.ZodTypeDef, + unknown +> = z + .union([ + z.nativeEnum(WorkspaceFeatureFlag), + z.string().transform(catchUnrecognizedEnum), + ]); + +/** @internal */ +export const WorkspaceFeatureFlag$outboundSchema: z.ZodType< + WorkspaceFeatureFlag, + z.ZodTypeDef, + WorkspaceFeatureFlag +> = z.union([ + z.nativeEnum(WorkspaceFeatureFlag), + z.string().and(z.custom>()), +]); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace WorkspaceFeatureFlag$ { + /** @deprecated use `WorkspaceFeatureFlag$inboundSchema` instead. */ + export const inboundSchema = WorkspaceFeatureFlag$inboundSchema; + /** @deprecated use `WorkspaceFeatureFlag$outboundSchema` instead. */ + export const outboundSchema = WorkspaceFeatureFlag$outboundSchema; +} diff --git a/src/sdk/models/shared/workspacefeatureflagrequest.ts b/src/sdk/models/shared/workspacefeatureflagrequest.ts new file mode 100644 index 00000000..adf8f8f2 --- /dev/null +++ b/src/sdk/models/shared/workspacefeatureflagrequest.ts @@ -0,0 +1,85 @@ +/* + * 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"; +import { + WorkspaceFeatureFlag, + WorkspaceFeatureFlag$inboundSchema, + WorkspaceFeatureFlag$outboundSchema, +} from "./workspacefeatureflag.js"; + +/** + * A request to add workspace feature flags + */ +export type WorkspaceFeatureFlagRequest = { + featureFlags: Array; +}; + +/** @internal */ +export const WorkspaceFeatureFlagRequest$inboundSchema: z.ZodType< + WorkspaceFeatureFlagRequest, + z.ZodTypeDef, + unknown +> = z.object({ + feature_flags: z.array(WorkspaceFeatureFlag$inboundSchema), +}).transform((v) => { + return remap$(v, { + "feature_flags": "featureFlags", + }); +}); + +/** @internal */ +export type WorkspaceFeatureFlagRequest$Outbound = { + feature_flags: Array; +}; + +/** @internal */ +export const WorkspaceFeatureFlagRequest$outboundSchema: z.ZodType< + WorkspaceFeatureFlagRequest$Outbound, + z.ZodTypeDef, + WorkspaceFeatureFlagRequest +> = z.object({ + featureFlags: z.array(WorkspaceFeatureFlag$outboundSchema), +}).transform((v) => { + return remap$(v, { + featureFlags: "feature_flags", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace WorkspaceFeatureFlagRequest$ { + /** @deprecated use `WorkspaceFeatureFlagRequest$inboundSchema` instead. */ + export const inboundSchema = WorkspaceFeatureFlagRequest$inboundSchema; + /** @deprecated use `WorkspaceFeatureFlagRequest$outboundSchema` instead. */ + export const outboundSchema = WorkspaceFeatureFlagRequest$outboundSchema; + /** @deprecated use `WorkspaceFeatureFlagRequest$Outbound` instead. */ + export type Outbound = WorkspaceFeatureFlagRequest$Outbound; +} + +export function workspaceFeatureFlagRequestToJSON( + workspaceFeatureFlagRequest: WorkspaceFeatureFlagRequest, +): string { + return JSON.stringify( + WorkspaceFeatureFlagRequest$outboundSchema.parse( + workspaceFeatureFlagRequest, + ), + ); +} + +export function workspaceFeatureFlagRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => WorkspaceFeatureFlagRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'WorkspaceFeatureFlagRequest' from JSON`, + ); +} diff --git a/src/sdk/models/shared/workspacefeatureflagresponse.ts b/src/sdk/models/shared/workspacefeatureflagresponse.ts index 7f2c7d47..74c98d98 100644 --- a/src/sdk/models/shared/workspacefeatureflagresponse.ts +++ b/src/sdk/models/shared/workspacefeatureflagresponse.ts @@ -4,6 +4,9 @@ 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"; import { FeatureFlag, FeatureFlag$inboundSchema, @@ -61,3 +64,23 @@ export namespace WorkspaceFeatureFlagResponse$ { /** @deprecated use `WorkspaceFeatureFlagResponse$Outbound` instead. */ export type Outbound = WorkspaceFeatureFlagResponse$Outbound; } + +export function workspaceFeatureFlagResponseToJSON( + workspaceFeatureFlagResponse: WorkspaceFeatureFlagResponse, +): string { + return JSON.stringify( + WorkspaceFeatureFlagResponse$outboundSchema.parse( + workspaceFeatureFlagResponse, + ), + ); +} + +export function workspaceFeatureFlagResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => WorkspaceFeatureFlagResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'WorkspaceFeatureFlagResponse' from JSON`, + ); +} diff --git a/src/sdk/models/shared/workspaceinviteresponse.ts b/src/sdk/models/shared/workspaceinviteresponse.ts index 8e58e822..9b4a721e 100644 --- a/src/sdk/models/shared/workspaceinviteresponse.ts +++ b/src/sdk/models/shared/workspaceinviteresponse.ts @@ -4,6 +4,9 @@ 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 Relationship = { userId: string; @@ -67,6 +70,20 @@ export namespace Relationship$ { export type Outbound = Relationship$Outbound; } +export function relationshipToJSON(relationship: Relationship): string { + return JSON.stringify(Relationship$outboundSchema.parse(relationship)); +} + +export function relationshipFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Relationship$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Relationship' from JSON`, + ); +} + /** @internal */ export const WorkspaceInviteResponse$inboundSchema: z.ZodType< WorkspaceInviteResponse, @@ -113,3 +130,21 @@ export namespace WorkspaceInviteResponse$ { /** @deprecated use `WorkspaceInviteResponse$Outbound` instead. */ export type Outbound = WorkspaceInviteResponse$Outbound; } + +export function workspaceInviteResponseToJSON( + workspaceInviteResponse: WorkspaceInviteResponse, +): string { + return JSON.stringify( + WorkspaceInviteResponse$outboundSchema.parse(workspaceInviteResponse), + ); +} + +export function workspaceInviteResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => WorkspaceInviteResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'WorkspaceInviteResponse' from JSON`, + ); +} diff --git a/src/sdk/models/shared/workspacesettings.ts b/src/sdk/models/shared/workspacesettings.ts index 81490755..4a8b36c5 100644 --- a/src/sdk/models/shared/workspacesettings.ts +++ b/src/sdk/models/shared/workspacesettings.ts @@ -4,9 +4,14 @@ 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 WorkspaceSettings = { - webhookUrl?: string | undefined; + createdAt: Date; + updatedAt: Date; + webhookUrl: string; workspaceId: string; }; @@ -16,10 +21,14 @@ export const WorkspaceSettings$inboundSchema: z.ZodType< z.ZodTypeDef, unknown > = z.object({ - webhook_url: z.string().optional(), + created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), + updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), + webhook_url: z.string(), workspace_id: z.string(), }).transform((v) => { return remap$(v, { + "created_at": "createdAt", + "updated_at": "updatedAt", "webhook_url": "webhookUrl", "workspace_id": "workspaceId", }); @@ -27,7 +36,9 @@ export const WorkspaceSettings$inboundSchema: z.ZodType< /** @internal */ export type WorkspaceSettings$Outbound = { - webhook_url?: string | undefined; + created_at: string; + updated_at: string; + webhook_url: string; workspace_id: string; }; @@ -37,10 +48,14 @@ export const WorkspaceSettings$outboundSchema: z.ZodType< z.ZodTypeDef, WorkspaceSettings > = z.object({ - webhookUrl: z.string().optional(), + createdAt: z.date().transform(v => v.toISOString()), + updatedAt: z.date().transform(v => v.toISOString()), + webhookUrl: z.string(), workspaceId: z.string(), }).transform((v) => { return remap$(v, { + createdAt: "created_at", + updatedAt: "updated_at", webhookUrl: "webhook_url", workspaceId: "workspace_id", }); @@ -58,3 +73,21 @@ export namespace WorkspaceSettings$ { /** @deprecated use `WorkspaceSettings$Outbound` instead. */ export type Outbound = WorkspaceSettings$Outbound; } + +export function workspaceSettingsToJSON( + workspaceSettings: WorkspaceSettings, +): string { + return JSON.stringify( + WorkspaceSettings$outboundSchema.parse(workspaceSettings), + ); +} + +export function workspaceSettingsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => WorkspaceSettings$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'WorkspaceSettings' from JSON`, + ); +} diff --git a/src/sdk/models/shared/workspaceteamresponse.ts b/src/sdk/models/shared/workspaceteamresponse.ts index 639020b7..dc205dbc 100644 --- a/src/sdk/models/shared/workspaceteamresponse.ts +++ b/src/sdk/models/shared/workspaceteamresponse.ts @@ -4,6 +4,9 @@ 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"; import { SSOMetadata, SSOMetadata$inboundSchema, @@ -74,3 +77,21 @@ export namespace WorkspaceTeamResponse$ { /** @deprecated use `WorkspaceTeamResponse$Outbound` instead. */ export type Outbound = WorkspaceTeamResponse$Outbound; } + +export function workspaceTeamResponseToJSON( + workspaceTeamResponse: WorkspaceTeamResponse, +): string { + return JSON.stringify( + WorkspaceTeamResponse$outboundSchema.parse(workspaceTeamResponse), + ); +} + +export function workspaceTeamResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => WorkspaceTeamResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'WorkspaceTeamResponse' from JSON`, + ); +} diff --git a/src/sdk/models/shared/workspacetoken.ts b/src/sdk/models/shared/workspacetoken.ts index e5629d86..4b19cdc6 100644 --- a/src/sdk/models/shared/workspacetoken.ts +++ b/src/sdk/models/shared/workspacetoken.ts @@ -4,20 +4,25 @@ 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"; /** * A workspace token */ export type WorkspaceToken = { alg: string; - createdAt: string; + createdAt: Date; createdBy?: string | null | undefined; + createdByName?: string | null | undefined; + createdByPhotoUrl?: string | null | undefined; email?: string | null | undefined; id: string; key: string; - lastUsed?: string | null | undefined; + lastUsed?: Date | null | undefined; name: string; - workspaceId?: string | undefined; + workspaceId: string; }; /** @internal */ @@ -27,18 +32,24 @@ export const WorkspaceToken$inboundSchema: z.ZodType< unknown > = z.object({ alg: z.string(), - created_at: z.string(), + created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), created_by: z.nullable(z.string()).optional(), + created_by_name: z.nullable(z.string()).optional(), + created_by_photo_url: z.nullable(z.string()).optional(), email: z.nullable(z.string()).optional(), id: z.string(), key: z.string(), - last_used: z.nullable(z.string()).optional(), + last_used: z.nullable( + z.string().datetime({ offset: true }).transform(v => new Date(v)), + ).optional(), name: z.string(), - workspace_id: z.string().optional(), + workspace_id: z.string(), }).transform((v) => { return remap$(v, { "created_at": "createdAt", "created_by": "createdBy", + "created_by_name": "createdByName", + "created_by_photo_url": "createdByPhotoUrl", "last_used": "lastUsed", "workspace_id": "workspaceId", }); @@ -49,12 +60,14 @@ export type WorkspaceToken$Outbound = { alg: string; created_at: string; created_by?: string | null | undefined; + created_by_name?: string | null | undefined; + created_by_photo_url?: string | null | undefined; email?: string | null | undefined; id: string; key: string; last_used?: string | null | undefined; name: string; - workspace_id?: string | undefined; + workspace_id: string; }; /** @internal */ @@ -64,18 +77,22 @@ export const WorkspaceToken$outboundSchema: z.ZodType< WorkspaceToken > = z.object({ alg: z.string(), - createdAt: z.string(), + createdAt: z.date().transform(v => v.toISOString()), createdBy: z.nullable(z.string()).optional(), + createdByName: z.nullable(z.string()).optional(), + createdByPhotoUrl: z.nullable(z.string()).optional(), email: z.nullable(z.string()).optional(), id: z.string(), key: z.string(), - lastUsed: z.nullable(z.string()).optional(), + lastUsed: z.nullable(z.date().transform(v => v.toISOString())).optional(), name: z.string(), - workspaceId: z.string().optional(), + workspaceId: z.string(), }).transform((v) => { return remap$(v, { createdAt: "created_at", createdBy: "created_by", + createdByName: "created_by_name", + createdByPhotoUrl: "created_by_photo_url", lastUsed: "last_used", workspaceId: "workspace_id", }); @@ -93,3 +110,17 @@ export namespace WorkspaceToken$ { /** @deprecated use `WorkspaceToken$Outbound` instead. */ export type Outbound = WorkspaceToken$Outbound; } + +export function workspaceTokenToJSON(workspaceToken: WorkspaceToken): string { + return JSON.stringify(WorkspaceToken$outboundSchema.parse(workspaceToken)); +} + +export function workspaceTokenFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => WorkspaceToken$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'WorkspaceToken' from JSON`, + ); +} diff --git a/src/sdk/organizations.ts b/src/sdk/organizations.ts index 41c42c7b..4f555d16 100644 --- a/src/sdk/organizations.ts +++ b/src/sdk/organizations.ts @@ -3,9 +3,12 @@ */ import { organizationsCreate } from "../funcs/organizationsCreate.js"; +import { organizationsCreateBillingAddOns } from "../funcs/organizationsCreateBillingAddOns.js"; import { organizationsCreateFreeTrial } from "../funcs/organizationsCreateFreeTrial.js"; +import { organizationsDeleteBillingAddOn } from "../funcs/organizationsDeleteBillingAddOn.js"; import { organizationsGet } from "../funcs/organizationsGet.js"; import { organizationsGetAll } from "../funcs/organizationsGetAll.js"; +import { organizationsGetBillingAddOns } from "../funcs/organizationsGetBillingAddOns.js"; import { organizationsGetUsage } from "../funcs/organizationsGetUsage.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as operations from "./models/operations/index.js"; @@ -30,6 +33,20 @@ export class Organizations extends ClientSDK { )); } + /** + * Create billing add ons + */ + async createBillingAddOns( + request: shared.OrganizationBillingAddOnRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(organizationsCreateBillingAddOns( + this, + request, + options, + )); + } + /** * Create a free trial for an organization * @@ -45,6 +62,20 @@ export class Organizations extends ClientSDK { )); } + /** + * Delete billing add ons + */ + async deleteBillingAddOn( + request: operations.DeleteBillingAddOnRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(organizationsDeleteBillingAddOn( + this, + request, + options, + )); + } + /** * Get organization * @@ -77,6 +108,18 @@ export class Organizations extends ClientSDK { )); } + /** + * Get billing add ons + */ + async getBillingAddOns( + options?: RequestOptions, + ): Promise { + return unwrapAsync(organizationsGetBillingAddOns( + this, + options, + )); + } + /** * Get billing usage summary for a particular organization * diff --git a/src/sdk/requests.ts b/src/sdk/requests.ts deleted file mode 100644 index 016c8cfc..00000000 --- a/src/sdk/requests.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { - GenerateRequestPostmanCollectionAcceptEnum, - requestsGenerateRequestPostmanCollection, -} from "../funcs/requestsGenerateRequestPostmanCollection.js"; -import { requestsGetRequestFromEventLog } from "../funcs/requestsGetRequestFromEventLog.js"; -import { requestsQueryEventLog } from "../funcs/requestsQueryEventLog.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export { GenerateRequestPostmanCollectionAcceptEnum } from "../funcs/requestsGenerateRequestPostmanCollection.js"; - -export class Requests extends ClientSDK { - /** - * Generate a Postman collection for a particular request. - * - * @remarks - * Generates a Postman collection for a particular request. - * Allowing it to be replayed with the same inputs that were captured by the SDK. - */ - async generateRequestPostmanCollection( - request: operations.GenerateRequestPostmanCollectionRequest, - options?: RequestOptions & { - acceptHeaderOverride?: GenerateRequestPostmanCollectionAcceptEnum; - }, - ): Promise { - return unwrapAsync(requestsGenerateRequestPostmanCollection( - this, - request, - options, - )); - } - - /** - * Get information about a particular request. - */ - async getRequestFromEventLog( - request: operations.GetRequestFromEventLogRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(requestsGetRequestFromEventLog( - this, - request, - options, - )); - } - - /** - * Query the event log to retrieve a list of requests. - * - * @remarks - * Supports retrieving a list of request captured by the SDK for this workspace. - * Allows the filtering of requests on a number of criteria such as ApiID, VersionID, Path, Method, etc. - */ - async queryEventLog( - request: operations.QueryEventLogRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(requestsQueryEventLog( - this, - request, - options, - )); - } -} diff --git a/src/sdk/schemas.ts b/src/sdk/schemas.ts deleted file mode 100644 index 76ff200d..00000000 --- a/src/sdk/schemas.ts +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { schemasDeleteSchema } from "../funcs/schemasDeleteSchema.js"; -import { - DownloadSchemaAcceptEnum, - schemasDownloadSchema, -} from "../funcs/schemasDownloadSchema.js"; -import { - DownloadSchemaRevisionAcceptEnum, - schemasDownloadSchemaRevision, -} from "../funcs/schemasDownloadSchemaRevision.js"; -import { schemasGetSchema } from "../funcs/schemasGetSchema.js"; -import { schemasGetSchemaDiff } from "../funcs/schemasGetSchemaDiff.js"; -import { schemasGetSchemaRevision } from "../funcs/schemasGetSchemaRevision.js"; -import { schemasGetSchemas } from "../funcs/schemasGetSchemas.js"; -import { schemasRegisterSchema } from "../funcs/schemasRegisterSchema.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export { DownloadSchemaAcceptEnum } from "../funcs/schemasDownloadSchema.js"; - -export { DownloadSchemaRevisionAcceptEnum } from "../funcs/schemasDownloadSchemaRevision.js"; - -export class Schemas extends ClientSDK { - /** - * Delete a particular schema revision for an Api. - */ - async deleteSchema( - request: operations.DeleteSchemaRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(schemasDeleteSchema( - this, - request, - options, - )); - } - - /** - * Download the latest schema for a particular apiID. - */ - async downloadSchema( - request: operations.DownloadSchemaRequest, - options?: RequestOptions & { - acceptHeaderOverride?: DownloadSchemaAcceptEnum; - }, - ): Promise { - return unwrapAsync(schemasDownloadSchema( - this, - request, - options, - )); - } - - /** - * Download a particular schema revision for an Api. - */ - async downloadSchemaRevision( - request: operations.DownloadSchemaRevisionRequest, - options?: RequestOptions & { - acceptHeaderOverride?: DownloadSchemaRevisionAcceptEnum; - }, - ): Promise { - return unwrapAsync(schemasDownloadSchemaRevision( - this, - request, - options, - )); - } - - /** - * Get information about the latest schema. - * - * @remarks - * Returns information about the last uploaded schema for a particular API version. - * This won't include the schema itself, that can be retrieved via the downloadSchema operation. - */ - async getSchema( - request: operations.GetSchemaRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(schemasGetSchema( - this, - request, - options, - )); - } - - /** - * Get a diff of two schema revisions for an Api. - */ - async getSchemaDiff( - request: operations.GetSchemaDiffRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(schemasGetSchemaDiff( - this, - request, - options, - )); - } - - /** - * Get information about a particular schema revision for an Api. - * - * @remarks - * Returns information about the last uploaded schema for a particular schema revision. - * This won't include the schema itself, that can be retrieved via the downloadSchema operation. - */ - async getSchemaRevision( - request: operations.GetSchemaRevisionRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(schemasGetSchemaRevision( - this, - request, - options, - )); - } - - /** - * Get information about all schemas associated with a particular apiID. - * - * @remarks - * Returns information the schemas associated with a particular apiID. - * This won't include the schemas themselves, they can be retrieved via the downloadSchema operation. - */ - async getSchemas( - request: operations.GetSchemasRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(schemasGetSchemas( - this, - request, - options, - )); - } - - /** - * Register a schema. - * - * @remarks - * Allows uploading a schema for a particular API version. - * This will be used to populate ApiEndpoints and used as a base for any schema generation if present. - */ - async registerSchema( - request: operations.RegisterSchemaRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(schemasRegisterSchema( - this, - request, - options, - )); - } -} diff --git a/src/sdk/schemastore.ts b/src/sdk/schemastore.ts new file mode 100644 index 00000000..d792c26c --- /dev/null +++ b/src/sdk/schemastore.ts @@ -0,0 +1,24 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { schemaStoreCreateSchemaStoreItem } from "../funcs/schemaStoreCreateSchemaStoreItem.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as operations from "./models/operations/index.js"; +import { unwrapAsync } from "./types/fp.js"; + +export class SchemaStore extends ClientSDK { + /** + * Create a schema in the schema store + */ + async createSchemaStoreItem( + request: operations.CreateSchemaStoreItemRequestBody, + options?: RequestOptions, + ): Promise { + return unwrapAsync(schemaStoreCreateSchemaStoreItem( + this, + request, + options, + )); + } +} diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts index 1769a1ff..2e15a40a 100644 --- a/src/sdk/sdk.ts +++ b/src/sdk/sdk.ts @@ -3,43 +3,20 @@ */ import { ClientSDK } from "../lib/sdks.js"; -import { ApiEndpoints } from "./apiendpoints.js"; -import { Apis } from "./apis.js"; import { Artifacts } from "./artifacts.js"; import { Auth } from "./auth.js"; -import { Embeds } from "./embeds.js"; +import { CodeSamples } from "./codesamples.js"; import { Events } from "./events.js"; import { Github } from "./github.js"; -import { Metadata } from "./metadata.js"; import { Organizations } from "./organizations.js"; import { Reports } from "./reports.js"; -import { Requests } from "./requests.js"; -import { Schemas } from "./schemas.js"; +import { SchemaStore } from "./schemastore.js"; import { ShortURLs } from "./shorturls.js"; +import { Subscriptions } from "./subscriptions.js"; import { Suggest } from "./suggest.js"; import { Workspaces } from "./workspaces.js"; export class Speakeasy extends ClientSDK { - private _apis?: Apis; - get apis(): Apis { - return (this._apis ??= new Apis(this._options)); - } - - private _apiEndpoints?: ApiEndpoints; - get apiEndpoints(): ApiEndpoints { - return (this._apiEndpoints ??= new ApiEndpoints(this._options)); - } - - private _metadata?: Metadata; - get metadata(): Metadata { - return (this._metadata ??= new Metadata(this._options)); - } - - private _schemas?: Schemas; - get schemas(): Schemas { - return (this._schemas ??= new Schemas(this._options)); - } - private _artifacts?: Artifacts; get artifacts(): Artifacts { return (this._artifacts ??= new Artifacts(this._options)); @@ -50,9 +27,9 @@ export class Speakeasy extends ClientSDK { return (this._auth ??= new Auth(this._options)); } - private _requests?: Requests; - get requests(): Requests { - return (this._requests ??= new Requests(this._options)); + private _codeSamples?: CodeSamples; + get codeSamples(): CodeSamples { + return (this._codeSamples ??= new CodeSamples(this._options)); } private _github?: Github; @@ -70,11 +47,21 @@ export class Speakeasy extends ClientSDK { return (this._reports ??= new Reports(this._options)); } + private _schemaStore?: SchemaStore; + get schemaStore(): SchemaStore { + return (this._schemaStore ??= new SchemaStore(this._options)); + } + private _shortURLs?: ShortURLs; get shortURLs(): ShortURLs { return (this._shortURLs ??= new ShortURLs(this._options)); } + private _subscriptions?: Subscriptions; + get subscriptions(): Subscriptions { + return (this._subscriptions ??= new Subscriptions(this._options)); + } + private _suggest?: Suggest; get suggest(): Suggest { return (this._suggest ??= new Suggest(this._options)); @@ -85,11 +72,6 @@ export class Speakeasy extends ClientSDK { return (this._workspaces ??= new Workspaces(this._options)); } - private _embeds?: Embeds; - get embeds(): Embeds { - return (this._embeds ??= new Embeds(this._options)); - } - private _events?: Events; get events(): Events { return (this._events ??= new Events(this._options)); diff --git a/src/sdk/subscriptions.ts b/src/sdk/subscriptions.ts new file mode 100644 index 00000000..c2cf4b95 --- /dev/null +++ b/src/sdk/subscriptions.ts @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { subscriptionsActivateSubscriptionNamespace } from "../funcs/subscriptionsActivateSubscriptionNamespace.js"; +import { subscriptionsIgnoreSubscriptionNamespace } from "../funcs/subscriptionsIgnoreSubscriptionNamespace.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as operations from "./models/operations/index.js"; +import * as shared from "./models/shared/index.js"; +import { unwrapAsync } from "./types/fp.js"; + +export class Subscriptions extends ClientSDK { + /** + * Activate an ignored namespace for a subscription + */ + async activateSubscriptionNamespace( + request: operations.ActivateSubscriptionNamespaceRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(subscriptionsActivateSubscriptionNamespace( + this, + request, + options, + )); + } + + /** + * Ignored a namespace for a subscription + */ + async ignoreSubscriptionNamespace( + request: operations.IgnoreSubscriptionNamespaceRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(subscriptionsIgnoreSubscriptionNamespace( + this, + request, + options, + )); + } +} diff --git a/src/sdk/suggest.ts b/src/sdk/suggest.ts index b5be5ba1..63cb3d5e 100644 --- a/src/sdk/suggest.ts +++ b/src/sdk/suggest.ts @@ -3,10 +3,12 @@ */ import { suggestSuggest } from "../funcs/suggestSuggest.js"; +import { suggestSuggestItems } from "../funcs/suggestSuggestItems.js"; import { suggestSuggestOpenAPI } from "../funcs/suggestSuggestOpenAPI.js"; import { suggestSuggestOpenAPIRegistry } from "../funcs/suggestSuggestOpenAPIRegistry.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as operations from "./models/operations/index.js"; +import * as shared from "./models/shared/index.js"; import { unwrapAsync } from "./types/fp.js"; export class Suggest extends ClientSDK { @@ -27,6 +29,20 @@ export class Suggest extends ClientSDK { )); } + /** + * Generate generic suggestions for a list of items. + */ + async suggestItems( + request: shared.SuggestItemsRequestBody, + options?: RequestOptions, + ): Promise> { + return unwrapAsync(suggestSuggestItems( + this, + request, + options, + )); + } + /** * (DEPRECATED) Generate suggestions for improving an OpenAPI document. * diff --git a/src/sdk/types/async.ts b/src/sdk/types/async.ts new file mode 100644 index 00000000..689dba5d --- /dev/null +++ b/src/sdk/types/async.ts @@ -0,0 +1,68 @@ +/* + * 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/sdk/types/operations.ts b/src/sdk/types/operations.ts index 0952f6f4..beb81e10 100644 --- a/src/sdk/types/operations.ts +++ b/src/sdk/types/operations.ts @@ -6,9 +6,10 @@ import { Result } from "./fp.js"; export type Paginator = () => Promise }> | null; -export type PageIterator = V & { +export type PageIterator = V & { next: Paginator; [Symbol.asyncIterator]: () => AsyncIterableIterator; + "~next"?: PageState | undefined; }; export function createPageIterator( @@ -40,7 +41,9 @@ export function createPageIterator( * terminates. It is useful in paginated SDK functions that have early return * paths when things go wrong. */ -export function haltIterator(v: V): PageIterator { +export function haltIterator( + v: V, +): PageIterator { return { ...v, next: () => null, @@ -54,9 +57,9 @@ export function haltIterator(v: V): PageIterator { * Converts an async iterator of `Result` into an async iterator of `V`. * When error results occur, the underlying error value is thrown. */ -export async function unwrapResultIterator( - iteratorPromise: Promise>>, -): Promise> { +export async function unwrapResultIterator( + iteratorPromise: Promise, PageState>>, +): Promise> { const resultIter = await iteratorPromise; if (!resultIter.ok) { @@ -66,6 +69,7 @@ export async function unwrapResultIterator( return { ...resultIter.value, next: unwrapPaginator(resultIter.next), + "~next": resultIter["~next"], [Symbol.asyncIterator]: async function* paginator() { for await (const page of resultIter) { if (!page.ok) { @@ -97,3 +101,5 @@ function unwrapPaginator( }); }; } + +export const URL_OVERRIDE = Symbol("URL_OVERRIDE"); diff --git a/src/sdk/workspaces.ts b/src/sdk/workspaces.ts index 0b576b57..b4ebb0c3 100644 --- a/src/sdk/workspaces.ts +++ b/src/sdk/workspaces.ts @@ -14,6 +14,7 @@ import { workspacesGetTeam } from "../funcs/workspacesGetTeam.js"; import { workspacesGetTokens } from "../funcs/workspacesGetTokens.js"; import { workspacesGrantAccess } from "../funcs/workspacesGrantAccess.js"; import { workspacesRevokeAccess } from "../funcs/workspacesRevokeAccess.js"; +import { workspacesSetFeatureFlags } from "../funcs/workspacesSetFeatureFlags.js"; import { workspacesUpdate } from "../funcs/workspacesUpdate.js"; import { workspacesUpdateSettings } from "../funcs/workspacesUpdateSettings.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; @@ -201,6 +202,20 @@ export class Workspaces extends ClientSDK { )); } + /** + * Set workspace feature flags + */ + async setFeatureFlags( + request: shared.WorkspaceFeatureFlagRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(workspacesSetFeatureFlags( + this, + request, + options, + )); + } + /** * Update workspace details * diff --git a/tsconfig.json b/tsconfig.json index 7a86d2d9..94d81a34 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,8 +2,9 @@ "compilerOptions": { "incremental": true, "tsBuildInfoFile": ".tsbuildinfo", - "target": "ES2018", + "target": "ES2020", "lib": ["ES2022", "DOM", "DOM.Iterable"], + "jsx": "react-jsx", "module": "Node16", "moduleResolution": "Node16",