@onkernel/sdk 0.23.0 → 0.25.0
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/CHANGELOG.md +25 -0
- package/LICENSE +1 -1
- package/README.md +7 -2
- package/client.d.mts +7 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +7 -4
- package/client.d.ts.map +1 -1
- package/client.js +3 -0
- package/client.js.map +1 -1
- package/client.mjs +3 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/agents/agents.d.mts +2 -2
- package/resources/agents/agents.d.mts.map +1 -1
- package/resources/agents/agents.d.ts +2 -2
- package/resources/agents/agents.d.ts.map +1 -1
- package/resources/agents/agents.js.map +1 -1
- package/resources/agents/agents.mjs.map +1 -1
- package/resources/agents/auth/auth.d.mts +146 -70
- package/resources/agents/auth/auth.d.mts.map +1 -1
- package/resources/agents/auth/auth.d.ts +146 -70
- package/resources/agents/auth/auth.d.ts.map +1 -1
- package/resources/agents/auth/auth.js +21 -2
- package/resources/agents/auth/auth.js.map +1 -1
- package/resources/agents/auth/auth.mjs +21 -2
- package/resources/agents/auth/auth.mjs.map +1 -1
- package/resources/agents/auth/index.d.mts +2 -2
- package/resources/agents/auth/index.d.mts.map +1 -1
- package/resources/agents/auth/index.d.ts +2 -2
- package/resources/agents/auth/index.d.ts.map +1 -1
- package/resources/agents/auth/index.js.map +1 -1
- package/resources/agents/auth/index.mjs.map +1 -1
- package/resources/agents/auth/invocations.d.mts +26 -31
- package/resources/agents/auth/invocations.d.mts.map +1 -1
- package/resources/agents/auth/invocations.d.ts +26 -31
- package/resources/agents/auth/invocations.d.ts.map +1 -1
- package/resources/agents/auth/invocations.js +5 -20
- package/resources/agents/auth/invocations.js.map +1 -1
- package/resources/agents/auth/invocations.mjs +5 -20
- package/resources/agents/auth/invocations.mjs.map +1 -1
- package/resources/agents/index.d.mts +1 -1
- package/resources/agents/index.d.mts.map +1 -1
- package/resources/agents/index.d.ts +1 -1
- package/resources/agents/index.d.ts.map +1 -1
- package/resources/agents/index.js.map +1 -1
- package/resources/agents/index.mjs.map +1 -1
- package/resources/browser-pools.d.mts +63 -98
- package/resources/browser-pools.d.mts.map +1 -1
- package/resources/browser-pools.d.ts +63 -98
- package/resources/browser-pools.d.ts.map +1 -1
- package/resources/credentials.d.mts +254 -0
- package/resources/credentials.d.mts.map +1 -0
- package/resources/credentials.d.ts +254 -0
- package/resources/credentials.d.ts.map +1 -0
- package/resources/credentials.js +101 -0
- package/resources/credentials.js.map +1 -0
- package/resources/credentials.mjs +97 -0
- package/resources/credentials.mjs.map +1 -0
- package/resources/index.d.mts +3 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/proxies.d.mts +137 -1
- package/resources/proxies.d.mts.map +1 -1
- package/resources/proxies.d.ts +137 -1
- package/resources/proxies.d.ts.map +1 -1
- package/resources/proxies.js +6 -0
- package/resources/proxies.js.map +1 -1
- package/resources/proxies.mjs +6 -0
- package/resources/proxies.mjs.map +1 -1
- package/src/client.ts +27 -8
- package/src/resources/agents/agents.ts +0 -2
- package/src/resources/agents/auth/auth.ts +170 -73
- package/src/resources/agents/auth/index.ts +0 -2
- package/src/resources/agents/auth/invocations.ts +25 -36
- package/src/resources/agents/index.ts +0 -1
- package/src/resources/browser-pools.ts +72 -115
- package/src/resources/credentials.ts +314 -0
- package/src/resources/index.ts +12 -4
- package/src/resources/proxies.ts +228 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-pools.d.ts","sourceRoot":"","sources":["../src/resources/browser-pools.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,M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AAI,0BAA0B,EAC7D,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;CACH"}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
|
+
import { OffsetPagination, type OffsetPaginationParams, PagePromise } from "../core/pagination.mjs";
|
|
4
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
5
|
+
export declare class Credentials extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Create a new credential for storing login information.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const credential = await client.credentials.create({
|
|
12
|
+
* domain: 'netflix.com',
|
|
13
|
+
* name: 'my-netflix-login',
|
|
14
|
+
* values: {
|
|
15
|
+
* username: 'user@example.com',
|
|
16
|
+
* password: 'mysecretpassword',
|
|
17
|
+
* },
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
create(body: CredentialCreateParams, options?: RequestOptions): APIPromise<Credential>;
|
|
22
|
+
/**
|
|
23
|
+
* Retrieve a credential by its ID or name. Credential values are not returned.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const credential = await client.credentials.retrieve(
|
|
28
|
+
* 'id_or_name',
|
|
29
|
+
* );
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
retrieve(idOrName: string, options?: RequestOptions): APIPromise<Credential>;
|
|
33
|
+
/**
|
|
34
|
+
* Update a credential's name or values. When values are provided, they are merged
|
|
35
|
+
* with existing values (new keys are added, existing keys are overwritten).
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const credential = await client.credentials.update(
|
|
40
|
+
* 'id_or_name',
|
|
41
|
+
* );
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
update(idOrName: string, body: CredentialUpdateParams, options?: RequestOptions): APIPromise<Credential>;
|
|
45
|
+
/**
|
|
46
|
+
* List credentials owned by the caller's organization. Credential values are not
|
|
47
|
+
* returned.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* // Automatically fetches more pages as needed.
|
|
52
|
+
* for await (const credential of client.credentials.list()) {
|
|
53
|
+
* // ...
|
|
54
|
+
* }
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
list(query?: CredentialListParams | null | undefined, options?: RequestOptions): PagePromise<CredentialsOffsetPagination, Credential>;
|
|
58
|
+
/**
|
|
59
|
+
* Delete a credential by its ID or name.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* await client.credentials.delete('id_or_name');
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
delete(idOrName: string, options?: RequestOptions): APIPromise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* Returns the current 6-digit TOTP code for a credential with a configured
|
|
69
|
+
* totp_secret. Use this to complete 2FA setup on sites or when you need a fresh
|
|
70
|
+
* code.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* const response = await client.credentials.totpCode(
|
|
75
|
+
* 'id_or_name',
|
|
76
|
+
* );
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
totpCode(idOrName: string, options?: RequestOptions): APIPromise<CredentialTotpCodeResponse>;
|
|
80
|
+
}
|
|
81
|
+
export type CredentialsOffsetPagination = OffsetPagination<Credential>;
|
|
82
|
+
/**
|
|
83
|
+
* Request to create a new credential
|
|
84
|
+
*/
|
|
85
|
+
export interface CreateCredentialRequest {
|
|
86
|
+
/**
|
|
87
|
+
* Target domain this credential is for
|
|
88
|
+
*/
|
|
89
|
+
domain: string;
|
|
90
|
+
/**
|
|
91
|
+
* Unique name for the credential within the organization
|
|
92
|
+
*/
|
|
93
|
+
name: string;
|
|
94
|
+
/**
|
|
95
|
+
* Field name to value mapping (e.g., username, password)
|
|
96
|
+
*/
|
|
97
|
+
values: {
|
|
98
|
+
[key: string]: string;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* If set, indicates this credential should be used with the specified SSO provider
|
|
102
|
+
* (e.g., google, github, microsoft). When the target site has a matching SSO
|
|
103
|
+
* button, it will be clicked first before filling credential values on the
|
|
104
|
+
* identity provider's login page.
|
|
105
|
+
*/
|
|
106
|
+
sso_provider?: string;
|
|
107
|
+
/**
|
|
108
|
+
* Base32-encoded TOTP secret for generating one-time passwords. Used for automatic
|
|
109
|
+
* 2FA during login.
|
|
110
|
+
*/
|
|
111
|
+
totp_secret?: string;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* A stored credential for automatic re-authentication
|
|
115
|
+
*/
|
|
116
|
+
export interface Credential {
|
|
117
|
+
/**
|
|
118
|
+
* Unique identifier for the credential
|
|
119
|
+
*/
|
|
120
|
+
id: string;
|
|
121
|
+
/**
|
|
122
|
+
* When the credential was created
|
|
123
|
+
*/
|
|
124
|
+
created_at: string;
|
|
125
|
+
/**
|
|
126
|
+
* Target domain this credential is for
|
|
127
|
+
*/
|
|
128
|
+
domain: string;
|
|
129
|
+
/**
|
|
130
|
+
* Unique name for the credential within the organization
|
|
131
|
+
*/
|
|
132
|
+
name: string;
|
|
133
|
+
/**
|
|
134
|
+
* When the credential was last updated
|
|
135
|
+
*/
|
|
136
|
+
updated_at: string;
|
|
137
|
+
/**
|
|
138
|
+
* Whether this credential has a TOTP secret configured for automatic 2FA
|
|
139
|
+
*/
|
|
140
|
+
has_totp_secret?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* If set, indicates this credential should be used with the specified SSO provider
|
|
143
|
+
* (e.g., google, github, microsoft). When the target site has a matching SSO
|
|
144
|
+
* button, it will be clicked first before filling credential values on the
|
|
145
|
+
* identity provider's login page.
|
|
146
|
+
*/
|
|
147
|
+
sso_provider?: string | null;
|
|
148
|
+
/**
|
|
149
|
+
* Current 6-digit TOTP code. Only included in create/update responses when
|
|
150
|
+
* totp_secret was just set.
|
|
151
|
+
*/
|
|
152
|
+
totp_code?: string;
|
|
153
|
+
/**
|
|
154
|
+
* When the totp_code expires. Only included when totp_code is present.
|
|
155
|
+
*/
|
|
156
|
+
totp_code_expires_at?: string;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Request to update an existing credential
|
|
160
|
+
*/
|
|
161
|
+
export interface UpdateCredentialRequest {
|
|
162
|
+
/**
|
|
163
|
+
* New name for the credential
|
|
164
|
+
*/
|
|
165
|
+
name?: string;
|
|
166
|
+
/**
|
|
167
|
+
* If set, indicates this credential should be used with the specified SSO
|
|
168
|
+
* provider. Set to empty string or null to remove.
|
|
169
|
+
*/
|
|
170
|
+
sso_provider?: string | null;
|
|
171
|
+
/**
|
|
172
|
+
* Base32-encoded TOTP secret for generating one-time passwords. Spaces and
|
|
173
|
+
* formatting are automatically normalized. Set to empty string to remove.
|
|
174
|
+
*/
|
|
175
|
+
totp_secret?: string;
|
|
176
|
+
/**
|
|
177
|
+
* Field name to value mapping. Values are merged with existing values (new keys
|
|
178
|
+
* added, existing keys overwritten).
|
|
179
|
+
*/
|
|
180
|
+
values?: {
|
|
181
|
+
[key: string]: string;
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
export interface CredentialTotpCodeResponse {
|
|
185
|
+
/**
|
|
186
|
+
* Current 6-digit TOTP code
|
|
187
|
+
*/
|
|
188
|
+
code: string;
|
|
189
|
+
/**
|
|
190
|
+
* When this code expires (ISO 8601 timestamp)
|
|
191
|
+
*/
|
|
192
|
+
expires_at: string;
|
|
193
|
+
}
|
|
194
|
+
export interface CredentialCreateParams {
|
|
195
|
+
/**
|
|
196
|
+
* Target domain this credential is for
|
|
197
|
+
*/
|
|
198
|
+
domain: string;
|
|
199
|
+
/**
|
|
200
|
+
* Unique name for the credential within the organization
|
|
201
|
+
*/
|
|
202
|
+
name: string;
|
|
203
|
+
/**
|
|
204
|
+
* Field name to value mapping (e.g., username, password)
|
|
205
|
+
*/
|
|
206
|
+
values: {
|
|
207
|
+
[key: string]: string;
|
|
208
|
+
};
|
|
209
|
+
/**
|
|
210
|
+
* If set, indicates this credential should be used with the specified SSO provider
|
|
211
|
+
* (e.g., google, github, microsoft). When the target site has a matching SSO
|
|
212
|
+
* button, it will be clicked first before filling credential values on the
|
|
213
|
+
* identity provider's login page.
|
|
214
|
+
*/
|
|
215
|
+
sso_provider?: string;
|
|
216
|
+
/**
|
|
217
|
+
* Base32-encoded TOTP secret for generating one-time passwords. Used for automatic
|
|
218
|
+
* 2FA during login.
|
|
219
|
+
*/
|
|
220
|
+
totp_secret?: string;
|
|
221
|
+
}
|
|
222
|
+
export interface CredentialUpdateParams {
|
|
223
|
+
/**
|
|
224
|
+
* New name for the credential
|
|
225
|
+
*/
|
|
226
|
+
name?: string;
|
|
227
|
+
/**
|
|
228
|
+
* If set, indicates this credential should be used with the specified SSO
|
|
229
|
+
* provider. Set to empty string or null to remove.
|
|
230
|
+
*/
|
|
231
|
+
sso_provider?: string | null;
|
|
232
|
+
/**
|
|
233
|
+
* Base32-encoded TOTP secret for generating one-time passwords. Spaces and
|
|
234
|
+
* formatting are automatically normalized. Set to empty string to remove.
|
|
235
|
+
*/
|
|
236
|
+
totp_secret?: string;
|
|
237
|
+
/**
|
|
238
|
+
* Field name to value mapping. Values are merged with existing values (new keys
|
|
239
|
+
* added, existing keys overwritten).
|
|
240
|
+
*/
|
|
241
|
+
values?: {
|
|
242
|
+
[key: string]: string;
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
export interface CredentialListParams extends OffsetPaginationParams {
|
|
246
|
+
/**
|
|
247
|
+
* Filter by domain
|
|
248
|
+
*/
|
|
249
|
+
domain?: string;
|
|
250
|
+
}
|
|
251
|
+
export declare namespace Credentials {
|
|
252
|
+
export { type CreateCredentialRequest as CreateCredentialRequest, type Credential as Credential, type UpdateCredentialRequest as UpdateCredentialRequest, type CredentialTotpCodeResponse as CredentialTotpCodeResponse, type CredentialsOffsetPagination as CredentialsOffsetPagination, type CredentialCreateParams as CredentialCreateParams, type CredentialUpdateParams as CredentialUpdateParams, type CredentialListParams as CredentialListParams, };
|
|
253
|
+
}
|
|
254
|
+
//# sourceMappingURL=credentials.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials.d.mts","sourceRoot":"","sources":["../src/resources/credentials.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,WAAW,EAAE;OAE9D,EAAE,cAAc,EAAE;AAGzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC;IAItF;;;;;;;;;OASG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC;IAI5E;;;;;;;;;;OAUG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC;IAIxG;;;;;;;;;;;OAWG;IACH,IAAI,CACF,KAAK,GAAE,oBAAoB,GAAG,IAAI,GAAG,SAAc,EACnD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,2BAA2B,EAAE,UAAU,CAAC;IAIvD;;;;;;;OAOG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cA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D,CAAC;CACH"}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.js";
|
|
3
|
+
import { OffsetPagination, type OffsetPaginationParams, PagePromise } from "../core/pagination.js";
|
|
4
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
5
|
+
export declare class Credentials extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Create a new credential for storing login information.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const credential = await client.credentials.create({
|
|
12
|
+
* domain: 'netflix.com',
|
|
13
|
+
* name: 'my-netflix-login',
|
|
14
|
+
* values: {
|
|
15
|
+
* username: 'user@example.com',
|
|
16
|
+
* password: 'mysecretpassword',
|
|
17
|
+
* },
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
create(body: CredentialCreateParams, options?: RequestOptions): APIPromise<Credential>;
|
|
22
|
+
/**
|
|
23
|
+
* Retrieve a credential by its ID or name. Credential values are not returned.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* const credential = await client.credentials.retrieve(
|
|
28
|
+
* 'id_or_name',
|
|
29
|
+
* );
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
retrieve(idOrName: string, options?: RequestOptions): APIPromise<Credential>;
|
|
33
|
+
/**
|
|
34
|
+
* Update a credential's name or values. When values are provided, they are merged
|
|
35
|
+
* with existing values (new keys are added, existing keys are overwritten).
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const credential = await client.credentials.update(
|
|
40
|
+
* 'id_or_name',
|
|
41
|
+
* );
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
update(idOrName: string, body: CredentialUpdateParams, options?: RequestOptions): APIPromise<Credential>;
|
|
45
|
+
/**
|
|
46
|
+
* List credentials owned by the caller's organization. Credential values are not
|
|
47
|
+
* returned.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* // Automatically fetches more pages as needed.
|
|
52
|
+
* for await (const credential of client.credentials.list()) {
|
|
53
|
+
* // ...
|
|
54
|
+
* }
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
list(query?: CredentialListParams | null | undefined, options?: RequestOptions): PagePromise<CredentialsOffsetPagination, Credential>;
|
|
58
|
+
/**
|
|
59
|
+
* Delete a credential by its ID or name.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* await client.credentials.delete('id_or_name');
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
delete(idOrName: string, options?: RequestOptions): APIPromise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* Returns the current 6-digit TOTP code for a credential with a configured
|
|
69
|
+
* totp_secret. Use this to complete 2FA setup on sites or when you need a fresh
|
|
70
|
+
* code.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* const response = await client.credentials.totpCode(
|
|
75
|
+
* 'id_or_name',
|
|
76
|
+
* );
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
totpCode(idOrName: string, options?: RequestOptions): APIPromise<CredentialTotpCodeResponse>;
|
|
80
|
+
}
|
|
81
|
+
export type CredentialsOffsetPagination = OffsetPagination<Credential>;
|
|
82
|
+
/**
|
|
83
|
+
* Request to create a new credential
|
|
84
|
+
*/
|
|
85
|
+
export interface CreateCredentialRequest {
|
|
86
|
+
/**
|
|
87
|
+
* Target domain this credential is for
|
|
88
|
+
*/
|
|
89
|
+
domain: string;
|
|
90
|
+
/**
|
|
91
|
+
* Unique name for the credential within the organization
|
|
92
|
+
*/
|
|
93
|
+
name: string;
|
|
94
|
+
/**
|
|
95
|
+
* Field name to value mapping (e.g., username, password)
|
|
96
|
+
*/
|
|
97
|
+
values: {
|
|
98
|
+
[key: string]: string;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* If set, indicates this credential should be used with the specified SSO provider
|
|
102
|
+
* (e.g., google, github, microsoft). When the target site has a matching SSO
|
|
103
|
+
* button, it will be clicked first before filling credential values on the
|
|
104
|
+
* identity provider's login page.
|
|
105
|
+
*/
|
|
106
|
+
sso_provider?: string;
|
|
107
|
+
/**
|
|
108
|
+
* Base32-encoded TOTP secret for generating one-time passwords. Used for automatic
|
|
109
|
+
* 2FA during login.
|
|
110
|
+
*/
|
|
111
|
+
totp_secret?: string;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* A stored credential for automatic re-authentication
|
|
115
|
+
*/
|
|
116
|
+
export interface Credential {
|
|
117
|
+
/**
|
|
118
|
+
* Unique identifier for the credential
|
|
119
|
+
*/
|
|
120
|
+
id: string;
|
|
121
|
+
/**
|
|
122
|
+
* When the credential was created
|
|
123
|
+
*/
|
|
124
|
+
created_at: string;
|
|
125
|
+
/**
|
|
126
|
+
* Target domain this credential is for
|
|
127
|
+
*/
|
|
128
|
+
domain: string;
|
|
129
|
+
/**
|
|
130
|
+
* Unique name for the credential within the organization
|
|
131
|
+
*/
|
|
132
|
+
name: string;
|
|
133
|
+
/**
|
|
134
|
+
* When the credential was last updated
|
|
135
|
+
*/
|
|
136
|
+
updated_at: string;
|
|
137
|
+
/**
|
|
138
|
+
* Whether this credential has a TOTP secret configured for automatic 2FA
|
|
139
|
+
*/
|
|
140
|
+
has_totp_secret?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* If set, indicates this credential should be used with the specified SSO provider
|
|
143
|
+
* (e.g., google, github, microsoft). When the target site has a matching SSO
|
|
144
|
+
* button, it will be clicked first before filling credential values on the
|
|
145
|
+
* identity provider's login page.
|
|
146
|
+
*/
|
|
147
|
+
sso_provider?: string | null;
|
|
148
|
+
/**
|
|
149
|
+
* Current 6-digit TOTP code. Only included in create/update responses when
|
|
150
|
+
* totp_secret was just set.
|
|
151
|
+
*/
|
|
152
|
+
totp_code?: string;
|
|
153
|
+
/**
|
|
154
|
+
* When the totp_code expires. Only included when totp_code is present.
|
|
155
|
+
*/
|
|
156
|
+
totp_code_expires_at?: string;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Request to update an existing credential
|
|
160
|
+
*/
|
|
161
|
+
export interface UpdateCredentialRequest {
|
|
162
|
+
/**
|
|
163
|
+
* New name for the credential
|
|
164
|
+
*/
|
|
165
|
+
name?: string;
|
|
166
|
+
/**
|
|
167
|
+
* If set, indicates this credential should be used with the specified SSO
|
|
168
|
+
* provider. Set to empty string or null to remove.
|
|
169
|
+
*/
|
|
170
|
+
sso_provider?: string | null;
|
|
171
|
+
/**
|
|
172
|
+
* Base32-encoded TOTP secret for generating one-time passwords. Spaces and
|
|
173
|
+
* formatting are automatically normalized. Set to empty string to remove.
|
|
174
|
+
*/
|
|
175
|
+
totp_secret?: string;
|
|
176
|
+
/**
|
|
177
|
+
* Field name to value mapping. Values are merged with existing values (new keys
|
|
178
|
+
* added, existing keys overwritten).
|
|
179
|
+
*/
|
|
180
|
+
values?: {
|
|
181
|
+
[key: string]: string;
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
export interface CredentialTotpCodeResponse {
|
|
185
|
+
/**
|
|
186
|
+
* Current 6-digit TOTP code
|
|
187
|
+
*/
|
|
188
|
+
code: string;
|
|
189
|
+
/**
|
|
190
|
+
* When this code expires (ISO 8601 timestamp)
|
|
191
|
+
*/
|
|
192
|
+
expires_at: string;
|
|
193
|
+
}
|
|
194
|
+
export interface CredentialCreateParams {
|
|
195
|
+
/**
|
|
196
|
+
* Target domain this credential is for
|
|
197
|
+
*/
|
|
198
|
+
domain: string;
|
|
199
|
+
/**
|
|
200
|
+
* Unique name for the credential within the organization
|
|
201
|
+
*/
|
|
202
|
+
name: string;
|
|
203
|
+
/**
|
|
204
|
+
* Field name to value mapping (e.g., username, password)
|
|
205
|
+
*/
|
|
206
|
+
values: {
|
|
207
|
+
[key: string]: string;
|
|
208
|
+
};
|
|
209
|
+
/**
|
|
210
|
+
* If set, indicates this credential should be used with the specified SSO provider
|
|
211
|
+
* (e.g., google, github, microsoft). When the target site has a matching SSO
|
|
212
|
+
* button, it will be clicked first before filling credential values on the
|
|
213
|
+
* identity provider's login page.
|
|
214
|
+
*/
|
|
215
|
+
sso_provider?: string;
|
|
216
|
+
/**
|
|
217
|
+
* Base32-encoded TOTP secret for generating one-time passwords. Used for automatic
|
|
218
|
+
* 2FA during login.
|
|
219
|
+
*/
|
|
220
|
+
totp_secret?: string;
|
|
221
|
+
}
|
|
222
|
+
export interface CredentialUpdateParams {
|
|
223
|
+
/**
|
|
224
|
+
* New name for the credential
|
|
225
|
+
*/
|
|
226
|
+
name?: string;
|
|
227
|
+
/**
|
|
228
|
+
* If set, indicates this credential should be used with the specified SSO
|
|
229
|
+
* provider. Set to empty string or null to remove.
|
|
230
|
+
*/
|
|
231
|
+
sso_provider?: string | null;
|
|
232
|
+
/**
|
|
233
|
+
* Base32-encoded TOTP secret for generating one-time passwords. Spaces and
|
|
234
|
+
* formatting are automatically normalized. Set to empty string to remove.
|
|
235
|
+
*/
|
|
236
|
+
totp_secret?: string;
|
|
237
|
+
/**
|
|
238
|
+
* Field name to value mapping. Values are merged with existing values (new keys
|
|
239
|
+
* added, existing keys overwritten).
|
|
240
|
+
*/
|
|
241
|
+
values?: {
|
|
242
|
+
[key: string]: string;
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
export interface CredentialListParams extends OffsetPaginationParams {
|
|
246
|
+
/**
|
|
247
|
+
* Filter by domain
|
|
248
|
+
*/
|
|
249
|
+
domain?: string;
|
|
250
|
+
}
|
|
251
|
+
export declare namespace Credentials {
|
|
252
|
+
export { type CreateCredentialRequest as CreateCredentialRequest, type Credential as Credential, type UpdateCredentialRequest as UpdateCredentialRequest, type CredentialTotpCodeResponse as CredentialTotpCodeResponse, type CredentialsOffsetPagination as CredentialsOffsetPagination, type CredentialCreateParams as CredentialCreateParams, type CredentialUpdateParams as CredentialUpdateParams, type CredentialListParams as CredentialListParams, };
|
|
253
|
+
}
|
|
254
|
+
//# sourceMappingURL=credentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/resources/credentials.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,WAAW,EAAE;OAE9D,EAAE,cAAc,EAAE;AAGzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC;IAItF;;;;;;;;;OASG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC;IAI5E;;;;;;;;;;OAUG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC;IAIxG;;;;;;;;;;;OAWG;IACH,IAAI,CACF,KAAK,GAAE,oBAAoB,GAAG,IAAI,GAAG,SAAc,EACnD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,2BAA2B,EAAE,UAAU,CAAC;IAIvD;;;;;;;OAOG;IACH,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAOpE;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,0BAA0B,CAAC;CAG7F;AAED,MAAM,MAAM,2BAA2B,GAAG,gBAAg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pB;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,MAAM,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAElC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,MAAM,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CACpC;AAED,MAAM,WAAW,oBAAqB,SAAQ,sBAAsB;IAClE;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Credentials = void 0;
|
|
5
|
+
const resource_1 = require("../core/resource.js");
|
|
6
|
+
const pagination_1 = require("../core/pagination.js");
|
|
7
|
+
const headers_1 = require("../internal/headers.js");
|
|
8
|
+
const path_1 = require("../internal/utils/path.js");
|
|
9
|
+
class Credentials extends resource_1.APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Create a new credential for storing login information.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const credential = await client.credentials.create({
|
|
16
|
+
* domain: 'netflix.com',
|
|
17
|
+
* name: 'my-netflix-login',
|
|
18
|
+
* values: {
|
|
19
|
+
* username: 'user@example.com',
|
|
20
|
+
* password: 'mysecretpassword',
|
|
21
|
+
* },
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
create(body, options) {
|
|
26
|
+
return this._client.post('/credentials', { body, ...options });
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Retrieve a credential by its ID or name. Credential values are not returned.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const credential = await client.credentials.retrieve(
|
|
34
|
+
* 'id_or_name',
|
|
35
|
+
* );
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
retrieve(idOrName, options) {
|
|
39
|
+
return this._client.get((0, path_1.path) `/credentials/${idOrName}`, options);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Update a credential's name or values. When values are provided, they are merged
|
|
43
|
+
* with existing values (new keys are added, existing keys are overwritten).
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const credential = await client.credentials.update(
|
|
48
|
+
* 'id_or_name',
|
|
49
|
+
* );
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
update(idOrName, body, options) {
|
|
53
|
+
return this._client.patch((0, path_1.path) `/credentials/${idOrName}`, { body, ...options });
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* List credentials owned by the caller's organization. Credential values are not
|
|
57
|
+
* returned.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* // Automatically fetches more pages as needed.
|
|
62
|
+
* for await (const credential of client.credentials.list()) {
|
|
63
|
+
* // ...
|
|
64
|
+
* }
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
list(query = {}, options) {
|
|
68
|
+
return this._client.getAPIList('/credentials', (pagination_1.OffsetPagination), { query, ...options });
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Delete a credential by its ID or name.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* await client.credentials.delete('id_or_name');
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
delete(idOrName, options) {
|
|
79
|
+
return this._client.delete((0, path_1.path) `/credentials/${idOrName}`, {
|
|
80
|
+
...options,
|
|
81
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Returns the current 6-digit TOTP code for a credential with a configured
|
|
86
|
+
* totp_secret. Use this to complete 2FA setup on sites or when you need a fresh
|
|
87
|
+
* code.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```ts
|
|
91
|
+
* const response = await client.credentials.totpCode(
|
|
92
|
+
* 'id_or_name',
|
|
93
|
+
* );
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
totpCode(idOrName, options) {
|
|
97
|
+
return this._client.get((0, path_1.path) `/credentials/${idOrName}/totp-code`, options);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
exports.Credentials = Credentials;
|
|
101
|
+
//# sourceMappingURL=credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../src/resources/credentials.ts"],"names":[],"mappings":";AA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