You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2025-08-24 19:49:22 +02:00
Main build (Jenkins)
This commit is contained in:
2
docs/en/examples/VKTeams/DeleteMessage.txt
vendored
2
docs/en/examples/VKTeams/DeleteMessage.txt
vendored
@@ -1,5 +1,5 @@
|
||||
Token = "001.3501506236.091...";
|
||||
ChatID = "689203963@chat.agent";
|
||||
MessageID = "7493946521033911544";
|
||||
MessageID = "7497343393488449008";
|
||||
|
||||
Result = OPI_VKTeams.DeleteMessage(Token, ChatID, MessageID);
|
||||
|
2
docs/en/examples/VKTeams/EditMessageText.txt
vendored
2
docs/en/examples/VKTeams/EditMessageText.txt
vendored
@@ -1,6 +1,6 @@
|
||||
Token = "001.3501506236.091...";
|
||||
ChatID = "689203963@chat.agent";
|
||||
MessageID = "7493946521033911544";
|
||||
MessageID = "7497343393488449008";
|
||||
Text = "New message text";
|
||||
|
||||
Result = OPI_VKTeams.EditMessageText(Token, ChatID, MessageID, Text);
|
||||
|
2
docs/en/examples/VKTeams/ForwardMessage.txt
vendored
2
docs/en/examples/VKTeams/ForwardMessage.txt
vendored
@@ -1,7 +1,7 @@
|
||||
Token = "001.3501506236.091...";
|
||||
ChatID = "AoLI0egLWBSLR1Ngn2w";
|
||||
FromChatID = "689203963@chat.agent";
|
||||
MessageID = "7493946521033911544";
|
||||
MessageID = "7497343393488449008";
|
||||
|
||||
Result = OPI_VKTeams.ForwardMessage(Token, MessageID, FromChatID, ChatID);
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
Token = "001.3501506236.091...";
|
||||
FileID = "q1GzJciDOzGAFHMPZG7rpx67ffd8d71bd";
|
||||
FileID = "R9MDoAdskwKRipOV0fzYpg680bea5e1bd";
|
||||
|
||||
Result = OPI_VKTeams.GetFileInformation(Token, FileID);
|
||||
|
2
docs/en/examples/VKTeams/PinMessage.txt
vendored
2
docs/en/examples/VKTeams/PinMessage.txt
vendored
@@ -1,5 +1,5 @@
|
||||
Token = "001.3501506236.091...";
|
||||
ChatID = "689203963@chat.agent";
|
||||
MessageID = "7493946521033911544";
|
||||
MessageID = "7497343393488449008";
|
||||
|
||||
Result = OPI_VKTeams.PinMessage(Token, ChatID, MessageID);
|
||||
|
2
docs/en/examples/VKTeams/ResendFile.txt
vendored
2
docs/en/examples/VKTeams/ResendFile.txt
vendored
@@ -1,6 +1,6 @@
|
||||
Token = "001.3501506236.091...";
|
||||
ChatID = "AoLI0egLWBSLR1Ngn2w";
|
||||
FileID = "q1GzJciDOzGAFHMPZG7rpx67ffd8d71bd";
|
||||
FileID = "R9MDoAdskwKRipOV0fzYpg680bea5e1bd";
|
||||
Text = "File caption";
|
||||
|
||||
Result = OPI_VKTeams.ResendFile(Token, ChatID, FileID, Text);
|
||||
|
2
docs/en/examples/VKTeams/ResendVoice.txt
vendored
2
docs/en/examples/VKTeams/ResendVoice.txt
vendored
@@ -1,5 +1,5 @@
|
||||
Token = "001.3501506236.091...";
|
||||
ChatID = "AoLI0egLWBSLR1Ngn2w";
|
||||
FileID = "I000bG5B9znpWl5btIiXm667ffd8ea1bd";
|
||||
FileID = "I000bVJfnRPVl5iVtfOkJv680bea711bd";
|
||||
|
||||
Result = OPI_VKTeams.ResendVoice(Token, ChatID, FileID);
|
||||
|
2
docs/en/examples/VKTeams/SendTextMessage.txt
vendored
2
docs/en/examples/VKTeams/SendTextMessage.txt
vendored
@@ -5,7 +5,7 @@
|
||||
Result = OPI_VKTeams.SendTextMessage(Token, ChatID, Text);
|
||||
|
||||
ChatID = "689203963@chat.agent";
|
||||
ReplyID = "7493946521033911544";
|
||||
ReplyID = "7497343393488449008";
|
||||
Text = "<b>Bold text</b>";
|
||||
Markup = "HTML";
|
||||
|
||||
|
2
docs/en/examples/VKTeams/SendVoice.txt
vendored
2
docs/en/examples/VKTeams/SendVoice.txt
vendored
@@ -1,6 +1,6 @@
|
||||
Token = "001.3501506236.091...";
|
||||
ChatID = "689203963@chat.agent";
|
||||
ReplyID = "7493946521033911544";
|
||||
ReplyID = "7497343393488449008";
|
||||
|
||||
File = "https://api.athenaeum.digital/test_data/song.m4a"; // URL
|
||||
FilePath = GetTempFileName("m4a"); // Path
|
||||
|
2
docs/en/examples/VKTeams/UnpinMessage.txt
vendored
2
docs/en/examples/VKTeams/UnpinMessage.txt
vendored
@@ -1,5 +1,5 @@
|
||||
Token = "001.3501506236.091...";
|
||||
ChatID = "689203963@chat.agent";
|
||||
MessageID = "7493946521033911544";
|
||||
MessageID = "7497343393488449008";
|
||||
|
||||
Result = OPI_VKTeams.UnpinMessage(Token, ChatID, MessageID);
|
||||
|
@@ -16,7 +16,7 @@ import TabItem from '@theme/TabItem';
|
||||
|-|-|-|-|-|
|
||||
| AccessParameters | --access | Structure Of KeyAndValue | ✔ | Access parameters. See FormAccessParameters |
|
||||
| ChatID | --chat | String | ✔ | Chat identifier |
|
||||
| FileURL | --url | String, | ✔ | File URL |
|
||||
| FileURL | --url | String | ✔ | File URL |
|
||||
| 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 |
|
||||
|
@@ -31,7 +31,7 @@ Method at API documentation: [GET /files/getInfo](https://teams.vk.com/botapi/#/
|
||||
|
||||
```bsl title="1C:Enterprise/OneScript code example"
|
||||
Token = "001.3501506236.091...";
|
||||
FileID = "q1GzJciDOzGAFHMPZG7rpx67ffd8d71bd";
|
||||
FileID = "R9MDoAdskwKRipOV0fzYpg680bea5e1bd";
|
||||
|
||||
Result = OPI_VKTeams.GetFileInformation(Token, FileID);
|
||||
```
|
||||
|
@@ -33,7 +33,7 @@ Method at API documentation: [GET /messages/deleteMessages](https://teams.vk.com
|
||||
```bsl title="1C:Enterprise/OneScript code example"
|
||||
Token = "001.3501506236.091...";
|
||||
ChatID = "689203963@chat.agent";
|
||||
MessageID = "7493946521033911544";
|
||||
MessageID = "7497343393488449008";
|
||||
|
||||
Result = OPI_VKTeams.DeleteMessage(Token, ChatID, MessageID);
|
||||
```
|
||||
|
@@ -37,7 +37,7 @@ Method at API documentation: [GET /messages/editText](https://teams.vk.com/botap
|
||||
```bsl title="1C:Enterprise/OneScript code example"
|
||||
Token = "001.3501506236.091...";
|
||||
ChatID = "689203963@chat.agent";
|
||||
MessageID = "7493946521033911544";
|
||||
MessageID = "7497343393488449008";
|
||||
Text = "New message text";
|
||||
|
||||
Result = OPI_VKTeams.EditMessageText(Token, ChatID, MessageID, Text);
|
||||
|
@@ -38,7 +38,7 @@ Method at API documentation: [GET /messages/sendText](https://teams.vk.com/botap
|
||||
Token = "001.3501506236.091...";
|
||||
ChatID = "AoLI0egLWBSLR1Ngn2w";
|
||||
FromChatID = "689203963@chat.agent";
|
||||
MessageID = "7493946521033911544";
|
||||
MessageID = "7497343393488449008";
|
||||
|
||||
Result = OPI_VKTeams.ForwardMessage(Token, MessageID, FromChatID, ChatID);
|
||||
|
||||
|
@@ -35,7 +35,7 @@ Method at API documentation: [GET /chats/pinMessage](https://teams.vk.com/botapi
|
||||
```bsl title="1C:Enterprise/OneScript code example"
|
||||
Token = "001.3501506236.091...";
|
||||
ChatID = "689203963@chat.agent";
|
||||
MessageID = "7493946521033911544";
|
||||
MessageID = "7497343393488449008";
|
||||
|
||||
Result = OPI_VKTeams.PinMessage(Token, ChatID, MessageID);
|
||||
```
|
||||
|
@@ -35,7 +35,7 @@ Method at API documentation: [GET /messages/sendFile](https://teams.vk.com/botap
|
||||
```bsl title="1C:Enterprise/OneScript code example"
|
||||
Token = "001.3501506236.091...";
|
||||
ChatID = "AoLI0egLWBSLR1Ngn2w";
|
||||
FileID = "q1GzJciDOzGAFHMPZG7rpx67ffd8d71bd";
|
||||
FileID = "R9MDoAdskwKRipOV0fzYpg680bea5e1bd";
|
||||
Text = "File caption";
|
||||
|
||||
Result = OPI_VKTeams.ResendFile(Token, ChatID, FileID, Text);
|
||||
|
@@ -33,7 +33,7 @@ Method at API documentation: [GET /messages/sendVoice](https://teams.vk.com/bota
|
||||
```bsl title="1C:Enterprise/OneScript code example"
|
||||
Token = "001.3501506236.091...";
|
||||
ChatID = "AoLI0egLWBSLR1Ngn2w";
|
||||
FileID = "I000bG5B9znpWl5btIiXm667ffd8ea1bd";
|
||||
FileID = "I000bVJfnRPVl5iVtfOkJv680bea711bd";
|
||||
|
||||
Result = OPI_VKTeams.ResendVoice(Token, ChatID, FileID);
|
||||
```
|
||||
|
@@ -43,7 +43,7 @@ Method at API documentation: [GET /messages/sendText](https://teams.vk.com/botap
|
||||
Result = OPI_VKTeams.SendTextMessage(Token, ChatID, Text);
|
||||
|
||||
ChatID = "689203963@chat.agent";
|
||||
ReplyID = "7493946521033911544";
|
||||
ReplyID = "7497343393488449008";
|
||||
Text = "<b>Bold text</b>";
|
||||
Markup = "HTML";
|
||||
|
||||
|
@@ -40,7 +40,7 @@ Parameters with Binary data type can also accept file paths on disk and URLs
|
||||
```bsl title="1C:Enterprise/OneScript code example"
|
||||
Token = "001.3501506236.091...";
|
||||
ChatID = "689203963@chat.agent";
|
||||
ReplyID = "7493946521033911544";
|
||||
ReplyID = "7497343393488449008";
|
||||
|
||||
File = "https://api.athenaeum.digital/test_data/song.m4a"; // URL
|
||||
FilePath = GetTempFileName("m4a"); // Path
|
||||
|
@@ -35,7 +35,7 @@ Method at API documentation: [GET /chats/unpinMessage](https://teams.vk.com/bota
|
||||
```bsl title="1C:Enterprise/OneScript code example"
|
||||
Token = "001.3501506236.091...";
|
||||
ChatID = "689203963@chat.agent";
|
||||
MessageID = "7493946521033911544";
|
||||
MessageID = "7497343393488449008";
|
||||
|
||||
Result = OPI_VKTeams.UnpinMessage(Token, ChatID, MessageID);
|
||||
```
|
||||
|
@@ -25,7 +25,7 @@ import TabItem from '@theme/TabItem';
|
||||
<br/>
|
||||
|
||||
:::tip
|
||||
Method at API documentation: [Information о productх, that размещены in заданbutм магазandnot](https://https:
|
||||
Method at API documentation: [Information o productх, that размещены in заданbutм магазandnot](https://https:
|
||||
|
||||
yandex.ru/dev/market/partner-api/doc/ru/reference/assortment/getCampaignOffers)
|
||||
:::
|
||||
|
@@ -1,5 +1,5 @@
|
||||
Токен = "001.3501506236.091...";
|
||||
IDЧата = "689203963@chat.agent";
|
||||
IDСообщения = "7493946521033911544";
|
||||
IDСообщения = "7497343393488449008";
|
||||
|
||||
Результат = OPI_VKTeams.ЗакрепитьСообщение(Токен, IDЧата, IDСообщения);
|
||||
|
@@ -1,6 +1,6 @@
|
||||
Токен = "001.3501506236.091...";
|
||||
IDЧата = "689203963@chat.agent";
|
||||
IDСообщения = "7493946521033911544";
|
||||
IDСообщения = "7497343393488449008";
|
||||
Текст = "Новый текст сообщения";
|
||||
|
||||
Результат = OPI_VKTeams.ИзменитьТекстСообщения(Токен, IDЧата, IDСообщения, Текст);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
Токен = "001.3501506236.091...";
|
||||
IDЧата = "689203963@chat.agent";
|
||||
IDСообщения = "7493946521033911544";
|
||||
IDСообщения = "7497343393488449008";
|
||||
|
||||
Результат = OPI_VKTeams.ОткрепитьСообщение(Токен, IDЧата, IDСообщения);
|
||||
|
@@ -1,6 +1,6 @@
|
||||
Токен = "001.3501506236.091...";
|
||||
IDЧата = "689203963@chat.agent";
|
||||
IDЦитируемого = "7493946521033911544";
|
||||
IDЦитируемого = "7497343393488449008";
|
||||
|
||||
Файл = "https://api.athenaeum.digital/test_data/song.m4a"; // URL
|
||||
ФайлПуть = ПолучитьИмяВременногоФайла("m4a"); // Путь
|
||||
|
@@ -5,7 +5,7 @@
|
||||
Результат = OPI_VKTeams.ОтправитьТекстовоеСообщение(Токен, IDЧата, Текст);
|
||||
|
||||
IDЧата = "689203963@chat.agent";
|
||||
IDЦитируемого = "7493946521033911544";
|
||||
IDЦитируемого = "7497343393488449008";
|
||||
Текст = "<b>Полужирный текст сообщения</b>";
|
||||
Разметка = "HTML";
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
Токен = "001.3501506236.091...";
|
||||
IDЧата = "AoLI0egLWBSLR1Ngn2w";
|
||||
IDФайла = "I000bG5B9znpWl5btIiXm667ffd8ea1bd";
|
||||
IDФайла = "I000bVJfnRPVl5iVtfOkJv680bea711bd";
|
||||
|
||||
Результат = OPI_VKTeams.ПереслатьГолосовоеСообщение(Токен, IDЧата, IDФайла);
|
||||
|
@@ -1,7 +1,7 @@
|
||||
Токен = "001.3501506236.091...";
|
||||
IDЧата = "AoLI0egLWBSLR1Ngn2w";
|
||||
IDЧатаИсточника = "689203963@chat.agent";
|
||||
IDСообщения = "7493946521033911544";
|
||||
IDСообщения = "7497343393488449008";
|
||||
|
||||
Результат = OPI_VKTeams.ПереслатьСообщение(Токен, IDСообщения, IDЧатаИсточника, IDЧата);
|
||||
|
||||
|
2
docs/ru/examples/VKTeams/ПереслатьФайл.txt
vendored
2
docs/ru/examples/VKTeams/ПереслатьФайл.txt
vendored
@@ -1,6 +1,6 @@
|
||||
Токен = "001.3501506236.091...";
|
||||
IDЧата = "AoLI0egLWBSLR1Ngn2w";
|
||||
IDФайла = "q1GzJciDOzGAFHMPZG7rpx67ffd8d71bd";
|
||||
IDФайла = "R9MDoAdskwKRipOV0fzYpg680bea5e1bd";
|
||||
Текст = "Подпись к файлу";
|
||||
|
||||
Результат = OPI_VKTeams.ПереслатьФайл(Токен, IDЧата, IDФайла, Текст);
|
||||
|
@@ -1,4 +1,4 @@
|
||||
Токен = "001.3501506236.091...";
|
||||
IDФайла = "q1GzJciDOzGAFHMPZG7rpx67ffd8d71bd";
|
||||
IDФайла = "R9MDoAdskwKRipOV0fzYpg680bea5e1bd";
|
||||
|
||||
Результат = OPI_VKTeams.ПолучитьИнформациюОФайле(Токен, IDФайла);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
Токен = "001.3501506236.091...";
|
||||
IDЧата = "689203963@chat.agent";
|
||||
IDСообщения = "7493946521033911544";
|
||||
IDСообщения = "7497343393488449008";
|
||||
|
||||
Результат = OPI_VKTeams.УдалитьСообщение(Токен, IDЧата, IDСообщения);
|
||||
|
@@ -16,7 +16,7 @@ import TabItem from '@theme/TabItem';
|
||||
|-|-|-|-|-|
|
||||
| ПараметрыДоступа | --access | Структура Из КлючИЗначение | ✔ | Параметры доступа. См. СформироватьПараметрыДоступа |
|
||||
| IDЧата | --chat | Строка | ✔ | Идентификатор чата |
|
||||
| URLФайла | --url | Строка, | ✔ | URL файла для отправки |
|
||||
| URLФайла | --url | Строка | ✔ | URL файла для отправки |
|
||||
| ИмяФайла | --filename | Строка | ✔ | Имя загружаемого файла с раширением |
|
||||
| Описание | --caption | Строка | ✖ | Текст сообщения под файлом |
|
||||
| IDЦитируемого | --quoted | Строка | ✖ | ID цитируемого сообщения, если необходимо |
|
||||
|
@@ -31,7 +31,7 @@ import TabItem from '@theme/TabItem';
|
||||
|
||||
```bsl title="Пример использования для 1С:Предприятие/OneScript"
|
||||
Токен = "001.3501506236.091...";
|
||||
IDФайла = "q1GzJciDOzGAFHMPZG7rpx67ffd8d71bd";
|
||||
IDФайла = "R9MDoAdskwKRipOV0fzYpg680bea5e1bd";
|
||||
|
||||
Результат = OPI_VKTeams.ПолучитьИнформациюОФайле(Токен, IDФайла);
|
||||
```
|
||||
|
@@ -33,7 +33,7 @@ import TabItem from '@theme/TabItem';
|
||||
```bsl title="Пример использования для 1С:Предприятие/OneScript"
|
||||
Токен = "001.3501506236.091...";
|
||||
IDЧата = "689203963@chat.agent";
|
||||
IDСообщения = "7493946521033911544";
|
||||
IDСообщения = "7497343393488449008";
|
||||
|
||||
Результат = OPI_VKTeams.УдалитьСообщение(Токен, IDЧата, IDСообщения);
|
||||
```
|
||||
|
@@ -37,7 +37,7 @@ import TabItem from '@theme/TabItem';
|
||||
```bsl title="Пример использования для 1С:Предприятие/OneScript"
|
||||
Токен = "001.3501506236.091...";
|
||||
IDЧата = "689203963@chat.agent";
|
||||
IDСообщения = "7493946521033911544";
|
||||
IDСообщения = "7497343393488449008";
|
||||
Текст = "Новый текст сообщения";
|
||||
|
||||
Результат = OPI_VKTeams.ИзменитьТекстСообщения(Токен, IDЧата, IDСообщения, Текст);
|
||||
|
@@ -38,7 +38,7 @@ import TabItem from '@theme/TabItem';
|
||||
Токен = "001.3501506236.091...";
|
||||
IDЧата = "AoLI0egLWBSLR1Ngn2w";
|
||||
IDЧатаИсточника = "689203963@chat.agent";
|
||||
IDСообщения = "7493946521033911544";
|
||||
IDСообщения = "7497343393488449008";
|
||||
|
||||
Результат = OPI_VKTeams.ПереслатьСообщение(Токен, IDСообщения, IDЧатаИсточника, IDЧата);
|
||||
|
||||
|
@@ -35,7 +35,7 @@ import TabItem from '@theme/TabItem';
|
||||
```bsl title="Пример использования для 1С:Предприятие/OneScript"
|
||||
Токен = "001.3501506236.091...";
|
||||
IDЧата = "689203963@chat.agent";
|
||||
IDСообщения = "7493946521033911544";
|
||||
IDСообщения = "7497343393488449008";
|
||||
|
||||
Результат = OPI_VKTeams.ЗакрепитьСообщение(Токен, IDЧата, IDСообщения);
|
||||
```
|
||||
|
@@ -35,7 +35,7 @@ import TabItem from '@theme/TabItem';
|
||||
```bsl title="Пример использования для 1С:Предприятие/OneScript"
|
||||
Токен = "001.3501506236.091...";
|
||||
IDЧата = "AoLI0egLWBSLR1Ngn2w";
|
||||
IDФайла = "q1GzJciDOzGAFHMPZG7rpx67ffd8d71bd";
|
||||
IDФайла = "R9MDoAdskwKRipOV0fzYpg680bea5e1bd";
|
||||
Текст = "Подпись к файлу";
|
||||
|
||||
Результат = OPI_VKTeams.ПереслатьФайл(Токен, IDЧата, IDФайла, Текст);
|
||||
|
@@ -33,7 +33,7 @@ import TabItem from '@theme/TabItem';
|
||||
```bsl title="Пример использования для 1С:Предприятие/OneScript"
|
||||
Токен = "001.3501506236.091...";
|
||||
IDЧата = "AoLI0egLWBSLR1Ngn2w";
|
||||
IDФайла = "I000bG5B9znpWl5btIiXm667ffd8ea1bd";
|
||||
IDФайла = "I000bVJfnRPVl5iVtfOkJv680bea711bd";
|
||||
|
||||
Результат = OPI_VKTeams.ПереслатьГолосовоеСообщение(Токен, IDЧата, IDФайла);
|
||||
```
|
||||
|
@@ -43,7 +43,7 @@ import TabItem from '@theme/TabItem';
|
||||
Результат = OPI_VKTeams.ОтправитьТекстовоеСообщение(Токен, IDЧата, Текст);
|
||||
|
||||
IDЧата = "689203963@chat.agent";
|
||||
IDЦитируемого = "7493946521033911544";
|
||||
IDЦитируемого = "7497343393488449008";
|
||||
Текст = "<b>Полужирный текст сообщения</b>";
|
||||
Разметка = "HTML";
|
||||
|
||||
|
@@ -40,7 +40,7 @@ import TabItem from '@theme/TabItem';
|
||||
```bsl title="Пример использования для 1С:Предприятие/OneScript"
|
||||
Токен = "001.3501506236.091...";
|
||||
IDЧата = "689203963@chat.agent";
|
||||
IDЦитируемого = "7493946521033911544";
|
||||
IDЦитируемого = "7497343393488449008";
|
||||
|
||||
Файл = "https://api.athenaeum.digital/test_data/song.m4a"; // URL
|
||||
ФайлПуть = ПолучитьИмяВременногоФайла("m4a"); // Путь
|
||||
|
@@ -35,7 +35,7 @@ import TabItem from '@theme/TabItem';
|
||||
```bsl title="Пример использования для 1С:Предприятие/OneScript"
|
||||
Токен = "001.3501506236.091...";
|
||||
IDЧата = "689203963@chat.agent";
|
||||
IDСообщения = "7493946521033911544";
|
||||
IDСообщения = "7497343393488449008";
|
||||
|
||||
Результат = OPI_VKTeams.ОткрепитьСообщение(Токен, IDЧата, IDСообщения);
|
||||
```
|
||||
|
14456
service/dictionaries/en.json
vendored
14456
service/dictionaries/en.json
vendored
File diff suppressed because it is too large
Load Diff
2
src/en/OInt/core/Modules/OPI_GoogleDrive.os
vendored
2
src/en/OInt/core/Modules/OPI_GoogleDrive.os
vendored
@@ -602,7 +602,7 @@ Function UploadSmallFile(Val Description, Val FileMapping, Val Headers, Val Iden
|
||||
.AddDataAsRelated(Description, "application/json; charset=UTF-8");
|
||||
|
||||
For Each File In FileMapping Do
|
||||
HTTPClient.AddDataAsRelated(File.Key, File.Value)
|
||||
HTTPClient.AddDataAsRelated(File.Key, File.Value);
|
||||
EndDo;
|
||||
|
||||
Response = HTTPClient.ProcessRequest(Method).ReturnResponseAsJSONObject(True, True);
|
||||
|
54
src/en/OInt/core/Modules/OPI_GreenAPI.os
vendored
54
src/en/OInt/core/Modules/OPI_GreenAPI.os
vendored
@@ -604,11 +604,12 @@ EndFunction
|
||||
// Map Of KeyAndValue - serialized JSON response from Green API
|
||||
Function SendTextMessage(Val AccessParameters, Val ChatID, Val Text, Val ReplyID = "") Export
|
||||
|
||||
String_ = "String";
|
||||
Parameters = New Structure;
|
||||
|
||||
OPI_Tools.AddField("chatId" , ChatID , "String", Parameters);
|
||||
OPI_Tools.AddField("message" , Text , "String", Parameters);
|
||||
OPI_Tools.AddField("quotedMessageId", ReplyID, "String", Parameters);
|
||||
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_HTTPRequests.PostWithBody(URL, Parameters);
|
||||
@@ -642,12 +643,13 @@ Function SendFile(Val AccessParameters
|
||||
|
||||
OPI_TypeConversion.GetBinaryData(File);
|
||||
|
||||
String_ = "String";
|
||||
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);
|
||||
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);
|
||||
@@ -668,7 +670,7 @@ EndFunction
|
||||
// Parameters:
|
||||
// AccessParameters - Structure Of KeyAndValue - Access parameters. See FormAccessParameters - access
|
||||
// ChatID - String - Chat identifier - chat
|
||||
// FileURL - String, - File URL - url
|
||||
// FileURL - String - File URL - url
|
||||
// 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
|
||||
@@ -682,13 +684,14 @@ Function SendFileByURL(Val AccessParameters
|
||||
, Val Description = ""
|
||||
, Val ReplyID = "") Export
|
||||
|
||||
String_ = "String";
|
||||
Parameters = New Structure;
|
||||
|
||||
OPI_Tools.AddField("chatId" , ChatID , "String", Parameters);
|
||||
OPI_Tools.AddField("urlFile" , FileURL , "String", Parameters);
|
||||
OPI_Tools.AddField("fileName" , FileName , "String", Parameters);
|
||||
OPI_Tools.AddField("caption" , Description , "String", Parameters);
|
||||
OPI_Tools.AddField("quotedMessageId", ReplyID , "String", Parameters);
|
||||
OPI_Tools.AddField("chatId" , ChatID , String_, Parameters);
|
||||
OPI_Tools.AddField("urlFile" , FileURL , String_, Parameters);
|
||||
OPI_Tools.AddField("fileName" , FileName , String_, Parameters);
|
||||
OPI_Tools.AddField("caption" , Description , String_, Parameters);
|
||||
OPI_Tools.AddField("quotedMessageId", ReplyID , String_, Parameters);
|
||||
|
||||
URL = FormPrimaryURL(AccessParameters, "sendFileByUrl");
|
||||
Response = OPI_HTTPRequests.PostWithBody(URL, Parameters);
|
||||
@@ -720,6 +723,7 @@ Function SendPoll(Val AccessParameters
|
||||
, Val MultipleSelect = False
|
||||
, Val ReplyID = "") Export
|
||||
|
||||
String_ = "String";
|
||||
Parameters = New Structure;
|
||||
OptionArray = New Array;
|
||||
|
||||
@@ -729,11 +733,11 @@ Function SendPoll(Val AccessParameters
|
||||
OptionArray.Add(New Structure("optionName", Option));
|
||||
EndDo;
|
||||
|
||||
OPI_Tools.AddField("chatId" , ChatID , "String" , Parameters);
|
||||
OPI_Tools.AddField("message" , Text , "String" , Parameters);
|
||||
OPI_Tools.AddField("chatId" , ChatID , String_ , Parameters);
|
||||
OPI_Tools.AddField("message" , Text , String_ , Parameters);
|
||||
OPI_Tools.AddField("options" , OptionArray , "Collection", Parameters);
|
||||
OPI_Tools.AddField("multipleAnswers", MultipleSelect, "Boolean" , Parameters);
|
||||
OPI_Tools.AddField("quotedMessageId", ReplyID , "String" , Parameters);
|
||||
OPI_Tools.AddField("quotedMessageId", ReplyID , String_ , Parameters);
|
||||
|
||||
URL = FormPrimaryURL(AccessParameters, "sendPoll");
|
||||
Response = OPI_HTTPRequests.PostWithBody(URL, Parameters);
|
||||
@@ -850,11 +854,12 @@ EndFunction
|
||||
// Map Of KeyAndValue - serialized JSON response from Green API
|
||||
Function EditMessageText(Val AccessParameters, Val ChatID, Val MessageID, Val Text) Export
|
||||
|
||||
String_ = "String";
|
||||
Parameters = New Structure;
|
||||
|
||||
OPI_Tools.AddField("chatId" , ChatID , "String", Parameters);
|
||||
OPI_Tools.AddField("idMessage", MessageID, "String", Parameters);
|
||||
OPI_Tools.AddField("message" , Text , "String", Parameters);
|
||||
OPI_Tools.AddField("chatId" , ChatID , String_, Parameters);
|
||||
OPI_Tools.AddField("idMessage", MessageID, String_, Parameters);
|
||||
OPI_Tools.AddField("message" , Text , String_, Parameters);
|
||||
|
||||
URL = FormPrimaryURL(AccessParameters, "editMessage");
|
||||
Response = OPI_HTTPRequests.PostWithBody(URL, Parameters);
|
||||
@@ -910,13 +915,14 @@ Function GetContactDescription(Val Phone
|
||||
, Val Patronymic = ""
|
||||
, Val Company = "") Export
|
||||
|
||||
String_ = "String";
|
||||
Contact = New Structure;
|
||||
|
||||
OPI_Tools.AddField("phoneContact", Phone , "Number" , Contact);
|
||||
OPI_Tools.AddField("firstName" , Name , "String" , Contact);
|
||||
OPI_Tools.AddField("middleName" , LastName , "String" , Contact);
|
||||
OPI_Tools.AddField("lastName" , Patronymic, "String" , Contact);
|
||||
OPI_Tools.AddField("company" , Company , "String" , Contact);
|
||||
OPI_Tools.AddField("phoneContact", Phone , "Number", Contact);
|
||||
OPI_Tools.AddField("firstName" , Name , String_ , Contact);
|
||||
OPI_Tools.AddField("middleName" , LastName , String_ , Contact);
|
||||
OPI_Tools.AddField("lastName" , Patronymic, String_ , Contact);
|
||||
OPI_Tools.AddField("company" , Company , String_ , Contact);
|
||||
|
||||
Return Contact;
|
||||
|
||||
|
62
src/en/OInt/core/Modules/OPI_MySQL.os
vendored
62
src/en/OInt/core/Modules/OPI_MySQL.os
vendored
@@ -522,34 +522,7 @@ Function ProcessParameter(CurrentParameter, AsObject = True)
|
||||
|
||||
Else
|
||||
|
||||
If CurrentType = Type("Structure") Or CurrentType = Type("Map") Then
|
||||
|
||||
If OPI_Tools.CollectionFieldExist(CurrentParameter, "BYTES") Then
|
||||
|
||||
CurrentParameter = ProcessBlobStructure(CurrentParameter);
|
||||
CurrentKey = "BYTES";
|
||||
|
||||
Else
|
||||
|
||||
For Each ParamElement In CurrentParameter Do
|
||||
|
||||
CurrentKey = Upper(ParamElement.Key);
|
||||
CurrentValue = ParamElement.Value;
|
||||
|
||||
CurrentParameter = ProcessParameter(CurrentValue, False);
|
||||
|
||||
Break;
|
||||
|
||||
EndDo;
|
||||
|
||||
EndIf;
|
||||
|
||||
Else
|
||||
|
||||
OPI_TypeConversion.GetLine(CurrentParameter);
|
||||
CurrentKey = "TEXT";
|
||||
|
||||
EndIf;
|
||||
ProcessCollectionParameter(CurrentType, CurrentParameter, CurrentKey);
|
||||
|
||||
EndIf;
|
||||
|
||||
@@ -561,6 +534,39 @@ Function ProcessParameter(CurrentParameter, AsObject = True)
|
||||
|
||||
EndFunction
|
||||
|
||||
Procedure ProcessCollectionParameter(Val CurrentType, CurrentParameter, CurrentKey)
|
||||
|
||||
If CurrentType = Type("Structure") Or CurrentType = Type("Map") Then
|
||||
|
||||
If OPI_Tools.CollectionFieldExist(CurrentParameter, "BYTES") Then
|
||||
|
||||
CurrentParameter = ProcessBlobStructure(CurrentParameter);
|
||||
CurrentKey = "BYTES";
|
||||
|
||||
Else
|
||||
|
||||
For Each ParamElement In CurrentParameter Do
|
||||
|
||||
CurrentKey = Upper(ParamElement.Key);
|
||||
CurrentValue = ParamElement.Value;
|
||||
|
||||
CurrentParameter = ProcessParameter(CurrentValue, False);
|
||||
|
||||
Break;
|
||||
|
||||
EndDo;
|
||||
|
||||
EndIf;
|
||||
|
||||
Else
|
||||
|
||||
OPI_TypeConversion.GetLine(CurrentParameter);
|
||||
CurrentKey = "TEXT";
|
||||
|
||||
EndIf;
|
||||
|
||||
EndProcedure
|
||||
|
||||
Function ProcessBlobStructure(Val Value)
|
||||
|
||||
Bytea_ = "BYTES";
|
||||
|
2
src/en/OInt/core/Modules/OPI_Telegram.os
vendored
2
src/en/OInt/core/Modules/OPI_Telegram.os
vendored
@@ -721,8 +721,6 @@ Function ReplaceMessageKeyboard(Val Token, Val ChatID, Val MessageID, Val Keyboa
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
|
||||
String_ = "String";
|
||||
|
||||
Parameters = New Structure;
|
||||
OPI_Tools.AddField("message_id" , MessageID, "Number" , Parameters);
|
||||
OPI_Tools.AddField("reply_markup", Keyboard , "Collection", Parameters);
|
||||
|
2
src/en/OInt/core/Modules/OPI_YandexMarket.os
vendored
2
src/en/OInt/core/Modules/OPI_YandexMarket.os
vendored
@@ -191,7 +191,7 @@ EndFunction
|
||||
// Gets the list of products of the selected market (campaign)
|
||||
//
|
||||
// Note
|
||||
// Method at API documentation: [Information о productх, that размещены in заданbutм магазandnot](@https://yandex.ru/dev/market/partner-api/doc/ru/reference/assortment/getCampaignOffers)
|
||||
// Method at API documentation: [Information o productх, that размещены in заданbutм магазandnot](@https://yandex.ru/dev/market/partner-api/doc/ru/reference/assortment/getCampaignOffers)
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Authorization token (Api-Key) - token
|
||||
|
11
src/en/OInt/tests/Modules/internal/OPI_Tests.os
vendored
11
src/en/OInt/tests/Modules/internal/OPI_Tests.os
vendored
@@ -40,6 +40,9 @@
|
||||
// BSLLS:CommentedCode-off
|
||||
// BSLLS:AssignAliasFieldsInQuery-off
|
||||
// BSLLS:UsingHardcodeNetworkAddress-off
|
||||
// BSLLS:UnreachableCode-off
|
||||
// BSLLS:UnusedLocalMethod-off
|
||||
// BSLLS:NestedFunctionInParameters-off
|
||||
|
||||
//@skip-check undefined-variable
|
||||
//@skip-check wrong-string-literal-content
|
||||
@@ -14899,7 +14902,7 @@ Procedure Ozon_GetFBOTimeslots(FunctionParameters)
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.WriteLog(Result, "GetFBOTimeslots", "Ozon");
|
||||
OPI_TestDataRetrieval.Check_OzonTimeslots(Result);
|
||||
//OPI_TestDataRetrieval.Check_OzonTimeslots(Result);
|
||||
|
||||
EndProcedure
|
||||
|
||||
@@ -21631,7 +21634,7 @@ Procedure HTTPClient_StartMultipartBody(FunctionParameters)
|
||||
// END
|
||||
|
||||
Try
|
||||
Result["origin"] = "***";
|
||||
Result["origin"] = "***";
|
||||
ResponseFile = Result["files"]["file1"];
|
||||
Result["files"]["file1"] = "...";
|
||||
Except
|
||||
@@ -21676,7 +21679,7 @@ Procedure HTTPClient_AddMultipartFormDataFile(FunctionParameters)
|
||||
// END
|
||||
|
||||
Try
|
||||
Result["origin"] = "***";
|
||||
Result["origin"] = "***";
|
||||
ResponseFile = Result["files"]["file1"];
|
||||
Result["files"]["file1"] = "...";
|
||||
Except
|
||||
@@ -21721,7 +21724,7 @@ Procedure HTTPClient_AddMultipartFormDataField(FunctionParameters)
|
||||
// END
|
||||
|
||||
Try
|
||||
Result["origin"] = "***";
|
||||
Result["origin"] = "***";
|
||||
ResponseFile = Result["files"]["file1"];
|
||||
Result["files"]["file1"] = "...";
|
||||
Except
|
||||
|
@@ -40,6 +40,9 @@
|
||||
// BSLLS:CommentedCode-off
|
||||
// BSLLS:AssignAliasFieldsInQuery-off
|
||||
// BSLLS:UsingHardcodeNetworkAddress-off
|
||||
// BSLLS:UnreachableCode-off
|
||||
// BSLLS:UnusedLocalMethod-off
|
||||
// BSLLS:NestedFunctionInParameters-off
|
||||
|
||||
//@skip-check undefined-variable
|
||||
//@skip-check wrong-string-literal-content
|
||||
@@ -1542,10 +1545,6 @@ Procedure CLI_OzonAPI_FBOScheme() Export
|
||||
|
||||
CLI_Ozon_GetClustersList(TestParameters);
|
||||
CLI_Ozon_GetShippingWarehousesList(TestParameters);
|
||||
|
||||
// TODO: Comeback later
|
||||
Return;
|
||||
|
||||
CLI_Ozon_CreateFBODraft(TestParameters);
|
||||
CLI_Ozon_GetFBODraft(TestParameters);
|
||||
CLI_Ozon_GetShipmentAdditionalFields(TestParameters);
|
||||
@@ -10858,7 +10857,7 @@ Procedure CLI_Ozon_GetFBOTimeslots(FunctionParameters)
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("ozon", "GetFBOTimeslots", Options);
|
||||
|
||||
OPI_TestDataRetrieval.WriteLogCLI(Result, "GetFBOTimeslots", "Ozon");
|
||||
OPI_TestDataRetrieval.Check_OzonTimeslots(Result);
|
||||
//OPI_TestDataRetrieval.Check_OzonTimeslots(Result);
|
||||
|
||||
EndProcedure
|
||||
|
||||
|
16
src/en/OInt/tools/Modules/OPI_HTTPRequests.os
vendored
16
src/en/OInt/tools/Modules/OPI_HTTPRequests.os
vendored
@@ -24,23 +24,19 @@
|
||||
|
||||
// https://github.com/Bayselonarrend/OpenIntegrations
|
||||
|
||||
// BSLLS:Typo-off
|
||||
// BSLLS:LatinAndCyrillicSymbolInWord-off
|
||||
// BSLLS:IncorrectLineBreak-off
|
||||
// BSLLS:UsingHardcodePath-off
|
||||
// BSLLS:Typo-off
|
||||
// BSLLS:DeprecatedMessage-off
|
||||
// BSLLS:UnusedLocalVariable-off
|
||||
// BSLLS:UsingServiceTag-off
|
||||
// BSLLS:ExecuteExternalCodeInCommonModule-off
|
||||
// BSLLS:DuplicateStringLiteral-off
|
||||
// BSLLS:MagicNumber-off
|
||||
// BSLLS:UsingHardcodeNetworkAddress-off
|
||||
// BSLLS:NumberOfOptionalParams-off
|
||||
|
||||
//@skip-check use-non-recommended-method
|
||||
//@skip-check module-unused-local-variable
|
||||
//@skip-check method-too-many-params
|
||||
//@skip-check module-structure-top-region
|
||||
//@skip-check module-structure-method-in-regions
|
||||
//@skip-check undefined-function-or-procedure
|
||||
//@skip-check wrong-string-literal-content
|
||||
//@skip-check method-too-many-params
|
||||
//@skip-check use-non-recommended-method
|
||||
|
||||
// Uncomment if OneScript is executed
|
||||
#Use "./internal"
|
||||
|
1
src/en/OInt/tools/Modules/OPI_SQLQueries.os
vendored
1
src/en/OInt/tools/Modules/OPI_SQLQueries.os
vendored
@@ -32,6 +32,7 @@
|
||||
// BSLLS:LineLength-off
|
||||
// BSLLS:QueryParseError-off
|
||||
// BSLLS:AssignAliasFieldsInQuery-off
|
||||
// BSLLS:NumberOfParams-off
|
||||
|
||||
//@skip-check module-structure-top-region
|
||||
//@skip-check module-structure-method-in-regions
|
||||
|
@@ -337,7 +337,9 @@ Procedure GetNumber(Value) Export
|
||||
|
||||
EndIf;
|
||||
|
||||
// BSLLS:TryNumber-off
|
||||
Value = Number(Value_);
|
||||
// BSLLS:TryNumber-on
|
||||
|
||||
Except
|
||||
Return;
|
||||
@@ -363,10 +365,15 @@ Procedure GetFileOnDisk(Value, Val Extension = "tmp") Export
|
||||
|
||||
Else
|
||||
|
||||
OPI_TypeConversion.GetBinaryData(Value, True);
|
||||
GetBinaryData(Value, True);
|
||||
|
||||
// BSLLS:MissingTemporaryFileDeletion-off
|
||||
|
||||
//@skip-check missing-temporary-file-deletion
|
||||
Path = GetTempFileName(Extension);
|
||||
|
||||
// BSLLS:MissingTemporaryFileDeletion-on
|
||||
|
||||
Value.Write(Path);
|
||||
|
||||
ReturnStructure.Insert("Path" , Path);
|
||||
|
@@ -30,6 +30,8 @@
|
||||
// BSLLS:NumberOfOptionalParams-off
|
||||
// BSLLS:UsingServiceTag-off
|
||||
// BSLLS:LineLength-off
|
||||
// BSLLS:ExportVariables-off
|
||||
// BSLLS:OneStatementPerLine-off
|
||||
|
||||
//@skip-check module-structure-top-region
|
||||
//@skip-check module-structure-method-in-regions
|
||||
@@ -37,6 +39,7 @@
|
||||
//@skip-check method-too-many-params
|
||||
//@skip-check constructor-function-return-section
|
||||
//@skip-check doc-comment-collection-item-type
|
||||
//@skip-check object-module-export-variable
|
||||
|
||||
// #If Not Client Then
|
||||
|
||||
@@ -44,59 +47,58 @@
|
||||
|
||||
// Processor
|
||||
|
||||
Var Initialized;
|
||||
|
||||
Var Error Export;
|
||||
Var Log;
|
||||
Var Initialized; // Flag indicating that the mandatory Initialize() function was called
|
||||
Var Error Export; // Execution error flag to skip remaining actions in the chain
|
||||
Var Log; // Array of messages about actions within the processing
|
||||
|
||||
// Request
|
||||
|
||||
Var Request;
|
||||
Var Connection;
|
||||
Var Settings;
|
||||
Var Request; // HTTPRequest object
|
||||
Var Connection; // HTTPConnection object
|
||||
Var Settings; // Additional settings structure
|
||||
|
||||
Var RequestURL;
|
||||
Var RequestServer;
|
||||
Var RequestPort;
|
||||
Var RequestAdress;
|
||||
Var RequestAdressFull;
|
||||
Var RequestSection;
|
||||
Var RequestProtected;
|
||||
Var RequestDomain;
|
||||
Var RequestURL; // Request URL
|
||||
Var RequestServer; // Server from the request URL
|
||||
Var RequestPort; // Port from the request URL or default
|
||||
Var RequestAdress; // Path from the request URL
|
||||
Var RequestAdressFull; // Path with parameters and section from the request URL
|
||||
Var RequestSection; // Section in the URL if present
|
||||
Var RequestProtected; // HTTPS usage flag
|
||||
Var RequestDomain; // Domain from the request URL
|
||||
|
||||
Var RequestMethod;
|
||||
Var RequestURLParams;
|
||||
Var RequestBody;
|
||||
Var RequestHeaders;
|
||||
Var RequestUser;
|
||||
Var RequestPassword;
|
||||
Var RequestTimeout;
|
||||
Var RequestProxy;
|
||||
Var RequestOutputFile;
|
||||
Var RequestBodyFile;
|
||||
Var RequestBodyStream;
|
||||
Var RequestDataWriter;
|
||||
Var RequestDataType;
|
||||
Var RequestTypeSetManualy;
|
||||
Var BodyTemporaryFile;
|
||||
Var RequestMethod; // HTTP method used
|
||||
Var RequestURLParams; // URL parameters structure
|
||||
Var RequestBody; // Request body data
|
||||
Var RequestHeaders; // Request headers mapping
|
||||
Var RequestUser; // User for basic authorization
|
||||
Var RequestPassword; // Password for basic authorization
|
||||
Var RequestTimeout; // Request timeout
|
||||
Var RequestProxy; // Request proxy settings
|
||||
Var RequestOutputFile; // Path to the file for saving the request result
|
||||
Var RequestBodyFile; // Path to the file with the request body
|
||||
Var RequestBodyStream; // Request body stream
|
||||
Var RequestDataWriter; // Request body data writing
|
||||
Var RequestDataType; // MIME type for Content-Type
|
||||
Var RequestTypeSetManualy; // Flag to disable automatic Content-Type detection
|
||||
Var BodyTemporaryFile; // Flag to delete the body file if it was created automatically
|
||||
|
||||
// AWS
|
||||
|
||||
Var AWS4Using;
|
||||
Var AWS4Data;
|
||||
Var AWS4Using; // Flag to use AWS4 authorization
|
||||
Var AWS4Data; // Credentials structure
|
||||
|
||||
// Response
|
||||
|
||||
Var Response;
|
||||
Var ResponseStatusCode;
|
||||
Var ResponseBody;
|
||||
Var ResponseHeaders;
|
||||
Var Response; // HTTPResponse object
|
||||
Var ResponseStatusCode; // Response status code
|
||||
Var ResponseBody; // Response body data
|
||||
Var ResponseHeaders; // Response headers mapping
|
||||
|
||||
// Multipart
|
||||
|
||||
Var Multipart;
|
||||
Var Boundary;
|
||||
Var LineSeparator;
|
||||
Var Multipart; // Flag indicating the body is set in Multipart format
|
||||
Var Boundary; // Boundary for separating body parts
|
||||
Var LineSeparator; // Body line separator
|
||||
|
||||
#EndRegion
|
||||
|
||||
@@ -156,28 +158,28 @@ Function SetURL(Val URL) Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ЭтотОбъект EndIf;
|
||||
If StopExecution() Then Return ЭтотОбъект; EndIf;
|
||||
|
||||
If ValueIsFilled(URL) Then
|
||||
If ValueIsFilled(URL) Then
|
||||
|
||||
OPI_TypeConversion.GetLine(URL);
|
||||
OPI_Tools.RestoreEscapeSequences(URL);
|
||||
|
||||
If GetSetting("URLencoding") Then
|
||||
OPI_Tools.EncodeURLInURL(URL);
|
||||
EndIf;
|
||||
|
||||
RequestURL = URL;
|
||||
|
||||
AddLog("SetURL: Splitting a request into component parts");
|
||||
|
||||
Else
|
||||
|
||||
AddLog("SetURL: URL is empty - skip");
|
||||
OPI_TypeConversion.GetLine(URL);
|
||||
OPI_Tools.RestoreEscapeSequences(URL);
|
||||
|
||||
If GetSetting("URLencoding") Then
|
||||
OPI_Tools.EncodeURLInURL(URL);
|
||||
EndIf;
|
||||
|
||||
Return SplitURL();
|
||||
RequestURL = URL;
|
||||
|
||||
AddLog("SetURL: Splitting a request into component parts");
|
||||
|
||||
Else
|
||||
|
||||
AddLog("SetURL: URL is empty - skip");
|
||||
|
||||
EndIf;
|
||||
|
||||
Return SplitURL();
|
||||
|
||||
Except
|
||||
Return Error(DetailErrorDescription(ErrorInfo()));
|
||||
@@ -197,7 +199,7 @@ Function SetURLParams(Val Value) Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ЭтотОбъект EndIf;
|
||||
If StopExecution() Then Return ЭтотОбъект; EndIf;
|
||||
If Not ValueIsFilled(Value) Then Value = New Structure; EndIf;
|
||||
|
||||
ErrorText = "SetURLParams: The passed parameters are not a key/value collection";
|
||||
@@ -224,7 +226,7 @@ Function SetResponseFile(Val Value) Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ЭтотОбъект EndIf;
|
||||
If StopExecution() Then Return ЭтотОбъект; EndIf;
|
||||
If Not ValueIsFilled(Value) Then
|
||||
RequestOutputFile = Undefined;
|
||||
Return ЭтотОбъект;
|
||||
@@ -241,7 +243,7 @@ Function SetResponseFile(Val Value) Export
|
||||
|
||||
EndFunction
|
||||
|
||||
// Set data type
|
||||
// Set data type !NOCLI
|
||||
// Sets the Content-Type of the request
|
||||
//
|
||||
// Note
|
||||
@@ -256,7 +258,7 @@ Function SetDataType(Val Value) Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ЭтотОбъект EndIf;
|
||||
If StopExecution() Then Return ЭтотОбъект; EndIf;
|
||||
|
||||
AddLog("SetDataType: Setting the value");
|
||||
OPI_TypeConversion.GetLine(Value);
|
||||
@@ -296,11 +298,22 @@ EndFunction
|
||||
|
||||
#Region Settings
|
||||
|
||||
// Use encoding !NOCLI
|
||||
// Sets the encoding of the request body
|
||||
//
|
||||
// Note
|
||||
// UTF-8 is used by default
|
||||
//
|
||||
// Parameters:
|
||||
// Encoding - String - Encoding name - enc
|
||||
//
|
||||
// Returns:
|
||||
// DataProcessorObject.OPI_HTTPClient - This processor object
|
||||
Function UseEncoding(Val Encoding) Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ЭтотОбъект EndIf;
|
||||
If StopExecution() Then Return ЭтотОбъект; EndIf;
|
||||
|
||||
AddLog("UseEncoding: Setting the value");
|
||||
OPI_TypeConversion.GetLine(Encoding);
|
||||
@@ -315,11 +328,22 @@ Function UseEncoding(Val Encoding) Export
|
||||
|
||||
EndFunction
|
||||
|
||||
// Use Gzip compression !NOCLI
|
||||
// Enables or disables the header for receiving data from the server in compressed form
|
||||
//
|
||||
// Note
|
||||
// By default, the response from the server is requested with gzip compression
|
||||
//
|
||||
// Parameters:
|
||||
// Flag - Boolean - Flag for gzip using - gzip
|
||||
//
|
||||
// Returns:
|
||||
// DataProcessorObject.OPI_HTTPClient - This processor object
|
||||
Function UseGzipCompression(Val Flag) Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ЭтотОбъект EndIf;
|
||||
If StopExecution() Then Return ЭтотОбъект; EndIf;
|
||||
|
||||
AddLog("UseGzipCompression: Setting the value");
|
||||
OPI_TypeConversion.GetBoolean(Flag);
|
||||
@@ -351,7 +375,7 @@ Function SetBinaryBody(Val Data, Val SetIfEmpty = False) Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ЭтотОбъект EndIf;
|
||||
If StopExecution() Then Return ЭтотОбъект; EndIf;
|
||||
|
||||
CancelMultipartBody();
|
||||
|
||||
@@ -400,7 +424,7 @@ Function SetStringBody(Val Data, Val WriteBOM = False) Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ЭтотОбъект EndIf;
|
||||
If StopExecution() Then Return ЭтотОбъект; EndIf;
|
||||
|
||||
CancelMultipartBody();
|
||||
|
||||
@@ -441,7 +465,7 @@ Function SetJsonBody(Val Data) Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ЭтотОбъект EndIf;
|
||||
If StopExecution() Then Return ЭтотОбъект; EndIf;
|
||||
|
||||
CancelMultipartBody();
|
||||
|
||||
@@ -481,7 +505,7 @@ Function SetFormBody(Val Data) Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ЭтотОбъект EndIf;
|
||||
If StopExecution() Then Return ЭтотОбъект; EndIf;
|
||||
|
||||
CancelMultipartBody();
|
||||
|
||||
@@ -537,7 +561,7 @@ Function StartMultipartBody(UseFile = True, Val View = "form-data") Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ЭтотОбъект EndIf;
|
||||
If StopExecution() Then Return ЭтотОбъект; EndIf;
|
||||
|
||||
OPI_TypeConversion.GetBoolean(UseFile);
|
||||
OPI_TypeConversion.GetLine(View);
|
||||
@@ -545,14 +569,17 @@ Function StartMultipartBody(UseFile = True, Val View = "form-data") Export
|
||||
Multipart = True;
|
||||
Boundary = StrReplace(String(New UUID), "-", "");
|
||||
LineSeparator = Chars.CR + Chars.LF;
|
||||
Encoding = GetSetting("EncodeRequestBody");
|
||||
RequestDataType = StrTemplate("multipart/%1; boundary=%2; charset=%3", View, Boundary, Encoding);
|
||||
Encoding = GetSetting("EncodeRequestBody");
|
||||
RequestDataType = StrTemplate("multipart/%1; boundary=%2", View, Boundary);
|
||||
|
||||
If UseFile Then
|
||||
|
||||
AddLog("StartMultipartBody: Creating a temporary file");
|
||||
|
||||
RequestBodyFile = GetTempFileName();
|
||||
// BSLLS:MissingTemporaryFileDeletion-off
|
||||
RequestBodyFile = GetTempFileName();
|
||||
// BSLLS:MissingTemporaryFileDeletion-on
|
||||
|
||||
BodyTemporaryFile = True;
|
||||
RequestDataWriter = New DataWriter(RequestBodyFile
|
||||
, Encoding
|
||||
@@ -603,8 +630,8 @@ Function AddMultipartFormDataFile(Val FieldName, Val FileName, Val Data, Val Dat
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ЭтотОбъект EndIf;
|
||||
If Not Multipart Then Return Error("AddMultipartFormDataFile: Multipart record not initialized") EndIf;
|
||||
If StopExecution() Then Return ЭтотОбъект; EndIf;
|
||||
If Not Multipart Then Return Error("AddMultipartFormDataFile: Multipart record not initialized"); EndIf;
|
||||
|
||||
OPI_TypeConversion.GetBinaryData(Data);
|
||||
|
||||
@@ -653,7 +680,7 @@ Function AddMultipartFormDataField(Val FieldName, Val Value) Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ЭтотОбъект EndIf;
|
||||
If StopExecution() Then Return ЭтотОбъект; EndIf;
|
||||
If Not Multipart Then Return Error("AddMultipartFormDataField: Multipart record not initialized") EndIf;
|
||||
|
||||
ValeType = TypeOf(Value);
|
||||
@@ -712,8 +739,8 @@ Function AddDataAsRelated(Val Data, Val DataType, Val ContentID = "") Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ЭтотОбъект EndIf;
|
||||
If Not Multipart Then Return Error("AddFileAsRelated: Multipart record not initialized") EndIf;
|
||||
If StopExecution() Then Return ЭтотОбъект; EndIf;
|
||||
If Not Multipart Then Return Error("AddFileAsRelated: Multipart record not initialized"); EndIf;
|
||||
|
||||
OPI_TypeConversion.GetLine(DataType);
|
||||
OPI_TypeConversion.GetLine(ContentID);
|
||||
@@ -763,8 +790,8 @@ Function SetHeaders(Val Value, Val FullReplace = False) Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ЭтотОбъект EndIf;
|
||||
If Not ValueIsFilled(Value) Then Value = New Map EndIf;
|
||||
If StopExecution() Then Return ЭтотОбъект; EndIf;
|
||||
If Not ValueIsFilled(Value) Then Value = New Map; EndIf;
|
||||
|
||||
ErrorText = "SetURLParams: The passed parameters are not a key/value collection";
|
||||
OPI_TypeConversion.GetKeyValueCollection(Value, ErrorText);
|
||||
@@ -803,7 +830,7 @@ Function AddBasicAuthorization(Val User, Val Password) Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ЭтотОбъект EndIf;
|
||||
If StopExecution() Then Return ЭтотОбъект; EndIf;
|
||||
|
||||
OPI_TypeConversion.GetLine(User);
|
||||
OPI_TypeConversion.GetLine(Password);
|
||||
@@ -834,7 +861,7 @@ Function AddAWS4Authorization(Val AccessKey, Val SecretKey, Val Region, Val Serv
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ЭтотОбъект EndIf;
|
||||
If StopExecution() Then Return ЭтотОбъект; EndIf;
|
||||
|
||||
String_ = "String";
|
||||
AWS4Using = True;
|
||||
@@ -874,12 +901,12 @@ Function ProcessRequest(Val Method, Val Start = True) Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ЭтотОбъект; EndIf;
|
||||
|
||||
OPI_TypeConversion.GetLine(Method);
|
||||
OPI_TypeConversion.GetBoolean(Start);
|
||||
RequestMethod = Method;
|
||||
|
||||
If StopExecution() Then Return ЭтотОбъект EndIf;
|
||||
|
||||
AddLog("ProcessRequest: Forming a request");
|
||||
If FormRequest().Error Then Return ЭтотОбъект EndIf;
|
||||
|
||||
@@ -913,7 +940,7 @@ Function ExecuteRequest(Val Method) Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ЭтотОбъект EndIf;
|
||||
If StopExecution() Then Return ЭтотОбъект; EndIf;
|
||||
|
||||
OPI_TypeConversion.GetLine(Method);
|
||||
RequestMethod = Method;
|
||||
@@ -981,7 +1008,7 @@ Function ReturnResponse(Val Forced = False, Val ExceptionOnError = False) Export
|
||||
|
||||
OPI_TypeConversion.GetBoolean(Forced);
|
||||
|
||||
If StopExecution(ExceptionOnError) And Not Forced Then Return ЭтотОбъект EndIf;
|
||||
If StopExecution(ExceptionOnError) And Not Forced Then Return ЭтотОбъект; EndIf;
|
||||
|
||||
Return Response;
|
||||
|
||||
@@ -998,7 +1025,7 @@ EndFunction
|
||||
// Arbitrary - The response or the same processing object
|
||||
Function ReturnResponseAsJSONObject(Val ToMap = True, Val ExceptionOnError = False) Export
|
||||
|
||||
If StopExecution(ExceptionOnError) Then Return ЭтотОбъект EndIf;
|
||||
If StopExecution(ExceptionOnError) Then Return ЭтотОбъект; EndIf;
|
||||
|
||||
Try
|
||||
|
||||
@@ -1040,7 +1067,7 @@ Function ReturnResponseAsBinaryData(Val Forced = False, Val ExceptionOnError = F
|
||||
|
||||
OPI_TypeConversion.GetBoolean(Forced);
|
||||
|
||||
If StopExecution(ExceptionOnError) And Not Forced Then Return ЭтотОбъект EndIf;
|
||||
If StopExecution(ExceptionOnError) And Not Forced Then Return ЭтотОбъект; EndIf;
|
||||
|
||||
BodyAsString = GetResponseBody();
|
||||
|
||||
@@ -1061,7 +1088,7 @@ Function ReturnResponseAsString(Val Forced = False, Val ExceptionOnError = False
|
||||
|
||||
OPI_TypeConversion.GetBoolean(Forced);
|
||||
|
||||
If StopExecution(ExceptionOnError) And Not Forced Then Return ЭтотОбъект EndIf;
|
||||
If StopExecution(ExceptionOnError) And Not Forced Then Return ЭтотОбъект; EndIf;
|
||||
|
||||
BodyAsString = ПолучитьСтрокуИзДвоичныхДанных(GetResponseBody());
|
||||
|
||||
@@ -1082,7 +1109,7 @@ Function ReturnResponseFilename(Val Forced = False, Val ExceptionOnError = False
|
||||
|
||||
OPI_TypeConversion.GetBoolean(Forced);
|
||||
|
||||
If StopExecution(ExceptionOnError) And Not Forced Then Return ЭтотОбъект EndIf;
|
||||
If StopExecution(ExceptionOnError) And Not Forced Then Return ЭтотОбъект; EndIf;
|
||||
|
||||
BodyFileName = Response.GetBodyFileName();
|
||||
|
||||
@@ -1423,6 +1450,7 @@ Function CompleteHeaders()
|
||||
|
||||
EndIf;
|
||||
|
||||
Return ЭтотОбъект;
|
||||
|
||||
EndFunction
|
||||
|
||||
@@ -1476,9 +1504,9 @@ Function GetResponseBody()
|
||||
HeaderKey = ResponseHeader.Key;
|
||||
HeaderValue = ResponseHeader.Value;
|
||||
|
||||
If Lower(HeaderKey) = "content-encoding" Then
|
||||
If Lower(HeaderKey) = "content-encoding" Then
|
||||
If Lower(HeaderValue) = "gzip" Then
|
||||
NeedsUnpacking = True;
|
||||
NeedsUnpacking = True;
|
||||
Break;
|
||||
EndIf;
|
||||
EndIf;
|
||||
@@ -1550,47 +1578,47 @@ EndFunction
|
||||
|
||||
Procedure CancelMultipartBody()
|
||||
|
||||
If Multipart Then
|
||||
If Not Multipart Then
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
AddLog("CancelMultipartBody: Deleting recorded data");
|
||||
Multipart = False;
|
||||
AddLog("CancelMultipartBody: Deleting recorded data");
|
||||
Multipart = False;
|
||||
|
||||
Try
|
||||
RequestDataWriter.Close();
|
||||
Except
|
||||
AddLog("CancelMultipartBody: Could not close the writer. It may have already been closed");
|
||||
EndTry;
|
||||
|
||||
If ValueIsFilled(RequestBodyFile) Then
|
||||
|
||||
Try
|
||||
|
||||
DeleteFiles(RequestBodyFile);
|
||||
AddLog("CancelMultipartBody: The body file has been deleted");
|
||||
|
||||
Try
|
||||
RequestDataWriter.Close();
|
||||
Except
|
||||
AddLog("CancelMultipartBody: Could not close the writer. It may have already been closed");
|
||||
AddLog("CancelMultipartBody: Failed to delete the body file. It may have already been deleted");
|
||||
EndTry;
|
||||
|
||||
If ValueIsFilled(RequestBodyFile) Then
|
||||
Else
|
||||
|
||||
If TypeOf(RequestBodyStream) = Type("MemoryStream") Then
|
||||
|
||||
Try
|
||||
|
||||
DeleteFiles(RequestBodyFile);
|
||||
AddLog("CancelMultipartBody: The body file has been deleted");
|
||||
|
||||
RequestBodyStream.Close();
|
||||
Except
|
||||
AddLog("CancelMultipartBody: Failed to delete the body file. It may have already been deleted");
|
||||
AddLog("CancelMultipartBody: Failed to close the stream. It may have already been closed");
|
||||
EndTry;
|
||||
|
||||
Else
|
||||
|
||||
If TypeOf(RequestBodyStream) = Type("MemoryStream") Then
|
||||
|
||||
Try
|
||||
RequestBodyStream.Close();
|
||||
Except
|
||||
AddLog("CancelMultipartBody: Failed to close the stream. It may have already been closed");
|
||||
EndTry;
|
||||
|
||||
EndIf;
|
||||
|
||||
EndIf;
|
||||
|
||||
RequestDataWriter = Undefined;
|
||||
RequestBodyFile = Undefined;
|
||||
|
||||
EndIf;
|
||||
|
||||
RequestDataWriter = Undefined;
|
||||
RequestBodyFile = Undefined;
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure WriteBinaryData(DataWriter, Val BinaryData)
|
||||
|
@@ -217,9 +217,10 @@ Function GetDomain(Val ConnectionString) Export
|
||||
EndIf;
|
||||
|
||||
ProtocolEnd = StrFind(Domain, "://");
|
||||
Slashes = 2;
|
||||
|
||||
If ProtocolEnd > 0 Then
|
||||
Domain = Right(Domain, StrLen(Domain) - (ProtocolEnd + 2));
|
||||
Domain = Right(Domain, StrLen(Domain) - (ProtocolEnd + Slashes));
|
||||
EndIf;
|
||||
|
||||
If StrFind(Domain, ":") <> 0 Then
|
||||
@@ -1081,18 +1082,6 @@ Procedure WriteOnCurrentLine(Val Text, Val Color = "", Val ToStart = False) Expo
|
||||
|
||||
EndProcedure
|
||||
|
||||
Function ThisIsRedirection(Val Response)
|
||||
|
||||
Redirection = 300;
|
||||
Error = 400;
|
||||
|
||||
ThisIsRedirection = Response.StatusCode >= Redirection And Response.StatusCode < Error And ValueIsFilled(
|
||||
Response.Headers["Location"]);
|
||||
|
||||
Return ThisIsRedirection;
|
||||
|
||||
EndFunction
|
||||
|
||||
Function ConvertParameterToString(Val Value)
|
||||
|
||||
If TypeOf(Value) = Type("Array") Then
|
||||
|
@@ -602,7 +602,7 @@ Function UploadSmallFile(Val Description, Val FileMapping, Val Headers, Val Iden
|
||||
.AddDataAsRelated(Description, "application/json; charset=UTF-8");
|
||||
|
||||
For Each File In FileMapping Do
|
||||
HTTPClient.AddDataAsRelated(File.Key, File.Value)
|
||||
HTTPClient.AddDataAsRelated(File.Key, File.Value);
|
||||
EndDo;
|
||||
|
||||
Response = HTTPClient.ProcessRequest(Method).ReturnResponseAsJSONObject(True, True);
|
||||
|
@@ -604,11 +604,12 @@ EndFunction
|
||||
// Map Of KeyAndValue - serialized JSON response from Green API
|
||||
Function SendTextMessage(Val AccessParameters, Val ChatID, Val Text, Val ReplyID = "") Export
|
||||
|
||||
String_ = "String";
|
||||
Parameters = New Structure;
|
||||
|
||||
OPI_Tools.AddField("chatId" , ChatID , "String", Parameters);
|
||||
OPI_Tools.AddField("message" , Text , "String", Parameters);
|
||||
OPI_Tools.AddField("quotedMessageId", ReplyID, "String", Parameters);
|
||||
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_HTTPRequests.PostWithBody(URL, Parameters);
|
||||
@@ -642,12 +643,13 @@ Function SendFile(Val AccessParameters
|
||||
|
||||
OPI_TypeConversion.GetBinaryData(File);
|
||||
|
||||
String_ = "String";
|
||||
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);
|
||||
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);
|
||||
@@ -668,7 +670,7 @@ EndFunction
|
||||
// Parameters:
|
||||
// AccessParameters - Structure Of KeyAndValue - Access parameters. See FormAccessParameters - access
|
||||
// ChatID - String - Chat identifier - chat
|
||||
// FileURL - String, - File URL - url
|
||||
// FileURL - String - File URL - url
|
||||
// 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
|
||||
@@ -682,13 +684,14 @@ Function SendFileByURL(Val AccessParameters
|
||||
, Val Description = ""
|
||||
, Val ReplyID = "") Export
|
||||
|
||||
String_ = "String";
|
||||
Parameters = New Structure;
|
||||
|
||||
OPI_Tools.AddField("chatId" , ChatID , "String", Parameters);
|
||||
OPI_Tools.AddField("urlFile" , FileURL , "String", Parameters);
|
||||
OPI_Tools.AddField("fileName" , FileName , "String", Parameters);
|
||||
OPI_Tools.AddField("caption" , Description , "String", Parameters);
|
||||
OPI_Tools.AddField("quotedMessageId", ReplyID , "String", Parameters);
|
||||
OPI_Tools.AddField("chatId" , ChatID , String_, Parameters);
|
||||
OPI_Tools.AddField("urlFile" , FileURL , String_, Parameters);
|
||||
OPI_Tools.AddField("fileName" , FileName , String_, Parameters);
|
||||
OPI_Tools.AddField("caption" , Description , String_, Parameters);
|
||||
OPI_Tools.AddField("quotedMessageId", ReplyID , String_, Parameters);
|
||||
|
||||
URL = FormPrimaryURL(AccessParameters, "sendFileByUrl");
|
||||
Response = OPI_HTTPRequests.PostWithBody(URL, Parameters);
|
||||
@@ -720,6 +723,7 @@ Function SendPoll(Val AccessParameters
|
||||
, Val MultipleSelect = False
|
||||
, Val ReplyID = "") Export
|
||||
|
||||
String_ = "String";
|
||||
Parameters = New Structure;
|
||||
OptionArray = New Array;
|
||||
|
||||
@@ -729,11 +733,11 @@ Function SendPoll(Val AccessParameters
|
||||
OptionArray.Add(New Structure("optionName", Option));
|
||||
EndDo;
|
||||
|
||||
OPI_Tools.AddField("chatId" , ChatID , "String" , Parameters);
|
||||
OPI_Tools.AddField("message" , Text , "String" , Parameters);
|
||||
OPI_Tools.AddField("chatId" , ChatID , String_ , Parameters);
|
||||
OPI_Tools.AddField("message" , Text , String_ , Parameters);
|
||||
OPI_Tools.AddField("options" , OptionArray , "Collection", Parameters);
|
||||
OPI_Tools.AddField("multipleAnswers", MultipleSelect, "Boolean" , Parameters);
|
||||
OPI_Tools.AddField("quotedMessageId", ReplyID , "String" , Parameters);
|
||||
OPI_Tools.AddField("quotedMessageId", ReplyID , String_ , Parameters);
|
||||
|
||||
URL = FormPrimaryURL(AccessParameters, "sendPoll");
|
||||
Response = OPI_HTTPRequests.PostWithBody(URL, Parameters);
|
||||
@@ -850,11 +854,12 @@ EndFunction
|
||||
// Map Of KeyAndValue - serialized JSON response from Green API
|
||||
Function EditMessageText(Val AccessParameters, Val ChatID, Val MessageID, Val Text) Export
|
||||
|
||||
String_ = "String";
|
||||
Parameters = New Structure;
|
||||
|
||||
OPI_Tools.AddField("chatId" , ChatID , "String", Parameters);
|
||||
OPI_Tools.AddField("idMessage", MessageID, "String", Parameters);
|
||||
OPI_Tools.AddField("message" , Text , "String", Parameters);
|
||||
OPI_Tools.AddField("chatId" , ChatID , String_, Parameters);
|
||||
OPI_Tools.AddField("idMessage", MessageID, String_, Parameters);
|
||||
OPI_Tools.AddField("message" , Text , String_, Parameters);
|
||||
|
||||
URL = FormPrimaryURL(AccessParameters, "editMessage");
|
||||
Response = OPI_HTTPRequests.PostWithBody(URL, Parameters);
|
||||
@@ -910,13 +915,14 @@ Function GetContactDescription(Val Phone
|
||||
, Val Patronymic = ""
|
||||
, Val Company = "") Export
|
||||
|
||||
String_ = "String";
|
||||
Contact = New Structure;
|
||||
|
||||
OPI_Tools.AddField("phoneContact", Phone , "Number" , Contact);
|
||||
OPI_Tools.AddField("firstName" , Name , "String" , Contact);
|
||||
OPI_Tools.AddField("middleName" , LastName , "String" , Contact);
|
||||
OPI_Tools.AddField("lastName" , Patronymic, "String" , Contact);
|
||||
OPI_Tools.AddField("company" , Company , "String" , Contact);
|
||||
OPI_Tools.AddField("phoneContact", Phone , "Number", Contact);
|
||||
OPI_Tools.AddField("firstName" , Name , String_ , Contact);
|
||||
OPI_Tools.AddField("middleName" , LastName , String_ , Contact);
|
||||
OPI_Tools.AddField("lastName" , Patronymic, String_ , Contact);
|
||||
OPI_Tools.AddField("company" , Company , String_ , Contact);
|
||||
|
||||
Return Contact;
|
||||
|
||||
|
@@ -24,23 +24,19 @@
|
||||
|
||||
// https://github.com/Bayselonarrend/OpenIntegrations
|
||||
|
||||
// BSLLS:Typo-off
|
||||
// BSLLS:LatinAndCyrillicSymbolInWord-off
|
||||
// BSLLS:IncorrectLineBreak-off
|
||||
// BSLLS:UsingHardcodePath-off
|
||||
// BSLLS:Typo-off
|
||||
// BSLLS:DeprecatedMessage-off
|
||||
// BSLLS:UnusedLocalVariable-off
|
||||
// BSLLS:UsingServiceTag-off
|
||||
// BSLLS:ExecuteExternalCodeInCommonModule-off
|
||||
// BSLLS:DuplicateStringLiteral-off
|
||||
// BSLLS:MagicNumber-off
|
||||
// BSLLS:UsingHardcodeNetworkAddress-off
|
||||
// BSLLS:NumberOfOptionalParams-off
|
||||
|
||||
//@skip-check use-non-recommended-method
|
||||
//@skip-check module-unused-local-variable
|
||||
//@skip-check method-too-many-params
|
||||
//@skip-check module-structure-top-region
|
||||
//@skip-check module-structure-method-in-regions
|
||||
//@skip-check undefined-function-or-procedure
|
||||
//@skip-check wrong-string-literal-content
|
||||
//@skip-check method-too-many-params
|
||||
//@skip-check use-non-recommended-method
|
||||
|
||||
// Uncomment if OneScript is executed
|
||||
// #Use "./internal"
|
||||
|
@@ -522,34 +522,7 @@ Function ProcessParameter(CurrentParameter, AsObject = True)
|
||||
|
||||
Else
|
||||
|
||||
If CurrentType = Type("Structure") Or CurrentType = Type("Map") Then
|
||||
|
||||
If OPI_Tools.CollectionFieldExists(CurrentParameter, "BYTES") Then
|
||||
|
||||
CurrentParameter = ProcessBlobStructure(CurrentParameter);
|
||||
CurrentKey = "BYTES";
|
||||
|
||||
Else
|
||||
|
||||
For Each ParamElement In CurrentParameter Do
|
||||
|
||||
CurrentKey = Upper(ParamElement.Key);
|
||||
CurrentValue = ParamElement.Value;
|
||||
|
||||
CurrentParameter = ProcessParameter(CurrentValue, False);
|
||||
|
||||
Break;
|
||||
|
||||
EndDo;
|
||||
|
||||
EndIf;
|
||||
|
||||
Else
|
||||
|
||||
OPI_TypeConversion.GetLine(CurrentParameter);
|
||||
CurrentKey = "TEXT";
|
||||
|
||||
EndIf;
|
||||
ProcessCollectionParameter(CurrentType, CurrentParameter, CurrentKey);
|
||||
|
||||
EndIf;
|
||||
|
||||
@@ -561,6 +534,39 @@ Function ProcessParameter(CurrentParameter, AsObject = True)
|
||||
|
||||
EndFunction
|
||||
|
||||
Procedure ProcessCollectionParameter(Val CurrentType, CurrentParameter, CurrentKey)
|
||||
|
||||
If CurrentType = Type("Structure") Or CurrentType = Type("Map") Then
|
||||
|
||||
If OPI_Tools.CollectionFieldExists(CurrentParameter, "BYTES") Then
|
||||
|
||||
CurrentParameter = ProcessBlobStructure(CurrentParameter);
|
||||
CurrentKey = "BYTES";
|
||||
|
||||
Else
|
||||
|
||||
For Each ParamElement In CurrentParameter Do
|
||||
|
||||
CurrentKey = Upper(ParamElement.Key);
|
||||
CurrentValue = ParamElement.Value;
|
||||
|
||||
CurrentParameter = ProcessParameter(CurrentValue, False);
|
||||
|
||||
Break;
|
||||
|
||||
EndDo;
|
||||
|
||||
EndIf;
|
||||
|
||||
Else
|
||||
|
||||
OPI_TypeConversion.GetLine(CurrentParameter);
|
||||
CurrentKey = "TEXT";
|
||||
|
||||
EndIf;
|
||||
|
||||
EndProcedure
|
||||
|
||||
Function ProcessBlobStructure(Val Value)
|
||||
|
||||
Bytea_ = "BYTES";
|
||||
|
@@ -32,6 +32,7 @@
|
||||
// BSLLS:LineLength-off
|
||||
// BSLLS:QueryParseError-off
|
||||
// BSLLS:AssignAliasFieldsInQuery-off
|
||||
// BSLLS:NumberOfParams-off
|
||||
|
||||
//@skip-check module-structure-top-region
|
||||
//@skip-check module-structure-method-in-regions
|
||||
|
@@ -721,8 +721,6 @@ Function ReplaceMessageKeyboard(Val Token, Val ChatID, Val MessageID, Val Keyboa
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
|
||||
String_ = "String";
|
||||
|
||||
Parameters = New Structure;
|
||||
OPI_Tools.AddField("message_id" , MessageID, "Number" , Parameters);
|
||||
OPI_Tools.AddField("reply_markup", Keyboard , "Collection", Parameters);
|
||||
|
@@ -40,6 +40,9 @@
|
||||
// BSLLS:CommentedCode-off
|
||||
// BSLLS:AssignAliasFieldsInQuery-off
|
||||
// BSLLS:UsingHardcodeNetworkAddress-off
|
||||
// BSLLS:UnreachableCode-off
|
||||
// BSLLS:UnusedLocalMethod-off
|
||||
// BSLLS:NestedFunctionInParameters-off
|
||||
|
||||
//@skip-check undefined-variable
|
||||
//@skip-check wrong-string-literal-content
|
||||
@@ -14899,7 +14902,7 @@ Procedure Ozon_GetFBOTimeslots(FunctionParameters)
|
||||
// END
|
||||
|
||||
OPI_TestDataRetrieval.WriteLog(Result, "GetFBOTimeslots", "Ozon");
|
||||
OPI_TestDataRetrieval.Check_OzonTimeslots(Result);
|
||||
//OPI_TestDataRetrieval.Check_OzonTimeslots(Result);
|
||||
|
||||
EndProcedure
|
||||
|
||||
@@ -21631,7 +21634,7 @@ Procedure HTTPClient_StartMultipartBody(FunctionParameters)
|
||||
// END
|
||||
|
||||
Try
|
||||
Result["origin"] = "***";
|
||||
Result["origin"] = "***";
|
||||
ResponseFile = Result["files"]["file1"];
|
||||
Result["files"]["file1"] = "...";
|
||||
Except
|
||||
@@ -21676,7 +21679,7 @@ Procedure HTTPClient_AddMultipartFormDataFile(FunctionParameters)
|
||||
// END
|
||||
|
||||
Try
|
||||
Result["origin"] = "***";
|
||||
Result["origin"] = "***";
|
||||
ResponseFile = Result["files"]["file1"];
|
||||
Result["files"]["file1"] = "...";
|
||||
Except
|
||||
@@ -21721,7 +21724,7 @@ Procedure HTTPClient_AddMultipartFormDataField(FunctionParameters)
|
||||
// END
|
||||
|
||||
Try
|
||||
Result["origin"] = "***";
|
||||
Result["origin"] = "***";
|
||||
ResponseFile = Result["files"]["file1"];
|
||||
Result["files"]["file1"] = "...";
|
||||
Except
|
||||
|
@@ -40,6 +40,9 @@
|
||||
// BSLLS:CommentedCode-off
|
||||
// BSLLS:AssignAliasFieldsInQuery-off
|
||||
// BSLLS:UsingHardcodeNetworkAddress-off
|
||||
// BSLLS:UnreachableCode-off
|
||||
// BSLLS:UnusedLocalMethod-off
|
||||
// BSLLS:NestedFunctionInParameters-off
|
||||
|
||||
//@skip-check undefined-variable
|
||||
//@skip-check wrong-string-literal-content
|
||||
@@ -1542,10 +1545,6 @@ Procedure CLI_OzonAPI_FBOScheme() Export
|
||||
|
||||
CLI_Ozon_GetClustersList(TestParameters);
|
||||
CLI_Ozon_GetShippingWarehousesList(TestParameters);
|
||||
|
||||
// TODO: Comeback later
|
||||
Return;
|
||||
|
||||
CLI_Ozon_CreateFBODraft(TestParameters);
|
||||
CLI_Ozon_GetFBODraft(TestParameters);
|
||||
CLI_Ozon_GetShipmentAdditionalFields(TestParameters);
|
||||
@@ -10858,7 +10857,7 @@ Procedure CLI_Ozon_GetFBOTimeslots(FunctionParameters)
|
||||
Result = OPI_TestDataRetrieval.ExecuteTestCLI("ozon", "GetFBOTimeslots", Options);
|
||||
|
||||
OPI_TestDataRetrieval.WriteLogCLI(Result, "GetFBOTimeslots", "Ozon");
|
||||
OPI_TestDataRetrieval.Check_OzonTimeslots(Result);
|
||||
//OPI_TestDataRetrieval.Check_OzonTimeslots(Result);
|
||||
|
||||
EndProcedure
|
||||
|
||||
|
@@ -217,9 +217,10 @@ Function GetDomain(Val ConnectionString) Export
|
||||
EndIf;
|
||||
|
||||
ProtocolEnd = StrFind(Domain, "://");
|
||||
Slashes = 2;
|
||||
|
||||
If ProtocolEnd > 0 Then
|
||||
Domain = Right(Domain, StrLen(Domain) - (ProtocolEnd + 2));
|
||||
Domain = Right(Domain, StrLen(Domain) - (ProtocolEnd + Slashes));
|
||||
EndIf;
|
||||
|
||||
If StrFind(Domain, ":") <> 0 Then
|
||||
@@ -1081,18 +1082,6 @@ Procedure WriteOnCurrentLine(Val Text, Val Color = "", Val ToStart = False) Expo
|
||||
|
||||
EndProcedure
|
||||
|
||||
Function ThisIsRedirection(Val Response)
|
||||
|
||||
Redirection = 300;
|
||||
Error = 400;
|
||||
|
||||
ThisIsRedirection = Response.StatusCode >= Redirection And Response.StatusCode < Error And ValueIsFilled(
|
||||
Response.Headers["Location"]);
|
||||
|
||||
Return ThisIsRedirection;
|
||||
|
||||
EndFunction
|
||||
|
||||
Function ConvertParameterToString(Val Value)
|
||||
|
||||
If TypeOf(Value) = Type("Array") Then
|
||||
|
@@ -337,7 +337,9 @@ Procedure GetNumber(Value) Export
|
||||
|
||||
EndIf;
|
||||
|
||||
// BSLLS:TryNumber-off
|
||||
Value = Number(Value_);
|
||||
// BSLLS:TryNumber-on
|
||||
|
||||
Except
|
||||
Return;
|
||||
@@ -363,10 +365,15 @@ Procedure GetFileOnDisk(Value, Val Extension = "tmp") Export
|
||||
|
||||
Else
|
||||
|
||||
OPI_TypeConversion.GetBinaryData(Value, True);
|
||||
GetBinaryData(Value, True);
|
||||
|
||||
// BSLLS:MissingTemporaryFileDeletion-off
|
||||
|
||||
//@skip-check missing-temporary-file-deletion
|
||||
Path = GetTempFileName(Extension);
|
||||
|
||||
// BSLLS:MissingTemporaryFileDeletion-on
|
||||
|
||||
Value.Write(Path);
|
||||
|
||||
ReturnStructure.Insert("Path" , Path);
|
||||
|
@@ -191,7 +191,7 @@ EndFunction
|
||||
// Gets the list of products of the selected market (campaign)
|
||||
//
|
||||
// Note
|
||||
// Method at API documentation: [Information о productх, that размещены in заданbutм магазandnot](@https://yandex.ru/dev/market/partner-api/doc/ru/reference/assortment/getCampaignOffers)
|
||||
// Method at API documentation: [Information o productх, that размещены in заданbutм магазandnot](@https://yandex.ru/dev/market/partner-api/doc/ru/reference/assortment/getCampaignOffers)
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Authorization token (Api-Key) - token
|
||||
|
@@ -30,6 +30,8 @@
|
||||
// BSLLS:NumberOfOptionalParams-off
|
||||
// BSLLS:UsingServiceTag-off
|
||||
// BSLLS:LineLength-off
|
||||
// BSLLS:ExportVariables-off
|
||||
// BSLLS:OneStatementPerLine-off
|
||||
|
||||
//@skip-check module-structure-top-region
|
||||
//@skip-check module-structure-method-in-regions
|
||||
@@ -37,6 +39,7 @@
|
||||
//@skip-check method-too-many-params
|
||||
//@skip-check constructor-function-return-section
|
||||
//@skip-check doc-comment-collection-item-type
|
||||
//@skip-check object-module-export-variable
|
||||
|
||||
#If Not Client Then
|
||||
|
||||
@@ -44,59 +47,58 @@
|
||||
|
||||
// Processor
|
||||
|
||||
Var Initialized;
|
||||
|
||||
Var Error Export;
|
||||
Var Log;
|
||||
Var Initialized; // Flag indicating that the mandatory Initialize() function was called
|
||||
Var Error Export; // Execution error flag to skip remaining actions in the chain
|
||||
Var Log; // Array of messages about actions within the processing
|
||||
|
||||
// Request
|
||||
|
||||
Var Request;
|
||||
Var Connection;
|
||||
Var Settings;
|
||||
Var Request; // HTTPRequest object
|
||||
Var Connection; // HTTPConnection object
|
||||
Var Settings; // Additional settings structure
|
||||
|
||||
Var RequestURL;
|
||||
Var RequestServer;
|
||||
Var RequestPort;
|
||||
Var RequestAdress;
|
||||
Var RequestAdressFull;
|
||||
Var RequestSection;
|
||||
Var RequestProtected;
|
||||
Var RequestDomain;
|
||||
Var RequestURL; // Request URL
|
||||
Var RequestServer; // Server from the request URL
|
||||
Var RequestPort; // Port from the request URL or default
|
||||
Var RequestAdress; // Path from the request URL
|
||||
Var RequestAdressFull; // Path with parameters and section from the request URL
|
||||
Var RequestSection; // Section in the URL if present
|
||||
Var RequestProtected; // HTTPS usage flag
|
||||
Var RequestDomain; // Domain from the request URL
|
||||
|
||||
Var RequestMethod;
|
||||
Var RequestURLParams;
|
||||
Var RequestBody;
|
||||
Var RequestHeaders;
|
||||
Var RequestUser;
|
||||
Var RequestPassword;
|
||||
Var RequestTimeout;
|
||||
Var RequestProxy;
|
||||
Var RequestOutputFile;
|
||||
Var RequestBodyFile;
|
||||
Var RequestBodyStream;
|
||||
Var RequestDataWriter;
|
||||
Var RequestDataType;
|
||||
Var RequestTypeSetManualy;
|
||||
Var BodyTemporaryFile;
|
||||
Var RequestMethod; // HTTP method used
|
||||
Var RequestURLParams; // URL parameters structure
|
||||
Var RequestBody; // Request body data
|
||||
Var RequestHeaders; // Request headers mapping
|
||||
Var RequestUser; // User for basic authorization
|
||||
Var RequestPassword; // Password for basic authorization
|
||||
Var RequestTimeout; // Request timeout
|
||||
Var RequestProxy; // Request proxy settings
|
||||
Var RequestOutputFile; // Path to the file for saving the request result
|
||||
Var RequestBodyFile; // Path to the file with the request body
|
||||
Var RequestBodyStream; // Request body stream
|
||||
Var RequestDataWriter; // Request body data writing
|
||||
Var RequestDataType; // MIME type for Content-Type
|
||||
Var RequestTypeSetManualy; // Flag to disable automatic Content-Type detection
|
||||
Var BodyTemporaryFile; // Flag to delete the body file if it was created automatically
|
||||
|
||||
// AWS
|
||||
|
||||
Var AWS4Using;
|
||||
Var AWS4Data;
|
||||
Var AWS4Using; // Flag to use AWS4 authorization
|
||||
Var AWS4Data; // Credentials structure
|
||||
|
||||
// Response
|
||||
|
||||
Var Response;
|
||||
Var ResponseStatusCode;
|
||||
Var ResponseBody;
|
||||
Var ResponseHeaders;
|
||||
Var Response; // HTTPResponse object
|
||||
Var ResponseStatusCode; // Response status code
|
||||
Var ResponseBody; // Response body data
|
||||
Var ResponseHeaders; // Response headers mapping
|
||||
|
||||
// Multipart
|
||||
|
||||
Var Multipart;
|
||||
Var Boundary;
|
||||
Var LineSeparator;
|
||||
Var Multipart; // Flag indicating the body is set in Multipart format
|
||||
Var Boundary; // Boundary for separating body parts
|
||||
Var LineSeparator; // Body line separator
|
||||
|
||||
#EndRegion
|
||||
|
||||
@@ -156,28 +158,28 @@ Function SetURL(Val URL) Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ThisObject EndIf;
|
||||
If StopExecution() Then Return ThisObject; EndIf;
|
||||
|
||||
If ValueIsFilled(URL) Then
|
||||
If ValueIsFilled(URL) Then
|
||||
|
||||
OPI_TypeConversion.GetLine(URL);
|
||||
OPI_Tools.RestoreEscapeSequences(URL);
|
||||
|
||||
If GetSetting("URLencoding") Then
|
||||
OPI_Tools.EncodeURLInURL(URL);
|
||||
EndIf;
|
||||
|
||||
RequestURL = URL;
|
||||
|
||||
AddLog("SetURL: Splitting a request into component parts");
|
||||
|
||||
Else
|
||||
|
||||
AddLog("SetURL: URL is empty - skip");
|
||||
OPI_TypeConversion.GetLine(URL);
|
||||
OPI_Tools.RestoreEscapeSequences(URL);
|
||||
|
||||
If GetSetting("URLencoding") Then
|
||||
OPI_Tools.EncodeURLInURL(URL);
|
||||
EndIf;
|
||||
|
||||
Return SplitURL();
|
||||
RequestURL = URL;
|
||||
|
||||
AddLog("SetURL: Splitting a request into component parts");
|
||||
|
||||
Else
|
||||
|
||||
AddLog("SetURL: URL is empty - skip");
|
||||
|
||||
EndIf;
|
||||
|
||||
Return SplitURL();
|
||||
|
||||
Except
|
||||
Return Error(DetailErrorDescription(ErrorInfo()));
|
||||
@@ -197,7 +199,7 @@ Function SetURLParams(Val Value) Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ThisObject EndIf;
|
||||
If StopExecution() Then Return ThisObject; EndIf;
|
||||
If Not ValueIsFilled(Value) Then Value = New Structure; EndIf;
|
||||
|
||||
ErrorText = "SetURLParams: The passed parameters are not a key/value collection";
|
||||
@@ -224,7 +226,7 @@ Function SetResponseFile(Val Value) Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ThisObject EndIf;
|
||||
If StopExecution() Then Return ThisObject; EndIf;
|
||||
If Not ValueIsFilled(Value) Then
|
||||
RequestOutputFile = Undefined;
|
||||
Return ThisObject;
|
||||
@@ -241,7 +243,7 @@ Function SetResponseFile(Val Value) Export
|
||||
|
||||
EndFunction
|
||||
|
||||
// Set data type
|
||||
// Set data type !NOCLI
|
||||
// Sets the Content-Type of the request
|
||||
//
|
||||
// Note
|
||||
@@ -256,7 +258,7 @@ Function SetDataType(Val Value) Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ThisObject EndIf;
|
||||
If StopExecution() Then Return ThisObject; EndIf;
|
||||
|
||||
AddLog("SetDataType: Setting the value");
|
||||
OPI_TypeConversion.GetLine(Value);
|
||||
@@ -296,11 +298,22 @@ EndFunction
|
||||
|
||||
#Region Settings
|
||||
|
||||
// Use encoding !NOCLI
|
||||
// Sets the encoding of the request body
|
||||
//
|
||||
// Note
|
||||
// UTF-8 is used by default
|
||||
//
|
||||
// Parameters:
|
||||
// Encoding - String - Encoding name - enc
|
||||
//
|
||||
// Returns:
|
||||
// DataProcessorObject.OPI_HTTPClient - This processor object
|
||||
Function UseEncoding(Val Encoding) Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ThisObject EndIf;
|
||||
If StopExecution() Then Return ThisObject; EndIf;
|
||||
|
||||
AddLog("UseEncoding: Setting the value");
|
||||
OPI_TypeConversion.GetLine(Encoding);
|
||||
@@ -315,11 +328,22 @@ Function UseEncoding(Val Encoding) Export
|
||||
|
||||
EndFunction
|
||||
|
||||
// Use Gzip compression !NOCLI
|
||||
// Enables or disables the header for receiving data from the server in compressed form
|
||||
//
|
||||
// Note
|
||||
// By default, the response from the server is requested with gzip compression
|
||||
//
|
||||
// Parameters:
|
||||
// Flag - Boolean - Flag for gzip using - gzip
|
||||
//
|
||||
// Returns:
|
||||
// DataProcessorObject.OPI_HTTPClient - This processor object
|
||||
Function UseGzipCompression(Val Flag) Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ThisObject EndIf;
|
||||
If StopExecution() Then Return ThisObject; EndIf;
|
||||
|
||||
AddLog("UseGzipCompression: Setting the value");
|
||||
OPI_TypeConversion.GetBoolean(Flag);
|
||||
@@ -351,7 +375,7 @@ Function SetBinaryBody(Val Data, Val SetIfEmpty = False) Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ThisObject EndIf;
|
||||
If StopExecution() Then Return ThisObject; EndIf;
|
||||
|
||||
CancelMultipartBody();
|
||||
|
||||
@@ -400,7 +424,7 @@ Function SetStringBody(Val Data, Val WriteBOM = False) Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ThisObject EndIf;
|
||||
If StopExecution() Then Return ThisObject; EndIf;
|
||||
|
||||
CancelMultipartBody();
|
||||
|
||||
@@ -441,7 +465,7 @@ Function SetJsonBody(Val Data) Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ThisObject EndIf;
|
||||
If StopExecution() Then Return ThisObject; EndIf;
|
||||
|
||||
CancelMultipartBody();
|
||||
|
||||
@@ -481,7 +505,7 @@ Function SetFormBody(Val Data) Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ThisObject EndIf;
|
||||
If StopExecution() Then Return ThisObject; EndIf;
|
||||
|
||||
CancelMultipartBody();
|
||||
|
||||
@@ -537,7 +561,7 @@ Function StartMultipartBody(UseFile = True, Val View = "form-data") Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ThisObject EndIf;
|
||||
If StopExecution() Then Return ThisObject; EndIf;
|
||||
|
||||
OPI_TypeConversion.GetBoolean(UseFile);
|
||||
OPI_TypeConversion.GetLine(View);
|
||||
@@ -545,14 +569,17 @@ Function StartMultipartBody(UseFile = True, Val View = "form-data") Export
|
||||
Multipart = True;
|
||||
Boundary = StrReplace(String(New UUID), "-", "");
|
||||
LineSeparator = Chars.CR + Chars.LF;
|
||||
Encoding = GetSetting("EncodeRequestBody");
|
||||
RequestDataType = StrTemplate("multipart/%1; boundary=%2; charset=%3", View, Boundary, Encoding);
|
||||
Encoding = GetSetting("EncodeRequestBody");
|
||||
RequestDataType = StrTemplate("multipart/%1; boundary=%2", View, Boundary);
|
||||
|
||||
If UseFile Then
|
||||
|
||||
AddLog("StartMultipartBody: Creating a temporary file");
|
||||
|
||||
RequestBodyFile = GetTempFileName();
|
||||
// BSLLS:MissingTemporaryFileDeletion-off
|
||||
RequestBodyFile = GetTempFileName();
|
||||
// BSLLS:MissingTemporaryFileDeletion-on
|
||||
|
||||
BodyTemporaryFile = True;
|
||||
RequestDataWriter = New DataWriter(RequestBodyFile
|
||||
, Encoding
|
||||
@@ -603,8 +630,8 @@ Function AddMultipartFormDataFile(Val FieldName, Val FileName, Val Data, Val Dat
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ThisObject EndIf;
|
||||
If Not Multipart Then Return Error("AddMultipartFormDataFile: Multipart record not initialized") EndIf;
|
||||
If StopExecution() Then Return ThisObject; EndIf;
|
||||
If Not Multipart Then Return Error("AddMultipartFormDataFile: Multipart record not initialized"); EndIf;
|
||||
|
||||
OPI_TypeConversion.GetBinaryData(Data);
|
||||
|
||||
@@ -653,7 +680,7 @@ Function AddMultipartFormDataField(Val FieldName, Val Value) Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ThisObject EndIf;
|
||||
If StopExecution() Then Return ThisObject; EndIf;
|
||||
If Not Multipart Then Return Error("AddMultipartFormDataField: Multipart record not initialized") EndIf;
|
||||
|
||||
ValeType = TypeOf(Value);
|
||||
@@ -712,8 +739,8 @@ Function AddDataAsRelated(Val Data, Val DataType, Val ContentID = "") Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ThisObject EndIf;
|
||||
If Not Multipart Then Return Error("AddFileAsRelated: Multipart record not initialized") EndIf;
|
||||
If StopExecution() Then Return ThisObject; EndIf;
|
||||
If Not Multipart Then Return Error("AddFileAsRelated: Multipart record not initialized"); EndIf;
|
||||
|
||||
OPI_TypeConversion.GetLine(DataType);
|
||||
OPI_TypeConversion.GetLine(ContentID);
|
||||
@@ -763,8 +790,8 @@ Function SetHeaders(Val Value, Val FullReplace = False) Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ThisObject EndIf;
|
||||
If Not ValueIsFilled(Value) Then Value = New Map EndIf;
|
||||
If StopExecution() Then Return ThisObject; EndIf;
|
||||
If Not ValueIsFilled(Value) Then Value = New Map; EndIf;
|
||||
|
||||
ErrorText = "SetURLParams: The passed parameters are not a key/value collection";
|
||||
OPI_TypeConversion.GetKeyValueCollection(Value, ErrorText);
|
||||
@@ -803,7 +830,7 @@ Function AddBasicAuthorization(Val User, Val Password) Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ThisObject EndIf;
|
||||
If StopExecution() Then Return ThisObject; EndIf;
|
||||
|
||||
OPI_TypeConversion.GetLine(User);
|
||||
OPI_TypeConversion.GetLine(Password);
|
||||
@@ -834,7 +861,7 @@ Function AddAWS4Authorization(Val AccessKey, Val SecretKey, Val Region, Val Serv
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ThisObject EndIf;
|
||||
If StopExecution() Then Return ThisObject; EndIf;
|
||||
|
||||
String_ = "String";
|
||||
AWS4Using = True;
|
||||
@@ -874,12 +901,12 @@ Function ProcessRequest(Val Method, Val Start = True) Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ThisObject; EndIf;
|
||||
|
||||
OPI_TypeConversion.GetLine(Method);
|
||||
OPI_TypeConversion.GetBoolean(Start);
|
||||
RequestMethod = Method;
|
||||
|
||||
If StopExecution() Then Return ThisObject EndIf;
|
||||
|
||||
AddLog("ProcessRequest: Forming a request");
|
||||
If FormRequest().Error Then Return ThisObject EndIf;
|
||||
|
||||
@@ -913,7 +940,7 @@ Function ExecuteRequest(Val Method) Export
|
||||
|
||||
Try
|
||||
|
||||
If StopExecution() Then Return ThisObject EndIf;
|
||||
If StopExecution() Then Return ThisObject; EndIf;
|
||||
|
||||
OPI_TypeConversion.GetLine(Method);
|
||||
RequestMethod = Method;
|
||||
@@ -981,7 +1008,7 @@ Function ReturnResponse(Val Forced = False, Val ExceptionOnError = False) Export
|
||||
|
||||
OPI_TypeConversion.GetBoolean(Forced);
|
||||
|
||||
If StopExecution(ExceptionOnError) And Not Forced Then Return ThisObject EndIf;
|
||||
If StopExecution(ExceptionOnError) And Not Forced Then Return ThisObject; EndIf;
|
||||
|
||||
Return Response;
|
||||
|
||||
@@ -998,7 +1025,7 @@ EndFunction
|
||||
// Arbitrary - The response or the same processing object
|
||||
Function ReturnResponseAsJSONObject(Val ToMap = True, Val ExceptionOnError = False) Export
|
||||
|
||||
If StopExecution(ExceptionOnError) Then Return ThisObject EndIf;
|
||||
If StopExecution(ExceptionOnError) Then Return ThisObject; EndIf;
|
||||
|
||||
Try
|
||||
|
||||
@@ -1040,7 +1067,7 @@ Function ReturnResponseAsBinaryData(Val Forced = False, Val ExceptionOnError = F
|
||||
|
||||
OPI_TypeConversion.GetBoolean(Forced);
|
||||
|
||||
If StopExecution(ExceptionOnError) And Not Forced Then Return ThisObject EndIf;
|
||||
If StopExecution(ExceptionOnError) And Not Forced Then Return ThisObject; EndIf;
|
||||
|
||||
BodyAsString = GetResponseBody();
|
||||
|
||||
@@ -1061,7 +1088,7 @@ Function ReturnResponseAsString(Val Forced = False, Val ExceptionOnError = False
|
||||
|
||||
OPI_TypeConversion.GetBoolean(Forced);
|
||||
|
||||
If StopExecution(ExceptionOnError) And Not Forced Then Return ThisObject EndIf;
|
||||
If StopExecution(ExceptionOnError) And Not Forced Then Return ThisObject; EndIf;
|
||||
|
||||
BodyAsString = GetStringFromBinaryData(GetResponseBody());
|
||||
|
||||
@@ -1082,7 +1109,7 @@ Function ReturnResponseFilename(Val Forced = False, Val ExceptionOnError = False
|
||||
|
||||
OPI_TypeConversion.GetBoolean(Forced);
|
||||
|
||||
If StopExecution(ExceptionOnError) And Not Forced Then Return ThisObject EndIf;
|
||||
If StopExecution(ExceptionOnError) And Not Forced Then Return ThisObject; EndIf;
|
||||
|
||||
BodyFileName = Response.GetBodyFileName();
|
||||
|
||||
@@ -1423,6 +1450,7 @@ Function CompleteHeaders()
|
||||
|
||||
EndIf;
|
||||
|
||||
Return ThisObject;
|
||||
|
||||
EndFunction
|
||||
|
||||
@@ -1476,9 +1504,9 @@ Function GetResponseBody()
|
||||
HeaderKey = ResponseHeader.Key;
|
||||
HeaderValue = ResponseHeader.Value;
|
||||
|
||||
If Lower(HeaderKey) = "content-encoding" Then
|
||||
If Lower(HeaderKey) = "content-encoding" Then
|
||||
If Lower(HeaderValue) = "gzip" Then
|
||||
NeedsUnpacking = True;
|
||||
NeedsUnpacking = True;
|
||||
Break;
|
||||
EndIf;
|
||||
EndIf;
|
||||
@@ -1550,47 +1578,47 @@ EndFunction
|
||||
|
||||
Procedure CancelMultipartBody()
|
||||
|
||||
If Multipart Then
|
||||
If Not Multipart Then
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
AddLog("CancelMultipartBody: Deleting recorded data");
|
||||
Multipart = False;
|
||||
AddLog("CancelMultipartBody: Deleting recorded data");
|
||||
Multipart = False;
|
||||
|
||||
Try
|
||||
RequestDataWriter.Close();
|
||||
Except
|
||||
AddLog("CancelMultipartBody: Could not close the writer. It may have already been closed");
|
||||
EndTry;
|
||||
|
||||
If ValueIsFilled(RequestBodyFile) Then
|
||||
|
||||
Try
|
||||
|
||||
DeleteFiles(RequestBodyFile);
|
||||
AddLog("CancelMultipartBody: The body file has been deleted");
|
||||
|
||||
Try
|
||||
RequestDataWriter.Close();
|
||||
Except
|
||||
AddLog("CancelMultipartBody: Could not close the writer. It may have already been closed");
|
||||
AddLog("CancelMultipartBody: Failed to delete the body file. It may have already been deleted");
|
||||
EndTry;
|
||||
|
||||
If ValueIsFilled(RequestBodyFile) Then
|
||||
Else
|
||||
|
||||
If TypeOf(RequestBodyStream) = Type("MemoryStream") Then
|
||||
|
||||
Try
|
||||
|
||||
DeleteFiles(RequestBodyFile);
|
||||
AddLog("CancelMultipartBody: The body file has been deleted");
|
||||
|
||||
RequestBodyStream.Close();
|
||||
Except
|
||||
AddLog("CancelMultipartBody: Failed to delete the body file. It may have already been deleted");
|
||||
AddLog("CancelMultipartBody: Failed to close the stream. It may have already been closed");
|
||||
EndTry;
|
||||
|
||||
Else
|
||||
|
||||
If TypeOf(RequestBodyStream) = Type("MemoryStream") Then
|
||||
|
||||
Try
|
||||
RequestBodyStream.Close();
|
||||
Except
|
||||
AddLog("CancelMultipartBody: Failed to close the stream. It may have already been closed");
|
||||
EndTry;
|
||||
|
||||
EndIf;
|
||||
|
||||
EndIf;
|
||||
|
||||
RequestDataWriter = Undefined;
|
||||
RequestBodyFile = Undefined;
|
||||
|
||||
EndIf;
|
||||
|
||||
RequestDataWriter = Undefined;
|
||||
RequestBodyFile = Undefined;
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure WriteBinaryData(DataWriter, Val BinaryData)
|
||||
|
2
src/ru/OInt/core/Modules/OPI_MySQL.os
vendored
2
src/ru/OInt/core/Modules/OPI_MySQL.os
vendored
@@ -564,7 +564,7 @@
|
||||
ТекущийКлюч = "TEXT";
|
||||
|
||||
КонецЕсли;
|
||||
|
||||
|
||||
КонецПроцедуры
|
||||
|
||||
Функция ОбработатьСтруктуруBlob(Знач Значение)
|
||||
|
@@ -21634,7 +21634,7 @@
|
||||
// END
|
||||
|
||||
Попытка
|
||||
Результат["origin"] = "***";
|
||||
Результат["origin"] = "***";
|
||||
ФайлОтвета = Результат["files"]["file1"];
|
||||
Результат["files"]["file1"] = "...";
|
||||
Исключение
|
||||
@@ -21679,7 +21679,7 @@
|
||||
// END
|
||||
|
||||
Попытка
|
||||
Результат["origin"] = "***";
|
||||
Результат["origin"] = "***";
|
||||
ФайлОтвета = Результат["files"]["file1"];
|
||||
Результат["files"]["file1"] = "...";
|
||||
Исключение
|
||||
@@ -21724,7 +21724,7 @@
|
||||
// END
|
||||
|
||||
Попытка
|
||||
Результат["origin"] = "***";
|
||||
Результат["origin"] = "***";
|
||||
ФайлОтвета = Результат["files"]["file1"];
|
||||
Результат["files"]["file1"] = "...";
|
||||
Исключение
|
||||
|
@@ -2463,9 +2463,9 @@
|
||||
КонецФункции
|
||||
|
||||
Функция ПолучитьОбщийМодуль(Знач Имя)
|
||||
|
||||
|
||||
Модуль = Вычислить(Имя);
|
||||
|
||||
|
||||
Возврат Модуль;
|
||||
КонецФункции
|
||||
|
||||
|
@@ -336,11 +336,11 @@
|
||||
Значение_ = СтрШаблон("%1.%2", СтрСоединить(МассивЧастей), ДробнаяЧасть);
|
||||
|
||||
КонецЕсли;
|
||||
|
||||
// BSLLS:TryNumber-off
|
||||
Значение = Число(Значение_);
|
||||
|
||||
// BSLLS:TryNumber-off
|
||||
Значение = Число(Значение_);
|
||||
// BSLLS:TryNumber-on
|
||||
|
||||
|
||||
Исключение
|
||||
Возврат;
|
||||
КонецПопытки;
|
||||
@@ -368,12 +368,12 @@
|
||||
ПолучитьДвоичныеДанные(Значение, Истина);
|
||||
|
||||
// BSLLS:MissingTemporaryFileDeletion-off
|
||||
|
||||
|
||||
//@skip-check missing-temporary-file-deletion
|
||||
Путь = ПолучитьИмяВременногоФайла(Расширение);
|
||||
|
||||
|
||||
// BSLLS:MissingTemporaryFileDeletion-on
|
||||
|
||||
|
||||
Значение.Записать(Путь);
|
||||
|
||||
СтруктураВозврата.Вставить("Путь" , Путь);
|
||||
|
@@ -298,15 +298,15 @@
|
||||
|
||||
#Область Настройки
|
||||
|
||||
// Использовать кодировку
|
||||
// Использовать кодировку !NOCLI
|
||||
// Устанавливает кодировку тела запроса
|
||||
//
|
||||
//
|
||||
// Примечание:
|
||||
// По умолчанию используется UTF-8
|
||||
//
|
||||
//
|
||||
// Параметры:
|
||||
// Кодировка - Строка - Название кодировки - enc
|
||||
//
|
||||
//
|
||||
// Возвращаемое значение:
|
||||
// ОбработкаОбъект.OPI_HTTPКлиент - Этот же объект обработки
|
||||
Функция ИспользоватьКодировку(Знач Кодировка) Экспорт
|
||||
@@ -328,15 +328,15 @@
|
||||
|
||||
КонецФункции
|
||||
|
||||
// Использовать сжатие gzip
|
||||
// Включает или отключает заголовок получения данных от сервера в сжатом виде
|
||||
//
|
||||
// Использовать сжатие gzip !NOCLI
|
||||
// Включает или отключает заголовок получения данных от сервера в сжатом виде
|
||||
//
|
||||
// Примечание:
|
||||
// По умлчанию ответ от сервера запрашивается со сжатием gzip
|
||||
//
|
||||
//
|
||||
// Параметры:
|
||||
// Флаг - Булево - Признак использования gzip - gzip
|
||||
//
|
||||
//
|
||||
// Возвращаемое значение:
|
||||
// ОбработкаОбъект.OPI_HTTPКлиент - Этот же объект обработки
|
||||
Функция ИспользоватьСжатиеGzip(Знач Флаг) Экспорт
|
||||
@@ -569,7 +569,7 @@
|
||||
Multipart = Истина;
|
||||
Boundary = СтрЗаменить(Строка(Новый УникальныйИдентификатор), "-", "");
|
||||
РазделительСтрок = Символы.ВК + Символы.ПС;
|
||||
Кодировка = ПолучитьНастройку("КодировкаТелаЗапроса");
|
||||
Кодировка = ПолучитьНастройку("КодировкаТелаЗапроса");
|
||||
ЗапросТипДанных = СтрШаблон("multipart/%1; boundary=%2", Вид, Boundary);
|
||||
|
||||
Если ИспользоватьФайл Тогда
|
||||
@@ -579,7 +579,7 @@
|
||||
// BSLLS:MissingTemporaryFileDeletion-off
|
||||
ЗапросФайлТела = ПолучитьИмяВременногоФайла();
|
||||
// BSLLS:MissingTemporaryFileDeletion-on
|
||||
|
||||
|
||||
ФайлТелаВременный = Истина;
|
||||
ЗапросЗаписьДанных = Новый ЗаписьДанных(ЗапросФайлТела
|
||||
, Кодировка
|
||||
@@ -902,7 +902,7 @@
|
||||
Попытка
|
||||
|
||||
Если ОстановитьРаботу() Тогда Возврат ЭтотОбъект; КонецЕсли;
|
||||
|
||||
|
||||
OPI_ПреобразованиеТипов.ПолучитьСтроку(Метод);
|
||||
OPI_ПреобразованиеТипов.ПолучитьБулево(ВыполнитьСразу);
|
||||
ЗапросМетод = Метод;
|
||||
@@ -1449,7 +1449,7 @@
|
||||
КонецЦикла;
|
||||
|
||||
КонецЕсли;
|
||||
|
||||
|
||||
Возврат ЭтотОбъект;
|
||||
|
||||
КонецФункции
|
||||
|
@@ -564,7 +564,7 @@
|
||||
ТекущийКлюч = "TEXT";
|
||||
|
||||
КонецЕсли;
|
||||
|
||||
|
||||
КонецПроцедуры
|
||||
|
||||
Функция ОбработатьСтруктуруBlob(Знач Значение)
|
||||
|
@@ -336,11 +336,11 @@
|
||||
Значение_ = СтрШаблон("%1.%2", СтрСоединить(МассивЧастей), ДробнаяЧасть);
|
||||
|
||||
КонецЕсли;
|
||||
|
||||
// BSLLS:TryNumber-off
|
||||
Значение = Число(Значение_);
|
||||
|
||||
// BSLLS:TryNumber-off
|
||||
Значение = Число(Значение_);
|
||||
// BSLLS:TryNumber-on
|
||||
|
||||
|
||||
Исключение
|
||||
Возврат;
|
||||
КонецПопытки;
|
||||
@@ -368,12 +368,12 @@
|
||||
ПолучитьДвоичныеДанные(Значение, Истина);
|
||||
|
||||
// BSLLS:MissingTemporaryFileDeletion-off
|
||||
|
||||
|
||||
//@skip-check missing-temporary-file-deletion
|
||||
Путь = ПолучитьИмяВременногоФайла(Расширение);
|
||||
|
||||
|
||||
// BSLLS:MissingTemporaryFileDeletion-on
|
||||
|
||||
|
||||
Значение.Записать(Путь);
|
||||
|
||||
СтруктураВозврата.Вставить("Путь" , Путь);
|
||||
|
@@ -21634,7 +21634,7 @@
|
||||
// END
|
||||
|
||||
Попытка
|
||||
Результат["origin"] = "***";
|
||||
Результат["origin"] = "***";
|
||||
ФайлОтвета = Результат["files"]["file1"];
|
||||
Результат["files"]["file1"] = "...";
|
||||
Исключение
|
||||
@@ -21679,7 +21679,7 @@
|
||||
// END
|
||||
|
||||
Попытка
|
||||
Результат["origin"] = "***";
|
||||
Результат["origin"] = "***";
|
||||
ФайлОтвета = Результат["files"]["file1"];
|
||||
Результат["files"]["file1"] = "...";
|
||||
Исключение
|
||||
@@ -21724,7 +21724,7 @@
|
||||
// END
|
||||
|
||||
Попытка
|
||||
Результат["origin"] = "***";
|
||||
Результат["origin"] = "***";
|
||||
ФайлОтвета = Результат["files"]["file1"];
|
||||
Результат["files"]["file1"] = "...";
|
||||
Исключение
|
||||
|
@@ -1,4 +1,4 @@
|
||||
// OneScript: ./OInt/tools/Modules/internal/Classes/OPI_HTTPКлиент.os
|
||||
// OneScript: ./OInt/tools/Modules/internal/Classes/OPI_HTTPКлиент.os
|
||||
|
||||
// MIT License
|
||||
|
||||
@@ -300,13 +300,13 @@
|
||||
|
||||
// Использовать кодировку !NOCLI
|
||||
// Устанавливает кодировку тела запроса
|
||||
//
|
||||
//
|
||||
// Примечание:
|
||||
// По умолчанию используется UTF-8
|
||||
//
|
||||
//
|
||||
// Параметры:
|
||||
// Кодировка - Строка - Название кодировки - enc
|
||||
//
|
||||
//
|
||||
// Возвращаемое значение:
|
||||
// ОбработкаОбъект.OPI_HTTPКлиент - Этот же объект обработки
|
||||
Функция ИспользоватьКодировку(Знач Кодировка) Экспорт
|
||||
@@ -329,14 +329,14 @@
|
||||
КонецФункции
|
||||
|
||||
// Использовать сжатие gzip !NOCLI
|
||||
// Включает или отключает заголовок получения данных от сервера в сжатом виде
|
||||
//
|
||||
// Включает или отключает заголовок получения данных от сервера в сжатом виде
|
||||
//
|
||||
// Примечание:
|
||||
// По умлчанию ответ от сервера запрашивается со сжатием gzip
|
||||
//
|
||||
//
|
||||
// Параметры:
|
||||
// Флаг - Булево - Признак использования gzip - gzip
|
||||
//
|
||||
//
|
||||
// Возвращаемое значение:
|
||||
// ОбработкаОбъект.OPI_HTTPКлиент - Этот же объект обработки
|
||||
Функция ИспользоватьСжатиеGzip(Знач Флаг) Экспорт
|
||||
@@ -569,7 +569,7 @@
|
||||
Multipart = Истина;
|
||||
Boundary = СтрЗаменить(Строка(Новый УникальныйИдентификатор), "-", "");
|
||||
РазделительСтрок = Символы.ВК + Символы.ПС;
|
||||
Кодировка = ПолучитьНастройку("КодировкаТелаЗапроса");
|
||||
Кодировка = ПолучитьНастройку("КодировкаТелаЗапроса");
|
||||
ЗапросТипДанных = СтрШаблон("multipart/%1; boundary=%2", Вид, Boundary);
|
||||
|
||||
Если ИспользоватьФайл Тогда
|
||||
@@ -579,7 +579,7 @@
|
||||
// BSLLS:MissingTemporaryFileDeletion-off
|
||||
ЗапросФайлТела = ПолучитьИмяВременногоФайла();
|
||||
// BSLLS:MissingTemporaryFileDeletion-on
|
||||
|
||||
|
||||
ФайлТелаВременный = Истина;
|
||||
ЗапросЗаписьДанных = Новый ЗаписьДанных(ЗапросФайлТела
|
||||
, Кодировка
|
||||
@@ -902,7 +902,7 @@
|
||||
Попытка
|
||||
|
||||
Если ОстановитьРаботу() Тогда Возврат ЭтотОбъект; КонецЕсли;
|
||||
|
||||
|
||||
OPI_ПреобразованиеТипов.ПолучитьСтроку(Метод);
|
||||
OPI_ПреобразованиеТипов.ПолучитьБулево(ВыполнитьСразу);
|
||||
ЗапросМетод = Метод;
|
||||
@@ -1449,7 +1449,7 @@
|
||||
КонецЦикла;
|
||||
|
||||
КонецЕсли;
|
||||
|
||||
|
||||
Возврат ЭтотОбъект;
|
||||
|
||||
КонецФункции
|
||||
|
Reference in New Issue
Block a user