Skip to content

Commit 3f4eb01

Browse files
feat(auth): add auto_login credential flow
1 parent c546f46 commit 3f4eb01

File tree

13 files changed

+295
-269
lines changed

13 files changed

+295
-269
lines changed

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 90
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-20fac779e9e13dc9421e467be31dbf274c39072ba0c01528ba451b48698d43c1.yml
3-
openapi_spec_hash: c3fc5784297ccc8f729326b62000d1f0
4-
config_hash: e47e015528251ee83e30367dbbb51044
1+
configured_endpoints: 89
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-8d66dbedea5b240936b338809f272568ca84a452fc13dbda835479f2ec068b41.yml
3+
openapi_spec_hash: 7c499bfce2e996f1fff5e7791cea390e
4+
config_hash: fcc2db3ed48ab4e8d1b588d31d394a23

api.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -251,23 +251,20 @@ Methods:
251251

252252
Types:
253253

254-
- <code><a href="./src/resources/agents/auth/auth.ts">AgentAuthDiscoverResponse</a></code>
255254
- <code><a href="./src/resources/agents/auth/auth.ts">AgentAuthInvocationResponse</a></code>
256255
- <code><a href="./src/resources/agents/auth/auth.ts">AgentAuthSubmitResponse</a></code>
257256
- <code><a href="./src/resources/agents/auth/auth.ts">AuthAgent</a></code>
258257
- <code><a href="./src/resources/agents/auth/auth.ts">AuthAgentCreateRequest</a></code>
259258
- <code><a href="./src/resources/agents/auth/auth.ts">AuthAgentInvocationCreateRequest</a></code>
260259
- <code><a href="./src/resources/agents/auth/auth.ts">AuthAgentInvocationCreateResponse</a></code>
261260
- <code><a href="./src/resources/agents/auth/auth.ts">DiscoveredField</a></code>
262-
- <code><a href="./src/resources/agents/auth/auth.ts">ReauthResponse</a></code>
263261

264262
Methods:
265263

266264
- <code title="post /agents/auth">client.agents.auth.<a href="./src/resources/agents/auth/auth.ts">create</a>({ ...params }) -> AuthAgent</code>
267265
- <code title="get /agents/auth/{id}">client.agents.auth.<a href="./src/resources/agents/auth/auth.ts">retrieve</a>(id) -> AuthAgent</code>
268266
- <code title="get /agents/auth">client.agents.auth.<a href="./src/resources/agents/auth/auth.ts">list</a>({ ...params }) -> AuthAgentsOffsetPagination</code>
269267
- <code title="delete /agents/auth/{id}">client.agents.auth.<a href="./src/resources/agents/auth/auth.ts">delete</a>(id) -> void</code>
270-
- <code title="post /agents/auth/{id}/reauth">client.agents.auth.<a href="./src/resources/agents/auth/auth.ts">reauth</a>(id) -> ReauthResponse</code>
271268

272269
### Invocations
273270

@@ -279,7 +276,6 @@ Methods:
279276

280277
- <code title="post /agents/auth/invocations">client.agents.auth.invocations.<a href="./src/resources/agents/auth/invocations.ts">create</a>({ ...params }) -> AuthAgentInvocationCreateResponse</code>
281278
- <code title="get /agents/auth/invocations/{invocation_id}">client.agents.auth.invocations.<a href="./src/resources/agents/auth/invocations.ts">retrieve</a>(invocationID) -> AgentAuthInvocationResponse</code>
282-
- <code title="post /agents/auth/invocations/{invocation_id}/discover">client.agents.auth.invocations.<a href="./src/resources/agents/auth/invocations.ts">discover</a>(invocationID, { ...params }) -> AgentAuthDiscoverResponse</code>
283279
- <code title="post /agents/auth/invocations/{invocation_id}/exchange">client.agents.auth.invocations.<a href="./src/resources/agents/auth/invocations.ts">exchange</a>(invocationID, { ...params }) -> InvocationExchangeResponse</code>
284280
- <code title="post /agents/auth/invocations/{invocation_id}/submit">client.agents.auth.invocations.<a href="./src/resources/agents/auth/invocations.ts">submit</a>(invocationID, { ...params }) -> AgentAuthSubmitResponse</code>
285281

