@toloka-platform/sdk 0.1.0-preview.4 → 0.1.0-preview.6

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 (60) hide show
  1. package/README.md +1 -1
  2. package/dist/cli/toloka.js +132 -126
  3. package/dist/cli/toloka.js.jsc +0 -0
  4. package/dist/cli/toloka.js.jsc.sha256 +1 -1
  5. package/dist/cli/toloka.js.sha256 +1 -1
  6. package/docs/cli-v2.md +4 -0
  7. package/docs/cli.md +82 -6
  8. package/docs/datasets.md +8 -9
  9. package/docs/getting-started.md +2 -2
  10. package/docs/limitations.md +5 -8
  11. package/docs/troubleshooting.md +0 -11
  12. package/openapi/gen/api.ts +782 -876
  13. package/openapi/gen/models/baseModel.ts +9 -0
  14. package/openapi/gen/models/baseModelId.ts +2 -0
  15. package/openapi/gen/models/baseModelIdProperty.ts +2 -0
  16. package/openapi/gen/models/createDatasetBody.ts +2 -0
  17. package/openapi/gen/models/createDatasetBodyProfile.ts +2 -0
  18. package/openapi/gen/models/createDatasetUploadBodyFormat.ts +1 -1
  19. package/openapi/gen/models/createProjectModelBody.ts +8 -0
  20. package/openapi/gen/models/createProjectModelBodyDescription.ts +2 -0
  21. package/openapi/gen/models/dataset.ts +2 -0
  22. package/openapi/gen/models/datasetProfile.ts +3 -0
  23. package/openapi/gen/models/datasetProfileStamp.ts +6 -0
  24. package/openapi/gen/models/datasetProfileStampName.ts +2 -0
  25. package/openapi/gen/models/generationNodeSettingsAudienceAndPricingOneOfOneone.ts +1 -0
  26. package/openapi/gen/models/index.ts +21 -0
  27. package/openapi/gen/models/listBaseModels200.ts +5 -0
  28. package/openapi/gen/models/listModelVersions200.ts +7 -0
  29. package/openapi/gen/models/listModelVersionsParams.ts +5 -0
  30. package/openapi/gen/models/listProjectModels200.ts +7 -0
  31. package/openapi/gen/models/listProjectModelsParams.ts +5 -0
  32. package/openapi/gen/models/model.ts +16 -0
  33. package/openapi/gen/models/modelArchivedAt.ts +2 -0
  34. package/openapi/gen/models/modelDescription.ts +2 -0
  35. package/openapi/gen/models/modelId.ts +2 -0
  36. package/openapi/gen/models/modelVersion.ts +9 -0
  37. package/openapi/gen/models/modelVersionId.ts +2 -0
  38. package/openapi/gen/models/pipelineGraphSnapshotGraphNodesItemOneOfThreeoneSettingsAudienceAndPricingOneOfOneone.ts +1 -0
  39. package/openapi/gen/models/runCost.ts +7 -0
  40. package/openapi/gen/models/validatePipelineGraphBodyGraphNodesItemOneOfThreeoneSettingsAudienceAndPricingOneOfOneone.ts +1 -0
  41. package/package.json +2 -1
  42. package/skills/catalog.json +22 -0
  43. package/skills/{SKILL.md → toloka-build/SKILL.md} +2 -2
  44. package/skills/{references → toloka-build/references}/workflow-and-cli.md +26 -5
  45. package/skills/toloka-report-issue/SKILL.md +25 -0
  46. package/skills/toloka-report-issue/references/report-template.md +34 -0
  47. package/src/cli/analytics.ts +53 -1
  48. package/src/cli/data.ts +148 -25
  49. package/src/cli/file-system.ts +34 -0
  50. package/src/cli/format-error.ts +19 -0
  51. package/src/cli/init.ts +149 -194
  52. package/src/cli/models.ts +188 -0
  53. package/src/cli/program.ts +202 -22
  54. package/src/cli/report.ts +144 -0
  55. package/src/cli/skill.ts +363 -0
  56. package/src/client.ts +109 -35
  57. package/src/errors.ts +25 -10
  58. package/src/pipeline-graph-v1.contract.json +5 -1
  59. package/src/transport.ts +16 -13
  60. /package/skills/{references → toloka-build/references}/node-semantics.md +0 -0
