mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2025-03-19 21:17:55 +02:00
Main build (Jenkins)
This commit is contained in:
parent
2e2bc21b7d
commit
d0dbe14e00
4
.github/workflows/oint_test_full_ru.yml
vendored
4
.github/workflows/oint_test_full_ru.yml
vendored
@ -1490,6 +1490,10 @@ jobs:
|
||||
if: ${{ cancelled() }} == false
|
||||
run: oscript /home/runner/.local/share/ovm/current/lib/1testrunner/src/main.os -run ./src/ru/OInt/tests/Modules/internal/OPI_ТестыCLI.os "CLI_GAPI_Аккаунт"
|
||||
|
||||
- name: Отправка сообщений
|
||||
if: ${{ cancelled() }} == false
|
||||
run: oscript /home/runner/.local/share/ovm/current/lib/1testrunner/src/main.os -run ./src/ru/OInt/tests/Modules/internal/OPI_ТестыCLI.os "CLI_GAPI_ОтправкаСообщений"
|
||||
|
||||
- name: Записать логи
|
||||
if: ${{ cancelled() }} == false
|
||||
uses: actions/cache/save@v3
|
||||
|
4
ci/cli_ostestru
vendored
4
ci/cli_ostestru
vendored
@ -721,6 +721,10 @@ pipeline {
|
||||
powershell encoding: 'UTF-8', script:'1testrunner -run "./src/ru/OInt/tests/Modules/internal/OPI_ТестыCLI.os" "CLI_GAPI_Аккаунт"'
|
||||
}
|
||||
|
||||
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
|
||||
powershell encoding: 'UTF-8', script:'1testrunner -run "./src/ru/OInt/tests/Modules/internal/OPI_ТестыCLI.os" "CLI_GAPI_ОтправкаСообщений"'
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
8
ci/clitesten
vendored
8
ci/clitesten
vendored
@ -1513,6 +1513,14 @@ def test_greenapi(){
|
||||
powershell encoding: 'UTF-8', script:'./oint.exe greenapi SetGroupPicture --access "test" --group "test" --picture "test" --debug --test '
|
||||
}
|
||||
|
||||
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
|
||||
powershell encoding: 'UTF-8', script:'./oint.exe greenapi SendTextMessage --access "test" --chat "test" --text "test" --quoted "test" --debug --test '
|
||||
}
|
||||
|
||||
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
|
||||
powershell encoding: 'UTF-8', script:'./oint.exe greenapi SendFile --access "test" --chat "test" --file "test" --filename "test" --caption "test" --quoted "test" --debug --test '
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
8
ci/clitestru
vendored
8
ci/clitestru
vendored
@ -1513,6 +1513,14 @@ def test_greenapi(){
|
||||
powershell encoding: 'UTF-8', script:'./oint.exe greenapi УстановитьКартинкуГруппы --access "test" --group "test" --picture "test" --debug --test '
|
||||
}
|
||||
|
||||
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
|
||||
powershell encoding: 'UTF-8', script:'./oint.exe greenapi ОтправитьТекстовоеСообщение --access "test" --chat "test" --text "test" --quoted "test" --debug --test '
|
||||
}
|
||||
|
||||
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
|
||||
powershell encoding: 'UTF-8', script:'./oint.exe greenapi ОтправитьФайл --access "test" --chat "test" --file "test" --filename "test" --caption "test" --quoted "test" --debug --test '
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
4
ci/ostestru
vendored
4
ci/ostestru
vendored
@ -721,6 +721,10 @@ pipeline {
|
||||
powershell encoding: 'UTF-8', script:'1testrunner -run "./src/ru/OInt/tests/Modules/internal/OPI_Тесты.os" "GAPI_Аккаунт"'
|
||||
}
|
||||
|
||||
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
|
||||
powershell encoding: 'UTF-8', script:'1testrunner -run "./src/ru/OInt/tests/Modules/internal/OPI_Тесты.os" "GAPI_ОтправкаСообщений"'
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
8
docs/en/data/GreenAPI/SendFile.json
vendored
Normal file
8
docs/en/data/GreenAPI/SendFile.json
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"ApiUrl": "https://7105.api.greenapi.com",
|
||||
"MediaUrl": "https://7105.media.greenapi.com",
|
||||
"IdInstance": "71051...",
|
||||
"ApiTokenInstance": "425010d90e114aa6b78f0969e...",
|
||||
"File": "https://api.athenaeum.digital/test_data/picture.jpg",
|
||||
"ChatID": "120363410406221140@g.us"
|
||||
}
|
7
docs/en/data/GreenAPI/SendTextMessage.json
vendored
Normal file
7
docs/en/data/GreenAPI/SendTextMessage.json
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"ApiUrl": "https://7105.api.greenapi.com",
|
||||
"MediaUrl": "https://7105.media.greenapi.com",
|
||||
"IdInstance": "71051...",
|
||||
"ApiTokenInstance": "425010d90e114aa6b78f0969e...",
|
||||
"ChatID": "120363410406221140@g.us"
|
||||
}
|
@ -6,8 +6,8 @@
|
||||
File = "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/document.docx";
|
||||
|
||||
Attachments = New Array;
|
||||
Attachments.Add(OPI_Bitrix24.GetPictureBlock("Image1" , Image));
|
||||
Attachments.Add(OPI_Bitrix24.GetFileBlock("File1.docx", File));
|
||||
Attachments.Add(OPI_Bitrix24.GetPictureBlock("Image1" , Image));
|
||||
Attachments.Add(OPI_Bitrix24.GetFileBlock("File1.docx" , File));
|
||||
|
||||
Result = OPI_Bitrix24.CreatePersonalNotification(URL, UserID, Text, , Attachments);
|
||||
|
||||
|
@ -6,8 +6,8 @@
|
||||
File = "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/document.docx";
|
||||
|
||||
Attachments = New Array;
|
||||
Attachments.Add(OPI_Bitrix24.GetPictureBlock("Image1" , Image));
|
||||
Attachments.Add(OPI_Bitrix24.GetFileBlock("File1.docx", File));
|
||||
Attachments.Add(OPI_Bitrix24.GetPictureBlock("Image1" , Image));
|
||||
Attachments.Add(OPI_Bitrix24.GetFileBlock("File1.docx" , File));
|
||||
|
||||
Result = OPI_Bitrix24.CreateSystemNotification(URL, UserID, Text, , Attachments);
|
||||
|
||||
|
4
docs/en/examples/Bitrix24/EditMessage.txt
vendored
4
docs/en/examples/Bitrix24/EditMessage.txt
vendored
@ -13,7 +13,7 @@
|
||||
File = "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/document.docx";
|
||||
|
||||
Attachments = New Array;
|
||||
Attachments.Add(OPI_Bitrix24.GetPictureBlock("Image1" , Image));
|
||||
Attachments.Add(OPI_Bitrix24.GetFileBlock("File1.docx", File));
|
||||
Attachments.Add(OPI_Bitrix24.GetPictureBlock("Image1" , Image));
|
||||
Attachments.Add(OPI_Bitrix24.GetFileBlock("File1.docx" , File));
|
||||
|
||||
Result = OPI_Bitrix24.EditMessage(URL, MessageID, Text, Attachments, Token);
|
||||
|
4
docs/en/examples/Bitrix24/SendMessage.txt
vendored
4
docs/en/examples/Bitrix24/SendMessage.txt
vendored
@ -5,8 +5,8 @@
|
||||
File = "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/document.docx";
|
||||
|
||||
Attachments = New Array;
|
||||
Attachments.Add(OPI_Bitrix24.GetPictureBlock("Image1" , Image));
|
||||
Attachments.Add(OPI_Bitrix24.GetFileBlock("File1.docx", File));
|
||||
Attachments.Add(OPI_Bitrix24.GetPictureBlock("Image1" , Image));
|
||||
Attachments.Add(OPI_Bitrix24.GetFileBlock("File1.docx" , File));
|
||||
|
||||
Result = OPI_Bitrix24.SendMessage(URL, ChatID, Text, Attachments);
|
||||
|
||||
|
2
docs/en/examples/GreenAPI/AddGroupMember.txt
vendored
2
docs/en/examples/GreenAPI/AddGroupMember.txt
vendored
@ -3,7 +3,7 @@
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
GroupID = "120363410798027942@g.us";
|
||||
GroupID = "120363413395724670@g.us";
|
||||
UserID = "123123123@c.us";
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
|
@ -3,7 +3,7 @@
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
GroupID = "120363410798027942@g.us";
|
||||
GroupID = "120363413395724670@g.us";
|
||||
UserID = "123123123@c.us";
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
|
@ -3,7 +3,7 @@
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
GroupID = "120363410798027942@g.us";
|
||||
GroupID = "120363413395724670@g.us";
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Result = OPI_GreenAPI.GetGroupInformation(AccessParameters, GroupID);
|
||||
|
2
docs/en/examples/GreenAPI/LeaveGroup.txt
vendored
2
docs/en/examples/GreenAPI/LeaveGroup.txt
vendored
@ -3,7 +3,7 @@
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
GroupID = "120363410798027942@g.us";
|
||||
GroupID = "120363413395724670@g.us";
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Result = OPI_GreenAPI.LeaveGroup(AccessParameters, GroupID);
|
||||
|
@ -3,7 +3,7 @@
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
GroupID = "120363410798027942@g.us";
|
||||
GroupID = "120363413395724670@g.us";
|
||||
UserID = "123123123@c.us";
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
|
12
docs/en/examples/GreenAPI/SendFile.txt
vendored
Normal file
12
docs/en/examples/GreenAPI/SendFile.txt
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
ApiUrl = "https://7105.api.greenapi.com";
|
||||
MediaUrl = "https://7105.media.greenapi.com";
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
File = "https://api.athenaeum.digital/test_data/picture.jpg"; // URL, Path or Binary Data
|
||||
FileName = "photo.jpg";
|
||||
ChatID = "120363410406221140@g.us";
|
||||
Description = "File description";
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Result = OPI_GreenAPI.SendFile(AccessParameters, ChatID, File, FileName, Description);
|
10
docs/en/examples/GreenAPI/SendTextMessage.txt
vendored
Normal file
10
docs/en/examples/GreenAPI/SendTextMessage.txt
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
ApiUrl = "https://7105.api.greenapi.com";
|
||||
MediaUrl = "https://7105.media.greenapi.com";
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
ChatID = "120363410406221140@g.us";
|
||||
Text = "New message";
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Result = OPI_GreenAPI.SendTextMessage(AccessParameters, ChatID, Text);
|
2
docs/en/examples/GreenAPI/SetAdminRights.txt
vendored
2
docs/en/examples/GreenAPI/SetAdminRights.txt
vendored
@ -3,7 +3,7 @@
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
GroupID = "120363410798027942@g.us";
|
||||
GroupID = "120363413395724670@g.us";
|
||||
UserID = "123123123@c.us";
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
|
@ -3,8 +3,8 @@
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
Image = "https://api.athenaeum.digital/test_data/picture.jpg";
|
||||
GroupID = "120363410798027942@g.us";
|
||||
Image = "https://api.athenaeum.digital/test_data/picture.jpg"; // URL, Path or Binary Data
|
||||
GroupID = "120363413395724670@g.us";
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Result = OPI_GreenAPI.SetGroupPicture(AccessParameters, GroupID, Image);
|
||||
|
@ -3,7 +3,7 @@
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
Image = "https://api.athenaeum.digital/test_data/picture.jpg";
|
||||
Image = "https://api.athenaeum.digital/test_data/picture.jpg"; // URL, Path or Binary Data
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Result = OPI_GreenAPI.SetProfilePicture(AccessParameters, Image);
|
||||
|
@ -3,7 +3,7 @@
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
GroupID = "120363410798027942@g.us";
|
||||
GroupID = "120363413395724670@g.us";
|
||||
Name = "New name";
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
|
6
docs/en/examples/Notion/CreateDatabase.txt
vendored
6
docs/en/examples/Notion/CreateDatabase.txt
vendored
@ -16,9 +16,9 @@
|
||||
Properties.Insert("User" , "people");
|
||||
|
||||
ValueSelection = New Map;
|
||||
ValueSelection.Insert("New" , "green");
|
||||
ValueSelection.Insert("InProgress", "yellow");
|
||||
ValueSelection.Insert("Remote" , "red");
|
||||
ValueSelection.Insert("New" , "green");
|
||||
ValueSelection.Insert("InProgress" , "yellow");
|
||||
ValueSelection.Insert("Remote" , "red");
|
||||
|
||||
Properties.Insert("Status", ValueSelection);
|
||||
|
||||
|
30
docs/en/examples/VK/AddProduct.txt
vendored
30
docs/en/examples/VK/AddProduct.txt
vendored
@ -9,20 +9,20 @@
|
||||
ImageArray.Add(Image2);
|
||||
|
||||
ProductDescription = New Map;
|
||||
ProductDescription.Insert("Name" , "TestProduct");
|
||||
ProductDescription.Insert("Description" , "Product description");
|
||||
ProductDescription.Insert("Category" , "20173");
|
||||
ProductDescription.Insert("Price" , 1);
|
||||
ProductDescription.Insert("OldPrice" , 15);
|
||||
ProductDescription.Insert("MainPhoto" , Image1);
|
||||
ProductDescription.Insert("URL" , "https://github.com/Bayselonarrend/OpenIntegrations");
|
||||
ProductDescription.Insert("AdditionalPhotos", ImageArray);
|
||||
ProductDescription.Insert("MainInGroup" , True);
|
||||
ProductDescription.Insert("Width" , 20);
|
||||
ProductDescription.Insert("Height" , 30);
|
||||
ProductDescription.Insert("Depth" , 40);
|
||||
ProductDescription.Insert("Weight" , 100);
|
||||
ProductDescription.Insert("SKU" , "12345");
|
||||
ProductDescription.Insert("AvailableBalance", "10");
|
||||
ProductDescription.Insert("Name" , "TestProduct");
|
||||
ProductDescription.Insert("Description" , "Product description");
|
||||
ProductDescription.Insert("Category" , "20173");
|
||||
ProductDescription.Insert("Price" , 1);
|
||||
ProductDescription.Insert("OldPrice" , 15);
|
||||
ProductDescription.Insert("MainPhoto" , Image1);
|
||||
ProductDescription.Insert("URL" , "https://github.com/Bayselonarrend/OpenIntegrations");
|
||||
ProductDescription.Insert("AdditionalPhotos" , ImageArray);
|
||||
ProductDescription.Insert("MainInGroup" , True);
|
||||
ProductDescription.Insert("Width" , 20);
|
||||
ProductDescription.Insert("Height" , 30);
|
||||
ProductDescription.Insert("Depth" , 40);
|
||||
ProductDescription.Insert("Weight" , 100);
|
||||
ProductDescription.Insert("SKU" , "12345");
|
||||
ProductDescription.Insert("AvailableBalance" , "10");
|
||||
|
||||
Result = OPI_VK.AddProduct(ProductDescription, Selection, Parameters);
|
||||
|
34
docs/en/examples/VK/CreateProductWithProp.txt
vendored
34
docs/en/examples/VK/CreateProductWithProp.txt
vendored
@ -10,23 +10,23 @@
|
||||
ImageArray.Add(Image2);
|
||||
|
||||
Product = New Map;
|
||||
Product.Insert("Name" , "Test product (with prop)");
|
||||
Product.Insert("Description" , "Product description");
|
||||
Product.Insert("Category" , "20173");
|
||||
Product.Insert("Price" , 1);
|
||||
Product.Insert("OldPrice" , 15);
|
||||
Product.Insert("MainPhoto" , Image1);
|
||||
Product.Insert("URL" , "https://github.com/Bayselonarrend/OpenIntegrations");
|
||||
Product.Insert("AdditionalPhotos", ImageArray);
|
||||
Product.Insert("MainInGroup" , True);
|
||||
Product.Insert("GroupNumber" , Undefined);
|
||||
Product.Insert("Width" , 20);
|
||||
Product.Insert("Height" , 30);
|
||||
Product.Insert("Depth" , 40);
|
||||
Product.Insert("Weight" , 100);
|
||||
Product.Insert("SKU" , 12345);
|
||||
Product.Insert("AvailableBalance", "10");
|
||||
Product.Insert("PropertyValues" , PropVariant1);
|
||||
Product.Insert("Name" , "Test product (with prop)");
|
||||
Product.Insert("Description" , "Product description");
|
||||
Product.Insert("Category" , "20173");
|
||||
Product.Insert("Price" , 1);
|
||||
Product.Insert("OldPrice" , 15);
|
||||
Product.Insert("MainPhoto" , Image1);
|
||||
Product.Insert("URL" , "https://github.com/Bayselonarrend/OpenIntegrations");
|
||||
Product.Insert("AdditionalPhotos" , ImageArray);
|
||||
Product.Insert("MainInGroup" , True);
|
||||
Product.Insert("GroupNumber" , Undefined);
|
||||
Product.Insert("Width" , 20);
|
||||
Product.Insert("Height" , 30);
|
||||
Product.Insert("Depth" , 40);
|
||||
Product.Insert("Weight" , 100);
|
||||
Product.Insert("SKU" , 12345);
|
||||
Product.Insert("AvailableBalance" , "10");
|
||||
Product.Insert("PropertyValues" , PropVariant1);
|
||||
|
||||
Result = OPI_VK.AddProduct(Product, , Parameters);
|
||||
|
||||
|
@ -48,8 +48,8 @@ Method at API documentation: [im.message.update](https://dev.1c-bitrix.ru/learni
|
||||
File = "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/document.docx";
|
||||
|
||||
Attachments = New Array;
|
||||
Attachments.Add(OPI_Bitrix24.GetPictureBlock("Image1" , Image));
|
||||
Attachments.Add(OPI_Bitrix24.GetFileBlock("File1.docx", File));
|
||||
Attachments.Add(OPI_Bitrix24.GetPictureBlock("Image1" , Image));
|
||||
Attachments.Add(OPI_Bitrix24.GetFileBlock("File1.docx" , File));
|
||||
|
||||
Result = OPI_Bitrix24.EditMessage(URL, MessageID, Text, Attachments, Token);
|
||||
```
|
||||
|
@ -40,8 +40,8 @@ Method at API documentation: [im.message.add](https://dev.1c-bitrix.ru/learning/
|
||||
File = "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/document.docx";
|
||||
|
||||
Attachments = New Array;
|
||||
Attachments.Add(OPI_Bitrix24.GetPictureBlock("Image1" , Image));
|
||||
Attachments.Add(OPI_Bitrix24.GetFileBlock("File1.docx", File));
|
||||
Attachments.Add(OPI_Bitrix24.GetPictureBlock("Image1" , Image));
|
||||
Attachments.Add(OPI_Bitrix24.GetFileBlock("File1.docx" , File));
|
||||
|
||||
Result = OPI_Bitrix24.SendMessage(URL, ChatID, Text, Attachments);
|
||||
|
||||
|
@ -42,8 +42,8 @@ Method at API documentation: [im.notify.personal.add](https://dev.1c-bitrix.ru/l
|
||||
File = "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/document.docx";
|
||||
|
||||
Attachments = New Array;
|
||||
Attachments.Add(OPI_Bitrix24.GetPictureBlock("Image1" , Image));
|
||||
Attachments.Add(OPI_Bitrix24.GetFileBlock("File1.docx", File));
|
||||
Attachments.Add(OPI_Bitrix24.GetPictureBlock("Image1" , Image));
|
||||
Attachments.Add(OPI_Bitrix24.GetFileBlock("File1.docx" , File));
|
||||
|
||||
Result = OPI_Bitrix24.CreatePersonalNotification(URL, UserID, Text, , Attachments);
|
||||
|
||||
|
@ -42,8 +42,8 @@ Method at API documentation: [im.notify.system.add](https://dev.1c-bitrix.ru/lea
|
||||
File = "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/document.docx";
|
||||
|
||||
Attachments = New Array;
|
||||
Attachments.Add(OPI_Bitrix24.GetPictureBlock("Image1" , Image));
|
||||
Attachments.Add(OPI_Bitrix24.GetFileBlock("File1.docx", File));
|
||||
Attachments.Add(OPI_Bitrix24.GetPictureBlock("Image1" , Image));
|
||||
Attachments.Add(OPI_Bitrix24.GetFileBlock("File1.docx" , File));
|
||||
|
||||
Result = OPI_Bitrix24.CreateSystemNotification(URL, UserID, Text, , Attachments);
|
||||
|
||||
|
@ -37,7 +37,7 @@ Parameters with Binary data type can also accept file paths on disk and URLs
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
Image = "https://api.athenaeum.digital/test_data/picture.jpg";
|
||||
Image = "https://api.athenaeum.digital/test_data/picture.jpg"; // URL, Path or Binary Data
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Result = OPI_GreenAPI.SetProfilePicture(AccessParameters, Image);
|
||||
|
@ -36,7 +36,7 @@ Method at API documentation: [AddGroupParticipant](https://green-api.com/docs/ap
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
GroupID = "120363410798027942@g.us";
|
||||
GroupID = "120363413395724670@g.us";
|
||||
UserID = "123123123@c.us";
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
|
@ -36,7 +36,7 @@ Method at API documentation: [RemoveGroupParticipant](https://green-api.com/docs
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
GroupID = "120363410798027942@g.us";
|
||||
GroupID = "120363413395724670@g.us";
|
||||
UserID = "123123123@c.us";
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
|
@ -35,7 +35,7 @@ Method at API documentation: [GetGroupData](https://green-api.com/docs/api/group
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
GroupID = "120363410798027942@g.us";
|
||||
GroupID = "120363413395724670@g.us";
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Result = OPI_GreenAPI.GetGroupInformation(AccessParameters, GroupID);
|
||||
|
@ -35,7 +35,7 @@ Method at API documentation: [LeaveGroup](https://green-api.com/docs/api/groups/
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
GroupID = "120363410798027942@g.us";
|
||||
GroupID = "120363413395724670@g.us";
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Result = OPI_GreenAPI.LeaveGroup(AccessParameters, GroupID);
|
||||
|
@ -36,7 +36,7 @@ Method at API documentation: [RemoveAdmin](https://green-api.com/docs/api/groups
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
GroupID = "120363410798027942@g.us";
|
||||
GroupID = "120363413395724670@g.us";
|
||||
UserID = "123123123@c.us";
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
|
@ -36,7 +36,7 @@ Method at API documentation: [SetGroupAdmin](https://green-api.com/docs/api/grou
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
GroupID = "120363410798027942@g.us";
|
||||
GroupID = "120363413395724670@g.us";
|
||||
UserID = "123123123@c.us";
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
|
@ -38,8 +38,8 @@ Parameters with Binary data type can also accept file paths on disk and URLs
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
Image = "https://api.athenaeum.digital/test_data/picture.jpg";
|
||||
GroupID = "120363410798027942@g.us";
|
||||
Image = "https://api.athenaeum.digital/test_data/picture.jpg"; // URL, Path or Binary Data
|
||||
GroupID = "120363413395724670@g.us";
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Result = OPI_GreenAPI.SetGroupPicture(AccessParameters, GroupID, Image);
|
||||
|
@ -36,7 +36,7 @@ Method at API documentation: [UpdateGroupName](https://green-api.com/docs/api/gr
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
GroupID = "120363410798027942@g.us";
|
||||
GroupID = "120363413395724670@g.us";
|
||||
Name = "New name";
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
|
56
docs/en/md/Green_API/Message-sending/Send-file.mdx
vendored
Normal file
56
docs/en/md/Green_API/Message-sending/Send-file.mdx
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
---
|
||||
sidebar_position: 2
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
# Send file
|
||||
Sends the file to the selected chat room
|
||||
|
||||
|
||||
|
||||
`Function SendFile(Val AccessParameters, Val ChatID, Val File, Val FileName, Val Description = "", Val ReplyID = "") Export`
|
||||
|
||||
| Parameter | CLI option | Type | Required | Description |
|
||||
|-|-|-|-|-|
|
||||
| AccessParameters | --access | Structure Of KeyAndValue | ✔ | Access parameters. See FormAccessParameters |
|
||||
| ChatID | --chat | String | ✔ | Chat identifier |
|
||||
| File | --file | String, BinaryData | ✔ | File data or filepath |
|
||||
| FileName | --filename | String | ✔ | Name of the file with the extension |
|
||||
| Description | --caption | String | ✖ | Message text below the file |
|
||||
| ReplyID | --quoted | String | ✖ | Replying message id if necessary |
|
||||
|
||||
|
||||
Returns: Map Of KeyAndValue - serialized JSON response from Green API
|
||||
|
||||
<br/>
|
||||
|
||||
:::tip
|
||||
Method at API documentation: [SendFileByUpload](https://green-api.com/docs/api/sending/SendFileByUpload/)
|
||||
|
||||
Parameters with Binary data type can also accept file paths on disk and URLs
|
||||
:::
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
```bsl title="1C:Enterprise/OneScript code example"
|
||||
ApiUrl = "https://7105.api.greenapi.com";
|
||||
MediaUrl = "https://7105.media.greenapi.com";
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
File = "https://api.athenaeum.digital/test_data/picture.jpg"; // URL, Path or Binary Data
|
||||
FileName = "photo.jpg";
|
||||
ChatID = "120363410406221140@g.us";
|
||||
Description = "File description";
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Result = OPI_GreenAPI.SendFile(AccessParameters, ChatID, File, FileName, Description);
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
50
docs/en/md/Green_API/Message-sending/Send-text-message.mdx
vendored
Normal file
50
docs/en/md/Green_API/Message-sending/Send-text-message.mdx
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
# Send text message
|
||||
Sends a text message to the selected chat room
|
||||
|
||||
|
||||
|
||||
`Function SendTextMessage(Val AccessParameters, Val ChatID, Val Text, Val ReplyID = "") Export`
|
||||
|
||||
| Parameter | CLI option | Type | Required | Description |
|
||||
|-|-|-|-|-|
|
||||
| AccessParameters | --access | Structure Of KeyAndValue | ✔ | Access parameters. See FormAccessParameters |
|
||||
| ChatID | --chat | String | ✔ | Chat identifier |
|
||||
| Text | --text | String | ✔ | Message text |
|
||||
| ReplyID | --quoted | String | ✖ | Replying message id if necessary |
|
||||
|
||||
|
||||
Returns: Map Of KeyAndValue - serialized JSON response from Green API
|
||||
|
||||
<br/>
|
||||
|
||||
:::tip
|
||||
Method at API documentation: [SendMessage](https://green-api.com/docs/api/sending/SendMessage/)
|
||||
:::
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
```bsl title="1C:Enterprise/OneScript code example"
|
||||
ApiUrl = "https://7105.api.greenapi.com";
|
||||
MediaUrl = "https://7105.media.greenapi.com";
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
ChatID = "120363410406221140@g.us";
|
||||
Text = "New message";
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Result = OPI_GreenAPI.SendTextMessage(AccessParameters, ChatID, Text);
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
4
docs/en/md/Green_API/Message-sending/_category_.json
vendored
Normal file
4
docs/en/md/Green_API/Message-sending/_category_.json
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"label": "Message sending",
|
||||
"position": "4"
|
||||
}
|
@ -46,9 +46,9 @@ import TabItem from '@theme/TabItem';
|
||||
Properties.Insert("User" , "people");
|
||||
|
||||
ValueSelection = New Map;
|
||||
ValueSelection.Insert("New" , "green");
|
||||
ValueSelection.Insert("InProgress", "yellow");
|
||||
ValueSelection.Insert("Remote" , "red");
|
||||
ValueSelection.Insert("New" , "green");
|
||||
ValueSelection.Insert("InProgress" , "yellow");
|
||||
ValueSelection.Insert("Remote" , "red");
|
||||
|
||||
Properties.Insert("Status", ValueSelection);
|
||||
|
||||
|
30
docs/en/md/VK/Product-management/Add-product.mdx
vendored
30
docs/en/md/VK/Product-management/Add-product.mdx
vendored
@ -38,21 +38,21 @@ import TabItem from '@theme/TabItem';
|
||||
ImageArray.Add(Image2);
|
||||
|
||||
ProductDescription = New Map;
|
||||
ProductDescription.Insert("Name" , "TestProduct");
|
||||
ProductDescription.Insert("Description" , "Product description");
|
||||
ProductDescription.Insert("Category" , "20173");
|
||||
ProductDescription.Insert("Price" , 1);
|
||||
ProductDescription.Insert("OldPrice" , 15);
|
||||
ProductDescription.Insert("MainPhoto" , Image1);
|
||||
ProductDescription.Insert("URL" , "https://github.com/Bayselonarrend/OpenIntegrations");
|
||||
ProductDescription.Insert("AdditionalPhotos", ImageArray);
|
||||
ProductDescription.Insert("MainInGroup" , True);
|
||||
ProductDescription.Insert("Width" , 20);
|
||||
ProductDescription.Insert("Height" , 30);
|
||||
ProductDescription.Insert("Depth" , 40);
|
||||
ProductDescription.Insert("Weight" , 100);
|
||||
ProductDescription.Insert("SKU" , "12345");
|
||||
ProductDescription.Insert("AvailableBalance", "10");
|
||||
ProductDescription.Insert("Name" , "TestProduct");
|
||||
ProductDescription.Insert("Description" , "Product description");
|
||||
ProductDescription.Insert("Category" , "20173");
|
||||
ProductDescription.Insert("Price" , 1);
|
||||
ProductDescription.Insert("OldPrice" , 15);
|
||||
ProductDescription.Insert("MainPhoto" , Image1);
|
||||
ProductDescription.Insert("URL" , "https://github.com/Bayselonarrend/OpenIntegrations");
|
||||
ProductDescription.Insert("AdditionalPhotos" , ImageArray);
|
||||
ProductDescription.Insert("MainInGroup" , True);
|
||||
ProductDescription.Insert("Width" , 20);
|
||||
ProductDescription.Insert("Height" , 30);
|
||||
ProductDescription.Insert("Depth" , 40);
|
||||
ProductDescription.Insert("Weight" , 100);
|
||||
ProductDescription.Insert("SKU" , "12345");
|
||||
ProductDescription.Insert("AvailableBalance" , "10");
|
||||
|
||||
Result = OPI_VK.AddProduct(ProductDescription, Selection, Parameters);
|
||||
```
|
||||
|
7
docs/ru/data/GreenAPI/ОтправитьТекстовоеСообщение.json
vendored
Normal file
7
docs/ru/data/GreenAPI/ОтправитьТекстовоеСообщение.json
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"ApiUrl": "https://7105.api.greenapi.com",
|
||||
"MediaUrl": "https://7105.media.greenapi.com",
|
||||
"IdInstance": "71051...",
|
||||
"ApiTokenInstance": "425010d90e114aa6b78f0969e...",
|
||||
"IDЧата": "120363410406221140@g.us"
|
||||
}
|
8
docs/ru/data/GreenAPI/ОтправитьФайл.json
vendored
Normal file
8
docs/ru/data/GreenAPI/ОтправитьФайл.json
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"ApiUrl": "https://7105.api.greenapi.com",
|
||||
"MediaUrl": "https://7105.media.greenapi.com",
|
||||
"IdInstance": "71051...",
|
||||
"ApiTokenInstance": "425010d90e114aa6b78f0969e...",
|
||||
"Файл": "https://api.athenaeum.digital/test_data/picture.jpg",
|
||||
"IDЧата": "120363410406221140@g.us"
|
||||
}
|
@ -3,7 +3,7 @@
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
IDГруппы = "120363410798027942@g.us";
|
||||
IDГруппы = "120363413395724670@g.us";
|
||||
IDПользователя = "123123123@c.us";
|
||||
|
||||
ПараметрыДоступа = OPI_GreenAPI.СформироватьПараметрыДоступа(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
|
@ -3,7 +3,7 @@
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
IDГруппы = "120363410798027942@g.us";
|
||||
IDГруппы = "120363413395724670@g.us";
|
||||
Имя = "New name";
|
||||
|
||||
ПараметрыДоступа = OPI_GreenAPI.СформироватьПараметрыДоступа(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
|
@ -3,7 +3,7 @@
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
IDГруппы = "120363410798027942@g.us";
|
||||
IDГруппы = "120363413395724670@g.us";
|
||||
IDПользователя = "123123123@c.us";
|
||||
|
||||
ПараметрыДоступа = OPI_GreenAPI.СформироватьПараметрыДоступа(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
|
@ -3,7 +3,7 @@
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
IDГруппы = "120363410798027942@g.us";
|
||||
IDГруппы = "120363413395724670@g.us";
|
||||
IDПользователя = "123123123@c.us";
|
||||
|
||||
ПараметрыДоступа = OPI_GreenAPI.СформироватьПараметрыДоступа(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
|
@ -3,7 +3,7 @@
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
IDГруппы = "120363410798027942@g.us";
|
||||
IDГруппы = "120363413395724670@g.us";
|
||||
IDПользователя = "123123123@c.us";
|
||||
|
||||
ПараметрыДоступа = OPI_GreenAPI.СформироватьПараметрыДоступа(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
|
10
docs/ru/examples/GreenAPI/ОтправитьТекстовоеСообщение.txt
vendored
Normal file
10
docs/ru/examples/GreenAPI/ОтправитьТекстовоеСообщение.txt
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
ApiUrl = "https://7105.api.greenapi.com";
|
||||
MediaUrl = "https://7105.media.greenapi.com";
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
IDЧата = "120363410406221140@g.us";
|
||||
Текст = "Новое сообщение";
|
||||
|
||||
ПараметрыДоступа = OPI_GreenAPI.СформироватьПараметрыДоступа(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Результат = OPI_GreenAPI.ОтправитьТекстовоеСообщение(ПараметрыДоступа, IDЧата, Текст);
|
12
docs/ru/examples/GreenAPI/ОтправитьФайл.txt
vendored
Normal file
12
docs/ru/examples/GreenAPI/ОтправитьФайл.txt
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
ApiUrl = "https://7105.api.greenapi.com";
|
||||
MediaUrl = "https://7105.media.greenapi.com";
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
Файл = "https://api.athenaeum.digital/test_data/picture.jpg"; // URL, Путь или Двоичные данные
|
||||
ИмяФайла = "photo.jpg";
|
||||
IDЧата = "120363410406221140@g.us";
|
||||
Описание = "Описание файла";
|
||||
|
||||
ПараметрыДоступа = OPI_GreenAPI.СформироватьПараметрыДоступа(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Результат = OPI_GreenAPI.ОтправитьФайл(ПараметрыДоступа, IDЧата, Файл, ИмяФайла, Описание);
|
2
docs/ru/examples/GreenAPI/ПокинутьГруппу.txt
vendored
2
docs/ru/examples/GreenAPI/ПокинутьГруппу.txt
vendored
@ -3,7 +3,7 @@
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
IDГруппы = "120363410798027942@g.us";
|
||||
IDГруппы = "120363413395724670@g.us";
|
||||
|
||||
ПараметрыДоступа = OPI_GreenAPI.СформироватьПараметрыДоступа(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Результат = OPI_GreenAPI.ПокинутьГруппу(ПараметрыДоступа, IDГруппы);
|
||||
|
@ -3,7 +3,7 @@
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
IDГруппы = "120363410798027942@g.us";
|
||||
IDГруппы = "120363413395724670@g.us";
|
||||
|
||||
ПараметрыДоступа = OPI_GreenAPI.СформироватьПараметрыДоступа(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Результат = OPI_GreenAPI.ПолучитьИнформациюОГруппе(ПараметрыДоступа, IDГруппы);
|
||||
|
@ -3,8 +3,8 @@
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
Картинка = "https://api.athenaeum.digital/test_data/picture.jpg";
|
||||
IDГруппы = "120363410798027942@g.us";
|
||||
Картинка = "https://api.athenaeum.digital/test_data/picture.jpg"; // URL, Путь или Двоичные данные
|
||||
IDГруппы = "120363413395724670@g.us";
|
||||
|
||||
ПараметрыДоступа = OPI_GreenAPI.СформироватьПараметрыДоступа(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Результат = OPI_GreenAPI.УстановитьКартинкуГруппы(ПараметрыДоступа, IDГруппы, Картинка);
|
||||
|
@ -3,7 +3,7 @@
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
Картинка = "https://api.athenaeum.digital/test_data/picture.jpg";
|
||||
Картинка = "https://api.athenaeum.digital/test_data/picture.jpg"; // URL, Путь или Двоичные данные
|
||||
|
||||
ПараметрыДоступа = OPI_GreenAPI.СформироватьПараметрыДоступа(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Результат = OPI_GreenAPI.УстановитьКартинкуПрофиля(ПараметрыДоступа, Картинка);
|
||||
|
@ -37,7 +37,7 @@ import TabItem from '@theme/TabItem';
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
Картинка = "https://api.athenaeum.digital/test_data/picture.jpg";
|
||||
Картинка = "https://api.athenaeum.digital/test_data/picture.jpg"; // URL, Путь или Двоичные данные
|
||||
|
||||
ПараметрыДоступа = OPI_GreenAPI.СформироватьПараметрыДоступа(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Результат = OPI_GreenAPI.УстановитьКартинкуПрофиля(ПараметрыДоступа, Картинка);
|
||||
|
@ -36,7 +36,7 @@ import TabItem from '@theme/TabItem';
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
IDГруппы = "120363410798027942@g.us";
|
||||
IDГруппы = "120363413395724670@g.us";
|
||||
IDПользователя = "123123123@c.us";
|
||||
|
||||
ПараметрыДоступа = OPI_GreenAPI.СформироватьПараметрыДоступа(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
|
@ -36,7 +36,7 @@ import TabItem from '@theme/TabItem';
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
IDГруппы = "120363410798027942@g.us";
|
||||
IDГруппы = "120363413395724670@g.us";
|
||||
IDПользователя = "123123123@c.us";
|
||||
|
||||
ПараметрыДоступа = OPI_GreenAPI.СформироватьПараметрыДоступа(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
|
@ -35,7 +35,7 @@ import TabItem from '@theme/TabItem';
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
IDГруппы = "120363410798027942@g.us";
|
||||
IDГруппы = "120363413395724670@g.us";
|
||||
|
||||
ПараметрыДоступа = OPI_GreenAPI.СформироватьПараметрыДоступа(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Результат = OPI_GreenAPI.ПолучитьИнформациюОГруппе(ПараметрыДоступа, IDГруппы);
|
||||
|
@ -35,7 +35,7 @@ import TabItem from '@theme/TabItem';
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
IDГруппы = "120363410798027942@g.us";
|
||||
IDГруппы = "120363413395724670@g.us";
|
||||
|
||||
ПараметрыДоступа = OPI_GreenAPI.СформироватьПараметрыДоступа(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Результат = OPI_GreenAPI.ПокинутьГруппу(ПараметрыДоступа, IDГруппы);
|
||||
|
@ -36,7 +36,7 @@ import TabItem from '@theme/TabItem';
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
IDГруппы = "120363410798027942@g.us";
|
||||
IDГруппы = "120363413395724670@g.us";
|
||||
IDПользователя = "123123123@c.us";
|
||||
|
||||
ПараметрыДоступа = OPI_GreenAPI.СформироватьПараметрыДоступа(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
|
@ -36,7 +36,7 @@ import TabItem from '@theme/TabItem';
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
IDГруппы = "120363410798027942@g.us";
|
||||
IDГруппы = "120363413395724670@g.us";
|
||||
IDПользователя = "123123123@c.us";
|
||||
|
||||
ПараметрыДоступа = OPI_GreenAPI.СформироватьПараметрыДоступа(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
|
@ -38,8 +38,8 @@ import TabItem from '@theme/TabItem';
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
Картинка = "https://api.athenaeum.digital/test_data/picture.jpg";
|
||||
IDГруппы = "120363410798027942@g.us";
|
||||
Картинка = "https://api.athenaeum.digital/test_data/picture.jpg"; // URL, Путь или Двоичные данные
|
||||
IDГруппы = "120363413395724670@g.us";
|
||||
|
||||
ПараметрыДоступа = OPI_GreenAPI.СформироватьПараметрыДоступа(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Результат = OPI_GreenAPI.УстановитьКартинкуГруппы(ПараметрыДоступа, IDГруппы, Картинка);
|
||||
|
@ -36,7 +36,7 @@ import TabItem from '@theme/TabItem';
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
IDГруппы = "120363410798027942@g.us";
|
||||
IDГруппы = "120363413395724670@g.us";
|
||||
Имя = "New name";
|
||||
|
||||
ПараметрыДоступа = OPI_GreenAPI.СформироватьПараметрыДоступа(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
|
56
docs/ru/md/Green_API/Message-sending/Send-file.mdx
vendored
Normal file
56
docs/ru/md/Green_API/Message-sending/Send-file.mdx
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
---
|
||||
sidebar_position: 2
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
# Отправить файл
|
||||
Отправляет файл в выбранный чат
|
||||
|
||||
|
||||
|
||||
`Функция ОтправитьФайл(Знач ПараметрыДоступа, Знач IDЧата, Знач Файл, Знач ИмяФайла, Знач Описание = "", Знач IDЦитируемого = "") Экспорт`
|
||||
|
||||
| Параметр | CLI опция | Тип | Обяз. | Назначение |
|
||||
|-|-|-|-|-|
|
||||
| ПараметрыДоступа | --access | Структура Из КлючИЗначение | ✔ | Параметры доступа. См. СформироватьПараметрыДоступа |
|
||||
| IDЧата | --chat | Строка | ✔ | Идентификатор чата |
|
||||
| Файл | --file | Строка, ДвоичныеДанные | ✔ | Данные или путь к файлу |
|
||||
| ИмяФайла | --filename | Строка | ✔ | Имя загружаемого файла с раширением |
|
||||
| Описание | --caption | Строка | ✖ | Текст сообщения под файлом |
|
||||
| IDЦитируемого | --quoted | Строка | ✖ | ID цитируемого сообщения, если необходимо |
|
||||
|
||||
|
||||
Возвращаемое значение: Соответствие Из КлючИЗначение - сериализованный JSON ответа от Green API
|
||||
|
||||
<br/>
|
||||
|
||||
:::tip
|
||||
Метод в документации API: [SendFileByUpload](https://green-api.com/docs/api/sending/SendFileByUpload/)
|
||||
|
||||
Параметры с типом данных Двоичные данные могут принимать также пути к файлам на диске и URL
|
||||
:::
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
```bsl title="Пример использования для 1С:Предприятие/OneScript"
|
||||
ApiUrl = "https://7105.api.greenapi.com";
|
||||
MediaUrl = "https://7105.media.greenapi.com";
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
Файл = "https://api.athenaeum.digital/test_data/picture.jpg"; // URL, Путь или Двоичные данные
|
||||
ИмяФайла = "photo.jpg";
|
||||
IDЧата = "120363410406221140@g.us";
|
||||
Описание = "Описание файла";
|
||||
|
||||
ПараметрыДоступа = OPI_GreenAPI.СформироватьПараметрыДоступа(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Результат = OPI_GreenAPI.ОтправитьФайл(ПараметрыДоступа, IDЧата, Файл, ИмяФайла, Описание);
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
50
docs/ru/md/Green_API/Message-sending/Send-text-message.mdx
vendored
Normal file
50
docs/ru/md/Green_API/Message-sending/Send-text-message.mdx
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
---
|
||||
sidebar_position: 1
|
||||
---
|
||||
|
||||
import Tabs from '@theme/Tabs';
|
||||
import TabItem from '@theme/TabItem';
|
||||
|
||||
# Отправить текстовое сообщение
|
||||
Отправляет текстовое сообщение в выбранный чат
|
||||
|
||||
|
||||
|
||||
`Функция ОтправитьТекстовоеСообщение(Знач ПараметрыДоступа, Знач IDЧата, Знач Текст, Знач IDЦитируемого = "") Экспорт`
|
||||
|
||||
| Параметр | CLI опция | Тип | Обяз. | Назначение |
|
||||
|-|-|-|-|-|
|
||||
| ПараметрыДоступа | --access | Структура Из КлючИЗначение | ✔ | Параметры доступа. См. СформироватьПараметрыДоступа |
|
||||
| IDЧата | --chat | Строка | ✔ | Идентификатор чата |
|
||||
| Текст | --text | Строка | ✔ | Текст сообщения |
|
||||
| IDЦитируемого | --quoted | Строка | ✖ | ID цитируемого сообщения, если необходимо |
|
||||
|
||||
|
||||
Возвращаемое значение: Соответствие Из КлючИЗначение - сериализованный JSON ответа от Green API
|
||||
|
||||
<br/>
|
||||
|
||||
:::tip
|
||||
Метод в документации API: [SendMessage](https://green-api.com/docs/api/sending/SendMessage/)
|
||||
:::
|
||||
<br/>
|
||||
|
||||
|
||||
|
||||
```bsl title="Пример использования для 1С:Предприятие/OneScript"
|
||||
ApiUrl = "https://7105.api.greenapi.com";
|
||||
MediaUrl = "https://7105.media.greenapi.com";
|
||||
IdInstance = "71051...";
|
||||
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
|
||||
|
||||
IDЧата = "120363410406221140@g.us";
|
||||
Текст = "Новое сообщение";
|
||||
|
||||
ПараметрыДоступа = OPI_GreenAPI.СформироватьПараметрыДоступа(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Результат = OPI_GreenAPI.ОтправитьТекстовоеСообщение(ПараметрыДоступа, IDЧата, Текст);
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
4
docs/ru/md/Green_API/Message-sending/_category_.json
vendored
Normal file
4
docs/ru/md/Green_API/Message-sending/_category_.json
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"label": "Отправка сообщений",
|
||||
"position": "4"
|
||||
}
|
13148
service/dictionaries/en.json
vendored
13148
service/dictionaries/en.json
vendored
File diff suppressed because it is too large
Load Diff
93
src/en/OInt/core/Modules/OPI_GreenAPI.os
vendored
93
src/en/OInt/core/Modules/OPI_GreenAPI.os
vendored
@ -549,27 +549,114 @@ EndFunction
|
||||
|
||||
#EndRegion
|
||||
|
||||
#Region MessageSending
|
||||
|
||||
// Send text message
|
||||
// Sends a text message to the selected chat room
|
||||
//
|
||||
// Note
|
||||
// Method at API documentation: [SendMessage](@green-api.com/docs/api/sending/SendMessage/)
|
||||
//
|
||||
// Parameters:
|
||||
// AccessParameters - Structure Of KeyAndValue - Access parameters. See FormAccessParameters - access
|
||||
// ChatID - String - Chat identifier - chat
|
||||
// Text - String - Message text - text
|
||||
// ReplyID - String - Replying message id if necessary - quoted
|
||||
//
|
||||
// Returns:
|
||||
// Map Of KeyAndValue - serialized JSON response from Green API
|
||||
Function SendTextMessage(Val AccessParameters, Val ChatID, Val Text, Val ReplyID = "") Export
|
||||
|
||||
Parameters = New Structure;
|
||||
|
||||
OPI_Tools.AddField("chatId" , ChatID , "String", Parameters);
|
||||
OPI_Tools.AddField("message" , Text , "String", Parameters);
|
||||
OPI_Tools.AddField("quotedMessageId", ReplyID, "String", Parameters);
|
||||
|
||||
URL = FormPrimaryURL(AccessParameters, "sendMessage");
|
||||
Response = OPI_Tools.Post(URL, Parameters);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Send file
|
||||
// Sends the file to the selected chat room
|
||||
//
|
||||
// Note
|
||||
// Method at API documentation: [SendFileByUpload](@green-api.com/docs/api/sending/SendFileByUpload/)
|
||||
//
|
||||
// Parameters:
|
||||
// AccessParameters - Structure Of KeyAndValue - Access parameters. See FormAccessParameters - access
|
||||
// ChatID - String - Chat identifier - chat
|
||||
// File - String, BinaryData - File data or filepath - file
|
||||
// FileName - String - Name of the file with the extension - filename
|
||||
// Description - String - Message text below the file - caption
|
||||
// ReplyID - String - Replying message id if necessary - quoted
|
||||
//
|
||||
// Returns:
|
||||
// Map Of KeyAndValue - serialized JSON response from Green API
|
||||
Function SendFile(Val AccessParameters
|
||||
, Val ChatID
|
||||
, Val File
|
||||
, Val FileName
|
||||
, Val Description = ""
|
||||
, Val ReplyID = "") Export
|
||||
|
||||
OPI_TypeConversion.GetBinaryData(File);
|
||||
|
||||
Parameters = New Structure;
|
||||
|
||||
OPI_Tools.AddField("chatId" , ChatID , "String", Parameters);
|
||||
OPI_Tools.AddField("fileName" , FileName , "String", Parameters);
|
||||
OPI_Tools.AddField("caption" , Description , "String", Parameters);
|
||||
OPI_Tools.AddField("quotedMessageId", ReplyID , "String", Parameters);
|
||||
|
||||
FileMapping = New Map();
|
||||
FileMapping.Insert(StrTemplate("file|%1", FileName), File);
|
||||
|
||||
URL = FormMediaURL(AccessParameters, "SendFileByUpload");
|
||||
Response = OPI_Tools.PostMultipart(URL, Parameters, FileMapping);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
#EndRegion
|
||||
|
||||
#EndRegion
|
||||
|
||||
#Region Private
|
||||
|
||||
Function FormPrimaryURL(Val AccessParameters, Val Method)
|
||||
|
||||
Return FormURL(AccessParameters, Method, "apiUrl");
|
||||
|
||||
EndFunction
|
||||
|
||||
Function FormMediaURL(Val AccessParameters, Val Method)
|
||||
|
||||
Return FormURL(AccessParameters, Method, "mediaUrl");
|
||||
|
||||
EndFunction
|
||||
|
||||
Function FormURL(AccessParameters, Method, URLField)
|
||||
|
||||
OPI_TypeConversion.GetKeyValueCollection(AccessParameters);
|
||||
OPI_TypeConversion.GetLine(Method);
|
||||
|
||||
RequiredFields = StrSplit("apiUrl,idInstance,apiTokenInstance", ",");
|
||||
RequiredFields = StrSplit(URLField + ",idInstance,apiTokenInstance", ",");
|
||||
MissingFields = OPI_Tools.FindMissingCollectionFields(AccessParameters, RequiredFields);
|
||||
|
||||
If MissingFields.Count() > 0 Then
|
||||
Raise "Missing mandatory fields in access parameters!";
|
||||
EndIf;
|
||||
|
||||
ApiUrl = AccessParameters["apiUrl"];
|
||||
Url = AccessParameters[URLField];
|
||||
IdInstance = AccessParameters["idInstance"];
|
||||
ApiTokenInstance = AccessParameters["apiTokenInstance"];
|
||||
|
||||
URL = StrTemplate("%1/waInstance%2/%3/%4", ApiUrl, IdInstance, Method, ApiTokenInstance);
|
||||
URL = StrTemplate("%1/waInstance%2/%3/%4", Url, IdInstance, Method, ApiTokenInstance);
|
||||
|
||||
Return URL;
|
||||
|
||||
|
174
src/en/OInt/tests/Modules/internal/OPI_Tests.os
vendored
174
src/en/OInt/tests/Modules/internal/OPI_Tests.os
vendored
@ -2419,6 +2419,22 @@ Procedure GAPI_GroupManagement() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GAPI_MessageSending() Export
|
||||
|
||||
TestParameters = New Structure;
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GreenAPI_ApiURL" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GreenAPI_MediaURL" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GreenAPI_IdInstance" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GreenAPI_Token" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GreenAPI_TestGroupID", TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("Picture" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("Video" , TestParameters);
|
||||
|
||||
GreenAPI_SendTextMessage(TestParameters);
|
||||
GreenAPI_SendFile(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
|
||||
#EndRegion
|
||||
@ -4030,21 +4046,21 @@ Procedure VK_AddProduct(FunctionParameters)
|
||||
ImageArray.Add(Image2);
|
||||
|
||||
ProductDescription = New Map;
|
||||
ProductDescription.Insert("Name" , "TestProduct");
|
||||
ProductDescription.Insert("Description" , "Product description");
|
||||
ProductDescription.Insert("Category" , "20173");
|
||||
ProductDescription.Insert("Price" , 1);
|
||||
ProductDescription.Insert("OldPrice" , 15);
|
||||
ProductDescription.Insert("MainPhoto" , Image1);
|
||||
ProductDescription.Insert("URL" , "https://github.com/Bayselonarrend/OpenIntegrations");
|
||||
ProductDescription.Insert("AdditionalPhotos", ImageArray);
|
||||
ProductDescription.Insert("MainInGroup" , True);
|
||||
ProductDescription.Insert("Width" , 20);
|
||||
ProductDescription.Insert("Height" , 30);
|
||||
ProductDescription.Insert("Depth" , 40);
|
||||
ProductDescription.Insert("Weight" , 100);
|
||||
ProductDescription.Insert("SKU" , "12345");
|
||||
ProductDescription.Insert("AvailableBalance", "10");
|
||||
ProductDescription.Insert("Name" , "TestProduct");
|
||||
ProductDescription.Insert("Description" , "Product description");
|
||||
ProductDescription.Insert("Category" , "20173");
|
||||
ProductDescription.Insert("Price" , 1);
|
||||
ProductDescription.Insert("OldPrice" , 15);
|
||||
ProductDescription.Insert("MainPhoto" , Image1);
|
||||
ProductDescription.Insert("URL" , "https://github.com/Bayselonarrend/OpenIntegrations");
|
||||
ProductDescription.Insert("AdditionalPhotos" , ImageArray);
|
||||
ProductDescription.Insert("MainInGroup" , True);
|
||||
ProductDescription.Insert("Width" , 20);
|
||||
ProductDescription.Insert("Height" , 30);
|
||||
ProductDescription.Insert("Depth" , 40);
|
||||
ProductDescription.Insert("Weight" , 100);
|
||||
ProductDescription.Insert("SKU" , "12345");
|
||||
ProductDescription.Insert("AvailableBalance" , "10");
|
||||
|
||||
Result = OPI_VK.AddProduct(ProductDescription, Selection, Parameters);
|
||||
|
||||
@ -4261,23 +4277,23 @@ Procedure VK_CreateProductWithProp(FunctionParameters)
|
||||
ImageArray.Add(Image2);
|
||||
|
||||
Product = New Map;
|
||||
Product.Insert("Name" , "Test product (with prop)");
|
||||
Product.Insert("Description" , "Product description");
|
||||
Product.Insert("Category" , "20173");
|
||||
Product.Insert("Price" , 1);
|
||||
Product.Insert("OldPrice" , 15);
|
||||
Product.Insert("MainPhoto" , Image1);
|
||||
Product.Insert("URL" , "https://github.com/Bayselonarrend/OpenIntegrations");
|
||||
Product.Insert("AdditionalPhotos", ImageArray);
|
||||
Product.Insert("MainInGroup" , True);
|
||||
Product.Insert("GroupNumber" , Undefined);
|
||||
Product.Insert("Width" , 20);
|
||||
Product.Insert("Height" , 30);
|
||||
Product.Insert("Depth" , 40);
|
||||
Product.Insert("Weight" , 100);
|
||||
Product.Insert("SKU" , 12345);
|
||||
Product.Insert("AvailableBalance", "10");
|
||||
Product.Insert("PropertyValues" , PropVariant1);
|
||||
Product.Insert("Name" , "Test product (with prop)");
|
||||
Product.Insert("Description" , "Product description");
|
||||
Product.Insert("Category" , "20173");
|
||||
Product.Insert("Price" , 1);
|
||||
Product.Insert("OldPrice" , 15);
|
||||
Product.Insert("MainPhoto" , Image1);
|
||||
Product.Insert("URL" , "https://github.com/Bayselonarrend/OpenIntegrations");
|
||||
Product.Insert("AdditionalPhotos" , ImageArray);
|
||||
Product.Insert("MainInGroup" , True);
|
||||
Product.Insert("GroupNumber" , Undefined);
|
||||
Product.Insert("Width" , 20);
|
||||
Product.Insert("Height" , 30);
|
||||
Product.Insert("Depth" , 40);
|
||||
Product.Insert("Weight" , 100);
|
||||
Product.Insert("SKU" , 12345);
|
||||
Product.Insert("AvailableBalance" , "10");
|
||||
Product.Insert("PropertyValues" , PropVariant1);
|
||||
|
||||
Result = OPI_VK.AddProduct(Product, , Parameters);
|
||||
|
||||
@ -7285,9 +7301,9 @@ Procedure Notion_CreateDatabase(FunctionParameters)
|
||||
Properties.Insert("User" , "people");
|
||||
|
||||
ValueSelection = New Map;
|
||||
ValueSelection.Insert("New" , "green");
|
||||
ValueSelection.Insert("InProgress", "yellow");
|
||||
ValueSelection.Insert("Remote" , "red");
|
||||
ValueSelection.Insert("New" , "green");
|
||||
ValueSelection.Insert("InProgress" , "yellow");
|
||||
ValueSelection.Insert("Remote" , "red");
|
||||
|
||||
Properties.Insert("Status", ValueSelection);
|
||||
|
||||
@ -7860,7 +7876,7 @@ Procedure Dropbox_GetTagList(FunctionParameters)
|
||||
|
||||
For Each Tag In Result["paths_to_tags"][0]["tags"] Do
|
||||
If Tag["tag_text"] = "important" Then
|
||||
HasTag = True;
|
||||
HasTag = True;
|
||||
EndIf;
|
||||
EndDo;
|
||||
|
||||
@ -8004,8 +8020,8 @@ Procedure Dropbox_CancelFolderPublication(FunctionParameters)
|
||||
JobID = Result["async_job_id"];
|
||||
|
||||
While CurrentStatus = "in_progress" Do
|
||||
Result = OPI_Dropbox.GetAsynchronousChangeStatus(Token, JobID);
|
||||
CurrentStatus = Result[".tag"];
|
||||
Result = OPI_Dropbox.GetAsynchronousChangeStatus(Token, JobID);
|
||||
CurrentStatus = Result[".tag"];
|
||||
OPI_Tools.Pause(3);
|
||||
EndDo;
|
||||
|
||||
@ -10999,8 +11015,8 @@ Procedure Bitrix24_SendMessage(FunctionParameters)
|
||||
File = "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/document.docx";
|
||||
|
||||
Attachments = New Array;
|
||||
Attachments.Add(OPI_Bitrix24.GetPictureBlock("Image1" , Image));
|
||||
Attachments.Add(OPI_Bitrix24.GetFileBlock("File1.docx", File));
|
||||
Attachments.Add(OPI_Bitrix24.GetPictureBlock("Image1" , Image));
|
||||
Attachments.Add(OPI_Bitrix24.GetFileBlock("File1.docx" , File));
|
||||
|
||||
Result = OPI_Bitrix24.SendMessage(URL, ChatID, Text, Attachments);
|
||||
|
||||
@ -11051,8 +11067,8 @@ Procedure Bitrix24_EditMessage(FunctionParameters)
|
||||
File = "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/document.docx";
|
||||
|
||||
Attachments = New Array;
|
||||
Attachments.Add(OPI_Bitrix24.GetPictureBlock("Image1" , Image));
|
||||
Attachments.Add(OPI_Bitrix24.GetFileBlock("File1.docx", File));
|
||||
Attachments.Add(OPI_Bitrix24.GetPictureBlock("Image1" , Image));
|
||||
Attachments.Add(OPI_Bitrix24.GetFileBlock("File1.docx" , File));
|
||||
|
||||
Result = OPI_Bitrix24.EditMessage(URL, MessageID, Text, Attachments, Token);
|
||||
|
||||
@ -11264,8 +11280,8 @@ Procedure Bitrix24_CreatePersonalNotification(FunctionParameters)
|
||||
File = "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/document.docx";
|
||||
|
||||
Attachments = New Array;
|
||||
Attachments.Add(OPI_Bitrix24.GetPictureBlock("Image1" , Image));
|
||||
Attachments.Add(OPI_Bitrix24.GetFileBlock("File1.docx", File));
|
||||
Attachments.Add(OPI_Bitrix24.GetPictureBlock("Image1" , Image));
|
||||
Attachments.Add(OPI_Bitrix24.GetFileBlock("File1.docx" , File));
|
||||
|
||||
Result = OPI_Bitrix24.CreatePersonalNotification(URL, UserID, Text, , Attachments);
|
||||
|
||||
@ -11306,8 +11322,8 @@ Procedure Bitrix24_CreateSystemNotification(FunctionParameters)
|
||||
File = "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/document.docx";
|
||||
|
||||
Attachments = New Array;
|
||||
Attachments.Add(OPI_Bitrix24.GetPictureBlock("Image1" , Image));
|
||||
Attachments.Add(OPI_Bitrix24.GetFileBlock("File1.docx", File));
|
||||
Attachments.Add(OPI_Bitrix24.GetPictureBlock("Image1" , Image));
|
||||
Attachments.Add(OPI_Bitrix24.GetFileBlock("File1.docx" , File));
|
||||
|
||||
Result = OPI_Bitrix24.CreateSystemNotification(URL, UserID, Text, , Attachments);
|
||||
|
||||
@ -18345,7 +18361,7 @@ Procedure GreenAPI_SetProfilePicture(FunctionParameters)
|
||||
IdInstance = FunctionParameters["GreenAPI_IdInstance"];
|
||||
ApiTokenInstance = FunctionParameters["GreenAPI_Token"];
|
||||
|
||||
Image = FunctionParameters["Picture"];
|
||||
Image = FunctionParameters["Picture"]; // URL, Path or Binary Data
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Result = OPI_GreenAPI.SetProfilePicture(AccessParameters, Image);
|
||||
@ -18556,7 +18572,7 @@ Procedure GreenAPI_SetGroupPicture(FunctionParameters)
|
||||
IdInstance = FunctionParameters["GreenAPI_IdInstance"];
|
||||
ApiTokenInstance = FunctionParameters["GreenAPI_Token"];
|
||||
|
||||
Image = FunctionParameters["Picture"];
|
||||
Image = FunctionParameters["Picture"]; // URL, Path or Binary Data
|
||||
GroupID = FunctionParameters["GreenAPI_GroupID"];
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
@ -18569,6 +18585,68 @@ Procedure GreenAPI_SetGroupPicture(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GreenAPI_SendTextMessage(FunctionParameters)
|
||||
|
||||
ApiUrl = FunctionParameters["GreenAPI_ApiURL"];
|
||||
MediaUrl = FunctionParameters["GreenAPI_MediaURL"];
|
||||
IdInstance = FunctionParameters["GreenAPI_IdInstance"];
|
||||
ApiTokenInstance = FunctionParameters["GreenAPI_Token"];
|
||||
|
||||
ChatID = FunctionParameters["GreenAPI_TestGroupID"];
|
||||
Text = "New message";
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Result = OPI_GreenAPI.SendTextMessage(AccessParameters, ChatID, Text);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.WriteLog(Result, "SendTextMessage", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_GreenMessage(Result);
|
||||
|
||||
MessageID = Result["idMessage"];
|
||||
OPI_TestDataRetrieval.WriteParameter("GreenAPI_MessageID", MessageID);
|
||||
OPI_Tools.AddField("GreenAPI_MessageID", MessageID, "String", FunctionParameters);
|
||||
|
||||
Result = OPI_GreenAPI.SendTextMessage(AccessParameters, ChatID, Text, MessageID);
|
||||
|
||||
OPI_TestDataRetrieval.WriteLog(Result, "SendTextMessage (quote)", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_GreenMessage(Result);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GreenAPI_SendFile(FunctionParameters)
|
||||
|
||||
ApiUrl = FunctionParameters["GreenAPI_ApiURL"];
|
||||
MediaUrl = FunctionParameters["GreenAPI_MediaURL"];
|
||||
IdInstance = FunctionParameters["GreenAPI_IdInstance"];
|
||||
ApiTokenInstance = FunctionParameters["GreenAPI_Token"];
|
||||
|
||||
File = FunctionParameters["Picture"]; // URL, Path or Binary Data
|
||||
FileName = "photo.jpg";
|
||||
ChatID = FunctionParameters["GreenAPI_TestGroupID"];
|
||||
Description = "File description";
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Result = OPI_GreenAPI.SendFile(AccessParameters, ChatID, File, FileName, Description);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.WriteLog(Result, "SendFile", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_GreenFile(Result);
|
||||
|
||||
MessageID = Result["idMessage"];
|
||||
OPI_TestDataRetrieval.WriteParameter("GreenAPI_FileMessageID", MessageID);
|
||||
OPI_Tools.AddField("GreenAPI_FileMessageID", MessageID, "String", FunctionParameters);
|
||||
|
||||
File = FunctionParameters["Video"];
|
||||
FileName = "vid.mp4";
|
||||
Result = OPI_GreenAPI.SendFile(AccessParameters, ChatID, File, FileName, Description, MessageID);
|
||||
|
||||
OPI_TestDataRetrieval.WriteLog(Result, "SendFile (quote)", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_GreenFile(Result);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
|
||||
#EndRegion
|
||||
|
161
src/en/OInt/tests/Modules/internal/OPI_TestsCLI.os
vendored
161
src/en/OInt/tests/Modules/internal/OPI_TestsCLI.os
vendored
@ -2385,6 +2385,22 @@ Procedure CLI_GAPI_GroupManagement() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure CLI_GAPI_MessageSending() Export
|
||||
|
||||
TestParameters = New Structure;
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GreenAPI_ApiURL" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GreenAPI_MediaURL" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GreenAPI_IdInstance" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GreenAPI_Token" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GreenAPI_TestGroupID", TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("Picture" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("Video" , TestParameters);
|
||||
|
||||
CLI_GreenAPI_SendTextMessage(TestParameters);
|
||||
CLI_GreenAPI_SendFile(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
|
||||
#EndRegion
|
||||
@ -20344,7 +20360,7 @@ Procedure CLI_GreenAPI_FormAccessParameters(FunctionParameters)
|
||||
// END
|
||||
|
||||
Result.Insert("apiTokenInstance", "***");
|
||||
OPI_TestDataRetrieval.WriteLog(Result, "FormAccessParameters", "GreenAPI");
|
||||
OPI_TestDataRetrieval.WriteLogCLI(Result, "FormAccessParameters", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_Map(Result);
|
||||
|
||||
EndProcedure
|
||||
@ -20371,7 +20387,7 @@ Procedure CLI_GreenAPI_GetInstanceSettings(FunctionParameters)
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.WriteLog(Result, "GetInstanceSettings", "GreenAPI");
|
||||
OPI_TestDataRetrieval.WriteLogCLI(Result, "GetInstanceSettings", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_GreenInstance(Result);
|
||||
|
||||
EndProcedure
|
||||
@ -20417,7 +20433,7 @@ Procedure CLI_GreenAPI_GetInstanceSettingsStructure(FunctionParameters)
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.WriteLog(Result, "GetInstanceSettingsStructure", "GreenAPI");
|
||||
OPI_TestDataRetrieval.WriteLogCLI(Result, "GetInstanceSettingsStructure", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_Map(Result);
|
||||
|
||||
Options = New Structure;
|
||||
@ -20425,7 +20441,7 @@ Procedure CLI_GreenAPI_GetInstanceSettingsStructure(FunctionParameters)
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("greenapi", "GetInstanceSettingsStructure", Options);
|
||||
|
||||
OPI_TestDataRetrieval.WriteLog(Result, "GetInstanceSettingsStructure (empty)", "GreenAPI");
|
||||
OPI_TestDataRetrieval.WriteLogCLI(Result, "GetInstanceSettingsStructure (empty)", "GreenAPI");
|
||||
|
||||
For Each Element In Result Do
|
||||
|
||||
@ -20467,7 +20483,7 @@ Procedure CLI_GreenAPI_SetInstanceSettings(FunctionParameters)
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.WriteLog(Result, "SetInstanceSettings", "GreenAPI");
|
||||
OPI_TestDataRetrieval.WriteLogCLI(Result, "SetInstanceSettings", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_GreenSettingsSaving(Result);
|
||||
|
||||
EndProcedure
|
||||
@ -20492,7 +20508,7 @@ Procedure CLI_GreenAPI_GetInstanceStatus(FunctionParameters)
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("greenapi", "GetInstanceStatus", Options);
|
||||
|
||||
OPI_TestDataRetrieval.WriteLog(Result, "GetInstanceStatus", "GreenAPI");
|
||||
OPI_TestDataRetrieval.WriteLogCLI(Result, "GetInstanceStatus", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_GreenAuth(Result);
|
||||
|
||||
EndProcedure
|
||||
@ -20517,7 +20533,7 @@ Procedure CLI_GreenAPI_RebootInstance(FunctionParameters)
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("greenapi", "RebootInstance", Options);
|
||||
|
||||
OPI_TestDataRetrieval.WriteLog(Result, "RebootInstance", "GreenAPI");
|
||||
OPI_TestDataRetrieval.WriteLogCLI(Result, "RebootInstance", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_GreenReboot(Result);
|
||||
|
||||
EndProcedure
|
||||
@ -20542,7 +20558,7 @@ Procedure CLI_GreenAPI_GetQR(FunctionParameters)
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("greenapi", "GetQR", Options);
|
||||
|
||||
OPI_TestDataRetrieval.WriteLog(Result, "GetQR", "GreenAPI");
|
||||
OPI_TestDataRetrieval.WriteLogCLI(Result, "GetQR", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_GreenAuth(Result);
|
||||
|
||||
EndProcedure
|
||||
@ -20567,7 +20583,7 @@ Procedure CLI_GreenAPI_LogoutInstance(FunctionParameters)
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("greenapi", "LogoutInstance", Options);
|
||||
|
||||
OPI_TestDataRetrieval.WriteLog(Result, "LogoutInstance", "GreenAPI");
|
||||
OPI_TestDataRetrieval.WriteLogCLI(Result, "LogoutInstance", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_GreenReboot(Result);
|
||||
|
||||
EndProcedure
|
||||
@ -20798,7 +20814,13 @@ Procedure CLI_GreenAPI_ExcludeGroupMember(FunctionParameters)
|
||||
GroupID = FunctionParameters["GreenAPI_GroupID"];
|
||||
UserID = "123123123@c.us";
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Options = New Structure;
|
||||
Options.Insert("api" , ApiUrl);
|
||||
Options.Insert("media", MediaUrl);
|
||||
Options.Insert("id" , IdInstance);
|
||||
Options.Insert("token", ApiTokenInstance);
|
||||
|
||||
AccessParameters = OPI_TestDataRetrieval.ExecuteTestCLI("greenapi", "FormAccessParameters", Options);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("access", AccessParameters);
|
||||
@ -20828,7 +20850,13 @@ Procedure CLI_GreenAPI_SetAdminRights(FunctionParameters)
|
||||
GroupID = FunctionParameters["GreenAPI_GroupID"];
|
||||
UserID = "123123123@c.us";
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Options = New Structure;
|
||||
Options.Insert("api" , ApiUrl);
|
||||
Options.Insert("media", MediaUrl);
|
||||
Options.Insert("id" , IdInstance);
|
||||
Options.Insert("token", ApiTokenInstance);
|
||||
|
||||
AccessParameters = OPI_TestDataRetrieval.ExecuteTestCLI("greenapi", "FormAccessParameters", Options);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("access", AccessParameters);
|
||||
@ -20843,7 +20871,7 @@ Procedure CLI_GreenAPI_SetAdminRights(FunctionParameters)
|
||||
Message("Failed to replace the secrets!");
|
||||
EndTry;
|
||||
|
||||
OPI_TestDataRetrieval.WriteLog(Result, "SetAdminRights", "GreenAPI");
|
||||
OPI_TestDataRetrieval.WriteLogCLI(Result, "SetAdminRights", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_GreenAdminSet(Result);
|
||||
|
||||
EndProcedure
|
||||
@ -20858,7 +20886,13 @@ Procedure CLI_GreenAPI_RevokeAdminRights(FunctionParameters)
|
||||
GroupID = FunctionParameters["GreenAPI_GroupID"];
|
||||
UserID = "123123123@c.us";
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Options = New Structure;
|
||||
Options.Insert("api" , ApiUrl);
|
||||
Options.Insert("media", MediaUrl);
|
||||
Options.Insert("id" , IdInstance);
|
||||
Options.Insert("token", ApiTokenInstance);
|
||||
|
||||
AccessParameters = OPI_TestDataRetrieval.ExecuteTestCLI("greenapi", "FormAccessParameters", Options);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("access", AccessParameters);
|
||||
@ -20873,11 +20907,110 @@ Procedure CLI_GreenAPI_RevokeAdminRights(FunctionParameters)
|
||||
Message("Failed to replace the secrets!");
|
||||
EndTry;
|
||||
|
||||
OPI_TestDataRetrieval.WriteLog(Result, "RevokeAdminRights", "GreenAPI");
|
||||
OPI_TestDataRetrieval.WriteLogCLI(Result, "RevokeAdminRights", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_GreenAdminRemove(Result);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure CLI_GreenAPI_SendTextMessage(FunctionParameters)
|
||||
|
||||
ApiUrl = FunctionParameters["GreenAPI_ApiURL"];
|
||||
MediaUrl = FunctionParameters["GreenAPI_MediaURL"];
|
||||
IdInstance = FunctionParameters["GreenAPI_IdInstance"];
|
||||
ApiTokenInstance = FunctionParameters["GreenAPI_Token"];
|
||||
|
||||
ChatID = FunctionParameters["GreenAPI_TestGroupID"];
|
||||
Text = "New message";
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("api" , ApiUrl);
|
||||
Options.Insert("media", MediaUrl);
|
||||
Options.Insert("id" , IdInstance);
|
||||
Options.Insert("token", ApiTokenInstance);
|
||||
|
||||
AccessParameters = OPI_TestDataRetrieval.ExecuteTestCLI("greenapi", "FormAccessParameters", Options);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("access", AccessParameters);
|
||||
Options.Insert("chat" , ChatID);
|
||||
Options.Insert("text" , Text);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("greenapi", "SendTextMessage", Options);
|
||||
|
||||
OPI_TestDataRetrieval.WriteLogCLI(Result, "SendTextMessage", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_GreenMessage(Result);
|
||||
|
||||
MessageID = Result["idMessage"];
|
||||
OPI_TestDataRetrieval.WriteParameter("GreenAPI_MessageID", MessageID);
|
||||
OPI_Tools.AddField("GreenAPI_MessageID", MessageID, "String", FunctionParameters);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("access", AccessParameters);
|
||||
Options.Insert("chat" , ChatID);
|
||||
Options.Insert("text" , Text);
|
||||
Options.Insert("quoted", MessageID);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("greenapi", "SendTextMessage", Options);
|
||||
|
||||
OPI_TestDataRetrieval.WriteLogCLI(Result, "SendTextMessage (quote)", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_GreenMessage(Result);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure CLI_GreenAPI_SendFile(FunctionParameters)
|
||||
|
||||
ApiUrl = FunctionParameters["GreenAPI_ApiURL"];
|
||||
MediaUrl = FunctionParameters["GreenAPI_MediaURL"];
|
||||
IdInstance = FunctionParameters["GreenAPI_IdInstance"];
|
||||
ApiTokenInstance = FunctionParameters["GreenAPI_Token"];
|
||||
|
||||
File = FunctionParameters["Picture"]; // URL, Path or Binary Data
|
||||
FileName = "photo.jpg";
|
||||
ChatID = FunctionParameters["GreenAPI_TestGroupID"];
|
||||
Description = "File description";
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("api" , ApiUrl);
|
||||
Options.Insert("media", MediaUrl);
|
||||
Options.Insert("id" , IdInstance);
|
||||
Options.Insert("token", ApiTokenInstance);
|
||||
|
||||
AccessParameters = OPI_TestDataRetrieval.ExecuteTestCLI("greenapi", "FormAccessParameters", Options);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("access" , AccessParameters);
|
||||
Options.Insert("chat" , ChatID);
|
||||
Options.Insert("file" , File);
|
||||
Options.Insert("filename", FileName);
|
||||
Options.Insert("caption" , Description);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("greenapi", "SendFile", Options);
|
||||
|
||||
OPI_TestDataRetrieval.WriteLogCLI(Result, "SendFile", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_GreenFile(Result);
|
||||
|
||||
MessageID = Result["idMessage"];
|
||||
OPI_TestDataRetrieval.WriteParameter("GreenAPI_FileMessageID", MessageID);
|
||||
OPI_Tools.AddField("GreenAPI_FileMessageID", MessageID, "String", FunctionParameters);
|
||||
|
||||
File = FunctionParameters["Video"];
|
||||
FileName = "vid.mp4";
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("access" , AccessParameters);
|
||||
Options.Insert("chat" , ChatID);
|
||||
Options.Insert("file" , File);
|
||||
Options.Insert("filename", FileName);
|
||||
Options.Insert("caption" , Description);
|
||||
Options.Insert("quoted" , MessageID);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("greenapi", "SendFile", Options);
|
||||
|
||||
OPI_TestDataRetrieval.WriteLogCLI(Result, "SendFile (quote)", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_GreenFile(Result);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
|
||||
#EndRegion
|
||||
|
@ -281,6 +281,7 @@ Function GetTestTable() Export
|
||||
NewTest(TestTable, "Postgres_ORM" , "ORM" , Postgres);
|
||||
NewTest(TestTable, "GAPI_GroupManagement" , "Group management" , GreenAPI);
|
||||
NewTest(TestTable, "GAPI_Account" , "Account" , GreenAPI);
|
||||
NewTest(TestTable, "GAPI_MessageSending" , "Messages sending" , GreenAPI);
|
||||
|
||||
Return TestTable;
|
||||
|
||||
@ -2238,6 +2239,19 @@ Procedure Check_GreenAdminRemove(Val Result) Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Check_GreenMessage(Val Result) Export
|
||||
|
||||
ExpectsThat(Result["idMessage"]).Заполнено();
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Check_GreenFile(Val Result) Export
|
||||
|
||||
ExpectsThat(Result["idMessage"]).Заполнено();
|
||||
ExpectsThat(Result["urlFile"]).Заполнено();
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
|
||||
#EndRegion
|
||||
|
@ -549,27 +549,114 @@ EndFunction
|
||||
|
||||
#EndRegion
|
||||
|
||||
#Region MessageSending
|
||||
|
||||
// Send text message
|
||||
// Sends a text message to the selected chat room
|
||||
//
|
||||
// Note
|
||||
// Method at API documentation: [SendMessage](@green-api.com/docs/api/sending/SendMessage/)
|
||||
//
|
||||
// Parameters:
|
||||
// AccessParameters - Structure Of KeyAndValue - Access parameters. See FormAccessParameters - access
|
||||
// ChatID - String - Chat identifier - chat
|
||||
// Text - String - Message text - text
|
||||
// ReplyID - String - Replying message id if necessary - quoted
|
||||
//
|
||||
// Returns:
|
||||
// Map Of KeyAndValue - serialized JSON response from Green API
|
||||
Function SendTextMessage(Val AccessParameters, Val ChatID, Val Text, Val ReplyID = "") Export
|
||||
|
||||
Parameters = New Structure;
|
||||
|
||||
OPI_Tools.AddField("chatId" , ChatID , "String", Parameters);
|
||||
OPI_Tools.AddField("message" , Text , "String", Parameters);
|
||||
OPI_Tools.AddField("quotedMessageId", ReplyID, "String", Parameters);
|
||||
|
||||
URL = FormPrimaryURL(AccessParameters, "sendMessage");
|
||||
Response = OPI_Tools.Post(URL, Parameters);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Send file
|
||||
// Sends the file to the selected chat room
|
||||
//
|
||||
// Note
|
||||
// Method at API documentation: [SendFileByUpload](@green-api.com/docs/api/sending/SendFileByUpload/)
|
||||
//
|
||||
// Parameters:
|
||||
// AccessParameters - Structure Of KeyAndValue - Access parameters. See FormAccessParameters - access
|
||||
// ChatID - String - Chat identifier - chat
|
||||
// File - String, BinaryData - File data or filepath - file
|
||||
// FileName - String - Name of the file with the extension - filename
|
||||
// Description - String - Message text below the file - caption
|
||||
// ReplyID - String - Replying message id if necessary - quoted
|
||||
//
|
||||
// Returns:
|
||||
// Map Of KeyAndValue - serialized JSON response from Green API
|
||||
Function SendFile(Val AccessParameters
|
||||
, Val ChatID
|
||||
, Val File
|
||||
, Val FileName
|
||||
, Val Description = ""
|
||||
, Val ReplyID = "") Export
|
||||
|
||||
OPI_TypeConversion.GetBinaryData(File);
|
||||
|
||||
Parameters = New Structure;
|
||||
|
||||
OPI_Tools.AddField("chatId" , ChatID , "String", Parameters);
|
||||
OPI_Tools.AddField("fileName" , FileName , "String", Parameters);
|
||||
OPI_Tools.AddField("caption" , Description , "String", Parameters);
|
||||
OPI_Tools.AddField("quotedMessageId", ReplyID , "String", Parameters);
|
||||
|
||||
FileMapping = New Map();
|
||||
FileMapping.Insert(StrTemplate("file|%1", FileName), File);
|
||||
|
||||
URL = FormMediaURL(AccessParameters, "SendFileByUpload");
|
||||
Response = OPI_Tools.PostMultipart(URL, Parameters, FileMapping);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
#EndRegion
|
||||
|
||||
#EndRegion
|
||||
|
||||
#Region Private
|
||||
|
||||
Function FormPrimaryURL(Val AccessParameters, Val Method)
|
||||
|
||||
Return FormURL(AccessParameters, Method, "apiUrl");
|
||||
|
||||
EndFunction
|
||||
|
||||
Function FormMediaURL(Val AccessParameters, Val Method)
|
||||
|
||||
Return FormURL(AccessParameters, Method, "mediaUrl");
|
||||
|
||||
EndFunction
|
||||
|
||||
Function FormURL(AccessParameters, Method, URLField)
|
||||
|
||||
OPI_TypeConversion.GetKeyValueCollection(AccessParameters);
|
||||
OPI_TypeConversion.GetLine(Method);
|
||||
|
||||
RequiredFields = StrSplit("apiUrl,idInstance,apiTokenInstance", ",");
|
||||
RequiredFields = StrSplit(URLField + ",idInstance,apiTokenInstance", ",");
|
||||
MissingFields = OPI_Tools.FindMissingCollectionFields(AccessParameters, RequiredFields);
|
||||
|
||||
If MissingFields.Count() > 0 Then
|
||||
Raise "Missing mandatory fields in access parameters!";
|
||||
EndIf;
|
||||
|
||||
ApiUrl = AccessParameters["apiUrl"];
|
||||
Url = AccessParameters[URLField];
|
||||
IdInstance = AccessParameters["idInstance"];
|
||||
ApiTokenInstance = AccessParameters["apiTokenInstance"];
|
||||
|
||||
URL = StrTemplate("%1/waInstance%2/%3/%4", ApiUrl, IdInstance, Method, ApiTokenInstance);
|
||||
URL = StrTemplate("%1/waInstance%2/%3/%4", Url, IdInstance, Method, ApiTokenInstance);
|
||||
|
||||
Return URL;
|
||||
|
||||
|
@ -281,6 +281,7 @@ Function GetTestTable() Export
|
||||
NewTest(TestTable, "Postgres_ORM" , "ORM" , Postgres);
|
||||
NewTest(TestTable, "GAPI_GroupManagement" , "Group management" , GreenAPI);
|
||||
NewTest(TestTable, "GAPI_Account" , "Account" , GreenAPI);
|
||||
NewTest(TestTable, "GAPI_MessageSending" , "Messages sending" , GreenAPI);
|
||||
|
||||
Return TestTable;
|
||||
|
||||
@ -2238,6 +2239,19 @@ Procedure Check_GreenAdminRemove(Val Result) Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Check_GreenMessage(Val Result) Export
|
||||
|
||||
ExpectsThat(Result["idMessage"]).Заполнено();
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure Check_GreenFile(Val Result) Export
|
||||
|
||||
ExpectsThat(Result["idMessage"]).Заполнено();
|
||||
ExpectsThat(Result["urlFile"]).Заполнено();
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
|
||||
#EndRegion
|
||||
|
174
src/en/OPI/src/CommonModules/OPI_Tests/Module.bsl
vendored
174
src/en/OPI/src/CommonModules/OPI_Tests/Module.bsl
vendored
@ -2419,6 +2419,22 @@ Procedure GAPI_GroupManagement() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GAPI_MessageSending() Export
|
||||
|
||||
TestParameters = New Structure;
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GreenAPI_ApiURL" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GreenAPI_MediaURL" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GreenAPI_IdInstance" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GreenAPI_Token" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GreenAPI_TestGroupID", TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("Picture" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("Video" , TestParameters);
|
||||
|
||||
GreenAPI_SendTextMessage(TestParameters);
|
||||
GreenAPI_SendFile(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
|
||||
#EndRegion
|
||||
@ -4030,21 +4046,21 @@ Procedure VK_AddProduct(FunctionParameters)
|
||||
ImageArray.Add(Image2);
|
||||
|
||||
ProductDescription = New Map;
|
||||
ProductDescription.Insert("Name" , "TestProduct");
|
||||
ProductDescription.Insert("Description" , "Product description");
|
||||
ProductDescription.Insert("Category" , "20173");
|
||||
ProductDescription.Insert("Price" , 1);
|
||||
ProductDescription.Insert("OldPrice" , 15);
|
||||
ProductDescription.Insert("MainPhoto" , Image1);
|
||||
ProductDescription.Insert("URL" , "https://github.com/Bayselonarrend/OpenIntegrations");
|
||||
ProductDescription.Insert("AdditionalPhotos", ImageArray);
|
||||
ProductDescription.Insert("MainInGroup" , True);
|
||||
ProductDescription.Insert("Width" , 20);
|
||||
ProductDescription.Insert("Height" , 30);
|
||||
ProductDescription.Insert("Depth" , 40);
|
||||
ProductDescription.Insert("Weight" , 100);
|
||||
ProductDescription.Insert("SKU" , "12345");
|
||||
ProductDescription.Insert("AvailableBalance", "10");
|
||||
ProductDescription.Insert("Name" , "TestProduct");
|
||||
ProductDescription.Insert("Description" , "Product description");
|
||||
ProductDescription.Insert("Category" , "20173");
|
||||
ProductDescription.Insert("Price" , 1);
|
||||
ProductDescription.Insert("OldPrice" , 15);
|
||||
ProductDescription.Insert("MainPhoto" , Image1);
|
||||
ProductDescription.Insert("URL" , "https://github.com/Bayselonarrend/OpenIntegrations");
|
||||
ProductDescription.Insert("AdditionalPhotos" , ImageArray);
|
||||
ProductDescription.Insert("MainInGroup" , True);
|
||||
ProductDescription.Insert("Width" , 20);
|
||||
ProductDescription.Insert("Height" , 30);
|
||||
ProductDescription.Insert("Depth" , 40);
|
||||
ProductDescription.Insert("Weight" , 100);
|
||||
ProductDescription.Insert("SKU" , "12345");
|
||||
ProductDescription.Insert("AvailableBalance" , "10");
|
||||
|
||||
Result = OPI_VK.AddProduct(ProductDescription, Selection, Parameters);
|
||||
|
||||
@ -4261,23 +4277,23 @@ Procedure VK_CreateProductWithProp(FunctionParameters)
|
||||
ImageArray.Add(Image2);
|
||||
|
||||
Product = New Map;
|
||||
Product.Insert("Name" , "Test product (with prop)");
|
||||
Product.Insert("Description" , "Product description");
|
||||
Product.Insert("Category" , "20173");
|
||||
Product.Insert("Price" , 1);
|
||||
Product.Insert("OldPrice" , 15);
|
||||
Product.Insert("MainPhoto" , Image1);
|
||||
Product.Insert("URL" , "https://github.com/Bayselonarrend/OpenIntegrations");
|
||||
Product.Insert("AdditionalPhotos", ImageArray);
|
||||
Product.Insert("MainInGroup" , True);
|
||||
Product.Insert("GroupNumber" , Undefined);
|
||||
Product.Insert("Width" , 20);
|
||||
Product.Insert("Height" , 30);
|
||||
Product.Insert("Depth" , 40);
|
||||
Product.Insert("Weight" , 100);
|
||||
Product.Insert("SKU" , 12345);
|
||||
Product.Insert("AvailableBalance", "10");
|
||||
Product.Insert("PropertyValues" , PropVariant1);
|
||||
Product.Insert("Name" , "Test product (with prop)");
|
||||
Product.Insert("Description" , "Product description");
|
||||
Product.Insert("Category" , "20173");
|
||||
Product.Insert("Price" , 1);
|
||||
Product.Insert("OldPrice" , 15);
|
||||
Product.Insert("MainPhoto" , Image1);
|
||||
Product.Insert("URL" , "https://github.com/Bayselonarrend/OpenIntegrations");
|
||||
Product.Insert("AdditionalPhotos" , ImageArray);
|
||||
Product.Insert("MainInGroup" , True);
|
||||
Product.Insert("GroupNumber" , Undefined);
|
||||
Product.Insert("Width" , 20);
|
||||
Product.Insert("Height" , 30);
|
||||
Product.Insert("Depth" , 40);
|
||||
Product.Insert("Weight" , 100);
|
||||
Product.Insert("SKU" , 12345);
|
||||
Product.Insert("AvailableBalance" , "10");
|
||||
Product.Insert("PropertyValues" , PropVariant1);
|
||||
|
||||
Result = OPI_VK.AddProduct(Product, , Parameters);
|
||||
|
||||
@ -7285,9 +7301,9 @@ Procedure Notion_CreateDatabase(FunctionParameters)
|
||||
Properties.Insert("User" , "people");
|
||||
|
||||
ValueSelection = New Map;
|
||||
ValueSelection.Insert("New" , "green");
|
||||
ValueSelection.Insert("InProgress", "yellow");
|
||||
ValueSelection.Insert("Remote" , "red");
|
||||
ValueSelection.Insert("New" , "green");
|
||||
ValueSelection.Insert("InProgress" , "yellow");
|
||||
ValueSelection.Insert("Remote" , "red");
|
||||
|
||||
Properties.Insert("Status", ValueSelection);
|
||||
|
||||
@ -7860,7 +7876,7 @@ Procedure Dropbox_GetTagList(FunctionParameters)
|
||||
|
||||
For Each Tag In Result["paths_to_tags"][0]["tags"] Do
|
||||
If Tag["tag_text"] = "important" Then
|
||||
HasTag = True;
|
||||
HasTag = True;
|
||||
EndIf;
|
||||
EndDo;
|
||||
|
||||
@ -8004,8 +8020,8 @@ Procedure Dropbox_CancelFolderPublication(FunctionParameters)
|
||||
JobID = Result["async_job_id"];
|
||||
|
||||
While CurrentStatus = "in_progress" Do
|
||||
Result = OPI_Dropbox.GetAsynchronousChangeStatus(Token, JobID);
|
||||
CurrentStatus = Result[".tag"];
|
||||
Result = OPI_Dropbox.GetAsynchronousChangeStatus(Token, JobID);
|
||||
CurrentStatus = Result[".tag"];
|
||||
OPI_Tools.Pause(3);
|
||||
EndDo;
|
||||
|
||||
@ -10999,8 +11015,8 @@ Procedure Bitrix24_SendMessage(FunctionParameters)
|
||||
File = "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/document.docx";
|
||||
|
||||
Attachments = New Array;
|
||||
Attachments.Add(OPI_Bitrix24.GetPictureBlock("Image1" , Image));
|
||||
Attachments.Add(OPI_Bitrix24.GetFileBlock("File1.docx", File));
|
||||
Attachments.Add(OPI_Bitrix24.GetPictureBlock("Image1" , Image));
|
||||
Attachments.Add(OPI_Bitrix24.GetFileBlock("File1.docx" , File));
|
||||
|
||||
Result = OPI_Bitrix24.SendMessage(URL, ChatID, Text, Attachments);
|
||||
|
||||
@ -11051,8 +11067,8 @@ Procedure Bitrix24_EditMessage(FunctionParameters)
|
||||
File = "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/document.docx";
|
||||
|
||||
Attachments = New Array;
|
||||
Attachments.Add(OPI_Bitrix24.GetPictureBlock("Image1" , Image));
|
||||
Attachments.Add(OPI_Bitrix24.GetFileBlock("File1.docx", File));
|
||||
Attachments.Add(OPI_Bitrix24.GetPictureBlock("Image1" , Image));
|
||||
Attachments.Add(OPI_Bitrix24.GetFileBlock("File1.docx" , File));
|
||||
|
||||
Result = OPI_Bitrix24.EditMessage(URL, MessageID, Text, Attachments, Token);
|
||||
|
||||
@ -11264,8 +11280,8 @@ Procedure Bitrix24_CreatePersonalNotification(FunctionParameters)
|
||||
File = "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/document.docx";
|
||||
|
||||
Attachments = New Array;
|
||||
Attachments.Add(OPI_Bitrix24.GetPictureBlock("Image1" , Image));
|
||||
Attachments.Add(OPI_Bitrix24.GetFileBlock("File1.docx", File));
|
||||
Attachments.Add(OPI_Bitrix24.GetPictureBlock("Image1" , Image));
|
||||
Attachments.Add(OPI_Bitrix24.GetFileBlock("File1.docx" , File));
|
||||
|
||||
Result = OPI_Bitrix24.CreatePersonalNotification(URL, UserID, Text, , Attachments);
|
||||
|
||||
@ -11306,8 +11322,8 @@ Procedure Bitrix24_CreateSystemNotification(FunctionParameters)
|
||||
File = "https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/document.docx";
|
||||
|
||||
Attachments = New Array;
|
||||
Attachments.Add(OPI_Bitrix24.GetPictureBlock("Image1" , Image));
|
||||
Attachments.Add(OPI_Bitrix24.GetFileBlock("File1.docx", File));
|
||||
Attachments.Add(OPI_Bitrix24.GetPictureBlock("Image1" , Image));
|
||||
Attachments.Add(OPI_Bitrix24.GetFileBlock("File1.docx" , File));
|
||||
|
||||
Result = OPI_Bitrix24.CreateSystemNotification(URL, UserID, Text, , Attachments);
|
||||
|
||||
@ -18345,7 +18361,7 @@ Procedure GreenAPI_SetProfilePicture(FunctionParameters)
|
||||
IdInstance = FunctionParameters["GreenAPI_IdInstance"];
|
||||
ApiTokenInstance = FunctionParameters["GreenAPI_Token"];
|
||||
|
||||
Image = FunctionParameters["Picture"];
|
||||
Image = FunctionParameters["Picture"]; // URL, Path or Binary Data
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Result = OPI_GreenAPI.SetProfilePicture(AccessParameters, Image);
|
||||
@ -18556,7 +18572,7 @@ Procedure GreenAPI_SetGroupPicture(FunctionParameters)
|
||||
IdInstance = FunctionParameters["GreenAPI_IdInstance"];
|
||||
ApiTokenInstance = FunctionParameters["GreenAPI_Token"];
|
||||
|
||||
Image = FunctionParameters["Picture"];
|
||||
Image = FunctionParameters["Picture"]; // URL, Path or Binary Data
|
||||
GroupID = FunctionParameters["GreenAPI_GroupID"];
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
@ -18569,6 +18585,68 @@ Procedure GreenAPI_SetGroupPicture(FunctionParameters)
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GreenAPI_SendTextMessage(FunctionParameters)
|
||||
|
||||
ApiUrl = FunctionParameters["GreenAPI_ApiURL"];
|
||||
MediaUrl = FunctionParameters["GreenAPI_MediaURL"];
|
||||
IdInstance = FunctionParameters["GreenAPI_IdInstance"];
|
||||
ApiTokenInstance = FunctionParameters["GreenAPI_Token"];
|
||||
|
||||
ChatID = FunctionParameters["GreenAPI_TestGroupID"];
|
||||
Text = "New message";
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Result = OPI_GreenAPI.SendTextMessage(AccessParameters, ChatID, Text);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.WriteLog(Result, "SendTextMessage", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_GreenMessage(Result);
|
||||
|
||||
MessageID = Result["idMessage"];
|
||||
OPI_TestDataRetrieval.WriteParameter("GreenAPI_MessageID", MessageID);
|
||||
OPI_Tools.AddField("GreenAPI_MessageID", MessageID, "String", FunctionParameters);
|
||||
|
||||
Result = OPI_GreenAPI.SendTextMessage(AccessParameters, ChatID, Text, MessageID);
|
||||
|
||||
OPI_TestDataRetrieval.WriteLog(Result, "SendTextMessage (quote)", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_GreenMessage(Result);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GreenAPI_SendFile(FunctionParameters)
|
||||
|
||||
ApiUrl = FunctionParameters["GreenAPI_ApiURL"];
|
||||
MediaUrl = FunctionParameters["GreenAPI_MediaURL"];
|
||||
IdInstance = FunctionParameters["GreenAPI_IdInstance"];
|
||||
ApiTokenInstance = FunctionParameters["GreenAPI_Token"];
|
||||
|
||||
File = FunctionParameters["Picture"]; // URL, Path or Binary Data
|
||||
FileName = "photo.jpg";
|
||||
ChatID = FunctionParameters["GreenAPI_TestGroupID"];
|
||||
Description = "File description";
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Result = OPI_GreenAPI.SendFile(AccessParameters, ChatID, File, FileName, Description);
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.WriteLog(Result, "SendFile", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_GreenFile(Result);
|
||||
|
||||
MessageID = Result["idMessage"];
|
||||
OPI_TestDataRetrieval.WriteParameter("GreenAPI_FileMessageID", MessageID);
|
||||
OPI_Tools.AddField("GreenAPI_FileMessageID", MessageID, "String", FunctionParameters);
|
||||
|
||||
File = FunctionParameters["Video"];
|
||||
FileName = "vid.mp4";
|
||||
Result = OPI_GreenAPI.SendFile(AccessParameters, ChatID, File, FileName, Description, MessageID);
|
||||
|
||||
OPI_TestDataRetrieval.WriteLog(Result, "SendFile (quote)", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_GreenFile(Result);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
|
||||
#EndRegion
|
||||
|
161
src/en/OPI/src/CommonModules/OPI_TestsCLI/Module.bsl
vendored
161
src/en/OPI/src/CommonModules/OPI_TestsCLI/Module.bsl
vendored
@ -2385,6 +2385,22 @@ Procedure CLI_GAPI_GroupManagement() Export
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure CLI_GAPI_MessageSending() Export
|
||||
|
||||
TestParameters = New Structure;
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GreenAPI_ApiURL" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GreenAPI_MediaURL" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GreenAPI_IdInstance" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GreenAPI_Token" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("GreenAPI_TestGroupID", TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("Picture" , TestParameters);
|
||||
OPI_TestDataRetrieval.ParameterToCollection("Video" , TestParameters);
|
||||
|
||||
CLI_GreenAPI_SendTextMessage(TestParameters);
|
||||
CLI_GreenAPI_SendFile(TestParameters);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
|
||||
#EndRegion
|
||||
@ -20344,7 +20360,7 @@ Procedure CLI_GreenAPI_FormAccessParameters(FunctionParameters)
|
||||
// END
|
||||
|
||||
Result.Insert("apiTokenInstance", "***");
|
||||
OPI_TestDataRetrieval.WriteLog(Result, "FormAccessParameters", "GreenAPI");
|
||||
OPI_TestDataRetrieval.WriteLogCLI(Result, "FormAccessParameters", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_Map(Result);
|
||||
|
||||
EndProcedure
|
||||
@ -20371,7 +20387,7 @@ Procedure CLI_GreenAPI_GetInstanceSettings(FunctionParameters)
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.WriteLog(Result, "GetInstanceSettings", "GreenAPI");
|
||||
OPI_TestDataRetrieval.WriteLogCLI(Result, "GetInstanceSettings", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_GreenInstance(Result);
|
||||
|
||||
EndProcedure
|
||||
@ -20417,7 +20433,7 @@ Procedure CLI_GreenAPI_GetInstanceSettingsStructure(FunctionParameters)
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.WriteLog(Result, "GetInstanceSettingsStructure", "GreenAPI");
|
||||
OPI_TestDataRetrieval.WriteLogCLI(Result, "GetInstanceSettingsStructure", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_Map(Result);
|
||||
|
||||
Options = New Structure;
|
||||
@ -20425,7 +20441,7 @@ Procedure CLI_GreenAPI_GetInstanceSettingsStructure(FunctionParameters)
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("greenapi", "GetInstanceSettingsStructure", Options);
|
||||
|
||||
OPI_TestDataRetrieval.WriteLog(Result, "GetInstanceSettingsStructure (empty)", "GreenAPI");
|
||||
OPI_TestDataRetrieval.WriteLogCLI(Result, "GetInstanceSettingsStructure (empty)", "GreenAPI");
|
||||
|
||||
For Each Element In Result Do
|
||||
|
||||
@ -20467,7 +20483,7 @@ Procedure CLI_GreenAPI_SetInstanceSettings(FunctionParameters)
|
||||
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.WriteLog(Result, "SetInstanceSettings", "GreenAPI");
|
||||
OPI_TestDataRetrieval.WriteLogCLI(Result, "SetInstanceSettings", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_GreenSettingsSaving(Result);
|
||||
|
||||
EndProcedure
|
||||
@ -20492,7 +20508,7 @@ Procedure CLI_GreenAPI_GetInstanceStatus(FunctionParameters)
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("greenapi", "GetInstanceStatus", Options);
|
||||
|
||||
OPI_TestDataRetrieval.WriteLog(Result, "GetInstanceStatus", "GreenAPI");
|
||||
OPI_TestDataRetrieval.WriteLogCLI(Result, "GetInstanceStatus", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_GreenAuth(Result);
|
||||
|
||||
EndProcedure
|
||||
@ -20517,7 +20533,7 @@ Procedure CLI_GreenAPI_RebootInstance(FunctionParameters)
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("greenapi", "RebootInstance", Options);
|
||||
|
||||
OPI_TestDataRetrieval.WriteLog(Result, "RebootInstance", "GreenAPI");
|
||||
OPI_TestDataRetrieval.WriteLogCLI(Result, "RebootInstance", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_GreenReboot(Result);
|
||||
|
||||
EndProcedure
|
||||
@ -20542,7 +20558,7 @@ Procedure CLI_GreenAPI_GetQR(FunctionParameters)
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("greenapi", "GetQR", Options);
|
||||
|
||||
OPI_TestDataRetrieval.WriteLog(Result, "GetQR", "GreenAPI");
|
||||
OPI_TestDataRetrieval.WriteLogCLI(Result, "GetQR", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_GreenAuth(Result);
|
||||
|
||||
EndProcedure
|
||||
@ -20567,7 +20583,7 @@ Procedure CLI_GreenAPI_LogoutInstance(FunctionParameters)
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("greenapi", "LogoutInstance", Options);
|
||||
|
||||
OPI_TestDataRetrieval.WriteLog(Result, "LogoutInstance", "GreenAPI");
|
||||
OPI_TestDataRetrieval.WriteLogCLI(Result, "LogoutInstance", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_GreenReboot(Result);
|
||||
|
||||
EndProcedure
|
||||
@ -20798,7 +20814,13 @@ Procedure CLI_GreenAPI_ExcludeGroupMember(FunctionParameters)
|
||||
GroupID = FunctionParameters["GreenAPI_GroupID"];
|
||||
UserID = "123123123@c.us";
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Options = New Structure;
|
||||
Options.Insert("api" , ApiUrl);
|
||||
Options.Insert("media", MediaUrl);
|
||||
Options.Insert("id" , IdInstance);
|
||||
Options.Insert("token", ApiTokenInstance);
|
||||
|
||||
AccessParameters = OPI_TestDataRetrieval.ExecuteTestCLI("greenapi", "FormAccessParameters", Options);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("access", AccessParameters);
|
||||
@ -20828,7 +20850,13 @@ Procedure CLI_GreenAPI_SetAdminRights(FunctionParameters)
|
||||
GroupID = FunctionParameters["GreenAPI_GroupID"];
|
||||
UserID = "123123123@c.us";
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Options = New Structure;
|
||||
Options.Insert("api" , ApiUrl);
|
||||
Options.Insert("media", MediaUrl);
|
||||
Options.Insert("id" , IdInstance);
|
||||
Options.Insert("token", ApiTokenInstance);
|
||||
|
||||
AccessParameters = OPI_TestDataRetrieval.ExecuteTestCLI("greenapi", "FormAccessParameters", Options);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("access", AccessParameters);
|
||||
@ -20843,7 +20871,7 @@ Procedure CLI_GreenAPI_SetAdminRights(FunctionParameters)
|
||||
Message("Failed to replace the secrets!");
|
||||
EndTry;
|
||||
|
||||
OPI_TestDataRetrieval.WriteLog(Result, "SetAdminRights", "GreenAPI");
|
||||
OPI_TestDataRetrieval.WriteLogCLI(Result, "SetAdminRights", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_GreenAdminSet(Result);
|
||||
|
||||
EndProcedure
|
||||
@ -20858,7 +20886,13 @@ Procedure CLI_GreenAPI_RevokeAdminRights(FunctionParameters)
|
||||
GroupID = FunctionParameters["GreenAPI_GroupID"];
|
||||
UserID = "123123123@c.us";
|
||||
|
||||
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Options = New Structure;
|
||||
Options.Insert("api" , ApiUrl);
|
||||
Options.Insert("media", MediaUrl);
|
||||
Options.Insert("id" , IdInstance);
|
||||
Options.Insert("token", ApiTokenInstance);
|
||||
|
||||
AccessParameters = OPI_TestDataRetrieval.ExecuteTestCLI("greenapi", "FormAccessParameters", Options);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("access", AccessParameters);
|
||||
@ -20873,11 +20907,110 @@ Procedure CLI_GreenAPI_RevokeAdminRights(FunctionParameters)
|
||||
Message("Failed to replace the secrets!");
|
||||
EndTry;
|
||||
|
||||
OPI_TestDataRetrieval.WriteLog(Result, "RevokeAdminRights", "GreenAPI");
|
||||
OPI_TestDataRetrieval.WriteLogCLI(Result, "RevokeAdminRights", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_GreenAdminRemove(Result);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure CLI_GreenAPI_SendTextMessage(FunctionParameters)
|
||||
|
||||
ApiUrl = FunctionParameters["GreenAPI_ApiURL"];
|
||||
MediaUrl = FunctionParameters["GreenAPI_MediaURL"];
|
||||
IdInstance = FunctionParameters["GreenAPI_IdInstance"];
|
||||
ApiTokenInstance = FunctionParameters["GreenAPI_Token"];
|
||||
|
||||
ChatID = FunctionParameters["GreenAPI_TestGroupID"];
|
||||
Text = "New message";
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("api" , ApiUrl);
|
||||
Options.Insert("media", MediaUrl);
|
||||
Options.Insert("id" , IdInstance);
|
||||
Options.Insert("token", ApiTokenInstance);
|
||||
|
||||
AccessParameters = OPI_TestDataRetrieval.ExecuteTestCLI("greenapi", "FormAccessParameters", Options);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("access", AccessParameters);
|
||||
Options.Insert("chat" , ChatID);
|
||||
Options.Insert("text" , Text);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("greenapi", "SendTextMessage", Options);
|
||||
|
||||
OPI_TestDataRetrieval.WriteLogCLI(Result, "SendTextMessage", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_GreenMessage(Result);
|
||||
|
||||
MessageID = Result["idMessage"];
|
||||
OPI_TestDataRetrieval.WriteParameter("GreenAPI_MessageID", MessageID);
|
||||
OPI_Tools.AddField("GreenAPI_MessageID", MessageID, "String", FunctionParameters);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("access", AccessParameters);
|
||||
Options.Insert("chat" , ChatID);
|
||||
Options.Insert("text" , Text);
|
||||
Options.Insert("quoted", MessageID);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("greenapi", "SendTextMessage", Options);
|
||||
|
||||
OPI_TestDataRetrieval.WriteLogCLI(Result, "SendTextMessage (quote)", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_GreenMessage(Result);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure CLI_GreenAPI_SendFile(FunctionParameters)
|
||||
|
||||
ApiUrl = FunctionParameters["GreenAPI_ApiURL"];
|
||||
MediaUrl = FunctionParameters["GreenAPI_MediaURL"];
|
||||
IdInstance = FunctionParameters["GreenAPI_IdInstance"];
|
||||
ApiTokenInstance = FunctionParameters["GreenAPI_Token"];
|
||||
|
||||
File = FunctionParameters["Picture"]; // URL, Path or Binary Data
|
||||
FileName = "photo.jpg";
|
||||
ChatID = FunctionParameters["GreenAPI_TestGroupID"];
|
||||
Description = "File description";
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("api" , ApiUrl);
|
||||
Options.Insert("media", MediaUrl);
|
||||
Options.Insert("id" , IdInstance);
|
||||
Options.Insert("token", ApiTokenInstance);
|
||||
|
||||
AccessParameters = OPI_TestDataRetrieval.ExecuteTestCLI("greenapi", "FormAccessParameters", Options);
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("access" , AccessParameters);
|
||||
Options.Insert("chat" , ChatID);
|
||||
Options.Insert("file" , File);
|
||||
Options.Insert("filename", FileName);
|
||||
Options.Insert("caption" , Description);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("greenapi", "SendFile", Options);
|
||||
|
||||
OPI_TestDataRetrieval.WriteLogCLI(Result, "SendFile", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_GreenFile(Result);
|
||||
|
||||
MessageID = Result["idMessage"];
|
||||
OPI_TestDataRetrieval.WriteParameter("GreenAPI_FileMessageID", MessageID);
|
||||
OPI_Tools.AddField("GreenAPI_FileMessageID", MessageID, "String", FunctionParameters);
|
||||
|
||||
File = FunctionParameters["Video"];
|
||||
FileName = "vid.mp4";
|
||||
|
||||
Options = New Structure;
|
||||
Options.Insert("access" , AccessParameters);
|
||||
Options.Insert("chat" , ChatID);
|
||||
Options.Insert("file" , File);
|
||||
Options.Insert("filename", FileName);
|
||||
Options.Insert("caption" , Description);
|
||||
Options.Insert("quoted" , MessageID);
|
||||
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("greenapi", "SendFile", Options);
|
||||
|
||||
OPI_TestDataRetrieval.WriteLogCLI(Result, "SendFile (quote)", "GreenAPI");
|
||||
OPI_TestDataRetrieval.Check_GreenFile(Result);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
|
||||
#EndRegion
|
||||
|
102
src/en/cli/data/Classes/internal/Classes/greenapi.os
vendored
102
src/en/cli/data/Classes/internal/Classes/greenapi.os
vendored
@ -449,6 +449,108 @@
|
||||
NewLine.Описание = "Profile picture";
|
||||
NewLine.Область = "Group management";
|
||||
|
||||
|
||||
NewLine = CompositionTable.Add();
|
||||
NewLine.Библиотека = "greenapi";
|
||||
NewLine.Модуль = "OPI_GreenAPI";
|
||||
NewLine.Метод = "SendTextMessage";
|
||||
NewLine.МетодПоиска = "SENDTEXTMESSAGE";
|
||||
NewLine.Параметр = "--access";
|
||||
NewLine.Описание = "Access parameters. See FormAccessParameters";
|
||||
NewLine.Область = "Message sending";
|
||||
NewLine.ОписаниеМетода = "Sends a text message to the selected chat room";
|
||||
|
||||
|
||||
NewLine = CompositionTable.Add();
|
||||
NewLine.Библиотека = "greenapi";
|
||||
NewLine.Модуль = "OPI_GreenAPI";
|
||||
NewLine.Метод = "SendTextMessage";
|
||||
NewLine.МетодПоиска = "SENDTEXTMESSAGE";
|
||||
NewLine.Параметр = "--chat";
|
||||
NewLine.Описание = "Chat identifier";
|
||||
NewLine.Область = "Message sending";
|
||||
|
||||
|
||||
NewLine = CompositionTable.Add();
|
||||
NewLine.Библиотека = "greenapi";
|
||||
NewLine.Модуль = "OPI_GreenAPI";
|
||||
NewLine.Метод = "SendTextMessage";
|
||||
NewLine.МетодПоиска = "SENDTEXTMESSAGE";
|
||||
NewLine.Параметр = "--text";
|
||||
NewLine.Описание = "Message text";
|
||||
NewLine.Область = "Message sending";
|
||||
|
||||
|
||||
NewLine = CompositionTable.Add();
|
||||
NewLine.Библиотека = "greenapi";
|
||||
NewLine.Модуль = "OPI_GreenAPI";
|
||||
NewLine.Метод = "SendTextMessage";
|
||||
NewLine.МетодПоиска = "SENDTEXTMESSAGE";
|
||||
NewLine.Параметр = "--quoted";
|
||||
NewLine.Описание = "Replying message id if necessary (optional, def. val. - Empty value)";
|
||||
NewLine.Область = "Message sending";
|
||||
|
||||
|
||||
NewLine = CompositionTable.Add();
|
||||
NewLine.Библиотека = "greenapi";
|
||||
NewLine.Модуль = "OPI_GreenAPI";
|
||||
NewLine.Метод = "SendFile";
|
||||
NewLine.МетодПоиска = "SENDFILE";
|
||||
NewLine.Параметр = "--access";
|
||||
NewLine.Описание = "Access parameters. See FormAccessParameters";
|
||||
NewLine.Область = "Message sending";
|
||||
NewLine.ОписаниеМетода = "Sends the file to the selected chat room";
|
||||
|
||||
|
||||
NewLine = CompositionTable.Add();
|
||||
NewLine.Библиотека = "greenapi";
|
||||
NewLine.Модуль = "OPI_GreenAPI";
|
||||
NewLine.Метод = "SendFile";
|
||||
NewLine.МетодПоиска = "SENDFILE";
|
||||
NewLine.Параметр = "--chat";
|
||||
NewLine.Описание = "Chat identifier";
|
||||
NewLine.Область = "Message sending";
|
||||
|
||||
|
||||
NewLine = CompositionTable.Add();
|
||||
NewLine.Библиотека = "greenapi";
|
||||
NewLine.Модуль = "OPI_GreenAPI";
|
||||
NewLine.Метод = "SendFile";
|
||||
NewLine.МетодПоиска = "SENDFILE";
|
||||
NewLine.Параметр = "--file";
|
||||
NewLine.Описание = "File data or filepath";
|
||||
NewLine.Область = "Message sending";
|
||||
|
||||
|
||||
NewLine = CompositionTable.Add();
|
||||
NewLine.Библиотека = "greenapi";
|
||||
NewLine.Модуль = "OPI_GreenAPI";
|
||||
NewLine.Метод = "SendFile";
|
||||
NewLine.МетодПоиска = "SENDFILE";
|
||||
NewLine.Параметр = "--filename";
|
||||
NewLine.Описание = "Name of the file with the extension";
|
||||
NewLine.Область = "Message sending";
|
||||
|
||||
|
||||
NewLine = CompositionTable.Add();
|
||||
NewLine.Библиотека = "greenapi";
|
||||
NewLine.Модуль = "OPI_GreenAPI";
|
||||
NewLine.Метод = "SendFile";
|
||||
NewLine.МетодПоиска = "SENDFILE";
|
||||
NewLine.Параметр = "--caption";
|
||||
NewLine.Описание = "Message text below the file (optional, def. val. - Empty value)";
|
||||
NewLine.Область = "Message sending";
|
||||
|
||||
|
||||
NewLine = CompositionTable.Add();
|
||||
NewLine.Библиотека = "greenapi";
|
||||
NewLine.Модуль = "OPI_GreenAPI";
|
||||
NewLine.Метод = "SendFile";
|
||||
NewLine.МетодПоиска = "SENDFILE";
|
||||
NewLine.Параметр = "--quoted";
|
||||
NewLine.Описание = "Replying message id if necessary (optional, def. val. - Empty value)";
|
||||
NewLine.Область = "Message sending";
|
||||
|
||||
Return CompositionTable;
|
||||
EndFunction
|
||||
|
||||
|
32
src/ru/OInt/core/Modules/OPI_GreenAPI.os
vendored
32
src/ru/OInt/core/Modules/OPI_GreenAPI.os
vendored
@ -451,7 +451,7 @@
|
||||
|
||||
// Назначить права администратора
|
||||
// Назначает пользователя администратором группы
|
||||
//
|
||||
//
|
||||
// Примечание:
|
||||
// Метод в документации API: [SetGroupAdmin](@green-api.com/docs/api/groups/SetGroupAdmin/)
|
||||
//
|
||||
@ -472,7 +472,7 @@
|
||||
|
||||
// Отозвать права администратора
|
||||
// Отзывает права администратора у пользователя
|
||||
//
|
||||
//
|
||||
// Примечание:
|
||||
// Метод в документации API: [RemoveAdmin](@green-api.com/docs/api/groups/RemoveAdmin/)
|
||||
//
|
||||
@ -518,7 +518,7 @@
|
||||
|
||||
// Установить картинку группы
|
||||
// Устанавливает картинку группового чата
|
||||
//
|
||||
//
|
||||
// Примечание:
|
||||
// Метод в документации API: [SetGroupPicture](@green-api.com/docs/api/groups/SetGroupPicture/)
|
||||
//
|
||||
@ -532,7 +532,7 @@
|
||||
Функция УстановитьКартинкуГруппы(Знач ПараметрыДоступа, Знач IDГруппы, Знач Картинка) Экспорт
|
||||
|
||||
OPI_ПреобразованиеТипов.ПолучитьДвоичныеДанные(Картинка);
|
||||
|
||||
|
||||
Параметры = Новый Структура;
|
||||
|
||||
OPI_Инструменты.ДобавитьПоле("groupId", IDГруппы, "Строка", Параметры);
|
||||
@ -553,7 +553,7 @@
|
||||
|
||||
// Отправить текстовое сообщение
|
||||
// Отправляет текстовое сообщение в выбранный чат
|
||||
//
|
||||
//
|
||||
// Примечание:
|
||||
// Метод в документации API: [SendMessage](@green-api.com/docs/api/sending/SendMessage/)
|
||||
//
|
||||
@ -562,11 +562,11 @@
|
||||
// IDЧата - Строка - Идентификатор чата - chat
|
||||
// Текст - Строка - Текст сообщения - text
|
||||
// IDЦитируемого - Строка - ID цитируемого сообщения, если необходимо - quoted
|
||||
//
|
||||
//
|
||||
// Возвращаемое значение:
|
||||
// Соответствие Из КлючИЗначение - сериализованный JSON ответа от Green API
|
||||
Функция ОтправитьТекстовоеСообщение(Знач ПараметрыДоступа, Знач IDЧата, Знач Текст, Знач IDЦитируемого = "") Экспорт
|
||||
|
||||
|
||||
Параметры = Новый Структура;
|
||||
|
||||
OPI_Инструменты.ДобавитьПоле("chatId" , IDЧата , "Строка", Параметры);
|
||||
@ -577,12 +577,12 @@
|
||||
Ответ = OPI_Инструменты.Post(URL, Параметры);
|
||||
|
||||
Возврат Ответ;
|
||||
|
||||
|
||||
КонецФункции
|
||||
|
||||
// Отправить файл
|
||||
// Отправляет файл в выбранный чат
|
||||
//
|
||||
//
|
||||
// Примечание:
|
||||
// Метод в документации API: [SendFileByUpload](@green-api.com/docs/api/sending/SendFileByUpload/)
|
||||
//
|
||||
@ -591,9 +591,9 @@
|
||||
// IDЧата - Строка - Идентификатор чата - chat
|
||||
// Файл - Строка, ДвоичныеДанные - Данные или путь к файлу - file
|
||||
// ИмяФайла - Строка - Имя загружаемого файла с раширением - filename
|
||||
// Описание - Строка - Текст сообщения под файлом - caption
|
||||
// Описание - Строка - Текст сообщения под файлом - caption
|
||||
// IDЦитируемого - Строка - ID цитируемого сообщения, если необходимо - quoted
|
||||
//
|
||||
//
|
||||
// Возвращаемое значение:
|
||||
// Соответствие Из КлючИЗначение - сериализованный JSON ответа от Green API
|
||||
Функция ОтправитьФайл(Знач ПараметрыДоступа
|
||||
@ -604,7 +604,7 @@
|
||||
, Знач IDЦитируемого = "") Экспорт
|
||||
|
||||
OPI_ПреобразованиеТипов.ПолучитьДвоичныеДанные(Файл);
|
||||
|
||||
|
||||
Параметры = Новый Структура;
|
||||
|
||||
OPI_Инструменты.ДобавитьПоле("chatId" , IDЧата , "Строка", Параметры);
|
||||
@ -619,7 +619,7 @@
|
||||
Ответ = OPI_Инструменты.PostMultipart(URL, Параметры, СоответствиеФайла);
|
||||
|
||||
Возврат Ответ;
|
||||
|
||||
|
||||
КонецФункции
|
||||
|
||||
#КонецОбласти
|
||||
@ -641,7 +641,7 @@
|
||||
КонецФункции
|
||||
|
||||
Функция СформироватьURL(ПараметрыДоступа, Метод, ПолеURL)
|
||||
|
||||
|
||||
OPI_ПреобразованиеТипов.ПолучитьКоллекциюКлючИЗначение(ПараметрыДоступа);
|
||||
OPI_ПреобразованиеТипов.ПолучитьСтроку(Метод);
|
||||
|
||||
@ -659,7 +659,7 @@
|
||||
URL = СтрШаблон("%1/waInstance%2/%3/%4", Url, IdInstance, Метод, ApiTokenInstance);
|
||||
|
||||
Возврат URL;
|
||||
|
||||
|
||||
КонецФункции
|
||||
|
||||
Функция ДействиеСУчастникомГруппы(Знач ПараметрыДоступа, Знач IDГруппы, Знач IDПользователя, Знач Метод)
|
||||
@ -673,7 +673,7 @@
|
||||
Ответ = OPI_Инструменты.Post(URL, Параметры);
|
||||
|
||||
Возврат Ответ;
|
||||
|
||||
|
||||
КонецФункции
|
||||
|
||||
#КонецОбласти
|
||||
|
36
src/ru/OInt/tests/Modules/internal/OPI_Тесты.os
vendored
36
src/ru/OInt/tests/Modules/internal/OPI_Тесты.os
vendored
@ -2420,7 +2420,7 @@
|
||||
КонецПроцедуры
|
||||
|
||||
Процедура GAPI_ОтправкаСообщений() Экспорт
|
||||
|
||||
|
||||
ПараметрыТеста = Новый Структура;
|
||||
OPI_ПолучениеДанныхТестов.ПараметрВКоллекцию("GreenAPI_ApiURL" , ПараметрыТеста);
|
||||
OPI_ПолучениеДанныхТестов.ПараметрВКоллекцию("GreenAPI_MediaURL" , ПараметрыТеста);
|
||||
@ -2429,10 +2429,10 @@
|
||||
OPI_ПолучениеДанныхТестов.ПараметрВКоллекцию("GreenAPI_TestGroupID", ПараметрыТеста);
|
||||
OPI_ПолучениеДанныхТестов.ПараметрВКоллекцию("Picture" , ПараметрыТеста);
|
||||
OPI_ПолучениеДанныхТестов.ПараметрВКоллекцию("Video" , ПараметрыТеста);
|
||||
|
||||
|
||||
GreenAPI_ОтправитьТекстовоеСообщение(ПараметрыТеста);
|
||||
GreenAPI_ОтправитьФайл(ПараметрыТеста);
|
||||
|
||||
|
||||
КонецПроцедуры
|
||||
|
||||
#КонецОбласти
|
||||
@ -18602,16 +18602,16 @@
|
||||
|
||||
OPI_ПолучениеДанныхТестов.ЗаписатьЛог(Результат, "ОтправитьТекстовоеСообщение", "GreenAPI");
|
||||
OPI_ПолучениеДанныхТестов.Проверка_ГринСообщение(Результат);
|
||||
|
||||
|
||||
IDСообщения = Результат["idMessage"];
|
||||
OPI_ПолучениеДанныхТестов.ЗаписатьПараметр("GreenAPI_MessageID", IDСообщения);
|
||||
OPI_Инструменты.ДобавитьПоле("GreenAPI_MessageID", IDСообщения, "Строка", ПараметрыФункции);
|
||||
|
||||
Результат = OPI_GreenAPI.ОтправитьТекстовоеСообщение(ПараметрыДоступа, IDЧата, Текст, IDСообщения);
|
||||
|
||||
|
||||
Результат = OPI_GreenAPI.ОтправитьТекстовоеСообщение(ПараметрыДоступа, IDЧата, Текст, IDСообщения);
|
||||
|
||||
OPI_ПолучениеДанныхТестов.ЗаписатьЛог(Результат, "ОтправитьТекстовоеСообщение (цитата)", "GreenAPI");
|
||||
OPI_ПолучениеДанныхТестов.Проверка_ГринСообщение(Результат);
|
||||
|
||||
OPI_ПолучениеДанныхТестов.Проверка_ГринСообщение(Результат);
|
||||
|
||||
КонецПроцедуры
|
||||
|
||||
Процедура GreenAPI_ОтправитьФайл(ПараметрыФункции)
|
||||
@ -18621,10 +18621,10 @@
|
||||
IdInstance = ПараметрыФункции["GreenAPI_IdInstance"];
|
||||
ApiTokenInstance = ПараметрыФункции["GreenAPI_Token"];
|
||||
|
||||
Файл = ПараметрыФункции["Picture"]; // URL, Путь или Двоичные данные
|
||||
ИмяФайла = "photo.jpg";
|
||||
IDЧата = ПараметрыФункции["GreenAPI_TestGroupID"];
|
||||
Описание = "Описание файла";
|
||||
Файл = ПараметрыФункции["Picture"]; // URL, Путь или Двоичные данные
|
||||
ИмяФайла = "photo.jpg";
|
||||
IDЧата = ПараметрыФункции["GreenAPI_TestGroupID"];
|
||||
Описание = "Описание файла";
|
||||
|
||||
ПараметрыДоступа = OPI_GreenAPI.СформироватьПараметрыДоступа(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Результат = OPI_GreenAPI.ОтправитьФайл(ПараметрыДоступа, IDЧата, Файл, ИмяФайла, Описание);
|
||||
@ -18633,18 +18633,18 @@
|
||||
|
||||
OPI_ПолучениеДанныхТестов.ЗаписатьЛог(Результат, "ОтправитьФайл", "GreenAPI");
|
||||
OPI_ПолучениеДанныхТестов.Проверка_ГринФайл(Результат);
|
||||
|
||||
|
||||
IDСообщения = Результат["idMessage"];
|
||||
OPI_ПолучениеДанныхТестов.ЗаписатьПараметр("GreenAPI_FileMessageID", IDСообщения);
|
||||
OPI_Инструменты.ДобавитьПоле("GreenAPI_FileMessageID", IDСообщения, "Строка", ПараметрыФункции);
|
||||
|
||||
OPI_Инструменты.ДобавитьПоле("GreenAPI_FileMessageID", IDСообщения, "Строка", ПараметрыФункции);
|
||||
|
||||
Файл = ПараметрыФункции["Video"];
|
||||
ИмяФайла = "vid.mp4";
|
||||
Результат = OPI_GreenAPI.ОтправитьФайл(ПараметрыДоступа, IDЧата, Файл, ИмяФайла, Описание, IDСообщения);
|
||||
|
||||
|
||||
OPI_ПолучениеДанныхТестов.ЗаписатьЛог(Результат, "ОтправитьФайл (цитата)", "GreenAPI");
|
||||
OPI_ПолучениеДанныхТестов.Проверка_ГринФайл(Результат);
|
||||
|
||||
|
||||
КонецПроцедуры
|
||||
|
||||
#КонецОбласти
|
||||
|
@ -2386,7 +2386,7 @@
|
||||
КонецПроцедуры
|
||||
|
||||
Процедура CLI_GAPI_ОтправкаСообщений() Экспорт
|
||||
|
||||
|
||||
ПараметрыТеста = Новый Структура;
|
||||
OPI_ПолучениеДанныхТестов.ПараметрВКоллекцию("GreenAPI_ApiURL" , ПараметрыТеста);
|
||||
OPI_ПолучениеДанныхТестов.ПараметрВКоллекцию("GreenAPI_MediaURL" , ПараметрыТеста);
|
||||
@ -2395,10 +2395,10 @@
|
||||
OPI_ПолучениеДанныхТестов.ПараметрВКоллекцию("GreenAPI_TestGroupID", ПараметрыТеста);
|
||||
OPI_ПолучениеДанныхТестов.ПараметрВКоллекцию("Picture" , ПараметрыТеста);
|
||||
OPI_ПолучениеДанныхТестов.ПараметрВКоллекцию("Video" , ПараметрыТеста);
|
||||
|
||||
|
||||
CLI_GreenAPI_ОтправитьТекстовоеСообщение(ПараметрыТеста);
|
||||
CLI_GreenAPI_ОтправитьФайл(ПараметрыТеста);
|
||||
|
||||
|
||||
КонецПроцедуры
|
||||
|
||||
#КонецОбласти
|
||||
@ -20935,15 +20935,15 @@
|
||||
Опции.Вставить("chat" , IDЧата);
|
||||
Опции.Вставить("text" , Текст);
|
||||
|
||||
Результат = OPI_ПолучениеДанныхТестов.ВыполнитьТестCLI("greenapi", "ОтправитьТекстовоеСообщение", Опции);
|
||||
Результат = OPI_ПолучениеДанныхТестов.ВыполнитьТестCLI("greenapi", "ОтправитьТекстовоеСообщение", Опции);
|
||||
|
||||
OPI_ПолучениеДанныхТестов.ЗаписатьЛогCLI(Результат, "ОтправитьТекстовоеСообщение", "GreenAPI");
|
||||
OPI_ПолучениеДанныхТестов.Проверка_ГринСообщение(Результат);
|
||||
|
||||
|
||||
IDСообщения = Результат["idMessage"];
|
||||
OPI_ПолучениеДанныхТестов.ЗаписатьПараметр("GreenAPI_MessageID", IDСообщения);
|
||||
OPI_Инструменты.ДобавитьПоле("GreenAPI_MessageID", IDСообщения, "Строка", ПараметрыФункции);
|
||||
|
||||
|
||||
Опции = Новый Структура;
|
||||
Опции.Вставить("access", ПараметрыДоступа);
|
||||
Опции.Вставить("chat" , IDЧата);
|
||||
@ -20951,10 +20951,10 @@
|
||||
Опции.Вставить("quoted", IDСообщения);
|
||||
|
||||
Результат = OPI_ПолучениеДанныхТестов.ВыполнитьТестCLI("greenapi", "ОтправитьТекстовоеСообщение", Опции);
|
||||
|
||||
|
||||
OPI_ПолучениеДанныхТестов.ЗаписатьЛогCLI(Результат, "ОтправитьТекстовоеСообщение (цитата)", "GreenAPI");
|
||||
OPI_ПолучениеДанныхТестов.Проверка_ГринСообщение(Результат);
|
||||
|
||||
OPI_ПолучениеДанныхТестов.Проверка_ГринСообщение(Результат);
|
||||
|
||||
КонецПроцедуры
|
||||
|
||||
Процедура CLI_GreenAPI_ОтправитьФайл(ПараметрыФункции)
|
||||
@ -20964,10 +20964,10 @@
|
||||
IdInstance = ПараметрыФункции["GreenAPI_IdInstance"];
|
||||
ApiTokenInstance = ПараметрыФункции["GreenAPI_Token"];
|
||||
|
||||
Файл = ПараметрыФункции["Picture"]; // URL, Путь или Двоичные данные
|
||||
ИмяФайла = "photo.jpg";
|
||||
IDЧата = ПараметрыФункции["GreenAPI_TestGroupID"];
|
||||
Описание = "Описание файла";
|
||||
Файл = ПараметрыФункции["Picture"]; // URL, Путь или Двоичные данные
|
||||
ИмяФайла = "photo.jpg";
|
||||
IDЧата = ПараметрыФункции["GreenAPI_TestGroupID"];
|
||||
Описание = "Описание файла";
|
||||
|
||||
Опции = Новый Структура;
|
||||
Опции.Вставить("api" , ApiUrl);
|
||||
@ -20988,14 +20988,14 @@
|
||||
|
||||
OPI_ПолучениеДанныхТестов.ЗаписатьЛогCLI(Результат, "ОтправитьФайл", "GreenAPI");
|
||||
OPI_ПолучениеДанныхТестов.Проверка_ГринФайл(Результат);
|
||||
|
||||
|
||||
IDСообщения = Результат["idMessage"];
|
||||
OPI_ПолучениеДанныхТестов.ЗаписатьПараметр("GreenAPI_FileMessageID", IDСообщения);
|
||||
OPI_Инструменты.ДобавитьПоле("GreenAPI_FileMessageID", IDСообщения, "Строка", ПараметрыФункции);
|
||||
|
||||
Файл = ПараметрыФункции["Video"];
|
||||
ИмяФайла = "vid.mp4";
|
||||
|
||||
OPI_Инструменты.ДобавитьПоле("GreenAPI_FileMessageID", IDСообщения, "Строка", ПараметрыФункции);
|
||||
|
||||
Файл = ПараметрыФункции["Video"];
|
||||
ИмяФайла = "vid.mp4";
|
||||
|
||||
Опции = Новый Структура;
|
||||
Опции.Вставить("access" , ПараметрыДоступа);
|
||||
Опции.Вставить("chat" , IDЧата);
|
||||
@ -21005,10 +21005,10 @@
|
||||
Опции.Вставить("quoted" , IDСообщения);
|
||||
|
||||
Результат = OPI_ПолучениеДанныхТестов.ВыполнитьТестCLI("greenapi", "ОтправитьФайл", Опции);
|
||||
|
||||
|
||||
OPI_ПолучениеДанныхТестов.ЗаписатьЛогCLI(Результат, "ОтправитьФайл (цитата)", "GreenAPI");
|
||||
OPI_ПолучениеДанныхТестов.Проверка_ГринФайл(Результат);
|
||||
|
||||
|
||||
КонецПроцедуры
|
||||
|
||||
#КонецОбласти
|
||||
|
@ -2240,16 +2240,16 @@
|
||||
КонецПроцедуры
|
||||
|
||||
Процедура Проверка_ГринСообщение(Знач Результат) Экспорт
|
||||
|
||||
|
||||
ОжидаетЧто(Результат["idMessage"]).Заполнено();
|
||||
|
||||
|
||||
КонецПроцедуры
|
||||
|
||||
Процедура Проверка_ГринФайл(Знач Результат) Экспорт
|
||||
|
||||
|
||||
ОжидаетЧто(Результат["idMessage"]).Заполнено();
|
||||
ОжидаетЧто(Результат["urlFile"]).Заполнено();
|
||||
|
||||
|
||||
КонецПроцедуры
|
||||
|
||||
#КонецОбласти
|
||||
@ -2288,9 +2288,9 @@
|
||||
КонецФункции
|
||||
|
||||
Функция ПолучитьОбщийМодуль(Знач Имя)
|
||||
|
||||
|
||||
Модуль = Вычислить(Имя);
|
||||
|
||||
|
||||
Возврат Модуль;
|
||||
КонецФункции
|
||||
|
||||
|
@ -451,7 +451,7 @@
|
||||
|
||||
// Назначить права администратора
|
||||
// Назначает пользователя администратором группы
|
||||
//
|
||||
//
|
||||
// Примечание:
|
||||
// Метод в документации API: [SetGroupAdmin](@green-api.com/docs/api/groups/SetGroupAdmin/)
|
||||
//
|
||||
@ -472,7 +472,7 @@
|
||||
|
||||
// Отозвать права администратора
|
||||
// Отзывает права администратора у пользователя
|
||||
//
|
||||
//
|
||||
// Примечание:
|
||||
// Метод в документации API: [RemoveAdmin](@green-api.com/docs/api/groups/RemoveAdmin/)
|
||||
//
|
||||
@ -518,7 +518,7 @@
|
||||
|
||||
// Установить картинку группы
|
||||
// Устанавливает картинку группового чата
|
||||
//
|
||||
//
|
||||
// Примечание:
|
||||
// Метод в документации API: [SetGroupPicture](@green-api.com/docs/api/groups/SetGroupPicture/)
|
||||
//
|
||||
@ -532,7 +532,7 @@
|
||||
Функция УстановитьКартинкуГруппы(Знач ПараметрыДоступа, Знач IDГруппы, Знач Картинка) Экспорт
|
||||
|
||||
OPI_ПреобразованиеТипов.ПолучитьДвоичныеДанные(Картинка);
|
||||
|
||||
|
||||
Параметры = Новый Структура;
|
||||
|
||||
OPI_Инструменты.ДобавитьПоле("groupId", IDГруппы, "Строка", Параметры);
|
||||
@ -553,7 +553,7 @@
|
||||
|
||||
// Отправить текстовое сообщение
|
||||
// Отправляет текстовое сообщение в выбранный чат
|
||||
//
|
||||
//
|
||||
// Примечание:
|
||||
// Метод в документации API: [SendMessage](@green-api.com/docs/api/sending/SendMessage/)
|
||||
//
|
||||
@ -562,11 +562,11 @@
|
||||
// IDЧата - Строка - Идентификатор чата - chat
|
||||
// Текст - Строка - Текст сообщения - text
|
||||
// IDЦитируемого - Строка - ID цитируемого сообщения, если необходимо - quoted
|
||||
//
|
||||
//
|
||||
// Возвращаемое значение:
|
||||
// Соответствие Из КлючИЗначение - сериализованный JSON ответа от Green API
|
||||
Функция ОтправитьТекстовоеСообщение(Знач ПараметрыДоступа, Знач IDЧата, Знач Текст, Знач IDЦитируемого = "") Экспорт
|
||||
|
||||
|
||||
Параметры = Новый Структура;
|
||||
|
||||
OPI_Инструменты.ДобавитьПоле("chatId" , IDЧата , "Строка", Параметры);
|
||||
@ -577,12 +577,12 @@
|
||||
Ответ = OPI_Инструменты.Post(URL, Параметры);
|
||||
|
||||
Возврат Ответ;
|
||||
|
||||
|
||||
КонецФункции
|
||||
|
||||
// Отправить файл
|
||||
// Отправляет файл в выбранный чат
|
||||
//
|
||||
//
|
||||
// Примечание:
|
||||
// Метод в документации API: [SendFileByUpload](@green-api.com/docs/api/sending/SendFileByUpload/)
|
||||
//
|
||||
@ -591,9 +591,9 @@
|
||||
// IDЧата - Строка - Идентификатор чата - chat
|
||||
// Файл - Строка, ДвоичныеДанные - Данные или путь к файлу - file
|
||||
// ИмяФайла - Строка - Имя загружаемого файла с раширением - filename
|
||||
// Описание - Строка - Текст сообщения под файлом - caption
|
||||
// Описание - Строка - Текст сообщения под файлом - caption
|
||||
// IDЦитируемого - Строка - ID цитируемого сообщения, если необходимо - quoted
|
||||
//
|
||||
//
|
||||
// Возвращаемое значение:
|
||||
// Соответствие Из КлючИЗначение - сериализованный JSON ответа от Green API
|
||||
Функция ОтправитьФайл(Знач ПараметрыДоступа
|
||||
@ -604,7 +604,7 @@
|
||||
, Знач IDЦитируемого = "") Экспорт
|
||||
|
||||
OPI_ПреобразованиеТипов.ПолучитьДвоичныеДанные(Файл);
|
||||
|
||||
|
||||
Параметры = Новый Структура;
|
||||
|
||||
OPI_Инструменты.ДобавитьПоле("chatId" , IDЧата , "Строка", Параметры);
|
||||
@ -619,7 +619,7 @@
|
||||
Ответ = OPI_Инструменты.PostMultipart(URL, Параметры, СоответствиеФайла);
|
||||
|
||||
Возврат Ответ;
|
||||
|
||||
|
||||
КонецФункции
|
||||
|
||||
#КонецОбласти
|
||||
@ -641,7 +641,7 @@
|
||||
КонецФункции
|
||||
|
||||
Функция СформироватьURL(ПараметрыДоступа, Метод, ПолеURL)
|
||||
|
||||
|
||||
OPI_ПреобразованиеТипов.ПолучитьКоллекциюКлючИЗначение(ПараметрыДоступа);
|
||||
OPI_ПреобразованиеТипов.ПолучитьСтроку(Метод);
|
||||
|
||||
@ -659,7 +659,7 @@
|
||||
URL = СтрШаблон("%1/waInstance%2/%3/%4", Url, IdInstance, Метод, ApiTokenInstance);
|
||||
|
||||
Возврат URL;
|
||||
|
||||
|
||||
КонецФункции
|
||||
|
||||
Функция ДействиеСУчастникомГруппы(Знач ПараметрыДоступа, Знач IDГруппы, Знач IDПользователя, Знач Метод)
|
||||
@ -673,7 +673,7 @@
|
||||
Ответ = OPI_Инструменты.Post(URL, Параметры);
|
||||
|
||||
Возврат Ответ;
|
||||
|
||||
|
||||
КонецФункции
|
||||
|
||||
#КонецОбласти
|
||||
|
@ -2240,16 +2240,16 @@
|
||||
КонецПроцедуры
|
||||
|
||||
Процедура Проверка_ГринСообщение(Знач Результат) Экспорт
|
||||
|
||||
|
||||
ОжидаетЧто(Результат["idMessage"]).Заполнено();
|
||||
|
||||
|
||||
КонецПроцедуры
|
||||
|
||||
Процедура Проверка_ГринФайл(Знач Результат) Экспорт
|
||||
|
||||
|
||||
ОжидаетЧто(Результат["idMessage"]).Заполнено();
|
||||
ОжидаетЧто(Результат["urlFile"]).Заполнено();
|
||||
|
||||
|
||||
КонецПроцедуры
|
||||
|
||||
#КонецОбласти
|
||||
|
@ -2420,7 +2420,7 @@
|
||||
КонецПроцедуры
|
||||
|
||||
Процедура GAPI_ОтправкаСообщений() Экспорт
|
||||
|
||||
|
||||
ПараметрыТеста = Новый Структура;
|
||||
OPI_ПолучениеДанныхТестов.ПараметрВКоллекцию("GreenAPI_ApiURL" , ПараметрыТеста);
|
||||
OPI_ПолучениеДанныхТестов.ПараметрВКоллекцию("GreenAPI_MediaURL" , ПараметрыТеста);
|
||||
@ -2429,10 +2429,10 @@
|
||||
OPI_ПолучениеДанныхТестов.ПараметрВКоллекцию("GreenAPI_TestGroupID", ПараметрыТеста);
|
||||
OPI_ПолучениеДанныхТестов.ПараметрВКоллекцию("Picture" , ПараметрыТеста);
|
||||
OPI_ПолучениеДанныхТестов.ПараметрВКоллекцию("Video" , ПараметрыТеста);
|
||||
|
||||
|
||||
GreenAPI_ОтправитьТекстовоеСообщение(ПараметрыТеста);
|
||||
GreenAPI_ОтправитьФайл(ПараметрыТеста);
|
||||
|
||||
|
||||
КонецПроцедуры
|
||||
|
||||
#КонецОбласти
|
||||
@ -18602,16 +18602,16 @@
|
||||
|
||||
OPI_ПолучениеДанныхТестов.ЗаписатьЛог(Результат, "ОтправитьТекстовоеСообщение", "GreenAPI");
|
||||
OPI_ПолучениеДанныхТестов.Проверка_ГринСообщение(Результат);
|
||||
|
||||
|
||||
IDСообщения = Результат["idMessage"];
|
||||
OPI_ПолучениеДанныхТестов.ЗаписатьПараметр("GreenAPI_MessageID", IDСообщения);
|
||||
OPI_Инструменты.ДобавитьПоле("GreenAPI_MessageID", IDСообщения, "Строка", ПараметрыФункции);
|
||||
|
||||
Результат = OPI_GreenAPI.ОтправитьТекстовоеСообщение(ПараметрыДоступа, IDЧата, Текст, IDСообщения);
|
||||
|
||||
|
||||
Результат = OPI_GreenAPI.ОтправитьТекстовоеСообщение(ПараметрыДоступа, IDЧата, Текст, IDСообщения);
|
||||
|
||||
OPI_ПолучениеДанныхТестов.ЗаписатьЛог(Результат, "ОтправитьТекстовоеСообщение (цитата)", "GreenAPI");
|
||||
OPI_ПолучениеДанныхТестов.Проверка_ГринСообщение(Результат);
|
||||
|
||||
OPI_ПолучениеДанныхТестов.Проверка_ГринСообщение(Результат);
|
||||
|
||||
КонецПроцедуры
|
||||
|
||||
Процедура GreenAPI_ОтправитьФайл(ПараметрыФункции)
|
||||
@ -18621,10 +18621,10 @@
|
||||
IdInstance = ПараметрыФункции["GreenAPI_IdInstance"];
|
||||
ApiTokenInstance = ПараметрыФункции["GreenAPI_Token"];
|
||||
|
||||
Файл = ПараметрыФункции["Picture"]; // URL, Путь или Двоичные данные
|
||||
ИмяФайла = "photo.jpg";
|
||||
IDЧата = ПараметрыФункции["GreenAPI_TestGroupID"];
|
||||
Описание = "Описание файла";
|
||||
Файл = ПараметрыФункции["Picture"]; // URL, Путь или Двоичные данные
|
||||
ИмяФайла = "photo.jpg";
|
||||
IDЧата = ПараметрыФункции["GreenAPI_TestGroupID"];
|
||||
Описание = "Описание файла";
|
||||
|
||||
ПараметрыДоступа = OPI_GreenAPI.СформироватьПараметрыДоступа(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
|
||||
Результат = OPI_GreenAPI.ОтправитьФайл(ПараметрыДоступа, IDЧата, Файл, ИмяФайла, Описание);
|
||||
@ -18633,18 +18633,18 @@
|
||||
|
||||
OPI_ПолучениеДанныхТестов.ЗаписатьЛог(Результат, "ОтправитьФайл", "GreenAPI");
|
||||
OPI_ПолучениеДанныхТестов.Проверка_ГринФайл(Результат);
|
||||
|
||||
|
||||
IDСообщения = Результат["idMessage"];
|
||||
OPI_ПолучениеДанныхТестов.ЗаписатьПараметр("GreenAPI_FileMessageID", IDСообщения);
|
||||
OPI_Инструменты.ДобавитьПоле("GreenAPI_FileMessageID", IDСообщения, "Строка", ПараметрыФункции);
|
||||
|
||||
OPI_Инструменты.ДобавитьПоле("GreenAPI_FileMessageID", IDСообщения, "Строка", ПараметрыФункции);
|
||||
|
||||
Файл = ПараметрыФункции["Video"];
|
||||
ИмяФайла = "vid.mp4";
|
||||
Результат = OPI_GreenAPI.ОтправитьФайл(ПараметрыДоступа, IDЧата, Файл, ИмяФайла, Описание, IDСообщения);
|
||||
|
||||
|
||||
OPI_ПолучениеДанныхТестов.ЗаписатьЛог(Результат, "ОтправитьФайл (цитата)", "GreenAPI");
|
||||
OPI_ПолучениеДанныхТестов.Проверка_ГринФайл(Результат);
|
||||
|
||||
|
||||
КонецПроцедуры
|
||||
|
||||
#КонецОбласти
|
||||
|
@ -2386,7 +2386,7 @@
|
||||
КонецПроцедуры
|
||||
|
||||
Процедура CLI_GAPI_ОтправкаСообщений() Экспорт
|
||||
|
||||
|
||||
ПараметрыТеста = Новый Структура;
|
||||
OPI_ПолучениеДанныхТестов.ПараметрВКоллекцию("GreenAPI_ApiURL" , ПараметрыТеста);
|
||||
OPI_ПолучениеДанныхТестов.ПараметрВКоллекцию("GreenAPI_MediaURL" , ПараметрыТеста);
|
||||
@ -2395,10 +2395,10 @@
|
||||
OPI_ПолучениеДанныхТестов.ПараметрВКоллекцию("GreenAPI_TestGroupID", ПараметрыТеста);
|
||||
OPI_ПолучениеДанныхТестов.ПараметрВКоллекцию("Picture" , ПараметрыТеста);
|
||||
OPI_ПолучениеДанныхТестов.ПараметрВКоллекцию("Video" , ПараметрыТеста);
|
||||
|
||||
|
||||
CLI_GreenAPI_ОтправитьТекстовоеСообщение(ПараметрыТеста);
|
||||
CLI_GreenAPI_ОтправитьФайл(ПараметрыТеста);
|
||||
|
||||
|
||||
КонецПроцедуры
|
||||
|
||||
#КонецОбласти
|
||||
@ -20935,15 +20935,15 @@
|
||||
Опции.Вставить("chat" , IDЧата);
|
||||
Опции.Вставить("text" , Текст);
|
||||
|
||||
Результат = OPI_ПолучениеДанныхТестов.ВыполнитьТестCLI("greenapi", "ОтправитьТекстовоеСообщение", Опции);
|
||||
Результат = OPI_ПолучениеДанныхТестов.ВыполнитьТестCLI("greenapi", "ОтправитьТекстовоеСообщение", Опции);
|
||||
|
||||
OPI_ПолучениеДанныхТестов.ЗаписатьЛогCLI(Результат, "ОтправитьТекстовоеСообщение", "GreenAPI");
|
||||
OPI_ПолучениеДанныхТестов.Проверка_ГринСообщение(Результат);
|
||||
|
||||
|
||||
IDСообщения = Результат["idMessage"];
|
||||
OPI_ПолучениеДанныхТестов.ЗаписатьПараметр("GreenAPI_MessageID", IDСообщения);
|
||||
OPI_Инструменты.ДобавитьПоле("GreenAPI_MessageID", IDСообщения, "Строка", ПараметрыФункции);
|
||||
|
||||
|
||||
Опции = Новый Структура;
|
||||
Опции.Вставить("access", ПараметрыДоступа);
|
||||
Опции.Вставить("chat" , IDЧата);
|
||||
@ -20951,10 +20951,10 @@
|
||||
Опции.Вставить("quoted", IDСообщения);
|
||||
|
||||
Результат = OPI_ПолучениеДанныхТестов.ВыполнитьТестCLI("greenapi", "ОтправитьТекстовоеСообщение", Опции);
|
||||
|
||||
|
||||
OPI_ПолучениеДанныхТестов.ЗаписатьЛогCLI(Результат, "ОтправитьТекстовоеСообщение (цитата)", "GreenAPI");
|
||||
OPI_ПолучениеДанныхТестов.Проверка_ГринСообщение(Результат);
|
||||
|
||||
OPI_ПолучениеДанныхТестов.Проверка_ГринСообщение(Результат);
|
||||
|
||||
КонецПроцедуры
|
||||
|
||||
Процедура CLI_GreenAPI_ОтправитьФайл(ПараметрыФункции)
|
||||
@ -20964,10 +20964,10 @@
|
||||
IdInstance = ПараметрыФункции["GreenAPI_IdInstance"];
|
||||
ApiTokenInstance = ПараметрыФункции["GreenAPI_Token"];
|
||||
|
||||
Файл = ПараметрыФункции["Picture"]; // URL, Путь или Двоичные данные
|
||||
ИмяФайла = "photo.jpg";
|
||||
IDЧата = ПараметрыФункции["GreenAPI_TestGroupID"];
|
||||
Описание = "Описание файла";
|
||||
Файл = ПараметрыФункции["Picture"]; // URL, Путь или Двоичные данные
|
||||
ИмяФайла = "photo.jpg";
|
||||
IDЧата = ПараметрыФункции["GreenAPI_TestGroupID"];
|
||||
Описание = "Описание файла";
|
||||
|
||||
Опции = Новый Структура;
|
||||
Опции.Вставить("api" , ApiUrl);
|
||||
@ -20988,14 +20988,14 @@
|
||||
|
||||
OPI_ПолучениеДанныхТестов.ЗаписатьЛогCLI(Результат, "ОтправитьФайл", "GreenAPI");
|
||||
OPI_ПолучениеДанныхТестов.Проверка_ГринФайл(Результат);
|
||||
|
||||
|
||||
IDСообщения = Результат["idMessage"];
|
||||
OPI_ПолучениеДанныхТестов.ЗаписатьПараметр("GreenAPI_FileMessageID", IDСообщения);
|
||||
OPI_Инструменты.ДобавитьПоле("GreenAPI_FileMessageID", IDСообщения, "Строка", ПараметрыФункции);
|
||||
|
||||
Файл = ПараметрыФункции["Video"];
|
||||
ИмяФайла = "vid.mp4";
|
||||
|
||||
OPI_Инструменты.ДобавитьПоле("GreenAPI_FileMessageID", IDСообщения, "Строка", ПараметрыФункции);
|
||||
|
||||
Файл = ПараметрыФункции["Video"];
|
||||
ИмяФайла = "vid.mp4";
|
||||
|
||||
Опции = Новый Структура;
|
||||
Опции.Вставить("access" , ПараметрыДоступа);
|
||||
Опции.Вставить("chat" , IDЧата);
|
||||
@ -21005,10 +21005,10 @@
|
||||
Опции.Вставить("quoted" , IDСообщения);
|
||||
|
||||
Результат = OPI_ПолучениеДанныхТестов.ВыполнитьТестCLI("greenapi", "ОтправитьФайл", Опции);
|
||||
|
||||
|
||||
OPI_ПолучениеДанныхТестов.ЗаписатьЛогCLI(Результат, "ОтправитьФайл (цитата)", "GreenAPI");
|
||||
OPI_ПолучениеДанныхТестов.Проверка_ГринФайл(Результат);
|
||||
|
||||
|
||||
КонецПроцедуры
|
||||
|
||||
#КонецОбласти
|
||||
|
102
src/ru/cli/data/Classes/internal/Classes/greenapi.os
vendored
102
src/ru/cli/data/Classes/internal/Classes/greenapi.os
vendored
@ -453,6 +453,108 @@
|
||||
НоваяСтрока.Описание = "Картинка профиля";
|
||||
НоваяСтрока.Область = "Управление группами";
|
||||
|
||||
|
||||
НоваяСтрока = ТаблицаСостава.Добавить();
|
||||
НоваяСтрока.Библиотека = "greenapi";
|
||||
НоваяСтрока.Модуль = "OPI_GreenAPI";
|
||||
НоваяСтрока.Метод = "ОтправитьТекстовоеСообщение";
|
||||
НоваяСтрока.МетодПоиска = "ОТПРАВИТЬТЕКСТОВОЕСООБЩЕНИЕ";
|
||||
НоваяСтрока.Параметр = "--access";
|
||||
НоваяСтрока.Описание = "Параметры доступа. См. СформироватьПараметрыДоступа";
|
||||
НоваяСтрока.Область = "Отправка сообщений";
|
||||
НоваяСтрока.ОписаниеМетода = "Отправляет текстовое сообщение в выбранный чат";
|
||||
|
||||
|
||||
НоваяСтрока = ТаблицаСостава.Добавить();
|
||||
НоваяСтрока.Библиотека = "greenapi";
|
||||
НоваяСтрока.Модуль = "OPI_GreenAPI";
|
||||
НоваяСтрока.Метод = "ОтправитьТекстовоеСообщение";
|
||||
НоваяСтрока.МетодПоиска = "ОТПРАВИТЬТЕКСТОВОЕСООБЩЕНИЕ";
|
||||
НоваяСтрока.Параметр = "--chat";
|
||||
НоваяСтрока.Описание = "Идентификатор чата";
|
||||
НоваяСтрока.Область = "Отправка сообщений";
|
||||
|
||||
|
||||
НоваяСтрока = ТаблицаСостава.Добавить();
|
||||
НоваяСтрока.Библиотека = "greenapi";
|
||||
НоваяСтрока.Модуль = "OPI_GreenAPI";
|
||||
НоваяСтрока.Метод = "ОтправитьТекстовоеСообщение";
|
||||
НоваяСтрока.МетодПоиска = "ОТПРАВИТЬТЕКСТОВОЕСООБЩЕНИЕ";
|
||||
НоваяСтрока.Параметр = "--text";
|
||||
НоваяСтрока.Описание = "Текст сообщения";
|
||||
НоваяСтрока.Область = "Отправка сообщений";
|
||||
|
||||
|
||||
НоваяСтрока = ТаблицаСостава.Добавить();
|
||||
НоваяСтрока.Библиотека = "greenapi";
|
||||
НоваяСтрока.Модуль = "OPI_GreenAPI";
|
||||
НоваяСтрока.Метод = "ОтправитьТекстовоеСообщение";
|
||||
НоваяСтрока.МетодПоиска = "ОТПРАВИТЬТЕКСТОВОЕСООБЩЕНИЕ";
|
||||
НоваяСтрока.Параметр = "--quoted";
|
||||
НоваяСтрока.Описание = "ID цитируемого сообщения, если необходимо (необяз. по ум. - Пустое значение)";
|
||||
НоваяСтрока.Область = "Отправка сообщений";
|
||||
|
||||
|
||||
НоваяСтрока = ТаблицаСостава.Добавить();
|
||||
НоваяСтрока.Библиотека = "greenapi";
|
||||
НоваяСтрока.Модуль = "OPI_GreenAPI";
|
||||
НоваяСтрока.Метод = "ОтправитьФайл";
|
||||
НоваяСтрока.МетодПоиска = "ОТПРАВИТЬФАЙЛ";
|
||||
НоваяСтрока.Параметр = "--access";
|
||||
НоваяСтрока.Описание = "Параметры доступа. См. СформироватьПараметрыДоступа";
|
||||
НоваяСтрока.Область = "Отправка сообщений";
|
||||
НоваяСтрока.ОписаниеМетода = "Отправляет файл в выбранный чат";
|
||||
|
||||
|
||||
НоваяСтрока = ТаблицаСостава.Добавить();
|
||||
НоваяСтрока.Библиотека = "greenapi";
|
||||
НоваяСтрока.Модуль = "OPI_GreenAPI";
|
||||
НоваяСтрока.Метод = "ОтправитьФайл";
|
||||
НоваяСтрока.МетодПоиска = "ОТПРАВИТЬФАЙЛ";
|
||||
НоваяСтрока.Параметр = "--chat";
|
||||
НоваяСтрока.Описание = "Идентификатор чата";
|
||||
НоваяСтрока.Область = "Отправка сообщений";
|
||||
|
||||
|
||||
НоваяСтрока = ТаблицаСостава.Добавить();
|
||||
НоваяСтрока.Библиотека = "greenapi";
|
||||
НоваяСтрока.Модуль = "OPI_GreenAPI";
|
||||
НоваяСтрока.Метод = "ОтправитьФайл";
|
||||
НоваяСтрока.МетодПоиска = "ОТПРАВИТЬФАЙЛ";
|
||||
НоваяСтрока.Параметр = "--file";
|
||||
НоваяСтрока.Описание = "Данные или путь к файлу";
|
||||
НоваяСтрока.Область = "Отправка сообщений";
|
||||
|
||||
|
||||
НоваяСтрока = ТаблицаСостава.Добавить();
|
||||
НоваяСтрока.Библиотека = "greenapi";
|
||||
НоваяСтрока.Модуль = "OPI_GreenAPI";
|
||||
НоваяСтрока.Метод = "ОтправитьФайл";
|
||||
НоваяСтрока.МетодПоиска = "ОТПРАВИТЬФАЙЛ";
|
||||
НоваяСтрока.Параметр = "--filename";
|
||||
НоваяСтрока.Описание = "Имя загружаемого файла с раширением";
|
||||
НоваяСтрока.Область = "Отправка сообщений";
|
||||
|
||||
|
||||
НоваяСтрока = ТаблицаСостава.Добавить();
|
||||
НоваяСтрока.Библиотека = "greenapi";
|
||||
НоваяСтрока.Модуль = "OPI_GreenAPI";
|
||||
НоваяСтрока.Метод = "ОтправитьФайл";
|
||||
НоваяСтрока.МетодПоиска = "ОТПРАВИТЬФАЙЛ";
|
||||
НоваяСтрока.Параметр = "--caption";
|
||||
НоваяСтрока.Описание = "Текст сообщения под файлом (необяз. по ум. - Пустое значение)";
|
||||
НоваяСтрока.Область = "Отправка сообщений";
|
||||
|
||||
|
||||
НоваяСтрока = ТаблицаСостава.Добавить();
|
||||
НоваяСтрока.Библиотека = "greenapi";
|
||||
НоваяСтрока.Модуль = "OPI_GreenAPI";
|
||||
НоваяСтрока.Метод = "ОтправитьФайл";
|
||||
НоваяСтрока.МетодПоиска = "ОТПРАВИТЬФАЙЛ";
|
||||
НоваяСтрока.Параметр = "--quoted";
|
||||
НоваяСтрока.Описание = "ID цитируемого сообщения, если необходимо (необяз. по ум. - Пустое значение)";
|
||||
НоваяСтрока.Область = "Отправка сообщений";
|
||||
|
||||
Возврат ТаблицаСостава;
|
||||
КонецФункции
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user