Skip to content

Commit dce49a0

Browse files
authored
Merge pull request #517 from val-town/release-please--branches--main--changes--next--components--sdk
release: 0.33.0
2 parents 5fe15bd + c5220c7 commit dce49a0

File tree

11 files changed

+154
-9
lines changed

11 files changed

+154
-9
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.32.0"
2+
".": "0.33.0"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 37
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/val-town%2Fval-town-d84dfa83575ab69d557d177944a1fa6146ad9fdd6fc555f6bb352a48f6a1daa0.yml
1+
configured_endpoints: 38
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/val-town%2Fval-town-fdb8597c76fe77a92ca60e29d54dc0cc907861b822a699ed026232f758d5eaee.yml

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## 0.33.0 (2025-03-05)
4+
5+
Full Changelog: [v0.32.0...v0.33.0](https://github.com/val-town/sdk/compare/v0.32.0...v0.33.0)
6+
7+
### Features
8+
9+
* **api:** api update ([#516](https://github.com/val-town/sdk/issues/516)) ([dcb4323](https://github.com/val-town/sdk/commit/dcb43232442ca0235309808436ef038c1b0a5f23))
10+
* **api:** api update ([#518](https://github.com/val-town/sdk/issues/518)) ([b51b467](https://github.com/val-town/sdk/commit/b51b4670a45e3baec2b10154dd7605e1be7268e2))
11+
312
## 0.32.0 (2025-03-03)
413

514
Full Changelog: [v0.31.0...v0.32.0](https://github.com/val-town/sdk/compare/v0.31.0...v0.32.0)

api.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,13 @@ Methods:
198198

199199
Types:
200200

201+
- <code><a href="./src/resources/projects/files.ts">FileCreateResponse</a></code>
201202
- <code><a href="./src/resources/projects/files.ts">FileRetrieveResponse</a></code>
202203
- <code><a href="./src/resources/projects/files.ts">FileListResponse</a></code>
203204

204205
Methods:
205206

207+
- <code title="post /v1/projects/{project_id}/files/{path}">client.projects.files.<a href="./src/resources/projects/files.ts">create</a>(projectId, path, { ...params }) -> FileCreateResponse</code>
206208
- <code title="get /v1/projects/{project_id}/files/{path}">client.projects.files.<a href="./src/resources/projects/files.ts">retrieve</a>(projectId, path, { ...params }) -> FileRetrieveResponse</code>
207209
- <code title="get /v1/projects/{project_id}/files">client.projects.files.<a href="./src/resources/projects/files.ts">list</a>(projectId, { ...params }) -> FileListResponsesPageCursorURL</code>
208210
- <code title="get /v1/projects/{project_id}/files/{path}/content">client.projects.files.<a href="./src/resources/projects/files.ts">content</a>(projectId, path, { ...params }) -> Response</code>

jsr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@valtown/sdk",
3-
"version": "0.32.0",
3+
"version": "0.33.0",
44
"exports": "./index.ts",
55
"publish": {
66
"exclude": [

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@valtown/sdk",
3-
"version": "0.32.0",
3+
"version": "0.33.0",
44
"description": "The official TypeScript library for the Val Town API",
55
"author": "Val Town <support@val.town>",
66
"types": "dist/index.d.ts",

src/resources/projects/files.ts

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,23 @@ import { PageCursorURL, type PageCursorURLParams } from '../../pagination';
88
import { type Response } from '../../_shims/index';
99

1010
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+
1128
/**
1229
* Get metadata for files and directories in a project at the specified path
1330
*/
@@ -80,6 +97,52 @@ export class Files extends APIResource {
8097

8198
export class FileListResponsesPageCursorURL extends PageCursorURL<FileListResponse> {}
8299

100+
/**
101+
* A File or Directory's Metadata
102+
*/
103+
export interface FileCreateResponse {
104+
/**
105+
* The id of the resource
106+
*/
107+
id: string;
108+
109+
links: FileCreateResponse.Links;
110+
111+
name: string;
112+
113+
path: string;
114+
115+
type: 'directory' | 'file' | 'interval' | 'http' | 'email' | 'script';
116+
117+
updatedAt: string;
118+
119+
version: number;
120+
}
121+
122+
export namespace FileCreateResponse {
123+
export interface Links {
124+
/**
125+
* The URL of this resource on Val Town
126+
*/
127+
html: string;
128+
129+
/**
130+
* The URL of this resource's source code as a module
131+
*/
132+
module: string;
133+
134+
/**
135+
* The URL of this resource on this API
136+
*/
137+
self: string;
138+
139+
/**
140+
* This resource's web endpoint, where it serves a website or API
141+
*/
142+
endpoint?: string;
143+
}
144+
}
145+
83146
/**
84147
* A paginated result set
85148
*/
@@ -186,6 +249,48 @@ export namespace FileListResponse {
186249
}
187250
}
188251

252+
export type FileCreateParams = FileCreateParams.Variant0 | FileCreateParams.Variant1;
253+
254+
export declare namespace FileCreateParams {
255+
export interface Variant0 {
256+
/**
257+
* Body param:
258+
*/
259+
type: 'directory';
260+
261+
/**
262+
* Query param: Id of the branch to create the file on. Defaults to main if not
263+
* provided.
264+
*/
265+
branch_id?: string;
266+
267+
/**
268+
* Body param:
269+
*/
270+
content?: null;
271+
}
272+
273+
export interface Variant1 {
274+
/**
275+
* Body param: Project file and val content. Null or an empty string will create an
276+
* empty file. When creating a directory, you can send null, an empty string, or
277+
* omit the content field entirely.
278+
*/
279+
content: string;
280+
281+
/**
282+
* Body param:
283+
*/
284+
type: 'file' | 'interval' | 'http' | 'email' | 'script';
285+
286+
/**
287+
* Query param: Id of the branch to create the file on. Defaults to main if not
288+
* provided.
289+
*/
290+
branch_id?: string;
291+
}
292+
}
293+
189294
export interface FileRetrieveParams {
190295
/**
191296
* Maximum items to return in each paginated response
@@ -266,9 +371,11 @@ Files.FileListResponsesPageCursorURL = FileListResponsesPageCursorURL;
266371

267372
export declare namespace Files {
268373
export {
374+
type FileCreateResponse as FileCreateResponse,
269375
type FileRetrieveResponse as FileRetrieveResponse,
270376
type FileListResponse as FileListResponse,
271377
FileListResponsesPageCursorURL as FileListResponsesPageCursorURL,
378+
type FileCreateParams as FileCreateParams,
272379
type FileRetrieveParams as FileRetrieveParams,
273380
type FileListParams as FileListParams,
274381
type FileContentParams as FileContentParams,

src/resources/projects/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ export {
1212
export {
1313
FileListResponsesPageCursorURL,
1414
Files,
15+
type FileCreateResponse,
1516
type FileRetrieveResponse,
1617
type FileListResponse,
18+
type FileCreateParams,
1719
type FileRetrieveParams,
1820
type FileListParams,
1921
type FileContentParams,

src/resources/projects/projects.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import {
1515
import * as FilesAPI from './files';
1616
import {
1717
FileContentParams,
18+
FileCreateParams,
19+
FileCreateResponse,
1820
FileListParams,
1921
FileListResponse,
2022
FileListResponsesPageCursorURL,
@@ -251,9 +253,11 @@ export declare namespace Projects {
251253

252254
export {
253255
Files as Files,
256+
type FileCreateResponse as FileCreateResponse,
254257
type FileRetrieveResponse as FileRetrieveResponse,
255258
type FileListResponse as FileListResponse,
256259
FileListResponsesPageCursorURL as FileListResponsesPageCursorURL,
260+
type FileCreateParams as FileCreateParams,
257261
type FileRetrieveParams as FileRetrieveParams,
258262
type FileListParams as FileListParams,
259263
type FileContentParams as FileContentParams,

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const VERSION = '0.32.0'; // x-release-please-version
1+
export const VERSION = '0.33.0'; // x-release-please-version

0 commit comments

Comments
 (0)