@valtown/sdk 0.26.0 → 0.28.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.
Files changed (58) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/core.d.ts.map +1 -1
  3. package/core.js +12 -6
  4. package/core.js.map +1 -1
  5. package/core.mjs +12 -6
  6. package/core.mjs.map +1 -1
  7. package/index.d.mts +6 -0
  8. package/index.d.ts +6 -0
  9. package/index.d.ts.map +1 -1
  10. package/index.js +7 -0
  11. package/index.js.map +1 -1
  12. package/index.mjs +7 -0
  13. package/index.mjs.map +1 -1
  14. package/package.json +1 -1
  15. package/resources/alias/username/val-name.d.ts +3 -3
  16. package/resources/index.d.ts +1 -0
  17. package/resources/index.d.ts.map +1 -1
  18. package/resources/index.js +4 -1
  19. package/resources/index.js.map +1 -1
  20. package/resources/index.mjs +1 -0
  21. package/resources/index.mjs.map +1 -1
  22. package/resources/me/comments.d.ts +2 -2
  23. package/resources/projects/branches.d.ts +63 -0
  24. package/resources/projects/branches.d.ts.map +1 -0
  25. package/resources/projects/branches.js +29 -0
  26. package/resources/projects/branches.js.map +1 -0
  27. package/resources/projects/branches.mjs +24 -0
  28. package/resources/projects/branches.mjs.map +1 -0
  29. package/resources/projects/index.d.ts +3 -0
  30. package/resources/projects/index.d.ts.map +1 -0
  31. package/resources/projects/index.js +11 -0
  32. package/resources/projects/index.js.map +1 -0
  33. package/resources/projects/index.mjs +4 -0
  34. package/resources/projects/index.mjs.map +1 -0
  35. package/resources/projects/projects.d.ts +92 -0
  36. package/resources/projects/projects.d.ts.map +1 -0
  37. package/resources/projects/projects.js +60 -0
  38. package/resources/projects/projects.js.map +1 -0
  39. package/resources/projects/projects.mjs +32 -0
  40. package/resources/projects/projects.mjs.map +1 -0
  41. package/resources/shared.d.ts +6 -6
  42. package/resources/vals/vals.d.ts +4 -4
  43. package/resources/vals/versions.d.ts +2 -2
  44. package/src/core.ts +14 -6
  45. package/src/index.ts +21 -0
  46. package/src/resources/alias/username/val-name.ts +3 -3
  47. package/src/resources/index.ts +7 -0
  48. package/src/resources/me/comments.ts +2 -2
  49. package/src/resources/projects/branches.ts +103 -0
  50. package/src/resources/projects/index.ts +16 -0
  51. package/src/resources/projects/projects.ts +146 -0
  52. package/src/resources/shared.ts +6 -6
  53. package/src/resources/vals/vals.ts +4 -4
  54. package/src/resources/vals/versions.ts +2 -2
  55. package/src/version.ts +1 -1
  56. package/version.d.ts +1 -1
  57. package/version.js +1 -1
  58. package/version.mjs +1 -1
package/src/index.ts CHANGED
@@ -12,6 +12,13 @@ import { EmailSendParams, EmailSendResponse, Emails } from './resources/emails';
12
12
  import { Sqlite, SqliteBatchParams, SqliteBatchResponse, SqliteExecuteParams } from './resources/sqlite';
13
13
  import { Alias } from './resources/alias/alias';
14
14
  import { Me } from './resources/me/me';
15
+ import {
16
+ ProjectListParams,
17
+ ProjectListResponse,
18
+ ProjectListResponsesPageCursorURL,
19
+ ProjectRetrieveResponse,
20
+ Projects,
21
+ } from './resources/projects/projects';
15
22
  import { Search } from './resources/search/search';
16
23
  import { Users } from './resources/users/users';
