@valtown/sdk 0.38.2 → 1.0.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 +36 -0
- package/README.md +0 -30
- package/core.d.ts +1 -1
- package/core.d.ts.map +1 -1
- package/core.js +5 -5
- package/core.js.map +1 -1
- package/core.mjs +5 -5
- package/core.mjs.map +1 -1
- package/index.d.mts +5 -12
- package/index.d.ts +5 -12
- package/index.d.ts.map +1 -1
- package/index.js +2 -9
- package/index.js.map +1 -1
- package/index.mjs +3 -10
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/alias/username/index.d.ts +1 -2
- package/resources/alias/username/index.d.ts.map +1 -1
- package/resources/alias/username/index.js +1 -3
- package/resources/alias/username/index.js.map +1 -1
- package/resources/alias/username/index.mjs +0 -1
- package/resources/alias/username/index.mjs.map +1 -1
- package/resources/alias/username/username.d.ts +2 -6
- package/resources/alias/username/username.d.ts.map +1 -1
- package/resources/alias/username/username.js +0 -4
- package/resources/alias/username/username.js.map +1 -1
- package/resources/alias/username/username.mjs +0 -4
- package/resources/alias/username/username.mjs.map +1 -1
- package/resources/alias/username/val-name.d.ts +2 -87
- package/resources/alias/username/val-name.d.ts.map +1 -1
- package/resources/alias/username/val-name.js +1 -1
- package/resources/alias/username/val-name.js.map +1 -1
- package/resources/alias/username/val-name.mjs +1 -1
- package/resources/alias/username/val-name.mjs.map +1 -1
- package/resources/index.d.ts +2 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +2 -5
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -3
- package/resources/index.mjs.map +1 -1
- package/resources/me/index.d.ts +1 -4
- package/resources/me/index.d.ts.map +1 -1
- package/resources/me/index.js +3 -12
- package/resources/me/index.js.map +1 -1
- package/resources/me/index.mjs +1 -4
- package/resources/me/index.mjs.map +1 -1
- package/resources/me/me.d.ts +4 -16
- package/resources/me/me.d.ts.map +1 -1
- package/resources/me/me.js +4 -19
- package/resources/me/me.js.map +1 -1
- package/resources/me/me.mjs +4 -19
- package/resources/me/me.mjs.map +1 -1
- package/resources/{users → me}/vals.d.ts +4 -4
- package/resources/me/vals.d.ts.map +1 -0
- package/resources/me/vals.js +17 -0
- package/resources/me/vals.js.map +1 -0
- package/resources/me/vals.mjs +13 -0
- package/resources/me/vals.mjs.map +1 -0
- package/resources/search/index.d.ts +1 -1
- package/resources/search/index.d.ts.map +1 -1
- package/resources/search/index.js +2 -1
- package/resources/search/index.js.map +1 -1
- package/resources/search/index.mjs +1 -1
- package/resources/search/index.mjs.map +1 -1
- package/resources/search/search.d.ts +2 -2
- package/resources/search/search.d.ts.map +1 -1
- package/resources/search/search.js +1 -0
- package/resources/search/search.js.map +1 -1
- package/resources/search/search.mjs +2 -1
- package/resources/search/search.mjs.map +1 -1
- package/resources/search/vals.d.ts +78 -6
- package/resources/search/vals.d.ts.map +1 -1
- package/resources/search/vals.js +7 -4
- package/resources/search/vals.js.map +1 -1
- package/resources/search/vals.mjs +5 -3
- package/resources/search/vals.mjs.map +1 -1
- package/resources/shared.d.ts +36 -157
- package/resources/shared.d.ts.map +1 -1
- package/resources/shared.js +3 -3
- package/resources/shared.js.map +1 -1
- package/resources/shared.mjs +1 -1
- package/resources/shared.mjs.map +1 -1
- package/resources/users.d.ts +12 -1
- package/resources/users.d.ts.map +1 -1
- package/resources/users.js +14 -15
- package/resources/users.js.map +1 -1
- package/resources/users.mjs +12 -1
- package/resources/users.mjs.map +1 -1
- package/resources/{projects → vals}/branches.d.ts +8 -8
- package/resources/vals/branches.d.ts.map +1 -0
- package/resources/{projects → vals}/branches.js +12 -12
- package/resources/vals/branches.js.map +1 -0
- package/resources/vals/branches.mjs +39 -0
- package/resources/vals/branches.mjs.map +1 -0
- package/resources/{projects → vals}/files.d.ts +26 -37
- package/resources/vals/files.d.ts.map +1 -0
- package/resources/{projects → vals}/files.js +18 -26
- package/resources/vals/files.js.map +1 -0
- package/resources/{projects → vals}/files.mjs +18 -26
- package/resources/vals/files.mjs.map +1 -0
- package/resources/vals/index.d.ts +3 -2
- package/resources/vals/index.d.ts.map +1 -1
- package/resources/vals/index.js +7 -4
- package/resources/vals/index.js.map +1 -1
- package/resources/vals/index.mjs +3 -2
- package/resources/vals/index.mjs.map +1 -1
- package/resources/vals/vals.d.ts +22 -114
- package/resources/vals/vals.d.ts.map +1 -1
- package/resources/vals/vals.js +20 -40
- package/resources/vals/vals.js.map +1 -1
- package/resources/vals/vals.mjs +19 -39
- package/resources/vals/vals.mjs.map +1 -1
- package/src/core.ts +4 -4
- package/src/index.ts +5 -47
- package/src/resources/alias/username/index.ts +1 -2
- package/src/resources/alias/username/username.ts +2 -8
- package/src/resources/alias/username/val-name.ts +3 -115
- package/src/resources/index.ts +2 -19
- package/src/resources/me/index.ts +1 -19
- package/src/resources/me/me.ts +5 -56
- package/src/resources/{users → me}/vals.ts +5 -9
- package/src/resources/search/index.ts +1 -1
- package/src/resources/search/search.ts +8 -2
- package/src/resources/search/vals.ts +103 -8
- package/src/resources/shared.ts +47 -197
- package/src/resources/users.ts +15 -1
- package/src/resources/{projects → vals}/branches.ts +12 -12
- package/src/resources/{projects → vals}/files.ts +33 -55
- package/src/resources/vals/index.ts +20 -15
- package/src/resources/vals/vals.ts +65 -181
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
- package/resources/alias/username/project-name.d.ts +0 -51
- package/resources/alias/username/project-name.d.ts.map +0 -1
- package/resources/alias/username/project-name.js +0 -15
- package/resources/alias/username/project-name.js.map +0 -1
- package/resources/alias/username/project-name.mjs +0 -11
- package/resources/alias/username/project-name.mjs.map +0 -1
- package/resources/me/comments.d.ts +0 -74
- package/resources/me/comments.d.ts.map +0 -1
- package/resources/me/comments.js +0 -23
- package/resources/me/comments.js.map +0 -1
- package/resources/me/comments.mjs +0 -18
- package/resources/me/comments.mjs.map +0 -1
- package/resources/me/likes.d.ts +0 -18
- package/resources/me/likes.d.ts.map +0 -1
- package/resources/me/likes.js +0 -17
- package/resources/me/likes.js.map +0 -1
- package/resources/me/likes.mjs +0 -13
- package/resources/me/likes.mjs.map +0 -1
- package/resources/me/projects.d.ts +0 -56
- package/resources/me/projects.d.ts.map +0 -1
- package/resources/me/projects.js +0 -23
- package/resources/me/projects.js.map +0 -1
- package/resources/me/projects.mjs +0 -18
- package/resources/me/projects.mjs.map +0 -1
- package/resources/me/references.d.ts +0 -84
- package/resources/me/references.d.ts.map +0 -1
- package/resources/me/references.js +0 -23
- package/resources/me/references.js.map +0 -1
- package/resources/me/references.mjs +0 -18
- package/resources/me/references.mjs.map +0 -1
- package/resources/projects/branches.d.ts.map +0 -1
- package/resources/projects/branches.js.map +0 -1
- package/resources/projects/branches.mjs +0 -39
- package/resources/projects/branches.mjs.map +0 -1
- package/resources/projects/files.d.ts.map +0 -1
- package/resources/projects/files.js.map +0 -1
- package/resources/projects/files.mjs.map +0 -1
- package/resources/projects/index.d.ts +0 -4
- package/resources/projects/index.d.ts.map +0 -1
- package/resources/projects/index.js +0 -14
- package/resources/projects/index.js.map +0 -1
- package/resources/projects/index.mjs +0 -5
- package/resources/projects/index.mjs.map +0 -1
- package/resources/projects/projects.d.ts +0 -162
- package/resources/projects/projects.d.ts.map +0 -1
- package/resources/projects/projects.js +0 -80
- package/resources/projects/projects.js.map +0 -1
- package/resources/projects/projects.mjs +0 -52
- package/resources/projects/projects.mjs.map +0 -1
- package/resources/projects.d.ts +0 -2
- package/resources/projects.d.ts.map +0 -1
- package/resources/projects.js +0 -19
- package/resources/projects.js.map +0 -1
- package/resources/projects.mjs +0 -3
- package/resources/projects.mjs.map +0 -1
- package/resources/users/index.d.ts +0 -3
- package/resources/users/index.d.ts.map +0 -1
- package/resources/users/index.js +0 -9
- package/resources/users/index.js.map +0 -1
- package/resources/users/index.mjs +0 -4
- package/resources/users/index.mjs.map +0 -1
- package/resources/users/users.d.ts +0 -19
- package/resources/users/users.d.ts.map +0 -1
- package/resources/users/users.js +0 -48
- package/resources/users/users.js.map +0 -1
- package/resources/users/users.mjs +0 -21
- package/resources/users/users.mjs.map +0 -1
- package/resources/users/vals.d.ts.map +0 -1
- package/resources/users/vals.js +0 -17
- package/resources/users/vals.js.map +0 -1
- package/resources/users/vals.mjs +0 -13
- package/resources/users/vals.mjs.map +0 -1
- package/resources/vals/versions.d.ts +0 -75
- package/resources/vals/versions.d.ts.map +0 -1
- package/resources/vals/versions.js +0 -44
- package/resources/vals/versions.js.map +0 -1
- package/resources/vals/versions.mjs +0 -39
- package/resources/vals/versions.mjs.map +0 -1
- package/src/resources/alias/username/project-name.ts +0 -72
- package/src/resources/me/comments.ts +0 -108
- package/src/resources/me/likes.ts +0 -27
- package/src/resources/me/projects.ts +0 -85
- package/src/resources/me/references.ts +0 -114
- package/src/resources/projects/index.ts +0 -32
- package/src/resources/projects/projects.ts +0 -275
- package/src/resources/projects.ts +0 -3
- package/src/resources/users/index.ts +0 -4
- package/src/resources/users/users.ts +0 -27
- package/src/resources/vals/versions.ts +0 -126
package/src/resources/users.ts
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import { APIResource } from '../resource';
|
|
4
|
+
import * as Core from '../core';
|
|
5
|
+
import * as Shared from './shared';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Access public user information and list other people’s vals
|
|
9
|
+
*/
|
|
10
|
+
export class Users extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* Get basic information about a user
|
|
13
|
+
*/
|
|
14
|
+
retrieve(userId: string, options?: Core.RequestOptions): Core.APIPromise<Shared.User> {
|
|
15
|
+
return this._client.get(`/v1/users/${userId}`, options);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -6,46 +6,46 @@ import { PageCursorURL, type PageCursorURLParams } from '../../pagination';
|
|
|
6
6
|
|
|
7
7
|
export class Branches extends APIResource {
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Create a new branch
|
|
10
10
|
*/
|
|
11
11
|
create(
|
|
12
|
-
|
|
12
|
+
valId: string,
|
|
13
13
|
body: BranchCreateParams,
|
|
14
14
|
options?: Core.RequestOptions,
|
|
15
15
|
): Core.APIPromise<BranchCreateResponse> {
|
|
16
|
-
return this._client.post(`/
|
|
16
|
+
return this._client.post(`/v2/vals/${valId}/branches`, { body, ...options });
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Get a branch by id
|
|
21
21
|
*/
|
|
22
22
|
retrieve(
|
|
23
|
-
|
|
23
|
+
valId: string,
|
|
24
24
|
branchId: string,
|
|
25
25
|
options?: Core.RequestOptions,
|
|
26
26
|
): Core.APIPromise<BranchRetrieveResponse> {
|
|
27
|
-
return this._client.get(`/
|
|
27
|
+
return this._client.get(`/v2/vals/${valId}/branches/${branchId}`, options);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
31
|
+
* List all branches for a val
|
|
32
32
|
*/
|
|
33
33
|
list(
|
|
34
|
-
|
|
34
|
+
valId: string,
|
|
35
35
|
query: BranchListParams,
|
|
36
36
|
options?: Core.RequestOptions,
|
|
37
37
|
): Core.PagePromise<BranchListResponsesPageCursorURL, BranchListResponse> {
|
|
38
|
-
return this._client.getAPIList(`/
|
|
38
|
+
return this._client.getAPIList(`/v2/vals/${valId}/branches`, BranchListResponsesPageCursorURL, {
|
|
39
39
|
query,
|
|
40
40
|
...options,
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
|
-
*
|
|
45
|
+
* Delete a branch
|
|
46
46
|
*/
|
|
47
|
-
delete(
|
|
48
|
-
return this._client.delete(`/
|
|
47
|
+
delete(valId: string, branchId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
48
|
+
return this._client.delete(`/v2/vals/${valId}/branches/${branchId}`, {
|
|
49
49
|
...options,
|
|
50
50
|
headers: { Accept: '*/*', ...options?.headers },
|
|
51
51
|
});
|
|
@@ -7,61 +7,53 @@ import { type Response } from '../../_shims/index';
|
|
|
7
7
|
|
|
8
8
|
export class Files extends APIResource {
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Create a new file, project val or directory
|
|
11
11
|
*/
|
|
12
12
|
create(
|
|
13
|
-
|
|
13
|
+
valId: string,
|
|
14
14
|
params: FileCreateParams,
|
|
15
15
|
options?: Core.RequestOptions,
|
|
16
16
|
): Core.APIPromise<FileCreateResponse> {
|
|
17
17
|
const { path, branch_id, ...body } = params;
|
|
18
|
-
return this._client.post(`/
|
|
19
|
-
query: { path, branch_id },
|
|
20
|
-
body,
|
|
21
|
-
...options,
|
|
22
|
-
});
|
|
18
|
+
return this._client.post(`/v2/vals/${valId}/files`, { query: { path, branch_id }, body, ...options });
|
|
23
19
|
}
|
|
24
20
|
|
|
25
21
|
/**
|
|
26
|
-
* Get metadata for files and directories in a
|
|
22
|
+
* Get metadata for files and directories in a val. If path is an empty string,
|
|
27
23
|
* returns files at the root directory.
|
|
28
24
|
*/
|
|
29
25
|
retrieve(
|
|
30
|
-
|
|
26
|
+
valId: string,
|
|
31
27
|
query: FileRetrieveParams,
|
|
32
28
|
options?: Core.RequestOptions,
|
|
33
29
|
): Core.PagePromise<FileRetrieveResponsesPageCursorURL, FileRetrieveResponse> {
|
|
34
|
-
return this._client.getAPIList(`/
|
|
30
|
+
return this._client.getAPIList(`/v2/vals/${valId}/files`, FileRetrieveResponsesPageCursorURL, {
|
|
35
31
|
query,
|
|
36
32
|
...options,
|
|
37
33
|
});
|
|
38
34
|
}
|
|
39
35
|
|
|
40
36
|
/**
|
|
41
|
-
*
|
|
37
|
+
* Update a file's content
|
|
42
38
|
*/
|
|
43
39
|
update(
|
|
44
|
-
|
|
40
|
+
valId: string,
|
|
45
41
|
params: FileUpdateParams,
|
|
46
42
|
options?: Core.RequestOptions,
|
|
47
43
|
): Core.APIPromise<FileUpdateResponse> {
|
|
48
44
|
const { path, branch_id, ...body } = params;
|
|
49
|
-
return this._client.put(`/
|
|
50
|
-
query: { path, branch_id },
|
|
51
|
-
body,
|
|
52
|
-
...options,
|
|
53
|
-
});
|
|
45
|
+
return this._client.put(`/v2/vals/${valId}/files`, { query: { path, branch_id }, body, ...options });
|
|
54
46
|
}
|
|
55
47
|
|
|
56
48
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
49
|
+
* Deletes a file or a directory. To delete a directory and all of its children,
|
|
50
|
+
* use the recursive flag. To delete all files, pass in an empty path and the
|
|
51
|
+
* recursive flag.
|
|
60
52
|
*/
|
|
61
|
-
delete(
|
|
62
|
-
const { path,
|
|
63
|
-
return this._client.delete(`/
|
|
64
|
-
query: { path,
|
|
53
|
+
delete(valId: string, params: FileDeleteParams, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
54
|
+
const { path, recursive, branch_id } = params;
|
|
55
|
+
return this._client.delete(`/v2/vals/${valId}/files`, {
|
|
56
|
+
query: { path, recursive, branch_id },
|
|
65
57
|
...options,
|
|
66
58
|
headers: { Accept: '*/*', ...options?.headers },
|
|
67
59
|
});
|
|
@@ -71,7 +63,7 @@ export class Files extends APIResource {
|
|
|
71
63
|
* Download file content
|
|
72
64
|
*/
|
|
73
65
|
getContent(
|
|
74
|
-
|
|
66
|
+
valId: string,
|
|
75
67
|
params: FileGetContentParams,
|
|
76
68
|
options?: Core.RequestOptions,
|
|
77
69
|
): Core.APIPromise<Response> {
|
|
@@ -83,7 +75,7 @@ export class Files extends APIResource {
|
|
|
83
75
|
'If-Unmodified-Since': ifUnmodifiedSince,
|
|
84
76
|
...query
|
|
85
77
|
} = params;
|
|
86
|
-
return this._client.get(`/
|
|
78
|
+
return this._client.get(`/v2/vals/${valId}/files/content`, {
|
|
87
79
|
query,
|
|
88
80
|
...options,
|
|
89
81
|
headers: {
|
|
@@ -115,11 +107,6 @@ export interface FileCreateResponse {
|
|
|
115
107
|
|
|
116
108
|
name: string;
|
|
117
109
|
|
|
118
|
-
/**
|
|
119
|
-
* The id of the parent resource
|
|
120
|
-
*/
|
|
121
|
-
parentId: string | null;
|
|
122
|
-
|
|
123
110
|
path: string;
|
|
124
111
|
|
|
125
112
|
type: 'directory' | 'file' | 'interval' | 'http' | 'email' | 'script';
|
|
@@ -166,11 +153,6 @@ export interface FileRetrieveResponse {
|
|
|
166
153
|
|
|
167
154
|
name: string;
|
|
168
155
|
|
|
169
|
-
/**
|
|
170
|
-
* The id of the parent resource
|
|
171
|
-
*/
|
|
172
|
-
parentId: string | null;
|
|
173
|
-
|
|
174
156
|
path: string;
|
|
175
157
|
|
|
176
158
|
type: 'directory' | 'file' | 'interval' | 'http' | 'email' | 'script';
|
|
@@ -217,11 +199,6 @@ export interface FileUpdateResponse {
|
|
|
217
199
|
|
|
218
200
|
name: string;
|
|
219
201
|
|
|
220
|
-
/**
|
|
221
|
-
* The id of the parent resource
|
|
222
|
-
*/
|
|
223
|
-
parentId: string | null;
|
|
224
|
-
|
|
225
202
|
path: string;
|
|
226
203
|
|
|
227
204
|
type: 'directory' | 'file' | 'interval' | 'http' | 'email' | 'script';
|
|
@@ -290,8 +267,8 @@ export declare namespace FileCreateParams {
|
|
|
290
267
|
path: string;
|
|
291
268
|
|
|
292
269
|
/**
|
|
293
|
-
* Body param:
|
|
294
|
-
*
|
|
270
|
+
* Body param: File and val content. An empty string will create an empty file.
|
|
271
|
+
* When creating a directory, the content should be null or undefined.
|
|
295
272
|
*/
|
|
296
273
|
content: string;
|
|
297
274
|
|
|
@@ -316,14 +293,14 @@ export interface FileRetrieveParams extends PageCursorURLParams {
|
|
|
316
293
|
path: string;
|
|
317
294
|
|
|
318
295
|
/**
|
|
319
|
-
*
|
|
296
|
+
* Whether to recursively act on all files in the project
|
|
320
297
|
*/
|
|
321
|
-
|
|
298
|
+
recursive: boolean;
|
|
322
299
|
|
|
323
300
|
/**
|
|
324
|
-
*
|
|
301
|
+
* Id to query
|
|
325
302
|
*/
|
|
326
|
-
|
|
303
|
+
branch_id?: string;
|
|
327
304
|
|
|
328
305
|
/**
|
|
329
306
|
* Specific branch version to query
|
|
@@ -345,8 +322,8 @@ export interface FileUpdateParams {
|
|
|
345
322
|
branch_id?: string;
|
|
346
323
|
|
|
347
324
|
/**
|
|
348
|
-
* Body param:
|
|
349
|
-
*
|
|
325
|
+
* Body param: File and val content. An empty string will create an empty file.
|
|
326
|
+
* When creating a directory, the content should be null or undefined.
|
|
350
327
|
*/
|
|
351
328
|
content?: string;
|
|
352
329
|
|
|
@@ -356,9 +333,10 @@ export interface FileUpdateParams {
|
|
|
356
333
|
name?: string;
|
|
357
334
|
|
|
358
335
|
/**
|
|
359
|
-
* Body param:
|
|
336
|
+
* Body param: Path to the directory you'd like to move this file to (e.g.
|
|
337
|
+
* 'folder1/folder2')
|
|
360
338
|
*/
|
|
361
|
-
|
|
339
|
+
parent_path?: string | null;
|
|
362
340
|
|
|
363
341
|
/**
|
|
364
342
|
* Body param:
|
|
@@ -374,14 +352,14 @@ export interface FileDeleteParams {
|
|
|
374
352
|
path: string;
|
|
375
353
|
|
|
376
354
|
/**
|
|
377
|
-
*
|
|
355
|
+
* Whether to recursively act on all files in the project
|
|
378
356
|
*/
|
|
379
|
-
|
|
357
|
+
recursive: boolean;
|
|
380
358
|
|
|
381
359
|
/**
|
|
382
|
-
*
|
|
360
|
+
* The specified branch of the resource. Defaults to main if not provided.
|
|
383
361
|
*/
|
|
384
|
-
|
|
362
|
+
branch_id?: string;
|
|
385
363
|
}
|
|
386
364
|
|
|
387
365
|
export interface FileGetContentParams {
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
type
|
|
7
|
-
type
|
|
8
|
-
type
|
|
9
|
-
type
|
|
10
|
-
type
|
|
11
|
-
} from './
|
|
4
|
+
BranchListResponsesPageCursorURL,
|
|
5
|
+
Branches,
|
|
6
|
+
type BranchCreateResponse,
|
|
7
|
+
type BranchRetrieveResponse,
|
|
8
|
+
type BranchListResponse,
|
|
9
|
+
type BranchCreateParams,
|
|
10
|
+
type BranchListParams,
|
|
11
|
+
} from './branches';
|
|
12
12
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
type
|
|
16
|
-
type
|
|
17
|
-
type
|
|
18
|
-
type
|
|
19
|
-
|
|
13
|
+
FileRetrieveResponsesPageCursorURL,
|
|
14
|
+
Files,
|
|
15
|
+
type FileCreateResponse,
|
|
16
|
+
type FileRetrieveResponse,
|
|
17
|
+
type FileUpdateResponse,
|
|
18
|
+
type FileCreateParams,
|
|
19
|
+
type FileRetrieveParams,
|
|
20
|
+
type FileUpdateParams,
|
|
21
|
+
type FileDeleteParams,
|
|
22
|
+
type FileGetContentParams,
|
|
23
|
+
} from './files';
|
|
24
|
+
export { Vals, type ValCreateParams, type ValListParams } from './vals';
|
|
@@ -1,229 +1,113 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../resource';
|
|
4
|
-
import { isRequestOptions } from '../../core';
|
|
5
4
|
import * as Core from '../../core';
|
|
6
5
|
import * as Shared from '../shared';
|
|
7
|
-
import
|
|
6
|
+
import { ValsPageCursorURL } from '../shared';
|
|
7
|
+
import * as BranchesAPI from './branches';
|
|
8
8
|
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
BranchCreateParams,
|
|
10
|
+
BranchCreateResponse,
|
|
11
|
+
BranchListParams,
|
|
12
|
+
BranchListResponse,
|
|
13
|
+
BranchListResponsesPageCursorURL,
|
|
14
|
+
BranchRetrieveResponse,
|
|
15
|
+
Branches,
|
|
16
|
+
} from './branches';
|
|
17
|
+
import * as FilesAPI from './files';
|
|
18
|
+
import {
|
|
19
|
+
FileCreateParams,
|
|
20
|
+
FileCreateResponse,
|
|
21
|
+
FileDeleteParams,
|
|
22
|
+
FileGetContentParams,
|
|
23
|
+
FileRetrieveParams,
|
|
24
|
+
FileRetrieveResponse,
|
|
25
|
+
FileRetrieveResponsesPageCursorURL,
|
|
26
|
+
FileUpdateParams,
|
|
27
|
+
FileUpdateResponse,
|
|
28
|
+
Files,
|
|
29
|
+
} from './files';
|
|
30
|
+
import { type PageCursorURLParams } from '../../pagination';
|
|
16
31
|
|
|
17
32
|
/**
|
|
18
|
-
* Vals are runnable JavaScript, TypeScript, and JSX modules
|
|
33
|
+
* Vals are a collaborative folder of runnable JavaScript, TypeScript, and JSX modules
|
|
19
34
|
*/
|
|
20
35
|
export class Vals extends APIResource {
|
|
21
|
-
|
|
36
|
+
branches: BranchesAPI.Branches = new BranchesAPI.Branches(this._client);
|
|
37
|
+
files: FilesAPI.Files = new FilesAPI.Files(this._client);
|
|
22
38
|
|
|
23
39
|
/**
|
|
24
40
|
* Create a new val
|
|
25
41
|
*/
|
|
26
|
-
create(body: ValCreateParams, options?: Core.RequestOptions): Core.APIPromise<Shared.
|
|
27
|
-
return this._client.post('/
|
|
42
|
+
create(body: ValCreateParams, options?: Core.RequestOptions): Core.APIPromise<Shared.Val> {
|
|
43
|
+
return this._client.post('/v2/vals', { body, ...options });
|
|
28
44
|
}
|
|
29
45
|
|
|
30
46
|
/**
|
|
31
47
|
* Get a val by id
|
|
32
48
|
*/
|
|
33
|
-
retrieve(valId: string, options?: Core.RequestOptions): Core.APIPromise<Shared.
|
|
34
|
-
return this._client.get(`/
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Update an existing val
|
|
39
|
-
*/
|
|
40
|
-
update(valId: string, body?: ValUpdateParams, options?: Core.RequestOptions): Core.APIPromise<void>;
|
|
41
|
-
update(valId: string, options?: Core.RequestOptions): Core.APIPromise<void>;
|
|
42
|
-
update(
|
|
43
|
-
valId: string,
|
|
44
|
-
body: ValUpdateParams | Core.RequestOptions = {},
|
|
45
|
-
options?: Core.RequestOptions,
|
|
46
|
-
): Core.APIPromise<void> {
|
|
47
|
-
if (isRequestOptions(body)) {
|
|
48
|
-
return this.update(valId, {}, body);
|
|
49
|
-
}
|
|
50
|
-
return this._client.put(`/v1/vals/${valId}`, {
|
|
51
|
-
body,
|
|
52
|
-
...options,
|
|
53
|
-
headers: { Accept: '*/*', ...options?.headers },
|
|
54
|
-
});
|
|
49
|
+
retrieve(valId: string, options?: Core.RequestOptions): Core.APIPromise<Shared.Val> {
|
|
50
|
+
return this._client.get(`/v2/vals/${valId}`, options);
|
|
55
51
|
}
|
|
56
52
|
|
|
57
53
|
/**
|
|
58
|
-
*
|
|
54
|
+
* Lists all public vals
|
|
59
55
|
*/
|
|
60
|
-
list(query: ValListParams, options?: Core.RequestOptions): Core.
|
|
61
|
-
return this._client.
|
|
56
|
+
list(query: ValListParams, options?: Core.RequestOptions): Core.PagePromise<ValsPageCursorURL, Shared.Val> {
|
|
57
|
+
return this._client.getAPIList('/v2/vals', ValsPageCursorURL, { query, ...options });
|
|
62
58
|
}
|
|
63
59
|
|
|
64
60
|
/**
|
|
65
|
-
* Delete a
|
|
61
|
+
* Delete a project
|
|
66
62
|
*/
|
|
67
63
|
delete(valId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
68
|
-
return this._client.delete(`/
|
|
69
|
-
...options,
|
|
70
|
-
headers: { Accept: '*/*', ...options?.headers },
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Cancel a running val
|
|
76
|
-
*/
|
|
77
|
-
cancelEvaluation(
|
|
78
|
-
valId: string,
|
|
79
|
-
evaluationId: string,
|
|
80
|
-
options?: Core.RequestOptions,
|
|
81
|
-
): Core.APIPromise<ValCancelEvaluationResponse> {
|
|
82
|
-
return this._client.post(`/v1/vals/${valId}/evaluations/${evaluationId}/cancel`, options);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Run an existing val or create a new one
|
|
87
|
-
*/
|
|
88
|
-
createOrUpdate(body: ValCreateOrUpdateParams, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
89
|
-
return this._client.put('/v1/vals', {
|
|
90
|
-
body,
|
|
64
|
+
return this._client.delete(`/v2/vals/${valId}`, {
|
|
91
65
|
...options,
|
|
92
66
|
headers: { Accept: '*/*', ...options?.headers },
|
|
93
67
|
});
|
|
94
68
|
}
|
|
95
69
|
}
|
|
96
70
|
|
|
97
|
-
/**
|
|
98
|
-
* A paginated result set
|
|
99
|
-
*/
|
|
100
|
-
export interface ValListResponse {
|
|
101
|
-
data: Array<Shared.ExtendedVal>;
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Links to use for pagination
|
|
105
|
-
*/
|
|
106
|
-
links: Shared.PaginationLinks;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* The evaluation_id was successfully searched for and the evaluation was either
|
|
111
|
-
* already done or now has been cancelled
|
|
112
|
-
*/
|
|
113
|
-
export interface ValCancelEvaluationResponse {
|
|
114
|
-
/**
|
|
115
|
-
* True if the evaluation was found and cancelled
|
|
116
|
-
*/
|
|
117
|
-
found: boolean;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
71
|
export interface ValCreateParams {
|
|
121
|
-
|
|
122
|
-
* Val source code as TypeScript
|
|
123
|
-
*/
|
|
124
|
-
code: string;
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* This val’s name
|
|
128
|
-
*/
|
|
129
|
-
name?: string;
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* This resource's privacy setting. Unlisted resources do not appear on profile
|
|
133
|
-
* pages or elsewhere, but you can link to them.
|
|
134
|
-
*/
|
|
135
|
-
privacy?: 'public' | 'unlisted' | 'private';
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Readme contents, as Markdown
|
|
139
|
-
*/
|
|
140
|
-
readme?: string;
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* The type of the val you want to create. Note that this does not include interval
|
|
144
|
-
* vals, because they cannot be created through the API yet.
|
|
145
|
-
*/
|
|
146
|
-
type?: 'httpnext' | 'http' | 'script' | 'email';
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
export interface ValUpdateParams {
|
|
150
|
-
/**
|
|
151
|
-
* This val’s name
|
|
152
|
-
*/
|
|
153
|
-
name?: string;
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* This resource's privacy setting. Unlisted resources do not appear on profile
|
|
157
|
-
* pages or elsewhere, but you can link to them.
|
|
158
|
-
*/
|
|
159
|
-
privacy?: 'public' | 'unlisted' | 'private';
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Readme contents, as Markdown
|
|
163
|
-
*/
|
|
164
|
-
readme?: string;
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* The type of the val you want to update. Note that this does not include interval
|
|
168
|
-
* vals, because they cannot be created through the API yet.
|
|
169
|
-
*/
|
|
170
|
-
type?: 'httpnext' | 'http' | 'script' | 'email';
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
export interface ValListParams {
|
|
174
|
-
/**
|
|
175
|
-
* Maximum items to return in each paginated response
|
|
176
|
-
*/
|
|
177
|
-
limit: number;
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
* Cursor to start the pagination from
|
|
181
|
-
*/
|
|
182
|
-
cursor?: string;
|
|
72
|
+
name: string;
|
|
183
73
|
|
|
184
|
-
|
|
185
|
-
* This resource's privacy setting. Unlisted resources do not appear on profile
|
|
186
|
-
* pages or elsewhere, but you can link to them.
|
|
187
|
-
*/
|
|
188
|
-
privacy?: 'public' | 'unlisted' | 'private';
|
|
74
|
+
privacy: 'public' | 'unlisted' | 'private';
|
|
189
75
|
|
|
190
|
-
|
|
191
|
-
* User ID to filter by
|
|
192
|
-
*/
|
|
193
|
-
userId?: string;
|
|
76
|
+
description?: string;
|
|
194
77
|
}
|
|
195
78
|
|
|
196
|
-
export interface
|
|
197
|
-
/**
|
|
198
|
-
* Val source code as TypeScript
|
|
199
|
-
*/
|
|
200
|
-
code: string;
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* This val’s name
|
|
204
|
-
*/
|
|
205
|
-
name: string;
|
|
206
|
-
}
|
|
79
|
+
export interface ValListParams extends PageCursorURLParams {}
|
|
207
80
|
|
|
208
|
-
Vals.
|
|
209
|
-
Vals.
|
|
81
|
+
Vals.Branches = Branches;
|
|
82
|
+
Vals.BranchListResponsesPageCursorURL = BranchListResponsesPageCursorURL;
|
|
83
|
+
Vals.Files = Files;
|
|
84
|
+
Vals.FileRetrieveResponsesPageCursorURL = FileRetrieveResponsesPageCursorURL;
|
|
210
85
|
|
|
211
86
|
export declare namespace Vals {
|
|
87
|
+
export { type ValCreateParams as ValCreateParams, type ValListParams as ValListParams };
|
|
88
|
+
|
|
212
89
|
export {
|
|
213
|
-
|
|
214
|
-
type
|
|
215
|
-
type
|
|
216
|
-
type
|
|
217
|
-
|
|
218
|
-
type
|
|
90
|
+
Branches as Branches,
|
|
91
|
+
type BranchCreateResponse as BranchCreateResponse,
|
|
92
|
+
type BranchRetrieveResponse as BranchRetrieveResponse,
|
|
93
|
+
type BranchListResponse as BranchListResponse,
|
|
94
|
+
BranchListResponsesPageCursorURL as BranchListResponsesPageCursorURL,
|
|
95
|
+
type BranchCreateParams as BranchCreateParams,
|
|
96
|
+
type BranchListParams as BranchListParams,
|
|
219
97
|
};
|
|
220
98
|
|
|
221
99
|
export {
|
|
222
|
-
|
|
223
|
-
type
|
|
224
|
-
|
|
225
|
-
type
|
|
226
|
-
|
|
227
|
-
type
|
|
100
|
+
Files as Files,
|
|
101
|
+
type FileCreateResponse as FileCreateResponse,
|
|
102
|
+
type FileRetrieveResponse as FileRetrieveResponse,
|
|
103
|
+
type FileUpdateResponse as FileUpdateResponse,
|
|
104
|
+
FileRetrieveResponsesPageCursorURL as FileRetrieveResponsesPageCursorURL,
|
|
105
|
+
type FileCreateParams as FileCreateParams,
|
|
106
|
+
type FileRetrieveParams as FileRetrieveParams,
|
|
107
|
+
type FileUpdateParams as FileUpdateParams,
|
|
108
|
+
type FileDeleteParams as FileDeleteParams,
|
|
109
|
+
type FileGetContentParams as FileGetContentParams,
|
|
228
110
|
};
|
|
229
111
|
}
|
|
112
|
+
|
|
113
|
+
export { ValsPageCursorURL };
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '1.0.0'; // x-release-please-version
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "1.0.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
|
package/version.js
CHANGED
package/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}
|
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '1.0.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|
package/version.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}
|