@valtown/sdk 0.32.0 → 0.34.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/package.json +1 -1
- package/resources/projects/files.d.ts +157 -4
- package/resources/projects/files.d.ts.map +1 -1
- package/resources/projects/files.js +24 -2
- package/resources/projects/files.js.map +1 -1
- package/resources/projects/files.mjs +24 -2
- package/resources/projects/files.mjs.map +1 -1
- package/resources/projects/index.d.ts +1 -1
- package/resources/projects/index.d.ts.map +1 -1
- package/resources/projects/index.js.map +1 -1
- package/resources/projects/index.mjs.map +1 -1
- package/resources/projects/projects.d.ts +2 -2
- package/resources/projects/projects.d.ts.map +1 -1
- package/resources/projects/projects.js.map +1 -1
- package/resources/projects/projects.mjs.map +1 -1
- package/src/resources/projects/files.ts +238 -8
- package/src/resources/projects/index.ts +5 -1
- package/src/resources/projects/projects.ts +10 -2
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.34.0 (2025-03-10)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.33.0...v0.34.0](https://github.com/val-town/sdk/compare/v0.33.0...v0.34.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** api update ([#520](https://github.com/val-town/sdk/issues/520)) ([05738af](https://github.com/val-town/sdk/commit/05738affbfabccffbc852437ac022acf001cd60c))
|
|
10
|
+
* **api:** api update ([#522](https://github.com/val-town/sdk/issues/522)) ([ddc863b](https://github.com/val-town/sdk/commit/ddc863b7eef9cea5e3d321fcfb7bb589c1ead86d))
|
|
11
|
+
|
|
12
|
+
## 0.33.0 (2025-03-05)
|
|
13
|
+
|
|
14
|
+
Full Changelog: [v0.32.0...v0.33.0](https://github.com/val-town/sdk/compare/v0.32.0...v0.33.0)
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* **api:** api update ([#516](https://github.com/val-town/sdk/issues/516)) ([dcb4323](https://github.com/val-town/sdk/commit/dcb43232442ca0235309808436ef038c1b0a5f23))
|
|
19
|
+
* **api:** api update ([#518](https://github.com/val-town/sdk/issues/518)) ([b51b467](https://github.com/val-town/sdk/commit/b51b4670a45e3baec2b10154dd7605e1be7268e2))
|
|
20
|
+
|
|
3
21
|
## 0.32.0 (2025-03-03)
|
|
4
22
|
|
|
5
23
|
Full Changelog: [v0.31.0...v0.32.0](https://github.com/val-town/sdk/compare/v0.31.0...v0.32.0)
|
package/package.json
CHANGED
|
@@ -4,10 +4,19 @@ import * as Shared from "../shared.js";
|
|
|
4
4
|
import { PageCursorURL, type PageCursorURLParams } from "../../pagination.js";
|
|
5
5
|
import { type Response } from "../../_shims/index.js";
|
|
6
6
|
export declare class Files extends APIResource {
|
|
7
|
+
/**
|
|
8
|
+
* [BETA] Create a new file, project val or directory
|
|
9
|
+
*/
|
|
10
|
+
create(projectId: string, path: string, params: FileCreateParams, options?: Core.RequestOptions): Core.APIPromise<FileCreateResponse>;
|
|
7
11
|
/**
|
|
8
12
|
* Get metadata for files and directories in a project at the specified path
|
|
9
13
|
*/
|
|
10
14
|
retrieve(projectId: string, path: string, query: FileRetrieveParams, options?: Core.RequestOptions): Core.APIPromise<FileRetrieveResponse>;
|
|
15
|
+
/**
|
|
16
|
+
* [BETA] Update a file's content
|
|
17
|
+
*/
|
|
18
|
+
update(projectId: string, path: string, params?: FileUpdateParams, options?: Core.RequestOptions): Core.APIPromise<FileUpdateResponse>;
|
|
19
|
+
update(projectId: string, path: string, options?: Core.RequestOptions): Core.APIPromise<FileUpdateResponse>;
|
|
11
20
|
/**
|
|
12
21
|
* Get metadata for files and directories in a project at the root directory
|
|
13
22
|
*/
|
|
@@ -15,11 +24,50 @@ export declare class Files extends APIResource {
|
|
|
15
24
|
/**
|
|
16
25
|
* Download file content
|
|
17
26
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
27
|
+
getContent(projectId: string, path: string, params?: FileGetContentParams, options?: Core.RequestOptions): Core.APIPromise<Response>;
|
|
28
|
+
getContent(projectId: string, path: string, options?: Core.RequestOptions): Core.APIPromise<Response>;
|
|
20
29
|
}
|
|
21
30
|
export declare class FileListResponsesPageCursorURL extends PageCursorURL<FileListResponse> {
|
|
22
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* A File or Directory's Metadata
|
|
34
|
+
*/
|
|
35
|
+
export interface FileCreateResponse {
|
|
36
|
+
/**
|
|
37
|
+
* The id of the resource
|
|
38
|
+
*/
|
|
39
|
+
id: string;
|
|
40
|
+
links: FileCreateResponse.Links;
|
|
41
|
+
name: string;
|
|
42
|
+
/**
|
|
43
|
+
* The id of the parent resource
|
|
44
|
+
*/
|
|
45
|
+
parentId: string | null;
|
|
46
|
+
path: string;
|
|
47
|
+
type: 'directory' | 'file' | 'interval' | 'http' | 'email' | 'script';
|
|
48
|
+
updatedAt: string;
|
|
49
|
+
version: number;
|
|
50
|
+
}
|
|
51
|
+
export declare namespace FileCreateResponse {
|
|
52
|
+
interface Links {
|
|
53
|
+
/**
|
|
54
|
+
* The URL of this resource on Val Town
|
|
55
|
+
*/
|
|
56
|
+
html: string;
|
|
57
|
+
/**
|
|
58
|
+
* The URL of this resource's source code as a module
|
|
59
|
+
*/
|
|
60
|
+
module: string;
|
|
61
|
+
/**
|
|
62
|
+
* The URL of this resource on this API
|
|
63
|
+
*/
|
|
64
|
+
self: string;
|
|
65
|
+
/**
|
|
66
|
+
* This resource's web endpoint, where it serves a website or API
|
|
67
|
+
*/
|
|
68
|
+
endpoint?: string;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
23
71
|
/**
|
|
24
72
|
* A paginated result set
|
|
25
73
|
*/
|
|
@@ -41,6 +89,10 @@ export declare namespace FileRetrieveResponse {
|
|
|
41
89
|
id: string;
|
|
42
90
|
links: Data.Links;
|
|
43
91
|
name: string;
|
|
92
|
+
/**
|
|
93
|
+
* The id of the parent resource
|
|
94
|
+
*/
|
|
95
|
+
parentId: string | null;
|
|
44
96
|
path: string;
|
|
45
97
|
type: 'directory' | 'file' | 'interval' | 'http' | 'email' | 'script';
|
|
46
98
|
updatedAt: string;
|
|
@@ -67,6 +119,45 @@ export declare namespace FileRetrieveResponse {
|
|
|
67
119
|
}
|
|
68
120
|
}
|
|
69
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* A File or Directory's Metadata
|
|
124
|
+
*/
|
|
125
|
+
export interface FileUpdateResponse {
|
|
126
|
+
/**
|
|
127
|
+
* The id of the resource
|
|
128
|
+
*/
|
|
129
|
+
id: string;
|
|
130
|
+
links: FileUpdateResponse.Links;
|
|
131
|
+
name: string;
|
|
132
|
+
/**
|
|
133
|
+
* The id of the parent resource
|
|
134
|
+
*/
|
|
135
|
+
parentId: string | null;
|
|
136
|
+
path: string;
|
|
137
|
+
type: 'directory' | 'file' | 'interval' | 'http' | 'email' | 'script';
|
|
138
|
+
updatedAt: string;
|
|
139
|
+
version: number;
|
|
140
|
+
}
|
|
141
|
+
export declare namespace FileUpdateResponse {
|
|
142
|
+
interface Links {
|
|
143
|
+
/**
|
|
144
|
+
* The URL of this resource on Val Town
|
|
145
|
+
*/
|
|
146
|
+
html: string;
|
|
147
|
+
/**
|
|
148
|
+
* The URL of this resource's source code as a module
|
|
149
|
+
*/
|
|
150
|
+
module: string;
|
|
151
|
+
/**
|
|
152
|
+
* The URL of this resource on this API
|
|
153
|
+
*/
|
|
154
|
+
self: string;
|
|
155
|
+
/**
|
|
156
|
+
* This resource's web endpoint, where it serves a website or API
|
|
157
|
+
*/
|
|
158
|
+
endpoint?: string;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
70
161
|
/**
|
|
71
162
|
* A File or Directory's Metadata
|
|
72
163
|
*/
|
|
@@ -77,6 +168,10 @@ export interface FileListResponse {
|
|
|
77
168
|
id: string;
|
|
78
169
|
links: FileListResponse.Links;
|
|
79
170
|
name: string;
|
|
171
|
+
/**
|
|
172
|
+
* The id of the parent resource
|
|
173
|
+
*/
|
|
174
|
+
parentId: string | null;
|
|
80
175
|
path: string;
|
|
81
176
|
type: 'directory' | 'file' | 'interval' | 'http' | 'email' | 'script';
|
|
82
177
|
updatedAt: string;
|
|
@@ -102,6 +197,40 @@ export declare namespace FileListResponse {
|
|
|
102
197
|
endpoint?: string;
|
|
103
198
|
}
|
|
104
199
|
}
|
|
200
|
+
export type FileCreateParams = FileCreateParams.Variant0 | FileCreateParams.Variant1;
|
|
201
|
+
export declare namespace FileCreateParams {
|
|
202
|
+
interface Variant0 {
|
|
203
|
+
/**
|
|
204
|
+
* Body param:
|
|
205
|
+
*/
|
|
206
|
+
type: 'directory';
|
|
207
|
+
/**
|
|
208
|
+
* Query param: The specified branch of the resource. Defaults to main if not
|
|
209
|
+
* provided.
|
|
210
|
+
*/
|
|
211
|
+
branch_id?: string;
|
|
212
|
+
/**
|
|
213
|
+
* Body param:
|
|
214
|
+
*/
|
|
215
|
+
content?: null;
|
|
216
|
+
}
|
|
217
|
+
interface Variant1 {
|
|
218
|
+
/**
|
|
219
|
+
* Body param: Project file and val content. An empty string will create an empty
|
|
220
|
+
* file. When creating a directory, the content should be null or undefined.
|
|
221
|
+
*/
|
|
222
|
+
content: string;
|
|
223
|
+
/**
|
|
224
|
+
* Body param:
|
|
225
|
+
*/
|
|
226
|
+
type: 'file' | 'interval' | 'http' | 'email' | 'script';
|
|
227
|
+
/**
|
|
228
|
+
* Query param: The specified branch of the resource. Defaults to main if not
|
|
229
|
+
* provided.
|
|
230
|
+
*/
|
|
231
|
+
branch_id?: string;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
105
234
|
export interface FileRetrieveParams {
|
|
106
235
|
/**
|
|
107
236
|
* Maximum items to return in each paginated response
|
|
@@ -120,6 +249,30 @@ export interface FileRetrieveParams {
|
|
|
120
249
|
*/
|
|
121
250
|
version?: number;
|
|
122
251
|
}
|
|
252
|
+
export interface FileUpdateParams {
|
|
253
|
+
/**
|
|
254
|
+
* Query param: The specified branch of the resource. Defaults to main if not
|
|
255
|
+
* provided.
|
|
256
|
+
*/
|
|
257
|
+
branch_id?: string;
|
|
258
|
+
/**
|
|
259
|
+
* Body param: Project file and val content. An empty string will create an empty
|
|
260
|
+
* file. When creating a directory, the content should be null or undefined.
|
|
261
|
+
*/
|
|
262
|
+
content?: string;
|
|
263
|
+
/**
|
|
264
|
+
* Body param:
|
|
265
|
+
*/
|
|
266
|
+
name?: string;
|
|
267
|
+
/**
|
|
268
|
+
* Body param: Id of the parent directory
|
|
269
|
+
*/
|
|
270
|
+
parent_id?: string | null;
|
|
271
|
+
/**
|
|
272
|
+
* Body param:
|
|
273
|
+
*/
|
|
274
|
+
type?: 'file' | 'interval' | 'http' | 'email' | 'script';
|
|
275
|
+
}
|
|
123
276
|
export interface FileListParams extends PageCursorURLParams {
|
|
124
277
|
/**
|
|
125
278
|
* Id to query
|
|
@@ -134,7 +287,7 @@ export interface FileListParams extends PageCursorURLParams {
|
|
|
134
287
|
*/
|
|
135
288
|
version?: number;
|
|
136
289
|
}
|
|
137
|
-
export interface
|
|
290
|
+
export interface FileGetContentParams {
|
|
138
291
|
/**
|
|
139
292
|
* Query param: Id to query
|
|
140
293
|
*/
|
|
@@ -165,6 +318,6 @@ export interface FileContentParams {
|
|
|
165
318
|
'If-Unmodified-Since'?: string;
|
|
166
319
|
}
|
|
167
320
|
export declare namespace Files {
|
|
168
|
-
export { type FileRetrieveResponse as FileRetrieveResponse, type FileListResponse as FileListResponse, FileListResponsesPageCursorURL as FileListResponsesPageCursorURL, type FileRetrieveParams as FileRetrieveParams, type FileListParams as FileListParams, type
|
|
321
|
+
export { type FileCreateResponse as FileCreateResponse, type FileRetrieveResponse as FileRetrieveResponse, type FileUpdateResponse as FileUpdateResponse, type FileListResponse as FileListResponse, FileListResponsesPageCursorURL as FileListResponsesPageCursorURL, type FileCreateParams as FileCreateParams, type FileRetrieveParams as FileRetrieveParams, type FileUpdateParams as FileUpdateParams, type FileListParams as FileListParams, type FileGetContentParams as FileGetContentParams, };
|
|
169
322
|
}
|
|
170
323
|
//# sourceMappingURL=files.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/resources/projects/files.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD,qBAAa,KAAM,SAAQ,WAAW;IACpC;;OAEG;IACH,QAAQ,CACN,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,kBAAkB,EACzB,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,UAAU,CAAC,oBAAoB,CAAC;IAIxC;;OAEG;IACH,IAAI,CACF,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,cAAc,EACrB,OAAO,CAAC,EAAE,IAAI,CAAC,cAAc,GAC5B,IAAI,CAAC,WAAW,CAAC,8BAA8B,EAAE,gBAAgB,CAAC;IAOrE;;OAEG;IACH,
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/resources/projects/files.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,KAAK,QAAQ,EAAE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resource.js");
|
|
|
6
6
|
const core_1 = require("../../core.js");
|
|
7
7
|
const pagination_1 = require("../../pagination.js");
|
|
8
8
|
class Files extends resource_1.APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* [BETA] Create a new file, project val or directory
|
|
11
|
+
*/
|
|
12
|
+
create(projectId, path, params, options) {
|
|
13
|
+
const { branch_id, ...body } = params;
|
|
14
|
+
return this._client.post(`/v1/projects/${projectId}/files/${path}`, {
|
|
15
|
+
query: { branch_id },
|
|
16
|
+
body,
|
|
17
|
+
...options,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
9
20
|
/**
|
|
10
21
|
* Get metadata for files and directories in a project at the specified path
|
|
11
22
|
*/
|
|
12
23
|
retrieve(projectId, path, query, options) {
|
|
13
24
|
return this._client.get(`/v1/projects/${projectId}/files/${path}`, { query, ...options });
|
|
14
25
|
}
|
|
26
|
+
update(projectId, path, params = {}, options) {
|
|
27
|
+
if ((0, core_1.isRequestOptions)(params)) {
|
|
28
|
+
return this.update(projectId, path, {}, params);
|
|
29
|
+
}
|
|
30
|
+
const { branch_id, ...body } = params;
|
|
31
|
+
return this._client.put(`/v1/projects/${projectId}/files/${path}`, {
|
|
32
|
+
query: { branch_id },
|
|
33
|
+
body,
|
|
34
|
+
...options,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
15
37
|
/**
|
|
16
38
|
* Get metadata for files and directories in a project at the root directory
|
|
17
39
|
*/
|
|
@@ -21,9 +43,9 @@ class Files extends resource_1.APIResource {
|
|
|
21
43
|
...options,
|
|
22
44
|
});
|
|
23
45
|
}
|
|
24
|
-
|
|
46
|
+
getContent(projectId, path, params = {}, options) {
|
|
25
47
|
if ((0, core_1.isRequestOptions)(params)) {
|
|
26
|
-
return this.
|
|
48
|
+
return this.getContent(projectId, path, {}, params);
|
|
27
49
|
}
|
|
28
50
|
const { 'Cache-Control': cacheControl, 'If-Match': ifMatch, 'If-Modified-Since': ifModifiedSince, 'If-None-Match': ifNoneMatch, 'If-Unmodified-Since': ifUnmodifiedSince, ...query } = params;
|
|
29
51
|
return this._client.get(`/v1/projects/${projectId}/files/${path}/content`, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/resources/projects/files.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA6C;AAC7C,wCAA8C;AAG9C,oDAA2E;AAG3E,MAAa,KAAM,SAAQ,sBAAW;IACpC;;OAEG;IACH,QAAQ,CACN,SAAiB,EACjB,IAAY,EACZ,KAAyB,EACzB,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,SAAS,UAAU,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5F,CAAC;IAED;;OAEG;IACH,IAAI,CACF,SAAiB,EACjB,KAAqB,EACrB,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,SAAS,QAAQ,EAAE,8BAA8B,EAAE;YAChG,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAYD,
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/resources/projects/files.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,gDAA6C;AAC7C,wCAA8C;AAG9C,oDAA2E;AAG3E,MAAa,KAAM,SAAQ,sBAAW;IACpC;;OAEG;IACH,MAAM,CACJ,SAAiB,EACjB,IAAY,EACZ,MAAwB,EACxB,OAA6B;QAE7B,MAAM,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,SAAS,UAAU,IAAI,EAAE,EAAE;YAClE,KAAK,EAAE,EAAE,SAAS,EAAE;YACpB,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,QA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AiB,EACxC,GAAG,KAAK,EACT,GAAG,MAAM,CAAC;QACX,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,SAAS,UAAU,IAAI,UAAU,EAAE;YACzE,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE;gBACP,MAAM,EAAE,0BAA0B;gBAClC,GAAG,CAAC,YAAY,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;gBACzE,GAAG,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;gBAC1D,GAAG,CAAC,eAAe,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,mBAAmB,EAAE,eAAe,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;gBACnF,GAAG,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;gBACvE,GAAG,CAAC,iBAAiB,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;gBACzF,GAAG,OAAO,EAAE,OAAO;aACpB;YACD,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;IACL,CAAC;CACF;AAjHD,sBAiHC;AAED,MAAa,8BAA+B,SAAQ,0BAA+B;CAAG;AAAtF,wEAAsF;AA8WtF,KAAK,CAAC,8BAA8B,GAAG,8BAA8B,CAAC"}
|
|
@@ -3,12 +3,34 @@ import { APIResource } from "../../resource.mjs";
|
|
|
3
3
|
import { isRequestOptions } from "../../core.mjs";
|
|
4
4
|
import { PageCursorURL } from "../../pagination.mjs";
|
|
5
5
|
export class Files extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* [BETA] Create a new file, project val or directory
|
|
8
|
+
*/
|
|
9
|
+
create(projectId, path, params, options) {
|
|
10
|
+
const { branch_id, ...body } = params;
|
|
11
|
+
return this._client.post(`/v1/projects/${projectId}/files/${path}`, {
|
|
12
|
+
query: { branch_id },
|
|
13
|
+
body,
|
|
14
|
+
...options,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
6
17
|
/**
|
|
7
18
|
* Get metadata for files and directories in a project at the specified path
|
|
8
19
|
*/
|
|
9
20
|
retrieve(projectId, path, query, options) {
|
|
10
21
|
return this._client.get(`/v1/projects/${projectId}/files/${path}`, { query, ...options });
|
|
11
22
|
}
|
|
23
|
+
update(projectId, path, params = {}, options) {
|
|
24
|
+
if (isRequestOptions(params)) {
|
|
25
|
+
return this.update(projectId, path, {}, params);
|
|
26
|
+
}
|
|
27
|
+
const { branch_id, ...body } = params;
|
|
28
|
+
return this._client.put(`/v1/projects/${projectId}/files/${path}`, {
|
|
29
|
+
query: { branch_id },
|
|
30
|
+
body,
|
|
31
|
+
...options,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
12
34
|
/**
|
|
13
35
|
* Get metadata for files and directories in a project at the root directory
|
|
14
36
|
*/
|
|
@@ -18,9 +40,9 @@ export class Files extends APIResource {
|
|
|
18
40
|
...options,
|
|
19
41
|
});
|
|
20
42
|
}
|
|
21
|
-
|
|
43
|
+
getContent(projectId, path, params = {}, options) {
|
|
22
44
|
if (isRequestOptions(params)) {
|
|
23
|
-
return this.
|
|
45
|
+
return this.getContent(projectId, path, {}, params);
|
|
24
46
|
}
|
|
25
47
|
const { 'Cache-Control': cacheControl, 'If-Match': ifMatch, 'If-Modified-Since': ifModifiedSince, 'If-None-Match': ifNoneMatch, 'If-Unmodified-Since': ifUnmodifiedSince, ...query } = params;
|
|
26
48
|
return this._client.get(`/v1/projects/${projectId}/files/${path}/content`, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"files.mjs","sourceRoot":"","sources":["../../src/resources/projects/files.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/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AK;YACL,GAAG,OAAO;YACV,OAAO,EAAE;gBACP,MAAM,EAAE,0BAA0B;gBAClC,GAAG,CAAC,YAAY,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;gBACzE,GAAG,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;gBAC1D,GAAG,CAAC,eAAe,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,mBAAmB,EAAE,eAAe,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;gBACnF,GAAG,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;gBACvE,GAAG,CAAC,iBAAiB,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;gBACzF,GAAG,OAAO,EAAE,OAAO;aACpB;YACD,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,OAAO,8BAA+B,SAAQ,aAA+B;CAAG;AA8WtF,KAAK,CAAC,8BAA8B,GAAG,8BAA8B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { BranchListResponsesPageCursorURL, Branches, type BranchCreateResponse, type BranchRetrieveResponse, type BranchListResponse, type BranchCreateParams, type BranchListParams, } from "./branches.js";
|
|
2
|
-
export { FileListResponsesPageCursorURL, Files, type FileRetrieveResponse, type FileListResponse, type FileRetrieveParams, type FileListParams, type
|
|
2
|
+
export { FileListResponsesPageCursorURL, Files, type FileCreateResponse, type FileRetrieveResponse, type FileUpdateResponse, type FileListResponse, type FileCreateParams, type FileRetrieveParams, type FileUpdateParams, type FileListParams, type FileGetContentParams, } from "./files.js";
|
|
3
3
|
export { ProjectListResponsesPageCursorURL, Projects, type ProjectCreateResponse, type ProjectRetrieveResponse, type ProjectListResponse, type ProjectCreateParams, type ProjectListParams, } from "./projects.js";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/projects/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gCAAgC,EAChC,QAAQ,EACR,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,GACtB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,8BAA8B,EAC9B,KAAK,EACL,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/projects/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gCAAgC,EAChC,QAAQ,EACR,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,GACtB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,8BAA8B,EAC9B,KAAK,EACL,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,oBAAoB,GAC1B,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,iCAAiC,EACjC,QAAQ,EACR,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,GACvB,MAAM,YAAY,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/projects/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,0CAQoB;AAPlB,4HAAA,gCAAgC,OAAA;AAChC,oGAAA,QAAQ,OAAA;AAOV,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/projects/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,0CAQoB;AAPlB,4HAAA,gCAAgC,OAAA;AAChC,oGAAA,QAAQ,OAAA;AAOV,oCAYiB;AAXf,uHAAA,8BAA8B,OAAA;AAC9B,8FAAA,KAAK,OAAA;AAWP,0CAQoB;AAPlB,6HAAA,iCAAiC,OAAA;AACjC,oGAAA,QAAQ,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/projects/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,gCAAgC,EAChC,QAAQ,GAMT;OACM,EACL,8BAA8B,EAC9B,KAAK,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/projects/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,gCAAgC,EAChC,QAAQ,GAMT;OACM,EACL,8BAA8B,EAC9B,KAAK,GAUN;OACM,EACL,iCAAiC,EACjC,QAAQ,GAMT"}
|
|
@@ -3,7 +3,7 @@ import * as Core from "../../core.js";
|
|
|
3
3
|
import * as BranchesAPI from "./branches.js";
|
|
4
4
|
import { BranchCreateParams, BranchCreateResponse, BranchListParams, BranchListResponse, BranchListResponsesPageCursorURL, BranchRetrieveResponse, Branches } from "./branches.js";
|
|
5
5
|
import * as FilesAPI from "./files.js";
|
|
6
|
-
import {
|
|
6
|
+
import { FileCreateParams, FileCreateResponse, FileGetContentParams, FileListParams, FileListResponse, FileListResponsesPageCursorURL, FileRetrieveParams, FileRetrieveResponse, FileUpdateParams, FileUpdateResponse, Files } from "./files.js";
|
|
7
7
|
import { PageCursorURL, type PageCursorURLParams } from "../../pagination.js";
|
|
8
8
|
/**
|
|
9
9
|
* Projects let you organize multiple files and collaborate with pull requests
|
|
@@ -154,6 +154,6 @@ export interface ProjectListParams extends PageCursorURLParams {
|
|
|
154
154
|
export declare namespace Projects {
|
|
155
155
|
export { type ProjectCreateResponse as ProjectCreateResponse, type ProjectRetrieveResponse as ProjectRetrieveResponse, type ProjectListResponse as ProjectListResponse, ProjectListResponsesPageCursorURL as ProjectListResponsesPageCursorURL, type ProjectCreateParams as ProjectCreateParams, type ProjectListParams as ProjectListParams, };
|
|
156
156
|
export { Branches as Branches, type BranchCreateResponse as BranchCreateResponse, type BranchRetrieveResponse as BranchRetrieveResponse, type BranchListResponse as BranchListResponse, BranchListResponsesPageCursorURL as BranchListResponsesPageCursorURL, type BranchCreateParams as BranchCreateParams, type BranchListParams as BranchListParams, };
|
|
157
|
-
export { Files as Files, type FileRetrieveResponse as FileRetrieveResponse, type FileListResponse as FileListResponse, FileListResponsesPageCursorURL as FileListResponsesPageCursorURL, type FileRetrieveParams as FileRetrieveParams, type FileListParams as FileListParams, type
|
|
157
|
+
export { Files as Files, type FileCreateResponse as FileCreateResponse, type FileRetrieveResponse as FileRetrieveResponse, type FileUpdateResponse as FileUpdateResponse, type FileListResponse as FileListResponse, FileListResponsesPageCursorURL as FileListResponsesPageCursorURL, type FileCreateParams as FileCreateParams, type FileRetrieveParams as FileRetrieveParams, type FileUpdateParams as FileUpdateParams, type FileListParams as FileListParams, type FileGetContentParams as FileGetContentParams, };
|
|
158
158
|
}
|
|
159
159
|
//# sourceMappingURL=projects.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/resources/projects/projects.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,IAAI,MAAM,YAAY,CAAC;AACnC,OAAO,KAA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C,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,qBAAqB,IAAI,qBAAqB,EACnD,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,iCAAiC,IAAI,iCAAiC,EACtE,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;IAEF,OAAO,EACL,QAAQ,IAAI,QAAQ,EACpB,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,gCAAgC,IAAI,gCAAgC,EACpE,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,GAC1C,CAAC;IAEF,OAAO,EACL,KAAK,IAAI,KAAK,EACd,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,8BAA8B,IAAI,8BAA8B,EAChE,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.js","sourceRoot":"","sources":["../../src/resources/projects/projects.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtF,gDAA6C;AAE7C,2DAA0C;AAC1C,4CAQoB;AACpB,qDAAoC;AACpC,
|
|
1
|
+
{"version":3,"file":"projects.js","sourceRoot":"","sources":["../../src/resources/projects/projects.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;;;;;;;;;;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","sources":["../../src/resources/projects/projects.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,KAAK,WAAW;OAChB,EAKL,gCAAgC,EAEhC,QAAQ,GACT;OACM,KAAK,QAAQ;OACb,
|
|
1
|
+
{"version":3,"file":"projects.mjs","sourceRoot":"","sources":["../../src/resources/projects/projects.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,KAAK,WAAW;OAChB,EAKL,gCAAgC,EAEhC,QAAQ,GACT;OACM,KAAK,QAAQ;OACb,EAML,8BAA8B,EAK9B,KAAK,GACN;OACM,EAAE,aAAa,EAA4B;AAElD;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,WAAW;IAAzC;;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;IAyB3D,CAAC;IAvBC;;OAEG;IACH,MAAM,CAAC,IAAyB,EAAE,OAA6B;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjE,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,SAAiB,EAAE,OAA6B;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAgB,SAAS,EAAE,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;IAED;;OAEG;IACH,IAAI,CACF,KAAwB,EACxB,OAA6B;QAE7B,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,cAAc,EAAE,iCAAiC,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC3G,CAAC;CACF;AAED,MAAM,OAAO,iCAAkC,SAAQ,aAAkC;CAAG;AAuK5F,QAAQ,CAAC,iCAAiC,GAAG,iCAAiC,CAAC;AAC/E,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC7B,QAAQ,CAAC,gCAAgC,GAAG,gCAAgC,CAAC;AAC7E,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;AACvB,QAAQ,CAAC,8BAA8B,GAAG,8BAA8B,CAAC"}
|
|
@@ -8,6 +8,23 @@ import { PageCursorURL, type PageCursorURLParams } from '../../pagination';
|
|
|
8
8
|
import { type Response } from '../../_shims/index';
|
|
9
9
|
|
|
10
10
|
export class Files extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* [BETA] Create a new file, project val or directory
|
|
13
|
+
*/
|
|
14
|
+
create(
|
|
15
|
+
projectId: string,
|
|
16
|
+
path: string,
|
|
17
|
+
params: FileCreateParams,
|
|
18
|
+
options?: Core.RequestOptions,
|
|
19
|
+
): Core.APIPromise<FileCreateResponse> {
|
|
20
|
+
const { branch_id, ...body } = params;
|
|
21
|
+
return this._client.post(`/v1/projects/${projectId}/files/${path}`, {
|
|
22
|
+
query: { branch_id },
|
|
23
|
+
body,
|
|
24
|
+
...options,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
11
28
|
/**
|
|
12
29
|
* Get metadata for files and directories in a project at the specified path
|
|
13
30
|
*/
|
|
@@ -20,6 +37,33 @@ export class Files extends APIResource {
|
|
|
20
37
|
return this._client.get(`/v1/projects/${projectId}/files/${path}`, { query, ...options });
|
|
21
38
|
}
|
|
22
39
|
|
|
40
|
+
/**
|
|
41
|
+
* [BETA] Update a file's content
|
|
42
|
+
*/
|
|
43
|
+
update(
|
|
44
|
+
projectId: string,
|
|
45
|
+
path: string,
|
|
46
|
+
params?: FileUpdateParams,
|
|
47
|
+
options?: Core.RequestOptions,
|
|
48
|
+
): Core.APIPromise<FileUpdateResponse>;
|
|
49
|
+
update(projectId: string, path: string, options?: Core.RequestOptions): Core.APIPromise<FileUpdateResponse>;
|
|
50
|
+
update(
|
|
51
|
+
projectId: string,
|
|
52
|
+
path: string,
|
|
53
|
+
params: FileUpdateParams | Core.RequestOptions = {},
|
|
54
|
+
options?: Core.RequestOptions,
|
|
55
|
+
): Core.APIPromise<FileUpdateResponse> {
|
|
56
|
+
if (isRequestOptions(params)) {
|
|
57
|
+
return this.update(projectId, path, {}, params);
|
|
58
|
+
}
|
|
59
|
+
const { branch_id, ...body } = params;
|
|
60
|
+
return this._client.put(`/v1/projects/${projectId}/files/${path}`, {
|
|
61
|
+
query: { branch_id },
|
|
62
|
+
body,
|
|
63
|
+
...options,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
23
67
|
/**
|
|
24
68
|
* Get metadata for files and directories in a project at the root directory
|
|
25
69
|
*/
|
|
@@ -37,21 +81,21 @@ export class Files extends APIResource {
|
|
|
37
81
|
/**
|
|
38
82
|
* Download file content
|
|
39
83
|
*/
|
|
40
|
-
|
|
84
|
+
getContent(
|
|
41
85
|
projectId: string,
|
|
42
86
|
path: string,
|
|
43
|
-
params?:
|
|
87
|
+
params?: FileGetContentParams,
|
|
44
88
|
options?: Core.RequestOptions,
|
|
45
89
|
): Core.APIPromise<Response>;
|
|
46
|
-
|
|
47
|
-
|
|
90
|
+
getContent(projectId: string, path: string, options?: Core.RequestOptions): Core.APIPromise<Response>;
|
|
91
|
+
getContent(
|
|
48
92
|
projectId: string,
|
|
49
93
|
path: string,
|
|
50
|
-
params:
|
|
94
|
+
params: FileGetContentParams | Core.RequestOptions = {},
|
|
51
95
|
options?: Core.RequestOptions,
|
|
52
96
|
): Core.APIPromise<Response> {
|
|
53
97
|
if (isRequestOptions(params)) {
|
|
54
|
-
return this.
|
|
98
|
+
return this.getContent(projectId, path, {}, params);
|
|
55
99
|
}
|
|
56
100
|
const {
|
|
57
101
|
'Cache-Control': cacheControl,
|
|
@@ -80,6 +124,57 @@ export class Files extends APIResource {
|
|
|
80
124
|
|
|
81
125
|
export class FileListResponsesPageCursorURL extends PageCursorURL<FileListResponse> {}
|
|
82
126
|
|
|
127
|
+
/**
|
|
128
|
+
* A File or Directory's Metadata
|
|
129
|
+
*/
|
|
130
|
+
export interface FileCreateResponse {
|
|
131
|
+
/**
|
|
132
|
+
* The id of the resource
|
|
133
|
+
*/
|
|
134
|
+
id: string;
|
|
135
|
+
|
|
136
|
+
links: FileCreateResponse.Links;
|
|
137
|
+
|
|
138
|
+
name: string;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* The id of the parent resource
|
|
142
|
+
*/
|
|
143
|
+
parentId: string | null;
|
|
144
|
+
|
|
145
|
+
path: string;
|
|
146
|
+
|
|
147
|
+
type: 'directory' | 'file' | 'interval' | 'http' | 'email' | 'script';
|
|
148
|
+
|
|
149
|
+
updatedAt: string;
|
|
150
|
+
|
|
151
|
+
version: number;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export namespace FileCreateResponse {
|
|
155
|
+
export interface Links {
|
|
156
|
+
/**
|
|
157
|
+
* The URL of this resource on Val Town
|
|
158
|
+
*/
|
|
159
|
+
html: string;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* The URL of this resource's source code as a module
|
|
163
|
+
*/
|
|
164
|
+
module: string;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* The URL of this resource on this API
|
|
168
|
+
*/
|
|
169
|
+
self: string;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* This resource's web endpoint, where it serves a website or API
|
|
173
|
+
*/
|
|
174
|
+
endpoint?: string;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
83
178
|
/**
|
|
84
179
|
* A paginated result set
|
|
85
180
|
*/
|
|
@@ -106,6 +201,11 @@ export namespace FileRetrieveResponse {
|
|
|
106
201
|
|
|
107
202
|
name: string;
|
|
108
203
|
|
|
204
|
+
/**
|
|
205
|
+
* The id of the parent resource
|
|
206
|
+
*/
|
|
207
|
+
parentId: string | null;
|
|
208
|
+
|
|
109
209
|
path: string;
|
|
110
210
|
|
|
111
211
|
type: 'directory' | 'file' | 'interval' | 'http' | 'email' | 'script';
|
|
@@ -140,6 +240,57 @@ export namespace FileRetrieveResponse {
|
|
|
140
240
|
}
|
|
141
241
|
}
|
|
142
242
|
|
|
243
|
+
/**
|
|
244
|
+
* A File or Directory's Metadata
|
|
245
|
+
*/
|
|
246
|
+
export interface FileUpdateResponse {
|
|
247
|
+
/**
|
|
248
|
+
* The id of the resource
|
|
249
|
+
*/
|
|
250
|
+
id: string;
|
|
251
|
+
|
|
252
|
+
links: FileUpdateResponse.Links;
|
|
253
|
+
|
|
254
|
+
name: string;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* The id of the parent resource
|
|
258
|
+
*/
|
|
259
|
+
parentId: string | null;
|
|
260
|
+
|
|
261
|
+
path: string;
|
|
262
|
+
|
|
263
|
+
type: 'directory' | 'file' | 'interval' | 'http' | 'email' | 'script';
|
|
264
|
+
|
|
265
|
+
updatedAt: string;
|
|
266
|
+
|
|
267
|
+
version: number;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export namespace FileUpdateResponse {
|
|
271
|
+
export interface Links {
|
|
272
|
+
/**
|
|
273
|
+
* The URL of this resource on Val Town
|
|
274
|
+
*/
|
|
275
|
+
html: string;
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* The URL of this resource's source code as a module
|
|
279
|
+
*/
|
|
280
|
+
module: string;
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* The URL of this resource on this API
|
|
284
|
+
*/
|
|
285
|
+
self: string;
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* This resource's web endpoint, where it serves a website or API
|
|
289
|
+
*/
|
|
290
|
+
endpoint?: string;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
143
294
|
/**
|
|
144
295
|
* A File or Directory's Metadata
|
|
145
296
|
*/
|
|
@@ -153,6 +304,11 @@ export interface FileListResponse {
|
|
|
153
304
|
|
|
154
305
|
name: string;
|
|
155
306
|
|
|
307
|
+
/**
|
|
308
|
+
* The id of the parent resource
|
|
309
|
+
*/
|
|
310
|
+
parentId: string | null;
|
|
311
|
+
|
|
156
312
|
path: string;
|
|
157
313
|
|
|
158
314
|
type: 'directory' | 'file' | 'interval' | 'http' | 'email' | 'script';
|
|
@@ -186,6 +342,47 @@ export namespace FileListResponse {
|
|
|
186
342
|
}
|
|
187
343
|
}
|
|
188
344
|
|
|
345
|
+
export type FileCreateParams = FileCreateParams.Variant0 | FileCreateParams.Variant1;
|
|
346
|
+
|
|
347
|
+
export declare namespace FileCreateParams {
|
|
348
|
+
export interface Variant0 {
|
|
349
|
+
/**
|
|
350
|
+
* Body param:
|
|
351
|
+
*/
|
|
352
|
+
type: 'directory';
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Query param: The specified branch of the resource. Defaults to main if not
|
|
356
|
+
* provided.
|
|
357
|
+
*/
|
|
358
|
+
branch_id?: string;
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Body param:
|
|
362
|
+
*/
|
|
363
|
+
content?: null;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
export interface Variant1 {
|
|
367
|
+
/**
|
|
368
|
+
* Body param: Project file and val content. An empty string will create an empty
|
|
369
|
+
* file. When creating a directory, the content should be null or undefined.
|
|
370
|
+
*/
|
|
371
|
+
content: string;
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* Body param:
|
|
375
|
+
*/
|
|
376
|
+
type: 'file' | 'interval' | 'http' | 'email' | 'script';
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* Query param: The specified branch of the resource. Defaults to main if not
|
|
380
|
+
* provided.
|
|
381
|
+
*/
|
|
382
|
+
branch_id?: string;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
189
386
|
export interface FileRetrieveParams {
|
|
190
387
|
/**
|
|
191
388
|
* Maximum items to return in each paginated response
|
|
@@ -208,6 +405,35 @@ export interface FileRetrieveParams {
|
|
|
208
405
|
version?: number;
|
|
209
406
|
}
|
|
210
407
|
|
|
408
|
+
export interface FileUpdateParams {
|
|
409
|
+
/**
|
|
410
|
+
* Query param: The specified branch of the resource. Defaults to main if not
|
|
411
|
+
* provided.
|
|
412
|
+
*/
|
|
413
|
+
branch_id?: string;
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* Body param: Project file and val content. An empty string will create an empty
|
|
417
|
+
* file. When creating a directory, the content should be null or undefined.
|
|
418
|
+
*/
|
|
419
|
+
content?: string;
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Body param:
|
|
423
|
+
*/
|
|
424
|
+
name?: string;
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* Body param: Id of the parent directory
|
|
428
|
+
*/
|
|
429
|
+
parent_id?: string | null;
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* Body param:
|
|
433
|
+
*/
|
|
434
|
+
type?: 'file' | 'interval' | 'http' | 'email' | 'script';
|
|
435
|
+
}
|
|
436
|
+
|
|
211
437
|
export interface FileListParams extends PageCursorURLParams {
|
|
212
438
|
/**
|
|
213
439
|
* Id to query
|
|
@@ -225,7 +451,7 @@ export interface FileListParams extends PageCursorURLParams {
|
|
|
225
451
|
version?: number;
|
|
226
452
|
}
|
|
227
453
|
|
|
228
|
-
export interface
|
|
454
|
+
export interface FileGetContentParams {
|
|
229
455
|
/**
|
|
230
456
|
* Query param: Id to query
|
|
231
457
|
*/
|
|
@@ -266,11 +492,15 @@ Files.FileListResponsesPageCursorURL = FileListResponsesPageCursorURL;
|
|
|
266
492
|
|
|
267
493
|
export declare namespace Files {
|
|
268
494
|
export {
|
|
495
|
+
type FileCreateResponse as FileCreateResponse,
|
|
269
496
|
type FileRetrieveResponse as FileRetrieveResponse,
|
|
497
|
+
type FileUpdateResponse as FileUpdateResponse,
|
|
270
498
|
type FileListResponse as FileListResponse,
|
|
271
499
|
FileListResponsesPageCursorURL as FileListResponsesPageCursorURL,
|
|
500
|
+
type FileCreateParams as FileCreateParams,
|
|
272
501
|
type FileRetrieveParams as FileRetrieveParams,
|
|
502
|
+
type FileUpdateParams as FileUpdateParams,
|
|
273
503
|
type FileListParams as FileListParams,
|
|
274
|
-
type
|
|
504
|
+
type FileGetContentParams as FileGetContentParams,
|
|
275
505
|
};
|
|
276
506
|
}
|
|
@@ -12,11 +12,15 @@ export {
|
|
|
12
12
|
export {
|
|
13
13
|
FileListResponsesPageCursorURL,
|
|
14
14
|
Files,
|
|
15
|
+
type FileCreateResponse,
|
|
15
16
|
type FileRetrieveResponse,
|
|
17
|
+
type FileUpdateResponse,
|
|
16
18
|
type FileListResponse,
|
|
19
|
+
type FileCreateParams,
|
|
17
20
|
type FileRetrieveParams,
|
|
21
|
+
type FileUpdateParams,
|
|
18
22
|
type FileListParams,
|
|
19
|
-
type
|
|
23
|
+
type FileGetContentParams,
|
|
20
24
|
} from './files';
|
|
21
25
|
export {
|
|
22
26
|
ProjectListResponsesPageCursorURL,
|
|
@@ -14,12 +14,16 @@ import {
|
|
|
14
14
|
} from './branches';
|
|
15
15
|
import * as FilesAPI from './files';
|
|
16
16
|
import {
|
|
17
|
-
|
|
17
|
+
FileCreateParams,
|
|
18
|
+
FileCreateResponse,
|
|
19
|
+
FileGetContentParams,
|
|
18
20
|
FileListParams,
|
|
19
21
|
FileListResponse,
|
|
20
22
|
FileListResponsesPageCursorURL,
|
|
21
23
|
FileRetrieveParams,
|
|
22
24
|
FileRetrieveResponse,
|
|
25
|
+
FileUpdateParams,
|
|
26
|
+
FileUpdateResponse,
|
|
23
27
|
Files,
|
|
24
28
|
} from './files';
|
|
25
29
|
import { PageCursorURL, type PageCursorURLParams } from '../../pagination';
|
|
@@ -251,11 +255,15 @@ export declare namespace Projects {
|
|
|
251
255
|
|
|
252
256
|
export {
|
|
253
257
|
Files as Files,
|
|
258
|
+
type FileCreateResponse as FileCreateResponse,
|
|
254
259
|
type FileRetrieveResponse as FileRetrieveResponse,
|
|
260
|
+
type FileUpdateResponse as FileUpdateResponse,
|
|
255
261
|
type FileListResponse as FileListResponse,
|
|
256
262
|
FileListResponsesPageCursorURL as FileListResponsesPageCursorURL,
|
|
263
|
+
type FileCreateParams as FileCreateParams,
|
|
257
264
|
type FileRetrieveParams as FileRetrieveParams,
|
|
265
|
+
type FileUpdateParams as FileUpdateParams,
|
|
258
266
|
type FileListParams as FileListParams,
|
|
259
|
-
type
|
|
267
|
+
type FileGetContentParams as FileGetContentParams,
|
|
260
268
|
};
|
|
261
269
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.34.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 = "0.34.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.34.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|