@leaflow/sdk 0.210.0 → 0.211.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assistant/v1/generated/functions.d.ts +243 -67
- package/dist/assistant/v1/generated/functions.js +248 -44
- package/dist/assistant/v1/generated/models.d.ts +302 -230
- package/dist/assistant/v1/generated/models.js +9 -19
- package/dist/assistant/v1/generated/schemas.zod.d.ts +119 -29
- package/dist/assistant/v1/generated/schemas.zod.js +139 -29
- package/dist/assistant/v1/generated/validators/answerQuestionRequestBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/answerQuestionRequestBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/approvalMode.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/approvalMode.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/artifactListResponseBody.zod.d.ts +68 -0
- package/dist/assistant/v1/generated/validators/artifactListResponseBody.zod.js +35 -0
- package/dist/assistant/v1/generated/validators/artifactResource.zod.d.ts +65 -0
- package/dist/assistant/v1/generated/validators/{attachmentResource.zod.js → artifactResource.zod.js} +13 -14
- package/dist/assistant/v1/generated/validators/artifactVersionListResponseBody.zod.d.ts +61 -0
- package/dist/assistant/v1/generated/validators/artifactVersionListResponseBody.zod.js +35 -0
- package/dist/assistant/v1/generated/validators/{uploadedResource.zod.d.ts → artifactVersionResource.zod.d.ts} +30 -16
- package/dist/assistant/v1/generated/validators/{attachmentFileResource.zod.js → artifactVersionResource.zod.js} +23 -16
- package/dist/assistant/v1/generated/validators/bindingCodeResponseBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/bindingCodeResponseBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/bindingResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/bindingResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/channelResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/channelResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/channelWithSecretResponseBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/channelWithSecretResponseBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/checkSenderParams.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/checkSenderParams.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/choiceResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/choiceResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/clientActionRequest.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/clientActionRequest.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/clientContextPart.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/clientContextPart.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/clientContextRequest.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/clientContextRequest.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/clientFunctionRequest.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/clientFunctionRequest.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/completeUploadRequestBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/completeUploadRequestBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/contextUsageResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/contextUsageResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/createArtifactRequestBody.zod.d.ts +38 -0
- package/dist/assistant/v1/generated/validators/createArtifactRequestBody.zod.js +36 -0
- package/dist/assistant/v1/generated/validators/createArtifactVersionRequestBody.zod.d.ts +36 -0
- package/dist/assistant/v1/generated/validators/createArtifactVersionRequestBody.zod.js +34 -0
- package/dist/assistant/v1/generated/validators/createChannelRequestBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/createChannelRequestBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/createFolderRequestBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/createFolderRequestBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/createTaskRequestBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/createTaskRequestBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/createThreadRequestBody.zod.d.ts +5 -4
- package/dist/assistant/v1/generated/validators/createThreadRequestBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/createThreadResponseBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/createThreadResponseBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/createUploadRequestBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/createUploadRequestBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/credentialFieldResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/credentialFieldResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/cursorPagination.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/cursorPagination.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/decideToolCallsRequestBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/decideToolCallsRequestBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/defaultModelResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/defaultModelResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/error.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/error.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/errorStatus.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/errorStatus.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/fieldViolation.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/fieldViolation.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/{attachmentCountsResource.zod.d.ts → fileCountsResource.zod.d.ts} +7 -6
- package/dist/assistant/v1/generated/validators/{attachmentCountsResource.zod.js → fileCountsResource.zod.js} +5 -4
- package/dist/assistant/v1/generated/validators/fileDiffResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/fileDiffResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/{attachmentListResponseBody.zod.d.ts → fileListResponseBody.zod.d.ts} +15 -14
- package/dist/assistant/v1/generated/validators/{attachmentListResponseBody.zod.js → fileListResponseBody.zod.js} +9 -8
- package/dist/assistant/v1/generated/validators/{attachmentFileResource.zod.d.ts → fileResource.zod.d.ts} +14 -13
- package/dist/assistant/v1/generated/validators/{uploadedResource.zod.js → fileResource.zod.js} +25 -15
- package/dist/assistant/v1/generated/validators/folderCountsResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/folderCountsResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/folderListResponseBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/folderListResponseBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/folderResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/folderResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/itemSourceResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/itemSourceResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/lastTurnResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/lastTurnResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/lengthAwarePageBindingResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/lengthAwarePageBindingResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/lengthAwarePageChannelResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/lengthAwarePageChannelResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/listArtifactVersionsParams.zod.d.ts +39 -0
- package/dist/assistant/v1/generated/validators/listArtifactVersionsParams.zod.js +41 -0
- package/dist/assistant/v1/generated/validators/listArtifactsParams.zod.d.ts +41 -0
- package/dist/assistant/v1/generated/validators/listArtifactsParams.zod.js +39 -0
- package/dist/assistant/v1/generated/validators/listBindingsParams.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/listBindingsParams.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/listChannelRejectionsParams.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/listChannelRejectionsParams.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/listChannelsParams.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/listChannelsParams.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/listTaskRunsParams.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/listTaskRunsParams.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/listThreadItemsParams.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/listThreadItemsParams.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/listThreadMessagesParams.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/listThreadMessagesParams.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/listThreadTurnsParams.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/listThreadTurnsParams.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/loginResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/loginResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/memoryListResponseBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/memoryListResponseBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/memoryResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/memoryResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/messagePart.zod.d.ts +5 -4
- package/dist/assistant/v1/generated/validators/messagePart.zod.js +7 -6
- package/dist/assistant/v1/generated/validators/moveFolderRequestBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/moveFolderRequestBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/offsetPagination.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/offsetPagination.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/partResource.zod.d.ts +20 -4
- package/dist/assistant/v1/generated/validators/partResource.zod.js +8 -7
- package/dist/assistant/v1/generated/validators/pendingActionResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/pendingActionResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/placeThreadRequestBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/placeThreadRequestBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/platformListResponseBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/platformListResponseBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/platformResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/platformResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/presentationResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/presentationResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/putUploadPartHeaders.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/putUploadPartHeaders.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/putUploadPartParams.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/putUploadPartParams.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/questionResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/questionResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/reasoningEffort.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/reasoningEffort.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/rejectionListResponseBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/rejectionListResponseBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/rejectionResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/rejectionResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/resumeThreadRequestBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/resumeThreadRequestBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/revertRequestBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/revertRequestBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/revertedCountResponseBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/revertedCountResponseBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/rotateSecretRequestBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/rotateSecretRequestBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/{searchAttachmentsRequestBody.zod.d.ts → searchFilesRequestBody.zod.d.ts} +12 -11
- package/dist/assistant/v1/generated/validators/{searchAttachmentsRequestBody.zod.js → searchFilesRequestBody.zod.js} +17 -16
- package/dist/assistant/v1/generated/validators/searchTasksRequestBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/searchTasksRequestBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/searchThreadsRequestBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/searchThreadsRequestBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/sendMessageRequestBody.zod.d.ts +5 -4
- package/dist/assistant/v1/generated/validators/sendMessageRequestBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/sendMessageResponseBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/sendMessageResponseBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/senderCheckResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/senderCheckResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/settingsResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/settingsResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/skillEnabledRequestBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/skillEnabledRequestBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/skillListResponseBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/skillListResponseBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/skillRequestBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/skillRequestBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/skillResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/skillResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/subagentCountResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/subagentCountResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/taskAction.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/taskAction.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/taskListResponseBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/taskListResponseBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/taskResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/taskResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/taskRunEvent.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/taskRunEvent.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/taskRunListResponseBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/taskRunListResponseBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/taskRunResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/taskRunResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/taskTrigger.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/taskTrigger.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/threadCountsResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/threadCountsResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/threadItemListResponseBody.zod.d.ts +120 -29
- package/dist/assistant/v1/generated/validators/threadItemListResponseBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/threadItemResource.zod.d.ts +62 -16
- package/dist/assistant/v1/generated/validators/threadItemResource.zod.js +5 -6
- package/dist/assistant/v1/generated/validators/threadListResponseBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/threadListResponseBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/threadMessageListResponseBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/threadMessageListResponseBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/threadMessageResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/threadMessageResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/threadResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/threadResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/threadStatus.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/threadStatus.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/threadTurnListResponseBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/threadTurnListResponseBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/threadTurnResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/threadTurnResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/todoResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/todoResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/toolCallResource.zod.d.ts +46 -3
- package/dist/assistant/v1/generated/validators/toolCallResource.zod.js +12 -3
- package/dist/assistant/v1/generated/validators/toolResultRequestBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/toolResultRequestBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/turnStartedResponseBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/turnStartedResponseBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/turnStatus.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/turnStatus.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/turnType.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/turnType.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/{attachmentResource.zod.d.ts → updateArtifactRequestBody.zod.d.ts} +9 -16
- package/dist/assistant/v1/generated/validators/updateArtifactRequestBody.zod.js +34 -0
- package/dist/assistant/v1/generated/validators/updateChannelRequestBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/updateChannelRequestBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/{updateAttachmentRequestBody.zod.d.ts → updateFileRequestBody.zod.d.ts} +8 -7
- package/dist/assistant/v1/generated/validators/{updateAttachmentRequestBody.zod.js → updateFileRequestBody.zod.js} +7 -6
- package/dist/assistant/v1/generated/validators/updateFolderRequestBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/updateFolderRequestBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/updateSettingsRequestBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/updateSettingsRequestBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/updateTaskRequestBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/updateTaskRequestBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/updateThreadRequestBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/updateThreadRequestBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/updateUploadRequestBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/updateUploadRequestBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/uploadConfigurationResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/uploadConfigurationResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/{uploadAttachmentParams.zod.d.ts → uploadFileParams.zod.d.ts} +8 -7
- package/dist/assistant/v1/generated/validators/{uploadAttachmentParams.zod.js → uploadFileParams.zod.js} +7 -6
- package/dist/assistant/v1/generated/validators/uploadListResponseBody.zod.d.ts +5 -4
- package/dist/assistant/v1/generated/validators/uploadListResponseBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/uploadPartResource.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/uploadPartResource.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/uploadResource.zod.d.ts +5 -4
- package/dist/assistant/v1/generated/validators/uploadResource.zod.js +8 -4
- package/dist/assistant/v1/generated/validators/usage.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/usage.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/verifyCodeRequestBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/verifyCodeRequestBody.zod.js +4 -3
- package/dist/assistant/v1/generated/validators/webhookSecretResponseBody.zod.d.ts +4 -3
- package/dist/assistant/v1/generated/validators/webhookSecretResponseBody.zod.js +4 -3
- package/dist/routes.d.ts +76 -12
- package/dist/routes.js +84 -12
- package/package.json +1 -1
|
@@ -1048,7 +1048,7 @@ export const updateSettings = async (updateSettingsRequestBody, options, fetchFn
|
|
|
1048
1048
|
const data = body ? JSON.parse(body) : {};
|
|
1049
1049
|
return { data, status: res.status, headers: res.headers };
|
|
1050
1050
|
};
|
|
1051
|
-
export const
|
|
1051
|
+
export const getUploadFileUrl = (params) => {
|
|
1052
1052
|
const normalizedParams = new URLSearchParams();
|
|
1053
1053
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1054
1054
|
if (value !== undefined) {
|
|
@@ -1057,18 +1057,18 @@ export const getUploadAttachmentUrl = (params) => {
|
|
|
1057
1057
|
});
|
|
1058
1058
|
const stringifiedParams = normalizedParams.toString();
|
|
1059
1059
|
return stringifiedParams.length > 0
|
|
1060
|
-
? `https://assistant.leaflow.cloud/api/v1/
|
|
1061
|
-
: `https://assistant.leaflow.cloud/api/v1/
|
|
1060
|
+
? `https://assistant.leaflow.cloud/api/v1/files?${stringifiedParams}`
|
|
1061
|
+
: `https://assistant.leaflow.cloud/api/v1/files`;
|
|
1062
1062
|
};
|
|
1063
1063
|
/**
|
|
1064
|
-
* The body is the file bytes themselves, not multipart, one file per request. The type is determined from the content, not from Content-Type or from the name. Put the returned id in
|
|
1064
|
+
* The body is the file bytes themselves, not multipart, one file per request. The type is determined from the content, not from Content-Type or from the name. Put the returned id in a `file` part when sending a message.
|
|
1065
1065
|
*
|
|
1066
1066
|
* An upload that no message ever references is a draft, and drafts are collected — `draftExpiresAt` in the response says when this one goes. Sending a message with the id makes it permanent.
|
|
1067
1067
|
*
|
|
1068
1068
|
* The returned `type` says how the assistant will see it. An `image` is read directly, and only by models that accept image input. A small `text` file is placed inline in the message. A large `text` file, and anything `binary`, arrives as a reference the assistant reads on demand — for a binary that usually means downloading it onto one of the project's cloud instances.
|
|
1069
1069
|
* @summary Upload a file
|
|
1070
1070
|
*/
|
|
1071
|
-
export const
|
|
1071
|
+
export const uploadFile = async (uploadFileBody, params, options, fetchFn) => {
|
|
1072
1072
|
const getHeaders = (h) => {
|
|
1073
1073
|
if (!h)
|
|
1074
1074
|
return {};
|
|
@@ -1084,31 +1084,33 @@ export const uploadAttachment = async (uploadAttachmentBody, params, options, fe
|
|
|
1084
1084
|
}
|
|
1085
1085
|
return headers;
|
|
1086
1086
|
};
|
|
1087
|
-
const res = await (fetchFn ?? fetch)(
|
|
1087
|
+
const res = await (fetchFn ?? fetch)(getUploadFileUrl(params), {
|
|
1088
1088
|
...options,
|
|
1089
1089
|
method: "POST",
|
|
1090
1090
|
headers: { "Content-Type": "*/*", ...getHeaders(options?.headers) },
|
|
1091
|
-
body:
|
|
1091
|
+
body: uploadFileBody,
|
|
1092
1092
|
});
|
|
1093
1093
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1094
1094
|
const data = body ? JSON.parse(body) : {};
|
|
1095
1095
|
return { data, status: res.status, headers: res.headers };
|
|
1096
1096
|
};
|
|
1097
|
-
export const
|
|
1098
|
-
return `https://assistant.leaflow.cloud/api/v1/
|
|
1097
|
+
export const getSearchFilesUrl = () => {
|
|
1098
|
+
return `https://assistant.leaflow.cloud/api/v1/files`;
|
|
1099
1099
|
};
|
|
1100
1100
|
/**
|
|
1101
|
-
* The caller's
|
|
1102
|
-
*
|
|
1101
|
+
* The caller's library in this project, most recently uploaded first: the files they attached to
|
|
1102
|
+
* messages, plus uploads that no message has referenced yet. Files that tools produced and
|
|
1103
|
+
* artifacts the assistant handed over are not listed here; artifacts are listed by
|
|
1104
|
+
* list-artifacts.
|
|
1103
1105
|
*
|
|
1104
1106
|
* A file with no message referencing it is a draft: `draftExpiresAt` says when it is cleared.
|
|
1105
1107
|
* Sending a message with the id makes it permanent and that field becomes null.
|
|
1106
1108
|
*
|
|
1107
1109
|
* Files removed from the library are not listed, but conversations that already use them keep
|
|
1108
1110
|
* them and download-by-id still works.
|
|
1109
|
-
* @summary Search
|
|
1111
|
+
* @summary Search files
|
|
1110
1112
|
*/
|
|
1111
|
-
export const
|
|
1113
|
+
export const searchFiles = async (searchFilesRequestBody, options, fetchFn) => {
|
|
1112
1114
|
const getHeaders = (h) => {
|
|
1113
1115
|
if (!h)
|
|
1114
1116
|
return {};
|
|
@@ -1124,29 +1126,29 @@ export const searchAttachments = async (searchAttachmentsRequestBody, options, f
|
|
|
1124
1126
|
}
|
|
1125
1127
|
return headers;
|
|
1126
1128
|
};
|
|
1127
|
-
const res = await (fetchFn ?? fetch)(
|
|
1129
|
+
const res = await (fetchFn ?? fetch)(getSearchFilesUrl(), {
|
|
1128
1130
|
...options,
|
|
1129
1131
|
method: "QUERY",
|
|
1130
1132
|
headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
|
|
1131
|
-
body: JSON.stringify(
|
|
1133
|
+
body: JSON.stringify(searchFilesRequestBody),
|
|
1132
1134
|
});
|
|
1133
1135
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1134
1136
|
const data = body ? JSON.parse(body) : {};
|
|
1135
1137
|
return { data, status: res.status, headers: res.headers };
|
|
1136
1138
|
};
|
|
1137
|
-
export const
|
|
1138
|
-
return `https://assistant.leaflow.cloud/api/v1/
|
|
1139
|
+
export const getGetFileUrl = (file) => {
|
|
1140
|
+
return `https://assistant.leaflow.cloud/api/v1/files/${encodeURIComponent(String(file))}`;
|
|
1139
1141
|
};
|
|
1140
1142
|
/**
|
|
1141
|
-
* Metadata for one
|
|
1143
|
+
* Metadata for one file. The bytes are at /api/v1/files/{file}:download.
|
|
1142
1144
|
*
|
|
1143
|
-
* Returns 404 when the
|
|
1144
|
-
*
|
|
1145
|
-
*
|
|
1145
|
+
* Returns 404 when the file does not exist, does not belong to the current user, or was removed
|
|
1146
|
+
* from the library. Removed files stay readable through their conversations but are no longer
|
|
1147
|
+
* described here.
|
|
1146
1148
|
* @summary Get a file
|
|
1147
1149
|
*/
|
|
1148
|
-
export const
|
|
1149
|
-
const res = await (fetchFn ?? fetch)(
|
|
1150
|
+
export const getFile = async (file, options, fetchFn) => {
|
|
1151
|
+
const res = await (fetchFn ?? fetch)(getGetFileUrl(file), {
|
|
1150
1152
|
...options,
|
|
1151
1153
|
method: "GET",
|
|
1152
1154
|
});
|
|
@@ -1154,16 +1156,15 @@ export const getAttachment = async (attachment, options, fetchFn) => {
|
|
|
1154
1156
|
const data = body ? JSON.parse(body) : {};
|
|
1155
1157
|
return { data, status: res.status, headers: res.headers };
|
|
1156
1158
|
};
|
|
1157
|
-
export const
|
|
1158
|
-
return `https://assistant.leaflow.cloud/api/v1/
|
|
1159
|
+
export const getUpdateFileUrl = (file) => {
|
|
1160
|
+
return `https://assistant.leaflow.cloud/api/v1/files/${encodeURIComponent(String(file))}`;
|
|
1159
1161
|
};
|
|
1160
1162
|
/**
|
|
1161
|
-
* Changes the name shown in the library and given to the assistant. The bytes and the
|
|
1162
|
-
*
|
|
1163
|
-
* on.
|
|
1163
|
+
* Changes the name shown in the library and given to the assistant. The bytes and the file id do
|
|
1164
|
+
* not change; conversations that already use it see the new name from their next request on.
|
|
1164
1165
|
* @summary Rename a file
|
|
1165
1166
|
*/
|
|
1166
|
-
export const
|
|
1167
|
+
export const updateFile = async (file, updateFileRequestBody, options, fetchFn) => {
|
|
1167
1168
|
const getHeaders = (h) => {
|
|
1168
1169
|
if (!h)
|
|
1169
1170
|
return {};
|
|
@@ -1179,27 +1180,27 @@ export const updateAttachment = async (attachment, updateAttachmentRequestBody,
|
|
|
1179
1180
|
}
|
|
1180
1181
|
return headers;
|
|
1181
1182
|
};
|
|
1182
|
-
const res = await (fetchFn ?? fetch)(
|
|
1183
|
+
const res = await (fetchFn ?? fetch)(getUpdateFileUrl(file), {
|
|
1183
1184
|
...options,
|
|
1184
1185
|
method: "PATCH",
|
|
1185
1186
|
headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
|
|
1186
|
-
body: JSON.stringify(
|
|
1187
|
+
body: JSON.stringify(updateFileRequestBody),
|
|
1187
1188
|
});
|
|
1188
1189
|
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1189
1190
|
const data = body ? JSON.parse(body) : {};
|
|
1190
1191
|
return { data, status: res.status, headers: res.headers };
|
|
1191
1192
|
};
|
|
1192
|
-
export const
|
|
1193
|
-
return `https://assistant.leaflow.cloud/api/v1/
|
|
1193
|
+
export const getDeleteFileUrl = (file) => {
|
|
1194
|
+
return `https://assistant.leaflow.cloud/api/v1/files/${encodeURIComponent(String(file))}`;
|
|
1194
1195
|
};
|
|
1195
1196
|
/**
|
|
1196
|
-
* Hides the file from the library. Conversations that already use it keep it: the
|
|
1197
|
-
*
|
|
1198
|
-
*
|
|
1197
|
+
* Hides the file from the library. Conversations that already use it keep it: the file stays
|
|
1198
|
+
* readable by id and keeps rendering in their history. Its bytes are released when the project
|
|
1199
|
+
* is deleted. A draft is cleared for good when its expiry passes. Idempotent.
|
|
1199
1200
|
* @summary Remove a file from the library
|
|
1200
1201
|
*/
|
|
1201
|
-
export const
|
|
1202
|
-
const res = await (fetchFn ?? fetch)(
|
|
1202
|
+
export const deleteFile = async (file, options, fetchFn) => {
|
|
1203
|
+
const res = await (fetchFn ?? fetch)(getDeleteFileUrl(file), {
|
|
1203
1204
|
...options,
|
|
1204
1205
|
method: "DELETE",
|
|
1205
1206
|
});
|
|
@@ -1207,17 +1208,17 @@ export const deleteAttachment = async (attachment, options, fetchFn) => {
|
|
|
1207
1208
|
const data = body ? JSON.parse(body) : undefined;
|
|
1208
1209
|
return { data, status: res.status, headers: res.headers };
|
|
1209
1210
|
};
|
|
1210
|
-
export const
|
|
1211
|
-
return `https://assistant.leaflow.cloud/api/v1/
|
|
1211
|
+
export const getDownloadFileUrl = (file) => {
|
|
1212
|
+
return `https://assistant.leaflow.cloud/api/v1/files/${encodeURIComponent(String(file))}:download`;
|
|
1212
1213
|
};
|
|
1213
1214
|
/**
|
|
1214
|
-
* Returns the original bytes
|
|
1215
|
+
* Returns the original bytes of a file, including one removed from the library, a file a tool produced and an artifact version. The response carries long-lived cache headers because the content never changes. Returns 404 when the file does not exist or does not belong to the current user.
|
|
1215
1216
|
*
|
|
1216
|
-
* Only
|
|
1217
|
+
* Only a file whose `type` is `image` comes back with its own image type and is usable as the address of an `<img>`. Everything else is served as `application/octet-stream` with `Content-Disposition: attachment`, deliberately: a file is arbitrary bytes under a name chosen elsewhere, and serving it back inline would run it on this origin.
|
|
1217
1218
|
* @summary Download a file
|
|
1218
1219
|
*/
|
|
1219
|
-
export const
|
|
1220
|
-
const res = await (fetchFn ?? fetch)(
|
|
1220
|
+
export const downloadFile = async (file, options, fetchFn) => {
|
|
1221
|
+
const res = await (fetchFn ?? fetch)(getDownloadFileUrl(file), {
|
|
1221
1222
|
...options,
|
|
1222
1223
|
method: "GET",
|
|
1223
1224
|
});
|
|
@@ -1441,6 +1442,209 @@ export const putUploadPart = async (upload, part, putUploadPartBody, params, hea
|
|
|
1441
1442
|
const data = body ? JSON.parse(body) : {};
|
|
1442
1443
|
return { data, status: res.status, headers: res.headers };
|
|
1443
1444
|
};
|
|
1445
|
+
export const getListArtifactsUrl = (params) => {
|
|
1446
|
+
const normalizedParams = new URLSearchParams();
|
|
1447
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1448
|
+
if (value !== undefined) {
|
|
1449
|
+
normalizedParams.append(key, value === null ? "null" : String(value));
|
|
1450
|
+
}
|
|
1451
|
+
});
|
|
1452
|
+
const stringifiedParams = normalizedParams.toString();
|
|
1453
|
+
return stringifiedParams.length > 0
|
|
1454
|
+
? `https://assistant.leaflow.cloud/api/v1/artifacts?${stringifiedParams}`
|
|
1455
|
+
: `https://assistant.leaflow.cloud/api/v1/artifacts`;
|
|
1456
|
+
};
|
|
1457
|
+
/**
|
|
1458
|
+
* The caller's artifacts in this project, most recently updated first. An artifact is a file the
|
|
1459
|
+
* assistant handed over, kept under one title across its versions: a later version replaces what
|
|
1460
|
+
* the person sees, and earlier versions stay readable.
|
|
1461
|
+
*
|
|
1462
|
+
* With `thread`, only artifacts that have a version created in that conversation are listed.
|
|
1463
|
+
* @summary List artifacts
|
|
1464
|
+
*/
|
|
1465
|
+
export const listArtifacts = async (params, options, fetchFn) => {
|
|
1466
|
+
const res = await (fetchFn ?? fetch)(getListArtifactsUrl(params), {
|
|
1467
|
+
...options,
|
|
1468
|
+
method: "GET",
|
|
1469
|
+
});
|
|
1470
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1471
|
+
const data = body ? JSON.parse(body) : {};
|
|
1472
|
+
return { data, status: res.status, headers: res.headers };
|
|
1473
|
+
};
|
|
1474
|
+
export const getCreateArtifactUrl = () => {
|
|
1475
|
+
return `https://assistant.leaflow.cloud/api/v1/artifacts`;
|
|
1476
|
+
};
|
|
1477
|
+
/**
|
|
1478
|
+
* Makes a file the first version of a new artifact. The file must belong to the caller in this
|
|
1479
|
+
* project. Fails with 404 and code FILE_NOT_FOUND when it does not.
|
|
1480
|
+
* @summary Create an artifact
|
|
1481
|
+
*/
|
|
1482
|
+
export const createArtifact = async (createArtifactRequestBody, options, fetchFn) => {
|
|
1483
|
+
const getHeaders = (h) => {
|
|
1484
|
+
if (!h)
|
|
1485
|
+
return {};
|
|
1486
|
+
if (h instanceof Headers)
|
|
1487
|
+
return Object.fromEntries(h.entries());
|
|
1488
|
+
if (Symbol.iterator in h) {
|
|
1489
|
+
return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
1490
|
+
}
|
|
1491
|
+
const headers = {};
|
|
1492
|
+
for (const [name, value] of Object.entries(h)) {
|
|
1493
|
+
if (value !== undefined)
|
|
1494
|
+
headers[name] = value;
|
|
1495
|
+
}
|
|
1496
|
+
return headers;
|
|
1497
|
+
};
|
|
1498
|
+
const res = await (fetchFn ?? fetch)(getCreateArtifactUrl(), {
|
|
1499
|
+
...options,
|
|
1500
|
+
method: "POST",
|
|
1501
|
+
headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
|
|
1502
|
+
body: JSON.stringify(createArtifactRequestBody),
|
|
1503
|
+
});
|
|
1504
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1505
|
+
const data = body ? JSON.parse(body) : {};
|
|
1506
|
+
return { data, status: res.status, headers: res.headers };
|
|
1507
|
+
};
|
|
1508
|
+
export const getGetArtifactUrl = (artifact) => {
|
|
1509
|
+
return `https://assistant.leaflow.cloud/api/v1/artifacts/${encodeURIComponent(String(artifact))}`;
|
|
1510
|
+
};
|
|
1511
|
+
/**
|
|
1512
|
+
* @summary Get an artifact
|
|
1513
|
+
*/
|
|
1514
|
+
export const getArtifact = async (artifact, options, fetchFn) => {
|
|
1515
|
+
const res = await (fetchFn ?? fetch)(getGetArtifactUrl(artifact), {
|
|
1516
|
+
...options,
|
|
1517
|
+
method: "GET",
|
|
1518
|
+
});
|
|
1519
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1520
|
+
const data = body ? JSON.parse(body) : {};
|
|
1521
|
+
return { data, status: res.status, headers: res.headers };
|
|
1522
|
+
};
|
|
1523
|
+
export const getUpdateArtifactUrl = (artifact) => {
|
|
1524
|
+
return `https://assistant.leaflow.cloud/api/v1/artifacts/${encodeURIComponent(String(artifact))}`;
|
|
1525
|
+
};
|
|
1526
|
+
/**
|
|
1527
|
+
* Changes the title shown for every version. The versions and their files do not change.
|
|
1528
|
+
* @summary Rename an artifact
|
|
1529
|
+
*/
|
|
1530
|
+
export const updateArtifact = async (artifact, updateArtifactRequestBody, options, fetchFn) => {
|
|
1531
|
+
const getHeaders = (h) => {
|
|
1532
|
+
if (!h)
|
|
1533
|
+
return {};
|
|
1534
|
+
if (h instanceof Headers)
|
|
1535
|
+
return Object.fromEntries(h.entries());
|
|
1536
|
+
if (Symbol.iterator in h) {
|
|
1537
|
+
return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
1538
|
+
}
|
|
1539
|
+
const headers = {};
|
|
1540
|
+
for (const [name, value] of Object.entries(h)) {
|
|
1541
|
+
if (value !== undefined)
|
|
1542
|
+
headers[name] = value;
|
|
1543
|
+
}
|
|
1544
|
+
return headers;
|
|
1545
|
+
};
|
|
1546
|
+
const res = await (fetchFn ?? fetch)(getUpdateArtifactUrl(artifact), {
|
|
1547
|
+
...options,
|
|
1548
|
+
method: "PATCH",
|
|
1549
|
+
headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
|
|
1550
|
+
body: JSON.stringify(updateArtifactRequestBody),
|
|
1551
|
+
});
|
|
1552
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1553
|
+
const data = body ? JSON.parse(body) : {};
|
|
1554
|
+
return { data, status: res.status, headers: res.headers };
|
|
1555
|
+
};
|
|
1556
|
+
export const getDeleteArtifactUrl = (artifact) => {
|
|
1557
|
+
return `https://assistant.leaflow.cloud/api/v1/artifacts/${encodeURIComponent(String(artifact))}`;
|
|
1558
|
+
};
|
|
1559
|
+
/**
|
|
1560
|
+
* Removes the artifact and its versions from lists, and the assistant can no longer add versions
|
|
1561
|
+
* to it. Conversations that showed a version keep showing it, and its file stays downloadable.
|
|
1562
|
+
* Idempotent.
|
|
1563
|
+
* @summary Delete an artifact
|
|
1564
|
+
*/
|
|
1565
|
+
export const deleteArtifact = async (artifact, options, fetchFn) => {
|
|
1566
|
+
const res = await (fetchFn ?? fetch)(getDeleteArtifactUrl(artifact), {
|
|
1567
|
+
...options,
|
|
1568
|
+
method: "DELETE",
|
|
1569
|
+
});
|
|
1570
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1571
|
+
const data = body ? JSON.parse(body) : undefined;
|
|
1572
|
+
return { data, status: res.status, headers: res.headers };
|
|
1573
|
+
};
|
|
1574
|
+
export const getListArtifactVersionsUrl = (artifact, params) => {
|
|
1575
|
+
const normalizedParams = new URLSearchParams();
|
|
1576
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1577
|
+
if (value !== undefined) {
|
|
1578
|
+
normalizedParams.append(key, value === null ? "null" : String(value));
|
|
1579
|
+
}
|
|
1580
|
+
});
|
|
1581
|
+
const stringifiedParams = normalizedParams.toString();
|
|
1582
|
+
return stringifiedParams.length > 0
|
|
1583
|
+
? `https://assistant.leaflow.cloud/api/v1/artifacts/${encodeURIComponent(String(artifact))}/versions?${stringifiedParams}`
|
|
1584
|
+
: `https://assistant.leaflow.cloud/api/v1/artifacts/${encodeURIComponent(String(artifact))}/versions`;
|
|
1585
|
+
};
|
|
1586
|
+
/**
|
|
1587
|
+
* The versions of an artifact, newest first.
|
|
1588
|
+
* @summary List artifact versions
|
|
1589
|
+
*/
|
|
1590
|
+
export const listArtifactVersions = async (artifact, params, options, fetchFn) => {
|
|
1591
|
+
const res = await (fetchFn ?? fetch)(getListArtifactVersionsUrl(artifact, params), {
|
|
1592
|
+
...options,
|
|
1593
|
+
method: "GET",
|
|
1594
|
+
});
|
|
1595
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1596
|
+
const data = body ? JSON.parse(body) : {};
|
|
1597
|
+
return { data, status: res.status, headers: res.headers };
|
|
1598
|
+
};
|
|
1599
|
+
export const getCreateArtifactVersionUrl = (artifact) => {
|
|
1600
|
+
return `https://assistant.leaflow.cloud/api/v1/artifacts/${encodeURIComponent(String(artifact))}/versions`;
|
|
1601
|
+
};
|
|
1602
|
+
/**
|
|
1603
|
+
* Makes a file the newest version of the artifact. The file must belong to the caller in this
|
|
1604
|
+
* project. Fails with 404 and code FILE_NOT_FOUND when it does not.
|
|
1605
|
+
* @summary Add a version
|
|
1606
|
+
*/
|
|
1607
|
+
export const createArtifactVersion = async (artifact, createArtifactVersionRequestBody, options, fetchFn) => {
|
|
1608
|
+
const getHeaders = (h) => {
|
|
1609
|
+
if (!h)
|
|
1610
|
+
return {};
|
|
1611
|
+
if (h instanceof Headers)
|
|
1612
|
+
return Object.fromEntries(h.entries());
|
|
1613
|
+
if (Symbol.iterator in h) {
|
|
1614
|
+
return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
1615
|
+
}
|
|
1616
|
+
const headers = {};
|
|
1617
|
+
for (const [name, value] of Object.entries(h)) {
|
|
1618
|
+
if (value !== undefined)
|
|
1619
|
+
headers[name] = value;
|
|
1620
|
+
}
|
|
1621
|
+
return headers;
|
|
1622
|
+
};
|
|
1623
|
+
const res = await (fetchFn ?? fetch)(getCreateArtifactVersionUrl(artifact), {
|
|
1624
|
+
...options,
|
|
1625
|
+
method: "POST",
|
|
1626
|
+
headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
|
|
1627
|
+
body: JSON.stringify(createArtifactVersionRequestBody),
|
|
1628
|
+
});
|
|
1629
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1630
|
+
const data = body ? JSON.parse(body) : {};
|
|
1631
|
+
return { data, status: res.status, headers: res.headers };
|
|
1632
|
+
};
|
|
1633
|
+
export const getGetArtifactVersionUrl = (artifact, version) => {
|
|
1634
|
+
return `https://assistant.leaflow.cloud/api/v1/artifacts/${encodeURIComponent(String(artifact))}/versions/${encodeURIComponent(String(version))}`;
|
|
1635
|
+
};
|
|
1636
|
+
/**
|
|
1637
|
+
* @summary Get an artifact version
|
|
1638
|
+
*/
|
|
1639
|
+
export const getArtifactVersion = async (artifact, version, options, fetchFn) => {
|
|
1640
|
+
const res = await (fetchFn ?? fetch)(getGetArtifactVersionUrl(artifact, version), {
|
|
1641
|
+
...options,
|
|
1642
|
+
method: "GET",
|
|
1643
|
+
});
|
|
1644
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
1645
|
+
const data = body ? JSON.parse(body) : {};
|
|
1646
|
+
return { data, status: res.status, headers: res.headers };
|
|
1647
|
+
};
|
|
1444
1648
|
export const getListMemoriesUrl = () => {
|
|
1445
1649
|
return `https://assistant.leaflow.cloud/api/v1/memories`;
|
|
1446
1650
|
};
|