@openrouter/sdk 0.0.0-beta.38 → 0.0.0-beta.39
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/dist/commonjs/funcs/betaResponsesSend.js +1 -1
- package/dist/commonjs/funcs/betaResponsesSend.js.map +1 -1
- package/dist/commonjs/funcs/chatSend.js +1 -1
- package/dist/commonjs/funcs/chatSend.js.map +1 -1
- package/dist/commonjs/funcs/custom/oAuthCreateAuthorizationUrl.d.ts +43 -0
- package/dist/commonjs/funcs/custom/oAuthCreateAuthorizationUrl.d.ts.map +1 -0
- package/dist/commonjs/funcs/custom/oAuthCreateAuthorizationUrl.js +50 -0
- package/dist/commonjs/funcs/custom/oAuthCreateAuthorizationUrl.js.map +1 -0
- package/dist/commonjs/funcs/custom/oAuthCreateAuthorizationUrl.test.d.ts +2 -0
- package/dist/commonjs/funcs/custom/oAuthCreateAuthorizationUrl.test.d.ts.map +1 -0
- package/dist/commonjs/funcs/custom/oAuthCreateAuthorizationUrl.test.js +213 -0
- package/dist/commonjs/funcs/custom/oAuthCreateAuthorizationUrl.test.js.map +1 -0
- package/dist/commonjs/funcs/custom/oAuthCreateSHA256CodeChallenge.d.ts +35 -0
- package/dist/commonjs/funcs/custom/oAuthCreateSHA256CodeChallenge.d.ts.map +1 -0
- package/dist/commonjs/funcs/custom/oAuthCreateSHA256CodeChallenge.js +75 -0
- package/dist/commonjs/funcs/custom/oAuthCreateSHA256CodeChallenge.js.map +1 -0
- package/dist/commonjs/funcs/custom/oAuthCreateSHA256CodeChallenge.test.d.ts +2 -0
- package/dist/commonjs/funcs/custom/oAuthCreateSHA256CodeChallenge.test.d.ts.map +1 -0
- package/dist/commonjs/funcs/custom/oAuthCreateSHA256CodeChallenge.test.js +164 -0
- package/dist/commonjs/funcs/custom/oAuthCreateSHA256CodeChallenge.test.js.map +1 -0
- package/dist/commonjs/funcs/modelsList.js +1 -1
- package/dist/commonjs/funcs/modelsList.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/config.js.map +1 -1
- package/dist/commonjs/models/chatgenerationparams.d.ts +16 -42
- package/dist/commonjs/models/chatgenerationparams.d.ts.map +1 -1
- package/dist/commonjs/models/chatgenerationparams.js +27 -6
- package/dist/commonjs/models/chatgenerationparams.js.map +1 -1
- package/dist/commonjs/models/chatmessagecontentitemaudio.d.ts +6 -22
- package/dist/commonjs/models/chatmessagecontentitemaudio.d.ts.map +1 -1
- package/dist/commonjs/models/chatmessagecontentitemaudio.js +10 -2
- package/dist/commonjs/models/chatmessagecontentitemaudio.js.map +1 -1
- package/dist/commonjs/models/chatmessagecontentitemimage.d.ts +6 -14
- package/dist/commonjs/models/chatmessagecontentitemimage.d.ts.map +1 -1
- package/dist/commonjs/models/chatmessagecontentitemimage.js +10 -2
- package/dist/commonjs/models/chatmessagecontentitemimage.js.map +1 -1
- package/dist/commonjs/models/chatresponsechoice.d.ts +6 -18
- package/dist/commonjs/models/chatresponsechoice.d.ts.map +1 -1
- package/dist/commonjs/models/chatresponsechoice.js +10 -2
- package/dist/commonjs/models/chatresponsechoice.js.map +1 -1
- package/dist/commonjs/models/chatstreamingchoice.d.ts +6 -18
- package/dist/commonjs/models/chatstreamingchoice.d.ts.map +1 -1
- package/dist/commonjs/models/chatstreamingchoice.js +10 -2
- package/dist/commonjs/models/chatstreamingchoice.js.map +1 -1
- package/dist/commonjs/models/completionfinishreason.d.ts +6 -14
- package/dist/commonjs/models/completionfinishreason.d.ts.map +1 -1
- package/dist/commonjs/models/completionfinishreason.js +10 -2
- package/dist/commonjs/models/completionfinishreason.js.map +1 -1
- package/dist/commonjs/models/endpointslist.d.ts +21 -269
- package/dist/commonjs/models/endpointslist.d.ts.map +1 -1
- package/dist/commonjs/models/endpointslist.js +37 -8
- package/dist/commonjs/models/endpointslist.js.map +1 -1
- package/dist/commonjs/models/errorresponse.d.ts +6 -148
- package/dist/commonjs/models/errorresponse.d.ts.map +1 -1
- package/dist/commonjs/models/errorresponse.js +10 -2
- package/dist/commonjs/models/errorresponse.js.map +1 -1
- package/dist/commonjs/models/modelslist.d.ts +26 -178
- package/dist/commonjs/models/modelslist.d.ts.map +1 -1
- package/dist/commonjs/models/modelslist.js +46 -11
- package/dist/commonjs/models/modelslist.js.map +1 -1
- package/dist/commonjs/models/operations/addcoinbasecharge.d.ts +6 -14
- package/dist/commonjs/models/operations/addcoinbasecharge.d.ts.map +1 -1
- package/dist/commonjs/models/operations/addcoinbasecharge.js +9 -2
- package/dist/commonjs/models/operations/addcoinbasecharge.js.map +1 -1
- package/dist/commonjs/models/operations/create.d.ts +6 -14
- package/dist/commonjs/models/operations/create.d.ts.map +1 -1
- package/dist/commonjs/models/operations/create.js +10 -2
- package/dist/commonjs/models/operations/create.js.map +1 -1
- package/dist/commonjs/models/operations/createauthorizationcode.d.ts +6 -12
- package/dist/commonjs/models/operations/createauthorizationcode.d.ts.map +1 -1
- package/dist/commonjs/models/operations/createauthorizationcode.js +9 -2
- package/dist/commonjs/models/operations/createauthorizationcode.js.map +1 -1
- package/dist/commonjs/models/operations/exchangeauthorizationcode.d.ts +6 -12
- package/dist/commonjs/models/operations/exchangeauthorizationcode.d.ts.map +1 -1
- package/dist/commonjs/models/operations/exchangeauthorizationcode.js +9 -2
- package/dist/commonjs/models/operations/exchangeauthorizationcode.js.map +1 -1
- package/dist/commonjs/models/operations/generate.d.ts +37 -569
- package/dist/commonjs/models/operations/generate.d.ts.map +1 -1
- package/dist/commonjs/models/operations/generate.js +55 -12
- package/dist/commonjs/models/operations/generate.js.map +1 -1
- package/dist/commonjs/models/operations/getmetadata.d.ts +6 -12
- package/dist/commonjs/models/operations/getmetadata.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getmetadata.js +9 -2
- package/dist/commonjs/models/operations/getmetadata.js.map +1 -1
- package/dist/commonjs/models/operations/getparameters.d.ts +11 -189
- package/dist/commonjs/models/operations/getparameters.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getparameters.js +19 -4
- package/dist/commonjs/models/operations/getparameters.js.map +1 -1
- package/dist/commonjs/models/operations/list.d.ts +21 -125
- package/dist/commonjs/models/operations/list.d.ts.map +1 -1
- package/dist/commonjs/models/operations/list.js +36 -8
- package/dist/commonjs/models/operations/list.js.map +1 -1
- package/dist/commonjs/models/operations/previewzdr.d.ts +21 -269
- package/dist/commonjs/models/operations/previewzdr.d.ts.map +1 -1
- package/dist/commonjs/models/operations/previewzdr.js +38 -9
- package/dist/commonjs/models/operations/previewzdr.js.map +1 -1
- package/dist/commonjs/models/operations/sendresponsesrequest.d.ts +57 -621
- package/dist/commonjs/models/operations/sendresponsesrequest.d.ts.map +1 -1
- package/dist/commonjs/models/operations/sendresponsesrequest.js +88 -20
- package/dist/commonjs/models/operations/sendresponsesrequest.js.map +1 -1
- package/dist/commonjs/models/operations/update.d.ts +6 -14
- package/dist/commonjs/models/operations/update.d.ts.map +1 -1
- package/dist/commonjs/models/operations/update.js +10 -2
- package/dist/commonjs/models/operations/update.js.map +1 -1
- package/dist/commonjs/models/responsefunctioncallstatus.d.ts +6 -14
- package/dist/commonjs/models/responsefunctioncallstatus.d.ts.map +1 -1
- package/dist/commonjs/models/responsefunctioncallstatus.js +10 -2
- package/dist/commonjs/models/responsefunctioncallstatus.js.map +1 -1
- package/dist/commonjs/models/responseimagegenerationcallstatus.d.ts +6 -16
- package/dist/commonjs/models/responseimagegenerationcallstatus.d.ts.map +1 -1
- package/dist/commonjs/models/responseimagegenerationcallstatus.js +10 -2
- package/dist/commonjs/models/responseimagegenerationcallstatus.js.map +1 -1
- package/dist/commonjs/models/responseincludable.d.ts +6 -18
- package/dist/commonjs/models/responseincludable.d.ts.map +1 -1
- package/dist/commonjs/models/responseincludable.js +10 -2
- package/dist/commonjs/models/responseincludable.js.map +1 -1
- package/dist/commonjs/models/responseinputimagedetail.d.ts +6 -14
- package/dist/commonjs/models/responseinputimagedetail.d.ts.map +1 -1
- package/dist/commonjs/models/responseinputimagedetail.js +10 -2
- package/dist/commonjs/models/responseinputimagedetail.js.map +1 -1
- package/dist/commonjs/models/responsereasoningconfig.d.ts +6 -16
- package/dist/commonjs/models/responsereasoningconfig.d.ts.map +1 -1
- package/dist/commonjs/models/responsereasoningconfig.js +10 -2
- package/dist/commonjs/models/responsereasoningconfig.js.map +1 -1
- package/dist/commonjs/models/responsereasoningsummarymode.d.ts +6 -14
- package/dist/commonjs/models/responsereasoningsummarymode.d.ts.map +1 -1
- package/dist/commonjs/models/responsereasoningsummarymode.js +10 -2
- package/dist/commonjs/models/responsereasoningsummarymode.js.map +1 -1
- package/dist/commonjs/models/responsesincompletedetails.d.ts +6 -12
- package/dist/commonjs/models/responsesincompletedetails.d.ts.map +1 -1
- package/dist/commonjs/models/responsesincompletedetails.js +10 -2
- package/dist/commonjs/models/responsesincompletedetails.js.map +1 -1
- package/dist/commonjs/models/responsesnonstreamingresponse.d.ts +21 -61
- package/dist/commonjs/models/responsesnonstreamingresponse.d.ts.map +1 -1
- package/dist/commonjs/models/responsesnonstreamingresponse.js +35 -8
- package/dist/commonjs/models/responsesnonstreamingresponse.js.map +1 -1
- package/dist/commonjs/models/responsesoutputitemfilesearchcall.d.ts +6 -16
- package/dist/commonjs/models/responsesoutputitemfilesearchcall.d.ts.map +1 -1
- package/dist/commonjs/models/responsesoutputitemfilesearchcall.js +9 -2
- package/dist/commonjs/models/responsesoutputitemfilesearchcall.js.map +1 -1
- package/dist/commonjs/models/responsesoutputitemreasoning.d.ts +6 -16
- package/dist/commonjs/models/responsesoutputitemreasoning.d.ts.map +1 -1
- package/dist/commonjs/models/responsesoutputitemreasoning.js +10 -2
- package/dist/commonjs/models/responsesoutputitemreasoning.js.map +1 -1
- package/dist/commonjs/models/responsesstreamchunkunion.d.ts +31 -81
- package/dist/commonjs/models/responsesstreamchunkunion.d.ts.map +1 -1
- package/dist/commonjs/models/responsesstreamchunkunion.js +55 -12
- package/dist/commonjs/models/responsesstreamchunkunion.js.map +1 -1
- package/dist/commonjs/models/responseswebsearchcalloutput.d.ts +6 -16
- package/dist/commonjs/models/responseswebsearchcalloutput.d.ts.map +1 -1
- package/dist/commonjs/models/responseswebsearchcalloutput.js +10 -2
- package/dist/commonjs/models/responseswebsearchcalloutput.js.map +1 -1
- package/dist/commonjs/models/responsetextverbosity.d.ts +6 -14
- package/dist/commonjs/models/responsetextverbosity.d.ts.map +1 -1
- package/dist/commonjs/models/responsetextverbosity.js +10 -2
- package/dist/commonjs/models/responsetextverbosity.js.map +1 -1
- package/dist/commonjs/sdk/oauth.d.ts +27 -0
- package/dist/commonjs/sdk/oauth.d.ts.map +1 -1
- package/dist/commonjs/sdk/oauth.js +43 -0
- package/dist/commonjs/sdk/oauth.js.map +1 -1
- package/dist/esm/funcs/betaResponsesSend.js +1 -1
- package/dist/esm/funcs/betaResponsesSend.js.map +1 -1
- package/dist/esm/funcs/chatSend.js +1 -1
- package/dist/esm/funcs/chatSend.js.map +1 -1
- package/dist/esm/funcs/custom/oAuthCreateAuthorizationUrl.d.ts +43 -0
- package/dist/esm/funcs/custom/oAuthCreateAuthorizationUrl.d.ts.map +1 -0
- package/dist/esm/funcs/custom/oAuthCreateAuthorizationUrl.js +44 -0
- package/dist/esm/funcs/custom/oAuthCreateAuthorizationUrl.js.map +1 -0
- package/dist/esm/funcs/custom/oAuthCreateAuthorizationUrl.test.d.ts +2 -0
- package/dist/esm/funcs/custom/oAuthCreateAuthorizationUrl.test.d.ts.map +1 -0
- package/dist/esm/funcs/custom/oAuthCreateAuthorizationUrl.test.js +211 -0
- package/dist/esm/funcs/custom/oAuthCreateAuthorizationUrl.test.js.map +1 -0
- package/dist/esm/funcs/custom/oAuthCreateSHA256CodeChallenge.d.ts +35 -0
- package/dist/esm/funcs/custom/oAuthCreateSHA256CodeChallenge.d.ts.map +1 -0
- package/dist/esm/funcs/custom/oAuthCreateSHA256CodeChallenge.js +69 -0
- package/dist/esm/funcs/custom/oAuthCreateSHA256CodeChallenge.js.map +1 -0
- package/dist/esm/funcs/custom/oAuthCreateSHA256CodeChallenge.test.d.ts +2 -0
- package/dist/esm/funcs/custom/oAuthCreateSHA256CodeChallenge.test.d.ts.map +1 -0
- package/dist/esm/funcs/custom/oAuthCreateSHA256CodeChallenge.test.js +162 -0
- package/dist/esm/funcs/custom/oAuthCreateSHA256CodeChallenge.test.js.map +1 -0
- package/dist/esm/funcs/modelsList.js +1 -1
- package/dist/esm/funcs/modelsList.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/config.js.map +1 -1
- package/dist/esm/models/chatgenerationparams.d.ts +16 -42
- package/dist/esm/models/chatgenerationparams.d.ts.map +1 -1
- package/dist/esm/models/chatgenerationparams.js +27 -6
- package/dist/esm/models/chatgenerationparams.js.map +1 -1
- package/dist/esm/models/chatmessagecontentitemaudio.d.ts +6 -22
- package/dist/esm/models/chatmessagecontentitemaudio.d.ts.map +1 -1
- package/dist/esm/models/chatmessagecontentitemaudio.js +10 -2
- package/dist/esm/models/chatmessagecontentitemaudio.js.map +1 -1
- package/dist/esm/models/chatmessagecontentitemimage.d.ts +6 -14
- package/dist/esm/models/chatmessagecontentitemimage.d.ts.map +1 -1
- package/dist/esm/models/chatmessagecontentitemimage.js +10 -2
- package/dist/esm/models/chatmessagecontentitemimage.js.map +1 -1
- package/dist/esm/models/chatresponsechoice.d.ts +6 -18
- package/dist/esm/models/chatresponsechoice.d.ts.map +1 -1
- package/dist/esm/models/chatresponsechoice.js +10 -2
- package/dist/esm/models/chatresponsechoice.js.map +1 -1
- package/dist/esm/models/chatstreamingchoice.d.ts +6 -18
- package/dist/esm/models/chatstreamingchoice.d.ts.map +1 -1
- package/dist/esm/models/chatstreamingchoice.js +10 -2
- package/dist/esm/models/chatstreamingchoice.js.map +1 -1
- package/dist/esm/models/completionfinishreason.d.ts +6 -14
- package/dist/esm/models/completionfinishreason.d.ts.map +1 -1
- package/dist/esm/models/completionfinishreason.js +10 -2
- package/dist/esm/models/completionfinishreason.js.map +1 -1
- package/dist/esm/models/endpointslist.d.ts +21 -269
- package/dist/esm/models/endpointslist.d.ts.map +1 -1
- package/dist/esm/models/endpointslist.js +37 -8
- package/dist/esm/models/endpointslist.js.map +1 -1
- package/dist/esm/models/errorresponse.d.ts +6 -148
- package/dist/esm/models/errorresponse.d.ts.map +1 -1
- package/dist/esm/models/errorresponse.js +10 -2
- package/dist/esm/models/errorresponse.js.map +1 -1
- package/dist/esm/models/modelslist.d.ts +26 -178
- package/dist/esm/models/modelslist.d.ts.map +1 -1
- package/dist/esm/models/modelslist.js +46 -11
- package/dist/esm/models/modelslist.js.map +1 -1
- package/dist/esm/models/operations/addcoinbasecharge.d.ts +6 -14
- package/dist/esm/models/operations/addcoinbasecharge.d.ts.map +1 -1
- package/dist/esm/models/operations/addcoinbasecharge.js +9 -2
- package/dist/esm/models/operations/addcoinbasecharge.js.map +1 -1
- package/dist/esm/models/operations/create.d.ts +6 -14
- package/dist/esm/models/operations/create.d.ts.map +1 -1
- package/dist/esm/models/operations/create.js +10 -2
- package/dist/esm/models/operations/create.js.map +1 -1
- package/dist/esm/models/operations/createauthorizationcode.d.ts +6 -12
- package/dist/esm/models/operations/createauthorizationcode.d.ts.map +1 -1
- package/dist/esm/models/operations/createauthorizationcode.js +9 -2
- package/dist/esm/models/operations/createauthorizationcode.js.map +1 -1
- package/dist/esm/models/operations/exchangeauthorizationcode.d.ts +6 -12
- package/dist/esm/models/operations/exchangeauthorizationcode.d.ts.map +1 -1
- package/dist/esm/models/operations/exchangeauthorizationcode.js +9 -2
- package/dist/esm/models/operations/exchangeauthorizationcode.js.map +1 -1
- package/dist/esm/models/operations/generate.d.ts +37 -569
- package/dist/esm/models/operations/generate.d.ts.map +1 -1
- package/dist/esm/models/operations/generate.js +55 -12
- package/dist/esm/models/operations/generate.js.map +1 -1
- package/dist/esm/models/operations/getmetadata.d.ts +6 -12
- package/dist/esm/models/operations/getmetadata.d.ts.map +1 -1
- package/dist/esm/models/operations/getmetadata.js +9 -2
- package/dist/esm/models/operations/getmetadata.js.map +1 -1
- package/dist/esm/models/operations/getparameters.d.ts +11 -189
- package/dist/esm/models/operations/getparameters.d.ts.map +1 -1
- package/dist/esm/models/operations/getparameters.js +19 -4
- package/dist/esm/models/operations/getparameters.js.map +1 -1
- package/dist/esm/models/operations/list.d.ts +21 -125
- package/dist/esm/models/operations/list.d.ts.map +1 -1
- package/dist/esm/models/operations/list.js +36 -8
- package/dist/esm/models/operations/list.js.map +1 -1
- package/dist/esm/models/operations/previewzdr.d.ts +21 -269
- package/dist/esm/models/operations/previewzdr.d.ts.map +1 -1
- package/dist/esm/models/operations/previewzdr.js +38 -9
- package/dist/esm/models/operations/previewzdr.js.map +1 -1
- package/dist/esm/models/operations/sendresponsesrequest.d.ts +57 -621
- package/dist/esm/models/operations/sendresponsesrequest.d.ts.map +1 -1
- package/dist/esm/models/operations/sendresponsesrequest.js +88 -20
- package/dist/esm/models/operations/sendresponsesrequest.js.map +1 -1
- package/dist/esm/models/operations/update.d.ts +6 -14
- package/dist/esm/models/operations/update.d.ts.map +1 -1
- package/dist/esm/models/operations/update.js +10 -2
- package/dist/esm/models/operations/update.js.map +1 -1
- package/dist/esm/models/responsefunctioncallstatus.d.ts +6 -14
- package/dist/esm/models/responsefunctioncallstatus.d.ts.map +1 -1
- package/dist/esm/models/responsefunctioncallstatus.js +10 -2
- package/dist/esm/models/responsefunctioncallstatus.js.map +1 -1
- package/dist/esm/models/responseimagegenerationcallstatus.d.ts +6 -16
- package/dist/esm/models/responseimagegenerationcallstatus.d.ts.map +1 -1
- package/dist/esm/models/responseimagegenerationcallstatus.js +10 -2
- package/dist/esm/models/responseimagegenerationcallstatus.js.map +1 -1
- package/dist/esm/models/responseincludable.d.ts +6 -18
- package/dist/esm/models/responseincludable.d.ts.map +1 -1
- package/dist/esm/models/responseincludable.js +10 -2
- package/dist/esm/models/responseincludable.js.map +1 -1
- package/dist/esm/models/responseinputimagedetail.d.ts +6 -14
- package/dist/esm/models/responseinputimagedetail.d.ts.map +1 -1
- package/dist/esm/models/responseinputimagedetail.js +10 -2
- package/dist/esm/models/responseinputimagedetail.js.map +1 -1
- package/dist/esm/models/responsereasoningconfig.d.ts +6 -16
- package/dist/esm/models/responsereasoningconfig.d.ts.map +1 -1
- package/dist/esm/models/responsereasoningconfig.js +10 -2
- package/dist/esm/models/responsereasoningconfig.js.map +1 -1
- package/dist/esm/models/responsereasoningsummarymode.d.ts +6 -14
- package/dist/esm/models/responsereasoningsummarymode.d.ts.map +1 -1
- package/dist/esm/models/responsereasoningsummarymode.js +10 -2
- package/dist/esm/models/responsereasoningsummarymode.js.map +1 -1
- package/dist/esm/models/responsesincompletedetails.d.ts +6 -12
- package/dist/esm/models/responsesincompletedetails.d.ts.map +1 -1
- package/dist/esm/models/responsesincompletedetails.js +10 -2
- package/dist/esm/models/responsesincompletedetails.js.map +1 -1
- package/dist/esm/models/responsesnonstreamingresponse.d.ts +21 -61
- package/dist/esm/models/responsesnonstreamingresponse.d.ts.map +1 -1
- package/dist/esm/models/responsesnonstreamingresponse.js +35 -8
- package/dist/esm/models/responsesnonstreamingresponse.js.map +1 -1
- package/dist/esm/models/responsesoutputitemfilesearchcall.d.ts +6 -16
- package/dist/esm/models/responsesoutputitemfilesearchcall.d.ts.map +1 -1
- package/dist/esm/models/responsesoutputitemfilesearchcall.js +9 -2
- package/dist/esm/models/responsesoutputitemfilesearchcall.js.map +1 -1
- package/dist/esm/models/responsesoutputitemreasoning.d.ts +6 -16
- package/dist/esm/models/responsesoutputitemreasoning.d.ts.map +1 -1
- package/dist/esm/models/responsesoutputitemreasoning.js +10 -2
- package/dist/esm/models/responsesoutputitemreasoning.js.map +1 -1
- package/dist/esm/models/responsesstreamchunkunion.d.ts +31 -81
- package/dist/esm/models/responsesstreamchunkunion.d.ts.map +1 -1
- package/dist/esm/models/responsesstreamchunkunion.js +55 -12
- package/dist/esm/models/responsesstreamchunkunion.js.map +1 -1
- package/dist/esm/models/responseswebsearchcalloutput.d.ts +6 -16
- package/dist/esm/models/responseswebsearchcalloutput.d.ts.map +1 -1
- package/dist/esm/models/responseswebsearchcalloutput.js +10 -2
- package/dist/esm/models/responseswebsearchcalloutput.js.map +1 -1
- package/dist/esm/models/responsetextverbosity.d.ts +6 -14
- package/dist/esm/models/responsetextverbosity.d.ts.map +1 -1
- package/dist/esm/models/responsetextverbosity.js +10 -2
- package/dist/esm/models/responsetextverbosity.js.map +1 -1
- package/dist/esm/sdk/oauth.d.ts +27 -0
- package/dist/esm/sdk/oauth.d.ts.map +1 -1
- package/dist/esm/sdk/oauth.js +43 -0
- package/dist/esm/sdk/oauth.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +3 -2
- package/src/funcs/betaResponsesSend.ts +1 -1
- package/src/funcs/chatSend.ts +1 -1
- package/src/funcs/custom/oAuthCreateAuthorizationUrl.test.ts +265 -0
- package/src/funcs/custom/oAuthCreateAuthorizationUrl.ts +66 -0
- package/src/funcs/custom/oAuthCreateSHA256CodeChallenge.test.ts +189 -0
- package/src/funcs/custom/oAuthCreateSHA256CodeChallenge.ts +90 -0
- package/src/funcs/modelsList.ts +1 -1
- package/src/lib/config.ts +3 -3
- package/src/models/chatgenerationparams.ts +59 -20
- package/src/models/chatmessagecontentitemaudio.ts +23 -8
- package/src/models/chatmessagecontentitemimage.ts +16 -6
- package/src/models/chatresponsechoice.ts +23 -8
- package/src/models/chatstreamingchoice.ts +23 -8
- package/src/models/completionfinishreason.ts +23 -8
- package/src/models/endpointslist.ts +77 -25
- package/src/models/errorresponse.ts +23 -8
- package/src/models/modelslist.ts +95 -32
- package/src/models/operations/addcoinbasecharge.ts +17 -6
- package/src/models/operations/create.ts +23 -8
- package/src/models/operations/createauthorizationcode.ts +20 -6
- package/src/models/operations/exchangeauthorizationcode.ts +23 -6
- package/src/models/operations/generate.ts +114 -41
- package/src/models/operations/getmetadata.ts +17 -6
- package/src/models/operations/getparameters.ts +41 -15
- package/src/models/operations/list.ts +77 -25
- package/src/models/operations/previewzdr.ts +70 -25
- package/src/models/operations/sendresponsesrequest.ts +179 -63
- package/src/models/operations/update.ts +23 -8
- package/src/models/responsefunctioncallstatus.ts +23 -8
- package/src/models/responseimagegenerationcallstatus.ts +23 -8
- package/src/models/responseincludable.ts +23 -8
- package/src/models/responseinputimagedetail.ts +23 -8
- package/src/models/responsereasoningconfig.ts +23 -8
- package/src/models/responsereasoningsummarymode.ts +23 -8
- package/src/models/responsesincompletedetails.ts +23 -8
- package/src/models/responsesnonstreamingresponse.ts +78 -25
- package/src/models/responsesoutputitemfilesearchcall.ts +24 -8
- package/src/models/responsesoutputitemreasoning.ts +24 -8
- package/src/models/responsesstreamchunkunion.ts +114 -43
- package/src/models/responseswebsearchcalloutput.ts +24 -8
- package/src/models/responsetextverbosity.ts +23 -8
- package/src/sdk/oauth.ts +60 -0
|
@@ -5,7 +5,12 @@
|
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import { remap as remap$ } from "../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../lib/schemas.js";
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
catchUnrecognizedEnum,
|
|
10
|
+
ClosedEnum,
|
|
11
|
+
OpenEnum,
|
|
12
|
+
Unrecognized,
|
|
13
|
+
} from "../types/enums.js";
|
|
9
14
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
10
15
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
11
16
|
import {
|
|
@@ -333,7 +338,7 @@ export const ItemStatusEnum4 = {
|
|
|
333
338
|
Completed: "completed",
|
|
334
339
|
Searching: "searching",
|
|
335
340
|
} as const;
|
|
336
|
-
export type ItemStatusEnum4 =
|
|
341
|
+
export type ItemStatusEnum4 = OpenEnum<typeof ItemStatusEnum4>;
|
|
337
342
|
|
|
338
343
|
export type ItemWebSearchCall2 = {
|
|
339
344
|
type: ItemTypeWebSearchCall2;
|
|
@@ -354,7 +359,7 @@ export const ItemStatusEnum3 = {
|
|
|
354
359
|
Generating: "generating",
|
|
355
360
|
Failed: "failed",
|
|
356
361
|
} as const;
|
|
357
|
-
export type ItemStatusEnum3 =
|
|
362
|
+
export type ItemStatusEnum3 = OpenEnum<typeof ItemStatusEnum3>;
|
|
358
363
|
|
|
359
364
|
export type ItemImageGenerationCall = {
|
|
360
365
|
type: ItemTypeImageGenerationCall;
|
|
@@ -456,7 +461,7 @@ export const ItemStatusEnum2 = {
|
|
|
456
461
|
InProgress: "in_progress",
|
|
457
462
|
Failed: "failed",
|
|
458
463
|
} as const;
|
|
459
|
-
export type ItemStatusEnum2 =
|
|
464
|
+
export type ItemStatusEnum2 = OpenEnum<typeof ItemStatusEnum2>;
|
|
460
465
|
|
|
461
466
|
export type ItemFileSearchCall = {
|
|
462
467
|
type: ItemTypeFileSearchCall;
|
|
@@ -476,7 +481,7 @@ export const ItemStatusEnum1 = {
|
|
|
476
481
|
InProgress: "in_progress",
|
|
477
482
|
Failed: "failed",
|
|
478
483
|
} as const;
|
|
479
|
-
export type ItemStatusEnum1 =
|
|
484
|
+
export type ItemStatusEnum1 = OpenEnum<typeof ItemStatusEnum1>;
|
|
480
485
|
|
|
481
486
|
export type ItemWebSearchCall1 = {
|
|
482
487
|
type: ItemTypeWebSearchCall1;
|
|
@@ -595,7 +600,7 @@ export const ResponsesStreamChunkType = {
|
|
|
595
600
|
ResponseCompleted: "response.completed",
|
|
596
601
|
ResponseIncomplete: "response.incomplete",
|
|
597
602
|
} as const;
|
|
598
|
-
export type ResponsesStreamChunkType =
|
|
603
|
+
export type ResponsesStreamChunkType = OpenEnum<
|
|
599
604
|
typeof ResponsesStreamChunkType
|
|
600
605
|
>;
|
|
601
606
|
|
|
@@ -603,7 +608,7 @@ export const ResponsesStreamChunkReason = {
|
|
|
603
608
|
MaxOutputTokens: "max_output_tokens",
|
|
604
609
|
ContentFilter: "content_filter",
|
|
605
610
|
} as const;
|
|
606
|
-
export type ResponsesStreamChunkReason =
|
|
611
|
+
export type ResponsesStreamChunkReason = OpenEnum<
|
|
607
612
|
typeof ResponsesStreamChunkReason
|
|
608
613
|
>;
|
|
609
614
|
|
|
@@ -3015,14 +3020,25 @@ export namespace ItemTypeWebSearchCall2$ {
|
|
|
3015
3020
|
}
|
|
3016
3021
|
|
|
3017
3022
|
/** @internal */
|
|
3018
|
-
export const ItemStatusEnum4$inboundSchema: z.
|
|
3019
|
-
|
|
3020
|
-
|
|
3023
|
+
export const ItemStatusEnum4$inboundSchema: z.ZodType<
|
|
3024
|
+
ItemStatusEnum4,
|
|
3025
|
+
z.ZodTypeDef,
|
|
3026
|
+
unknown
|
|
3027
|
+
> = z
|
|
3028
|
+
.union([
|
|
3029
|
+
z.nativeEnum(ItemStatusEnum4),
|
|
3030
|
+
z.string().transform(catchUnrecognizedEnum),
|
|
3031
|
+
]);
|
|
3021
3032
|
|
|
3022
3033
|
/** @internal */
|
|
3023
|
-
export const ItemStatusEnum4$outboundSchema: z.
|
|
3024
|
-
|
|
3025
|
-
|
|
3034
|
+
export const ItemStatusEnum4$outboundSchema: z.ZodType<
|
|
3035
|
+
ItemStatusEnum4,
|
|
3036
|
+
z.ZodTypeDef,
|
|
3037
|
+
ItemStatusEnum4
|
|
3038
|
+
> = z.union([
|
|
3039
|
+
z.nativeEnum(ItemStatusEnum4),
|
|
3040
|
+
z.string().and(z.custom<Unrecognized<string>>()),
|
|
3041
|
+
]);
|
|
3026
3042
|
|
|
3027
3043
|
/**
|
|
3028
3044
|
* @internal
|
|
@@ -3117,14 +3133,25 @@ export namespace ItemTypeImageGenerationCall$ {
|
|
|
3117
3133
|
}
|
|
3118
3134
|
|
|
3119
3135
|
/** @internal */
|
|
3120
|
-
export const ItemStatusEnum3$inboundSchema: z.
|
|
3121
|
-
|
|
3122
|
-
|
|
3136
|
+
export const ItemStatusEnum3$inboundSchema: z.ZodType<
|
|
3137
|
+
ItemStatusEnum3,
|
|
3138
|
+
z.ZodTypeDef,
|
|
3139
|
+
unknown
|
|
3140
|
+
> = z
|
|
3141
|
+
.union([
|
|
3142
|
+
z.nativeEnum(ItemStatusEnum3),
|
|
3143
|
+
z.string().transform(catchUnrecognizedEnum),
|
|
3144
|
+
]);
|
|
3123
3145
|
|
|
3124
3146
|
/** @internal */
|
|
3125
|
-
export const ItemStatusEnum3$outboundSchema: z.
|
|
3126
|
-
|
|
3127
|
-
|
|
3147
|
+
export const ItemStatusEnum3$outboundSchema: z.ZodType<
|
|
3148
|
+
ItemStatusEnum3,
|
|
3149
|
+
z.ZodTypeDef,
|
|
3150
|
+
ItemStatusEnum3
|
|
3151
|
+
> = z.union([
|
|
3152
|
+
z.nativeEnum(ItemStatusEnum3),
|
|
3153
|
+
z.string().and(z.custom<Unrecognized<string>>()),
|
|
3154
|
+
]);
|
|
3128
3155
|
|
|
3129
3156
|
/**
|
|
3130
3157
|
* @internal
|
|
@@ -3837,14 +3864,25 @@ export namespace ItemTypeFileSearchCall$ {
|
|
|
3837
3864
|
}
|
|
3838
3865
|
|
|
3839
3866
|
/** @internal */
|
|
3840
|
-
export const ItemStatusEnum2$inboundSchema: z.
|
|
3841
|
-
|
|
3842
|
-
|
|
3867
|
+
export const ItemStatusEnum2$inboundSchema: z.ZodType<
|
|
3868
|
+
ItemStatusEnum2,
|
|
3869
|
+
z.ZodTypeDef,
|
|
3870
|
+
unknown
|
|
3871
|
+
> = z
|
|
3872
|
+
.union([
|
|
3873
|
+
z.nativeEnum(ItemStatusEnum2),
|
|
3874
|
+
z.string().transform(catchUnrecognizedEnum),
|
|
3875
|
+
]);
|
|
3843
3876
|
|
|
3844
3877
|
/** @internal */
|
|
3845
|
-
export const ItemStatusEnum2$outboundSchema: z.
|
|
3846
|
-
|
|
3847
|
-
|
|
3878
|
+
export const ItemStatusEnum2$outboundSchema: z.ZodType<
|
|
3879
|
+
ItemStatusEnum2,
|
|
3880
|
+
z.ZodTypeDef,
|
|
3881
|
+
ItemStatusEnum2
|
|
3882
|
+
> = z.union([
|
|
3883
|
+
z.nativeEnum(ItemStatusEnum2),
|
|
3884
|
+
z.string().and(z.custom<Unrecognized<string>>()),
|
|
3885
|
+
]);
|
|
3848
3886
|
|
|
3849
3887
|
/**
|
|
3850
3888
|
* @internal
|
|
@@ -3942,14 +3980,25 @@ export namespace ItemTypeWebSearchCall1$ {
|
|
|
3942
3980
|
}
|
|
3943
3981
|
|
|
3944
3982
|
/** @internal */
|
|
3945
|
-
export const ItemStatusEnum1$inboundSchema: z.
|
|
3946
|
-
|
|
3947
|
-
|
|
3983
|
+
export const ItemStatusEnum1$inboundSchema: z.ZodType<
|
|
3984
|
+
ItemStatusEnum1,
|
|
3985
|
+
z.ZodTypeDef,
|
|
3986
|
+
unknown
|
|
3987
|
+
> = z
|
|
3988
|
+
.union([
|
|
3989
|
+
z.nativeEnum(ItemStatusEnum1),
|
|
3990
|
+
z.string().transform(catchUnrecognizedEnum),
|
|
3991
|
+
]);
|
|
3948
3992
|
|
|
3949
3993
|
/** @internal */
|
|
3950
|
-
export const ItemStatusEnum1$outboundSchema: z.
|
|
3951
|
-
|
|
3952
|
-
|
|
3994
|
+
export const ItemStatusEnum1$outboundSchema: z.ZodType<
|
|
3995
|
+
ItemStatusEnum1,
|
|
3996
|
+
z.ZodTypeDef,
|
|
3997
|
+
ItemStatusEnum1
|
|
3998
|
+
> = z.union([
|
|
3999
|
+
z.nativeEnum(ItemStatusEnum1),
|
|
4000
|
+
z.string().and(z.custom<Unrecognized<string>>()),
|
|
4001
|
+
]);
|
|
3953
4002
|
|
|
3954
4003
|
/**
|
|
3955
4004
|
* @internal
|
|
@@ -4818,14 +4867,25 @@ export function responsesStreamChunkResponseCreatedFromJSON(
|
|
|
4818
4867
|
}
|
|
4819
4868
|
|
|
4820
4869
|
/** @internal */
|
|
4821
|
-
export const ResponsesStreamChunkType$inboundSchema: z.
|
|
4822
|
-
|
|
4823
|
-
|
|
4870
|
+
export const ResponsesStreamChunkType$inboundSchema: z.ZodType<
|
|
4871
|
+
ResponsesStreamChunkType,
|
|
4872
|
+
z.ZodTypeDef,
|
|
4873
|
+
unknown
|
|
4874
|
+
> = z
|
|
4875
|
+
.union([
|
|
4876
|
+
z.nativeEnum(ResponsesStreamChunkType),
|
|
4877
|
+
z.string().transform(catchUnrecognizedEnum),
|
|
4878
|
+
]);
|
|
4824
4879
|
|
|
4825
4880
|
/** @internal */
|
|
4826
|
-
export const ResponsesStreamChunkType$outboundSchema: z.
|
|
4827
|
-
|
|
4828
|
-
|
|
4881
|
+
export const ResponsesStreamChunkType$outboundSchema: z.ZodType<
|
|
4882
|
+
ResponsesStreamChunkType,
|
|
4883
|
+
z.ZodTypeDef,
|
|
4884
|
+
ResponsesStreamChunkType
|
|
4885
|
+
> = z.union([
|
|
4886
|
+
z.nativeEnum(ResponsesStreamChunkType),
|
|
4887
|
+
z.string().and(z.custom<Unrecognized<string>>()),
|
|
4888
|
+
]);
|
|
4829
4889
|
|
|
4830
4890
|
/**
|
|
4831
4891
|
* @internal
|
|
@@ -4839,14 +4899,25 @@ export namespace ResponsesStreamChunkType$ {
|
|
|
4839
4899
|
}
|
|
4840
4900
|
|
|
4841
4901
|
/** @internal */
|
|
4842
|
-
export const ResponsesStreamChunkReason$inboundSchema: z.
|
|
4843
|
-
|
|
4844
|
-
|
|
4902
|
+
export const ResponsesStreamChunkReason$inboundSchema: z.ZodType<
|
|
4903
|
+
ResponsesStreamChunkReason,
|
|
4904
|
+
z.ZodTypeDef,
|
|
4905
|
+
unknown
|
|
4906
|
+
> = z
|
|
4907
|
+
.union([
|
|
4908
|
+
z.nativeEnum(ResponsesStreamChunkReason),
|
|
4909
|
+
z.string().transform(catchUnrecognizedEnum),
|
|
4910
|
+
]);
|
|
4845
4911
|
|
|
4846
4912
|
/** @internal */
|
|
4847
|
-
export const ResponsesStreamChunkReason$outboundSchema: z.
|
|
4848
|
-
|
|
4849
|
-
|
|
4913
|
+
export const ResponsesStreamChunkReason$outboundSchema: z.ZodType<
|
|
4914
|
+
ResponsesStreamChunkReason,
|
|
4915
|
+
z.ZodTypeDef,
|
|
4916
|
+
ResponsesStreamChunkReason
|
|
4917
|
+
> = z.union([
|
|
4918
|
+
z.nativeEnum(ResponsesStreamChunkReason),
|
|
4919
|
+
z.string().and(z.custom<Unrecognized<string>>()),
|
|
4920
|
+
]);
|
|
4850
4921
|
|
|
4851
4922
|
/**
|
|
4852
4923
|
* @internal
|
|
@@ -4,7 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import { safeParse } from "../lib/schemas.js";
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
catchUnrecognizedEnum,
|
|
9
|
+
ClosedEnum,
|
|
10
|
+
OpenEnum,
|
|
11
|
+
Unrecognized,
|
|
12
|
+
} from "../types/enums.js";
|
|
8
13
|
import { Result as SafeParseResult } from "../types/fp.js";
|
|
9
14
|
import { SDKValidationError } from "./errors/sdkvalidationerror.js";
|
|
10
15
|
|
|
@@ -21,7 +26,7 @@ export const ResponsesWebSearchCallOutputStatus = {
|
|
|
21
26
|
InProgress: "in_progress",
|
|
22
27
|
Failed: "failed",
|
|
23
28
|
} as const;
|
|
24
|
-
export type ResponsesWebSearchCallOutputStatus =
|
|
29
|
+
export type ResponsesWebSearchCallOutputStatus = OpenEnum<
|
|
25
30
|
typeof ResponsesWebSearchCallOutputStatus
|
|
26
31
|
>;
|
|
27
32
|
|
|
@@ -56,14 +61,25 @@ export namespace ResponsesWebSearchCallOutputType$ {
|
|
|
56
61
|
}
|
|
57
62
|
|
|
58
63
|
/** @internal */
|
|
59
|
-
export const ResponsesWebSearchCallOutputStatus$inboundSchema: z.
|
|
60
|
-
|
|
61
|
-
|
|
64
|
+
export const ResponsesWebSearchCallOutputStatus$inboundSchema: z.ZodType<
|
|
65
|
+
ResponsesWebSearchCallOutputStatus,
|
|
66
|
+
z.ZodTypeDef,
|
|
67
|
+
unknown
|
|
68
|
+
> = z
|
|
69
|
+
.union([
|
|
70
|
+
z.nativeEnum(ResponsesWebSearchCallOutputStatus),
|
|
71
|
+
z.string().transform(catchUnrecognizedEnum),
|
|
72
|
+
]);
|
|
62
73
|
|
|
63
74
|
/** @internal */
|
|
64
|
-
export const ResponsesWebSearchCallOutputStatus$outboundSchema: z.
|
|
65
|
-
|
|
66
|
-
|
|
75
|
+
export const ResponsesWebSearchCallOutputStatus$outboundSchema: z.ZodType<
|
|
76
|
+
ResponsesWebSearchCallOutputStatus,
|
|
77
|
+
z.ZodTypeDef,
|
|
78
|
+
ResponsesWebSearchCallOutputStatus
|
|
79
|
+
> = z.union([
|
|
80
|
+
z.nativeEnum(ResponsesWebSearchCallOutputStatus),
|
|
81
|
+
z.string().and(z.custom<Unrecognized<string>>()),
|
|
82
|
+
]);
|
|
67
83
|
|
|
68
84
|
/**
|
|
69
85
|
* @internal
|
|
@@ -3,24 +3,39 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod";
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
catchUnrecognizedEnum,
|
|
8
|
+
OpenEnum,
|
|
9
|
+
Unrecognized,
|
|
10
|
+
} from "../types/enums.js";
|
|
7
11
|
|
|
8
12
|
export const ResponseTextVerbosity = {
|
|
9
13
|
High: "high",
|
|
10
14
|
Low: "low",
|
|
11
15
|
Medium: "medium",
|
|
12
16
|
} as const;
|
|
13
|
-
export type ResponseTextVerbosity =
|
|
17
|
+
export type ResponseTextVerbosity = OpenEnum<typeof ResponseTextVerbosity>;
|
|
14
18
|
|
|
15
19
|
/** @internal */
|
|
16
|
-
export const ResponseTextVerbosity$inboundSchema: z.
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
export const ResponseTextVerbosity$inboundSchema: z.ZodType<
|
|
21
|
+
ResponseTextVerbosity,
|
|
22
|
+
z.ZodTypeDef,
|
|
23
|
+
unknown
|
|
24
|
+
> = z
|
|
25
|
+
.union([
|
|
26
|
+
z.nativeEnum(ResponseTextVerbosity),
|
|
27
|
+
z.string().transform(catchUnrecognizedEnum),
|
|
28
|
+
]);
|
|
19
29
|
|
|
20
30
|
/** @internal */
|
|
21
|
-
export const ResponseTextVerbosity$outboundSchema: z.
|
|
22
|
-
|
|
23
|
-
|
|
31
|
+
export const ResponseTextVerbosity$outboundSchema: z.ZodType<
|
|
32
|
+
ResponseTextVerbosity,
|
|
33
|
+
z.ZodTypeDef,
|
|
34
|
+
ResponseTextVerbosity
|
|
35
|
+
> = z.union([
|
|
36
|
+
z.nativeEnum(ResponseTextVerbosity),
|
|
37
|
+
z.string().and(z.custom<Unrecognized<string>>()),
|
|
38
|
+
]);
|
|
24
39
|
|
|
25
40
|
/**
|
|
26
41
|
* @internal
|
package/src/sdk/oauth.ts
CHANGED
|
@@ -7,8 +7,68 @@ import { oAuthExchangeAuthorizationCode } from "../funcs/oAuthExchangeAuthorizat
|
|
|
7
7
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
8
8
|
import * as operations from "../models/operations/index.js";
|
|
9
9
|
import { unwrapAsync } from "../types/fp.js";
|
|
10
|
+
// #region imports
|
|
11
|
+
import {
|
|
12
|
+
CreateAuthorizationUrlRequest,
|
|
13
|
+
oAuthCreateAuthorizationUrl,
|
|
14
|
+
} from "../funcs/custom/oAuthCreateAuthorizationUrl.js";
|
|
15
|
+
import {
|
|
16
|
+
CreateSHA256CodeChallengeRequest,
|
|
17
|
+
CreateSHA256CodeChallengeResponse,
|
|
18
|
+
oAuthCreateSHA256CodeChallenge,
|
|
19
|
+
} from "../funcs/custom/oAuthCreateSHA256CodeChallenge.js";
|
|
20
|
+
// #endregion imports
|
|
10
21
|
|
|
11
22
|
export class OAuth extends ClientSDK {
|
|
23
|
+
// #region sdk-class-body
|
|
24
|
+
/**
|
|
25
|
+
* Generate a OAuth2 authorization URL
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* Generates a URL to redirect users to for authorizing your application. The
|
|
29
|
+
* URL includes the provided callback URL and, if applicable, the code
|
|
30
|
+
* challenge parameters for PKCE.
|
|
31
|
+
*
|
|
32
|
+
* @see {@link https://openrouter.ai/docs/use-cases/oauth-pkce}
|
|
33
|
+
*/
|
|
34
|
+
async createAuthorizationUrl(
|
|
35
|
+
request: CreateAuthorizationUrlRequest,
|
|
36
|
+
): Promise<string> {
|
|
37
|
+
const result = oAuthCreateAuthorizationUrl(this, request);
|
|
38
|
+
|
|
39
|
+
if (!result.ok) {
|
|
40
|
+
throw result.error;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return result.value;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Generate a SHA-256 code challenge for PKCE
|
|
48
|
+
*
|
|
49
|
+
* @remarks
|
|
50
|
+
* Generates a SHA-256 code challenge and corresponding code verifier for use
|
|
51
|
+
* in the PKCE extension to OAuth2. If no code verifier is provided, a random
|
|
52
|
+
* one will be generated according to RFC 7636 (32 random bytes, base64url
|
|
53
|
+
* encoded). If a code verifier is provided, it must be 43-128 characters and
|
|
54
|
+
* contain only unreserved characters [A-Za-z0-9-._~].
|
|
55
|
+
*
|
|
56
|
+
* @see {@link https://openrouter.ai/docs/use-cases/oauth-pkce}
|
|
57
|
+
* @see {@link https://datatracker.ietf.org/doc/html/rfc7636}
|
|
58
|
+
*/
|
|
59
|
+
async createSHA256CodeChallenge(
|
|
60
|
+
request: CreateSHA256CodeChallengeRequest = {},
|
|
61
|
+
): Promise<CreateSHA256CodeChallengeResponse> {
|
|
62
|
+
const result = await oAuthCreateSHA256CodeChallenge(request);
|
|
63
|
+
|
|
64
|
+
if (!result.ok) {
|
|
65
|
+
throw result.error;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return result.value;
|
|
69
|
+
}
|
|
70
|
+
// #endregion sdk-class-body
|
|
71
|
+
|
|
12
72
|
/**
|
|
13
73
|
* Exchange authorization code for API key
|
|
14
74
|
*
|