1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-02-03 13:22:19 +02:00

Преобразование OPI -> OInt (workflow)

This commit is contained in:
Vitaly the Alpaca 2024-06-20 07:27:31 +00:00 committed by Vitaly the Alpaca (bot)
parent 1221e833ed
commit 37a5cf42f5
8 changed files with 4013 additions and 3855 deletions

File diff suppressed because it is too large Load Diff

View File

@ -142,7 +142,7 @@ EndFunction
#EndRegion
#Region NewsFeed
#Region FeedPostsManagment
// Create post
// Create a new post at news feed
@ -354,7 +354,7 @@ EndFunction
#EndRegion
#Region Tasks
#Region TasksManagment
// Get task fields structure
// Gets a structure with a description of the fields for creating a task
@ -814,7 +814,7 @@ EndFunction
#EndRegion
#Region Drive
#Region StoragesAndFilesManagment
// Get list of storages
// Get list of available files storages
@ -834,8 +834,8 @@ Function GetStoragesList(Val URL, Val Token = "") Export
EndFunction
// Get list of storages, available for current app
// Get a list of storages with which the application can work to store its data
// Get storage for application data
// Get information about storage with which the application can work to store its data
//
// Parameters:
// URL - String - URL of webhook or a Bitrix24 domain, when token used - url
@ -843,9 +843,9 @@ EndFunction
//
// Returns:
// Map Of KeyAndValue - serialized JSON of answer from Bitrix24 API
Function GetAppStoragesList(Val URL, Val Token = "") Export
Function GetAppSotrage(Val URL, Val Token = "") Export
Parameters = NormalizeAuth(URL, Token, "disk.storage.getlist");
Parameters = NormalizeAuth(URL, Token, "disk.storage.getforapp");
Response = OPI_Tools.Post(URL, Parameters);
Return Response;
@ -869,6 +869,30 @@ Function GetStorage(Val URL, Val StorageID, Val Token = "") Export
EndFunction
// Rename storage
// Change storage name (for app storage only, see. GetAppStorage)
//
// Parameters:
// URL - String - URL of webhook or a Bitrix24 domain, when token used - url
// StorageID - String, Number - Storage ID - storageid
// Name - String - New storage name - title
// Token - String - Access token, when not-webhook method used - token
//
// Returns:
// HTTPResponse - Rename storage
Function RenameStorage(Val URL, Val StorageID, Val Name, Val Token = "") Export
Parameters = NormalizeAuth(URL, Token, "disk.storage.rename");
OPI_Tools.AddField("id" , StorageID , "String", Parameters);
OPI_Tools.AddField("newName", Name, "String", Parameters);
Response = OPI_Tools.Post(URL, Parameters);
Return Response;
EndFunction
// Get a list of child storage objects
// Get a list of files and folders, located at the root of the storage
//
@ -921,10 +945,9 @@ Function UploadFileToStorage(Val URL
OPI_Tools.AddField("id" , StorageID, "String" , Parameters);
FileArray = NormalizeFiles(FileContent);
FileArray.Add(Name);
If Not FileArray.Count() = 0 Then
Parameters.Insert("fileContent", FileArray);
Parameters.Insert("fileContent", FileArray[0]);
EndIf;
Response = OPI_Tools.Post(URL, Parameters);

View File

@ -3343,7 +3343,8 @@ Procedure B24_WorkingWithDrive() Export
OPI_TestDataRetrieval.ParameterToCollection("Picture2" , TestParameters);
Bitrix24_GetStoragesList(TestParameters);
Bitrix24_GetAppStoragesList(TestParameters);
Bitrix24_GetAppStorage(TestParameters);
Bitrix24_RenameStorage(TestParameters);
Bitrix24_GetStorage(TestParameters);
Bitrix24_UploadFileToStorage(TestParameters);
Bitrix24_GetStorageObjects(TestParameters);
@ -6320,25 +6321,22 @@ Procedure Bitrix24_GetStoragesList(FunctionParameters)
EndProcedure
Procedure Bitrix24_GetAppStoragesList(FunctionParameters)
URL = FunctionParameters["Bitrix24_URL"];
Result = OPI_Bitrix24.GetAppStoragesList(URL);
OPI_TestDataRetrieval.WriteLog(Result, "GetAppStoragesList (wh)", "Bitrix24");
Check_BitrixStorage(Result); // SKIP
Procedure Bitrix24_GetAppStorage(FunctionParameters)
URL = FunctionParameters["Bitrix24_Domain"];
Token = FunctionParameters["Bitrix24_Token"];
Result = OPI_Bitrix24.GetAppStoragesList(URL, Token);
Result = OPI_Bitrix24.GetAppSotrage(URL, Token);
// END
OPI_TestDataRetrieval.WriteLog(Result, "GetAppStoragesList", "Bitrix24");
Check_BitrixStorage(Result);
Check_BitrixFile(Result);
StorageID = Result["result"]["ID"]; // SKIP
OPI_TestDataRetrieval.WriteParameter("Bitrix24_StorageID", StorageID); // SKIP
FunctionParameters.Insert("Bitrix24_StorageID", StorageID); // SKIP
EndProcedure
@ -6514,6 +6512,23 @@ Procedure Bitrix24_GetStorageObjects(FunctionParameters)
EndProcedure
Procedure Bitrix24_RenameStorage(FunctionParameters)
Name = "New storage name";
URL = FunctionParameters["Bitrix24_Domain"];
Token = FunctionParameters["Bitrix24_Token"];
StorageID = FunctionParameters["Bitrix24_StorageID"];
Result = OPI_Bitrix24.RenameStorage(URL, StorageID, Name, Token);
// END
OPI_TestDataRetrieval.WriteLog(Result, "RenameStorage", "Bitrix24");
Check_BitrixFile(Result);
EndProcedure
#EndRegion
#EndRegion

View File

@ -142,7 +142,7 @@ EndFunction
#EndRegion
#Region NewsFeed
#Region FeedPostsManagment
// Create post
// Create a new post at news feed
@ -354,7 +354,7 @@ EndFunction
#EndRegion
#Region Tasks
#Region TasksManagment
// Get task fields structure
// Gets a structure with a description of the fields for creating a task
@ -814,7 +814,7 @@ EndFunction
#EndRegion
#Region Drive
#Region StoragesAndFilesManagment
// Get list of storages
// Get list of available files storages
@ -834,8 +834,8 @@ Function GetStoragesList(Val URL, Val Token = "") Export
EndFunction
// Get list of storages, available for current app
// Get a list of storages with which the application can work to store its data
// Get storage for application data
// Get information about storage with which the application can work to store its data
//
// Parameters:
// URL - String - URL of webhook or a Bitrix24 domain, when token used - url
@ -843,9 +843,9 @@ EndFunction
//
// Returns:
// Map Of KeyAndValue - serialized JSON of answer from Bitrix24 API
Function GetAppStoragesList(Val URL, Val Token = "") Export
Function GetAppSotrage(Val URL, Val Token = "") Export
Parameters = NormalizeAuth(URL, Token, "disk.storage.getlist");
Parameters = NormalizeAuth(URL, Token, "disk.storage.getforapp");
Response = OPI_Tools.Post(URL, Parameters);
Return Response;
@ -869,6 +869,30 @@ Function GetStorage(Val URL, Val StorageID, Val Token = "") Export
EndFunction
// Rename storage
// Change storage name (for app storage only, see. GetAppStorage)
//
// Parameters:
// URL - String - URL of webhook or a Bitrix24 domain, when token used - url
// StorageID - String, Number - Storage ID - storageid
// Name - String - New storage name - title
// Token - String - Access token, when not-webhook method used - token
//
// Returns:
// HTTPResponse - Rename storage
Function RenameStorage(Val URL, Val StorageID, Val Name, Val Token = "") Export
Parameters = NormalizeAuth(URL, Token, "disk.storage.rename");
OPI_Tools.AddField("id" , StorageID , "String", Parameters);
OPI_Tools.AddField("newName", Name, "String", Parameters);
Response = OPI_Tools.Post(URL, Parameters);
Return Response;
EndFunction
// Get a list of child storage objects
// Get a list of files and folders, located at the root of the storage
//
@ -921,10 +945,9 @@ Function UploadFileToStorage(Val URL
OPI_Tools.AddField("id" , StorageID, "String" , Parameters);
FileArray = NormalizeFiles(FileContent);
FileArray.Add(Name);
If Not FileArray.Count() = 0 Then
Parameters.Insert("fileContent", FileArray);
Parameters.Insert("fileContent", FileArray[0]);
EndIf;
Response = OPI_Tools.Post(URL, Parameters);

View File

@ -3343,7 +3343,8 @@ Procedure B24_WorkingWithDrive() Export
OPI_TestDataRetrieval.ParameterToCollection("Picture2" , TestParameters);
Bitrix24_GetStoragesList(TestParameters);
Bitrix24_GetAppStoragesList(TestParameters);
Bitrix24_GetAppStorage(TestParameters);
Bitrix24_RenameStorage(TestParameters);
Bitrix24_GetStorage(TestParameters);
Bitrix24_UploadFileToStorage(TestParameters);
Bitrix24_GetStorageObjects(TestParameters);
@ -6320,25 +6321,22 @@ Procedure Bitrix24_GetStoragesList(FunctionParameters)
EndProcedure
Procedure Bitrix24_GetAppStoragesList(FunctionParameters)
URL = FunctionParameters["Bitrix24_URL"];
Result = OPI_Bitrix24.GetAppStoragesList(URL);
// !OInt OPI_TestDataRetrieval.WriteLog(Result, "GetAppStoragesList (wh)", "Bitrix24");
Check_BitrixStorage(Result); // SKIP
Procedure Bitrix24_GetAppStorage(FunctionParameters)
URL = FunctionParameters["Bitrix24_Domain"];
Token = FunctionParameters["Bitrix24_Token"];
Result = OPI_Bitrix24.GetAppStoragesList(URL, Token);
Result = OPI_Bitrix24.GetAppSotrage(URL, Token);
// END
// !OInt OPI_TestDataRetrieval.WriteLog(Result, "GetAppStoragesList", "Bitrix24");
Check_BitrixStorage(Result);
Check_BitrixFile(Result);
StorageID = Result["result"]["ID"]; // SKIP
OPI_TestDataRetrieval.WriteParameter("Bitrix24_StorageID", StorageID); // SKIP
FunctionParameters.Insert("Bitrix24_StorageID", StorageID); // SKIP
EndProcedure
@ -6514,6 +6512,23 @@ Procedure Bitrix24_GetStorageObjects(FunctionParameters)
EndProcedure
Procedure Bitrix24_RenameStorage(FunctionParameters)
Name = "New storage name";
URL = FunctionParameters["Bitrix24_Domain"];
Token = FunctionParameters["Bitrix24_Token"];
StorageID = FunctionParameters["Bitrix24_StorageID"];
Result = OPI_Bitrix24.RenameStorage(URL, StorageID, Name, Token);
// END
// !OInt OPI_TestDataRetrieval.WriteLog(Result, "RenameStorage", "Bitrix24");
Check_BitrixFile(Result);
EndProcedure
#EndRegion
#EndRegion

File diff suppressed because it is too large Load Diff

View File

@ -1,21 +1,21 @@
<package-def>
<module name="OPI_Криптография" file="tools/Modules/internal/Modules/OPI_Криптография.os"/>
<module name="OPI_Notion" file="core/Modules/OPI_Notion.os"/>
<module name="OPI_GoogleCalendar" file="core/Modules/OPI_GoogleCalendar.os"/>
<module name="OPI_ПолучениеДанныхТестов" file="tools/Modules/OPI_ПолучениеДанныхТестов.os"/>
<module name="OPI_Slack" file="core/Modules/OPI_Slack.os"/>
<module name="OPI_Dropbox" file="core/Modules/OPI_Dropbox.os"/>
<module name="OPI_GoogleDrive" file="core/Modules/OPI_GoogleDrive.os"/>
<module name="OPI_VK" file="core/Modules/OPI_VK.os"/>
<module name="OPI_Telegram" file="core/Modules/OPI_Telegram.os"/>
<module name="OPI_Airtable" file="core/Modules/OPI_Airtable.os"/>
<module name="OPI_Bitrix24" file="core/Modules/OPI_Bitrix24.os"/>
<module name="OPI_Dropbox" file="core/Modules/OPI_Dropbox.os"/>
<module name="OPI_GoogleCalendar" file="core/Modules/OPI_GoogleCalendar.os"/>
<module name="OPI_GoogleDrive" file="core/Modules/OPI_GoogleDrive.os"/>
<module name="OPI_GoogleSheets" file="core/Modules/OPI_GoogleSheets.os"/>
<module name="OPI_GoogleWorkspace" file="core/Modules/OPI_GoogleWorkspace.os"/>
<module name="OPI_Notion" file="core/Modules/OPI_Notion.os"/>
<module name="OPI_Slack" file="core/Modules/OPI_Slack.os"/>
<module name="OPI_Telegram" file="core/Modules/OPI_Telegram.os"/>
<module name="OPI_ПреобразованиеТипов" file="tools/Modules/OPI_ПреобразованиеТипов.os"/>
<module name="OPI_Twitter" file="core/Modules/OPI_Twitter.os"/>
<module name="OPI_Инструменты" file="tools/Modules/internal/Modules/OPI_Инструменты.os"/>
<module name="OPI_Viber" file="core/Modules/OPI_Viber.os"/>
<module name="OPI_VK" file="core/Modules/OPI_VK.os"/>
<module name="OPI_YandexDisk" file="core/Modules/OPI_YandexDisk.os"/>
<module name="OPI_YandexID" file="core/Modules/OPI_YandexID.os"/>
<module name="OPI_Инструменты" file="tools/Modules/internal/Modules/OPI_Инструменты.os"/>
<module name="OPI_Криптография" file="tools/Modules/internal/Modules/OPI_Криптография.os"/>
<module name="OPI_ПолучениеДанныхТестов" file="tools/Modules/OPI_ПолучениеДанныхТестов.os"/>
<module name="OPI_ПреобразованиеТипов" file="tools/Modules/OPI_ПреобразованиеТипов.os"/>
<module name="OPI_GoogleWorkspace" file="core/Modules/OPI_GoogleWorkspace.os"/>
</package-def>

File diff suppressed because it is too large Load Diff