@openrouter/sdk 0.0.1-beta.7 → 0.0.1-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/core.d.ts +10 -0
- package/esm/core.js +13 -0
- package/esm/funcs/analyticsGetUserActivity.d.ts +18 -0
- package/esm/funcs/analyticsGetUserActivity.js +85 -0
- package/esm/funcs/apiKeysCreate.d.ts +15 -0
- package/esm/funcs/apiKeysCreate.js +79 -0
- package/esm/funcs/apiKeysDelete.d.ts +15 -0
- package/esm/funcs/apiKeysDelete.js +84 -0
- package/esm/funcs/apiKeysGet.d.ts +15 -0
- package/esm/funcs/apiKeysGet.js +84 -0
- package/esm/funcs/apiKeysGetCurrentKeyMetadata.d.ts +18 -0
- package/esm/funcs/apiKeysGetCurrentKeyMetadata.js +72 -0
- package/esm/funcs/apiKeysList.d.ts +15 -0
- package/esm/funcs/apiKeysList.js +83 -0
- package/esm/funcs/apiKeysUpdate.d.ts +15 -0
- package/esm/funcs/apiKeysUpdate.js +85 -0
- package/esm/funcs/betaResponsesSend.d.ts +18 -0
- package/esm/funcs/betaResponsesSend.js +69 -0
- package/esm/funcs/chatSend.d.ts +19 -0
- package/esm/funcs/chatSend.js +83 -0
- package/esm/funcs/completionsGenerate.d.ts +18 -0
- package/esm/funcs/completionsGenerate.js +82 -0
- package/esm/funcs/creditsCreateCoinbaseCharge.d.ts +19 -0
- package/esm/funcs/creditsCreateCoinbaseCharge.js +77 -0
- package/esm/funcs/creditsGetCredits.d.ts +18 -0
- package/esm/funcs/creditsGetCredits.js +72 -0
- package/esm/funcs/endpointsList.d.ts +15 -0
- package/esm/funcs/endpointsList.js +88 -0
- package/esm/funcs/endpointsListZdrEndpoints.d.ts +14 -0
- package/esm/funcs/endpointsListZdrEndpoints.js +65 -0
- package/esm/funcs/generationsGetGeneration.d.ts +15 -0
- package/esm/funcs/generationsGetGeneration.js +82 -0
- package/esm/funcs/modelsCount.d.ts +14 -0
- package/esm/funcs/modelsCount.js +65 -0
- package/esm/funcs/modelsList.d.ts +14 -0
- package/esm/funcs/modelsList.js +83 -0
- package/esm/funcs/modelsListForUser.d.ts +14 -0
- package/esm/funcs/modelsListForUser.js +69 -0
- package/esm/funcs/oAuthCreateAuthorizationUrl.d.ts +43 -0
- package/esm/funcs/oAuthCreateAuthorizationUrl.js +44 -0
- package/esm/funcs/oAuthCreateSHA256CodeChallenge.d.ts +35 -0
- package/esm/funcs/oAuthCreateSHA256CodeChallenge.js +69 -0
- package/esm/funcs/parametersGetParameters.d.ts +15 -0
- package/esm/funcs/parametersGetParameters.js +96 -0
- package/esm/funcs/providersList.d.ts +15 -0
- package/esm/funcs/providersList.js +69 -0
- package/esm/hooks/hooks.d.ts +25 -0
- package/esm/hooks/hooks.js +82 -0
- package/esm/hooks/index.d.ts +3 -0
- package/esm/hooks/index.js +6 -0
- package/esm/hooks/registration.d.ts +3 -0
- package/esm/hooks/registration.js +12 -0
- package/esm/hooks/types.d.ts +76 -0
- package/esm/hooks/types.js +5 -0
- package/esm/index.d.ts +6 -0
- package/esm/index.js +8 -0
- package/esm/lib/base64.d.ts +10 -0
- package/esm/lib/base64.js +29 -0
- package/esm/lib/config.d.ts +44 -0
- package/esm/lib/config.js +32 -0
- package/esm/lib/dlv.d.ts +14 -0
- package/esm/lib/dlv.js +46 -0
- package/esm/lib/encodings.d.ts +52 -0
- package/esm/lib/encodings.js +354 -0
- package/esm/lib/env.d.ts +15 -0
- package/esm/lib/env.js +44 -0
- package/esm/lib/event-streams.d.ts +11 -0
- package/esm/lib/event-streams.js +125 -0
- package/esm/lib/files.d.ts +13 -0
- package/esm/lib/files.js +73 -0
- package/esm/lib/http.d.ts +67 -0
- package/esm/lib/http.js +207 -0
- package/esm/lib/is-plain-object.d.ts +2 -0
- package/esm/lib/is-plain-object.js +38 -0
- package/esm/lib/logger.d.ts +6 -0
- package/esm/lib/logger.js +5 -0
- package/esm/lib/matchers.d.ts +59 -0
- package/esm/lib/matchers.js +203 -0
- package/esm/lib/primitives.d.ts +26 -0
- package/esm/lib/primitives.js +103 -0
- package/esm/lib/retries.d.ts +38 -0
- package/esm/lib/retries.js +147 -0
- package/esm/lib/schemas.d.ts +21 -0
- package/esm/lib/schemas.js +57 -0
- package/esm/lib/sdks.d.ts +63 -0
- package/esm/lib/sdks.js +269 -0
- package/esm/lib/security.d.ts +83 -0
- package/esm/lib/security.js +137 -0
- package/esm/lib/url.d.ts +5 -0
- package/esm/lib/url.js +22 -0
- package/esm/models/activityitem.d.ts +82 -0
- package/esm/models/activityitem.js +73 -0
- package/esm/models/assistantmessage.d.ts +62 -0
- package/esm/models/assistantmessage.js +73 -0
- package/esm/models/chatcompletionfinishreason.d.ts +25 -0
- package/esm/models/chatcompletionfinishreason.js +35 -0
- package/esm/models/chaterror.d.ts +56 -0
- package/esm/models/chaterror.js +64 -0
- package/esm/models/chatgenerationparams.d.ts +249 -0
- package/esm/models/chatgenerationparams.js +301 -0
- package/esm/models/chatgenerationtokenusage.d.ts +95 -0
- package/esm/models/chatgenerationtokenusage.js +142 -0
- package/esm/models/chatmessagecontentitem.d.ts +40 -0
- package/esm/models/chatmessagecontentitem.js +46 -0
- package/esm/models/chatmessagecontentitemaudio.d.ts +83 -0
- package/esm/models/chatmessagecontentitemaudio.js +102 -0
- package/esm/models/chatmessagecontentitemimage.d.ts +79 -0
- package/esm/models/chatmessagecontentitemimage.js +98 -0
- package/esm/models/chatmessagecontentitemtext.d.ts +31 -0
- package/esm/models/chatmessagecontentitemtext.js +33 -0
- package/esm/models/chatmessagetokenlogprob.d.ts +64 -0
- package/esm/models/chatmessagetokenlogprob.js +75 -0
- package/esm/models/chatmessagetokenlogprobs.d.ts +32 -0
- package/esm/models/chatmessagetokenlogprobs.js +34 -0
- package/esm/models/chatmessagetoolcall.d.ts +60 -0
- package/esm/models/chatmessagetoolcall.js +62 -0
- package/esm/models/chatresponse.d.ts +43 -0
- package/esm/models/chatresponse.js +55 -0
- package/esm/models/chatresponsechoice.d.ts +38 -0
- package/esm/models/chatresponsechoice.js +49 -0
- package/esm/models/chatstreamingchoice.d.ts +38 -0
- package/esm/models/chatstreamingchoice.js +49 -0
- package/esm/models/chatstreamingmessagechunk.d.ts +61 -0
- package/esm/models/chatstreamingmessagechunk.js +67 -0
- package/esm/models/chatstreamingmessagetoolcall.d.ts +62 -0
- package/esm/models/chatstreamingmessagetoolcall.js +66 -0
- package/esm/models/chatstreamingresponsechunk.d.ts +97 -0
- package/esm/models/chatstreamingresponsechunk.js +120 -0
- package/esm/models/chatstreamoptions.d.ts +29 -0
- package/esm/models/chatstreamoptions.js +40 -0
- package/esm/models/completionchoice.d.ts +57 -0
- package/esm/models/completionchoice.js +75 -0
- package/esm/models/completioncreateparams.d.ts +240 -0
- package/esm/models/completioncreateparams.js +313 -0
- package/esm/models/completionlogprobs.d.ts +39 -0
- package/esm/models/completionlogprobs.js +50 -0
- package/esm/models/completionresponse.d.ts +43 -0
- package/esm/models/completionresponse.js +54 -0
- package/esm/models/completionusage.d.ts +33 -0
- package/esm/models/completionusage.js +48 -0
- package/esm/models/createchargerequest.d.ts +28 -0
- package/esm/models/createchargerequest.js +27 -0
- package/esm/models/errorresponse.d.ts +155 -0
- package/esm/models/errorresponse.js +167 -0
- package/esm/models/errors/chaterror.d.ts +37 -0
- package/esm/models/errors/chaterror.js +48 -0
- package/esm/models/errors/errorresponse.d.ts +46 -0
- package/esm/models/errors/errorresponse.js +64 -0
- package/esm/models/errors/httpclienterrors.d.ts +44 -0
- package/esm/models/errors/httpclienterrors.js +69 -0
- package/esm/models/errors/index.d.ts +9 -0
- package/esm/models/errors/index.js +12 -0
- package/esm/models/errors/listproviders.d.ts +49 -0
- package/esm/models/errors/listproviders.js +51 -0
- package/esm/models/errors/openrouterdefaulterror.d.ts +10 -0
- package/esm/models/errors/openrouterdefaulterror.js +30 -0
- package/esm/models/errors/openroutererror.d.ts +19 -0
- package/esm/models/errors/openroutererror.js +16 -0
- package/esm/models/errors/responsevalidationerror.d.ts +26 -0
- package/esm/models/errors/responsevalidationerror.js +29 -0
- package/esm/models/errors/sdkvalidationerror.d.ts +21 -0
- package/esm/models/errors/sdkvalidationerror.js +44 -0
- package/esm/models/filecitationannotation.d.ts +58 -0
- package/esm/models/filecitationannotation.js +64 -0
- package/esm/models/filepathannotation.d.ts +56 -0
- package/esm/models/filepathannotation.js +62 -0
- package/esm/models/imagegenerationstatus.d.ts +24 -0
- package/esm/models/imagegenerationstatus.js +34 -0
- package/esm/models/index.d.ts +96 -0
- package/esm/models/index.js +99 -0
- package/esm/models/jsonschemaconfig.d.ts +39 -0
- package/esm/models/jsonschemaconfig.js +37 -0
- package/esm/models/listendpointsresponse.d.ts +28 -0
- package/esm/models/listendpointsresponse.js +27 -0
- package/esm/models/message.d.ts +80 -0
- package/esm/models/message.js +101 -0
- package/esm/models/modelscountresponse.d.ts +28 -0
- package/esm/models/modelscountresponse.js +27 -0
- package/esm/models/modelslistresponse.d.ts +28 -0
- package/esm/models/modelslistresponse.js +27 -0
- package/esm/models/namedtoolchoice.d.ts +56 -0
- package/esm/models/namedtoolchoice.js +58 -0
- package/esm/models/openresponseseasyinputmessage.d.ts +190 -0
- package/esm/models/openresponseseasyinputmessage.js +194 -0
- package/esm/models/openresponsesformatjsonobject.d.ts +55 -0
- package/esm/models/openresponsesformatjsonobject.js +49 -0
- package/esm/models/openresponsesformatjsonschema.d.ts +67 -0
- package/esm/models/openresponsesformatjsonschema.js +57 -0
- package/esm/models/openresponsesformattext.d.ts +55 -0
- package/esm/models/openresponsesformattext.js +49 -0
- package/esm/models/openresponsesformattextconfig.d.ts +31 -0
- package/esm/models/openresponsesformattextconfig.js +38 -0
- package/esm/models/openresponsesfunctioncalloutput.d.ts +64 -0
- package/esm/models/openresponsesfunctioncalloutput.js +67 -0
- package/esm/models/openresponsesfunctiontoolcall.d.ts +66 -0
- package/esm/models/openresponsesfunctiontoolcall.js +69 -0
- package/esm/models/openresponsesinput.d.ts +29 -0
- package/esm/models/openresponsesinput.js +36 -0
- package/esm/models/openresponsesinputcontent.d.ts +43 -0
- package/esm/models/openresponsesinputcontent.js +50 -0
- package/esm/models/openresponsesinputfile.d.ts +63 -0
- package/esm/models/openresponsesinputfile.js +70 -0
- package/esm/models/openresponsesinputimage.d.ts +79 -0
- package/esm/models/openresponsesinputimage.js +90 -0
- package/esm/models/openresponsesinputitem.d.ts +39 -0
- package/esm/models/openresponsesinputitem.js +62 -0
- package/esm/models/openresponsesinputmessageitem.d.ts +149 -0
- package/esm/models/openresponsesinputmessageitem.js +147 -0
- package/esm/models/openresponsesinputtext.d.ts +57 -0
- package/esm/models/openresponsesinputtext.js +51 -0
- package/esm/models/openresponseslogprobs.d.ts +66 -0
- package/esm/models/openresponseslogprobs.js +71 -0
- package/esm/models/openresponsesnonstreamingresponse.d.ts +260 -0
- package/esm/models/openresponsesnonstreamingresponse.js +290 -0
- package/esm/models/openresponsesoutputtext.d.ts +80 -0
- package/esm/models/openresponsesoutputtext.js +93 -0
- package/esm/models/openresponsesprompt.d.ts +39 -0
- package/esm/models/openresponsesprompt.js +34 -0
- package/esm/models/openresponsesreasoning.d.ts +90 -0
- package/esm/models/openresponsesreasoning.js +101 -0
- package/esm/models/openresponsesreasoningconfig.d.ts +61 -0
- package/esm/models/openresponsesreasoningconfig.js +78 -0
- package/esm/models/openresponsesrefusalcontent.d.ts +54 -0
- package/esm/models/openresponsesrefusalcontent.js +51 -0
- package/esm/models/openresponsesrequest.d.ts +28 -0
- package/esm/models/openresponsesrequest.js +27 -0
- package/esm/models/openresponsesstreamevent.d.ts +1683 -0
- package/esm/models/openresponsesstreamevent.js +1944 -0
- package/esm/models/openresponsestextconfig.d.ts +59 -0
- package/esm/models/openresponsestextconfig.js +63 -0
- package/esm/models/openresponsestoolchoice.d.ts +148 -0
- package/esm/models/openresponsestoolchoice.js +139 -0
- package/esm/models/openresponsestoolunion.d.ts +95 -0
- package/esm/models/openresponsestoolunion.js +94 -0
- package/esm/models/openresponseswebsearch20250826tool.d.ts +94 -0
- package/esm/models/openresponseswebsearch20250826tool.js +103 -0
- package/esm/models/openresponseswebsearchpreview20250311tool.d.ts +64 -0
- package/esm/models/openresponseswebsearchpreview20250311tool.js +68 -0
- package/esm/models/openresponseswebsearchpreviewtool.d.ts +64 -0
- package/esm/models/openresponseswebsearchpreviewtool.js +68 -0
- package/esm/models/openresponseswebsearchtool.d.ts +94 -0
- package/esm/models/openresponseswebsearchtool.js +103 -0
- package/esm/models/operations/createapialpharesponses.d.ts +58 -0
- package/esm/models/operations/createapialpharesponses.js +83 -0
- package/esm/models/operations/createcoinbasecharge.d.ts +212 -0
- package/esm/models/operations/createcoinbasecharge.js +267 -0
- package/esm/models/operations/createkeys.d.ts +226 -0
- package/esm/models/operations/createkeys.js +195 -0
- package/esm/models/operations/deletekeys.d.ts +63 -0
- package/esm/models/operations/deletekeys.js +56 -0
- package/esm/models/operations/getcredits.d.ts +28 -0
- package/esm/models/operations/getcredits.js +27 -0
- package/esm/models/operations/getcurrentkey.d.ts +186 -0
- package/esm/models/operations/getcurrentkey.js +148 -0
- package/esm/models/operations/getgeneration.d.ts +272 -0
- package/esm/models/operations/getgeneration.js +230 -0
- package/esm/models/operations/getkey.d.ts +179 -0
- package/esm/models/operations/getkey.js +148 -0
- package/esm/models/operations/getmodels.d.ts +57 -0
- package/esm/models/operations/getmodels.js +80 -0
- package/esm/models/operations/getparameters.d.ts +250 -0
- package/esm/models/operations/getparameters.js +260 -0
- package/esm/models/operations/getuseractivity.d.ts +64 -0
- package/esm/models/operations/getuseractivity.js +57 -0
- package/esm/models/operations/index.d.ts +20 -0
- package/esm/models/operations/index.js +23 -0
- package/esm/models/operations/list.d.ts +181 -0
- package/esm/models/operations/list.js +159 -0
- package/esm/models/operations/listendpoints.d.ts +63 -0
- package/esm/models/operations/listendpoints.js +59 -0
- package/esm/models/operations/listendpointszdr.d.ts +54 -0
- package/esm/models/operations/listendpointszdr.js +59 -0
- package/esm/models/operations/listmodelscount.d.ts +26 -0
- package/esm/models/operations/listmodelscount.js +34 -0
- package/esm/models/operations/listmodelsuser.d.ts +51 -0
- package/esm/models/operations/listmodelsuser.js +59 -0
- package/esm/models/operations/listproviders.d.ts +116 -0
- package/esm/models/operations/listproviders.js +105 -0
- package/esm/models/operations/sendchatcompletionrequest.d.ts +27 -0
- package/esm/models/operations/sendchatcompletionrequest.js +41 -0
- package/esm/models/operations/updatekeys.d.ts +256 -0
- package/esm/models/operations/updatekeys.js +230 -0
- package/esm/models/outputtextcontent.d.ts +80 -0
- package/esm/models/outputtextcontent.js +93 -0
- package/esm/models/publicendpoint.d.ts +28 -0
- package/esm/models/publicendpoint.js +27 -0
- package/esm/models/reasoningsummarytext.d.ts +54 -0
- package/esm/models/reasoningsummarytext.js +51 -0
- package/esm/models/reasoningsummaryverbosity.d.ts +23 -0
- package/esm/models/reasoningsummaryverbosity.js +33 -0
- package/esm/models/reasoningtextcontent.d.ts +54 -0
- package/esm/models/reasoningtextcontent.js +51 -0
- package/esm/models/refusalcontent.d.ts +54 -0
- package/esm/models/refusalcontent.js +51 -0
- package/esm/models/responseformatjsonschema.d.ts +32 -0
- package/esm/models/responseformatjsonschema.js +43 -0
- package/esm/models/responseformattextgrammar.d.ts +31 -0
- package/esm/models/responseformattextgrammar.js +33 -0
- package/esm/models/responseserrorfield.d.ts +55 -0
- package/esm/models/responseserrorfield.js +61 -0
- package/esm/models/responsesimagegenerationcall.d.ts +59 -0
- package/esm/models/responsesimagegenerationcall.js +56 -0
- package/esm/models/responsesoutputitem.d.ts +34 -0
- package/esm/models/responsesoutputitem.js +47 -0
- package/esm/models/responsesoutputitemfilesearchcall.d.ts +59 -0
- package/esm/models/responsesoutputitemfilesearchcall.js +56 -0
- package/esm/models/responsesoutputitemfunctioncall.d.ts +60 -0
- package/esm/models/responsesoutputitemfunctioncall.js +66 -0
- package/esm/models/responsesoutputitemreasoning.d.ts +62 -0
- package/esm/models/responsesoutputitemreasoning.js +68 -0
- package/esm/models/responsesoutputmessage.d.ts +192 -0
- package/esm/models/responsesoutputmessage.js +190 -0
- package/esm/models/responsessearchcontextsize.d.ts +29 -0
- package/esm/models/responsessearchcontextsize.js +36 -0
- package/esm/models/responsesusage.d.ts +131 -0
- package/esm/models/responsesusage.js +174 -0
- package/esm/models/responseswebsearchcalloutput.d.ts +57 -0
- package/esm/models/responseswebsearchcalloutput.js +54 -0
- package/esm/models/responseswebsearchuserlocation.d.ts +63 -0
- package/esm/models/responseswebsearchuserlocation.js +57 -0
- package/esm/models/security.d.ts +29 -0
- package/esm/models/security.js +32 -0
- package/esm/models/systemmessage.d.ts +55 -0
- package/esm/models/systemmessage.js +64 -0
- package/esm/models/tool.d.ts +66 -0
- package/esm/models/tool.js +65 -0
- package/esm/models/toolcallstatus.d.ts +23 -0
- package/esm/models/toolcallstatus.js +33 -0
- package/esm/models/toolchoicetypes.d.ts +164 -0
- package/esm/models/toolchoicetypes.js +167 -0
- package/esm/models/toolresponsemessage.d.ts +55 -0
- package/esm/models/toolresponsemessage.js +69 -0
- package/esm/models/urlcitationannotation.d.ts +60 -0
- package/esm/models/urlcitationannotation.js +68 -0
- package/esm/models/usermessage.d.ts +55 -0
- package/esm/models/usermessage.js +64 -0
- package/esm/models/websearchpreviewtooluserlocation.d.ts +60 -0
- package/esm/models/websearchpreviewtooluserlocation.js +57 -0
- package/esm/models/websearchstatus.d.ts +24 -0
- package/esm/models/websearchstatus.js +34 -0
- package/esm/react-query/_context.d.ts +8 -0
- package/esm/react-query/_context.js +14 -0
- package/esm/react-query/_types.d.ts +27 -0
- package/esm/react-query/_types.js +5 -0
- package/esm/react-query/analyticsGetUserActivity.d.ts +36 -0
- package/esm/react-query/analyticsGetUserActivity.js +77 -0
- package/esm/react-query/apiKeysCreate.d.ts +20 -0
- package/esm/react-query/apiKeysCreate.js +39 -0
- package/esm/react-query/apiKeysDelete.d.ts +20 -0
- package/esm/react-query/apiKeysDelete.js +39 -0
- package/esm/react-query/apiKeysGet.d.ts +24 -0
- package/esm/react-query/apiKeysGet.js +66 -0
- package/esm/react-query/apiKeysGetCurrentKeyMetadata.d.ts +29 -0
- package/esm/react-query/apiKeysGetCurrentKeyMetadata.js +66 -0
- package/esm/react-query/apiKeysList.d.ts +37 -0
- package/esm/react-query/apiKeysList.js +69 -0
- package/esm/react-query/apiKeysUpdate.d.ts +20 -0
- package/esm/react-query/apiKeysUpdate.js +39 -0
- package/esm/react-query/betaResponsesSend.d.ts +24 -0
- package/esm/react-query/betaResponsesSend.js +42 -0
- package/esm/react-query/chatSend.d.ts +24 -0
- package/esm/react-query/chatSend.js +42 -0
- package/esm/react-query/completionsGenerate.d.ts +23 -0
- package/esm/react-query/completionsGenerate.js +42 -0
- package/esm/react-query/creditsCreateCoinbaseCharge.d.ts +25 -0
- package/esm/react-query/creditsCreateCoinbaseCharge.js +42 -0
- package/esm/react-query/creditsGetCredits.d.ts +29 -0
- package/esm/react-query/creditsGetCredits.js +66 -0
- package/esm/react-query/endpointsList.d.ts +24 -0
- package/esm/react-query/endpointsList.js +66 -0
- package/esm/react-query/endpointsListZdrEndpoints.d.ts +23 -0
- package/esm/react-query/endpointsListZdrEndpoints.js +60 -0
- package/esm/react-query/generationsGetGeneration.d.ts +30 -0
- package/esm/react-query/generationsGetGeneration.js +71 -0
- package/esm/react-query/index.d.ts +23 -0
- package/esm/react-query/index.js +26 -0
- package/esm/react-query/modelsCount.d.ts +23 -0
- package/esm/react-query/modelsCount.js +60 -0
- package/esm/react-query/modelsList.d.ts +43 -0
- package/esm/react-query/modelsList.js +71 -0
- package/esm/react-query/modelsListForUser.d.ts +23 -0
- package/esm/react-query/modelsListForUser.js +60 -0
- package/esm/react-query/parametersGetParameters.d.ts +38 -0
- package/esm/react-query/parametersGetParameters.js +80 -0
- package/esm/react-query/providersList.d.ts +23 -0
- package/esm/react-query/providersList.js +60 -0
- package/esm/sdk/analytics.d.ts +12 -0
- package/esm/sdk/analytics.js +18 -0
- package/esm/sdk/apikeys.d.ts +32 -0
- package/esm/sdk/apikeys.js +53 -0
- package/esm/sdk/beta.d.ts +7 -0
- package/esm/sdk/beta.js +11 -0
- package/esm/sdk/chat.d.ts +13 -0
- package/esm/sdk/chat.js +18 -0
- package/esm/sdk/completions.d.ts +12 -0
- package/esm/sdk/completions.js +18 -0
- package/esm/sdk/credits.d.ts +20 -0
- package/esm/sdk/credits.js +28 -0
- package/esm/sdk/endpoints.d.ts +13 -0
- package/esm/sdk/endpoints.js +22 -0
- package/esm/sdk/generations.d.ts +9 -0
- package/esm/sdk/generations.js +15 -0
- package/esm/sdk/index.d.ts +2 -0
- package/esm/sdk/index.js +5 -0
- package/esm/sdk/models.d.ts +17 -0
- package/esm/sdk/models.js +29 -0
- package/esm/sdk/parameters.d.ts +9 -0
- package/esm/sdk/parameters.js +15 -0
- package/esm/sdk/providers.d.ts +9 -0
- package/esm/sdk/providers.js +15 -0
- package/esm/sdk/responses.d.ts +13 -0
- package/esm/sdk/responses.js +18 -0
- package/esm/sdk/sdk.d.ts +37 -0
- package/esm/sdk/sdk.js +51 -0
- package/esm/types/async.d.ts +23 -0
- package/esm/types/async.js +40 -0
- package/esm/types/blobs.d.ts +4 -0
- package/esm/types/blobs.js +25 -0
- package/esm/types/constdatetime.d.ts +3 -0
- package/esm/types/constdatetime.js +10 -0
- package/esm/types/enums.d.ts +12 -0
- package/esm/types/enums.js +7 -0
- package/esm/types/fp.d.ts +31 -0
- package/esm/types/fp.js +31 -0
- package/esm/types/index.d.ts +8 -0
- package/esm/types/index.js +8 -0
- package/esm/types/operations.d.ts +27 -0
- package/esm/types/operations.js +77 -0
- package/esm/types/rfcdate.d.ts +21 -0
- package/esm/types/rfcdate.js +42 -0
- package/esm/types/streams.d.ts +2 -0
- package/esm/types/streams.js +15 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/tsconfig.json +3 -3
- package/core.d.ts +0 -9
- package/core.js +0 -12
- package/funcs/analyticsGetUserActivity.d.ts +0 -17
- package/funcs/analyticsGetUserActivity.js +0 -84
- package/funcs/apiKeysCreate.d.ts +0 -14
- package/funcs/apiKeysCreate.js +0 -78
- package/funcs/apiKeysDelete.d.ts +0 -14
- package/funcs/apiKeysDelete.js +0 -83
- package/funcs/apiKeysGet.d.ts +0 -14
- package/funcs/apiKeysGet.js +0 -83
- package/funcs/apiKeysGetCurrentKeyMetadata.d.ts +0 -17
- package/funcs/apiKeysGetCurrentKeyMetadata.js +0 -71
- package/funcs/apiKeysList.d.ts +0 -14
- package/funcs/apiKeysList.js +0 -82
- package/funcs/apiKeysUpdate.d.ts +0 -14
- package/funcs/apiKeysUpdate.js +0 -84
- package/funcs/betaResponsesSend.d.ts +0 -17
- package/funcs/betaResponsesSend.js +0 -68
- package/funcs/chatSend.d.ts +0 -18
- package/funcs/chatSend.js +0 -82
- package/funcs/completionsGenerate.d.ts +0 -17
- package/funcs/completionsGenerate.js +0 -81
- package/funcs/creditsCreateCoinbaseCharge.d.ts +0 -18
- package/funcs/creditsCreateCoinbaseCharge.js +0 -76
- package/funcs/creditsGetCredits.d.ts +0 -17
- package/funcs/creditsGetCredits.js +0 -71
- package/funcs/endpointsList.d.ts +0 -14
- package/funcs/endpointsList.js +0 -87
- package/funcs/endpointsListZdrEndpoints.d.ts +0 -13
- package/funcs/endpointsListZdrEndpoints.js +0 -64
- package/funcs/generationsGetGeneration.d.ts +0 -14
- package/funcs/generationsGetGeneration.js +0 -81
- package/funcs/modelsCount.d.ts +0 -13
- package/funcs/modelsCount.js +0 -64
- package/funcs/modelsList.d.ts +0 -13
- package/funcs/modelsList.js +0 -82
- package/funcs/modelsListForUser.d.ts +0 -13
- package/funcs/modelsListForUser.js +0 -68
- package/funcs/oAuthCreateAuthorizationUrl.d.ts +0 -42
- package/funcs/oAuthCreateAuthorizationUrl.js +0 -43
- package/funcs/oAuthCreateSHA256CodeChallenge.d.ts +0 -34
- package/funcs/oAuthCreateSHA256CodeChallenge.js +0 -68
- package/funcs/parametersGetParameters.d.ts +0 -14
- package/funcs/parametersGetParameters.js +0 -95
- package/funcs/providersList.d.ts +0 -14
- package/funcs/providersList.js +0 -68
- package/hooks/hooks.d.ts +0 -24
- package/hooks/hooks.js +0 -81
- package/hooks/index.d.ts +0 -2
- package/hooks/index.js +0 -5
- package/hooks/registration.d.ts +0 -2
- package/hooks/registration.js +0 -11
- package/hooks/types.d.ts +0 -75
- package/hooks/types.js +0 -4
- package/index.d.ts +0 -5
- package/index.js +0 -7
- package/lib/base64.d.ts +0 -9
- package/lib/base64.js +0 -28
- package/lib/config.d.ts +0 -43
- package/lib/config.js +0 -31
- package/lib/dlv.d.ts +0 -13
- package/lib/dlv.js +0 -45
- package/lib/encodings.d.ts +0 -51
- package/lib/encodings.js +0 -353
- package/lib/env.d.ts +0 -14
- package/lib/env.js +0 -43
- package/lib/event-streams.d.ts +0 -10
- package/lib/event-streams.js +0 -124
- package/lib/files.d.ts +0 -12
- package/lib/files.js +0 -72
- package/lib/http.d.ts +0 -66
- package/lib/http.js +0 -206
- package/lib/is-plain-object.d.ts +0 -1
- package/lib/is-plain-object.js +0 -37
- package/lib/logger.d.ts +0 -5
- package/lib/logger.js +0 -4
- package/lib/matchers.d.ts +0 -58
- package/lib/matchers.js +0 -202
- package/lib/primitives.d.ts +0 -25
- package/lib/primitives.js +0 -102
- package/lib/retries.d.ts +0 -37
- package/lib/retries.js +0 -146
- package/lib/schemas.d.ts +0 -20
- package/lib/schemas.js +0 -56
- package/lib/sdks.d.ts +0 -62
- package/lib/sdks.js +0 -268
- package/lib/security.d.ts +0 -82
- package/lib/security.js +0 -136
- package/lib/url.d.ts +0 -4
- package/lib/url.js +0 -21
- package/models/activityitem.d.ts +0 -81
- package/models/activityitem.js +0 -72
- package/models/assistantmessage.d.ts +0 -61
- package/models/assistantmessage.js +0 -72
- package/models/chatcompletionfinishreason.d.ts +0 -24
- package/models/chatcompletionfinishreason.js +0 -34
- package/models/chaterror.d.ts +0 -55
- package/models/chaterror.js +0 -63
- package/models/chatgenerationparams.d.ts +0 -248
- package/models/chatgenerationparams.js +0 -300
- package/models/chatgenerationtokenusage.d.ts +0 -94
- package/models/chatgenerationtokenusage.js +0 -141
- package/models/chatmessagecontentitem.d.ts +0 -39
- package/models/chatmessagecontentitem.js +0 -45
- package/models/chatmessagecontentitemaudio.d.ts +0 -82
- package/models/chatmessagecontentitemaudio.js +0 -101
- package/models/chatmessagecontentitemimage.d.ts +0 -78
- package/models/chatmessagecontentitemimage.js +0 -97
- package/models/chatmessagecontentitemtext.d.ts +0 -30
- package/models/chatmessagecontentitemtext.js +0 -32
- package/models/chatmessagetokenlogprob.d.ts +0 -63
- package/models/chatmessagetokenlogprob.js +0 -74
- package/models/chatmessagetokenlogprobs.d.ts +0 -31
- package/models/chatmessagetokenlogprobs.js +0 -33
- package/models/chatmessagetoolcall.d.ts +0 -59
- package/models/chatmessagetoolcall.js +0 -61
- package/models/chatresponse.d.ts +0 -42
- package/models/chatresponse.js +0 -54
- package/models/chatresponsechoice.d.ts +0 -37
- package/models/chatresponsechoice.js +0 -48
- package/models/chatstreamingchoice.d.ts +0 -37
- package/models/chatstreamingchoice.js +0 -48
- package/models/chatstreamingmessagechunk.d.ts +0 -60
- package/models/chatstreamingmessagechunk.js +0 -66
- package/models/chatstreamingmessagetoolcall.d.ts +0 -61
- package/models/chatstreamingmessagetoolcall.js +0 -65
- package/models/chatstreamingresponsechunk.d.ts +0 -96
- package/models/chatstreamingresponsechunk.js +0 -119
- package/models/chatstreamoptions.d.ts +0 -28
- package/models/chatstreamoptions.js +0 -39
- package/models/completionchoice.d.ts +0 -56
- package/models/completionchoice.js +0 -74
- package/models/completioncreateparams.d.ts +0 -239
- package/models/completioncreateparams.js +0 -312
- package/models/completionlogprobs.d.ts +0 -38
- package/models/completionlogprobs.js +0 -49
- package/models/completionresponse.d.ts +0 -42
- package/models/completionresponse.js +0 -53
- package/models/completionusage.d.ts +0 -32
- package/models/completionusage.js +0 -47
- package/models/createchargerequest.d.ts +0 -27
- package/models/createchargerequest.js +0 -26
- package/models/errorresponse.d.ts +0 -154
- package/models/errorresponse.js +0 -166
- package/models/errors/chaterror.d.ts +0 -36
- package/models/errors/chaterror.js +0 -47
- package/models/errors/errorresponse.d.ts +0 -45
- package/models/errors/errorresponse.js +0 -63
- package/models/errors/httpclienterrors.d.ts +0 -43
- package/models/errors/httpclienterrors.js +0 -68
- package/models/errors/index.d.ts +0 -8
- package/models/errors/index.js +0 -11
- package/models/errors/listproviders.d.ts +0 -48
- package/models/errors/listproviders.js +0 -50
- package/models/errors/openrouterdefaulterror.d.ts +0 -9
- package/models/errors/openrouterdefaulterror.js +0 -29
- package/models/errors/openroutererror.d.ts +0 -18
- package/models/errors/openroutererror.js +0 -15
- package/models/errors/responsevalidationerror.d.ts +0 -25
- package/models/errors/responsevalidationerror.js +0 -28
- package/models/errors/sdkvalidationerror.d.ts +0 -20
- package/models/errors/sdkvalidationerror.js +0 -43
- package/models/filecitationannotation.d.ts +0 -57
- package/models/filecitationannotation.js +0 -63
- package/models/filepathannotation.d.ts +0 -55
- package/models/filepathannotation.js +0 -61
- package/models/imagegenerationstatus.d.ts +0 -23
- package/models/imagegenerationstatus.js +0 -33
- package/models/index.d.ts +0 -95
- package/models/index.js +0 -98
- package/models/jsonschemaconfig.d.ts +0 -38
- package/models/jsonschemaconfig.js +0 -36
- package/models/listendpointsresponse.d.ts +0 -27
- package/models/listendpointsresponse.js +0 -26
- package/models/message.d.ts +0 -79
- package/models/message.js +0 -100
- package/models/modelscountresponse.d.ts +0 -27
- package/models/modelscountresponse.js +0 -26
- package/models/modelslistresponse.d.ts +0 -27
- package/models/modelslistresponse.js +0 -26
- package/models/namedtoolchoice.d.ts +0 -55
- package/models/namedtoolchoice.js +0 -57
- package/models/openresponseseasyinputmessage.d.ts +0 -189
- package/models/openresponseseasyinputmessage.js +0 -193
- package/models/openresponsesformatjsonobject.d.ts +0 -54
- package/models/openresponsesformatjsonobject.js +0 -48
- package/models/openresponsesformatjsonschema.d.ts +0 -66
- package/models/openresponsesformatjsonschema.js +0 -56
- package/models/openresponsesformattext.d.ts +0 -54
- package/models/openresponsesformattext.js +0 -48
- package/models/openresponsesformattextconfig.d.ts +0 -30
- package/models/openresponsesformattextconfig.js +0 -37
- package/models/openresponsesfunctioncalloutput.d.ts +0 -63
- package/models/openresponsesfunctioncalloutput.js +0 -66
- package/models/openresponsesfunctiontoolcall.d.ts +0 -65
- package/models/openresponsesfunctiontoolcall.js +0 -68
- package/models/openresponsesinput.d.ts +0 -28
- package/models/openresponsesinput.js +0 -35
- package/models/openresponsesinputcontent.d.ts +0 -42
- package/models/openresponsesinputcontent.js +0 -49
- package/models/openresponsesinputfile.d.ts +0 -62
- package/models/openresponsesinputfile.js +0 -69
- package/models/openresponsesinputimage.d.ts +0 -78
- package/models/openresponsesinputimage.js +0 -89
- package/models/openresponsesinputitem.d.ts +0 -38
- package/models/openresponsesinputitem.js +0 -61
- package/models/openresponsesinputmessageitem.d.ts +0 -148
- package/models/openresponsesinputmessageitem.js +0 -146
- package/models/openresponsesinputtext.d.ts +0 -56
- package/models/openresponsesinputtext.js +0 -50
- package/models/openresponseslogprobs.d.ts +0 -65
- package/models/openresponseslogprobs.js +0 -70
- package/models/openresponsesnonstreamingresponse.d.ts +0 -259
- package/models/openresponsesnonstreamingresponse.js +0 -289
- package/models/openresponsesoutputtext.d.ts +0 -79
- package/models/openresponsesoutputtext.js +0 -92
- package/models/openresponsesprompt.d.ts +0 -38
- package/models/openresponsesprompt.js +0 -33
- package/models/openresponsesreasoning.d.ts +0 -89
- package/models/openresponsesreasoning.js +0 -100
- package/models/openresponsesreasoningconfig.d.ts +0 -60
- package/models/openresponsesreasoningconfig.js +0 -77
- package/models/openresponsesrefusalcontent.d.ts +0 -53
- package/models/openresponsesrefusalcontent.js +0 -50
- package/models/openresponsesrequest.d.ts +0 -27
- package/models/openresponsesrequest.js +0 -26
- package/models/openresponsesstreamevent.d.ts +0 -1682
- package/models/openresponsesstreamevent.js +0 -1943
- package/models/openresponsestextconfig.d.ts +0 -58
- package/models/openresponsestextconfig.js +0 -62
- package/models/openresponsestoolchoice.d.ts +0 -147
- package/models/openresponsestoolchoice.js +0 -138
- package/models/openresponsestoolunion.d.ts +0 -94
- package/models/openresponsestoolunion.js +0 -93
- package/models/openresponseswebsearch20250826tool.d.ts +0 -93
- package/models/openresponseswebsearch20250826tool.js +0 -102
- package/models/openresponseswebsearchpreview20250311tool.d.ts +0 -63
- package/models/openresponseswebsearchpreview20250311tool.js +0 -67
- package/models/openresponseswebsearchpreviewtool.d.ts +0 -63
- package/models/openresponseswebsearchpreviewtool.js +0 -67
- package/models/openresponseswebsearchtool.d.ts +0 -93
- package/models/openresponseswebsearchtool.js +0 -102
- package/models/operations/createapialpharesponses.d.ts +0 -57
- package/models/operations/createapialpharesponses.js +0 -82
- package/models/operations/createcoinbasecharge.d.ts +0 -211
- package/models/operations/createcoinbasecharge.js +0 -266
- package/models/operations/createkeys.d.ts +0 -225
- package/models/operations/createkeys.js +0 -194
- package/models/operations/deletekeys.d.ts +0 -62
- package/models/operations/deletekeys.js +0 -55
- package/models/operations/getcredits.d.ts +0 -27
- package/models/operations/getcredits.js +0 -26
- package/models/operations/getcurrentkey.d.ts +0 -185
- package/models/operations/getcurrentkey.js +0 -147
- package/models/operations/getgeneration.d.ts +0 -271
- package/models/operations/getgeneration.js +0 -229
- package/models/operations/getkey.d.ts +0 -178
- package/models/operations/getkey.js +0 -147
- package/models/operations/getmodels.d.ts +0 -56
- package/models/operations/getmodels.js +0 -79
- package/models/operations/getparameters.d.ts +0 -249
- package/models/operations/getparameters.js +0 -259
- package/models/operations/getuseractivity.d.ts +0 -63
- package/models/operations/getuseractivity.js +0 -56
- package/models/operations/index.d.ts +0 -19
- package/models/operations/index.js +0 -22
- package/models/operations/list.d.ts +0 -180
- package/models/operations/list.js +0 -158
- package/models/operations/listendpoints.d.ts +0 -62
- package/models/operations/listendpoints.js +0 -58
- package/models/operations/listendpointszdr.d.ts +0 -53
- package/models/operations/listendpointszdr.js +0 -58
- package/models/operations/listmodelscount.d.ts +0 -25
- package/models/operations/listmodelscount.js +0 -33
- package/models/operations/listmodelsuser.d.ts +0 -50
- package/models/operations/listmodelsuser.js +0 -58
- package/models/operations/listproviders.d.ts +0 -115
- package/models/operations/listproviders.js +0 -104
- package/models/operations/sendchatcompletionrequest.d.ts +0 -26
- package/models/operations/sendchatcompletionrequest.js +0 -40
- package/models/operations/updatekeys.d.ts +0 -255
- package/models/operations/updatekeys.js +0 -229
- package/models/outputtextcontent.d.ts +0 -79
- package/models/outputtextcontent.js +0 -92
- package/models/publicendpoint.d.ts +0 -27
- package/models/publicendpoint.js +0 -26
- package/models/reasoningsummarytext.d.ts +0 -53
- package/models/reasoningsummarytext.js +0 -50
- package/models/reasoningsummaryverbosity.d.ts +0 -22
- package/models/reasoningsummaryverbosity.js +0 -32
- package/models/reasoningtextcontent.d.ts +0 -53
- package/models/reasoningtextcontent.js +0 -50
- package/models/refusalcontent.d.ts +0 -53
- package/models/refusalcontent.js +0 -50
- package/models/responseformatjsonschema.d.ts +0 -31
- package/models/responseformatjsonschema.js +0 -42
- package/models/responseformattextgrammar.d.ts +0 -30
- package/models/responseformattextgrammar.js +0 -32
- package/models/responseserrorfield.d.ts +0 -54
- package/models/responseserrorfield.js +0 -60
- package/models/responsesimagegenerationcall.d.ts +0 -58
- package/models/responsesimagegenerationcall.js +0 -55
- package/models/responsesoutputitem.d.ts +0 -33
- package/models/responsesoutputitem.js +0 -46
- package/models/responsesoutputitemfilesearchcall.d.ts +0 -58
- package/models/responsesoutputitemfilesearchcall.js +0 -55
- package/models/responsesoutputitemfunctioncall.d.ts +0 -59
- package/models/responsesoutputitemfunctioncall.js +0 -65
- package/models/responsesoutputitemreasoning.d.ts +0 -61
- package/models/responsesoutputitemreasoning.js +0 -67
- package/models/responsesoutputmessage.d.ts +0 -191
- package/models/responsesoutputmessage.js +0 -189
- package/models/responsessearchcontextsize.d.ts +0 -28
- package/models/responsessearchcontextsize.js +0 -35
- package/models/responsesusage.d.ts +0 -130
- package/models/responsesusage.js +0 -173
- package/models/responseswebsearchcalloutput.d.ts +0 -56
- package/models/responseswebsearchcalloutput.js +0 -53
- package/models/responseswebsearchuserlocation.d.ts +0 -62
- package/models/responseswebsearchuserlocation.js +0 -56
- package/models/security.d.ts +0 -28
- package/models/security.js +0 -31
- package/models/systemmessage.d.ts +0 -54
- package/models/systemmessage.js +0 -63
- package/models/tool.d.ts +0 -65
- package/models/tool.js +0 -64
- package/models/toolcallstatus.d.ts +0 -22
- package/models/toolcallstatus.js +0 -32
- package/models/toolchoicetypes.d.ts +0 -163
- package/models/toolchoicetypes.js +0 -166
- package/models/toolresponsemessage.d.ts +0 -54
- package/models/toolresponsemessage.js +0 -68
- package/models/urlcitationannotation.d.ts +0 -59
- package/models/urlcitationannotation.js +0 -67
- package/models/usermessage.d.ts +0 -54
- package/models/usermessage.js +0 -63
- package/models/websearchpreviewtooluserlocation.d.ts +0 -59
- package/models/websearchpreviewtooluserlocation.js +0 -56
- package/models/websearchstatus.d.ts +0 -23
- package/models/websearchstatus.js +0 -33
- package/react-query/_context.d.ts +0 -7
- package/react-query/_context.js +0 -13
- package/react-query/_types.d.ts +0 -26
- package/react-query/_types.js +0 -4
- package/react-query/analyticsGetUserActivity.d.ts +0 -35
- package/react-query/analyticsGetUserActivity.js +0 -76
- package/react-query/apiKeysCreate.d.ts +0 -19
- package/react-query/apiKeysCreate.js +0 -38
- package/react-query/apiKeysDelete.d.ts +0 -19
- package/react-query/apiKeysDelete.js +0 -38
- package/react-query/apiKeysGet.d.ts +0 -23
- package/react-query/apiKeysGet.js +0 -65
- package/react-query/apiKeysGetCurrentKeyMetadata.d.ts +0 -28
- package/react-query/apiKeysGetCurrentKeyMetadata.js +0 -65
- package/react-query/apiKeysList.d.ts +0 -36
- package/react-query/apiKeysList.js +0 -68
- package/react-query/apiKeysUpdate.d.ts +0 -19
- package/react-query/apiKeysUpdate.js +0 -38
- package/react-query/betaResponsesSend.d.ts +0 -23
- package/react-query/betaResponsesSend.js +0 -41
- package/react-query/chatSend.d.ts +0 -23
- package/react-query/chatSend.js +0 -41
- package/react-query/completionsGenerate.d.ts +0 -22
- package/react-query/completionsGenerate.js +0 -41
- package/react-query/creditsCreateCoinbaseCharge.d.ts +0 -24
- package/react-query/creditsCreateCoinbaseCharge.js +0 -41
- package/react-query/creditsGetCredits.d.ts +0 -28
- package/react-query/creditsGetCredits.js +0 -65
- package/react-query/endpointsList.d.ts +0 -23
- package/react-query/endpointsList.js +0 -65
- package/react-query/endpointsListZdrEndpoints.d.ts +0 -22
- package/react-query/endpointsListZdrEndpoints.js +0 -59
- package/react-query/generationsGetGeneration.d.ts +0 -29
- package/react-query/generationsGetGeneration.js +0 -70
- package/react-query/index.d.ts +0 -22
- package/react-query/index.js +0 -25
- package/react-query/modelsCount.d.ts +0 -22
- package/react-query/modelsCount.js +0 -59
- package/react-query/modelsList.d.ts +0 -42
- package/react-query/modelsList.js +0 -70
- package/react-query/modelsListForUser.d.ts +0 -22
- package/react-query/modelsListForUser.js +0 -59
- package/react-query/parametersGetParameters.d.ts +0 -37
- package/react-query/parametersGetParameters.js +0 -79
- package/react-query/providersList.d.ts +0 -22
- package/react-query/providersList.js +0 -59
- package/sdk/analytics.d.ts +0 -11
- package/sdk/analytics.js +0 -17
- package/sdk/apikeys.d.ts +0 -31
- package/sdk/apikeys.js +0 -52
- package/sdk/beta.d.ts +0 -6
- package/sdk/beta.js +0 -10
- package/sdk/chat.d.ts +0 -12
- package/sdk/chat.js +0 -17
- package/sdk/completions.d.ts +0 -11
- package/sdk/completions.js +0 -17
- package/sdk/credits.d.ts +0 -19
- package/sdk/credits.js +0 -27
- package/sdk/endpoints.d.ts +0 -12
- package/sdk/endpoints.js +0 -21
- package/sdk/generations.d.ts +0 -8
- package/sdk/generations.js +0 -14
- package/sdk/index.d.ts +0 -1
- package/sdk/index.js +0 -4
- package/sdk/models.d.ts +0 -16
- package/sdk/models.js +0 -28
- package/sdk/parameters.d.ts +0 -8
- package/sdk/parameters.js +0 -14
- package/sdk/providers.d.ts +0 -8
- package/sdk/providers.js +0 -14
- package/sdk/responses.d.ts +0 -12
- package/sdk/responses.js +0 -17
- package/sdk/sdk.d.ts +0 -36
- package/sdk/sdk.js +0 -50
- package/types/async.d.ts +0 -22
- package/types/async.js +0 -39
- package/types/blobs.d.ts +0 -3
- package/types/blobs.js +0 -24
- package/types/constdatetime.d.ts +0 -2
- package/types/constdatetime.js +0 -9
- package/types/enums.d.ts +0 -11
- package/types/enums.js +0 -6
- package/types/fp.d.ts +0 -30
- package/types/fp.js +0 -30
- package/types/index.d.ts +0 -7
- package/types/index.js +0 -7
- package/types/operations.d.ts +0 -26
- package/types/operations.js +0 -76
- package/types/rfcdate.d.ts +0 -20
- package/types/rfcdate.js +0 -41
- package/types/streams.d.ts +0 -1
- package/types/streams.js +0 -14
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
import * as M from "../lib/matchers.js";
|
|
5
|
-
import { compactMap } from "../lib/primitives.js";
|
|
6
|
-
import { resolveSecurity } from "../lib/security.js";
|
|
7
|
-
import { pathToFunc } from "../lib/url.js";
|
|
8
|
-
import * as operations from "../models/operations/index.js";
|
|
9
|
-
import { APIPromise } from "../types/async.js";
|
|
10
|
-
/**
|
|
11
|
-
* List models filtered by user provider preferences
|
|
12
|
-
*/
|
|
13
|
-
export function modelsListForUser(client, security, options) {
|
|
14
|
-
return new APIPromise($do(client, security, options));
|
|
15
|
-
}
|
|
16
|
-
async function $do(client, security, options) {
|
|
17
|
-
const path = pathToFunc("/models/user")();
|
|
18
|
-
const headers = new Headers(compactMap({
|
|
19
|
-
Accept: "application/json",
|
|
20
|
-
}));
|
|
21
|
-
const requestSecurity = resolveSecurity([
|
|
22
|
-
{
|
|
23
|
-
fieldName: "Authorization",
|
|
24
|
-
type: "http:bearer",
|
|
25
|
-
value: security?.bearer,
|
|
26
|
-
},
|
|
27
|
-
]);
|
|
28
|
-
const context = {
|
|
29
|
-
options: client._options,
|
|
30
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
31
|
-
operationID: "listModelsUser",
|
|
32
|
-
oAuth2Scopes: null,
|
|
33
|
-
resolvedSecurity: requestSecurity,
|
|
34
|
-
securitySource: security,
|
|
35
|
-
retryConfig: options?.retries
|
|
36
|
-
|| client._options.retryConfig
|
|
37
|
-
|| { strategy: "none" },
|
|
38
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
39
|
-
};
|
|
40
|
-
const requestRes = client._createRequest(context, {
|
|
41
|
-
security: requestSecurity,
|
|
42
|
-
method: "GET",
|
|
43
|
-
baseURL: options?.serverURL,
|
|
44
|
-
path: path,
|
|
45
|
-
headers: headers,
|
|
46
|
-
userAgent: client._options.userAgent,
|
|
47
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
48
|
-
}, options);
|
|
49
|
-
if (!requestRes.ok) {
|
|
50
|
-
return [requestRes, { status: "invalid" }];
|
|
51
|
-
}
|
|
52
|
-
const req = requestRes.value;
|
|
53
|
-
const doResult = await client._do(req, {
|
|
54
|
-
context,
|
|
55
|
-
errorCodes: ["4XX", "5XX"],
|
|
56
|
-
retryConfig: context.retryConfig,
|
|
57
|
-
retryCodes: context.retryCodes,
|
|
58
|
-
});
|
|
59
|
-
if (!doResult.ok) {
|
|
60
|
-
return [doResult, { status: "request-error", request: req }];
|
|
61
|
-
}
|
|
62
|
-
const response = doResult.value;
|
|
63
|
-
const [result] = await M.match(M.json(200, operations.ListModelsUserResponse$inboundSchema), M.fail("4XX"), M.fail("5XX"), M.json("default", operations.ListModelsUserResponse$inboundSchema))(response, req);
|
|
64
|
-
if (!result.ok) {
|
|
65
|
-
return [result, { status: "complete", request: req, response }];
|
|
66
|
-
}
|
|
67
|
-
return [result, { status: "complete", request: req, response }];
|
|
68
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import z from "zod/v3";
|
|
2
|
-
import { OpenRouterCore } from "../core.js";
|
|
3
|
-
import { Result } from "../types/fp.js";
|
|
4
|
-
declare const CreateAuthorizationurlParamsSchema: z.ZodUnion<[z.ZodObject<{
|
|
5
|
-
callbackUrl: z.ZodUnion<[z.ZodString, z.ZodType<URL, z.ZodTypeDef, URL>]>;
|
|
6
|
-
limit: z.ZodOptional<z.ZodNumber>;
|
|
7
|
-
} & {
|
|
8
|
-
codeChallengeMethod: z.ZodEnum<["S256", "plain"]>;
|
|
9
|
-
codeChallenge: z.ZodString;
|
|
10
|
-
}, "strip", z.ZodTypeAny, {
|
|
11
|
-
callbackUrl: string | URL;
|
|
12
|
-
codeChallengeMethod: "S256" | "plain";
|
|
13
|
-
codeChallenge: string;
|
|
14
|
-
limit?: number | undefined;
|
|
15
|
-
}, {
|
|
16
|
-
callbackUrl: string | URL;
|
|
17
|
-
codeChallengeMethod: "S256" | "plain";
|
|
18
|
-
codeChallenge: string;
|
|
19
|
-
limit?: number | undefined;
|
|
20
|
-
}>, z.ZodObject<{
|
|
21
|
-
callbackUrl: z.ZodUnion<[z.ZodString, z.ZodType<URL, z.ZodTypeDef, URL>]>;
|
|
22
|
-
limit: z.ZodOptional<z.ZodNumber>;
|
|
23
|
-
}, "strip", z.ZodTypeAny, {
|
|
24
|
-
callbackUrl: string | URL;
|
|
25
|
-
limit?: number | undefined;
|
|
26
|
-
}, {
|
|
27
|
-
callbackUrl: string | URL;
|
|
28
|
-
limit?: number | undefined;
|
|
29
|
-
}>]>;
|
|
30
|
-
export type CreateAuthorizationUrlRequest = z.infer<typeof CreateAuthorizationurlParamsSchema>;
|
|
31
|
-
/**
|
|
32
|
-
* Generate a OAuth2 authorization URL
|
|
33
|
-
*
|
|
34
|
-
* @remarks
|
|
35
|
-
* Generates a URL to redirect users to for authorizing your application. The
|
|
36
|
-
* URL includes the provided callback URL and, if applicable, the code
|
|
37
|
-
* challenge parameters for PKCE.
|
|
38
|
-
*
|
|
39
|
-
* @see {@link https://openrouter.ai/docs/use-cases/oauth-pkce}
|
|
40
|
-
*/
|
|
41
|
-
export declare function oAuthCreateAuthorizationUrl(client: OpenRouterCore, params: CreateAuthorizationUrlRequest): Result<string>;
|
|
42
|
-
export {};
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import z from "zod/v3";
|
|
2
|
-
import { serverURLFromOptions } from "../lib/config.js";
|
|
3
|
-
const CreateAuthorizationUrlBaseSchema = z.object({
|
|
4
|
-
callbackUrl: z.union([z.string().url(), z.instanceof(URL)]),
|
|
5
|
-
limit: z.number().optional(),
|
|
6
|
-
});
|
|
7
|
-
const CreateAuthorizationurlParamsSchema = z.union([
|
|
8
|
-
CreateAuthorizationUrlBaseSchema.extend({
|
|
9
|
-
codeChallengeMethod: z.enum(["S256", "plain"]),
|
|
10
|
-
codeChallenge: z.string(),
|
|
11
|
-
}),
|
|
12
|
-
CreateAuthorizationUrlBaseSchema,
|
|
13
|
-
]);
|
|
14
|
-
/**
|
|
15
|
-
* Generate a OAuth2 authorization URL
|
|
16
|
-
*
|
|
17
|
-
* @remarks
|
|
18
|
-
* Generates a URL to redirect users to for authorizing your application. The
|
|
19
|
-
* URL includes the provided callback URL and, if applicable, the code
|
|
20
|
-
* challenge parameters for PKCE.
|
|
21
|
-
*
|
|
22
|
-
* @see {@link https://openrouter.ai/docs/use-cases/oauth-pkce}
|
|
23
|
-
*/
|
|
24
|
-
export function oAuthCreateAuthorizationUrl(client, params) {
|
|
25
|
-
const parsedParams = CreateAuthorizationurlParamsSchema.safeParse(params);
|
|
26
|
-
if (!parsedParams.success)
|
|
27
|
-
return { ok: false, error: parsedParams.error };
|
|
28
|
-
const baseURL = serverURLFromOptions(client._options);
|
|
29
|
-
if (!baseURL) {
|
|
30
|
-
return { ok: false, error: new Error("No server URL configured") };
|
|
31
|
-
}
|
|
32
|
-
// Clone the URL to avoid mutating the original
|
|
33
|
-
const authURL = new URL("/auth", baseURL);
|
|
34
|
-
authURL.searchParams.set("callback_url", parsedParams.data.callbackUrl.toString());
|
|
35
|
-
if ("codeChallengeMethod" in parsedParams.data) {
|
|
36
|
-
authURL.searchParams.set("code_challenge", parsedParams.data.codeChallenge);
|
|
37
|
-
authURL.searchParams.set("code_challenge_method", parsedParams.data.codeChallengeMethod);
|
|
38
|
-
}
|
|
39
|
-
if (parsedParams.data.limit !== undefined) {
|
|
40
|
-
authURL.searchParams.set("limit", parsedParams.data.limit.toString());
|
|
41
|
-
}
|
|
42
|
-
return { ok: true, value: authURL.toString() };
|
|
43
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import z from "zod/v3";
|
|
2
|
-
import { Result } from "../types/fp.js";
|
|
3
|
-
declare const CreateSHA256CodeChallengeRequestSchema: z.ZodObject<{
|
|
4
|
-
/**
|
|
5
|
-
* If not provided, a random code verifier will be generated.
|
|
6
|
-
* If provided, must be 43-128 characters and contain only unreserved
|
|
7
|
-
* characters [A-Za-z0-9-._~] per RFC 7636.
|
|
8
|
-
*/
|
|
9
|
-
codeVerifier: z.ZodOptional<z.ZodString>;
|
|
10
|
-
}, "strip", z.ZodTypeAny, {
|
|
11
|
-
codeVerifier?: string | undefined;
|
|
12
|
-
}, {
|
|
13
|
-
codeVerifier?: string | undefined;
|
|
14
|
-
}>;
|
|
15
|
-
export type CreateSHA256CodeChallengeRequest = z.infer<typeof CreateSHA256CodeChallengeRequestSchema>;
|
|
16
|
-
export type CreateSHA256CodeChallengeResponse = {
|
|
17
|
-
codeChallenge: string;
|
|
18
|
-
codeVerifier: string;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* Generate a SHA-256 code challenge for PKCE
|
|
22
|
-
*
|
|
23
|
-
* @remarks
|
|
24
|
-
* Generates a SHA-256 code challenge and corresponding code verifier for use
|
|
25
|
-
* in the PKCE extension to OAuth2. If no code verifier is provided, a random
|
|
26
|
-
* one will be generated according to RFC 7636 (32 random bytes, base64url
|
|
27
|
-
* encoded). If a code verifier is provided, it must be 43-128 characters and
|
|
28
|
-
* contain only unreserved characters [A-Za-z0-9-._~].
|
|
29
|
-
*
|
|
30
|
-
* @see {@link https://openrouter.ai/docs/use-cases/oauth-pkce}
|
|
31
|
-
* @see {@link https://datatracker.ietf.org/doc/html/rfc7636}
|
|
32
|
-
*/
|
|
33
|
-
export declare function oAuthCreateSHA256CodeChallenge(params?: CreateSHA256CodeChallengeRequest): Promise<Result<CreateSHA256CodeChallengeResponse>>;
|
|
34
|
-
export {};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import z from "zod/v3";
|
|
2
|
-
const CreateSHA256CodeChallengeRequestSchema = z.object({
|
|
3
|
-
/**
|
|
4
|
-
* If not provided, a random code verifier will be generated.
|
|
5
|
-
* If provided, must be 43-128 characters and contain only unreserved
|
|
6
|
-
* characters [A-Za-z0-9-._~] per RFC 7636.
|
|
7
|
-
*/
|
|
8
|
-
codeVerifier: z
|
|
9
|
-
.string()
|
|
10
|
-
.min(43, "Code verifier must be at least 43 characters")
|
|
11
|
-
.max(128, "Code verifier must be at most 128 characters")
|
|
12
|
-
.regex(/^[A-Za-z0-9\-._~]+$/, "Code verifier must only contain unreserved characters: [A-Za-z0-9-._~]")
|
|
13
|
-
.optional(),
|
|
14
|
-
});
|
|
15
|
-
/**
|
|
16
|
-
* Convert a Uint8Array to base64url encoding (RFC 4648)
|
|
17
|
-
*/
|
|
18
|
-
function arrayBufferToBase64Url(buffer) {
|
|
19
|
-
let binary = "";
|
|
20
|
-
for (let i = 0; i < buffer.length; i++) {
|
|
21
|
-
binary += String.fromCharCode(buffer[i]);
|
|
22
|
-
}
|
|
23
|
-
return btoa(binary)
|
|
24
|
-
.replace(/\+/g, "-")
|
|
25
|
-
.replace(/\//g, "_")
|
|
26
|
-
.replace(/=+$/, "");
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Generate a cryptographically random code verifier per RFC 7636
|
|
30
|
-
*/
|
|
31
|
-
function generateCodeVerifier() {
|
|
32
|
-
// RFC 7636 recommends 32 octets of random data, base64url encoded = 43 chars
|
|
33
|
-
const randomBytes = crypto.getRandomValues(new Uint8Array(32));
|
|
34
|
-
return arrayBufferToBase64Url(randomBytes);
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Generate a SHA-256 code challenge for PKCE
|
|
38
|
-
*
|
|
39
|
-
* @remarks
|
|
40
|
-
* Generates a SHA-256 code challenge and corresponding code verifier for use
|
|
41
|
-
* in the PKCE extension to OAuth2. If no code verifier is provided, a random
|
|
42
|
-
* one will be generated according to RFC 7636 (32 random bytes, base64url
|
|
43
|
-
* encoded). If a code verifier is provided, it must be 43-128 characters and
|
|
44
|
-
* contain only unreserved characters [A-Za-z0-9-._~].
|
|
45
|
-
*
|
|
46
|
-
* @see {@link https://openrouter.ai/docs/use-cases/oauth-pkce}
|
|
47
|
-
* @see {@link https://datatracker.ietf.org/doc/html/rfc7636}
|
|
48
|
-
*/
|
|
49
|
-
export async function oAuthCreateSHA256CodeChallenge(params = {}) {
|
|
50
|
-
const parsedParams = CreateSHA256CodeChallengeRequestSchema.safeParse(params);
|
|
51
|
-
if (!parsedParams.success)
|
|
52
|
-
return { ok: false, error: parsedParams.error };
|
|
53
|
-
const { codeVerifier = generateCodeVerifier() } = parsedParams.data;
|
|
54
|
-
// Generate SHA-256 hash
|
|
55
|
-
const encoder = new TextEncoder();
|
|
56
|
-
const data = encoder.encode(codeVerifier);
|
|
57
|
-
const hash = await crypto.subtle.digest("SHA-256", data);
|
|
58
|
-
// Convert hash to base64url
|
|
59
|
-
const hashArray = new Uint8Array(hash);
|
|
60
|
-
const codeChallenge = arrayBufferToBase64Url(hashArray);
|
|
61
|
-
return {
|
|
62
|
-
ok: true,
|
|
63
|
-
value: {
|
|
64
|
-
codeChallenge,
|
|
65
|
-
codeVerifier,
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { OpenRouterCore } from "../core.js";
|
|
2
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
-
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
4
|
-
import * as errors from "../models/errors/index.js";
|
|
5
|
-
import { OpenRouterError } from "../models/errors/openroutererror.js";
|
|
6
|
-
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
7
|
-
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
8
|
-
import * as operations from "../models/operations/index.js";
|
|
9
|
-
import { APIPromise } from "../types/async.js";
|
|
10
|
-
import { Result } from "../types/fp.js";
|
|
11
|
-
/**
|
|
12
|
-
* Get a model's supported parameters and data about which are most popular
|
|
13
|
-
*/
|
|
14
|
-
export declare function parametersGetParameters(client: OpenRouterCore, security: operations.GetParametersSecurity, request: operations.GetParametersRequest, options?: RequestOptions): APIPromise<Result<operations.GetParametersResponse, errors.ErrorResponse | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
5
|
-
import * as M from "../lib/matchers.js";
|
|
6
|
-
import { compactMap } from "../lib/primitives.js";
|
|
7
|
-
import { safeParse } from "../lib/schemas.js";
|
|
8
|
-
import { resolveSecurity } from "../lib/security.js";
|
|
9
|
-
import { pathToFunc } from "../lib/url.js";
|
|
10
|
-
import * as errors from "../models/errors/index.js";
|
|
11
|
-
import * as operations from "../models/operations/index.js";
|
|
12
|
-
import { APIPromise } from "../types/async.js";
|
|
13
|
-
/**
|
|
14
|
-
* Get a model's supported parameters and data about which are most popular
|
|
15
|
-
*/
|
|
16
|
-
export function parametersGetParameters(client, security, request, options) {
|
|
17
|
-
return new APIPromise($do(client, security, request, options));
|
|
18
|
-
}
|
|
19
|
-
async function $do(client, security, request, options) {
|
|
20
|
-
const parsed = safeParse(request, (value) => operations.GetParametersRequest$outboundSchema.parse(value), "Input validation failed");
|
|
21
|
-
if (!parsed.ok) {
|
|
22
|
-
return [parsed, { status: "invalid" }];
|
|
23
|
-
}
|
|
24
|
-
const payload = parsed.value;
|
|
25
|
-
const body = null;
|
|
26
|
-
const pathParams = {
|
|
27
|
-
author: encodeSimple("author", payload.author, {
|
|
28
|
-
explode: false,
|
|
29
|
-
charEncoding: "percent",
|
|
30
|
-
}),
|
|
31
|
-
slug: encodeSimple("slug", payload.slug, {
|
|
32
|
-
explode: false,
|
|
33
|
-
charEncoding: "percent",
|
|
34
|
-
}),
|
|
35
|
-
};
|
|
36
|
-
const path = pathToFunc("/parameters/{author}/{slug}")(pathParams);
|
|
37
|
-
const query = encodeFormQuery({
|
|
38
|
-
"provider": payload.provider,
|
|
39
|
-
});
|
|
40
|
-
const headers = new Headers(compactMap({
|
|
41
|
-
Accept: "application/json",
|
|
42
|
-
}));
|
|
43
|
-
const requestSecurity = resolveSecurity([
|
|
44
|
-
{
|
|
45
|
-
fieldName: "Authorization",
|
|
46
|
-
type: "http:bearer",
|
|
47
|
-
value: security?.bearer,
|
|
48
|
-
},
|
|
49
|
-
]);
|
|
50
|
-
const context = {
|
|
51
|
-
options: client._options,
|
|
52
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
53
|
-
operationID: "getParameters",
|
|
54
|
-
oAuth2Scopes: null,
|
|
55
|
-
resolvedSecurity: requestSecurity,
|
|
56
|
-
securitySource: security,
|
|
57
|
-
retryConfig: options?.retries
|
|
58
|
-
|| client._options.retryConfig
|
|
59
|
-
|| { strategy: "none" },
|
|
60
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
61
|
-
};
|
|
62
|
-
const requestRes = client._createRequest(context, {
|
|
63
|
-
security: requestSecurity,
|
|
64
|
-
method: "GET",
|
|
65
|
-
baseURL: options?.serverURL,
|
|
66
|
-
path: path,
|
|
67
|
-
headers: headers,
|
|
68
|
-
query: query,
|
|
69
|
-
body: body,
|
|
70
|
-
userAgent: client._options.userAgent,
|
|
71
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
72
|
-
}, options);
|
|
73
|
-
if (!requestRes.ok) {
|
|
74
|
-
return [requestRes, { status: "invalid" }];
|
|
75
|
-
}
|
|
76
|
-
const req = requestRes.value;
|
|
77
|
-
const doResult = await client._do(req, {
|
|
78
|
-
context,
|
|
79
|
-
errorCodes: ["4XX", "5XX"],
|
|
80
|
-
retryConfig: context.retryConfig,
|
|
81
|
-
retryCodes: context.retryCodes,
|
|
82
|
-
});
|
|
83
|
-
if (!doResult.ok) {
|
|
84
|
-
return [doResult, { status: "request-error", request: req }];
|
|
85
|
-
}
|
|
86
|
-
const response = doResult.value;
|
|
87
|
-
const responseFields = {
|
|
88
|
-
HttpMeta: { Response: response, Request: req },
|
|
89
|
-
};
|
|
90
|
-
const [result] = await M.match(M.json(200, operations.GetParametersResponse$inboundSchema), M.jsonErr("4XX", errors.ErrorResponse$inboundSchema), M.jsonErr("5XX", errors.ErrorResponse$inboundSchema))(response, req, { extraFields: responseFields });
|
|
91
|
-
if (!result.ok) {
|
|
92
|
-
return [result, { status: "complete", request: req, response }];
|
|
93
|
-
}
|
|
94
|
-
return [result, { status: "complete", request: req, response }];
|
|
95
|
-
}
|
package/funcs/providersList.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { OpenRouterCore } from "../core.js";
|
|
2
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
3
|
-
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
|
|
4
|
-
import * as errors from "../models/errors/index.js";
|
|
5
|
-
import { OpenRouterError } from "../models/errors/openroutererror.js";
|
|
6
|
-
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
7
|
-
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
8
|
-
import * as operations from "../models/operations/index.js";
|
|
9
|
-
import { APIPromise } from "../types/async.js";
|
|
10
|
-
import { Result } from "../types/fp.js";
|
|
11
|
-
/**
|
|
12
|
-
* List all providers
|
|
13
|
-
*/
|
|
14
|
-
export declare function providersList(client: OpenRouterCore, options?: RequestOptions): APIPromise<Result<operations.ListProvidersResponse, errors.InternalServerError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
|
package/funcs/providersList.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
import * as M from "../lib/matchers.js";
|
|
5
|
-
import { compactMap } from "../lib/primitives.js";
|
|
6
|
-
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
7
|
-
import { pathToFunc } from "../lib/url.js";
|
|
8
|
-
import * as errors from "../models/errors/index.js";
|
|
9
|
-
import * as operations from "../models/operations/index.js";
|
|
10
|
-
import { APIPromise } from "../types/async.js";
|
|
11
|
-
/**
|
|
12
|
-
* List all providers
|
|
13
|
-
*/
|
|
14
|
-
export function providersList(client, options) {
|
|
15
|
-
return new APIPromise($do(client, options));
|
|
16
|
-
}
|
|
17
|
-
async function $do(client, options) {
|
|
18
|
-
const path = pathToFunc("/providers")();
|
|
19
|
-
const headers = new Headers(compactMap({
|
|
20
|
-
Accept: "application/json",
|
|
21
|
-
}));
|
|
22
|
-
const secConfig = await extractSecurity(client._options.apiKey);
|
|
23
|
-
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
24
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
25
|
-
const context = {
|
|
26
|
-
options: client._options,
|
|
27
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
28
|
-
operationID: "listProviders",
|
|
29
|
-
oAuth2Scopes: null,
|
|
30
|
-
resolvedSecurity: requestSecurity,
|
|
31
|
-
securitySource: client._options.apiKey,
|
|
32
|
-
retryConfig: options?.retries
|
|
33
|
-
|| client._options.retryConfig
|
|
34
|
-
|| { strategy: "none" },
|
|
35
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
36
|
-
};
|
|
37
|
-
const requestRes = client._createRequest(context, {
|
|
38
|
-
security: requestSecurity,
|
|
39
|
-
method: "GET",
|
|
40
|
-
baseURL: options?.serverURL,
|
|
41
|
-
path: path,
|
|
42
|
-
headers: headers,
|
|
43
|
-
userAgent: client._options.userAgent,
|
|
44
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
45
|
-
}, options);
|
|
46
|
-
if (!requestRes.ok) {
|
|
47
|
-
return [requestRes, { status: "invalid" }];
|
|
48
|
-
}
|
|
49
|
-
const req = requestRes.value;
|
|
50
|
-
const doResult = await client._do(req, {
|
|
51
|
-
context,
|
|
52
|
-
errorCodes: ["4XX", "500", "5XX"],
|
|
53
|
-
retryConfig: context.retryConfig,
|
|
54
|
-
retryCodes: context.retryCodes,
|
|
55
|
-
});
|
|
56
|
-
if (!doResult.ok) {
|
|
57
|
-
return [doResult, { status: "request-error", request: req }];
|
|
58
|
-
}
|
|
59
|
-
const response = doResult.value;
|
|
60
|
-
const responseFields = {
|
|
61
|
-
HttpMeta: { Response: response, Request: req },
|
|
62
|
-
};
|
|
63
|
-
const [result] = await M.match(M.json(200, operations.ListProvidersResponse$inboundSchema), M.jsonErr(500, errors.InternalServerError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
|
|
64
|
-
if (!result.ok) {
|
|
65
|
-
return [result, { status: "complete", request: req, response }];
|
|
66
|
-
}
|
|
67
|
-
return [result, { status: "complete", request: req, response }];
|
|
68
|
-
}
|
package/hooks/hooks.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { SDKOptions } from "../lib/config.js";
|
|
2
|
-
import { RequestInput } from "../lib/http.js";
|
|
3
|
-
import { AfterErrorContext, AfterErrorHook, AfterSuccessContext, AfterSuccessHook, BeforeCreateRequestContext, BeforeCreateRequestHook, BeforeRequestContext, BeforeRequestHook, Hooks, SDKInitHook } from "./types.js";
|
|
4
|
-
export declare class SDKHooks implements Hooks {
|
|
5
|
-
sdkInitHooks: SDKInitHook[];
|
|
6
|
-
beforeCreateRequestHooks: BeforeCreateRequestHook[];
|
|
7
|
-
beforeRequestHooks: BeforeRequestHook[];
|
|
8
|
-
afterSuccessHooks: AfterSuccessHook[];
|
|
9
|
-
afterErrorHooks: AfterErrorHook[];
|
|
10
|
-
constructor();
|
|
11
|
-
registerSDKInitHook(hook: SDKInitHook): void;
|
|
12
|
-
registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook): void;
|
|
13
|
-
registerBeforeRequestHook(hook: BeforeRequestHook): void;
|
|
14
|
-
registerAfterSuccessHook(hook: AfterSuccessHook): void;
|
|
15
|
-
registerAfterErrorHook(hook: AfterErrorHook): void;
|
|
16
|
-
sdkInit(opts: SDKOptions): SDKOptions;
|
|
17
|
-
beforeCreateRequest(hookCtx: BeforeCreateRequestContext, input: RequestInput): RequestInput;
|
|
18
|
-
beforeRequest(hookCtx: BeforeRequestContext, request: Request): Promise<Request>;
|
|
19
|
-
afterSuccess(hookCtx: AfterSuccessContext, response: Response): Promise<Response>;
|
|
20
|
-
afterError(hookCtx: AfterErrorContext, response: Response | null, error: unknown): Promise<{
|
|
21
|
-
response: Response | null;
|
|
22
|
-
error: unknown;
|
|
23
|
-
}>;
|
|
24
|
-
}
|
package/hooks/hooks.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
import { initHooks } from "./registration.js";
|
|
5
|
-
export class SDKHooks {
|
|
6
|
-
constructor() {
|
|
7
|
-
this.sdkInitHooks = [];
|
|
8
|
-
this.beforeCreateRequestHooks = [];
|
|
9
|
-
this.beforeRequestHooks = [];
|
|
10
|
-
this.afterSuccessHooks = [];
|
|
11
|
-
this.afterErrorHooks = [];
|
|
12
|
-
const presetHooks = [];
|
|
13
|
-
for (const hook of presetHooks) {
|
|
14
|
-
if ("sdkInit" in hook) {
|
|
15
|
-
this.registerSDKInitHook(hook);
|
|
16
|
-
}
|
|
17
|
-
if ("beforeCreateRequest" in hook) {
|
|
18
|
-
this.registerBeforeCreateRequestHook(hook);
|
|
19
|
-
}
|
|
20
|
-
if ("beforeRequest" in hook) {
|
|
21
|
-
this.registerBeforeRequestHook(hook);
|
|
22
|
-
}
|
|
23
|
-
if ("afterSuccess" in hook) {
|
|
24
|
-
this.registerAfterSuccessHook(hook);
|
|
25
|
-
}
|
|
26
|
-
if ("afterError" in hook) {
|
|
27
|
-
this.registerAfterErrorHook(hook);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
initHooks(this);
|
|
31
|
-
}
|
|
32
|
-
registerSDKInitHook(hook) {
|
|
33
|
-
this.sdkInitHooks.push(hook);
|
|
34
|
-
}
|
|
35
|
-
registerBeforeCreateRequestHook(hook) {
|
|
36
|
-
this.beforeCreateRequestHooks.push(hook);
|
|
37
|
-
}
|
|
38
|
-
registerBeforeRequestHook(hook) {
|
|
39
|
-
this.beforeRequestHooks.push(hook);
|
|
40
|
-
}
|
|
41
|
-
registerAfterSuccessHook(hook) {
|
|
42
|
-
this.afterSuccessHooks.push(hook);
|
|
43
|
-
}
|
|
44
|
-
registerAfterErrorHook(hook) {
|
|
45
|
-
this.afterErrorHooks.push(hook);
|
|
46
|
-
}
|
|
47
|
-
sdkInit(opts) {
|
|
48
|
-
return this.sdkInitHooks.reduce((opts, hook) => hook.sdkInit(opts), opts);
|
|
49
|
-
}
|
|
50
|
-
beforeCreateRequest(hookCtx, input) {
|
|
51
|
-
let inp = input;
|
|
52
|
-
for (const hook of this.beforeCreateRequestHooks) {
|
|
53
|
-
inp = hook.beforeCreateRequest(hookCtx, inp);
|
|
54
|
-
}
|
|
55
|
-
return inp;
|
|
56
|
-
}
|
|
57
|
-
async beforeRequest(hookCtx, request) {
|
|
58
|
-
let req = request;
|
|
59
|
-
for (const hook of this.beforeRequestHooks) {
|
|
60
|
-
req = await hook.beforeRequest(hookCtx, req);
|
|
61
|
-
}
|
|
62
|
-
return req;
|
|
63
|
-
}
|
|
64
|
-
async afterSuccess(hookCtx, response) {
|
|
65
|
-
let res = response;
|
|
66
|
-
for (const hook of this.afterSuccessHooks) {
|
|
67
|
-
res = await hook.afterSuccess(hookCtx, res);
|
|
68
|
-
}
|
|
69
|
-
return res;
|
|
70
|
-
}
|
|
71
|
-
async afterError(hookCtx, response, error) {
|
|
72
|
-
let res = response;
|
|
73
|
-
let err = error;
|
|
74
|
-
for (const hook of this.afterErrorHooks) {
|
|
75
|
-
const result = await hook.afterError(hookCtx, res, err);
|
|
76
|
-
res = result.response;
|
|
77
|
-
err = result.error;
|
|
78
|
-
}
|
|
79
|
-
return { response: res, error: err };
|
|
80
|
-
}
|
|
81
|
-
}
|
package/hooks/index.d.ts
DELETED
package/hooks/index.js
DELETED
package/hooks/registration.d.ts
DELETED
package/hooks/registration.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* This file is only ever generated once on the first generation and then is free to be modified.
|
|
3
|
-
* Any hooks you wish to add should be registered in the initHooks function. Feel free to define them
|
|
4
|
-
* in this file or in separate files in the hooks folder.
|
|
5
|
-
*/
|
|
6
|
-
// @ts-expect-error remove this line when you add your first hook and hooks is used
|
|
7
|
-
export function initHooks(hooks) {
|
|
8
|
-
// Add hooks by calling hooks.register{ClientInit/BeforeCreateRequest/BeforeRequest/AfterSuccess/AfterError}Hook
|
|
9
|
-
// with an instance of a hook that implements that specific Hook interface
|
|
10
|
-
// Hooks are registered per SDK instance, and are valid for the lifetime of the SDK instance
|
|
11
|
-
}
|
package/hooks/types.d.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { SDKOptions } from "../lib/config.js";
|
|
2
|
-
import { RequestInput } from "../lib/http.js";
|
|
3
|
-
import { RetryConfig } from "../lib/retries.js";
|
|
4
|
-
import { SecurityState } from "../lib/security.js";
|
|
5
|
-
export type HookContext = {
|
|
6
|
-
baseURL: string | URL;
|
|
7
|
-
operationID: string;
|
|
8
|
-
oAuth2Scopes: string[] | null;
|
|
9
|
-
securitySource?: any | (() => Promise<any>);
|
|
10
|
-
retryConfig: RetryConfig;
|
|
11
|
-
resolvedSecurity: SecurityState | null;
|
|
12
|
-
options: SDKOptions;
|
|
13
|
-
};
|
|
14
|
-
export type Awaitable<T> = T | Promise<T>;
|
|
15
|
-
export type BeforeCreateRequestContext = HookContext & {};
|
|
16
|
-
export type BeforeRequestContext = HookContext & {};
|
|
17
|
-
export type AfterSuccessContext = HookContext & {};
|
|
18
|
-
export type AfterErrorContext = HookContext & {};
|
|
19
|
-
/**
|
|
20
|
-
* SDKInitHook is called when the SDK is initializing. The
|
|
21
|
-
* hook can return a new baseURL and HTTP client to be used by the SDK.
|
|
22
|
-
*/
|
|
23
|
-
export interface SDKInitHook {
|
|
24
|
-
sdkInit: (opts: SDKOptions) => SDKOptions;
|
|
25
|
-
}
|
|
26
|
-
export interface BeforeCreateRequestHook {
|
|
27
|
-
/**
|
|
28
|
-
* A hook that is called before the SDK creates a `Request` object. The hook
|
|
29
|
-
* can modify how a request is constructed since certain modifications, like
|
|
30
|
-
* changing the request URL, cannot be done on a request object directly.
|
|
31
|
-
*/
|
|
32
|
-
beforeCreateRequest: (hookCtx: BeforeCreateRequestContext, input: RequestInput) => RequestInput;
|
|
33
|
-
}
|
|
34
|
-
export interface BeforeRequestHook {
|
|
35
|
-
/**
|
|
36
|
-
* A hook that is called before the SDK sends a request. The hook can
|
|
37
|
-
* introduce instrumentation code such as logging, tracing and metrics or
|
|
38
|
-
* replace the request before it is sent or throw an error to stop the
|
|
39
|
-
* request from being sent.
|
|
40
|
-
*/
|
|
41
|
-
beforeRequest: (hookCtx: BeforeRequestContext, request: Request) => Awaitable<Request>;
|
|
42
|
-
}
|
|
43
|
-
export interface AfterSuccessHook {
|
|
44
|
-
/**
|
|
45
|
-
* A hook that is called after the SDK receives a response. The hook can
|
|
46
|
-
* introduce instrumentation code such as logging, tracing and metrics or
|
|
47
|
-
* modify the response before it is handled or throw an error to stop the
|
|
48
|
-
* response from being handled.
|
|
49
|
-
*/
|
|
50
|
-
afterSuccess: (hookCtx: AfterSuccessContext, response: Response) => Awaitable<Response>;
|
|
51
|
-
}
|
|
52
|
-
export interface AfterErrorHook {
|
|
53
|
-
/**
|
|
54
|
-
* A hook that is called after the SDK encounters an error, or a
|
|
55
|
-
* non-successful response. The hook can introduce instrumentation code such
|
|
56
|
-
* as logging, tracing and metrics or modify the response or error values.
|
|
57
|
-
*/
|
|
58
|
-
afterError: (hookCtx: AfterErrorContext, response: Response | null, error: unknown) => Awaitable<{
|
|
59
|
-
response: Response | null;
|
|
60
|
-
error: unknown;
|
|
61
|
-
}>;
|
|
62
|
-
}
|
|
63
|
-
export interface Hooks {
|
|
64
|
-
/** Registers a hook to be used by the SDK for initialization event. */
|
|
65
|
-
registerSDKInitHook(hook: SDKInitHook): void;
|
|
66
|
-
/** Registers a hook to be used by the SDK for to modify `Request` construction. */
|
|
67
|
-
registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook): void;
|
|
68
|
-
/** Registers a hook to be used by the SDK for the before request event. */
|
|
69
|
-
registerBeforeRequestHook(hook: BeforeRequestHook): void;
|
|
70
|
-
/** Registers a hook to be used by the SDK for the after success event. */
|
|
71
|
-
registerAfterSuccessHook(hook: AfterSuccessHook): void;
|
|
72
|
-
/** Registers a hook to be used by the SDK for the after error event. */
|
|
73
|
-
registerAfterErrorHook(hook: AfterErrorHook): void;
|
|
74
|
-
}
|
|
75
|
-
export type Hook = SDKInitHook | BeforeCreateRequestHook | BeforeRequestHook | AfterSuccessHook | AfterErrorHook;
|
package/hooks/types.js
DELETED