From 28904583748d47a720f0cf9d4a6338c39e94d657 Mon Sep 17 00:00:00 2001 From: Vitaly the Alpaca Date: Sat, 1 Jun 2024 16:37:04 +0000 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=B5=D0=BE=D0=B1=D1=80=D0=B0?= =?UTF-8?q?=D0=B7=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20OPI=20->=20OInt=20?= =?UTF-8?q?(workflow)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/en/OInt/core/Modules/OPI_Airtable.os | 2 +- src/en/OInt/core/Modules/OPI_Dropbox.os | 6 +-- .../OInt/core/Modules/OPI_GoogleCalendar.os | 10 ++-- src/en/OInt/core/Modules/OPI_GoogleDrive.os | 10 ++-- src/en/OInt/core/Modules/OPI_GoogleSheets.os | 2 +- src/en/OInt/core/Modules/OPI_Notion.os | 16 +++--- src/en/OInt/core/Modules/OPI_Telegram.os | 28 +++++------ src/en/OInt/core/Modules/OPI_Twitter.os | 32 ++++++------ src/en/OInt/core/Modules/OPI_VK.os | 50 +++++++++---------- src/en/OInt/core/Modules/OPI_YandexDisk.os | 30 +++++------ .../OInt/tests/Modules/internal/OPI_Tests.os | 32 ++++++------ .../tools/Modules/OPI_TestDataRetrieval.os | 2 +- .../internal/Modules/OPI_Cryptography.os | 28 +++++------ .../Modules/internal/Modules/OPI_Tools.os | 22 ++++---- .../src/CommonModules/OPI_Airtable/Module.bsl | 2 +- .../CommonModules/OPI_Cryptography/Module.bsl | 28 +++++------ .../src/CommonModules/OPI_Dropbox/Module.bsl | 6 +-- .../OPI_GoogleCalendar/Module.bsl | 10 ++-- .../CommonModules/OPI_GoogleDrive/Module.bsl | 10 ++-- .../CommonModules/OPI_GoogleSheets/Module.bsl | 2 +- .../src/CommonModules/OPI_Notion/Module.bsl | 16 +++--- .../src/CommonModules/OPI_Telegram/Module.bsl | 28 +++++------ .../OPI_TestDataRetrieval/Module.bsl | 2 +- .../src/CommonModules/OPI_Tests/Module.bsl | 32 ++++++------ .../src/CommonModules/OPI_Tools/Module.bsl | 22 ++++---- .../src/CommonModules/OPI_Twitter/Module.bsl | 32 ++++++------ .../OPI/src/CommonModules/OPI_VK/Module.bsl | 50 +++++++++---------- .../CommonModules/OPI_YandexDisk/Module.bsl | 30 +++++------ src/ru/OInt/core/Modules/OPI_VK.os | 4 +- 29 files changed, 272 insertions(+), 272 deletions(-) diff --git a/src/en/OInt/core/Modules/OPI_Airtable.os b/src/en/OInt/core/Modules/OPI_Airtable.os index 75e1aa6f89..815ad996f9 100644 --- a/src/en/OInt/core/Modules/OPI_Airtable.os +++ b/src/en/OInt/core/Modules/OPI_Airtable.os @@ -114,7 +114,7 @@ Function CreateDatabase(Val Token, Val Workspace, Val Name, Val TableCollection) For Each Table In TableCollection Do - Description = GenerateTableDescription(Table.TheKey, Table.Value); + Description = GenerateTableDescription(Table.Key, Table.Value); TableArray.Add(Description); EndDo; diff --git a/src/en/OInt/core/Modules/OPI_Dropbox.os b/src/en/OInt/core/Modules/OPI_Dropbox.os index c11d0f5955..419dba0da4 100644 --- a/src/en/OInt/core/Modules/OPI_Dropbox.os +++ b/src/en/OInt/core/Modules/OPI_Dropbox.os @@ -467,17 +467,17 @@ EndFunction // Parameters: // Token - String - Token - token // 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: // 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"; Parameters = New Structure; OPI_Tools.AddField("path" , Path , "String", Parameters); - OPI_Tools.AddField("limit", Quantity, "Number" , Parameters); + OPI_Tools.AddField("limit", Count, "Number" , Parameters); Headers = GetRequestHeaders(Token); Response = OPI_Tools.Post(URL, Parameters, Headers); diff --git a/src/en/OInt/core/Modules/OPI_GoogleCalendar.os b/src/en/OInt/core/Modules/OPI_GoogleCalendar.os index d6f3f6cd38..a7b7f801e4 100644 --- a/src/en/OInt/core/Modules/OPI_GoogleCalendar.os +++ b/src/en/OInt/core/Modules/OPI_GoogleCalendar.os @@ -323,7 +323,7 @@ Function GetEventDescription() Export Event.Insert("Venue" , ""); // String description of the venue of the event Event.Insert("StartDate" , CurrentDate); // Date of start 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 Return Event; @@ -513,7 +513,7 @@ Function ConvertAttachments(Val Attachments) For Each Attachment In Attachments Do CurrentAttachment = New Structure; - CurrentAttachment.Insert("title" , Attachment.TheKey); + CurrentAttachment.Insert("title" , Attachment.Key); CurrentAttachment.Insert("fileUrl", Attachment.Value); AttachmentsArray.Add(CurrentAttachment); @@ -522,7 +522,7 @@ Function ConvertAttachments(Val Attachments) EndIf; - If AttachmentsArray.Quantity() > 0 Then + If AttachmentsArray.Count() > 0 Then Return AttachmentsArray; Else Return Undefined; @@ -599,7 +599,7 @@ Procedure GetCalendarsListRecursively(Val Headers, ArrayOfCalendars, Page = "") ArrayOfCalendars.Add(Calendar); EndDo; - If Calendars.Quantity() > 0 And ValueIsFilled(Page) Then + If Calendars.Count() > 0 And ValueIsFilled(Page) Then GetCalendarsListRecursively(Headers, ArrayOfCalendars, Page); EndIf; @@ -626,7 +626,7 @@ Procedure GetEventsListRecursively(Val Headers, Val Calendar, ArrayOfEvents, Pag ArrayOfEvents.Add(Event); EndDo; - If Events.Quantity() > 0 And ValueIsFilled(Page) Then + If Events.Count() > 0 And ValueIsFilled(Page) Then GetEventsListRecursively(Headers, ArrayOfEvents, Page); EndIf; diff --git a/src/en/OInt/core/Modules/OPI_GoogleDrive.os b/src/en/OInt/core/Modules/OPI_GoogleDrive.os index 95b4179fb8..2d95ef06ef 100644 --- a/src/en/OInt/core/Modules/OPI_GoogleDrive.os +++ b/src/en/OInt/core/Modules/OPI_GoogleDrive.os @@ -456,7 +456,7 @@ Procedure GetObjectsListRecursively(Val Headers, ArrayOfObjects, Detailed = Fals ArrayOfObjects.Add(CurrentObject); EndDo; - If Objects.Quantity() > 0 And ValueIsFilled(Page) Then + If Objects.Count() > 0 And ValueIsFilled(Page) Then GetObjectsListRecursively(Headers, ArrayOfObjects, Detailed, Filter, Page); EndIf; @@ -495,7 +495,7 @@ Procedure FormFileUploadParameters(Description) For Each Element In Description Do - If Element.TheKey = "Parent" Then + If Element.Key = "Parent" Then CurrentValue = New Array; CurrentValue.Add(Element.Value); @@ -506,7 +506,7 @@ Procedure FormFileUploadParameters(Description) EndIf; - FieldName = FieldMapping.Get(Element.TheKey); + FieldName = FieldMapping.Get(Element.Key); FormedDescription.Insert(FieldName, CurrentValue); EndDo; @@ -581,7 +581,7 @@ EndFunction Function UploadLargeFile(Val Description, Val FileMapping, Val Headers, Val Identifier = "") For Each File In FileMapping Do - Binary = File.TheKey; + Binary = File.Key; Break; EndDo; @@ -709,7 +709,7 @@ Function CheckPartUpload(Response, StrTotalSize, AdditionalHeaders, UploadURL, C ArrayOfInformation = StrSplit(UploadedData, "-", False); PartsRequired = 2; - If Not ArrayOfInformation.Quantity() = PartsRequired Then + If Not ArrayOfInformation.Count() = PartsRequired Then OPI_Tools.ProcessResponse(Response); Return Response; EndIf; diff --git a/src/en/OInt/core/Modules/OPI_GoogleSheets.os b/src/en/OInt/core/Modules/OPI_GoogleSheets.os index ed5af6c156..67cccfe11f 100644 --- a/src/en/OInt/core/Modules/OPI_GoogleSheets.os +++ b/src/en/OInt/core/Modules/OPI_GoogleSheets.os @@ -377,7 +377,7 @@ Function FormCellDataArray(Val ValueStructure, Val MajorDimension, Val Sheet) For Each CellData In ValueStructure Do CurrentValue = CellData.Value; - CurrentKey = CellData.TheKey; + CurrentKey = CellData.Key; AddSheetName(CurrentKey, Sheet); diff --git a/src/en/OInt/core/Modules/OPI_Notion.os b/src/en/OInt/core/Modules/OPI_Notion.os index 179614e6de..9ea43db439 100644 --- a/src/en/OInt/core/Modules/OPI_Notion.os +++ b/src/en/OInt/core/Modules/OPI_Notion.os @@ -224,7 +224,7 @@ Function CreateDatabase(Val Token, Val Parent, Val Title, Val Properties = "") E // Name : title // Description : rich_text // InProgress : checkbox - // Quantity : number + // Count : number // Date : date // Status : Map // Аtoтиinный : green @@ -587,7 +587,7 @@ EndProcedure Procedure AddDatabaseProperties(Val Properties, MainStructure) - If Properties.Quantity() = 0 Then + If Properties.Count() = 0 Then MainStructure.Insert("properties", New Structure); Return; EndIf; @@ -598,17 +598,17 @@ Procedure AddDatabaseProperties(Val Properties, MainStructure) 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") Or TypeOf(Property.Value) = Type("Map") Then ValueSelection = FormSelectionValues(Property.Value); - ParameterMap.Insert(Property.TheKey, New Structure("select", ValueSelection)); + ParameterMap.Insert(Property.Key, New Structure("select", ValueSelection)); Else - ParameterMap.Insert(Property.TheKey, Property.Value); + ParameterMap.Insert(Property.Key, Property.Value); EndIf; @@ -625,7 +625,7 @@ Function FormSelectionValues(Val VariantStructure) For Each Option In VariantStructure Do OptionMap = New Map; - OptionMap.Insert("name" , Option.TheKey); + OptionMap.Insert("name" , Option.Key); OptionMap.Insert("color", Option.Value); OptionArray.Add(OptionMap); @@ -654,7 +654,7 @@ Function FillDataBySchema(Val Scheme, Val Data, Val Token, Val ThisIsBase = True FieldData = Field.Value; FieldType = FieldData["type"]; - FillableData = Data.Get(Field.TheKey); + FillableData = Data.Get(Field.Key); If FillableData = Undefined Then Continue; @@ -860,7 +860,7 @@ Function ConvertFiles(Val FileMapping) FileStructure = New Structure; FileStructure.Insert("type" , "external"); - FileStructure.Insert("name" , File.TheKey); + FileStructure.Insert("name" , File.Key); FileStructure.Insert("external", New Structure("url", File.Value)); ArrayOfFiles.Add(FileStructure); diff --git a/src/en/OInt/core/Modules/OPI_Telegram.os b/src/en/OInt/core/Modules/OPI_Telegram.os index 2e7f33a56e..2672ce4623 100644 --- a/src/en/OInt/core/Modules/OPI_Telegram.os +++ b/src/en/OInt/core/Modules/OPI_Telegram.os @@ -179,34 +179,34 @@ Function ProcessTMAData(Val DataString, Val Token) Export DataString = DecodeString(DataString, StringEncodingMethod.URLencoding); DataStructure = OPI_Tools.RequestParametersToMatch(DataString); - TheKey = "WebAppData"; + Key = "WebAppData"; Hash = ""; - BinaryKey = GetBinaryDataFromString(TheKey); + BinaryKey = GetBinaryDataFromString(Key); Result = OPI_Cryptography.HMACSHA256(BinaryKey, GetBinaryDataFromString(Token)); TValue = New ValueTable; - TValue.Columns.Add("TheKey"); + TValue.Columns.Add("Key"); TValue.Columns.Add("Value"); For Each Data In DataStructure Do NewLine = TValue.Add(); - NewLine.TheKey = Data.TheKey; + NewLine.Key = Data.Key; NewLine.Value = Data.Value; EndDo; - TValue.Sort("TheKey"); + TValue.Sort("Key"); ReturnMapping = New Map; DCS = ""; For Each DataString In TValue Do - If DataString.TheKey <> "hash" Then - DCS = DCS + DataString.TheKey + "=" + DataString.Value + Chars.PS; - ReturnMapping.Insert(DataString.TheKey, DataString.Value); + If DataString.Key <> "hash" Then + DCS = DCS + DataString.Key + "=" + DataString.Value + Chars.PS; + ReturnMapping.Insert(DataString.Key, DataString.Value); Else Hash = DataString.Value; EndIf; @@ -410,7 +410,7 @@ Function SendMediaGroup(Val Token , Val Markup = "Markdown") Export // FileMapping - // TheKey - File, Value - Type + // Key - File, Value - Type // Types: audio, document, photo, video // Different types cannot be mixed! @@ -1165,12 +1165,12 @@ Procedure FormMediaArray(Val FileMapping, Val Text, FileStructure, Media) 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); - ThisFile = New File(CurrentFile.TheKey); + ThisFile = New File(CurrentFile.Key); MediaName = CurrentFile.Value + String(Counter) + ?(CurrentFile.Value = "document", ThisFile.Extension, ""); @@ -1178,7 +1178,7 @@ Procedure FormMediaArray(Val FileMapping, Val Text, FileStructure, Media) FullMediaName = StrReplace(MediaName, ".", "___"); Else - Binary = CurrentFile.TheKey; + Binary = CurrentFile.Key; MediaName = CurrentFile.Value + String(Counter); FullMediaName = MediaName; EndIf; @@ -1208,7 +1208,7 @@ Procedure AddChatIdentifier(Val ChatID, Parameters) ChatID = OPI_Tools.NumberToString(ChatID); ChatArray = StrSplit(ChatID, "*", False); - If ChatArray.Quantity() > 1 Then + If ChatArray.Count() > 1 Then ChatID = ChatArray[0]; ThreadID = ChatArray[1]; diff --git a/src/en/OInt/core/Modules/OPI_Twitter.os b/src/en/OInt/core/Modules/OPI_Twitter.os index 016cb3c3b8..f4234a1ef4 100644 --- a/src/en/OInt/core/Modules/OPI_Twitter.os +++ b/src/en/OInt/core/Modules/OPI_Twitter.os @@ -200,7 +200,7 @@ Function CreateCustomTweet(Val Text = "" PollDuration = Number(PollDuration); - If PollOptionsArray.Quantity() > 0 Then + If PollOptionsArray.Count() > 0 Then OptionStructure = New Structure("options,duration_minutes", PollOptionsArray, PollDuration); Fields.Insert("poll", OptionStructure); @@ -210,7 +210,7 @@ Function CreateCustomTweet(Val Text = "" EndIf; If TypeOf(MediaArray) = Type(Array) Then - If MediaArray.Quantity() > 0 Then + If MediaArray.Count() > 0 Then Fields.Insert("media", New Structure("media_ids", MediaArray)); EndIf; EndIf; @@ -379,7 +379,7 @@ EndFunction Function UploadMediaInParts(Val File, Val Type, Val RequestType, Val URL, Parameters) Unit = 1024; - Quantity = 4; + Count = 4; MediaKey = "media_key"; MIS = "media_id_string"; 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_gif" , "image/gif"); - ChunkSize = Quantity * Unit * Unit; + ChunkSize = Count * Unit * Unit; ArrayReading = SplitBinaryData(File, ChunkSize); Fields = New Structure; @@ -540,7 +540,7 @@ Function GetStandardParameters(Val Parameters = "") If TypeOf(Parameters) = Type("Structure") Or TypeOf(Parameters) = Type("Map") Then 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; EndIf; @@ -561,54 +561,54 @@ Function CreateAuthorizationHeaderV1(Val Parameters, Val Fields, Val RequestType CurrentUNIXDate = OPI_Tools.UNIXTime(CurrentDate); CurrentUNIXDate = OPI_Tools.NumberToString(CurrentUNIXDate); ParametersTable = New ValueTable; - ParametersTable.Columns.Add("TheKey"); + ParametersTable.Columns.Add("Key"); ParametersTable.Columns.Add("Value"); For Each Field In Fields Do NewLine = ParametersTable.Add(); - NewLine.TheKey = Field.TheKey; + NewLine.Key = Field.Key; NewLine.Value = Field.Value; EndDo; NewLine = ParametersTable.Add(); - NewLine.TheKey = OCK; + NewLine.Key = OCK; NewLine.Value = Parameters[OCK]; NewLine = ParametersTable.Add(); - NewLine.TheKey = OTK; + NewLine.Key = OTK; NewLine.Value = Parameters[OTK]; NewLine = ParametersTable.Add(); - NewLine.TheKey = "oauth_version"; + NewLine.Key = "oauth_version"; NewLine.Value = APIVersion; NewLine = ParametersTable.Add(); - NewLine.TheKey = "oauth_signature_method"; + NewLine.Key = "oauth_signature_method"; NewLine.Value = HashingMethod; NewLine = ParametersTable.Add(); - NewLine.TheKey = "oauth_timestamp"; + NewLine.Key = "oauth_timestamp"; NewLine.Value = CurrentUNIXDate; NewLine = ParametersTable.Add(); - NewLine.TheKey = "oauth_nonce"; + NewLine.Key = "oauth_nonce"; NewLine.Value = CurrentUNIXDate; 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); EndDo; - ParametersTable.Sort("TheKey"); + ParametersTable.Sort("Key"); For Each TableRow In ParametersTable Do SignatureString = SignatureString - + TableRow.TheKey + + TableRow.Key + "=" + TableRow.Value + "&"; diff --git a/src/en/OInt/core/Modules/OPI_VK.os b/src/en/OInt/core/Modules/OPI_VK.os index 776d61fd0d..a163fa4aa1 100644 --- a/src/en/OInt/core/Modules/OPI_VK.os +++ b/src/en/OInt/core/Modules/OPI_VK.os @@ -444,7 +444,7 @@ Function UploadPhotoToServer(Val Image, Val Parameters = "", Val View = "Post") Method = DetermineImageUploadMethod(View); Files = New Map; - Response = "response"; + Response_ = "response"; URL = "api.vk.com/method/"; Upload = URL + Method["Upload"]; Save = URL + Method["Save"]; @@ -461,7 +461,7 @@ Function UploadPhotoToServer(Val Image, Val Parameters = "", Val View = "Post") For N = 1 To 5 Do Response = OPI_Tools.Get(Upload, Parameters); - Result = Response[Response]; + Result = Response[Response_]; If ValueIsFilled(Result) Then @@ -842,7 +842,7 @@ Function GetPostStatistics(Val PostIDsArray, Val Parameters = "") Export SetsArray.Add(OPI_Tools.NumberToString(Post)); - If SetsArray.Quantity() = MaximumPosts Then + If SetsArray.Count() = MaximumPosts Then NumbersString = StrConcat(SetsArray, ","); Parameters_.Insert("post_ids", NumbersString); @@ -1055,7 +1055,7 @@ EndFunction // Parameters - Structure Of String - See GetStandardParameters - auth - Authorization JSON or path to .json // // Returns: -// Map Of String - TheKey - ID, Value - Name +// Map Of String - Key - ID, Value - Name Function GetProductCategoryList(Val Parameters = "") Export Response = "response"; @@ -1065,9 +1065,9 @@ Function GetProductCategoryList(Val Parameters = "") Export If ValueIsFilled(Result) Then - Quantity = Result["count"]; + Count = Result["count"]; - If Not ValueIsFilled(Quantity) Then + If Not ValueIsFilled(Count) Then Return Response; EndIf; @@ -1075,7 +1075,7 @@ Function GetProductCategoryList(Val Parameters = "") Export Return Response; EndIf; - Parameters_.Insert("count", Quantity); + Parameters_.Insert("count", Count); Response = OPI_Tools.Get("api.vk.com/method/market.getCategories", Parameters_); Result = Response[Response]; @@ -1743,7 +1743,7 @@ Function GetStandardParameters(Val Parameters = "") If TypeOf(Parameters) = Type("Structure") Or TypeOf(Parameters) = Type("Map") Then 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; EndIf; @@ -1781,7 +1781,7 @@ Function GetImageCorrespondence(Val Image, Val Parameters, Val View) If Not ValueIsFilled(ResponseArray) Or Not TypeOf(ResponseArray) = Type("Array") Then Return Response; Else - If ResponseArray.Quantity() = 0 Then + If ResponseArray.Count() = 0 Then Return Response; Else ResponseCorrespondence = ResponseArray[0]; @@ -1819,7 +1819,7 @@ Function DetermineImageUploadMethod(Val View) MethodCorrespondence = New Map; Upload = "Upload"; Save = "Save"; - Method = "Method"; + Way = "Way"; Photo = "Photo"; If View = "Post" Then @@ -1827,33 +1827,33 @@ Function DetermineImageUploadMethod(Val View) MethodCorrespondence.Insert(Upload , "photos.getWallUploadServer"); MethodCorrespondence.Insert(Save, "photos.saveWallPhoto"); MethodCorrespondence.Insert(Photo , "photo"); - MethodCorrespondence.Insert(Method , 1); + MethodCorrespondence.Insert(Way , 1); ElsIf View = "Product" Then MethodCorrespondence.Insert(Upload , "market.getProductPhotoUploadServer"); MethodCorrespondence.Insert(Save, "market.saveProductPhoto"); - MethodCorrespondence.Insert(Method , 2); + MethodCorrespondence.Insert(Way , 2); ElsIf View = "Story" Then MethodCorrespondence.Insert(Upload , "stories.getPhotoUploadServer"); MethodCorrespondence.Insert(Save, "stories.save"); - MethodCorrespondence.Insert(Method , 3); + MethodCorrespondence.Insert(Way , 3); ElsIf View = "Poll" Then MethodCorrespondence.Insert(Upload , "polls.getPhotoUploadServer"); MethodCorrespondence.Insert(Save, "polls.savePhoto"); MethodCorrespondence.Insert(Photo , "photo"); - MethodCorrespondence.Insert(Method , 1); + MethodCorrespondence.Insert(Way , 1); Else MethodCorrespondence.Insert(Upload , "photos.getUploadServer"); MethodCorrespondence.Insert(Save, "photos.save"); MethodCorrespondence.Insert(Photo , "photos_list"); - MethodCorrespondence.Insert(Method , 1); + MethodCorrespondence.Insert(Way , 1); EndIf; @@ -1985,7 +1985,7 @@ Function AddImageParameter(Val Image, Val SelectionID, Parameters) Return Selections; EndIf; - If Not Selections.Quantity() = 0 Then + If Not Selections.Count() = 0 Then PhotoID = Selections[0]["photo"]["id"]; OPI_TypeConversion.GetLine(PhotoID); Parameters.Insert(PhotoID, PhotoID); @@ -2002,11 +2002,11 @@ EndFunction Procedure FillPhotoUploadParameters(Val Method, Val Response, Parameters) Response = "response"; - Method = Method["Method"]; + Way = Method["Way"]; StandardMethod = 1; NewMethod = 2; - If Method = StandardMethod Then + If Way = StandardMethod Then Hash = "hash"; Serv = "server"; @@ -2030,7 +2030,7 @@ Procedure FillPhotoUploadParameters(Val Method, Val Response, Parameters) Parameters.Insert(Aid , Identifier); EndIf; - ElsIf Method = NewMethod Then + ElsIf Way = NewMethod Then ResponseString = OPI_Tools.JSONString(Response); Parameters.Insert("upload_response", ResponseString); @@ -2091,10 +2091,10 @@ Procedure FillProductRequestFields(Val ProductDescription, Parameters) For Each Field In GetProductParameterMapping() Do - Value = ProductDescription[Field.TheKey]; + Value = ProductDescription[Field.Key]; If Value <> Undefined Then - Parameters.Insert(Field.Value, ProductDescription[Field.TheKey]); + Parameters.Insert(Field.Value, ProductDescription[Field.Key]); EndIf; EndDo; @@ -2104,7 +2104,7 @@ EndProcedure Procedure AddAdditionalProductPhotos(Val PhotoArray, Parameters) If TypeOf(PhotoArray) = Type("Array") Then - If PhotoArray.Quantity() > 0 Then + If PhotoArray.Count() > 0 Then PhotoString = ""; @@ -2134,7 +2134,7 @@ Procedure GetProductListRecursively(ProductsArray, Parameters, Shift = 0) Response = OPI_Tools.Get("api.vk.com/method/market.get", Parameters); Products = Response[Response]["items"]; - If Products.Quantity() = 0 Then + If Products.Count() = 0 Then Return; EndIf; @@ -2155,7 +2155,7 @@ Procedure GetAlbumListRecursively(ArrayOfAlbums, Parameters, Shift = 0) Response = OPI_Tools.Get("api.vk.com/method/market.getAlbums", Parameters); Albums = Response[Response]["items"]; - If Albums.Quantity() = 0 Then + If Albums.Count() = 0 Then Return; EndIf; @@ -2176,7 +2176,7 @@ Procedure GetOrderListRecursively(ArrayOfOrders, Parameters, Shift = 0) Response = OPI_Tools.Get("api.vk.com/method/market.getGroupOrders", Parameters); Orders = Response[Response]["items"]; - If Orders.Quantity() = 0 Then + If Orders.Count() = 0 Then Return; EndIf; diff --git a/src/en/OInt/core/Modules/OPI_YandexDisk.os b/src/en/OInt/core/Modules/OPI_YandexDisk.os index bc848b26d2..4240ede1bb 100644 --- a/src/en/OInt/core/Modules/OPI_YandexDisk.os +++ b/src/en/OInt/core/Modules/OPI_YandexDisk.os @@ -251,7 +251,7 @@ EndFunction // // Parameters: // 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 // FilterByType - String - Filter by file type - type // SortByDate - Boolean - True > sort by date, False > alphabetically - datesort @@ -259,13 +259,13 @@ EndFunction // Returns: // Key-Value Pair - serialized JSON response from Yandex Function GetFilesList(Val Token - , Val Quantity = 0 + , Val Count = 0 , Val OffsetFromStart = 0 , Val FilterByType = "" , Val SortByDate = False) Export OPI_TypeConversion.GetLine(Token); - OPI_TypeConversion.GetLine(Quantity); + OPI_TypeConversion.GetLine(Count); OPI_TypeConversion.GetLine(OffsetFromStart); OPI_TypeConversion.GetLine(FilterByType); OPI_TypeConversion.GetBoolean(SortByDate); @@ -274,8 +274,8 @@ Function GetFilesList(Val Token Parameters = New Structure; - If ValueIsFilled(Quantity) Then - Parameters.Insert("limit", OPI_Tools.NumberToString(Quantity)); + If ValueIsFilled(Count) Then + Parameters.Insert("limit", OPI_Tools.NumberToString(Count)); EndIf; If ValueIsFilled(OffsetFromStart) Then @@ -443,23 +443,23 @@ EndFunction // // Parameters: // 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 // // Returns: // 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(Quantity); + OPI_TypeConversion.GetLine(Count); OPI_TypeConversion.GetLine(OffsetFromStart); Headers = AuthorizationHeader(Token); Parameters = New Structure; - If ValueIsFilled(Quantity) Then - Parameters.Insert("limit", Quantity); + If ValueIsFilled(Count) Then + Parameters.Insert("limit", Count); EndIf; If ValueIsFilled(OffsetFromStart) Then @@ -478,24 +478,24 @@ EndFunction // Parameters: // Token - String - Token - token // 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 // // Returns: // 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(URL); - OPI_TypeConversion.GetLine(Quantity); + OPI_TypeConversion.GetLine(Count); OPI_TypeConversion.GetLine(OffsetFromStart); Headers = AuthorizationHeader(Token); Parameters = New Structure; - If ValueIsFilled(Quantity) Then - Parameters.Insert("limit", OPI_Tools.NumberToString(Quantity)); + If ValueIsFilled(Count) Then + Parameters.Insert("limit", OPI_Tools.NumberToString(Count)); EndIf; If ValueIsFilled(OffsetFromStart) Then diff --git a/src/en/OInt/tests/Modules/internal/OPI_Tests.os b/src/en/OInt/tests/Modules/internal/OPI_Tests.os index fd9d1bb3d3..77d7168fa3 100644 --- a/src/en/OInt/tests/Modules/internal/OPI_Tests.os +++ b/src/en/OInt/tests/Modules/internal/OPI_Tests.os @@ -1147,15 +1147,15 @@ EndProcedure Procedure YDisk_GetFileList() Export Token = OPI_TestDataRetrieval.GetParameter("YandexDisk_Token"); - Quantity = 2; + Count = 2; 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.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["items"]).HasType("Array"); @@ -1253,15 +1253,15 @@ EndProcedure Procedure YDisk_GetPublishedList() Export Token = OPI_TestDataRetrieval.GetParameter("YandexDisk_Token"); - Quantity = 2; + Count = 2; Indent = 1; - Result = OPI_YandexDisk.GetPublishedObjectsList(Token, Quantity, Indent); + Result = OPI_YandexDisk.GetPublishedObjectsList(Token, Count, Indent); OPI_TestDataRetrieval.WriteLog(Result, "GetPublishedObjectsList"); 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["items"]).HasType("Array"); @@ -2028,14 +2028,14 @@ Procedure GT_FillClearCells() Export OPI_TestDataRetrieval.WriteLog(Result, "SetCellValues"); 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); OPI_TestDataRetrieval.WriteLog(Result, "GetCellValues"); 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); @@ -2053,7 +2053,7 @@ Procedure GT_FillClearCells() Export OPI_TestDataRetrieval.WriteLog(Result, "ClearCells"); 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 @@ -3060,7 +3060,7 @@ Procedure AT_CreateDeleteRecords() Export OPI_TestDataRetrieval.WriteLog(Result, "CreatePosts"); 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 ArrayOfDeletions.Add(Record["id"]); @@ -3575,12 +3575,12 @@ Procedure Check_DropboxMetadata(Val Result, Val Path) EndProcedure -Procedure Check_DropboxArray(Val Result, Val Quantity = Undefined) +Procedure Check_DropboxArray(Val Result, Val Count = Undefined) OPI_TestDataRetrieval.ExpectsThat(Result["entries"]).HasType("Array"); - If Not Quantity = Undefined Then - OPI_TestDataRetrieval.ExpectsThat(Result["entries"].Quantity()).Equal(Quantity); + If Not Count = Undefined Then + OPI_TestDataRetrieval.ExpectsThat(Result["entries"].Count()).Equal(Count); EndIf; EndProcedure @@ -3593,10 +3593,10 @@ Procedure Check_DropboxStatus(Val Result) OPI_TestDataRetrieval.ExpectsThat(Result[".tag"]).Equal("complete"); 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"].Quantity()).Equal(Quantity); + OPI_TestDataRetrieval.ExpectsThat(Result["paths_to_tags"].Count()).Equal(Count); EndProcedure @@ -5102,7 +5102,7 @@ Procedure Dropbox_GetTagList(FunctionParameters) OPI_TestDataRetrieval.WriteLog(Result, "GetTagList", "Dropbox"); - Check_DropboxTags(Result, PathsArray.Quantity()); + Check_DropboxTags(Result, PathsArray.Count()); Result = OPI_Dropbox.GetTagList(Token, "/New/mydoc.docx"); diff --git a/src/en/OInt/tools/Modules/OPI_TestDataRetrieval.os b/src/en/OInt/tools/Modules/OPI_TestDataRetrieval.os index d61f619d8c..cac65f3007 100644 --- a/src/en/OInt/tools/Modules/OPI_TestDataRetrieval.os +++ b/src/en/OInt/tools/Modules/OPI_TestDataRetrieval.os @@ -244,7 +244,7 @@ Function FormYAXTests() Export For Each Section In Sections Do - CurrentSection = Section.TheKey; + CurrentSection = Section.Key; Filter = New Structure("Section", CurrentSection); SectionTests = TestTable.FindLines(Filter); diff --git a/src/en/OInt/tools/Modules/internal/Modules/OPI_Cryptography.os b/src/en/OInt/tools/Modules/internal/Modules/OPI_Cryptography.os index 3d3c6ff6c4..a05a454a09 100644 --- a/src/en/OInt/tools/Modules/internal/Modules/OPI_Cryptography.os +++ b/src/en/OInt/tools/Modules/internal/Modules/OPI_Cryptography.os @@ -44,9 +44,9 @@ // 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 @@ -59,28 +59,28 @@ Function Hash(BinaryData, Type) Export EndFunction -Function HMAC(Val TheKey, Val Data, Type, BlockSize) Export +Function HMAC(Val Key, Val Data, Type, BlockSize) Export Twice = 2; - If TheKey.Size() > BlockSize Then - TheKey = Hash(TheKey, Type); + If Key.Size() > BlockSize Then + Key = Hash(Key, Type); EndIf; - If TheKey.Size() <= BlockSize Then - TheKey = GetHexStringFromBinaryData(TheKey); - TheKey = Left(TheKey + RepeatString("00", BlockSize), BlockSize * Twice); + If Key.Size() <= BlockSize Then + Key = GetHexStringFromBinaryData(Key); + Key = Left(Key + RepeatString("00", BlockSize), BlockSize * Twice); EndIf; - TheKey = GetBinaryDataBufferFromBinaryData(GetBinaryDataFromHexString(TheKey)); + Key = GetBinaryDataBufferFromBinaryData(GetBinaryDataFromHexString(Key)); Ipad = GetBinaryDataBufferFromHexString(RepeatString("36", BlockSize)); Opad = GetBinaryDataBufferFromHexString(RepeatString("5c", BlockSize)); - Ipad.WriteBitwiseExclusiveOr(0, TheKey); + Ipad.WriteBitwiseExclusiveOr(0, Key); Ikeypad = GetBinaryDataFromBinaryDataBuffer(ipad); - Opad.WriteBitwiseExclusiveOr(0, TheKey); + Opad.WriteBitwiseExclusiveOr(0, Key); Okeypad = GetBinaryDataFromBinaryDataBuffer(opad); Return Hash(UniteBinaryData(okeypad, Hash(UniteBinaryData(ikeypad, Data), Type)), Type); @@ -97,11 +97,11 @@ Function UniteBinaryData(BinaryData1, BinaryData2) Export 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); EndDo; diff --git a/src/en/OInt/tools/Modules/internal/Modules/OPI_Tools.os b/src/en/OInt/tools/Modules/internal/Modules/OPI_Tools.os index a98db4ee7a..4aa606ae90 100644 --- a/src/en/OInt/tools/Modules/internal/Modules/OPI_Tools.os +++ b/src/en/OInt/tools/Modules/internal/Modules/OPI_Tools.os @@ -199,7 +199,7 @@ Function CreateRequest(Val Address, Val AdditionalHeaders = "", Val DataType = " If TypeOf(AdditionalHeaders) = Type("Map") Then For Each Title In AdditionalHeaders Do - Headers.Insert(Title.TheKey, Title.Value); + Headers.Insert(Title.Key, Title.Value); EndDo; EndIf; @@ -229,7 +229,7 @@ EndFunction Function RequestParametersToString(Val Parameters) Export - If Parameters.Quantity() = 0 Then + If Parameters.Count() = 0 Then Return ""; EndIf; @@ -240,7 +240,7 @@ Function RequestParametersToString(Val Parameters) Export ParameterValue = ConvertParameterToString(Parameter.Value); ParameterString = ParameterString - + Parameter.TheKey + + Parameter.Key + "=" + ParameterValue + "&"; @@ -344,7 +344,7 @@ Function RequestParametersToMatch(Val ParameterString) Export KeyValueArray = StrSplit(Parameter, "="); - If KeyValueArray.Quantity() = NumberOfParts Then + If KeyValueArray.Count() = NumberOfParts Then ReturnMapping.Insert(KeyValueArray[0], KeyValueArray[1]); EndIf; @@ -453,7 +453,7 @@ Procedure ReplaceSpecialCharacters(Text, Markup = "Markdown") Export EndIf; For Each ArraySymbol In CharacterMapping Do - Text = StrReplace(Text, ArraySymbol.TheKey, ArraySymbol.Value); + Text = StrReplace(Text, ArraySymbol.Key, ArraySymbol.Value); EndDo; EndProcedure @@ -849,7 +849,7 @@ Procedure WriteMultipartParameters(TextRecord, Val Boundary, Val Parameters) EndIf; 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); @@ -883,14 +883,14 @@ Procedure WriteMultipartFiles(TextRecord, Val Boundary, Val ContentType, Val Fil For Each File In Files Do - FilePath = StrReplace(File.TheKey, DotReplacement, "."); + FilePath = StrReplace(File.Key, DotReplacement, "."); If ContentType = "image/jpeg" Then SendingFileName = "photo"; Else - SendingFileName = StrReplace(File.TheKey, DotReplacement, "."); + SendingFileName = StrReplace(File.Key, DotReplacement, "."); SendingFileName = Left(SendingFileName, StrFind(SendingFileName, ".") - 1); - SendingFileName = ?(ValueIsFilled(SendingFileName), SendingFileName, StrReplace(File.TheKey, + SendingFileName = ?(ValueIsFilled(SendingFileName), SendingFileName, StrReplace(File.Key, DotReplacement, ".")); EndIf; @@ -930,7 +930,7 @@ Procedure WriteRelatedFiles(TextRecord, Val Boundary, Val Files) TextRecord.WriteString("Content-Type: " + File.Value); TextRecord.WriteString(LineSeparator); TextRecord.WriteString(LineSeparator); - WriteBinaryData(TextRecord, File.TheKey); + WriteBinaryData(TextRecord, File.Key); TextRecord.WriteString(LineSeparator); TextRecord.WriteString(LineSeparator); @@ -1006,7 +1006,7 @@ Procedure RemoveEmptyKeyValues(Val Collection, OutputCollection) For Each CollectionItem In Collection Do If Not CollectionItem.Value = Undefined And Not CollectionItem.Value = NULL Then - OutputCollection.Insert(CollectionItem.TheKey, CollectionItem.Value); + OutputCollection.Insert(CollectionItem.Key, CollectionItem.Value); EndIf; EndDo; diff --git a/src/en/OPI/src/CommonModules/OPI_Airtable/Module.bsl b/src/en/OPI/src/CommonModules/OPI_Airtable/Module.bsl index e919a82102..3b17bc1ba0 100644 --- a/src/en/OPI/src/CommonModules/OPI_Airtable/Module.bsl +++ b/src/en/OPI/src/CommonModules/OPI_Airtable/Module.bsl @@ -114,7 +114,7 @@ Function CreateDatabase(Val Token, Val Workspace, Val Name, Val TableCollection) For Each Table In TableCollection Do - Description = GenerateTableDescription(Table.TheKey, Table.Value); + Description = GenerateTableDescription(Table.Key, Table.Value); TableArray.Add(Description); EndDo; diff --git a/src/en/OPI/src/CommonModules/OPI_Cryptography/Module.bsl b/src/en/OPI/src/CommonModules/OPI_Cryptography/Module.bsl index 43d9151159..5669eb9720 100644 --- a/src/en/OPI/src/CommonModules/OPI_Cryptography/Module.bsl +++ b/src/en/OPI/src/CommonModules/OPI_Cryptography/Module.bsl @@ -44,9 +44,9 @@ // 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 @@ -59,28 +59,28 @@ Function Hash(BinaryData, Type) Export EndFunction -Function HMAC(Val TheKey, Val Data, Type, BlockSize) Export +Function HMAC(Val Key, Val Data, Type, BlockSize) Export Twice = 2; - If TheKey.Size() > BlockSize Then - TheKey = Hash(TheKey, Type); + If Key.Size() > BlockSize Then + Key = Hash(Key, Type); EndIf; - If TheKey.Size() <= BlockSize Then - TheKey = GetHexStringFromBinaryData(TheKey); - TheKey = Left(TheKey + RepeatString("00", BlockSize), BlockSize * Twice); + If Key.Size() <= BlockSize Then + Key = GetHexStringFromBinaryData(Key); + Key = Left(Key + RepeatString("00", BlockSize), BlockSize * Twice); EndIf; - TheKey = GetBinaryDataBufferFromBinaryData(GetBinaryDataFromHexString(TheKey)); + Key = GetBinaryDataBufferFromBinaryData(GetBinaryDataFromHexString(Key)); Ipad = GetBinaryDataBufferFromHexString(RepeatString("36", BlockSize)); Opad = GetBinaryDataBufferFromHexString(RepeatString("5c", BlockSize)); - Ipad.WriteBitwiseExclusiveOr(0, TheKey); + Ipad.WriteBitwiseExclusiveOr(0, Key); Ikeypad = GetBinaryDataFromBinaryDataBuffer(ipad); - Opad.WriteBitwiseExclusiveOr(0, TheKey); + Opad.WriteBitwiseExclusiveOr(0, Key); Okeypad = GetBinaryDataFromBinaryDataBuffer(opad); Return Hash(UniteBinaryData(okeypad, Hash(UniteBinaryData(ikeypad, Data), Type)), Type); @@ -97,11 +97,11 @@ Function UniteBinaryData(BinaryData1, BinaryData2) Export 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); EndDo; diff --git a/src/en/OPI/src/CommonModules/OPI_Dropbox/Module.bsl b/src/en/OPI/src/CommonModules/OPI_Dropbox/Module.bsl index 2d6ed7549a..1f4e9af7b0 100644 --- a/src/en/OPI/src/CommonModules/OPI_Dropbox/Module.bsl +++ b/src/en/OPI/src/CommonModules/OPI_Dropbox/Module.bsl @@ -467,17 +467,17 @@ EndFunction // Parameters: // Token - String - Token - token // 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: // 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"; Parameters = New Structure; OPI_Tools.AddField("path" , Path , "String", Parameters); - OPI_Tools.AddField("limit", Quantity, "Number" , Parameters); + OPI_Tools.AddField("limit", Count, "Number" , Parameters); Headers = GetRequestHeaders(Token); Response = OPI_Tools.Post(URL, Parameters, Headers); diff --git a/src/en/OPI/src/CommonModules/OPI_GoogleCalendar/Module.bsl b/src/en/OPI/src/CommonModules/OPI_GoogleCalendar/Module.bsl index 06b8fa652f..07250fb6da 100644 --- a/src/en/OPI/src/CommonModules/OPI_GoogleCalendar/Module.bsl +++ b/src/en/OPI/src/CommonModules/OPI_GoogleCalendar/Module.bsl @@ -323,7 +323,7 @@ Function GetEventDescription() Export Event.Insert("Venue" , ""); // String description of the venue of the event Event.Insert("StartDate" , CurrentDate); // Date of start 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 Return Event; @@ -513,7 +513,7 @@ Function ConvertAttachments(Val Attachments) For Each Attachment In Attachments Do CurrentAttachment = New Structure; - CurrentAttachment.Insert("title" , Attachment.TheKey); + CurrentAttachment.Insert("title" , Attachment.Key); CurrentAttachment.Insert("fileUrl", Attachment.Value); AttachmentsArray.Add(CurrentAttachment); @@ -522,7 +522,7 @@ Function ConvertAttachments(Val Attachments) EndIf; - If AttachmentsArray.Quantity() > 0 Then + If AttachmentsArray.Count() > 0 Then Return AttachmentsArray; Else Return Undefined; @@ -599,7 +599,7 @@ Procedure GetCalendarsListRecursively(Val Headers, ArrayOfCalendars, Page = "") ArrayOfCalendars.Add(Calendar); EndDo; - If Calendars.Quantity() > 0 And ValueIsFilled(Page) Then + If Calendars.Count() > 0 And ValueIsFilled(Page) Then GetCalendarsListRecursively(Headers, ArrayOfCalendars, Page); EndIf; @@ -626,7 +626,7 @@ Procedure GetEventsListRecursively(Val Headers, Val Calendar, ArrayOfEvents, Pag ArrayOfEvents.Add(Event); EndDo; - If Events.Quantity() > 0 And ValueIsFilled(Page) Then + If Events.Count() > 0 And ValueIsFilled(Page) Then GetEventsListRecursively(Headers, ArrayOfEvents, Page); EndIf; diff --git a/src/en/OPI/src/CommonModules/OPI_GoogleDrive/Module.bsl b/src/en/OPI/src/CommonModules/OPI_GoogleDrive/Module.bsl index cd82b4d8cc..03f6e38d10 100644 --- a/src/en/OPI/src/CommonModules/OPI_GoogleDrive/Module.bsl +++ b/src/en/OPI/src/CommonModules/OPI_GoogleDrive/Module.bsl @@ -456,7 +456,7 @@ Procedure GetObjectsListRecursively(Val Headers, ArrayOfObjects, Detailed = Fals ArrayOfObjects.Add(CurrentObject); EndDo; - If Objects.Quantity() > 0 And ValueIsFilled(Page) Then + If Objects.Count() > 0 And ValueIsFilled(Page) Then GetObjectsListRecursively(Headers, ArrayOfObjects, Detailed, Filter, Page); EndIf; @@ -495,7 +495,7 @@ Procedure FormFileUploadParameters(Description) For Each Element In Description Do - If Element.TheKey = "Parent" Then + If Element.Key = "Parent" Then CurrentValue = New Array; CurrentValue.Add(Element.Value); @@ -506,7 +506,7 @@ Procedure FormFileUploadParameters(Description) EndIf; - FieldName = FieldMapping.Get(Element.TheKey); + FieldName = FieldMapping.Get(Element.Key); FormedDescription.Insert(FieldName, CurrentValue); EndDo; @@ -581,7 +581,7 @@ EndFunction Function UploadLargeFile(Val Description, Val FileMapping, Val Headers, Val Identifier = "") For Each File In FileMapping Do - Binary = File.TheKey; + Binary = File.Key; Break; EndDo; @@ -709,7 +709,7 @@ Function CheckPartUpload(Response, StrTotalSize, AdditionalHeaders, UploadURL, C ArrayOfInformation = StrSplit(UploadedData, "-", False); PartsRequired = 2; - If Not ArrayOfInformation.Quantity() = PartsRequired Then + If Not ArrayOfInformation.Count() = PartsRequired Then OPI_Tools.ProcessResponse(Response); Return Response; EndIf; diff --git a/src/en/OPI/src/CommonModules/OPI_GoogleSheets/Module.bsl b/src/en/OPI/src/CommonModules/OPI_GoogleSheets/Module.bsl index 8a421d94df..cdd259b74b 100644 --- a/src/en/OPI/src/CommonModules/OPI_GoogleSheets/Module.bsl +++ b/src/en/OPI/src/CommonModules/OPI_GoogleSheets/Module.bsl @@ -377,7 +377,7 @@ Function FormCellDataArray(Val ValueStructure, Val MajorDimension, Val Sheet) For Each CellData In ValueStructure Do CurrentValue = CellData.Value; - CurrentKey = CellData.TheKey; + CurrentKey = CellData.Key; AddSheetName(CurrentKey, Sheet); diff --git a/src/en/OPI/src/CommonModules/OPI_Notion/Module.bsl b/src/en/OPI/src/CommonModules/OPI_Notion/Module.bsl index b24adcc3d2..5b41d81432 100644 --- a/src/en/OPI/src/CommonModules/OPI_Notion/Module.bsl +++ b/src/en/OPI/src/CommonModules/OPI_Notion/Module.bsl @@ -224,7 +224,7 @@ Function CreateDatabase(Val Token, Val Parent, Val Title, Val Properties = "") E // Name : title // Description : rich_text // InProgress : checkbox - // Quantity : number + // Count : number // Date : date // Status : Map // Аtoтиinный : green @@ -587,7 +587,7 @@ EndProcedure Procedure AddDatabaseProperties(Val Properties, MainStructure) - If Properties.Quantity() = 0 Then + If Properties.Count() = 0 Then MainStructure.Insert("properties", New Structure); Return; EndIf; @@ -598,17 +598,17 @@ Procedure AddDatabaseProperties(Val Properties, MainStructure) 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") Or TypeOf(Property.Value) = Type("Map") Then ValueSelection = FormSelectionValues(Property.Value); - ParameterMap.Insert(Property.TheKey, New Structure("select", ValueSelection)); + ParameterMap.Insert(Property.Key, New Structure("select", ValueSelection)); Else - ParameterMap.Insert(Property.TheKey, Property.Value); + ParameterMap.Insert(Property.Key, Property.Value); EndIf; @@ -625,7 +625,7 @@ Function FormSelectionValues(Val VariantStructure) For Each Option In VariantStructure Do OptionMap = New Map; - OptionMap.Insert("name" , Option.TheKey); + OptionMap.Insert("name" , Option.Key); OptionMap.Insert("color", Option.Value); OptionArray.Add(OptionMap); @@ -654,7 +654,7 @@ Function FillDataBySchema(Val Scheme, Val Data, Val Token, Val ThisIsBase = True FieldData = Field.Value; FieldType = FieldData["type"]; - FillableData = Data.Get(Field.TheKey); + FillableData = Data.Get(Field.Key); If FillableData = Undefined Then Continue; @@ -860,7 +860,7 @@ Function ConvertFiles(Val FileMapping) FileStructure = New Structure; FileStructure.Insert("type" , "external"); - FileStructure.Insert("name" , File.TheKey); + FileStructure.Insert("name" , File.Key); FileStructure.Insert("external", New Structure("url", File.Value)); ArrayOfFiles.Add(FileStructure); diff --git a/src/en/OPI/src/CommonModules/OPI_Telegram/Module.bsl b/src/en/OPI/src/CommonModules/OPI_Telegram/Module.bsl index a4ca00f1e1..6b86404ec7 100644 --- a/src/en/OPI/src/CommonModules/OPI_Telegram/Module.bsl +++ b/src/en/OPI/src/CommonModules/OPI_Telegram/Module.bsl @@ -179,34 +179,34 @@ Function ProcessTMAData(Val DataString, Val Token) Export DataString = DecodeString(DataString, StringEncodingMethod.URLencoding); DataStructure = OPI_Tools.RequestParametersToMatch(DataString); - TheKey = "WebAppData"; + Key = "WebAppData"; Hash = ""; - BinaryKey = GetBinaryDataFromString(TheKey); + BinaryKey = GetBinaryDataFromString(Key); Result = OPI_Cryptography.HMACSHA256(BinaryKey, GetBinaryDataFromString(Token)); TValue = New ValueTable; - TValue.Columns.Add("TheKey"); + TValue.Columns.Add("Key"); TValue.Columns.Add("Value"); For Each Data In DataStructure Do NewLine = TValue.Add(); - NewLine.TheKey = Data.TheKey; + NewLine.Key = Data.Key; NewLine.Value = Data.Value; EndDo; - TValue.Sort("TheKey"); + TValue.Sort("Key"); ReturnMapping = New Map; DCS = ""; For Each DataString In TValue Do - If DataString.TheKey <> "hash" Then - DCS = DCS + DataString.TheKey + "=" + DataString.Value + Chars.PS; - ReturnMapping.Insert(DataString.TheKey, DataString.Value); + If DataString.Key <> "hash" Then + DCS = DCS + DataString.Key + "=" + DataString.Value + Chars.PS; + ReturnMapping.Insert(DataString.Key, DataString.Value); Else Hash = DataString.Value; EndIf; @@ -410,7 +410,7 @@ Function SendMediaGroup(Val Token , Val Markup = "Markdown") Export // FileMapping - // TheKey - File, Value - Type + // Key - File, Value - Type // Types: audio, document, photo, video // Different types cannot be mixed! @@ -1165,12 +1165,12 @@ Procedure FormMediaArray(Val FileMapping, Val Text, FileStructure, Media) 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); - ThisFile = New File(CurrentFile.TheKey); + ThisFile = New File(CurrentFile.Key); MediaName = CurrentFile.Value + String(Counter) + ?(CurrentFile.Value = "document", ThisFile.Extension, ""); @@ -1178,7 +1178,7 @@ Procedure FormMediaArray(Val FileMapping, Val Text, FileStructure, Media) FullMediaName = StrReplace(MediaName, ".", "___"); Else - Binary = CurrentFile.TheKey; + Binary = CurrentFile.Key; MediaName = CurrentFile.Value + String(Counter); FullMediaName = MediaName; EndIf; @@ -1208,7 +1208,7 @@ Procedure AddChatIdentifier(Val ChatID, Parameters) ChatID = OPI_Tools.NumberToString(ChatID); ChatArray = StrSplit(ChatID, "*", False); - If ChatArray.Quantity() > 1 Then + If ChatArray.Count() > 1 Then ChatID = ChatArray[0]; ThreadID = ChatArray[1]; diff --git a/src/en/OPI/src/CommonModules/OPI_TestDataRetrieval/Module.bsl b/src/en/OPI/src/CommonModules/OPI_TestDataRetrieval/Module.bsl index d350414e9b..7db635b446 100644 --- a/src/en/OPI/src/CommonModules/OPI_TestDataRetrieval/Module.bsl +++ b/src/en/OPI/src/CommonModules/OPI_TestDataRetrieval/Module.bsl @@ -244,7 +244,7 @@ Function FormYAXTests() Export For Each Section In Sections Do - CurrentSection = Section.TheKey; + CurrentSection = Section.Key; Filter = New Structure("Section", CurrentSection); SectionTests = TestTable.FindLines(Filter); diff --git a/src/en/OPI/src/CommonModules/OPI_Tests/Module.bsl b/src/en/OPI/src/CommonModules/OPI_Tests/Module.bsl index 0caaa6ec6a..260f539f5a 100644 --- a/src/en/OPI/src/CommonModules/OPI_Tests/Module.bsl +++ b/src/en/OPI/src/CommonModules/OPI_Tests/Module.bsl @@ -1147,15 +1147,15 @@ EndProcedure Procedure YDisk_GetFileList() Export Token = OPI_TestDataRetrieval.GetParameter("YandexDisk_Token"); - Quantity = 2; + Count = 2; Indent = 1; - Result = OPI_YandexDisk.GetFilesList(Token, Quantity, Indent, "image"); + Result = OPI_YandexDisk.GetFilesList(Token, Count, Indent, "image"); // !OInt OPI_TestDataRetrieval.WriteLog(Result, "GetFileList"); 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["items"]).HasType("Array"); @@ -1253,15 +1253,15 @@ EndProcedure Procedure YDisk_GetPublishedList() Export Token = OPI_TestDataRetrieval.GetParameter("YandexDisk_Token"); - Quantity = 2; + Count = 2; Indent = 1; - Result = OPI_YandexDisk.GetPublishedObjectsList(Token, Quantity, Indent); + Result = OPI_YandexDisk.GetPublishedObjectsList(Token, Count, Indent); // !OInt OPI_TestDataRetrieval.WriteLog(Result, "GetPublishedObjectList"); 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["items"]).HasType("Array"); @@ -2028,14 +2028,14 @@ Procedure GT_FillClearCells() Export // !OInt OPI_TestDataRetrieval.WriteLog(Result, "SetCellValues"); 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); // !OInt OPI_TestDataRetrieval.WriteLog(Result, "GetCellValues"); 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); @@ -2053,7 +2053,7 @@ Procedure GT_FillClearCells() Export // !OInt OPI_TestDataRetrieval.WriteLog(Result, "ClearCells"); 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 @@ -3060,7 +3060,7 @@ Procedure AT_CreateDeleteRecords() Export // !OInt OPI_TestDataRetrieval.WriteLog(Result, "CreateRecords"); 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 ArrayOfDeletions.Add(Record["id"]); @@ -3575,12 +3575,12 @@ Procedure Check_DropboxMetadata(Val Result, Val Path) EndProcedure -Procedure Check_DropboxArray(Val Result, Val Quantity = Undefined) +Procedure Check_DropboxArray(Val Result, Val Count = Undefined) OPI_TestDataRetrieval.ExpectsThat(Result["entries"]).HasType("Array"); - If Not Quantity = Undefined Then - OPI_TestDataRetrieval.ExpectsThat(Result["entries"].Quantity()).Equal(Quantity); + If Not Count = Undefined Then + OPI_TestDataRetrieval.ExpectsThat(Result["entries"].Count()).Equal(Count); EndIf; EndProcedure @@ -3593,10 +3593,10 @@ Procedure Check_DropboxStatus(Val Result) OPI_TestDataRetrieval.ExpectsThat(Result[".tag"]).Equal("complete"); 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"].Quantity()).Equal(Quantity); + OPI_TestDataRetrieval.ExpectsThat(Result["paths_to_tags"].Count()).Equal(Count); EndProcedure @@ -5102,7 +5102,7 @@ Procedure Dropbox_GetTagList(FunctionParameters) // !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"); diff --git a/src/en/OPI/src/CommonModules/OPI_Tools/Module.bsl b/src/en/OPI/src/CommonModules/OPI_Tools/Module.bsl index 0e13cd48df..2609f06a51 100644 --- a/src/en/OPI/src/CommonModules/OPI_Tools/Module.bsl +++ b/src/en/OPI/src/CommonModules/OPI_Tools/Module.bsl @@ -199,7 +199,7 @@ Function CreateRequest(Val Address, Val AdditionalHeaders = "", Val DataType = " If TypeOf(AdditionalHeaders) = Type("Map") Then For Each Title In AdditionalHeaders Do - Headers.Insert(Title.TheKey, Title.Value); + Headers.Insert(Title.Key, Title.Value); EndDo; EndIf; @@ -229,7 +229,7 @@ EndFunction Function RequestParametersToString(Val Parameters) Export - If Parameters.Quantity() = 0 Then + If Parameters.Count() = 0 Then Return ""; EndIf; @@ -240,7 +240,7 @@ Function RequestParametersToString(Val Parameters) Export ParameterValue = ConvertParameterToString(Parameter.Value); ParameterString = ParameterString - + Parameter.TheKey + + Parameter.Key + "=" + ParameterValue + "&"; @@ -344,7 +344,7 @@ Function RequestParametersToMatch(Val ParameterString) Export KeyValueArray = StrSplit(Parameter, "="); - If KeyValueArray.Quantity() = NumberOfParts Then + If KeyValueArray.Count() = NumberOfParts Then ReturnMapping.Insert(KeyValueArray[0], KeyValueArray[1]); EndIf; @@ -453,7 +453,7 @@ Procedure ReplaceSpecialCharacters(Text, Markup = "Markdown") Export EndIf; For Each ArraySymbol In CharacterMapping Do - Text = StrReplace(Text, ArraySymbol.TheKey, ArraySymbol.Value); + Text = StrReplace(Text, ArraySymbol.Key, ArraySymbol.Value); EndDo; EndProcedure @@ -849,7 +849,7 @@ Procedure WriteMultipartParameters(TextRecord, Val Boundary, Val Parameters) EndIf; 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); @@ -883,14 +883,14 @@ Procedure WriteMultipartFiles(TextRecord, Val Boundary, Val ContentType, Val Fil For Each File In Files Do - FilePath = StrReplace(File.TheKey, DotReplacement, "."); + FilePath = StrReplace(File.Key, DotReplacement, "."); If ContentType = "image/jpeg" Then SendingFileName = "photo"; Else - SendingFileName = StrReplace(File.TheKey, DotReplacement, "."); + SendingFileName = StrReplace(File.Key, DotReplacement, "."); SendingFileName = Left(SendingFileName, StrFind(SendingFileName, ".") - 1); - SendingFileName = ?(ValueIsFilled(SendingFileName), SendingFileName, StrReplace(File.TheKey, + SendingFileName = ?(ValueIsFilled(SendingFileName), SendingFileName, StrReplace(File.Key, DotReplacement, ".")); EndIf; @@ -930,7 +930,7 @@ Procedure WriteRelatedFiles(TextRecord, Val Boundary, Val Files) TextRecord.WriteString("Content-Type: " + File.Value); TextRecord.WriteString(LineSeparator); TextRecord.WriteString(LineSeparator); - WriteBinaryData(TextRecord, File.TheKey); + WriteBinaryData(TextRecord, File.Key); TextRecord.WriteString(LineSeparator); TextRecord.WriteString(LineSeparator); @@ -1006,7 +1006,7 @@ Procedure RemoveEmptyKeyValues(Val Collection, OutputCollection) For Each CollectionItem In Collection Do If Not CollectionItem.Value = Undefined And Not CollectionItem.Value = NULL Then - OutputCollection.Insert(CollectionItem.TheKey, CollectionItem.Value); + OutputCollection.Insert(CollectionItem.Key, CollectionItem.Value); EndIf; EndDo; diff --git a/src/en/OPI/src/CommonModules/OPI_Twitter/Module.bsl b/src/en/OPI/src/CommonModules/OPI_Twitter/Module.bsl index fb524ff70a..74c1e20226 100644 --- a/src/en/OPI/src/CommonModules/OPI_Twitter/Module.bsl +++ b/src/en/OPI/src/CommonModules/OPI_Twitter/Module.bsl @@ -200,7 +200,7 @@ Function CreateCustomTweet(Val Text = "" PollDuration = Number(PollDuration); - If PollOptionsArray.Quantity() > 0 Then + If PollOptionsArray.Count() > 0 Then OptionStructure = New Structure("options,duration_minutes", PollOptionsArray, PollDuration); Fields.Insert("poll", OptionStructure); @@ -210,7 +210,7 @@ Function CreateCustomTweet(Val Text = "" EndIf; If TypeOf(MediaArray) = Type(Array) Then - If MediaArray.Quantity() > 0 Then + If MediaArray.Count() > 0 Then Fields.Insert("media", New Structure("media_ids", MediaArray)); EndIf; EndIf; @@ -379,7 +379,7 @@ EndFunction Function UploadMediaInParts(Val File, Val Type, Val RequestType, Val URL, Parameters) Unit = 1024; - Quantity = 4; + Count = 4; MediaKey = "media_key"; MIS = "media_id_string"; 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_gif" , "image/gif"); - ChunkSize = Quantity * Unit * Unit; + ChunkSize = Count * Unit * Unit; ArrayReading = SplitBinaryData(File, ChunkSize); Fields = New Structure; @@ -540,7 +540,7 @@ Function GetStandardParameters(Val Parameters = "") If TypeOf(Parameters) = Type("Structure") Or TypeOf(Parameters) = Type("Map") Then 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; EndIf; @@ -561,54 +561,54 @@ Function CreateAuthorizationHeaderV1(Val Parameters, Val Fields, Val RequestType CurrentUNIXDate = OPI_Tools.UNIXTime(CurrentDate); CurrentUNIXDate = OPI_Tools.NumberToString(CurrentUNIXDate); ParametersTable = New ValueTable; - ParametersTable.Columns.Add("TheKey"); + ParametersTable.Columns.Add("Key"); ParametersTable.Columns.Add("Value"); For Each Field In Fields Do NewLine = ParametersTable.Add(); - NewLine.TheKey = Field.TheKey; + NewLine.Key = Field.Key; NewLine.Value = Field.Value; EndDo; NewLine = ParametersTable.Add(); - NewLine.TheKey = OCK; + NewLine.Key = OCK; NewLine.Value = Parameters[OCK]; NewLine = ParametersTable.Add(); - NewLine.TheKey = OTK; + NewLine.Key = OTK; NewLine.Value = Parameters[OTK]; NewLine = ParametersTable.Add(); - NewLine.TheKey = "oauth_version"; + NewLine.Key = "oauth_version"; NewLine.Value = APIVersion; NewLine = ParametersTable.Add(); - NewLine.TheKey = "oauth_signature_method"; + NewLine.Key = "oauth_signature_method"; NewLine.Value = HashingMethod; NewLine = ParametersTable.Add(); - NewLine.TheKey = "oauth_timestamp"; + NewLine.Key = "oauth_timestamp"; NewLine.Value = CurrentUNIXDate; NewLine = ParametersTable.Add(); - NewLine.TheKey = "oauth_nonce"; + NewLine.Key = "oauth_nonce"; NewLine.Value = CurrentUNIXDate; 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); EndDo; - ParametersTable.Sort("TheKey"); + ParametersTable.Sort("Key"); For Each TableRow In ParametersTable Do SignatureString = SignatureString - + TableRow.TheKey + + TableRow.Key + "=" + TableRow.Value + "&"; diff --git a/src/en/OPI/src/CommonModules/OPI_VK/Module.bsl b/src/en/OPI/src/CommonModules/OPI_VK/Module.bsl index 7519c0594c..f1e9b19ef5 100644 --- a/src/en/OPI/src/CommonModules/OPI_VK/Module.bsl +++ b/src/en/OPI/src/CommonModules/OPI_VK/Module.bsl @@ -444,7 +444,7 @@ Function UploadPhotoToServer(Val Image, Val Parameters = "", Val View = "Post") Method = DetermineImageUploadMethod(View); Files = New Map; - Response = "response"; + Response_ = "response"; URL = "api.vk.com/method/"; Upload = URL + Method["Upload"]; Save = URL + Method["Save"]; @@ -461,7 +461,7 @@ Function UploadPhotoToServer(Val Image, Val Parameters = "", Val View = "Post") For N = 1 To 5 Do Response = OPI_Tools.Get(Upload, Parameters); - Result = Response[Response]; + Result = Response[Response_]; If ValueIsFilled(Result) Then @@ -842,7 +842,7 @@ Function GetPostStatistics(Val PostIDsArray, Val Parameters = "") Export SetsArray.Add(OPI_Tools.NumberToString(Post)); - If SetsArray.Quantity() = MaximumPosts Then + If SetsArray.Count() = MaximumPosts Then NumbersString = StrConcat(SetsArray, ","); Parameters_.Insert("post_ids", NumbersString); @@ -1055,7 +1055,7 @@ EndFunction // Parameters - Structure Of String - See GetStandardParameters - auth - Authorization JSON or path to .json // // Returns: -// Map Of String - TheKey - ID, Value - Name +// Map Of String - Key - ID, Value - Name Function GetProductCategoryList(Val Parameters = "") Export Response = "response"; @@ -1065,9 +1065,9 @@ Function GetProductCategoryList(Val Parameters = "") Export If ValueIsFilled(Result) Then - Quantity = Result["count"]; + Count = Result["count"]; - If Not ValueIsFilled(Quantity) Then + If Not ValueIsFilled(Count) Then Return Response; EndIf; @@ -1075,7 +1075,7 @@ Function GetProductCategoryList(Val Parameters = "") Export Return Response; EndIf; - Parameters_.Insert("count", Quantity); + Parameters_.Insert("count", Count); Response = OPI_Tools.Get("api.vk.com/method/market.getCategories", Parameters_); Result = Response[Response]; @@ -1743,7 +1743,7 @@ Function GetStandardParameters(Val Parameters = "") If TypeOf(Parameters) = Type("Structure") Or TypeOf(Parameters) = Type("Map") Then 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; EndIf; @@ -1781,7 +1781,7 @@ Function GetImageCorrespondence(Val Image, Val Parameters, Val View) If Not ValueIsFilled(ResponseArray) Or Not TypeOf(ResponseArray) = Type("Array") Then Return Response; Else - If ResponseArray.Quantity() = 0 Then + If ResponseArray.Count() = 0 Then Return Response; Else ResponseCorrespondence = ResponseArray[0]; @@ -1819,7 +1819,7 @@ Function DetermineImageUploadMethod(Val View) MethodCorrespondence = New Map; Upload = "Upload"; Save = "Save"; - Method = "Method"; + Way = "Way"; Photo = "Photo"; If View = "Post" Then @@ -1827,33 +1827,33 @@ Function DetermineImageUploadMethod(Val View) MethodCorrespondence.Insert(Upload , "photos.getWallUploadServer"); MethodCorrespondence.Insert(Save, "photos.saveWallPhoto"); MethodCorrespondence.Insert(Photo , "photo"); - MethodCorrespondence.Insert(Method , 1); + MethodCorrespondence.Insert(Way , 1); ElsIf View = "Product" Then MethodCorrespondence.Insert(Upload , "market.getProductPhotoUploadServer"); MethodCorrespondence.Insert(Save, "market.saveProductPhoto"); - MethodCorrespondence.Insert(Method , 2); + MethodCorrespondence.Insert(Way , 2); ElsIf View = "Story" Then MethodCorrespondence.Insert(Upload , "stories.getPhotoUploadServer"); MethodCorrespondence.Insert(Save, "stories.save"); - MethodCorrespondence.Insert(Method , 3); + MethodCorrespondence.Insert(Way , 3); ElsIf View = "Poll" Then MethodCorrespondence.Insert(Upload , "polls.getPhotoUploadServer"); MethodCorrespondence.Insert(Save, "polls.savePhoto"); MethodCorrespondence.Insert(Photo , "photo"); - MethodCorrespondence.Insert(Method , 1); + MethodCorrespondence.Insert(Way , 1); Else MethodCorrespondence.Insert(Upload , "photos.getUploadServer"); MethodCorrespondence.Insert(Save, "photos.save"); MethodCorrespondence.Insert(Photo , "photos_list"); - MethodCorrespondence.Insert(Method , 1); + MethodCorrespondence.Insert(Way , 1); EndIf; @@ -1985,7 +1985,7 @@ Function AddImageParameter(Val Image, Val SelectionID, Parameters) Return Selections; EndIf; - If Not Selections.Quantity() = 0 Then + If Not Selections.Count() = 0 Then PhotoID = Selections[0]["photo"]["id"]; OPI_TypeConversion.GetLine(PhotoID); Parameters.Insert(PhotoID, PhotoID); @@ -2002,11 +2002,11 @@ EndFunction Procedure FillPhotoUploadParameters(Val Method, Val Response, Parameters) Response = "response"; - Method = Method["Method"]; + Way = Method["Way"]; StandardMethod = 1; NewMethod = 2; - If Method = StandardMethod Then + If Way = StandardMethod Then Hash = "hash"; Serv = "server"; @@ -2030,7 +2030,7 @@ Procedure FillPhotoUploadParameters(Val Method, Val Response, Parameters) Parameters.Insert(Aid , Identifier); EndIf; - ElsIf Method = NewMethod Then + ElsIf Way = NewMethod Then ResponseString = OPI_Tools.JSONString(Response); Parameters.Insert("upload_response", ResponseString); @@ -2091,10 +2091,10 @@ Procedure FillProductRequestFields(Val ProductDescription, Parameters) For Each Field In GetProductParameterMapping() Do - Value = ProductDescription[Field.TheKey]; + Value = ProductDescription[Field.Key]; If Value <> Undefined Then - Parameters.Insert(Field.Value, ProductDescription[Field.TheKey]); + Parameters.Insert(Field.Value, ProductDescription[Field.Key]); EndIf; EndDo; @@ -2104,7 +2104,7 @@ EndProcedure Procedure AddAdditionalProductPhotos(Val PhotoArray, Parameters) If TypeOf(PhotoArray) = Type("Array") Then - If PhotoArray.Quantity() > 0 Then + If PhotoArray.Count() > 0 Then PhotoString = ""; @@ -2134,7 +2134,7 @@ Procedure GetProductListRecursively(ProductsArray, Parameters, Shift = 0) Response = OPI_Tools.Get("api.vk.com/method/market.get", Parameters); Products = Response[Response]["items"]; - If Products.Quantity() = 0 Then + If Products.Count() = 0 Then Return; EndIf; @@ -2155,7 +2155,7 @@ Procedure GetAlbumListRecursively(ArrayOfAlbums, Parameters, Shift = 0) Response = OPI_Tools.Get("api.vk.com/method/market.getAlbums", Parameters); Albums = Response[Response]["items"]; - If Albums.Quantity() = 0 Then + If Albums.Count() = 0 Then Return; EndIf; @@ -2176,7 +2176,7 @@ Procedure GetOrderListRecursively(ArrayOfOrders, Parameters, Shift = 0) Response = OPI_Tools.Get("api.vk.com/method/market.getGroupOrders", Parameters); Orders = Response[Response]["items"]; - If Orders.Quantity() = 0 Then + If Orders.Count() = 0 Then Return; EndIf; diff --git a/src/en/OPI/src/CommonModules/OPI_YandexDisk/Module.bsl b/src/en/OPI/src/CommonModules/OPI_YandexDisk/Module.bsl index 762f61c450..5d9cd6fa52 100644 --- a/src/en/OPI/src/CommonModules/OPI_YandexDisk/Module.bsl +++ b/src/en/OPI/src/CommonModules/OPI_YandexDisk/Module.bsl @@ -251,7 +251,7 @@ EndFunction // // Parameters: // 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 // FilterByType - String - Filter by file type - type // SortByDate - Boolean - True > sort by date, False > alphabetically - datesort @@ -259,13 +259,13 @@ EndFunction // Returns: // Key-Value Pair - serialized JSON response from Yandex Function GetFilesList(Val Token - , Val Quantity = 0 + , Val Count = 0 , Val OffsetFromStart = 0 , Val FilterByType = "" , Val SortByDate = False) Export OPI_TypeConversion.GetLine(Token); - OPI_TypeConversion.GetLine(Quantity); + OPI_TypeConversion.GetLine(Count); OPI_TypeConversion.GetLine(OffsetFromStart); OPI_TypeConversion.GetLine(FilterByType); OPI_TypeConversion.GetBoolean(SortByDate); @@ -274,8 +274,8 @@ Function GetFilesList(Val Token Parameters = New Structure; - If ValueIsFilled(Quantity) Then - Parameters.Insert("limit", OPI_Tools.NumberToString(Quantity)); + If ValueIsFilled(Count) Then + Parameters.Insert("limit", OPI_Tools.NumberToString(Count)); EndIf; If ValueIsFilled(OffsetFromStart) Then @@ -443,23 +443,23 @@ EndFunction // // Parameters: // 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 // // Returns: // 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(Quantity); + OPI_TypeConversion.GetLine(Count); OPI_TypeConversion.GetLine(OffsetFromStart); Headers = AuthorizationHeader(Token); Parameters = New Structure; - If ValueIsFilled(Quantity) Then - Parameters.Insert("limit", Quantity); + If ValueIsFilled(Count) Then + Parameters.Insert("limit", Count); EndIf; If ValueIsFilled(OffsetFromStart) Then @@ -478,24 +478,24 @@ EndFunction // Parameters: // Token - String - Token - token // 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 // // Returns: // 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(URL); - OPI_TypeConversion.GetLine(Quantity); + OPI_TypeConversion.GetLine(Count); OPI_TypeConversion.GetLine(OffsetFromStart); Headers = AuthorizationHeader(Token); Parameters = New Structure; - If ValueIsFilled(Quantity) Then - Parameters.Insert("limit", OPI_Tools.NumberToString(Quantity)); + If ValueIsFilled(Count) Then + Parameters.Insert("limit", OPI_Tools.NumberToString(Count)); EndIf; If ValueIsFilled(OffsetFromStart) Then diff --git a/src/ru/OInt/core/Modules/OPI_VK.os b/src/ru/OInt/core/Modules/OPI_VK.os index 558c692f34..f4270a1668 100644 --- a/src/ru/OInt/core/Modules/OPI_VK.os +++ b/src/ru/OInt/core/Modules/OPI_VK.os @@ -444,7 +444,7 @@ Метод = ОпределитьМетодЗагрузкиИзображений(Вид); Файлы = Новый Соответствие; - Response = "response"; + Response_ = "response"; URL = "api.vk.com/method/"; Загрузка = URL + Метод["Загрузка"]; Сохранение = URL + Метод["Сохранение"]; @@ -461,7 +461,7 @@ Для Н = 1 По 5 Цикл Ответ = OPI_Инструменты.Get(Загрузка, Параметры); - Результат = Ответ[Response]; + Результат = Ответ[Response_]; Если ЗначениеЗаполнено(Результат) Тогда