@@ -290,11 +286,13 @@ Types:
290286
- <code><a href="./src/resources/credentials.ts">CreateCredentialRequest</a></code>
291287
- <code><a href="./src/resources/credentials.ts">Credential</a></code>
292288
- <code><a href="./src/resources/credentials.ts">UpdateCredentialRequest</a></code>
289+
- <code><a href="./src/resources/credentials.ts">CredentialTotpCodeResponse</a></code>
293290

294291
Methods:
295292

296293
- <code title="post /credentials">client.credentials.<a href="./src/resources/credentials.ts">create</a>({ ...params }) -> Credential</code>
297-
- <code title="get /credentials/{id}">client.credentials.<a href="./src/resources/credentials.ts">retrieve</a>(id) -> Credential</code>
298-
- <code title="patch /credentials/{id}">client.credentials.<a href="./src/resources/credentials.ts">update</a>(id, { ...params }) -> Credential</code>
294+
- <code title="get /credentials/{id_or_name}">client.credentials.<a href="./src/resources/credentials.ts">retrieve</a>(idOrName) -> Credential</code>
295+
- <code title="patch /credentials/{id_or_name}">client.credentials.<a href="./src/resources/credentials.ts">update</a>(idOrName, { ...params }) -> Credential</code>
299296
- <code title="get /credentials">client.credentials.<a href="./src/resources/credentials.ts">list</a>({ ...params }) -> CredentialsOffsetPagination</code>
300-
- <code title="delete /credentials/{id}">client.credentials.<a href="./src/resources/credentials.ts">delete</a>(id) -> void</code>
297+
- <code title="delete /credentials/{id_or_name}">client.credentials.<a href="./src/resources/credentials.ts">delete</a>(idOrName) -> void</code>
298+
- <code title="get /credentials/{id_or_name}/totp-code">client.credentials.<a href="./src/resources/credentials.ts">totpCode</a>(idOrName) -> CredentialTotpCodeResponse</code>

src/client.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import {
3535
Credential,
3636
CredentialCreateParams,
3737
CredentialListParams,
38+
CredentialTotpCodeResponse,
3839
CredentialUpdateParams,
3940
Credentials,
4041
CredentialsOffsetPagination,
@@ -982,6 +983,7 @@ export declare namespace Kernel {
982983
type CreateCredentialRequest as CreateCredentialRequest,
983984
type Credential as Credential,
984985
type UpdateCredentialRequest as UpdateCredentialRequest,
986+
type CredentialTotpCodeResponse as CredentialTotpCodeResponse,
985987
type CredentialsOffsetPagination as CredentialsOffsetPagination,
986988
type CredentialCreateParams as CredentialCreateParams,
987989
type CredentialUpdateParams as CredentialUpdateParams,

src/resources/agents/agents.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import { APIResource } from '../../core/resource';
44
import * as AuthAPI from './auth/auth';
55
import {
6-
AgentAuthDiscoverResponse,
76
AgentAuthInvocationResponse,
87
AgentAuthSubmitResponse,
98
Auth,
@@ -15,7 +14,6 @@ import {
1514
AuthCreateParams,
1615
AuthListParams,
1716
DiscoveredField,
18-
ReauthResponse,
1917
} from './auth/auth';
2018

2119
export class Agents extends APIResource {
@@ -27,15 +25,13 @@ Agents.Auth = Auth;
2725
export declare namespace Agents {
2826
export {
2927
Auth as Auth,
30-
type AgentAuthDiscoverResponse as AgentAuthDiscoverResponse,
3128
type AgentAuthInvocationResponse as AgentAuthInvocationResponse,
3229
type AgentAuthSubmitResponse as AgentAuthSubmitResponse,
3330
type AuthAgent as AuthAgent,
3431
type AuthAgentCreateRequest as AuthAgentCreateRequest,
3532
type AuthAgentInvocationCreateRequest as AuthAgentInvocationCreateRequest,
3633
type AuthAgentInvocationCreateResponse as AuthAgentInvocationCreateResponse,
3734
type DiscoveredField as DiscoveredField,
38-
type ReauthResponse as ReauthResponse,
3935
type AuthAgentsOffsetPagination as AuthAgentsOffsetPagination,
4036
type AuthCreateParams as AuthCreateParams,
4137
type AuthListParams as AuthListParams,

0 commit comments

Comments
 (0)