@@ -2,6 +2,8 @@ import type {
2
2
  AddDatasetItems200,
3
3
  AddDatasetItemsBody,
4
4
  AttachPipelineDatasetBody,
5
+ BaseModel,
6
+ BaseModelId,
5
7
  CheckJob,
6
8
  CheckRunId,
7
9
  CopyPipelineBody,
@@ -15,6 +17,7 @@ import type {
15
17
  CreateProjectBody,
16
18
  CreateProjectFileUpload200,
17
19
  CreateProjectFileUploadBody,
20
+ CreateProjectModelBody,
18
21
  CurrentUser,
19
22
  Dataset,
20
23
  DatasetId,
@@ -24,10 +27,13 @@ import type {
24
27
  ExportPipeline200,
25
28
  GetDatasetInferredFields200,
26
29
  ImportPipelineBody,
30
+ ListBaseModels200,
27
31
  ListDatasetFields200,
28
32
  ListDatasetFieldsParams,
29
33
  ListDatasetItems200,
30
34
  ListDatasetItemsParams,
35
+ ListModelVersions200,
36
+ ListModelVersionsParams,
31
37
  ListPipelineChecks200,
32
38
  ListPipelineRunItems200,
33
39
  ListPipelineRunItemsParams,
@@ -36,11 +42,17 @@ import type {
36
42
  ListProjectDatasets200,
37
43
  ListProjectDatasetsParams,
38
44
  ListProjectFiles200,
45
+ ListProjectModels200,
46
+ ListProjectModelsParams,
39
47
  ListProjectPipelines200,
40
48
  ListProjectPipelinesParams,
41
49
  ListProjectSecrets200,
42
50
  ListProjects200,
43
51
  ListProjectsParams,
52
+ Model,
53
+ ModelId,
54
+ ModelVersion,
55
+ ModelVersionId,
44
56
  PatchPipelineNodeBody,
45
57
  Pipeline,
46
58
  PipelineCostEstimate,
@@ -54,6 +66,7 @@ import type {
54
66
  ProjectSecret,
55
67
  ProjectSecretName,
56
68
  ReplacePipelineGraphBody,
69
+ RunCost,
57
70
  RunId,
58
71
  RunItem,
59
72
  RunItemId,
@@ -63,1055 +76,948 @@ import type {
63
76
  UpdateProjectBody,
64
77
  UploadId,
65
78
  UploadJob,
66
- ValidatePipelineGraphBody
67
- } from './models';
79
+ ValidatePipelineGraphBody,
80
+ } from "./models";
68
81
 
69
- import { potatoFetch } from '../../src/transport';
70
- export const getGetCurrentUserUrl = () => {
71
-
72
-
73
-
82
+ import { potatoFetch } from "../../src/transport";
83
+ export const getListBaseModelsUrl = () => {
84
+ return `/api/v2-beta/base-models`;
85
+ };
74
86
 
75
- return `/api/v2-beta/me`
76
- }
77
-
78
- export const getCurrentUser = async ( options?: RequestInit): Promise<CurrentUser> => {
79
-
80
- return potatoFetch<CurrentUser>(getGetCurrentUserUrl(),
81
- {
87
+ export const listBaseModels = async (options?: RequestInit): Promise<ListBaseModels200> => {
88
+ return potatoFetch<ListBaseModels200>(getListBaseModelsUrl(), {
82
89
  ...options,
83
- method: 'GET'
84
-
85
-
86
- }
87
- );}
90
+ method: "GET",
91
+ });
92
+ };
88
93
 
94
+ export const getGetBaseModelUrl = (baseModelId: BaseModelId) => {
95
+ return `/api/v2-beta/base-models/${baseModelId}`;
96
+ };
89
97
 
98
+ export const getBaseModel = async (
99
+ baseModelId: BaseModelId,
100
+ options?: RequestInit,
101
+ ): Promise<BaseModel> => {
102
+ return potatoFetch<BaseModel>(getGetBaseModelUrl(baseModelId), {
103
+ ...options,
104
+ method: "GET",
105
+ });
106
+ };
90
107
 
91
- export const getListProjectsUrl = (params?: ListProjectsParams,) => {
108
+ export const getListProjectModelsUrl = (projectId: ProjectId, params?: ListProjectModelsParams) => {
92
109
  const normalizedParams = new URLSearchParams();
93
110
 
94
111
  Object.entries(params || {}).forEach(([key, value]) => {
95
-
96
112
  if (value !== undefined) {
97
- normalizedParams.append(key, value === null ? 'null' : value.toString())
113
+ normalizedParams.append(key, value === null ? "null" : value.toString());
98
114
  }
99
115
  });
100
116
 
101
117
  const stringifiedParams = normalizedParams.toString();
102
118
 
103
- return stringifiedParams.length > 0 ? `/api/v2-beta/projects?${stringifiedParams}` : `/api/v2-beta/projects`
104
- }
105
-
106
- export const listProjects = async (params?: ListProjectsParams, options?: RequestInit): Promise<ListProjects200> => {
107
-
108
- return potatoFetch<ListProjects200>(getListProjectsUrl(params),
109
- {
110
- ...options,
111
- method: 'GET'
112
-
113
-
114
- }
115
- );}
116
-
117
-
118
-
119
- export const getCreateProjectUrl = () => {
120
-
121
-
122
-
123
-
124
- return `/api/v2-beta/projects`
125
- }
126
-
127
- export const createProject = async (createProjectBody: CreateProjectBody, options?: RequestInit): Promise<Project> => {
128
-
129
- return potatoFetch<Project>(getCreateProjectUrl(),
130
- {
131
- ...options,
132
- method: 'POST',
133
- headers: { 'Content-Type': 'application/json', ...options?.headers },
134
- body: JSON.stringify(
135
- createProjectBody,)
136
- }
137
- );}
138
-
119
+ return stringifiedParams.length > 0
120
+ ? `/api/v2-beta/projects/${projectId}/models?${stringifiedParams}`
121
+ : `/api/v2-beta/projects/${projectId}/models`;
122
+ };
139
123
 
140
-
141
- export const getGetProjectByIdUrl = (projectId: ProjectId,) => {
142
-
143
-
144
-
145
-
146
- return `/api/v2-beta/projects/${projectId}`
147
- }
148
-
149
- export const getProjectById = async (projectId: ProjectId, options?: RequestInit): Promise<Project> => {
150
-
151
- return potatoFetch<Project>(getGetProjectByIdUrl(projectId),
152
- {
124
+ export const listProjectModels = async (
125
+ projectId: ProjectId,
126
+ params?: ListProjectModelsParams,
127
+ options?: RequestInit,
128
+ ): Promise<ListProjectModels200> => {
129
+ return potatoFetch<ListProjectModels200>(getListProjectModelsUrl(projectId, params), {
153
130
  ...options,
154
- method: 'GET'
155
-
156
-
157
- }
158
- );}
159
-
160
-
161
-
162
- export const getUpdateProjectUrl = (projectId: ProjectId,) => {
163
-
164
-
165
-
166
-
167
- return `/api/v2-beta/projects/${projectId}`
168
- }
169
-
170
- export const updateProject = async (projectId: ProjectId,
171
- updateProjectBody: UpdateProjectBody, options?: RequestInit): Promise<Project> => {
172
-
173
- return potatoFetch<Project>(getUpdateProjectUrl(projectId),
174
- {
175
- ...options,
176
- method: 'PATCH',
177
- headers: { 'Content-Type': 'application/json', ...options?.headers },
178
- body: JSON.stringify(
179
- updateProjectBody,)
180
- }
181
- );}
182
-
183
-
131
+ method: "GET",
132
+ });
133
+ };
134
+
135
+ export const getCreateProjectModelUrl = (projectId: ProjectId) => {
136
+ return `/api/v2-beta/projects/${projectId}/models`;
137
+ };
138
+
139
+ export const createProjectModel = async (
140
+ projectId: ProjectId,
141
+ createProjectModelBody: CreateProjectModelBody,
142
+ options?: RequestInit,
143
+ ): Promise<Model> => {
144
+ return potatoFetch<Model>(getCreateProjectModelUrl(projectId), {
145
+ ...options,
146
+ method: "POST",
147
+ headers: { "Content-Type": "application/json", ...options?.headers },
148
+ body: JSON.stringify(createProjectModelBody),
149
+ });
150
+ };
184
151
 
185
- export const getListProjectPipelinesUrl = (projectId: ProjectId,
186
- params?: ListProjectPipelinesParams,) => {
152
+ export const getListModelVersionsUrl = (
153
+ projectId: ProjectId,
154
+ modelId: ModelId,
155
+ params?: ListModelVersionsParams,
156
+ ) => {
187
157
  const normalizedParams = new URLSearchParams();
188
158
 
189
159
  Object.entries(params || {}).forEach(([key, value]) => {
190
-
191
160
  if (value !== undefined) {
192
- normalizedParams.append(key, value === null ? 'null' : value.toString())
161
+ normalizedParams.append(key, value === null ? "null" : value.toString());
193
162
  }
194
163
  });
195
164
 
196
165
  const stringifiedParams = normalizedParams.toString();
197
166
 
198
- return stringifiedParams.length > 0 ? `/api/v2-beta/projects/${projectId}/pipelines?${stringifiedParams}` : `/api/v2-beta/projects/${projectId}/pipelines`
199
- }
167
+ return stringifiedParams.length > 0
168
+ ? `/api/v2-beta/projects/${projectId}/models/${modelId}/versions?${stringifiedParams}`
169
+ : `/api/v2-beta/projects/${projectId}/models/${modelId}/versions`;
170
+ };
200
171
 
201
- export const listProjectPipelines = async (projectId: ProjectId,
202
- params?: ListProjectPipelinesParams, options?: RequestInit): Promise<ListProjectPipelines200> => {
203
-
204
- return potatoFetch<ListProjectPipelines200>(getListProjectPipelinesUrl(projectId,params),
205
- {
172
+ export const listModelVersions = async (
173
+ projectId: ProjectId,
174
+ modelId: ModelId,
175
+ params?: ListModelVersionsParams,
176
+ options?: RequestInit,
177
+ ): Promise<ListModelVersions200> => {
178
+ return potatoFetch<ListModelVersions200>(getListModelVersionsUrl(projectId, modelId, params), {
206
179
  ...options,
207
- method: 'GET'
208
-
209
-
210
- }
211
- );}
212
-
213
-
214
-
215
- export const getGetPipelineByIdUrl = (pipelineId: PipelineId,) => {
216
-
217
-
218
-
180
+ method: "GET",
181
+ });
182
+ };
219
183
 
220
- return `/api/v2-beta/pipelines/${pipelineId}`
221
- }
184
+ export const getGetModelVersionUrl = (modelVersionId: ModelVersionId) => {
185
+ return `/api/v2-beta/model-versions/${modelVersionId}`;
186
+ };
222
187
 
223
- export const getPipelineById = async (pipelineId: PipelineId, options?: RequestInit): Promise<Pipeline> => {
224
-
225
- return potatoFetch<Pipeline>(getGetPipelineByIdUrl(pipelineId),
226
- {
188
+ export const getModelVersion = async (
189
+ modelVersionId: ModelVersionId,
190
+ options?: RequestInit,
191
+ ): Promise<ModelVersion> => {
192
+ return potatoFetch<ModelVersion>(getGetModelVersionUrl(modelVersionId), {
227
193
  ...options,
228
- method: 'GET'
229
-
230
-
231
- }
232
- );}
233
-
234
-
235
-
236
- export const getUpdatePipelineUrl = (pipelineId: PipelineId,) => {
194
+ method: "GET",
195
+ });
196
+ };
237
197
 
198
+ export const getArchiveProjectModelUrl = (projectId: ProjectId, modelId: ModelId) => {
199
+ return `/api/v2-beta/projects/${projectId}/models/${modelId}/archive`;
200
+ };
238
201
 
239
-
202
+ export const archiveProjectModel = async (
203
+ projectId: ProjectId,
204
+ modelId: ModelId,
205
+ options?: RequestInit,
206
+ ): Promise<Model> => {
207
+ return potatoFetch<Model>(getArchiveProjectModelUrl(projectId, modelId), {
208
+ ...options,
209
+ method: "POST",
210
+ });
211
+ };
240
212
 
241
- return `/api/v2-beta/pipelines/${pipelineId}`
242
- }
213
+ export const getGetProjectModelUrl = (projectId: ProjectId, modelId: ModelId) => {
214
+ return `/api/v2-beta/projects/${projectId}/models/${modelId}`;
215
+ };
243
216
 
244
- export const updatePipeline = async (pipelineId: PipelineId,
245
- updatePipelineBody: UpdatePipelineBody, options?: RequestInit): Promise<Pipeline> => {
246
-
247
- return potatoFetch<Pipeline>(getUpdatePipelineUrl(pipelineId),
248
- {
217
+ export const getProjectModel = async (
218
+ projectId: ProjectId,
219
+ modelId: ModelId,
220
+ options?: RequestInit,
221
+ ): Promise<Model> => {
222
+ return potatoFetch<Model>(getGetProjectModelUrl(projectId, modelId), {
249
223
  ...options,
250
- method: 'PATCH',
251
- headers: { 'Content-Type': 'application/json', ...options?.headers },
252
- body: JSON.stringify(
253
- updatePipelineBody,)
254
- }
255
- );}
224
+ method: "GET",
225
+ });
226
+ };
256
227
 
228
+ export const getGetCurrentUserUrl = () => {
229
+ return `/api/v2-beta/me`;
230
+ };
257
231
 
232
+ export const getCurrentUser = async (options?: RequestInit): Promise<CurrentUser> => {
233
+ return potatoFetch<CurrentUser>(getGetCurrentUserUrl(), {
234
+ ...options,
235
+ method: "GET",
236
+ });
237
+ };
258
238
 
259
- export const getListProjectDatasetsUrl = (projectId: ProjectId,
260
- params?: ListProjectDatasetsParams,) => {
239
+ export const getListProjectsUrl = (params?: ListProjectsParams) => {
261
240
  const normalizedParams = new URLSearchParams();
262
241
 
263
242
  Object.entries(params || {}).forEach(([key, value]) => {
264
-
265
243
  if (value !== undefined) {
266
- normalizedParams.append(key, value === null ? 'null' : value.toString())
244
+ normalizedParams.append(key, value === null ? "null" : value.toString());
267
245
  }
268
246
  });
269
247
 
270
248
  const stringifiedParams = normalizedParams.toString();
271
249
 
272
- return stringifiedParams.length > 0 ? `/api/v2-beta/projects/${projectId}/datasets?${stringifiedParams}` : `/api/v2-beta/projects/${projectId}/datasets`
273
- }
274
-
275
- export const listProjectDatasets = async (projectId: ProjectId,
276
- params?: ListProjectDatasetsParams, options?: RequestInit): Promise<ListProjectDatasets200> => {
277
-
278
- return potatoFetch<ListProjectDatasets200>(getListProjectDatasetsUrl(projectId,params),
279
- {
280
- ...options,
281
- method: 'GET'
282
-
283
-
284
- }
285
- );}
286
-
287
-
288
-
289
- export const getCreateDatasetUrl = (projectId: ProjectId,) => {
250
+ return stringifiedParams.length > 0
251
+ ? `/api/v2-beta/projects?${stringifiedParams}`
252
+ : `/api/v2-beta/projects`;
253
+ };
290
254
 
291
-
292
-
293
-
294
- return `/api/v2-beta/projects/${projectId}/datasets`
295
- }
296
-
297
- export const createDataset = async (projectId: ProjectId,
298
- createDatasetBody: CreateDatasetBody, options?: RequestInit): Promise<Dataset> => {
299
-
300
- return potatoFetch<Dataset>(getCreateDatasetUrl(projectId),
301
- {
255
+ export const listProjects = async (
256
+ params?: ListProjectsParams,
257
+ options?: RequestInit,
258
+ ): Promise<ListProjects200> => {
259
+ return potatoFetch<ListProjects200>(getListProjectsUrl(params), {
302
260
  ...options,
303
- method: 'POST',
304
- headers: { 'Content-Type': 'application/json', ...options?.headers },
305
- body: JSON.stringify(
306
- createDatasetBody,)
307
- }
308
- );}
309
-
310
-
311
-
312
- export const getGetDatasetByIdUrl = (datasetId: DatasetId,) => {
313
-
261
+ method: "GET",
262
+ });
263
+ };
314
264
 
315
-
265
+ export const getCreateProjectUrl = () => {
266
+ return `/api/v2-beta/projects`;
267
+ };
268
+
269
+ export const createProject = async (
270
+ createProjectBody: CreateProjectBody,
271
+ options?: RequestInit,
272
+ ): Promise<Project> => {
273
+ return potatoFetch<Project>(getCreateProjectUrl(), {
274
+ ...options,
275
+ method: "POST",
276
+ headers: { "Content-Type": "application/json", ...options?.headers },
277
+ body: JSON.stringify(createProjectBody),
278
+ });
279
+ };
316
280
 
317
- return `/api/v2-beta/datasets/${datasetId}`
318
- }
281
+ export const getGetProjectByIdUrl = (projectId: ProjectId) => {
282
+ return `/api/v2-beta/projects/${projectId}`;
283
+ };
319
284
 
320
- export const getDatasetById = async (datasetId: DatasetId, options?: RequestInit): Promise<Dataset> => {
321
-
322
- return potatoFetch<Dataset>(getGetDatasetByIdUrl(datasetId),
323
- {
285
+ export const getProjectById = async (
286
+ projectId: ProjectId,
287
+ options?: RequestInit,
288
+ ): Promise<Project> => {
289
+ return potatoFetch<Project>(getGetProjectByIdUrl(projectId), {
324
290
  ...options,
325
- method: 'GET'
326
-
327
-
328
- }
329
- );}
330
-
331
-
291
+ method: "GET",
292
+ });
293
+ };
294
+
295
+ export const getUpdateProjectUrl = (projectId: ProjectId) => {
296
+ return `/api/v2-beta/projects/${projectId}`;
297
+ };
298
+
299
+ export const updateProject = async (
300
+ projectId: ProjectId,
301
+ updateProjectBody: UpdateProjectBody,
302
+ options?: RequestInit,
303
+ ): Promise<Project> => {
304
+ return potatoFetch<Project>(getUpdateProjectUrl(projectId), {
305
+ ...options,
306
+ method: "PATCH",
307
+ headers: { "Content-Type": "application/json", ...options?.headers },
308
+ body: JSON.stringify(updateProjectBody),
309
+ });
310
+ };
332
311
 
333
- export const getListDatasetFieldsUrl = (datasetId: DatasetId,
334
- params?: ListDatasetFieldsParams,) => {
312
+ export const getListProjectPipelinesUrl = (
313
+ projectId: ProjectId,
314
+ params?: ListProjectPipelinesParams,
315
+ ) => {
335
316
  const normalizedParams = new URLSearchParams();
336
317
 
337
318
  Object.entries(params || {}).forEach(([key, value]) => {
338
-
339
319
  if (value !== undefined) {
340
- normalizedParams.append(key, value === null ? 'null' : value.toString())
320
+ normalizedParams.append(key, value === null ? "null" : value.toString());
341
321
  }
342
322
  });
343
323
 
344
324
  const stringifiedParams = normalizedParams.toString();
345
325
 
346
- return stringifiedParams.length > 0 ? `/api/v2-beta/datasets/${datasetId}/fields?${stringifiedParams}` : `/api/v2-beta/datasets/${datasetId}/fields`
347
- }
326
+ return stringifiedParams.length > 0
327
+ ? `/api/v2-beta/projects/${projectId}/pipelines?${stringifiedParams}`
328
+ : `/api/v2-beta/projects/${projectId}/pipelines`;
329
+ };
348
330
 
349
- export const listDatasetFields = async (datasetId: DatasetId,
350
- params?: ListDatasetFieldsParams, options?: RequestInit): Promise<ListDatasetFields200> => {
351
-
352
- return potatoFetch<ListDatasetFields200>(getListDatasetFieldsUrl(datasetId,params),
353
- {
331
+ export const listProjectPipelines = async (
332
+ projectId: ProjectId,
333
+ params?: ListProjectPipelinesParams,
334
+ options?: RequestInit,
335
+ ): Promise<ListProjectPipelines200> => {
336
+ return potatoFetch<ListProjectPipelines200>(getListProjectPipelinesUrl(projectId, params), {
354
337
  ...options,
355
- method: 'GET'
356
-
357
-
358
- }
359
- );}
360
-
361
-
362
-
363
- export const getCreateDatasetFieldUrl = (datasetId: DatasetId,) => {
364
-
365
-
366
-
367
-
368
- return `/api/v2-beta/datasets/${datasetId}/fields`
369
- }
370
-
371
- export const createDatasetField = async (datasetId: DatasetId,
372
- createDatasetFieldBody: CreateDatasetFieldBody, options?: RequestInit): Promise<CreateDatasetField200> => {
373
-
374
- return potatoFetch<CreateDatasetField200>(getCreateDatasetFieldUrl(datasetId),
375
- {
376
- ...options,
377
- method: 'POST',
378
- headers: { 'Content-Type': 'application/json', ...options?.headers },
379
- body: JSON.stringify(
380
- createDatasetFieldBody,)
381
- }
382
- );}
383
-
384
-
385
-
386
- export const getGetDatasetInferredFieldsUrl = (datasetId: DatasetId,) => {
387
-
388
-
389
-
390
-
391
- return `/api/v2-beta/datasets/${datasetId}/inferred-fields`
392
- }
393
-
394
- export const getDatasetInferredFields = async (datasetId: DatasetId, options?: RequestInit): Promise<GetDatasetInferredFields200> => {
395
-
396
- return potatoFetch<GetDatasetInferredFields200>(getGetDatasetInferredFieldsUrl(datasetId),
397
- {
398
- ...options,
399
- method: 'GET'
400
-
401
-
402
- }
403
- );}
404
-
405
-
406
-
407
- export const getAddDatasetItemsUrl = (datasetId: DatasetId,) => {
408
-
409
-
410
-
338
+ method: "GET",
339
+ });
340
+ };
411
341
 
412
- return `/api/v2-beta/datasets/${datasetId}/items`
413
- }
342
+ export const getGetPipelineByIdUrl = (pipelineId: PipelineId) => {
343
+ return `/api/v2-beta/pipelines/${pipelineId}`;
344
+ };
414
345
 
415
- export const addDatasetItems = async (datasetId: DatasetId,
416
- addDatasetItemsBody: AddDatasetItemsBody, options?: RequestInit): Promise<AddDatasetItems200> => {
417
-
418
- return potatoFetch<AddDatasetItems200>(getAddDatasetItemsUrl(datasetId),
419
- {
346
+ export const getPipelineById = async (
347
+ pipelineId: PipelineId,
348
+ options?: RequestInit,
349
+ ): Promise<Pipeline> => {
350
+ return potatoFetch<Pipeline>(getGetPipelineByIdUrl(pipelineId), {
420
351
  ...options,
421
- method: 'POST',
422
- headers: { 'Content-Type': 'application/json', ...options?.headers },
423
- body: JSON.stringify(
424
- addDatasetItemsBody,)
425
- }
426
- );}
427
-
428
-
352
+ method: "GET",
353
+ });
354
+ };
355
+
356
+ export const getUpdatePipelineUrl = (pipelineId: PipelineId) => {
357
+ return `/api/v2-beta/pipelines/${pipelineId}`;
358
+ };
359
+
360
+ export const updatePipeline = async (
361
+ pipelineId: PipelineId,
362
+ updatePipelineBody: UpdatePipelineBody,
363
+ options?: RequestInit,
364
+ ): Promise<Pipeline> => {
365
+ return potatoFetch<Pipeline>(getUpdatePipelineUrl(pipelineId), {
366
+ ...options,
367
+ method: "PATCH",
368
+ headers: { "Content-Type": "application/json", ...options?.headers },
369
+ body: JSON.stringify(updatePipelineBody),
370
+ });
371
+ };
429
372
 
430
- export const getListDatasetItemsUrl = (datasetId: DatasetId,
431
- params?: ListDatasetItemsParams,) => {
373
+ export const getListProjectDatasetsUrl = (
374
+ projectId: ProjectId,
375
+ params?: ListProjectDatasetsParams,
376
+ ) => {
432
377
  const normalizedParams = new URLSearchParams();
433
378
 
434
379
  Object.entries(params || {}).forEach(([key, value]) => {
435
-
436
380
  if (value !== undefined) {
437
- normalizedParams.append(key, value === null ? 'null' : value.toString())
381
+ normalizedParams.append(key, value === null ? "null" : value.toString());
438
382
  }
439
383
  });
440
384
 
441
385
  const stringifiedParams = normalizedParams.toString();
442
386
 
443
- return stringifiedParams.length > 0 ? `/api/v2-beta/datasets/${datasetId}/items?${stringifiedParams}` : `/api/v2-beta/datasets/${datasetId}/items`
444
- }
387
+ return stringifiedParams.length > 0
388
+ ? `/api/v2-beta/projects/${projectId}/datasets?${stringifiedParams}`
389
+ : `/api/v2-beta/projects/${projectId}/datasets`;
390
+ };
445
391
 
446
- export const listDatasetItems = async (datasetId: DatasetId,
447
- params?: ListDatasetItemsParams, options?: RequestInit): Promise<ListDatasetItems200> => {
448
-
449
- return potatoFetch<ListDatasetItems200>(getListDatasetItemsUrl(datasetId,params),
450
- {
392
+ export const listProjectDatasets = async (
393
+ projectId: ProjectId,
394
+ params?: ListProjectDatasetsParams,
395
+ options?: RequestInit,
396
+ ): Promise<ListProjectDatasets200> => {
397
+ return potatoFetch<ListProjectDatasets200>(getListProjectDatasetsUrl(projectId, params), {
451
398
  ...options,
452
- method: 'GET'
453
-
454
-
455
- }
456
- );}
457
-
458
-
459
-
460
- export const getCreateDatasetUploadUrl = (datasetId: DatasetId,) => {
461
-
462
-
463
-
399
+ method: "GET",
400
+ });
401
+ };
402
+
403
+ export const getCreateDatasetUrl = (projectId: ProjectId) => {
404
+ return `/api/v2-beta/projects/${projectId}/datasets`;
405
+ };
406
+
407
+ export const createDataset = async (
408
+ projectId: ProjectId,
409
+ createDatasetBody: CreateDatasetBody,
410
+ options?: RequestInit,
411
+ ): Promise<Dataset> => {
412
+ return potatoFetch<Dataset>(getCreateDatasetUrl(projectId), {
413
+ ...options,
414
+ method: "POST",
415
+ headers: { "Content-Type": "application/json", ...options?.headers },
416
+ body: JSON.stringify(createDatasetBody),
417
+ });
418
+ };
464
419
 
465
- return `/api/v2-beta/datasets/${datasetId}/uploads`
466
- }
420
+ export const getGetDatasetByIdUrl = (datasetId: DatasetId) => {
421
+ return `/api/v2-beta/datasets/${datasetId}`;
422
+ };
467
423
 
468
- export const createDatasetUpload = async (datasetId: DatasetId,
469
- createDatasetUploadBody: CreateDatasetUploadBody, options?: RequestInit): Promise<CreateDatasetUpload200> => {
470
-
471
- return potatoFetch<CreateDatasetUpload200>(getCreateDatasetUploadUrl(datasetId),
472
- {
424
+ export const getDatasetById = async (
425
+ datasetId: DatasetId,
426
+ options?: RequestInit,
427
+ ): Promise<Dataset> => {
428
+ return potatoFetch<Dataset>(getGetDatasetByIdUrl(datasetId), {
473
429
  ...options,
474
- method: 'POST',
475
- headers: { 'Content-Type': 'application/json', ...options?.headers },
476
- body: JSON.stringify(
477
- createDatasetUploadBody,)
478
- }
479
- );}
480
-
481
-
430
+ method: "GET",
431
+ });
432
+ };
482
433
 
483
- export const getFinalizeDatasetUploadUrl = (uploadId: UploadId,) => {
434
+ export const getListDatasetFieldsUrl = (datasetId: DatasetId, params?: ListDatasetFieldsParams) => {
435
+ const normalizedParams = new URLSearchParams();
484
436
 
437
+ Object.entries(params || {}).forEach(([key, value]) => {
438
+ if (value !== undefined) {
439
+ normalizedParams.append(key, value === null ? "null" : value.toString());
440
+ }
441
+ });
485
442
 
486
-
443
+ const stringifiedParams = normalizedParams.toString();
487
444
 
488
- return `/api/v2-beta/uploads/${uploadId}/finalize`
489
- }
445
+ return stringifiedParams.length > 0
446
+ ? `/api/v2-beta/datasets/${datasetId}/fields?${stringifiedParams}`
447
+ : `/api/v2-beta/datasets/${datasetId}/fields`;
448
+ };
490
449
 
491
- export const finalizeDatasetUpload = async (uploadId: UploadId, options?: RequestInit): Promise<UploadJob> => {
492
-
493
- return potatoFetch<UploadJob>(getFinalizeDatasetUploadUrl(uploadId),
494
- {
450
+ export const listDatasetFields = async (
451
+ datasetId: DatasetId,
452
+ params?: ListDatasetFieldsParams,
453
+ options?: RequestInit,
454
+ ): Promise<ListDatasetFields200> => {
455
+ return potatoFetch<ListDatasetFields200>(getListDatasetFieldsUrl(datasetId, params), {
495
456
  ...options,
496
- method: 'POST'
497
-
498
-
499
- }
500
- );}
501
-
502
-
503
-
504
- export const getGetDatasetUploadUrl = (uploadId: UploadId,) => {
505
-
506
-
507
-
457
+ method: "GET",
458
+ });
459
+ };
460
+
461
+ export const getCreateDatasetFieldUrl = (datasetId: DatasetId) => {
462
+ return `/api/v2-beta/datasets/${datasetId}/fields`;
463
+ };
464
+
465
+ export const createDatasetField = async (
466
+ datasetId: DatasetId,
467
+ createDatasetFieldBody: CreateDatasetFieldBody,
468
+ options?: RequestInit,
469
+ ): Promise<CreateDatasetField200> => {
470
+ return potatoFetch<CreateDatasetField200>(getCreateDatasetFieldUrl(datasetId), {
471
+ ...options,
472
+ method: "POST",
473
+ headers: { "Content-Type": "application/json", ...options?.headers },
474
+ body: JSON.stringify(createDatasetFieldBody),
475
+ });
476
+ };
508
477
 
509
- return `/api/v2-beta/uploads/${uploadId}`
510
- }
478
+ export const getGetDatasetInferredFieldsUrl = (datasetId: DatasetId) => {
479
+ return `/api/v2-beta/datasets/${datasetId}/inferred-fields`;
480
+ };
511
481
 
512
- export const getDatasetUpload = async (uploadId: UploadId, options?: RequestInit): Promise<UploadJob> => {
513
-
514
- return potatoFetch<UploadJob>(getGetDatasetUploadUrl(uploadId),
515
- {
482
+ export const getDatasetInferredFields = async (
483
+ datasetId: DatasetId,
484
+ options?: RequestInit,
485
+ ): Promise<GetDatasetInferredFields200> => {
486
+ return potatoFetch<GetDatasetInferredFields200>(getGetDatasetInferredFieldsUrl(datasetId), {
516
487
  ...options,
517
- method: 'GET'
518
-
519
-
520
- }
521
- );}
522
-
523
-
488
+ method: "GET",
489
+ });
490
+ };
491
+
492
+ export const getAddDatasetItemsUrl = (datasetId: DatasetId) => {
493
+ return `/api/v2-beta/datasets/${datasetId}/items`;
494
+ };
495
+
496
+ export const addDatasetItems = async (
497
+ datasetId: DatasetId,
498
+ addDatasetItemsBody: AddDatasetItemsBody,
499
+ options?: RequestInit,
500
+ ): Promise<AddDatasetItems200> => {
501
+ return potatoFetch<AddDatasetItems200>(getAddDatasetItemsUrl(datasetId), {
502
+ ...options,
503
+ method: "POST",
504
+ headers: { "Content-Type": "application/json", ...options?.headers },
505
+ body: JSON.stringify(addDatasetItemsBody),
506
+ });
507
+ };
524
508
 
525
- export const getImportPipelineUrl = (projectId: ProjectId,) => {
509
+ export const getListDatasetItemsUrl = (datasetId: DatasetId, params?: ListDatasetItemsParams) => {
510
+ const normalizedParams = new URLSearchParams();
526
511
 
512
+ Object.entries(params || {}).forEach(([key, value]) => {
513
+ if (value !== undefined) {
514
+ normalizedParams.append(key, value === null ? "null" : value.toString());
515
+ }
516
+ });
527
517
 
528
-
518
+ const stringifiedParams = normalizedParams.toString();
529
519
 
530
- return `/api/v2-beta/projects/${projectId}/pipelines/import`
531
- }
520
+ return stringifiedParams.length > 0
521
+ ? `/api/v2-beta/datasets/${datasetId}/items?${stringifiedParams}`
522
+ : `/api/v2-beta/datasets/${datasetId}/items`;
523
+ };
532
524
 
533
- export const importPipeline = async (projectId: ProjectId,
534
- importPipelineBody: ImportPipelineBody, options?: RequestInit): Promise<Pipeline> => {
535
-
536
- return potatoFetch<Pipeline>(getImportPipelineUrl(projectId),
537
- {
525
+ export const listDatasetItems = async (
526
+ datasetId: DatasetId,
527
+ params?: ListDatasetItemsParams,
528
+ options?: RequestInit,
529
+ ): Promise<ListDatasetItems200> => {
530
+ return potatoFetch<ListDatasetItems200>(getListDatasetItemsUrl(datasetId, params), {
538
531
  ...options,
539
- method: 'POST',
540
- headers: { 'Content-Type': 'application/json', ...options?.headers },
541
- body: JSON.stringify(
542
- importPipelineBody,)
543
- }
544
- );}
545
-
546
-
547
-
548
- export const getAttachPipelineDatasetUrl = (pipelineId: PipelineId,) => {
549
-
550
-
551
-
532
+ method: "GET",
533
+ });
534
+ };
535
+
536
+ export const getCreateDatasetUploadUrl = (datasetId: DatasetId) => {
537
+ return `/api/v2-beta/datasets/${datasetId}/uploads`;
538
+ };
539
+
540
+ export const createDatasetUpload = async (
541
+ datasetId: DatasetId,
542
+ createDatasetUploadBody: CreateDatasetUploadBody,
543
+ options?: RequestInit,
544
+ ): Promise<CreateDatasetUpload200> => {
545
+ return potatoFetch<CreateDatasetUpload200>(getCreateDatasetUploadUrl(datasetId), {
546
+ ...options,
547
+ method: "POST",
548
+ headers: { "Content-Type": "application/json", ...options?.headers },
549
+ body: JSON.stringify(createDatasetUploadBody),
550
+ });
551
+ };
552
552
 
553
- return `/api/v2-beta/pipelines/${pipelineId}/dataset`
554
- }
553
+ export const getFinalizeDatasetUploadUrl = (uploadId: UploadId) => {
554
+ return `/api/v2-beta/uploads/${uploadId}/finalize`;
555
+ };
555
556
 
556
- export const attachPipelineDataset = async (pipelineId: PipelineId,
557
- attachPipelineDatasetBody: AttachPipelineDatasetBody, options?: RequestInit): Promise<Pipeline> => {
558
-
559
- return potatoFetch<Pipeline>(getAttachPipelineDatasetUrl(pipelineId),
560
- {
557
+ export const finalizeDatasetUpload = async (
558
+ uploadId: UploadId,
559
+ options?: RequestInit,
560
+ ): Promise<UploadJob> => {
561
+ return potatoFetch<UploadJob>(getFinalizeDatasetUploadUrl(uploadId), {
561
562
  ...options,
562
- method: 'POST',
563
- headers: { 'Content-Type': 'application/json', ...options?.headers },
564
- body: JSON.stringify(
565
- attachPipelineDatasetBody,)
566
- }
567
- );}
568
-
569
-
570
-
571
- export const getExportPipelineUrl = (pipelineId: PipelineId,) => {
572
-
573
-
574
-
563
+ method: "POST",
564
+ });
565
+ };
575
566
 
576
- return `/api/v2-beta/pipelines/${pipelineId}/export`
577
- }
567
+ export const getGetDatasetUploadUrl = (uploadId: UploadId) => {
568
+ return `/api/v2-beta/uploads/${uploadId}`;
569
+ };
578
570
 
579
- export const exportPipeline = async (pipelineId: PipelineId, options?: RequestInit): Promise<ExportPipeline200> => {
580
-
581
- return potatoFetch<ExportPipeline200>(getExportPipelineUrl(pipelineId),
582
- {
571
+ export const getDatasetUpload = async (
572
+ uploadId: UploadId,
573
+ options?: RequestInit,
574
+ ): Promise<UploadJob> => {
575
+ return potatoFetch<UploadJob>(getGetDatasetUploadUrl(uploadId), {
583
576
  ...options,
584
- method: 'GET'
585
-
586
-
587
- }
588
- );}
589
-
590
-
591
-
592
- export const getCopyPipelineUrl = (pipelineId: PipelineId,) => {
593
-
594
-
595
-
577
+ method: "GET",
578
+ });
579
+ };
596
580
 
597
- return `/api/v2-beta/pipelines/${pipelineId}/copy`
598
- }
581
+ export const getCancelDatasetUploadUrl = (uploadId: UploadId) => {
582
+ return `/api/v2-beta/uploads/${uploadId}/cancel`;
583
+ };
599
584
 
600
- export const copyPipeline = async (pipelineId: PipelineId,
601
- copyPipelineBody: CopyPipelineBody, options?: RequestInit): Promise<Pipeline> => {
602
-
603
- return potatoFetch<Pipeline>(getCopyPipelineUrl(pipelineId),
604
- {
585
+ export const cancelDatasetUpload = async (uploadId: UploadId, options?: RequestInit): Promise<void> => {
586
+ return potatoFetch<void>(getCancelDatasetUploadUrl(uploadId), {
605
587
  ...options,
606
- method: 'POST',
607
- headers: { 'Content-Type': 'application/json', ...options?.headers },
608
- body: JSON.stringify(
609
- copyPipelineBody,)
610
- }
611
- );}
612
-
613
-
614
-
615
- export const getEstimatePipelineCostUrl = (pipelineId: PipelineId,) => {
616
-
617
-
618
-
588
+ method: "POST",
589
+ });
590
+ };
591
+
592
+ export const getImportPipelineUrl = (projectId: ProjectId) => {
593
+ return `/api/v2-beta/projects/${projectId}/pipelines/import`;
594
+ };
595
+
596
+ export const importPipeline = async (
597
+ projectId: ProjectId,
598
+ importPipelineBody: ImportPipelineBody,
599
+ options?: RequestInit,
600
+ ): Promise<Pipeline> => {
601
+ return potatoFetch<Pipeline>(getImportPipelineUrl(projectId), {
602
+ ...options,
603
+ method: "POST",
604
+ headers: { "Content-Type": "application/json", ...options?.headers },
605
+ body: JSON.stringify(importPipelineBody),
606
+ });
607
+ };
608
+
609
+ export const getAttachPipelineDatasetUrl = (pipelineId: PipelineId) => {
610
+ return `/api/v2-beta/pipelines/${pipelineId}/dataset`;
611
+ };
612
+
613
+ export const attachPipelineDataset = async (
614
+ pipelineId: PipelineId,
615
+ attachPipelineDatasetBody: AttachPipelineDatasetBody,
616
+ options?: RequestInit,
617
+ ): Promise<Pipeline> => {
618
+ return potatoFetch<Pipeline>(getAttachPipelineDatasetUrl(pipelineId), {
619
+ ...options,
620
+ method: "POST",
621
+ headers: { "Content-Type": "application/json", ...options?.headers },
622
+ body: JSON.stringify(attachPipelineDatasetBody),
623
+ });
624
+ };
619
625
 
620
- return `/api/v2-beta/pipelines/${pipelineId}/cost-estimate`
621
- }
626
+ export const getExportPipelineUrl = (pipelineId: PipelineId) => {
627
+ return `/api/v2-beta/pipelines/${pipelineId}/export`;
628
+ };
622
629
 
623
- export const estimatePipelineCost = async (pipelineId: PipelineId,
624
- estimatePipelineCostBody: EstimatePipelineCostBody, options?: RequestInit): Promise<PipelineCostEstimate> => {
625
-
626
- return potatoFetch<PipelineCostEstimate>(getEstimatePipelineCostUrl(pipelineId),
627
- {
630
+ export const exportPipeline = async (
631
+ pipelineId: PipelineId,
632
+ options?: RequestInit,
633
+ ): Promise<ExportPipeline200> => {
634
+ return potatoFetch<ExportPipeline200>(getExportPipelineUrl(pipelineId), {
628
635
  ...options,
629
- method: 'POST',
630
- headers: { 'Content-Type': 'application/json', ...options?.headers },
631
- body: JSON.stringify(
632
- estimatePipelineCostBody,)
633
- }
634
- );}
635
-
636
-
637
-
638
- export const getCreatePipelineRunUrl = (pipelineId: PipelineId,) => {
639
-
640
-
641
-
636
+ method: "GET",
637
+ });
638
+ };
639
+
640
+ export const getCopyPipelineUrl = (pipelineId: PipelineId) => {
641
+ return `/api/v2-beta/pipelines/${pipelineId}/copy`;
642
+ };
643
+
644
+ export const copyPipeline = async (
645
+ pipelineId: PipelineId,
646
+ copyPipelineBody: CopyPipelineBody,
647
+ options?: RequestInit,
648
+ ): Promise<Pipeline> => {
649
+ return potatoFetch<Pipeline>(getCopyPipelineUrl(pipelineId), {
650
+ ...options,
651
+ method: "POST",
652
+ headers: { "Content-Type": "application/json", ...options?.headers },
653
+ body: JSON.stringify(copyPipelineBody),
654
+ });
655
+ };
656
+
657
+ export const getEstimatePipelineCostUrl = (pipelineId: PipelineId) => {
658
+ return `/api/v2-beta/pipelines/${pipelineId}/cost-estimate`;
659
+ };
660
+
661
+ export const estimatePipelineCost = async (
662
+ pipelineId: PipelineId,
663
+ estimatePipelineCostBody: EstimatePipelineCostBody,
664
+ options?: RequestInit,
665
+ ): Promise<PipelineCostEstimate> => {
666
+ return potatoFetch<PipelineCostEstimate>(getEstimatePipelineCostUrl(pipelineId), {
667
+ ...options,
668
+ method: "POST",
669
+ headers: { "Content-Type": "application/json", ...options?.headers },
670
+ body: JSON.stringify(estimatePipelineCostBody),
671
+ });
672
+ };
642
673
 
643
- return `/api/v2-beta/pipelines/${pipelineId}/runs`
644
- }
674
+ export const getCreatePipelineRunUrl = (pipelineId: PipelineId) => {
675
+ return `/api/v2-beta/pipelines/${pipelineId}/runs`;
676
+ };
645
677
 
646
- export const createPipelineRun = async (pipelineId: PipelineId, options?: RequestInit): Promise<RunJob> => {
647
-
648
- return potatoFetch<RunJob>(getCreatePipelineRunUrl(pipelineId),
649
- {
678
+ export const createPipelineRun = async (
679
+ pipelineId: PipelineId,
680
+ options?: RequestInit,
681
+ ): Promise<RunJob> => {
682
+ return potatoFetch<RunJob>(getCreatePipelineRunUrl(pipelineId), {
650
683
  ...options,
651
- method: 'POST'
652
-
653
-
654
- }
655
- );}
656
-
657
-
684
+ method: "POST",
685
+ });
686
+ };
658
687
 
659
- export const getListPipelineRunsUrl = (pipelineId: PipelineId,
660
- params?: ListPipelineRunsParams,) => {
688
+ export const getListPipelineRunsUrl = (pipelineId: PipelineId, params?: ListPipelineRunsParams) => {
661
689
  const normalizedParams = new URLSearchParams();
662
690
 
663
691
  Object.entries(params || {}).forEach(([key, value]) => {
664
-
665
692
  if (value !== undefined) {
666
- normalizedParams.append(key, value === null ? 'null' : value.toString())
693
+ normalizedParams.append(key, value === null ? "null" : value.toString());
667
694
  }
668
695
  });
669
696
 
670
697
  const stringifiedParams = normalizedParams.toString();
671
698
 
672
- return stringifiedParams.length > 0 ? `/api/v2-beta/pipelines/${pipelineId}/runs?${stringifiedParams}` : `/api/v2-beta/pipelines/${pipelineId}/runs`
673
- }
699
+ return stringifiedParams.length > 0
700
+ ? `/api/v2-beta/pipelines/${pipelineId}/runs?${stringifiedParams}`
701
+ : `/api/v2-beta/pipelines/${pipelineId}/runs`;
702
+ };
674
703
 
675
- export const listPipelineRuns = async (pipelineId: PipelineId,
676
- params?: ListPipelineRunsParams, options?: RequestInit): Promise<ListPipelineRuns200> => {
677
-
678
- return potatoFetch<ListPipelineRuns200>(getListPipelineRunsUrl(pipelineId,params),
679
- {
704
+ export const listPipelineRuns = async (
705
+ pipelineId: PipelineId,
706
+ params?: ListPipelineRunsParams,
707
+ options?: RequestInit,
708
+ ): Promise<ListPipelineRuns200> => {
709
+ return potatoFetch<ListPipelineRuns200>(getListPipelineRunsUrl(pipelineId, params), {
680
710
  ...options,
681
- method: 'GET'
682
-
683
-
684
- }
685
- );}
686
-
687
-
688
-
689
- export const getGetPipelineRunUrl = (runId: RunId,) => {
690
-
691
-
692
-
711
+ method: "GET",
712
+ });
713
+ };
693
714
 
694
- return `/api/v2-beta/runs/${runId}`
695
- }
715
+ export const getGetPipelineRunUrl = (runId: RunId) => {
716
+ return `/api/v2-beta/runs/${runId}`;
717
+ };
696
718
 
697
719
  export const getPipelineRun = async (runId: RunId, options?: RequestInit): Promise<RunJob> => {
698
-
699
- return potatoFetch<RunJob>(getGetPipelineRunUrl(runId),
700
- {
720
+ return potatoFetch<RunJob>(getGetPipelineRunUrl(runId), {
701
721
  ...options,
702
- method: 'GET'
703
-
704
-
705
- }
706
- );}
707
-
708
-
709
-
710
- export const getCancelPipelineRunUrl = (runId: RunId,) => {
711
-
712
-
713
-
714
-
715
- return `/api/v2-beta/runs/${runId}/cancel`
716
- }
717
-
718
- export const cancelPipelineRun = async (runId: RunId, options?: RequestInit): Promise<RunJob> => {
719
-
720
- return potatoFetch<RunJob>(getCancelPipelineRunUrl(runId),
721
- {
722
- ...options,
723
- method: 'POST'
724
-
725
-
726
- }
727
- );}
728
-
729
-
730
-
731
- export const getCreateDatasetExportUrl = (datasetId: DatasetId,) => {
732
-
733
-
734
-
735
-
736
- return `/api/v2-beta/datasets/${datasetId}/exports`
737
- }
738
-
739
- export const createDatasetExport = async (datasetId: DatasetId,
740
- createDatasetExportBody: CreateDatasetExportBody, options?: RequestInit): Promise<ExportJob> => {
741
-
742
- return potatoFetch<ExportJob>(getCreateDatasetExportUrl(datasetId),
743
- {
744
- ...options,
745
- method: 'POST',
746
- headers: { 'Content-Type': 'application/json', ...options?.headers },
747
- body: JSON.stringify(
748
- createDatasetExportBody,)
749
- }
750
- );}
751
-
752
-
753
-
754
- export const getGetDatasetExportUrl = (exportId: ExportId,) => {
755
-
756
-
757
-
758
-
759
- return `/api/v2-beta/exports/${exportId}`
760
- }
761
-
762
- export const getDatasetExport = async (exportId: ExportId, options?: RequestInit): Promise<ExportJob> => {
763
-
764
- return potatoFetch<ExportJob>(getGetDatasetExportUrl(exportId),
765
- {
766
- ...options,
767
- method: 'GET'
768
-
769
-
770
- }
771
- );}
772
-
773
-
774
-
775
- export const getGetPipelineGraphSnapshotUrl = (pipelineId: PipelineId,) => {
776
-
777
-
778
-
779
-
780
- return `/api/v2-beta/pipelines/${pipelineId}/graph`
781
- }
782
-
783
- export const getPipelineGraphSnapshot = async (pipelineId: PipelineId, options?: RequestInit): Promise<PipelineGraphSnapshot> => {
784
-
785
- return potatoFetch<PipelineGraphSnapshot>(getGetPipelineGraphSnapshotUrl(pipelineId),
786
- {
787
- ...options,
788
- method: 'GET'
789
-
790
-
791
- }
792
- );}
793
-
794
-
795
-
796
- export const getReplacePipelineGraphUrl = (pipelineId: PipelineId,) => {
797
-
798
-
799
-
800
-
801
- return `/api/v2-beta/pipelines/${pipelineId}/graph`
802
- }
803
-
804
- export const replacePipelineGraph = async (pipelineId: PipelineId,
805
- replacePipelineGraphBody: ReplacePipelineGraphBody, options?: RequestInit): Promise<Pipeline> => {
806
-
807
- return potatoFetch<Pipeline>(getReplacePipelineGraphUrl(pipelineId),
808
- {
809
- ...options,
810
- method: 'PUT',
811
- headers: { 'Content-Type': 'application/json', ...options?.headers },
812
- body: JSON.stringify(
813
- replacePipelineGraphBody,)
814
- }
815
- );}
816
-
817
-
818
-
819
- export const getValidatePipelineGraphUrl = (pipelineId: PipelineId,) => {
820
-
821
-
822
-
722
+ method: "GET",
723
+ });
724
+ };
823
725
 
824
- return `/api/v2-beta/pipelines/${pipelineId}/graph/validate`
825
- }
726
+ export const getGetPipelineRunCostUrl = (runId: RunId) => {
727
+ return `/api/v2-beta/runs/${runId}/cost`;
728
+ };
826
729
 
827
- export const validatePipelineGraph = async (pipelineId: PipelineId,
828
- validatePipelineGraphBody: ValidatePipelineGraphBody, options?: RequestInit): Promise<PipelineValidationReport> => {
829
-
830
- return potatoFetch<PipelineValidationReport>(getValidatePipelineGraphUrl(pipelineId),
831
- {
730
+ export const getPipelineRunCost = async (runId: RunId, options?: RequestInit): Promise<RunCost> => {
731
+ return potatoFetch<RunCost>(getGetPipelineRunCostUrl(runId), {
832
732
  ...options,
833
- method: 'POST',
834
- headers: { 'Content-Type': 'application/json', ...options?.headers },
835
- body: JSON.stringify(
836
- validatePipelineGraphBody,)
837
- }
838
- );}
839
-
840
-
841
-
842
- export const getPatchPipelineNodeUrl = (pipelineId: PipelineId,
843
- nodeId: string,) => {
844
-
845
-
846
-
733
+ method: "GET",
734
+ });
735
+ };
847
736
 
848
- return `/api/v2-beta/pipelines/${pipelineId}/graph/nodes/${nodeId}`
849
- }
737
+ export const getCancelPipelineRunUrl = (runId: RunId) => {
738
+ return `/api/v2-beta/runs/${runId}/cancel`;
739
+ };
850
740
 
851
- export const patchPipelineNode = async (pipelineId: PipelineId,
852
- nodeId: string,
853
- patchPipelineNodeBody: PatchPipelineNodeBody, options?: RequestInit): Promise<Pipeline> => {
854
-
855
- return potatoFetch<Pipeline>(getPatchPipelineNodeUrl(pipelineId,nodeId),
856
- {
741
+ export const cancelPipelineRun = async (runId: RunId, options?: RequestInit): Promise<RunJob> => {
742
+ return potatoFetch<RunJob>(getCancelPipelineRunUrl(runId), {
857
743
  ...options,
858
- method: 'PATCH',
859
- headers: { 'Content-Type': 'application/json', ...options?.headers },
860
- body: JSON.stringify(
861
- patchPipelineNodeBody,)
862
- }
863
- );}
864
-
865
-
866
-
867
- export const getListProjectSecretsUrl = (projectId: ProjectId,) => {
868
-
869
-
870
-
744
+ method: "POST",
745
+ });
746
+ };
747
+
748
+ export const getCreateDatasetExportUrl = (datasetId: DatasetId) => {
749
+ return `/api/v2-beta/datasets/${datasetId}/exports`;
750
+ };
751
+
752
+ export const createDatasetExport = async (
753
+ datasetId: DatasetId,
754
+ createDatasetExportBody: CreateDatasetExportBody,
755
+ options?: RequestInit,
756
+ ): Promise<ExportJob> => {
757
+ return potatoFetch<ExportJob>(getCreateDatasetExportUrl(datasetId), {
758
+ ...options,
759
+ method: "POST",
760
+ headers: { "Content-Type": "application/json", ...options?.headers },
761
+ body: JSON.stringify(createDatasetExportBody),
762
+ });
763
+ };
871
764
 
872
- return `/api/v2-beta/projects/${projectId}/secrets`
873
- }
765
+ export const getGetDatasetExportUrl = (exportId: ExportId) => {
766
+ return `/api/v2-beta/exports/${exportId}`;
767
+ };
874
768
 
875
- export const listProjectSecrets = async (projectId: ProjectId, options?: RequestInit): Promise<ListProjectSecrets200> => {
876
-
877
- return potatoFetch<ListProjectSecrets200>(getListProjectSecretsUrl(projectId),
878
- {
769
+ export const getDatasetExport = async (
770
+ exportId: ExportId,
771
+ options?: RequestInit,
772
+ ): Promise<ExportJob> => {
773
+ return potatoFetch<ExportJob>(getGetDatasetExportUrl(exportId), {
879
774
  ...options,
880
- method: 'GET'
881
-
882
-
883
- }
884
- );}
885
-
886
-
887
-
888
- export const getSetProjectSecretUrl = (projectId: ProjectId,
889
- name: ProjectSecretName,) => {
890
-
891
-
892
-
775
+ method: "GET",
776
+ });
777
+ };
893
778
 
894
- return `/api/v2-beta/projects/${projectId}/secrets/${name}`
895
- }
779
+ export const getGetPipelineGraphSnapshotUrl = (pipelineId: PipelineId) => {
780
+ return `/api/v2-beta/pipelines/${pipelineId}/graph`;
781
+ };
896
782
 
897
- export const setProjectSecret = async (projectId: ProjectId,
898
- name: ProjectSecretName,
899
- setProjectSecretBody: SetProjectSecretBody, options?: RequestInit): Promise<ProjectSecret> => {
900
-
901
- return potatoFetch<ProjectSecret>(getSetProjectSecretUrl(projectId,name),
902
- {
783
+ export const getPipelineGraphSnapshot = async (
784
+ pipelineId: PipelineId,
785
+ options?: RequestInit,
786
+ ): Promise<PipelineGraphSnapshot> => {
787
+ return potatoFetch<PipelineGraphSnapshot>(getGetPipelineGraphSnapshotUrl(pipelineId), {
903
788
  ...options,
904
- method: 'PUT',
905
- headers: { 'Content-Type': 'application/json', ...options?.headers },
906
- body: JSON.stringify(
907
- setProjectSecretBody,)
908
- }
909
- );}
910
-
911
-
912
-
913
- export const getListProjectFilesUrl = (projectId: ProjectId,) => {
914
-
915
-
916
-
789
+ method: "GET",
790
+ });
791
+ };
792
+
793
+ export const getReplacePipelineGraphUrl = (pipelineId: PipelineId) => {
794
+ return `/api/v2-beta/pipelines/${pipelineId}/graph`;
795
+ };
796
+
797
+ export const replacePipelineGraph = async (
798
+ pipelineId: PipelineId,
799
+ replacePipelineGraphBody: ReplacePipelineGraphBody,
800
+ options?: RequestInit,
801
+ ): Promise<Pipeline> => {
802
+ return potatoFetch<Pipeline>(getReplacePipelineGraphUrl(pipelineId), {
803
+ ...options,
804
+ method: "PUT",
805
+ headers: { "Content-Type": "application/json", ...options?.headers },
806
+ body: JSON.stringify(replacePipelineGraphBody),
807
+ });
808
+ };
809
+
810
+ export const getValidatePipelineGraphUrl = (pipelineId: PipelineId) => {
811
+ return `/api/v2-beta/pipelines/${pipelineId}/graph/validate`;
812
+ };
813
+
814
+ export const validatePipelineGraph = async (
815
+ pipelineId: PipelineId,
816
+ validatePipelineGraphBody: ValidatePipelineGraphBody,
817
+ options?: RequestInit,
818
+ ): Promise<PipelineValidationReport> => {
819
+ return potatoFetch<PipelineValidationReport>(getValidatePipelineGraphUrl(pipelineId), {
820
+ ...options,
821
+ method: "POST",
822
+ headers: { "Content-Type": "application/json", ...options?.headers },
823
+ body: JSON.stringify(validatePipelineGraphBody),
824
+ });
825
+ };
826
+
827
+ export const getPatchPipelineNodeUrl = (pipelineId: PipelineId, nodeId: string) => {
828
+ return `/api/v2-beta/pipelines/${pipelineId}/graph/nodes/${nodeId}`;
829
+ };
830
+
831
+ export const patchPipelineNode = async (
832
+ pipelineId: PipelineId,
833
+ nodeId: string,
834
+ patchPipelineNodeBody: PatchPipelineNodeBody,
835
+ options?: RequestInit,
836
+ ): Promise<Pipeline> => {
837
+ return potatoFetch<Pipeline>(getPatchPipelineNodeUrl(pipelineId, nodeId), {
838
+ ...options,
839
+ method: "PATCH",
840
+ headers: { "Content-Type": "application/json", ...options?.headers },
841
+ body: JSON.stringify(patchPipelineNodeBody),
842
+ });
843
+ };
917
844
 
918
- return `/api/v2-beta/projects/${projectId}/files`
919
- }
845
+ export const getListProjectSecretsUrl = (projectId: ProjectId) => {
846
+ return `/api/v2-beta/projects/${projectId}/secrets`;
847
+ };
920
848
 
921
- export const listProjectFiles = async (projectId: ProjectId, options?: RequestInit): Promise<ListProjectFiles200> => {
922
-
923
- return potatoFetch<ListProjectFiles200>(getListProjectFilesUrl(projectId),
924
- {
849
+ export const listProjectSecrets = async (
850
+ projectId: ProjectId,
851
+ options?: RequestInit,
852
+ ): Promise<ListProjectSecrets200> => {
853
+ return potatoFetch<ListProjectSecrets200>(getListProjectSecretsUrl(projectId), {
925
854
  ...options,
926
- method: 'GET'
927
-
928
-
929
- }
930
- );}
931
-
932
-
933
-
934
- export const getCreateProjectFileUploadUrl = (projectId: ProjectId,) => {
935
-
936
-
937
-
855
+ method: "GET",
856
+ });
857
+ };
858
+
859
+ export const getSetProjectSecretUrl = (projectId: ProjectId, name: ProjectSecretName) => {
860
+ return `/api/v2-beta/projects/${projectId}/secrets/${name}`;
861
+ };
862
+
863
+ export const setProjectSecret = async (
864
+ projectId: ProjectId,
865
+ name: ProjectSecretName,
866
+ setProjectSecretBody: SetProjectSecretBody,
867
+ options?: RequestInit,
868
+ ): Promise<ProjectSecret> => {
869
+ return potatoFetch<ProjectSecret>(getSetProjectSecretUrl(projectId, name), {
870
+ ...options,
871
+ method: "PUT",
872
+ headers: { "Content-Type": "application/json", ...options?.headers },
873
+ body: JSON.stringify(setProjectSecretBody),
874
+ });
875
+ };
938
876
 
939
- return `/api/v2-beta/projects/${projectId}/files`
940
- }
877
+ export const getListProjectFilesUrl = (projectId: ProjectId) => {
878
+ return `/api/v2-beta/projects/${projectId}/files`;
879
+ };
941
880
 
942
- export const createProjectFileUpload = async (projectId: ProjectId,
943
- createProjectFileUploadBody: CreateProjectFileUploadBody, options?: RequestInit): Promise<CreateProjectFileUpload200> => {
944
-
945
- return potatoFetch<CreateProjectFileUpload200>(getCreateProjectFileUploadUrl(projectId),
946
- {
881
+ export const listProjectFiles = async (
882
+ projectId: ProjectId,
883
+ options?: RequestInit,
884
+ ): Promise<ListProjectFiles200> => {
885
+ return potatoFetch<ListProjectFiles200>(getListProjectFilesUrl(projectId), {
947
886
  ...options,
948
- method: 'POST',
949
- headers: { 'Content-Type': 'application/json', ...options?.headers },
950
- body: JSON.stringify(
951
- createProjectFileUploadBody,)
952
- }
953
- );}
954
-
955
-
956
-
957
- export const getFinalizeProjectFileUploadUrl = (projectId: ProjectId,
958
- fileId: ProjectFileId,) => {
959
-
960
-
961
-
887
+ method: "GET",
888
+ });
889
+ };
890
+
891
+ export const getCreateProjectFileUploadUrl = (projectId: ProjectId) => {
892
+ return `/api/v2-beta/projects/${projectId}/files`;
893
+ };
894
+
895
+ export const createProjectFileUpload = async (
896
+ projectId: ProjectId,
897
+ createProjectFileUploadBody: CreateProjectFileUploadBody,
898
+ options?: RequestInit,
899
+ ): Promise<CreateProjectFileUpload200> => {
900
+ return potatoFetch<CreateProjectFileUpload200>(getCreateProjectFileUploadUrl(projectId), {
901
+ ...options,
902
+ method: "POST",
903
+ headers: { "Content-Type": "application/json", ...options?.headers },
904
+ body: JSON.stringify(createProjectFileUploadBody),
905
+ });
906
+ };
962
907
 
963
- return `/api/v2-beta/projects/${projectId}/files/${fileId}/finalize`
964
- }
908
+ export const getFinalizeProjectFileUploadUrl = (projectId: ProjectId, fileId: ProjectFileId) => {
909
+ return `/api/v2-beta/projects/${projectId}/files/${fileId}/finalize`;
910
+ };
965
911
 
966
- export const finalizeProjectFileUpload = async (projectId: ProjectId,
967
- fileId: ProjectFileId, options?: RequestInit): Promise<ProjectFile> => {
968
-
969
- return potatoFetch<ProjectFile>(getFinalizeProjectFileUploadUrl(projectId,fileId),
970
- {
912
+ export const finalizeProjectFileUpload = async (
913
+ projectId: ProjectId,
914
+ fileId: ProjectFileId,
915
+ options?: RequestInit,
916
+ ): Promise<ProjectFile> => {
917
+ return potatoFetch<ProjectFile>(getFinalizeProjectFileUploadUrl(projectId, fileId), {
971
918
  ...options,
972
- method: 'POST'
973
-
974
-
975
- }
976
- );}
977
-
978
-
979
-
980
- export const getDeleteProjectFileUrl = (projectId: ProjectId,
981
- fileId: ProjectFileId,) => {
982
-
983
-
984
-
919
+ method: "POST",
920
+ });
921
+ };
985
922
 
986
- return `/api/v2-beta/projects/${projectId}/files/${fileId}`
987
- }
923
+ export const getDeleteProjectFileUrl = (projectId: ProjectId, fileId: ProjectFileId) => {
924
+ return `/api/v2-beta/projects/${projectId}/files/${fileId}`;
925
+ };
988
926
 
989
- export const deleteProjectFile = async (projectId: ProjectId,
990
- fileId: ProjectFileId, options?: RequestInit): Promise<void> => {
991
-
992
- return potatoFetch<void>(getDeleteProjectFileUrl(projectId,fileId),
993
- {
927
+ export const deleteProjectFile = async (
928
+ projectId: ProjectId,
929
+ fileId: ProjectFileId,
930
+ options?: RequestInit,
931
+ ): Promise<void> => {
932
+ return potatoFetch<void>(getDeleteProjectFileUrl(projectId, fileId), {
994
933
  ...options,
995
- method: 'DELETE'
996
-
997
-
998
- }
999
- );}
1000
-
1001
-
934
+ method: "DELETE",
935
+ });
936
+ };
1002
937
 
1003
- export const getListPipelineRunItemsUrl = (runId: RunId,
1004
- params?: ListPipelineRunItemsParams,) => {
938
+ export const getListPipelineRunItemsUrl = (runId: RunId, params?: ListPipelineRunItemsParams) => {
1005
939
  const normalizedParams = new URLSearchParams();
1006
940
 
1007
941
  Object.entries(params || {}).forEach(([key, value]) => {
1008
-
1009
942
  if (value !== undefined) {
1010
- normalizedParams.append(key, value === null ? 'null' : value.toString())
943
+ normalizedParams.append(key, value === null ? "null" : value.toString());
1011
944
  }
1012
945
  });
1013
946
 
1014
947
  const stringifiedParams = normalizedParams.toString();
1015
948
 
1016
- return stringifiedParams.length > 0 ? `/api/v2-beta/runs/${runId}/items?${stringifiedParams}` : `/api/v2-beta/runs/${runId}/items`
1017
- }
949
+ return stringifiedParams.length > 0
950
+ ? `/api/v2-beta/runs/${runId}/items?${stringifiedParams}`
951
+ : `/api/v2-beta/runs/${runId}/items`;
952
+ };
1018
953
 
1019
- export const listPipelineRunItems = async (runId: RunId,
1020
- params?: ListPipelineRunItemsParams, options?: RequestInit): Promise<ListPipelineRunItems200> => {
1021
-
1022
- return potatoFetch<ListPipelineRunItems200>(getListPipelineRunItemsUrl(runId,params),
1023
- {
954
+ export const listPipelineRunItems = async (
955
+ runId: RunId,
956
+ params?: ListPipelineRunItemsParams,
957
+ options?: RequestInit,
958
+ ): Promise<ListPipelineRunItems200> => {
959
+ return potatoFetch<ListPipelineRunItems200>(getListPipelineRunItemsUrl(runId, params), {
1024
960
  ...options,
1025
- method: 'GET'
1026
-
1027
-
1028
- }
1029
- );}
1030
-
1031
-
1032
-
1033
- export const getGetPipelineRunItemUrl = (runId: RunId,
1034
- itemId: RunItemId,) => {
1035
-
1036
-
1037
-
1038
-
1039
- return `/api/v2-beta/runs/${runId}/items/${itemId}`
1040
- }
1041
-
1042
- export const getPipelineRunItem = async (runId: RunId,
1043
- itemId: RunItemId, options?: RequestInit): Promise<RunItem> => {
1044
-
1045
- return potatoFetch<RunItem>(getGetPipelineRunItemUrl(runId,itemId),
1046
- {
1047
- ...options,
1048
- method: 'GET'
1049
-
1050
-
1051
- }
1052
- );}
1053
-
1054
-
1055
-
1056
- export const getListPipelineChecksUrl = (pipelineId: PipelineId,) => {
1057
-
1058
-
1059
-
961
+ method: "GET",
962
+ });
963
+ };
1060
964
 
1061
- return `/api/v2-beta/pipelines/${pipelineId}/checks`
1062
- }
965
+ export const getGetPipelineRunItemUrl = (runId: RunId, itemId: RunItemId) => {
966
+ return `/api/v2-beta/runs/${runId}/items/${itemId}`;
967
+ };
1063
968
 
1064
- export const listPipelineChecks = async (pipelineId: PipelineId, options?: RequestInit): Promise<ListPipelineChecks200> => {
1065
-
1066
- return potatoFetch<ListPipelineChecks200>(getListPipelineChecksUrl(pipelineId),
1067
- {
969
+ export const getPipelineRunItem = async (
970
+ runId: RunId,
971
+ itemId: RunItemId,
972
+ options?: RequestInit,
973
+ ): Promise<RunItem> => {
974
+ return potatoFetch<RunItem>(getGetPipelineRunItemUrl(runId, itemId), {
1068
975
  ...options,
1069
- method: 'GET'
1070
-
1071
-
1072
- }
1073
- );}
1074
-
1075
-
1076
-
1077
- export const getCreatePipelineCheckUrl = (pipelineId: PipelineId,) => {
1078
-
1079
-
1080
-
976
+ method: "GET",
977
+ });
978
+ };
1081
979
 
1082
- return `/api/v2-beta/pipelines/${pipelineId}/checks`
1083
- }
980
+ export const getListPipelineChecksUrl = (pipelineId: PipelineId) => {
981
+ return `/api/v2-beta/pipelines/${pipelineId}/checks`;
982
+ };
1084
983
 
1085
- export const createPipelineCheck = async (pipelineId: PipelineId,
1086
- createPipelineCheckBody: CreatePipelineCheckBody, options?: RequestInit): Promise<CheckJob> => {
1087
-
1088
- return potatoFetch<CheckJob>(getCreatePipelineCheckUrl(pipelineId),
1089
- {
984
+ export const listPipelineChecks = async (
985
+ pipelineId: PipelineId,
986
+ options?: RequestInit,
987
+ ): Promise<ListPipelineChecks200> => {
988
+ return potatoFetch<ListPipelineChecks200>(getListPipelineChecksUrl(pipelineId), {
1090
989
  ...options,
1091
- method: 'POST',
1092
- headers: { 'Content-Type': 'application/json', ...options?.headers },
1093
- body: JSON.stringify(
1094
- createPipelineCheckBody,)
1095
- }
1096
- );}
1097
-
1098
-
1099
-
1100
- export const getGetPipelineCheckUrl = (checkRunId: CheckRunId,) => {
1101
-
1102
-
1103
-
990
+ method: "GET",
991
+ });
992
+ };
993
+
994
+ export const getCreatePipelineCheckUrl = (pipelineId: PipelineId) => {
995
+ return `/api/v2-beta/pipelines/${pipelineId}/checks`;
996
+ };
997
+
998
+ export const createPipelineCheck = async (
999
+ pipelineId: PipelineId,
1000
+ createPipelineCheckBody: CreatePipelineCheckBody,
1001
+ options?: RequestInit,
1002
+ ): Promise<CheckJob> => {
1003
+ return potatoFetch<CheckJob>(getCreatePipelineCheckUrl(pipelineId), {
1004
+ ...options,
1005
+ method: "POST",
1006
+ headers: { "Content-Type": "application/json", ...options?.headers },
1007
+ body: JSON.stringify(createPipelineCheckBody),
1008
+ });
1009
+ };
1104
1010
 
1105
- return `/api/v2-beta/checks/${checkRunId}`
1106
- }
1011
+ export const getGetPipelineCheckUrl = (checkRunId: CheckRunId) => {
1012
+ return `/api/v2-beta/checks/${checkRunId}`;
1013
+ };
1107
1014
 
1108
- export const getPipelineCheck = async (checkRunId: CheckRunId, options?: RequestInit): Promise<CheckJob> => {
1109
-
1110
- return potatoFetch<CheckJob>(getGetPipelineCheckUrl(checkRunId),
1111
- {
1015
+ export const getPipelineCheck = async (
1016
+ checkRunId: CheckRunId,
1017
+ options?: RequestInit,
1018
+ ): Promise<CheckJob> => {
1019
+ return potatoFetch<CheckJob>(getGetPipelineCheckUrl(checkRunId), {
1112
1020
  ...options,
1113
- method: 'GET'
1114
-
1115
-
1116
- }
1117
- );}
1021
+ method: "GET",
1022
+ });
1023
+ };