@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.
Files changed (226) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +0 -30
  3. package/core.d.ts +1 -1
  4. package/core.d.ts.map +1 -1
  5. package/core.js +5 -5
  6. package/core.js.map +1 -1
  7. package/core.mjs +5 -5
  8. package/core.mjs.map +1 -1
  9. package/index.d.mts +5 -12
  10. package/index.d.ts +5 -12
  11. package/index.d.ts.map +1 -1
  12. package/index.js +2 -9
  13. package/index.js.map +1 -1
  14. package/index.mjs +3 -10
  15. package/index.mjs.map +1 -1
  16. package/package.json +1 -1
  17. package/resources/alias/username/index.d.ts +1 -2
  18. package/resources/alias/username/index.d.ts.map +1 -1
  19. package/resources/alias/username/index.js +1 -3
  20. package/resources/alias/username/index.js.map +1 -1
  21. package/resources/alias/username/index.mjs +0 -1
  22. package/resources/alias/username/index.mjs.map +1 -1
  23. package/resources/alias/username/username.d.ts +2 -6
  24. package/resources/alias/username/username.d.ts.map +1 -1
  25. package/resources/alias/username/username.js +0 -4
  26. package/resources/alias/username/username.js.map +1 -1
  27. package/resources/alias/username/username.mjs +0 -4
  28. package/resources/alias/username/username.mjs.map +1 -1
  29. package/resources/alias/username/val-name.d.ts +2 -87
  30. package/resources/alias/username/val-name.d.ts.map +1 -1
  31. package/resources/alias/username/val-name.js +1 -1
  32. package/resources/alias/username/val-name.js.map +1 -1
  33. package/resources/alias/username/val-name.mjs +1 -1
  34. package/resources/alias/username/val-name.mjs.map +1 -1
  35. package/resources/index.d.ts +2 -3
  36. package/resources/index.d.ts.map +1 -1
  37. package/resources/index.js +2 -5
  38. package/resources/index.js.map +1 -1
  39. package/resources/index.mjs +2 -3
  40. package/resources/index.mjs.map +1 -1
  41. package/resources/me/index.d.ts +1 -4
  42. package/resources/me/index.d.ts.map +1 -1
  43. package/resources/me/index.js +3 -12
  44. package/resources/me/index.js.map +1 -1
  45. package/resources/me/index.mjs +1 -4
  46. package/resources/me/index.mjs.map +1 -1
  47. package/resources/me/me.d.ts +4 -16
  48. package/resources/me/me.d.ts.map +1 -1
  49. package/resources/me/me.js +4 -19
  50. package/resources/me/me.js.map +1 -1
  51. package/resources/me/me.mjs +4 -19
  52. package/resources/me/me.mjs.map +1 -1
  53. package/resources/{users → me}/vals.d.ts +4 -4
  54. package/resources/me/vals.d.ts.map +1 -0
  55. package/resources/me/vals.js +17 -0
  56. package/resources/me/vals.js.map +1 -0
  57. package/resources/me/vals.mjs +13 -0
  58. package/resources/me/vals.mjs.map +1 -0
  59. package/resources/search/index.d.ts +1 -1
  60. package/resources/search/index.d.ts.map +1 -1
  61. package/resources/search/index.js +2 -1
  62. package/resources/search/index.js.map +1 -1
  63. package/resources/search/index.mjs +1 -1
  64. package/resources/search/index.mjs.map +1 -1
  65. package/resources/search/search.d.ts +2 -2
  66. package/resources/search/search.d.ts.map +1 -1
  67. package/resources/search/search.js +1 -0
  68. package/resources/search/search.js.map +1 -1
  69. package/resources/search/search.mjs +2 -1
  70. package/resources/search/search.mjs.map +1 -1
  71. package/resources/search/vals.d.ts +78 -6
  72. package/resources/search/vals.d.ts.map +1 -1
  73. package/resources/search/vals.js +7 -4
  74. package/resources/search/vals.js.map +1 -1
  75. package/resources/search/vals.mjs +5 -3
  76. package/resources/search/vals.mjs.map +1 -1
  77. package/resources/shared.d.ts +36 -157
  78. package/resources/shared.d.ts.map +1 -1
  79. package/resources/shared.js +3 -3
  80. package/resources/shared.js.map +1 -1
  81. package/resources/shared.mjs +1 -1
  82. package/resources/shared.mjs.map +1 -1
  83. package/resources/users.d.ts +12 -1
  84. package/resources/users.d.ts.map +1 -1
  85. package/resources/users.js +14 -15
  86. package/resources/users.js.map +1 -1
  87. package/resources/users.mjs +12 -1
  88. package/resources/users.mjs.map +1 -1
  89. package/resources/{projects → vals}/branches.d.ts +8 -8
  90. package/resources/vals/branches.d.ts.map +1 -0
  91. package/resources/{projects → vals}/branches.js +12 -12
  92. package/resources/vals/branches.js.map +1 -0
  93. package/resources/vals/branches.mjs +39 -0
  94. package/resources/vals/branches.mjs.map +1 -0
  95. package/resources/{projects → vals}/files.d.ts +26 -37
  96. package/resources/vals/files.d.ts.map +1 -0
  97. package/resources/{projects → vals}/files.js +18 -26
  98. package/resources/vals/files.js.map +1 -0
  99. package/resources/{projects → vals}/files.mjs +18 -26
  100. package/resources/vals/files.mjs.map +1 -0
  101. package/resources/vals/index.d.ts +3 -2
  102. package/resources/vals/index.d.ts.map +1 -1
  103. package/resources/vals/index.js +7 -4
  104. package/resources/vals/index.js.map +1 -1
  105. package/resources/vals/index.mjs +3 -2
  106. package/resources/vals/index.mjs.map +1 -1
  107. package/resources/vals/vals.d.ts +22 -114
  108. package/resources/vals/vals.d.ts.map +1 -1
  109. package/resources/vals/vals.js +20 -40
  110. package/resources/vals/vals.js.map +1 -1
  111. package/resources/vals/vals.mjs +19 -39
  112. package/resources/vals/vals.mjs.map +1 -1
  113. package/src/core.ts +4 -4
  114. package/src/index.ts +5 -47
  115. package/src/resources/alias/username/index.ts +1 -2
  116. package/src/resources/alias/username/username.ts +2 -8
  117. package/src/resources/alias/username/val-name.ts +3 -115
  118. package/src/resources/index.ts +2 -19
  119. package/src/resources/me/index.ts +1 -19
  120. package/src/resources/me/me.ts +5 -56
  121. package/src/resources/{users → me}/vals.ts +5 -9
  122. package/src/resources/search/index.ts +1 -1
  123. package/src/resources/search/search.ts +8 -2
  124. package/src/resources/search/vals.ts +103 -8
  125. package/src/resources/shared.ts +47 -197
  126. package/src/resources/users.ts +15 -1
  127. package/src/resources/{projects → vals}/branches.ts +12 -12
  128. package/src/resources/{projects → vals}/files.ts +33 -55
  129. package/src/resources/vals/index.ts +20 -15
  130. package/src/resources/vals/vals.ts +65 -181
  131. package/src/version.ts +1 -1
  132. package/version.d.ts +1 -1
  133. package/version.d.ts.map +1 -1
  134. package/version.js +1 -1
  135. package/version.js.map +1 -1
  136. package/version.mjs +1 -1
  137. package/version.mjs.map +1 -1
  138. package/resources/alias/username/project-name.d.ts +0 -51
  139. package/resources/alias/username/project-name.d.ts.map +0 -1
  140. package/resources/alias/username/project-name.js +0 -15
  141. package/resources/alias/username/project-name.js.map +0 -1
  142. package/resources/alias/username/project-name.mjs +0 -11
  143. package/resources/alias/username/project-name.mjs.map +0 -1
  144. package/resources/me/comments.d.ts +0 -74
  145. package/resources/me/comments.d.ts.map +0 -1
  146. package/resources/me/comments.js +0 -23
  147. package/resources/me/comments.js.map +0 -1
  148. package/resources/me/comments.mjs +0 -18
  149. package/resources/me/comments.mjs.map +0 -1
  150. package/resources/me/likes.d.ts +0 -18
  151. package/resources/me/likes.d.ts.map +0 -1
  152. package/resources/me/likes.js +0 -17
  153. package/resources/me/likes.js.map +0 -1
  154. package/resources/me/likes.mjs +0 -13
  155. package/resources/me/likes.mjs.map +0 -1
  156. package/resources/me/projects.d.ts +0 -56
  157. package/resources/me/projects.d.ts.map +0 -1
  158. package/resources/me/projects.js +0 -23
  159. package/resources/me/projects.js.map +0 -1
  160. package/resources/me/projects.mjs +0 -18
  161. package/resources/me/projects.mjs.map +0 -1
  162. package/resources/me/references.d.ts +0 -84
  163. package/resources/me/references.d.ts.map +0 -1
  164. package/resources/me/references.js +0 -23
  165. package/resources/me/references.js.map +0 -1
  166. package/resources/me/references.mjs +0 -18
  167. package/resources/me/references.mjs.map +0 -1
  168. package/resources/projects/branches.d.ts.map +0 -1
  169. package/resources/projects/branches.js.map +0 -1
  170. package/resources/projects/branches.mjs +0 -39
  171. package/resources/projects/branches.mjs.map +0 -1
  172. package/resources/projects/files.d.ts.map +0 -1
  173. package/resources/projects/files.js.map +0 -1
  174. package/resources/projects/files.mjs.map +0 -1
  175. package/resources/projects/index.d.ts +0 -4
  176. package/resources/projects/index.d.ts.map +0 -1
  177. package/resources/projects/index.js +0 -14
  178. package/resources/projects/index.js.map +0 -1
  179. package/resources/projects/index.mjs +0 -5
  180. package/resources/projects/index.mjs.map +0 -1
  181. package/resources/projects/projects.d.ts +0 -162
  182. package/resources/projects/projects.d.ts.map +0 -1
  183. package/resources/projects/projects.js +0 -80
  184. package/resources/projects/projects.js.map +0 -1
  185. package/resources/projects/projects.mjs +0 -52
  186. package/resources/projects/projects.mjs.map +0 -1
  187. package/resources/projects.d.ts +0 -2
  188. package/resources/projects.d.ts.map +0 -1
  189. package/resources/projects.js +0 -19
  190. package/resources/projects.js.map +0 -1
  191. package/resources/projects.mjs +0 -3
  192. package/resources/projects.mjs.map +0 -1
  193. package/resources/users/index.d.ts +0 -3
  194. package/resources/users/index.d.ts.map +0 -1
  195. package/resources/users/index.js +0 -9
  196. package/resources/users/index.js.map +0 -1
  197. package/resources/users/index.mjs +0 -4
  198. package/resources/users/index.mjs.map +0 -1
  199. package/resources/users/users.d.ts +0 -19
  200. package/resources/users/users.d.ts.map +0 -1
  201. package/resources/users/users.js +0 -48
  202. package/resources/users/users.js.map +0 -1
  203. package/resources/users/users.mjs +0 -21
  204. package/resources/users/users.mjs.map +0 -1
  205. package/resources/users/vals.d.ts.map +0 -1
  206. package/resources/users/vals.js +0 -17
  207. package/resources/users/vals.js.map +0 -1
  208. package/resources/users/vals.mjs +0 -13
  209. package/resources/users/vals.mjs.map +0 -1
  210. package/resources/vals/versions.d.ts +0 -75
  211. package/resources/vals/versions.d.ts.map +0 -1
  212. package/resources/vals/versions.js +0 -44
  213. package/resources/vals/versions.js.map +0 -1
  214. package/resources/vals/versions.mjs +0 -39
  215. package/resources/vals/versions.mjs.map +0 -1
  216. package/src/resources/alias/username/project-name.ts +0 -72
  217. package/src/resources/me/comments.ts +0 -108
  218. package/src/resources/me/likes.ts +0 -27
  219. package/src/resources/me/projects.ts +0 -85
  220. package/src/resources/me/references.ts +0 -114
  221. package/src/resources/projects/index.ts +0 -32
  222. package/src/resources/projects/projects.ts +0 -275
  223. package/src/resources/projects.ts +0 -3
  224. package/src/resources/users/index.ts +0 -4
  225. package/src/resources/users/users.ts +0 -27
  226. package/src/resources/vals/versions.ts +0 -126
