@valtown/sdk 1.1.0 → 1.2.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 +18 -0
- package/index.d.mts +2 -2
- package/index.d.ts +2 -2
- package/index.d.ts.map +1 -1
- package/index.js.map +1 -1
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/alias/username/username.d.ts +7 -0
- package/resources/alias/username/username.d.ts.map +1 -1
- package/resources/alias/username/username.js +7 -0
- package/resources/alias/username/username.js.map +1 -1
- package/resources/alias/username/username.mjs +7 -0
- package/resources/alias/username/username.mjs.map +1 -1
- package/resources/alias/username/val-name.d.ts +8 -0
- package/resources/alias/username/val-name.d.ts.map +1 -1
- package/resources/alias/username/val-name.js +8 -0
- package/resources/alias/username/val-name.js.map +1 -1
- package/resources/alias/username/val-name.mjs +8 -0
- package/resources/alias/username/val-name.mjs.map +1 -1
- package/resources/emails.d.ts +9 -0
- package/resources/emails.d.ts.map +1 -1
- package/resources/emails.js.map +1 -1
- package/resources/emails.mjs.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/sqlite.d.ts +15 -0
- package/resources/sqlite.d.ts.map +1 -1
- package/resources/sqlite.js +15 -0
- package/resources/sqlite.js.map +1 -1
- package/resources/sqlite.mjs +15 -0
- package/resources/sqlite.mjs.map +1 -1
- package/resources/users.d.ts +7 -0
- package/resources/users.d.ts.map +1 -1
- package/resources/users.js +7 -0
- package/resources/users.js.map +1 -1
- package/resources/users.mjs +7 -0
- package/resources/users.mjs.map +1 -1
- package/resources/vals/branches.d.ts +38 -0
- package/resources/vals/branches.d.ts.map +1 -1
- package/resources/vals/branches.js +38 -0
- package/resources/vals/branches.js.map +1 -1
- package/resources/vals/branches.mjs +38 -0
- package/resources/vals/branches.mjs.map +1 -1
- package/resources/vals/files.d.ts +46 -0
- package/resources/vals/files.d.ts.map +1 -1
- package/resources/vals/files.js +46 -0
- package/resources/vals/files.js.map +1 -1
- package/resources/vals/files.mjs +46 -0
- package/resources/vals/files.mjs.map +1 -1
- package/resources/vals/index.d.ts +1 -1
- package/resources/vals/index.d.ts.map +1 -1
- package/resources/vals/index.js.map +1 -1
- package/resources/vals/index.mjs.map +1 -1
- package/resources/vals/vals.d.ts +59 -7
- package/resources/vals/vals.d.ts.map +1 -1
- package/resources/vals/vals.js +31 -5
- package/resources/vals/vals.js.map +1 -1
- package/resources/vals/vals.mjs +30 -4
- package/resources/vals/vals.mjs.map +1 -1
- package/src/index.ts +7 -2
- package/src/resources/alias/username/username.ts +7 -0
- package/src/resources/alias/username/val-name.ts +8 -0
- package/src/resources/emails.ts +9 -0
- package/src/resources/index.ts +1 -1
- package/src/resources/sqlite.ts +15 -0
- package/src/resources/users.ts +7 -0
- package/src/resources/vals/branches.ts +38 -0
- package/src/resources/vals/files.ts +46 -0
- package/src/resources/vals/index.ts +1 -1
- package/src/resources/vals/vals.ts +70 -9
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/resources/vals/vals.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../../resource.mjs";
|
|
3
|
-
import { ValsPageCursorURL } from "../shared.mjs";
|
|
4
3
|
import * as BranchesAPI from "./branches.mjs";
|
|
5
4
|
import { BranchListResponsesPageCursorURL, Branches, } from "./branches.mjs";
|
|
6
5
|
import * as FilesAPI from "./files.mjs";
|
|
@@ -16,24 +15,52 @@ export class Vals extends APIResource {
|
|
|
16
15
|
}
|
|
17
16
|
/**
|
|
18
17
|
* Create a new val
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```ts
|
|
21
|
+
* const val = await client.vals.create({
|
|
22
|
+
* name: 'myVal',
|
|
23
|
+
* privacy: 'public',
|
|
24
|
+
* description: 'My val',
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
19
27
|
*/
|
|
20
28
|
create(body, options) {
|
|
21
29
|
return this._client.post('/v2/vals', { body, ...options });
|
|
22
30
|
}
|
|
23
31
|
/**
|
|
24
32
|
* Get a val by id
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* const val = await client.vals.retrieve(
|
|
37
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
38
|
+
* );
|
|
39
|
+
* ```
|
|
25
40
|
*/
|
|
26
41
|
retrieve(valId, options) {
|
|
27
42
|
return this._client.get(`/v2/vals/${valId}`, options);
|
|
28
43
|
}
|
|
29
44
|
/**
|
|
30
|
-
* Lists all public vals
|
|
45
|
+
* Lists all vals including all public vals and your unlisted and private vals
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const vals = await client.vals.list({ limit: 1 });
|
|
50
|
+
* ```
|
|
31
51
|
*/
|
|
32
52
|
list(query, options) {
|
|
33
|
-
return this._client.
|
|
53
|
+
return this._client.get('/v2/vals', { query, ...options });
|
|
34
54
|
}
|
|
35
55
|
/**
|
|
36
56
|
* Delete a project
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* await client.vals.delete(
|
|
61
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
62
|
+
* );
|
|
63
|
+
* ```
|
|
37
64
|
*/
|
|
38
65
|
delete(valId, options) {
|
|
39
66
|
return this._client.delete(`/v2/vals/${valId}`, {
|
|
@@ -46,5 +73,4 @@ Vals.Branches = Branches;
|
|
|
46
73
|
Vals.BranchListResponsesPageCursorURL = BranchListResponsesPageCursorURL;
|
|
47
74
|
Vals.Files = Files;
|
|
48
75
|
Vals.FileRetrieveResponsesPageCursorURL = FileRetrieveResponsesPageCursorURL;
|
|
49
|
-
export { ValsPageCursorURL };
|
|
50
76
|
//# sourceMappingURL=vals.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vals.mjs","sourceRoot":"","sources":["../../src/resources/vals/vals.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,
|
|
1
|
+
{"version":3,"file":"vals.mjs","sourceRoot":"","sources":["../../src/resources/vals/vals.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,KAAK,WAAW;OAChB,EAKL,gCAAgC,EAEhC,QAAQ,GACT;OACM,KAAK,QAAQ;OACb,EAOL,kCAAkC,EAGlC,KAAK,GACN;AAED;;GAEG;AACH,MAAM,OAAO,IAAK,SAAQ,WAAW;IAArC;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxE,UAAK,GAAmB,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IA4D3D,CAAC;IA1DC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAAqB,EAAE,OAA6B;QACzD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;;;;OASG;IACH,QAAQ,CAAC,KAAa,EAAE,OAA6B;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;IAED;;;;;;;OAOG;IACH,IAAI,CAAC,KAAoB,EAAE,OAA6B;QACtD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,KAAa,EAAE,OAA6B;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,KAAK,EAAE,EAAE;YAC9C,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE;SAChD,CAAC,CAAC;IACL,CAAC;CACF;AA6CD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;AACzB,IAAI,CAAC,gCAAgC,GAAG,gCAAgC,CAAC;AACzE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;AACnB,IAAI,CAAC,kCAAkC,GAAG,kCAAkC,CAAC"}
|
package/src/index.ts
CHANGED
|
@@ -14,7 +14,7 @@ import { Users } from './resources/users';
|
|
|
14
14
|
import { Alias } from './resources/alias/alias';
|
|
15
15
|
import { Me } from './resources/me/me';
|
|
16
16
|
import { Search } from './resources/search/search';
|
|
17
|
-
import { ValCreateParams, ValListParams, Vals } from './resources/vals/vals';
|
|
17
|
+
import { ValCreateParams, ValListParams, ValListResponse, Vals } from './resources/vals/vals';
|
|
18
18
|
|
|
19
19
|
export interface ClientOptions {
|
|
20
20
|
/**
|
|
@@ -237,7 +237,12 @@ export declare namespace ValTown {
|
|
|
237
237
|
type SqliteExecuteParams as SqliteExecuteParams,
|
|
238
238
|
};
|
|
239
239
|
|
|
240
|
-
export {
|
|
240
|
+
export {
|
|
241
|
+
Vals as Vals,
|
|
242
|
+
type ValListResponse as ValListResponse,
|
|
243
|
+
type ValCreateParams as ValCreateParams,
|
|
244
|
+
type ValListParams as ValListParams,
|
|
245
|
+
};
|
|
241
246
|
|
|
242
247
|
export {
|
|
243
248
|
Emails as Emails,
|
|
@@ -11,6 +11,13 @@ export class Username extends APIResource {
|
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Get basic details about a user, given their username
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const user = await client.alias.username.retrieve(
|
|
18
|
+
* 'username',
|
|
19
|
+
* );
|
|
20
|
+
* ```
|
|
14
21
|
*/
|
|
15
22
|
retrieve(username: string, options?: Core.RequestOptions): Core.APIPromise<Shared.User> {
|
|
16
23
|
return this._client.get(`/v1/alias/${username}`, options);
|
|
@@ -7,6 +7,14 @@ import * as Shared from '../../shared';
|
|
|
7
7
|
export class ValName extends APIResource {
|
|
8
8
|
/**
|
|
9
9
|
* Get a val
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const val = await client.alias.username.valName.retrieve(
|
|
14
|
+
* 'username',
|
|
15
|
+
* 'val_name',
|
|
16
|
+
* );
|
|
17
|
+
* ```
|
|
10
18
|
*/
|
|
11
19
|
retrieve(username: string, valName: string, options?: Core.RequestOptions): Core.APIPromise<Shared.Val> {
|
|
12
20
|
return this._client.get(`/v2/alias/vals/${username}/${valName}`, options);
|
package/src/resources/emails.ts
CHANGED
|
@@ -10,6 +10,15 @@ import * as Core from '../core';
|
|
|
10
10
|
export class Emails extends APIResource {
|
|
11
11
|
/**
|
|
12
12
|
* Send emails
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const response = await client.emails.send({
|
|
17
|
+
* html: 'Hello <strong>world</strong>',
|
|
18
|
+
* subject: 'An important message',
|
|
19
|
+
* text: 'Hello world',
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
13
22
|
*/
|
|
14
23
|
send(body?: EmailSendParams, options?: Core.RequestOptions): Core.APIPromise<EmailSendResponse>;
|
|
15
24
|
send(options?: Core.RequestOptions): Core.APIPromise<EmailSendResponse>;
|
package/src/resources/index.ts
CHANGED
|
@@ -8,4 +8,4 @@ export { Me } from './me/me';
|
|
|
8
8
|
export { Search } from './search/search';
|
|
9
9
|
export { Sqlite, type SqliteBatchResponse, type SqliteBatchParams, type SqliteExecuteParams } from './sqlite';
|
|
10
10
|
export { Users } from './users';
|
|
11
|
-
export { Vals, type ValCreateParams, type ValListParams } from './vals/vals';
|
|
11
|
+
export { Vals, type ValListResponse, type ValCreateParams, type ValListParams } from './vals/vals';
|
package/src/resources/sqlite.ts
CHANGED
|
@@ -10,6 +10,14 @@ import * as Shared from './shared';
|
|
|
10
10
|
export class Sqlite extends APIResource {
|
|
11
11
|
/**
|
|
12
12
|
* Execute a batch of SQLite statements and return results for all of them
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const resultSets = await client.sqlite.batch({
|
|
17
|
+
* statements: ['SELECT 1;'],
|
|
18
|
+
* mode: 'read',
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
13
21
|
*/
|
|
14
22
|
batch(body: SqliteBatchParams, options?: Core.RequestOptions): Core.APIPromise<SqliteBatchResponse> {
|
|
15
23
|
return this._client.post('/v1/sqlite/batch', { body, ...options });
|
|
@@ -17,6 +25,13 @@ export class Sqlite extends APIResource {
|
|
|
17
25
|
|
|
18
26
|
/**
|
|
19
27
|
* Execute a single SQLite statement and return results
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const resultSet = await client.sqlite.execute({
|
|
32
|
+
* statement: 'SELECT 1;',
|
|
33
|
+
* });
|
|
34
|
+
* ```
|
|
20
35
|
*/
|
|
21
36
|
execute(body: SqliteExecuteParams, options?: Core.RequestOptions): Core.APIPromise<Shared.ResultSet> {
|
|
22
37
|
return this._client.post('/v1/sqlite/execute', { body, ...options });
|
package/src/resources/users.ts
CHANGED
|
@@ -10,6 +10,13 @@ import * as Shared from './shared';
|
|
|
10
10
|
export class Users extends APIResource {
|
|
11
11
|
/**
|
|
12
12
|
* Get basic information about a user
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const user = await client.users.retrieve(
|
|
17
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
18
|
+
* );
|
|
19
|
+
* ```
|
|
13
20
|
*/
|
|
14
21
|
retrieve(userId: string, options?: Core.RequestOptions): Core.APIPromise<Shared.User> {
|
|
15
22
|
return this._client.get(`/v1/users/${userId}`, options);
|
|
@@ -7,6 +7,17 @@ import { PageCursorURL, type PageCursorURLParams } from '../../pagination';
|
|
|
7
7
|
export class Branches extends APIResource {
|
|
8
8
|
/**
|
|
9
9
|
* Create a new branch
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const branch = await client.vals.branches.create(
|
|
14
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
15
|
+
* {
|
|
16
|
+
* name: 'my-branch',
|
|
17
|
+
* branchId: '00000000-0000-0000-0000-000000000000',
|
|
18
|
+
* },
|
|
19
|
+
* );
|
|
20
|
+
* ```
|
|
10
21
|
*/
|
|
11
22
|
create(
|
|
12
23
|
valId: string,
|
|
@@ -18,6 +29,14 @@ export class Branches extends APIResource {
|
|
|
18
29
|
|
|
19
30
|
/**
|
|
20
31
|
* Get a branch by id
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const branch = await client.vals.branches.retrieve(
|
|
36
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
37
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
38
|
+
* );
|
|
39
|
+
* ```
|
|
21
40
|
*/
|
|
22
41
|
retrieve(
|
|
23
42
|
valId: string,
|
|
@@ -29,6 +48,17 @@ export class Branches extends APIResource {
|
|
|
29
48
|
|
|
30
49
|
/**
|
|
31
50
|
* List all branches for a val
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* // Automatically fetches more pages as needed.
|
|
55
|
+
* for await (const branchListResponse of client.vals.branches.list(
|
|
56
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
57
|
+
* { limit: 1, offset: 0 },
|
|
58
|
+
* )) {
|
|
59
|
+
* // ...
|
|
60
|
+
* }
|
|
61
|
+
* ```
|
|
32
62
|
*/
|
|
33
63
|
list(
|
|
34
64
|
valId: string,
|
|
@@ -43,6 +73,14 @@ export class Branches extends APIResource {
|
|
|
43
73
|
|
|
44
74
|
/**
|
|
45
75
|
* Delete a branch
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* await client.vals.branches.delete(
|
|
80
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
81
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
82
|
+
* );
|
|
83
|
+
* ```
|
|
46
84
|
*/
|
|
47
85
|
delete(valId: string, branchId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
48
86
|
return this._client.delete(`/v2/vals/${valId}/branches/${branchId}`, {
|
|
@@ -8,6 +8,14 @@ import { type Response } from '../../_shims/index';
|
|
|
8
8
|
export class Files extends APIResource {
|
|
9
9
|
/**
|
|
10
10
|
* Create a new file, project val or directory
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const file = await client.vals.files.create(
|
|
15
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
16
|
+
* { path: 'path', type: 'directory' },
|
|
17
|
+
* );
|
|
18
|
+
* ```
|
|
11
19
|
*/
|
|
12
20
|
create(
|
|
13
21
|
valId: string,
|
|
@@ -21,6 +29,17 @@ export class Files extends APIResource {
|
|
|
21
29
|
/**
|
|
22
30
|
* Get metadata for files and directories in a val. If path is an empty string,
|
|
23
31
|
* returns files at the root directory.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* // Automatically fetches more pages as needed.
|
|
36
|
+
* for await (const fileRetrieveResponse of client.vals.files.retrieve(
|
|
37
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
38
|
+
* { limit: 1, offset: 0, path: 'path', recursive: true },
|
|
39
|
+
* )) {
|
|
40
|
+
* // ...
|
|
41
|
+
* }
|
|
42
|
+
* ```
|
|
24
43
|
*/
|
|
25
44
|
retrieve(
|
|
26
45
|
valId: string,
|
|
@@ -35,6 +54,14 @@ export class Files extends APIResource {
|
|
|
35
54
|
|
|
36
55
|
/**
|
|
37
56
|
* Update a file's content
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const file = await client.vals.files.update(
|
|
61
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
62
|
+
* { path: 'path' },
|
|
63
|
+
* );
|
|
64
|
+
* ```
|
|
38
65
|
*/
|
|
39
66
|
update(
|
|
40
67
|
valId: string,
|
|
@@ -49,6 +76,14 @@ export class Files extends APIResource {
|
|
|
49
76
|
* Deletes a file or a directory. To delete a directory and all of its children,
|
|
50
77
|
* use the recursive flag. To delete all files, pass in an empty path and the
|
|
51
78
|
* recursive flag.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```ts
|
|
82
|
+
* await client.vals.files.delete(
|
|
83
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
84
|
+
* { path: 'path', recursive: true },
|
|
85
|
+
* );
|
|
86
|
+
* ```
|
|
52
87
|
*/
|
|
53
88
|
delete(valId: string, params: FileDeleteParams, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
54
89
|
const { path, recursive, branch_id } = params;
|
|
@@ -61,6 +96,17 @@ export class Files extends APIResource {
|
|
|
61
96
|
|
|
62
97
|
/**
|
|
63
98
|
* Download file content
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```ts
|
|
102
|
+
* const response = await client.vals.files.getContent(
|
|
103
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
104
|
+
* { path: 'path' },
|
|
105
|
+
* );
|
|
106
|
+
*
|
|
107
|
+
* const content = await response.blob();
|
|
108
|
+
* console.log(content);
|
|
109
|
+
* ```
|
|
64
110
|
*/
|
|
65
111
|
getContent(
|
|
66
112
|
valId: string,
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import { APIResource } from '../../resource';
|
|
4
4
|
import * as Core from '../../core';
|
|
5
5
|
import * as Shared from '../shared';
|
|
6
|
-
import { ValsPageCursorURL } from '../shared';
|
|
7
6
|
import * as BranchesAPI from './branches';
|
|
8
7
|
import {
|
|
9
8
|
BranchCreateParams,
|
|
@@ -27,7 +26,6 @@ import {
|
|
|
27
26
|
FileUpdateResponse,
|
|
28
27
|
Files,
|
|
29
28
|
} from './files';
|
|
30
|
-
import { type PageCursorURLParams } from '../../pagination';
|
|
31
29
|
|
|
32
30
|
/**
|
|
33
31
|
* Vals are a collaborative folder of runnable JavaScript, TypeScript, and JSX modules
|
|
@@ -38,6 +36,15 @@ export class Vals extends APIResource {
|
|
|
38
36
|
|
|
39
37
|
/**
|
|
40
38
|
* Create a new val
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* const val = await client.vals.create({
|
|
43
|
+
* name: 'myVal',
|
|
44
|
+
* privacy: 'public',
|
|
45
|
+
* description: 'My val',
|
|
46
|
+
* });
|
|
47
|
+
* ```
|
|
41
48
|
*/
|
|
42
49
|
create(body: ValCreateParams, options?: Core.RequestOptions): Core.APIPromise<Shared.Val> {
|
|
43
50
|
return this._client.post('/v2/vals', { body, ...options });
|
|
@@ -45,20 +52,39 @@ export class Vals extends APIResource {
|
|
|
45
52
|
|
|
46
53
|
/**
|
|
47
54
|
* Get a val by id
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* const val = await client.vals.retrieve(
|
|
59
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
60
|
+
* );
|
|
61
|
+
* ```
|
|
48
62
|
*/
|
|
49
63
|
retrieve(valId: string, options?: Core.RequestOptions): Core.APIPromise<Shared.Val> {
|
|
50
64
|
return this._client.get(`/v2/vals/${valId}`, options);
|
|
51
65
|
}
|
|
52
66
|
|
|
53
67
|
/**
|
|
54
|
-
* Lists all public vals
|
|
68
|
+
* Lists all vals including all public vals and your unlisted and private vals
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```ts
|
|
72
|
+
* const vals = await client.vals.list({ limit: 1 });
|
|
73
|
+
* ```
|
|
55
74
|
*/
|
|
56
|
-
list(query: ValListParams, options?: Core.RequestOptions): Core.
|
|
57
|
-
return this._client.
|
|
75
|
+
list(query: ValListParams, options?: Core.RequestOptions): Core.APIPromise<ValListResponse> {
|
|
76
|
+
return this._client.get('/v2/vals', { query, ...options });
|
|
58
77
|
}
|
|
59
78
|
|
|
60
79
|
/**
|
|
61
80
|
* Delete a project
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* await client.vals.delete(
|
|
85
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
86
|
+
* );
|
|
87
|
+
* ```
|
|
62
88
|
*/
|
|
63
89
|
delete(valId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
|
|
64
90
|
return this._client.delete(`/v2/vals/${valId}`, {
|
|
@@ -68,6 +94,18 @@ export class Vals extends APIResource {
|
|
|
68
94
|
}
|
|
69
95
|
}
|
|
70
96
|
|
|
97
|
+
/**
|
|
98
|
+
* A paginated result set
|
|
99
|
+
*/
|
|
100
|
+
export interface ValListResponse {
|
|
101
|
+
data: Array<Shared.Val>;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Links to use for pagination
|
|
105
|
+
*/
|
|
106
|
+
links: Shared.PaginationLinks;
|
|
107
|
+
}
|
|
108
|
+
|
|
71
109
|
export interface ValCreateParams {
|
|
72
110
|
name: string;
|
|
73
111
|
|
|
@@ -76,7 +114,28 @@ export interface ValCreateParams {
|
|
|
76
114
|
description?: string;
|
|
77
115
|
}
|
|
78
116
|
|
|
79
|
-
export interface ValListParams
|
|
117
|
+
export interface ValListParams {
|
|
118
|
+
/**
|
|
119
|
+
* Maximum items to return in each paginated response
|
|
120
|
+
*/
|
|
121
|
+
limit: number;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Cursor to start the pagination from
|
|
125
|
+
*/
|
|
126
|
+
cursor?: string;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* This resource's privacy setting. Unlisted resources do not appear on profile
|
|
130
|
+
* pages or elsewhere, but you can link to them.
|
|
131
|
+
*/
|
|
132
|
+
privacy?: 'public' | 'unlisted' | 'private';
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* User ID to filter by
|
|
136
|
+
*/
|
|
137
|
+
user_id?: string;
|
|
138
|
+
}
|
|
80
139
|
|
|
81
140
|
Vals.Branches = Branches;
|
|
82
141
|
Vals.BranchListResponsesPageCursorURL = BranchListResponsesPageCursorURL;
|
|
@@ -84,7 +143,11 @@ Vals.Files = Files;
|
|
|
84
143
|
Vals.FileRetrieveResponsesPageCursorURL = FileRetrieveResponsesPageCursorURL;
|
|
85
144
|
|
|
86
145
|
export declare namespace Vals {
|
|
87
|
-
export {
|
|
146
|
+
export {
|
|
147
|
+
type ValListResponse as ValListResponse,
|
|
148
|
+
type ValCreateParams as ValCreateParams,
|
|
149
|
+
type ValListParams as ValListParams,
|
|
150
|
+
};
|
|
88
151
|
|
|
89
152
|
export {
|
|
90
153
|
Branches as Branches,
|
|
@@ -109,5 +172,3 @@ export declare namespace Vals {
|
|
|
109
172
|
type FileGetContentParams as FileGetContentParams,
|
|
110
173
|
};
|
|
111
174
|
}
|
|
112
|
-
|
|
113
|
-
export { ValsPageCursorURL };
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '1.
|
|
1
|
+
export const VERSION = '1.2.0'; // x-release-please-version
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.2.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '1.
|
|
1
|
+
export const VERSION = '1.2.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|