-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcontexts.ts
109 lines (89 loc) · 2.5 KB
/
contexts.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../resource';
import * as Core from '../core';
export class Contexts extends APIResource {
/**
* Create a Context
*/
create(body: ContextCreateParams, options?: Core.RequestOptions): Core.APIPromise<ContextCreateResponse> {
return this._client.post('/v1/contexts', { body, ...options });
}
/**
* Context
*/
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<Context> {
return this._client.get(`/v1/contexts/${id}`, options);
}
/**
* Update Context
*/
update(id: string, options?: Core.RequestOptions): Core.APIPromise<ContextUpdateResponse> {
return this._client.put(`/v1/contexts/${id}`, options);
}
}
export interface Context {
id: string;
createdAt: string;
/**
* The Project ID linked to the uploaded Context.
*/
projectId: string;
updatedAt: string;
}
export interface ContextCreateResponse {
id: string;
/**
* The cipher algorithm used to encrypt the user-data-directory. AES-256-CBC is
* currently the only supported algorithm.
*/
cipherAlgorithm: string;
/**
* The initialization vector size used to encrypt the user-data-directory.
* [Read more about how to use it](/features/contexts).
*/
initializationVectorSize: number;
/**
* The public key to encrypt the user-data-directory.
*/
publicKey: string;
/**
* An upload URL to upload a custom user-data-directory.
*/
uploadUrl: string;
}
export interface ContextUpdateResponse {
id: string;
/**
* The cipher algorithm used to encrypt the user-data-directory. AES-256-CBC is
* currently the only supported algorithm.
*/
cipherAlgorithm: string;
/**
* The initialization vector size used to encrypt the user-data-directory.
* [Read more about how to use it](/features/contexts).
*/
initializationVectorSize: number;
/**
* The public key to encrypt the user-data-directory.
*/
publicKey: string;
/**
* An upload URL to upload a custom user-data-directory.
*/
uploadUrl: string;
}
export interface ContextCreateParams {
/**
* The Project ID. Can be found in
* [Settings](https://www.browserbase.com/settings).
*/
projectId: string;
}
export declare namespace Contexts {
export {
type Context as Context,
type ContextCreateResponse as ContextCreateResponse,
type ContextUpdateResponse as ContextUpdateResponse,
type ContextCreateParams as ContextCreateParams,
};
}