@@ -1,3 +1,17 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- export * from './users/index';
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
- * [BETA] Create a new branch
9
+ * Create a new branch
10
10
  */
11
11
  create(
12
- projectId: string,
12
+ valId: string,
13
13
  body: BranchCreateParams,
14
14
  options?: Core.RequestOptions,
15
15
  ): Core.APIPromise<BranchCreateResponse> {
16
- return this._client.post(`/v1/projects/${projectId}/branches`, { body, ...options });
16
+ return this._client.post(`/v2/vals/${valId}/branches`, { body, ...options });
17
17
  }
18
18
 
19
19
  /**
20
- * [BETA] Get a branch by id
20
+ * Get a branch by id
21
21
  */
22
22
  retrieve(
23
- projectId: string,
23
+ valId: string,
24
24
  branchId: string,
25
25
  options?: Core.RequestOptions,
26
26
  ): Core.APIPromise<BranchRetrieveResponse> {
27
- return this._client.get(`/v1/projects/${projectId}/branches/${branchId}`, options);
27
+ return this._client.get(`/v2/vals/${valId}/branches/${branchId}`, options);
28
28
  }
29
29
 
30
30
  /**
31
- * [BETA] List all branches for a project
31
+ * List all branches for a val
32
32
  */
33
33
  list(
34
- projectId: string,
34
+ valId: string,
35
35
  query: BranchListParams,
36
36
  options?: Core.RequestOptions,
37
37
  ): Core.PagePromise<BranchListResponsesPageCursorURL, BranchListResponse> {
38
- return this._client.getAPIList(`/v1/projects/${projectId}/branches`, BranchListResponsesPageCursorURL, {
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
- * [BETA] Delete a branch
45
+ * Delete a branch
46
46
  */
47
- delete(projectId: string, branchId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
48
- return this._client.delete(`/v1/projects/${projectId}/branches/${branchId}`, {
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
- * [BETA] Create a new file, project val or directory
10
+ * Create a new file, project val or directory
11
11
  */
12
12
  create(
13
- projectId: string,
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(`/v1/projects/${projectId}/files`, {
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 project. If path is an empty string,
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
- projectId: string,
26
+ valId: string,
31
27
  query: FileRetrieveParams,
32
28
  options?: Core.RequestOptions,
33
29
  ): Core.PagePromise<FileRetrieveResponsesPageCursorURL, FileRetrieveResponse> {
34
- return this._client.getAPIList(`/v1/projects/${projectId}/files`, FileRetrieveResponsesPageCursorURL, {
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
- * [BETA] Update a file's content
37
+ * Update a file's content
42
38
  */
43
39
  update(
44
- projectId: string,
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(`/v1/projects/${projectId}/files`, {
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
- * [BETA] Deletes a file or a directory. To delete a directory and all of its
58
- * children, use the recursive flag. To delete all files, pass in an empty path and
59
- * the recursive flag.
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(projectId: string, params: FileDeleteParams, options?: Core.RequestOptions): Core.APIPromise<void> {
62
- const { path, branch_id, recursive } = params;
63
- return this._client.delete(`/v1/projects/${projectId}/files`, {
64
- query: { path, branch_id, recursive },
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
- projectId: string,
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(`/v1/projects/${projectId}/files/content`, {
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: Project file and val content. An empty string will create an empty
294
- * file. When creating a directory, the content should be null or undefined.
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
- * Id to query
296
+ * Whether to recursively act on all files in the project
320
297
  */
321
- branch_id?: string;
298
+ recursive: boolean;
322
299
 
323
300
  /**
324
- * Whether to recursively act on all files in the project
301
+ * Id to query
325
302
  */
326
- recursive?: boolean;
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: Project file and val content. An empty string will create an empty
349
- * file. When creating a directory, the content should be null or undefined.
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: Id of the parent directory
336
+ * Body param: Path to the directory you'd like to move this file to (e.g.
337
+ * 'folder1/folder2')
360
338
  */
361
- parent_id?: string | null;
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
- * The specified branch of the resource. Defaults to main if not provided.
355
+ * Whether to recursively act on all files in the project
378
356
  */
379
- branch_id?: string;
357
+ recursive: boolean;
380
358
 
381
359
  /**
382
- * Whether to recursively act on all files in the project
360
+ * The specified branch of the resource. Defaults to main if not provided.
383
361
  */
384
- recursive?: boolean;
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
- Vals,
5
- type ValListResponse,
6
- type ValCancelEvaluationResponse,
7
- type ValCreateParams,
8
- type ValUpdateParams,
9
- type ValListParams,
10
- type ValCreateOrUpdateParams,
11
- } from './vals';
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
- VersionListResponsesPageCursorURL,
14
- Versions,
15
- type VersionListResponse,
16
- type VersionCreateParams,
17
- type VersionRetrieveParams,
18
- type VersionListParams,
19
- } from './versions';
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 * as VersionsAPI from './versions';
6
+ import { ValsPageCursorURL } from '../shared';
7
+ import * as BranchesAPI from './branches';
8
8
  import {
9
- VersionCreateParams,
10
- VersionListParams,
11
- VersionListResponse,
12
- VersionListResponsesPageCursorURL,
13
- VersionRetrieveParams,
14
- Versions,
15
- } from './versions';
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
- versions: VersionsAPI.Versions = new VersionsAPI.Versions(this._client);
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.ExtendedVal> {
27
- return this._client.post('/v1/vals', { body, ...options });
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.ExtendedVal> {
34
- return this._client.get(`/v1/vals/${valId}`, options);
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
- * List all vals including all public vals and your unlisted and private vals
54
+ * Lists all public vals
59
55
  */
60
- list(query: ValListParams, options?: Core.RequestOptions): Core.APIPromise<ValListResponse> {
61
- return this._client.get('/v1/vals', { query, ...options });
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 val
61
+ * Delete a project
66
62
  */
67
63
  delete(valId: string, options?: Core.RequestOptions): Core.APIPromise<void> {
68
- return this._client.delete(`/v1/vals/${valId}`, {
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 ValCreateOrUpdateParams {
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.Versions = Versions;
209
- Vals.VersionListResponsesPageCursorURL = VersionListResponsesPageCursorURL;
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
- type ValListResponse as ValListResponse,
214
- type ValCancelEvaluationResponse as ValCancelEvaluationResponse,
215
- type ValCreateParams as ValCreateParams,
216
- type ValUpdateParams as ValUpdateParams,
217
- type ValListParams as ValListParams,
218
- type ValCreateOrUpdateParams as ValCreateOrUpdateParams,
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
- Versions as Versions,
223
- type VersionListResponse as VersionListResponse,
224
- VersionListResponsesPageCursorURL as VersionListResponsesPageCursorURL,
225
- type VersionCreateParams as VersionCreateParams,
226
- type VersionRetrieveParams as VersionRetrieveParams,
227
- type VersionListParams as VersionListParams,
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.38.2'; // x-release-please-version
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.38.2";
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,WAAW,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAC"}
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.38.2'; // x-release-please-version
4
+ exports.VERSION = '1.0.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,QAAQ,CAAC,CAAC,2BAA2B"}
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.38.2'; // x-release-please-version
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,QAAQ,CAAC,CAAC,2BAA2B"}
1
+ {"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,2BAA2B"}