mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2025-03-21 21:27:27 +02:00
Преобразование OPI -> OInt (workflow)
This commit is contained in:
parent
747822f965
commit
8035dcfbcd
File diff suppressed because it is too large
Load Diff
@ -142,7 +142,7 @@ EndFunction
|
|||||||
|
|
||||||
#EndRegion
|
#EndRegion
|
||||||
|
|
||||||
#Region NewsFeed
|
#Region FeedPostsManagment
|
||||||
|
|
||||||
// Create post
|
// Create post
|
||||||
// Create a new post at news feed
|
// Create a new post at news feed
|
||||||
@ -354,7 +354,7 @@ EndFunction
|
|||||||
|
|
||||||
#EndRegion
|
#EndRegion
|
||||||
|
|
||||||
#Region Tasks
|
#Region TasksManagment
|
||||||
|
|
||||||
// Get task fields structure
|
// Get task fields structure
|
||||||
// Gets a structure with a description of the fields for creating a task
|
// Gets a structure with a description of the fields for creating a task
|
||||||
@ -814,7 +814,7 @@ EndFunction
|
|||||||
|
|
||||||
#EndRegion
|
#EndRegion
|
||||||
|
|
||||||
#Region Drive
|
#Region StoragesAndFilesManagment
|
||||||
|
|
||||||
// Get list of storages
|
// Get list of storages
|
||||||
// Get list of available files storages
|
// Get list of available files storages
|
||||||
@ -834,8 +834,8 @@ Function GetStoragesList(Val URL, Val Token = "") Export
|
|||||||
|
|
||||||
EndFunction
|
EndFunction
|
||||||
|
|
||||||
// Get list of storages, available for current app
|
// Get storage for application data
|
||||||
// Get a list of storages with which the application can work to store its data
|
// Get information about storage with which the application can work to store its data
|
||||||
//
|
//
|
||||||
// Parameters:
|
// Parameters:
|
||||||
// URL - String - URL of webhook or a Bitrix24 domain, when token used - url
|
// URL - String - URL of webhook or a Bitrix24 domain, when token used - url
|
||||||
@ -843,9 +843,9 @@ EndFunction
|
|||||||
//
|
//
|
||||||
// Returns:
|
// Returns:
|
||||||
// Map Of KeyAndValue - serialized JSON of answer from Bitrix24 API
|
// 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);
|
Response = OPI_Tools.Post(URL, Parameters);
|
||||||
|
|
||||||
Return Response;
|
Return Response;
|
||||||
@ -869,6 +869,30 @@ Function GetStorage(Val URL, Val StorageID, Val Token = "") Export
|
|||||||
|
|
||||||
EndFunction
|
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 child storage objects
|
||||||
// Get a list of files and folders, located at the root of the storage
|
// 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);
|
OPI_Tools.AddField("id" , StorageID, "String" , Parameters);
|
||||||
|
|
||||||
FileArray = NormalizeFiles(FileContent);
|
FileArray = NormalizeFiles(FileContent);
|
||||||
FileArray.Add(Name);
|
|
||||||
|
|
||||||
If Not FileArray.Count() = 0 Then
|
If Not FileArray.Count() = 0 Then
|
||||||
Parameters.Insert("fileContent", FileArray);
|
Parameters.Insert("fileContent", FileArray[0]);
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
Response = OPI_Tools.Post(URL, Parameters);
|
Response = OPI_Tools.Post(URL, Parameters);
|
||||||
|
@ -3343,7 +3343,8 @@ Procedure B24_WorkingWithDrive() Export
|
|||||||
OPI_TestDataRetrieval.ParameterToCollection("Picture2" , TestParameters);
|
OPI_TestDataRetrieval.ParameterToCollection("Picture2" , TestParameters);
|
||||||
|
|
||||||
Bitrix24_GetStoragesList(TestParameters);
|
Bitrix24_GetStoragesList(TestParameters);
|
||||||
Bitrix24_GetAppStoragesList(TestParameters);
|
Bitrix24_GetAppStorage(TestParameters);
|
||||||
|
Bitrix24_RenameStorage(TestParameters);
|
||||||
Bitrix24_GetStorage(TestParameters);
|
Bitrix24_GetStorage(TestParameters);
|
||||||
Bitrix24_UploadFileToStorage(TestParameters);
|
Bitrix24_UploadFileToStorage(TestParameters);
|
||||||
Bitrix24_GetStorageObjects(TestParameters);
|
Bitrix24_GetStorageObjects(TestParameters);
|
||||||
@ -6320,25 +6321,22 @@ Procedure Bitrix24_GetStoragesList(FunctionParameters)
|
|||||||
|
|
||||||
EndProcedure
|
EndProcedure
|
||||||
|
|
||||||
Procedure Bitrix24_GetAppStoragesList(FunctionParameters)
|
Procedure Bitrix24_GetAppStorage(FunctionParameters)
|
||||||
|
|
||||||
URL = FunctionParameters["Bitrix24_URL"];
|
|
||||||
Result = OPI_Bitrix24.GetAppStoragesList(URL);
|
|
||||||
|
|
||||||
OPI_TestDataRetrieval.WriteLog(Result, "GetAppStoragesList (wh)", "Bitrix24");
|
|
||||||
|
|
||||||
Check_BitrixStorage(Result); // SKIP
|
|
||||||
|
|
||||||
URL = FunctionParameters["Bitrix24_Domain"];
|
URL = FunctionParameters["Bitrix24_Domain"];
|
||||||
Token = FunctionParameters["Bitrix24_Token"];
|
Token = FunctionParameters["Bitrix24_Token"];
|
||||||
|
|
||||||
Result = OPI_Bitrix24.GetAppStoragesList(URL, Token);
|
Result = OPI_Bitrix24.GetAppSotrage(URL, Token);
|
||||||
|
|
||||||
// END
|
// END
|
||||||
|
|
||||||
OPI_TestDataRetrieval.WriteLog(Result, "GetAppStoragesList", "Bitrix24");
|
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
|
EndProcedure
|
||||||
|
|
||||||
@ -6514,6 +6512,23 @@ Procedure Bitrix24_GetStorageObjects(FunctionParameters)
|
|||||||
|
|
||||||
EndProcedure
|
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
|
||||||
|
|
||||||
#EndRegion
|
#EndRegion
|
||||||
|
@ -142,7 +142,7 @@ EndFunction
|
|||||||
|
|
||||||
#EndRegion
|
#EndRegion
|
||||||
|
|
||||||
#Region NewsFeed
|
#Region FeedPostsManagment
|
||||||
|
|
||||||
// Create post
|
// Create post
|
||||||
// Create a new post at news feed
|
// Create a new post at news feed
|
||||||
@ -354,7 +354,7 @@ EndFunction
|
|||||||
|
|
||||||
#EndRegion
|
#EndRegion
|
||||||
|
|
||||||
#Region Tasks
|
#Region TasksManagment
|
||||||
|
|
||||||
// Get task fields structure
|
// Get task fields structure
|
||||||
// Gets a structure with a description of the fields for creating a task
|
// Gets a structure with a description of the fields for creating a task
|
||||||
@ -814,7 +814,7 @@ EndFunction
|
|||||||
|
|
||||||
#EndRegion
|
#EndRegion
|
||||||
|
|
||||||
#Region Drive
|
#Region StoragesAndFilesManagment
|
||||||
|
|
||||||
// Get list of storages
|
// Get list of storages
|
||||||
// Get list of available files storages
|
// Get list of available files storages
|
||||||
@ -834,8 +834,8 @@ Function GetStoragesList(Val URL, Val Token = "") Export
|
|||||||
|
|
||||||
EndFunction
|
EndFunction
|
||||||
|
|
||||||
// Get list of storages, available for current app
|
// Get storage for application data
|
||||||
// Get a list of storages with which the application can work to store its data
|
// Get information about storage with which the application can work to store its data
|
||||||
//
|
//
|
||||||
// Parameters:
|
// Parameters:
|
||||||
// URL - String - URL of webhook or a Bitrix24 domain, when token used - url
|
// URL - String - URL of webhook or a Bitrix24 domain, when token used - url
|
||||||
@ -843,9 +843,9 @@ EndFunction
|
|||||||
//
|
//
|
||||||
// Returns:
|
// Returns:
|
||||||
// Map Of KeyAndValue - serialized JSON of answer from Bitrix24 API
|
// 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);
|
Response = OPI_Tools.Post(URL, Parameters);
|
||||||
|
|
||||||
Return Response;
|
Return Response;
|
||||||
@ -869,6 +869,30 @@ Function GetStorage(Val URL, Val StorageID, Val Token = "") Export
|
|||||||
|
|
||||||
EndFunction
|
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 child storage objects
|
||||||
// Get a list of files and folders, located at the root of the storage
|
// 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);
|
OPI_Tools.AddField("id" , StorageID, "String" , Parameters);
|
||||||
|
|
||||||
FileArray = NormalizeFiles(FileContent);
|
FileArray = NormalizeFiles(FileContent);
|
||||||
FileArray.Add(Name);
|
|
||||||
|
|
||||||
If Not FileArray.Count() = 0 Then
|
If Not FileArray.Count() = 0 Then
|
||||||
Parameters.Insert("fileContent", FileArray);
|
Parameters.Insert("fileContent", FileArray[0]);
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
Response = OPI_Tools.Post(URL, Parameters);
|
Response = OPI_Tools.Post(URL, Parameters);
|
||||||
|
@ -3343,7 +3343,8 @@ Procedure B24_WorkingWithDrive() Export
|
|||||||
OPI_TestDataRetrieval.ParameterToCollection("Picture2" , TestParameters);
|
OPI_TestDataRetrieval.ParameterToCollection("Picture2" , TestParameters);
|
||||||
|
|
||||||
Bitrix24_GetStoragesList(TestParameters);
|
Bitrix24_GetStoragesList(TestParameters);
|
||||||
Bitrix24_GetAppStoragesList(TestParameters);
|
Bitrix24_GetAppStorage(TestParameters);
|
||||||
|
Bitrix24_RenameStorage(TestParameters);
|
||||||
Bitrix24_GetStorage(TestParameters);
|
Bitrix24_GetStorage(TestParameters);
|
||||||
Bitrix24_UploadFileToStorage(TestParameters);
|
Bitrix24_UploadFileToStorage(TestParameters);
|
||||||
Bitrix24_GetStorageObjects(TestParameters);
|
Bitrix24_GetStorageObjects(TestParameters);
|
||||||
@ -6320,25 +6321,22 @@ Procedure Bitrix24_GetStoragesList(FunctionParameters)
|
|||||||
|
|
||||||
EndProcedure
|
EndProcedure
|
||||||
|
|
||||||
Procedure Bitrix24_GetAppStoragesList(FunctionParameters)
|
Procedure Bitrix24_GetAppStorage(FunctionParameters)
|
||||||
|
|
||||||
URL = FunctionParameters["Bitrix24_URL"];
|
|
||||||
Result = OPI_Bitrix24.GetAppStoragesList(URL);
|
|
||||||
|
|
||||||
// !OInt OPI_TestDataRetrieval.WriteLog(Result, "GetAppStoragesList (wh)", "Bitrix24");
|
|
||||||
|
|
||||||
Check_BitrixStorage(Result); // SKIP
|
|
||||||
|
|
||||||
URL = FunctionParameters["Bitrix24_Domain"];
|
URL = FunctionParameters["Bitrix24_Domain"];
|
||||||
Token = FunctionParameters["Bitrix24_Token"];
|
Token = FunctionParameters["Bitrix24_Token"];
|
||||||
|
|
||||||
Result = OPI_Bitrix24.GetAppStoragesList(URL, Token);
|
Result = OPI_Bitrix24.GetAppSotrage(URL, Token);
|
||||||
|
|
||||||
// END
|
// END
|
||||||
|
|
||||||
// !OInt OPI_TestDataRetrieval.WriteLog(Result, "GetAppStoragesList", "Bitrix24");
|
// !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
|
EndProcedure
|
||||||
|
|
||||||
@ -6514,6 +6512,23 @@ Procedure Bitrix24_GetStorageObjects(FunctionParameters)
|
|||||||
|
|
||||||
EndProcedure
|
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
|
||||||
|
|
||||||
#EndRegion
|
#EndRegion
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,21 +1,21 @@
|
|||||||
<package-def>
|
<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_Airtable" file="core/Modules/OPI_Airtable.os"/>
|
||||||
<module name="OPI_Bitrix24" file="core/Modules/OPI_Bitrix24.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_GoogleSheets" file="core/Modules/OPI_GoogleSheets.os"/>
|
||||||
<module name="OPI_GoogleWorkspace" file="core/Modules/OPI_GoogleWorkspace.os"/>
|
<module name="OPI_ПреобразованиеТипов" file="tools/Modules/OPI_ПреобразованиеТипов.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_Twitter" file="core/Modules/OPI_Twitter.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_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_YandexDisk" file="core/Modules/OPI_YandexDisk.os"/>
|
||||||
<module name="OPI_YandexID" file="core/Modules/OPI_YandexID.os"/>
|
<module name="OPI_YandexID" file="core/Modules/OPI_YandexID.os"/>
|
||||||
<module name="OPI_Инструменты" file="tools/Modules/internal/Modules/OPI_Инструменты.os"/>
|
<module name="OPI_GoogleWorkspace" file="core/Modules/OPI_GoogleWorkspace.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"/>
|
|
||||||
</package-def>
|
</package-def>
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user