@onkernel/sdk 0.24.0 → 0.26.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 +38 -0
- package/LICENSE +1 -1
- package/README.md +9 -4
- package/client.d.mts +6 -6
- package/client.d.mts.map +1 -1
- package/client.d.ts +6 -6
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/package.json +2 -2
- 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 +135 -126
- package/resources/agents/auth/auth.d.mts.map +1 -1
- package/resources/agents/auth/auth.d.ts +135 -126
- package/resources/agents/auth/auth.d.ts.map +1 -1
- package/resources/agents/auth/auth.js +2 -18
- package/resources/agents/auth/auth.js.map +1 -1
- package/resources/agents/auth/auth.mjs +2 -18
- 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 +28 -33
- package/resources/agents/auth/invocations.d.mts.map +1 -1
- package/resources/agents/auth/invocations.d.ts +28 -33
- 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/browsers/browsers.d.mts +84 -3
- package/resources/browsers/browsers.d.mts.map +1 -1
- package/resources/browsers/browsers.d.ts +84 -3
- package/resources/browsers/browsers.d.ts.map +1 -1
- package/resources/browsers/browsers.js +13 -0
- package/resources/browsers/browsers.js.map +1 -1
- package/resources/browsers/browsers.mjs +13 -0
- package/resources/browsers/browsers.mjs.map +1 -1
- package/resources/browsers/index.d.mts +2 -2
- package/resources/browsers/index.d.mts.map +1 -1
- package/resources/browsers/index.d.ts +2 -2
- package/resources/browsers/index.d.ts.map +1 -1
- package/resources/browsers/index.js.map +1 -1
- package/resources/browsers/index.mjs.map +1 -1
- package/resources/browsers/process.d.mts +52 -1
- package/resources/browsers/process.d.mts.map +1 -1
- package/resources/browsers/process.d.ts +52 -1
- package/resources/browsers/process.d.ts.map +1 -1
- package/resources/browsers/process.js +19 -0
- package/resources/browsers/process.js.map +1 -1
- package/resources/browsers/process.mjs +19 -0
- package/resources/browsers/process.mjs.map +1 -1
- package/resources/credentials.d.mts +107 -16
- package/resources/credentials.d.mts.map +1 -1
- package/resources/credentials.d.ts +107 -16
- package/resources/credentials.d.ts.map +1 -1
- package/resources/credentials.js +33 -14
- package/resources/credentials.js.map +1 -1
- package/resources/credentials.mjs +33 -14
- package/resources/credentials.mjs.map +1 -1
- package/resources/index.d.mts +3 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/proxies.d.mts +153 -1
- package/resources/proxies.d.mts.map +1 -1
- package/resources/proxies.d.ts +153 -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 +8 -0
- package/src/resources/agents/agents.ts +0 -4
- package/src/resources/agents/auth/auth.ts +146 -136
- package/src/resources/agents/auth/index.ts +0 -3
- package/src/resources/agents/auth/invocations.ts +31 -39
- package/src/resources/agents/index.ts +0 -2
- package/src/resources/browsers/browsers.ts +104 -0
- package/src/resources/browsers/index.ts +4 -0
- package/src/resources/browsers/process.ts +68 -0
- package/src/resources/credentials.ts +127 -18
- package/src/resources/index.ts +4 -0
- package/src/resources/proxies.ts +248 -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
|
@@ -4,8 +4,7 @@ import { OffsetPagination, type OffsetPaginationParams, PagePromise } from "../c
|
|
|
4
4
|
import { RequestOptions } from "../internal/request-options.mjs";
|
|
5
5
|
export declare class Credentials extends APIResource {
|
|
6
6
|
/**
|
|
7
|
-
* Create a new credential for storing login information.
|
|
8
|
-
* rest.
|
|
7
|
+
* Create a new credential for storing login information.
|
|
9
8
|
*
|
|
10
9
|
* @example
|
|
11
10
|
* ```ts
|
|
@@ -21,23 +20,28 @@ export declare class Credentials extends APIResource {
|
|
|
21
20
|
*/
|
|
22
21
|
create(body: CredentialCreateParams, options?: RequestOptions): APIPromise<Credential>;
|
|
23
22
|
/**
|
|
24
|
-
* Retrieve a credential by its ID. Credential values are not returned.
|
|
23
|
+
* Retrieve a credential by its ID or name. Credential values are not returned.
|
|
25
24
|
*
|
|
26
25
|
* @example
|
|
27
26
|
* ```ts
|
|
28
|
-
* const credential = await client.credentials.retrieve(
|
|
27
|
+
* const credential = await client.credentials.retrieve(
|
|
28
|
+
* 'id_or_name',
|
|
29
|
+
* );
|
|
29
30
|
* ```
|
|
30
31
|
*/
|
|
31
|
-
retrieve(
|
|
32
|
+
retrieve(idOrName: string, options?: RequestOptions): APIPromise<Credential>;
|
|
32
33
|
/**
|
|
33
|
-
* Update a credential's name or values.
|
|
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).
|
|
34
36
|
*
|
|
35
37
|
* @example
|
|
36
38
|
* ```ts
|
|
37
|
-
* const credential = await client.credentials.update(
|
|
39
|
+
* const credential = await client.credentials.update(
|
|
40
|
+
* 'id_or_name',
|
|
41
|
+
* );
|
|
38
42
|
* ```
|
|
39
43
|
*/
|
|
40
|
-
update(
|
|
44
|
+
update(idOrName: string, body: CredentialUpdateParams, options?: RequestOptions): APIPromise<Credential>;
|
|
41
45
|
/**
|
|
42
46
|
* List credentials owned by the caller's organization. Credential values are not
|
|
43
47
|
* returned.
|
|
@@ -52,14 +56,27 @@ export declare class Credentials extends APIResource {
|
|
|
52
56
|
*/
|
|
53
57
|
list(query?: CredentialListParams | null | undefined, options?: RequestOptions): PagePromise<CredentialsOffsetPagination, Credential>;
|
|
54
58
|
/**
|
|
55
|
-
* Delete a credential by its ID.
|
|
59
|
+
* Delete a credential by its ID or name.
|
|
56
60
|
*
|
|
57
61
|
* @example
|
|
58
62
|
* ```ts
|
|
59
|
-
* await client.credentials.delete('
|
|
63
|
+
* await client.credentials.delete('id_or_name');
|
|
60
64
|
* ```
|
|
61
65
|
*/
|
|
62
|
-
delete(
|
|
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>;
|
|
63
80
|
}
|
|
64
81
|
export type CredentialsOffsetPagination = OffsetPagination<Credential>;
|
|
65
82
|
/**
|
|
@@ -80,6 +97,18 @@ export interface CreateCredentialRequest {
|
|
|
80
97
|
values: {
|
|
81
98
|
[key: string]: string;
|
|
82
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;
|
|
83
112
|
}
|
|
84
113
|
/**
|
|
85
114
|
* A stored credential for automatic re-authentication
|
|
@@ -105,6 +134,26 @@ export interface Credential {
|
|
|
105
134
|
* When the credential was last updated
|
|
106
135
|
*/
|
|
107
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;
|
|
108
157
|
}
|
|
109
158
|
/**
|
|
110
159
|
* Request to update an existing credential
|
|
@@ -115,13 +164,33 @@ export interface UpdateCredentialRequest {
|
|
|
115
164
|
*/
|
|
116
165
|
name?: string;
|
|
117
166
|
/**
|
|
118
|
-
*
|
|
119
|
-
*
|
|
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).
|
|
120
179
|
*/
|
|
121
180
|
values?: {
|
|
122
181
|
[key: string]: string;
|
|
123
182
|
};
|
|
124
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
|
+
}
|
|
125
194
|
export interface CredentialCreateParams {
|
|
126
195
|
/**
|
|
127
196
|
* Target domain this credential is for
|
|
@@ -137,6 +206,18 @@ export interface CredentialCreateParams {
|
|
|
137
206
|
values: {
|
|
138
207
|
[key: string]: string;
|
|
139
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;
|
|
140
221
|
}
|
|
141
222
|
export interface CredentialUpdateParams {
|
|
142
223
|
/**
|
|
@@ -144,8 +225,18 @@ export interface CredentialUpdateParams {
|
|
|
144
225
|
*/
|
|
145
226
|
name?: string;
|
|
146
227
|
/**
|
|
147
|
-
*
|
|
148
|
-
*
|
|
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).
|
|
149
240
|
*/
|
|
150
241
|
values?: {
|
|
151
242
|
[key: string]: string;
|
|
@@ -158,6 +249,6 @@ export interface CredentialListParams extends OffsetPaginationParams {
|
|
|
158
249
|
domain?: string;
|
|
159
250
|
}
|
|
160
251
|
export declare namespace Credentials {
|
|
161
|
-
export { type CreateCredentialRequest as CreateCredentialRequest, type Credential as Credential, type UpdateCredentialRequest as UpdateCredentialRequest, type CredentialsOffsetPagination as CredentialsOffsetPagination, type CredentialCreateParams as CredentialCreateParams, type CredentialUpdateParams as CredentialUpdateParams, type CredentialListParams as CredentialListParams, };
|
|
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, };
|
|
162
253
|
}
|
|
163
254
|
//# sourceMappingURL=credentials.d.mts.map
|
|
@@ -1 +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,KA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AAE,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"}
|
|
@@ -4,8 +4,7 @@ import { OffsetPagination, type OffsetPaginationParams, PagePromise } from "../c
|
|
|
4
4
|
import { RequestOptions } from "../internal/request-options.js";
|
|
5
5
|
export declare class Credentials extends APIResource {
|
|
6
6
|
/**
|
|
7
|
-
* Create a new credential for storing login information.
|
|
8
|
-
* rest.
|
|
7
|
+
* Create a new credential for storing login information.
|
|
9
8
|
*
|
|
10
9
|
* @example
|
|
11
10
|
* ```ts
|
|
@@ -21,23 +20,28 @@ export declare class Credentials extends APIResource {
|
|
|
21
20
|
*/
|
|
22
21
|
create(body: CredentialCreateParams, options?: RequestOptions): APIPromise<Credential>;
|
|
23
22
|
/**
|
|
24
|
-
* Retrieve a credential by its ID. Credential values are not returned.
|
|
23
|
+
* Retrieve a credential by its ID or name. Credential values are not returned.
|
|
25
24
|
*
|
|
26
25
|
* @example
|
|
27
26
|
* ```ts
|
|
28
|
-
* const credential = await client.credentials.retrieve(
|
|
27
|
+
* const credential = await client.credentials.retrieve(
|
|
28
|
+
* 'id_or_name',
|
|
29
|
+
* );
|
|
29
30
|
* ```
|
|
30
31
|
*/
|
|
31
|
-
retrieve(
|
|
32
|
+
retrieve(idOrName: string, options?: RequestOptions): APIPromise<Credential>;
|
|
32
33
|
/**
|
|
33
|
-
* Update a credential's name or values.
|
|
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).
|
|
34
36
|
*
|
|
35
37
|
* @example
|
|
36
38
|
* ```ts
|
|
37
|
-
* const credential = await client.credentials.update(
|
|
39
|
+
* const credential = await client.credentials.update(
|
|
40
|
+
* 'id_or_name',
|
|
41
|
+
* );
|
|
38
42
|
* ```
|
|
39
43
|
*/
|
|
40
|
-
update(
|
|
44
|
+
update(idOrName: string, body: CredentialUpdateParams, options?: RequestOptions): APIPromise<Credential>;
|
|
41
45
|
/**
|
|
42
46
|
* List credentials owned by the caller's organization. Credential values are not
|
|
43
47
|
* returned.
|
|
@@ -52,14 +56,27 @@ export declare class Credentials extends APIResource {
|
|
|
52
56
|
*/
|
|
53
57
|
list(query?: CredentialListParams | null | undefined, options?: RequestOptions): PagePromise<CredentialsOffsetPagination, Credential>;
|
|
54
58
|
/**
|
|
55
|
-
* Delete a credential by its ID.
|
|
59
|
+
* Delete a credential by its ID or name.
|
|
56
60
|
*
|
|
57
61
|
* @example
|
|
58
62
|
* ```ts
|
|
59
|
-
* await client.credentials.delete('
|
|
63
|
+
* await client.credentials.delete('id_or_name');
|
|
60
64
|
* ```
|
|
61
65
|
*/
|
|
62
|
-
delete(
|
|
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>;
|
|
63
80
|
}
|
|
64
81
|
export type CredentialsOffsetPagination = OffsetPagination<Credential>;
|
|
65
82
|
/**
|
|
@@ -80,6 +97,18 @@ export interface CreateCredentialRequest {
|
|
|
80
97
|
values: {
|
|
81
98
|
[key: string]: string;
|
|
82
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;
|
|
83
112
|
}
|
|
84
113
|
/**
|
|
85
114
|
* A stored credential for automatic re-authentication
|
|
@@ -105,6 +134,26 @@ export interface Credential {
|
|
|
105
134
|
* When the credential was last updated
|
|
106
135
|
*/
|
|
107
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;
|
|
108
157
|
}
|
|
109
158
|
/**
|
|
110
159
|
* Request to update an existing credential
|
|
@@ -115,13 +164,33 @@ export interface UpdateCredentialRequest {
|
|
|
115
164
|
*/
|
|
116
165
|
name?: string;
|
|
117
166
|
/**
|
|
118
|
-
*
|
|
119
|
-
*
|
|
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).
|
|
120
179
|
*/
|
|
121
180
|
values?: {
|
|
122
181
|
[key: string]: string;
|
|
123
182
|
};
|
|
124
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
|
+
}
|
|
125
194
|
export interface CredentialCreateParams {
|
|
126
195
|
/**
|
|
127
196
|
* Target domain this credential is for
|
|
@@ -137,6 +206,18 @@ export interface CredentialCreateParams {
|
|
|
137
206
|
values: {
|
|
138
207
|
[key: string]: string;
|
|
139
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;
|
|
140
221
|
}
|
|
141
222
|
export interface CredentialUpdateParams {
|
|
142
223
|
/**
|
|
@@ -144,8 +225,18 @@ export interface CredentialUpdateParams {
|
|
|
144
225
|
*/
|
|
145
226
|
name?: string;
|
|
146
227
|
/**
|
|
147
|
-
*
|
|
148
|
-
*
|
|
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).
|
|
149
240
|
*/
|
|
150
241
|
values?: {
|
|
151
242
|
[key: string]: string;
|
|
@@ -158,6 +249,6 @@ export interface CredentialListParams extends OffsetPaginationParams {
|
|
|
158
249
|
domain?: string;
|
|
159
250
|
}
|
|
160
251
|
export declare namespace Credentials {
|
|
161
|
-
export { type CreateCredentialRequest as CreateCredentialRequest, type Credential as Credential, type UpdateCredentialRequest as UpdateCredentialRequest, type CredentialsOffsetPagination as CredentialsOffsetPagination, type CredentialCreateParams as CredentialCreateParams, type CredentialUpdateParams as CredentialUpdateParams, type CredentialListParams as CredentialListParams, };
|
|
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, };
|
|
162
253
|
}
|
|
163
254
|
//# sourceMappingURL=credentials.d.ts.map
|
|
@@ -1 +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
|
|
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,CAA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AsB;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"}
|
package/resources/credentials.js
CHANGED
|
@@ -8,8 +8,7 @@ const headers_1 = require("../internal/headers.js");
|
|
|
8
8
|
const path_1 = require("../internal/utils/path.js");
|
|
9
9
|
class Credentials extends resource_1.APIResource {
|
|
10
10
|
/**
|
|
11
|
-
* Create a new credential for storing login information.
|
|
12
|
-
* rest.
|
|
11
|
+
* Create a new credential for storing login information.
|
|
13
12
|
*
|
|
14
13
|
* @example
|
|
15
14
|
* ```ts
|
|
@@ -27,26 +26,31 @@ class Credentials extends resource_1.APIResource {
|
|
|
27
26
|
return this._client.post('/credentials', { body, ...options });
|
|
28
27
|
}
|
|
29
28
|
/**
|
|
30
|
-
* Retrieve a credential by its ID. Credential values are not returned.
|
|
29
|
+
* Retrieve a credential by its ID or name. Credential values are not returned.
|
|
31
30
|
*
|
|
32
31
|
* @example
|
|
33
32
|
* ```ts
|
|
34
|
-
* const credential = await client.credentials.retrieve(
|
|
33
|
+
* const credential = await client.credentials.retrieve(
|
|
34
|
+
* 'id_or_name',
|
|
35
|
+
* );
|
|
35
36
|
* ```
|
|
36
37
|
*/
|
|
37
|
-
retrieve(
|
|
38
|
-
return this._client.get((0, path_1.path) `/credentials/${
|
|
38
|
+
retrieve(idOrName, options) {
|
|
39
|
+
return this._client.get((0, path_1.path) `/credentials/${idOrName}`, options);
|
|
39
40
|
}
|
|
40
41
|
/**
|
|
41
|
-
* Update a credential's name or values.
|
|
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).
|
|
42
44
|
*
|
|
43
45
|
* @example
|
|
44
46
|
* ```ts
|
|
45
|
-
* const credential = await client.credentials.update(
|
|
47
|
+
* const credential = await client.credentials.update(
|
|
48
|
+
* 'id_or_name',
|
|
49
|
+
* );
|
|
46
50
|
* ```
|
|
47
51
|
*/
|
|
48
|
-
update(
|
|
49
|
-
return this._client.patch((0, path_1.path) `/credentials/${
|
|
52
|
+
update(idOrName, body, options) {
|
|
53
|
+
return this._client.patch((0, path_1.path) `/credentials/${idOrName}`, { body, ...options });
|
|
50
54
|
}
|
|
51
55
|
/**
|
|
52
56
|
* List credentials owned by the caller's organization. Credential values are not
|
|
@@ -64,19 +68,34 @@ class Credentials extends resource_1.APIResource {
|
|
|
64
68
|
return this._client.getAPIList('/credentials', (pagination_1.OffsetPagination), { query, ...options });
|
|
65
69
|
}
|
|
66
70
|
/**
|
|
67
|
-
* Delete a credential by its ID.
|
|
71
|
+
* Delete a credential by its ID or name.
|
|
68
72
|
*
|
|
69
73
|
* @example
|
|
70
74
|
* ```ts
|
|
71
|
-
* await client.credentials.delete('
|
|
75
|
+
* await client.credentials.delete('id_or_name');
|
|
72
76
|
* ```
|
|
73
77
|
*/
|
|
74
|
-
delete(
|
|
75
|
-
return this._client.delete((0, path_1.path) `/credentials/${
|
|
78
|
+
delete(idOrName, options) {
|
|
79
|
+
return this._client.delete((0, path_1.path) `/credentials/${idOrName}`, {
|
|
76
80
|
...options,
|
|
77
81
|
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
78
82
|
});
|
|
79
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
|
+
}
|
|
80
99
|
}
|
|
81
100
|
exports.Credentials = Credentials;
|
|
82
101
|
//# sourceMappingURL=credentials.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../src/resources/credentials.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,sDAAgG;AAChG,oDAAmD;AAEnD,oDAA8C;AAE9C,MAAa,WAAY,SAAQ,sBAAW;IAC1C
|
|
1
|
+
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../src/resources/credentials.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,sDAAgG;AAChG,oDAAmD;AAEnD,oDAA8C;AAE9C,MAAa,WAAY,SAAQ,sBAAW;IAC1C;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,IAA4B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;;;OASG;IACH,QAAQ,CAAC,QAAgB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,gBAAgB,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IACnE,CAAC;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,QAAgB,EAAE,IAA4B,EAAE,OAAwB;QAC7E,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,gBAAgB,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClF,CAAC;IAED;;;;;;;;;;;OAWG;IACH,IAAI,CACF,QAAiD,EAAE,EACnD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,CAAA,6BAA4B,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtG,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,QAAgB,EAAE,OAAwB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,gBAAgB,QAAQ,EAAE,EAAE;YACzD,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,QAAgB,EAAE,OAAwB;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,gBAAgB,QAAQ,YAAY,EAAE,OAAO,CAAC,CAAC;IAC7E,CAAC;CACF;AAlGD,kCAkGC"}
|
|
@@ -5,8 +5,7 @@ import { buildHeaders } from "../internal/headers.mjs";
|
|
|
5
5
|
import { path } from "../internal/utils/path.mjs";
|
|
6
6
|
export class Credentials extends APIResource {
|
|
7
7
|
/**
|
|
8
|
-
* Create a new credential for storing login information.
|
|
9
|
-
* rest.
|
|
8
|
+
* Create a new credential for storing login information.
|
|
10
9
|
*
|
|
11
10
|
* @example
|
|
12
11
|
* ```ts
|
|
@@ -24,26 +23,31 @@ export class Credentials extends APIResource {
|
|
|
24
23
|
return this._client.post('/credentials', { body, ...options });
|
|
25
24
|
}
|
|
26
25
|
/**
|
|
27
|
-
* Retrieve a credential by its ID. Credential values are not returned.
|
|
26
|
+
* Retrieve a credential by its ID or name. Credential values are not returned.
|
|
28
27
|
*
|
|
29
28
|
* @example
|
|
30
29
|
* ```ts
|
|
31
|
-
* const credential = await client.credentials.retrieve(
|
|
30
|
+
* const credential = await client.credentials.retrieve(
|
|
31
|
+
* 'id_or_name',
|
|
32
|
+
* );
|
|
32
33
|
* ```
|
|
33
34
|
*/
|
|
34
|
-
retrieve(
|
|
35
|
-
return this._client.get(path `/credentials/${
|
|
35
|
+
retrieve(idOrName, options) {
|
|
36
|
+
return this._client.get(path `/credentials/${idOrName}`, options);
|
|
36
37
|
}
|
|
37
38
|
/**
|
|
38
|
-
* Update a credential's name or values.
|
|
39
|
+
* Update a credential's name or values. When values are provided, they are merged
|
|
40
|
+
* with existing values (new keys are added, existing keys are overwritten).
|
|
39
41
|
*
|
|
40
42
|
* @example
|
|
41
43
|
* ```ts
|
|
42
|
-
* const credential = await client.credentials.update(
|
|
44
|
+
* const credential = await client.credentials.update(
|
|
45
|
+
* 'id_or_name',
|
|
46
|
+
* );
|
|
43
47
|
* ```
|
|
44
48
|
*/
|
|
45
|
-
update(
|
|
46
|
-
return this._client.patch(path `/credentials/${
|
|
49
|
+
update(idOrName, body, options) {
|
|
50
|
+
return this._client.patch(path `/credentials/${idOrName}`, { body, ...options });
|
|
47
51
|
}
|
|
48
52
|
/**
|
|
49
53
|
* List credentials owned by the caller's organization. Credential values are not
|
|
@@ -61,18 +65,33 @@ export class Credentials extends APIResource {
|
|
|
61
65
|
return this._client.getAPIList('/credentials', (OffsetPagination), { query, ...options });
|
|
62
66
|
}
|
|
63
67
|
/**
|
|
64
|
-
* Delete a credential by its ID.
|
|
68
|
+
* Delete a credential by its ID or name.
|
|
65
69
|
*
|
|
66
70
|
* @example
|
|
67
71
|
* ```ts
|
|
68
|
-
* await client.credentials.delete('
|
|
72
|
+
* await client.credentials.delete('id_or_name');
|
|
69
73
|
* ```
|
|
70
74
|
*/
|
|
71
|
-
delete(
|
|
72
|
-
return this._client.delete(path `/credentials/${
|
|
75
|
+
delete(idOrName, options) {
|
|
76
|
+
return this._client.delete(path `/credentials/${idOrName}`, {
|
|
73
77
|
...options,
|
|
74
78
|
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
75
79
|
});
|
|
76
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* Returns the current 6-digit TOTP code for a credential with a configured
|
|
83
|
+
* totp_secret. Use this to complete 2FA setup on sites or when you need a fresh
|
|
84
|
+
* code.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* const response = await client.credentials.totpCode(
|
|
89
|
+
* 'id_or_name',
|
|
90
|
+
* );
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
totpCode(idOrName, options) {
|
|
94
|
+
return this._client.get(path `/credentials/${idOrName}/totp-code`, options);
|
|
95
|
+
}
|
|
77
96
|
}
|
|
78
97
|
//# sourceMappingURL=credentials.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.mjs","sourceRoot":"","sources":["../src/resources/credentials.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,gBAAgB,EAA4C;OAC9D,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C
|
|
1
|
+
{"version":3,"file":"credentials.mjs","sourceRoot":"","sources":["../src/resources/credentials.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,gBAAgB,EAA4C;OAC9D,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,IAA4B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAA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";
|
|
3
3
|
export { Apps, type AppListResponse, type AppListParams, type AppListResponsesOffsetPagination, } from "./apps.mjs";
|
|
4
4
|
export { BrowserPools, type BrowserPool, type BrowserPoolListResponse, type BrowserPoolAcquireResponse, type BrowserPoolCreateParams, type BrowserPoolUpdateParams, type BrowserPoolDeleteParams, type BrowserPoolAcquireParams, type BrowserPoolReleaseParams, } from "./browser-pools.mjs";
|
|
5
|
-
export { Browsers, type BrowserPersistence, type Profile, type BrowserCreateResponse, type BrowserRetrieveResponse, type BrowserListResponse, type BrowserCreateParams, type BrowserListParams, type BrowserDeleteParams, type BrowserLoadExtensionsParams, type BrowserListResponsesOffsetPagination, } from "./browsers/browsers.mjs";
|
|
6
|
-
export { Credentials, type CreateCredentialRequest, type Credential, type UpdateCredentialRequest, type CredentialCreateParams, type CredentialUpdateParams, type CredentialListParams, type CredentialsOffsetPagination, } from "./credentials.mjs";
|
|
5
|
+
export { Browsers, type BrowserPersistence, type Profile, type BrowserCreateResponse, type BrowserRetrieveResponse, type BrowserUpdateResponse, type BrowserListResponse, type BrowserCreateParams, type BrowserUpdateParams, type BrowserListParams, type BrowserDeleteParams, type BrowserLoadExtensionsParams, type BrowserListResponsesOffsetPagination, } from "./browsers/browsers.mjs";
|
|
6
|
+
export { Credentials, type CreateCredentialRequest, type Credential, type UpdateCredentialRequest, type CredentialTotpCodeResponse, type CredentialCreateParams, type CredentialUpdateParams, type CredentialListParams, type CredentialsOffsetPagination, } from "./credentials.mjs";
|
|
7
7
|
export { Deployments, type DeploymentStateEvent, type DeploymentCreateResponse, type DeploymentRetrieveResponse, type DeploymentListResponse, type DeploymentFollowResponse, type DeploymentCreateParams, type DeploymentListParams, type DeploymentFollowParams, type DeploymentListResponsesOffsetPagination, } from "./deployments.mjs";
|
|
8
8
|
export { Extensions, type ExtensionListResponse, type ExtensionUploadResponse, type ExtensionDownloadFromChromeStoreParams, type ExtensionUploadParams, } from "./extensions.mjs";
|
|
9
9
|
export { Invocations, type InvocationStateEvent, type InvocationCreateResponse, type InvocationRetrieveResponse, type InvocationUpdateResponse, type InvocationListResponse, type InvocationFollowResponse, type InvocationCreateParams, type InvocationUpdateParams, type InvocationListParams, type InvocationFollowParams, type InvocationListResponsesOffsetPagination, } from "./invocations.mjs";
|
|
10
10
|
export { Profiles, type ProfileListResponse, type ProfileCreateParams } from "./profiles.mjs";
|
|
11
|
-
export { Proxies, type ProxyCreateResponse, type ProxyRetrieveResponse, type ProxyListResponse, type ProxyCreateParams, } from "./proxies.mjs";
|
|
11
|
+
export { Proxies, type ProxyCreateResponse, type ProxyRetrieveResponse, type ProxyListResponse, type ProxyCheckResponse, type ProxyCreateParams, } from "./proxies.mjs";
|
|
12
12
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";OAGO,EAAE,MAAM,EAAE;OACV,EACL,IAAI,EACJ,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,gCAAgC,GACtC;OACM,EACL,YAAY,EACZ,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,GAC9B;OACM,EACL,QAAQ,EACR,KAAK,kBAAkB,EACvB,KAAK,OAAO,EACZ,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAChC,KAAK,oCAAoC,GAC1C;OACM,EACL,WAAW,EACX,KAAK,uBAAuB,EAC5B,KAAK,UAAU,EACf,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,EACzB,KAAK,2BAA2B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