From 58767e2de72f53e703b22b8f6fdee1d2735c8827 Mon Sep 17 00:00:00 2001 From: Rhys Lees <43909932+RhysLees@users.noreply.github.com> Date: Thu, 9 Jan 2025 18:10:02 +0000 Subject: [PATCH 1/8] WIP --- .phpunit.cache/test-results | 2 +- .../Upload/ReplaceAPDFDocumentSection.php | 51 ++++++++++++++++ .../ReplaceAPDFDocumentSectionResponse.php | 20 +++++++ .../Upload/ReplaceAPDFDocumentSectionTest.php | 58 +++++++++++++++++++ 4 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 src/Requests/FileCabinets/Upload/ReplaceAPDFDocumentSection.php create mode 100644 src/Responses/FileCabinets/Upload/ReplaceAPDFDocumentSectionResponse.php create mode 100644 tests/Feature/Requests/FileCabinets/Upload/ReplaceAPDFDocumentSectionTest.php diff --git a/.phpunit.cache/test-results b/.phpunit.cache/test-results index 5d9c295..fdb1dd1 100644 --- a/.phpunit.cache/test-results +++ b/.phpunit.cache/test-results @@ -1 +1 @@ -{"version":"pest_2.36.0","defects":[],"times":{"P\\Tests\\Feature\\Requests\\Documents\\ClipUnclipStapleUnstaple\\UnclipTest::__pest_evaluable_it_can_unclip_2_documents":13.49,"P\\Tests\\Feature\\Requests\\Documents\\Download\\DownloadThumbnailTest::__pest_evaluable_it_can_download_a_thumbnail":1.227,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\CreateUpdateUsers\\CreateUpdateUserTest::__pest_evaluable_it_can_create_users":1.712,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\CreateUpdateUsers\\CreateUpdateUserTest::__pest_evaluable_it_can_update_users":6.045,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexDateDTOTest::__pest_evaluable_it_create_index_date_dto":0.003,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyRoles\\GetRolesTest::__pest_evaluable_it_can_list_groups":0.826,"P\\Tests\\Feature\\Requests\\Documents\\Sections\\GetAllSectionsFromADocumentTest::__pest_evaluable_it_can_get_all_sections_from_a_document":1.015,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\DeleteDocumentsFromTrashBinTest::__pest_evaluable_it_can_delete_documents_in_trash":1.466,"P\\Tests\\Feature\\Requests\\Workflow\\GetDocumentWorkflowHistoryTest::__pest_evaluable_it_can_get_document_workflow_history":6.432,"P\\Tests\\Feature\\SleepTest::__pest_evaluable_sleep":0.727,"P\\Tests\\Feature\\Requests\\Documents\\Sections\\GetASpecificSectionTest::__pest_evaluable_it_can_get_a_specific_section":1.034,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyGroups\\GetAllGroupsForASpecificUserTest::__pest_evaluable_it_can_list_groups_for_a_specific_user":1.006,"P\\Tests\\Feature\\Requests\\Documents\\Thumbnail\\GetDocumentDownloadThumbnailRequestTest::__pest_evaluable_it_can_download_a_document_thumbnail":1.082,"P\\Tests\\Feature\\Requests\\FileCabinets\\General\\GetFileCabinetInformationTest::__pest_evaluable_it_can_get_file_cabinet_information":0.761,"P\\Tests\\Unit\\DTO\\DocumentIndex\\PrepareDTOTest::__pest_evaluable_it_create_prepare_makeContent_dto":0.003,"P\\Tests\\Feature\\Requests\\FileCabinets\\Dialogs\\GetDialogsOfASpecificTypeTest::__pest_evaluable_it_can_list_dialogs_for_a_file_cabinet":0.877,"P\\Tests\\Feature\\Requests\\Documents\\Download\\DownloadSectionTest::__pest_evaluable_it_can_download_a_section":0.964,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_override_search_documents_dates_filter_by_using_same_operator":0.834,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_override_search_documents_dates_filter_by_using_equal_operator":0.882,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents":0.768,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_t_search_documents_by_diverged_date_range":0.725,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents_with_multiple_values":1.511,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents_with_null_values":0.775,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents_dates_filter_in_past":0.813,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents_dates_filter_in_future":0.858,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_t_search_documents_by_more_than_two_dates":0.739,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyGroups\\GetGroupsTest::__pest_evaluable_it_can_list_groups":0.831,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetUsers\\GetUsersOfAGroupTest::__pest_evaluable_it_can_list_users_of_a_group":1.126,"P\\Tests\\Feature\\Requests\\Documents\\Sections\\DeleteSectionTest::__pest_evaluable_it_can_delete_a_specific_section":1.634,"P\\Tests\\Feature\\Requests\\Documents\\ClipUnclipStapleUnstaple\\ClipTest::__pest_evaluable_it_can_clip_2_documents":7.648,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexDecimalDTOTest::__pest_evaluable_it_create_index_numeric_dto":0.003,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetUsers\\GetUsersTest::__pest_evaluable_it_can_list_users":1.063,"P\\Tests\\Feature\\Requests\\FileCabinets\\Search\\GetDocumentsFromAFileCabinetTest::__pest_evaluable_it_can_get_all_documents":1.419,"P\\Tests\\Feature\\Requests\\Documents\\Download\\DownloadDocumentTest::__pest_evaluable_it_can_download_a_document":1.021,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\RestoreDocumentsFromTrashBinTest::__pest_evaluable_it_can_restore_documents_in_trash":1.447,"P\\Tests\\Feature\\Requests\\Documents\\ApplicationProperties\\ApplicationPropertiesTest::__pest_evaluable_it_can_add_get_update_delete_application_properties_to_a_document":1.407,"P\\Tests\\Feature\\Requests\\FileCabinets\\Dialogs\\GetASpecificDialogTest::__pest_evaluable_it_can_get_a_dialog":0.786,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexDateTimeDTOTest::__pest_evaluable_it_create_index_date_time_dto":0.004,"P\\Tests\\Feature\\DocuWareTest::__pest_evaluable_it_can_create_encrypted_url_for_a_document_in_a_basket":0.604,"P\\Tests\\Feature\\DocuWareTest::__pest_evaluable_it_can_create_encrypted_url_for_a_document_in_a_file_cabinet":0.67,"P\\Tests\\Feature\\Requests\\Organization\\GetOrganizationsRequestTest::__pest_evaluable_it_can_list_organizations":0.796,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_document_paginator":0.642,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_document":0.588,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_document_field":0.585,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_organization":0.61,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_suggestion_field":0.602,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_table_row":0.66,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_dialog":0.649,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_file_cabinet":0.639,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_field":0.655,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_organization_index":0.658,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyRoles\\GetAllRolesForASpecificUserTest::__pest_evaluable_it_can_list_groups":1.106,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_t_search_documents_by_more_than_two_dates_in_trash":0.701,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_override_search_documents_dates_filter_by_using_equal_operator_in_trash":0.799,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_override_search_documents_dates_filter_by_using_same_operator_in_trash":0.905,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_search_documents_with_null_values_in_trash":0.979,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_search_documents_dates_filter_in_past_in_trash":0.827,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_search_documents_dates_filter_in_future_in_trash":0.839,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_t_search_documents_by_diverged_date_range":0.747,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_search_documents_in_trash":0.819,"P\\Tests\\Feature\\Requests\\Documents\\GetDocumentCountRequestTest::__pest_evaluable_it_can_get_a_total_count_of_documents":1.146,"P\\Tests\\Feature\\Requests\\Documents\\PutDocumentFieldsRequestTest::__pest_evaluable_it_can_update_a_document_value":1.035,"P\\Tests\\Feature\\Requests\\Documents\\PutDocumentFieldsRequestTest::__pest_evaluable_it_can_update_multiple_document_values":0.998,"P\\Tests\\Feature\\Requests\\Documents\\Sections\\GetTextshotTest::__pest_evaluable_it_get_textshot_for_a_specific_section":2.264,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetUsers\\GetUsersOfARoleTest::__pest_evaluable_it_can_list_users_of_a_role":0.999,"P\\Tests\\Feature\\Requests\\Fields\\GetFieldsRequestTest::__pest_evaluable_it_can_list_fields_for_a_file_cabinet":0.792,"P\\Tests\\Feature\\Requests\\Documents\\ClipUnclipStapleUnstaple\\StapleTest::__pest_evaluable_it_can_staple_2_documents":13.671,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexKeywordDTOTest::__pest_evaluable_it_create_prepare_index_keyword_dto":0.004,"P\\Tests\\Core\\ArchTest::__pest_evaluable_it_will_not_use_any_debug_function":1.113,"P\\Tests\\Feature\\Requests\\Documents\\PostDocumentRequestTest::__pest_evaluable_it_can_upload_document_with_index_values_and_delete_it":0.897,"P\\Tests\\Feature\\Requests\\Documents\\PostDocumentRequestTest::__pest_evaluable_it_can_upload_document_without_file_name_and_file_content_and_delete_it":0.771,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexTableDTOTest::__pest_evaluable_it_create_prepare_index_text_dto_using_dto":0.005,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyGroups\\AddRemoveUserToAGroupTest::__pest_evaluable_it_can_add_groups_to_a_user":7.501,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyGroups\\AddRemoveUserToAGroupTest::__pest_evaluable_it_can_remove_groups_to_a_user":6.95,"P\\Tests\\Feature\\Requests\\FileCabinets\\Upload\\AppendFilesToADataRecordTest::__pest_evaluable_it_can_attach_a_file_to_a_data_record":1.064,"P\\Tests\\Feature\\Requests\\FileCabinets\\Upload\\AppendFilesToADataRecordTest::__pest_evaluable_it_can_attach_files_to_a_data_record":0.626,"P\\Tests\\Feature\\Requests\\Documents\\GetDocumentPreviewRequestTest::__pest_evaluable_it_can_preview_a_document_image":1.14,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexMemoDTOTest::__pest_evaluable_it_create_prepare_index_memo_dto":0.007,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetUsers\\GetUserByIdTest::__pest_evaluable_it_can_get_user_by_id":1.007,"P\\Tests\\Feature\\Requests\\Documents\\ClipUnclipStapleUnstaple\\UnstapleTest::__pest_evaluable_it_can_unstaple_a_document":13.781,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexNumericDTOTest::__pest_evaluable_it_create_index_numeric_dto":0.004,"P\\Tests\\Feature\\Requests\\FileCabinets\\Search\\GetASpecificDocumentFromAFileCabinetTest::__pest_evaluable_it_can_show_a_document":1.028,"P\\Tests\\Feature\\Requests\\Workflow\\GetDocumentWorkflowHistoryStepsTest::__pest_evaluable_it_can_get_document_workflow_history":7.572,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyRoles\\AddRemoveUserToARoleTest::__pest_evaluable_it_can_add_roles_to_a_user":8.541,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyRoles\\AddRemoveUserToARoleTest::__pest_evaluable_it_can_remove_roles_to_a_user":6.12,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexTextDTOTest::__pest_evaluable_it_create_prepare_index_text_dto":0.004,"P\\Tests\\Feature\\DocuWareAuthenticationTest::__pest_evaluable_it_can_get_oath_identity_service_configuration":0.945,"P\\Tests\\Feature\\DocuWareAuthenticationTest::__pest_evaluable_it_can_get_oath_responsible_identity_service":0.727,"P\\Tests\\Feature\\DocuWareAuthenticationTest::__pest_evaluable_it_can_authenticate_with_DocuWare_Credentials":0.869,"P\\Tests\\Feature\\DocuWareAuthenticationTest::__pest_evaluable_it_throws_an_error_if_credentials_are_wrong":1.428}} \ No newline at end of file +{"version":"pest_2.36.0","defects":[],"times":{"P\\Tests\\Feature\\Requests\\Documents\\ClipUnclipStapleUnstaple\\UnclipTest::__pest_evaluable_it_can_unclip_2_documents":13.49,"P\\Tests\\Feature\\Requests\\Documents\\Download\\DownloadThumbnailTest::__pest_evaluable_it_can_download_a_thumbnail":1.227,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\CreateUpdateUsers\\CreateUpdateUserTest::__pest_evaluable_it_can_create_users":1.712,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\CreateUpdateUsers\\CreateUpdateUserTest::__pest_evaluable_it_can_update_users":6.045,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexDateDTOTest::__pest_evaluable_it_create_index_date_dto":0.003,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyRoles\\GetRolesTest::__pest_evaluable_it_can_list_groups":0.826,"P\\Tests\\Feature\\Requests\\Documents\\Sections\\GetAllSectionsFromADocumentTest::__pest_evaluable_it_can_get_all_sections_from_a_document":1.015,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\DeleteDocumentsFromTrashBinTest::__pest_evaluable_it_can_delete_documents_in_trash":1.466,"P\\Tests\\Feature\\Requests\\Workflow\\GetDocumentWorkflowHistoryTest::__pest_evaluable_it_can_get_document_workflow_history":6.432,"P\\Tests\\Feature\\SleepTest::__pest_evaluable_sleep":0.727,"P\\Tests\\Feature\\Requests\\Documents\\Sections\\GetASpecificSectionTest::__pest_evaluable_it_can_get_a_specific_section":1.034,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyGroups\\GetAllGroupsForASpecificUserTest::__pest_evaluable_it_can_list_groups_for_a_specific_user":1.006,"P\\Tests\\Feature\\Requests\\Documents\\Thumbnail\\GetDocumentDownloadThumbnailRequestTest::__pest_evaluable_it_can_download_a_document_thumbnail":1.082,"P\\Tests\\Feature\\Requests\\FileCabinets\\General\\GetFileCabinetInformationTest::__pest_evaluable_it_can_get_file_cabinet_information":0.761,"P\\Tests\\Unit\\DTO\\DocumentIndex\\PrepareDTOTest::__pest_evaluable_it_create_prepare_makeContent_dto":0.003,"P\\Tests\\Feature\\Requests\\FileCabinets\\Dialogs\\GetDialogsOfASpecificTypeTest::__pest_evaluable_it_can_list_dialogs_for_a_file_cabinet":0.877,"P\\Tests\\Feature\\Requests\\Documents\\Download\\DownloadSectionTest::__pest_evaluable_it_can_download_a_section":0.964,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_override_search_documents_dates_filter_by_using_same_operator":0.834,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_override_search_documents_dates_filter_by_using_equal_operator":0.882,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents":0.768,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_t_search_documents_by_diverged_date_range":0.725,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents_with_multiple_values":1.511,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents_with_null_values":0.775,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents_dates_filter_in_past":0.813,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents_dates_filter_in_future":0.858,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_t_search_documents_by_more_than_two_dates":0.739,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyGroups\\GetGroupsTest::__pest_evaluable_it_can_list_groups":0.831,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetUsers\\GetUsersOfAGroupTest::__pest_evaluable_it_can_list_users_of_a_group":1.126,"P\\Tests\\Feature\\Requests\\Documents\\Sections\\DeleteSectionTest::__pest_evaluable_it_can_delete_a_specific_section":1.634,"P\\Tests\\Feature\\Requests\\Documents\\ClipUnclipStapleUnstaple\\ClipTest::__pest_evaluable_it_can_clip_2_documents":7.648,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexDecimalDTOTest::__pest_evaluable_it_create_index_numeric_dto":0.003,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetUsers\\GetUsersTest::__pest_evaluable_it_can_list_users":1.063,"P\\Tests\\Feature\\Requests\\FileCabinets\\Search\\GetDocumentsFromAFileCabinetTest::__pest_evaluable_it_can_get_all_documents":1.419,"P\\Tests\\Feature\\Requests\\Documents\\Download\\DownloadDocumentTest::__pest_evaluable_it_can_download_a_document":1.021,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\RestoreDocumentsFromTrashBinTest::__pest_evaluable_it_can_restore_documents_in_trash":1.447,"P\\Tests\\Feature\\Requests\\Documents\\ApplicationProperties\\ApplicationPropertiesTest::__pest_evaluable_it_can_add_get_update_delete_application_properties_to_a_document":1.407,"P\\Tests\\Feature\\Requests\\FileCabinets\\Dialogs\\GetASpecificDialogTest::__pest_evaluable_it_can_get_a_dialog":0.786,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexDateTimeDTOTest::__pest_evaluable_it_create_index_date_time_dto":0.004,"P\\Tests\\Feature\\DocuWareTest::__pest_evaluable_it_can_create_encrypted_url_for_a_document_in_a_basket":0.604,"P\\Tests\\Feature\\DocuWareTest::__pest_evaluable_it_can_create_encrypted_url_for_a_document_in_a_file_cabinet":0.67,"P\\Tests\\Feature\\Requests\\Organization\\GetOrganizationsRequestTest::__pest_evaluable_it_can_list_organizations":0.796,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_document_paginator":0.642,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_document":0.588,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_document_field":0.585,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_organization":0.61,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_suggestion_field":0.602,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_table_row":0.66,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_dialog":0.649,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_file_cabinet":0.639,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_field":0.655,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_organization_index":0.658,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyRoles\\GetAllRolesForASpecificUserTest::__pest_evaluable_it_can_list_groups":1.106,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_t_search_documents_by_more_than_two_dates_in_trash":0.701,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_override_search_documents_dates_filter_by_using_equal_operator_in_trash":0.799,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_override_search_documents_dates_filter_by_using_same_operator_in_trash":0.905,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_search_documents_with_null_values_in_trash":0.979,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_search_documents_dates_filter_in_past_in_trash":0.827,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_search_documents_dates_filter_in_future_in_trash":0.839,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_t_search_documents_by_diverged_date_range":0.747,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_search_documents_in_trash":0.819,"P\\Tests\\Feature\\Requests\\Documents\\GetDocumentCountRequestTest::__pest_evaluable_it_can_get_a_total_count_of_documents":1.146,"P\\Tests\\Feature\\Requests\\Documents\\PutDocumentFieldsRequestTest::__pest_evaluable_it_can_update_a_document_value":1.035,"P\\Tests\\Feature\\Requests\\Documents\\PutDocumentFieldsRequestTest::__pest_evaluable_it_can_update_multiple_document_values":0.998,"P\\Tests\\Feature\\Requests\\Documents\\Sections\\GetTextshotTest::__pest_evaluable_it_get_textshot_for_a_specific_section":2.264,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetUsers\\GetUsersOfARoleTest::__pest_evaluable_it_can_list_users_of_a_role":0.999,"P\\Tests\\Feature\\Requests\\Fields\\GetFieldsRequestTest::__pest_evaluable_it_can_list_fields_for_a_file_cabinet":0.792,"P\\Tests\\Feature\\Requests\\Documents\\ClipUnclipStapleUnstaple\\StapleTest::__pest_evaluable_it_can_staple_2_documents":13.671,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexKeywordDTOTest::__pest_evaluable_it_create_prepare_index_keyword_dto":0.004,"P\\Tests\\Core\\ArchTest::__pest_evaluable_it_will_not_use_any_debug_function":1.113,"P\\Tests\\Feature\\Requests\\Documents\\PostDocumentRequestTest::__pest_evaluable_it_can_upload_document_with_index_values_and_delete_it":0.897,"P\\Tests\\Feature\\Requests\\Documents\\PostDocumentRequestTest::__pest_evaluable_it_can_upload_document_without_file_name_and_file_content_and_delete_it":0.771,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexTableDTOTest::__pest_evaluable_it_create_prepare_index_text_dto_using_dto":0.005,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyGroups\\AddRemoveUserToAGroupTest::__pest_evaluable_it_can_add_groups_to_a_user":7.501,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyGroups\\AddRemoveUserToAGroupTest::__pest_evaluable_it_can_remove_groups_to_a_user":6.95,"P\\Tests\\Feature\\Requests\\FileCabinets\\Upload\\AppendFilesToADataRecordTest::__pest_evaluable_it_can_attach_a_file_to_a_data_record":1.064,"P\\Tests\\Feature\\Requests\\FileCabinets\\Upload\\AppendFilesToADataRecordTest::__pest_evaluable_it_can_attach_files_to_a_data_record":0.626,"P\\Tests\\Feature\\Requests\\Documents\\GetDocumentPreviewRequestTest::__pest_evaluable_it_can_preview_a_document_image":1.14,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexMemoDTOTest::__pest_evaluable_it_create_prepare_index_memo_dto":0.007,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetUsers\\GetUserByIdTest::__pest_evaluable_it_can_get_user_by_id":1.007,"P\\Tests\\Feature\\Requests\\Documents\\ClipUnclipStapleUnstaple\\UnstapleTest::__pest_evaluable_it_can_unstaple_a_document":13.781,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexNumericDTOTest::__pest_evaluable_it_create_index_numeric_dto":0.004,"P\\Tests\\Feature\\Requests\\FileCabinets\\Search\\GetASpecificDocumentFromAFileCabinetTest::__pest_evaluable_it_can_show_a_document":1.028,"P\\Tests\\Feature\\Requests\\Workflow\\GetDocumentWorkflowHistoryStepsTest::__pest_evaluable_it_can_get_document_workflow_history":7.572,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyRoles\\AddRemoveUserToARoleTest::__pest_evaluable_it_can_add_roles_to_a_user":8.541,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyRoles\\AddRemoveUserToARoleTest::__pest_evaluable_it_can_remove_roles_to_a_user":6.12,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexTextDTOTest::__pest_evaluable_it_create_prepare_index_text_dto":0.004,"P\\Tests\\Feature\\DocuWareAuthenticationTest::__pest_evaluable_it_can_get_oath_identity_service_configuration":0.945,"P\\Tests\\Feature\\DocuWareAuthenticationTest::__pest_evaluable_it_can_get_oath_responsible_identity_service":0.727,"P\\Tests\\Feature\\DocuWareAuthenticationTest::__pest_evaluable_it_can_authenticate_with_DocuWare_Credentials":0.869,"P\\Tests\\Feature\\DocuWareAuthenticationTest::__pest_evaluable_it_throws_an_error_if_credentials_are_wrong":1.428,"P\\Tests\\Feature\\Requests\\FileCabinets\\Upload\\ReplaceAPDFDocumentSectionTest::__pest_evaluable_it_can_replace_a_pdf_document_section":1.301}} \ No newline at end of file diff --git a/src/Requests/FileCabinets/Upload/ReplaceAPDFDocumentSection.php b/src/Requests/FileCabinets/Upload/ReplaceAPDFDocumentSection.php new file mode 100644 index 0000000..dd64e7a --- /dev/null +++ b/src/Requests/FileCabinets/Upload/ReplaceAPDFDocumentSection.php @@ -0,0 +1,51 @@ +fileCabinetId.'/Sections/'.$this->sectionId.'/Data'; + } + + protected function defaultQuery(): array + { + return [ + 'fileName' => $this->fileName, + ]; + } + + protected function defaultBody(): array + { + return [ + new MultipartValue(name: 'file', value: $this->fileContent, filename: $this->fileName), + ]; + } + + public function createDtoFromResponse(Response $response): Section + { + return ReplaceAPDFDocumentSectionResponse::fromResponse($response); + } +} diff --git a/src/Responses/FileCabinets/Upload/ReplaceAPDFDocumentSectionResponse.php b/src/Responses/FileCabinets/Upload/ReplaceAPDFDocumentSectionResponse.php new file mode 100644 index 0000000..dd93d0d --- /dev/null +++ b/src/Responses/FileCabinets/Upload/ReplaceAPDFDocumentSectionResponse.php @@ -0,0 +1,20 @@ +throw()->json()); + } +} diff --git a/tests/Feature/Requests/FileCabinets/Upload/ReplaceAPDFDocumentSectionTest.php b/tests/Feature/Requests/FileCabinets/Upload/ReplaceAPDFDocumentSectionTest.php new file mode 100644 index 0000000..31f6604 --- /dev/null +++ b/tests/Feature/Requests/FileCabinets/Upload/ReplaceAPDFDocumentSectionTest.php @@ -0,0 +1,58 @@ +connector->send(new CreateDataRecord( + fileCabinetId: $fileCabinetId, + fileContent: file_get_contents(__DIR__.'/../../../../Fixtures/files/test-1.pdf'), + fileName: 'test-1.pdf', + indexes: null + ))->dto(); + + $documentWithSections = $this->connector->send( + new AppendFilesToADataRecord( + fileCabinetId: $fileCabinetId, + dataRecordId: $document->id, + files: collect([ + new MultipartValue( + name: 'File[]', + value: file_get_contents(__DIR__.'/../../../../Fixtures/files/test-2.pdf'), + filename: 'test-2.pdf', + ), + ]) + ) + )->dto(); + + expect($documentWithSections)->toBeInstanceOf(Document::class) + ->and($documentWithSections->sections->count())->toBe(2) + ->and($documentWithSections->sections->first()->originalFileName)->toBe('test-1.pdf') + ->and($documentWithSections->sections->last()->originalFileName)->toBe('test-2.pdf'); + + $documentWithSectionReplaced = $this->connector->send(new ReplaceAPDFDocumentSection( + fileCabinetId: $fileCabinetId, + sectionId: $documentWithSections->sections->last()->id, + fileContent: file_get_contents(__DIR__.'/../../../../Fixtures/files/test-3.pdf'), + fileName: 'test-3.pdf', + ))->dto(); + + $response = $this->connector->send(new GetASpecificDocumentFromAFileCabinet($fileCabinetId, Str::before($documentWithSectionReplaced->id, '-')))->dto(); + + expect($response)->toBeInstanceOf(Document::class) + ->and($response->sections->count())->toBe(2) + ->and($response->sections->first()->originalFileName)->toBe('test-1.pdf') + ->and($response->sections->last()->originalFileName)->toBe('test-3.pdf'); + + Event::assertDispatched(DocuWareResponseLog::class); +})->only(); From 7c4814569d15911d4e05b11e224e5fbfa74c19d8 Mon Sep 17 00:00:00 2001 From: Rhys Lees <43909932+RhysLees@users.noreply.github.com> Date: Thu, 9 Jan 2025 18:12:49 +0000 Subject: [PATCH 2/8] WIP --- README.md | 2 +- docs/File Cabinets/upload.md | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 90b58f5..e010027 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ then optimize the processes that power the core of your business. | FileCabinets/Upload | Create a Data Record & Upload File | ❌ | - | | FileCabinets/Upload | Create Data Record & Upload File Using Store Dialog | ❌ | - | | FileCabinets/Upload | Append a Single PDF to a Document | ❌ | - | -| FileCabinets/Upload | Replace a PDF Document Section | ❌ | - | +| FileCabinets/Upload | Replace a PDF Document Section | ✅ | | | FileCabinets/BatchIndexFieldsUpdate | Batch Update Index Fields By Id | ❌ | - | | FileCabinets/BatchIndexFieldsUpdate | Batch Update Index Fields By Search | ❌ | - | | FileCabinets/BatchIndexFieldsUpdate | Batch Append/Update Keyword Fields By Id | ❌ | - | diff --git a/docs/File Cabinets/upload.md b/docs/File Cabinets/upload.md index 29c9e57..2364a5b 100644 --- a/docs/File Cabinets/upload.md +++ b/docs/File Cabinets/upload.md @@ -87,3 +87,15 @@ $response = $connector->send( ) )->dto(); ``` + +#### Replace A PDF Document Section +```php +use CodebarAg\DocuWare\Requests\FileCabinets\Upload\ReplaceAPDFDocumentSection; + +$response = $this->connector->send(new ReplaceAPDFDocumentSection( + fileCabinetId: $fileCabinetId, + sectionId: $documentWithSections->sections->first()->id, + fileContent: file_get_contents(__DIR__.'/../../../../Fixtures/files/test-3.pdf'), + fileName: 'test-3.pdf', +))->dto(); +``` From 97ee3d608a07dd30b0004a6ad7080c1907ca5584 Mon Sep 17 00:00:00 2001 From: Rhys Lees <43909932+RhysLees@users.noreply.github.com> Date: Thu, 9 Jan 2025 18:22:54 +0000 Subject: [PATCH 3/8] WIP --- .phpunit.cache/test-results | 2 +- .../Upload/AppendASinglePDFToADocument.php | 51 +++++++++++++++++++ .../AppendSinglePDFToADocumentResponse.php | 20 ++++++++ .../AppendASinglePDFToADocumentTest.php | 37 ++++++++++++++ .../Upload/ReplaceAPDFDocumentSectionTest.php | 2 +- 5 files changed, 110 insertions(+), 2 deletions(-) create mode 100644 src/Requests/FileCabinets/Upload/AppendASinglePDFToADocument.php create mode 100644 src/Responses/FileCabinets/Upload/AppendSinglePDFToADocumentResponse.php create mode 100644 tests/Feature/Requests/FileCabinets/Upload/AppendASinglePDFToADocumentTest.php diff --git a/.phpunit.cache/test-results b/.phpunit.cache/test-results index fdb1dd1..cce67cb 100644 --- a/.phpunit.cache/test-results +++ b/.phpunit.cache/test-results @@ -1 +1 @@ -{"version":"pest_2.36.0","defects":[],"times":{"P\\Tests\\Feature\\Requests\\Documents\\ClipUnclipStapleUnstaple\\UnclipTest::__pest_evaluable_it_can_unclip_2_documents":13.49,"P\\Tests\\Feature\\Requests\\Documents\\Download\\DownloadThumbnailTest::__pest_evaluable_it_can_download_a_thumbnail":1.227,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\CreateUpdateUsers\\CreateUpdateUserTest::__pest_evaluable_it_can_create_users":1.712,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\CreateUpdateUsers\\CreateUpdateUserTest::__pest_evaluable_it_can_update_users":6.045,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexDateDTOTest::__pest_evaluable_it_create_index_date_dto":0.003,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyRoles\\GetRolesTest::__pest_evaluable_it_can_list_groups":0.826,"P\\Tests\\Feature\\Requests\\Documents\\Sections\\GetAllSectionsFromADocumentTest::__pest_evaluable_it_can_get_all_sections_from_a_document":1.015,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\DeleteDocumentsFromTrashBinTest::__pest_evaluable_it_can_delete_documents_in_trash":1.466,"P\\Tests\\Feature\\Requests\\Workflow\\GetDocumentWorkflowHistoryTest::__pest_evaluable_it_can_get_document_workflow_history":6.432,"P\\Tests\\Feature\\SleepTest::__pest_evaluable_sleep":0.727,"P\\Tests\\Feature\\Requests\\Documents\\Sections\\GetASpecificSectionTest::__pest_evaluable_it_can_get_a_specific_section":1.034,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyGroups\\GetAllGroupsForASpecificUserTest::__pest_evaluable_it_can_list_groups_for_a_specific_user":1.006,"P\\Tests\\Feature\\Requests\\Documents\\Thumbnail\\GetDocumentDownloadThumbnailRequestTest::__pest_evaluable_it_can_download_a_document_thumbnail":1.082,"P\\Tests\\Feature\\Requests\\FileCabinets\\General\\GetFileCabinetInformationTest::__pest_evaluable_it_can_get_file_cabinet_information":0.761,"P\\Tests\\Unit\\DTO\\DocumentIndex\\PrepareDTOTest::__pest_evaluable_it_create_prepare_makeContent_dto":0.003,"P\\Tests\\Feature\\Requests\\FileCabinets\\Dialogs\\GetDialogsOfASpecificTypeTest::__pest_evaluable_it_can_list_dialogs_for_a_file_cabinet":0.877,"P\\Tests\\Feature\\Requests\\Documents\\Download\\DownloadSectionTest::__pest_evaluable_it_can_download_a_section":0.964,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_override_search_documents_dates_filter_by_using_same_operator":0.834,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_override_search_documents_dates_filter_by_using_equal_operator":0.882,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents":0.768,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_t_search_documents_by_diverged_date_range":0.725,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents_with_multiple_values":1.511,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents_with_null_values":0.775,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents_dates_filter_in_past":0.813,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents_dates_filter_in_future":0.858,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_t_search_documents_by_more_than_two_dates":0.739,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyGroups\\GetGroupsTest::__pest_evaluable_it_can_list_groups":0.831,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetUsers\\GetUsersOfAGroupTest::__pest_evaluable_it_can_list_users_of_a_group":1.126,"P\\Tests\\Feature\\Requests\\Documents\\Sections\\DeleteSectionTest::__pest_evaluable_it_can_delete_a_specific_section":1.634,"P\\Tests\\Feature\\Requests\\Documents\\ClipUnclipStapleUnstaple\\ClipTest::__pest_evaluable_it_can_clip_2_documents":7.648,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexDecimalDTOTest::__pest_evaluable_it_create_index_numeric_dto":0.003,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetUsers\\GetUsersTest::__pest_evaluable_it_can_list_users":1.063,"P\\Tests\\Feature\\Requests\\FileCabinets\\Search\\GetDocumentsFromAFileCabinetTest::__pest_evaluable_it_can_get_all_documents":1.419,"P\\Tests\\Feature\\Requests\\Documents\\Download\\DownloadDocumentTest::__pest_evaluable_it_can_download_a_document":1.021,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\RestoreDocumentsFromTrashBinTest::__pest_evaluable_it_can_restore_documents_in_trash":1.447,"P\\Tests\\Feature\\Requests\\Documents\\ApplicationProperties\\ApplicationPropertiesTest::__pest_evaluable_it_can_add_get_update_delete_application_properties_to_a_document":1.407,"P\\Tests\\Feature\\Requests\\FileCabinets\\Dialogs\\GetASpecificDialogTest::__pest_evaluable_it_can_get_a_dialog":0.786,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexDateTimeDTOTest::__pest_evaluable_it_create_index_date_time_dto":0.004,"P\\Tests\\Feature\\DocuWareTest::__pest_evaluable_it_can_create_encrypted_url_for_a_document_in_a_basket":0.604,"P\\Tests\\Feature\\DocuWareTest::__pest_evaluable_it_can_create_encrypted_url_for_a_document_in_a_file_cabinet":0.67,"P\\Tests\\Feature\\Requests\\Organization\\GetOrganizationsRequestTest::__pest_evaluable_it_can_list_organizations":0.796,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_document_paginator":0.642,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_document":0.588,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_document_field":0.585,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_organization":0.61,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_suggestion_field":0.602,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_table_row":0.66,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_dialog":0.649,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_file_cabinet":0.639,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_field":0.655,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_organization_index":0.658,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyRoles\\GetAllRolesForASpecificUserTest::__pest_evaluable_it_can_list_groups":1.106,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_t_search_documents_by_more_than_two_dates_in_trash":0.701,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_override_search_documents_dates_filter_by_using_equal_operator_in_trash":0.799,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_override_search_documents_dates_filter_by_using_same_operator_in_trash":0.905,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_search_documents_with_null_values_in_trash":0.979,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_search_documents_dates_filter_in_past_in_trash":0.827,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_search_documents_dates_filter_in_future_in_trash":0.839,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_t_search_documents_by_diverged_date_range":0.747,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_search_documents_in_trash":0.819,"P\\Tests\\Feature\\Requests\\Documents\\GetDocumentCountRequestTest::__pest_evaluable_it_can_get_a_total_count_of_documents":1.146,"P\\Tests\\Feature\\Requests\\Documents\\PutDocumentFieldsRequestTest::__pest_evaluable_it_can_update_a_document_value":1.035,"P\\Tests\\Feature\\Requests\\Documents\\PutDocumentFieldsRequestTest::__pest_evaluable_it_can_update_multiple_document_values":0.998,"P\\Tests\\Feature\\Requests\\Documents\\Sections\\GetTextshotTest::__pest_evaluable_it_get_textshot_for_a_specific_section":2.264,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetUsers\\GetUsersOfARoleTest::__pest_evaluable_it_can_list_users_of_a_role":0.999,"P\\Tests\\Feature\\Requests\\Fields\\GetFieldsRequestTest::__pest_evaluable_it_can_list_fields_for_a_file_cabinet":0.792,"P\\Tests\\Feature\\Requests\\Documents\\ClipUnclipStapleUnstaple\\StapleTest::__pest_evaluable_it_can_staple_2_documents":13.671,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexKeywordDTOTest::__pest_evaluable_it_create_prepare_index_keyword_dto":0.004,"P\\Tests\\Core\\ArchTest::__pest_evaluable_it_will_not_use_any_debug_function":1.113,"P\\Tests\\Feature\\Requests\\Documents\\PostDocumentRequestTest::__pest_evaluable_it_can_upload_document_with_index_values_and_delete_it":0.897,"P\\Tests\\Feature\\Requests\\Documents\\PostDocumentRequestTest::__pest_evaluable_it_can_upload_document_without_file_name_and_file_content_and_delete_it":0.771,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexTableDTOTest::__pest_evaluable_it_create_prepare_index_text_dto_using_dto":0.005,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyGroups\\AddRemoveUserToAGroupTest::__pest_evaluable_it_can_add_groups_to_a_user":7.501,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyGroups\\AddRemoveUserToAGroupTest::__pest_evaluable_it_can_remove_groups_to_a_user":6.95,"P\\Tests\\Feature\\Requests\\FileCabinets\\Upload\\AppendFilesToADataRecordTest::__pest_evaluable_it_can_attach_a_file_to_a_data_record":1.064,"P\\Tests\\Feature\\Requests\\FileCabinets\\Upload\\AppendFilesToADataRecordTest::__pest_evaluable_it_can_attach_files_to_a_data_record":0.626,"P\\Tests\\Feature\\Requests\\Documents\\GetDocumentPreviewRequestTest::__pest_evaluable_it_can_preview_a_document_image":1.14,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexMemoDTOTest::__pest_evaluable_it_create_prepare_index_memo_dto":0.007,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetUsers\\GetUserByIdTest::__pest_evaluable_it_can_get_user_by_id":1.007,"P\\Tests\\Feature\\Requests\\Documents\\ClipUnclipStapleUnstaple\\UnstapleTest::__pest_evaluable_it_can_unstaple_a_document":13.781,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexNumericDTOTest::__pest_evaluable_it_create_index_numeric_dto":0.004,"P\\Tests\\Feature\\Requests\\FileCabinets\\Search\\GetASpecificDocumentFromAFileCabinetTest::__pest_evaluable_it_can_show_a_document":1.028,"P\\Tests\\Feature\\Requests\\Workflow\\GetDocumentWorkflowHistoryStepsTest::__pest_evaluable_it_can_get_document_workflow_history":7.572,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyRoles\\AddRemoveUserToARoleTest::__pest_evaluable_it_can_add_roles_to_a_user":8.541,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyRoles\\AddRemoveUserToARoleTest::__pest_evaluable_it_can_remove_roles_to_a_user":6.12,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexTextDTOTest::__pest_evaluable_it_create_prepare_index_text_dto":0.004,"P\\Tests\\Feature\\DocuWareAuthenticationTest::__pest_evaluable_it_can_get_oath_identity_service_configuration":0.945,"P\\Tests\\Feature\\DocuWareAuthenticationTest::__pest_evaluable_it_can_get_oath_responsible_identity_service":0.727,"P\\Tests\\Feature\\DocuWareAuthenticationTest::__pest_evaluable_it_can_authenticate_with_DocuWare_Credentials":0.869,"P\\Tests\\Feature\\DocuWareAuthenticationTest::__pest_evaluable_it_throws_an_error_if_credentials_are_wrong":1.428,"P\\Tests\\Feature\\Requests\\FileCabinets\\Upload\\ReplaceAPDFDocumentSectionTest::__pest_evaluable_it_can_replace_a_pdf_document_section":1.301}} \ No newline at end of file +{"version":"pest_2.36.0","defects":[],"times":{"P\\Tests\\Feature\\Requests\\Documents\\ClipUnclipStapleUnstaple\\UnclipTest::__pest_evaluable_it_can_unclip_2_documents":13.49,"P\\Tests\\Feature\\Requests\\Documents\\Download\\DownloadThumbnailTest::__pest_evaluable_it_can_download_a_thumbnail":1.227,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\CreateUpdateUsers\\CreateUpdateUserTest::__pest_evaluable_it_can_create_users":1.712,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\CreateUpdateUsers\\CreateUpdateUserTest::__pest_evaluable_it_can_update_users":6.045,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexDateDTOTest::__pest_evaluable_it_create_index_date_dto":0.003,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyRoles\\GetRolesTest::__pest_evaluable_it_can_list_groups":0.826,"P\\Tests\\Feature\\Requests\\Documents\\Sections\\GetAllSectionsFromADocumentTest::__pest_evaluable_it_can_get_all_sections_from_a_document":1.015,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\DeleteDocumentsFromTrashBinTest::__pest_evaluable_it_can_delete_documents_in_trash":1.466,"P\\Tests\\Feature\\Requests\\Workflow\\GetDocumentWorkflowHistoryTest::__pest_evaluable_it_can_get_document_workflow_history":6.432,"P\\Tests\\Feature\\SleepTest::__pest_evaluable_sleep":0.727,"P\\Tests\\Feature\\Requests\\Documents\\Sections\\GetASpecificSectionTest::__pest_evaluable_it_can_get_a_specific_section":1.034,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyGroups\\GetAllGroupsForASpecificUserTest::__pest_evaluable_it_can_list_groups_for_a_specific_user":1.006,"P\\Tests\\Feature\\Requests\\Documents\\Thumbnail\\GetDocumentDownloadThumbnailRequestTest::__pest_evaluable_it_can_download_a_document_thumbnail":1.082,"P\\Tests\\Feature\\Requests\\FileCabinets\\General\\GetFileCabinetInformationTest::__pest_evaluable_it_can_get_file_cabinet_information":0.761,"P\\Tests\\Unit\\DTO\\DocumentIndex\\PrepareDTOTest::__pest_evaluable_it_create_prepare_makeContent_dto":0.003,"P\\Tests\\Feature\\Requests\\FileCabinets\\Dialogs\\GetDialogsOfASpecificTypeTest::__pest_evaluable_it_can_list_dialogs_for_a_file_cabinet":0.877,"P\\Tests\\Feature\\Requests\\Documents\\Download\\DownloadSectionTest::__pest_evaluable_it_can_download_a_section":0.964,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_override_search_documents_dates_filter_by_using_same_operator":0.834,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_override_search_documents_dates_filter_by_using_equal_operator":0.882,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents":0.768,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_t_search_documents_by_diverged_date_range":0.725,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents_with_multiple_values":1.511,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents_with_null_values":0.775,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents_dates_filter_in_past":0.813,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_search_documents_dates_filter_in_future":0.858,"P\\Tests\\Feature\\Requests\\Search\\GetSearchRequestTest::__pest_evaluable_it_can_t_search_documents_by_more_than_two_dates":0.739,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyGroups\\GetGroupsTest::__pest_evaluable_it_can_list_groups":0.831,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetUsers\\GetUsersOfAGroupTest::__pest_evaluable_it_can_list_users_of_a_group":1.126,"P\\Tests\\Feature\\Requests\\Documents\\Sections\\DeleteSectionTest::__pest_evaluable_it_can_delete_a_specific_section":1.634,"P\\Tests\\Feature\\Requests\\Documents\\ClipUnclipStapleUnstaple\\ClipTest::__pest_evaluable_it_can_clip_2_documents":7.648,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexDecimalDTOTest::__pest_evaluable_it_create_index_numeric_dto":0.003,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetUsers\\GetUsersTest::__pest_evaluable_it_can_list_users":1.063,"P\\Tests\\Feature\\Requests\\FileCabinets\\Search\\GetDocumentsFromAFileCabinetTest::__pest_evaluable_it_can_get_all_documents":1.419,"P\\Tests\\Feature\\Requests\\Documents\\Download\\DownloadDocumentTest::__pest_evaluable_it_can_download_a_document":1.021,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\RestoreDocumentsFromTrashBinTest::__pest_evaluable_it_can_restore_documents_in_trash":1.447,"P\\Tests\\Feature\\Requests\\Documents\\ApplicationProperties\\ApplicationPropertiesTest::__pest_evaluable_it_can_add_get_update_delete_application_properties_to_a_document":1.407,"P\\Tests\\Feature\\Requests\\FileCabinets\\Dialogs\\GetASpecificDialogTest::__pest_evaluable_it_can_get_a_dialog":0.786,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexDateTimeDTOTest::__pest_evaluable_it_create_index_date_time_dto":0.004,"P\\Tests\\Feature\\DocuWareTest::__pest_evaluable_it_can_create_encrypted_url_for_a_document_in_a_basket":0.604,"P\\Tests\\Feature\\DocuWareTest::__pest_evaluable_it_can_create_encrypted_url_for_a_document_in_a_file_cabinet":0.67,"P\\Tests\\Feature\\Requests\\Organization\\GetOrganizationsRequestTest::__pest_evaluable_it_can_list_organizations":0.796,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_document_paginator":0.642,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_document":0.588,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_document_field":0.585,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_organization":0.61,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_suggestion_field":0.602,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_table_row":0.66,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_dialog":0.649,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_file_cabinet":0.639,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_field":0.655,"P\\Tests\\Feature\\DTOTest::__pest_evaluable_it_create_a_fake_organization_index":0.658,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyRoles\\GetAllRolesForASpecificUserTest::__pest_evaluable_it_can_list_groups":1.106,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_t_search_documents_by_more_than_two_dates_in_trash":0.701,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_override_search_documents_dates_filter_by_using_equal_operator_in_trash":0.799,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_override_search_documents_dates_filter_by_using_same_operator_in_trash":0.905,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_search_documents_with_null_values_in_trash":0.979,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_search_documents_dates_filter_in_past_in_trash":0.827,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_search_documents_dates_filter_in_future_in_trash":0.839,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_t_search_documents_by_diverged_date_range":0.747,"P\\Tests\\Feature\\Requests\\Documents\\DocumentsTrashBin\\GetDocumentsFromTrashBinTest::__pest_evaluable_it_can_search_documents_in_trash":0.819,"P\\Tests\\Feature\\Requests\\Documents\\GetDocumentCountRequestTest::__pest_evaluable_it_can_get_a_total_count_of_documents":1.146,"P\\Tests\\Feature\\Requests\\Documents\\PutDocumentFieldsRequestTest::__pest_evaluable_it_can_update_a_document_value":1.035,"P\\Tests\\Feature\\Requests\\Documents\\PutDocumentFieldsRequestTest::__pest_evaluable_it_can_update_multiple_document_values":0.998,"P\\Tests\\Feature\\Requests\\Documents\\Sections\\GetTextshotTest::__pest_evaluable_it_get_textshot_for_a_specific_section":2.264,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetUsers\\GetUsersOfARoleTest::__pest_evaluable_it_can_list_users_of_a_role":0.999,"P\\Tests\\Feature\\Requests\\Fields\\GetFieldsRequestTest::__pest_evaluable_it_can_list_fields_for_a_file_cabinet":0.792,"P\\Tests\\Feature\\Requests\\Documents\\ClipUnclipStapleUnstaple\\StapleTest::__pest_evaluable_it_can_staple_2_documents":13.671,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexKeywordDTOTest::__pest_evaluable_it_create_prepare_index_keyword_dto":0.004,"P\\Tests\\Core\\ArchTest::__pest_evaluable_it_will_not_use_any_debug_function":1.113,"P\\Tests\\Feature\\Requests\\Documents\\PostDocumentRequestTest::__pest_evaluable_it_can_upload_document_with_index_values_and_delete_it":0.897,"P\\Tests\\Feature\\Requests\\Documents\\PostDocumentRequestTest::__pest_evaluable_it_can_upload_document_without_file_name_and_file_content_and_delete_it":0.771,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexTableDTOTest::__pest_evaluable_it_create_prepare_index_text_dto_using_dto":0.005,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyGroups\\AddRemoveUserToAGroupTest::__pest_evaluable_it_can_add_groups_to_a_user":7.501,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyGroups\\AddRemoveUserToAGroupTest::__pest_evaluable_it_can_remove_groups_to_a_user":6.95,"P\\Tests\\Feature\\Requests\\FileCabinets\\Upload\\AppendFilesToADataRecordTest::__pest_evaluable_it_can_attach_a_file_to_a_data_record":1.064,"P\\Tests\\Feature\\Requests\\FileCabinets\\Upload\\AppendFilesToADataRecordTest::__pest_evaluable_it_can_attach_files_to_a_data_record":0.626,"P\\Tests\\Feature\\Requests\\Documents\\GetDocumentPreviewRequestTest::__pest_evaluable_it_can_preview_a_document_image":1.14,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexMemoDTOTest::__pest_evaluable_it_create_prepare_index_memo_dto":0.007,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetUsers\\GetUserByIdTest::__pest_evaluable_it_can_get_user_by_id":1.007,"P\\Tests\\Feature\\Requests\\Documents\\ClipUnclipStapleUnstaple\\UnstapleTest::__pest_evaluable_it_can_unstaple_a_document":13.781,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexNumericDTOTest::__pest_evaluable_it_create_index_numeric_dto":0.004,"P\\Tests\\Feature\\Requests\\FileCabinets\\Search\\GetASpecificDocumentFromAFileCabinetTest::__pest_evaluable_it_can_show_a_document":1.028,"P\\Tests\\Feature\\Requests\\Workflow\\GetDocumentWorkflowHistoryStepsTest::__pest_evaluable_it_can_get_document_workflow_history":7.572,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyRoles\\AddRemoveUserToARoleTest::__pest_evaluable_it_can_add_roles_to_a_user":8.541,"P\\Tests\\Feature\\Requests\\General\\UserManagement\\GetModifyRoles\\AddRemoveUserToARoleTest::__pest_evaluable_it_can_remove_roles_to_a_user":6.12,"P\\Tests\\Unit\\DTO\\DocumentIndex\\IndexTextDTOTest::__pest_evaluable_it_create_prepare_index_text_dto":0.004,"P\\Tests\\Feature\\DocuWareAuthenticationTest::__pest_evaluable_it_can_get_oath_identity_service_configuration":0.945,"P\\Tests\\Feature\\DocuWareAuthenticationTest::__pest_evaluable_it_can_get_oath_responsible_identity_service":0.727,"P\\Tests\\Feature\\DocuWareAuthenticationTest::__pest_evaluable_it_can_authenticate_with_DocuWare_Credentials":0.869,"P\\Tests\\Feature\\DocuWareAuthenticationTest::__pest_evaluable_it_throws_an_error_if_credentials_are_wrong":1.428,"P\\Tests\\Feature\\Requests\\FileCabinets\\Upload\\ReplaceAPDFDocumentSectionTest::__pest_evaluable_it_can_replace_a_pdf_document_section":1.734,"P\\Tests\\Feature\\Requests\\FileCabinets\\Upload\\AppendASinglePDFToADocumentTest::__pest_evaluable_it_can_replace_a_pdf_document_section":1.099}} \ No newline at end of file diff --git a/src/Requests/FileCabinets/Upload/AppendASinglePDFToADocument.php b/src/Requests/FileCabinets/Upload/AppendASinglePDFToADocument.php new file mode 100644 index 0000000..eca8114 --- /dev/null +++ b/src/Requests/FileCabinets/Upload/AppendASinglePDFToADocument.php @@ -0,0 +1,51 @@ +fileCabinetId.'/Sections'; + } + + protected function defaultQuery(): array + { + return [ + 'DocId' => $this->documentId, + ]; + } + + protected function defaultBody(): array + { + return [ + new MultipartValue(name: 'file', value: $this->fileContent, filename: $this->fileName), + ]; + } + + public function createDtoFromResponse(Response $response): Section + { + return AppendSinglePDFToADocumentResponse::fromResponse($response); + } +} diff --git a/src/Responses/FileCabinets/Upload/AppendSinglePDFToADocumentResponse.php b/src/Responses/FileCabinets/Upload/AppendSinglePDFToADocumentResponse.php new file mode 100644 index 0000000..5a2cafd --- /dev/null +++ b/src/Responses/FileCabinets/Upload/AppendSinglePDFToADocumentResponse.php @@ -0,0 +1,20 @@ +throw()->json()); + } +} diff --git a/tests/Feature/Requests/FileCabinets/Upload/AppendASinglePDFToADocumentTest.php b/tests/Feature/Requests/FileCabinets/Upload/AppendASinglePDFToADocumentTest.php new file mode 100644 index 0000000..7b9fee1 --- /dev/null +++ b/tests/Feature/Requests/FileCabinets/Upload/AppendASinglePDFToADocumentTest.php @@ -0,0 +1,37 @@ +connector->send(new CreateDataRecord( + fileCabinetId: $fileCabinetId, + fileContent: file_get_contents(__DIR__.'/../../../../Fixtures/files/test-1.pdf'), + fileName: 'test-1.pdf', + indexes: null + ))->dto(); + + $documentWithSingleAddition = $this->connector->send(new AppendASinglePDFToADocument( + fileCabinetId: $fileCabinetId, + documentId: $document->id, + fileContent: file_get_contents(__DIR__.'/../../../../Fixtures/files/test-2.pdf'), + fileName: 'test-2.pdf', + ))->dto(); + + $response = $this->connector->send(new GetASpecificDocumentFromAFileCabinet($fileCabinetId, $document->id))->dto(); + + expect($response)->toBeInstanceOf(Document::class) + ->and($response->sections->count())->toBe(2) + ->and($response->sections->first()->originalFileName)->toBe('test-1.pdf') + ->and($response->sections->last()->originalFileName)->toBe('test-2.pdf'); + + Event::assertDispatched(DocuWareResponseLog::class); +})->only(); diff --git a/tests/Feature/Requests/FileCabinets/Upload/ReplaceAPDFDocumentSectionTest.php b/tests/Feature/Requests/FileCabinets/Upload/ReplaceAPDFDocumentSectionTest.php index 31f6604..8ce6e30 100644 --- a/tests/Feature/Requests/FileCabinets/Upload/ReplaceAPDFDocumentSectionTest.php +++ b/tests/Feature/Requests/FileCabinets/Upload/ReplaceAPDFDocumentSectionTest.php @@ -55,4 +55,4 @@ ->and($response->sections->last()->originalFileName)->toBe('test-3.pdf'); Event::assertDispatched(DocuWareResponseLog::class); -})->only(); +}); From 6d26d757fa64e9e6c48c1826adcf99149724e4b8 Mon Sep 17 00:00:00 2001 From: Rhys Lees <43909932+RhysLees@users.noreply.github.com> Date: Thu, 9 Jan 2025 18:24:20 +0000 Subject: [PATCH 4/8] WIP --- docs/File Cabinets/upload.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/File Cabinets/upload.md b/docs/File Cabinets/upload.md index 2364a5b..8570e05 100644 --- a/docs/File Cabinets/upload.md +++ b/docs/File Cabinets/upload.md @@ -67,6 +67,7 @@ $document = $connector->send(new CreateDataRecord( #### Append File(s) To A Data Record ```php use CodebarAg\DocuWare\Requests\FileCabinets\Upload\AppendFilesToADataRecord; +use Saloon\Data\MultipartValue; $response = $connector->send( new AppendFilesToADataRecord( @@ -88,6 +89,18 @@ $response = $connector->send( )->dto(); ``` +#### Append A Single PDF To A Document +```php +use CodebarAg\DocuWare\Requests\FileCabinets\Upload\AppendASinglePDFToADocument; + +$response = $this->connector->send(new AppendASinglePDFToADocument( + fileCabinetId: $fileCabinetId, + documentId: $document->id, + fileContent: file_get_contents(__DIR__.'/../../../../Fixtures/files/test-2.pdf'), + fileName: 'test-2.pdf', +))->dto(); +``` + #### Replace A PDF Document Section ```php use CodebarAg\DocuWare\Requests\FileCabinets\Upload\ReplaceAPDFDocumentSection; From 3bbad6b1f7e1eabd258fcd8614fb89fe883be923 Mon Sep 17 00:00:00 2001 From: Rhys Lees <43909932+RhysLees@users.noreply.github.com> Date: Thu, 9 Jan 2025 18:24:42 +0000 Subject: [PATCH 5/8] WIP --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e010027..55f7d66 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ then optimize the processes that power the core of your business. | FileCabinets/Upload | Upload a Single File for a Data Record | ❌ | - | | FileCabinets/Upload | Create a Data Record & Upload File | ❌ | - | | FileCabinets/Upload | Create Data Record & Upload File Using Store Dialog | ❌ | - | -| FileCabinets/Upload | Append a Single PDF to a Document | ❌ | - | +| FileCabinets/Upload | Append a Single PDF to a Document | ✅ | - | | FileCabinets/Upload | Replace a PDF Document Section | ✅ | | | FileCabinets/BatchIndexFieldsUpdate | Batch Update Index Fields By Id | ❌ | - | | FileCabinets/BatchIndexFieldsUpdate | Batch Update Index Fields By Search | ❌ | - | From 6a1a2e3d430b0c23da0a8b3d025fd4ec712bc07b Mon Sep 17 00:00:00 2001 From: Rhys Lees <43909932+RhysLees@users.noreply.github.com> Date: Thu, 9 Jan 2025 18:24:58 +0000 Subject: [PATCH 6/8] WIP --- .../FileCabinets/Upload/AppendASinglePDFToADocumentTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Feature/Requests/FileCabinets/Upload/AppendASinglePDFToADocumentTest.php b/tests/Feature/Requests/FileCabinets/Upload/AppendASinglePDFToADocumentTest.php index 7b9fee1..d42694f 100644 --- a/tests/Feature/Requests/FileCabinets/Upload/AppendASinglePDFToADocumentTest.php +++ b/tests/Feature/Requests/FileCabinets/Upload/AppendASinglePDFToADocumentTest.php @@ -34,4 +34,4 @@ ->and($response->sections->last()->originalFileName)->toBe('test-2.pdf'); Event::assertDispatched(DocuWareResponseLog::class); -})->only(); +}); From 87e0d587f5e7e931e9c409bdc7015b17ed62ef7d Mon Sep 17 00:00:00 2001 From: Rhys Lees <43909932+RhysLees@users.noreply.github.com> Date: Thu, 9 Jan 2025 19:12:56 +0000 Subject: [PATCH 7/8] WIP --- README.md | 1376 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 1372 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 55f7d66..85f8288 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ See the documentation if you need further functionality. ⚠️ ## Navigation + * [Navigation](#navigation) * [💡 What is DocuWare?](#-what-is-docuware) * [🛠 Requirements](#-requirements) * [⚙️ Installation](#-installation) @@ -22,12 +23,108 @@ See the documentation if you need further functionality. ⚠️ * [Getting a new token via Username & Password:](#getting-a-new-token-via-username--password) * [Getting a new token via Username & Password (Trusted User):](#getting-a-new-token-via-username--password-trusted-user) * [Available Requests](#available-requests) + * [Organization](#organization) + * [Get Organization](#get-organization) + * [Get All File Cabinets And Document Trays](#get-all-file-cabinets-and-document-trays) + * [User Management](#user-management) + * [Get Users](#get-users) + * [Get Users](#get-users-1) + * [Get User By Id](#get-user-by-id) + * [Get Users Of A Role](#get-users-of-a-role) + * [Get Users Of A Group](#get-users-of-a-group) + * [Create/Update Users](#createupdate-users) + * [Create User](#create-user) + * [Update User](#update-user) + * [Get/Modify Groups](#getmodify-groups) + * [Get Groups](#get-groups) + * [Get All Groups For A Specific User](#get-all-groups-for-a-specific-user) + * [Add User To A Group](#add-user-to-a-group) + * [Remove User From A Group](#remove-user-from-a-group) + * [Get/Modify Roles](#getmodify-roles) + * [Get Roles](#get-roles) + * [Get All Roles For A Specific User](#get-all-roles-for-a-specific-user) + * [Add User To A Role](#add-user-to-a-role) + * [Remove User From A Role](#remove-user-from-a-role) + * [File Cabinets](#file-cabinets) + * [General](#general) + * [Get File Cabinet Information](#get-file-cabinet-information) + * [Get Total Number Of Documents](#get-total-number-of-documents) + * [Dialogs](#dialogs) + * [Get All Dialogs](#get-all-dialogs) + * [Get Dialogs of a Specific Type](#get-dialogs-of-a-specific-type) + * [Get Dialogs Of A Specific Type](#get-dialogs-of-a-specific-type-1) + * [Search](#search) + * [Get A Specific Document From A File Cabinet](#get-a-specific-document-from-a-file-cabinet) + * [Get Documents From A File Cabinet](#get-documents-from-a-file-cabinet) + * [Most basic example to search for documents.](#most-basic-example-to-search-for-documents) + * [Search in multiple file cabinets](#search-in-multiple-file-cabinets) + * [Find results on the next page](#find-results-on-the-next-page) + * [Define the number of results which should be shown per page](#define-the-number-of-results-which-should-be-shown-per-page) + * [Use the full-text search](#use-the-full-text-search) + * [Search documents which are created from the first of march.](#search-documents-which-are-created-from-the-first-of-march) + * [Search documents which are created until the first of april.](#search-documents-which-are-created-until-the-first-of-april) + * [Order the results by field name.](#order-the-results-by-field-name) + * [Search documents filtered to the value.](#search-documents-filtered-to-the-value) + * [Search documents filtered to multiple values.](#search-documents-filtered-to-multiple-values) + * [You can specify the dialog which should be used.](#you-can-specify-the-dialog-which-should-be-used) + * [You can also combine everything.](#you-can-also-combine-everything) + * [Check In Check Out](#check-in-check-out) + * [Select Lists](#select-lists) + * [Get Select Lists](#get-select-lists) + * [Upload](#upload) + * [Create Data Record](#create-data-record) + * [Create Table Data Record](#create-table-data-record) + * [Append File(s) To A Data Record](#append-files-to-a-data-record) + * [Append A Single PDF To A Document](#append-a-single-pdf-to-a-document) + * [Replace A PDF Document Section](#replace-a-pdf-document-section) + * [Batch Index Fields Update](#batch-index-fields-update) + * [Get Fields](#get-fields) + * [Documents](#documents) + * [Update Index Values](#update-index-values) + * [Update Table Data Record](#update-table-data-record) + * [Modify Documents](#modify-documents) + * [Transfer Document](#transfer-document) + * [Delete Documents](#delete-documents) + * [Clip/Unclip & Staple/Unstaple](#clipunclip--stapleunstaple) + * [Clip](#clip) + * [Unclip](#unclip) + * [Staple](#staple) + * [Unstaple](#unstaple) + * [Annotations/Stamps](#annotationsstamps) + * [Documents Trash Bin](#documents-trash-bin) + * [Get Documents](#get-documents) + * [Delete Documents](#delete-documents-1) + * [Restore Documents](#restore-documents) + * [Application Properties](#application-properties) + * [Add Application Properties](#add-application-properties) + * [Update Application Properties](#update-application-properties) + * [Delete Application Properties](#delete-application-properties) + * [Get Application Properties](#get-application-properties) + * [Sections](#sections) + * [Get All Sections](#get-all-sections) + * [Get Specific Section](#get-specific-section) + * [Delete Section](#delete-section) + * [Get Textshot](#get-textshot) + * [Download](#download) + * [Download Document](#download-document) + * [Download Section](#download-section) + * [Download Thumbnail](#download-thumbnail) + * [Workflow](#workflow) + * [Workflow History](#workflow-history) + * [Get Document Workflow History](#get-document-workflow-history) + * [Get Document Workflow History Steps](#get-document-workflow-history-steps) * [Extending the connector (EXAMPLE)](#extending-the-connector-example) * [Create a new connector](#create-a-new-connector) * [Use the new connector](#use-the-new-connector) * [🖼 Make encrypted URLs](#-make-encrypted-urls) + * [Make encrypted URL for a document in a file cabinet.](#make-encrypted-url-for-a-document-in-a-file-cabinet) + * [Make encrypted URL for a document in a basket.](#make-encrypted-url-for-a-document-in-a-basket) + * [Make encrypted URL valid for a specific amount of time.](#make-encrypted-url-valid-for-a-specific-amount-of-time) * [🏋️ Document Index Fields DTO showcase](#-document-index-fields-dto-showcase) * [📦 Caching requests](#-caching-requests) + * [Is Cached](#is-cached) + * [Invalidate Cache](#invalidate-cache) + * [Disable Caching](#disable-caching) * [💥 Exceptions explained](#-exceptions-explained) * [✨ Events](#-events) * [🔧 Configuration file](#-configuration-file) @@ -239,6 +336,977 @@ $connector = new DocuWareConnector( - [Sections](docs/Documents/sections.md) - [Download](docs/Documents/download.md) - [Workflow](docs/workflow.md) + +#### Organization + +| Request | Supported | +|-------------------------------------------------------------|-----------| +| Get Login Token | ✅ | +| Get Organization | ✅ | +| Get All File Cabinets and Document Trays | ✅ | + + +##### Get Organization +```php +use CodebarAg\DocuWare\Requests\General\Organization\GetOrganization; + +$organizations = $this->connector->send(new GetOrganization())->dto(); +``` + +##### Get All File Cabinets And Document Trays +```php +use CodebarAg\DocuWare\Requests\General\Organization\GetAllFileCabinetsAndDocumentTrays; + +$cabinetsAndTrays = $this->connector->send(new GetAllFileCabinetsAndDocumentTrays())->dto(); +``` + +#### User Management + +##### Get Users + +| Request | Supported | +|----------------------|-----------| +| Get Users | ✅ | +| Get Users by ID | ✅ | +| Get Users of a Role | ✅ | +| Get Users of a Group | ✅ | + +###### Get Users +```php +use CodebarAg\DocuWare\Requests\General\UserManagement\GetUsers\GetUsers; + +$users = $this->connector->send(new GetUsers())->dto(); +``` + +###### Get User By Id +```php +use CodebarAg\DocuWare\Requests\General\UserManagement\GetUsers\GetUserById; + +$user = $this->connector->send(new GetUserById($userId))->dto(); +``` + +###### Get Users Of A Role +```php +use CodebarAg\DocuWare\Requests\General\UserManagement\GetUsers\GetUsersOfARole; + +$users = $this->connector->send(new GetUsersOfARole($roleId))->dto(); +``` + +###### Get Users Of A Group +```php +use CodebarAg\DocuWare\Requests\General\UserManagement\GetUsers\GetUsersOfAGroup; + +$users = $this->connector->send(new GetUsersOfAGroup($groupId))->dto(); +``` + +##### Create/Update Users + +| Request | Supported | +|-------------|-----------| +| Create User | ✅ | +| Update User | ✅ | + +###### Create User +```php +use CodebarAg\DocuWare\Requests\General\UserManagement\CreateUpdateUsers\CreateUser; + +$user = $connector->send(new CreateUser(new User( + name: $timestamp.' - Test User', + dbName: $timestamp, + email: $timestamp.'-test@example.test', + password: 'TESTPASSWORD', +)))->dto(); +``` + +###### Update User +```php +use CodebarAg\DocuWare\Requests\General\UserManagement\CreateUpdateUsers\UpdateUser; + +$user->name .= ' - Updated'; +$user->active = false; + +$user = $connector->send(new UpdateUser($user))->dto(); +``` + +##### Get/Modify Groups + +| Request | Supported | +|------------------------------------|-----------| +| Get Groups | ✅ | +| Get All Groups for a Specific User | ✅ | +| Add User to a Group | ✅ | +| Remove User from a Group | ✅ | + +###### Get Groups +```php +use CodebarAg\DocuWare\Requests\General\UserManagement\GetModifyGroups\GetGroups; + +$groups = $connector->send(new GetGroups())->dto(); +``` + +###### Get All Groups For A Specific User +```php +use CodebarAg\DocuWare\Requests\General\UserManagement\GetModifyGroups\GetAllGroupsForASpecificUser; + +$groups = $connector->send(new GetAllGroupsForASpecificUser($userId))->dto(); +``` + +###### Add User To A Group +```php +use CodebarAg\DocuWare\Requests\General\UserManagement\GetModifyGroups\AddUserToAGroup; + +$response = $connector->send(new AddUserToAGroup( + userId: $userId, + ids: [$groupId], +))->dto(); +``` + +###### Remove User From A Group +```php +use CodebarAg\DocuWare\Requests\General\UserManagement\GetModifyGroups\RemoveUserFromAGroup; + +$response = $connector->send(new RemoveUserFromAGroup( + userId: $userId, + ids: [$groupId], +))->dto(); +``` + +##### Get/Modify Roles + +| Request | Supported | +|-----------------------------------|-----------| +| Get Roles | ✅ | +| Get All Roles for a Specific User | ✅ | +| Add User to a Role | ✅ | +| Remove User from a Role | ✅ | + +###### Get Roles +```php +use CodebarAg\DocuWare\Requests\General\UserManagement\GetModifyRoles\GetRoles; + +$roles = $this->connector->send(new GetRoles())->dto(); +``` + +###### Get All Roles For A Specific User +```php +use CodebarAg\DocuWare\Requests\General\UserManagement\GetModifyRoles\GetAllRolesForASpecificUser; + +$roles = $connector->send(new GetAllRolesForASpecificUser($userId))->dto(); +``` + +###### Add User To A Role +```php +use CodebarAg\DocuWare\Requests\General\UserManagement\GetModifyRoles\AddUserToARole; + +$response = $connector->send(new AddUserToARole( + userId: $userId, + ids: [$roleId], +))->dto(); +``` + +###### Remove User From A Role +```php +use CodebarAg\DocuWare\Requests\General\UserManagement\GetModifyRoles\RemoveUserFromARole; + +$response = $connector->send(new RemoveUserFromARole( + userId: $userId, + ids: [$roleId], +))->dto(); +``` + +#### File Cabinets + +##### General + +| Request | Supported | +|-------------------------------|-----------| +| Get File Cabinet Information | ✅ | +| Get Total Number of Documents | ✅ | + +###### Get File Cabinet Information +```php +use CodebarAg\DocuWare\Requests\FileCabinets\General\GetFileCabinetInformation; + +$fileCabinet = $connector->send(new GetFileCabinetInformation($fileCabinetId))->dto(); +``` + +###### Get Total Number Of Documents +```php +use CodebarAg\DocuWare\Requests\FileCabinets\General\GetTotalNumberOfDocuments; + +$count = $connector->send(new GetTotalNumberOfDocuments( + $fileCabinetId, + $dialogId +))->dto(); +``` + +##### Dialogs + +| Request | Supported | +|--------------------------------|-----------| +| Get All Dialogs | ✅ | +| Get a Specific Dialog | ✅ | +| Get Dialogs of a Specific Type | ✅ | + +###### Get All Dialogs +```php +use CodebarAg\DocuWare\Requests\FileCabinets\Dialogs\GetAllDialogs; + +$dialogs = $connector->send(new GetAllDialogs($fileCabinetId))->dto(); +``` + +###### Get Dialogs of a Specific Type +```php +use CodebarAg\DocuWare\Requests\FileCabinets\Dialogs\GetASpecificDialog; + +$dialog = $connector->send(new GetASpecificDialog($fileCabinetId, $dialogId))->dto(); +``` + +###### Get Dialogs Of A Specific Type +```php +use CodebarAg\DocuWare\Enums\DialogType; +use CodebarAg\DocuWare\Requests\FileCabinets\Dialogs\GetDialogsOfASpecificType; + +$dialogs = $connector->send(new GetDialogsOfASpecificType($fileCabinetId, DialogType::SEARCH))->dto(); +``` + +##### Search + +| Description | Implemented | +|------------------------------------------------|-------------| +| Get Documents from a File Cabinet | ✅ | +| Get a Specific Document From a File Cabinet | ✅ | +| Search for Documents in a Single File Cabinet | ✅ | +| Search for Documents in Multiple File Cabinets | ✅ | + +###### Get A Specific Document From A File Cabinet +```php +use CodebarAg\DocuWare\Requests\FileCabinets\Search\GetASpecificDocumentFromAFileCabinet; + +$document = $connector->send(new GetASpecificDocumentFromAFileCabinet( + $fileCabinetId, + $documentId +))->dto(); +``` + +###### Get Documents From A File Cabinet +```php +use CodebarAg\DocuWare\Requests\FileCabinets\Search\GetDocumentsFromAFileCabinet; + +$documents = $connector->send(new GetDocumentsFromAFileCabinet( + $fileCabinetId +))->dto(); +``` + +###### Most basic example to search for documents. +> You only need to provide a valid file cabinet id. +```php +$fileCabinetId = '87356f8d-e50c-450b-909c-4eaccd318fbf'; + +$paginatorRequest = DocuWare::searchRequestBuilder() + ->fileCabinet($fileCabinetId) + ->get(); + +$paginator = $connector->send($paginatorRequest)->dto(); +``` + +###### Search in multiple file cabinets +> Provide an array of file cabinet ids. +```php +$fileCabinetIds = [ + '0ee72de3-4258-4353-8020-6a3ff6dd650f', + '3f9cb4ff-82f2-44dc-b439-dd648269064f', +]; + +$paginatorRequest = DocuWare::searchRequestBuilder() + ->fileCabinets($fileCabinetIds) + ->get(); + +$paginator = $connector->send($paginatorRequest)->dto(); +``` + +###### Find results on the next page +> Default: 1 +```php +$paginatorRequest = DocuWare::searchRequestBuilder() + ->fileCabinet($id) + ->page(2) + ->get(); + +$paginator = $connector->send($paginatorRequest)->dto(); +``` + +###### Define the number of results which should be shown per page +> Default: 50 +```php +$paginatorRequest = DocuWare::searchRequestBuilder() + ->fileCabinet($id) + ->perPage(30) + ->get(); + +$paginator = $connector->send($paginatorRequest)->dto(); +``` + +###### Use the full-text search +> You have to activate full-text search in your file cabinet before you can use this feature. +```php +$paginatorRequest = DocuWare::searchRequestBuilder() + ->fileCabinet($id) + ->fulltext('My secret document') + ->get(); + +$paginator = $connector->send($paginatorRequest)->dto(); +``` + +###### Search documents which are created from the first of march. +```php +$paginatorRequest = DocuWare::searchRequestBuilder() + ->fileCabinet($id) + ->filterDate('DWSTOREDATETIME', '>=', Carbon::create(2021, 3, 1)) + ->get(); + +$paginator = $connector->send($paginatorRequest)->dto(); +``` + +###### Search documents which are created until the first of april. +```php +$paginatorRequest = DocuWare::searchRequestBuilder() + ->fileCabinet($id) + ->filterDate('DWSTOREDATETIME', '<', Carbon::create(2021, 4, 1)) + ->get(); + +$paginator = $connector->send($paginatorRequest)->dto(); +``` + +###### Order the results by field name. +> Supported values: 'asc', 'desc' +```php +$paginatorRequest = DocuWare::searchRequestBuilder() + ->fileCabinet($id) + ->orderBy('DWSTOREDATETIME', 'desc') + ->get(); + +$paginator = $connector->send($paginatorRequest)->dto(); +``` + +###### Search documents filtered to the value. +> You can specify multiple filters. +```php +$paginatorRequest = DocuWare::searchRequestBuilder() + ->fileCabinet($id) + ->filter('TYPE', 'Order') + ->filter('OTHER_FIELD', 'other') + ->get(); + +$paginator = $connector->send($paginatorRequest)->dto(); +``` + +###### Search documents filtered to multiple values. +```php +$paginatorRequest = DocuWare::searchRequestBuilder() + ->fileCabinet($id) + ->filterIn('TYPE', ['Order', 'Invoice']) + ->get(); + +$paginator = $connector->send($paginatorRequest)->dto(); +``` + +###### You can specify the dialog which should be used. +```php +$dialogId = 'bb42c30a-89fc-4b81-9091-d7e326caba62'; + +$paginatorRequest = DocuWare::searchRequestBuilder() + ->fileCabinet($id) + ->dialog($dialogId) + ->get(); + +$paginator = $connector->send($paginatorRequest)->dto(); +``` + +###### You can also combine everything. +```php +$paginatorRequest = DocuWare::searchRequestBuilder() + ->fileCabinet($id) + ->page(2) + ->perPage(30) + ->fulltext('My secret document') + ->filterDate('DWSTOREDATETIME', '>=', Carbon::create(2021, 3, 1)) + ->filterDate('DWSTOREDATETIME','<',Carbon::create(2021, 4, 1)) + ->filter('TYPE', 'Order') + ->filter('OTHER_FIELD', 'other') + ->orderBy('DWSTOREDATETIME', 'desc') + ->dialog($dialogId) + ->get(); + +$paginator = $connector->send($paginatorRequest)->dto(); +``` + + +##### Check In Check Out + +| Request | Supported | +|-------------------------------------------------------------|-----------| +| Check-out & Download a Document | 🕣 | +| Check-in a Document from the File System | 🕣 | +| Undo Check-out | 🕣 | + +> Not Currently Supported + +##### Select Lists +| Request | Supported | +|----------------------------------------------|-----------| +| Get Select Lists & Get Filtered Select Lists | ✅ | + +###### Get Select Lists +```php +use CodebarAg\DocuWare\Requests\FileCabinets\SelectLists\GetSelectLists; + +$types = $this->connector->send(new GetSelectLists( + $fileCabinetId, + $dialogId, + $fieldName, +))->dto(); +``` + +##### Upload + +| Request | Supported | +|-----------------------------------------------------|-----------| +| Create Data Record | ✅ | +| Append File(s) to a Data Record | ✅ | +| Upload a Single File for a Data Record | ❌ | +| Create a Data Record & Upload File | ❌ | +| Create Data Record & Upload File Using Store Dialog | ❌ | +| Append a Single PDF to a Document | ❌ | +| Replace a PDF Document Section | ❌ | + +###### Create Data Record +```php +use CodebarAg\DocuWare\Requests\FileCabinets\Upload\CreateDataRecord; +use CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexTextDTO; + +$document = $connector->send(new CreateDataRecord( + $fileCabinetId, + null, + null, + collect([ + IndexTextDTO::make('DOCUMENT_LABEL', '::data-entry::'), + ]), +))->dto(); +``` + +###### Create Table Data Record +```php +use CodebarAg\DocuWare\Requests\FileCabinets\Upload\CreateDataRecord; +use CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexDateDTO; +use CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexDateTimeDTO; +use CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexDecimalDTO; +use CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexNumericDTO; +use CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexTableDTO; +use CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexTextDTO; + +$tableRows = collect([ + collect([ + IndexTextDTO::make('TEXT', 'project_1'), + IndexNumericDTO::make('INT', 1), + IndexDecimalDTO::make('DECIMAL', 1.1), + IndexDateDTO::make('DATE', $now), + IndexDateTimeDTO::make('DATETIME', $now), + ]), + collect([ + IndexTextDTO::make('TEXT', 'project_2'), + IndexNumericDTO::make('INT', 2), + IndexDecimalDTO::make('DECIMAL', 2.2), + IndexDateDTO::make('DATE', $now), + IndexDateTimeDTO::make('DATETIME', $now), + ]), +]); + + +$document = $connector->send(new CreateDataRecord( + $fileCabinetId, + null, + null, + collect([ + IndexTableDTO::make('TABLE_NAME', $tableRows) + ]), +))->dto(); +``` + +###### Append File(s) To A Data Record +```php +use CodebarAg\DocuWare\Requests\FileCabinets\Upload\AppendFilesToADataRecord; +use Saloon\Data\MultipartValue; + +$response = $connector->send( + new AppendFilesToADataRecord( + fileCabinetId: $fileCabinetId, + dataRecordId: $document->id, + files: collect([ + new MultipartValue( + name: 'File[]', + value: file_get_contents(__DIR__.'/../../../../Fixtures/files/test-2.pdf'), + filename: 'test-2.pdf', + ), + new MultipartValue( + name: 'File[]', + value: file_get_contents(__DIR__.'/../../../../Fixtures/files/test-3.pdf'), + filename: 'test-3.pdf', + ), + ]) + ) +)->dto(); +``` + +###### Append A Single PDF To A Document +```php +use CodebarAg\DocuWare\Requests\FileCabinets\Upload\AppendASinglePDFToADocument; + +$response = $this->connector->send(new AppendASinglePDFToADocument( + fileCabinetId: $fileCabinetId, + documentId: $document->id, + fileContent: file_get_contents(__DIR__.'/../../../../Fixtures/files/test-2.pdf'), + fileName: 'test-2.pdf', +))->dto(); +``` + +###### Replace A PDF Document Section +```php +use CodebarAg\DocuWare\Requests\FileCabinets\Upload\ReplaceAPDFDocumentSection; + +$response = $this->connector->send(new ReplaceAPDFDocumentSection( + fileCabinetId: $fileCabinetId, + sectionId: $documentWithSections->sections->first()->id, + fileContent: file_get_contents(__DIR__.'/../../../../Fixtures/files/test-3.pdf'), + fileName: 'test-3.pdf', +))->dto(); +``` + +###### Batch Index Fields Update +| Request | Supported | +|------------------------------------------|-----------| +| Batch Update Index Fields By Id | ❌ | +| Batch Update Index Fields By Search | ❌ | +| Batch Append/Update Keyword Fields By Id | ❌ | + +> Not Currently Supported + +###### Get Fields +```php +use CodebarAg\DocuWare\Requests\Fields\GetFieldsRequest; + +$fields = $connector->send(new GetFieldsRequest($fileCabinetId))->dto(); +``` + +#### Documents + +##### Update Index Values +| Request | Supported | +|---------------------------|-----------| +| Update Index Values | ✅ | +| Update Table Index Values | ✅ | +| Update Table Field Values | ❌ | + + +```php +use CodebarAg\DocuWare\Requests\Documents\UpdateIndexValues\UpdateIndexValues; +use CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexDateDTO; + +$response = $connector->send(new UpdateIndexValues( + $fileCabinetId, + $documentId, + collect([ + IndexTextDTO::make('DOCUMENT_LABEL', '::new-data-entry::'), + ]) +))->dto(); +``` + +###### Update Table Data Record +```php +use CodebarAg\DocuWare\Requests\Documents\UpdateIndexValues\UpdateIndexValues; +use CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexDateDTO; +use CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexDateTimeDTO; +use CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexDecimalDTO; +use CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexNumericDTO; +use CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexTableDTO; +use CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexTextDTO; + +$tableRows = collect([ + collect([ + IndexTextDTO::make('TEXT', 'project_1'), + IndexNumericDTO::make('INT', 1), + IndexDecimalDTO::make('DECIMAL', 1.1), + IndexDateDTO::make('DATE', $now), + IndexDateTimeDTO::make('DATETIME', $now), + ]), + collect([ + IndexTextDTO::make('TEXT', 'project_2'), + IndexNumericDTO::make('INT', 2), + IndexDecimalDTO::make('DECIMAL', 2.2), + IndexDateDTO::make('DATE', $now), + IndexDateTimeDTO::make('DATETIME', $now), + ]), +]); + + +$document = $connector->send(new UpdateIndexValues( + $fileCabinetId, + null, + null, + collect([ + IndexTableDTO::make('TABLE_NAME', $tableRows) + ]), +))->dto(); +``` + +##### Modify Documents +| Request | Supported | +|-------------------|-----------| +| Transfer Document | ✅ | +| Delete Document | ✅ | + + +###### Transfer Document +```php +use CodebarAg\DocuWare\Requests\Documents\ModifyDocuments\TransferDocument; + +$response = $connector->send(new TransferDocument( + $fileCabinetId, + $destinationFileCabinetId, + $storeDialogId, + $documentId, + $fields, +))->dto(); +``` + +###### Delete Documents +```php +use CodebarAg\DocuWare\Requests\Documents\ModifyDocuments\DeleteDocument; + +$connector->send(new DeleteDocument( + $fileCabinetId + $documentId, +))->dto(); +``` + +##### Clip/Unclip & Staple/Unstaple +| Request | Supported | +|----------|-----------| +| Clip | ✅ | +| Unclip | ✅ | +| Staple | ✅ | +| Unstaple | ✅ | + +###### Clip +```php +use CodebarAg\DocuWare\Requests\Documents\ClipUnclipStapleUnstaple\Clip; + +$clip = $connector->send(new Clip( + $fileCabinetId, + [ + $documentId, + $document2Id, + ] +))->dto(); +``` + +###### Unclip +```php +use CodebarAg\DocuWare\Requests\Documents\ClipUnclipStapleUnstaple\Unclip; + +$unclip = $connector->send(new Unclip( + $fileCabinetId, + $clipId +))->dto(); +``` + +###### Staple +```php +use CodebarAg\DocuWare\Requests\Documents\ClipUnclipStapleUnstaple\Staple; + +$staple = $connector->send(new Staple( + $fileCabinetId, + [ + $documentId, + $document2Id, + ] +))->dto(); +``` + +###### Unstaple +```php +use CodebarAg\DocuWare\Requests\Documents\ClipUnclipStapleUnstaple\Unstaple; + +$unclip = $connector->send(new Unstaple( + $fileCabinetId, + $stapleId +))->dto(); +``` + +##### Annotations/Stamps +| Request | Supported | +|----------------------------|-----------| +| AddStampWithPosition | 🕣 | +| AddStampWithBestPosition | 🕣 | +| AddTextAnnotation | 🕣 | +| AddRectEntryAnnotation | 🕣 | +| AddLineEntryAnnotation | 🕣 | +| AddPolyLineEntryAnnotation | ❌ | +| DeleteAnnotation | ❌ | +| UpdateTextAnnotation | 🕣 | +| Get Stamps | ❌ | + +> Not Currently Supported + +###### Documents Trash Bin +| Request | Supported | +|-------------------|-----------| +| Get Documents | ✅ | +| Delete Documents | ✅ | +| Restore Documents | ✅ | + + +###### Get Documents +> You can use the same methods as in the search usage. The only difference is that you have to use the `trashBin` method after the `searchRequestBuilder` method. +```php + + +```php +use CodebarAg\DocuWare\DocuWare; + +$paginatorRequest = (new DocuWare()) + ->searchRequestBuilder() + ->trashBin() +``` + +###### Delete Documents +```php +use CodebarAg\DocuWare\Requests\Documents\DocumentsTrashBin\DeleteDocuments; + +$delete = $connector->send(new DeleteDocuments([$documentID, $document2ID]))->dto(); +``` + +###### Restore Documents +```php +use CodebarAg\DocuWare\Requests\Documents\DocumentsTrashBin\RestoreDocuments; + +$delete = $connector->send(new RestoreDocuments([$documentID, $document2ID]))->dto(); +``` + +##### Application Properties +| Request | Supported | +|-------------------------------|-----------| +| Get Application Properties | ✅ | +| Add Application Properties | ✅ | +| Delete Application Properties | ✅ | +| Update Application Properties | ✅ | + + +###### Add Application Properties +```php +use CodebarAg\DocuWare\Requests\Documents\ApplicationProperties\AddApplicationProperties; + +$addProperties = $connector->send(new AddApplicationProperties( + $fileCabinetId, + $documentId, + [ + [ + 'Name' => 'Key1', + 'Value' => 'Key1 Value', + ], + [ + 'Name' => 'Key2', + 'Value' => 'Key2 Value', + ], + ], +))->dto(); +``` + +###### Update Application Properties +```php +use CodebarAg\DocuWare\Requests\Documents\ApplicationProperties\UpdateApplicationProperties; + +$updateProperties = $connector->send(new UpdateApplicationProperties( + $fileCabinetId, + $documentId, + [ + [ + 'Name' => 'Key1', + 'Value' => 'Key1 Value Updated', + ], + ], +))->dto()->sortBy('Name'); +``` + +###### Delete Application Properties +```php +use CodebarAg\DocuWare\Requests\Documents\ApplicationProperties\DeleteApplicationProperties; + +$deleteProperties = $connector->send(new DeleteApplicationProperties( + $fileCabinetId, + $document->id, + [ + 'Key1', + ], +))->dto(); +``` + +###### Get Application Properties +```php +use CodebarAg\DocuWare\Requests\Documents\ApplicationProperties\GetApplicationProperties; + +$properties = $connector->send(new GetApplicationProperties( + $fileCabinetId, + $document->id, +))->dto(); +``` + +##### Sections + +| Request | Supported | +|----------------------------------|-----------| +| Get All Sections from a Document | ✅ | +| Get a Specific Section | ✅ | +| Delete Section | ✅ | +| Get Textshot | ✅ | + +###### Get All Sections + +```php +use CodebarAg\DocuWare\Requests\Documents\Sections\GetAllSectionsFromADocument; + +$sections = $connector->send(new GetAllSectionsFromADocument( + $fileCabinetId, + $documentId +))->dto(); +``` + +###### Get Specific Section + +```php +use CodebarAg\DocuWare\Requests\Documents\Sections\GetASpecificSection; + +$section = $connector->send(new GetASpecificSection( + $fileCabinetId, + $sectionsId +))->dto(); +``` + +###### Delete Section + +```php +use CodebarAg\DocuWare\Requests\Documents\Sections\DeleteSection; + +$deleted = $connector->send(new DeleteSection( + $fileCabinetId, + $sectionId +))->dto(); +``` + +###### Get Textshot + +```php +use CodebarAg\DocuWare\Requests\Documents\Sections\GetTextshot; + +$deleted = $connector->send(new GetTextshot( + $fileCabinetId, + $sectionId +))->dto(); +``` + +##### Download +| Request | Supported | +|--------------------|-----------| +| Download Document | ✅ | +| Download Section | ✅ | +| Download Thumbnail | ✅ | + + +###### Download Document +```php +use CodebarAg\DocuWare\Requests\Documents\Download\DownloadDocument; + +$contents = $connector->send(new DownloadDocument( + $fileCabinetId, + $documentId +))->dto(); +``` + +###### Download Section +```php +use CodebarAg\DocuWare\Requests\Documents\Download\DownloadSection; + +$contents = $connector->send(new DownloadSection( + $fileCabinetId, + $sectionId +))->dto(); +``` + +###### Download Thumbnail +```php +use CodebarAg\DocuWare\Requests\Documents\Download\DownloadThumbnail; + +$contents = $connector->send(new DownloadThumbnail( + $fileCabinetId, + $sectionId +))->dto(); +``` + +#### Workflow + +##### Workflow History +| Request | Supported | +|-------------------------------------|-----------| +| Get Document Workflow History | ✅ | +| Get Document Workflow History Steps | ✅ | + +###### Get Document Workflow History +```php +use CodebarAg\DocuWare\Requests\Workflow\GetDocumentWorkflowHistory; + +$history = $this->connector->send(new GetDocumentWorkflowHistory( + $fileCabinetId, + $documentId +))->dto(); +``` + +###### Get Document Workflow History Steps +```php +use CodebarAg\DocuWare\Requests\Workflow\GetDocumentWorkflowHistorySteps; + +$historySteps = $this->connector->send(new GetDocumentWorkflowHistorySteps( + $workflowId, + $historyId, +))->dto(); +``` + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -282,19 +1350,319 @@ $connector = new YourOwnDocuWareConnector(); ## 🖼 Make encrypted URLs -- [Encrypted URLs](docs/encrypted_urls.md) +```php +use CodebarAg\DocuWare\Facades\DocuWare; +``` + +### Make encrypted URL for a document in a file cabinet. +```php +$fileCabinetId = '87356f8d-e50c-450b-909c-4eaccd318fbf'; +$documentId = 42; + +$url = DocuWare::url() + ->fileCabinet($fileCabinetId) + ->document($documentId) + ->make(); +``` + +### Make encrypted URL for a document in a basket. +```php +$basketId = 'b_87356f8d-e50c-450b-909c-4eaccd318fbf'; + +$url = DocuWare::url() + ->basket($basketId) + ->document($documentId) + ->make(); +``` + +### Make encrypted URL valid for a specific amount of time. +> In the example below the URL is valid for one week, afterward the URL is no longer working. +```php +$url = DocuWare::url() + ->fileCabinet($fileCabinetId) + ->document($documentId) + ->validUntil(now()->addWeek()) + ->make(); +``` + ## 🏋️ Document Index Fields DTO showcase -- [Document Index Fields DTO](docs/dto.md) +```php +CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexTextDTO { + +name: "FIELD_TEXT" // string + +value: "Value" // null|string +} +``` + +```php +CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexNumericDTO { + +name: "FIELD_NUMERIC" // string + +value: 1 // null|int +} +``` + +```php +CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexDecimalDTO { + +name: "FIELD_DECIMAL" // string + +value: 1.00 // null|int|float +} +``` + +```php +CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexDateDTO { + +name: "FIELD_DATE" // string + +value: now(), // null|Carbon +} +``` + +```php +CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexDateTimeDTO { + +name: "FIELD_DATETIME" // string + +value: now(), // null|Carbon +} +``` + +```php +CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexKeywordDTO { + +name: "FIELD_KEYWORD" // string + +value: "Value" // null|string +} +``` + +```php +CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexMemoDTO { + +name: "FIELD_MEMO" // string + +value: "Value" // null|string +} +``` + +```php +CodebarAg\DocuWare\DTO\OrganizationIndex { + +id: "2f071481-095d-4363-abd9-29ef845a8b05" // string + +name: "Fake File Cabinet" // string + +guid: "1334c006-f095-4ae7-892b-fe59282c8bed" // string|null +} +``` + +```php +CodebarAg\DocuWare\DTO\Organization { + +id: "2f071481-095d-4363-abd9-29ef845a8b05" // string + +name: "Fake File Cabinet" // string + +guid: "1334c006-f095-4ae7-892b-fe59282c8bed" // string|null + +additionalInfo: [] // array + +configurationRights: [] // array +} +``` + +```php +CodebarAg\DocuWare\DTO\FileCabinet { + +id: "2f071481-095d-4363-abd9-29ef845a8b05" // string + +name: "Fake File Cabinet" // string + +color: "Yellow" // string + +isBasket: true // bool + +assignedCabinet: "889c13cc-c636-4759-a704-1e6500d2d70f" // string +} +``` + +```php +CodebarAg\DocuWare\DTO\Dialog { + +id: "fae3b667-53e9-48dd-9004-34647a26112e" // string + +type: "ResultList" // string + +label: "Fake Dialog" // string + +isDefault: true // boolean + +fileCabinetId: "1334c006-f095-4ae7-892b-fe59282c8bed" // string +} +``` + +```php +CodebarAg\DocuWare\DTO\Field { + +name: "FAKE_FIELD" // string + +label: "Fake Field" // string + +type: "Memo" // string + +scope: "User" // string +``` + +```php +CodebarAg\DocuWare\DTO\Field { + +name: "FAKE_FIELD" // string + +label: "Fake Field" // string + +type: "Memo" // string + +scope: "User" // string +``` + +```php +CodebarAg\DocuWare\DTO\Document { + +id: 659732 // integer + +file_size: 765336 // integer + +total_pages: 100 // integer + +title: "Fake Title" // string + +extension: ".pdf" // string + +content_type: "application/pdf" // string + +file_cabinet_id: "a233b03d-dc63-42dd-b774-25b3ff77548f" // string + +created_at: Illuminate\Support\Carbon // Carbon + +updated_at: Illuminate\Support\Carbon // Carbon + +fields: Illuminate\Support\Collection { // Collection|DocumentField[] + #items: array:2 [ + 0 => CodebarAg\DocuWare\DTO\DocumentField // DocumentField + 1 => CodebarAg\DocuWare\DTO\DocumentField // DocumentField + ] + } +} +``` + +```php +CodebarAg\DocuWare\DTO\Section {#23784▶ + +id: "5589-5525" + +contentType: "text/plain" + +haveMorePages: true + +pageCount: 1 + +fileSize: 32 + +originalFileName: "example.txt" + +contentModified: "/Date(1702395557000)/" + +annotationsPreview: false + +hasTextAnnotations: null +} +``` + +```php +CodebarAg\DocuWare\DTO\DocumentThumbnail { + +mime: "image/png" // string + +data: "somedata" // string + +base64: "data:image/png;base64,WXpJNWRGcFhVbWhrUjBVOQ==" // string +} +``` + +```php +CodebarAg\DocuWare\DTO\TableRow { + +fields: Illuminate\Support\Collection { // Collection|DocumentField[] + #items: array:2 [ + 0 => CodebarAg\DocuWare\DTO\DocumentField // DocumentField + 1 => CodebarAg\DocuWare\DTO\DocumentField // DocumentField + ] +} +``` + +```php +CodebarAg\DocuWare\DTO\DocumentPaginator + +total: 39 // integer + +per_page: 10 // integer + +current_page: 9 // integer + +last_page: 15 // integer + +from: 1 // integer + +to: 10 // integer + +documents: Illuminate\Support\Collection { // Collection|Document[] + #items: array:2 [ + 0 => CodebarAg\DocuWare\DTO\Document // Document + 1 => CodebarAg\DocuWare\DTO\Document // Document + ] + } + +error: CodebarAg\DocuWare\DTO\ErrorBag { // ErrorBag|null + +code: 422 // int + +message: "'000' is not valid cabinet id" // string + } +} +``` + ## 📦 Caching requests -- [Caching Requests](docs/caching.md) +> All Get Requests are cachable and will be cached by default. To determine if the response is cached you can use the following method: + +### Is Cached +```php +$connector = new DocuWareConnector(); + +$response = $connector->send(new GetDocumentRequest($fileCabinetId, $documentId)); +$response->isCached(); // false + +// Next time the request is sent + +$response = $connector->send(new GetDocumentRequest($fileCabinetId, $documentId)); +$response->isCached(); // true +``` + + +### Invalidate Cache +> To invalidate the cache for a specific request you can use the following method: +```php +$connector = new DocuWareConnector(); + +$request = new GetDocumentRequest($fileCabinetId, $documentId); +$request->invalidateCache(); + +$response = $connector->send($request); +``` + +### Disable Caching +> To temporarily disable caching for a specific request you can use the following method: +```php +$connector = new DocuWareConnector(); + +$request = new GetDocumentRequest($fileCabinetId, $documentId); +$request->disableCaching(); + +$response = $connector->send($request); +``` + ## 💥 Exceptions explained -- [Exceptions](docs/exceptions.md) +- `CodebarAg\DocuWare\Exceptions\UnableToMakeRequest` + +This is thrown if you are not authorized to make the request. + +--- + +- `CodebarAg\DocuWare\Exceptions\UnableToProcessRequest` + +This is thrown if you passed wrong attributes. For example a file cabinet ID +which does not exist. + +--- + +- `CodebarAg\DocuWare\Exceptions\UnableToLogin` + +This exception can only be thrown during the login if the credentials did not +match. + +--- + +- `CodebarAg\DocuWare\Exceptions\UnableToLoginNoCookies` + +This exception can only be thrown during the login if there was no cookies in +the response from the api. + +--- + +- `CodebarAg\DocuWare\Exceptions\UnableToFindPassphrase` + +This exception can only be thrown during the url making if the passphrase +could not be found. + +--- + +- `CodebarAg\DocuWare\Exceptions\UnableToMakeUrl` + +Something is wrong during the URL making. + +--- + +- `CodebarAg\DocuWare\Exceptions\UnableToUpdateFields` + +No fields were supplied. + +--- + +- `CodebarAg\DocuWare\Exceptions\UnableToGetDocumentCount` + +Something is wrong with the response from getting the document count. + +--- + +- `Illuminate\Http\Client\RequestException` + +All other cases if the response is not successfully. ## ✨ Events From 57ac145c82dab13bd8f18cc6a2bfcb80186c4c65 Mon Sep 17 00:00:00 2001 From: Rhys Lees <43909932+RhysLees@users.noreply.github.com> Date: Fri, 10 Jan 2025 13:07:54 +0000 Subject: [PATCH 8/8] WIP --- docs/Documents/annotations-stamps.md | 14 -- docs/Documents/application_properties.md | 67 ------- .../clip-unclicp_and_staple-unstaple.md | 53 ------ docs/Documents/documents-trash-bin.md | 34 ---- docs/Documents/download.md | 37 ---- docs/Documents/modify_documents.md | 29 --- docs/Documents/sections.md | 52 ----- docs/Documents/update_index_values.md | 59 ------ .../batch_index_fields_update.md | 15 -- docs/File Cabinets/check-in_check-out.md | 8 - docs/File Cabinets/dialogs.md | 30 --- docs/File Cabinets/general.md | 23 --- docs/File Cabinets/search.md | 170 ----------------- docs/File Cabinets/select_lists.md | 15 -- docs/File Cabinets/upload.md | 114 ----------- .../User Management/create-update_users.md | 28 --- .../User Management/get-modify_groups.md | 42 ----- .../User Management/get-modify_roles.md | 42 ----- docs/General/User Management/get_users.md | 36 ---- docs/General/organization.md | 22 --- docs/caching.md | 39 ---- docs/dto.md | 177 ------------------ docs/encrypted_urls.md | 36 ---- docs/exceptions.md | 57 ------ docs/workflow.md | 25 --- 25 files changed, 1224 deletions(-) delete mode 100644 docs/Documents/annotations-stamps.md delete mode 100644 docs/Documents/application_properties.md delete mode 100644 docs/Documents/clip-unclicp_and_staple-unstaple.md delete mode 100644 docs/Documents/documents-trash-bin.md delete mode 100644 docs/Documents/download.md delete mode 100644 docs/Documents/modify_documents.md delete mode 100644 docs/Documents/sections.md delete mode 100644 docs/Documents/update_index_values.md delete mode 100644 docs/File Cabinets/batch_index_fields_update.md delete mode 100644 docs/File Cabinets/check-in_check-out.md delete mode 100644 docs/File Cabinets/dialogs.md delete mode 100644 docs/File Cabinets/general.md delete mode 100644 docs/File Cabinets/search.md delete mode 100644 docs/File Cabinets/select_lists.md delete mode 100644 docs/File Cabinets/upload.md delete mode 100644 docs/General/User Management/create-update_users.md delete mode 100644 docs/General/User Management/get-modify_groups.md delete mode 100644 docs/General/User Management/get-modify_roles.md delete mode 100644 docs/General/User Management/get_users.md delete mode 100644 docs/General/organization.md delete mode 100644 docs/caching.md delete mode 100644 docs/dto.md delete mode 100644 docs/encrypted_urls.md delete mode 100644 docs/exceptions.md delete mode 100644 docs/workflow.md diff --git a/docs/Documents/annotations-stamps.md b/docs/Documents/annotations-stamps.md deleted file mode 100644 index c4c6541..0000000 --- a/docs/Documents/annotations-stamps.md +++ /dev/null @@ -1,14 +0,0 @@ -# Annotations/Stamps -| Request | Supported | -|----------------------------|-----------| -| AddStampWithPosition | 🕣 | -| AddStampWithBestPosition | 🕣 | -| AddTextAnnotation | 🕣 | -| AddRectEntryAnnotation | 🕣 | -| AddLineEntryAnnotation | 🕣 | -| AddPolyLineEntryAnnotation | ❌ | -| DeleteAnnotation | ❌ | -| UpdateTextAnnotation | 🕣 | -| Get Stamps | ❌ | - -> Not Currently Supported diff --git a/docs/Documents/application_properties.md b/docs/Documents/application_properties.md deleted file mode 100644 index 4e3932b..0000000 --- a/docs/Documents/application_properties.md +++ /dev/null @@ -1,67 +0,0 @@ -# Application Properties -| Request | Supported | -|-------------------------------|-----------| -| Get Application Properties | ✅ | -| Add Application Properties | ✅ | -| Delete Application Properties | ✅ | -| Update Application Properties | ✅ | - - -### Add Application Properties -```php -use CodebarAg\DocuWare\Requests\Documents\ApplicationProperties\AddApplicationProperties; - -$addProperties = $connector->send(new AddApplicationProperties( - $fileCabinetId, - $documentId, - [ - [ - 'Name' => 'Key1', - 'Value' => 'Key1 Value', - ], - [ - 'Name' => 'Key2', - 'Value' => 'Key2 Value', - ], - ], -))->dto(); -``` - -### Update Application Properties -```php -use CodebarAg\DocuWare\Requests\Documents\ApplicationProperties\UpdateApplicationProperties; - -$updateProperties = $connector->send(new UpdateApplicationProperties( - $fileCabinetId, - $documentId, - [ - [ - 'Name' => 'Key1', - 'Value' => 'Key1 Value Updated', - ], - ], -))->dto()->sortBy('Name'); -``` - -### Delete Application Properties -```php -use CodebarAg\DocuWare\Requests\Documents\ApplicationProperties\DeleteApplicationProperties; - -$deleteProperties = $connector->send(new DeleteApplicationProperties( - $fileCabinetId, - $document->id, - [ - 'Key1', - ], -))->dto(); -``` - -### Get Application Properties -```php -use CodebarAg\DocuWare\Requests\Documents\ApplicationProperties\GetApplicationProperties; - -$properties = $connector->send(new GetApplicationProperties( - $fileCabinetId, - $document->id, -))->dto(); -``` diff --git a/docs/Documents/clip-unclicp_and_staple-unstaple.md b/docs/Documents/clip-unclicp_and_staple-unstaple.md deleted file mode 100644 index 35f6c72..0000000 --- a/docs/Documents/clip-unclicp_and_staple-unstaple.md +++ /dev/null @@ -1,53 +0,0 @@ -# Clip/Unclip & Staple/Unstaple -| Request | Supported | -|----------|-----------| -| Clip | ✅ | -| Unclip | ✅ | -| Staple | ✅ | -| Unstaple | ✅ | - -### Clip -```php -use CodebarAg\DocuWare\Requests\Documents\ClipUnclipStapleUnstaple\Clip; - -$clip = $connector->send(new Clip( - $fileCabinetId, - [ - $documentId, - $document2Id, - ] -))->dto(); -``` - -### Unclip -```php -use CodebarAg\DocuWare\Requests\Documents\ClipUnclipStapleUnstaple\Unclip; - -$unclip = $connector->send(new Unclip( - $fileCabinetId, - $clipId -))->dto(); -``` - -### Staple -```php -use CodebarAg\DocuWare\Requests\Documents\ClipUnclipStapleUnstaple\Staple; - -$staple = $connector->send(new Staple( - $fileCabinetId, - [ - $documentId, - $document2Id, - ] -))->dto(); -``` - -### Unstaple -```php -use CodebarAg\DocuWare\Requests\Documents\ClipUnclipStapleUnstaple\Unstaple; - -$unclip = $connector->send(new Unstaple( - $fileCabinetId, - $stapleId -))->dto(); -``` diff --git a/docs/Documents/documents-trash-bin.md b/docs/Documents/documents-trash-bin.md deleted file mode 100644 index 6da7ded..0000000 --- a/docs/Documents/documents-trash-bin.md +++ /dev/null @@ -1,34 +0,0 @@ -# Documents Trash Bin -| Request | Supported | -|-------------------|-----------| -| Get Documents | ✅ | -| Delete Documents | ✅ | -| Restore Documents | ✅ | - - -### Get Documents -> You can use the same methods as in the search usage. The only difference is that you have to use the `trashBin` method after the `searchRequestBuilder` method. -```php - - -```php -use CodebarAg\DocuWare\DocuWare; - -$paginatorRequest = (new DocuWare()) - ->searchRequestBuilder() - ->trashBin() -``` - -#### Delete Documents -```php -use CodebarAg\DocuWare\Requests\Documents\DocumentsTrashBin\DeleteDocuments; - -$delete = $connector->send(new DeleteDocuments([$documentID, $document2ID]))->dto(); -``` - -#### Restore Documents -```php -use CodebarAg\DocuWare\Requests\Documents\DocumentsTrashBin\RestoreDocuments; - -$delete = $connector->send(new RestoreDocuments([$documentID, $document2ID]))->dto(); -``` diff --git a/docs/Documents/download.md b/docs/Documents/download.md deleted file mode 100644 index 0aa8d5a..0000000 --- a/docs/Documents/download.md +++ /dev/null @@ -1,37 +0,0 @@ -# Download -| Request | Supported | -|--------------------|-----------| -| Download Document | ✅ | -| Download Section | ✅ | -| Download Thumbnail | ✅ | - - -### Download Document -```php -use CodebarAg\DocuWare\Requests\Documents\Download\DownloadDocument; - -$contents = $connector->send(new DownloadDocument( - $fileCabinetId, - $documentId -))->dto(); -``` - -### Download Section -```php -use CodebarAg\DocuWare\Requests\Documents\Download\DownloadSection; - -$contents = $connector->send(new DownloadSection( - $fileCabinetId, - $sectionId -))->dto(); -``` - -### Download Thumbnail -```php -use CodebarAg\DocuWare\Requests\Documents\Download\DownloadThumbnail; - -$contents = $connector->send(new DownloadThumbnail( - $fileCabinetId, - $sectionId -))->dto(); -``` diff --git a/docs/Documents/modify_documents.md b/docs/Documents/modify_documents.md deleted file mode 100644 index 9a97c8e..0000000 --- a/docs/Documents/modify_documents.md +++ /dev/null @@ -1,29 +0,0 @@ -# Modify Documents -| Request | Supported | -|-------------------|-----------| -| Transfer Document | ✅ | -| Delete Document | ✅ | - - -### Transfer Document -```php -use CodebarAg\DocuWare\Requests\Documents\ModifyDocuments\TransferDocument; - -$response = $connector->send(new TransferDocument( - $fileCabinetId, - $destinationFileCabinetId, - $storeDialogId, - $documentId, - $fields, -))->dto(); -``` - -### Delete Documents -```php -use CodebarAg\DocuWare\Requests\Documents\ModifyDocuments\DeleteDocument; - -$connector->send(new DeleteDocument( - $fileCabinetId - $documentId, -))->dto(); -``` diff --git a/docs/Documents/sections.md b/docs/Documents/sections.md deleted file mode 100644 index 57cd925..0000000 --- a/docs/Documents/sections.md +++ /dev/null @@ -1,52 +0,0 @@ -# Sections - -| Request | Supported | -|----------------------------------|-----------| -| Get All Sections from a Document | ✅ | -| Get a Specific Section | ✅ | -| Delete Section | ✅ | -| Get Textshot | ✅ | - -### Get All Sections - -```php -use CodebarAg\DocuWare\Requests\Documents\Sections\GetAllSectionsFromADocument; - -$sections = $connector->send(new GetAllSectionsFromADocument( - $fileCabinetId, - $documentId -))->dto(); -``` - -### Get Specific Section - -```php -use CodebarAg\DocuWare\Requests\Documents\Sections\GetASpecificSection; - -$section = $connector->send(new GetASpecificSection( - $fileCabinetId, - $sectionsId -))->dto(); -``` - -### Delete Section - -```php -use CodebarAg\DocuWare\Requests\Documents\Sections\DeleteSection; - -$deleted = $connector->send(new DeleteSection( - $fileCabinetId, - $sectionId -))->dto(); -``` - -### Get Textshot - -```php -use CodebarAg\DocuWare\Requests\Documents\Sections\GetTextshot; - -$deleted = $connector->send(new GetTextshot( - $fileCabinetId, - $sectionId -))->dto(); -``` diff --git a/docs/Documents/update_index_values.md b/docs/Documents/update_index_values.md deleted file mode 100644 index 1e4b2e0..0000000 --- a/docs/Documents/update_index_values.md +++ /dev/null @@ -1,59 +0,0 @@ -# Update Index Values -| Request | Supported | -|---------------------------|-----------| -| Update Index Values | ✅ | -| Update Table Index Values | ✅ | -| Update Table Field Values | ❌ | - - -### Update Index Values -```php -use CodebarAg\DocuWare\Requests\Documents\UpdateIndexValues\UpdateIndexValues; -use CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexDateDTO; - -$response = $connector->send(new UpdateIndexValues( - $fileCabinetId, - $documentId, - collect([ - IndexTextDTO::make('DOCUMENT_LABEL', '::new-data-entry::'), - ]) -))->dto(); -``` - -### Update Table Data Record -```php -use CodebarAg\DocuWare\Requests\Documents\UpdateIndexValues\UpdateIndexValues; -use CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexDateDTO; -use CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexDateTimeDTO; -use CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexDecimalDTO; -use CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexNumericDTO; -use CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexTableDTO; -use CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexTextDTO; - -$tableRows = collect([ - collect([ - IndexTextDTO::make('TEXT', 'project_1'), - IndexNumericDTO::make('INT', 1), - IndexDecimalDTO::make('DECIMAL', 1.1), - IndexDateDTO::make('DATE', $now), - IndexDateTimeDTO::make('DATETIME', $now), - ]), - collect([ - IndexTextDTO::make('TEXT', 'project_2'), - IndexNumericDTO::make('INT', 2), - IndexDecimalDTO::make('DECIMAL', 2.2), - IndexDateDTO::make('DATE', $now), - IndexDateTimeDTO::make('DATETIME', $now), - ]), -]); - - -$document = $connector->send(new UpdateIndexValues( - $fileCabinetId, - null, - null, - collect([ - IndexTableDTO::make('TABLE_NAME', $tableRows) - ]), -))->dto(); -``` diff --git a/docs/File Cabinets/batch_index_fields_update.md b/docs/File Cabinets/batch_index_fields_update.md deleted file mode 100644 index 3bad9bb..0000000 --- a/docs/File Cabinets/batch_index_fields_update.md +++ /dev/null @@ -1,15 +0,0 @@ -# General -| Request | Supported | -|------------------------------------------|-----------| -| Batch Update Index Fields By Id | ❌ | -| Batch Update Index Fields By Search | ❌ | -| Batch Append/Update Keyword Fields By Id | ❌ | - -> Not Currently Supported - -#### Get Fields -```php -use CodebarAg\DocuWare\Requests\Fields\GetFieldsRequest; - -$fields = $connector->send(new GetFieldsRequest($fileCabinetId))->dto(); -``` diff --git a/docs/File Cabinets/check-in_check-out.md b/docs/File Cabinets/check-in_check-out.md deleted file mode 100644 index 0ecfcf5..0000000 --- a/docs/File Cabinets/check-in_check-out.md +++ /dev/null @@ -1,8 +0,0 @@ -# General -| Request | Supported | -|-------------------------------------------------------------|-----------| -| Check-out & Download a Document | 🕣 | -| Check-in a Document from the File System | 🕣 | -| Undo Check-out | 🕣 | - -> Not Currently Supported diff --git a/docs/File Cabinets/dialogs.md b/docs/File Cabinets/dialogs.md deleted file mode 100644 index e187242..0000000 --- a/docs/File Cabinets/dialogs.md +++ /dev/null @@ -1,30 +0,0 @@ -# Dialogs - -| Request | Supported | -|--------------------------------|-----------| -| Get All Dialogs | ✅ | -| Get a Specific Dialog | ✅ | -| Get Dialogs of a Specific Type | ✅ | - -### Get All Dialogs -```php -use CodebarAg\DocuWare\Requests\FileCabinets\Dialogs\GetAllDialogs; - -$dialogs = $connector->send(new GetAllDialogs($fileCabinetId))->dto(); -``` - -### Get Dialogs of a Specific Type -```php -use CodebarAg\DocuWare\Requests\FileCabinets\Dialogs\GetASpecificDialog; - -$dialog = $connector->send(new GetASpecificDialog($fileCabinetId, $dialogId))->dto(); -``` - -### Get Dialogs Of A Specific Type -```php -use CodebarAg\DocuWare\Enums\DialogType; -use CodebarAg\DocuWare\Requests\FileCabinets\Dialogs\GetDialogsOfASpecificType; - -$dialogs = $connector->send(new GetDialogsOfASpecificType($fileCabinetId, DialogType::SEARCH))->dto(); -``` - diff --git a/docs/File Cabinets/general.md b/docs/File Cabinets/general.md deleted file mode 100644 index 0e0dd07..0000000 --- a/docs/File Cabinets/general.md +++ /dev/null @@ -1,23 +0,0 @@ -# General - -| Request | Supported | -|-------------------------------|-----------| -| Get File Cabinet Information | ✅ | -| Get Total Number of Documents | ✅ | - -### Get File Cabinet Information -```php -use CodebarAg\DocuWare\Requests\FileCabinets\General\GetFileCabinetInformation; - -$fileCabinet = $connector->send(new GetFileCabinetInformation($fileCabinetId))->dto(); -``` - -### Get Total Number Of Documents -```php -use CodebarAg\DocuWare\Requests\FileCabinets\General\GetTotalNumberOfDocuments; - -$count = $connector->send(new GetTotalNumberOfDocuments( - $fileCabinetId, - $dialogId -))->dto(); -``` diff --git a/docs/File Cabinets/search.md b/docs/File Cabinets/search.md deleted file mode 100644 index 8f4e8e0..0000000 --- a/docs/File Cabinets/search.md +++ /dev/null @@ -1,170 +0,0 @@ -# Search - -| Description | Implemented | -|------------------------------------------------|-------------| -| Get Documents from a File Cabinet | ✅ | -| Get a Specific Document From a File Cabinet | ✅ | -| Search for Documents in a Single File Cabinet | ✅ | -| Search for Documents in Multiple File Cabinets | ✅ | - -#### Get A Specific Document From A File Cabinet -```php -use CodebarAg\DocuWare\Requests\FileCabinets\Search\GetASpecificDocumentFromAFileCabinet; - -$document = $connector->send(new GetASpecificDocumentFromAFileCabinet( - $fileCabinetId, - $documentId -))->dto(); -``` - -#### Get Documents From A File Cabinet -```php -use CodebarAg\DocuWare\Requests\FileCabinets\Search\GetDocumentsFromAFileCabinet; - -$documents = $connector->send(new GetDocumentsFromAFileCabinet( - $fileCabinetId -))->dto(); -``` - -### Most basic example to search for documents. -> You only need to provide a valid file cabinet id. -```php -$fileCabinetId = '87356f8d-e50c-450b-909c-4eaccd318fbf'; - -$paginatorRequest = DocuWare::searchRequestBuilder() - ->fileCabinet($fileCabinetId) - ->get(); - -$paginator = $connector->send($paginatorRequest)->dto(); -``` - -### Search in multiple file cabinets -> Provide an array of file cabinet ids. -```php -$fileCabinetIds = [ - '0ee72de3-4258-4353-8020-6a3ff6dd650f', - '3f9cb4ff-82f2-44dc-b439-dd648269064f', -]; - -$paginatorRequest = DocuWare::searchRequestBuilder() - ->fileCabinets($fileCabinetIds) - ->get(); - -$paginator = $connector->send($paginatorRequest)->dto(); -``` - -### Find results on the next page -> Default: 1 -```php -$paginatorRequest = DocuWare::searchRequestBuilder() - ->fileCabinet($id) - ->page(2) - ->get(); - -$paginator = $connector->send($paginatorRequest)->dto(); -``` - -### Define the number of results which should be shown per page -> Default: 50 -```php -$paginatorRequest = DocuWare::searchRequestBuilder() - ->fileCabinet($id) - ->perPage(30) - ->get(); - -$paginator = $connector->send($paginatorRequest)->dto(); -``` - -### Use the full-text search -> You have to activate full-text search in your file cabinet before you can use this feature. -```php -$paginatorRequest = DocuWare::searchRequestBuilder() - ->fileCabinet($id) - ->fulltext('My secret document') - ->get(); - -$paginator = $connector->send($paginatorRequest)->dto(); -``` - -### Search documents which are created from the first of march. -```php -$paginatorRequest = DocuWare::searchRequestBuilder() - ->fileCabinet($id) - ->filterDate('DWSTOREDATETIME', '>=', Carbon::create(2021, 3, 1)) - ->get(); - -$paginator = $connector->send($paginatorRequest)->dto(); -``` - -### Search documents which are created until the first of april. -```php -$paginatorRequest = DocuWare::searchRequestBuilder() - ->fileCabinet($id) - ->filterDate('DWSTOREDATETIME', '<', Carbon::create(2021, 4, 1)) - ->get(); - -$paginator = $connector->send($paginatorRequest)->dto(); -``` - -### Order the results by field name. -> Supported values: 'asc', 'desc' -```php -$paginatorRequest = DocuWare::searchRequestBuilder() - ->fileCabinet($id) - ->orderBy('DWSTOREDATETIME', 'desc') - ->get(); - -$paginator = $connector->send($paginatorRequest)->dto(); -``` - -### Search documents filtered to the value. -> You can specify multiple filters. -```php -$paginatorRequest = DocuWare::searchRequestBuilder() - ->fileCabinet($id) - ->filter('TYPE', 'Order') - ->filter('OTHER_FIELD', 'other') - ->get(); - -$paginator = $connector->send($paginatorRequest)->dto(); -``` - -### Search documents filtered to multiple values. -```php -$paginatorRequest = DocuWare::searchRequestBuilder() - ->fileCabinet($id) - ->filterIn('TYPE', ['Order', 'Invoice']) - ->get(); - -$paginator = $connector->send($paginatorRequest)->dto(); -``` - -### You can specify the dialog which should be used. -```php -$dialogId = 'bb42c30a-89fc-4b81-9091-d7e326caba62'; - -$paginatorRequest = DocuWare::searchRequestBuilder() - ->fileCabinet($id) - ->dialog($dialogId) - ->get(); - -$paginator = $connector->send($paginatorRequest)->dto(); -``` - -### You can also combine everything. -```php -$paginatorRequest = DocuWare::searchRequestBuilder() - ->fileCabinet($id) - ->page(2) - ->perPage(30) - ->fulltext('My secret document') - ->filterDate('DWSTOREDATETIME', '>=', Carbon::create(2021, 3, 1)) - ->filterDate('DWSTOREDATETIME','<',Carbon::create(2021, 4, 1)) - ->filter('TYPE', 'Order') - ->filter('OTHER_FIELD', 'other') - ->orderBy('DWSTOREDATETIME', 'desc') - ->dialog($dialogId) - ->get(); - -$paginator = $connector->send($paginatorRequest)->dto(); -``` diff --git a/docs/File Cabinets/select_lists.md b/docs/File Cabinets/select_lists.md deleted file mode 100644 index 7be7749..0000000 --- a/docs/File Cabinets/select_lists.md +++ /dev/null @@ -1,15 +0,0 @@ -# General -| Request | Supported | -|----------------------------------------------|-----------| -| Get Select Lists & Get Filtered Select Lists | ✅ | - -### Get Select Lists -```php -use CodebarAg\DocuWare\Requests\FileCabinets\SelectLists\GetSelectLists; - -$types = $this->connector->send(new GetSelectLists( - $fileCabinetId, - $dialogId, - $fieldName, -))->dto(); -``` diff --git a/docs/File Cabinets/upload.md b/docs/File Cabinets/upload.md deleted file mode 100644 index 8570e05..0000000 --- a/docs/File Cabinets/upload.md +++ /dev/null @@ -1,114 +0,0 @@ -# General -| Request | Supported | -|-----------------------------------------------------|-----------| -| Create Data Record | ✅ | -| Append File(s) to a Data Record | ✅ | -| Upload a Single File for a Data Record | ❌ | -| Create a Data Record & Upload File | ❌ | -| Create Data Record & Upload File Using Store Dialog | ❌ | -| Append a Single PDF to a Document | ❌ | -| Replace a PDF Document Section | ❌ | - -### Create Data Record - -#### Create Data Record -```php -use CodebarAg\DocuWare\Requests\FileCabinets\Upload\CreateDataRecord; -use CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexTextDTO; - -$document = $connector->send(new CreateDataRecord( - $fileCabinetId, - null, - null, - collect([ - IndexTextDTO::make('DOCUMENT_LABEL', '::data-entry::'), - ]), -))->dto(); -``` - -#### Create Table Data Record -```php -use CodebarAg\DocuWare\Requests\FileCabinets\Upload\CreateDataRecord; -use CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexDateDTO; -use CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexDateTimeDTO; -use CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexDecimalDTO; -use CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexNumericDTO; -use CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexTableDTO; -use CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexTextDTO; - -$tableRows = collect([ - collect([ - IndexTextDTO::make('TEXT', 'project_1'), - IndexNumericDTO::make('INT', 1), - IndexDecimalDTO::make('DECIMAL', 1.1), - IndexDateDTO::make('DATE', $now), - IndexDateTimeDTO::make('DATETIME', $now), - ]), - collect([ - IndexTextDTO::make('TEXT', 'project_2'), - IndexNumericDTO::make('INT', 2), - IndexDecimalDTO::make('DECIMAL', 2.2), - IndexDateDTO::make('DATE', $now), - IndexDateTimeDTO::make('DATETIME', $now), - ]), -]); - - -$document = $connector->send(new CreateDataRecord( - $fileCabinetId, - null, - null, - collect([ - IndexTableDTO::make('TABLE_NAME', $tableRows) - ]), -))->dto(); -``` - -#### Append File(s) To A Data Record -```php -use CodebarAg\DocuWare\Requests\FileCabinets\Upload\AppendFilesToADataRecord; -use Saloon\Data\MultipartValue; - -$response = $connector->send( - new AppendFilesToADataRecord( - fileCabinetId: $fileCabinetId, - dataRecordId: $document->id, - files: collect([ - new MultipartValue( - name: 'File[]', - value: file_get_contents(__DIR__.'/../../../../Fixtures/files/test-2.pdf'), - filename: 'test-2.pdf', - ), - new MultipartValue( - name: 'File[]', - value: file_get_contents(__DIR__.'/../../../../Fixtures/files/test-3.pdf'), - filename: 'test-3.pdf', - ), - ]) - ) -)->dto(); -``` - -#### Append A Single PDF To A Document -```php -use CodebarAg\DocuWare\Requests\FileCabinets\Upload\AppendASinglePDFToADocument; - -$response = $this->connector->send(new AppendASinglePDFToADocument( - fileCabinetId: $fileCabinetId, - documentId: $document->id, - fileContent: file_get_contents(__DIR__.'/../../../../Fixtures/files/test-2.pdf'), - fileName: 'test-2.pdf', -))->dto(); -``` - -#### Replace A PDF Document Section -```php -use CodebarAg\DocuWare\Requests\FileCabinets\Upload\ReplaceAPDFDocumentSection; - -$response = $this->connector->send(new ReplaceAPDFDocumentSection( - fileCabinetId: $fileCabinetId, - sectionId: $documentWithSections->sections->first()->id, - fileContent: file_get_contents(__DIR__.'/../../../../Fixtures/files/test-3.pdf'), - fileName: 'test-3.pdf', -))->dto(); -``` diff --git a/docs/General/User Management/create-update_users.md b/docs/General/User Management/create-update_users.md deleted file mode 100644 index 082ca02..0000000 --- a/docs/General/User Management/create-update_users.md +++ /dev/null @@ -1,28 +0,0 @@ -# Create/Update Users - -| Request | Supported | -|-------------|-----------| -| Create User | ✅ | -| Update User | ✅ | - -### Create User -```php -use CodebarAg\DocuWare\Requests\General\UserManagement\CreateUpdateUsers\CreateUser; - -$user = $connector->send(new CreateUser(new User( - name: $timestamp.' - Test User', - dbName: $timestamp, - email: $timestamp.'-test@example.test', - password: 'TESTPASSWORD', -)))->dto(); -``` - -### Update User -```php -use CodebarAg\DocuWare\Requests\General\UserManagement\CreateUpdateUsers\UpdateUser; - -$user->name .= ' - Updated'; -$user->active = false; - -$user = $connector->send(new UpdateUser($user))->dto(); -``` diff --git a/docs/General/User Management/get-modify_groups.md b/docs/General/User Management/get-modify_groups.md deleted file mode 100644 index 6d1f108..0000000 --- a/docs/General/User Management/get-modify_groups.md +++ /dev/null @@ -1,42 +0,0 @@ -# Get/Modify Groups - -| Request | Supported | -|------------------------------------|-----------| -| Get Groups | ✅ | -| Get All Groups for a Specific User | ✅ | -| Add User to a Group | ✅ | -| Remove User from a Group | ✅ | - -### Get Groups -```php -use CodebarAg\DocuWare\Requests\General\UserManagement\GetModifyGroups\GetGroups; - -$groups = $connector->send(new GetGroups())->dto(); -``` - -### Get All Groups For A Specific User -```php -use CodebarAg\DocuWare\Requests\General\UserManagement\GetModifyGroups\GetAllGroupsForASpecificUser; - -$groups = $connector->send(new GetAllGroupsForASpecificUser($userId))->dto(); -``` - -### Add User To A Group -```php -use CodebarAg\DocuWare\Requests\General\UserManagement\GetModifyGroups\AddUserToAGroup; - -$response = $connector->send(new AddUserToAGroup( - userId: $userId, - ids: [$groupId], -))->dto(); -``` - -### Remove User From A Group -```php -use CodebarAg\DocuWare\Requests\General\UserManagement\GetModifyGroups\RemoveUserFromAGroup; - -$response = $connector->send(new RemoveUserFromAGroup( - userId: $userId, - ids: [$groupId], -))->dto(); -``` diff --git a/docs/General/User Management/get-modify_roles.md b/docs/General/User Management/get-modify_roles.md deleted file mode 100644 index 6802caf..0000000 --- a/docs/General/User Management/get-modify_roles.md +++ /dev/null @@ -1,42 +0,0 @@ -# Get/Modify Roles - -| Request | Supported | -|-----------------------------------|-----------| -| Get Roles | ✅ | -| Get All Roles for a Specific User | ✅ | -| Add User to a Role | ✅ | -| Remove User from a Role | ✅ | - -### Get Roles -```php -use CodebarAg\DocuWare\Requests\General\UserManagement\GetModifyRoles\GetRoles; - -$roles = $this->connector->send(new GetRoles())->dto(); -``` - -### Get All Roles For A Specific User -```php -use CodebarAg\DocuWare\Requests\General\UserManagement\GetModifyRoles\GetAllRolesForASpecificUser; - -$roles = $connector->send(new GetAllRolesForASpecificUser($userId))->dto(); -``` - -### Add User To A Role -```php -use CodebarAg\DocuWare\Requests\General\UserManagement\GetModifyRoles\AddUserToARole; - -$response = $connector->send(new AddUserToARole( - userId: $userId, - ids: [$roleId], -))->dto(); -``` - -### Remove User From A Role -```php -use CodebarAg\DocuWare\Requests\General\UserManagement\GetModifyRoles\RemoveUserFromARole; - -$response = $connector->send(new RemoveUserFromARole( - userId: $userId, - ids: [$roleId], -))->dto(); -``` diff --git a/docs/General/User Management/get_users.md b/docs/General/User Management/get_users.md deleted file mode 100644 index ba2771d..0000000 --- a/docs/General/User Management/get_users.md +++ /dev/null @@ -1,36 +0,0 @@ -# Get Users - -| Request | Supported | -|----------------------|-----------| -| Get Users | ✅ | -| Get Users by ID | ✅ | -| Get Users of a Role | ✅ | -| Get Users of a Group | ✅ | - -### Get Users -```php -use CodebarAg\DocuWare\Requests\General\UserManagement\GetUsers\GetUsers; - -$users = $this->connector->send(new GetUsers())->dto(); -``` - -### Get User By Id -```php -use CodebarAg\DocuWare\Requests\General\UserManagement\GetUsers\GetUserById; - -$user = $this->connector->send(new GetUserById($userId))->dto(); -``` - -### Get Users Of A Role -```php -use CodebarAg\DocuWare\Requests\General\UserManagement\GetUsers\GetUsersOfARole; - -$users = $this->connector->send(new GetUsersOfARole($roleId))->dto(); -``` - -### Get Users Of A Group -```php -use CodebarAg\DocuWare\Requests\General\UserManagement\GetUsers\GetUsersOfAGroup; - -$users = $this->connector->send(new GetUsersOfAGroup($groupId))->dto(); -``` diff --git a/docs/General/organization.md b/docs/General/organization.md deleted file mode 100644 index e4b11b9..0000000 --- a/docs/General/organization.md +++ /dev/null @@ -1,22 +0,0 @@ -# Organization - -| Request | Supported | -|-------------------------------------------------------------|-----------| -| Get Login Token | ✅ | -| Get Organization | ✅ | -| Get All File Cabinets and Document Trays | ✅ | - - -### Get Organization -```php -use CodebarAg\DocuWare\Requests\General\Organization\GetOrganization; - -$organizations = $this->connector->send(new GetOrganization())->dto(); -``` - -### Get All File Cabinets And Document Trays -```php -use CodebarAg\DocuWare\Requests\General\Organization\GetAllFileCabinetsAndDocumentTrays; - -$cabinetsAndTrays = $this->connector->send(new GetAllFileCabinetsAndDocumentTrays())->dto(); -``` diff --git a/docs/caching.md b/docs/caching.md deleted file mode 100644 index a40aca2..0000000 --- a/docs/caching.md +++ /dev/null @@ -1,39 +0,0 @@ -# Caching - -> All Get Requests are cachable and will be cached by default. To determine if the response is cached you can use the following method: - -### Is Cached -```php -$connector = new DocuWareConnector(); - -$response = $connector->send(new GetDocumentRequest($fileCabinetId, $documentId)); -$response->isCached(); // false - -// Next time the request is sent - -$response = $connector->send(new GetDocumentRequest($fileCabinetId, $documentId)); -$response->isCached(); // true -``` - - -### Invalidate Cache -> To invalidate the cache for a specific request you can use the following method: -```php -$connector = new DocuWareConnector(); - -$request = new GetDocumentRequest($fileCabinetId, $documentId); -$request->invalidateCache(); - -$response = $connector->send($request); -``` - -### Disable Caching -> To temporarily disable caching for a specific request you can use the following method: -```php -$connector = new DocuWareConnector(); - -$request = new GetDocumentRequest($fileCabinetId, $documentId); -$request->disableCaching(); - -$response = $connector->send($request); -``` diff --git a/docs/dto.md b/docs/dto.md deleted file mode 100644 index 49eb190..0000000 --- a/docs/dto.md +++ /dev/null @@ -1,177 +0,0 @@ -# DTO - -```php -CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexTextDTO { - +name: "FIELD_TEXT" // string - +value: "Value" // null|string -} -``` - -```php -CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexNumericDTO { - +name: "FIELD_NUMERIC" // string - +value: 1 // null|int -} -``` - -```php -CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexDecimalDTO { - +name: "FIELD_DECIMAL" // string - +value: 1.00 // null|int|float -} -``` - -```php -CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexDateDTO { - +name: "FIELD_DATE" // string - +value: now(), // null|Carbon -} -``` - -```php -CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexDateTimeDTO { - +name: "FIELD_DATETIME" // string - +value: now(), // null|Carbon -} -``` - -```php -CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexKeywordDTO { - +name: "FIELD_KEYWORD" // string - +value: "Value" // null|string -} -``` - -```php -CodebarAg\DocuWare\DTO\Documents\DocumentIndex\IndexMemoDTO { - +name: "FIELD_MEMO" // string - +value: "Value" // null|string -} -``` - -```php -CodebarAg\DocuWare\DTO\OrganizationIndex { - +id: "2f071481-095d-4363-abd9-29ef845a8b05" // string - +name: "Fake File Cabinet" // string - +guid: "1334c006-f095-4ae7-892b-fe59282c8bed" // string|null -} -``` - -```php -CodebarAg\DocuWare\DTO\Organization { - +id: "2f071481-095d-4363-abd9-29ef845a8b05" // string - +name: "Fake File Cabinet" // string - +guid: "1334c006-f095-4ae7-892b-fe59282c8bed" // string|null - +additionalInfo: [] // array - +configurationRights: [] // array -} -``` - -```php -CodebarAg\DocuWare\DTO\FileCabinet { - +id: "2f071481-095d-4363-abd9-29ef845a8b05" // string - +name: "Fake File Cabinet" // string - +color: "Yellow" // string - +isBasket: true // bool - +assignedCabinet: "889c13cc-c636-4759-a704-1e6500d2d70f" // string -} -``` - -```php -CodebarAg\DocuWare\DTO\Dialog { - +id: "fae3b667-53e9-48dd-9004-34647a26112e" // string - +type: "ResultList" // string - +label: "Fake Dialog" // string - +isDefault: true // boolean - +fileCabinetId: "1334c006-f095-4ae7-892b-fe59282c8bed" // string -} -``` - -```php -CodebarAg\DocuWare\DTO\Field { - +name: "FAKE_FIELD" // string - +label: "Fake Field" // string - +type: "Memo" // string - +scope: "User" // string -``` - -```php -CodebarAg\DocuWare\DTO\Field { - +name: "FAKE_FIELD" // string - +label: "Fake Field" // string - +type: "Memo" // string - +scope: "User" // string -``` - -```php -CodebarAg\DocuWare\DTO\Document { - +id: 659732 // integer - +file_size: 765336 // integer - +total_pages: 100 // integer - +title: "Fake Title" // string - +extension: ".pdf" // string - +content_type: "application/pdf" // string - +file_cabinet_id: "a233b03d-dc63-42dd-b774-25b3ff77548f" // string - +created_at: Illuminate\Support\Carbon // Carbon - +updated_at: Illuminate\Support\Carbon // Carbon - +fields: Illuminate\Support\Collection { // Collection|DocumentField[] - #items: array:2 [ - 0 => CodebarAg\DocuWare\DTO\DocumentField // DocumentField - 1 => CodebarAg\DocuWare\DTO\DocumentField // DocumentField - ] - } -} -``` - -```php -CodebarAg\DocuWare\DTO\Section {#23784▶ - +id: "5589-5525" - +contentType: "text/plain" - +haveMorePages: true - +pageCount: 1 - +fileSize: 32 - +originalFileName: "example.txt" - +contentModified: "/Date(1702395557000)/" - +annotationsPreview: false - +hasTextAnnotations: null -} -``` - -```php -CodebarAg\DocuWare\DTO\DocumentThumbnail { - +mime: "image/png" // string - +data: "somedata" // string - +base64: "data:image/png;base64,WXpJNWRGcFhVbWhrUjBVOQ==" // string -} -``` - -```php -CodebarAg\DocuWare\DTO\TableRow { - +fields: Illuminate\Support\Collection { // Collection|DocumentField[] - #items: array:2 [ - 0 => CodebarAg\DocuWare\DTO\DocumentField // DocumentField - 1 => CodebarAg\DocuWare\DTO\DocumentField // DocumentField - ] -} -``` - -```php -CodebarAg\DocuWare\DTO\DocumentPaginator - +total: 39 // integer - +per_page: 10 // integer - +current_page: 9 // integer - +last_page: 15 // integer - +from: 1 // integer - +to: 10 // integer - +documents: Illuminate\Support\Collection { // Collection|Document[] - #items: array:2 [ - 0 => CodebarAg\DocuWare\DTO\Document // Document - 1 => CodebarAg\DocuWare\DTO\Document // Document - ] - } - +error: CodebarAg\DocuWare\DTO\ErrorBag { // ErrorBag|null - +code: 422 // int - +message: "'000' is not valid cabinet id" // string - } -} -``` diff --git a/docs/encrypted_urls.md b/docs/encrypted_urls.md deleted file mode 100644 index 096fb32..0000000 --- a/docs/encrypted_urls.md +++ /dev/null @@ -1,36 +0,0 @@ -# Encrypted URLs - -```php -use CodebarAg\DocuWare\Facades\DocuWare; -``` - -### Make encrypted URL for a document in a file cabinet. -```php -$fileCabinetId = '87356f8d-e50c-450b-909c-4eaccd318fbf'; -$documentId = 42; - -$url = DocuWare::url() - ->fileCabinet($fileCabinetId) - ->document($documentId) - ->make(); -``` - -### Make encrypted URL for a document in a basket. -```php -$basketId = 'b_87356f8d-e50c-450b-909c-4eaccd318fbf'; - -$url = DocuWare::url() - ->basket($basketId) - ->document($documentId) - ->make(); -``` - -### Make encrypted URL valid for a specific amount of time. -> In the example below the URL is valid for one week, afterward the URL is no longer working. -```php -$url = DocuWare::url() - ->fileCabinet($fileCabinetId) - ->document($documentId) - ->validUntil(now()->addWeek()) - ->make(); -``` diff --git a/docs/exceptions.md b/docs/exceptions.md deleted file mode 100644 index faef3c0..0000000 --- a/docs/exceptions.md +++ /dev/null @@ -1,57 +0,0 @@ -# Exceptions - -- `CodebarAg\DocuWare\Exceptions\UnableToMakeRequest` - -This is thrown if you are not authorized to make the request. - ---- - -- `CodebarAg\DocuWare\Exceptions\UnableToProcessRequest` - -This is thrown if you passed wrong attributes. For example a file cabinet ID -which does not exist. - ---- - -- `CodebarAg\DocuWare\Exceptions\UnableToLogin` - -This exception can only be thrown during the login if the credentials did not -match. - ---- - -- `CodebarAg\DocuWare\Exceptions\UnableToLoginNoCookies` - -This exception can only be thrown during the login if there was no cookies in -the response from the api. - ---- - -- `CodebarAg\DocuWare\Exceptions\UnableToFindPassphrase` - -This exception can only be thrown during the url making if the passphrase -could not be found. - ---- - -- `CodebarAg\DocuWare\Exceptions\UnableToMakeUrl` - -Something is wrong during the URL making. - ---- - -- `CodebarAg\DocuWare\Exceptions\UnableToUpdateFields` - -No fields were supplied. - ---- - -- `CodebarAg\DocuWare\Exceptions\UnableToGetDocumentCount` - -Something is wrong with the response from getting the document count. - ---- - -- `Illuminate\Http\Client\RequestException` - -All other cases if the response is not successfully. diff --git a/docs/workflow.md b/docs/workflow.md deleted file mode 100644 index da58ef2..0000000 --- a/docs/workflow.md +++ /dev/null @@ -1,25 +0,0 @@ -# Workflow -| Request | Supported | -|-------------------------------------|-----------| -| Get Document Workflow History | ✅ | -| Get Document Workflow History Steps | ✅ | - -#### Get Document Workflow History -```php -use CodebarAg\DocuWare\Requests\Workflow\GetDocumentWorkflowHistory; - -$history = $this->connector->send(new GetDocumentWorkflowHistory( - $fileCabinetId, - $documentId -))->dto(); -``` - -#### Get Document Workflow History Steps -```php -use CodebarAg\DocuWare\Requests\Workflow\GetDocumentWorkflowHistorySteps; - -$historySteps = $this->connector->send(new GetDocumentWorkflowHistorySteps( - $workflowId, - $historyId, -))->dto(); -```