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