1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-02-07 13:43:35 +02:00

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

This commit is contained in:
Vitaly the Alpaca 2024-07-27 12:29:37 +00:00 committed by Vitaly the Alpaca (bot)
parent 96e2080f44
commit a45a4bc6f4
18 changed files with 881 additions and 881 deletions

File diff suppressed because it is too large Load Diff

View File

@ -493,7 +493,7 @@ Function DeletePosts(Val Token, Val Base, Val Table, Val Records) Export
RecordString = "";
For Each Record In Records Do
RecordString = RecordString
RecordString = RecordString
+ ?(ValueIsFilled(RecordString), "&", "?")
+ "records[]="
+ OPI_Tools.NumberToString(Record);

View File

@ -69,7 +69,7 @@ EndFunction
// Map Of KeyAndValue - serialized JSON response from Dropbox
Function GetToken(Val AppKey, Val AppSecret, Val Code) Export
URL = "https://api.dropbox.com/oauth2/token";
URL = "https://api.dropbox.com/oauth2/token";
DataType = "application/x-www-form-urlencoded; charset=utf-8";
Parameters = New Structure;

View File

@ -292,7 +292,7 @@ Function EditListCalendar(Val Token
OPI_TypeConversion.GetBoolean(Hidden);
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
URL = "https://www.googleapis.com/calendar/v3/users/me/calendarList/" + Calendar + "?colorRgbFormat =true";
URL = "https://www.googleapis.com/calendar/v3/users/me/calendarList/" + Calendar + "?colorRgbFormat=true";
Parameters = New Map;
Parameters.Insert("hidden" , Hidden);
@ -491,12 +491,12 @@ Function ConvertDate(Val Date)
Return Undefined;
EndIf;
If Date = BegOfDay(Date) Then
If Date = BegOfDay(Date) Then
DateFormat = "DF=yyyy-MM-dd";
Field = "date";
Field = "date";
Else
DateFormat = "DF=yyyy-MM-ddTHH:mm:ssZ";
Field = "dateTime";
Field = "dateTime";
EndIf;
Date = Format(Date, DateFormat);

View File

@ -337,7 +337,7 @@ Function CreateComment(Val Token, Val Identifier, Val Comment) Export
OPI_TypeConversion.GetLine(Comment);
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
URL = "https://www.googleapis.com/drive/v3/files/" + Identifier + "/comments?fields =*";
URL = "https://www.googleapis.com/drive/v3/files/" + Identifier + "/comments?fields=*";
Parameters = New Structure;
Parameters.Insert("content", Comment);
@ -708,7 +708,7 @@ Function CheckPartUpload(Response, StrTotalSize, AdditionalHeaders, UploadURL, C
Return Response;
EndIf;
UploadedData = StrReplace(UploadedData, "bytes =", "");
UploadedData = StrReplace(UploadedData, "bytes=", "");
ArrayOfInformation = StrSplit(UploadedData, "-", False);
PartsRequired = 2;

View File

@ -320,11 +320,11 @@ Function GetCellValues(Val Token, Val Spreadsheet, Val CellsArray = "", Val Shee
First = True;
For Each Cell In CellsArray Do
Delimiter = ?(First, "?", "&");
URL = URL + Delimiter + "ranges =" + Cell;
URL = URL + Delimiter + "ranges=" + Cell;
First = False;
EndDo;
Else
URL = URL + "?ranges ='" + Sheet + "'";
URL = URL + "?ranges ='" + Sheet + "'";
EndIf;
Response = OPI_Tools.Get(URL, , Headers);

View File

@ -207,7 +207,7 @@ Function ProcessTMAData(Val DataString, Val Token) Export
For Each DataString In TValue Do
If DataString.Key <> "hash" Then
DCS = DCS + DataString.Key + " =" + DataString.Value + Chars.LF;
DCS = DCS + DataString.Key + "=" + DataString.Value + Chars.LF;
ReturnMapping.Insert(DataString.Key, DataString.Value);
Else
Hash = DataString.Value;

View File

@ -611,7 +611,7 @@ Function CreateAuthorizationHeaderV1(Val Parameters, Val Fields, Val RequestType
SignatureString = SignatureString
+ TableRow.Key
+ " ="
+ " ="
+ TableRow.Value
+ "&";
@ -635,16 +635,16 @@ Function CreateAuthorizationHeaderV1(Val Parameters, Val Fields, Val RequestType
Signature = EncodeString(Base64String(Signature), StringEncodingMethod.URLencoding);
Delimiter = """,";
AuthorizationHeader = AuthorizationHeader
Delimiter = """,";
AuthorizationHeader = AuthorizationHeader
+ "OAuth "
+ "oauth_consumer_key =""" + Parameters[OCK] + Delimiter
+ "oauth_token =""" + Parameters[OTK] + Delimiter
+ "oauth_consumer_key =""" + Parameters[OCK] + Delimiter
+ "oauth_token =""" + Parameters[OTK] + Delimiter
+ "oauth_signature_method=""" + HashingMethod + Delimiter
+ "oauth_timestamp =""" + CurrentUNIXDate + Delimiter
+ "oauth_nonce =""" + CurrentUNIXDate + Delimiter
+ "oauth_version =""" + APIVersion + Delimiter
+ "oauth_signature =""" + Signature;
+ "oauth_timestamp =""" + CurrentUNIXDate + Delimiter
+ "oauth_nonce =""" + CurrentUNIXDate + Delimiter
+ "oauth_version =""" + APIVersion + Delimiter
+ "oauth_signature =""" + Signature;
HeaderMapping = New Map;
HeaderMapping.Insert("authorization", AuthorizationHeader);

View File

@ -241,7 +241,7 @@ Function RequestParametersToString(Val Parameters) Export
ParameterString = ParameterString
+ Parameter.Key
+ " ="
+ "="
+ ParameterValue
+ "&";
EndDo;
@ -555,7 +555,7 @@ Function ExecuteRequestWithBody(Val URL
Parameters = New Structure;
EndIf;
DataType = ?(JSON, "application/json; charset =utf-8", "application/x-www-form-urlencoded; charset =utf-8");
DataType = ?(JSON, "application/json; charset=utf-8", "application/x-www-form-urlencoded; charset=utf-8");
URLStructure = SplitURL(URL);
Server = URLStructure["Server"];
Address = URLStructure["Address"];
@ -675,7 +675,7 @@ Function ExecuteMultipartRequest(Val URL
Error = 400;
Boundary = StrReplace(String(New UUID), "-", "");
LineSeparator = Chars.CR + Chars.LF;
DataType = "multipart/form-data; boundary =" + Boundary;
DataType = "multipart/form-data; boundary=" + Boundary;
URLStructure = SplitURL(URL);
Server = URLStructure["Server"];
Address = URLStructure["Address"];
@ -739,7 +739,7 @@ Function ExecuteMultipartRelatedRequest(Val URL
Error = 400;
Boundary = StrReplace(String(New UUID), "-", "");
LineSeparator = Chars.CR + Chars.LF;
DataType = "multipart/related; boundary =" + Boundary;
DataType = "multipart/related; boundary=" + Boundary;
URLStructure = SplitURL(URL);
Server = URLStructure["Server"];
Address = URLStructure["Address"];

View File

@ -493,7 +493,7 @@ Function DeletePosts(Val Token, Val Base, Val Table, Val Records) Export
RecordString = "";
For Each Record In Records Do
RecordString = RecordString
RecordString = RecordString
+ ?(ValueIsFilled(RecordString), "&", "?")
+ "records[]="
+ OPI_Tools.NumberToString(Record);

View File

@ -69,7 +69,7 @@ EndFunction
// Map Of KeyAndValue - serialized JSON response from Dropbox
Function GetToken(Val AppKey, Val AppSecret, Val Code) Export
URL = "https://api.dropbox.com/oauth2/token";
URL = "https://api.dropbox.com/oauth2/token";
DataType = "application/x-www-form-urlencoded; charset=utf-8";
Parameters = New Structure;

View File

@ -292,7 +292,7 @@ Function EditListCalendar(Val Token
OPI_TypeConversion.GetBoolean(Hidden);
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
URL = "https://www.googleapis.com/calendar/v3/users/me/calendarList/" + Calendar + "?colorRgbFormat =true";
URL = "https://www.googleapis.com/calendar/v3/users/me/calendarList/" + Calendar + "?colorRgbFormat=true";
Parameters = New Map;
Parameters.Insert("hidden" , Hidden);
@ -491,12 +491,12 @@ Function ConvertDate(Val Date)
Return Undefined;
EndIf;
If Date = BegOfDay(Date) Then
If Date = BegOfDay(Date) Then
DateFormat = "DF=yyyy-MM-dd";
Field = "date";
Field = "date";
Else
DateFormat = "DF=yyyy-MM-ddTHH:mm:ssZ";
Field = "dateTime";
Field = "dateTime";
EndIf;
Date = Format(Date, DateFormat);

View File

@ -337,7 +337,7 @@ Function CreateComment(Val Token, Val Identifier, Val Comment) Export
OPI_TypeConversion.GetLine(Comment);
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
URL = "https://www.googleapis.com/drive/v3/files/" + Identifier + "/comments?fields =*";
URL = "https://www.googleapis.com/drive/v3/files/" + Identifier + "/comments?fields=*";
Parameters = New Structure;
Parameters.Insert("content", Comment);
@ -708,7 +708,7 @@ Function CheckPartUpload(Response, StrTotalSize, AdditionalHeaders, UploadURL, C
Return Response;
EndIf;
UploadedData = StrReplace(UploadedData, "bytes =", "");
UploadedData = StrReplace(UploadedData, "bytes=", "");
ArrayOfInformation = StrSplit(UploadedData, "-", False);
PartsRequired = 2;

View File

@ -320,11 +320,11 @@ Function GetCellValues(Val Token, Val Spreadsheet, Val CellsArray = "", Val Shee
First = True;
For Each Cell In CellsArray Do
Delimiter = ?(First, "?", "&");
URL = URL + Delimiter + "ranges =" + Cell;
URL = URL + Delimiter + "ranges=" + Cell;
First = False;
EndDo;
Else
URL = URL + "?ranges ='" + Sheet + "'";
URL = URL + "?ranges ='" + Sheet + "'";
EndIf;
Response = OPI_Tools.Get(URL, , Headers);

View File

@ -207,7 +207,7 @@ Function ProcessTMAData(Val DataString, Val Token) Export
For Each DataString In TValue Do
If DataString.Key <> "hash" Then
DCS = DCS + DataString.Key + " =" + DataString.Value + Chars.LF;
DCS = DCS + DataString.Key + "=" + DataString.Value + Chars.LF;
ReturnMapping.Insert(DataString.Key, DataString.Value);
Else
Hash = DataString.Value;

View File

@ -241,7 +241,7 @@ Function RequestParametersToString(Val Parameters) Export
ParameterString = ParameterString
+ Parameter.Key
+ " ="
+ "="
+ ParameterValue
+ "&";
EndDo;
@ -555,7 +555,7 @@ Function ExecuteRequestWithBody(Val URL
Parameters = New Structure;
EndIf;
DataType = ?(JSON, "application/json; charset =utf-8", "application/x-www-form-urlencoded; charset =utf-8");
DataType = ?(JSON, "application/json; charset=utf-8", "application/x-www-form-urlencoded; charset=utf-8");
URLStructure = SplitURL(URL);
Server = URLStructure["Server"];
Address = URLStructure["Address"];
@ -675,7 +675,7 @@ Function ExecuteMultipartRequest(Val URL
Error = 400;
Boundary = StrReplace(String(New UUID), "-", "");
LineSeparator = Chars.CR + Chars.LF;
DataType = "multipart/form-data; boundary =" + Boundary;
DataType = "multipart/form-data; boundary=" + Boundary;
URLStructure = SplitURL(URL);
Server = URLStructure["Server"];
Address = URLStructure["Address"];
@ -739,7 +739,7 @@ Function ExecuteMultipartRelatedRequest(Val URL
Error = 400;
Boundary = StrReplace(String(New UUID), "-", "");
LineSeparator = Chars.CR + Chars.LF;
DataType = "multipart/related; boundary =" + Boundary;
DataType = "multipart/related; boundary=" + Boundary;
URLStructure = SplitURL(URL);
Server = URLStructure["Server"];
Address = URLStructure["Address"];

View File

@ -611,7 +611,7 @@ Function CreateAuthorizationHeaderV1(Val Parameters, Val Fields, Val RequestType
SignatureString = SignatureString
+ TableRow.Key
+ " ="
+ " ="
+ TableRow.Value
+ "&";
@ -635,16 +635,16 @@ Function CreateAuthorizationHeaderV1(Val Parameters, Val Fields, Val RequestType
Signature = EncodeString(Base64String(Signature), StringEncodingMethod.URLencoding);
Delimiter = """,";
AuthorizationHeader = AuthorizationHeader
Delimiter = """,";
AuthorizationHeader = AuthorizationHeader
+ "OAuth "
+ "oauth_consumer_key =""" + Parameters[OCK] + Delimiter
+ "oauth_token =""" + Parameters[OTK] + Delimiter
+ "oauth_consumer_key =""" + Parameters[OCK] + Delimiter
+ "oauth_token =""" + Parameters[OTK] + Delimiter
+ "oauth_signature_method=""" + HashingMethod + Delimiter
+ "oauth_timestamp =""" + CurrentUNIXDate + Delimiter
+ "oauth_nonce =""" + CurrentUNIXDate + Delimiter
+ "oauth_version =""" + APIVersion + Delimiter
+ "oauth_signature =""" + Signature;
+ "oauth_timestamp =""" + CurrentUNIXDate + Delimiter
+ "oauth_nonce =""" + CurrentUNIXDate + Delimiter
+ "oauth_version =""" + APIVersion + Delimiter
+ "oauth_signature =""" + Signature;
HeaderMapping = New Map;
HeaderMapping.Insert("authorization", AuthorizationHeader);

View File

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