You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2025-08-15 20:13:31 +02:00
Преобразование OPI -> OInt (workflow)
This commit is contained in:
committed by
Vitaly the Alpaca (bot)
parent
546e88ec0a
commit
2890458374
@@ -114,7 +114,7 @@ Function CreateDatabase(Val Token, Val Workspace, Val Name, Val TableCollection)
|
|||||||
|
|
||||||
For Each Table In TableCollection Do
|
For Each Table In TableCollection Do
|
||||||
|
|
||||||
Description = GenerateTableDescription(Table.TheKey, Table.Value);
|
Description = GenerateTableDescription(Table.Key, Table.Value);
|
||||||
TableArray.Add(Description);
|
TableArray.Add(Description);
|
||||||
|
|
||||||
EndDo;
|
EndDo;
|
||||||
|
@@ -467,17 +467,17 @@ EndFunction
|
|||||||
// Parameters:
|
// Parameters:
|
||||||
// Token - String - Token - token
|
// Token - String - Token - token
|
||||||
// Path - String - Path to the object - path
|
// Path - String - Path to the object - path
|
||||||
// Quantity - String, Number - Number of the latest versions of the object to display - amount
|
// Count - String, Number - Number of the latest versions of the object to display - amount
|
||||||
//
|
//
|
||||||
// Returns:
|
// Returns:
|
||||||
// Key-Value Pair - serialized JSON response from Dropbox
|
// Key-Value Pair - serialized JSON response from Dropbox
|
||||||
Function GetObjectVersionList(Val Token, Val Path, Val Quantity = 10) Export
|
Function GetObjectVersionList(Val Token, Val Path, Val Count = 10) Export
|
||||||
|
|
||||||
URL = "https://api.dropboxapi.com/2/files/list_revisions";
|
URL = "https://api.dropboxapi.com/2/files/list_revisions";
|
||||||
|
|
||||||
Parameters = New Structure;
|
Parameters = New Structure;
|
||||||
OPI_Tools.AddField("path" , Path , "String", Parameters);
|
OPI_Tools.AddField("path" , Path , "String", Parameters);
|
||||||
OPI_Tools.AddField("limit", Quantity, "Number" , Parameters);
|
OPI_Tools.AddField("limit", Count, "Number" , Parameters);
|
||||||
|
|
||||||
Headers = GetRequestHeaders(Token);
|
Headers = GetRequestHeaders(Token);
|
||||||
Response = OPI_Tools.Post(URL, Parameters, Headers);
|
Response = OPI_Tools.Post(URL, Parameters, Headers);
|
||||||
|
@@ -323,7 +323,7 @@ Function GetEventDescription() Export
|
|||||||
Event.Insert("Venue" , ""); // String description of the venue of the event
|
Event.Insert("Venue" , ""); // String description of the venue of the event
|
||||||
Event.Insert("StartDate" , CurrentDate); // Date of start events
|
Event.Insert("StartDate" , CurrentDate); // Date of start events
|
||||||
Event.Insert("EndDate" , CurrentDate + Hour); // Date of end events
|
Event.Insert("EndDate" , CurrentDate + Hour); // Date of end events
|
||||||
Event.Insert("ArrayOfAttachmentURLs", New Map); // TheKey - name, Value - URL to file
|
Event.Insert("ArrayOfAttachmentURLs", New Map); // Key - name, Value - URL to file
|
||||||
Event.Insert("SendNotifications" , True); // Indication of sending notifications to participants
|
Event.Insert("SendNotifications" , True); // Indication of sending notifications to participants
|
||||||
|
|
||||||
Return Event;
|
Return Event;
|
||||||
@@ -513,7 +513,7 @@ Function ConvertAttachments(Val Attachments)
|
|||||||
For Each Attachment In Attachments Do
|
For Each Attachment In Attachments Do
|
||||||
|
|
||||||
CurrentAttachment = New Structure;
|
CurrentAttachment = New Structure;
|
||||||
CurrentAttachment.Insert("title" , Attachment.TheKey);
|
CurrentAttachment.Insert("title" , Attachment.Key);
|
||||||
CurrentAttachment.Insert("fileUrl", Attachment.Value);
|
CurrentAttachment.Insert("fileUrl", Attachment.Value);
|
||||||
|
|
||||||
AttachmentsArray.Add(CurrentAttachment);
|
AttachmentsArray.Add(CurrentAttachment);
|
||||||
@@ -522,7 +522,7 @@ Function ConvertAttachments(Val Attachments)
|
|||||||
|
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
If AttachmentsArray.Quantity() > 0 Then
|
If AttachmentsArray.Count() > 0 Then
|
||||||
Return AttachmentsArray;
|
Return AttachmentsArray;
|
||||||
Else
|
Else
|
||||||
Return Undefined;
|
Return Undefined;
|
||||||
@@ -599,7 +599,7 @@ Procedure GetCalendarsListRecursively(Val Headers, ArrayOfCalendars, Page = "")
|
|||||||
ArrayOfCalendars.Add(Calendar);
|
ArrayOfCalendars.Add(Calendar);
|
||||||
EndDo;
|
EndDo;
|
||||||
|
|
||||||
If Calendars.Quantity() > 0 And ValueIsFilled(Page) Then
|
If Calendars.Count() > 0 And ValueIsFilled(Page) Then
|
||||||
GetCalendarsListRecursively(Headers, ArrayOfCalendars, Page);
|
GetCalendarsListRecursively(Headers, ArrayOfCalendars, Page);
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
@@ -626,7 +626,7 @@ Procedure GetEventsListRecursively(Val Headers, Val Calendar, ArrayOfEvents, Pag
|
|||||||
ArrayOfEvents.Add(Event);
|
ArrayOfEvents.Add(Event);
|
||||||
EndDo;
|
EndDo;
|
||||||
|
|
||||||
If Events.Quantity() > 0 And ValueIsFilled(Page) Then
|
If Events.Count() > 0 And ValueIsFilled(Page) Then
|
||||||
GetEventsListRecursively(Headers, ArrayOfEvents, Page);
|
GetEventsListRecursively(Headers, ArrayOfEvents, Page);
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
|
@@ -456,7 +456,7 @@ Procedure GetObjectsListRecursively(Val Headers, ArrayOfObjects, Detailed = Fals
|
|||||||
ArrayOfObjects.Add(CurrentObject);
|
ArrayOfObjects.Add(CurrentObject);
|
||||||
EndDo;
|
EndDo;
|
||||||
|
|
||||||
If Objects.Quantity() > 0 And ValueIsFilled(Page) Then
|
If Objects.Count() > 0 And ValueIsFilled(Page) Then
|
||||||
GetObjectsListRecursively(Headers, ArrayOfObjects, Detailed, Filter, Page);
|
GetObjectsListRecursively(Headers, ArrayOfObjects, Detailed, Filter, Page);
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
@@ -495,7 +495,7 @@ Procedure FormFileUploadParameters(Description)
|
|||||||
|
|
||||||
For Each Element In Description Do
|
For Each Element In Description Do
|
||||||
|
|
||||||
If Element.TheKey = "Parent" Then
|
If Element.Key = "Parent" Then
|
||||||
|
|
||||||
CurrentValue = New Array;
|
CurrentValue = New Array;
|
||||||
CurrentValue.Add(Element.Value);
|
CurrentValue.Add(Element.Value);
|
||||||
@@ -506,7 +506,7 @@ Procedure FormFileUploadParameters(Description)
|
|||||||
|
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
FieldName = FieldMapping.Get(Element.TheKey);
|
FieldName = FieldMapping.Get(Element.Key);
|
||||||
FormedDescription.Insert(FieldName, CurrentValue);
|
FormedDescription.Insert(FieldName, CurrentValue);
|
||||||
|
|
||||||
EndDo;
|
EndDo;
|
||||||
@@ -581,7 +581,7 @@ EndFunction
|
|||||||
Function UploadLargeFile(Val Description, Val FileMapping, Val Headers, Val Identifier = "")
|
Function UploadLargeFile(Val Description, Val FileMapping, Val Headers, Val Identifier = "")
|
||||||
|
|
||||||
For Each File In FileMapping Do
|
For Each File In FileMapping Do
|
||||||
Binary = File.TheKey;
|
Binary = File.Key;
|
||||||
Break;
|
Break;
|
||||||
EndDo;
|
EndDo;
|
||||||
|
|
||||||
@@ -709,7 +709,7 @@ Function CheckPartUpload(Response, StrTotalSize, AdditionalHeaders, UploadURL, C
|
|||||||
ArrayOfInformation = StrSplit(UploadedData, "-", False);
|
ArrayOfInformation = StrSplit(UploadedData, "-", False);
|
||||||
PartsRequired = 2;
|
PartsRequired = 2;
|
||||||
|
|
||||||
If Not ArrayOfInformation.Quantity() = PartsRequired Then
|
If Not ArrayOfInformation.Count() = PartsRequired Then
|
||||||
OPI_Tools.ProcessResponse(Response);
|
OPI_Tools.ProcessResponse(Response);
|
||||||
Return Response;
|
Return Response;
|
||||||
EndIf;
|
EndIf;
|
||||||
|
@@ -377,7 +377,7 @@ Function FormCellDataArray(Val ValueStructure, Val MajorDimension, Val Sheet)
|
|||||||
For Each CellData In ValueStructure Do
|
For Each CellData In ValueStructure Do
|
||||||
|
|
||||||
CurrentValue = CellData.Value;
|
CurrentValue = CellData.Value;
|
||||||
CurrentKey = CellData.TheKey;
|
CurrentKey = CellData.Key;
|
||||||
|
|
||||||
AddSheetName(CurrentKey, Sheet);
|
AddSheetName(CurrentKey, Sheet);
|
||||||
|
|
||||||
|
@@ -224,7 +224,7 @@ Function CreateDatabase(Val Token, Val Parent, Val Title, Val Properties = "") E
|
|||||||
// Name : title
|
// Name : title
|
||||||
// Description : rich_text
|
// Description : rich_text
|
||||||
// InProgress : checkbox
|
// InProgress : checkbox
|
||||||
// Quantity : number
|
// Count : number
|
||||||
// Date : date
|
// Date : date
|
||||||
// Status : Map
|
// Status : Map
|
||||||
// Аtoтиinный : green
|
// Аtoтиinный : green
|
||||||
@@ -587,7 +587,7 @@ EndProcedure
|
|||||||
|
|
||||||
Procedure AddDatabaseProperties(Val Properties, MainStructure)
|
Procedure AddDatabaseProperties(Val Properties, MainStructure)
|
||||||
|
|
||||||
If Properties.Quantity() = 0 Then
|
If Properties.Count() = 0 Then
|
||||||
MainStructure.Insert("properties", New Structure);
|
MainStructure.Insert("properties", New Structure);
|
||||||
Return;
|
Return;
|
||||||
EndIf;
|
EndIf;
|
||||||
@@ -598,17 +598,17 @@ Procedure AddDatabaseProperties(Val Properties, MainStructure)
|
|||||||
|
|
||||||
If TypeOf(Property.Value) = Type("String") Then
|
If TypeOf(Property.Value) = Type("String") Then
|
||||||
|
|
||||||
ParameterMap.Insert(Property.TheKey, New Structure(Property.Value, New Structure));
|
ParameterMap.Insert(Property.Key, New Structure(Property.Value, New Structure));
|
||||||
|
|
||||||
ElsIf TypeOf(Property.Value) = Type("Structure")
|
ElsIf TypeOf(Property.Value) = Type("Structure")
|
||||||
Or TypeOf(Property.Value) = Type("Map") Then
|
Or TypeOf(Property.Value) = Type("Map") Then
|
||||||
|
|
||||||
ValueSelection = FormSelectionValues(Property.Value);
|
ValueSelection = FormSelectionValues(Property.Value);
|
||||||
ParameterMap.Insert(Property.TheKey, New Structure("select", ValueSelection));
|
ParameterMap.Insert(Property.Key, New Structure("select", ValueSelection));
|
||||||
|
|
||||||
Else
|
Else
|
||||||
|
|
||||||
ParameterMap.Insert(Property.TheKey, Property.Value);
|
ParameterMap.Insert(Property.Key, Property.Value);
|
||||||
|
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
@@ -625,7 +625,7 @@ Function FormSelectionValues(Val VariantStructure)
|
|||||||
For Each Option In VariantStructure Do
|
For Each Option In VariantStructure Do
|
||||||
|
|
||||||
OptionMap = New Map;
|
OptionMap = New Map;
|
||||||
OptionMap.Insert("name" , Option.TheKey);
|
OptionMap.Insert("name" , Option.Key);
|
||||||
OptionMap.Insert("color", Option.Value);
|
OptionMap.Insert("color", Option.Value);
|
||||||
|
|
||||||
OptionArray.Add(OptionMap);
|
OptionArray.Add(OptionMap);
|
||||||
@@ -654,7 +654,7 @@ Function FillDataBySchema(Val Scheme, Val Data, Val Token, Val ThisIsBase = True
|
|||||||
FieldData = Field.Value;
|
FieldData = Field.Value;
|
||||||
FieldType = FieldData["type"];
|
FieldType = FieldData["type"];
|
||||||
|
|
||||||
FillableData = Data.Get(Field.TheKey);
|
FillableData = Data.Get(Field.Key);
|
||||||
|
|
||||||
If FillableData = Undefined Then
|
If FillableData = Undefined Then
|
||||||
Continue;
|
Continue;
|
||||||
@@ -860,7 +860,7 @@ Function ConvertFiles(Val FileMapping)
|
|||||||
|
|
||||||
FileStructure = New Structure;
|
FileStructure = New Structure;
|
||||||
FileStructure.Insert("type" , "external");
|
FileStructure.Insert("type" , "external");
|
||||||
FileStructure.Insert("name" , File.TheKey);
|
FileStructure.Insert("name" , File.Key);
|
||||||
FileStructure.Insert("external", New Structure("url", File.Value));
|
FileStructure.Insert("external", New Structure("url", File.Value));
|
||||||
|
|
||||||
ArrayOfFiles.Add(FileStructure);
|
ArrayOfFiles.Add(FileStructure);
|
||||||
|
@@ -179,34 +179,34 @@ Function ProcessTMAData(Val DataString, Val Token) Export
|
|||||||
|
|
||||||
DataString = DecodeString(DataString, StringEncodingMethod.URLencoding);
|
DataString = DecodeString(DataString, StringEncodingMethod.URLencoding);
|
||||||
DataStructure = OPI_Tools.RequestParametersToMatch(DataString);
|
DataStructure = OPI_Tools.RequestParametersToMatch(DataString);
|
||||||
TheKey = "WebAppData";
|
Key = "WebAppData";
|
||||||
Hash = "";
|
Hash = "";
|
||||||
BinaryKey = GetBinaryDataFromString(TheKey);
|
BinaryKey = GetBinaryDataFromString(Key);
|
||||||
|
|
||||||
Result = OPI_Cryptography.HMACSHA256(BinaryKey, GetBinaryDataFromString(Token));
|
Result = OPI_Cryptography.HMACSHA256(BinaryKey, GetBinaryDataFromString(Token));
|
||||||
|
|
||||||
TValue = New ValueTable;
|
TValue = New ValueTable;
|
||||||
TValue.Columns.Add("TheKey");
|
TValue.Columns.Add("Key");
|
||||||
TValue.Columns.Add("Value");
|
TValue.Columns.Add("Value");
|
||||||
|
|
||||||
For Each Data In DataStructure Do
|
For Each Data In DataStructure Do
|
||||||
|
|
||||||
NewLine = TValue.Add();
|
NewLine = TValue.Add();
|
||||||
NewLine.TheKey = Data.TheKey;
|
NewLine.Key = Data.Key;
|
||||||
NewLine.Value = Data.Value;
|
NewLine.Value = Data.Value;
|
||||||
|
|
||||||
EndDo;
|
EndDo;
|
||||||
|
|
||||||
TValue.Sort("TheKey");
|
TValue.Sort("Key");
|
||||||
|
|
||||||
ReturnMapping = New Map;
|
ReturnMapping = New Map;
|
||||||
DCS = "";
|
DCS = "";
|
||||||
|
|
||||||
For Each DataString In TValue Do
|
For Each DataString In TValue Do
|
||||||
|
|
||||||
If DataString.TheKey <> "hash" Then
|
If DataString.Key <> "hash" Then
|
||||||
DCS = DCS + DataString.TheKey + "=" + DataString.Value + Chars.PS;
|
DCS = DCS + DataString.Key + "=" + DataString.Value + Chars.PS;
|
||||||
ReturnMapping.Insert(DataString.TheKey, DataString.Value);
|
ReturnMapping.Insert(DataString.Key, DataString.Value);
|
||||||
Else
|
Else
|
||||||
Hash = DataString.Value;
|
Hash = DataString.Value;
|
||||||
EndIf;
|
EndIf;
|
||||||
@@ -410,7 +410,7 @@ Function SendMediaGroup(Val Token
|
|||||||
, Val Markup = "Markdown") Export
|
, Val Markup = "Markdown") Export
|
||||||
|
|
||||||
// FileMapping
|
// FileMapping
|
||||||
// TheKey - File, Value - Type
|
// Key - File, Value - Type
|
||||||
// Types: audio, document, photo, video
|
// Types: audio, document, photo, video
|
||||||
// Different types cannot be mixed!
|
// Different types cannot be mixed!
|
||||||
|
|
||||||
@@ -1165,12 +1165,12 @@ Procedure FormMediaArray(Val FileMapping, Val Text, FileStructure, Media)
|
|||||||
|
|
||||||
For Each CurrentFile In FileMapping Do
|
For Each CurrentFile In FileMapping Do
|
||||||
|
|
||||||
If Not TypeOf(CurrentFile.TheKey) = Type("BinaryData") Then
|
If Not TypeOf(CurrentFile.Key) = Type("BinaryData") Then
|
||||||
|
|
||||||
Binary = CurrentFile.TheKey;
|
Binary = CurrentFile.Key;
|
||||||
OPI_TypeConversion.GetBinaryData(Binary);
|
OPI_TypeConversion.GetBinaryData(Binary);
|
||||||
|
|
||||||
ThisFile = New File(CurrentFile.TheKey);
|
ThisFile = New File(CurrentFile.Key);
|
||||||
MediaName = CurrentFile.Value
|
MediaName = CurrentFile.Value
|
||||||
+ String(Counter)
|
+ String(Counter)
|
||||||
+ ?(CurrentFile.Value = "document", ThisFile.Extension, "");
|
+ ?(CurrentFile.Value = "document", ThisFile.Extension, "");
|
||||||
@@ -1178,7 +1178,7 @@ Procedure FormMediaArray(Val FileMapping, Val Text, FileStructure, Media)
|
|||||||
FullMediaName = StrReplace(MediaName, ".", "___");
|
FullMediaName = StrReplace(MediaName, ".", "___");
|
||||||
|
|
||||||
Else
|
Else
|
||||||
Binary = CurrentFile.TheKey;
|
Binary = CurrentFile.Key;
|
||||||
MediaName = CurrentFile.Value + String(Counter);
|
MediaName = CurrentFile.Value + String(Counter);
|
||||||
FullMediaName = MediaName;
|
FullMediaName = MediaName;
|
||||||
EndIf;
|
EndIf;
|
||||||
@@ -1208,7 +1208,7 @@ Procedure AddChatIdentifier(Val ChatID, Parameters)
|
|||||||
ChatID = OPI_Tools.NumberToString(ChatID);
|
ChatID = OPI_Tools.NumberToString(ChatID);
|
||||||
ChatArray = StrSplit(ChatID, "*", False);
|
ChatArray = StrSplit(ChatID, "*", False);
|
||||||
|
|
||||||
If ChatArray.Quantity() > 1 Then
|
If ChatArray.Count() > 1 Then
|
||||||
|
|
||||||
ChatID = ChatArray[0];
|
ChatID = ChatArray[0];
|
||||||
ThreadID = ChatArray[1];
|
ThreadID = ChatArray[1];
|
||||||
|
@@ -200,7 +200,7 @@ Function CreateCustomTweet(Val Text = ""
|
|||||||
|
|
||||||
PollDuration = Number(PollDuration);
|
PollDuration = Number(PollDuration);
|
||||||
|
|
||||||
If PollOptionsArray.Quantity() > 0 Then
|
If PollOptionsArray.Count() > 0 Then
|
||||||
|
|
||||||
OptionStructure = New Structure("options,duration_minutes", PollOptionsArray, PollDuration);
|
OptionStructure = New Structure("options,duration_minutes", PollOptionsArray, PollDuration);
|
||||||
Fields.Insert("poll", OptionStructure);
|
Fields.Insert("poll", OptionStructure);
|
||||||
@@ -210,7 +210,7 @@ Function CreateCustomTweet(Val Text = ""
|
|||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
If TypeOf(MediaArray) = Type(Array) Then
|
If TypeOf(MediaArray) = Type(Array) Then
|
||||||
If MediaArray.Quantity() > 0 Then
|
If MediaArray.Count() > 0 Then
|
||||||
Fields.Insert("media", New Structure("media_ids", MediaArray));
|
Fields.Insert("media", New Structure("media_ids", MediaArray));
|
||||||
EndIf;
|
EndIf;
|
||||||
EndIf;
|
EndIf;
|
||||||
@@ -379,7 +379,7 @@ EndFunction
|
|||||||
Function UploadMediaInParts(Val File, Val Type, Val RequestType, Val URL, Parameters)
|
Function UploadMediaInParts(Val File, Val Type, Val RequestType, Val URL, Parameters)
|
||||||
|
|
||||||
Unit = 1024;
|
Unit = 1024;
|
||||||
Quantity = 4;
|
Count = 4;
|
||||||
MediaKey = "media_key";
|
MediaKey = "media_key";
|
||||||
MIS = "media_id_string";
|
MIS = "media_id_string";
|
||||||
Command = "command";
|
Command = "command";
|
||||||
@@ -390,7 +390,7 @@ Function UploadMediaInParts(Val File, Val Type, Val RequestType, Val URL, Parame
|
|||||||
MIMETypeMapping.Insert("tweet_video", "video/mp4");
|
MIMETypeMapping.Insert("tweet_video", "video/mp4");
|
||||||
MIMETypeMapping.Insert("tweet_gif" , "image/gif");
|
MIMETypeMapping.Insert("tweet_gif" , "image/gif");
|
||||||
|
|
||||||
ChunkSize = Quantity * Unit * Unit;
|
ChunkSize = Count * Unit * Unit;
|
||||||
ArrayReading = SplitBinaryData(File, ChunkSize);
|
ArrayReading = SplitBinaryData(File, ChunkSize);
|
||||||
|
|
||||||
Fields = New Structure;
|
Fields = New Structure;
|
||||||
@@ -540,7 +540,7 @@ Function GetStandardParameters(Val Parameters = "")
|
|||||||
|
|
||||||
If TypeOf(Parameters) = Type("Structure") Or TypeOf(Parameters) = Type("Map") Then
|
If TypeOf(Parameters) = Type("Structure") Or TypeOf(Parameters) = Type("Map") Then
|
||||||
For Each PassedParameter In Parameters Do
|
For Each PassedParameter In Parameters Do
|
||||||
Parameters_.Insert(PassedParameter.TheKey, OPI_Tools.NumberToString(PassedParameter.Value));
|
Parameters_.Insert(PassedParameter.Key, OPI_Tools.NumberToString(PassedParameter.Value));
|
||||||
EndDo;
|
EndDo;
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
@@ -561,54 +561,54 @@ Function CreateAuthorizationHeaderV1(Val Parameters, Val Fields, Val RequestType
|
|||||||
CurrentUNIXDate = OPI_Tools.UNIXTime(CurrentDate);
|
CurrentUNIXDate = OPI_Tools.UNIXTime(CurrentDate);
|
||||||
CurrentUNIXDate = OPI_Tools.NumberToString(CurrentUNIXDate);
|
CurrentUNIXDate = OPI_Tools.NumberToString(CurrentUNIXDate);
|
||||||
ParametersTable = New ValueTable;
|
ParametersTable = New ValueTable;
|
||||||
ParametersTable.Columns.Add("TheKey");
|
ParametersTable.Columns.Add("Key");
|
||||||
ParametersTable.Columns.Add("Value");
|
ParametersTable.Columns.Add("Value");
|
||||||
|
|
||||||
For Each Field In Fields Do
|
For Each Field In Fields Do
|
||||||
|
|
||||||
NewLine = ParametersTable.Add();
|
NewLine = ParametersTable.Add();
|
||||||
NewLine.TheKey = Field.TheKey;
|
NewLine.Key = Field.Key;
|
||||||
NewLine.Value = Field.Value;
|
NewLine.Value = Field.Value;
|
||||||
|
|
||||||
EndDo;
|
EndDo;
|
||||||
|
|
||||||
NewLine = ParametersTable.Add();
|
NewLine = ParametersTable.Add();
|
||||||
NewLine.TheKey = OCK;
|
NewLine.Key = OCK;
|
||||||
NewLine.Value = Parameters[OCK];
|
NewLine.Value = Parameters[OCK];
|
||||||
|
|
||||||
NewLine = ParametersTable.Add();
|
NewLine = ParametersTable.Add();
|
||||||
NewLine.TheKey = OTK;
|
NewLine.Key = OTK;
|
||||||
NewLine.Value = Parameters[OTK];
|
NewLine.Value = Parameters[OTK];
|
||||||
|
|
||||||
NewLine = ParametersTable.Add();
|
NewLine = ParametersTable.Add();
|
||||||
NewLine.TheKey = "oauth_version";
|
NewLine.Key = "oauth_version";
|
||||||
NewLine.Value = APIVersion;
|
NewLine.Value = APIVersion;
|
||||||
|
|
||||||
NewLine = ParametersTable.Add();
|
NewLine = ParametersTable.Add();
|
||||||
NewLine.TheKey = "oauth_signature_method";
|
NewLine.Key = "oauth_signature_method";
|
||||||
NewLine.Value = HashingMethod;
|
NewLine.Value = HashingMethod;
|
||||||
|
|
||||||
NewLine = ParametersTable.Add();
|
NewLine = ParametersTable.Add();
|
||||||
NewLine.TheKey = "oauth_timestamp";
|
NewLine.Key = "oauth_timestamp";
|
||||||
NewLine.Value = CurrentUNIXDate;
|
NewLine.Value = CurrentUNIXDate;
|
||||||
|
|
||||||
NewLine = ParametersTable.Add();
|
NewLine = ParametersTable.Add();
|
||||||
NewLine.TheKey = "oauth_nonce";
|
NewLine.Key = "oauth_nonce";
|
||||||
NewLine.Value = CurrentUNIXDate;
|
NewLine.Value = CurrentUNIXDate;
|
||||||
|
|
||||||
For Each TableRow In ParametersTable Do
|
For Each TableRow In ParametersTable Do
|
||||||
|
|
||||||
TableRow.TheKey = EncodeString(TableRow.TheKey, StringEncodingMethod.URLencoding);
|
TableRow.Key = EncodeString(TableRow.Key, StringEncodingMethod.URLencoding);
|
||||||
TableRow.Value = EncodeString(TableRow.Value, StringEncodingMethod.URLencoding);
|
TableRow.Value = EncodeString(TableRow.Value, StringEncodingMethod.URLencoding);
|
||||||
|
|
||||||
EndDo;
|
EndDo;
|
||||||
|
|
||||||
ParametersTable.Sort("TheKey");
|
ParametersTable.Sort("Key");
|
||||||
|
|
||||||
For Each TableRow In ParametersTable Do
|
For Each TableRow In ParametersTable Do
|
||||||
|
|
||||||
SignatureString = SignatureString
|
SignatureString = SignatureString
|
||||||
+ TableRow.TheKey
|
+ TableRow.Key
|
||||||
+ "="
|
+ "="
|
||||||
+ TableRow.Value
|
+ TableRow.Value
|
||||||
+ "&";
|
+ "&";
|
||||||
|
@@ -444,7 +444,7 @@ Function UploadPhotoToServer(Val Image, Val Parameters = "", Val View = "Post")
|
|||||||
Method = DetermineImageUploadMethod(View);
|
Method = DetermineImageUploadMethod(View);
|
||||||
Files = New Map;
|
Files = New Map;
|
||||||
|
|
||||||
Response = "response";
|
Response_ = "response";
|
||||||
URL = "api.vk.com/method/";
|
URL = "api.vk.com/method/";
|
||||||
Upload = URL + Method["Upload"];
|
Upload = URL + Method["Upload"];
|
||||||
Save = URL + Method["Save"];
|
Save = URL + Method["Save"];
|
||||||
@@ -461,7 +461,7 @@ Function UploadPhotoToServer(Val Image, Val Parameters = "", Val View = "Post")
|
|||||||
For N = 1 To 5 Do
|
For N = 1 To 5 Do
|
||||||
|
|
||||||
Response = OPI_Tools.Get(Upload, Parameters);
|
Response = OPI_Tools.Get(Upload, Parameters);
|
||||||
Result = Response[Response];
|
Result = Response[Response_];
|
||||||
|
|
||||||
If ValueIsFilled(Result) Then
|
If ValueIsFilled(Result) Then
|
||||||
|
|
||||||
@@ -842,7 +842,7 @@ Function GetPostStatistics(Val PostIDsArray, Val Parameters = "") Export
|
|||||||
|
|
||||||
SetsArray.Add(OPI_Tools.NumberToString(Post));
|
SetsArray.Add(OPI_Tools.NumberToString(Post));
|
||||||
|
|
||||||
If SetsArray.Quantity() = MaximumPosts Then
|
If SetsArray.Count() = MaximumPosts Then
|
||||||
|
|
||||||
NumbersString = StrConcat(SetsArray, ",");
|
NumbersString = StrConcat(SetsArray, ",");
|
||||||
Parameters_.Insert("post_ids", NumbersString);
|
Parameters_.Insert("post_ids", NumbersString);
|
||||||
@@ -1055,7 +1055,7 @@ EndFunction
|
|||||||
// Parameters - Structure Of String - See GetStandardParameters - auth - Authorization JSON or path to .json
|
// Parameters - Structure Of String - See GetStandardParameters - auth - Authorization JSON or path to .json
|
||||||
//
|
//
|
||||||
// Returns:
|
// Returns:
|
||||||
// Map Of String - TheKey - ID, Value - Name
|
// Map Of String - Key - ID, Value - Name
|
||||||
Function GetProductCategoryList(Val Parameters = "") Export
|
Function GetProductCategoryList(Val Parameters = "") Export
|
||||||
|
|
||||||
Response = "response";
|
Response = "response";
|
||||||
@@ -1065,9 +1065,9 @@ Function GetProductCategoryList(Val Parameters = "") Export
|
|||||||
|
|
||||||
If ValueIsFilled(Result) Then
|
If ValueIsFilled(Result) Then
|
||||||
|
|
||||||
Quantity = Result["count"];
|
Count = Result["count"];
|
||||||
|
|
||||||
If Not ValueIsFilled(Quantity) Then
|
If Not ValueIsFilled(Count) Then
|
||||||
Return Response;
|
Return Response;
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
@@ -1075,7 +1075,7 @@ Function GetProductCategoryList(Val Parameters = "") Export
|
|||||||
Return Response;
|
Return Response;
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
Parameters_.Insert("count", Quantity);
|
Parameters_.Insert("count", Count);
|
||||||
Response = OPI_Tools.Get("api.vk.com/method/market.getCategories", Parameters_);
|
Response = OPI_Tools.Get("api.vk.com/method/market.getCategories", Parameters_);
|
||||||
Result = Response[Response];
|
Result = Response[Response];
|
||||||
|
|
||||||
@@ -1743,7 +1743,7 @@ Function GetStandardParameters(Val Parameters = "")
|
|||||||
|
|
||||||
If TypeOf(Parameters) = Type("Structure") Or TypeOf(Parameters) = Type("Map") Then
|
If TypeOf(Parameters) = Type("Structure") Or TypeOf(Parameters) = Type("Map") Then
|
||||||
For Each PassedParameter In Parameters Do
|
For Each PassedParameter In Parameters Do
|
||||||
Parameters_.Insert(PassedParameter.TheKey, OPI_Tools.NumberToString(PassedParameter.Value));
|
Parameters_.Insert(PassedParameter.Key, OPI_Tools.NumberToString(PassedParameter.Value));
|
||||||
EndDo;
|
EndDo;
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
@@ -1781,7 +1781,7 @@ Function GetImageCorrespondence(Val Image, Val Parameters, Val View)
|
|||||||
If Not ValueIsFilled(ResponseArray) Or Not TypeOf(ResponseArray) = Type("Array") Then
|
If Not ValueIsFilled(ResponseArray) Or Not TypeOf(ResponseArray) = Type("Array") Then
|
||||||
Return Response;
|
Return Response;
|
||||||
Else
|
Else
|
||||||
If ResponseArray.Quantity() = 0 Then
|
If ResponseArray.Count() = 0 Then
|
||||||
Return Response;
|
Return Response;
|
||||||
Else
|
Else
|
||||||
ResponseCorrespondence = ResponseArray[0];
|
ResponseCorrespondence = ResponseArray[0];
|
||||||
@@ -1819,7 +1819,7 @@ Function DetermineImageUploadMethod(Val View)
|
|||||||
MethodCorrespondence = New Map;
|
MethodCorrespondence = New Map;
|
||||||
Upload = "Upload";
|
Upload = "Upload";
|
||||||
Save = "Save";
|
Save = "Save";
|
||||||
Method = "Method";
|
Way = "Way";
|
||||||
Photo = "Photo";
|
Photo = "Photo";
|
||||||
|
|
||||||
If View = "Post" Then
|
If View = "Post" Then
|
||||||
@@ -1827,33 +1827,33 @@ Function DetermineImageUploadMethod(Val View)
|
|||||||
MethodCorrespondence.Insert(Upload , "photos.getWallUploadServer");
|
MethodCorrespondence.Insert(Upload , "photos.getWallUploadServer");
|
||||||
MethodCorrespondence.Insert(Save, "photos.saveWallPhoto");
|
MethodCorrespondence.Insert(Save, "photos.saveWallPhoto");
|
||||||
MethodCorrespondence.Insert(Photo , "photo");
|
MethodCorrespondence.Insert(Photo , "photo");
|
||||||
MethodCorrespondence.Insert(Method , 1);
|
MethodCorrespondence.Insert(Way , 1);
|
||||||
|
|
||||||
ElsIf View = "Product" Then
|
ElsIf View = "Product" Then
|
||||||
|
|
||||||
MethodCorrespondence.Insert(Upload , "market.getProductPhotoUploadServer");
|
MethodCorrespondence.Insert(Upload , "market.getProductPhotoUploadServer");
|
||||||
MethodCorrespondence.Insert(Save, "market.saveProductPhoto");
|
MethodCorrespondence.Insert(Save, "market.saveProductPhoto");
|
||||||
MethodCorrespondence.Insert(Method , 2);
|
MethodCorrespondence.Insert(Way , 2);
|
||||||
|
|
||||||
ElsIf View = "Story" Then
|
ElsIf View = "Story" Then
|
||||||
|
|
||||||
MethodCorrespondence.Insert(Upload , "stories.getPhotoUploadServer");
|
MethodCorrespondence.Insert(Upload , "stories.getPhotoUploadServer");
|
||||||
MethodCorrespondence.Insert(Save, "stories.save");
|
MethodCorrespondence.Insert(Save, "stories.save");
|
||||||
MethodCorrespondence.Insert(Method , 3);
|
MethodCorrespondence.Insert(Way , 3);
|
||||||
|
|
||||||
ElsIf View = "Poll" Then
|
ElsIf View = "Poll" Then
|
||||||
|
|
||||||
MethodCorrespondence.Insert(Upload , "polls.getPhotoUploadServer");
|
MethodCorrespondence.Insert(Upload , "polls.getPhotoUploadServer");
|
||||||
MethodCorrespondence.Insert(Save, "polls.savePhoto");
|
MethodCorrespondence.Insert(Save, "polls.savePhoto");
|
||||||
MethodCorrespondence.Insert(Photo , "photo");
|
MethodCorrespondence.Insert(Photo , "photo");
|
||||||
MethodCorrespondence.Insert(Method , 1);
|
MethodCorrespondence.Insert(Way , 1);
|
||||||
|
|
||||||
Else
|
Else
|
||||||
|
|
||||||
MethodCorrespondence.Insert(Upload , "photos.getUploadServer");
|
MethodCorrespondence.Insert(Upload , "photos.getUploadServer");
|
||||||
MethodCorrespondence.Insert(Save, "photos.save");
|
MethodCorrespondence.Insert(Save, "photos.save");
|
||||||
MethodCorrespondence.Insert(Photo , "photos_list");
|
MethodCorrespondence.Insert(Photo , "photos_list");
|
||||||
MethodCorrespondence.Insert(Method , 1);
|
MethodCorrespondence.Insert(Way , 1);
|
||||||
|
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
@@ -1985,7 +1985,7 @@ Function AddImageParameter(Val Image, Val SelectionID, Parameters)
|
|||||||
Return Selections;
|
Return Selections;
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
If Not Selections.Quantity() = 0 Then
|
If Not Selections.Count() = 0 Then
|
||||||
PhotoID = Selections[0]["photo"]["id"];
|
PhotoID = Selections[0]["photo"]["id"];
|
||||||
OPI_TypeConversion.GetLine(PhotoID);
|
OPI_TypeConversion.GetLine(PhotoID);
|
||||||
Parameters.Insert(PhotoID, PhotoID);
|
Parameters.Insert(PhotoID, PhotoID);
|
||||||
@@ -2002,11 +2002,11 @@ EndFunction
|
|||||||
Procedure FillPhotoUploadParameters(Val Method, Val Response, Parameters)
|
Procedure FillPhotoUploadParameters(Val Method, Val Response, Parameters)
|
||||||
|
|
||||||
Response = "response";
|
Response = "response";
|
||||||
Method = Method["Method"];
|
Way = Method["Way"];
|
||||||
StandardMethod = 1;
|
StandardMethod = 1;
|
||||||
NewMethod = 2;
|
NewMethod = 2;
|
||||||
|
|
||||||
If Method = StandardMethod Then
|
If Way = StandardMethod Then
|
||||||
|
|
||||||
Hash = "hash";
|
Hash = "hash";
|
||||||
Serv = "server";
|
Serv = "server";
|
||||||
@@ -2030,7 +2030,7 @@ Procedure FillPhotoUploadParameters(Val Method, Val Response, Parameters)
|
|||||||
Parameters.Insert(Aid , Identifier);
|
Parameters.Insert(Aid , Identifier);
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
ElsIf Method = NewMethod Then
|
ElsIf Way = NewMethod Then
|
||||||
|
|
||||||
ResponseString = OPI_Tools.JSONString(Response);
|
ResponseString = OPI_Tools.JSONString(Response);
|
||||||
Parameters.Insert("upload_response", ResponseString);
|
Parameters.Insert("upload_response", ResponseString);
|
||||||
@@ -2091,10 +2091,10 @@ Procedure FillProductRequestFields(Val ProductDescription, Parameters)
|
|||||||
|
|
||||||
For Each Field In GetProductParameterMapping() Do
|
For Each Field In GetProductParameterMapping() Do
|
||||||
|
|
||||||
Value = ProductDescription[Field.TheKey];
|
Value = ProductDescription[Field.Key];
|
||||||
|
|
||||||
If Value <> Undefined Then
|
If Value <> Undefined Then
|
||||||
Parameters.Insert(Field.Value, ProductDescription[Field.TheKey]);
|
Parameters.Insert(Field.Value, ProductDescription[Field.Key]);
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
EndDo;
|
EndDo;
|
||||||
@@ -2104,7 +2104,7 @@ EndProcedure
|
|||||||
Procedure AddAdditionalProductPhotos(Val PhotoArray, Parameters)
|
Procedure AddAdditionalProductPhotos(Val PhotoArray, Parameters)
|
||||||
|
|
||||||
If TypeOf(PhotoArray) = Type("Array") Then
|
If TypeOf(PhotoArray) = Type("Array") Then
|
||||||
If PhotoArray.Quantity() > 0 Then
|
If PhotoArray.Count() > 0 Then
|
||||||
|
|
||||||
PhotoString = "";
|
PhotoString = "";
|
||||||
|
|
||||||
@@ -2134,7 +2134,7 @@ Procedure GetProductListRecursively(ProductsArray, Parameters, Shift = 0)
|
|||||||
Response = OPI_Tools.Get("api.vk.com/method/market.get", Parameters);
|
Response = OPI_Tools.Get("api.vk.com/method/market.get", Parameters);
|
||||||
Products = Response[Response]["items"];
|
Products = Response[Response]["items"];
|
||||||
|
|
||||||
If Products.Quantity() = 0 Then
|
If Products.Count() = 0 Then
|
||||||
Return;
|
Return;
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
@@ -2155,7 +2155,7 @@ Procedure GetAlbumListRecursively(ArrayOfAlbums, Parameters, Shift = 0)
|
|||||||
Response = OPI_Tools.Get("api.vk.com/method/market.getAlbums", Parameters);
|
Response = OPI_Tools.Get("api.vk.com/method/market.getAlbums", Parameters);
|
||||||
Albums = Response[Response]["items"];
|
Albums = Response[Response]["items"];
|
||||||
|
|
||||||
If Albums.Quantity() = 0 Then
|
If Albums.Count() = 0 Then
|
||||||
Return;
|
Return;
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
@@ -2176,7 +2176,7 @@ Procedure GetOrderListRecursively(ArrayOfOrders, Parameters, Shift = 0)
|
|||||||
Response = OPI_Tools.Get("api.vk.com/method/market.getGroupOrders", Parameters);
|
Response = OPI_Tools.Get("api.vk.com/method/market.getGroupOrders", Parameters);
|
||||||
Orders = Response[Response]["items"];
|
Orders = Response[Response]["items"];
|
||||||
|
|
||||||
If Orders.Quantity() = 0 Then
|
If Orders.Count() = 0 Then
|
||||||
Return;
|
Return;
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
|
@@ -251,7 +251,7 @@ EndFunction
|
|||||||
//
|
//
|
||||||
// Parameters:
|
// Parameters:
|
||||||
// Token - String - Token - token
|
// Token - String - Token - token
|
||||||
// Quantity - Number, String - Number of returned objects - amount
|
// Count - Number, String - Number of returned objects - amount
|
||||||
// OffsetFromStart - Number - Offset for getting objects not from the beginning of the list - offset
|
// OffsetFromStart - Number - Offset for getting objects not from the beginning of the list - offset
|
||||||
// FilterByType - String - Filter by file type - type
|
// FilterByType - String - Filter by file type - type
|
||||||
// SortByDate - Boolean - True > sort by date, False > alphabetically - datesort
|
// SortByDate - Boolean - True > sort by date, False > alphabetically - datesort
|
||||||
@@ -259,13 +259,13 @@ EndFunction
|
|||||||
// Returns:
|
// Returns:
|
||||||
// Key-Value Pair - serialized JSON response from Yandex
|
// Key-Value Pair - serialized JSON response from Yandex
|
||||||
Function GetFilesList(Val Token
|
Function GetFilesList(Val Token
|
||||||
, Val Quantity = 0
|
, Val Count = 0
|
||||||
, Val OffsetFromStart = 0
|
, Val OffsetFromStart = 0
|
||||||
, Val FilterByType = ""
|
, Val FilterByType = ""
|
||||||
, Val SortByDate = False) Export
|
, Val SortByDate = False) Export
|
||||||
|
|
||||||
OPI_TypeConversion.GetLine(Token);
|
OPI_TypeConversion.GetLine(Token);
|
||||||
OPI_TypeConversion.GetLine(Quantity);
|
OPI_TypeConversion.GetLine(Count);
|
||||||
OPI_TypeConversion.GetLine(OffsetFromStart);
|
OPI_TypeConversion.GetLine(OffsetFromStart);
|
||||||
OPI_TypeConversion.GetLine(FilterByType);
|
OPI_TypeConversion.GetLine(FilterByType);
|
||||||
OPI_TypeConversion.GetBoolean(SortByDate);
|
OPI_TypeConversion.GetBoolean(SortByDate);
|
||||||
@@ -274,8 +274,8 @@ Function GetFilesList(Val Token
|
|||||||
|
|
||||||
Parameters = New Structure;
|
Parameters = New Structure;
|
||||||
|
|
||||||
If ValueIsFilled(Quantity) Then
|
If ValueIsFilled(Count) Then
|
||||||
Parameters.Insert("limit", OPI_Tools.NumberToString(Quantity));
|
Parameters.Insert("limit", OPI_Tools.NumberToString(Count));
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
If ValueIsFilled(OffsetFromStart) Then
|
If ValueIsFilled(OffsetFromStart) Then
|
||||||
@@ -443,23 +443,23 @@ EndFunction
|
|||||||
//
|
//
|
||||||
// Parameters:
|
// Parameters:
|
||||||
// Token - String - Token - token
|
// Token - String - Token - token
|
||||||
// Quantity - Number - Number of returned objects - amount
|
// Count - Number - Number of returned objects - amount
|
||||||
// OffsetFromStart - Number - Offset for getting objects not from the beginning of the list - offset
|
// OffsetFromStart - Number - Offset for getting objects not from the beginning of the list - offset
|
||||||
//
|
//
|
||||||
// Returns:
|
// Returns:
|
||||||
// Key-Value Pair - serialized JSON response from Yandex
|
// Key-Value Pair - serialized JSON response from Yandex
|
||||||
Function GetPublishedObjectsList(Val Token, Val Quantity = 0, Val OffsetFromStart = 0) Export
|
Function GetPublishedObjectsList(Val Token, Val Count = 0, Val OffsetFromStart = 0) Export
|
||||||
|
|
||||||
OPI_TypeConversion.GetLine(Token);
|
OPI_TypeConversion.GetLine(Token);
|
||||||
OPI_TypeConversion.GetLine(Quantity);
|
OPI_TypeConversion.GetLine(Count);
|
||||||
OPI_TypeConversion.GetLine(OffsetFromStart);
|
OPI_TypeConversion.GetLine(OffsetFromStart);
|
||||||
|
|
||||||
Headers = AuthorizationHeader(Token);
|
Headers = AuthorizationHeader(Token);
|
||||||
|
|
||||||
Parameters = New Structure;
|
Parameters = New Structure;
|
||||||
|
|
||||||
If ValueIsFilled(Quantity) Then
|
If ValueIsFilled(Count) Then
|
||||||
Parameters.Insert("limit", Quantity);
|
Parameters.Insert("limit", Count);
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
If ValueIsFilled(OffsetFromStart) Then
|
If ValueIsFilled(OffsetFromStart) Then
|
||||||
@@ -478,24 +478,24 @@ EndFunction
|
|||||||
// Parameters:
|
// Parameters:
|
||||||
// Token - String - Token - token
|
// Token - String - Token - token
|
||||||
// URL - String - Object address - url
|
// URL - String - Object address - url
|
||||||
// Quantity - Number - Number of returned nested objects (for catalog) - amount
|
// Count - Number - Number of returned nested objects (for catalog) - amount
|
||||||
// OffsetFromStart - Number - Offset for getting nested objects not from the beginning of the list - offset
|
// OffsetFromStart - Number - Offset for getting nested objects not from the beginning of the list - offset
|
||||||
//
|
//
|
||||||
// Returns:
|
// Returns:
|
||||||
// Key-Value Pair - serialized JSON response from Yandex
|
// Key-Value Pair - serialized JSON response from Yandex
|
||||||
Function GetPublicObject(Val Token, Val URL, Val Quantity = 0, Val OffsetFromStart = 0) Export
|
Function GetPublicObject(Val Token, Val URL, Val Count = 0, Val OffsetFromStart = 0) Export
|
||||||
|
|
||||||
OPI_TypeConversion.GetLine(Token);
|
OPI_TypeConversion.GetLine(Token);
|
||||||
OPI_TypeConversion.GetLine(URL);
|
OPI_TypeConversion.GetLine(URL);
|
||||||
OPI_TypeConversion.GetLine(Quantity);
|
OPI_TypeConversion.GetLine(Count);
|
||||||
OPI_TypeConversion.GetLine(OffsetFromStart);
|
OPI_TypeConversion.GetLine(OffsetFromStart);
|
||||||
|
|
||||||
Headers = AuthorizationHeader(Token);
|
Headers = AuthorizationHeader(Token);
|
||||||
|
|
||||||
Parameters = New Structure;
|
Parameters = New Structure;
|
||||||
|
|
||||||
If ValueIsFilled(Quantity) Then
|
If ValueIsFilled(Count) Then
|
||||||
Parameters.Insert("limit", OPI_Tools.NumberToString(Quantity));
|
Parameters.Insert("limit", OPI_Tools.NumberToString(Count));
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
If ValueIsFilled(OffsetFromStart) Then
|
If ValueIsFilled(OffsetFromStart) Then
|
||||||
|
@@ -1147,15 +1147,15 @@ EndProcedure
|
|||||||
Procedure YDisk_GetFileList() Export
|
Procedure YDisk_GetFileList() Export
|
||||||
|
|
||||||
Token = OPI_TestDataRetrieval.GetParameter("YandexDisk_Token");
|
Token = OPI_TestDataRetrieval.GetParameter("YandexDisk_Token");
|
||||||
Quantity = 2;
|
Count = 2;
|
||||||
Indent = 1;
|
Indent = 1;
|
||||||
|
|
||||||
Result = OPI_YandexDisk.GetFilesList(Token, Quantity, Indent, "image");
|
Result = OPI_YandexDisk.GetFilesList(Token, Count, Indent, "image");
|
||||||
|
|
||||||
OPI_TestDataRetrieval.WriteLog(Result, "GetFilesList");
|
OPI_TestDataRetrieval.WriteLog(Result, "GetFilesList");
|
||||||
|
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result).HasType("Map").Filled();
|
OPI_TestDataRetrieval.ExpectsThat(Result).HasType("Map").Filled();
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["limit"]).Equal(Quantity);
|
OPI_TestDataRetrieval.ExpectsThat(Result["limit"]).Equal(Count);
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["offset"]).Equal(Indent);
|
OPI_TestDataRetrieval.ExpectsThat(Result["offset"]).Equal(Indent);
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["items"]).HasType("Array");
|
OPI_TestDataRetrieval.ExpectsThat(Result["items"]).HasType("Array");
|
||||||
|
|
||||||
@@ -1253,15 +1253,15 @@ EndProcedure
|
|||||||
Procedure YDisk_GetPublishedList() Export
|
Procedure YDisk_GetPublishedList() Export
|
||||||
|
|
||||||
Token = OPI_TestDataRetrieval.GetParameter("YandexDisk_Token");
|
Token = OPI_TestDataRetrieval.GetParameter("YandexDisk_Token");
|
||||||
Quantity = 2;
|
Count = 2;
|
||||||
Indent = 1;
|
Indent = 1;
|
||||||
|
|
||||||
Result = OPI_YandexDisk.GetPublishedObjectsList(Token, Quantity, Indent);
|
Result = OPI_YandexDisk.GetPublishedObjectsList(Token, Count, Indent);
|
||||||
|
|
||||||
OPI_TestDataRetrieval.WriteLog(Result, "GetPublishedObjectsList");
|
OPI_TestDataRetrieval.WriteLog(Result, "GetPublishedObjectsList");
|
||||||
|
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result).HasType("Map").Filled();
|
OPI_TestDataRetrieval.ExpectsThat(Result).HasType("Map").Filled();
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["limit"]).Equal(Quantity);
|
OPI_TestDataRetrieval.ExpectsThat(Result["limit"]).Equal(Count);
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["offset"]).Equal(Indent);
|
OPI_TestDataRetrieval.ExpectsThat(Result["offset"]).Equal(Indent);
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["items"]).HasType("Array");
|
OPI_TestDataRetrieval.ExpectsThat(Result["items"]).HasType("Array");
|
||||||
|
|
||||||
@@ -2028,14 +2028,14 @@ Procedure GT_FillClearCells() Export
|
|||||||
OPI_TestDataRetrieval.WriteLog(Result, "SetCellValues");
|
OPI_TestDataRetrieval.WriteLog(Result, "SetCellValues");
|
||||||
|
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["spreadsheetId"]).Equal(Book);
|
OPI_TestDataRetrieval.ExpectsThat(Result["spreadsheetId"]).Equal(Book);
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["totalUpdatedCells"]).Equal(CellStructure.Quantity());
|
OPI_TestDataRetrieval.ExpectsThat(Result["totalUpdatedCells"]).Equal(CellStructure.Count());
|
||||||
|
|
||||||
Result = OPI_GoogleSheets.GetCellValues(Token, Book, CellsArray, Sheet);
|
Result = OPI_GoogleSheets.GetCellValues(Token, Book, CellsArray, Sheet);
|
||||||
|
|
||||||
OPI_TestDataRetrieval.WriteLog(Result, "GetCellValues");
|
OPI_TestDataRetrieval.WriteLog(Result, "GetCellValues");
|
||||||
|
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["spreadsheetId"]).Equal(Book);
|
OPI_TestDataRetrieval.ExpectsThat(Result["spreadsheetId"]).Equal(Book);
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["valueRanges"].Quantity()).Equal(CellsArray.Quantity());
|
OPI_TestDataRetrieval.ExpectsThat(Result["valueRanges"].Count()).Equal(CellsArray.Count());
|
||||||
|
|
||||||
Result = OPI_GoogleSheets.GetCellValues(Token, Book, , Sheet);
|
Result = OPI_GoogleSheets.GetCellValues(Token, Book, , Sheet);
|
||||||
|
|
||||||
@@ -2053,7 +2053,7 @@ Procedure GT_FillClearCells() Export
|
|||||||
OPI_TestDataRetrieval.WriteLog(Result, "ClearCells");
|
OPI_TestDataRetrieval.WriteLog(Result, "ClearCells");
|
||||||
|
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["spreadsheetId"]).Equal(Book);
|
OPI_TestDataRetrieval.ExpectsThat(Result["spreadsheetId"]).Equal(Book);
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["clearedRanges"].Quantity()).Equal(CellsArray.Quantity());
|
OPI_TestDataRetrieval.ExpectsThat(Result["clearedRanges"].Count()).Equal(CellsArray.Count());
|
||||||
|
|
||||||
EndProcedure
|
EndProcedure
|
||||||
|
|
||||||
@@ -3060,7 +3060,7 @@ Procedure AT_CreateDeleteRecords() Export
|
|||||||
OPI_TestDataRetrieval.WriteLog(Result, "CreatePosts");
|
OPI_TestDataRetrieval.WriteLog(Result, "CreatePosts");
|
||||||
|
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["records"]).HasType("Array");
|
OPI_TestDataRetrieval.ExpectsThat(Result["records"]).HasType("Array");
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["records"].Quantity()).Equal(2);
|
OPI_TestDataRetrieval.ExpectsThat(Result["records"].Count()).Equal(2);
|
||||||
|
|
||||||
For Each Record In Result["records"] Do
|
For Each Record In Result["records"] Do
|
||||||
ArrayOfDeletions.Add(Record["id"]);
|
ArrayOfDeletions.Add(Record["id"]);
|
||||||
@@ -3575,12 +3575,12 @@ Procedure Check_DropboxMetadata(Val Result, Val Path)
|
|||||||
|
|
||||||
EndProcedure
|
EndProcedure
|
||||||
|
|
||||||
Procedure Check_DropboxArray(Val Result, Val Quantity = Undefined)
|
Procedure Check_DropboxArray(Val Result, Val Count = Undefined)
|
||||||
|
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["entries"]).HasType("Array");
|
OPI_TestDataRetrieval.ExpectsThat(Result["entries"]).HasType("Array");
|
||||||
|
|
||||||
If Not Quantity = Undefined Then
|
If Not Count = Undefined Then
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["entries"].Quantity()).Equal(Quantity);
|
OPI_TestDataRetrieval.ExpectsThat(Result["entries"].Count()).Equal(Count);
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
EndProcedure
|
EndProcedure
|
||||||
@@ -3593,10 +3593,10 @@ Procedure Check_DropboxStatus(Val Result)
|
|||||||
OPI_TestDataRetrieval.ExpectsThat(Result[".tag"]).Equal("complete");
|
OPI_TestDataRetrieval.ExpectsThat(Result[".tag"]).Equal("complete");
|
||||||
EndProcedure
|
EndProcedure
|
||||||
|
|
||||||
Procedure Check_DropboxTags(Val Result, Val Quantity)
|
Procedure Check_DropboxTags(Val Result, Val Count)
|
||||||
|
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["paths_to_tags"]).HasType("Array");
|
OPI_TestDataRetrieval.ExpectsThat(Result["paths_to_tags"]).HasType("Array");
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["paths_to_tags"].Quantity()).Equal(Quantity);
|
OPI_TestDataRetrieval.ExpectsThat(Result["paths_to_tags"].Count()).Equal(Count);
|
||||||
|
|
||||||
EndProcedure
|
EndProcedure
|
||||||
|
|
||||||
@@ -5102,7 +5102,7 @@ Procedure Dropbox_GetTagList(FunctionParameters)
|
|||||||
|
|
||||||
OPI_TestDataRetrieval.WriteLog(Result, "GetTagList", "Dropbox");
|
OPI_TestDataRetrieval.WriteLog(Result, "GetTagList", "Dropbox");
|
||||||
|
|
||||||
Check_DropboxTags(Result, PathsArray.Quantity());
|
Check_DropboxTags(Result, PathsArray.Count());
|
||||||
|
|
||||||
Result = OPI_Dropbox.GetTagList(Token, "/New/mydoc.docx");
|
Result = OPI_Dropbox.GetTagList(Token, "/New/mydoc.docx");
|
||||||
|
|
||||||
|
@@ -244,7 +244,7 @@ Function FormYAXTests() Export
|
|||||||
|
|
||||||
For Each Section In Sections Do
|
For Each Section In Sections Do
|
||||||
|
|
||||||
CurrentSection = Section.TheKey;
|
CurrentSection = Section.Key;
|
||||||
Filter = New Structure("Section", CurrentSection);
|
Filter = New Structure("Section", CurrentSection);
|
||||||
SectionTests = TestTable.FindLines(Filter);
|
SectionTests = TestTable.FindLines(Filter);
|
||||||
|
|
||||||
|
@@ -44,9 +44,9 @@
|
|||||||
// https://creativecommons.org/licenses/by/4.0/legalcode
|
// https://creativecommons.org/licenses/by/4.0/legalcode
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
Function HMACSHA256(Val TheKey, Val Data) Export
|
Function HMACSHA256(Val Key, Val Data) Export
|
||||||
|
|
||||||
Return HMAC(TheKey, Data, HashFunction.SHA256, 64);
|
Return HMAC(Key, Data, HashFunction.SHA256, 64);
|
||||||
|
|
||||||
EndFunction
|
EndFunction
|
||||||
|
|
||||||
@@ -59,28 +59,28 @@ Function Hash(BinaryData, Type) Export
|
|||||||
|
|
||||||
EndFunction
|
EndFunction
|
||||||
|
|
||||||
Function HMAC(Val TheKey, Val Data, Type, BlockSize) Export
|
Function HMAC(Val Key, Val Data, Type, BlockSize) Export
|
||||||
|
|
||||||
Twice = 2;
|
Twice = 2;
|
||||||
|
|
||||||
If TheKey.Size() > BlockSize Then
|
If Key.Size() > BlockSize Then
|
||||||
TheKey = Hash(TheKey, Type);
|
Key = Hash(Key, Type);
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
If TheKey.Size() <= BlockSize Then
|
If Key.Size() <= BlockSize Then
|
||||||
TheKey = GetHexStringFromBinaryData(TheKey);
|
Key = GetHexStringFromBinaryData(Key);
|
||||||
TheKey = Left(TheKey + RepeatString("00", BlockSize), BlockSize * Twice);
|
Key = Left(Key + RepeatString("00", BlockSize), BlockSize * Twice);
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
TheKey = GetBinaryDataBufferFromBinaryData(GetBinaryDataFromHexString(TheKey));
|
Key = GetBinaryDataBufferFromBinaryData(GetBinaryDataFromHexString(Key));
|
||||||
|
|
||||||
Ipad = GetBinaryDataBufferFromHexString(RepeatString("36", BlockSize));
|
Ipad = GetBinaryDataBufferFromHexString(RepeatString("36", BlockSize));
|
||||||
Opad = GetBinaryDataBufferFromHexString(RepeatString("5c", BlockSize));
|
Opad = GetBinaryDataBufferFromHexString(RepeatString("5c", BlockSize));
|
||||||
|
|
||||||
Ipad.WriteBitwiseExclusiveOr(0, TheKey);
|
Ipad.WriteBitwiseExclusiveOr(0, Key);
|
||||||
Ikeypad = GetBinaryDataFromBinaryDataBuffer(ipad);
|
Ikeypad = GetBinaryDataFromBinaryDataBuffer(ipad);
|
||||||
|
|
||||||
Opad.WriteBitwiseExclusiveOr(0, TheKey);
|
Opad.WriteBitwiseExclusiveOr(0, Key);
|
||||||
Okeypad = GetBinaryDataFromBinaryDataBuffer(opad);
|
Okeypad = GetBinaryDataFromBinaryDataBuffer(opad);
|
||||||
|
|
||||||
Return Hash(UniteBinaryData(okeypad, Hash(UniteBinaryData(ikeypad, Data), Type)), Type);
|
Return Hash(UniteBinaryData(okeypad, Hash(UniteBinaryData(ikeypad, Data), Type)), Type);
|
||||||
@@ -97,11 +97,11 @@ Function UniteBinaryData(BinaryData1, BinaryData2) Export
|
|||||||
|
|
||||||
EndFunction
|
EndFunction
|
||||||
|
|
||||||
Function RepeatString(String, Quantity) Export
|
Function RepeatString(String, Count) Export
|
||||||
|
|
||||||
Parts = New Array(Quantity);
|
Parts = New Array(Count);
|
||||||
|
|
||||||
For K = 1 To Quantity Do
|
For K = 1 To Count Do
|
||||||
Parts.Add(String);
|
Parts.Add(String);
|
||||||
EndDo;
|
EndDo;
|
||||||
|
|
||||||
|
@@ -199,7 +199,7 @@ Function CreateRequest(Val Address, Val AdditionalHeaders = "", Val DataType = "
|
|||||||
If TypeOf(AdditionalHeaders) = Type("Map") Then
|
If TypeOf(AdditionalHeaders) = Type("Map") Then
|
||||||
|
|
||||||
For Each Title In AdditionalHeaders Do
|
For Each Title In AdditionalHeaders Do
|
||||||
Headers.Insert(Title.TheKey, Title.Value);
|
Headers.Insert(Title.Key, Title.Value);
|
||||||
EndDo;
|
EndDo;
|
||||||
|
|
||||||
EndIf;
|
EndIf;
|
||||||
@@ -229,7 +229,7 @@ EndFunction
|
|||||||
|
|
||||||
Function RequestParametersToString(Val Parameters) Export
|
Function RequestParametersToString(Val Parameters) Export
|
||||||
|
|
||||||
If Parameters.Quantity() = 0 Then
|
If Parameters.Count() = 0 Then
|
||||||
Return "";
|
Return "";
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
@@ -240,7 +240,7 @@ Function RequestParametersToString(Val Parameters) Export
|
|||||||
ParameterValue = ConvertParameterToString(Parameter.Value);
|
ParameterValue = ConvertParameterToString(Parameter.Value);
|
||||||
|
|
||||||
ParameterString = ParameterString
|
ParameterString = ParameterString
|
||||||
+ Parameter.TheKey
|
+ Parameter.Key
|
||||||
+ "="
|
+ "="
|
||||||
+ ParameterValue
|
+ ParameterValue
|
||||||
+ "&";
|
+ "&";
|
||||||
@@ -344,7 +344,7 @@ Function RequestParametersToMatch(Val ParameterString) Export
|
|||||||
|
|
||||||
KeyValueArray = StrSplit(Parameter, "=");
|
KeyValueArray = StrSplit(Parameter, "=");
|
||||||
|
|
||||||
If KeyValueArray.Quantity() = NumberOfParts Then
|
If KeyValueArray.Count() = NumberOfParts Then
|
||||||
ReturnMapping.Insert(KeyValueArray[0], KeyValueArray[1]);
|
ReturnMapping.Insert(KeyValueArray[0], KeyValueArray[1]);
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
@@ -453,7 +453,7 @@ Procedure ReplaceSpecialCharacters(Text, Markup = "Markdown") Export
|
|||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
For Each ArraySymbol In CharacterMapping Do
|
For Each ArraySymbol In CharacterMapping Do
|
||||||
Text = StrReplace(Text, ArraySymbol.TheKey, ArraySymbol.Value);
|
Text = StrReplace(Text, ArraySymbol.Key, ArraySymbol.Value);
|
||||||
EndDo;
|
EndDo;
|
||||||
|
|
||||||
EndProcedure
|
EndProcedure
|
||||||
@@ -849,7 +849,7 @@ Procedure WriteMultipartParameters(TextRecord, Val Boundary, Val Parameters)
|
|||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
TextRecord.WriteString("--" + boundary + LineSeparator);
|
TextRecord.WriteString("--" + boundary + LineSeparator);
|
||||||
TextRecord.WriteString("Content-Disposition: form-data; name=""" + Parameter.TheKey + """");
|
TextRecord.WriteString("Content-Disposition: form-data; name=""" + Parameter.Key + """");
|
||||||
TextRecord.WriteString(LineSeparator);
|
TextRecord.WriteString(LineSeparator);
|
||||||
TextRecord.WriteString(LineSeparator);
|
TextRecord.WriteString(LineSeparator);
|
||||||
|
|
||||||
@@ -883,14 +883,14 @@ Procedure WriteMultipartFiles(TextRecord, Val Boundary, Val ContentType, Val Fil
|
|||||||
|
|
||||||
For Each File In Files Do
|
For Each File In Files Do
|
||||||
|
|
||||||
FilePath = StrReplace(File.TheKey, DotReplacement, ".");
|
FilePath = StrReplace(File.Key, DotReplacement, ".");
|
||||||
|
|
||||||
If ContentType = "image/jpeg" Then
|
If ContentType = "image/jpeg" Then
|
||||||
SendingFileName = "photo";
|
SendingFileName = "photo";
|
||||||
Else
|
Else
|
||||||
SendingFileName = StrReplace(File.TheKey, DotReplacement, ".");
|
SendingFileName = StrReplace(File.Key, DotReplacement, ".");
|
||||||
SendingFileName = Left(SendingFileName, StrFind(SendingFileName, ".") - 1);
|
SendingFileName = Left(SendingFileName, StrFind(SendingFileName, ".") - 1);
|
||||||
SendingFileName = ?(ValueIsFilled(SendingFileName), SendingFileName, StrReplace(File.TheKey,
|
SendingFileName = ?(ValueIsFilled(SendingFileName), SendingFileName, StrReplace(File.Key,
|
||||||
DotReplacement, "."));
|
DotReplacement, "."));
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
@@ -930,7 +930,7 @@ Procedure WriteRelatedFiles(TextRecord, Val Boundary, Val Files)
|
|||||||
TextRecord.WriteString("Content-Type: " + File.Value);
|
TextRecord.WriteString("Content-Type: " + File.Value);
|
||||||
TextRecord.WriteString(LineSeparator);
|
TextRecord.WriteString(LineSeparator);
|
||||||
TextRecord.WriteString(LineSeparator);
|
TextRecord.WriteString(LineSeparator);
|
||||||
WriteBinaryData(TextRecord, File.TheKey);
|
WriteBinaryData(TextRecord, File.Key);
|
||||||
TextRecord.WriteString(LineSeparator);
|
TextRecord.WriteString(LineSeparator);
|
||||||
TextRecord.WriteString(LineSeparator);
|
TextRecord.WriteString(LineSeparator);
|
||||||
|
|
||||||
@@ -1006,7 +1006,7 @@ Procedure RemoveEmptyKeyValues(Val Collection, OutputCollection)
|
|||||||
For Each CollectionItem In Collection Do
|
For Each CollectionItem In Collection Do
|
||||||
|
|
||||||
If Not CollectionItem.Value = Undefined And Not CollectionItem.Value = NULL Then
|
If Not CollectionItem.Value = Undefined And Not CollectionItem.Value = NULL Then
|
||||||
OutputCollection.Insert(CollectionItem.TheKey, CollectionItem.Value);
|
OutputCollection.Insert(CollectionItem.Key, CollectionItem.Value);
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
EndDo;
|
EndDo;
|
||||||
|
@@ -114,7 +114,7 @@ Function CreateDatabase(Val Token, Val Workspace, Val Name, Val TableCollection)
|
|||||||
|
|
||||||
For Each Table In TableCollection Do
|
For Each Table In TableCollection Do
|
||||||
|
|
||||||
Description = GenerateTableDescription(Table.TheKey, Table.Value);
|
Description = GenerateTableDescription(Table.Key, Table.Value);
|
||||||
TableArray.Add(Description);
|
TableArray.Add(Description);
|
||||||
|
|
||||||
EndDo;
|
EndDo;
|
||||||
|
@@ -44,9 +44,9 @@
|
|||||||
// https://creativecommons.org/licenses/by/4.0/legalcode
|
// https://creativecommons.org/licenses/by/4.0/legalcode
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
Function HMACSHA256(Val TheKey, Val Data) Export
|
Function HMACSHA256(Val Key, Val Data) Export
|
||||||
|
|
||||||
Return HMAC(TheKey, Data, HashFunction.SHA256, 64);
|
Return HMAC(Key, Data, HashFunction.SHA256, 64);
|
||||||
|
|
||||||
EndFunction
|
EndFunction
|
||||||
|
|
||||||
@@ -59,28 +59,28 @@ Function Hash(BinaryData, Type) Export
|
|||||||
|
|
||||||
EndFunction
|
EndFunction
|
||||||
|
|
||||||
Function HMAC(Val TheKey, Val Data, Type, BlockSize) Export
|
Function HMAC(Val Key, Val Data, Type, BlockSize) Export
|
||||||
|
|
||||||
Twice = 2;
|
Twice = 2;
|
||||||
|
|
||||||
If TheKey.Size() > BlockSize Then
|
If Key.Size() > BlockSize Then
|
||||||
TheKey = Hash(TheKey, Type);
|
Key = Hash(Key, Type);
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
If TheKey.Size() <= BlockSize Then
|
If Key.Size() <= BlockSize Then
|
||||||
TheKey = GetHexStringFromBinaryData(TheKey);
|
Key = GetHexStringFromBinaryData(Key);
|
||||||
TheKey = Left(TheKey + RepeatString("00", BlockSize), BlockSize * Twice);
|
Key = Left(Key + RepeatString("00", BlockSize), BlockSize * Twice);
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
TheKey = GetBinaryDataBufferFromBinaryData(GetBinaryDataFromHexString(TheKey));
|
Key = GetBinaryDataBufferFromBinaryData(GetBinaryDataFromHexString(Key));
|
||||||
|
|
||||||
Ipad = GetBinaryDataBufferFromHexString(RepeatString("36", BlockSize));
|
Ipad = GetBinaryDataBufferFromHexString(RepeatString("36", BlockSize));
|
||||||
Opad = GetBinaryDataBufferFromHexString(RepeatString("5c", BlockSize));
|
Opad = GetBinaryDataBufferFromHexString(RepeatString("5c", BlockSize));
|
||||||
|
|
||||||
Ipad.WriteBitwiseExclusiveOr(0, TheKey);
|
Ipad.WriteBitwiseExclusiveOr(0, Key);
|
||||||
Ikeypad = GetBinaryDataFromBinaryDataBuffer(ipad);
|
Ikeypad = GetBinaryDataFromBinaryDataBuffer(ipad);
|
||||||
|
|
||||||
Opad.WriteBitwiseExclusiveOr(0, TheKey);
|
Opad.WriteBitwiseExclusiveOr(0, Key);
|
||||||
Okeypad = GetBinaryDataFromBinaryDataBuffer(opad);
|
Okeypad = GetBinaryDataFromBinaryDataBuffer(opad);
|
||||||
|
|
||||||
Return Hash(UniteBinaryData(okeypad, Hash(UniteBinaryData(ikeypad, Data), Type)), Type);
|
Return Hash(UniteBinaryData(okeypad, Hash(UniteBinaryData(ikeypad, Data), Type)), Type);
|
||||||
@@ -97,11 +97,11 @@ Function UniteBinaryData(BinaryData1, BinaryData2) Export
|
|||||||
|
|
||||||
EndFunction
|
EndFunction
|
||||||
|
|
||||||
Function RepeatString(String, Quantity) Export
|
Function RepeatString(String, Count) Export
|
||||||
|
|
||||||
Parts = New Array(Quantity);
|
Parts = New Array(Count);
|
||||||
|
|
||||||
For K = 1 To Quantity Do
|
For K = 1 To Count Do
|
||||||
Parts.Add(String);
|
Parts.Add(String);
|
||||||
EndDo;
|
EndDo;
|
||||||
|
|
||||||
|
@@ -467,17 +467,17 @@ EndFunction
|
|||||||
// Parameters:
|
// Parameters:
|
||||||
// Token - String - Token - token
|
// Token - String - Token - token
|
||||||
// Path - String - Path to the object - path
|
// Path - String - Path to the object - path
|
||||||
// Quantity - String, Number - Number of the latest versions of the object to display - amount
|
// Count - String, Number - Number of the latest versions of the object to display - amount
|
||||||
//
|
//
|
||||||
// Returns:
|
// Returns:
|
||||||
// Key-Value Pair - serialized JSON response from Dropbox
|
// Key-Value Pair - serialized JSON response from Dropbox
|
||||||
Function GetObjectVersionList(Val Token, Val Path, Val Quantity = 10) Export
|
Function GetObjectVersionList(Val Token, Val Path, Val Count = 10) Export
|
||||||
|
|
||||||
URL = "https://api.dropboxapi.com/2/files/list_revisions";
|
URL = "https://api.dropboxapi.com/2/files/list_revisions";
|
||||||
|
|
||||||
Parameters = New Structure;
|
Parameters = New Structure;
|
||||||
OPI_Tools.AddField("path" , Path , "String", Parameters);
|
OPI_Tools.AddField("path" , Path , "String", Parameters);
|
||||||
OPI_Tools.AddField("limit", Quantity, "Number" , Parameters);
|
OPI_Tools.AddField("limit", Count, "Number" , Parameters);
|
||||||
|
|
||||||
Headers = GetRequestHeaders(Token);
|
Headers = GetRequestHeaders(Token);
|
||||||
Response = OPI_Tools.Post(URL, Parameters, Headers);
|
Response = OPI_Tools.Post(URL, Parameters, Headers);
|
||||||
|
@@ -323,7 +323,7 @@ Function GetEventDescription() Export
|
|||||||
Event.Insert("Venue" , ""); // String description of the venue of the event
|
Event.Insert("Venue" , ""); // String description of the venue of the event
|
||||||
Event.Insert("StartDate" , CurrentDate); // Date of start events
|
Event.Insert("StartDate" , CurrentDate); // Date of start events
|
||||||
Event.Insert("EndDate" , CurrentDate + Hour); // Date of end events
|
Event.Insert("EndDate" , CurrentDate + Hour); // Date of end events
|
||||||
Event.Insert("ArrayOfAttachmentURLs", New Map); // TheKey - name, Value - URL to file
|
Event.Insert("ArrayOfAttachmentURLs", New Map); // Key - name, Value - URL to file
|
||||||
Event.Insert("SendNotifications" , True); // Indication of sending notifications to participants
|
Event.Insert("SendNotifications" , True); // Indication of sending notifications to participants
|
||||||
|
|
||||||
Return Event;
|
Return Event;
|
||||||
@@ -513,7 +513,7 @@ Function ConvertAttachments(Val Attachments)
|
|||||||
For Each Attachment In Attachments Do
|
For Each Attachment In Attachments Do
|
||||||
|
|
||||||
CurrentAttachment = New Structure;
|
CurrentAttachment = New Structure;
|
||||||
CurrentAttachment.Insert("title" , Attachment.TheKey);
|
CurrentAttachment.Insert("title" , Attachment.Key);
|
||||||
CurrentAttachment.Insert("fileUrl", Attachment.Value);
|
CurrentAttachment.Insert("fileUrl", Attachment.Value);
|
||||||
|
|
||||||
AttachmentsArray.Add(CurrentAttachment);
|
AttachmentsArray.Add(CurrentAttachment);
|
||||||
@@ -522,7 +522,7 @@ Function ConvertAttachments(Val Attachments)
|
|||||||
|
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
If AttachmentsArray.Quantity() > 0 Then
|
If AttachmentsArray.Count() > 0 Then
|
||||||
Return AttachmentsArray;
|
Return AttachmentsArray;
|
||||||
Else
|
Else
|
||||||
Return Undefined;
|
Return Undefined;
|
||||||
@@ -599,7 +599,7 @@ Procedure GetCalendarsListRecursively(Val Headers, ArrayOfCalendars, Page = "")
|
|||||||
ArrayOfCalendars.Add(Calendar);
|
ArrayOfCalendars.Add(Calendar);
|
||||||
EndDo;
|
EndDo;
|
||||||
|
|
||||||
If Calendars.Quantity() > 0 And ValueIsFilled(Page) Then
|
If Calendars.Count() > 0 And ValueIsFilled(Page) Then
|
||||||
GetCalendarsListRecursively(Headers, ArrayOfCalendars, Page);
|
GetCalendarsListRecursively(Headers, ArrayOfCalendars, Page);
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
@@ -626,7 +626,7 @@ Procedure GetEventsListRecursively(Val Headers, Val Calendar, ArrayOfEvents, Pag
|
|||||||
ArrayOfEvents.Add(Event);
|
ArrayOfEvents.Add(Event);
|
||||||
EndDo;
|
EndDo;
|
||||||
|
|
||||||
If Events.Quantity() > 0 And ValueIsFilled(Page) Then
|
If Events.Count() > 0 And ValueIsFilled(Page) Then
|
||||||
GetEventsListRecursively(Headers, ArrayOfEvents, Page);
|
GetEventsListRecursively(Headers, ArrayOfEvents, Page);
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
|
@@ -456,7 +456,7 @@ Procedure GetObjectsListRecursively(Val Headers, ArrayOfObjects, Detailed = Fals
|
|||||||
ArrayOfObjects.Add(CurrentObject);
|
ArrayOfObjects.Add(CurrentObject);
|
||||||
EndDo;
|
EndDo;
|
||||||
|
|
||||||
If Objects.Quantity() > 0 And ValueIsFilled(Page) Then
|
If Objects.Count() > 0 And ValueIsFilled(Page) Then
|
||||||
GetObjectsListRecursively(Headers, ArrayOfObjects, Detailed, Filter, Page);
|
GetObjectsListRecursively(Headers, ArrayOfObjects, Detailed, Filter, Page);
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
@@ -495,7 +495,7 @@ Procedure FormFileUploadParameters(Description)
|
|||||||
|
|
||||||
For Each Element In Description Do
|
For Each Element In Description Do
|
||||||
|
|
||||||
If Element.TheKey = "Parent" Then
|
If Element.Key = "Parent" Then
|
||||||
|
|
||||||
CurrentValue = New Array;
|
CurrentValue = New Array;
|
||||||
CurrentValue.Add(Element.Value);
|
CurrentValue.Add(Element.Value);
|
||||||
@@ -506,7 +506,7 @@ Procedure FormFileUploadParameters(Description)
|
|||||||
|
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
FieldName = FieldMapping.Get(Element.TheKey);
|
FieldName = FieldMapping.Get(Element.Key);
|
||||||
FormedDescription.Insert(FieldName, CurrentValue);
|
FormedDescription.Insert(FieldName, CurrentValue);
|
||||||
|
|
||||||
EndDo;
|
EndDo;
|
||||||
@@ -581,7 +581,7 @@ EndFunction
|
|||||||
Function UploadLargeFile(Val Description, Val FileMapping, Val Headers, Val Identifier = "")
|
Function UploadLargeFile(Val Description, Val FileMapping, Val Headers, Val Identifier = "")
|
||||||
|
|
||||||
For Each File In FileMapping Do
|
For Each File In FileMapping Do
|
||||||
Binary = File.TheKey;
|
Binary = File.Key;
|
||||||
Break;
|
Break;
|
||||||
EndDo;
|
EndDo;
|
||||||
|
|
||||||
@@ -709,7 +709,7 @@ Function CheckPartUpload(Response, StrTotalSize, AdditionalHeaders, UploadURL, C
|
|||||||
ArrayOfInformation = StrSplit(UploadedData, "-", False);
|
ArrayOfInformation = StrSplit(UploadedData, "-", False);
|
||||||
PartsRequired = 2;
|
PartsRequired = 2;
|
||||||
|
|
||||||
If Not ArrayOfInformation.Quantity() = PartsRequired Then
|
If Not ArrayOfInformation.Count() = PartsRequired Then
|
||||||
OPI_Tools.ProcessResponse(Response);
|
OPI_Tools.ProcessResponse(Response);
|
||||||
Return Response;
|
Return Response;
|
||||||
EndIf;
|
EndIf;
|
||||||
|
@@ -377,7 +377,7 @@ Function FormCellDataArray(Val ValueStructure, Val MajorDimension, Val Sheet)
|
|||||||
For Each CellData In ValueStructure Do
|
For Each CellData In ValueStructure Do
|
||||||
|
|
||||||
CurrentValue = CellData.Value;
|
CurrentValue = CellData.Value;
|
||||||
CurrentKey = CellData.TheKey;
|
CurrentKey = CellData.Key;
|
||||||
|
|
||||||
AddSheetName(CurrentKey, Sheet);
|
AddSheetName(CurrentKey, Sheet);
|
||||||
|
|
||||||
|
@@ -224,7 +224,7 @@ Function CreateDatabase(Val Token, Val Parent, Val Title, Val Properties = "") E
|
|||||||
// Name : title
|
// Name : title
|
||||||
// Description : rich_text
|
// Description : rich_text
|
||||||
// InProgress : checkbox
|
// InProgress : checkbox
|
||||||
// Quantity : number
|
// Count : number
|
||||||
// Date : date
|
// Date : date
|
||||||
// Status : Map
|
// Status : Map
|
||||||
// Аtoтиinный : green
|
// Аtoтиinный : green
|
||||||
@@ -587,7 +587,7 @@ EndProcedure
|
|||||||
|
|
||||||
Procedure AddDatabaseProperties(Val Properties, MainStructure)
|
Procedure AddDatabaseProperties(Val Properties, MainStructure)
|
||||||
|
|
||||||
If Properties.Quantity() = 0 Then
|
If Properties.Count() = 0 Then
|
||||||
MainStructure.Insert("properties", New Structure);
|
MainStructure.Insert("properties", New Structure);
|
||||||
Return;
|
Return;
|
||||||
EndIf;
|
EndIf;
|
||||||
@@ -598,17 +598,17 @@ Procedure AddDatabaseProperties(Val Properties, MainStructure)
|
|||||||
|
|
||||||
If TypeOf(Property.Value) = Type("String") Then
|
If TypeOf(Property.Value) = Type("String") Then
|
||||||
|
|
||||||
ParameterMap.Insert(Property.TheKey, New Structure(Property.Value, New Structure));
|
ParameterMap.Insert(Property.Key, New Structure(Property.Value, New Structure));
|
||||||
|
|
||||||
ElsIf TypeOf(Property.Value) = Type("Structure")
|
ElsIf TypeOf(Property.Value) = Type("Structure")
|
||||||
Or TypeOf(Property.Value) = Type("Map") Then
|
Or TypeOf(Property.Value) = Type("Map") Then
|
||||||
|
|
||||||
ValueSelection = FormSelectionValues(Property.Value);
|
ValueSelection = FormSelectionValues(Property.Value);
|
||||||
ParameterMap.Insert(Property.TheKey, New Structure("select", ValueSelection));
|
ParameterMap.Insert(Property.Key, New Structure("select", ValueSelection));
|
||||||
|
|
||||||
Else
|
Else
|
||||||
|
|
||||||
ParameterMap.Insert(Property.TheKey, Property.Value);
|
ParameterMap.Insert(Property.Key, Property.Value);
|
||||||
|
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
@@ -625,7 +625,7 @@ Function FormSelectionValues(Val VariantStructure)
|
|||||||
For Each Option In VariantStructure Do
|
For Each Option In VariantStructure Do
|
||||||
|
|
||||||
OptionMap = New Map;
|
OptionMap = New Map;
|
||||||
OptionMap.Insert("name" , Option.TheKey);
|
OptionMap.Insert("name" , Option.Key);
|
||||||
OptionMap.Insert("color", Option.Value);
|
OptionMap.Insert("color", Option.Value);
|
||||||
|
|
||||||
OptionArray.Add(OptionMap);
|
OptionArray.Add(OptionMap);
|
||||||
@@ -654,7 +654,7 @@ Function FillDataBySchema(Val Scheme, Val Data, Val Token, Val ThisIsBase = True
|
|||||||
FieldData = Field.Value;
|
FieldData = Field.Value;
|
||||||
FieldType = FieldData["type"];
|
FieldType = FieldData["type"];
|
||||||
|
|
||||||
FillableData = Data.Get(Field.TheKey);
|
FillableData = Data.Get(Field.Key);
|
||||||
|
|
||||||
If FillableData = Undefined Then
|
If FillableData = Undefined Then
|
||||||
Continue;
|
Continue;
|
||||||
@@ -860,7 +860,7 @@ Function ConvertFiles(Val FileMapping)
|
|||||||
|
|
||||||
FileStructure = New Structure;
|
FileStructure = New Structure;
|
||||||
FileStructure.Insert("type" , "external");
|
FileStructure.Insert("type" , "external");
|
||||||
FileStructure.Insert("name" , File.TheKey);
|
FileStructure.Insert("name" , File.Key);
|
||||||
FileStructure.Insert("external", New Structure("url", File.Value));
|
FileStructure.Insert("external", New Structure("url", File.Value));
|
||||||
|
|
||||||
ArrayOfFiles.Add(FileStructure);
|
ArrayOfFiles.Add(FileStructure);
|
||||||
|
@@ -179,34 +179,34 @@ Function ProcessTMAData(Val DataString, Val Token) Export
|
|||||||
|
|
||||||
DataString = DecodeString(DataString, StringEncodingMethod.URLencoding);
|
DataString = DecodeString(DataString, StringEncodingMethod.URLencoding);
|
||||||
DataStructure = OPI_Tools.RequestParametersToMatch(DataString);
|
DataStructure = OPI_Tools.RequestParametersToMatch(DataString);
|
||||||
TheKey = "WebAppData";
|
Key = "WebAppData";
|
||||||
Hash = "";
|
Hash = "";
|
||||||
BinaryKey = GetBinaryDataFromString(TheKey);
|
BinaryKey = GetBinaryDataFromString(Key);
|
||||||
|
|
||||||
Result = OPI_Cryptography.HMACSHA256(BinaryKey, GetBinaryDataFromString(Token));
|
Result = OPI_Cryptography.HMACSHA256(BinaryKey, GetBinaryDataFromString(Token));
|
||||||
|
|
||||||
TValue = New ValueTable;
|
TValue = New ValueTable;
|
||||||
TValue.Columns.Add("TheKey");
|
TValue.Columns.Add("Key");
|
||||||
TValue.Columns.Add("Value");
|
TValue.Columns.Add("Value");
|
||||||
|
|
||||||
For Each Data In DataStructure Do
|
For Each Data In DataStructure Do
|
||||||
|
|
||||||
NewLine = TValue.Add();
|
NewLine = TValue.Add();
|
||||||
NewLine.TheKey = Data.TheKey;
|
NewLine.Key = Data.Key;
|
||||||
NewLine.Value = Data.Value;
|
NewLine.Value = Data.Value;
|
||||||
|
|
||||||
EndDo;
|
EndDo;
|
||||||
|
|
||||||
TValue.Sort("TheKey");
|
TValue.Sort("Key");
|
||||||
|
|
||||||
ReturnMapping = New Map;
|
ReturnMapping = New Map;
|
||||||
DCS = "";
|
DCS = "";
|
||||||
|
|
||||||
For Each DataString In TValue Do
|
For Each DataString In TValue Do
|
||||||
|
|
||||||
If DataString.TheKey <> "hash" Then
|
If DataString.Key <> "hash" Then
|
||||||
DCS = DCS + DataString.TheKey + "=" + DataString.Value + Chars.PS;
|
DCS = DCS + DataString.Key + "=" + DataString.Value + Chars.PS;
|
||||||
ReturnMapping.Insert(DataString.TheKey, DataString.Value);
|
ReturnMapping.Insert(DataString.Key, DataString.Value);
|
||||||
Else
|
Else
|
||||||
Hash = DataString.Value;
|
Hash = DataString.Value;
|
||||||
EndIf;
|
EndIf;
|
||||||
@@ -410,7 +410,7 @@ Function SendMediaGroup(Val Token
|
|||||||
, Val Markup = "Markdown") Export
|
, Val Markup = "Markdown") Export
|
||||||
|
|
||||||
// FileMapping
|
// FileMapping
|
||||||
// TheKey - File, Value - Type
|
// Key - File, Value - Type
|
||||||
// Types: audio, document, photo, video
|
// Types: audio, document, photo, video
|
||||||
// Different types cannot be mixed!
|
// Different types cannot be mixed!
|
||||||
|
|
||||||
@@ -1165,12 +1165,12 @@ Procedure FormMediaArray(Val FileMapping, Val Text, FileStructure, Media)
|
|||||||
|
|
||||||
For Each CurrentFile In FileMapping Do
|
For Each CurrentFile In FileMapping Do
|
||||||
|
|
||||||
If Not TypeOf(CurrentFile.TheKey) = Type("BinaryData") Then
|
If Not TypeOf(CurrentFile.Key) = Type("BinaryData") Then
|
||||||
|
|
||||||
Binary = CurrentFile.TheKey;
|
Binary = CurrentFile.Key;
|
||||||
OPI_TypeConversion.GetBinaryData(Binary);
|
OPI_TypeConversion.GetBinaryData(Binary);
|
||||||
|
|
||||||
ThisFile = New File(CurrentFile.TheKey);
|
ThisFile = New File(CurrentFile.Key);
|
||||||
MediaName = CurrentFile.Value
|
MediaName = CurrentFile.Value
|
||||||
+ String(Counter)
|
+ String(Counter)
|
||||||
+ ?(CurrentFile.Value = "document", ThisFile.Extension, "");
|
+ ?(CurrentFile.Value = "document", ThisFile.Extension, "");
|
||||||
@@ -1178,7 +1178,7 @@ Procedure FormMediaArray(Val FileMapping, Val Text, FileStructure, Media)
|
|||||||
FullMediaName = StrReplace(MediaName, ".", "___");
|
FullMediaName = StrReplace(MediaName, ".", "___");
|
||||||
|
|
||||||
Else
|
Else
|
||||||
Binary = CurrentFile.TheKey;
|
Binary = CurrentFile.Key;
|
||||||
MediaName = CurrentFile.Value + String(Counter);
|
MediaName = CurrentFile.Value + String(Counter);
|
||||||
FullMediaName = MediaName;
|
FullMediaName = MediaName;
|
||||||
EndIf;
|
EndIf;
|
||||||
@@ -1208,7 +1208,7 @@ Procedure AddChatIdentifier(Val ChatID, Parameters)
|
|||||||
ChatID = OPI_Tools.NumberToString(ChatID);
|
ChatID = OPI_Tools.NumberToString(ChatID);
|
||||||
ChatArray = StrSplit(ChatID, "*", False);
|
ChatArray = StrSplit(ChatID, "*", False);
|
||||||
|
|
||||||
If ChatArray.Quantity() > 1 Then
|
If ChatArray.Count() > 1 Then
|
||||||
|
|
||||||
ChatID = ChatArray[0];
|
ChatID = ChatArray[0];
|
||||||
ThreadID = ChatArray[1];
|
ThreadID = ChatArray[1];
|
||||||
|
@@ -244,7 +244,7 @@ Function FormYAXTests() Export
|
|||||||
|
|
||||||
For Each Section In Sections Do
|
For Each Section In Sections Do
|
||||||
|
|
||||||
CurrentSection = Section.TheKey;
|
CurrentSection = Section.Key;
|
||||||
Filter = New Structure("Section", CurrentSection);
|
Filter = New Structure("Section", CurrentSection);
|
||||||
SectionTests = TestTable.FindLines(Filter);
|
SectionTests = TestTable.FindLines(Filter);
|
||||||
|
|
||||||
|
@@ -1147,15 +1147,15 @@ EndProcedure
|
|||||||
Procedure YDisk_GetFileList() Export
|
Procedure YDisk_GetFileList() Export
|
||||||
|
|
||||||
Token = OPI_TestDataRetrieval.GetParameter("YandexDisk_Token");
|
Token = OPI_TestDataRetrieval.GetParameter("YandexDisk_Token");
|
||||||
Quantity = 2;
|
Count = 2;
|
||||||
Indent = 1;
|
Indent = 1;
|
||||||
|
|
||||||
Result = OPI_YandexDisk.GetFilesList(Token, Quantity, Indent, "image");
|
Result = OPI_YandexDisk.GetFilesList(Token, Count, Indent, "image");
|
||||||
|
|
||||||
// !OInt OPI_TestDataRetrieval.WriteLog(Result, "GetFileList");
|
// !OInt OPI_TestDataRetrieval.WriteLog(Result, "GetFileList");
|
||||||
|
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result).HasType("Map").Filled();
|
OPI_TestDataRetrieval.ExpectsThat(Result).HasType("Map").Filled();
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["limit"]).Equal(Quantity);
|
OPI_TestDataRetrieval.ExpectsThat(Result["limit"]).Equal(Count);
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["offset"]).Equal(Indent);
|
OPI_TestDataRetrieval.ExpectsThat(Result["offset"]).Equal(Indent);
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["items"]).HasType("Array");
|
OPI_TestDataRetrieval.ExpectsThat(Result["items"]).HasType("Array");
|
||||||
|
|
||||||
@@ -1253,15 +1253,15 @@ EndProcedure
|
|||||||
Procedure YDisk_GetPublishedList() Export
|
Procedure YDisk_GetPublishedList() Export
|
||||||
|
|
||||||
Token = OPI_TestDataRetrieval.GetParameter("YandexDisk_Token");
|
Token = OPI_TestDataRetrieval.GetParameter("YandexDisk_Token");
|
||||||
Quantity = 2;
|
Count = 2;
|
||||||
Indent = 1;
|
Indent = 1;
|
||||||
|
|
||||||
Result = OPI_YandexDisk.GetPublishedObjectsList(Token, Quantity, Indent);
|
Result = OPI_YandexDisk.GetPublishedObjectsList(Token, Count, Indent);
|
||||||
|
|
||||||
// !OInt OPI_TestDataRetrieval.WriteLog(Result, "GetPublishedObjectList");
|
// !OInt OPI_TestDataRetrieval.WriteLog(Result, "GetPublishedObjectList");
|
||||||
|
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result).HasType("Map").Filled();
|
OPI_TestDataRetrieval.ExpectsThat(Result).HasType("Map").Filled();
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["limit"]).Equal(Quantity);
|
OPI_TestDataRetrieval.ExpectsThat(Result["limit"]).Equal(Count);
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["offset"]).Equal(Indent);
|
OPI_TestDataRetrieval.ExpectsThat(Result["offset"]).Equal(Indent);
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["items"]).HasType("Array");
|
OPI_TestDataRetrieval.ExpectsThat(Result["items"]).HasType("Array");
|
||||||
|
|
||||||
@@ -2028,14 +2028,14 @@ Procedure GT_FillClearCells() Export
|
|||||||
// !OInt OPI_TestDataRetrieval.WriteLog(Result, "SetCellValues");
|
// !OInt OPI_TestDataRetrieval.WriteLog(Result, "SetCellValues");
|
||||||
|
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["spreadsheetId"]).Equal(Book);
|
OPI_TestDataRetrieval.ExpectsThat(Result["spreadsheetId"]).Equal(Book);
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["totalUpdatedCells"]).Equal(CellStructure.Quantity());
|
OPI_TestDataRetrieval.ExpectsThat(Result["totalUpdatedCells"]).Equal(CellStructure.Count());
|
||||||
|
|
||||||
Result = OPI_GoogleSheets.GetCellValues(Token, Book, CellsArray, Sheet);
|
Result = OPI_GoogleSheets.GetCellValues(Token, Book, CellsArray, Sheet);
|
||||||
|
|
||||||
// !OInt OPI_TestDataRetrieval.WriteLog(Result, "GetCellValues");
|
// !OInt OPI_TestDataRetrieval.WriteLog(Result, "GetCellValues");
|
||||||
|
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["spreadsheetId"]).Equal(Book);
|
OPI_TestDataRetrieval.ExpectsThat(Result["spreadsheetId"]).Equal(Book);
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["valueRanges"].Quantity()).Equal(CellsArray.Quantity());
|
OPI_TestDataRetrieval.ExpectsThat(Result["valueRanges"].Count()).Equal(CellsArray.Count());
|
||||||
|
|
||||||
Result = OPI_GoogleSheets.GetCellValues(Token, Book, , Sheet);
|
Result = OPI_GoogleSheets.GetCellValues(Token, Book, , Sheet);
|
||||||
|
|
||||||
@@ -2053,7 +2053,7 @@ Procedure GT_FillClearCells() Export
|
|||||||
// !OInt OPI_TestDataRetrieval.WriteLog(Result, "ClearCells");
|
// !OInt OPI_TestDataRetrieval.WriteLog(Result, "ClearCells");
|
||||||
|
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["spreadsheetId"]).Equal(Book);
|
OPI_TestDataRetrieval.ExpectsThat(Result["spreadsheetId"]).Equal(Book);
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["clearedRanges"].Quantity()).Equal(CellsArray.Quantity());
|
OPI_TestDataRetrieval.ExpectsThat(Result["clearedRanges"].Count()).Equal(CellsArray.Count());
|
||||||
|
|
||||||
EndProcedure
|
EndProcedure
|
||||||
|
|
||||||
@@ -3060,7 +3060,7 @@ Procedure AT_CreateDeleteRecords() Export
|
|||||||
// !OInt OPI_TestDataRetrieval.WriteLog(Result, "CreateRecords");
|
// !OInt OPI_TestDataRetrieval.WriteLog(Result, "CreateRecords");
|
||||||
|
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["records"]).HasType("Array");
|
OPI_TestDataRetrieval.ExpectsThat(Result["records"]).HasType("Array");
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["records"].Quantity()).Equal(2);
|
OPI_TestDataRetrieval.ExpectsThat(Result["records"].Count()).Equal(2);
|
||||||
|
|
||||||
For Each Record In Result["records"] Do
|
For Each Record In Result["records"] Do
|
||||||
ArrayOfDeletions.Add(Record["id"]);
|
ArrayOfDeletions.Add(Record["id"]);
|
||||||
@@ -3575,12 +3575,12 @@ Procedure Check_DropboxMetadata(Val Result, Val Path)
|
|||||||
|
|
||||||
EndProcedure
|
EndProcedure
|
||||||
|
|
||||||
Procedure Check_DropboxArray(Val Result, Val Quantity = Undefined)
|
Procedure Check_DropboxArray(Val Result, Val Count = Undefined)
|
||||||
|
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["entries"]).HasType("Array");
|
OPI_TestDataRetrieval.ExpectsThat(Result["entries"]).HasType("Array");
|
||||||
|
|
||||||
If Not Quantity = Undefined Then
|
If Not Count = Undefined Then
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["entries"].Quantity()).Equal(Quantity);
|
OPI_TestDataRetrieval.ExpectsThat(Result["entries"].Count()).Equal(Count);
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
EndProcedure
|
EndProcedure
|
||||||
@@ -3593,10 +3593,10 @@ Procedure Check_DropboxStatus(Val Result)
|
|||||||
OPI_TestDataRetrieval.ExpectsThat(Result[".tag"]).Equal("complete");
|
OPI_TestDataRetrieval.ExpectsThat(Result[".tag"]).Equal("complete");
|
||||||
EndProcedure
|
EndProcedure
|
||||||
|
|
||||||
Procedure Check_DropboxTags(Val Result, Val Quantity)
|
Procedure Check_DropboxTags(Val Result, Val Count)
|
||||||
|
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["paths_to_tags"]).HasType("Array");
|
OPI_TestDataRetrieval.ExpectsThat(Result["paths_to_tags"]).HasType("Array");
|
||||||
OPI_TestDataRetrieval.ExpectsThat(Result["paths_to_tags"].Quantity()).Equal(Quantity);
|
OPI_TestDataRetrieval.ExpectsThat(Result["paths_to_tags"].Count()).Equal(Count);
|
||||||
|
|
||||||
EndProcedure
|
EndProcedure
|
||||||
|
|
||||||
@@ -5102,7 +5102,7 @@ Procedure Dropbox_GetTagList(FunctionParameters)
|
|||||||
|
|
||||||
// !OInt OPI_TestDataRetrieval.WriteLog(Result, "GetTagList", "Dropbox");
|
// !OInt OPI_TestDataRetrieval.WriteLog(Result, "GetTagList", "Dropbox");
|
||||||
|
|
||||||
Check_DropboxTags(Result, PathsArray.Quantity());
|
Check_DropboxTags(Result, PathsArray.Count());
|
||||||
|
|
||||||
Result = OPI_Dropbox.GetTagList(Token, "/New/mydoc.docx");
|
Result = OPI_Dropbox.GetTagList(Token, "/New/mydoc.docx");
|
||||||
|
|
||||||
|
@@ -199,7 +199,7 @@ Function CreateRequest(Val Address, Val AdditionalHeaders = "", Val DataType = "
|
|||||||
If TypeOf(AdditionalHeaders) = Type("Map") Then
|
If TypeOf(AdditionalHeaders) = Type("Map") Then
|
||||||
|
|
||||||
For Each Title In AdditionalHeaders Do
|
For Each Title In AdditionalHeaders Do
|
||||||
Headers.Insert(Title.TheKey, Title.Value);
|
Headers.Insert(Title.Key, Title.Value);
|
||||||
EndDo;
|
EndDo;
|
||||||
|
|
||||||
EndIf;
|
EndIf;
|
||||||
@@ -229,7 +229,7 @@ EndFunction
|
|||||||
|
|
||||||
Function RequestParametersToString(Val Parameters) Export
|
Function RequestParametersToString(Val Parameters) Export
|
||||||
|
|
||||||
If Parameters.Quantity() = 0 Then
|
If Parameters.Count() = 0 Then
|
||||||
Return "";
|
Return "";
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
@@ -240,7 +240,7 @@ Function RequestParametersToString(Val Parameters) Export
|
|||||||
ParameterValue = ConvertParameterToString(Parameter.Value);
|
ParameterValue = ConvertParameterToString(Parameter.Value);
|
||||||
|
|
||||||
ParameterString = ParameterString
|
ParameterString = ParameterString
|
||||||
+ Parameter.TheKey
|
+ Parameter.Key
|
||||||
+ "="
|
+ "="
|
||||||
+ ParameterValue
|
+ ParameterValue
|
||||||
+ "&";
|
+ "&";
|
||||||
@@ -344,7 +344,7 @@ Function RequestParametersToMatch(Val ParameterString) Export
|
|||||||
|
|
||||||
KeyValueArray = StrSplit(Parameter, "=");
|
KeyValueArray = StrSplit(Parameter, "=");
|
||||||
|
|
||||||
If KeyValueArray.Quantity() = NumberOfParts Then
|
If KeyValueArray.Count() = NumberOfParts Then
|
||||||
ReturnMapping.Insert(KeyValueArray[0], KeyValueArray[1]);
|
ReturnMapping.Insert(KeyValueArray[0], KeyValueArray[1]);
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
@@ -453,7 +453,7 @@ Procedure ReplaceSpecialCharacters(Text, Markup = "Markdown") Export
|
|||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
For Each ArraySymbol In CharacterMapping Do
|
For Each ArraySymbol In CharacterMapping Do
|
||||||
Text = StrReplace(Text, ArraySymbol.TheKey, ArraySymbol.Value);
|
Text = StrReplace(Text, ArraySymbol.Key, ArraySymbol.Value);
|
||||||
EndDo;
|
EndDo;
|
||||||
|
|
||||||
EndProcedure
|
EndProcedure
|
||||||
@@ -849,7 +849,7 @@ Procedure WriteMultipartParameters(TextRecord, Val Boundary, Val Parameters)
|
|||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
TextRecord.WriteString("--" + boundary + LineSeparator);
|
TextRecord.WriteString("--" + boundary + LineSeparator);
|
||||||
TextRecord.WriteString("Content-Disposition: form-data; name=""" + Parameter.TheKey + """");
|
TextRecord.WriteString("Content-Disposition: form-data; name=""" + Parameter.Key + """");
|
||||||
TextRecord.WriteString(LineSeparator);
|
TextRecord.WriteString(LineSeparator);
|
||||||
TextRecord.WriteString(LineSeparator);
|
TextRecord.WriteString(LineSeparator);
|
||||||
|
|
||||||
@@ -883,14 +883,14 @@ Procedure WriteMultipartFiles(TextRecord, Val Boundary, Val ContentType, Val Fil
|
|||||||
|
|
||||||
For Each File In Files Do
|
For Each File In Files Do
|
||||||
|
|
||||||
FilePath = StrReplace(File.TheKey, DotReplacement, ".");
|
FilePath = StrReplace(File.Key, DotReplacement, ".");
|
||||||
|
|
||||||
If ContentType = "image/jpeg" Then
|
If ContentType = "image/jpeg" Then
|
||||||
SendingFileName = "photo";
|
SendingFileName = "photo";
|
||||||
Else
|
Else
|
||||||
SendingFileName = StrReplace(File.TheKey, DotReplacement, ".");
|
SendingFileName = StrReplace(File.Key, DotReplacement, ".");
|
||||||
SendingFileName = Left(SendingFileName, StrFind(SendingFileName, ".") - 1);
|
SendingFileName = Left(SendingFileName, StrFind(SendingFileName, ".") - 1);
|
||||||
SendingFileName = ?(ValueIsFilled(SendingFileName), SendingFileName, StrReplace(File.TheKey,
|
SendingFileName = ?(ValueIsFilled(SendingFileName), SendingFileName, StrReplace(File.Key,
|
||||||
DotReplacement, "."));
|
DotReplacement, "."));
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
@@ -930,7 +930,7 @@ Procedure WriteRelatedFiles(TextRecord, Val Boundary, Val Files)
|
|||||||
TextRecord.WriteString("Content-Type: " + File.Value);
|
TextRecord.WriteString("Content-Type: " + File.Value);
|
||||||
TextRecord.WriteString(LineSeparator);
|
TextRecord.WriteString(LineSeparator);
|
||||||
TextRecord.WriteString(LineSeparator);
|
TextRecord.WriteString(LineSeparator);
|
||||||
WriteBinaryData(TextRecord, File.TheKey);
|
WriteBinaryData(TextRecord, File.Key);
|
||||||
TextRecord.WriteString(LineSeparator);
|
TextRecord.WriteString(LineSeparator);
|
||||||
TextRecord.WriteString(LineSeparator);
|
TextRecord.WriteString(LineSeparator);
|
||||||
|
|
||||||
@@ -1006,7 +1006,7 @@ Procedure RemoveEmptyKeyValues(Val Collection, OutputCollection)
|
|||||||
For Each CollectionItem In Collection Do
|
For Each CollectionItem In Collection Do
|
||||||
|
|
||||||
If Not CollectionItem.Value = Undefined And Not CollectionItem.Value = NULL Then
|
If Not CollectionItem.Value = Undefined And Not CollectionItem.Value = NULL Then
|
||||||
OutputCollection.Insert(CollectionItem.TheKey, CollectionItem.Value);
|
OutputCollection.Insert(CollectionItem.Key, CollectionItem.Value);
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
EndDo;
|
EndDo;
|
||||||
|
@@ -200,7 +200,7 @@ Function CreateCustomTweet(Val Text = ""
|
|||||||
|
|
||||||
PollDuration = Number(PollDuration);
|
PollDuration = Number(PollDuration);
|
||||||
|
|
||||||
If PollOptionsArray.Quantity() > 0 Then
|
If PollOptionsArray.Count() > 0 Then
|
||||||
|
|
||||||
OptionStructure = New Structure("options,duration_minutes", PollOptionsArray, PollDuration);
|
OptionStructure = New Structure("options,duration_minutes", PollOptionsArray, PollDuration);
|
||||||
Fields.Insert("poll", OptionStructure);
|
Fields.Insert("poll", OptionStructure);
|
||||||
@@ -210,7 +210,7 @@ Function CreateCustomTweet(Val Text = ""
|
|||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
If TypeOf(MediaArray) = Type(Array) Then
|
If TypeOf(MediaArray) = Type(Array) Then
|
||||||
If MediaArray.Quantity() > 0 Then
|
If MediaArray.Count() > 0 Then
|
||||||
Fields.Insert("media", New Structure("media_ids", MediaArray));
|
Fields.Insert("media", New Structure("media_ids", MediaArray));
|
||||||
EndIf;
|
EndIf;
|
||||||
EndIf;
|
EndIf;
|
||||||
@@ -379,7 +379,7 @@ EndFunction
|
|||||||
Function UploadMediaInParts(Val File, Val Type, Val RequestType, Val URL, Parameters)
|
Function UploadMediaInParts(Val File, Val Type, Val RequestType, Val URL, Parameters)
|
||||||
|
|
||||||
Unit = 1024;
|
Unit = 1024;
|
||||||
Quantity = 4;
|
Count = 4;
|
||||||
MediaKey = "media_key";
|
MediaKey = "media_key";
|
||||||
MIS = "media_id_string";
|
MIS = "media_id_string";
|
||||||
Command = "command";
|
Command = "command";
|
||||||
@@ -390,7 +390,7 @@ Function UploadMediaInParts(Val File, Val Type, Val RequestType, Val URL, Parame
|
|||||||
MIMETypeMapping.Insert("tweet_video", "video/mp4");
|
MIMETypeMapping.Insert("tweet_video", "video/mp4");
|
||||||
MIMETypeMapping.Insert("tweet_gif" , "image/gif");
|
MIMETypeMapping.Insert("tweet_gif" , "image/gif");
|
||||||
|
|
||||||
ChunkSize = Quantity * Unit * Unit;
|
ChunkSize = Count * Unit * Unit;
|
||||||
ArrayReading = SplitBinaryData(File, ChunkSize);
|
ArrayReading = SplitBinaryData(File, ChunkSize);
|
||||||
|
|
||||||
Fields = New Structure;
|
Fields = New Structure;
|
||||||
@@ -540,7 +540,7 @@ Function GetStandardParameters(Val Parameters = "")
|
|||||||
|
|
||||||
If TypeOf(Parameters) = Type("Structure") Or TypeOf(Parameters) = Type("Map") Then
|
If TypeOf(Parameters) = Type("Structure") Or TypeOf(Parameters) = Type("Map") Then
|
||||||
For Each PassedParameter In Parameters Do
|
For Each PassedParameter In Parameters Do
|
||||||
Parameters_.Insert(PassedParameter.TheKey, OPI_Tools.NumberToString(PassedParameter.Value));
|
Parameters_.Insert(PassedParameter.Key, OPI_Tools.NumberToString(PassedParameter.Value));
|
||||||
EndDo;
|
EndDo;
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
@@ -561,54 +561,54 @@ Function CreateAuthorizationHeaderV1(Val Parameters, Val Fields, Val RequestType
|
|||||||
CurrentUNIXDate = OPI_Tools.UNIXTime(CurrentDate);
|
CurrentUNIXDate = OPI_Tools.UNIXTime(CurrentDate);
|
||||||
CurrentUNIXDate = OPI_Tools.NumberToString(CurrentUNIXDate);
|
CurrentUNIXDate = OPI_Tools.NumberToString(CurrentUNIXDate);
|
||||||
ParametersTable = New ValueTable;
|
ParametersTable = New ValueTable;
|
||||||
ParametersTable.Columns.Add("TheKey");
|
ParametersTable.Columns.Add("Key");
|
||||||
ParametersTable.Columns.Add("Value");
|
ParametersTable.Columns.Add("Value");
|
||||||
|
|
||||||
For Each Field In Fields Do
|
For Each Field In Fields Do
|
||||||
|
|
||||||
NewLine = ParametersTable.Add();
|
NewLine = ParametersTable.Add();
|
||||||
NewLine.TheKey = Field.TheKey;
|
NewLine.Key = Field.Key;
|
||||||
NewLine.Value = Field.Value;
|
NewLine.Value = Field.Value;
|
||||||
|
|
||||||
EndDo;
|
EndDo;
|
||||||
|
|
||||||
NewLine = ParametersTable.Add();
|
NewLine = ParametersTable.Add();
|
||||||
NewLine.TheKey = OCK;
|
NewLine.Key = OCK;
|
||||||
NewLine.Value = Parameters[OCK];
|
NewLine.Value = Parameters[OCK];
|
||||||
|
|
||||||
NewLine = ParametersTable.Add();
|
NewLine = ParametersTable.Add();
|
||||||
NewLine.TheKey = OTK;
|
NewLine.Key = OTK;
|
||||||
NewLine.Value = Parameters[OTK];
|
NewLine.Value = Parameters[OTK];
|
||||||
|
|
||||||
NewLine = ParametersTable.Add();
|
NewLine = ParametersTable.Add();
|
||||||
NewLine.TheKey = "oauth_version";
|
NewLine.Key = "oauth_version";
|
||||||
NewLine.Value = APIVersion;
|
NewLine.Value = APIVersion;
|
||||||
|
|
||||||
NewLine = ParametersTable.Add();
|
NewLine = ParametersTable.Add();
|
||||||
NewLine.TheKey = "oauth_signature_method";
|
NewLine.Key = "oauth_signature_method";
|
||||||
NewLine.Value = HashingMethod;
|
NewLine.Value = HashingMethod;
|
||||||
|
|
||||||
NewLine = ParametersTable.Add();
|
NewLine = ParametersTable.Add();
|
||||||
NewLine.TheKey = "oauth_timestamp";
|
NewLine.Key = "oauth_timestamp";
|
||||||
NewLine.Value = CurrentUNIXDate;
|
NewLine.Value = CurrentUNIXDate;
|
||||||
|
|
||||||
NewLine = ParametersTable.Add();
|
NewLine = ParametersTable.Add();
|
||||||
NewLine.TheKey = "oauth_nonce";
|
NewLine.Key = "oauth_nonce";
|
||||||
NewLine.Value = CurrentUNIXDate;
|
NewLine.Value = CurrentUNIXDate;
|
||||||
|
|
||||||
For Each TableRow In ParametersTable Do
|
For Each TableRow In ParametersTable Do
|
||||||
|
|
||||||
TableRow.TheKey = EncodeString(TableRow.TheKey, StringEncodingMethod.URLencoding);
|
TableRow.Key = EncodeString(TableRow.Key, StringEncodingMethod.URLencoding);
|
||||||
TableRow.Value = EncodeString(TableRow.Value, StringEncodingMethod.URLencoding);
|
TableRow.Value = EncodeString(TableRow.Value, StringEncodingMethod.URLencoding);
|
||||||
|
|
||||||
EndDo;
|
EndDo;
|
||||||
|
|
||||||
ParametersTable.Sort("TheKey");
|
ParametersTable.Sort("Key");
|
||||||
|
|
||||||
For Each TableRow In ParametersTable Do
|
For Each TableRow In ParametersTable Do
|
||||||
|
|
||||||
SignatureString = SignatureString
|
SignatureString = SignatureString
|
||||||
+ TableRow.TheKey
|
+ TableRow.Key
|
||||||
+ "="
|
+ "="
|
||||||
+ TableRow.Value
|
+ TableRow.Value
|
||||||
+ "&";
|
+ "&";
|
||||||
|
@@ -444,7 +444,7 @@ Function UploadPhotoToServer(Val Image, Val Parameters = "", Val View = "Post")
|
|||||||
Method = DetermineImageUploadMethod(View);
|
Method = DetermineImageUploadMethod(View);
|
||||||
Files = New Map;
|
Files = New Map;
|
||||||
|
|
||||||
Response = "response";
|
Response_ = "response";
|
||||||
URL = "api.vk.com/method/";
|
URL = "api.vk.com/method/";
|
||||||
Upload = URL + Method["Upload"];
|
Upload = URL + Method["Upload"];
|
||||||
Save = URL + Method["Save"];
|
Save = URL + Method["Save"];
|
||||||
@@ -461,7 +461,7 @@ Function UploadPhotoToServer(Val Image, Val Parameters = "", Val View = "Post")
|
|||||||
For N = 1 To 5 Do
|
For N = 1 To 5 Do
|
||||||
|
|
||||||
Response = OPI_Tools.Get(Upload, Parameters);
|
Response = OPI_Tools.Get(Upload, Parameters);
|
||||||
Result = Response[Response];
|
Result = Response[Response_];
|
||||||
|
|
||||||
If ValueIsFilled(Result) Then
|
If ValueIsFilled(Result) Then
|
||||||
|
|
||||||
@@ -842,7 +842,7 @@ Function GetPostStatistics(Val PostIDsArray, Val Parameters = "") Export
|
|||||||
|
|
||||||
SetsArray.Add(OPI_Tools.NumberToString(Post));
|
SetsArray.Add(OPI_Tools.NumberToString(Post));
|
||||||
|
|
||||||
If SetsArray.Quantity() = MaximumPosts Then
|
If SetsArray.Count() = MaximumPosts Then
|
||||||
|
|
||||||
NumbersString = StrConcat(SetsArray, ",");
|
NumbersString = StrConcat(SetsArray, ",");
|
||||||
Parameters_.Insert("post_ids", NumbersString);
|
Parameters_.Insert("post_ids", NumbersString);
|
||||||
@@ -1055,7 +1055,7 @@ EndFunction
|
|||||||
// Parameters - Structure Of String - See GetStandardParameters - auth - Authorization JSON or path to .json
|
// Parameters - Structure Of String - See GetStandardParameters - auth - Authorization JSON or path to .json
|
||||||
//
|
//
|
||||||
// Returns:
|
// Returns:
|
||||||
// Map Of String - TheKey - ID, Value - Name
|
// Map Of String - Key - ID, Value - Name
|
||||||
Function GetProductCategoryList(Val Parameters = "") Export
|
Function GetProductCategoryList(Val Parameters = "") Export
|
||||||
|
|
||||||
Response = "response";
|
Response = "response";
|
||||||
@@ -1065,9 +1065,9 @@ Function GetProductCategoryList(Val Parameters = "") Export
|
|||||||
|
|
||||||
If ValueIsFilled(Result) Then
|
If ValueIsFilled(Result) Then
|
||||||
|
|
||||||
Quantity = Result["count"];
|
Count = Result["count"];
|
||||||
|
|
||||||
If Not ValueIsFilled(Quantity) Then
|
If Not ValueIsFilled(Count) Then
|
||||||
Return Response;
|
Return Response;
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
@@ -1075,7 +1075,7 @@ Function GetProductCategoryList(Val Parameters = "") Export
|
|||||||
Return Response;
|
Return Response;
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
Parameters_.Insert("count", Quantity);
|
Parameters_.Insert("count", Count);
|
||||||
Response = OPI_Tools.Get("api.vk.com/method/market.getCategories", Parameters_);
|
Response = OPI_Tools.Get("api.vk.com/method/market.getCategories", Parameters_);
|
||||||
Result = Response[Response];
|
Result = Response[Response];
|
||||||
|
|
||||||
@@ -1743,7 +1743,7 @@ Function GetStandardParameters(Val Parameters = "")
|
|||||||
|
|
||||||
If TypeOf(Parameters) = Type("Structure") Or TypeOf(Parameters) = Type("Map") Then
|
If TypeOf(Parameters) = Type("Structure") Or TypeOf(Parameters) = Type("Map") Then
|
||||||
For Each PassedParameter In Parameters Do
|
For Each PassedParameter In Parameters Do
|
||||||
Parameters_.Insert(PassedParameter.TheKey, OPI_Tools.NumberToString(PassedParameter.Value));
|
Parameters_.Insert(PassedParameter.Key, OPI_Tools.NumberToString(PassedParameter.Value));
|
||||||
EndDo;
|
EndDo;
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
@@ -1781,7 +1781,7 @@ Function GetImageCorrespondence(Val Image, Val Parameters, Val View)
|
|||||||
If Not ValueIsFilled(ResponseArray) Or Not TypeOf(ResponseArray) = Type("Array") Then
|
If Not ValueIsFilled(ResponseArray) Or Not TypeOf(ResponseArray) = Type("Array") Then
|
||||||
Return Response;
|
Return Response;
|
||||||
Else
|
Else
|
||||||
If ResponseArray.Quantity() = 0 Then
|
If ResponseArray.Count() = 0 Then
|
||||||
Return Response;
|
Return Response;
|
||||||
Else
|
Else
|
||||||
ResponseCorrespondence = ResponseArray[0];
|
ResponseCorrespondence = ResponseArray[0];
|
||||||
@@ -1819,7 +1819,7 @@ Function DetermineImageUploadMethod(Val View)
|
|||||||
MethodCorrespondence = New Map;
|
MethodCorrespondence = New Map;
|
||||||
Upload = "Upload";
|
Upload = "Upload";
|
||||||
Save = "Save";
|
Save = "Save";
|
||||||
Method = "Method";
|
Way = "Way";
|
||||||
Photo = "Photo";
|
Photo = "Photo";
|
||||||
|
|
||||||
If View = "Post" Then
|
If View = "Post" Then
|
||||||
@@ -1827,33 +1827,33 @@ Function DetermineImageUploadMethod(Val View)
|
|||||||
MethodCorrespondence.Insert(Upload , "photos.getWallUploadServer");
|
MethodCorrespondence.Insert(Upload , "photos.getWallUploadServer");
|
||||||
MethodCorrespondence.Insert(Save, "photos.saveWallPhoto");
|
MethodCorrespondence.Insert(Save, "photos.saveWallPhoto");
|
||||||
MethodCorrespondence.Insert(Photo , "photo");
|
MethodCorrespondence.Insert(Photo , "photo");
|
||||||
MethodCorrespondence.Insert(Method , 1);
|
MethodCorrespondence.Insert(Way , 1);
|
||||||
|
|
||||||
ElsIf View = "Product" Then
|
ElsIf View = "Product" Then
|
||||||
|
|
||||||
MethodCorrespondence.Insert(Upload , "market.getProductPhotoUploadServer");
|
MethodCorrespondence.Insert(Upload , "market.getProductPhotoUploadServer");
|
||||||
MethodCorrespondence.Insert(Save, "market.saveProductPhoto");
|
MethodCorrespondence.Insert(Save, "market.saveProductPhoto");
|
||||||
MethodCorrespondence.Insert(Method , 2);
|
MethodCorrespondence.Insert(Way , 2);
|
||||||
|
|
||||||
ElsIf View = "Story" Then
|
ElsIf View = "Story" Then
|
||||||
|
|
||||||
MethodCorrespondence.Insert(Upload , "stories.getPhotoUploadServer");
|
MethodCorrespondence.Insert(Upload , "stories.getPhotoUploadServer");
|
||||||
MethodCorrespondence.Insert(Save, "stories.save");
|
MethodCorrespondence.Insert(Save, "stories.save");
|
||||||
MethodCorrespondence.Insert(Method , 3);
|
MethodCorrespondence.Insert(Way , 3);
|
||||||
|
|
||||||
ElsIf View = "Poll" Then
|
ElsIf View = "Poll" Then
|
||||||
|
|
||||||
MethodCorrespondence.Insert(Upload , "polls.getPhotoUploadServer");
|
MethodCorrespondence.Insert(Upload , "polls.getPhotoUploadServer");
|
||||||
MethodCorrespondence.Insert(Save, "polls.savePhoto");
|
MethodCorrespondence.Insert(Save, "polls.savePhoto");
|
||||||
MethodCorrespondence.Insert(Photo , "photo");
|
MethodCorrespondence.Insert(Photo , "photo");
|
||||||
MethodCorrespondence.Insert(Method , 1);
|
MethodCorrespondence.Insert(Way , 1);
|
||||||
|
|
||||||
Else
|
Else
|
||||||
|
|
||||||
MethodCorrespondence.Insert(Upload , "photos.getUploadServer");
|
MethodCorrespondence.Insert(Upload , "photos.getUploadServer");
|
||||||
MethodCorrespondence.Insert(Save, "photos.save");
|
MethodCorrespondence.Insert(Save, "photos.save");
|
||||||
MethodCorrespondence.Insert(Photo , "photos_list");
|
MethodCorrespondence.Insert(Photo , "photos_list");
|
||||||
MethodCorrespondence.Insert(Method , 1);
|
MethodCorrespondence.Insert(Way , 1);
|
||||||
|
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
@@ -1985,7 +1985,7 @@ Function AddImageParameter(Val Image, Val SelectionID, Parameters)
|
|||||||
Return Selections;
|
Return Selections;
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
If Not Selections.Quantity() = 0 Then
|
If Not Selections.Count() = 0 Then
|
||||||
PhotoID = Selections[0]["photo"]["id"];
|
PhotoID = Selections[0]["photo"]["id"];
|
||||||
OPI_TypeConversion.GetLine(PhotoID);
|
OPI_TypeConversion.GetLine(PhotoID);
|
||||||
Parameters.Insert(PhotoID, PhotoID);
|
Parameters.Insert(PhotoID, PhotoID);
|
||||||
@@ -2002,11 +2002,11 @@ EndFunction
|
|||||||
Procedure FillPhotoUploadParameters(Val Method, Val Response, Parameters)
|
Procedure FillPhotoUploadParameters(Val Method, Val Response, Parameters)
|
||||||
|
|
||||||
Response = "response";
|
Response = "response";
|
||||||
Method = Method["Method"];
|
Way = Method["Way"];
|
||||||
StandardMethod = 1;
|
StandardMethod = 1;
|
||||||
NewMethod = 2;
|
NewMethod = 2;
|
||||||
|
|
||||||
If Method = StandardMethod Then
|
If Way = StandardMethod Then
|
||||||
|
|
||||||
Hash = "hash";
|
Hash = "hash";
|
||||||
Serv = "server";
|
Serv = "server";
|
||||||
@@ -2030,7 +2030,7 @@ Procedure FillPhotoUploadParameters(Val Method, Val Response, Parameters)
|
|||||||
Parameters.Insert(Aid , Identifier);
|
Parameters.Insert(Aid , Identifier);
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
ElsIf Method = NewMethod Then
|
ElsIf Way = NewMethod Then
|
||||||
|
|
||||||
ResponseString = OPI_Tools.JSONString(Response);
|
ResponseString = OPI_Tools.JSONString(Response);
|
||||||
Parameters.Insert("upload_response", ResponseString);
|
Parameters.Insert("upload_response", ResponseString);
|
||||||
@@ -2091,10 +2091,10 @@ Procedure FillProductRequestFields(Val ProductDescription, Parameters)
|
|||||||
|
|
||||||
For Each Field In GetProductParameterMapping() Do
|
For Each Field In GetProductParameterMapping() Do
|
||||||
|
|
||||||
Value = ProductDescription[Field.TheKey];
|
Value = ProductDescription[Field.Key];
|
||||||
|
|
||||||
If Value <> Undefined Then
|
If Value <> Undefined Then
|
||||||
Parameters.Insert(Field.Value, ProductDescription[Field.TheKey]);
|
Parameters.Insert(Field.Value, ProductDescription[Field.Key]);
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
EndDo;
|
EndDo;
|
||||||
@@ -2104,7 +2104,7 @@ EndProcedure
|
|||||||
Procedure AddAdditionalProductPhotos(Val PhotoArray, Parameters)
|
Procedure AddAdditionalProductPhotos(Val PhotoArray, Parameters)
|
||||||
|
|
||||||
If TypeOf(PhotoArray) = Type("Array") Then
|
If TypeOf(PhotoArray) = Type("Array") Then
|
||||||
If PhotoArray.Quantity() > 0 Then
|
If PhotoArray.Count() > 0 Then
|
||||||
|
|
||||||
PhotoString = "";
|
PhotoString = "";
|
||||||
|
|
||||||
@@ -2134,7 +2134,7 @@ Procedure GetProductListRecursively(ProductsArray, Parameters, Shift = 0)
|
|||||||
Response = OPI_Tools.Get("api.vk.com/method/market.get", Parameters);
|
Response = OPI_Tools.Get("api.vk.com/method/market.get", Parameters);
|
||||||
Products = Response[Response]["items"];
|
Products = Response[Response]["items"];
|
||||||
|
|
||||||
If Products.Quantity() = 0 Then
|
If Products.Count() = 0 Then
|
||||||
Return;
|
Return;
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
@@ -2155,7 +2155,7 @@ Procedure GetAlbumListRecursively(ArrayOfAlbums, Parameters, Shift = 0)
|
|||||||
Response = OPI_Tools.Get("api.vk.com/method/market.getAlbums", Parameters);
|
Response = OPI_Tools.Get("api.vk.com/method/market.getAlbums", Parameters);
|
||||||
Albums = Response[Response]["items"];
|
Albums = Response[Response]["items"];
|
||||||
|
|
||||||
If Albums.Quantity() = 0 Then
|
If Albums.Count() = 0 Then
|
||||||
Return;
|
Return;
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
@@ -2176,7 +2176,7 @@ Procedure GetOrderListRecursively(ArrayOfOrders, Parameters, Shift = 0)
|
|||||||
Response = OPI_Tools.Get("api.vk.com/method/market.getGroupOrders", Parameters);
|
Response = OPI_Tools.Get("api.vk.com/method/market.getGroupOrders", Parameters);
|
||||||
Orders = Response[Response]["items"];
|
Orders = Response[Response]["items"];
|
||||||
|
|
||||||
If Orders.Quantity() = 0 Then
|
If Orders.Count() = 0 Then
|
||||||
Return;
|
Return;
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
|
@@ -251,7 +251,7 @@ EndFunction
|
|||||||
//
|
//
|
||||||
// Parameters:
|
// Parameters:
|
||||||
// Token - String - Token - token
|
// Token - String - Token - token
|
||||||
// Quantity - Number, String - Number of returned objects - amount
|
// Count - Number, String - Number of returned objects - amount
|
||||||
// OffsetFromStart - Number - Offset for getting objects not from the beginning of the list - offset
|
// OffsetFromStart - Number - Offset for getting objects not from the beginning of the list - offset
|
||||||
// FilterByType - String - Filter by file type - type
|
// FilterByType - String - Filter by file type - type
|
||||||
// SortByDate - Boolean - True > sort by date, False > alphabetically - datesort
|
// SortByDate - Boolean - True > sort by date, False > alphabetically - datesort
|
||||||
@@ -259,13 +259,13 @@ EndFunction
|
|||||||
// Returns:
|
// Returns:
|
||||||
// Key-Value Pair - serialized JSON response from Yandex
|
// Key-Value Pair - serialized JSON response from Yandex
|
||||||
Function GetFilesList(Val Token
|
Function GetFilesList(Val Token
|
||||||
, Val Quantity = 0
|
, Val Count = 0
|
||||||
, Val OffsetFromStart = 0
|
, Val OffsetFromStart = 0
|
||||||
, Val FilterByType = ""
|
, Val FilterByType = ""
|
||||||
, Val SortByDate = False) Export
|
, Val SortByDate = False) Export
|
||||||
|
|
||||||
OPI_TypeConversion.GetLine(Token);
|
OPI_TypeConversion.GetLine(Token);
|
||||||
OPI_TypeConversion.GetLine(Quantity);
|
OPI_TypeConversion.GetLine(Count);
|
||||||
OPI_TypeConversion.GetLine(OffsetFromStart);
|
OPI_TypeConversion.GetLine(OffsetFromStart);
|
||||||
OPI_TypeConversion.GetLine(FilterByType);
|
OPI_TypeConversion.GetLine(FilterByType);
|
||||||
OPI_TypeConversion.GetBoolean(SortByDate);
|
OPI_TypeConversion.GetBoolean(SortByDate);
|
||||||
@@ -274,8 +274,8 @@ Function GetFilesList(Val Token
|
|||||||
|
|
||||||
Parameters = New Structure;
|
Parameters = New Structure;
|
||||||
|
|
||||||
If ValueIsFilled(Quantity) Then
|
If ValueIsFilled(Count) Then
|
||||||
Parameters.Insert("limit", OPI_Tools.NumberToString(Quantity));
|
Parameters.Insert("limit", OPI_Tools.NumberToString(Count));
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
If ValueIsFilled(OffsetFromStart) Then
|
If ValueIsFilled(OffsetFromStart) Then
|
||||||
@@ -443,23 +443,23 @@ EndFunction
|
|||||||
//
|
//
|
||||||
// Parameters:
|
// Parameters:
|
||||||
// Token - String - Token - token
|
// Token - String - Token - token
|
||||||
// Quantity - Number - Number of returned objects - amount
|
// Count - Number - Number of returned objects - amount
|
||||||
// OffsetFromStart - Number - Offset for getting objects not from the beginning of the list - offset
|
// OffsetFromStart - Number - Offset for getting objects not from the beginning of the list - offset
|
||||||
//
|
//
|
||||||
// Returns:
|
// Returns:
|
||||||
// Key-Value Pair - serialized JSON response from Yandex
|
// Key-Value Pair - serialized JSON response from Yandex
|
||||||
Function GetPublishedObjectsList(Val Token, Val Quantity = 0, Val OffsetFromStart = 0) Export
|
Function GetPublishedObjectsList(Val Token, Val Count = 0, Val OffsetFromStart = 0) Export
|
||||||
|
|
||||||
OPI_TypeConversion.GetLine(Token);
|
OPI_TypeConversion.GetLine(Token);
|
||||||
OPI_TypeConversion.GetLine(Quantity);
|
OPI_TypeConversion.GetLine(Count);
|
||||||
OPI_TypeConversion.GetLine(OffsetFromStart);
|
OPI_TypeConversion.GetLine(OffsetFromStart);
|
||||||
|
|
||||||
Headers = AuthorizationHeader(Token);
|
Headers = AuthorizationHeader(Token);
|
||||||
|
|
||||||
Parameters = New Structure;
|
Parameters = New Structure;
|
||||||
|
|
||||||
If ValueIsFilled(Quantity) Then
|
If ValueIsFilled(Count) Then
|
||||||
Parameters.Insert("limit", Quantity);
|
Parameters.Insert("limit", Count);
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
If ValueIsFilled(OffsetFromStart) Then
|
If ValueIsFilled(OffsetFromStart) Then
|
||||||
@@ -478,24 +478,24 @@ EndFunction
|
|||||||
// Parameters:
|
// Parameters:
|
||||||
// Token - String - Token - token
|
// Token - String - Token - token
|
||||||
// URL - String - Object address - url
|
// URL - String - Object address - url
|
||||||
// Quantity - Number - Number of returned nested objects (for catalog) - amount
|
// Count - Number - Number of returned nested objects (for catalog) - amount
|
||||||
// OffsetFromStart - Number - Offset for getting nested objects not from the beginning of the list - offset
|
// OffsetFromStart - Number - Offset for getting nested objects not from the beginning of the list - offset
|
||||||
//
|
//
|
||||||
// Returns:
|
// Returns:
|
||||||
// Key-Value Pair - serialized JSON response from Yandex
|
// Key-Value Pair - serialized JSON response from Yandex
|
||||||
Function GetPublicObject(Val Token, Val URL, Val Quantity = 0, Val OffsetFromStart = 0) Export
|
Function GetPublicObject(Val Token, Val URL, Val Count = 0, Val OffsetFromStart = 0) Export
|
||||||
|
|
||||||
OPI_TypeConversion.GetLine(Token);
|
OPI_TypeConversion.GetLine(Token);
|
||||||
OPI_TypeConversion.GetLine(URL);
|
OPI_TypeConversion.GetLine(URL);
|
||||||
OPI_TypeConversion.GetLine(Quantity);
|
OPI_TypeConversion.GetLine(Count);
|
||||||
OPI_TypeConversion.GetLine(OffsetFromStart);
|
OPI_TypeConversion.GetLine(OffsetFromStart);
|
||||||
|
|
||||||
Headers = AuthorizationHeader(Token);
|
Headers = AuthorizationHeader(Token);
|
||||||
|
|
||||||
Parameters = New Structure;
|
Parameters = New Structure;
|
||||||
|
|
||||||
If ValueIsFilled(Quantity) Then
|
If ValueIsFilled(Count) Then
|
||||||
Parameters.Insert("limit", OPI_Tools.NumberToString(Quantity));
|
Parameters.Insert("limit", OPI_Tools.NumberToString(Count));
|
||||||
EndIf;
|
EndIf;
|
||||||
|
|
||||||
If ValueIsFilled(OffsetFromStart) Then
|
If ValueIsFilled(OffsetFromStart) Then
|
||||||
|
@@ -444,7 +444,7 @@
|
|||||||
Метод = ОпределитьМетодЗагрузкиИзображений(Вид);
|
Метод = ОпределитьМетодЗагрузкиИзображений(Вид);
|
||||||
Файлы = Новый Соответствие;
|
Файлы = Новый Соответствие;
|
||||||
|
|
||||||
Response = "response";
|
Response_ = "response";
|
||||||
URL = "api.vk.com/method/";
|
URL = "api.vk.com/method/";
|
||||||
Загрузка = URL + Метод["Загрузка"];
|
Загрузка = URL + Метод["Загрузка"];
|
||||||
Сохранение = URL + Метод["Сохранение"];
|
Сохранение = URL + Метод["Сохранение"];
|
||||||
@@ -461,7 +461,7 @@
|
|||||||
Для Н = 1 По 5 Цикл
|
Для Н = 1 По 5 Цикл
|
||||||
|
|
||||||
Ответ = OPI_Инструменты.Get(Загрузка, Параметры);
|
Ответ = OPI_Инструменты.Get(Загрузка, Параметры);
|
||||||
Результат = Ответ[Response];
|
Результат = Ответ[Response_];
|
||||||
|
|
||||||
Если ЗначениеЗаполнено(Результат) Тогда
|
Если ЗначениеЗаполнено(Результат) Тогда
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user