17
24
  import {
@@ -167,6 +174,10 @@ export class ValTown extends Core.APIClient {
167
174
  * Val Town supports sending emails from vals
168
175
  */
169
176
  emails: API.Emails = new API.Emails(this);
177
+ /**
178
+ * Projects let you organize multiple files and collaborate with pull requests
179
+ */
180
+ projects: API.Projects = new API.Projects(this);
170
181
 
171
182
  protected override defaultQuery(): Core.DefaultQuery | undefined {
172
183
  return this._options.defaultQuery;
@@ -212,6 +223,8 @@ ValTown.Users = Users;
212
223
  ValTown.Sqlite = Sqlite;
213
224
  ValTown.Vals = Vals;
214
225
  ValTown.Emails = Emails;
226
+ ValTown.Projects = Projects;
227
+ ValTown.ProjectListResponsesPageCursorURL = ProjectListResponsesPageCursorURL;
215
228
  export declare namespace ValTown {
216
229
  export type RequestOptions = Core.RequestOptions;
217
230
 
@@ -257,6 +270,14 @@ export declare namespace ValTown {
257
270
  type EmailSendParams as EmailSendParams,
258
271
  };
259
272
 
273
+ export {
274
+ Projects as Projects,
275
+ type ProjectRetrieveResponse as ProjectRetrieveResponse,
276
+ type ProjectListResponse as ProjectListResponse,
277
+ ProjectListResponsesPageCursorURL as ProjectListResponsesPageCursorURL,
278
+ type ProjectListParams as ProjectListParams,
279
+ };
280
+
260
281
  export type BasicVal = API.BasicVal;
261
282
  export type ExtendedVal = API.ExtendedVal;
262
283
  export type PaginationLinks = API.PaginationLinks;
@@ -50,8 +50,8 @@ export interface ValNameRetrieveResponse {
50
50
  name: string;
51
51
 
52
52
  /**
53
- * This val’s privacy setting. Unlisted vals do not appear on profile pages or
54
- * elsewhere, but you can link to them.
53
+ * This resource's privacy setting. Unlisted resources do not appear on profile
54
+ * pages or elsewhere, but you can link to them.
55
55
  */
56
56
  privacy: 'public' | 'unlisted' | 'private';
57
57
 
@@ -74,7 +74,7 @@ export interface ValNameRetrieveResponse {
74
74
  type: 'interval' | 'http' | 'express' | 'email' | 'script' | 'rpc' | 'httpnext';
75
75
 
76
76
  /**
77
- * The URL of this val on the Val Town website
77
+ * The URL of this resource on the Val Town website
78
78
  */
79
79
  url: string;
80
80
 
@@ -5,6 +5,13 @@ export { Alias } from './alias/alias';
5
5
  export { Blobs, type BlobListResponse, type BlobListParams, type BlobStoreParams } from './blobs';
6
6
  export { Emails, type EmailSendResponse, type EmailSendParams } from './emails';
7
7
  export { Me } from './me/me';
8
+ export {
9
+ ProjectListResponsesPageCursorURL,
10
+ Projects,
11
+ type ProjectRetrieveResponse,
12
+ type ProjectListResponse,
13
+ type ProjectListParams,
14
+ } from './projects/projects';
8
15
  export { Search } from './search/search';
9
16
  export { Sqlite, type SqliteBatchResponse, type SqliteBatchParams, type SqliteExecuteParams } from './sqlite';
10
17
  export { Users } from './users/users';
@@ -60,8 +60,8 @@ export namespace CommentListResponse {
60
60
  name: string;
61
61
 
62
62
  /**
63
- * This val’s privacy setting. Unlisted vals do not appear on profile pages or
64
- * elsewhere, but you can link to them.
63
+ * This resource's privacy setting. Unlisted resources do not appear on profile
64
+ * pages or elsewhere, but you can link to them.
65
65
  */
66
66
  privacy: 'public' | 'unlisted' | 'private';
67
67
 
@@ -0,0 +1,103 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../resource';
4
+ import * as Core from '../../core';
5
+ import { PageCursorURL, type PageCursorURLParams } from '../../pagination';
6
+
7
+ export class Branches extends APIResource {
8
+ /**
9
+ * [BETA] Get a branch by id
10
+ */
11
+ retrieve(
12
+ projectId: string,
13
+ branchId: string,
14
+ options?: Core.RequestOptions,
15
+ ): Core.APIPromise<BranchRetrieveResponse> {
16
+ return this._client.get(`/v1/projects/${projectId}/branches/${branchId}`, options);
17
+ }
18
+
19
+ /**
20
+ * [BETA] List all branches for a project
21
+ */
22
+ list(
23
+ projectId: string,
24
+ query: BranchListParams,
25
+ options?: Core.RequestOptions,
26
+ ): Core.PagePromise<BranchListResponsesPageCursorURL, BranchListResponse> {
27
+ return this._client.getAPIList(`/v1/projects/${projectId}/branches`, BranchListResponsesPageCursorURL, {
28
+ query,
29
+ ...options,
30
+ });
31
+ }
32
+ }
33
+
34
+ export class BranchListResponsesPageCursorURL extends PageCursorURL<BranchListResponse> {}
35
+
36
+ /**
37
+ * A Branch
38
+ */
39
+ export interface BranchRetrieveResponse {
40
+ /**
41
+ * The id of the branch
42
+ */
43
+ id: string;
44
+
45
+ createdAt: string;
46
+
47
+ /**
48
+ * The id of the branch this branch was forked from
49
+ */
50
+ forkedBranchId: string | null;
51
+
52
+ name: string;
53
+
54
+ updatedAt: string;
55
+
56
+ /**
57
+ * The URL of this resource on the Val Town website
58
+ */
59
+ valTownUrl: string;
60
+
61
+ version: number;
62
+ }
63
+
64
+ /**
65
+ * A Branch
66
+ */
67
+ export interface BranchListResponse {
68
+ /**
69
+ * The id of the branch
70
+ */
71
+ id: string;
72
+
73
+ createdAt: string;
74
+
75
+ /**
76
+ * The id of the branch this branch was forked from
77
+ */
78
+ forkedBranchId: string | null;
79
+
80
+ name: string;
81
+
82
+ updatedAt: string;
83
+
84
+ /**
85
+ * The URL of this resource on the Val Town website
86
+ */
87
+ valTownUrl: string;
88
+
89
+ version: number;
90
+ }
91
+
92
+ export interface BranchListParams extends PageCursorURLParams {}
93
+
94
+ Branches.BranchListResponsesPageCursorURL = BranchListResponsesPageCursorURL;
95
+
96
+ export declare namespace Branches {
97
+ export {
98
+ type BranchRetrieveResponse as BranchRetrieveResponse,
99
+ type BranchListResponse as BranchListResponse,
100
+ BranchListResponsesPageCursorURL as BranchListResponsesPageCursorURL,
101
+ type BranchListParams as BranchListParams,
102
+ };
103
+ }
@@ -0,0 +1,16 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export {
4
+ BranchListResponsesPageCursorURL,
5
+ Branches,
6
+ type BranchRetrieveResponse,
7
+ type BranchListResponse,
8
+ type BranchListParams,
9
+ } from './branches';
10
+ export {
11
+ ProjectListResponsesPageCursorURL,
12
+ Projects,
13
+ type ProjectRetrieveResponse,
14
+ type ProjectListResponse,
15
+ type ProjectListParams,
16
+ } from './projects';
@@ -0,0 +1,146 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../resource';
4
+ import * as Core from '../../core';
5
+ import * as BranchesAPI from './branches';
6
+ import {
7
+ BranchListParams,
8
+ BranchListResponse,
9
+ BranchListResponsesPageCursorURL,
10
+ BranchRetrieveResponse,
11
+ Branches,
12
+ } from './branches';
13
+ import { PageCursorURL, type PageCursorURLParams } from '../../pagination';
14
+
15
+ /**
16
+ * Projects let you organize multiple files and collaborate with pull requests
17
+ */
18
+ export class Projects extends APIResource {
19
+ branches: BranchesAPI.Branches = new BranchesAPI.Branches(this._client);
20
+
21
+ /**
22
+ * [BETA] Get a project by id
23
+ */
24
+ retrieve(projectId: string, options?: Core.RequestOptions): Core.APIPromise<ProjectRetrieveResponse> {
25
+ return this._client.get(`/v1/projects/${projectId}`, options);
26
+ }
27
+
28
+ /**
29
+ * [BETA] List all of a user's projects for authenticated users
30
+ */
31
+ list(
32
+ query: ProjectListParams,
33
+ options?: Core.RequestOptions,
34
+ ): Core.PagePromise<ProjectListResponsesPageCursorURL, ProjectListResponse> {
35
+ return this._client.getAPIList('/v1/projects', ProjectListResponsesPageCursorURL, { query, ...options });
36
+ }
37
+ }
38
+
39
+ export class ProjectListResponsesPageCursorURL extends PageCursorURL<ProjectListResponse> {}
40
+
41
+ /**
42
+ * A Project
43
+ */
44
+ export interface ProjectRetrieveResponse {
45
+ /**
46
+ * The id of the project
47
+ */
48
+ id: string;
49
+
50
+ author: ProjectRetrieveResponse.Author;
51
+
52
+ createdAt: string;
53
+
54
+ description: string | null;
55
+
56
+ /**
57
+ * The URL of this project's image
58
+ */
59
+ imageUrl: string | null;
60
+
61
+ name: string;
62
+
63
+ /**
64
+ * This resource's privacy setting. Unlisted resources do not appear on profile
65
+ * pages or elsewhere, but you can link to them.
66
+ */
67
+ privacy: 'public' | 'unlisted' | 'private';
68
+
69
+ /**
70
+ * The URL of this resource on the Val Town website
71
+ */
72
+ valTownUrl: string;
73
+ }
74
+
75
+ export namespace ProjectRetrieveResponse {
76
+ export interface Author {
77
+ id: string;
78
+
79
+ username: string | null;
80
+ }
81
+ }
82
+
83
+ /**
84
+ * A Project
85
+ */
86
+ export interface ProjectListResponse {
87
+ /**
88
+ * The id of the project
89
+ */
90
+ id: string;
91
+
92
+ author: ProjectListResponse.Author;
93
+
94
+ createdAt: string;
95
+
96
+ description: string | null;
97
+
98
+ /**
99
+ * The URL of this project's image
100
+ */
101
+ imageUrl: string | null;
102
+
103
+ name: string;
104
+
105
+ /**
106
+ * This resource's privacy setting. Unlisted resources do not appear on profile
107
+ * pages or elsewhere, but you can link to them.
108
+ */
109
+ privacy: 'public' | 'unlisted' | 'private';
110
+
111
+ /**
112
+ * The URL of this resource on the Val Town website
113
+ */
114
+ valTownUrl: string;
115
+ }
116
+
117
+ export namespace ProjectListResponse {
118
+ export interface Author {
119
+ id: string;
120
+
121
+ username: string | null;
122
+ }
123
+ }
124
+
125
+ export interface ProjectListParams extends PageCursorURLParams {}
126
+
127
+ Projects.ProjectListResponsesPageCursorURL = ProjectListResponsesPageCursorURL;
128
+ Projects.Branches = Branches;
129
+ Projects.BranchListResponsesPageCursorURL = BranchListResponsesPageCursorURL;
130
+
131
+ export declare namespace Projects {
132
+ export {
133
+ type ProjectRetrieveResponse as ProjectRetrieveResponse,
134
+ type ProjectListResponse as ProjectListResponse,
135
+ ProjectListResponsesPageCursorURL as ProjectListResponsesPageCursorURL,
136
+ type ProjectListParams as ProjectListParams,
137
+ };
138
+
139
+ export {
140
+ Branches as Branches,
141
+ type BranchRetrieveResponse as BranchRetrieveResponse,
142
+ type BranchListResponse as BranchListResponse,
143
+ BranchListResponsesPageCursorURL as BranchListResponsesPageCursorURL,
144
+ type BranchListParams as BranchListParams,
145
+ };
146
+ }
@@ -31,8 +31,8 @@ export interface BasicVal {
31
31
  name: string;
32
32
 
33
33
  /**
34
- * This val’s privacy setting. Unlisted vals do not appear on profile pages or
35
- * elsewhere, but you can link to them.
34
+ * This resource's privacy setting. Unlisted resources do not appear on profile
35
+ * pages or elsewhere, but you can link to them.
36
36
  */
37
37
  privacy: 'public' | 'unlisted' | 'private';
38
38
 
@@ -48,7 +48,7 @@ export interface BasicVal {
48
48
  type: 'interval' | 'http' | 'express' | 'email' | 'script' | 'rpc' | 'httpnext';
49
49
 
50
50
  /**
51
- * The URL of this val on the Val Town website
51
+ * The URL of this resource on the Val Town website
52
52
  */
53
53
  url: string;
54
54
 
@@ -125,8 +125,8 @@ export interface ExtendedVal {
125
125
  name: string;
126
126
 
127
127
  /**
128
- * This val’s privacy setting. Unlisted vals do not appear on profile pages or
129
- * elsewhere, but you can link to them.
128
+ * This resource's privacy setting. Unlisted resources do not appear on profile
129
+ * pages or elsewhere, but you can link to them.
130
130
  */
131
131
  privacy: 'public' | 'unlisted' | 'private';
132
132
 
@@ -149,7 +149,7 @@ export interface ExtendedVal {
149
149
  type: 'interval' | 'http' | 'express' | 'email' | 'script' | 'rpc' | 'httpnext';
150
150
 
151
151
  /**
152
- * The URL of this val on the Val Town website
152
+ * The URL of this resource on the Val Town website
153
153
  */
154
154
  url: string;
155
155
 
@@ -110,8 +110,8 @@ export interface ValCreateParams {
110
110
  name?: string;
111
111
 
112
112
  /**
113
- * This val’s privacy setting. Unlisted vals do not appear on profile pages or
114
- * elsewhere, but you can link to them.
113
+ * This resource's privacy setting. Unlisted resources do not appear on profile
114
+ * pages or elsewhere, but you can link to them.
115
115
  */
116
116
  privacy?: 'public' | 'unlisted' | 'private';
117
117
 
@@ -134,8 +134,8 @@ export interface ValUpdateParams {
134
134
  name?: string;
135
135
 
136
136
  /**
137
- * This val’s privacy setting. Unlisted vals do not appear on profile pages or
138
- * elsewhere, but you can link to them.
137
+ * This resource's privacy setting. Unlisted resources do not appear on profile
138
+ * pages or elsewhere, but you can link to them.
139
139
  */
140
140
  privacy?: 'public' | 'unlisted' | 'private';
141
141
 
@@ -82,8 +82,8 @@ export interface VersionCreateParams {
82
82
  name?: string;
83
83
 
84
84
  /**
85
- * This val’s privacy setting. Unlisted vals do not appear on profile pages or
86
- * elsewhere, but you can link to them.
85
+ * This resource's privacy setting. Unlisted resources do not appear on profile
86
+ * pages or elsewhere, but you can link to them.
87
87
  */
88
88
  privacy?: 'public' | 'unlisted' | 'private';
89
89
 
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.26.0'; // x-release-please-version
1
+ export const VERSION = '0.28.0'; // x-release-please-version
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.26.0";
1
+ export declare const VERSION = "0.28.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.26.0'; // x-release-please-version
4
+ exports.VERSION = '0.28.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.26.0'; // x-release-please-version
1
+ export const VERSION = '0.28.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map