@mistralai/mistralai 2.6.1 → 2.6.3
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/README.md +11 -2
- package/esm/funcs/betaUsersListOrganizations.d.ts +23 -0
- package/esm/funcs/betaUsersListOrganizations.d.ts.map +1 -0
- package/esm/funcs/betaUsersListOrganizations.js +128 -0
- package/esm/funcs/betaUsersListOrganizations.js.map +1 -0
- package/esm/funcs/betaUsersListWorkspaces.d.ts +21 -0
- package/esm/funcs/betaUsersListWorkspaces.d.ts.map +1 -0
- package/esm/funcs/betaUsersListWorkspaces.js +126 -0
- package/esm/funcs/betaUsersListWorkspaces.js.map +1 -0
- package/esm/funcs/realtimeSessionsCreate.d.ts +16 -0
- package/esm/funcs/realtimeSessionsCreate.d.ts.map +1 -0
- package/esm/funcs/realtimeSessionsCreate.js +82 -0
- package/esm/funcs/realtimeSessionsCreate.js.map +1 -0
- package/esm/funcs/workflowsDeploymentsGetDeployment.js +5 -1
- package/esm/funcs/workflowsDeploymentsGetDeployment.js.map +1 -1
- package/esm/lib/config.d.ts +2 -2
- package/esm/lib/config.js +2 -2
- package/esm/models/components/activitytaskcompletedresponse.d.ts +12 -0
- package/esm/models/components/activitytaskcompletedresponse.d.ts.map +1 -1
- package/esm/models/components/activitytaskcompletedresponse.js +6 -0
- package/esm/models/components/activitytaskcompletedresponse.js.map +1 -1
- package/esm/models/components/activitytaskfailedresponse.d.ts +12 -0
- package/esm/models/components/activitytaskfailedresponse.d.ts.map +1 -1
- package/esm/models/components/activitytaskfailedresponse.js +6 -0
- package/esm/models/components/activitytaskfailedresponse.js.map +1 -1
- package/esm/models/components/activitytaskretryingresponse.d.ts +12 -0
- package/esm/models/components/activitytaskretryingresponse.d.ts.map +1 -1
- package/esm/models/components/activitytaskretryingresponse.js +6 -0
- package/esm/models/components/activitytaskretryingresponse.js.map +1 -1
- package/esm/models/components/activitytaskstartedresponse.d.ts +12 -0
- package/esm/models/components/activitytaskstartedresponse.d.ts.map +1 -1
- package/esm/models/components/activitytaskstartedresponse.js +6 -0
- package/esm/models/components/activitytaskstartedresponse.js.map +1 -1
- package/esm/models/components/agentscompletionrequest.d.ts +6 -0
- package/esm/models/components/agentscompletionrequest.d.ts.map +1 -1
- package/esm/models/components/agentscompletionrequest.js +3 -0
- package/esm/models/components/agentscompletionrequest.js.map +1 -1
- package/esm/models/components/agentscompletionstreamrequest.d.ts +6 -0
- package/esm/models/components/agentscompletionstreamrequest.d.ts.map +1 -1
- package/esm/models/components/agentscompletionstreamrequest.js +3 -0
- package/esm/models/components/agentscompletionstreamrequest.js.map +1 -1
- package/esm/models/components/authdirection.d.ts +10 -0
- package/esm/models/components/authdirection.d.ts.map +1 -0
- package/esm/models/components/authdirection.js +13 -0
- package/esm/models/components/authdirection.js.map +1 -0
- package/esm/models/components/authenticationmethodcreateorupdaterequest.d.ts +57 -0
- package/esm/models/components/authenticationmethodcreateorupdaterequest.d.ts.map +1 -0
- package/esm/models/components/authenticationmethodcreateorupdaterequest.js +50 -0
- package/esm/models/components/authenticationmethodcreateorupdaterequest.js.map +1 -0
- package/esm/models/components/chatcompletionrequest.d.ts +6 -0
- package/esm/models/components/chatcompletionrequest.d.ts.map +1 -1
- package/esm/models/components/chatcompletionrequest.js +3 -0
- package/esm/models/components/chatcompletionrequest.js.map +1 -1
- package/esm/models/components/chatcompletionstreamrequest.d.ts +6 -0
- package/esm/models/components/chatcompletionstreamrequest.d.ts.map +1 -1
- package/esm/models/components/chatcompletionstreamrequest.js +3 -0
- package/esm/models/components/chatcompletionstreamrequest.js.map +1 -1
- package/esm/models/components/clientsecret.d.ts +11 -0
- package/esm/models/components/clientsecret.d.ts.map +1 -0
- package/esm/models/components/clientsecret.js +21 -0
- package/esm/models/components/clientsecret.js.map +1 -0
- package/esm/models/components/clientsessionpurpose.d.ts +15 -0
- package/esm/models/components/clientsessionpurpose.d.ts.map +1 -0
- package/esm/models/components/clientsessionpurpose.js +14 -0
- package/esm/models/components/clientsessionpurpose.js.map +1 -0
- package/esm/models/components/connectorauthenticationheader.d.ts +11 -2
- package/esm/models/components/connectorauthenticationheader.d.ts.map +1 -1
- package/esm/models/components/connectorauthenticationheader.js +14 -0
- package/esm/models/components/connectorauthenticationheader.js.map +1 -1
- package/esm/models/components/createconnectorrequest.d.ts +15 -0
- package/esm/models/components/createconnectorrequest.d.ts.map +1 -1
- package/esm/models/components/createconnectorrequest.js +5 -0
- package/esm/models/components/createconnectorrequest.js.map +1 -1
- package/esm/models/components/createingestionpipelineconfigurationrequest.d.ts +3 -0
- package/esm/models/components/createingestionpipelineconfigurationrequest.d.ts.map +1 -1
- package/esm/models/components/createingestionpipelineconfigurationrequest.js +3 -0
- package/esm/models/components/createingestionpipelineconfigurationrequest.js.map +1 -1
- package/esm/models/components/createrealtimesessionrequest.d.ts +17 -0
- package/esm/models/components/createrealtimesessionrequest.d.ts.map +1 -0
- package/esm/models/components/createrealtimesessionrequest.js +14 -0
- package/esm/models/components/createrealtimesessionrequest.js.map +1 -0
- package/esm/models/components/createrealtimesessionresponse.d.ts +18 -0
- package/esm/models/components/createrealtimesessionresponse.d.ts.map +1 -0
- package/esm/models/components/createrealtimesessionresponse.js +25 -0
- package/esm/models/components/createrealtimesessionresponse.js.map +1 -0
- package/esm/models/components/customtaskcanceledresponse.d.ts +12 -0
- package/esm/models/components/customtaskcanceledresponse.d.ts.map +1 -1
- package/esm/models/components/customtaskcanceledresponse.js +6 -0
- package/esm/models/components/customtaskcanceledresponse.js.map +1 -1
- package/esm/models/components/customtaskcompletedresponse.d.ts +12 -0
- package/esm/models/components/customtaskcompletedresponse.d.ts.map +1 -1
- package/esm/models/components/customtaskcompletedresponse.js +6 -0
- package/esm/models/components/customtaskcompletedresponse.js.map +1 -1
- package/esm/models/components/customtaskfailedresponse.d.ts +12 -0
- package/esm/models/components/customtaskfailedresponse.d.ts.map +1 -1
- package/esm/models/components/customtaskfailedresponse.js +6 -0
- package/esm/models/components/customtaskfailedresponse.js.map +1 -1
- package/esm/models/components/customtaskinprogressresponse.d.ts +12 -0
- package/esm/models/components/customtaskinprogressresponse.d.ts.map +1 -1
- package/esm/models/components/customtaskinprogressresponse.js +6 -0
- package/esm/models/components/customtaskinprogressresponse.js.map +1 -1
- package/esm/models/components/customtaskstartedresponse.d.ts +12 -0
- package/esm/models/components/customtaskstartedresponse.d.ts.map +1 -1
- package/esm/models/components/customtaskstartedresponse.js +6 -0
- package/esm/models/components/customtaskstartedresponse.js.map +1 -1
- package/esm/models/components/customtasktimedoutresponse.d.ts +12 -0
- package/esm/models/components/customtasktimedoutresponse.d.ts.map +1 -1
- package/esm/models/components/customtasktimedoutresponse.js +6 -0
- package/esm/models/components/customtasktimedoutresponse.js.map +1 -1
- package/esm/models/components/deploymentdetailresponse.d.ts +2 -0
- package/esm/models/components/deploymentdetailresponse.d.ts.map +1 -1
- package/esm/models/components/deploymentdetailresponse.js.map +1 -1
- package/esm/models/components/deploymentresponse.d.ts +2 -0
- package/esm/models/components/deploymentresponse.d.ts.map +1 -1
- package/esm/models/components/deploymentresponse.js.map +1 -1
- package/esm/models/components/deploymentworkerspecresponse.d.ts +5 -0
- package/esm/models/components/deploymentworkerspecresponse.d.ts.map +1 -1
- package/esm/models/components/deploymentworkerspecresponse.js +2 -0
- package/esm/models/components/deploymentworkerspecresponse.js.map +1 -1
- package/esm/models/components/extendedoauthservermetadata.d.ts +10 -0
- package/esm/models/components/extendedoauthservermetadata.d.ts.map +1 -1
- package/esm/models/components/extendedoauthservermetadata.js +67 -0
- package/esm/models/components/extendedoauthservermetadata.js.map +1 -1
- package/esm/models/components/gitcommitauthor.d.ts +12 -0
- package/esm/models/components/gitcommitauthor.d.ts.map +1 -0
- package/esm/models/components/gitcommitauthor.js +21 -0
- package/esm/models/components/gitcommitauthor.js.map +1 -0
- package/esm/models/components/gitcommitmetadata.d.ts +14 -0
- package/esm/models/components/gitcommitmetadata.d.ts.map +1 -0
- package/esm/models/components/gitcommitmetadata.js +23 -0
- package/esm/models/components/gitcommitmetadata.js.map +1 -0
- package/esm/models/components/globalheadervalue.d.ts +26 -0
- package/esm/models/components/globalheadervalue.d.ts.map +1 -0
- package/esm/models/components/globalheadervalue.js +32 -0
- package/esm/models/components/globalheadervalue.js.map +1 -0
- package/esm/models/components/inboundauthenticationtype.d.ts +9 -0
- package/esm/models/components/inboundauthenticationtype.d.ts.map +1 -0
- package/esm/models/components/inboundauthenticationtype.js +11 -0
- package/esm/models/components/inboundauthenticationtype.js.map +1 -0
- package/esm/models/components/index.d.ts +18 -0
- package/esm/models/components/index.d.ts.map +1 -1
- package/esm/models/components/index.js +18 -0
- package/esm/models/components/index.js.map +1 -1
- package/esm/models/components/ingestionpipelinetargetindexref.d.ts +14 -0
- package/esm/models/components/ingestionpipelinetargetindexref.d.ts.map +1 -0
- package/esm/models/components/ingestionpipelinetargetindexref.js +14 -0
- package/esm/models/components/ingestionpipelinetargetindexref.js.map +1 -0
- package/esm/models/components/listorganizationsresponse.d.ts +14 -0
- package/esm/models/components/listorganizationsresponse.d.ts.map +1 -0
- package/esm/models/components/listorganizationsresponse.js +15 -0
- package/esm/models/components/listorganizationsresponse.js.map +1 -0
- package/esm/models/components/listworkspacesresponse.d.ts +14 -0
- package/esm/models/components/listworkspacesresponse.d.ts.map +1 -0
- package/esm/models/components/listworkspacesresponse.js +15 -0
- package/esm/models/components/listworkspacesresponse.js.map +1 -0
- package/esm/models/components/oauth2metadatasecrets.d.ts +27 -0
- package/esm/models/components/oauth2metadatasecrets.d.ts.map +1 -0
- package/esm/models/components/oauth2metadatasecrets.js +24 -0
- package/esm/models/components/oauth2metadatasecrets.js.map +1 -0
- package/esm/models/components/oauthmetadatasource.d.ts +18 -0
- package/esm/models/components/oauthmetadatasource.d.ts.map +1 -0
- package/esm/models/components/oauthmetadatasource.js +17 -0
- package/esm/models/components/oauthmetadatasource.js.map +1 -0
- package/esm/models/components/observabilityerrorcode.d.ts +1 -0
- package/esm/models/components/observabilityerrorcode.d.ts.map +1 -1
- package/esm/models/components/observabilityerrorcode.js +1 -0
- package/esm/models/components/observabilityerrorcode.js.map +1 -1
- package/esm/models/components/publicauthenticationmethod.d.ts +6 -0
- package/esm/models/components/publicauthenticationmethod.d.ts.map +1 -1
- package/esm/models/components/publicauthenticationmethod.js +8 -0
- package/esm/models/components/publicauthenticationmethod.js.map +1 -1
- package/esm/models/components/requestedservicetier.d.ts +10 -0
- package/esm/models/components/requestedservicetier.d.ts.map +1 -0
- package/esm/models/components/requestedservicetier.js +12 -0
- package/esm/models/components/requestedservicetier.js.map +1 -0
- package/esm/models/components/updateconnectorrequest.d.ts +4 -13
- package/esm/models/components/updateconnectorrequest.d.ts.map +1 -1
- package/esm/models/components/updateconnectorrequest.js +3 -4
- package/esm/models/components/updateconnectorrequest.js.map +1 -1
- package/esm/models/components/usageinfo.d.ts +5 -0
- package/esm/models/components/usageinfo.d.ts.map +1 -1
- package/esm/models/components/usageinfo.js +4 -0
- package/esm/models/components/usageinfo.js.map +1 -1
- package/esm/models/components/userorganization.d.ts +17 -0
- package/esm/models/components/userorganization.d.ts.map +1 -0
- package/esm/models/components/userorganization.js +15 -0
- package/esm/models/components/userorganization.js.map +1 -0
- package/esm/models/components/userworkspace.d.ts +21 -0
- package/esm/models/components/userworkspace.d.ts.map +1 -0
- package/esm/models/components/userworkspace.js +22 -0
- package/esm/models/components/userworkspace.js.map +1 -0
- package/esm/models/components/workflowexecutioncanceledattributes.d.ts +4 -0
- package/esm/models/components/workflowexecutioncanceledattributes.d.ts.map +1 -1
- package/esm/models/components/workflowexecutioncanceledattributes.js +1 -0
- package/esm/models/components/workflowexecutioncanceledattributes.js.map +1 -1
- package/esm/models/components/workflowexecutioncanceledresponse.d.ts +12 -0
- package/esm/models/components/workflowexecutioncanceledresponse.d.ts.map +1 -1
- package/esm/models/components/workflowexecutioncanceledresponse.js +6 -0
- package/esm/models/components/workflowexecutioncanceledresponse.js.map +1 -1
- package/esm/models/components/workflowexecutioncompletedattributesresponse.d.ts +4 -0
- package/esm/models/components/workflowexecutioncompletedattributesresponse.d.ts.map +1 -1
- package/esm/models/components/workflowexecutioncompletedattributesresponse.js +1 -0
- package/esm/models/components/workflowexecutioncompletedattributesresponse.js.map +1 -1
- package/esm/models/components/workflowexecutioncompletedresponse.d.ts +12 -0
- package/esm/models/components/workflowexecutioncompletedresponse.d.ts.map +1 -1
- package/esm/models/components/workflowexecutioncompletedresponse.js +6 -0
- package/esm/models/components/workflowexecutioncompletedresponse.js.map +1 -1
- package/esm/models/components/workflowexecutioncontinuedasnewresponse.d.ts +12 -0
- package/esm/models/components/workflowexecutioncontinuedasnewresponse.d.ts.map +1 -1
- package/esm/models/components/workflowexecutioncontinuedasnewresponse.js +6 -0
- package/esm/models/components/workflowexecutioncontinuedasnewresponse.js.map +1 -1
- package/esm/models/components/workflowexecutionfailedattributes.d.ts +4 -0
- package/esm/models/components/workflowexecutionfailedattributes.d.ts.map +1 -1
- package/esm/models/components/workflowexecutionfailedattributes.js +1 -0
- package/esm/models/components/workflowexecutionfailedattributes.js.map +1 -1
- package/esm/models/components/workflowexecutionfailedresponse.d.ts +12 -0
- package/esm/models/components/workflowexecutionfailedresponse.d.ts.map +1 -1
- package/esm/models/components/workflowexecutionfailedresponse.js +6 -0
- package/esm/models/components/workflowexecutionfailedresponse.js.map +1 -1
- package/esm/models/components/workflowexecutionstartedattributesresponse.d.ts +4 -0
- package/esm/models/components/workflowexecutionstartedattributesresponse.d.ts.map +1 -1
- package/esm/models/components/workflowexecutionstartedattributesresponse.js +1 -0
- package/esm/models/components/workflowexecutionstartedattributesresponse.js.map +1 -1
- package/esm/models/components/workflowexecutionstartedresponse.d.ts +12 -0
- package/esm/models/components/workflowexecutionstartedresponse.d.ts.map +1 -1
- package/esm/models/components/workflowexecutionstartedresponse.js +6 -0
- package/esm/models/components/workflowexecutionstartedresponse.js.map +1 -1
- package/esm/models/components/workflowtaskfailedresponse.d.ts +12 -0
- package/esm/models/components/workflowtaskfailedresponse.d.ts.map +1 -1
- package/esm/models/components/workflowtaskfailedresponse.js +6 -0
- package/esm/models/components/workflowtaskfailedresponse.js.map +1 -1
- package/esm/models/components/workflowtasktimedoutresponse.d.ts +12 -0
- package/esm/models/components/workflowtasktimedoutresponse.d.ts.map +1 -1
- package/esm/models/components/workflowtasktimedoutresponse.js +6 -0
- package/esm/models/components/workflowtasktimedoutresponse.js.map +1 -1
- package/esm/models/operations/createclientsessionv1clientsessionspost.d.ts +9 -0
- package/esm/models/operations/createclientsessionv1clientsessionspost.d.ts.map +1 -0
- package/esm/models/operations/createclientsessionv1clientsessionspost.js +11 -0
- package/esm/models/operations/createclientsessionv1clientsessionspost.js.map +1 -0
- package/esm/models/operations/getdeploymentv1workflowsdeploymentsnameget.d.ts +5 -0
- package/esm/models/operations/getdeploymentv1workflowsdeploymentsnameget.d.ts.map +1 -1
- package/esm/models/operations/getdeploymentv1workflowsdeploymentsnameget.js +6 -0
- package/esm/models/operations/getdeploymentv1workflowsdeploymentsnameget.js.map +1 -1
- package/esm/models/operations/index.d.ts +3 -0
- package/esm/models/operations/index.d.ts.map +1 -1
- package/esm/models/operations/index.js +3 -0
- package/esm/models/operations/index.js.map +1 -1
- package/esm/models/operations/usersapilistorganizations.d.ts +39 -0
- package/esm/models/operations/usersapilistorganizations.d.ts.map +1 -0
- package/esm/models/operations/usersapilistorganizations.js +39 -0
- package/esm/models/operations/usersapilistorganizations.js.map +1 -0
- package/esm/models/operations/usersapilistworkspaces.d.ts +44 -0
- package/esm/models/operations/usersapilistworkspaces.d.ts.map +1 -0
- package/esm/models/operations/usersapilistworkspaces.js +44 -0
- package/esm/models/operations/usersapilistworkspaces.js.map +1 -0
- package/esm/sdk/realtime.d.ts +7 -0
- package/esm/sdk/realtime.d.ts.map +1 -0
- package/esm/sdk/realtime.js +13 -0
- package/esm/sdk/realtime.js.map +1 -0
- package/esm/sdk/sdk.d.ts +3 -0
- package/esm/sdk/sdk.d.ts.map +1 -1
- package/esm/sdk/sdk.js +5 -0
- package/esm/sdk/sdk.js.map +1 -1
- package/esm/sdk/sessions.d.ts +10 -0
- package/esm/sdk/sessions.d.ts.map +1 -0
- package/esm/sdk/sessions.js +16 -0
- package/esm/sdk/sessions.js.map +1 -0
- package/esm/sdk/users.d.ts +23 -0
- package/esm/sdk/users.d.ts.map +1 -1
- package/esm/sdk/users.js +25 -0
- package/esm/sdk/users.js.map +1 -1
- package/examples/src/model_management.ts +59 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/betaUsersListOrganizations.ts +257 -0
- package/src/funcs/betaUsersListWorkspaces.ts +257 -0
- package/src/funcs/realtimeSessionsCreate.ts +170 -0
- package/src/funcs/workflowsDeploymentsGetDeployment.ts +6 -1
- package/src/lib/config.ts +2 -2
- package/src/models/components/activitytaskcompletedresponse.ts +18 -0
- package/src/models/components/activitytaskfailedresponse.ts +18 -0
- package/src/models/components/activitytaskretryingresponse.ts +18 -0
- package/src/models/components/activitytaskstartedresponse.ts +18 -0
- package/src/models/components/agentscompletionrequest.ts +11 -0
- package/src/models/components/agentscompletionstreamrequest.ts +11 -0
- package/src/models/components/authdirection.ts +17 -0
- package/src/models/components/authenticationmethodcreateorupdaterequest.ts +138 -0
- package/src/models/components/chatcompletionrequest.ts +11 -0
- package/src/models/components/chatcompletionstreamrequest.ts +11 -0
- package/src/models/components/clientsecret.ts +36 -0
- package/src/models/components/clientsessionpurpose.ts +23 -0
- package/src/models/components/connectorauthenticationheader.ts +32 -2
- package/src/models/components/createconnectorrequest.ts +19 -0
- package/src/models/components/createingestionpipelineconfigurationrequest.ts +14 -0
- package/src/models/components/createrealtimesessionrequest.ts +39 -0
- package/src/models/components/createrealtimesessionresponse.ts +51 -0
- package/src/models/components/customtaskcanceledresponse.ts +18 -0
- package/src/models/components/customtaskcompletedresponse.ts +18 -0
- package/src/models/components/customtaskfailedresponse.ts +18 -0
- package/src/models/components/customtaskinprogressresponse.ts +18 -0
- package/src/models/components/customtaskstartedresponse.ts +18 -0
- package/src/models/components/customtasktimedoutresponse.ts +18 -0
- package/src/models/components/deploymentdetailresponse.ts +2 -0
- package/src/models/components/deploymentresponse.ts +2 -0
- package/src/models/components/deploymentworkerspecresponse.ts +9 -0
- package/src/models/components/extendedoauthservermetadata.ts +99 -0
- package/src/models/components/gitcommitauthor.ts +40 -0
- package/src/models/components/gitcommitmetadata.ts +46 -0
- package/src/models/components/globalheadervalue.ts +70 -0
- package/src/models/components/inboundauthenticationtype.ts +19 -0
- package/src/models/components/index.ts +18 -0
- package/src/models/components/ingestionpipelinetargetindexref.ts +36 -0
- package/src/models/components/listorganizationsresponse.ts +38 -0
- package/src/models/components/listworkspacesresponse.ts +35 -0
- package/src/models/components/oauth2metadatasecrets.ts +57 -0
- package/src/models/components/oauthmetadatasource.ts +31 -0
- package/src/models/components/observabilityerrorcode.ts +1 -0
- package/src/models/components/publicauthenticationmethod.ts +16 -0
- package/src/models/components/requestedservicetier.ts +18 -0
- package/src/models/components/updateconnectorrequest.ts +17 -15
- package/src/models/components/usageinfo.ts +9 -0
- package/src/models/components/userorganization.ts +39 -0
- package/src/models/components/userworkspace.ts +47 -0
- package/src/models/components/workflowexecutioncanceledattributes.ts +5 -0
- package/src/models/components/workflowexecutioncanceledresponse.ts +18 -0
- package/src/models/components/workflowexecutioncompletedattributesresponse.ts +5 -0
- package/src/models/components/workflowexecutioncompletedresponse.ts +18 -0
- package/src/models/components/workflowexecutioncontinuedasnewresponse.ts +18 -0
- package/src/models/components/workflowexecutionfailedattributes.ts +5 -0
- package/src/models/components/workflowexecutionfailedresponse.ts +18 -0
- package/src/models/components/workflowexecutionstartedattributesresponse.ts +5 -0
- package/src/models/components/workflowexecutionstartedresponse.ts +18 -0
- package/src/models/components/workflowtaskfailedresponse.ts +18 -0
- package/src/models/components/workflowtasktimedoutresponse.ts +18 -0
- package/src/models/operations/createclientsessionv1clientsessionspost.ts +20 -0
- package/src/models/operations/getdeploymentv1workflowsdeploymentsnameget.ts +11 -0
- package/src/models/operations/index.ts +3 -0
- package/src/models/operations/usersapilistorganizations.ts +104 -0
- package/src/models/operations/usersapilistworkspaces.ts +114 -0
- package/src/sdk/realtime.ts +14 -0
- package/src/sdk/sdk.ts +6 -0
- package/src/sdk/sessions.ts +26 -0
- package/src/sdk/users.ts +52 -0
- package/examples/src/async_jobs.ts +0 -51
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: dd2b1c2b32df
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { MistralCore } from "../core.js";
|
|
7
|
+
import { dlv } from "../lib/dlv.js";
|
|
8
|
+
import { encodeFormQuery } from "../lib/encodings.js";
|
|
9
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
10
|
+
import * as M from "../lib/matchers.js";
|
|
11
|
+
import { compactMap } from "../lib/primitives.js";
|
|
12
|
+
import { safeParse } from "../lib/schemas.js";
|
|
13
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
14
|
+
import { resolveSecurity } from "../lib/security.js";
|
|
15
|
+
import { pathToFunc } from "../lib/url.js";
|
|
16
|
+
import {
|
|
17
|
+
ConnectionError,
|
|
18
|
+
InvalidRequestError,
|
|
19
|
+
RequestAbortedError,
|
|
20
|
+
RequestTimeoutError,
|
|
21
|
+
UnexpectedClientError,
|
|
22
|
+
} from "../models/errors/httpclienterrors.js";
|
|
23
|
+
import { MistralError } from "../models/errors/mistralerror.js";
|
|
24
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
25
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
26
|
+
import * as operations from "../models/operations/index.js";
|
|
27
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
28
|
+
import { Result } from "../types/fp.js";
|
|
29
|
+
import {
|
|
30
|
+
createPageIterator,
|
|
31
|
+
haltIterator,
|
|
32
|
+
PageIterator,
|
|
33
|
+
Paginator,
|
|
34
|
+
} from "../types/operations.js";
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* List Organizations
|
|
38
|
+
*
|
|
39
|
+
* @remarks
|
|
40
|
+
* List every organization the authenticated user is a member of.
|
|
41
|
+
*
|
|
42
|
+
* Identity-only: the caller need not have selected an organization, so this
|
|
43
|
+
* reads only the user and never scopes by the active org.
|
|
44
|
+
*/
|
|
45
|
+
export function betaUsersListOrganizations(
|
|
46
|
+
client: MistralCore,
|
|
47
|
+
security: operations.UsersApiListOrganizationsSecurity,
|
|
48
|
+
request?: operations.UsersApiListOrganizationsRequest | undefined,
|
|
49
|
+
options?: RequestOptions,
|
|
50
|
+
): APIPromise<
|
|
51
|
+
PageIterator<
|
|
52
|
+
Result<
|
|
53
|
+
operations.UsersApiListOrganizationsResponse,
|
|
54
|
+
| MistralError
|
|
55
|
+
| ResponseValidationError
|
|
56
|
+
| ConnectionError
|
|
57
|
+
| RequestAbortedError
|
|
58
|
+
| RequestTimeoutError
|
|
59
|
+
| InvalidRequestError
|
|
60
|
+
| UnexpectedClientError
|
|
61
|
+
| SDKValidationError
|
|
62
|
+
>,
|
|
63
|
+
{ offset: number }
|
|
64
|
+
>
|
|
65
|
+
> {
|
|
66
|
+
return new APIPromise($do(
|
|
67
|
+
client,
|
|
68
|
+
security,
|
|
69
|
+
request,
|
|
70
|
+
options,
|
|
71
|
+
));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
async function $do(
|
|
75
|
+
client: MistralCore,
|
|
76
|
+
security: operations.UsersApiListOrganizationsSecurity,
|
|
77
|
+
request?: operations.UsersApiListOrganizationsRequest | undefined,
|
|
78
|
+
options?: RequestOptions,
|
|
79
|
+
): Promise<
|
|
80
|
+
[
|
|
81
|
+
PageIterator<
|
|
82
|
+
Result<
|
|
83
|
+
operations.UsersApiListOrganizationsResponse,
|
|
84
|
+
| MistralError
|
|
85
|
+
| ResponseValidationError
|
|
86
|
+
| ConnectionError
|
|
87
|
+
| RequestAbortedError
|
|
88
|
+
| RequestTimeoutError
|
|
89
|
+
| InvalidRequestError
|
|
90
|
+
| UnexpectedClientError
|
|
91
|
+
| SDKValidationError
|
|
92
|
+
>,
|
|
93
|
+
{ offset: number }
|
|
94
|
+
>,
|
|
95
|
+
APICall,
|
|
96
|
+
]
|
|
97
|
+
> {
|
|
98
|
+
const parsed = safeParse(
|
|
99
|
+
request,
|
|
100
|
+
(value) =>
|
|
101
|
+
operations.UsersApiListOrganizationsRequest$outboundSchema.optional()
|
|
102
|
+
.parse(value),
|
|
103
|
+
"Input validation failed",
|
|
104
|
+
);
|
|
105
|
+
if (!parsed.ok) {
|
|
106
|
+
return [haltIterator(parsed), { status: "invalid" }];
|
|
107
|
+
}
|
|
108
|
+
const payload = parsed.value;
|
|
109
|
+
const body = null;
|
|
110
|
+
|
|
111
|
+
const path = pathToFunc("/v1/users/me/organizations")();
|
|
112
|
+
|
|
113
|
+
const query = encodeFormQuery({
|
|
114
|
+
"limit": payload?.limit,
|
|
115
|
+
"offset": payload?.offset,
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
const headers = new Headers(compactMap({
|
|
119
|
+
Accept: "application/json",
|
|
120
|
+
}));
|
|
121
|
+
|
|
122
|
+
const requestSecurity = resolveSecurity(
|
|
123
|
+
[
|
|
124
|
+
{
|
|
125
|
+
fieldName: "x-api-key",
|
|
126
|
+
type: "apiKey:header",
|
|
127
|
+
value: security?.dashboardUserContextAuth,
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
);
|
|
131
|
+
|
|
132
|
+
const context = {
|
|
133
|
+
options: client._options,
|
|
134
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
135
|
+
operationID: "users_api_list_organizations",
|
|
136
|
+
oAuth2Scopes: null,
|
|
137
|
+
|
|
138
|
+
resolvedSecurity: requestSecurity,
|
|
139
|
+
|
|
140
|
+
securitySource: security,
|
|
141
|
+
retryConfig: options?.retries
|
|
142
|
+
|| client._options.retryConfig
|
|
143
|
+
|| { strategy: "none" },
|
|
144
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const requestRes = client._createRequest(context, {
|
|
148
|
+
security: requestSecurity,
|
|
149
|
+
method: "GET",
|
|
150
|
+
baseURL: options?.serverURL,
|
|
151
|
+
path: path,
|
|
152
|
+
headers: headers,
|
|
153
|
+
query: query,
|
|
154
|
+
body: body,
|
|
155
|
+
userAgent: client._options.userAgent,
|
|
156
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 300000,
|
|
157
|
+
}, options);
|
|
158
|
+
if (!requestRes.ok) {
|
|
159
|
+
return [haltIterator(requestRes), { status: "invalid" }];
|
|
160
|
+
}
|
|
161
|
+
const req = requestRes.value;
|
|
162
|
+
|
|
163
|
+
const doResult = await client._do(req, {
|
|
164
|
+
context,
|
|
165
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
166
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
167
|
+
retryConfig: context.retryConfig,
|
|
168
|
+
retryCodes: context.retryCodes,
|
|
169
|
+
});
|
|
170
|
+
if (!doResult.ok) {
|
|
171
|
+
return [haltIterator(doResult), { status: "request-error", request: req }];
|
|
172
|
+
}
|
|
173
|
+
const response = doResult.value;
|
|
174
|
+
|
|
175
|
+
const responseFields = {
|
|
176
|
+
HttpMeta: { Response: response, Request: req },
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
const [result, raw] = await M.match<
|
|
180
|
+
operations.UsersApiListOrganizationsResponse,
|
|
181
|
+
| MistralError
|
|
182
|
+
| ResponseValidationError
|
|
183
|
+
| ConnectionError
|
|
184
|
+
| RequestAbortedError
|
|
185
|
+
| RequestTimeoutError
|
|
186
|
+
| InvalidRequestError
|
|
187
|
+
| UnexpectedClientError
|
|
188
|
+
| SDKValidationError
|
|
189
|
+
>(
|
|
190
|
+
M.json(200, operations.UsersApiListOrganizationsResponse$inboundSchema, {
|
|
191
|
+
key: "Result",
|
|
192
|
+
}),
|
|
193
|
+
M.fail("4XX"),
|
|
194
|
+
M.fail("5XX"),
|
|
195
|
+
)(response, req, { extraFields: responseFields });
|
|
196
|
+
if (!result.ok) {
|
|
197
|
+
return [haltIterator(result), {
|
|
198
|
+
status: "complete",
|
|
199
|
+
request: req,
|
|
200
|
+
response,
|
|
201
|
+
}];
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
const nextFunc = (
|
|
205
|
+
responseData: unknown,
|
|
206
|
+
): {
|
|
207
|
+
next: Paginator<
|
|
208
|
+
Result<
|
|
209
|
+
operations.UsersApiListOrganizationsResponse,
|
|
210
|
+
| MistralError
|
|
211
|
+
| ResponseValidationError
|
|
212
|
+
| ConnectionError
|
|
213
|
+
| RequestAbortedError
|
|
214
|
+
| RequestTimeoutError
|
|
215
|
+
| InvalidRequestError
|
|
216
|
+
| UnexpectedClientError
|
|
217
|
+
| SDKValidationError
|
|
218
|
+
>
|
|
219
|
+
>;
|
|
220
|
+
"~next"?: { offset: number };
|
|
221
|
+
} => {
|
|
222
|
+
const offset = request?.offset ?? 0;
|
|
223
|
+
|
|
224
|
+
if (!responseData) {
|
|
225
|
+
return { next: () => null };
|
|
226
|
+
}
|
|
227
|
+
const results = dlv(responseData, "organizations");
|
|
228
|
+
if (!Array.isArray(results) || !results.length) {
|
|
229
|
+
return { next: () => null };
|
|
230
|
+
}
|
|
231
|
+
const limit = request?.limit ?? 100;
|
|
232
|
+
if (results.length < limit) {
|
|
233
|
+
return { next: () => null };
|
|
234
|
+
}
|
|
235
|
+
const nextOffset = offset + results.length;
|
|
236
|
+
|
|
237
|
+
const nextVal = () =>
|
|
238
|
+
betaUsersListOrganizations(
|
|
239
|
+
client,
|
|
240
|
+
security,
|
|
241
|
+
{
|
|
242
|
+
...request!,
|
|
243
|
+
offset: nextOffset,
|
|
244
|
+
},
|
|
245
|
+
options,
|
|
246
|
+
);
|
|
247
|
+
|
|
248
|
+
return { next: nextVal, "~next": { offset: nextOffset } };
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
const page = { ...result, ...nextFunc(raw) };
|
|
252
|
+
return [{ ...page, ...createPageIterator(page, (v) => !v.ok) }, {
|
|
253
|
+
status: "complete",
|
|
254
|
+
request: req,
|
|
255
|
+
response,
|
|
256
|
+
}];
|
|
257
|
+
}
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 8709b463047a
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { MistralCore } from "../core.js";
|
|
7
|
+
import { dlv } from "../lib/dlv.js";
|
|
8
|
+
import { encodeFormQuery } from "../lib/encodings.js";
|
|
9
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
10
|
+
import * as M from "../lib/matchers.js";
|
|
11
|
+
import { compactMap } from "../lib/primitives.js";
|
|
12
|
+
import { safeParse } from "../lib/schemas.js";
|
|
13
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
14
|
+
import { resolveSecurity } from "../lib/security.js";
|
|
15
|
+
import { pathToFunc } from "../lib/url.js";
|
|
16
|
+
import {
|
|
17
|
+
ConnectionError,
|
|
18
|
+
InvalidRequestError,
|
|
19
|
+
RequestAbortedError,
|
|
20
|
+
RequestTimeoutError,
|
|
21
|
+
UnexpectedClientError,
|
|
22
|
+
} from "../models/errors/httpclienterrors.js";
|
|
23
|
+
import { MistralError } from "../models/errors/mistralerror.js";
|
|
24
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
25
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
26
|
+
import * as operations from "../models/operations/index.js";
|
|
27
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
28
|
+
import { Result } from "../types/fp.js";
|
|
29
|
+
import {
|
|
30
|
+
createPageIterator,
|
|
31
|
+
haltIterator,
|
|
32
|
+
PageIterator,
|
|
33
|
+
Paginator,
|
|
34
|
+
} from "../types/operations.js";
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* List Workspaces
|
|
38
|
+
*
|
|
39
|
+
* @remarks
|
|
40
|
+
* List every workspace the authenticated user is a member of, across all
|
|
41
|
+
* their organizations, each tagged with the organization it belongs to.
|
|
42
|
+
*/
|
|
43
|
+
export function betaUsersListWorkspaces(
|
|
44
|
+
client: MistralCore,
|
|
45
|
+
security: operations.UsersApiListWorkspacesSecurity,
|
|
46
|
+
request?: operations.UsersApiListWorkspacesRequest | undefined,
|
|
47
|
+
options?: RequestOptions,
|
|
48
|
+
): APIPromise<
|
|
49
|
+
PageIterator<
|
|
50
|
+
Result<
|
|
51
|
+
operations.UsersApiListWorkspacesResponse,
|
|
52
|
+
| MistralError
|
|
53
|
+
| ResponseValidationError
|
|
54
|
+
| ConnectionError
|
|
55
|
+
| RequestAbortedError
|
|
56
|
+
| RequestTimeoutError
|
|
57
|
+
| InvalidRequestError
|
|
58
|
+
| UnexpectedClientError
|
|
59
|
+
| SDKValidationError
|
|
60
|
+
>,
|
|
61
|
+
{ offset: number }
|
|
62
|
+
>
|
|
63
|
+
> {
|
|
64
|
+
return new APIPromise($do(
|
|
65
|
+
client,
|
|
66
|
+
security,
|
|
67
|
+
request,
|
|
68
|
+
options,
|
|
69
|
+
));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
async function $do(
|
|
73
|
+
client: MistralCore,
|
|
74
|
+
security: operations.UsersApiListWorkspacesSecurity,
|
|
75
|
+
request?: operations.UsersApiListWorkspacesRequest | undefined,
|
|
76
|
+
options?: RequestOptions,
|
|
77
|
+
): Promise<
|
|
78
|
+
[
|
|
79
|
+
PageIterator<
|
|
80
|
+
Result<
|
|
81
|
+
operations.UsersApiListWorkspacesResponse,
|
|
82
|
+
| MistralError
|
|
83
|
+
| ResponseValidationError
|
|
84
|
+
| ConnectionError
|
|
85
|
+
| RequestAbortedError
|
|
86
|
+
| RequestTimeoutError
|
|
87
|
+
| InvalidRequestError
|
|
88
|
+
| UnexpectedClientError
|
|
89
|
+
| SDKValidationError
|
|
90
|
+
>,
|
|
91
|
+
{ offset: number }
|
|
92
|
+
>,
|
|
93
|
+
APICall,
|
|
94
|
+
]
|
|
95
|
+
> {
|
|
96
|
+
const parsed = safeParse(
|
|
97
|
+
request,
|
|
98
|
+
(value) =>
|
|
99
|
+
operations.UsersApiListWorkspacesRequest$outboundSchema.optional().parse(
|
|
100
|
+
value,
|
|
101
|
+
),
|
|
102
|
+
"Input validation failed",
|
|
103
|
+
);
|
|
104
|
+
if (!parsed.ok) {
|
|
105
|
+
return [haltIterator(parsed), { status: "invalid" }];
|
|
106
|
+
}
|
|
107
|
+
const payload = parsed.value;
|
|
108
|
+
const body = null;
|
|
109
|
+
|
|
110
|
+
const path = pathToFunc("/v1/users/me/workspaces")();
|
|
111
|
+
|
|
112
|
+
const query = encodeFormQuery({
|
|
113
|
+
"limit": payload?.limit,
|
|
114
|
+
"offset": payload?.offset,
|
|
115
|
+
"organization_id": payload?.organization_id,
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
const headers = new Headers(compactMap({
|
|
119
|
+
Accept: "application/json",
|
|
120
|
+
}));
|
|
121
|
+
|
|
122
|
+
const requestSecurity = resolveSecurity(
|
|
123
|
+
[
|
|
124
|
+
{
|
|
125
|
+
fieldName: "x-api-key",
|
|
126
|
+
type: "apiKey:header",
|
|
127
|
+
value: security?.dashboardUserContextAuth,
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
);
|
|
131
|
+
|
|
132
|
+
const context = {
|
|
133
|
+
options: client._options,
|
|
134
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
135
|
+
operationID: "users_api_list_workspaces",
|
|
136
|
+
oAuth2Scopes: null,
|
|
137
|
+
|
|
138
|
+
resolvedSecurity: requestSecurity,
|
|
139
|
+
|
|
140
|
+
securitySource: security,
|
|
141
|
+
retryConfig: options?.retries
|
|
142
|
+
|| client._options.retryConfig
|
|
143
|
+
|| { strategy: "none" },
|
|
144
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const requestRes = client._createRequest(context, {
|
|
148
|
+
security: requestSecurity,
|
|
149
|
+
method: "GET",
|
|
150
|
+
baseURL: options?.serverURL,
|
|
151
|
+
path: path,
|
|
152
|
+
headers: headers,
|
|
153
|
+
query: query,
|
|
154
|
+
body: body,
|
|
155
|
+
userAgent: client._options.userAgent,
|
|
156
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 300000,
|
|
157
|
+
}, options);
|
|
158
|
+
if (!requestRes.ok) {
|
|
159
|
+
return [haltIterator(requestRes), { status: "invalid" }];
|
|
160
|
+
}
|
|
161
|
+
const req = requestRes.value;
|
|
162
|
+
|
|
163
|
+
const doResult = await client._do(req, {
|
|
164
|
+
context,
|
|
165
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
166
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
167
|
+
retryConfig: context.retryConfig,
|
|
168
|
+
retryCodes: context.retryCodes,
|
|
169
|
+
});
|
|
170
|
+
if (!doResult.ok) {
|
|
171
|
+
return [haltIterator(doResult), { status: "request-error", request: req }];
|
|
172
|
+
}
|
|
173
|
+
const response = doResult.value;
|
|
174
|
+
|
|
175
|
+
const responseFields = {
|
|
176
|
+
HttpMeta: { Response: response, Request: req },
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
const [result, raw] = await M.match<
|
|
180
|
+
operations.UsersApiListWorkspacesResponse,
|
|
181
|
+
| MistralError
|
|
182
|
+
| ResponseValidationError
|
|
183
|
+
| ConnectionError
|
|
184
|
+
| RequestAbortedError
|
|
185
|
+
| RequestTimeoutError
|
|
186
|
+
| InvalidRequestError
|
|
187
|
+
| UnexpectedClientError
|
|
188
|
+
| SDKValidationError
|
|
189
|
+
>(
|
|
190
|
+
M.json(200, operations.UsersApiListWorkspacesResponse$inboundSchema, {
|
|
191
|
+
key: "Result",
|
|
192
|
+
}),
|
|
193
|
+
M.fail("4XX"),
|
|
194
|
+
M.fail("5XX"),
|
|
195
|
+
)(response, req, { extraFields: responseFields });
|
|
196
|
+
if (!result.ok) {
|
|
197
|
+
return [haltIterator(result), {
|
|
198
|
+
status: "complete",
|
|
199
|
+
request: req,
|
|
200
|
+
response,
|
|
201
|
+
}];
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
const nextFunc = (
|
|
205
|
+
responseData: unknown,
|
|
206
|
+
): {
|
|
207
|
+
next: Paginator<
|
|
208
|
+
Result<
|
|
209
|
+
operations.UsersApiListWorkspacesResponse,
|
|
210
|
+
| MistralError
|
|
211
|
+
| ResponseValidationError
|
|
212
|
+
| ConnectionError
|
|
213
|
+
| RequestAbortedError
|
|
214
|
+
| RequestTimeoutError
|
|
215
|
+
| InvalidRequestError
|
|
216
|
+
| UnexpectedClientError
|
|
217
|
+
| SDKValidationError
|
|
218
|
+
>
|
|
219
|
+
>;
|
|
220
|
+
"~next"?: { offset: number };
|
|
221
|
+
} => {
|
|
222
|
+
const offset = request?.offset ?? 0;
|
|
223
|
+
|
|
224
|
+
if (!responseData) {
|
|
225
|
+
return { next: () => null };
|
|
226
|
+
}
|
|
227
|
+
const results = dlv(responseData, "workspaces");
|
|
228
|
+
if (!Array.isArray(results) || !results.length) {
|
|
229
|
+
return { next: () => null };
|
|
230
|
+
}
|
|
231
|
+
const limit = request?.limit ?? 100;
|
|
232
|
+
if (results.length < limit) {
|
|
233
|
+
return { next: () => null };
|
|
234
|
+
}
|
|
235
|
+
const nextOffset = offset + results.length;
|
|
236
|
+
|
|
237
|
+
const nextVal = () =>
|
|
238
|
+
betaUsersListWorkspaces(
|
|
239
|
+
client,
|
|
240
|
+
security,
|
|
241
|
+
{
|
|
242
|
+
...request!,
|
|
243
|
+
offset: nextOffset,
|
|
244
|
+
},
|
|
245
|
+
options,
|
|
246
|
+
);
|
|
247
|
+
|
|
248
|
+
return { next: nextVal, "~next": { offset: nextOffset } };
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
const page = { ...result, ...nextFunc(raw) };
|
|
252
|
+
return [{ ...page, ...createPageIterator(page, (v) => !v.ok) }, {
|
|
253
|
+
status: "complete",
|
|
254
|
+
request: req,
|
|
255
|
+
response,
|
|
256
|
+
}];
|
|
257
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
* @generated-id: 7d77adefc594
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { MistralCore } from "../core.js";
|
|
7
|
+
import { encodeJSON } from "../lib/encodings.js";
|
|
8
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
9
|
+
import * as M from "../lib/matchers.js";
|
|
10
|
+
import { compactMap } from "../lib/primitives.js";
|
|
11
|
+
import { safeParse } from "../lib/schemas.js";
|
|
12
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
13
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
14
|
+
import { pathToFunc } from "../lib/url.js";
|
|
15
|
+
import * as components from "../models/components/index.js";
|
|
16
|
+
import {
|
|
17
|
+
ConnectionError,
|
|
18
|
+
InvalidRequestError,
|
|
19
|
+
RequestAbortedError,
|
|
20
|
+
RequestTimeoutError,
|
|
21
|
+
UnexpectedClientError,
|
|
22
|
+
} from "../models/errors/httpclienterrors.js";
|
|
23
|
+
import * as errors from "../models/errors/index.js";
|
|
24
|
+
import { MistralError } from "../models/errors/mistralerror.js";
|
|
25
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
26
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
27
|
+
import * as operations from "../models/operations/index.js";
|
|
28
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
29
|
+
import { Result } from "../types/fp.js";
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Create Client Session
|
|
33
|
+
*/
|
|
34
|
+
export function realtimeSessionsCreate(
|
|
35
|
+
client: MistralCore,
|
|
36
|
+
request: operations.Body,
|
|
37
|
+
options?: RequestOptions,
|
|
38
|
+
): APIPromise<
|
|
39
|
+
Result<
|
|
40
|
+
components.CreateRealtimeSessionResponse,
|
|
41
|
+
| errors.HTTPValidationError
|
|
42
|
+
| MistralError
|
|
43
|
+
| ResponseValidationError
|
|
44
|
+
| ConnectionError
|
|
45
|
+
| RequestAbortedError
|
|
46
|
+
| RequestTimeoutError
|
|
47
|
+
| InvalidRequestError
|
|
48
|
+
| UnexpectedClientError
|
|
49
|
+
| SDKValidationError
|
|
50
|
+
>
|
|
51
|
+
> {
|
|
52
|
+
return new APIPromise($do(
|
|
53
|
+
client,
|
|
54
|
+
request,
|
|
55
|
+
options,
|
|
56
|
+
));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async function $do(
|
|
60
|
+
client: MistralCore,
|
|
61
|
+
request: operations.Body,
|
|
62
|
+
options?: RequestOptions,
|
|
63
|
+
): Promise<
|
|
64
|
+
[
|
|
65
|
+
Result<
|
|
66
|
+
components.CreateRealtimeSessionResponse,
|
|
67
|
+
| errors.HTTPValidationError
|
|
68
|
+
| MistralError
|
|
69
|
+
| ResponseValidationError
|
|
70
|
+
| ConnectionError
|
|
71
|
+
| RequestAbortedError
|
|
72
|
+
| RequestTimeoutError
|
|
73
|
+
| InvalidRequestError
|
|
74
|
+
| UnexpectedClientError
|
|
75
|
+
| SDKValidationError
|
|
76
|
+
>,
|
|
77
|
+
APICall,
|
|
78
|
+
]
|
|
79
|
+
> {
|
|
80
|
+
const parsed = safeParse(
|
|
81
|
+
request,
|
|
82
|
+
(value) => operations.Body$outboundSchema.parse(value),
|
|
83
|
+
"Input validation failed",
|
|
84
|
+
);
|
|
85
|
+
if (!parsed.ok) {
|
|
86
|
+
return [parsed, { status: "invalid" }];
|
|
87
|
+
}
|
|
88
|
+
const payload = parsed.value;
|
|
89
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
90
|
+
|
|
91
|
+
const path = pathToFunc("/v1/client/sessions")();
|
|
92
|
+
|
|
93
|
+
const headers = new Headers(compactMap({
|
|
94
|
+
"Content-Type": "application/json",
|
|
95
|
+
Accept: "application/json",
|
|
96
|
+
}));
|
|
97
|
+
|
|
98
|
+
const secConfig = await extractSecurity(client._options.apiKey);
|
|
99
|
+
const securityInput = secConfig == null ? {} : { apiKey: secConfig };
|
|
100
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
101
|
+
|
|
102
|
+
const context = {
|
|
103
|
+
options: client._options,
|
|
104
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
105
|
+
operationID: "create_client_session_v1_client_sessions_post",
|
|
106
|
+
oAuth2Scopes: null,
|
|
107
|
+
|
|
108
|
+
resolvedSecurity: requestSecurity,
|
|
109
|
+
|
|
110
|
+
securitySource: client._options.apiKey,
|
|
111
|
+
retryConfig: options?.retries
|
|
112
|
+
|| client._options.retryConfig
|
|
113
|
+
|| { strategy: "none" },
|
|
114
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const requestRes = client._createRequest(context, {
|
|
118
|
+
security: requestSecurity,
|
|
119
|
+
method: "POST",
|
|
120
|
+
baseURL: options?.serverURL,
|
|
121
|
+
path: path,
|
|
122
|
+
headers: headers,
|
|
123
|
+
body: body,
|
|
124
|
+
userAgent: client._options.userAgent,
|
|
125
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 300000,
|
|
126
|
+
}, options);
|
|
127
|
+
if (!requestRes.ok) {
|
|
128
|
+
return [requestRes, { status: "invalid" }];
|
|
129
|
+
}
|
|
130
|
+
const req = requestRes.value;
|
|
131
|
+
|
|
132
|
+
const doResult = await client._do(req, {
|
|
133
|
+
context,
|
|
134
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
135
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
136
|
+
retryConfig: context.retryConfig,
|
|
137
|
+
retryCodes: context.retryCodes,
|
|
138
|
+
});
|
|
139
|
+
if (!doResult.ok) {
|
|
140
|
+
return [doResult, { status: "request-error", request: req }];
|
|
141
|
+
}
|
|
142
|
+
const response = doResult.value;
|
|
143
|
+
|
|
144
|
+
const responseFields = {
|
|
145
|
+
HttpMeta: { Response: response, Request: req },
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
const [result] = await M.match<
|
|
149
|
+
components.CreateRealtimeSessionResponse,
|
|
150
|
+
| errors.HTTPValidationError
|
|
151
|
+
| MistralError
|
|
152
|
+
| ResponseValidationError
|
|
153
|
+
| ConnectionError
|
|
154
|
+
| RequestAbortedError
|
|
155
|
+
| RequestTimeoutError
|
|
156
|
+
| InvalidRequestError
|
|
157
|
+
| UnexpectedClientError
|
|
158
|
+
| SDKValidationError
|
|
159
|
+
>(
|
|
160
|
+
M.json(201, components.CreateRealtimeSessionResponse$inboundSchema),
|
|
161
|
+
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
162
|
+
M.fail("4XX"),
|
|
163
|
+
M.fail("5XX"),
|
|
164
|
+
)(response, req, { extraFields: responseFields });
|
|
165
|
+
if (!result.ok) {
|
|
166
|
+
return [result, { status: "complete", request: req, response }];
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return [result, { status: "complete", request: req, response }];
|
|
170
|
+
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import { MistralCore } from "../core.js";
|
|
7
|
-
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
8
8
|
import { matchStatusCode } from "../lib/http.js";
|
|
9
9
|
import * as M from "../lib/matchers.js";
|
|
10
10
|
import { compactMap } from "../lib/primitives.js";
|
|
@@ -100,6 +100,10 @@ async function $do(
|
|
|
100
100
|
};
|
|
101
101
|
const path = pathToFunc("/v1/workflows/deployments/{name}")(pathParams);
|
|
102
102
|
|
|
103
|
+
const query = encodeFormQuery({
|
|
104
|
+
"workflow_name": payload.workflow_name,
|
|
105
|
+
});
|
|
106
|
+
|
|
103
107
|
const headers = new Headers(compactMap({
|
|
104
108
|
Accept: "application/json",
|
|
105
109
|
}));
|
|
@@ -129,6 +133,7 @@ async function $do(
|
|
|
129
133
|
baseURL: options?.serverURL,
|
|
130
134
|
path: path,
|
|
131
135
|
headers: headers,
|
|
136
|
+
query: query,
|
|
132
137
|
body: body,
|
|
133
138
|
userAgent: client._options.userAgent,
|
|
134
139
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || 300000,
|