@toloka-platform/sdk 0.1.0-preview.5 → 0.1.0-preview.7

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