@toloka-platform/sdk 0.1.0 → 0.2.0-preview.1
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/README.md +2 -2
- package/dist/cli/toloka.js +138 -136
- 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-v2.md +1 -1
- package/docs/cli.md +3 -1
- package/docs/getting-started.md +1 -1
- package/docs/limitations.md +2 -2
- package/docs/testing.md +1 -1
- package/examples/face-image-collection/README.md +1 -1
- package/openapi/gen/api.ts +1482 -777
- package/openapi/gen/models/createDatasetExportBody.ts +5 -3
- package/openapi/gen/models/createDatasetExportBodyFormat.ts +2 -0
- package/openapi/gen/models/createProjectTrainingBody.ts +6 -0
- package/openapi/gen/models/createTrainingRunBody.ts +6 -0
- package/openapi/gen/models/datasetExportReportTokens.ts +4 -1
- package/openapi/gen/models/datasetExportReportTokensEstimatorVersion.ts +2 -0
- package/openapi/gen/models/datasetExportReportTokensTotal.ts +2 -0
- package/openapi/gen/models/estimateTrainingCostBody.ts +5 -0
- package/openapi/gen/models/exportJob.ts +2 -0
- package/openapi/gen/models/exportJobError.ts +3 -0
- package/openapi/gen/models/exportJobErrorAnyOf.ts +7 -0
- package/openapi/gen/models/exportJobErrorAnyOfCode.ts +2 -0
- package/openapi/gen/models/exportJobStatus.ts +1 -1
- package/openapi/gen/models/getTrainingRunLogsParams.ts +5 -0
- package/openapi/gen/models/gistingTrainingConfiguration.ts +13 -0
- package/openapi/gen/models/gistingTrainingConfigurationInput.ts +13 -0
- package/openapi/gen/models/gistingTrainingConfigurationInputRegime.ts +2 -0
- package/openapi/gen/models/gistingTrainingConfigurationRegime.ts +2 -0
- package/openapi/gen/models/index.ts +230 -16
- package/openapi/gen/models/listProjectTrainings200.ts +7 -0
- package/openapi/gen/models/listProjectTrainingsParams.ts +5 -0
- package/openapi/gen/models/listTrainingRuns200.ts +7 -0
- package/openapi/gen/models/listTrainingRunsParams.ts +5 -0
- package/openapi/gen/models/modelVersion.ts +6 -1
- package/openapi/gen/models/modelVersionContent.ts +4 -0
- package/openapi/gen/models/modelVersionContentDownload.ts +11 -0
- package/openapi/gen/models/modelVersionContentDownloadContent.ts +4 -0
- package/openapi/gen/models/modelVersionContentDownloadContentOneOf.ts +10 -0
- package/openapi/gen/models/modelVersionContentDownloadContentOneOfManifestItem.ts +8 -0
- package/openapi/gen/models/modelVersionContentDownloadContentOneOfManifestItemMediaType.ts +2 -0
- package/openapi/gen/models/modelVersionContentDownloadContentOneOfNine.ts +8 -0
- package/openapi/gen/models/modelVersionContentDownloadContentOneOfNineManifestItem.ts +8 -0
- package/openapi/gen/models/modelVersionContentDownloadContentOneOfNineManifestItemMediaType.ts +2 -0
- package/openapi/gen/models/modelVersionContentDownloadContentOneOfNineRuntimeBase.ts +2 -0
- package/openapi/gen/models/modelVersionContentDownloadContentOneOfParent.ts +4 -0
- package/openapi/gen/models/modelVersionContentDownloadContentOneOfParentOneOf.ts +6 -0
- package/openapi/gen/models/modelVersionContentDownloadContentOneOfParentOneOfBaseModelId.ts +2 -0
- package/openapi/gen/models/modelVersionContentDownloadContentOneOfParentOneOfThree.ts +5 -0
- package/openapi/gen/models/modelVersionContentDownloadContentOneOfRuntimeBase.ts +2 -0
- package/openapi/gen/models/modelVersionContentDownloadFilesItem.ts +9 -0
- package/openapi/gen/models/modelVersionContentDownloadFilesItemMediaType.ts +2 -0
- package/openapi/gen/models/modelVersionContentOneOf.ts +10 -0
- package/openapi/gen/models/modelVersionContentOneOfManifestItem.ts +8 -0
- package/openapi/gen/models/modelVersionContentOneOfManifestItemMediaType.ts +2 -0
- package/openapi/gen/models/modelVersionContentOneOfNine.ts +8 -0
- package/openapi/gen/models/modelVersionContentOneOfNineManifestItem.ts +8 -0
- package/openapi/gen/models/modelVersionContentOneOfNineManifestItemMediaType.ts +2 -0
- package/openapi/gen/models/modelVersionContentOneOfNineRuntimeBase.ts +2 -0
- package/openapi/gen/models/modelVersionContentOneOfParent.ts +4 -0
- package/openapi/gen/models/modelVersionContentOneOfParentOneOf.ts +6 -0
- package/openapi/gen/models/modelVersionContentOneOfParentOneOfBaseModelId.ts +2 -0
- package/openapi/gen/models/modelVersionContentOneOfParentOneOfThree.ts +5 -0
- package/openapi/gen/models/modelVersionContentOneOfRuntimeBase.ts +2 -0
- package/openapi/gen/models/modelVersionProducer.ts +5 -0
- package/openapi/gen/models/prepareTrainingCostEstimateInputsBody.ts +2 -0
- package/openapi/gen/models/replaceTrainingConfigurationBody.ts +5 -0
- package/openapi/gen/models/sftTrainingConfiguration.ts +13 -0
- package/openapi/gen/models/sftTrainingConfigurationInput.ts +13 -0
- package/openapi/gen/models/sftTrainingConfigurationInputRegime.ts +2 -0
- package/openapi/gen/models/sftTrainingConfigurationRegime.ts +2 -0
- package/openapi/gen/models/training.ts +16 -0
- package/openapi/gen/models/trainingArchivedAt.ts +2 -0
- package/openapi/gen/models/trainingConfiguration.ts +4 -0
- package/openapi/gen/models/trainingConfigurationInput.ts +4 -0
- package/openapi/gen/models/trainingCostEstimate.ts +4 -0
- package/openapi/gen/models/trainingCostEstimateInputSet.ts +12 -0
- package/openapi/gen/models/trainingCostEstimateInputSetExports.ts +6 -0
- package/openapi/gen/models/trainingCostEstimateInputSetExportsValidation.ts +2 -0
- package/openapi/gen/models/trainingCostEstimateInputSetId.ts +2 -0
- package/openapi/gen/models/trainingCostEstimateOneOf.ts +16 -0
- package/openapi/gen/models/trainingCostEstimateOneOfInputs.ts +7 -0
- package/openapi/gen/models/trainingCostEstimateOneOfInputsTraining.ts +9 -0
- package/openapi/gen/models/trainingCostEstimateOneOfInputsTrainingFailure.ts +3 -0
- package/openapi/gen/models/trainingCostEstimateOneOfInputsTrainingFailureAnyOf.ts +7 -0
- package/openapi/gen/models/trainingCostEstimateOneOfInputsTrainingFailureAnyOfCode.ts +2 -0
- package/openapi/gen/models/trainingCostEstimateOneOfInputsTrainingReport.ts +3 -0
- package/openapi/gen/models/trainingCostEstimateOneOfInputsTrainingReportAnyOf.ts +9 -0
- package/openapi/gen/models/trainingCostEstimateOneOfInputsTrainingReportAnyOfErrorsItem.ts +5 -0
- package/openapi/gen/models/trainingCostEstimateOneOfInputsTrainingReportAnyOfTokens.ts +10 -0
- package/openapi/gen/models/trainingCostEstimateOneOfInputsTrainingReportAnyOfTokensEstimatorVersion.ts +2 -0
- package/openapi/gen/models/trainingCostEstimateOneOfInputsTrainingReportAnyOfTokensTotal.ts +2 -0
- package/openapi/gen/models/trainingCostEstimateOneOfInputsValidation.ts +3 -0
- package/openapi/gen/models/trainingCostEstimateOneOfInputsValidationAnyOf.ts +9 -0
- package/openapi/gen/models/trainingCostEstimateOneOfInputsValidationAnyOfFailure.ts +3 -0
- package/openapi/gen/models/trainingCostEstimateOneOfInputsValidationAnyOfFailureAnyOf.ts +7 -0
- package/openapi/gen/models/trainingCostEstimateOneOfInputsValidationAnyOfFailureAnyOfCode.ts +2 -0
- package/openapi/gen/models/trainingCostEstimateOneOfInputsValidationAnyOfReport.ts +3 -0
- package/openapi/gen/models/trainingCostEstimateOneOfInputsValidationAnyOfReportAnyOf.ts +9 -0
- package/openapi/gen/models/trainingCostEstimateOneOfInputsValidationAnyOfReportAnyOfErrorsItem.ts +5 -0
- package/openapi/gen/models/trainingCostEstimateOneOfInputsValidationAnyOfReportAnyOfTokens.ts +10 -0
- package/openapi/gen/models/trainingCostEstimateOneOfInputsValidationAnyOfReportAnyOfTokensEstimatorVersion.ts +2 -0
- package/openapi/gen/models/trainingCostEstimateOneOfInputsValidationAnyOfReportAnyOfTokensTotal.ts +2 -0
- package/openapi/gen/models/trainingCostEstimateOneOfIssuesItem.ts +8 -0
- package/openapi/gen/models/trainingCostEstimateOneOfIssuesItemCode.ts +2 -0
- package/openapi/gen/models/trainingCostEstimateOneOfIssuesItemPurpose.ts +2 -0
- package/openapi/gen/models/trainingCostEstimateOneOfTwoseven.ts +23 -0
- package/openapi/gen/models/trainingCostEstimateOneOfTwosevenBudget.ts +9 -0
- package/openapi/gen/models/trainingCostEstimateOneOfTwosevenInputs.ts +7 -0
- package/openapi/gen/models/trainingCostEstimateOneOfTwosevenInputsTraining.ts +9 -0
- package/openapi/gen/models/trainingCostEstimateOneOfTwosevenInputsTrainingFailure.ts +3 -0
- package/openapi/gen/models/trainingCostEstimateOneOfTwosevenInputsTrainingFailureAnyOf.ts +7 -0
- package/openapi/gen/models/trainingCostEstimateOneOfTwosevenInputsTrainingFailureAnyOfCode.ts +2 -0
- package/openapi/gen/models/trainingCostEstimateOneOfTwosevenInputsTrainingReport.ts +3 -0
- package/openapi/gen/models/trainingCostEstimateOneOfTwosevenInputsTrainingReportAnyOf.ts +9 -0
- package/openapi/gen/models/trainingCostEstimateOneOfTwosevenInputsTrainingReportAnyOfErrorsItem.ts +5 -0
- package/openapi/gen/models/trainingCostEstimateOneOfTwosevenInputsTrainingReportAnyOfTokens.ts +10 -0
- package/openapi/gen/models/trainingCostEstimateOneOfTwosevenInputsTrainingReportAnyOfTokensEstimatorVersion.ts +2 -0
- package/openapi/gen/models/trainingCostEstimateOneOfTwosevenInputsTrainingReportAnyOfTokensTotal.ts +2 -0
- package/openapi/gen/models/trainingCostEstimateOneOfTwosevenInputsValidation.ts +3 -0
- package/openapi/gen/models/trainingCostEstimateOneOfTwosevenInputsValidationAnyOf.ts +9 -0
- package/openapi/gen/models/trainingCostEstimateOneOfTwosevenInputsValidationAnyOfFailure.ts +3 -0
- package/openapi/gen/models/trainingCostEstimateOneOfTwosevenInputsValidationAnyOfFailureAnyOf.ts +7 -0
- package/openapi/gen/models/trainingCostEstimateOneOfTwosevenInputsValidationAnyOfFailureAnyOfCode.ts +2 -0
- package/openapi/gen/models/trainingCostEstimateOneOfTwosevenInputsValidationAnyOfReport.ts +3 -0
- package/openapi/gen/models/trainingCostEstimateOneOfTwosevenInputsValidationAnyOfReportAnyOf.ts +9 -0
- package/openapi/gen/models/trainingCostEstimateOneOfTwosevenInputsValidationAnyOfReportAnyOfErrorsItem.ts +5 -0
- package/openapi/gen/models/trainingCostEstimateOneOfTwosevenInputsValidationAnyOfReportAnyOfTokens.ts +10 -0
- package/openapi/gen/models/trainingCostEstimateOneOfTwosevenInputsValidationAnyOfReportAnyOfTokensEstimatorVersion.ts +2 -0
- package/openapi/gen/models/trainingCostEstimateOneOfTwosevenInputsValidationAnyOfReportAnyOfTokensTotal.ts +2 -0
- package/openapi/gen/models/trainingCostEstimateOneOfTwosevenIssuesItem.ts +8 -0
- package/openapi/gen/models/trainingCostEstimateOneOfTwosevenIssuesItemCode.ts +2 -0
- package/openapi/gen/models/trainingCostEstimateOneOfTwosevenIssuesItemPurpose.ts +2 -0
- package/openapi/gen/models/trainingDatasetItemFilter.ts +8 -0
- package/openapi/gen/models/trainingDatasetItemFilterFieldSourcesItem.ts +6 -0
- package/openapi/gen/models/trainingDatasetItemFilterFieldSourcesItemSourcesItem.ts +4 -0
- package/openapi/gen/models/trainingDatasetItemFilterFieldSourcesItemSourcesItemOneOf.ts +5 -0
- package/openapi/gen/models/trainingDatasetItemFilterFieldSourcesItemSourcesItemOneOfTwo.ts +5 -0
- package/openapi/gen/models/trainingDatasetItemFilterFieldValuesItem.ts +12 -0
- package/openapi/gen/models/trainingDatasetItemFilterFieldValuesItemOperator.ts +2 -0
- package/openapi/gen/models/trainingDatasetItemFilterFieldValuesItemSourcesItem.ts +4 -0
- package/openapi/gen/models/trainingDatasetItemFilterFieldValuesItemSourcesItemOneOf.ts +5 -0
- package/openapi/gen/models/trainingDatasetItemFilterFieldValuesItemSourcesItemOneOfTwo.ts +5 -0
- package/openapi/gen/models/trainingDatasetItemFilterFieldValuesItemValue.ts +2 -0
- package/openapi/gen/models/trainingDatasetItemFilterInput.ts +8 -0
- package/openapi/gen/models/trainingDatasetItemFilterInputFieldSourcesItem.ts +6 -0
- package/openapi/gen/models/trainingDatasetItemFilterInputFieldSourcesItemSourcesItem.ts +4 -0
- package/openapi/gen/models/trainingDatasetItemFilterInputFieldSourcesItemSourcesItemOneOf.ts +5 -0
- package/openapi/gen/models/trainingDatasetItemFilterInputFieldSourcesItemSourcesItemOneOfTwo.ts +5 -0
- package/openapi/gen/models/trainingDatasetItemFilterInputFieldValuesItem.ts +12 -0
- package/openapi/gen/models/trainingDatasetItemFilterInputFieldValuesItemOperator.ts +2 -0
- package/openapi/gen/models/trainingDatasetItemFilterInputFieldValuesItemSourcesItem.ts +4 -0
- package/openapi/gen/models/trainingDatasetItemFilterInputFieldValuesItemSourcesItemOneOf.ts +5 -0
- package/openapi/gen/models/trainingDatasetItemFilterInputFieldValuesItemSourcesItemOneOfTwo.ts +5 -0
- package/openapi/gen/models/trainingDatasetItemFilterInputFieldValuesItemValue.ts +2 -0
- package/openapi/gen/models/trainingDatasetSelection.ts +6 -0
- package/openapi/gen/models/trainingDatasetSelectionInput.ts +6 -0
- package/openapi/gen/models/trainingId.ts +2 -0
- package/openapi/gen/models/trainingModelId.ts +3 -0
- package/openapi/gen/models/trainingModelSource.ts +4 -0
- package/openapi/gen/models/trainingModelSourceOneOf.ts +6 -0
- package/openapi/gen/models/trainingModelSourceOneOfBaseModelId.ts +2 -0
- package/openapi/gen/models/trainingModelSourceOneOfThree.ts +5 -0
- package/openapi/gen/models/trainingRun.ts +39 -0
- package/openapi/gen/models/trainingRunBillingStatus.ts +2 -0
- package/openapi/gen/models/trainingRunBlockedReason.ts +2 -0
- package/openapi/gen/models/trainingRunChargedAmount.ts +2 -0
- package/openapi/gen/models/trainingRunError.ts +3 -0
- package/openapi/gen/models/trainingRunErrorAnyOf.ts +7 -0
- package/openapi/gen/models/trainingRunErrorAnyOfCode.ts +2 -0
- package/openapi/gen/models/trainingRunId.ts +2 -0
- package/openapi/gen/models/trainingRunInputs.ts +3 -0
- package/openapi/gen/models/trainingRunInputsAnyOf.ts +7 -0
- package/openapi/gen/models/trainingRunInputsAnyOfTraining.ts +15 -0
- package/openapi/gen/models/trainingRunInputsAnyOfTrainingContract.ts +2 -0
- package/openapi/gen/models/trainingRunInputsAnyOfTrainingItemFilter.ts +9 -0
- package/openapi/gen/models/trainingRunInputsAnyOfTrainingItemFilterFieldSourcesItem.ts +6 -0
- package/openapi/gen/models/trainingRunInputsAnyOfTrainingItemFilterFieldSourcesItemSourcesItem.ts +4 -0
- package/openapi/gen/models/trainingRunInputsAnyOfTrainingItemFilterFieldSourcesItemSourcesItemOneOf.ts +5 -0
- package/openapi/gen/models/trainingRunInputsAnyOfTrainingItemFilterFieldSourcesItemSourcesItemOneOfTwo.ts +5 -0
- package/openapi/gen/models/trainingRunInputsAnyOfTrainingItemFilterFieldValuesItem.ts +12 -0
- package/openapi/gen/models/trainingRunInputsAnyOfTrainingItemFilterFieldValuesItemOperator.ts +2 -0
- package/openapi/gen/models/trainingRunInputsAnyOfTrainingItemFilterFieldValuesItemSourcesItem.ts +4 -0
- package/openapi/gen/models/trainingRunInputsAnyOfTrainingItemFilterFieldValuesItemSourcesItemOneOf.ts +5 -0
- package/openapi/gen/models/trainingRunInputsAnyOfTrainingItemFilterFieldValuesItemSourcesItemOneOfTwo.ts +5 -0
- package/openapi/gen/models/trainingRunInputsAnyOfTrainingItemFilterFieldValuesItemValue.ts +2 -0
- package/openapi/gen/models/trainingRunInputsAnyOfTrainingReport.ts +9 -0
- package/openapi/gen/models/trainingRunInputsAnyOfTrainingReportErrorsItem.ts +5 -0
- package/openapi/gen/models/trainingRunInputsAnyOfTrainingReportTokens.ts +10 -0
- package/openapi/gen/models/trainingRunInputsAnyOfTrainingReportTokensEstimatorVersion.ts +2 -0
- package/openapi/gen/models/trainingRunInputsAnyOfTrainingReportTokensTotal.ts +2 -0
- package/openapi/gen/models/trainingRunInputsAnyOfValidation.ts +3 -0
- package/openapi/gen/models/trainingRunInputsAnyOfValidationAnyOf.ts +15 -0
- package/openapi/gen/models/trainingRunInputsAnyOfValidationAnyOfContract.ts +2 -0
- package/openapi/gen/models/trainingRunInputsAnyOfValidationAnyOfItemFilter.ts +9 -0
- package/openapi/gen/models/trainingRunInputsAnyOfValidationAnyOfItemFilterFieldSourcesItem.ts +6 -0
- package/openapi/gen/models/trainingRunInputsAnyOfValidationAnyOfItemFilterFieldSourcesItemSourcesItem.ts +4 -0
- package/openapi/gen/models/trainingRunInputsAnyOfValidationAnyOfItemFilterFieldSourcesItemSourcesItemOneOf.ts +5 -0
- package/openapi/gen/models/trainingRunInputsAnyOfValidationAnyOfItemFilterFieldSourcesItemSourcesItemOneOfTwo.ts +5 -0
- package/openapi/gen/models/trainingRunInputsAnyOfValidationAnyOfItemFilterFieldValuesItem.ts +12 -0
- package/openapi/gen/models/trainingRunInputsAnyOfValidationAnyOfItemFilterFieldValuesItemOperator.ts +2 -0
- package/openapi/gen/models/trainingRunInputsAnyOfValidationAnyOfItemFilterFieldValuesItemSourcesItem.ts +4 -0
- package/openapi/gen/models/trainingRunInputsAnyOfValidationAnyOfItemFilterFieldValuesItemSourcesItemOneOf.ts +5 -0
- package/openapi/gen/models/trainingRunInputsAnyOfValidationAnyOfItemFilterFieldValuesItemSourcesItemOneOfTwo.ts +5 -0
- package/openapi/gen/models/trainingRunInputsAnyOfValidationAnyOfItemFilterFieldValuesItemValue.ts +2 -0
- package/openapi/gen/models/trainingRunInputsAnyOfValidationAnyOfReport.ts +9 -0
- package/openapi/gen/models/trainingRunInputsAnyOfValidationAnyOfReportErrorsItem.ts +5 -0
- package/openapi/gen/models/trainingRunInputsAnyOfValidationAnyOfReportTokens.ts +10 -0
- package/openapi/gen/models/trainingRunInputsAnyOfValidationAnyOfReportTokensEstimatorVersion.ts +2 -0
- package/openapi/gen/models/trainingRunInputsAnyOfValidationAnyOfReportTokensTotal.ts +2 -0
- package/openapi/gen/models/trainingRunLogs.ts +9 -0
- package/openapi/gen/models/trainingRunLogsEntriesItem.ts +7 -0
- package/openapi/gen/models/trainingRunLogsEntriesItemLevel.ts +2 -0
- package/openapi/gen/models/trainingRunLogsNextCursor.ts +2 -0
- package/openapi/gen/models/trainingRunMessage.ts +2 -0
- package/openapi/gen/models/trainingRunOutputModelVersionRevision.ts +2 -0
- package/openapi/gen/models/trainingRunProgress.ts +3 -0
- package/openapi/gen/models/trainingRunProgressAnyOf.ts +10 -0
- package/openapi/gen/models/trainingRunProgressAnyOfMessage.ts +2 -0
- package/openapi/gen/models/trainingRunProgressAnyOfStep.ts +2 -0
- package/openapi/gen/models/trainingRunProgressAnyOfTotal.ts +2 -0
- package/openapi/gen/models/trainingRunQuote.ts +17 -0
- package/openapi/gen/models/trainingRunQuoteBudget.ts +9 -0
- package/openapi/gen/models/trainingRunQuoteInputs.ts +7 -0
- package/openapi/gen/models/trainingRunQuoteInputsTraining.ts +9 -0
- package/openapi/gen/models/trainingRunQuoteInputsTrainingFailure.ts +3 -0
- package/openapi/gen/models/trainingRunQuoteInputsTrainingFailureAnyOf.ts +7 -0
- package/openapi/gen/models/trainingRunQuoteInputsTrainingFailureAnyOfCode.ts +2 -0
- package/openapi/gen/models/trainingRunQuoteInputsTrainingReport.ts +3 -0
- package/openapi/gen/models/trainingRunQuoteInputsTrainingReportAnyOf.ts +9 -0
- package/openapi/gen/models/trainingRunQuoteInputsTrainingReportAnyOfErrorsItem.ts +5 -0
- package/openapi/gen/models/trainingRunQuoteInputsTrainingReportAnyOfTokens.ts +10 -0
- package/openapi/gen/models/trainingRunQuoteInputsTrainingReportAnyOfTokensEstimatorVersion.ts +2 -0
- package/openapi/gen/models/trainingRunQuoteInputsTrainingReportAnyOfTokensTotal.ts +2 -0
- package/openapi/gen/models/trainingRunQuoteInputsValidation.ts +3 -0
- package/openapi/gen/models/trainingRunQuoteInputsValidationAnyOf.ts +9 -0
- package/openapi/gen/models/trainingRunQuoteInputsValidationAnyOfFailure.ts +3 -0
- package/openapi/gen/models/trainingRunQuoteInputsValidationAnyOfFailureAnyOf.ts +7 -0
- package/openapi/gen/models/trainingRunQuoteInputsValidationAnyOfFailureAnyOfCode.ts +2 -0
- package/openapi/gen/models/trainingRunQuoteInputsValidationAnyOfReport.ts +3 -0
- package/openapi/gen/models/trainingRunQuoteInputsValidationAnyOfReportAnyOf.ts +9 -0
- package/openapi/gen/models/trainingRunQuoteInputsValidationAnyOfReportAnyOfErrorsItem.ts +5 -0
- package/openapi/gen/models/trainingRunQuoteInputsValidationAnyOfReportAnyOfTokens.ts +10 -0
- package/openapi/gen/models/trainingRunQuoteInputsValidationAnyOfReportAnyOfTokensEstimatorVersion.ts +2 -0
- package/openapi/gen/models/trainingRunQuoteInputsValidationAnyOfReportAnyOfTokensTotal.ts +2 -0
- package/openapi/gen/models/trainingRunStatus.ts +2 -0
- package/openapi/gen/models/updateTrainingMetadataBody.ts +5 -0
- package/package.json +1 -1
- package/skills/catalog.json +19 -7
- package/skills/toloka-build/SKILL.md +3 -3
- package/skills/toloka-build/references/workflow-and-cli.md +19 -2
- package/skills/toloka-report-issue/references/report-template.md +1 -1
- package/src/cli/auth.ts +1 -1
- package/src/cli/bin.ts +1 -1
- package/src/cli/cost.ts +1 -1
- package/src/cli/models.ts +107 -2
- package/src/cli/program.ts +243 -0
- package/src/cli/project-context.ts +9 -10
- package/src/cli/project.ts +2 -1
- package/src/cli/secrets.ts +4 -4
- package/src/cli/trainings.ts +627 -0
- package/src/client.ts +164 -30
- package/src/index.ts +2 -0
- package/openapi/gen/models/createDatasetExportBodyOneOf.ts +0 -6
- package/openapi/gen/models/createDatasetExportBodyOneOfFormat.ts +0 -2
- package/openapi/gen/models/createDatasetExportBodyOneOfThree.ts +0 -10
- package/openapi/gen/models/createDatasetExportBodyOneOfThreeContract.ts +0 -2
- package/openapi/gen/models/createDatasetExportBodyOneOfThreeFormat.ts +0 -2
- package/openapi/gen/models/createDatasetExportBodyOneOfThreeItemFilter.ts +0 -9
- package/openapi/gen/models/createDatasetExportBodyOneOfThreeItemFilterFieldSourcesItem.ts +0 -6
- package/openapi/gen/models/createDatasetExportBodyOneOfThreeItemFilterFieldSourcesItemSourcesItem.ts +0 -4
- package/openapi/gen/models/createDatasetExportBodyOneOfThreeItemFilterFieldSourcesItemSourcesItemOneOf.ts +0 -5
- package/openapi/gen/models/createDatasetExportBodyOneOfThreeItemFilterFieldSourcesItemSourcesItemOneOfTwo.ts +0 -5
- package/openapi/gen/models/createDatasetExportBodyOneOfThreeItemFilterFieldValuesItem.ts +0 -12
- package/openapi/gen/models/createDatasetExportBodyOneOfThreeItemFilterFieldValuesItemOperator.ts +0 -2
- package/openapi/gen/models/createDatasetExportBodyOneOfThreeItemFilterFieldValuesItemSourcesItem.ts +0 -4
- package/openapi/gen/models/createDatasetExportBodyOneOfThreeItemFilterFieldValuesItemSourcesItemOneOf.ts +0 -5
- package/openapi/gen/models/createDatasetExportBodyOneOfThreeItemFilterFieldValuesItemSourcesItemOneOfTwo.ts +0 -5
- package/openapi/gen/models/createDatasetExportBodyOneOfThreeItemFilterFieldValuesItemValue.ts +0 -2
package/openapi/gen/api.ts
CHANGED
|
@@ -18,14 +18,18 @@ import type {
|
|
|
18
18
|
CreateProjectFileUpload200,
|
|
19
19
|
CreateProjectFileUploadBody,
|
|
20
20
|
CreateProjectModelBody,
|
|
21
|
+
CreateProjectTrainingBody,
|
|
22
|
+
CreateTrainingRunBody,
|
|
21
23
|
CurrentUser,
|
|
22
24
|
Dataset,
|
|
23
25
|
DatasetId,
|
|
24
26
|
EstimatePipelineCostBody,
|
|
27
|
+
EstimateTrainingCostBody,
|
|
25
28
|
ExportId,
|
|
26
29
|
ExportJob,
|
|
27
30
|
ExportPipeline200,
|
|
28
31
|
GetDatasetInferredFields200,
|
|
32
|
+
GetTrainingRunLogsParams,
|
|
29
33
|
ImportPipelineBody,
|
|
30
34
|
ListBaseModels200,
|
|
31
35
|
ListDatasetFields200,
|
|
@@ -47,11 +51,16 @@ import type {
|
|
|
47
51
|
ListProjectPipelines200,
|
|
48
52
|
ListProjectPipelinesParams,
|
|
49
53
|
ListProjectSecrets200,
|
|
54
|
+
ListProjectTrainings200,
|
|
55
|
+
ListProjectTrainingsParams,
|
|
50
56
|
ListProjects200,
|
|
51
57
|
ListProjectsParams,
|
|
58
|
+
ListTrainingRuns200,
|
|
59
|
+
ListTrainingRunsParams,
|
|
52
60
|
Model,
|
|
53
61
|
ModelId,
|
|
54
62
|
ModelVersion,
|
|
63
|
+
ModelVersionContentDownload,
|
|
55
64
|
ModelVersionId,
|
|
56
65
|
PatchPipelineNodeBody,
|
|
57
66
|
Pipeline,
|
|
@@ -59,6 +68,7 @@ import type {
|
|
|
59
68
|
PipelineGraphSnapshot,
|
|
60
69
|
PipelineId,
|
|
61
70
|
PipelineValidationReport,
|
|
71
|
+
PrepareTrainingCostEstimateInputsBody,
|
|
62
72
|
Project,
|
|
63
73
|
ProjectFile,
|
|
64
74
|
ProjectFileId,
|
|
@@ -66,6 +76,7 @@ import type {
|
|
|
66
76
|
ProjectSecret,
|
|
67
77
|
ProjectSecretName,
|
|
68
78
|
ReplacePipelineGraphBody,
|
|
79
|
+
ReplaceTrainingConfigurationBody,
|
|
69
80
|
RunCost,
|
|
70
81
|
RunId,
|
|
71
82
|
RunItem,
|
|
@@ -75,986 +86,1680 @@ import type {
|
|
|
75
86
|
SampleJob,
|
|
76
87
|
SampleResult,
|
|
77
88
|
SetProjectSecretBody,
|
|
89
|
+
Training,
|
|
90
|
+
TrainingCostEstimate,
|
|
91
|
+
TrainingCostEstimateInputSet,
|
|
92
|
+
TrainingId,
|
|
93
|
+
TrainingRun,
|
|
94
|
+
TrainingRunId,
|
|
95
|
+
TrainingRunLogs,
|
|
78
96
|
UpdatePipelineBody,
|
|
79
97
|
UpdateProjectBody,
|
|
98
|
+
UpdateTrainingMetadataBody,
|
|
80
99
|
UploadId,
|
|
81
100
|
UploadJob,
|
|
82
|
-
ValidatePipelineGraphBody
|
|
83
|
-
} from
|
|
101
|
+
ValidatePipelineGraphBody
|
|
102
|
+
} from './models';
|
|
84
103
|
|
|
85
|
-
import { potatoFetch } from
|
|
104
|
+
import { potatoFetch } from '../../src/transport';
|
|
86
105
|
export const getListBaseModelsUrl = () => {
|
|
87
|
-
return `/api/v2-beta/base-models`;
|
|
88
|
-
};
|
|
89
106
|
|
|
90
|
-
|
|
91
|
-
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
return `/api/v2-beta/base-models`
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export const listBaseModels = async ( options?: RequestInit): Promise<ListBaseModels200> => {
|
|
114
|
+
|
|
115
|
+
return potatoFetch<ListBaseModels200>(getListBaseModelsUrl(),
|
|
116
|
+
{
|
|
92
117
|
...options,
|
|
93
|
-
method:
|
|
94
|
-
|
|
95
|
-
|
|
118
|
+
method: 'GET'
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
}
|
|
122
|
+
);}
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
export const getGetBaseModelUrl = (baseModelId: BaseModelId,) => {
|
|
127
|
+
|
|
96
128
|
|
|
97
|
-
|
|
98
|
-
return `/api/v2-beta/base-models/${baseModelId}`;
|
|
99
|
-
};
|
|
129
|
+
|
|
100
130
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
): Promise<BaseModel> => {
|
|
105
|
-
|
|
131
|
+
return `/api/v2-beta/base-models/${baseModelId}`
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export const getBaseModel = async (baseModelId: BaseModelId, options?: RequestInit): Promise<BaseModel> => {
|
|
135
|
+
|
|
136
|
+
return potatoFetch<BaseModel>(getGetBaseModelUrl(baseModelId),
|
|
137
|
+
{
|
|
106
138
|
...options,
|
|
107
|
-
method:
|
|
108
|
-
|
|
109
|
-
|
|
139
|
+
method: 'GET'
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
}
|
|
143
|
+
);}
|
|
144
|
+
|
|
145
|
+
|
|
110
146
|
|
|
111
|
-
export const getListProjectModelsUrl = (projectId: ProjectId,
|
|
147
|
+
export const getListProjectModelsUrl = (projectId: ProjectId,
|
|
148
|
+
params?: ListProjectModelsParams,) => {
|
|
112
149
|
const normalizedParams = new URLSearchParams();
|
|
113
150
|
|
|
114
151
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
152
|
+
|
|
115
153
|
if (value !== undefined) {
|
|
116
|
-
normalizedParams.append(key, value === null ?
|
|
154
|
+
normalizedParams.append(key, value === null ? 'null' : value.toString())
|
|
117
155
|
}
|
|
118
156
|
});
|
|
119
157
|
|
|
120
158
|
const stringifiedParams = normalizedParams.toString();
|
|
121
159
|
|
|
122
|
-
return stringifiedParams.length > 0
|
|
123
|
-
|
|
124
|
-
: `/api/v2-beta/projects/${projectId}/models`;
|
|
125
|
-
};
|
|
160
|
+
return stringifiedParams.length > 0 ? `/api/v2-beta/projects/${projectId}/models?${stringifiedParams}` : `/api/v2-beta/projects/${projectId}/models`
|
|
161
|
+
}
|
|
126
162
|
|
|
127
|
-
export const listProjectModels = async (
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
return potatoFetch<ListProjectModels200>(getListProjectModelsUrl(projectId, params), {
|
|
163
|
+
export const listProjectModels = async (projectId: ProjectId,
|
|
164
|
+
params?: ListProjectModelsParams, options?: RequestInit): Promise<ListProjectModels200> => {
|
|
165
|
+
|
|
166
|
+
return potatoFetch<ListProjectModels200>(getListProjectModelsUrl(projectId,params),
|
|
167
|
+
{
|
|
133
168
|
...options,
|
|
134
|
-
method:
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
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), {
|
|
148
|
-
...options,
|
|
149
|
-
method: "POST",
|
|
150
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
151
|
-
body: JSON.stringify(createProjectModelBody),
|
|
152
|
-
});
|
|
153
|
-
};
|
|
169
|
+
method: 'GET'
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
}
|
|
173
|
+
);}
|
|
174
|
+
|
|
175
|
+
|
|
154
176
|
|
|
155
|
-
export const
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
177
|
+
export const getCreateProjectModelUrl = (projectId: ProjectId,) => {
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
return `/api/v2-beta/projects/${projectId}/models`
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export const createProjectModel = async (projectId: ProjectId,
|
|
186
|
+
createProjectModelBody: CreateProjectModelBody, options?: RequestInit): Promise<Model> => {
|
|
187
|
+
|
|
188
|
+
return potatoFetch<Model>(getCreateProjectModelUrl(projectId),
|
|
189
|
+
{
|
|
190
|
+
...options,
|
|
191
|
+
method: 'POST',
|
|
192
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
193
|
+
body: JSON.stringify(
|
|
194
|
+
createProjectModelBody,)
|
|
195
|
+
}
|
|
196
|
+
);}
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
export const getListModelVersionsUrl = (projectId: ProjectId,
|
|
201
|
+
modelId: ModelId,
|
|
202
|
+
params?: ListModelVersionsParams,) => {
|
|
160
203
|
const normalizedParams = new URLSearchParams();
|
|
161
204
|
|
|
162
205
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
206
|
+
|
|
163
207
|
if (value !== undefined) {
|
|
164
|
-
normalizedParams.append(key, value === null ?
|
|
208
|
+
normalizedParams.append(key, value === null ? 'null' : value.toString())
|
|
165
209
|
}
|
|
166
210
|
});
|
|
167
211
|
|
|
168
212
|
const stringifiedParams = normalizedParams.toString();
|
|
169
213
|
|
|
170
|
-
return stringifiedParams.length > 0
|
|
171
|
-
|
|
172
|
-
: `/api/v2-beta/projects/${projectId}/models/${modelId}/versions`;
|
|
173
|
-
};
|
|
214
|
+
return stringifiedParams.length > 0 ? `/api/v2-beta/projects/${projectId}/models/${modelId}/versions?${stringifiedParams}` : `/api/v2-beta/projects/${projectId}/models/${modelId}/versions`
|
|
215
|
+
}
|
|
174
216
|
|
|
175
|
-
export const listModelVersions = async (
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
return potatoFetch<ListModelVersions200>(getListModelVersionsUrl(projectId, modelId, params), {
|
|
217
|
+
export const listModelVersions = async (projectId: ProjectId,
|
|
218
|
+
modelId: ModelId,
|
|
219
|
+
params?: ListModelVersionsParams, options?: RequestInit): Promise<ListModelVersions200> => {
|
|
220
|
+
|
|
221
|
+
return potatoFetch<ListModelVersions200>(getListModelVersionsUrl(projectId,modelId,params),
|
|
222
|
+
{
|
|
182
223
|
...options,
|
|
183
|
-
method:
|
|
184
|
-
|
|
185
|
-
|
|
224
|
+
method: 'GET'
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
}
|
|
228
|
+
);}
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
export const getGetModelVersionUrl = (modelVersionId: ModelVersionId,) => {
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
return `/api/v2-beta/model-versions/${modelVersionId}`
|
|
238
|
+
}
|
|
186
239
|
|
|
187
|
-
export const
|
|
188
|
-
|
|
189
|
-
|
|
240
|
+
export const getModelVersion = async (modelVersionId: ModelVersionId, options?: RequestInit): Promise<ModelVersion> => {
|
|
241
|
+
|
|
242
|
+
return potatoFetch<ModelVersion>(getGetModelVersionUrl(modelVersionId),
|
|
243
|
+
{
|
|
244
|
+
...options,
|
|
245
|
+
method: 'GET'
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
}
|
|
249
|
+
);}
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
export const getGetModelVersionContentUrl = (modelVersionId: ModelVersionId,) => {
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
return `/api/v2-beta/model-versions/${modelVersionId}/content`
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export const getModelVersionContent = async (modelVersionId: ModelVersionId, options?: RequestInit): Promise<ModelVersionContentDownload> => {
|
|
262
|
+
|
|
263
|
+
return potatoFetch<ModelVersionContentDownload>(getGetModelVersionContentUrl(modelVersionId),
|
|
264
|
+
{
|
|
265
|
+
...options,
|
|
266
|
+
method: 'GET'
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
}
|
|
270
|
+
);}
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
export const getArchiveProjectModelUrl = (projectId: ProjectId,
|
|
275
|
+
modelId: ModelId,) => {
|
|
190
276
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
return `/api/v2-beta/projects/${projectId}/models/${modelId}/archive`
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export const archiveProjectModel = async (projectId: ProjectId,
|
|
284
|
+
modelId: ModelId, options?: RequestInit): Promise<Model> => {
|
|
285
|
+
|
|
286
|
+
return potatoFetch<Model>(getArchiveProjectModelUrl(projectId,modelId),
|
|
287
|
+
{
|
|
196
288
|
...options,
|
|
197
|
-
method:
|
|
289
|
+
method: 'POST'
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
}
|
|
293
|
+
);}
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
export const getGetProjectModelUrl = (projectId: ProjectId,
|
|
298
|
+
modelId: ModelId,) => {
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
return `/api/v2-beta/projects/${projectId}/models/${modelId}`
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
export const getProjectModel = async (projectId: ProjectId,
|
|
307
|
+
modelId: ModelId, options?: RequestInit): Promise<Model> => {
|
|
308
|
+
|
|
309
|
+
return potatoFetch<Model>(getGetProjectModelUrl(projectId,modelId),
|
|
310
|
+
{
|
|
311
|
+
...options,
|
|
312
|
+
method: 'GET'
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
}
|
|
316
|
+
);}
|
|
317
|
+
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
export const getListProjectTrainingsUrl = (projectId: ProjectId,
|
|
321
|
+
params?: ListProjectTrainingsParams,) => {
|
|
322
|
+
const normalizedParams = new URLSearchParams();
|
|
323
|
+
|
|
324
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
325
|
+
|
|
326
|
+
if (value !== undefined) {
|
|
327
|
+
normalizedParams.append(key, value === null ? 'null' : value.toString())
|
|
328
|
+
}
|
|
198
329
|
});
|
|
199
|
-
};
|
|
200
330
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
}
|
|
331
|
+
const stringifiedParams = normalizedParams.toString();
|
|
332
|
+
|
|
333
|
+
return stringifiedParams.length > 0 ? `/api/v2-beta/projects/${projectId}/trainings?${stringifiedParams}` : `/api/v2-beta/projects/${projectId}/trainings`
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
export const listProjectTrainings = async (projectId: ProjectId,
|
|
337
|
+
params?: ListProjectTrainingsParams, options?: RequestInit): Promise<ListProjectTrainings200> => {
|
|
338
|
+
|
|
339
|
+
return potatoFetch<ListProjectTrainings200>(getListProjectTrainingsUrl(projectId,params),
|
|
340
|
+
{
|
|
341
|
+
...options,
|
|
342
|
+
method: 'GET'
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
}
|
|
346
|
+
);}
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
export const getCreateProjectTrainingUrl = (projectId: ProjectId,) => {
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
return `/api/v2-beta/projects/${projectId}/trainings`
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
export const createProjectTraining = async (projectId: ProjectId,
|
|
359
|
+
createProjectTrainingBody: CreateProjectTrainingBody, options?: RequestInit): Promise<Training> => {
|
|
360
|
+
|
|
361
|
+
return potatoFetch<Training>(getCreateProjectTrainingUrl(projectId),
|
|
362
|
+
{
|
|
363
|
+
...options,
|
|
364
|
+
method: 'POST',
|
|
365
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
366
|
+
body: JSON.stringify(
|
|
367
|
+
createProjectTrainingBody,)
|
|
368
|
+
}
|
|
369
|
+
);}
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
export const getGetTrainingUrl = (trainingId: TrainingId,) => {
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
return `/api/v2-beta/trainings/${trainingId}`
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
export const getTraining = async (trainingId: TrainingId, options?: RequestInit): Promise<Training> => {
|
|
382
|
+
|
|
383
|
+
return potatoFetch<Training>(getGetTrainingUrl(trainingId),
|
|
384
|
+
{
|
|
385
|
+
...options,
|
|
386
|
+
method: 'GET'
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
}
|
|
390
|
+
);}
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
export const getUpdateTrainingMetadataUrl = (trainingId: TrainingId,) => {
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
return `/api/v2-beta/trainings/${trainingId}`
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
export const updateTrainingMetadata = async (trainingId: TrainingId,
|
|
403
|
+
updateTrainingMetadataBody: UpdateTrainingMetadataBody, options?: RequestInit): Promise<Training> => {
|
|
404
|
+
|
|
405
|
+
return potatoFetch<Training>(getUpdateTrainingMetadataUrl(trainingId),
|
|
406
|
+
{
|
|
407
|
+
...options,
|
|
408
|
+
method: 'PATCH',
|
|
409
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
410
|
+
body: JSON.stringify(
|
|
411
|
+
updateTrainingMetadataBody,)
|
|
412
|
+
}
|
|
413
|
+
);}
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
export const getReplaceTrainingConfigurationUrl = (trainingId: TrainingId,) => {
|
|
204
418
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
return `/api/v2-beta/trainings/${trainingId}/configuration`
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
export const replaceTrainingConfiguration = async (trainingId: TrainingId,
|
|
426
|
+
replaceTrainingConfigurationBody: ReplaceTrainingConfigurationBody, options?: RequestInit): Promise<Training> => {
|
|
427
|
+
|
|
428
|
+
return potatoFetch<Training>(getReplaceTrainingConfigurationUrl(trainingId),
|
|
429
|
+
{
|
|
430
|
+
...options,
|
|
431
|
+
method: 'PUT',
|
|
432
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
433
|
+
body: JSON.stringify(
|
|
434
|
+
replaceTrainingConfigurationBody,)
|
|
435
|
+
}
|
|
436
|
+
);}
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
export const getPrepareTrainingCostEstimateInputsUrl = (trainingId: TrainingId,) => {
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
return `/api/v2-beta/trainings/${trainingId}/cost-estimate-inputs`
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
export const prepareTrainingCostEstimateInputs = async (trainingId: TrainingId,
|
|
449
|
+
prepareTrainingCostEstimateInputsBody: PrepareTrainingCostEstimateInputsBody, options?: RequestInit): Promise<TrainingCostEstimateInputSet> => {
|
|
450
|
+
|
|
451
|
+
return potatoFetch<TrainingCostEstimateInputSet>(getPrepareTrainingCostEstimateInputsUrl(trainingId),
|
|
452
|
+
{
|
|
211
453
|
...options,
|
|
212
|
-
method:
|
|
454
|
+
method: 'POST',
|
|
455
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
456
|
+
body: JSON.stringify(
|
|
457
|
+
prepareTrainingCostEstimateInputsBody,)
|
|
458
|
+
}
|
|
459
|
+
);}
|
|
460
|
+
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
export const getEstimateTrainingCostUrl = (trainingId: TrainingId,) => {
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
return `/api/v2-beta/trainings/${trainingId}/cost-estimate`
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
export const estimateTrainingCost = async (trainingId: TrainingId,
|
|
472
|
+
estimateTrainingCostBody: EstimateTrainingCostBody, options?: RequestInit): Promise<TrainingCostEstimate> => {
|
|
473
|
+
|
|
474
|
+
return potatoFetch<TrainingCostEstimate>(getEstimateTrainingCostUrl(trainingId),
|
|
475
|
+
{
|
|
476
|
+
...options,
|
|
477
|
+
method: 'POST',
|
|
478
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
479
|
+
body: JSON.stringify(
|
|
480
|
+
estimateTrainingCostBody,)
|
|
481
|
+
}
|
|
482
|
+
);}
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
export const getCreateTrainingRunUrl = (trainingId: TrainingId,) => {
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
return `/api/v2-beta/trainings/${trainingId}/runs`
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
export const createTrainingRun = async (trainingId: TrainingId,
|
|
495
|
+
createTrainingRunBody: CreateTrainingRunBody, options?: RequestInit): Promise<TrainingRun> => {
|
|
496
|
+
|
|
497
|
+
return potatoFetch<TrainingRun>(getCreateTrainingRunUrl(trainingId),
|
|
498
|
+
{
|
|
499
|
+
...options,
|
|
500
|
+
method: 'POST',
|
|
501
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
502
|
+
body: JSON.stringify(
|
|
503
|
+
createTrainingRunBody,)
|
|
504
|
+
}
|
|
505
|
+
);}
|
|
506
|
+
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
export const getListTrainingRunsUrl = (trainingId: TrainingId,
|
|
510
|
+
params?: ListTrainingRunsParams,) => {
|
|
511
|
+
const normalizedParams = new URLSearchParams();
|
|
512
|
+
|
|
513
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
514
|
+
|
|
515
|
+
if (value !== undefined) {
|
|
516
|
+
normalizedParams.append(key, value === null ? 'null' : value.toString())
|
|
517
|
+
}
|
|
213
518
|
});
|
|
214
|
-
};
|
|
215
519
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
}
|
|
520
|
+
const stringifiedParams = normalizedParams.toString();
|
|
521
|
+
|
|
522
|
+
return stringifiedParams.length > 0 ? `/api/v2-beta/trainings/${trainingId}/runs?${stringifiedParams}` : `/api/v2-beta/trainings/${trainingId}/runs`
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
export const listTrainingRuns = async (trainingId: TrainingId,
|
|
526
|
+
params?: ListTrainingRunsParams, options?: RequestInit): Promise<ListTrainingRuns200> => {
|
|
527
|
+
|
|
528
|
+
return potatoFetch<ListTrainingRuns200>(getListTrainingRunsUrl(trainingId,params),
|
|
529
|
+
{
|
|
530
|
+
...options,
|
|
531
|
+
method: 'GET'
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
}
|
|
535
|
+
);}
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
|
|
539
|
+
export const getGetTrainingRunUrl = (trainingRunId: TrainingRunId,) => {
|
|
540
|
+
|
|
219
541
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
return `/api/v2-beta/training-runs/${trainingRunId}`
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
export const getTrainingRun = async (trainingRunId: TrainingRunId, options?: RequestInit): Promise<TrainingRun> => {
|
|
548
|
+
|
|
549
|
+
return potatoFetch<TrainingRun>(getGetTrainingRunUrl(trainingRunId),
|
|
550
|
+
{
|
|
226
551
|
...options,
|
|
227
|
-
method:
|
|
552
|
+
method: 'GET'
|
|
553
|
+
|
|
554
|
+
|
|
555
|
+
}
|
|
556
|
+
);}
|
|
557
|
+
|
|
558
|
+
|
|
559
|
+
|
|
560
|
+
export const getGetTrainingRunLogsUrl = (trainingRunId: TrainingRunId,
|
|
561
|
+
params?: GetTrainingRunLogsParams,) => {
|
|
562
|
+
const normalizedParams = new URLSearchParams();
|
|
563
|
+
|
|
564
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
565
|
+
|
|
566
|
+
if (value !== undefined) {
|
|
567
|
+
normalizedParams.append(key, value === null ? 'null' : value.toString())
|
|
568
|
+
}
|
|
228
569
|
});
|
|
229
|
-
|
|
570
|
+
|
|
571
|
+
const stringifiedParams = normalizedParams.toString();
|
|
572
|
+
|
|
573
|
+
return stringifiedParams.length > 0 ? `/api/v2-beta/training-runs/${trainingRunId}/logs?${stringifiedParams}` : `/api/v2-beta/training-runs/${trainingRunId}/logs`
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
export const getTrainingRunLogs = async (trainingRunId: TrainingRunId,
|
|
577
|
+
params?: GetTrainingRunLogsParams, options?: RequestInit): Promise<TrainingRunLogs> => {
|
|
578
|
+
|
|
579
|
+
return potatoFetch<TrainingRunLogs>(getGetTrainingRunLogsUrl(trainingRunId,params),
|
|
580
|
+
{
|
|
581
|
+
...options,
|
|
582
|
+
method: 'GET'
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
}
|
|
586
|
+
);}
|
|
587
|
+
|
|
588
|
+
|
|
589
|
+
|
|
590
|
+
export const getResumeTrainingRunUrl = (trainingRunId: TrainingRunId,) => {
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
|
|
595
|
+
return `/api/v2-beta/training-runs/${trainingRunId}/resume`
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
export const resumeTrainingRun = async (trainingRunId: TrainingRunId, options?: RequestInit): Promise<TrainingRun> => {
|
|
599
|
+
|
|
600
|
+
return potatoFetch<TrainingRun>(getResumeTrainingRunUrl(trainingRunId),
|
|
601
|
+
{
|
|
602
|
+
...options,
|
|
603
|
+
method: 'POST'
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
}
|
|
607
|
+
);}
|
|
608
|
+
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
export const getCancelTrainingRunUrl = (trainingRunId: TrainingRunId,) => {
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
|
|
616
|
+
return `/api/v2-beta/training-runs/${trainingRunId}/cancel`
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
export const cancelTrainingRun = async (trainingRunId: TrainingRunId, options?: RequestInit): Promise<TrainingRun> => {
|
|
620
|
+
|
|
621
|
+
return potatoFetch<TrainingRun>(getCancelTrainingRunUrl(trainingRunId),
|
|
622
|
+
{
|
|
623
|
+
...options,
|
|
624
|
+
method: 'POST'
|
|
625
|
+
|
|
626
|
+
|
|
627
|
+
}
|
|
628
|
+
);}
|
|
629
|
+
|
|
630
|
+
|
|
230
631
|
|
|
231
632
|
export const getGetCurrentUserUrl = () => {
|
|
232
|
-
return `/api/v2-beta/me`;
|
|
233
|
-
};
|
|
234
633
|
|
|
235
|
-
|
|
236
|
-
|
|
634
|
+
|
|
635
|
+
|
|
636
|
+
|
|
637
|
+
return `/api/v2-beta/me`
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
export const getCurrentUser = async ( options?: RequestInit): Promise<CurrentUser> => {
|
|
641
|
+
|
|
642
|
+
return potatoFetch<CurrentUser>(getGetCurrentUserUrl(),
|
|
643
|
+
{
|
|
237
644
|
...options,
|
|
238
|
-
method:
|
|
239
|
-
|
|
240
|
-
|
|
645
|
+
method: 'GET'
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
}
|
|
649
|
+
);}
|
|
650
|
+
|
|
651
|
+
|
|
241
652
|
|
|
242
|
-
export const getListProjectsUrl = (params?: ListProjectsParams) => {
|
|
653
|
+
export const getListProjectsUrl = (params?: ListProjectsParams,) => {
|
|
243
654
|
const normalizedParams = new URLSearchParams();
|
|
244
655
|
|
|
245
656
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
657
|
+
|
|
246
658
|
if (value !== undefined) {
|
|
247
|
-
normalizedParams.append(key, value === null ?
|
|
659
|
+
normalizedParams.append(key, value === null ? 'null' : value.toString())
|
|
248
660
|
}
|
|
249
661
|
});
|
|
250
662
|
|
|
251
663
|
const stringifiedParams = normalizedParams.toString();
|
|
252
664
|
|
|
253
|
-
return stringifiedParams.length > 0
|
|
254
|
-
|
|
255
|
-
: `/api/v2-beta/projects`;
|
|
256
|
-
};
|
|
665
|
+
return stringifiedParams.length > 0 ? `/api/v2-beta/projects?${stringifiedParams}` : `/api/v2-beta/projects`
|
|
666
|
+
}
|
|
257
667
|
|
|
258
|
-
export const listProjects = async (
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
return potatoFetch<ListProjects200>(getListProjectsUrl(params), {
|
|
668
|
+
export const listProjects = async (params?: ListProjectsParams, options?: RequestInit): Promise<ListProjects200> => {
|
|
669
|
+
|
|
670
|
+
return potatoFetch<ListProjects200>(getListProjectsUrl(params),
|
|
671
|
+
{
|
|
263
672
|
...options,
|
|
264
|
-
method:
|
|
265
|
-
|
|
266
|
-
|
|
673
|
+
method: 'GET'
|
|
674
|
+
|
|
675
|
+
|
|
676
|
+
}
|
|
677
|
+
);}
|
|
678
|
+
|
|
679
|
+
|
|
267
680
|
|
|
268
681
|
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(), {
|
|
277
|
-
...options,
|
|
278
|
-
method: "POST",
|
|
279
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
280
|
-
body: JSON.stringify(createProjectBody),
|
|
281
|
-
});
|
|
282
|
-
};
|
|
283
682
|
|
|
284
|
-
export const getGetProjectByIdUrl = (projectId: ProjectId) => {
|
|
285
|
-
return `/api/v2-beta/projects/${projectId}`;
|
|
286
|
-
};
|
|
287
683
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
684
|
+
|
|
685
|
+
|
|
686
|
+
return `/api/v2-beta/projects`
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
export const createProject = async (createProjectBody: CreateProjectBody, options?: RequestInit): Promise<Project> => {
|
|
690
|
+
|
|
691
|
+
return potatoFetch<Project>(getCreateProjectUrl(),
|
|
692
|
+
{
|
|
293
693
|
...options,
|
|
294
|
-
method:
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
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
|
-
};
|
|
694
|
+
method: 'POST',
|
|
695
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
696
|
+
body: JSON.stringify(
|
|
697
|
+
createProjectBody,)
|
|
698
|
+
}
|
|
699
|
+
);}
|
|
700
|
+
|
|
701
|
+
|
|
702
|
+
|
|
703
|
+
export const getGetProjectByIdUrl = (projectId: ProjectId,) => {
|
|
314
704
|
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
705
|
+
|
|
706
|
+
|
|
707
|
+
|
|
708
|
+
return `/api/v2-beta/projects/${projectId}`
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
export const getProjectById = async (projectId: ProjectId, options?: RequestInit): Promise<Project> => {
|
|
712
|
+
|
|
713
|
+
return potatoFetch<Project>(getGetProjectByIdUrl(projectId),
|
|
714
|
+
{
|
|
715
|
+
...options,
|
|
716
|
+
method: 'GET'
|
|
717
|
+
|
|
718
|
+
|
|
719
|
+
}
|
|
720
|
+
);}
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
|
|
724
|
+
export const getUpdateProjectUrl = (projectId: ProjectId,) => {
|
|
725
|
+
|
|
726
|
+
|
|
727
|
+
|
|
728
|
+
|
|
729
|
+
return `/api/v2-beta/projects/${projectId}`
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
export const updateProject = async (projectId: ProjectId,
|
|
733
|
+
updateProjectBody: UpdateProjectBody, options?: RequestInit): Promise<Project> => {
|
|
734
|
+
|
|
735
|
+
return potatoFetch<Project>(getUpdateProjectUrl(projectId),
|
|
736
|
+
{
|
|
737
|
+
...options,
|
|
738
|
+
method: 'PATCH',
|
|
739
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
740
|
+
body: JSON.stringify(
|
|
741
|
+
updateProjectBody,)
|
|
742
|
+
}
|
|
743
|
+
);}
|
|
744
|
+
|
|
745
|
+
|
|
746
|
+
|
|
747
|
+
export const getListProjectPipelinesUrl = (projectId: ProjectId,
|
|
748
|
+
params?: ListProjectPipelinesParams,) => {
|
|
319
749
|
const normalizedParams = new URLSearchParams();
|
|
320
750
|
|
|
321
751
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
752
|
+
|
|
322
753
|
if (value !== undefined) {
|
|
323
|
-
normalizedParams.append(key, value === null ?
|
|
754
|
+
normalizedParams.append(key, value === null ? 'null' : value.toString())
|
|
324
755
|
}
|
|
325
756
|
});
|
|
326
757
|
|
|
327
758
|
const stringifiedParams = normalizedParams.toString();
|
|
328
759
|
|
|
329
|
-
return stringifiedParams.length > 0
|
|
330
|
-
|
|
331
|
-
: `/api/v2-beta/projects/${projectId}/pipelines`;
|
|
332
|
-
};
|
|
760
|
+
return stringifiedParams.length > 0 ? `/api/v2-beta/projects/${projectId}/pipelines?${stringifiedParams}` : `/api/v2-beta/projects/${projectId}/pipelines`
|
|
761
|
+
}
|
|
333
762
|
|
|
334
|
-
export const listProjectPipelines = async (
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
return potatoFetch<ListProjectPipelines200>(getListProjectPipelinesUrl(projectId, params), {
|
|
763
|
+
export const listProjectPipelines = async (projectId: ProjectId,
|
|
764
|
+
params?: ListProjectPipelinesParams, options?: RequestInit): Promise<ListProjectPipelines200> => {
|
|
765
|
+
|
|
766
|
+
return potatoFetch<ListProjectPipelines200>(getListProjectPipelinesUrl(projectId,params),
|
|
767
|
+
{
|
|
340
768
|
...options,
|
|
341
|
-
method:
|
|
342
|
-
|
|
343
|
-
|
|
769
|
+
method: 'GET'
|
|
770
|
+
|
|
771
|
+
|
|
772
|
+
}
|
|
773
|
+
);}
|
|
344
774
|
|
|
345
|
-
export const getGetPipelineByIdUrl = (pipelineId: PipelineId) => {
|
|
346
|
-
return `/api/v2-beta/pipelines/${pipelineId}`;
|
|
347
|
-
};
|
|
348
775
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
776
|
+
|
|
777
|
+
export const getGetPipelineByIdUrl = (pipelineId: PipelineId,) => {
|
|
778
|
+
|
|
779
|
+
|
|
780
|
+
|
|
781
|
+
|
|
782
|
+
return `/api/v2-beta/pipelines/${pipelineId}`
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
export const getPipelineById = async (pipelineId: PipelineId, options?: RequestInit): Promise<Pipeline> => {
|
|
786
|
+
|
|
787
|
+
return potatoFetch<Pipeline>(getGetPipelineByIdUrl(pipelineId),
|
|
788
|
+
{
|
|
354
789
|
...options,
|
|
355
|
-
method:
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
export const
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
return
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
790
|
+
method: 'GET'
|
|
791
|
+
|
|
792
|
+
|
|
793
|
+
}
|
|
794
|
+
);}
|
|
795
|
+
|
|
796
|
+
|
|
797
|
+
|
|
798
|
+
export const getUpdatePipelineUrl = (pipelineId: PipelineId,) => {
|
|
799
|
+
|
|
800
|
+
|
|
801
|
+
|
|
802
|
+
|
|
803
|
+
return `/api/v2-beta/pipelines/${pipelineId}`
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
export const updatePipeline = async (pipelineId: PipelineId,
|
|
807
|
+
updatePipelineBody: UpdatePipelineBody, options?: RequestInit): Promise<Pipeline> => {
|
|
808
|
+
|
|
809
|
+
return potatoFetch<Pipeline>(getUpdatePipelineUrl(pipelineId),
|
|
810
|
+
{
|
|
811
|
+
...options,
|
|
812
|
+
method: 'PATCH',
|
|
813
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
814
|
+
body: JSON.stringify(
|
|
815
|
+
updatePipelineBody,)
|
|
816
|
+
}
|
|
817
|
+
);}
|
|
375
818
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
) => {
|
|
819
|
+
|
|
820
|
+
|
|
821
|
+
export const getListProjectDatasetsUrl = (projectId: ProjectId,
|
|
822
|
+
params?: ListProjectDatasetsParams,) => {
|
|
380
823
|
const normalizedParams = new URLSearchParams();
|
|
381
824
|
|
|
382
825
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
826
|
+
|
|
383
827
|
if (value !== undefined) {
|
|
384
|
-
normalizedParams.append(key, value === null ?
|
|
828
|
+
normalizedParams.append(key, value === null ? 'null' : value.toString())
|
|
385
829
|
}
|
|
386
830
|
});
|
|
387
831
|
|
|
388
832
|
const stringifiedParams = normalizedParams.toString();
|
|
389
833
|
|
|
390
|
-
return stringifiedParams.length > 0
|
|
391
|
-
|
|
392
|
-
: `/api/v2-beta/projects/${projectId}/datasets`;
|
|
393
|
-
};
|
|
834
|
+
return stringifiedParams.length > 0 ? `/api/v2-beta/projects/${projectId}/datasets?${stringifiedParams}` : `/api/v2-beta/projects/${projectId}/datasets`
|
|
835
|
+
}
|
|
394
836
|
|
|
395
|
-
export const listProjectDatasets = async (
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
return potatoFetch<ListProjectDatasets200>(getListProjectDatasetsUrl(projectId, params), {
|
|
837
|
+
export const listProjectDatasets = async (projectId: ProjectId,
|
|
838
|
+
params?: ListProjectDatasetsParams, options?: RequestInit): Promise<ListProjectDatasets200> => {
|
|
839
|
+
|
|
840
|
+
return potatoFetch<ListProjectDatasets200>(getListProjectDatasetsUrl(projectId,params),
|
|
841
|
+
{
|
|
401
842
|
...options,
|
|
402
|
-
method:
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
export const
|
|
411
|
-
|
|
412
|
-
createDatasetBody: CreateDatasetBody,
|
|
413
|
-
options?: RequestInit,
|
|
414
|
-
): Promise<Dataset> => {
|
|
415
|
-
return potatoFetch<Dataset>(getCreateDatasetUrl(projectId), {
|
|
416
|
-
...options,
|
|
417
|
-
method: "POST",
|
|
418
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
419
|
-
body: JSON.stringify(createDatasetBody),
|
|
420
|
-
});
|
|
421
|
-
};
|
|
843
|
+
method: 'GET'
|
|
844
|
+
|
|
845
|
+
|
|
846
|
+
}
|
|
847
|
+
);}
|
|
848
|
+
|
|
849
|
+
|
|
850
|
+
|
|
851
|
+
export const getCreateDatasetUrl = (projectId: ProjectId,) => {
|
|
852
|
+
|
|
422
853
|
|
|
423
|
-
|
|
424
|
-
return `/api/v2-beta/datasets/${datasetId}`;
|
|
425
|
-
};
|
|
854
|
+
|
|
426
855
|
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
856
|
+
return `/api/v2-beta/projects/${projectId}/datasets`
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
export const createDataset = async (projectId: ProjectId,
|
|
860
|
+
createDatasetBody: CreateDatasetBody, options?: RequestInit): Promise<Dataset> => {
|
|
861
|
+
|
|
862
|
+
return potatoFetch<Dataset>(getCreateDatasetUrl(projectId),
|
|
863
|
+
{
|
|
432
864
|
...options,
|
|
433
|
-
method:
|
|
434
|
-
|
|
435
|
-
|
|
865
|
+
method: 'POST',
|
|
866
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
867
|
+
body: JSON.stringify(
|
|
868
|
+
createDatasetBody,)
|
|
869
|
+
}
|
|
870
|
+
);}
|
|
871
|
+
|
|
872
|
+
|
|
873
|
+
|
|
874
|
+
export const getGetDatasetByIdUrl = (datasetId: DatasetId,) => {
|
|
875
|
+
|
|
876
|
+
|
|
877
|
+
|
|
878
|
+
|
|
879
|
+
return `/api/v2-beta/datasets/${datasetId}`
|
|
880
|
+
}
|
|
436
881
|
|
|
437
|
-
export const
|
|
882
|
+
export const getDatasetById = async (datasetId: DatasetId, options?: RequestInit): Promise<Dataset> => {
|
|
883
|
+
|
|
884
|
+
return potatoFetch<Dataset>(getGetDatasetByIdUrl(datasetId),
|
|
885
|
+
{
|
|
886
|
+
...options,
|
|
887
|
+
method: 'GET'
|
|
888
|
+
|
|
889
|
+
|
|
890
|
+
}
|
|
891
|
+
);}
|
|
892
|
+
|
|
893
|
+
|
|
894
|
+
|
|
895
|
+
export const getListDatasetFieldsUrl = (datasetId: DatasetId,
|
|
896
|
+
params?: ListDatasetFieldsParams,) => {
|
|
438
897
|
const normalizedParams = new URLSearchParams();
|
|
439
898
|
|
|
440
899
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
900
|
+
|
|
441
901
|
if (value !== undefined) {
|
|
442
|
-
normalizedParams.append(key, value === null ?
|
|
902
|
+
normalizedParams.append(key, value === null ? 'null' : value.toString())
|
|
443
903
|
}
|
|
444
904
|
});
|
|
445
905
|
|
|
446
906
|
const stringifiedParams = normalizedParams.toString();
|
|
447
907
|
|
|
448
|
-
return stringifiedParams.length > 0
|
|
449
|
-
|
|
450
|
-
: `/api/v2-beta/datasets/${datasetId}/fields`;
|
|
451
|
-
};
|
|
908
|
+
return stringifiedParams.length > 0 ? `/api/v2-beta/datasets/${datasetId}/fields?${stringifiedParams}` : `/api/v2-beta/datasets/${datasetId}/fields`
|
|
909
|
+
}
|
|
452
910
|
|
|
453
|
-
export const listDatasetFields = async (
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
return potatoFetch<ListDatasetFields200>(getListDatasetFieldsUrl(datasetId, params), {
|
|
911
|
+
export const listDatasetFields = async (datasetId: DatasetId,
|
|
912
|
+
params?: ListDatasetFieldsParams, options?: RequestInit): Promise<ListDatasetFields200> => {
|
|
913
|
+
|
|
914
|
+
return potatoFetch<ListDatasetFields200>(getListDatasetFieldsUrl(datasetId,params),
|
|
915
|
+
{
|
|
459
916
|
...options,
|
|
460
|
-
method:
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
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), {
|
|
474
|
-
...options,
|
|
475
|
-
method: "POST",
|
|
476
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
477
|
-
body: JSON.stringify(createDatasetFieldBody),
|
|
478
|
-
});
|
|
479
|
-
};
|
|
917
|
+
method: 'GET'
|
|
918
|
+
|
|
919
|
+
|
|
920
|
+
}
|
|
921
|
+
);}
|
|
922
|
+
|
|
923
|
+
|
|
480
924
|
|
|
481
|
-
export const
|
|
482
|
-
return `/api/v2-beta/datasets/${datasetId}/inferred-fields`;
|
|
483
|
-
};
|
|
925
|
+
export const getCreateDatasetFieldUrl = (datasetId: DatasetId,) => {
|
|
484
926
|
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
927
|
+
|
|
928
|
+
|
|
929
|
+
|
|
930
|
+
return `/api/v2-beta/datasets/${datasetId}/fields`
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
export const createDatasetField = async (datasetId: DatasetId,
|
|
934
|
+
createDatasetFieldBody: CreateDatasetFieldBody, options?: RequestInit): Promise<CreateDatasetField200> => {
|
|
935
|
+
|
|
936
|
+
return potatoFetch<CreateDatasetField200>(getCreateDatasetFieldUrl(datasetId),
|
|
937
|
+
{
|
|
490
938
|
...options,
|
|
491
|
-
method:
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
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
|
-
};
|
|
939
|
+
method: 'POST',
|
|
940
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
941
|
+
body: JSON.stringify(
|
|
942
|
+
createDatasetFieldBody,)
|
|
943
|
+
}
|
|
944
|
+
);}
|
|
945
|
+
|
|
946
|
+
|
|
511
947
|
|
|
512
|
-
export const
|
|
948
|
+
export const getGetDatasetInferredFieldsUrl = (datasetId: DatasetId,) => {
|
|
949
|
+
|
|
950
|
+
|
|
951
|
+
|
|
952
|
+
|
|
953
|
+
return `/api/v2-beta/datasets/${datasetId}/inferred-fields`
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
export const getDatasetInferredFields = async (datasetId: DatasetId, options?: RequestInit): Promise<GetDatasetInferredFields200> => {
|
|
957
|
+
|
|
958
|
+
return potatoFetch<GetDatasetInferredFields200>(getGetDatasetInferredFieldsUrl(datasetId),
|
|
959
|
+
{
|
|
960
|
+
...options,
|
|
961
|
+
method: 'GET'
|
|
962
|
+
|
|
963
|
+
|
|
964
|
+
}
|
|
965
|
+
);}
|
|
966
|
+
|
|
967
|
+
|
|
968
|
+
|
|
969
|
+
export const getAddDatasetItemsUrl = (datasetId: DatasetId,) => {
|
|
970
|
+
|
|
971
|
+
|
|
972
|
+
|
|
973
|
+
|
|
974
|
+
return `/api/v2-beta/datasets/${datasetId}/items`
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
export const addDatasetItems = async (datasetId: DatasetId,
|
|
978
|
+
addDatasetItemsBody: AddDatasetItemsBody, options?: RequestInit): Promise<AddDatasetItems200> => {
|
|
979
|
+
|
|
980
|
+
return potatoFetch<AddDatasetItems200>(getAddDatasetItemsUrl(datasetId),
|
|
981
|
+
{
|
|
982
|
+
...options,
|
|
983
|
+
method: 'POST',
|
|
984
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
985
|
+
body: JSON.stringify(
|
|
986
|
+
addDatasetItemsBody,)
|
|
987
|
+
}
|
|
988
|
+
);}
|
|
989
|
+
|
|
990
|
+
|
|
991
|
+
|
|
992
|
+
export const getListDatasetItemsUrl = (datasetId: DatasetId,
|
|
993
|
+
params?: ListDatasetItemsParams,) => {
|
|
513
994
|
const normalizedParams = new URLSearchParams();
|
|
514
995
|
|
|
515
996
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
997
|
+
|
|
516
998
|
if (value !== undefined) {
|
|
517
|
-
normalizedParams.append(key, value === null ?
|
|
999
|
+
normalizedParams.append(key, value === null ? 'null' : value.toString())
|
|
518
1000
|
}
|
|
519
1001
|
});
|
|
520
1002
|
|
|
521
1003
|
const stringifiedParams = normalizedParams.toString();
|
|
522
1004
|
|
|
523
|
-
return stringifiedParams.length > 0
|
|
524
|
-
|
|
525
|
-
: `/api/v2-beta/datasets/${datasetId}/items`;
|
|
526
|
-
};
|
|
1005
|
+
return stringifiedParams.length > 0 ? `/api/v2-beta/datasets/${datasetId}/items?${stringifiedParams}` : `/api/v2-beta/datasets/${datasetId}/items`
|
|
1006
|
+
}
|
|
527
1007
|
|
|
528
|
-
export const listDatasetItems = async (
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
return potatoFetch<ListDatasetItems200>(getListDatasetItemsUrl(datasetId, params), {
|
|
1008
|
+
export const listDatasetItems = async (datasetId: DatasetId,
|
|
1009
|
+
params?: ListDatasetItemsParams, options?: RequestInit): Promise<ListDatasetItems200> => {
|
|
1010
|
+
|
|
1011
|
+
return potatoFetch<ListDatasetItems200>(getListDatasetItemsUrl(datasetId,params),
|
|
1012
|
+
{
|
|
534
1013
|
...options,
|
|
535
|
-
method:
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
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), {
|
|
549
|
-
...options,
|
|
550
|
-
method: "POST",
|
|
551
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
552
|
-
body: JSON.stringify(createDatasetUploadBody),
|
|
553
|
-
});
|
|
554
|
-
};
|
|
1014
|
+
method: 'GET'
|
|
1015
|
+
|
|
1016
|
+
|
|
1017
|
+
}
|
|
1018
|
+
);}
|
|
1019
|
+
|
|
1020
|
+
|
|
555
1021
|
|
|
556
|
-
export const
|
|
557
|
-
return `/api/v2-beta/uploads/${uploadId}/finalize`;
|
|
558
|
-
};
|
|
1022
|
+
export const getCreateDatasetUploadUrl = (datasetId: DatasetId,) => {
|
|
559
1023
|
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
1024
|
+
|
|
1025
|
+
|
|
1026
|
+
|
|
1027
|
+
return `/api/v2-beta/datasets/${datasetId}/uploads`
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
export const createDatasetUpload = async (datasetId: DatasetId,
|
|
1031
|
+
createDatasetUploadBody: CreateDatasetUploadBody, options?: RequestInit): Promise<CreateDatasetUpload200> => {
|
|
1032
|
+
|
|
1033
|
+
return potatoFetch<CreateDatasetUpload200>(getCreateDatasetUploadUrl(datasetId),
|
|
1034
|
+
{
|
|
565
1035
|
...options,
|
|
566
|
-
method:
|
|
567
|
-
|
|
568
|
-
|
|
1036
|
+
method: 'POST',
|
|
1037
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
1038
|
+
body: JSON.stringify(
|
|
1039
|
+
createDatasetUploadBody,)
|
|
1040
|
+
}
|
|
1041
|
+
);}
|
|
569
1042
|
|
|
570
|
-
export const getCancelDatasetUploadUrl = (uploadId: UploadId) => {
|
|
571
|
-
return `/api/v2-beta/uploads/${uploadId}/cancel`;
|
|
572
|
-
};
|
|
573
1043
|
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
1044
|
+
|
|
1045
|
+
export const getFinalizeDatasetUploadUrl = (uploadId: UploadId,) => {
|
|
1046
|
+
|
|
1047
|
+
|
|
1048
|
+
|
|
1049
|
+
|
|
1050
|
+
return `/api/v2-beta/uploads/${uploadId}/finalize`
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
export const finalizeDatasetUpload = async (uploadId: UploadId, options?: RequestInit): Promise<UploadJob> => {
|
|
1054
|
+
|
|
1055
|
+
return potatoFetch<UploadJob>(getFinalizeDatasetUploadUrl(uploadId),
|
|
1056
|
+
{
|
|
579
1057
|
...options,
|
|
580
|
-
method:
|
|
581
|
-
|
|
582
|
-
|
|
1058
|
+
method: 'POST'
|
|
1059
|
+
|
|
1060
|
+
|
|
1061
|
+
}
|
|
1062
|
+
);}
|
|
1063
|
+
|
|
583
1064
|
|
|
584
|
-
export const getGetDatasetUploadUrl = (uploadId: UploadId) => {
|
|
585
|
-
return `/api/v2-beta/uploads/${uploadId}`;
|
|
586
|
-
};
|
|
587
1065
|
|
|
588
|
-
export const
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
1066
|
+
export const getCancelDatasetUploadUrl = (uploadId: UploadId,) => {
|
|
1067
|
+
|
|
1068
|
+
|
|
1069
|
+
|
|
1070
|
+
|
|
1071
|
+
return `/api/v2-beta/uploads/${uploadId}/cancel`
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
export const cancelDatasetUpload = async (uploadId: UploadId, options?: RequestInit): Promise<void> => {
|
|
1075
|
+
|
|
1076
|
+
return potatoFetch<void>(getCancelDatasetUploadUrl(uploadId),
|
|
1077
|
+
{
|
|
593
1078
|
...options,
|
|
594
|
-
method:
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
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), {
|
|
608
|
-
...options,
|
|
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), {
|
|
625
|
-
...options,
|
|
626
|
-
method: "POST",
|
|
627
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
628
|
-
body: JSON.stringify(attachPipelineDatasetBody),
|
|
629
|
-
});
|
|
630
|
-
};
|
|
1079
|
+
method: 'POST'
|
|
1080
|
+
|
|
1081
|
+
|
|
1082
|
+
}
|
|
1083
|
+
);}
|
|
1084
|
+
|
|
631
1085
|
|
|
632
|
-
export const getExportPipelineUrl = (pipelineId: PipelineId) => {
|
|
633
|
-
return `/api/v2-beta/pipelines/${pipelineId}/export`;
|
|
634
|
-
};
|
|
635
1086
|
|
|
636
|
-
export const
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
1087
|
+
export const getGetDatasetUploadUrl = (uploadId: UploadId,) => {
|
|
1088
|
+
|
|
1089
|
+
|
|
1090
|
+
|
|
1091
|
+
|
|
1092
|
+
return `/api/v2-beta/uploads/${uploadId}`
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
export const getDatasetUpload = async (uploadId: UploadId, options?: RequestInit): Promise<UploadJob> => {
|
|
1096
|
+
|
|
1097
|
+
return potatoFetch<UploadJob>(getGetDatasetUploadUrl(uploadId),
|
|
1098
|
+
{
|
|
641
1099
|
...options,
|
|
642
|
-
method:
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
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), {
|
|
656
|
-
...options,
|
|
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), {
|
|
673
|
-
...options,
|
|
674
|
-
method: "POST",
|
|
675
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
676
|
-
body: JSON.stringify(estimatePipelineCostBody),
|
|
677
|
-
});
|
|
678
|
-
};
|
|
1100
|
+
method: 'GET'
|
|
1101
|
+
|
|
1102
|
+
|
|
1103
|
+
}
|
|
1104
|
+
);}
|
|
1105
|
+
|
|
679
1106
|
|
|
680
|
-
export const getCreatePipelineRunUrl = (pipelineId: PipelineId) => {
|
|
681
|
-
return `/api/v2-beta/pipelines/${pipelineId}/runs`;
|
|
682
|
-
};
|
|
683
1107
|
|
|
684
|
-
export const
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
1108
|
+
export const getImportPipelineUrl = (projectId: ProjectId,) => {
|
|
1109
|
+
|
|
1110
|
+
|
|
1111
|
+
|
|
1112
|
+
|
|
1113
|
+
return `/api/v2-beta/projects/${projectId}/pipelines/import`
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
export const importPipeline = async (projectId: ProjectId,
|
|
1117
|
+
importPipelineBody: ImportPipelineBody, options?: RequestInit): Promise<Pipeline> => {
|
|
1118
|
+
|
|
1119
|
+
return potatoFetch<Pipeline>(getImportPipelineUrl(projectId),
|
|
1120
|
+
{
|
|
689
1121
|
...options,
|
|
690
|
-
method:
|
|
691
|
-
|
|
692
|
-
|
|
1122
|
+
method: 'POST',
|
|
1123
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
1124
|
+
body: JSON.stringify(
|
|
1125
|
+
importPipelineBody,)
|
|
1126
|
+
}
|
|
1127
|
+
);}
|
|
1128
|
+
|
|
1129
|
+
|
|
1130
|
+
|
|
1131
|
+
export const getAttachPipelineDatasetUrl = (pipelineId: PipelineId,) => {
|
|
1132
|
+
|
|
1133
|
+
|
|
1134
|
+
|
|
1135
|
+
|
|
1136
|
+
return `/api/v2-beta/pipelines/${pipelineId}/dataset`
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
export const attachPipelineDataset = async (pipelineId: PipelineId,
|
|
1140
|
+
attachPipelineDatasetBody: AttachPipelineDatasetBody, options?: RequestInit): Promise<Pipeline> => {
|
|
1141
|
+
|
|
1142
|
+
return potatoFetch<Pipeline>(getAttachPipelineDatasetUrl(pipelineId),
|
|
1143
|
+
{
|
|
1144
|
+
...options,
|
|
1145
|
+
method: 'POST',
|
|
1146
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
1147
|
+
body: JSON.stringify(
|
|
1148
|
+
attachPipelineDatasetBody,)
|
|
1149
|
+
}
|
|
1150
|
+
);}
|
|
1151
|
+
|
|
1152
|
+
|
|
693
1153
|
|
|
694
|
-
export const
|
|
1154
|
+
export const getExportPipelineUrl = (pipelineId: PipelineId,) => {
|
|
1155
|
+
|
|
1156
|
+
|
|
1157
|
+
|
|
1158
|
+
|
|
1159
|
+
return `/api/v2-beta/pipelines/${pipelineId}/export`
|
|
1160
|
+
}
|
|
1161
|
+
|
|
1162
|
+
export const exportPipeline = async (pipelineId: PipelineId, options?: RequestInit): Promise<ExportPipeline200> => {
|
|
1163
|
+
|
|
1164
|
+
return potatoFetch<ExportPipeline200>(getExportPipelineUrl(pipelineId),
|
|
1165
|
+
{
|
|
1166
|
+
...options,
|
|
1167
|
+
method: 'GET'
|
|
1168
|
+
|
|
1169
|
+
|
|
1170
|
+
}
|
|
1171
|
+
);}
|
|
1172
|
+
|
|
1173
|
+
|
|
1174
|
+
|
|
1175
|
+
export const getCopyPipelineUrl = (pipelineId: PipelineId,) => {
|
|
1176
|
+
|
|
1177
|
+
|
|
1178
|
+
|
|
1179
|
+
|
|
1180
|
+
return `/api/v2-beta/pipelines/${pipelineId}/copy`
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1183
|
+
export const copyPipeline = async (pipelineId: PipelineId,
|
|
1184
|
+
copyPipelineBody: CopyPipelineBody, options?: RequestInit): Promise<Pipeline> => {
|
|
1185
|
+
|
|
1186
|
+
return potatoFetch<Pipeline>(getCopyPipelineUrl(pipelineId),
|
|
1187
|
+
{
|
|
1188
|
+
...options,
|
|
1189
|
+
method: 'POST',
|
|
1190
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
1191
|
+
body: JSON.stringify(
|
|
1192
|
+
copyPipelineBody,)
|
|
1193
|
+
}
|
|
1194
|
+
);}
|
|
1195
|
+
|
|
1196
|
+
|
|
1197
|
+
|
|
1198
|
+
export const getEstimatePipelineCostUrl = (pipelineId: PipelineId,) => {
|
|
1199
|
+
|
|
1200
|
+
|
|
1201
|
+
|
|
1202
|
+
|
|
1203
|
+
return `/api/v2-beta/pipelines/${pipelineId}/cost-estimate`
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
export const estimatePipelineCost = async (pipelineId: PipelineId,
|
|
1207
|
+
estimatePipelineCostBody: EstimatePipelineCostBody, options?: RequestInit): Promise<PipelineCostEstimate> => {
|
|
1208
|
+
|
|
1209
|
+
return potatoFetch<PipelineCostEstimate>(getEstimatePipelineCostUrl(pipelineId),
|
|
1210
|
+
{
|
|
1211
|
+
...options,
|
|
1212
|
+
method: 'POST',
|
|
1213
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
1214
|
+
body: JSON.stringify(
|
|
1215
|
+
estimatePipelineCostBody,)
|
|
1216
|
+
}
|
|
1217
|
+
);}
|
|
1218
|
+
|
|
1219
|
+
|
|
1220
|
+
|
|
1221
|
+
export const getCreatePipelineRunUrl = (pipelineId: PipelineId,) => {
|
|
1222
|
+
|
|
1223
|
+
|
|
1224
|
+
|
|
1225
|
+
|
|
1226
|
+
return `/api/v2-beta/pipelines/${pipelineId}/runs`
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
export const createPipelineRun = async (pipelineId: PipelineId, options?: RequestInit): Promise<RunJob> => {
|
|
1230
|
+
|
|
1231
|
+
return potatoFetch<RunJob>(getCreatePipelineRunUrl(pipelineId),
|
|
1232
|
+
{
|
|
1233
|
+
...options,
|
|
1234
|
+
method: 'POST'
|
|
1235
|
+
|
|
1236
|
+
|
|
1237
|
+
}
|
|
1238
|
+
);}
|
|
1239
|
+
|
|
1240
|
+
|
|
1241
|
+
|
|
1242
|
+
export const getListPipelineRunsUrl = (pipelineId: PipelineId,
|
|
1243
|
+
params?: ListPipelineRunsParams,) => {
|
|
695
1244
|
const normalizedParams = new URLSearchParams();
|
|
696
1245
|
|
|
697
1246
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1247
|
+
|
|
698
1248
|
if (value !== undefined) {
|
|
699
|
-
normalizedParams.append(key, value === null ?
|
|
1249
|
+
normalizedParams.append(key, value === null ? 'null' : value.toString())
|
|
700
1250
|
}
|
|
701
1251
|
});
|
|
702
1252
|
|
|
703
1253
|
const stringifiedParams = normalizedParams.toString();
|
|
704
1254
|
|
|
705
|
-
return stringifiedParams.length > 0
|
|
706
|
-
|
|
707
|
-
: `/api/v2-beta/pipelines/${pipelineId}/runs`;
|
|
708
|
-
};
|
|
1255
|
+
return stringifiedParams.length > 0 ? `/api/v2-beta/pipelines/${pipelineId}/runs?${stringifiedParams}` : `/api/v2-beta/pipelines/${pipelineId}/runs`
|
|
1256
|
+
}
|
|
709
1257
|
|
|
710
|
-
export const listPipelineRuns = async (
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
return potatoFetch<ListPipelineRuns200>(getListPipelineRunsUrl(pipelineId, params), {
|
|
1258
|
+
export const listPipelineRuns = async (pipelineId: PipelineId,
|
|
1259
|
+
params?: ListPipelineRunsParams, options?: RequestInit): Promise<ListPipelineRuns200> => {
|
|
1260
|
+
|
|
1261
|
+
return potatoFetch<ListPipelineRuns200>(getListPipelineRunsUrl(pipelineId,params),
|
|
1262
|
+
{
|
|
716
1263
|
...options,
|
|
717
|
-
method:
|
|
718
|
-
|
|
719
|
-
|
|
1264
|
+
method: 'GET'
|
|
1265
|
+
|
|
1266
|
+
|
|
1267
|
+
}
|
|
1268
|
+
);}
|
|
1269
|
+
|
|
1270
|
+
|
|
720
1271
|
|
|
721
|
-
export const getGetPipelineRunUrl = (runId: RunId) => {
|
|
722
|
-
|
|
723
|
-
|
|
1272
|
+
export const getGetPipelineRunUrl = (runId: RunId,) => {
|
|
1273
|
+
|
|
1274
|
+
|
|
1275
|
+
|
|
1276
|
+
|
|
1277
|
+
return `/api/v2-beta/runs/${runId}`
|
|
1278
|
+
}
|
|
724
1279
|
|
|
725
1280
|
export const getPipelineRun = async (runId: RunId, options?: RequestInit): Promise<RunJob> => {
|
|
726
|
-
|
|
1281
|
+
|
|
1282
|
+
return potatoFetch<RunJob>(getGetPipelineRunUrl(runId),
|
|
1283
|
+
{
|
|
727
1284
|
...options,
|
|
728
|
-
method:
|
|
729
|
-
|
|
730
|
-
|
|
1285
|
+
method: 'GET'
|
|
1286
|
+
|
|
1287
|
+
|
|
1288
|
+
}
|
|
1289
|
+
);}
|
|
731
1290
|
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
1291
|
+
|
|
1292
|
+
|
|
1293
|
+
export const getGetPipelineRunCostUrl = (runId: RunId,) => {
|
|
1294
|
+
|
|
1295
|
+
|
|
1296
|
+
|
|
1297
|
+
|
|
1298
|
+
return `/api/v2-beta/runs/${runId}/cost`
|
|
1299
|
+
}
|
|
735
1300
|
|
|
736
1301
|
export const getPipelineRunCost = async (runId: RunId, options?: RequestInit): Promise<RunCost> => {
|
|
737
|
-
|
|
1302
|
+
|
|
1303
|
+
return potatoFetch<RunCost>(getGetPipelineRunCostUrl(runId),
|
|
1304
|
+
{
|
|
738
1305
|
...options,
|
|
739
|
-
method:
|
|
740
|
-
|
|
741
|
-
|
|
1306
|
+
method: 'GET'
|
|
1307
|
+
|
|
1308
|
+
|
|
1309
|
+
}
|
|
1310
|
+
);}
|
|
1311
|
+
|
|
1312
|
+
|
|
742
1313
|
|
|
743
|
-
export const getCancelPipelineRunUrl = (runId: RunId) => {
|
|
744
|
-
|
|
745
|
-
|
|
1314
|
+
export const getCancelPipelineRunUrl = (runId: RunId,) => {
|
|
1315
|
+
|
|
1316
|
+
|
|
1317
|
+
|
|
1318
|
+
|
|
1319
|
+
return `/api/v2-beta/runs/${runId}/cancel`
|
|
1320
|
+
}
|
|
746
1321
|
|
|
747
1322
|
export const cancelPipelineRun = async (runId: RunId, options?: RequestInit): Promise<RunJob> => {
|
|
748
|
-
|
|
1323
|
+
|
|
1324
|
+
return potatoFetch<RunJob>(getCancelPipelineRunUrl(runId),
|
|
1325
|
+
{
|
|
749
1326
|
...options,
|
|
750
|
-
method:
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
export const
|
|
759
|
-
datasetId: DatasetId,
|
|
760
|
-
sampleDatasetItemsBody: SampleDatasetItemsBody,
|
|
761
|
-
options?: RequestInit,
|
|
762
|
-
): Promise<SampleResult> => {
|
|
763
|
-
return potatoFetch<SampleResult>(getSampleDatasetItemsUrl(datasetId), {
|
|
764
|
-
...options,
|
|
765
|
-
method: "POST",
|
|
766
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
767
|
-
body: JSON.stringify(sampleDatasetItemsBody),
|
|
768
|
-
});
|
|
769
|
-
};
|
|
1327
|
+
method: 'POST'
|
|
1328
|
+
|
|
1329
|
+
|
|
1330
|
+
}
|
|
1331
|
+
);}
|
|
1332
|
+
|
|
1333
|
+
|
|
1334
|
+
|
|
1335
|
+
export const getSampleDatasetItemsUrl = (datasetId: DatasetId,) => {
|
|
770
1336
|
|
|
771
|
-
export const getGetDatasetSampleUrl = (sampleId: string) => {
|
|
772
|
-
return `/api/v2-beta/samples/${sampleId}`;
|
|
773
|
-
};
|
|
774
1337
|
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
1338
|
+
|
|
1339
|
+
|
|
1340
|
+
return `/api/v2-beta/datasets/${datasetId}/sample`
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
export const sampleDatasetItems = async (datasetId: DatasetId,
|
|
1344
|
+
sampleDatasetItemsBody: SampleDatasetItemsBody, options?: RequestInit): Promise<SampleResult> => {
|
|
1345
|
+
|
|
1346
|
+
return potatoFetch<SampleResult>(getSampleDatasetItemsUrl(datasetId),
|
|
1347
|
+
{
|
|
780
1348
|
...options,
|
|
781
|
-
method:
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
createDatasetExportBody: CreateDatasetExportBody,
|
|
792
|
-
options?: RequestInit,
|
|
793
|
-
): Promise<ExportJob> => {
|
|
794
|
-
return potatoFetch<ExportJob>(getCreateDatasetExportUrl(datasetId), {
|
|
795
|
-
...options,
|
|
796
|
-
method: "POST",
|
|
797
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
798
|
-
body: JSON.stringify(createDatasetExportBody),
|
|
799
|
-
});
|
|
800
|
-
};
|
|
1349
|
+
method: 'POST',
|
|
1350
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
1351
|
+
body: JSON.stringify(
|
|
1352
|
+
sampleDatasetItemsBody,)
|
|
1353
|
+
}
|
|
1354
|
+
);}
|
|
1355
|
+
|
|
1356
|
+
|
|
1357
|
+
|
|
1358
|
+
export const getGetDatasetSampleUrl = (sampleId: string,) => {
|
|
801
1359
|
|
|
802
|
-
export const getGetDatasetExportUrl = (exportId: ExportId) => {
|
|
803
|
-
return `/api/v2-beta/exports/${exportId}`;
|
|
804
|
-
};
|
|
805
1360
|
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
1361
|
+
|
|
1362
|
+
|
|
1363
|
+
return `/api/v2-beta/samples/${sampleId}`
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
export const getDatasetSample = async (sampleId: string, options?: RequestInit): Promise<SampleJob> => {
|
|
1367
|
+
|
|
1368
|
+
return potatoFetch<SampleJob>(getGetDatasetSampleUrl(sampleId),
|
|
1369
|
+
{
|
|
811
1370
|
...options,
|
|
812
|
-
method:
|
|
813
|
-
|
|
814
|
-
|
|
1371
|
+
method: 'GET'
|
|
1372
|
+
|
|
1373
|
+
|
|
1374
|
+
}
|
|
1375
|
+
);}
|
|
1376
|
+
|
|
1377
|
+
|
|
1378
|
+
|
|
1379
|
+
export const getCreateDatasetExportUrl = (datasetId: DatasetId,) => {
|
|
1380
|
+
|
|
1381
|
+
|
|
1382
|
+
|
|
815
1383
|
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
};
|
|
1384
|
+
return `/api/v2-beta/datasets/${datasetId}/exports`
|
|
1385
|
+
}
|
|
819
1386
|
|
|
820
|
-
export const
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
1387
|
+
export const createDatasetExport = async (datasetId: DatasetId,
|
|
1388
|
+
createDatasetExportBody: CreateDatasetExportBody, options?: RequestInit): Promise<ExportJob> => {
|
|
1389
|
+
|
|
1390
|
+
return potatoFetch<ExportJob>(getCreateDatasetExportUrl(datasetId),
|
|
1391
|
+
{
|
|
825
1392
|
...options,
|
|
826
|
-
method:
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
options?: RequestInit,
|
|
838
|
-
): Promise<Pipeline> => {
|
|
839
|
-
return potatoFetch<Pipeline>(getReplacePipelineGraphUrl(pipelineId), {
|
|
840
|
-
...options,
|
|
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), {
|
|
857
|
-
...options,
|
|
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), {
|
|
875
|
-
...options,
|
|
876
|
-
method: "PATCH",
|
|
877
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
878
|
-
body: JSON.stringify(patchPipelineNodeBody),
|
|
879
|
-
});
|
|
880
|
-
};
|
|
1393
|
+
method: 'POST',
|
|
1394
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
1395
|
+
body: JSON.stringify(
|
|
1396
|
+
createDatasetExportBody,)
|
|
1397
|
+
}
|
|
1398
|
+
);}
|
|
1399
|
+
|
|
1400
|
+
|
|
1401
|
+
|
|
1402
|
+
export const getGetDatasetExportUrl = (exportId: ExportId,) => {
|
|
1403
|
+
|
|
881
1404
|
|
|
882
|
-
|
|
883
|
-
return `/api/v2-beta/projects/${projectId}/secrets`;
|
|
884
|
-
};
|
|
1405
|
+
|
|
885
1406
|
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
): Promise<
|
|
890
|
-
|
|
1407
|
+
return `/api/v2-beta/exports/${exportId}`
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1410
|
+
export const getDatasetExport = async (exportId: ExportId, options?: RequestInit): Promise<ExportJob> => {
|
|
1411
|
+
|
|
1412
|
+
return potatoFetch<ExportJob>(getGetDatasetExportUrl(exportId),
|
|
1413
|
+
{
|
|
891
1414
|
...options,
|
|
892
|
-
method:
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
export const
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
options?: RequestInit,
|
|
905
|
-
): Promise<ProjectSecret> => {
|
|
906
|
-
return potatoFetch<ProjectSecret>(getSetProjectSecretUrl(projectId, name), {
|
|
907
|
-
...options,
|
|
908
|
-
method: "PUT",
|
|
909
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
910
|
-
body: JSON.stringify(setProjectSecretBody),
|
|
911
|
-
});
|
|
912
|
-
};
|
|
1415
|
+
method: 'GET'
|
|
1416
|
+
|
|
1417
|
+
|
|
1418
|
+
}
|
|
1419
|
+
);}
|
|
1420
|
+
|
|
1421
|
+
|
|
1422
|
+
|
|
1423
|
+
export const getGetPipelineGraphSnapshotUrl = (pipelineId: PipelineId,) => {
|
|
1424
|
+
|
|
1425
|
+
|
|
1426
|
+
|
|
913
1427
|
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
};
|
|
1428
|
+
return `/api/v2-beta/pipelines/${pipelineId}/graph`
|
|
1429
|
+
}
|
|
917
1430
|
|
|
918
|
-
export const
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
return potatoFetch<ListProjectFiles200>(getListProjectFilesUrl(projectId), {
|
|
1431
|
+
export const getPipelineGraphSnapshot = async (pipelineId: PipelineId, options?: RequestInit): Promise<PipelineGraphSnapshot> => {
|
|
1432
|
+
|
|
1433
|
+
return potatoFetch<PipelineGraphSnapshot>(getGetPipelineGraphSnapshotUrl(pipelineId),
|
|
1434
|
+
{
|
|
923
1435
|
...options,
|
|
924
|
-
method:
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
export const
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
): Promise<CreateProjectFileUpload200> => {
|
|
937
|
-
return potatoFetch<CreateProjectFileUpload200>(getCreateProjectFileUploadUrl(projectId), {
|
|
938
|
-
...options,
|
|
939
|
-
method: "POST",
|
|
940
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
941
|
-
body: JSON.stringify(createProjectFileUploadBody),
|
|
942
|
-
});
|
|
943
|
-
};
|
|
1436
|
+
method: 'GET'
|
|
1437
|
+
|
|
1438
|
+
|
|
1439
|
+
}
|
|
1440
|
+
);}
|
|
1441
|
+
|
|
1442
|
+
|
|
1443
|
+
|
|
1444
|
+
export const getReplacePipelineGraphUrl = (pipelineId: PipelineId,) => {
|
|
1445
|
+
|
|
1446
|
+
|
|
1447
|
+
|
|
944
1448
|
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
};
|
|
1449
|
+
return `/api/v2-beta/pipelines/${pipelineId}/graph`
|
|
1450
|
+
}
|
|
948
1451
|
|
|
949
|
-
export const
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
return potatoFetch<ProjectFile>(getFinalizeProjectFileUploadUrl(projectId, fileId), {
|
|
1452
|
+
export const replacePipelineGraph = async (pipelineId: PipelineId,
|
|
1453
|
+
replacePipelineGraphBody: ReplacePipelineGraphBody, options?: RequestInit): Promise<Pipeline> => {
|
|
1454
|
+
|
|
1455
|
+
return potatoFetch<Pipeline>(getReplacePipelineGraphUrl(pipelineId),
|
|
1456
|
+
{
|
|
955
1457
|
...options,
|
|
956
|
-
method:
|
|
957
|
-
|
|
958
|
-
|
|
1458
|
+
method: 'PUT',
|
|
1459
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
1460
|
+
body: JSON.stringify(
|
|
1461
|
+
replacePipelineGraphBody,)
|
|
1462
|
+
}
|
|
1463
|
+
);}
|
|
1464
|
+
|
|
1465
|
+
|
|
1466
|
+
|
|
1467
|
+
export const getValidatePipelineGraphUrl = (pipelineId: PipelineId,) => {
|
|
959
1468
|
|
|
960
|
-
export const getDeleteProjectFileUrl = (projectId: ProjectId, fileId: ProjectFileId) => {
|
|
961
|
-
return `/api/v2-beta/projects/${projectId}/files/${fileId}`;
|
|
962
|
-
};
|
|
963
1469
|
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
1470
|
+
|
|
1471
|
+
|
|
1472
|
+
return `/api/v2-beta/pipelines/${pipelineId}/graph/validate`
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1475
|
+
export const validatePipelineGraph = async (pipelineId: PipelineId,
|
|
1476
|
+
validatePipelineGraphBody: ValidatePipelineGraphBody, options?: RequestInit): Promise<PipelineValidationReport> => {
|
|
1477
|
+
|
|
1478
|
+
return potatoFetch<PipelineValidationReport>(getValidatePipelineGraphUrl(pipelineId),
|
|
1479
|
+
{
|
|
970
1480
|
...options,
|
|
971
|
-
method:
|
|
972
|
-
|
|
973
|
-
|
|
1481
|
+
method: 'POST',
|
|
1482
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
1483
|
+
body: JSON.stringify(
|
|
1484
|
+
validatePipelineGraphBody,)
|
|
1485
|
+
}
|
|
1486
|
+
);}
|
|
1487
|
+
|
|
1488
|
+
|
|
1489
|
+
|
|
1490
|
+
export const getPatchPipelineNodeUrl = (pipelineId: PipelineId,
|
|
1491
|
+
nodeId: string,) => {
|
|
1492
|
+
|
|
1493
|
+
|
|
1494
|
+
|
|
1495
|
+
|
|
1496
|
+
return `/api/v2-beta/pipelines/${pipelineId}/graph/nodes/${nodeId}`
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
export const patchPipelineNode = async (pipelineId: PipelineId,
|
|
1500
|
+
nodeId: string,
|
|
1501
|
+
patchPipelineNodeBody: PatchPipelineNodeBody, options?: RequestInit): Promise<Pipeline> => {
|
|
1502
|
+
|
|
1503
|
+
return potatoFetch<Pipeline>(getPatchPipelineNodeUrl(pipelineId,nodeId),
|
|
1504
|
+
{
|
|
1505
|
+
...options,
|
|
1506
|
+
method: 'PATCH',
|
|
1507
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
1508
|
+
body: JSON.stringify(
|
|
1509
|
+
patchPipelineNodeBody,)
|
|
1510
|
+
}
|
|
1511
|
+
);}
|
|
1512
|
+
|
|
1513
|
+
|
|
1514
|
+
|
|
1515
|
+
export const getListProjectSecretsUrl = (projectId: ProjectId,) => {
|
|
1516
|
+
|
|
1517
|
+
|
|
1518
|
+
|
|
1519
|
+
|
|
1520
|
+
return `/api/v2-beta/projects/${projectId}/secrets`
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
export const listProjectSecrets = async (projectId: ProjectId, options?: RequestInit): Promise<ListProjectSecrets200> => {
|
|
1524
|
+
|
|
1525
|
+
return potatoFetch<ListProjectSecrets200>(getListProjectSecretsUrl(projectId),
|
|
1526
|
+
{
|
|
1527
|
+
...options,
|
|
1528
|
+
method: 'GET'
|
|
1529
|
+
|
|
1530
|
+
|
|
1531
|
+
}
|
|
1532
|
+
);}
|
|
1533
|
+
|
|
1534
|
+
|
|
1535
|
+
|
|
1536
|
+
export const getSetProjectSecretUrl = (projectId: ProjectId,
|
|
1537
|
+
name: ProjectSecretName,) => {
|
|
1538
|
+
|
|
1539
|
+
|
|
1540
|
+
|
|
1541
|
+
|
|
1542
|
+
return `/api/v2-beta/projects/${projectId}/secrets/${name}`
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
export const setProjectSecret = async (projectId: ProjectId,
|
|
1546
|
+
name: ProjectSecretName,
|
|
1547
|
+
setProjectSecretBody: SetProjectSecretBody, options?: RequestInit): Promise<ProjectSecret> => {
|
|
1548
|
+
|
|
1549
|
+
return potatoFetch<ProjectSecret>(getSetProjectSecretUrl(projectId,name),
|
|
1550
|
+
{
|
|
1551
|
+
...options,
|
|
1552
|
+
method: 'PUT',
|
|
1553
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
1554
|
+
body: JSON.stringify(
|
|
1555
|
+
setProjectSecretBody,)
|
|
1556
|
+
}
|
|
1557
|
+
);}
|
|
974
1558
|
|
|
975
|
-
|
|
1559
|
+
|
|
1560
|
+
|
|
1561
|
+
export const getListProjectFilesUrl = (projectId: ProjectId,) => {
|
|
1562
|
+
|
|
1563
|
+
|
|
1564
|
+
|
|
1565
|
+
|
|
1566
|
+
return `/api/v2-beta/projects/${projectId}/files`
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1569
|
+
export const listProjectFiles = async (projectId: ProjectId, options?: RequestInit): Promise<ListProjectFiles200> => {
|
|
1570
|
+
|
|
1571
|
+
return potatoFetch<ListProjectFiles200>(getListProjectFilesUrl(projectId),
|
|
1572
|
+
{
|
|
1573
|
+
...options,
|
|
1574
|
+
method: 'GET'
|
|
1575
|
+
|
|
1576
|
+
|
|
1577
|
+
}
|
|
1578
|
+
);}
|
|
1579
|
+
|
|
1580
|
+
|
|
1581
|
+
|
|
1582
|
+
export const getCreateProjectFileUploadUrl = (projectId: ProjectId,) => {
|
|
1583
|
+
|
|
1584
|
+
|
|
1585
|
+
|
|
1586
|
+
|
|
1587
|
+
return `/api/v2-beta/projects/${projectId}/files`
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1590
|
+
export const createProjectFileUpload = async (projectId: ProjectId,
|
|
1591
|
+
createProjectFileUploadBody: CreateProjectFileUploadBody, options?: RequestInit): Promise<CreateProjectFileUpload200> => {
|
|
1592
|
+
|
|
1593
|
+
return potatoFetch<CreateProjectFileUpload200>(getCreateProjectFileUploadUrl(projectId),
|
|
1594
|
+
{
|
|
1595
|
+
...options,
|
|
1596
|
+
method: 'POST',
|
|
1597
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
1598
|
+
body: JSON.stringify(
|
|
1599
|
+
createProjectFileUploadBody,)
|
|
1600
|
+
}
|
|
1601
|
+
);}
|
|
1602
|
+
|
|
1603
|
+
|
|
1604
|
+
|
|
1605
|
+
export const getFinalizeProjectFileUploadUrl = (projectId: ProjectId,
|
|
1606
|
+
fileId: ProjectFileId,) => {
|
|
1607
|
+
|
|
1608
|
+
|
|
1609
|
+
|
|
1610
|
+
|
|
1611
|
+
return `/api/v2-beta/projects/${projectId}/files/${fileId}/finalize`
|
|
1612
|
+
}
|
|
1613
|
+
|
|
1614
|
+
export const finalizeProjectFileUpload = async (projectId: ProjectId,
|
|
1615
|
+
fileId: ProjectFileId, options?: RequestInit): Promise<ProjectFile> => {
|
|
1616
|
+
|
|
1617
|
+
return potatoFetch<ProjectFile>(getFinalizeProjectFileUploadUrl(projectId,fileId),
|
|
1618
|
+
{
|
|
1619
|
+
...options,
|
|
1620
|
+
method: 'POST'
|
|
1621
|
+
|
|
1622
|
+
|
|
1623
|
+
}
|
|
1624
|
+
);}
|
|
1625
|
+
|
|
1626
|
+
|
|
1627
|
+
|
|
1628
|
+
export const getDeleteProjectFileUrl = (projectId: ProjectId,
|
|
1629
|
+
fileId: ProjectFileId,) => {
|
|
1630
|
+
|
|
1631
|
+
|
|
1632
|
+
|
|
1633
|
+
|
|
1634
|
+
return `/api/v2-beta/projects/${projectId}/files/${fileId}`
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
export const deleteProjectFile = async (projectId: ProjectId,
|
|
1638
|
+
fileId: ProjectFileId, options?: RequestInit): Promise<void> => {
|
|
1639
|
+
|
|
1640
|
+
return potatoFetch<void>(getDeleteProjectFileUrl(projectId,fileId),
|
|
1641
|
+
{
|
|
1642
|
+
...options,
|
|
1643
|
+
method: 'DELETE'
|
|
1644
|
+
|
|
1645
|
+
|
|
1646
|
+
}
|
|
1647
|
+
);}
|
|
1648
|
+
|
|
1649
|
+
|
|
1650
|
+
|
|
1651
|
+
export const getListPipelineRunItemsUrl = (runId: RunId,
|
|
1652
|
+
params?: ListPipelineRunItemsParams,) => {
|
|
976
1653
|
const normalizedParams = new URLSearchParams();
|
|
977
1654
|
|
|
978
1655
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1656
|
+
|
|
979
1657
|
if (value !== undefined) {
|
|
980
|
-
normalizedParams.append(key, value === null ?
|
|
1658
|
+
normalizedParams.append(key, value === null ? 'null' : value.toString())
|
|
981
1659
|
}
|
|
982
1660
|
});
|
|
983
1661
|
|
|
984
1662
|
const stringifiedParams = normalizedParams.toString();
|
|
985
1663
|
|
|
986
|
-
return stringifiedParams.length > 0
|
|
987
|
-
|
|
988
|
-
: `/api/v2-beta/runs/${runId}/items`;
|
|
989
|
-
};
|
|
1664
|
+
return stringifiedParams.length > 0 ? `/api/v2-beta/runs/${runId}/items?${stringifiedParams}` : `/api/v2-beta/runs/${runId}/items`
|
|
1665
|
+
}
|
|
990
1666
|
|
|
991
|
-
export const listPipelineRunItems = async (
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
return potatoFetch<ListPipelineRunItems200>(getListPipelineRunItemsUrl(runId, params), {
|
|
1667
|
+
export const listPipelineRunItems = async (runId: RunId,
|
|
1668
|
+
params?: ListPipelineRunItemsParams, options?: RequestInit): Promise<ListPipelineRunItems200> => {
|
|
1669
|
+
|
|
1670
|
+
return potatoFetch<ListPipelineRunItems200>(getListPipelineRunItemsUrl(runId,params),
|
|
1671
|
+
{
|
|
997
1672
|
...options,
|
|
998
|
-
method:
|
|
999
|
-
|
|
1000
|
-
|
|
1673
|
+
method: 'GET'
|
|
1674
|
+
|
|
1675
|
+
|
|
1676
|
+
}
|
|
1677
|
+
);}
|
|
1678
|
+
|
|
1679
|
+
|
|
1680
|
+
|
|
1681
|
+
export const getGetPipelineRunItemUrl = (runId: RunId,
|
|
1682
|
+
itemId: RunItemId,) => {
|
|
1683
|
+
|
|
1001
1684
|
|
|
1002
|
-
|
|
1003
|
-
return `/api/v2-beta/runs/${runId}/items/${itemId}`;
|
|
1004
|
-
};
|
|
1685
|
+
|
|
1005
1686
|
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
): Promise<RunItem> => {
|
|
1011
|
-
|
|
1687
|
+
return `/api/v2-beta/runs/${runId}/items/${itemId}`
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
export const getPipelineRunItem = async (runId: RunId,
|
|
1691
|
+
itemId: RunItemId, options?: RequestInit): Promise<RunItem> => {
|
|
1692
|
+
|
|
1693
|
+
return potatoFetch<RunItem>(getGetPipelineRunItemUrl(runId,itemId),
|
|
1694
|
+
{
|
|
1012
1695
|
...options,
|
|
1013
|
-
method:
|
|
1014
|
-
|
|
1015
|
-
|
|
1696
|
+
method: 'GET'
|
|
1697
|
+
|
|
1698
|
+
|
|
1699
|
+
}
|
|
1700
|
+
);}
|
|
1701
|
+
|
|
1702
|
+
|
|
1016
1703
|
|
|
1017
|
-
export const getListPipelineChecksUrl = (pipelineId: PipelineId) => {
|
|
1018
|
-
return `/api/v2-beta/pipelines/${pipelineId}/checks`;
|
|
1019
|
-
};
|
|
1704
|
+
export const getListPipelineChecksUrl = (pipelineId: PipelineId,) => {
|
|
1020
1705
|
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1706
|
+
|
|
1707
|
+
|
|
1708
|
+
|
|
1709
|
+
return `/api/v2-beta/pipelines/${pipelineId}/checks`
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1712
|
+
export const listPipelineChecks = async (pipelineId: PipelineId, options?: RequestInit): Promise<ListPipelineChecks200> => {
|
|
1713
|
+
|
|
1714
|
+
return potatoFetch<ListPipelineChecks200>(getListPipelineChecksUrl(pipelineId),
|
|
1715
|
+
{
|
|
1026
1716
|
...options,
|
|
1027
|
-
method:
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
export const
|
|
1036
|
-
pipelineId: PipelineId,
|
|
1037
|
-
createPipelineCheckBody: CreatePipelineCheckBody,
|
|
1038
|
-
options?: RequestInit,
|
|
1039
|
-
): Promise<CheckJob> => {
|
|
1040
|
-
return potatoFetch<CheckJob>(getCreatePipelineCheckUrl(pipelineId), {
|
|
1041
|
-
...options,
|
|
1042
|
-
method: "POST",
|
|
1043
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
1044
|
-
body: JSON.stringify(createPipelineCheckBody),
|
|
1045
|
-
});
|
|
1046
|
-
};
|
|
1717
|
+
method: 'GET'
|
|
1718
|
+
|
|
1719
|
+
|
|
1720
|
+
}
|
|
1721
|
+
);}
|
|
1722
|
+
|
|
1723
|
+
|
|
1724
|
+
|
|
1725
|
+
export const getCreatePipelineCheckUrl = (pipelineId: PipelineId,) => {
|
|
1047
1726
|
|
|
1048
|
-
export const getGetPipelineCheckUrl = (checkRunId: CheckRunId) => {
|
|
1049
|
-
return `/api/v2-beta/checks/${checkRunId}`;
|
|
1050
|
-
};
|
|
1051
1727
|
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1728
|
+
|
|
1729
|
+
|
|
1730
|
+
return `/api/v2-beta/pipelines/${pipelineId}/checks`
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
export const createPipelineCheck = async (pipelineId: PipelineId,
|
|
1734
|
+
createPipelineCheckBody: CreatePipelineCheckBody, options?: RequestInit): Promise<CheckJob> => {
|
|
1735
|
+
|
|
1736
|
+
return potatoFetch<CheckJob>(getCreatePipelineCheckUrl(pipelineId),
|
|
1737
|
+
{
|
|
1057
1738
|
...options,
|
|
1058
|
-
method:
|
|
1059
|
-
|
|
1060
|
-
|
|
1739
|
+
method: 'POST',
|
|
1740
|
+
headers: { 'Content-Type': 'application/json', ...options?.headers },
|
|
1741
|
+
body: JSON.stringify(
|
|
1742
|
+
createPipelineCheckBody,)
|
|
1743
|
+
}
|
|
1744
|
+
);}
|
|
1745
|
+
|
|
1746
|
+
|
|
1747
|
+
|
|
1748
|
+
export const getGetPipelineCheckUrl = (checkRunId: CheckRunId,) => {
|
|
1749
|
+
|
|
1750
|
+
|
|
1751
|
+
|
|
1752
|
+
|
|
1753
|
+
return `/api/v2-beta/checks/${checkRunId}`
|
|
1754
|
+
}
|
|
1755
|
+
|
|
1756
|
+
export const getPipelineCheck = async (checkRunId: CheckRunId, options?: RequestInit): Promise<CheckJob> => {
|
|
1757
|
+
|
|
1758
|
+
return potatoFetch<CheckJob>(getGetPipelineCheckUrl(checkRunId),
|
|
1759
|
+
{
|
|
1760
|
+
...options,
|
|
1761
|
+
method: 'GET'
|
|
1762
|
+
|
|
1763
|
+
|
|
1764
|
+
}
|
|
1765
|
+
);}
|