You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2025-08-13 20:05:19 +02:00
Табуляция в локализации
This commit is contained in:
7
.github/workflows/os/opi_translate.os
vendored
7
.github/workflows/os/opi_translate.os
vendored
@@ -111,11 +111,16 @@
|
||||
|
||||
ТекущаяСтрока = СокрЛП(ДокументМодуля.ПолучитьСтроку(Н));
|
||||
|
||||
Если Не ЗначениеЗаполнено(ТекущаяСтрока) Тогда
|
||||
Продолжить;
|
||||
КонецЕсли;
|
||||
|
||||
Пока СтрНайти(ТекущаяСтрока, " ") <> 0 Цикл
|
||||
ТекущаяСтрока = СтрЗаменить(ТекущаяСтрока, " ", " ");
|
||||
КонецЦикла;
|
||||
|
||||
ДокументМодуля.ЗаменитьСтроку(Н, ТекущаяСтрока);
|
||||
ВыводимаяСтрока = СтрЗаменить(ДокументМодуля.ПолучитьСтроку(Н), СокрЛП(ДокументМодуля.ПолучитьСтроку(Н)), ТекущаяСтрока);
|
||||
ДокументМодуля.ЗаменитьСтроку(Н, ВыводимаяСтрока);
|
||||
|
||||
КонецЦикла;
|
||||
|
||||
|
@@ -1,18 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>OPI</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
|
||||
<nature>com._1c.g5.v8.dt.core.V8ExtensionNature</nature>
|
||||
</natures>
|
||||
<name>OPI</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
|
||||
<nature>com._1c.g5.v8.dt.core.V8ExtensionNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
@@ -37,92 +37,92 @@
|
||||
|
||||
// Get list of bases
|
||||
// Gets the list of available bases
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Indent - String - Next page identifier of the base list from the previous request - offset
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Airtable
|
||||
// Key-Value Pair - serialized JSON response from Airtable
|
||||
Function GetListOfBases(Val Token, Val Indent = "") Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Indent);
|
||||
|
||||
URL = "https://api.airtable.com/v0/meta/bases";
|
||||
Headers = GetAuthorizationHeader(Token);
|
||||
Parameters = New Structure;
|
||||
|
||||
OPI_Tools.AddField("offset", Indent, "String", Parameters);
|
||||
|
||||
Response = OPI_Tools.Get(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
|
||||
OPI_TypeConversion.GetLine(Indent);
|
||||
|
||||
URL = "https://api.airtable.com/v0/meta/bases";
|
||||
Headers = GetAuthorizationHeader(Token);
|
||||
Parameters = New Structure;
|
||||
|
||||
OPI_Tools.AddField("offset", Indent, "String", Parameters);
|
||||
|
||||
Response = OPI_Tools.Get(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Get base tables
|
||||
// Gets the schema of base tables
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Base - String - Base identifier - base
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Airtable
|
||||
Function GetDatabaseTables(Val Token, Val Base) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Base);
|
||||
|
||||
URL = "https://api.airtable.com/v0/meta/bases/" + Base + "/tables";
|
||||
Headers = GetAuthorizationHeader(Token);
|
||||
|
||||
Response = OPI_Tools.Get(URL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
|
||||
OPI_TypeConversion.GetLine(Base);
|
||||
|
||||
URL = "https://api.airtable.com/v0/meta/bases/" + Base + "/tables";
|
||||
Headers = GetAuthorizationHeader(Token);
|
||||
|
||||
Response = OPI_Tools.Get(URL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Create base
|
||||
// Creates a new database
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Workspace - String - Workspace identifier - ws
|
||||
// Name - String - New base name - title
|
||||
// TableCollection - Key-Value Pair - Table description: Key > name, Value > array of fields - tablesdata
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Airtable
|
||||
Function CreateDatabase(Val Token, Val Workspace, Val Name, Val TableCollection) Export
|
||||
|
||||
OPI_TypeConversion.GetCollection(TableCollection);
|
||||
|
||||
If Not TypeValue(TableCollection) = Type("Structure")
|
||||
And Not TypeValue(TableCollection) = Type("Match") Then
|
||||
|
||||
Raise "Error in table collection data";
|
||||
|
||||
EndIf;
|
||||
|
||||
URL = "https://api.airtable.com/v0/meta/bases";
|
||||
Headers = GetAuthorizationHeader(Token);
|
||||
TableArray = New Array;
|
||||
|
||||
For Each Table In TableCollection Do
|
||||
|
||||
Description = GenerateTableDescription(Table.Key, Table.Value);
|
||||
TableArray.Add(Description);
|
||||
|
||||
EndDo;
|
||||
|
||||
Parameters = New Structure;
|
||||
OPI_Tools.AddField("name" , Name , "String", Parameters);
|
||||
OPI_Tools.AddField("tables" , TableArray , "Array", Parameters);
|
||||
OPI_Tools.AddField("workspaceId", Workspace, "String", Parameters);
|
||||
|
||||
Response = OPI_Tools.Post(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
OPI_TypeConversion.GetCollection(TableCollection);
|
||||
|
||||
If Not TypeValue(TableCollection) = Type("Structure")
|
||||
And Not TypeValue(TableCollection) = Type("Match") Then
|
||||
|
||||
Raise "Error in table collection data";
|
||||
|
||||
EndIf;
|
||||
|
||||
URL = "https://api.airtable.com/v0/meta/bases";
|
||||
Headers = GetAuthorizationHeader(Token);
|
||||
TableArray = New Array;
|
||||
|
||||
For Each Table In TableCollection Do
|
||||
|
||||
Description = GenerateTableDescription(Table.Key, Table.Value);
|
||||
TableArray.Add(Description);
|
||||
|
||||
EndDo;
|
||||
|
||||
Parameters = New Structure;
|
||||
OPI_Tools.AddField("name" , Name , "String", Parameters);
|
||||
OPI_Tools.AddField("tables" , TableArray , "Array", Parameters);
|
||||
OPI_Tools.AddField("workspaceId", Workspace, "String", Parameters);
|
||||
|
||||
Response = OPI_Tools.Post(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
@@ -132,57 +132,57 @@ EndFunction
|
||||
|
||||
// Create table
|
||||
// Creates a new table in the base
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Base - String - Base identifier - base
|
||||
// Name - String - New table name - title
|
||||
// FieldArray - Array of Structures - Array of field descriptions - fieldsdata
|
||||
// Description - String - Table description - description
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Airtable
|
||||
Function CreateTable(Val Token, Val Base, Val Name, Val FieldArray, Val Description = "") Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Base);
|
||||
|
||||
URL = "https://api.airtable.com/v0/meta/bases/" + Base + "/tables";
|
||||
Headers = GetAuthorizationHeader(Token);
|
||||
Parameters = GenerateTableDescription(Name, FieldArray, Description);
|
||||
|
||||
Response = OPI_Tools.Post(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
OPI_TypeConversion.GetLine(Base);
|
||||
|
||||
URL = "https://api.airtable.com/v0/meta/bases/" + Base + "/tables";
|
||||
Headers = GetAuthorizationHeader(Token);
|
||||
Parameters = GenerateTableDescription(Name, FieldArray, Description);
|
||||
|
||||
Response = OPI_Tools.Post(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Modify table
|
||||
// Changes the name and/or description of the base
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Base - String - Base identifier - base
|
||||
// Table - String - Table identifier - table
|
||||
// Name - String - New name - title
|
||||
// Description - String - New description - description
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Airtable
|
||||
Function ModifyTable(Val Token, Val Base, Val Table, Val Name = "", Val Description = "") Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Base);
|
||||
OPI_TypeConversion.GetLine(Table);
|
||||
|
||||
URL = "https://api.airtable.com/v0/meta/bases/" + Base + "/tables/" + Table;
|
||||
Headers = GetAuthorizationHeader(Token);
|
||||
Parameters = New Structure;
|
||||
|
||||
OPI_Tools.AddField("name" , Name, "String", Parameters);
|
||||
OPI_Tools.AddField("description", Description , "String", Parameters);
|
||||
|
||||
Response = OPI_Tools.Patch(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
OPI_TypeConversion.GetLine(Base);
|
||||
OPI_TypeConversion.GetLine(Table);
|
||||
|
||||
URL = "https://api.airtable.com/v0/meta/bases/" + Base + "/tables/" + Table;
|
||||
Headers = GetAuthorizationHeader(Token);
|
||||
Parameters = New Structure;
|
||||
|
||||
OPI_Tools.AddField("name" , Name, "String", Parameters);
|
||||
OPI_Tools.AddField("description", Description , "String", Parameters);
|
||||
|
||||
Response = OPI_Tools.Patch(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
@@ -192,40 +192,40 @@ EndFunction
|
||||
|
||||
// Create field
|
||||
// Creates a new field in the table
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Base - String - Base identifier - base
|
||||
// Table - String - Table identifier - table
|
||||
// FieldStructure - Structure of Key-Value - Description of the new field - fielddata
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Airtable
|
||||
Function CreateField(Val Token, Val Base, Val Table, Val FieldStructure) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Base);
|
||||
OPI_TypeConversion.GetLine(Table);
|
||||
OPI_TypeConversion.GetCollection(FieldStructure);
|
||||
|
||||
If Not TypeValue(FieldStructure) = Type("Structure")
|
||||
And Not TypeValue(FieldStructure) = Type("Match") Then
|
||||
|
||||
Raise "Error in field description data";
|
||||
|
||||
EndIf;
|
||||
|
||||
URL = "https://api.airtable.com/v0/meta/bases/" + Base + "/tables/" + Table + "/fields";
|
||||
Headers = GetAuthorizationHeader(Token);
|
||||
|
||||
Response = OPI_Tools.Post(URL, FieldStructure, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
OPI_TypeConversion.GetLine(Base);
|
||||
OPI_TypeConversion.GetLine(Table);
|
||||
OPI_TypeConversion.GetCollection(FieldStructure);
|
||||
|
||||
If Not TypeValue(FieldStructure) = Type("Structure")
|
||||
And Not TypeValue(FieldStructure) = Type("Match") Then
|
||||
|
||||
Raise "Error in field description data";
|
||||
|
||||
EndIf;
|
||||
|
||||
URL = "https://api.airtable.com/v0/meta/bases/" + Base + "/tables/" + Table + "/fields";
|
||||
Headers = GetAuthorizationHeader(Token);
|
||||
|
||||
Response = OPI_Tools.Post(URL, FieldStructure, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Modify field
|
||||
// Changes the name and/or description of an existing table field
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Base - String - Base identifier Base - base
|
||||
@@ -233,142 +233,142 @@ EndFunction
|
||||
// Field - String - Field identifier - field
|
||||
// Name - String - New name - title
|
||||
// Description - String - New description - description
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Airtable
|
||||
Function ModifyField(Val Token, Val Base, Val Table, Val Field, Val Name = "", Val Description = "") Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Base);
|
||||
OPI_TypeConversion.GetLine(Table);
|
||||
OPI_TypeConversion.GetLine(Field);
|
||||
|
||||
URL = "https://api.airtable.com/v0/meta/bases/"
|
||||
+ Base
|
||||
+ "/tables/"
|
||||
+ Table
|
||||
+ "/fields/"
|
||||
+ Field;
|
||||
|
||||
Headers = GetAuthorizationHeader(Token);
|
||||
|
||||
Parameters = New Structure();
|
||||
OPI_Tools.AddField("name" , Name, "String", Parameters);
|
||||
OPI_Tools.AddField("description", Description , "String", Parameters);
|
||||
|
||||
Response = OPI_Tools.Patch(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
OPI_TypeConversion.GetLine(Base);
|
||||
OPI_TypeConversion.GetLine(Table);
|
||||
OPI_TypeConversion.GetLine(Field);
|
||||
|
||||
URL = "https://api.airtable.com/v0/meta/bases/"
|
||||
+ Base
|
||||
+ "/tables/"
|
||||
+ Table
|
||||
+ "/fields/"
|
||||
+ Field;
|
||||
|
||||
Headers = GetAuthorizationHeader(Token);
|
||||
|
||||
Parameters = New Structure();
|
||||
OPI_Tools.AddField("name" , Name, "String", Parameters);
|
||||
OPI_Tools.AddField("description", Description , "String", Parameters);
|
||||
|
||||
Response = OPI_Tools.Patch(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Get поле (withтроtoоinое)
|
||||
// Gets the description of a string field
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Name - String - New field name - title
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Structure - Field description
|
||||
Function GetStringField(Val Name) Export
|
||||
Return PrimitiveFieldDescription(Name, "richText");
|
||||
Return PrimitiveFieldDescription(Name, "richText");
|
||||
EndFunction
|
||||
|
||||
// Get поле (чиwithлоinое)
|
||||
// Gets the description of a numeric field
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Name - String - New field name - title
|
||||
// Precision - Number, String - Number of decimal places - precision
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Structure - Field description
|
||||
Function GetNumberField(Val Name, Val Precision = 0) Export
|
||||
|
||||
OPI_TypeConversion.GetNumber(Precision);
|
||||
|
||||
OptionsStructure = New Structure("precision", Precision);
|
||||
Return PrimitiveFieldDescription(Name, "number", OptionsStructure);
|
||||
|
||||
|
||||
OPI_TypeConversion.GetNumber(Precision);
|
||||
|
||||
OptionsStructure = New Structure("precision", Precision);
|
||||
Return PrimitiveFieldDescription(Name, "number", OptionsStructure);
|
||||
|
||||
EndFunction
|
||||
|
||||
// Get поле (file)
|
||||
// Gets the description of a file field
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Name - String - Field name - title
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Structure - Field description
|
||||
Function GetAttachmentField(Val Name) Export
|
||||
Return PrimitiveFieldDescription(Name, "multipleAttachments");
|
||||
Return PrimitiveFieldDescription(Name, "multipleAttachments");
|
||||
EndFunction
|
||||
|
||||
// Get поле (флажоto)
|
||||
// Gets the description of a boolean field
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Name - String - Field name - title
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Structure - Field description
|
||||
Function GetCheckboxField(Val Name) Export
|
||||
|
||||
OptionsStructure = New Structure("icon,color", "check", "yellowBright");
|
||||
Return PrimitiveFieldDescription(Name, "checkbox", OptionsStructure);
|
||||
|
||||
|
||||
OptionsStructure = New Structure("icon,color", "check", "yellowBright");
|
||||
Return PrimitiveFieldDescription(Name, "checkbox", OptionsStructure);
|
||||
|
||||
EndFunction
|
||||
|
||||
// Get поле (dата)
|
||||
// Gets the description of a date field
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Name - String - Field name - title
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Structure - Field description
|
||||
Function GetDateField(Val Name) Export
|
||||
|
||||
FormatStructure = New Structure("format,name", "YYYY-MM-DD", "iso");
|
||||
OptionsStructure = New Structure("dateFormat", FormatStructure);
|
||||
|
||||
Return PrimitiveFieldDescription(Name, "date", OptionsStructure);
|
||||
|
||||
|
||||
FormatStructure = New Structure("format,name", "YYYY-MM-DD", "iso");
|
||||
OptionsStructure = New Structure("dateFormat", FormatStructure);
|
||||
|
||||
Return PrimitiveFieldDescription(Name, "date", OptionsStructure);
|
||||
|
||||
EndFunction
|
||||
|
||||
// Get поле (email)
|
||||
// Gets the description of an email field
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Name - String - Field name - title
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Structure - Field description
|
||||
Function GetEmailField(Val Name) Export
|
||||
Return PrimitiveFieldDescription(Name, "email");
|
||||
Return PrimitiveFieldDescription(Name, "email");
|
||||
EndFunction
|
||||
|
||||
// Get поле (телефон)
|
||||
// Gets the description of a phone number field
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Name - String - Field name - title
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Structure - Field description
|
||||
Function GetPhoneField(Val Name) Export
|
||||
Return PrimitiveFieldDescription(Name, "phoneNumber");
|
||||
Return PrimitiveFieldDescription(Name, "phoneNumber");
|
||||
EndFunction
|
||||
|
||||
// Get поле (url)
|
||||
// Gets the description of a URL field
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Name - String - Field name - title
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Structure - Field description
|
||||
Function GetLinkField(Val Name) Export
|
||||
Return PrimitiveFieldDescription(Name, "url");
|
||||
Return PrimitiveFieldDescription(Name, "url");
|
||||
EndFunction
|
||||
|
||||
#EndRegion
|
||||
@@ -377,120 +377,120 @@ EndFunction
|
||||
|
||||
// Get list of records
|
||||
// Gets the list of records of the selected table
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Base - String - Database identifier - base
|
||||
// Table - String - Table identifier - table
|
||||
// Indent - String - Next page identifier of data from the previous request - offset
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Airtable
|
||||
Function GetListOfRecords(Val Token, Val Base, Val Table, Val Indent = "") Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Base);
|
||||
OPI_TypeConversion.GetLine(Table);
|
||||
|
||||
URL = "https://api.airtable.com/v0/" + Base + "/" + Table;
|
||||
Headers = GetAuthorizationHeader(Token);
|
||||
|
||||
Parameters = New Structure();
|
||||
OPI_Tools.AddField("offset", Indent, "String", Parameters);
|
||||
|
||||
Response = OPI_Tools.Get(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
OPI_TypeConversion.GetLine(Base);
|
||||
OPI_TypeConversion.GetLine(Table);
|
||||
|
||||
URL = "https://api.airtable.com/v0/" + Base + "/" + Table;
|
||||
Headers = GetAuthorizationHeader(Token);
|
||||
|
||||
Parameters = New Structure();
|
||||
OPI_Tools.AddField("offset", Indent, "String", Parameters);
|
||||
|
||||
Response = OPI_Tools.Get(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Get record
|
||||
// Gets row data of the table by identifier
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Base - String - Database identifier - base
|
||||
// Table - String - Table identifier - table
|
||||
// Record - String - Record identifier in the table - record
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Airtable
|
||||
Function GetRecord(Val Token, Val Base, Val Table, Val Record) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Base);
|
||||
OPI_TypeConversion.GetLine(Table);
|
||||
OPI_TypeConversion.GetLine(Record);
|
||||
|
||||
URL = "https://api.airtable.com/v0/" + Base + "/" + Table + "/" + Record;
|
||||
Headers = GetAuthorizationHeader(Token);
|
||||
|
||||
OPI_TypeConversion.GetLine(Base);
|
||||
OPI_TypeConversion.GetLine(Table);
|
||||
OPI_TypeConversion.GetLine(Record);
|
||||
|
||||
URL = "https://api.airtable.com/v0/" + Base + "/" + Table + "/" + Record;
|
||||
Headers = GetAuthorizationHeader(Token);
|
||||
|
||||
Response = OPI_Tools.Get(URL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
Response = OPI_Tools.Get(URL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Create records
|
||||
// Creates one or an array of records by description or an array of field value descriptions
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Base - String - Database identifier - base
|
||||
// Table - String - Table identifier - table
|
||||
// Data - Structure, Array of Structures - Set or array of sets of Key : Value pairs > Field : Indicator - data
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Airtable
|
||||
Function CreatePosts(Val Token, Val Base, Val Table, Val Data) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Base);
|
||||
OPI_TypeConversion.GetLine(Table);
|
||||
OPI_TypeConversion.GetCollection(Data);
|
||||
OPI_TypeConversion.GetLine(Base);
|
||||
OPI_TypeConversion.GetLine(Table);
|
||||
OPI_TypeConversion.GetCollection(Data);
|
||||
|
||||
Parameters = New Structure();
|
||||
AddDataDescription(Data, Parameters);
|
||||
|
||||
Parameters = New Structure();
|
||||
AddDataDescription(Data, Parameters);
|
||||
|
||||
URL = "https://api.airtable.com/v0/" + Base + "/" + Table;
|
||||
Headers = GetAuthorizationHeader(Token);
|
||||
|
||||
Response = OPI_Tools.Post(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
URL = "https://api.airtable.com/v0/" + Base + "/" + Table;
|
||||
Headers = GetAuthorizationHeader(Token);
|
||||
|
||||
Response = OPI_Tools.Post(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Delete records
|
||||
// Deletes one or an array of records by identifiers
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Base - String - Database identifier - base
|
||||
// Table - String - Table identifier - table
|
||||
// Records - String, Array of Strings - Identifier or array of record identifiers - records
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Airtable
|
||||
Function DeletePosts(Val Token, Val Base, Val Table, Val Records) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Base);
|
||||
OPI_TypeConversion.GetLine(Table);
|
||||
OPI_TypeConversion.GetArray(Records);
|
||||
|
||||
RecordString = "";
|
||||
|
||||
For Each Record In Records Do
|
||||
RecordString = RecordString
|
||||
+ ?(ValueIsFilled(RecordString), "&", "?")
|
||||
+ "records[]="
|
||||
+ OPI_Tools.NumberToString(Record);
|
||||
EndDo;
|
||||
|
||||
URL = "https://api.airtable.com/v0/" + Base + "/" + Table + RecordString;
|
||||
Headers = GetAuthorizationHeader(Token);
|
||||
|
||||
OPI_TypeConversion.GetLine(Base);
|
||||
OPI_TypeConversion.GetLine(Table);
|
||||
OPI_TypeConversion.GetArray(Records);
|
||||
|
||||
RecordString = "";
|
||||
|
||||
For Each Record In Records Do
|
||||
RecordString = RecordString
|
||||
+ ?(ValueIsFilled(RecordString), "&", "?")
|
||||
+ "records[]="
|
||||
+ OPI_Tools.NumberToString(Record);
|
||||
EndDo;
|
||||
|
||||
URL = "https://api.airtable.com/v0/" + Base + "/" + Table + RecordString;
|
||||
Headers = GetAuthorizationHeader(Token);
|
||||
|
||||
Response = OPI_Tools.Delete(URL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
Response = OPI_Tools.Delete(URL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
#EndRegion
|
||||
@@ -499,67 +499,67 @@ EndFunction
|
||||
|
||||
// Get comments
|
||||
// Gets the list of comments for a record in the table
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Base - String - Database identifier - base
|
||||
// Table - String - Table identifier - table
|
||||
// Record - String - Record identifier in the table - record
|
||||
// Indent - String - Next page identifier of data from the previous request - offset
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Airtable
|
||||
Function GetComments(Val Token, Val Base, Val Table, Val Record, Val Indent = "") Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Base);
|
||||
OPI_TypeConversion.GetLine(Table);
|
||||
OPI_TypeConversion.GetLine(Record);
|
||||
|
||||
URL = "https://api.airtable.com/v0/" + Base + "/" + Table + "/" + Record + "/comments";
|
||||
Headers = GetAuthorizationHeader(Token);
|
||||
|
||||
Parameters = New Structure();
|
||||
OPI_Tools.AddField("offset", Indent, "String", Parameters);
|
||||
|
||||
Response = OPI_Tools.Get(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
|
||||
OPI_TypeConversion.GetLine(Base);
|
||||
OPI_TypeConversion.GetLine(Table);
|
||||
OPI_TypeConversion.GetLine(Record);
|
||||
|
||||
URL = "https://api.airtable.com/v0/" + Base + "/" + Table + "/" + Record + "/comments";
|
||||
Headers = GetAuthorizationHeader(Token);
|
||||
|
||||
Parameters = New Structure();
|
||||
OPI_Tools.AddField("offset", Indent, "String", Parameters);
|
||||
|
||||
Response = OPI_Tools.Get(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Create comment
|
||||
// Creates a comment for a record in the table
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Base - String - Database identifier - base
|
||||
// Table - String - Table identifier - table
|
||||
// Record - String - Record identifier in the table - record
|
||||
// Text - String - Comment text - text
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Airtable
|
||||
Function CreateComment(Val Token, Val Base, Val Table, Val Record, Val Text) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Base);
|
||||
OPI_TypeConversion.GetLine(Table);
|
||||
OPI_TypeConversion.GetLine(Record);
|
||||
|
||||
URL = "https://api.airtable.com/v0/" + Base + "/" + Table + "/" + Record + "/comments";
|
||||
Headers = GetAuthorizationHeader(Token);
|
||||
|
||||
Parameters = New Structure();
|
||||
OPI_Tools.AddField("text", Text, "String", Parameters);
|
||||
|
||||
Response = OPI_Tools.Post(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
|
||||
OPI_TypeConversion.GetLine(Base);
|
||||
OPI_TypeConversion.GetLine(Table);
|
||||
OPI_TypeConversion.GetLine(Record);
|
||||
|
||||
URL = "https://api.airtable.com/v0/" + Base + "/" + Table + "/" + Record + "/comments";
|
||||
Headers = GetAuthorizationHeader(Token);
|
||||
|
||||
Parameters = New Structure();
|
||||
OPI_Tools.AddField("text", Text, "String", Parameters);
|
||||
|
||||
Response = OPI_Tools.Post(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Modify comment
|
||||
// Changes the text of an existing comment
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Base - String - Database identifier - base
|
||||
@@ -567,54 +567,54 @@ EndFunction
|
||||
// Record - String - Record identifier in the table - record
|
||||
// Comment - String - Comment identifier - comment
|
||||
// Text - String - New comment text - text
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Airtable
|
||||
Function EditComment(Val Token, Val Base, Val Table, Val Record, Val Comment, Val Text) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Base);
|
||||
OPI_TypeConversion.GetLine(Table);
|
||||
OPI_TypeConversion.GetLine(Record);
|
||||
OPI_TypeConversion.GetLine(Comment);
|
||||
|
||||
URL = "https://api.airtable.com/v0/" + Base + "/" + Table + "/" + Record + "/comments/" + Comment;
|
||||
Headers = GetAuthorizationHeader(Token);
|
||||
|
||||
Parameters = New Structure();
|
||||
OPI_Tools.AddField("text", Text, "String", Parameters);
|
||||
|
||||
Response = OPI_Tools.Patch(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
|
||||
OPI_TypeConversion.GetLine(Base);
|
||||
OPI_TypeConversion.GetLine(Table);
|
||||
OPI_TypeConversion.GetLine(Record);
|
||||
OPI_TypeConversion.GetLine(Comment);
|
||||
|
||||
URL = "https://api.airtable.com/v0/" + Base + "/" + Table + "/" + Record + "/comments/" + Comment;
|
||||
Headers = GetAuthorizationHeader(Token);
|
||||
|
||||
Parameters = New Structure();
|
||||
OPI_Tools.AddField("text", Text, "String", Parameters);
|
||||
|
||||
Response = OPI_Tools.Patch(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Delete comment
|
||||
// Deletes a comment for a table record
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Base - String - Database identifier - base
|
||||
// Table - String - Table identifier - table
|
||||
// Record - String - Record identifier in the table - record
|
||||
// Comment - String - Comment identifier - comment
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Airtable
|
||||
// Key-Value Pair - serialized JSON response from Airtable
|
||||
Function DeleteComment(Val Token, Val Base, Val Table, Val Record, Val Comment) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Base);
|
||||
OPI_TypeConversion.GetLine(Table);
|
||||
OPI_TypeConversion.GetLine(Record);
|
||||
OPI_TypeConversion.GetLine(Comment);
|
||||
|
||||
URL = "https://api.airtable.com/v0/" + Base + "/" + Table + "/" + Record + "/comments/" + Comment;
|
||||
Headers = GetAuthorizationHeader(Token);
|
||||
|
||||
Response = OPI_Tools.Delete(URL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
OPI_TypeConversion.GetLine(Base);
|
||||
OPI_TypeConversion.GetLine(Table);
|
||||
OPI_TypeConversion.GetLine(Record);
|
||||
OPI_TypeConversion.GetLine(Comment);
|
||||
|
||||
URL = "https://api.airtable.com/v0/" + Base + "/" + Table + "/" + Record + "/comments/" + Comment;
|
||||
Headers = GetAuthorizationHeader(Token);
|
||||
|
||||
Response = OPI_Tools.Delete(URL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
#EndRegion
|
||||
@@ -624,58 +624,58 @@ EndFunction
|
||||
#Region ServiceProceduresAndFunctions
|
||||
|
||||
Function GetAuthorizationHeader(Val Token)
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
|
||||
Headers = New Match;
|
||||
Headers.Insert("Authorization", "Bearer " + Token);
|
||||
|
||||
Return Headers;
|
||||
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
|
||||
Headers = New Match;
|
||||
Headers.Insert("Authorization", "Bearer " + Token);
|
||||
|
||||
Return Headers;
|
||||
|
||||
EndFunction
|
||||
|
||||
Function GenerateTableDescription(Val Name, Val FieldArray, Val Description = "")
|
||||
|
||||
OPI_TypeConversion.GetLine(Name);
|
||||
OPI_TypeConversion.GetCollection(FieldArray);
|
||||
|
||||
TableDescription = New Structure("name,fields", Name, FieldArray);
|
||||
|
||||
OPI_Tools.AddField("description", Description, "String", TableDescription);
|
||||
|
||||
Return TableDescription;
|
||||
|
||||
|
||||
OPI_TypeConversion.GetLine(Name);
|
||||
OPI_TypeConversion.GetCollection(FieldArray);
|
||||
|
||||
TableDescription = New Structure("name,fields", Name, FieldArray);
|
||||
|
||||
OPI_Tools.AddField("description", Description, "String", TableDescription);
|
||||
|
||||
Return TableDescription;
|
||||
|
||||
EndFunction
|
||||
|
||||
Function PrimitiveFieldDescription(Val Name, Val Type, Val Options = "")
|
||||
|
||||
FieldStructure = New Structure();
|
||||
OPI_Tools.AddField("name" , Name, "String" , FieldStructure);
|
||||
OPI_Tools.AddField("type" , Type , "String" , FieldStructure);
|
||||
OPI_Tools.AddField("options", Options , "Collection", FieldStructure);
|
||||
|
||||
Return FieldStructure;
|
||||
|
||||
FieldStructure = New Structure();
|
||||
OPI_Tools.AddField("name" , Name, "String" , FieldStructure);
|
||||
OPI_Tools.AddField("type" , Type , "String" , FieldStructure);
|
||||
OPI_Tools.AddField("options", Options , "Collection", FieldStructure);
|
||||
|
||||
Return FieldStructure;
|
||||
|
||||
EndFunction
|
||||
|
||||
Procedure AddDataDescription(Val Data, Parameters)
|
||||
|
||||
If TypeValue(Data) = Type("Array") Then
|
||||
|
||||
SendArray = New Array;
|
||||
|
||||
For Each RecordDescription In Data Do
|
||||
SendArray.Add(New Structure("fields", RecordDescription));
|
||||
EndDo;
|
||||
|
||||
OPI_Tools.AddField("records", SendArray, "Array", Parameters);
|
||||
|
||||
Else
|
||||
|
||||
OPI_Tools.AddField("fields", Data, "Collection", Parameters);
|
||||
|
||||
EndIf;
|
||||
|
||||
|
||||
If TypeValue(Data) = Type("Array") Then
|
||||
|
||||
SendArray = New Array;
|
||||
|
||||
For Each RecordDescription In Data Do
|
||||
SendArray.Add(New Structure("fields", RecordDescription));
|
||||
EndDo;
|
||||
|
||||
OPI_Tools.AddField("records", SendArray, "Array", Parameters);
|
||||
|
||||
Else
|
||||
|
||||
OPI_Tools.AddField("fields", Data, "Collection", Parameters);
|
||||
|
||||
EndIf;
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
|
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mdclass:CommonModule xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="457991ad-c2ad-49b8-a26a-9fc83c8a7d11">
|
||||
<name>OPI_Airtable</name>
|
||||
<synonym>
|
||||
<key></key>
|
||||
<value>OPI airtable</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
<name>OPI_Airtable</name>
|
||||
<synonym>
|
||||
<key></key>
|
||||
<value>OPI airtable</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
</mdclass:CommonModule>
|
||||
|
@@ -34,75 +34,75 @@
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Copyright (c) 2019, LLC 1C-Soft
|
||||
// All rights reserved. This program and accompanying materials are provided
|
||||
// All rights reserved. This program and accompanying materials are provided
|
||||
// in withоотinетwithтinии with уwithлоinиями лицензии Attribution 4.0 International (CC BY 4.0)
|
||||
// License text available at:
|
||||
// https://creativecommons.org/licenses/by/4.0/legalcode
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Function HMACSHA256(Val Key, Val Data) Export
|
||||
|
||||
Return HMAC(Key, Data, HashFunction.SHA256, 64);
|
||||
|
||||
|
||||
Return HMAC(Key, Data, HashFunction.SHA256, 64);
|
||||
|
||||
EndFunction
|
||||
|
||||
Function Hash(BinaryData, Type) Export
|
||||
|
||||
Hashing = New DataHashing(Type);
|
||||
Hashing.Add(BinaryData);
|
||||
|
||||
Return Hashing.HashSum;
|
||||
|
||||
|
||||
Hashing = New DataHashing(Type);
|
||||
Hashing.Add(BinaryData);
|
||||
|
||||
Return Hashing.HashSum;
|
||||
|
||||
EndFunction
|
||||
|
||||
Function HMAC(Val Key, Val Data, Type, BlockSize) Export
|
||||
|
||||
Twice = 2;
|
||||
|
||||
If Key.Size() > BlockSize Then
|
||||
Key = Hash(Key, Type);
|
||||
EndIf;
|
||||
|
||||
If Key.Size() <= BlockSize Then
|
||||
Key = GetHexStringFromBinaryData(Key);
|
||||
Key = Left(Key + RepeatString("00", BlockSize), BlockSize * Twice);
|
||||
EndIf;
|
||||
|
||||
Key = GetBinaryDataBufferFromBinaryData(GetBinaryDataFromHexString(Key));
|
||||
|
||||
Ipad = GetBinaryDataBufferFromHexString(RepeatString("36", BlockSize));
|
||||
Opad = GetBinaryDataBufferFromHexString(RepeatString("5c", BlockSize));
|
||||
|
||||
Ipad.WriteBitwiseExclusiveOr(0, Key);
|
||||
Ikeypad = GetBinaryDataFromBinaryDataBuffer(ipad);
|
||||
|
||||
Opad.WriteBitwiseExclusiveOr(0, Key);
|
||||
Okeypad = GetBinaryDataFromBinaryDataBuffer(opad);
|
||||
|
||||
Return Hash(ConcatenateBinaryData(okeypad, Hash(ConcatenateBinaryData(ikeypad, Data), Type)), Type);
|
||||
|
||||
|
||||
Twice = 2;
|
||||
|
||||
If Key.Size() > BlockSize Then
|
||||
Key = Hash(Key, Type);
|
||||
EndIf;
|
||||
|
||||
If Key.Size() <= BlockSize Then
|
||||
Key = GetHexStringFromBinaryData(Key);
|
||||
Key = Left(Key + RepeatString("00", BlockSize), BlockSize * Twice);
|
||||
EndIf;
|
||||
|
||||
Key = GetBinaryDataBufferFromBinaryData(GetBinaryDataFromHexString(Key));
|
||||
|
||||
Ipad = GetBinaryDataBufferFromHexString(RepeatString("36", BlockSize));
|
||||
Opad = GetBinaryDataBufferFromHexString(RepeatString("5c", BlockSize));
|
||||
|
||||
Ipad.WriteBitwiseExclusiveOr(0, Key);
|
||||
Ikeypad = GetBinaryDataFromBinaryDataBuffer(ipad);
|
||||
|
||||
Opad.WriteBitwiseExclusiveOr(0, Key);
|
||||
Okeypad = GetBinaryDataFromBinaryDataBuffer(opad);
|
||||
|
||||
Return Hash(ConcatenateBinaryData(okeypad, Hash(ConcatenateBinaryData(ikeypad, Data), Type)), Type);
|
||||
|
||||
EndFunction
|
||||
|
||||
Function ConcatenateBinaryData(BinaryData1, BinaryData2) Export
|
||||
|
||||
BinaryDataArray = New Array;
|
||||
BinaryDataArray.Add(BinaryData1);
|
||||
BinaryDataArray.Add(BinaryData2);
|
||||
|
||||
Return JoinBinaryData(BinaryDataArray);
|
||||
|
||||
|
||||
BinaryDataArray = New Array;
|
||||
BinaryDataArray.Add(BinaryData1);
|
||||
BinaryDataArray.Add(BinaryData2);
|
||||
|
||||
Return JoinBinaryData(BinaryDataArray);
|
||||
|
||||
EndFunction
|
||||
|
||||
Function RepeatString(String, Quantity) Export
|
||||
|
||||
Parts = New Array(Quantity);
|
||||
|
||||
For To = 1 For Quantity Do
|
||||
Parts.Add(String);
|
||||
EndDo;
|
||||
|
||||
Parts = New Array(Quantity);
|
||||
|
||||
For To = 1 For Quantity Do
|
||||
Parts.Add(String);
|
||||
EndDo;
|
||||
|
||||
Return StrJoin(Parts, "");
|
||||
|
||||
Return StrJoin(Parts, "");
|
||||
|
||||
EndFunction
|
||||
|
||||
#EndRegion
|
||||
|
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mdclass:CommonModule xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="55bb3987-d7ac-4ed7-a6fd-aa4cfeb61c27">
|
||||
<name>OPI_Cryptography</name>
|
||||
<synonym>
|
||||
<key>ru</key>
|
||||
<value>Toриптография (OPI)</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
<name>OPI_Cryptography</name>
|
||||
<synonym>
|
||||
<key>ru</key>
|
||||
<value>Toриптография (OPI)</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
</mdclass:CommonModule>
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,15 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mdclass:CommonModule xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="66ce7792-41e5-47e4-bfad-2dcff1c96287">
|
||||
<name>OPI_Dropbox</name>
|
||||
<synonym>
|
||||
<key></key>
|
||||
<value>OPI dropbox</value>
|
||||
</synonym>
|
||||
<synonym>
|
||||
<key>ru</key>
|
||||
<value>Drop box</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
<name>OPI_Dropbox</name>
|
||||
<synonym>
|
||||
<key></key>
|
||||
<value>OPI dropbox</value>
|
||||
</synonym>
|
||||
<synonym>
|
||||
<key>ru</key>
|
||||
<value>Drop box</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
</mdclass:CommonModule>
|
||||
|
@@ -42,429 +42,429 @@
|
||||
#Region ServiceProgramInterface
|
||||
|
||||
Function GetTestingSectionMapping() Export
|
||||
|
||||
StandardDependencies = "[Decode, Build]";
|
||||
GoogleDependencies = "Testing-GoogleWorkspace";
|
||||
|
||||
Sections = New Structure;
|
||||
Sections.Insert("Telegram" , StandardDependencies);
|
||||
Sections.Insert("VK" , StandardDependencies);
|
||||
Sections.Insert("Viber" , StandardDependencies);
|
||||
Sections.Insert("Twitter" , StandardDependencies);
|
||||
Sections.Insert("YandexDisk" , StandardDependencies);
|
||||
Sections.Insert("GoogleWorkspace", StandardDependencies);
|
||||
Sections.Insert("GoogleCalendar" , GoogleDependencies);
|
||||
Sections.Insert("GoogleDrive" , GoogleDependencies);
|
||||
Sections.Insert("GoogleSheets" , GoogleDependencies);
|
||||
Sections.Insert("Notion" , StandardDependencies);
|
||||
Sections.Insert("Slack" , StandardDependencies);
|
||||
Sections.Insert("Airtable" , StandardDependencies);
|
||||
Sections.Insert("Dropbox" , StandardDependencies);
|
||||
|
||||
Return Sections;
|
||||
|
||||
|
||||
StandardDependencies = "[Decode, Build]";
|
||||
GoogleDependencies = "Testing-GoogleWorkspace";
|
||||
|
||||
Sections = New Structure;
|
||||
Sections.Insert("Telegram" , StandardDependencies);
|
||||
Sections.Insert("VK" , StandardDependencies);
|
||||
Sections.Insert("Viber" , StandardDependencies);
|
||||
Sections.Insert("Twitter" , StandardDependencies);
|
||||
Sections.Insert("YandexDisk" , StandardDependencies);
|
||||
Sections.Insert("GoogleWorkspace", StandardDependencies);
|
||||
Sections.Insert("GoogleCalendar" , GoogleDependencies);
|
||||
Sections.Insert("GoogleDrive" , GoogleDependencies);
|
||||
Sections.Insert("GoogleSheets" , GoogleDependencies);
|
||||
Sections.Insert("Notion" , StandardDependencies);
|
||||
Sections.Insert("Slack" , StandardDependencies);
|
||||
Sections.Insert("Airtable" , StandardDependencies);
|
||||
Sections.Insert("Dropbox" , StandardDependencies);
|
||||
|
||||
Return Sections;
|
||||
|
||||
EndFunction
|
||||
|
||||
Function GetTestTable() Export
|
||||
|
||||
Telegram = "Telegram";
|
||||
VK = "VK";
|
||||
YDisk = "YandexDisk";
|
||||
Calendar = "GoogleCalendar";
|
||||
Twitter = "Twitter";
|
||||
Viber = "Viber";
|
||||
Drive = "GoogleDrive";
|
||||
VSpace = "GoogleWorkspace";
|
||||
Notion = "Notion";
|
||||
Slack = "Slack";
|
||||
Tables = "GoogleSheets";
|
||||
AirT = "Airtable";
|
||||
Dropbox = "Dropbox";
|
||||
|
||||
TestTable = New ValueTable;
|
||||
TestTable.Columns.Add("Method");
|
||||
TestTable.Columns.Add("Synonym");
|
||||
TestTable.Columns.Add("Section");
|
||||
|
||||
NewTest(TestTable, "Telegram_GetBotInfo" , "Get bot information" , Telegram);
|
||||
NewTest(TestTable, "Telegram_GetUpdates" , "Get updates" , Telegram);
|
||||
NewTest(TestTable, "Telegram_SetWebhook" , "Set Webhook" , Telegram);
|
||||
NewTest(TestTable, "Telegram_SendTextMessage" , "Send text message" , Telegram);
|
||||
NewTest(TestTable, "Telegram_SendImage" , "Send image" , Telegram);
|
||||
NewTest(TestTable, "Telegram_SendVideo" , "Send video" , Telegram);
|
||||
NewTest(TestTable, "Telegram_SendAudio" , "Send audio" , Telegram);
|
||||
NewTest(TestTable, "Telegram_SendDocument" , "Send document" , Telegram);
|
||||
NewTest(TestTable, "Telegram_SendGIF" , "Send GIF" , Telegram);
|
||||
NewTest(TestTable, "Telegram_SendMediaGroup" , "Send media group" , Telegram);
|
||||
NewTest(TestTable, "Telegram_SendLocation" , "Send location" , Telegram);
|
||||
NewTest(TestTable, "Telegram_SendContact" , "Send contact" , Telegram);
|
||||
NewTest(TestTable, "Telegram_SendPoll" , "Send poll" , Telegram);
|
||||
NewTest(TestTable, "Telegram_ForwardMessage" , "Forward message" , Telegram);
|
||||
NewTest(TestTable, "Telegram_BanUnban" , "Ban/Unban" , Telegram);
|
||||
NewTest(TestTable, "Telegram_CreateInvitationLink" , "Create invitation link" , Telegram);
|
||||
NewTest(TestTable, "Telegram_PinUnpinMessage" , "Pin/Unpin message" , Telegram);
|
||||
NewTest(TestTable, "Telegram_GetMemberCount" , "Get participant count" , Telegram);
|
||||
NewTest(TestTable, "Telegram_GetForumAvatarsList", "Get forum avatars list", Telegram);
|
||||
NewTest(TestTable, "Telegram_CreateDeleteForumTopic" , "Create/Delete forum topic" , Telegram);
|
||||
NewTest(TestTable, "Telegram_ChangeMainTopicName" , "Change main topic name" , Telegram);
|
||||
NewTest(TestTable, "Telegram_HideShowMainTopic" , "Hide/Show main topic" , Telegram);
|
||||
|
||||
NewTest(TestTable, "VK_CreateTokenLink" , "Create token retrieval link", VK);
|
||||
NewTest(TestTable, "VK_CreateDeletePost" , "Create/Delete post" , VK);
|
||||
NewTest(TestTable, "VK_CreateCompositePost" , "Create/Delete composite post" , VK);
|
||||
NewTest(TestTable, "VK_CreatePoll" , "Create poll" , VK);
|
||||
NewTest(TestTable, "VK_SaveDeleteImage" , "Add/Delete image" , VK);
|
||||
NewTest(TestTable, "VK_CreateStory" , "Create story" , VK);
|
||||
NewTest(TestTable, "VK_DiscussionMethods" , "Actions with discussions" , VK);
|
||||
NewTest(TestTable, "VK_LikeRepostComment" , "Like/Repost/Comment" , VK);
|
||||
NewTest(TestTable, "VK_GetStatistics" , "Get statistics" , VK);
|
||||
NewTest(TestTable, "VK_GetPostStatistics" , "Get post statistics" , VK);
|
||||
NewTest(TestTable, "VK_CreateAdCampaign" , "Create advertising campaign" , VK);
|
||||
NewTest(TestTable, "VK_SendMessage" , "Send message" , VK);
|
||||
NewTest(TestTable, "VK_GetProductCategories" , "Get product categories" , VK);
|
||||
NewTest(TestTable, "VK_CreateProductSelection" , "Create product and selection" , VK);
|
||||
NewTest(TestTable, "VK_CreateProductWithProperties" , "Create product with properties" , VK);
|
||||
NewTest(TestTable, "VK_GetProductList" , "Get product list" , VK);
|
||||
NewTest(TestTable, "VK_GetSelectionList" , "Get selection list" , VK);
|
||||
NewTest(TestTable, "VK_GetPropertyList" , "Get property list" , VK);
|
||||
NewTest(TestTable, "VK_GetOrderList" , "Get order list" , VK);
|
||||
NewTest(TestTable, "VK_UploadVideo" , "Upload video" , VK);
|
||||
|
||||
NewTest(TestTable, "YDisk_GetDiskInfo" , "Get disk information" , YDisk);
|
||||
NewTest(TestTable, "YDisk_CreateFolder" , "Create folder" , YDisk);
|
||||
NewTest(TestTable, "YDisk_UploadByUrlAndGetObject", "Upload by URL and get" , YDisk);
|
||||
NewTest(TestTable, "YDisk_UploadDeleteFile" , "Upload/Delete file" , YDisk);
|
||||
NewTest(TestTable, "YDisk_CreateObjectCopy" , "Create object copy" , YDisk);
|
||||
NewTest(TestTable, "YDisk_GetDownloadLink" , "Get download link" , YDisk);
|
||||
NewTest(TestTable, "YDisk_GetFileList" , "Get list of files" , YDisk);
|
||||
NewTest(TestTable, "YDisk_MoveObject" , "Move object" , YDisk);
|
||||
NewTest(TestTable, "YDisk_PublicObjectActions" , "Actions with public objects", YDisk);
|
||||
NewTest(TestTable, "YDisk_GetPublishedList" , "Get published list" , YDisk);
|
||||
|
||||
NewTest(TestTable, "GV_GetAuthorizationLink" , "Get authorization link" , VSpace);
|
||||
NewTest(TestTable, "GV_GetToken" , "Get token" , VSpace);
|
||||
NewTest(TestTable, "GV_UpdateToken" , "Refresh token" , VSpace);
|
||||
|
||||
NewTest(TestTable, "GC_GetCalendarList" , "Get list of calendars" , Calendar);
|
||||
NewTest(TestTable, "GC_CreateDeleteCalendar" , "Create/Delete calendar" , Calendar);
|
||||
NewTest(TestTable, "GC_CreateDeleteEvent" , "Create/Delete event" , Calendar);
|
||||
NewTest(TestTable, "GC_GetEventList" , "Get list of events" , Calendar);
|
||||
|
||||
NewTest(TestTable, "GD_GetCatalogList" , "Get list of directories" , Drive);
|
||||
NewTest(TestTable, "GD_UploadDeleteFile" , "Upload/Delete file" , Drive);
|
||||
NewTest(TestTable, "GD_CreateDeleteComment" , "Create/Delete Comment" , Drive);
|
||||
NewTest(TestTable, "GD_CreateCatalog" , "Create/Delete catalog" , Drive);
|
||||
|
||||
NewTest(TestTable, "GT_CreateTable" , "Create table" , Tables);
|
||||
NewTest(TestTable, "GT_GetTable" , "Get table" , Tables);
|
||||
NewTest(TestTable, "GT_FillClearCells" , "Fill/Clear cells" , Tables);
|
||||
|
||||
NewTest(TestTable, "Twitter_GetAuthorizationLink" , "Get authorization link" , Twitter);
|
||||
NewTest(TestTable, "Twitter_UpdateToken" , "Refresh token" , Twitter);
|
||||
NewTest(TestTable, "Twitter_CreateTextTweet" , "Text tweet" , Twitter);
|
||||
NewTest(TestTable, "Twitter_CreateTweetWithImage" , "Tweet with image" , Twitter);
|
||||
NewTest(TestTable, "Twitter_CreateTweetWithVideo" , "Tweet with video" , Twitter);
|
||||
NewTest(TestTable, "Twitter_CreateTweetWithGif" , "Tweet with gif" , Twitter);
|
||||
NewTest(TestTable, "Twitter_CreateTweetWithPoll" , "Tweet with poll" , Twitter);
|
||||
|
||||
NewTest(TestTable, "Viber_GetChannelInfo" , "Get channel info" , Viber);
|
||||
NewTest(TestTable, "Viber_GetUserData" , "Get user data" , Viber);
|
||||
NewTest(TestTable, "Viber_GetOnlineUsers" , "Get online users" , Viber);
|
||||
NewTest(TestTable, "Viber_SendTextMessage" , "Send text message" , Viber);
|
||||
NewTest(TestTable, "Viber_SendImage" , "Send image" , Viber);
|
||||
NewTest(TestTable, "Viber_SendFile" , "SendFile" , Viber);
|
||||
NewTest(TestTable, "Viber_SendContact" , "Send contact" , Viber);
|
||||
NewTest(TestTable, "Viber_SendLocation" , "SendLocation" , Viber);
|
||||
NewTest(TestTable, "Viber_SendLink" , "SendLink" , Viber);
|
||||
|
||||
NewTest(TestTable, "Notion_CreatePage" , "Create page" , Notion);
|
||||
NewTest(TestTable, "Notion_CreateEditDatabase" , "Create/Edit database" , Notion);
|
||||
NewTest(TestTable, "Notion_GetPageInfo" , "Get page info" , Notion);
|
||||
NewTest(TestTable, "Notion_GetDatabaseInfo" , "Get database info" , Notion);
|
||||
NewTest(TestTable, "Notion_CreatePageInDatabase" , "Create page in database" , Notion);
|
||||
NewTest(TestTable, "Notion_EditPageProperties" , "Edit page properties" , Notion);
|
||||
NewTest(TestTable, "Notion_CreateDeleteBlock" , "Create/Delete block" , Notion);
|
||||
NewTest(TestTable, "Notion_GetUsers" , "Get users" , Notion);
|
||||
NewTest(TestTable, "Notion_GetUserData" , "Get user data" , Notion);
|
||||
|
||||
NewTest(TestTable, "Slack_GetBotInfo" , "Get bot information" , Slack);
|
||||
NewTest(TestTable, "Slack_GetUserList" , "Get user list" , Slack);
|
||||
NewTest(TestTable, "Slack_GetRegionList" , "Get region list" , Slack);
|
||||
NewTest(TestTable, "Slack_SendDeleteMessage" , "Send/Delete message" , Slack);
|
||||
NewTest(TestTable, "Slack_SendDeleteEphemeral" , "Send/Delete ephemeral" , Slack);
|
||||
NewTest(TestTable, "Slack_GetScheduledMessages" , "Get scheduled messages" , Slack);
|
||||
NewTest(TestTable, "Slack_CreateArchiveChannel" , "Create/Archive channel" , Slack);
|
||||
NewTest(TestTable, "Slack_GetChannelList" , "Get channel list" , Slack);
|
||||
NewTest(TestTable, "Slack_OpenCloseDialog" , "Open/Close dialog" , Slack);
|
||||
NewTest(TestTable, "Slack_GetFileList" , "Get list of files" , Slack);
|
||||
NewTest(TestTable, "Slack_UploadDeleteFile" , "Upload/Delete file" , Slack);
|
||||
NewTest(TestTable, "Slack_GetExternalFileList" , "Get external file list" , Slack);
|
||||
NewTest(TestTable, "Slack_UploadDeleteExternalFile" , "Upload/Delete external file" , Slack);
|
||||
|
||||
NewTest(TestTable, "AT_CreateDatabase" , "Create/Edit database" , AirT);
|
||||
NewTest(TestTable, "AT_CreateTable" , "Create/Edit table" , AirT);
|
||||
NewTest(TestTable, "AT_CreateField" , "Create/Edit field" , AirT);
|
||||
NewTest(TestTable, "AT_CreateDeleteRecords" , "Create/Delete records" , AirT);
|
||||
|
||||
NewTest(TestTable, "Dropbox_GetUpdateToken" , "Get/Update token" , Dropbox);
|
||||
NewTest(TestTable, "Dropbox_UploadFile" , "Upload file" , Dropbox);
|
||||
NewTest(TestTable, "Dropbox_UploadFileByURL" , "Upload file by URL" , Dropbox);
|
||||
NewTest(TestTable, "Dropbox_CreateFolder" , "Create folder" , Dropbox);
|
||||
NewTest(TestTable, "Dropbox_CreateDeleteTag" , "Create/Delete tag" , Dropbox);
|
||||
NewTest(TestTable, "Dropbox_GetAccount" , "Get account data" , Dropbox);
|
||||
NewTest(TestTable, "Dropbox_AccessManagement" , "Access management" , Dropbox);
|
||||
|
||||
Return TestTable;
|
||||
|
||||
EndFunction
|
||||
|
||||
Telegram = "Telegram";
|
||||
VK = "VK";
|
||||
YDisk = "YandexDisk";
|
||||
Calendar = "GoogleCalendar";
|
||||
Twitter = "Twitter";
|
||||
Viber = "Viber";
|
||||
Drive = "GoogleDrive";
|
||||
VSpace = "GoogleWorkspace";
|
||||
Notion = "Notion";
|
||||
Slack = "Slack";
|
||||
Tables = "GoogleSheets";
|
||||
AirT = "Airtable";
|
||||
Dropbox = "Dropbox";
|
||||
|
||||
TestTable = New ValueTable;
|
||||
TestTable.Columns.Add("Method");
|
||||
TestTable.Columns.Add("Synonym");
|
||||
TestTable.Columns.Add("Section");
|
||||
|
||||
NewTest(TestTable, "Telegram_GetBotInfo" , "Get bot information" , Telegram);
|
||||
NewTest(TestTable, "Telegram_GetUpdates" , "Get updates" , Telegram);
|
||||
NewTest(TestTable, "Telegram_SetWebhook" , "Set Webhook" , Telegram);
|
||||
NewTest(TestTable, "Telegram_SendTextMessage" , "Send text message" , Telegram);
|
||||
NewTest(TestTable, "Telegram_SendImage" , "Send image" , Telegram);
|
||||
NewTest(TestTable, "Telegram_SendVideo" , "Send video" , Telegram);
|
||||
NewTest(TestTable, "Telegram_SendAudio" , "Send audio" , Telegram);
|
||||
NewTest(TestTable, "Telegram_SendDocument" , "Send document" , Telegram);
|
||||
NewTest(TestTable, "Telegram_SendGIF" , "Send GIF" , Telegram);
|
||||
NewTest(TestTable, "Telegram_SendMediaGroup" , "Send media group" , Telegram);
|
||||
NewTest(TestTable, "Telegram_SendLocation" , "Send location" , Telegram);
|
||||
NewTest(TestTable, "Telegram_SendContact" , "Send contact" , Telegram);
|
||||
NewTest(TestTable, "Telegram_SendPoll" , "Send poll" , Telegram);
|
||||
NewTest(TestTable, "Telegram_ForwardMessage" , "Forward message" , Telegram);
|
||||
NewTest(TestTable, "Telegram_BanUnban" , "Ban/Unban" , Telegram);
|
||||
NewTest(TestTable, "Telegram_CreateInvitationLink" , "Create invitation link" , Telegram);
|
||||
NewTest(TestTable, "Telegram_PinUnpinMessage" , "Pin/Unpin message" , Telegram);
|
||||
NewTest(TestTable, "Telegram_GetMemberCount" , "Get participant count" , Telegram);
|
||||
NewTest(TestTable, "Telegram_GetForumAvatarsList", "Get forum avatars list", Telegram);
|
||||
NewTest(TestTable, "Telegram_CreateDeleteForumTopic" , "Create/Delete forum topic" , Telegram);
|
||||
NewTest(TestTable, "Telegram_ChangeMainTopicName" , "Change main topic name" , Telegram);
|
||||
NewTest(TestTable, "Telegram_HideShowMainTopic" , "Hide/Show main topic" , Telegram);
|
||||
|
||||
NewTest(TestTable, "VK_CreateTokenLink" , "Create token retrieval link", VK);
|
||||
NewTest(TestTable, "VK_CreateDeletePost" , "Create/Delete post" , VK);
|
||||
NewTest(TestTable, "VK_CreateCompositePost" , "Create/Delete composite post" , VK);
|
||||
NewTest(TestTable, "VK_CreatePoll" , "Create poll" , VK);
|
||||
NewTest(TestTable, "VK_SaveDeleteImage" , "Add/Delete image" , VK);
|
||||
NewTest(TestTable, "VK_CreateStory" , "Create story" , VK);
|
||||
NewTest(TestTable, "VK_DiscussionMethods" , "Actions with discussions" , VK);
|
||||
NewTest(TestTable, "VK_LikeRepostComment" , "Like/Repost/Comment" , VK);
|
||||
NewTest(TestTable, "VK_GetStatistics" , "Get statistics" , VK);
|
||||
NewTest(TestTable, "VK_GetPostStatistics" , "Get post statistics" , VK);
|
||||
NewTest(TestTable, "VK_CreateAdCampaign" , "Create advertising campaign" , VK);
|
||||
NewTest(TestTable, "VK_SendMessage" , "Send message" , VK);
|
||||
NewTest(TestTable, "VK_GetProductCategories" , "Get product categories" , VK);
|
||||
NewTest(TestTable, "VK_CreateProductSelection" , "Create product and selection" , VK);
|
||||
NewTest(TestTable, "VK_CreateProductWithProperties" , "Create product with properties" , VK);
|
||||
NewTest(TestTable, "VK_GetProductList" , "Get product list" , VK);
|
||||
NewTest(TestTable, "VK_GetSelectionList" , "Get selection list" , VK);
|
||||
NewTest(TestTable, "VK_GetPropertyList" , "Get property list" , VK);
|
||||
NewTest(TestTable, "VK_GetOrderList" , "Get order list" , VK);
|
||||
NewTest(TestTable, "VK_UploadVideo" , "Upload video" , VK);
|
||||
|
||||
NewTest(TestTable, "YDisk_GetDiskInfo" , "Get disk information" , YDisk);
|
||||
NewTest(TestTable, "YDisk_CreateFolder" , "Create folder" , YDisk);
|
||||
NewTest(TestTable, "YDisk_UploadByUrlAndGetObject", "Upload by URL and get" , YDisk);
|
||||
NewTest(TestTable, "YDisk_UploadDeleteFile" , "Upload/Delete file" , YDisk);
|
||||
NewTest(TestTable, "YDisk_CreateObjectCopy" , "Create object copy" , YDisk);
|
||||
NewTest(TestTable, "YDisk_GetDownloadLink" , "Get download link" , YDisk);
|
||||
NewTest(TestTable, "YDisk_GetFileList" , "Get list of files" , YDisk);
|
||||
NewTest(TestTable, "YDisk_MoveObject" , "Move object" , YDisk);
|
||||
NewTest(TestTable, "YDisk_PublicObjectActions" , "Actions with public objects", YDisk);
|
||||
NewTest(TestTable, "YDisk_GetPublishedList" , "Get published list" , YDisk);
|
||||
|
||||
NewTest(TestTable, "GV_GetAuthorizationLink" , "Get authorization link" , VSpace);
|
||||
NewTest(TestTable, "GV_GetToken" , "Get token" , VSpace);
|
||||
NewTest(TestTable, "GV_UpdateToken" , "Refresh token" , VSpace);
|
||||
|
||||
NewTest(TestTable, "GC_GetCalendarList" , "Get list of calendars" , Calendar);
|
||||
NewTest(TestTable, "GC_CreateDeleteCalendar" , "Create/Delete calendar" , Calendar);
|
||||
NewTest(TestTable, "GC_CreateDeleteEvent" , "Create/Delete event" , Calendar);
|
||||
NewTest(TestTable, "GC_GetEventList" , "Get list of events" , Calendar);
|
||||
|
||||
NewTest(TestTable, "GD_GetCatalogList" , "Get list of directories" , Drive);
|
||||
NewTest(TestTable, "GD_UploadDeleteFile" , "Upload/Delete file" , Drive);
|
||||
NewTest(TestTable, "GD_CreateDeleteComment" , "Create/Delete Comment" , Drive);
|
||||
NewTest(TestTable, "GD_CreateCatalog" , "Create/Delete catalog" , Drive);
|
||||
|
||||
NewTest(TestTable, "GT_CreateTable" , "Create table" , Tables);
|
||||
NewTest(TestTable, "GT_GetTable" , "Get table" , Tables);
|
||||
NewTest(TestTable, "GT_FillClearCells" , "Fill/Clear cells" , Tables);
|
||||
|
||||
NewTest(TestTable, "Twitter_GetAuthorizationLink" , "Get authorization link" , Twitter);
|
||||
NewTest(TestTable, "Twitter_UpdateToken" , "Refresh token" , Twitter);
|
||||
NewTest(TestTable, "Twitter_CreateTextTweet" , "Text tweet" , Twitter);
|
||||
NewTest(TestTable, "Twitter_CreateTweetWithImage" , "Tweet with image" , Twitter);
|
||||
NewTest(TestTable, "Twitter_CreateTweetWithVideo" , "Tweet with video" , Twitter);
|
||||
NewTest(TestTable, "Twitter_CreateTweetWithGif" , "Tweet with gif" , Twitter);
|
||||
NewTest(TestTable, "Twitter_CreateTweetWithPoll" , "Tweet with poll" , Twitter);
|
||||
|
||||
NewTest(TestTable, "Viber_GetChannelInfo" , "Get channel info" , Viber);
|
||||
NewTest(TestTable, "Viber_GetUserData" , "Get user data" , Viber);
|
||||
NewTest(TestTable, "Viber_GetOnlineUsers" , "Get online users" , Viber);
|
||||
NewTest(TestTable, "Viber_SendTextMessage" , "Send text message" , Viber);
|
||||
NewTest(TestTable, "Viber_SendImage" , "Send image" , Viber);
|
||||
NewTest(TestTable, "Viber_SendFile" , "SendFile" , Viber);
|
||||
NewTest(TestTable, "Viber_SendContact" , "Send contact" , Viber);
|
||||
NewTest(TestTable, "Viber_SendLocation" , "SendLocation" , Viber);
|
||||
NewTest(TestTable, "Viber_SendLink" , "SendLink" , Viber);
|
||||
|
||||
NewTest(TestTable, "Notion_CreatePage" , "Create page" , Notion);
|
||||
NewTest(TestTable, "Notion_CreateEditDatabase" , "Create/Edit database" , Notion);
|
||||
NewTest(TestTable, "Notion_GetPageInfo" , "Get page info" , Notion);
|
||||
NewTest(TestTable, "Notion_GetDatabaseInfo" , "Get database info" , Notion);
|
||||
NewTest(TestTable, "Notion_CreatePageInDatabase" , "Create page in database" , Notion);
|
||||
NewTest(TestTable, "Notion_EditPageProperties" , "Edit page properties" , Notion);
|
||||
NewTest(TestTable, "Notion_CreateDeleteBlock" , "Create/Delete block" , Notion);
|
||||
NewTest(TestTable, "Notion_GetUsers" , "Get users" , Notion);
|
||||
NewTest(TestTable, "Notion_GetUserData" , "Get user data" , Notion);
|
||||
|
||||
NewTest(TestTable, "Slack_GetBotInfo" , "Get bot information" , Slack);
|
||||
NewTest(TestTable, "Slack_GetUserList" , "Get user list" , Slack);
|
||||
NewTest(TestTable, "Slack_GetRegionList" , "Get region list" , Slack);
|
||||
NewTest(TestTable, "Slack_SendDeleteMessage" , "Send/Delete message" , Slack);
|
||||
NewTest(TestTable, "Slack_SendDeleteEphemeral" , "Send/Delete ephemeral" , Slack);
|
||||
NewTest(TestTable, "Slack_GetScheduledMessages" , "Get scheduled messages" , Slack);
|
||||
NewTest(TestTable, "Slack_CreateArchiveChannel" , "Create/Archive channel" , Slack);
|
||||
NewTest(TestTable, "Slack_GetChannelList" , "Get channel list" , Slack);
|
||||
NewTest(TestTable, "Slack_OpenCloseDialog" , "Open/Close dialog" , Slack);
|
||||
NewTest(TestTable, "Slack_GetFileList" , "Get list of files" , Slack);
|
||||
NewTest(TestTable, "Slack_UploadDeleteFile" , "Upload/Delete file" , Slack);
|
||||
NewTest(TestTable, "Slack_GetExternalFileList" , "Get external file list" , Slack);
|
||||
NewTest(TestTable, "Slack_UploadDeleteExternalFile" , "Upload/Delete external file" , Slack);
|
||||
|
||||
NewTest(TestTable, "AT_CreateDatabase" , "Create/Edit database" , AirT);
|
||||
NewTest(TestTable, "AT_CreateTable" , "Create/Edit table" , AirT);
|
||||
NewTest(TestTable, "AT_CreateField" , "Create/Edit field" , AirT);
|
||||
NewTest(TestTable, "AT_CreateDeleteRecords" , "Create/Delete records" , AirT);
|
||||
|
||||
NewTest(TestTable, "Dropbox_GetUpdateToken" , "Get/Update token" , Dropbox);
|
||||
NewTest(TestTable, "Dropbox_UploadFile" , "Upload file" , Dropbox);
|
||||
NewTest(TestTable, "Dropbox_UploadFileByURL" , "Upload file by URL" , Dropbox);
|
||||
NewTest(TestTable, "Dropbox_CreateFolder" , "Create folder" , Dropbox);
|
||||
NewTest(TestTable, "Dropbox_CreateDeleteTag" , "Create/Delete tag" , Dropbox);
|
||||
NewTest(TestTable, "Dropbox_GetAccount" , "Get account data" , Dropbox);
|
||||
NewTest(TestTable, "Dropbox_AccessManagement" , "Access management" , Dropbox);
|
||||
|
||||
Return TestTable;
|
||||
|
||||
EndFunction
|
||||
|
||||
Function ExpectsThat(Value) Export
|
||||
|
||||
Try
|
||||
|
||||
Module = GetCommonModule("UTest");
|
||||
Awaiting = TypeValue(Module) = Type("CommonModule");
|
||||
Return Module.ExpectsThat(Value);
|
||||
|
||||
Except
|
||||
Return Awaiting.What(Value);
|
||||
EndTry;
|
||||
|
||||
|
||||
Try
|
||||
|
||||
Module = GetCommonModule("UTest");
|
||||
Awaiting = TypeValue(Module) = Type("CommonModule");
|
||||
Return Module.ExpectsThat(Value);
|
||||
|
||||
Except
|
||||
Return Awaiting.What(Value);
|
||||
EndTry;
|
||||
|
||||
EndFunction
|
||||
|
||||
Function FormYAXTests() Export
|
||||
|
||||
Module = GetCommonModule("UTTests");
|
||||
Sections = GetTestingSectionMapping();
|
||||
TestTable = GetTestTable();
|
||||
|
||||
For Each Section In Sections Do
|
||||
|
||||
CurrentSection = Section.Key;
|
||||
Filter = New Structure("Section", CurrentSection);
|
||||
SectionTests = TestTable.FindLines(Filter);
|
||||
|
||||
Set = Module.AddTestSet(CurrentSection);
|
||||
|
||||
For Each Test In SectionTests Do
|
||||
Set.AddServerTest(Test.Method, Test.Synonym);
|
||||
EndDo;
|
||||
|
||||
EndDo;
|
||||
|
||||
Return "";
|
||||
|
||||
|
||||
Module = GetCommonModule("UTTests");
|
||||
Sections = GetTestingSectionMapping();
|
||||
TestTable = GetTestTable();
|
||||
|
||||
For Each Section In Sections Do
|
||||
|
||||
CurrentSection = Section.Key;
|
||||
Filter = New Structure("Section", CurrentSection);
|
||||
SectionTests = TestTable.FindLines(Filter);
|
||||
|
||||
Set = Module.AddTestSet(CurrentSection);
|
||||
|
||||
For Each Test In SectionTests Do
|
||||
Set.AddServerTest(Test.Method, Test.Synonym);
|
||||
EndDo;
|
||||
|
||||
EndDo;
|
||||
|
||||
Return "";
|
||||
|
||||
EndFunction
|
||||
|
||||
Function FormAssertsTests() Export
|
||||
|
||||
TestTable = GetTestTable();
|
||||
ArrayOfTests = New Array;
|
||||
|
||||
For Each Test In TestTable Do
|
||||
ArrayOfTests.Add(Test.Method);
|
||||
EndDo;
|
||||
|
||||
Return ArrayOfTests;
|
||||
|
||||
|
||||
TestTable = GetTestTable();
|
||||
ArrayOfTests = New Array;
|
||||
|
||||
For Each Test In TestTable Do
|
||||
ArrayOfTests.Add(Test.Method);
|
||||
EndDo;
|
||||
|
||||
Return ArrayOfTests;
|
||||
|
||||
EndFunction
|
||||
|
||||
Function GetParameter(Parameter) Export
|
||||
Function GetParameter(Parameter) Export
|
||||
|
||||
Path = DataFilePath();
|
||||
Return GetValueFromFile(Parameter, Path);
|
||||
Path = DataFilePath();
|
||||
Return GetValueFromFile(Parameter, Path);
|
||||
|
||||
EndFunction
|
||||
|
||||
Function GetBinary(Parameter) Export
|
||||
|
||||
Path = DataFilePath();
|
||||
LocalParameter = Parameter + "Local";
|
||||
MainValue = GetValueFromFile(Parameter , Path);
|
||||
LocalValue = GetValueFromFile(LocalParameter, Path);
|
||||
|
||||
LocalFile = New File(LocalValue);
|
||||
|
||||
If LocalFile.Exists() Then
|
||||
Value = New BinaryData(LocalValue);
|
||||
Else
|
||||
Value = MainValue;
|
||||
EndIf;
|
||||
|
||||
If TypeValue(Value) = Type("String") Then
|
||||
Value = GetFilePath(Value, LocalParameter);
|
||||
EndIf;
|
||||
|
||||
Return Value;
|
||||
|
||||
|
||||
Path = DataFilePath();
|
||||
LocalParameter = Parameter + "Local";
|
||||
MainValue = GetValueFromFile(Parameter , Path);
|
||||
LocalValue = GetValueFromFile(LocalParameter, Path);
|
||||
|
||||
LocalFile = New File(LocalValue);
|
||||
|
||||
If LocalFile.Exists() Then
|
||||
Value = New BinaryData(LocalValue);
|
||||
Else
|
||||
Value = MainValue;
|
||||
EndIf;
|
||||
|
||||
If TypeValue(Value) = Type("String") Then
|
||||
Value = GetFilePath(Value, LocalParameter);
|
||||
EndIf;
|
||||
|
||||
Return Value;
|
||||
|
||||
EndFunction
|
||||
|
||||
Function GetFilePath(Val Path, LocalParameter, Val SaveLocally = True) Export
|
||||
|
||||
If StrFind(Path, "http") > 0
|
||||
Or StrFind(Path, "www") > 0 Then
|
||||
|
||||
AndVF = GetTempFileName();
|
||||
CopyFile(Path, AndVF);
|
||||
Path = AndVF;
|
||||
Binary = New BinaryData(Path);
|
||||
|
||||
If SaveLocally Then
|
||||
WriteParameter(LocalParameter, AndVF);
|
||||
Else
|
||||
DeleteFiles(AndVF);
|
||||
EndIf;
|
||||
|
||||
Else
|
||||
|
||||
Binary = New BinaryData(Path);
|
||||
|
||||
EndIf;
|
||||
|
||||
Return Binary;
|
||||
|
||||
|
||||
If StrFind(Path, "http") > 0
|
||||
Or StrFind(Path, "www") > 0 Then
|
||||
|
||||
AndVF = GetTempFileName();
|
||||
CopyFile(Path, AndVF);
|
||||
Path = AndVF;
|
||||
Binary = New BinaryData(Path);
|
||||
|
||||
If SaveLocally Then
|
||||
WriteParameter(LocalParameter, AndVF);
|
||||
Else
|
||||
DeleteFiles(AndVF);
|
||||
EndIf;
|
||||
|
||||
Else
|
||||
|
||||
Binary = New BinaryData(Path);
|
||||
|
||||
EndIf;
|
||||
|
||||
Return Binary;
|
||||
|
||||
EndFunction
|
||||
|
||||
Procedure ParameterToCollection(Parameter, Collection) Export
|
||||
|
||||
Value = GetParameter(Parameter);
|
||||
Collection.Insert(Parameter, Value);
|
||||
|
||||
Value = GetParameter(Parameter);
|
||||
Collection.Insert(Parameter, Value);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure BinaryToCollection(Parameter, Collection) Export
|
||||
|
||||
Value = GetBinary(Parameter);
|
||||
Collection.Insert(Parameter, Value);
|
||||
|
||||
Value = GetBinary(Parameter);
|
||||
Collection.Insert(Parameter, Value);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure WriteParameter(Parameter, Value) Export
|
||||
|
||||
Path = DataFilePath();
|
||||
WriteParameterToFile(Parameter, Value, Path);
|
||||
|
||||
|
||||
Path = DataFilePath();
|
||||
WriteParameterToFile(Parameter, Value, Path);
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure WriteLog(Val Result, Val Method, Val Library = "") Export
|
||||
|
||||
Header = String(OPI_Tools.GetCurrentDate()) + " | " + Method;
|
||||
|
||||
Try
|
||||
Data = OPI_Tools.JSONString(Result);
|
||||
Except
|
||||
Data = "Not JSON: " + String(Result);
|
||||
EndTry;
|
||||
|
||||
Data = " " + Data;
|
||||
|
||||
Notify(Header);
|
||||
Notify(Symbols.PS);
|
||||
Notify(Data);
|
||||
Notify(Symbols.PS);
|
||||
Notify("---------------------------------");
|
||||
Notify(Symbols.PS);
|
||||
|
||||
If ValueIsFilled(Library) Then
|
||||
WriteLogFile(Data, Method, Library);
|
||||
EndIf;
|
||||
|
||||
|
||||
Header = String(OPI_Tools.GetCurrentDate()) + " | " + Method;
|
||||
|
||||
Try
|
||||
Data = OPI_Tools.JSONString(Result);
|
||||
Except
|
||||
Data = "Not JSON: " + String(Result);
|
||||
EndTry;
|
||||
|
||||
Data = " " + Data;
|
||||
|
||||
Notify(Header);
|
||||
Notify(Symbols.PS);
|
||||
Notify(Data);
|
||||
Notify(Symbols.PS);
|
||||
Notify("---------------------------------");
|
||||
Notify(Symbols.PS);
|
||||
|
||||
If ValueIsFilled(Library) Then
|
||||
WriteLogFile(Data, Method, Library);
|
||||
EndIf;
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
|
||||
#Region ServiceProceduresAndFunctions
|
||||
|
||||
Function GetValueFromFile(Parameter, Path)
|
||||
|
||||
Values = OPI_Tools.ReadJSONFile(Path);
|
||||
Return ?(Values.Property(Parameter), Values[Parameter], "");
|
||||
|
||||
Function GetValueFromFile(Parameter, Path)
|
||||
|
||||
Values = OPI_Tools.ReadJSONFile(Path);
|
||||
Return ?(Values.Property(Parameter), Values[Parameter], "");
|
||||
|
||||
EndFunction
|
||||
|
||||
Function DataFilePath()
|
||||
|
||||
Path = "";
|
||||
PossiblePaths = New Array;
|
||||
PossiblePaths.Add("./data.json");
|
||||
PossiblePaths.Add("C:\GDrive\My Drive\data.json");
|
||||
PossiblePaths.Add("D:\GD\My Drive\data.json");
|
||||
|
||||
For Each PossiblePath In PossiblePaths Do
|
||||
|
||||
RepositoryFile = New File(PossiblePath);
|
||||
|
||||
If RepositoryFile.Exists() Then
|
||||
Path = PossiblePath;
|
||||
EndIf;
|
||||
|
||||
EndDo;
|
||||
|
||||
Return Path;
|
||||
|
||||
|
||||
Path = "";
|
||||
PossiblePaths = New Array;
|
||||
PossiblePaths.Add("./data.json");
|
||||
PossiblePaths.Add("C:\GDrive\My Drive\data.json");
|
||||
PossiblePaths.Add("D:\GD\My Drive\data.json");
|
||||
|
||||
For Each PossiblePath In PossiblePaths Do
|
||||
|
||||
RepositoryFile = New File(PossiblePath);
|
||||
|
||||
If RepositoryFile.Exists() Then
|
||||
Path = PossiblePath;
|
||||
EndIf;
|
||||
|
||||
EndDo;
|
||||
|
||||
Return Path;
|
||||
|
||||
EndFunction
|
||||
|
||||
Function GetCommonModule(Val Name)
|
||||
SetSafeMode(True);
|
||||
Module = Calculate(Name);
|
||||
SetSafeMode(False);
|
||||
Return Module;
|
||||
SetSafeMode(True);
|
||||
Module = Calculate(Name);
|
||||
SetSafeMode(False);
|
||||
Return Module;
|
||||
EndFunction
|
||||
|
||||
Procedure NewTest(ValueTable, Val Method, Val Synonym, Val Section)
|
||||
|
||||
NewTest = ValueTable.Add();
|
||||
NewTest.Method = Method;
|
||||
NewTest.Synonym = Synonym;
|
||||
NewTest.Section = Section;
|
||||
|
||||
|
||||
NewTest = ValueTable.Add();
|
||||
NewTest.Method = Method;
|
||||
NewTest.Synonym = Synonym;
|
||||
NewTest.Section = Section;
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure WriteParameterToFile(Val Parameter, Val Value, Val Path)
|
||||
|
||||
Values = OPI_Tools.ReadJSONFile(Path);
|
||||
Values.Insert(Parameter, Value);
|
||||
|
||||
Values = OPI_Tools.ReadJSONFile(Path);
|
||||
Values.Insert(Parameter, Value);
|
||||
|
||||
Record = New WritingJSON;
|
||||
JSONWriteParameters = New JSONWriteParameters(JSONLineBreak.Auto, Symbols.Tab);
|
||||
Record.OpenFile(Path, , , JSONWriteParameters);
|
||||
WriteJSON(Record, Values);
|
||||
Record.Close();
|
||||
Record = New WritingJSON;
|
||||
JSONWriteParameters = New JSONWriteParameters(JSONLineBreak.Auto, Symbols.Tab);
|
||||
Record.OpenFile(Path, , , JSONWriteParameters);
|
||||
WriteJSON(Record, Values);
|
||||
Record.Close();
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure WriteLogFile(Val Data, Val Method, Val Library)
|
||||
|
||||
Try
|
||||
|
||||
LogPath = "./docs/results";
|
||||
LibraryLogPath = LogPath + "/" + Library;
|
||||
|
||||
LogDirectory = New File(LogPath);
|
||||
|
||||
If Not LogDirectory.Exists() Then
|
||||
CreateDirectory(LogPath);
|
||||
EndIf;
|
||||
|
||||
LibraryLogCatalog = New File(LibraryLogPath);
|
||||
|
||||
If Not LibraryLogCatalog.Exists() Then
|
||||
CreateDirectory(LibraryLogPath);
|
||||
EndIf;
|
||||
|
||||
FilePath = LibraryLogPath + "/" + Method + ".log";
|
||||
LogFile = New File(FilePath);
|
||||
|
||||
If Not LogFile.Exists() Then
|
||||
LogDocument = New TextDocument;
|
||||
LogDocument.SetText(Data);
|
||||
LogDocument.Write(FilePath);
|
||||
EndIf;
|
||||
|
||||
Except
|
||||
Notify("Failed to write log file!: " + ErrorDescription());
|
||||
EndTry;
|
||||
|
||||
|
||||
Try
|
||||
|
||||
LogPath = "./docs/results";
|
||||
LibraryLogPath = LogPath + "/" + Library;
|
||||
|
||||
LogDirectory = New File(LogPath);
|
||||
|
||||
If Not LogDirectory.Exists() Then
|
||||
CreateDirectory(LogPath);
|
||||
EndIf;
|
||||
|
||||
LibraryLogCatalog = New File(LibraryLogPath);
|
||||
|
||||
If Not LibraryLogCatalog.Exists() Then
|
||||
CreateDirectory(LibraryLogPath);
|
||||
EndIf;
|
||||
|
||||
FilePath = LibraryLogPath + "/" + Method + ".log";
|
||||
LogFile = New File(FilePath);
|
||||
|
||||
If Not LogFile.Exists() Then
|
||||
LogDocument = New TextDocument;
|
||||
LogDocument.SetText(Data);
|
||||
LogDocument.Write(FilePath);
|
||||
EndIf;
|
||||
|
||||
Except
|
||||
Notify("Failed to write log file!: " + ErrorDescription());
|
||||
EndTry;
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
|
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mdclass:CommonModule xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="546edcad-c9a0-4823-a44c-fefd7200de6c">
|
||||
<name>OPI_GetTestData</name>
|
||||
<synonym>
|
||||
<key></key>
|
||||
<value>OPI test data retrieval</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
<name>OPI_GetTestData</name>
|
||||
<synonym>
|
||||
<key></key>
|
||||
<value>OPI test data retrieval</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
</mdclass:CommonModule>
|
||||
|
@@ -38,132 +38,132 @@
|
||||
|
||||
// Create calendar
|
||||
// Creates an empty calendar
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Name - String - Name of the created calendar - title
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Google
|
||||
Function CreateCalendar(Val Token, Val Name) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Name);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://www.googleapis.com/calendar/v3/calendars";
|
||||
|
||||
Parameters = New Structure;
|
||||
Parameters.Insert("summary" , Name);
|
||||
Parameters.Insert("timeZone", "Europe/Moscow");
|
||||
|
||||
Response = OPI_Tools.Post(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Name);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://www.googleapis.com/calendar/v3/calendars";
|
||||
|
||||
Parameters = New Structure;
|
||||
Parameters.Insert("summary" , Name);
|
||||
Parameters.Insert("timeZone", "Europe/Moscow");
|
||||
|
||||
Response = OPI_Tools.Post(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Get calendar
|
||||
// Gets calendar information by ID
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Calendar - String - Calendar ID - calendar
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Google
|
||||
Function GetCalendarMetadata(Val Token, Val Calendar) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Calendar);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://www.googleapis.com/calendar/v3/calendars/" + Calendar;
|
||||
Response = OPI_Tools.Get(URL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Calendar);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://www.googleapis.com/calendar/v3/calendars/" + Calendar;
|
||||
Response = OPI_Tools.Get(URL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Edit calendar
|
||||
// Edits properties of an existing calendar
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Calendar - String - Calendar ID - calendar
|
||||
// Name - String - New name - title
|
||||
// Description - String - New calendar description - description
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Google
|
||||
Function EditCalendarMetadata(Val Token
|
||||
, Val Calendar
|
||||
, Val Name = ""
|
||||
, Val Description = "") Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Calendar);
|
||||
OPI_TypeConversion.GetLine(Name);
|
||||
OPI_TypeConversion.GetLine(Description);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://www.googleapis.com/calendar/v3/calendars/" + Calendar;
|
||||
|
||||
Parameters = New Structure;
|
||||
|
||||
If ValueIsFilled(Name) Then
|
||||
Parameters.Insert("summary", Name);
|
||||
EndIf;
|
||||
|
||||
If ValueIsFilled(Description) Then
|
||||
Parameters.Insert("description", Description);
|
||||
EndIf;
|
||||
|
||||
Response = OPI_Tools.Patch(URL, Parameters, Headers, True);
|
||||
|
||||
Return Response;
|
||||
, Val Calendar
|
||||
, Val Name = ""
|
||||
, Val Description = "") Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Calendar);
|
||||
OPI_TypeConversion.GetLine(Name);
|
||||
OPI_TypeConversion.GetLine(Description);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://www.googleapis.com/calendar/v3/calendars/" + Calendar;
|
||||
|
||||
Parameters = New Structure;
|
||||
|
||||
If ValueIsFilled(Name) Then
|
||||
Parameters.Insert("summary", Name);
|
||||
EndIf;
|
||||
|
||||
If ValueIsFilled(Description) Then
|
||||
Parameters.Insert("description", Description);
|
||||
EndIf;
|
||||
|
||||
Response = OPI_Tools.Patch(URL, Parameters, Headers, True);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Clear primary calendar
|
||||
// Clears the event list of the primary calendar
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Google
|
||||
Function ClearMainCalendar(Val Token) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://www.googleapis.com/calendar/v3/calendars/primary/clear";
|
||||
Response = OPI_Tools.Post(URL, , Headers, False);
|
||||
|
||||
Return Response;
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://www.googleapis.com/calendar/v3/calendars/primary/clear";
|
||||
Response = OPI_Tools.Post(URL, , Headers, False);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Delete calendar
|
||||
// Deletes a calendar by ID
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Calendar - String - Calendar ID - calendar
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Google
|
||||
Function DeleteCalendar(Val Token, Val Calendar) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Calendar);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://www.googleapis.com/calendar/v3/calendars/" + Calendar;
|
||||
Response = OPI_Tools.Delete(URL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Calendar);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://www.googleapis.com/calendar/v3/calendars/" + Calendar;
|
||||
Response = OPI_Tools.Delete(URL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
@@ -173,130 +173,130 @@ EndFunction
|
||||
|
||||
// Get list of calendars
|
||||
// Gets an array of account calendars
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - Array of calendar data mappings
|
||||
Function GetCalendarList(Val Token) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
ArrayOfCalendars = New Array;
|
||||
|
||||
GetCalendarsListRecursively(Headers, ArrayOfCalendars);
|
||||
|
||||
Return ArrayOfCalendars;
|
||||
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
ArrayOfCalendars = New Array;
|
||||
|
||||
GetCalendarsListRecursively(Headers, ArrayOfCalendars);
|
||||
|
||||
Return ArrayOfCalendars;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Add calendar to list
|
||||
// Adds an existing calendar to the user's list
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Calendar - String - Calendar ID - calendar
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Google
|
||||
Function AddCalendarToList(Val Token, Val Calendar) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Calendar);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://www.googleapis.com/calendar/v3/users/me/calendarList";
|
||||
|
||||
Parameters = New Structure;
|
||||
Parameters.Insert("id", Calendar);
|
||||
|
||||
Response = OPI_Tools.Post(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Calendar);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://www.googleapis.com/calendar/v3/users/me/calendarList";
|
||||
|
||||
Parameters = New Structure;
|
||||
Parameters.Insert("id", Calendar);
|
||||
|
||||
Response = OPI_Tools.Post(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Get list calendar
|
||||
// Gets a calendar from the user's list by ID
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Calendar - String - Calendar ID - calendar
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Google
|
||||
Function GetListCalendar(Val Token, Val Calendar) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Calendar);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://www.googleapis.com/calendar/v3/users/me/calendarList/" + Calendar;
|
||||
Response = OPI_Tools.Get(URL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Calendar);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://www.googleapis.com/calendar/v3/users/me/calendarList/" + Calendar;
|
||||
Response = OPI_Tools.Get(URL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Remove calendar from list
|
||||
// Removes a calendar from the user's list
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Calendar - String - Calendar ID - calendar
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Google
|
||||
Function DeleteCalendarFromList(Val Token, Val Calendar) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Calendar);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://www.googleapis.com/calendar/v3/users/me/calendarList/" + Calendar;
|
||||
Response = OPI_Tools.Delete(URL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Calendar);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://www.googleapis.com/calendar/v3/users/me/calendarList/" + Calendar;
|
||||
Response = OPI_Tools.Delete(URL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Edit list calendar
|
||||
// Edits the properties of a calendar from the user's list
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Calendar - String - Calendar ID - calendar
|
||||
// PrimaryColor - String - HEX mainоinного цinета (#ffffff) - primary
|
||||
// SecondaryColor - String - HEX addолнительного цinета (#ffffff) - secondary
|
||||
// Hidden - Boolean - Hidden calendar - hidden
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Google
|
||||
Function EditListCalendar(Val Token
|
||||
, Val Calendar
|
||||
, Val PrimaryColor
|
||||
, Val SecondaryColor
|
||||
, Val Hidden = False) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Calendar);
|
||||
OPI_TypeConversion.GetLine(PrimaryColor);
|
||||
OPI_TypeConversion.GetLine(SecondaryColor);
|
||||
OPI_TypeConversion.GetBoolean(Hidden);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://www.googleapis.com/calendar/v3/users/me/calendarList/" + Calendar + "?colorRgbFormat=true";
|
||||
|
||||
Parameters = New Match;
|
||||
Parameters.Insert("hidden" , Hidden);
|
||||
Parameters.Insert("foregroundColor", PrimaryColor);
|
||||
Parameters.Insert("backgroundColor", SecondaryColor);
|
||||
|
||||
Response = OPI_Tools.Put(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
, Val Calendar
|
||||
, Val PrimaryColor
|
||||
, Val SecondaryColor
|
||||
, Val Hidden = False) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Calendar);
|
||||
OPI_TypeConversion.GetLine(PrimaryColor);
|
||||
OPI_TypeConversion.GetLine(SecondaryColor);
|
||||
OPI_TypeConversion.GetBoolean(Hidden);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://www.googleapis.com/calendar/v3/users/me/calendarList/" + Calendar + "?colorRgbFormat=true";
|
||||
|
||||
Parameters = New Match;
|
||||
Parameters.Insert("hidden" , Hidden);
|
||||
Parameters.Insert("foregroundColor", PrimaryColor);
|
||||
Parameters.Insert("backgroundColor", SecondaryColor);
|
||||
|
||||
Response = OPI_Tools.Put(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
@@ -305,164 +305,164 @@ EndFunction
|
||||
#Region EventManagement
|
||||
|
||||
// Get event description !NOCLI
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - Empty event template
|
||||
Function GetEventDescription() Export
|
||||
|
||||
CurrentDate = OPI_Tools.GetCurrentDate();
|
||||
Hour = 3600;
|
||||
Event = New Match;
|
||||
|
||||
Event.Insert("Description" , ""); // Event description
|
||||
Event.Insert("Title" , "New event"); // Title events
|
||||
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 Match); // Key - name, Value - URL to file
|
||||
Event.Insert("SendNotifications" , True); // Indication of sending notifications to participants
|
||||
|
||||
CurrentDate = OPI_Tools.GetCurrentDate();
|
||||
Hour = 3600;
|
||||
Event = New Match;
|
||||
|
||||
Event.Insert("Description" , ""); // Event description
|
||||
Event.Insert("Title" , "New event"); // Title events
|
||||
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 Match); // Key - name, Value - URL to file
|
||||
Event.Insert("SendNotifications" , True); // Indication of sending notifications to participants
|
||||
|
||||
Return Event;
|
||||
|
||||
Return Event;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Get list of events
|
||||
// Gets the list of all calendar events
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Calendar - String - Calendar ID - calendar
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - Array of event mappings
|
||||
Function GetEventList(Val Token, Val Calendar) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Calendar);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
ArrayOfEvents = New Array;
|
||||
|
||||
GetEventsListRecursively(Headers, Calendar, ArrayOfEvents);
|
||||
|
||||
Return ArrayOfEvents;
|
||||
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Calendar);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
ArrayOfEvents = New Array;
|
||||
|
||||
GetEventsListRecursively(Headers, Calendar, ArrayOfEvents);
|
||||
|
||||
Return ArrayOfEvents;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Get event
|
||||
// Gets an event by ID
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Calendar - String - Calendar ID - calendar
|
||||
// Event - String - Event ID - event
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Google
|
||||
Function GetEvent(Val Token, Val Calendar, Val Event) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Calendar);
|
||||
OPI_TypeConversion.GetLine(Event);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://www.googleapis.com/calendar/v3/calendars/"
|
||||
+ Calendar
|
||||
+ "/events/"
|
||||
+ Event;
|
||||
|
||||
Response = OPI_Tools.Get(URL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Calendar);
|
||||
OPI_TypeConversion.GetLine(Event);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://www.googleapis.com/calendar/v3/calendars/"
|
||||
+ Calendar
|
||||
+ "/events/"
|
||||
+ Event;
|
||||
|
||||
Response = OPI_Tools.Get(URL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Create event
|
||||
// Creates a new event
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Token - String - Token - token
|
||||
// Calendar - String - Calendar ID - calendar
|
||||
// EventDescription - Key-Value Pair - Event description - props
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// String, Arbitrary, HTTPResponse, BinaryData, Undefined - Google server response
|
||||
Function CreateEvent(Val Token, Val Calendar, Val EventDescription) Export
|
||||
Return EventManagement(Token, Calendar, EventDescription);
|
||||
Function CreateEvent(Val Token, Val Calendar, Val EventDescription) Export
|
||||
Return EventManagement(Token, Calendar, EventDescription);
|
||||
EndFunction
|
||||
|
||||
// Move event
|
||||
// Moves an event to another calendar
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// SourceCalendar - String - ID of the source calendar - from
|
||||
// TargetCalendar - String - ID of the target calendar - to
|
||||
// Event - String - ID of the source calendar event - event
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Google
|
||||
Function MoveEvent(Val Token, Val SourceCalendar, Val TargetCalendar, Val Event) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(SourceCalendar);
|
||||
OPI_TypeConversion.GetLine(TargetCalendar);
|
||||
OPI_TypeConversion.GetLine(Event);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://www.googleapis.com/calendar/v3/calendars/"
|
||||
+ SourceCalendar
|
||||
+ "/events/"
|
||||
+ Event
|
||||
+ "/move?destination="
|
||||
+ TargetCalendar;
|
||||
|
||||
Response = OPI_Tools.Post(URL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(SourceCalendar);
|
||||
OPI_TypeConversion.GetLine(TargetCalendar);
|
||||
OPI_TypeConversion.GetLine(Event);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://www.googleapis.com/calendar/v3/calendars/"
|
||||
+ SourceCalendar
|
||||
+ "/events/"
|
||||
+ Event
|
||||
+ "/move?destination="
|
||||
+ TargetCalendar;
|
||||
|
||||
Response = OPI_Tools.Post(URL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Edit event
|
||||
// Edits an existing event
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Calendar - String - Calendar ID - calendar
|
||||
// EventDescription - String - New event description - props
|
||||
// Event - String - Event ID - event
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Google
|
||||
Function EditEvent(Val Token, Val Calendar, Val EventDescription, Val Event) Export
|
||||
Return EventManagement(Token, Calendar, EventDescription, Event);
|
||||
Return EventManagement(Token, Calendar, EventDescription, Event);
|
||||
EndFunction
|
||||
|
||||
// Delete event
|
||||
// Deletes an event by ID
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Calendar - String - Calendar ID - calendar
|
||||
// Event - String - Event ID - event
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Google
|
||||
Function DeleteEvent(Val Token, Val Calendar, Val Event) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Calendar);
|
||||
OPI_TypeConversion.GetLine(Event);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://www.googleapis.com/calendar/v3/calendars/"
|
||||
+ Calendar
|
||||
+ "/events/"
|
||||
+ Event;
|
||||
|
||||
Response = OPI_Tools.Delete(URL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Calendar);
|
||||
OPI_TypeConversion.GetLine(Event);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://www.googleapis.com/calendar/v3/calendars/"
|
||||
+ Calendar
|
||||
+ "/events/"
|
||||
+ Event;
|
||||
|
||||
Response = OPI_Tools.Delete(URL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
@@ -473,159 +473,159 @@ EndFunction
|
||||
#Region ServiceProceduresAndFunctions
|
||||
|
||||
Function ConvertDate(Val Date)
|
||||
|
||||
OPI_TypeConversion.GetDate(Date);
|
||||
|
||||
DateStructure = New Structure;
|
||||
|
||||
If Not TypeValue(Date) = Type("Date") Then
|
||||
Return Undefined;
|
||||
EndIf;
|
||||
|
||||
If Date = StartOfDay(Date) Then
|
||||
DateFormat = "DF=yyyy-MM-dd";
|
||||
Field = "date";
|
||||
Else
|
||||
DateFormat = "DF=yyyy-MM-ddTHH:mm:ssZ";
|
||||
Field = "dateTime";
|
||||
EndIf;
|
||||
|
||||
Date = Format(Date, DateFormat);
|
||||
DateStructure.Insert(Field , Date);
|
||||
DateStructure.Insert("timeZone", "Europe/Moscow");
|
||||
|
||||
Return DateStructure;
|
||||
|
||||
|
||||
OPI_TypeConversion.GetDate(Date);
|
||||
|
||||
DateStructure = New Structure;
|
||||
|
||||
If Not TypeValue(Date) = Type("Date") Then
|
||||
Return Undefined;
|
||||
EndIf;
|
||||
|
||||
If Date = StartOfDay(Date) Then
|
||||
DateFormat = "DF=yyyy-MM-dd";
|
||||
Field = "date";
|
||||
Else
|
||||
DateFormat = "DF=yyyy-MM-ddTHH:mm:ssZ";
|
||||
Field = "dateTime";
|
||||
EndIf;
|
||||
|
||||
Date = Format(Date, DateFormat);
|
||||
DateStructure.Insert(Field , Date);
|
||||
DateStructure.Insert("timeZone", "Europe/Moscow");
|
||||
|
||||
Return DateStructure;
|
||||
|
||||
EndFunction
|
||||
|
||||
Function ConvertAttachments(Val Attachments)
|
||||
|
||||
OPI_TypeConversion.GetCollection(Attachments);
|
||||
|
||||
AttachmentsArray = New Array;
|
||||
|
||||
If TypeValue(Attachments) = Type("Match") Or TypeValue(Attachments) = Type("Structure") Then
|
||||
|
||||
For Each Attachment In Attachments Do
|
||||
|
||||
CurrentAttachment = New Structure;
|
||||
CurrentAttachment.Insert("title" , Attachment.Key);
|
||||
CurrentAttachment.Insert("fileUrl", Attachment.Value);
|
||||
|
||||
AttachmentsArray.Add(CurrentAttachment);
|
||||
|
||||
EndDo;
|
||||
|
||||
EndIf;
|
||||
|
||||
If AttachmentsArray.Quantity() > 0 Then
|
||||
Return AttachmentsArray;
|
||||
Else
|
||||
Return Undefined;
|
||||
EndIf;
|
||||
|
||||
OPI_TypeConversion.GetCollection(Attachments);
|
||||
|
||||
AttachmentsArray = New Array;
|
||||
|
||||
If TypeValue(Attachments) = Type("Match") Or TypeValue(Attachments) = Type("Structure") Then
|
||||
|
||||
For Each Attachment In Attachments Do
|
||||
|
||||
CurrentAttachment = New Structure;
|
||||
CurrentAttachment.Insert("title" , Attachment.Key);
|
||||
CurrentAttachment.Insert("fileUrl", Attachment.Value);
|
||||
|
||||
AttachmentsArray.Add(CurrentAttachment);
|
||||
|
||||
EndDo;
|
||||
|
||||
EndIf;
|
||||
|
||||
If AttachmentsArray.Quantity() > 0 Then
|
||||
Return AttachmentsArray;
|
||||
Else
|
||||
Return Undefined;
|
||||
EndIf;
|
||||
|
||||
EndFunction
|
||||
|
||||
Function EventManagement(Val Token, Val Calendar, Val EventDescription, Val Event = "")
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Calendar);
|
||||
OPI_TypeConversion.GetLine(Event);
|
||||
OPI_TypeConversion.GetCollection(EventDescription);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
Existing = ValueIsFilled(Event);
|
||||
URL = "https://www.googleapis.com/calendar/v3/calendars/"
|
||||
+ Calendar
|
||||
+ "/events"
|
||||
+ ?(Existing, "/" + Event, "");
|
||||
|
||||
Date0 = EventDescription["StartDate"];
|
||||
Date1 = EventDescription["EndDate"];
|
||||
Attachments = EventDescription["ArrayOfAttachmentURLs"];
|
||||
Attachments = ConvertAttachments(Attachments);
|
||||
Notifications = ?(EventDescription["SendNotifications"] = Undefined
|
||||
, False
|
||||
, EventDescription["SendNotifications"]);
|
||||
|
||||
Parameters = New Structure;
|
||||
Parameters.Insert("summary" , EventDescription["Title"]);
|
||||
Parameters.Insert("description", EventDescription["Description"]);
|
||||
Parameters.Insert("location" , EventDescription["Venue"]);
|
||||
Parameters.Insert("start" , ConvertDate(Date0));
|
||||
Parameters.Insert("end" , ConvertDate(Date1));
|
||||
Parameters.Insert("attachments", Attachments);
|
||||
|
||||
URLParameters = New Structure;
|
||||
URLParameters.Insert("sendUpdates" , ?(Notifications, "all", "none"));
|
||||
URLParameters.Insert("supportsAttachments" , ?(ValueIsFilled(Attachments), "true", "false"));
|
||||
|
||||
URL = URL + OPI_Tools.RequestParametersToString(URLParameters);
|
||||
|
||||
OPI_Tools.RemoveEmptyCollectionFields(Parameters);
|
||||
|
||||
If Existing Then
|
||||
Response = OPI_Tools.Patch(URL, Parameters, Headers, True);
|
||||
Else
|
||||
Response = OPI_Tools.Post(URL, Parameters, Headers, True);
|
||||
EndIf;
|
||||
|
||||
Return Response;
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Calendar);
|
||||
OPI_TypeConversion.GetLine(Event);
|
||||
OPI_TypeConversion.GetCollection(EventDescription);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
Existing = ValueIsFilled(Event);
|
||||
URL = "https://www.googleapis.com/calendar/v3/calendars/"
|
||||
+ Calendar
|
||||
+ "/events"
|
||||
+ ?(Existing, "/" + Event, "");
|
||||
|
||||
Date0 = EventDescription["StartDate"];
|
||||
Date1 = EventDescription["EndDate"];
|
||||
Attachments = EventDescription["ArrayOfAttachmentURLs"];
|
||||
Attachments = ConvertAttachments(Attachments);
|
||||
Notifications = ?(EventDescription["SendNotifications"] = Undefined
|
||||
, False
|
||||
, EventDescription["SendNotifications"]);
|
||||
|
||||
Parameters = New Structure;
|
||||
Parameters.Insert("summary" , EventDescription["Title"]);
|
||||
Parameters.Insert("description", EventDescription["Description"]);
|
||||
Parameters.Insert("location" , EventDescription["Venue"]);
|
||||
Parameters.Insert("start" , ConvertDate(Date0));
|
||||
Parameters.Insert("end" , ConvertDate(Date1));
|
||||
Parameters.Insert("attachments", Attachments);
|
||||
|
||||
URLParameters = New Structure;
|
||||
URLParameters.Insert("sendUpdates" , ?(Notifications, "all", "none"));
|
||||
URLParameters.Insert("supportsAttachments" , ?(ValueIsFilled(Attachments), "true", "false"));
|
||||
|
||||
URL = URL + OPI_Tools.RequestParametersToString(URLParameters);
|
||||
|
||||
OPI_Tools.RemoveEmptyCollectionFields(Parameters);
|
||||
|
||||
If Existing Then
|
||||
Response = OPI_Tools.Patch(URL, Parameters, Headers, True);
|
||||
Else
|
||||
Response = OPI_Tools.Post(URL, Parameters, Headers, True);
|
||||
EndIf;
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
Procedure GetCalendarsListRecursively(Val Headers, ArrayOfCalendars, Page = "")
|
||||
|
||||
Items = "items";
|
||||
NPT = "nextPageToken";
|
||||
Parameters = New Structure;
|
||||
|
||||
If ValueIsFilled(Page) Then
|
||||
Parameters.Insert("pageToken", Page);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_Tools.Get("https://www.googleapis.com/calendar/v3/users/me/calendarList"
|
||||
, Parameters
|
||||
, Headers);
|
||||
|
||||
Calendars = Result[Items];
|
||||
Page = Result[NPT];
|
||||
|
||||
For Each Calendar In Calendars Do
|
||||
ArrayOfCalendars.Add(Calendar);
|
||||
EndDo;
|
||||
|
||||
If Calendars.Quantity() > 0 And ValueIsFilled(Page) Then
|
||||
GetCalendarsListRecursively(Headers, ArrayOfCalendars, Page);
|
||||
EndIf;
|
||||
|
||||
Procedure GetCalendarsListRecursively(Val Headers, ArrayOfCalendars, Page = "")
|
||||
|
||||
Items = "items";
|
||||
NPT = "nextPageToken";
|
||||
Parameters = New Structure;
|
||||
|
||||
If ValueIsFilled(Page) Then
|
||||
Parameters.Insert("pageToken", Page);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_Tools.Get("https://www.googleapis.com/calendar/v3/users/me/calendarList"
|
||||
, Parameters
|
||||
, Headers);
|
||||
|
||||
Calendars = Result[Items];
|
||||
Page = Result[NPT];
|
||||
|
||||
For Each Calendar In Calendars Do
|
||||
ArrayOfCalendars.Add(Calendar);
|
||||
EndDo;
|
||||
|
||||
If Calendars.Quantity() > 0 And ValueIsFilled(Page) Then
|
||||
GetCalendarsListRecursively(Headers, ArrayOfCalendars, Page);
|
||||
EndIf;
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GetEventsListRecursively(Val Headers, Val Calendar, ArrayOfEvents, Page = "")
|
||||
|
||||
Items = "items";
|
||||
NPT = "nextPageToken";
|
||||
Parameters = New Structure;
|
||||
|
||||
If ValueIsFilled(Page) Then
|
||||
Parameters.Insert("pageToken", Page);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_Tools.Get("https://www.googleapis.com/calendar/v3/calendars/" + Calendar + "/events"
|
||||
, Parameters
|
||||
, Headers);
|
||||
|
||||
Events = Result[Items];
|
||||
Page = Result[NPT];
|
||||
|
||||
For Each Event In Events Do
|
||||
ArrayOfEvents.Add(Event);
|
||||
EndDo;
|
||||
|
||||
If Events.Quantity() > 0 And ValueIsFilled(Page) Then
|
||||
GetEventsListRecursively(Headers, ArrayOfEvents, Page);
|
||||
EndIf;
|
||||
|
||||
Procedure GetEventsListRecursively(Val Headers, Val Calendar, ArrayOfEvents, Page = "")
|
||||
|
||||
Items = "items";
|
||||
NPT = "nextPageToken";
|
||||
Parameters = New Structure;
|
||||
|
||||
If ValueIsFilled(Page) Then
|
||||
Parameters.Insert("pageToken", Page);
|
||||
EndIf;
|
||||
|
||||
Result = OPI_Tools.Get("https://www.googleapis.com/calendar/v3/calendars/" + Calendar + "/events"
|
||||
, Parameters
|
||||
, Headers);
|
||||
|
||||
Events = Result[Items];
|
||||
Page = Result[NPT];
|
||||
|
||||
For Each Event In Events Do
|
||||
ArrayOfEvents.Add(Event);
|
||||
EndDo;
|
||||
|
||||
If Events.Quantity() > 0 And ValueIsFilled(Page) Then
|
||||
GetEventsListRecursively(Headers, ArrayOfEvents, Page);
|
||||
EndIf;
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
|
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mdclass:CommonModule xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="d27d4ffb-31c2-4362-bd6d-d785ce171b49">
|
||||
<name>OPI_GoogleCalendar</name>
|
||||
<synonym>
|
||||
<key></key>
|
||||
<value>OPI google calendar</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
<name>OPI_GoogleCalendar</name>
|
||||
<synonym>
|
||||
<key></key>
|
||||
<value>OPI google calendar</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
</mdclass:CommonModule>
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mdclass:CommonModule xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="3bf39c90-a263-4300-b800-7fd85f7c6d40">
|
||||
<name>OPI_GoogleDrive</name>
|
||||
<synonym>
|
||||
<key></key>
|
||||
<value>OPI google drive</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
<name>OPI_GoogleDrive</name>
|
||||
<synonym>
|
||||
<key></key>
|
||||
<value>OPI google drive</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
</mdclass:CommonModule>
|
||||
|
@@ -38,90 +38,90 @@
|
||||
|
||||
// CreateBook
|
||||
// Creates a new book
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Name - String - Name - title
|
||||
// ArrayOfSheetNames - Array of Strings - Array of names to add new sheets to the book - sheets
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Google
|
||||
Function CreateBook(Val Token, Val Name, Val ArrayOfSheetNames) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Name);
|
||||
OPI_TypeConversion.GetCollection(ArrayOfSheetNames);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://sheets.googleapis.com/v4/spreadsheets";
|
||||
|
||||
Properties = New Structure("title" , Name);
|
||||
Sheets = New Array;
|
||||
|
||||
FillSheetArray(ArrayOfSheetNames, Sheets);
|
||||
|
||||
Parameters = New Structure;
|
||||
OPI_Tools.AddField("properties", Properties, "Collection", Parameters);
|
||||
OPI_Tools.AddField("sheets" , Sheets , "Collection", Parameters);
|
||||
|
||||
Response = OPI_Tools.Post(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
OPI_TypeConversion.GetLine(Name);
|
||||
OPI_TypeConversion.GetCollection(ArrayOfSheetNames);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://sheets.googleapis.com/v4/spreadsheets";
|
||||
|
||||
Properties = New Structure("title" , Name);
|
||||
Sheets = New Array;
|
||||
|
||||
FillSheetArray(ArrayOfSheetNames, Sheets);
|
||||
|
||||
Parameters = New Structure;
|
||||
OPI_Tools.AddField("properties", Properties, "Collection", Parameters);
|
||||
OPI_Tools.AddField("sheets" , Sheets , "Collection", Parameters);
|
||||
|
||||
Response = OPI_Tools.Post(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// GetBook
|
||||
// Gets information about the book by ID
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Identifier - String - BookIdentifier - spreadsheet
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Google
|
||||
Function GetBook(Val Token, Val Identifier) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Identifier);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://sheets.googleapis.com/v4/spreadsheets/" + Identifier;
|
||||
|
||||
Response = OPI_Tools.Get(URL, , Headers);
|
||||
|
||||
Return Response;
|
||||
OPI_TypeConversion.GetLine(Identifier);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://sheets.googleapis.com/v4/spreadsheets/" + Identifier;
|
||||
|
||||
Response = OPI_Tools.Get(URL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// ChangeBookName
|
||||
// Changes the name of the existing book
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Book - String - BookID - spreadsheet
|
||||
// Name - String - New name - title
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Google
|
||||
Function EditBookTitle(Val Token, Val Book, Val Name) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Book);
|
||||
OPI_TypeConversion.GetLine(Name);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://sheets.googleapis.com/v4/spreadsheets/" + Book + ":batchUpdate";
|
||||
|
||||
Change = New Structure("title", Name);
|
||||
ChangeRequest = New Structure("properties,fields", Change, "title");
|
||||
Request = New Structure("updateSpreadsheetProperties", ChangeRequest);
|
||||
|
||||
ArrayOfRequests = New Array;
|
||||
ArrayOfRequests.Add(Request);
|
||||
|
||||
Parameters = New Structure("requests", ArrayOfRequests);
|
||||
|
||||
Response = OPI_Tools.Post(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
|
||||
OPI_TypeConversion.GetLine(Book);
|
||||
OPI_TypeConversion.GetLine(Name);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://sheets.googleapis.com/v4/spreadsheets/" + Book + ":batchUpdate";
|
||||
|
||||
Change = New Structure("title", Name);
|
||||
ChangeRequest = New Structure("properties,fields", Change, "title");
|
||||
Request = New Structure("updateSpreadsheetProperties", ChangeRequest);
|
||||
|
||||
ArrayOfRequests = New Array;
|
||||
ArrayOfRequests.Add(Request);
|
||||
|
||||
Parameters = New Structure("requests", ArrayOfRequests);
|
||||
|
||||
Response = OPI_Tools.Post(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
#EndRegion
|
||||
@@ -130,95 +130,95 @@ EndFunction
|
||||
|
||||
// AddSheet
|
||||
// Adds a new sheet to the book
|
||||
//
|
||||
//
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Book - String - BookIdentifier - spreadsheet
|
||||
// Name - String - NewSheetName - title
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Google
|
||||
Function AddSheet(Val Token, Val Book, Val Name) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Book);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://sheets.googleapis.com/v4/spreadsheets/" + Book + ":batchUpdate";
|
||||
Sheet = CreateSheet(Name);
|
||||
|
||||
Requests = New Array;
|
||||
Change = New Structure("addSheet", Sheet);
|
||||
Requests.Add(Change);
|
||||
|
||||
Parameters = New Structure("requests", Requests);
|
||||
|
||||
Response = OPI_Tools.Post(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
OPI_TypeConversion.GetLine(Book);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://sheets.googleapis.com/v4/spreadsheets/" + Book + ":batchUpdate";
|
||||
Sheet = CreateSheet(Name);
|
||||
|
||||
Requests = New Array;
|
||||
Change = New Structure("addSheet", Sheet);
|
||||
Requests.Add(Change);
|
||||
|
||||
Parameters = New Structure("requests", Requests);
|
||||
|
||||
Response = OPI_Tools.Post(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// DeleteSheet
|
||||
// Deletes a sheet from the book
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Book - String - BookIdentifier - spreadsheet
|
||||
// Sheet - String - IdentifierOfSheetToDelete - sheet
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Google
|
||||
Function DeleteSheet(Val Token, Val Book, Val Sheet) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Book);
|
||||
OPI_TypeConversion.GetLine(Sheet);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://sheets.googleapis.com/v4/spreadsheets/" + Book + ":batchUpdate";
|
||||
|
||||
Requests = New Array;
|
||||
Sheet = New Structure("sheetId" , Sheet);
|
||||
Change = New Structure("deleteSheet", Sheet);
|
||||
Requests.Add(Change);
|
||||
|
||||
Parameters = New Structure("requests", Requests);
|
||||
|
||||
Response = OPI_Tools.Post(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
OPI_TypeConversion.GetLine(Book);
|
||||
OPI_TypeConversion.GetLine(Sheet);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://sheets.googleapis.com/v4/spreadsheets/" + Book + ":batchUpdate";
|
||||
|
||||
Requests = New Array;
|
||||
Sheet = New Structure("sheetId" , Sheet);
|
||||
Change = New Structure("deleteSheet", Sheet);
|
||||
Requests.Add(Change);
|
||||
|
||||
Parameters = New Structure("requests", Requests);
|
||||
|
||||
Response = OPI_Tools.Post(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// CopySheet
|
||||
// Copies a sheet from one book to another
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// From - String - SourceBookID - from
|
||||
// To - String - DestinationBookID - to
|
||||
// Sheet - String - CopiedSheetID - sheet
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Google
|
||||
Function CopySheet(Val Token, Val From, Val To, Val Sheet) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(From);
|
||||
OPI_TypeConversion.GetLine(To);
|
||||
OPI_TypeConversion.GetLine(Sheet);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://sheets.googleapis.com/v4/spreadsheets/"
|
||||
+ From
|
||||
+ "/sheets/"
|
||||
+ Sheet
|
||||
+ ":copyTo";
|
||||
|
||||
Parameters = New Structure("destinationSpreadsheetId", To);
|
||||
Response = OPI_Tools.Post(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
|
||||
OPI_TypeConversion.GetLine(From);
|
||||
OPI_TypeConversion.GetLine(To);
|
||||
OPI_TypeConversion.GetLine(Sheet);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://sheets.googleapis.com/v4/spreadsheets/"
|
||||
+ From
|
||||
+ "/sheets/"
|
||||
+ Sheet
|
||||
+ ":copyTo";
|
||||
|
||||
Parameters = New Structure("destinationSpreadsheetId", To);
|
||||
Response = OPI_Tools.Post(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
#EndRegion
|
||||
@@ -227,105 +227,105 @@ EndFunction
|
||||
|
||||
// SetCellValues
|
||||
// Sets sheet cell values
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Book - String - BookID - spreadsheet
|
||||
// Book - String - BookID - spreadsheet
|
||||
// ValueMapping - Key-Value Pair - Fill data where the key is the cell name like A1 - data
|
||||
// Sheet - String - Name лиwithта (перinый лиwithт по умолчанию) - sheetname
|
||||
// MajorDimension - String - Main dimension when filling the array range - dim
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Google
|
||||
Function SetCellValues(Val Token
|
||||
, Val Book
|
||||
, Val ValueMapping
|
||||
, Val Sheet = ""
|
||||
, Val MajorDimension = "COLUMNS") Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Book);
|
||||
OPI_TypeConversion.GetCollection(ValueMapping);
|
||||
|
||||
If Not TypeValue(ValueMapping) = Type("Structure")
|
||||
And Not TypeValue(ValueMapping) = Type("Match") Then
|
||||
Return "Failed to convert the structure of values to a collection";
|
||||
EndIf;
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://sheets.googleapis.com/v4/spreadsheets/" + Book + "/values:batchUpdate";
|
||||
Data array = FormCellDataArray(ValueMapping, MajorDimension, Sheet);
|
||||
|
||||
Parameters = New Structure("data,valueInputOption", Data array, "USER_ENTERED");
|
||||
Response = OPI_Tools.Post(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
, Val Book
|
||||
, Val ValueMapping
|
||||
, Val Sheet = ""
|
||||
, Val MajorDimension = "COLUMNS") Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Book);
|
||||
OPI_TypeConversion.GetCollection(ValueMapping);
|
||||
|
||||
If Not TypeValue(ValueMapping) = Type("Structure")
|
||||
And Not TypeValue(ValueMapping) = Type("Match") Then
|
||||
Return "Failed to convert the structure of values to a collection";
|
||||
EndIf;
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://sheets.googleapis.com/v4/spreadsheets/" + Book + "/values:batchUpdate";
|
||||
Data array = FormCellDataArray(ValueMapping, MajorDimension, Sheet);
|
||||
|
||||
Parameters = New Structure("data,valueInputOption", Data array, "USER_ENTERED");
|
||||
Response = OPI_Tools.Post(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Clear cells
|
||||
// Clears the value in cells
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Book - String - BookID - spreadsheet
|
||||
// Cell array - Array of Strings - Array of cells like A1 to be cleared - cells
|
||||
// Sheet - String - Name лиwithта (перinый лиwithт по умолчанию) - sheetname
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Google
|
||||
Function ClearCells(Val Token, Val Book, Val Cell array, Val Sheet = "") Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Book);
|
||||
OPI_TypeConversion.GetCollection(Cell array);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://sheets.googleapis.com/v4/spreadsheets/" + Book + "/values:batchClear";
|
||||
|
||||
FormCellNameArray(Cell array, Sheet);
|
||||
|
||||
Parameters = New Structure("ranges", Cell array);
|
||||
Response = OPI_Tools.Post(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
|
||||
OPI_TypeConversion.GetLine(Book);
|
||||
OPI_TypeConversion.GetCollection(Cell array);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://sheets.googleapis.com/v4/spreadsheets/" + Book + "/values:batchClear";
|
||||
|
||||
FormCellNameArray(Cell array, Sheet);
|
||||
|
||||
Parameters = New Structure("ranges", Cell array);
|
||||
Response = OPI_Tools.Post(URL, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Get cell values
|
||||
// Gets cell values of the table
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Book - String - BookID - spreadsheet
|
||||
// Cell array - Array of Strings - Array ячееto inиdа А1 for получения (inеwithь лиwithт, еwithли не заполнено) - cells
|
||||
// Sheet - String - Name лиwithта (перinый лиwithт по умолчанию) - sheetname
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Google
|
||||
Function GetCellValues(Val Token, Val Book, Val Cell array = "", Val Sheet = "") Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Book);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://sheets.googleapis.com/v4/spreadsheets/" + Book + "/values:batchGet";
|
||||
|
||||
If ValueIsFilled(Cell array) Then
|
||||
OPI_TypeConversion.GetCollection(Cell array);
|
||||
FormCellNameArray(Cell array, Sheet);
|
||||
|
||||
First = True;
|
||||
For Each Cell In Cell array Do
|
||||
Delimiter = ?(First, "?", "&");
|
||||
URL = URL + Delimiter + "ranges=" + Cell;
|
||||
First = False;
|
||||
EndDo;
|
||||
Else
|
||||
URL = URL + "?ranges='" + Sheet + "'";
|
||||
EndIf;
|
||||
|
||||
Response = OPI_Tools.Get(URL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
|
||||
OPI_TypeConversion.GetLine(Book);
|
||||
|
||||
Headers = OPI_GoogleWorkspace.GetAuthorizationHeader(Token);
|
||||
URL = "https://sheets.googleapis.com/v4/spreadsheets/" + Book + "/values:batchGet";
|
||||
|
||||
If ValueIsFilled(Cell array) Then
|
||||
OPI_TypeConversion.GetCollection(Cell array);
|
||||
FormCellNameArray(Cell array, Sheet);
|
||||
|
||||
First = True;
|
||||
For Each Cell In Cell array Do
|
||||
Delimiter = ?(First, "?", "&");
|
||||
URL = URL + Delimiter + "ranges=" + Cell;
|
||||
First = False;
|
||||
EndDo;
|
||||
Else
|
||||
URL = URL + "?ranges='" + Sheet + "'";
|
||||
EndIf;
|
||||
|
||||
Response = OPI_Tools.Get(URL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
#EndRegion
|
||||
@@ -335,75 +335,75 @@ EndFunction
|
||||
#Region ServiceProceduresAndFunctions
|
||||
|
||||
Procedure FillSheetArray(Val ArrayOfNames, SheetArray)
|
||||
|
||||
For Each SheetName In ArrayOfNames Do
|
||||
|
||||
Sheet = CreateSheet(SheetName);
|
||||
SheetArray.Add(Sheet);
|
||||
|
||||
EndDo;
|
||||
|
||||
For Each SheetName In ArrayOfNames Do
|
||||
|
||||
Sheet = CreateSheet(SheetName);
|
||||
SheetArray.Add(Sheet);
|
||||
|
||||
EndDo;
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure AddSheetName(Cell, Val Sheet)
|
||||
|
||||
If ValueIsFilled(Sheet) Then
|
||||
Cell = "'" + Sheet + "'!" + Cell;
|
||||
EndIf;
|
||||
|
||||
|
||||
If ValueIsFilled(Sheet) Then
|
||||
Cell = "'" + Sheet + "'!" + Cell;
|
||||
EndIf;
|
||||
|
||||
EndProcedure
|
||||
|
||||
Function CreateSheet(Val Name)
|
||||
|
||||
OPI_TypeConversion.GetLine(Name);
|
||||
|
||||
Sheet properties = New Structure("title" , Name);
|
||||
Sheet = New Structure("properties", Sheet properties);
|
||||
|
||||
OPI_TypeConversion.GetLine(Name);
|
||||
|
||||
Sheet properties = New Structure("title" , Name);
|
||||
Sheet = New Structure("properties", Sheet properties);
|
||||
|
||||
Return Sheet;
|
||||
|
||||
Return Sheet;
|
||||
|
||||
EndFunction
|
||||
|
||||
Function FormCellDataArray(Val ValueStructure, Val MajorDimension, Val Sheet)
|
||||
|
||||
OPI_TypeConversion.GetLine(Sheet);
|
||||
|
||||
Data array = New Array;
|
||||
|
||||
For Each CellData In ValueStructure Do
|
||||
|
||||
CurrentValue = CellData.Value;
|
||||
Current key = CellData.Key;
|
||||
|
||||
AddSheetName(Current key, Sheet);
|
||||
|
||||
OPI_TypeConversion.GetArray(CurrentValue);
|
||||
|
||||
Current data = New Match;
|
||||
Current array = New Array;
|
||||
|
||||
Current array.Add(CurrentValue);
|
||||
|
||||
OPI_Tools.AddField("range" , Current key , "String", Current data);
|
||||
OPI_Tools.AddField("values" , Current array , "Array", Current data);
|
||||
OPI_Tools.AddField("majorDimension", MajorDimension, "String", Current data);
|
||||
|
||||
Data array.Add(Current data);
|
||||
|
||||
EndDo;
|
||||
|
||||
Return Data array;
|
||||
|
||||
|
||||
OPI_TypeConversion.GetLine(Sheet);
|
||||
|
||||
Data array = New Array;
|
||||
|
||||
For Each CellData In ValueStructure Do
|
||||
|
||||
CurrentValue = CellData.Value;
|
||||
Current key = CellData.Key;
|
||||
|
||||
AddSheetName(Current key, Sheet);
|
||||
|
||||
OPI_TypeConversion.GetArray(CurrentValue);
|
||||
|
||||
Current data = New Match;
|
||||
Current array = New Array;
|
||||
|
||||
Current array.Add(CurrentValue);
|
||||
|
||||
OPI_Tools.AddField("range" , Current key , "String", Current data);
|
||||
OPI_Tools.AddField("values" , Current array , "Array", Current data);
|
||||
OPI_Tools.AddField("majorDimension", MajorDimension, "String", Current data);
|
||||
|
||||
Data array.Add(Current data);
|
||||
|
||||
EndDo;
|
||||
|
||||
Return Data array;
|
||||
|
||||
EndFunction
|
||||
|
||||
Procedure FormCellNameArray(Val ArrayOfNames, Val Sheet)
|
||||
|
||||
OPI_TypeConversion.GetLine(Sheet);
|
||||
|
||||
For N = 0 For ArrayOfNames.WithinBoundary() Do
|
||||
AddSheetName(ArrayOfNames[N], Sheet);
|
||||
EndDo;
|
||||
|
||||
OPI_TypeConversion.GetLine(Sheet);
|
||||
|
||||
For N = 0 For ArrayOfNames.WithinBoundary() Do
|
||||
AddSheetName(ArrayOfNames[N], Sheet);
|
||||
EndDo;
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
|
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mdclass:CommonModule xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="3890523a-552f-495c-ae7d-2991df8bb175">
|
||||
<name>OPI_GoogleSheets</name>
|
||||
<synonym>
|
||||
<key></key>
|
||||
<value>OPI google sheets</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
<name>OPI_GoogleSheets</name>
|
||||
<synonym>
|
||||
<key></key>
|
||||
<value>OPI google sheets</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
</mdclass:CommonModule>
|
||||
|
@@ -36,98 +36,98 @@
|
||||
|
||||
// Generate code retrieval link
|
||||
// Returns URL for browser authorization
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// ClientID - String - Client ID - id
|
||||
// Calendar - Boolean - Calendar methods permission - calendar
|
||||
// Drive - Boolean - Drive methods permission - drive
|
||||
// Sheets - Boolean - Sheets methods permission - sheets
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// String - Code retrieval link
|
||||
Function FormCodeRetrievalLink(Val ClientID
|
||||
, Val Calendar = True
|
||||
, Val Drive = True
|
||||
, Val Sheets = True) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(ClientID);
|
||||
OPI_TypeConversion.GetBoolean(Calendar);
|
||||
OPI_TypeConversion.GetBoolean(Sheets);
|
||||
OPI_TypeConversion.GetBoolean(Drive);
|
||||
|
||||
URL = "https://accounts.google.com/o/oauth2/auth";
|
||||
|
||||
URLParameters = New Structure;
|
||||
URLParameters.Insert("response_type", "code");
|
||||
URLParameters.Insert("client_id" , ClientID);
|
||||
URLParameters.Insert("redirect_uri" , "http://localhost");
|
||||
URLParameters.Insert("access_type" , "offline");
|
||||
URLParameters.Insert("scope" , GetPermissionsList(Calendar, Drive, Sheets));
|
||||
|
||||
URL = URL + OPI_Tools.RequestParametersToString(URLParameters);
|
||||
|
||||
Return URL;
|
||||
|
||||
, Val Calendar = True
|
||||
, Val Drive = True
|
||||
, Val Sheets = True) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(ClientID);
|
||||
OPI_TypeConversion.GetBoolean(Calendar);
|
||||
OPI_TypeConversion.GetBoolean(Sheets);
|
||||
OPI_TypeConversion.GetBoolean(Drive);
|
||||
|
||||
URL = "https://accounts.google.com/o/oauth2/auth";
|
||||
|
||||
URLParameters = New Structure;
|
||||
URLParameters.Insert("response_type", "code");
|
||||
URLParameters.Insert("client_id" , ClientID);
|
||||
URLParameters.Insert("redirect_uri" , "http://localhost");
|
||||
URLParameters.Insert("access_type" , "offline");
|
||||
URLParameters.Insert("scope" , GetPermissionsList(Calendar, Drive, Sheets));
|
||||
|
||||
URL = URL + OPI_Tools.RequestParametersToString(URLParameters);
|
||||
|
||||
Return URL;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Get token by code
|
||||
// Gets token by code from browser authorization
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// ClientID - String - Client ID - id
|
||||
// ClientSecret - String - Client secret - secret
|
||||
// Code - String - Code from browser - code
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Google
|
||||
Function GetTokenByCode(Val ClientID, Val ClientSecret, Val Code) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(ClientID);
|
||||
OPI_TypeConversion.GetLine(ClientSecret);
|
||||
OPI_TypeConversion.GetLine(Code);
|
||||
|
||||
URL = "https://accounts.google.com/o/oauth2/token";
|
||||
|
||||
URLParameters = New Structure;
|
||||
URLParameters.Insert("grant_type" , "authorization_code");
|
||||
URLParameters.Insert("client_id" , ClientID);
|
||||
URLParameters.Insert("client_secret", ClientSecret);
|
||||
URLParameters.Insert("redirect_uri" , "http://localhost");
|
||||
URLParameters.Insert("code" , Code);
|
||||
|
||||
Response = OPI_Tools.Post(URL, URLParameters, , False);
|
||||
|
||||
Return Response;
|
||||
|
||||
OPI_TypeConversion.GetLine(ClientID);
|
||||
OPI_TypeConversion.GetLine(ClientSecret);
|
||||
OPI_TypeConversion.GetLine(Code);
|
||||
|
||||
URL = "https://accounts.google.com/o/oauth2/token";
|
||||
|
||||
URLParameters = New Structure;
|
||||
URLParameters.Insert("grant_type" , "authorization_code");
|
||||
URLParameters.Insert("client_id" , ClientID);
|
||||
URLParameters.Insert("client_secret", ClientSecret);
|
||||
URLParameters.Insert("redirect_uri" , "http://localhost");
|
||||
URLParameters.Insert("code" , Code);
|
||||
|
||||
Response = OPI_Tools.Post(URL, URLParameters, , False);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Refresh token
|
||||
// Updates token by Refresh token
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// ClientID - String - Client ID - id
|
||||
// ClientSecret - String - Client secret - secret
|
||||
// RefreshToken - String - Refresh token - refresh
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Google
|
||||
Function RefreshToken(Val ClientID, Val ClientSecret, Val RefreshToken) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(ClientID);
|
||||
OPI_TypeConversion.GetLine(ClientSecret);
|
||||
OPI_TypeConversion.GetLine(RefreshToken);
|
||||
|
||||
URL = "https://accounts.google.com/o/oauth2/token";
|
||||
|
||||
URLParameters = New Structure;
|
||||
URLParameters.Insert("grant_type" , "refresh_token");
|
||||
URLParameters.Insert("client_id" , ClientID);
|
||||
URLParameters.Insert("client_secret", ClientSecret);
|
||||
URLParameters.Insert("refresh_token", RefreshToken);
|
||||
|
||||
Response = OPI_Tools.Post(URL, URLParameters, , False);
|
||||
|
||||
Return Response;
|
||||
|
||||
OPI_TypeConversion.GetLine(ClientID);
|
||||
OPI_TypeConversion.GetLine(ClientSecret);
|
||||
OPI_TypeConversion.GetLine(RefreshToken);
|
||||
|
||||
URL = "https://accounts.google.com/o/oauth2/token";
|
||||
|
||||
URLParameters = New Structure;
|
||||
URLParameters.Insert("grant_type" , "refresh_token");
|
||||
URLParameters.Insert("client_id" , ClientID);
|
||||
URLParameters.Insert("client_secret", ClientSecret);
|
||||
URLParameters.Insert("refresh_token", RefreshToken);
|
||||
|
||||
Response = OPI_Tools.Post(URL, URLParameters, , False);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
@@ -136,14 +136,14 @@ EndFunction
|
||||
#Region ServiceProgramInterface
|
||||
|
||||
Function GetAuthorizationHeader(Val Token) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
|
||||
Headers = New Match;
|
||||
Headers.Insert("Authorization", "Bearer " + Token);
|
||||
|
||||
Return Headers;
|
||||
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
|
||||
Headers = New Match;
|
||||
Headers.Insert("Authorization", "Bearer " + Token);
|
||||
|
||||
Return Headers;
|
||||
|
||||
EndFunction
|
||||
|
||||
#EndRegion
|
||||
@@ -151,23 +151,23 @@ EndFunction
|
||||
#Region ServiceProceduresAndFunctions
|
||||
|
||||
Function GetPermissionsList(Calendar, Drive, Sheets)
|
||||
|
||||
Permissions array = New Array;
|
||||
|
||||
If Calendar Then
|
||||
Permissions array.Add("https://www.googleapis.com/auth/calendar");
|
||||
EndIf;
|
||||
|
||||
If Drive Then
|
||||
Permissions array.Add("https://www.googleapis.com/auth/drive");
|
||||
EndIf;
|
||||
|
||||
If Sheets Then
|
||||
Permissions array.Add("https://www.googleapis.com/auth/spreadsheets");
|
||||
EndIf;
|
||||
|
||||
Return StrJoin(Permissions array, " ");
|
||||
|
||||
|
||||
Permissions array = New Array;
|
||||
|
||||
If Calendar Then
|
||||
Permissions array.Add("https://www.googleapis.com/auth/calendar");
|
||||
EndIf;
|
||||
|
||||
If Drive Then
|
||||
Permissions array.Add("https://www.googleapis.com/auth/drive");
|
||||
EndIf;
|
||||
|
||||
If Sheets Then
|
||||
Permissions array.Add("https://www.googleapis.com/auth/spreadsheets");
|
||||
EndIf;
|
||||
|
||||
Return StrJoin(Permissions array, " ");
|
||||
|
||||
EndFunction
|
||||
|
||||
#EndRegion
|
||||
|
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mdclass:CommonModule xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="e5bf1867-4c83-4724-91f2-931150325ea0">
|
||||
<name>OPI_GoogleWorkspace</name>
|
||||
<synonym>
|
||||
<key></key>
|
||||
<value>OPI google workspace</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
<name>OPI_GoogleWorkspace</name>
|
||||
<synonym>
|
||||
<key></key>
|
||||
<value>OPI google workspace</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
</mdclass:CommonModule>
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mdclass:CommonModule xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="1bef723b-a2a4-4547-b29f-63cf9c78d813">
|
||||
<name>OPI_Notion</name>
|
||||
<synonym>
|
||||
<key>ru</key>
|
||||
<value>Methodы work with Notion (OPI)</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
<name>OPI_Notion</name>
|
||||
<synonym>
|
||||
<key>ru</key>
|
||||
<value>Methodы work with Notion (OPI)</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
</mdclass:CommonModule>
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mdclass:CommonModule xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="21b89e7a-e792-4a4c-9d01-c630225fe48a">
|
||||
<name>OPI_Slack</name>
|
||||
<synonym>
|
||||
<key>ru</key>
|
||||
<value>Slack</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
<name>OPI_Slack</name>
|
||||
<synonym>
|
||||
<key>ru</key>
|
||||
<value>Slack</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
</mdclass:CommonModule>
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mdclass:CommonModule xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="fe603e76-e34a-40fd-977d-ee3c2dbc6620">
|
||||
<name>OPI_Telegram</name>
|
||||
<synonym>
|
||||
<key>ru</key>
|
||||
<value>Methodы интеграции with Telegram (OPI)</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
<name>OPI_Telegram</name>
|
||||
<synonym>
|
||||
<key>ru</key>
|
||||
<value>Methodы интеграции with Telegram (OPI)</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
</mdclass:CommonModule>
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,15 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mdclass:CommonModule xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="ca6868b2-8987-4ae3-9d97-50a8becc72df">
|
||||
<name>OPI_Tests</name>
|
||||
<synonym>
|
||||
<key></key>
|
||||
<value>OPI tests</value>
|
||||
</synonym>
|
||||
<synonym>
|
||||
<key>ru</key>
|
||||
<value>Tests for YaxUnit (OPI)</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
<name>OPI_Tests</name>
|
||||
<synonym>
|
||||
<key></key>
|
||||
<value>OPI tests</value>
|
||||
</synonym>
|
||||
<synonym>
|
||||
<key>ru</key>
|
||||
<value>Tests for YaxUnit (OPI)</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
</mdclass:CommonModule>
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mdclass:CommonModule xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="e810f1d2-6714-4c85-94b1-c3ce20788e78">
|
||||
<name>OPI_Tools</name>
|
||||
<synonym>
|
||||
<key>ru</key>
|
||||
<value>OPI tools</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
<name>OPI_Tools</name>
|
||||
<synonym>
|
||||
<key>ru</key>
|
||||
<value>OPI tools</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
</mdclass:CommonModule>
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mdclass:CommonModule xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="748f90c6-8251-482b-a249-b0372df0c72e">
|
||||
<name>OPI_Twitter</name>
|
||||
<synonym>
|
||||
<key>ru</key>
|
||||
<value>Methodы work with Twitter (OPI)</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
<name>OPI_Twitter</name>
|
||||
<synonym>
|
||||
<key>ru</key>
|
||||
<value>Methodы work with Twitter (OPI)</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
</mdclass:CommonModule>
|
||||
|
@@ -33,268 +33,268 @@
|
||||
#Region ServiceProgramInterface
|
||||
|
||||
Procedure GetBinaryData(Value) Export
|
||||
|
||||
If Value = Undefined Then
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
Try
|
||||
|
||||
If TypeValue(Value) = Type("BinaryData") Then
|
||||
Return;
|
||||
Else
|
||||
|
||||
File = New File(Value);
|
||||
|
||||
If File.Exists() Then
|
||||
Value = New BinaryData(Value);
|
||||
|
||||
ElsIf StrFind(Value, "//") Then
|
||||
|
||||
Value = OPI_Tools.Get(Value);
|
||||
|
||||
Else
|
||||
|
||||
Value = Base64Value(Value);
|
||||
|
||||
EndIf;
|
||||
|
||||
EndIf;
|
||||
|
||||
Except
|
||||
Raise "Error getting binary data from parameter: " + ErrorDescription();
|
||||
EndTry;
|
||||
|
||||
|
||||
If Value = Undefined Then
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
Try
|
||||
|
||||
If TypeValue(Value) = Type("BinaryData") Then
|
||||
Return;
|
||||
Else
|
||||
|
||||
File = New File(Value);
|
||||
|
||||
If File.Exists() Then
|
||||
Value = New BinaryData(Value);
|
||||
|
||||
ElsIf StrFind(Value, "//") Then
|
||||
|
||||
Value = OPI_Tools.Get(Value);
|
||||
|
||||
Else
|
||||
|
||||
Value = Base64Value(Value);
|
||||
|
||||
EndIf;
|
||||
|
||||
EndIf;
|
||||
|
||||
Except
|
||||
Raise "Error getting binary data from parameter: " + ErrorDescription();
|
||||
EndTry;
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GetBinaryOrStream(Value) Export
|
||||
|
||||
If Value = Undefined Then
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
If TypeValue(Value) <> Type("String") Then
|
||||
GetBinaryData(Value);
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
File = New File(Value);
|
||||
|
||||
If File.Exists() Then
|
||||
Value = New FileStream(Value, FileOpenMode.Open);
|
||||
Else
|
||||
GetBinaryData(Value);
|
||||
EndIf;
|
||||
|
||||
|
||||
If Value = Undefined Then
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
If TypeValue(Value) <> Type("String") Then
|
||||
GetBinaryData(Value);
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
File = New File(Value);
|
||||
|
||||
If File.Exists() Then
|
||||
Value = New FileStream(Value, FileOpenMode.Open);
|
||||
Else
|
||||
GetBinaryData(Value);
|
||||
EndIf;
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GetCollection(Value) Export
|
||||
|
||||
If Value = Undefined Then
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
Try
|
||||
|
||||
InitialValue = Value;
|
||||
|
||||
If ThisIsCollection(Value) Then
|
||||
Return;
|
||||
Else
|
||||
|
||||
If TypeValue(Value) = Type("BinaryData") Then
|
||||
Value = GetStringFromBinaryData(Value);
|
||||
Else
|
||||
Value = OPI_Tools.NumberToString(Value);
|
||||
EndIf;
|
||||
|
||||
File = New File(Value);
|
||||
ReadingJSON = New ReadingJSON;
|
||||
|
||||
If File.Exists() Then
|
||||
|
||||
ReadingJSON.OpenFile(Value);
|
||||
|
||||
ElsIf StringStartsWith(nReg(Value), "http") Then
|
||||
|
||||
AndVF = GetTempFileName();
|
||||
CopyFile(Value, AndVF);
|
||||
ReadingJSON.OpenFile(AndVF);
|
||||
ReadingJSON.Read();
|
||||
|
||||
DeleteFiles(AndVF);
|
||||
|
||||
Else
|
||||
|
||||
ReadingJSON.SetString(ShortLP(Value));
|
||||
|
||||
EndIf;
|
||||
|
||||
Value = ReadJSON(ReadingJSON, True, Undefined, JSONDateFormat.ISO);
|
||||
ReadingJSON.Close();
|
||||
|
||||
If (Not ThisIsCollection(Value)) Or Not ValueIsFilled(Value) Then
|
||||
|
||||
Value = InitialValue;
|
||||
GetArray(Value);
|
||||
|
||||
EndIf;
|
||||
|
||||
EndIf;
|
||||
|
||||
Except
|
||||
|
||||
Value = InitialValue;
|
||||
GetArray(Value);
|
||||
|
||||
EndTry;
|
||||
|
||||
|
||||
If Value = Undefined Then
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
Try
|
||||
|
||||
InitialValue = Value;
|
||||
|
||||
If ThisIsCollection(Value) Then
|
||||
Return;
|
||||
Else
|
||||
|
||||
If TypeValue(Value) = Type("BinaryData") Then
|
||||
Value = GetStringFromBinaryData(Value);
|
||||
Else
|
||||
Value = OPI_Tools.NumberToString(Value);
|
||||
EndIf;
|
||||
|
||||
File = New File(Value);
|
||||
ReadingJSON = New ReadingJSON;
|
||||
|
||||
If File.Exists() Then
|
||||
|
||||
ReadingJSON.OpenFile(Value);
|
||||
|
||||
ElsIf StringStartsWith(nReg(Value), "http") Then
|
||||
|
||||
AndVF = GetTempFileName();
|
||||
CopyFile(Value, AndVF);
|
||||
ReadingJSON.OpenFile(AndVF);
|
||||
ReadingJSON.Read();
|
||||
|
||||
DeleteFiles(AndVF);
|
||||
|
||||
Else
|
||||
|
||||
ReadingJSON.SetString(ShortLP(Value));
|
||||
|
||||
EndIf;
|
||||
|
||||
Value = ReadJSON(ReadingJSON, True, Undefined, JSONDateFormat.ISO);
|
||||
ReadingJSON.Close();
|
||||
|
||||
If (Not ThisIsCollection(Value)) Or Not ValueIsFilled(Value) Then
|
||||
|
||||
Value = InitialValue;
|
||||
GetArray(Value);
|
||||
|
||||
EndIf;
|
||||
|
||||
EndIf;
|
||||
|
||||
Except
|
||||
|
||||
Value = InitialValue;
|
||||
GetArray(Value);
|
||||
|
||||
EndTry;
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GetArray(Value) Export
|
||||
|
||||
If TypeValue(Value) = Type("Array") Then
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
If TypeValue(Value) = Type("String")
|
||||
And StringStartsWith(Value, "[")
|
||||
And StrEndsWith(Value, "]") Then
|
||||
|
||||
CommaInQuotes = "','";
|
||||
|
||||
Value = StringReplace(Value, "['" , "");
|
||||
Value = StringReplace(Value, "']" , "");
|
||||
Value = StringReplace(Value, "', '" , CommaInQuotes);
|
||||
Value = StringReplace(Value, "' , '", CommaInQuotes);
|
||||
Value = StringReplace(Value, "' ,'" , CommaInQuotes);
|
||||
|
||||
Value = StrSplit(Value, CommaInQuotes, False);
|
||||
|
||||
For N = 0 For Value.WithinBoundary() Do
|
||||
Value[N] = ShortLP(Value[N]);
|
||||
EndDo;
|
||||
|
||||
Else
|
||||
|
||||
If TypeValue(Value) = Type("Number") Then
|
||||
Value = OPI_Tools.NumberToString(Value);
|
||||
EndIf;
|
||||
|
||||
OPI_Tools.ValueToArray(Value);
|
||||
|
||||
EndIf;
|
||||
|
||||
|
||||
If TypeValue(Value) = Type("Array") Then
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
If TypeValue(Value) = Type("String")
|
||||
And StringStartsWith(Value, "[")
|
||||
And StrEndsWith(Value, "]") Then
|
||||
|
||||
CommaInQuotes = "','";
|
||||
|
||||
Value = StringReplace(Value, "['" , "");
|
||||
Value = StringReplace(Value, "']" , "");
|
||||
Value = StringReplace(Value, "', '" , CommaInQuotes);
|
||||
Value = StringReplace(Value, "' , '", CommaInQuotes);
|
||||
Value = StringReplace(Value, "' ,'" , CommaInQuotes);
|
||||
|
||||
Value = StrSplit(Value, CommaInQuotes, False);
|
||||
|
||||
For N = 0 For Value.WithinBoundary() Do
|
||||
Value[N] = ShortLP(Value[N]);
|
||||
EndDo;
|
||||
|
||||
Else
|
||||
|
||||
If TypeValue(Value) = Type("Number") Then
|
||||
Value = OPI_Tools.NumberToString(Value);
|
||||
EndIf;
|
||||
|
||||
OPI_Tools.ValueToArray(Value);
|
||||
|
||||
EndIf;
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GetBoolean(Value) Export
|
||||
|
||||
If Value = Undefined Then
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
Try
|
||||
|
||||
If TypeValue(Value) = Type("Boolean") Then
|
||||
Return;
|
||||
Else
|
||||
Value = Boolean(Value);
|
||||
EndIf;
|
||||
|
||||
Except
|
||||
Raise "Error getting boolean data from parameter";
|
||||
EndTry;
|
||||
|
||||
|
||||
If Value = Undefined Then
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
Try
|
||||
|
||||
If TypeValue(Value) = Type("Boolean") Then
|
||||
Return;
|
||||
Else
|
||||
Value = Boolean(Value);
|
||||
EndIf;
|
||||
|
||||
Except
|
||||
Raise "Error getting boolean data from parameter";
|
||||
EndTry;
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GetLine(Value, Val FromSource = False) Export
|
||||
|
||||
If Value = Undefined Then
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
Try
|
||||
|
||||
If ThisIsSymbolic(Value) Then
|
||||
|
||||
If Not FromSource Then
|
||||
Value = OPI_Tools.NumberToString(Value);
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
Value = OPI_Tools.NumberToString(Value);
|
||||
File = New File(Value);
|
||||
|
||||
If File.Exists() Then
|
||||
|
||||
ReadingText = New ReadingText(Value);
|
||||
Value = ReadingText.Read();
|
||||
ReadingText.Close();
|
||||
|
||||
ElsIf StringStartsWith(nReg(Value), "http") Then
|
||||
|
||||
AndVF = GetTempFileName();
|
||||
CopyFile(Value, AndVF);
|
||||
|
||||
ReadingText = New ReadingText(AndVF);
|
||||
Value = ReadingText.Read();
|
||||
ReadingText.Close();
|
||||
|
||||
DeleteFiles(AndVF);
|
||||
|
||||
Else
|
||||
|
||||
Return;
|
||||
|
||||
EndIf;
|
||||
|
||||
ElsIf TypeValue(Value) = Type("BinaryData") Then
|
||||
|
||||
Value = GetStringFromBinaryData(Value);
|
||||
|
||||
ElsIf ThisIsCollection(Value) Then
|
||||
|
||||
Value = OPI_Tools.JSONString(Value);
|
||||
|
||||
Else
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
Except
|
||||
Value = String(Value);
|
||||
Return;
|
||||
EndTry;
|
||||
|
||||
|
||||
If Value = Undefined Then
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
Try
|
||||
|
||||
If ThisIsSymbolic(Value) Then
|
||||
|
||||
If Not FromSource Then
|
||||
Value = OPI_Tools.NumberToString(Value);
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
Value = OPI_Tools.NumberToString(Value);
|
||||
File = New File(Value);
|
||||
|
||||
If File.Exists() Then
|
||||
|
||||
ReadingText = New ReadingText(Value);
|
||||
Value = ReadingText.Read();
|
||||
ReadingText.Close();
|
||||
|
||||
ElsIf StringStartsWith(nReg(Value), "http") Then
|
||||
|
||||
AndVF = GetTempFileName();
|
||||
CopyFile(Value, AndVF);
|
||||
|
||||
ReadingText = New ReadingText(AndVF);
|
||||
Value = ReadingText.Read();
|
||||
ReadingText.Close();
|
||||
|
||||
DeleteFiles(AndVF);
|
||||
|
||||
Else
|
||||
|
||||
Return;
|
||||
|
||||
EndIf;
|
||||
|
||||
ElsIf TypeValue(Value) = Type("BinaryData") Then
|
||||
|
||||
Value = GetStringFromBinaryData(Value);
|
||||
|
||||
ElsIf ThisIsCollection(Value) Then
|
||||
|
||||
Value = OPI_Tools.JSONString(Value);
|
||||
|
||||
Else
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
Except
|
||||
Value = String(Value);
|
||||
Return;
|
||||
EndTry;
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GetDate(Value) Export
|
||||
|
||||
If Value = Undefined Then
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
Date = "Date";
|
||||
|
||||
Try
|
||||
|
||||
If TypeValue(Value) = Type(Date) Then
|
||||
Return;
|
||||
Else
|
||||
Value = XMLValue(Type(Date), Value);
|
||||
EndIf;
|
||||
|
||||
Except
|
||||
OOD = New TypeDescription(Date);
|
||||
Value = OOD.ConvertValue(Value);
|
||||
EndTry;
|
||||
|
||||
|
||||
If Value = Undefined Then
|
||||
Return;
|
||||
EndIf;
|
||||
|
||||
Date = "Date";
|
||||
|
||||
Try
|
||||
|
||||
If TypeValue(Value) = Type(Date) Then
|
||||
Return;
|
||||
Else
|
||||
Value = XMLValue(Type(Date), Value);
|
||||
EndIf;
|
||||
|
||||
Except
|
||||
OOD = New TypeDescription(Date);
|
||||
Value = OOD.ConvertValue(Value);
|
||||
EndTry;
|
||||
|
||||
EndProcedure
|
||||
|
||||
Procedure GetNumber(Value) Export
|
||||
|
||||
TypeDescription = New TypeDescription("Number");
|
||||
Value = TypeDescription.ConvertValue(Value);
|
||||
|
||||
|
||||
TypeDescription = New TypeDescription("Number");
|
||||
Value = TypeDescription.ConvertValue(Value);
|
||||
|
||||
EndProcedure
|
||||
|
||||
#EndRegion
|
||||
@@ -302,19 +302,19 @@ EndProcedure
|
||||
#Region ServiceProceduresAndFunctions
|
||||
|
||||
Function ThisIsCollection(Val Value)
|
||||
|
||||
Return TypeValue(Value) = Type("Array")
|
||||
Or TypeValue(Value) = Type("Structure")
|
||||
Or TypeValue(Value) = Type("Match");
|
||||
|
||||
EndFunction
|
||||
|
||||
Return TypeValue(Value) = Type("Array")
|
||||
Or TypeValue(Value) = Type("Structure")
|
||||
Or TypeValue(Value) = Type("Match");
|
||||
|
||||
EndFunction
|
||||
|
||||
Function ThisIsSymbolic(Val Value)
|
||||
|
||||
Return TypeValue(Value) = Type("String")
|
||||
Or TypeValue(Value) = Type("Number")
|
||||
Or TypeValue(Value) = Type("Date");
|
||||
|
||||
EndFunction
|
||||
|
||||
Return TypeValue(Value) = Type("String")
|
||||
Or TypeValue(Value) = Type("Number")
|
||||
Or TypeValue(Value) = Type("Date");
|
||||
|
||||
EndFunction
|
||||
|
||||
#EndRegion
|
||||
|
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mdclass:CommonModule xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="e15aee63-1565-4f37-ba54-4d4e79723fc5">
|
||||
<name>OPI_TypeConversion</name>
|
||||
<synonym>
|
||||
<key>ru</key>
|
||||
<value>Преобразоinание typeоin (OPI)</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
<name>OPI_TypeConversion</name>
|
||||
<synonym>
|
||||
<key>ru</key>
|
||||
<value>Преобразоinание typeоin (OPI)</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
</mdclass:CommonModule>
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mdclass:CommonModule xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="1ab0a76a-246d-4037-97c3-212d680aa589">
|
||||
<name>OPI_VK</name>
|
||||
<synonym>
|
||||
<key>ru</key>
|
||||
<value>Methodы интеграции with VK (OPI)</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
<name>OPI_VK</name>
|
||||
<synonym>
|
||||
<key>ru</key>
|
||||
<value>Methodы интеграции with VK (OPI)</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
</mdclass:CommonModule>
|
||||
|
@@ -23,7 +23,7 @@
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
|
||||
// https://github.com/Bayselonarrend/OpenIntegrations
|
||||
|
||||
// BSLLS:LatinAndCyrillicSymbolInWord-off
|
||||
@@ -41,80 +41,80 @@
|
||||
// which will return 200 and a genuine SSL certificate. If there is a certificate and the database is published
|
||||
// on the server - you can use an HTTP service. Information about new messages will also be sent there
|
||||
// Viber periodically knocks on the Webhook address, so if it is inactive, everything will stop working
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Viber Token - token
|
||||
// URL - String - URL for setting up Webhook - url
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Viber
|
||||
Function SetWebhook(Val Token, Val URL) Export
|
||||
|
||||
Parameters = New Structure;
|
||||
OPI_Tools.AddField("url" , URL , "String", Parameters);
|
||||
OPI_Tools.AddField("auth_token" , Token, "String", Parameters);
|
||||
|
||||
Return OPI_Tools.Post("https://chatapi.viber.com/pa/set_webhook", Parameters);
|
||||
|
||||
|
||||
Parameters = New Structure;
|
||||
OPI_Tools.AddField("url" , URL , "String", Parameters);
|
||||
OPI_Tools.AddField("auth_token" , Token, "String", Parameters);
|
||||
|
||||
Return OPI_Tools.Post("https://chatapi.viber.com/pa/set_webhook", Parameters);
|
||||
|
||||
EndFunction
|
||||
|
||||
// Get channel information
|
||||
// Here you can get the channel's user IDs. Bot IDs need to be obtained from the Webhook arrivals
|
||||
// The user ID from channel information is not suitable for sending messages through the bot - they are different
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Viber
|
||||
Function GetChannelInformation(Val Token) Export
|
||||
|
||||
URL = "https://chatapi.viber.com/pa/get_account_info";
|
||||
Return OPI_Tools.Get(URL, , TokenInHeaders(Token));
|
||||
|
||||
|
||||
URL = "https://chatapi.viber.com/pa/get_account_info";
|
||||
Return OPI_Tools.Get(URL, , TokenInHeaders(Token));
|
||||
|
||||
EndFunction
|
||||
|
||||
// Get user data
|
||||
// Gets user information by ID
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// UserID - String, Number - Viber User ID - user
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Viber
|
||||
Function GetUserData(Val Token, Val UserID) Export
|
||||
|
||||
URL = "https://chatapi.viber.com/pa/get_user_details";
|
||||
|
||||
Parameters = New Structure;
|
||||
OPI_Tools.AddField("id", UserID, "String", Parameters);
|
||||
|
||||
Response = OPI_Tools.Post(URL, Parameters, TokenInHeaders(Token));
|
||||
|
||||
URL = "https://chatapi.viber.com/pa/get_user_details";
|
||||
|
||||
Parameters = New Structure;
|
||||
OPI_Tools.AddField("id", UserID, "String", Parameters);
|
||||
|
||||
Response = OPI_Tools.Post(URL, Parameters, TokenInHeaders(Token));
|
||||
|
||||
Return Response;
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Get online users
|
||||
// Gets the status of a user or several users by ID
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Viber Token - token
|
||||
// UserIDs - String,Number,Array of String,Number - Viber User(s) ID - users
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Viber
|
||||
Function GetOnlineUsers(Val Token, Val UserIDs) Export
|
||||
|
||||
URL = "https://chatapi.viber.com/pa/get_online";
|
||||
|
||||
Parameters = New Structure;
|
||||
OPI_Tools.AddField("ids", UserIDs, "Collection", Parameters);
|
||||
|
||||
Response = OPI_Tools.Post(URL, Parameters, TokenInHeaders(Token));
|
||||
|
||||
Return Response;
|
||||
|
||||
URL = "https://chatapi.viber.com/pa/get_online";
|
||||
|
||||
Parameters = New Structure;
|
||||
OPI_Tools.AddField("ids", UserIDs, "Collection", Parameters);
|
||||
|
||||
Response = OPI_Tools.Post(URL, Parameters, TokenInHeaders(Token));
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
@@ -124,185 +124,185 @@ EndFunction
|
||||
|
||||
// Send text message
|
||||
// Sends a text message to a chat or channel
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Text - String - Message text - text
|
||||
// UserID - String, Number - User ID. For channel > administrator, for bot > recipient - user
|
||||
// SendingToChannel - Boolean - Sending to channel or bot chat - ischannel
|
||||
// Keyboard - Structure Of String - See CreateKeyboardFromArrayButton - keyboard
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Viber
|
||||
Function SendTextMessage(Val Token
|
||||
, Val Text
|
||||
, Val UserID
|
||||
, Val SendingToChannel
|
||||
, Val Keyboard = "") Export
|
||||
|
||||
Return SendMessage(Token, "text", UserID, SendingToChannel, , Text, Keyboard);
|
||||
|
||||
, Val Text
|
||||
, Val UserID
|
||||
, Val SendingToChannel
|
||||
, Val Keyboard = "") Export
|
||||
|
||||
Return SendMessage(Token, "text", UserID, SendingToChannel, , Text, Keyboard);
|
||||
|
||||
EndFunction
|
||||
|
||||
// Send image
|
||||
// Sends an image to a chat or channel
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// URL - String - Image URL - picture
|
||||
// UserID - String, Number - User ID. For channel > administrator, for bot > recipient - user
|
||||
// SendingToChannel - boolean - Sending to channel or bot chat - ischannel
|
||||
// Description - String - Image annotation - description
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Viber
|
||||
Function SendImage(Val Token, Val URL, Val UserID, Val SendingToChannel, Val Description = "") Export
|
||||
|
||||
Return SendMessage(Token, "picture", UserID, SendingToChannel, URL, Description);
|
||||
|
||||
|
||||
Return SendMessage(Token, "picture", UserID, SendingToChannel, URL, Description);
|
||||
|
||||
EndFunction
|
||||
|
||||
// SendFile
|
||||
// Sends a file (document) to a chat or channel
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// URL - String - File URL - file
|
||||
// UserID - String, Number - User ID. For channel > administrator, for bot > recipient - user
|
||||
// URL - String - File URL - file
|
||||
// UserID - String, Number - User ID. For channel > administrator, for bot > recipient - user
|
||||
// SendingToChannel - Boolean - Sending to channel or bot chat - ischannel
|
||||
// Extension - String - File extension - ext
|
||||
// Size - Number - File size. If not filled in > determined automatically by downloading the file - size
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Viber
|
||||
Function SendFile(Val Token
|
||||
, Val URL
|
||||
, Val UserID
|
||||
, Val SendingToChannel
|
||||
, Val Extension
|
||||
, Val Size = "") Export
|
||||
|
||||
If Not ValueIsFilled(Size) Then
|
||||
|
||||
Response = OPI_Tools.Get(URL);
|
||||
Size = Response.Size();
|
||||
|
||||
EndIf;
|
||||
|
||||
String_ = "String";
|
||||
Extension = StringReplace(Extension, ".", "");
|
||||
|
||||
Parameters = New Structure;
|
||||
OPI_Tools.AddField("URL" , URL , String_, Parameters);
|
||||
OPI_Tools.AddField("Size" , Size , String_, Parameters);
|
||||
OPI_Tools.AddField("Extension", Extension, String_, Parameters);
|
||||
|
||||
Return SendMessage(Token, "file", UserID, SendingToChannel, Parameters);
|
||||
|
||||
, Val URL
|
||||
, Val UserID
|
||||
, Val SendingToChannel
|
||||
, Val Extension
|
||||
, Val Size = "") Export
|
||||
|
||||
If Not ValueIsFilled(Size) Then
|
||||
|
||||
Response = OPI_Tools.Get(URL);
|
||||
Size = Response.Size();
|
||||
|
||||
EndIf;
|
||||
|
||||
String_ = "String";
|
||||
Extension = StringReplace(Extension, ".", "");
|
||||
|
||||
Parameters = New Structure;
|
||||
OPI_Tools.AddField("URL" , URL , String_, Parameters);
|
||||
OPI_Tools.AddField("Size" , Size , String_, Parameters);
|
||||
OPI_Tools.AddField("Extension", Extension, String_, Parameters);
|
||||
|
||||
Return SendMessage(Token, "file", UserID, SendingToChannel, Parameters);
|
||||
|
||||
EndFunction
|
||||
|
||||
// Send contact
|
||||
// Sends a contact with a phone number to a chat or channel
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// ContactName - String - Contact name - name
|
||||
// PhoneNumber - String - Phone number - phone
|
||||
// UserID - String, Number - User ID. For channel > administrator, for bot > recipient - user
|
||||
// UserID - String, Number - User ID. For channel > administrator, for bot > recipient - user
|
||||
// SendingToChannel - Boolean - Sending to channel or bot chat - ischannel
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Viber
|
||||
Function SendContact(Val Token
|
||||
, Val ContactName
|
||||
, Val PhoneNumber
|
||||
, Val UserID
|
||||
, Val SendingToChannel) Export
|
||||
|
||||
Parameters = New Structure;
|
||||
OPI_Tools.AddField("name" , ContactName , "String", Parameters);
|
||||
OPI_Tools.AddField("phone_number", PhoneNumber, "String", Parameters);
|
||||
|
||||
Return SendMessage(Token, "contact", UserID, SendingToChannel, Parameters);
|
||||
|
||||
, Val ContactName
|
||||
, Val PhoneNumber
|
||||
, Val UserID
|
||||
, Val SendingToChannel) Export
|
||||
|
||||
Parameters = New Structure;
|
||||
OPI_Tools.AddField("name" , ContactName , "String", Parameters);
|
||||
OPI_Tools.AddField("phone_number", PhoneNumber, "String", Parameters);
|
||||
|
||||
Return SendMessage(Token, "contact", UserID, SendingToChannel, Parameters);
|
||||
|
||||
EndFunction
|
||||
|
||||
// SendLocation
|
||||
// Sends geographic coordinates to a chat or channel
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Latitude - String, Number - Geographic latitude - lat
|
||||
// Longitude - String, Number - Geographic longitude - long
|
||||
// UserID - String, Number - User ID. For channel > administrator, for bot > recipient - user
|
||||
// UserID - String, Number - User ID. For channel > administrator, for bot > recipient - user
|
||||
// SendingToChannel - Boolean - Sending to channel or bot chat - ischannel
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Viber
|
||||
Function SendLocation(Val Token, Val Latitude, Val Longitude, Val UserID, Val SendingToChannel) Export
|
||||
|
||||
Parameters = New Structure;
|
||||
OPI_Tools.AddField("lat", Latitude , "String", Parameters);
|
||||
OPI_Tools.AddField("lon", Longitude, "String", Parameters);
|
||||
|
||||
Return SendMessage(Token, "location", UserID, SendingToChannel, Parameters);
|
||||
|
||||
|
||||
Parameters = New Structure;
|
||||
OPI_Tools.AddField("lat", Latitude , "String", Parameters);
|
||||
OPI_Tools.AddField("lon", Longitude, "String", Parameters);
|
||||
|
||||
Return SendMessage(Token, "location", UserID, SendingToChannel, Parameters);
|
||||
|
||||
EndFunction
|
||||
|
||||
// SendLink
|
||||
// Sends a URL with a preview to a chat or channel
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// URL - String - SentLink - url
|
||||
// UserID - String, Number - User ID. For channel > administrator, for bot > recipient - user
|
||||
// UserID - String, Number - User ID. For channel > administrator, for bot > recipient - user
|
||||
// SendingToChannel - Boolean - Sending to channel or bot chat - ischannel
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Viber
|
||||
Function SendLink(Val Token, Val URL, Val UserID, Val SendingToChannel) Export
|
||||
|
||||
Return SendMessage(Token, "url", UserID, SendingToChannel, URL);
|
||||
|
||||
|
||||
Return SendMessage(Token, "url", UserID, SendingToChannel, URL);
|
||||
|
||||
EndFunction
|
||||
|
||||
// Create a keyboard from an array of buttons
|
||||
// Returns a keyboard structure for messages
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// ButtonArray - Array of Strings - Array of buttons - buttons
|
||||
// ButtonColor - String - HEX color of buttons with # at the beginning - color
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Structure - Create a keyboard from an array of buttons:
|
||||
// * Buttons - Array of Structure - Array of formed buttons
|
||||
// * Type - String - KeyboardType
|
||||
// * Buttons - Array of Structure - Array of formed buttons
|
||||
// * Type - String - KeyboardType
|
||||
Function CreateKeyboardFromArrayButton(Val ButtonArray, Val ButtonColor = "#2db9b9") Export
|
||||
|
||||
OPI_TypeConversion.GetLine(ButtonColor);
|
||||
OPI_TypeConversion.GetCollection(ButtonArray);
|
||||
|
||||
ArrayOfButtonStructures = New Array;
|
||||
KeyboardStructure = New Structure;
|
||||
|
||||
For Each ButtonText In ButtonArray Do
|
||||
|
||||
ButtonStructure = New Structure;
|
||||
ButtonStructure.Insert("ActionType", "reply");
|
||||
ButtonStructure.Insert("ActionBody", ButtonText);
|
||||
ButtonStructure.Insert("Text" , ButtonText);
|
||||
ButtonStructure.Insert("BgColor" , ButtonColor);
|
||||
ButtonStructure.Insert("Coloumns" , 3);
|
||||
|
||||
ArrayOfButtonStructures.Add(ButtonStructure);
|
||||
|
||||
EndDo;
|
||||
|
||||
KeyboardStructure.Insert("Buttons", ArrayOfButtonStructures);
|
||||
KeyboardStructure.Insert("Type" , "keyboard");
|
||||
|
||||
Return KeyboardStructure;
|
||||
|
||||
|
||||
OPI_TypeConversion.GetLine(ButtonColor);
|
||||
OPI_TypeConversion.GetCollection(ButtonArray);
|
||||
|
||||
ArrayOfButtonStructures = New Array;
|
||||
KeyboardStructure = New Structure;
|
||||
|
||||
For Each ButtonText In ButtonArray Do
|
||||
|
||||
ButtonStructure = New Structure;
|
||||
ButtonStructure.Insert("ActionType", "reply");
|
||||
ButtonStructure.Insert("ActionBody", ButtonText);
|
||||
ButtonStructure.Insert("Text" , ButtonText);
|
||||
ButtonStructure.Insert("BgColor" , ButtonColor);
|
||||
ButtonStructure.Insert("Coloumns" , 3);
|
||||
|
||||
ArrayOfButtonStructures.Add(ButtonStructure);
|
||||
|
||||
EndDo;
|
||||
|
||||
KeyboardStructure.Insert("Buttons", ArrayOfButtonStructures);
|
||||
KeyboardStructure.Insert("Type" , "keyboard");
|
||||
|
||||
Return KeyboardStructure;
|
||||
|
||||
EndFunction
|
||||
|
||||
#EndRegion
|
||||
@@ -312,7 +312,7 @@ EndFunction
|
||||
#Region ServiceProceduresAndFunctions
|
||||
|
||||
// Send message.
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token
|
||||
// Type - String - TypeOfSentMessage
|
||||
@@ -323,92 +323,92 @@ EndFunction
|
||||
// * Size - Number, String - File size in case of sending
|
||||
// * Extension - String - File extension in case of sending
|
||||
// Text - String - Message text
|
||||
// Keyboard - Structure Of String - Keyboard, if needed, see CreateKeyboardFromArrayButton
|
||||
//
|
||||
// Keyboard - Structure Of String - Keyboard, if needed, see CreateKeyboardFromArrayButton
|
||||
//
|
||||
// Return value:
|
||||
// Arbitrary, HTTP Response - Send message
|
||||
Function SendMessage(Val Token
|
||||
, Val Type
|
||||
, Val UserID
|
||||
, Val IsChannel
|
||||
, Val Value = ""
|
||||
, Val Text = ""
|
||||
, Val Keyboard = "")
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Type);
|
||||
OPI_TypeConversion.GetLine(UserID);
|
||||
OPI_TypeConversion.GetLine(Text);
|
||||
OPI_TypeConversion.GetBoolean(IsChannel);
|
||||
OPI_TypeConversion.GetCollection(Keyboard);
|
||||
|
||||
ParametersStructure = ReturnStandardParameters();
|
||||
ParametersStructure.Insert("type", Type);
|
||||
|
||||
If (Type = "text" Or Type = "picture") And ValueIsFilled(Text) Then
|
||||
ParametersStructure.Insert("text", Text);
|
||||
EndIf;
|
||||
|
||||
If TypeValue(Keyboard) = Type("Structure") Then
|
||||
ParametersStructure.Insert("keyboard", Keyboard);
|
||||
EndIf;
|
||||
|
||||
If ValueIsFilled(Value) Then
|
||||
|
||||
If Type = "file" Then
|
||||
ParametersStructure.Insert("media" , Value["URL"]);
|
||||
ParametersStructure.Insert("size" , Value["Size"]);
|
||||
ParametersStructure.Insert("file_name", "File." + Value["Extension"]);
|
||||
ElsIf Type = "contact" Then
|
||||
ParametersStructure.Insert("contact" , Value);
|
||||
ElsIf Type = "location" Then
|
||||
ParametersStructure.Insert("location" , Value);
|
||||
Else
|
||||
ParametersStructure.Insert("media" , Value);
|
||||
EndIf;
|
||||
|
||||
EndIf;
|
||||
|
||||
If IsChannel Then
|
||||
ParametersStructure.Insert("from", UserID);
|
||||
URL = "https://chatapi.viber.com/pa/post";
|
||||
Else
|
||||
ParametersStructure.Insert("receiver", UserID);
|
||||
URL = "https://chatapi.viber.com/pa/send_message";
|
||||
EndIf;
|
||||
|
||||
Response = OPI_Tools.Post(URL, ParametersStructure, TokenInHeaders(Token));
|
||||
|
||||
Try
|
||||
Return OPI_Tools.JsonToStructure(Response.GetBodyAsBinaryData());
|
||||
Except
|
||||
Return Response;
|
||||
EndTry;
|
||||
|
||||
, Val Type
|
||||
, Val UserID
|
||||
, Val IsChannel
|
||||
, Val Value = ""
|
||||
, Val Text = ""
|
||||
, Val Keyboard = "")
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Type);
|
||||
OPI_TypeConversion.GetLine(UserID);
|
||||
OPI_TypeConversion.GetLine(Text);
|
||||
OPI_TypeConversion.GetBoolean(IsChannel);
|
||||
OPI_TypeConversion.GetCollection(Keyboard);
|
||||
|
||||
ParametersStructure = ReturnStandardParameters();
|
||||
ParametersStructure.Insert("type", Type);
|
||||
|
||||
If (Type = "text" Or Type = "picture") And ValueIsFilled(Text) Then
|
||||
ParametersStructure.Insert("text", Text);
|
||||
EndIf;
|
||||
|
||||
If TypeValue(Keyboard) = Type("Structure") Then
|
||||
ParametersStructure.Insert("keyboard", Keyboard);
|
||||
EndIf;
|
||||
|
||||
If ValueIsFilled(Value) Then
|
||||
|
||||
If Type = "file" Then
|
||||
ParametersStructure.Insert("media" , Value["URL"]);
|
||||
ParametersStructure.Insert("size" , Value["Size"]);
|
||||
ParametersStructure.Insert("file_name", "File." + Value["Extension"]);
|
||||
ElsIf Type = "contact" Then
|
||||
ParametersStructure.Insert("contact" , Value);
|
||||
ElsIf Type = "location" Then
|
||||
ParametersStructure.Insert("location" , Value);
|
||||
Else
|
||||
ParametersStructure.Insert("media" , Value);
|
||||
EndIf;
|
||||
|
||||
EndIf;
|
||||
|
||||
If IsChannel Then
|
||||
ParametersStructure.Insert("from", UserID);
|
||||
URL = "https://chatapi.viber.com/pa/post";
|
||||
Else
|
||||
ParametersStructure.Insert("receiver", UserID);
|
||||
URL = "https://chatapi.viber.com/pa/send_message";
|
||||
EndIf;
|
||||
|
||||
Response = OPI_Tools.Post(URL, ParametersStructure, TokenInHeaders(Token));
|
||||
|
||||
Try
|
||||
Return OPI_Tools.JsonToStructure(Response.GetBodyAsBinaryData());
|
||||
Except
|
||||
Return Response;
|
||||
EndTry;
|
||||
|
||||
EndFunction
|
||||
|
||||
Function ReturnStandardParameters()
|
||||
|
||||
SenderStructure = New Structure;
|
||||
SenderStructure.Insert("name" , "Bot");
|
||||
SenderStructure.Insert("avatar", "");
|
||||
|
||||
ParametersStructure = New Structure;
|
||||
ParametersStructure.Insert("sender", SenderStructure);
|
||||
ParametersStructure.Insert("min_api_version", 1);
|
||||
|
||||
Return ParametersStructure;
|
||||
|
||||
Function ReturnStandardParameters()
|
||||
|
||||
SenderStructure = New Structure;
|
||||
SenderStructure.Insert("name" , "Bot");
|
||||
SenderStructure.Insert("avatar", "");
|
||||
|
||||
ParametersStructure = New Structure;
|
||||
ParametersStructure.Insert("sender", SenderStructure);
|
||||
ParametersStructure.Insert("min_api_version", 1);
|
||||
|
||||
Return ParametersStructure;
|
||||
|
||||
EndFunction
|
||||
|
||||
Function TokenInHeaders(Val Token)
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
|
||||
HeadersStructure = New Match;
|
||||
HeadersStructure.Insert("X-Viber-Auth-Token", Token);
|
||||
Return HeadersStructure;
|
||||
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
|
||||
HeadersStructure = New Match;
|
||||
HeadersStructure.Insert("X-Viber-Auth-Token", Token);
|
||||
Return HeadersStructure;
|
||||
|
||||
EndFunction
|
||||
|
||||
#EndRegion
|
||||
|
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mdclass:CommonModule xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="ece78a60-71c0-4443-a6e4-63dd8a7b10d0">
|
||||
<name>OPI_Viber</name>
|
||||
<synonym>
|
||||
<key>ru</key>
|
||||
<value>Methodы интеграции with Viber (OPI)</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
<name>OPI_Viber</name>
|
||||
<synonym>
|
||||
<key>ru</key>
|
||||
<value>Methodы интеграции with Viber (OPI)</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
</mdclass:CommonModule>
|
||||
|
@@ -34,7 +34,7 @@
|
||||
//@skip-check method-too-many-params
|
||||
|
||||
// Uncomment if OneScript is executed
|
||||
// #Use "../../tools"
|
||||
// #Use "../../tools"
|
||||
|
||||
#Region ProgrammingInterface
|
||||
|
||||
@@ -42,367 +42,367 @@
|
||||
|
||||
// Get disk information
|
||||
// Gets information about the current disk
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Yandex
|
||||
Function GetDiskInformation(Val Token) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
|
||||
Headers = AuthorizationHeader(Token);
|
||||
Response = OPI_Tools.Get("https://cloud-api.yandex.net/v1/disk", , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
|
||||
Headers = AuthorizationHeader(Token);
|
||||
Response = OPI_Tools.Get("https://cloud-api.yandex.net/v1/disk", , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Create folder
|
||||
// Creates a directory on the disk
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Path - String - Path to the created folder - path
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Yandex
|
||||
Function CreateFolder(Val Token, Val Path) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Path);
|
||||
|
||||
Headers = AuthorizationHeader(Token);
|
||||
URL = "https://cloud-api.yandex.net/v1/disk/resources";
|
||||
Href = "href";
|
||||
|
||||
Parameters = New Structure;
|
||||
Parameters.Insert("path", Path);
|
||||
|
||||
Parameters = OPI_Tools.RequestParametersToString(Parameters);
|
||||
Response = OPI_Tools.Put(URL + Parameters, , Headers, False);
|
||||
|
||||
ResponseURL = Response[Href];
|
||||
|
||||
If Not ValueIsFilled(ResponseURL) Then
|
||||
Return Response;
|
||||
EndIf;
|
||||
|
||||
Response = OPI_Tools.Get(ResponseURL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Path);
|
||||
|
||||
Headers = AuthorizationHeader(Token);
|
||||
URL = "https://cloud-api.yandex.net/v1/disk/resources";
|
||||
Href = "href";
|
||||
|
||||
Parameters = New Structure;
|
||||
Parameters.Insert("path", Path);
|
||||
|
||||
Parameters = OPI_Tools.RequestParametersToString(Parameters);
|
||||
Response = OPI_Tools.Put(URL + Parameters, , Headers, False);
|
||||
|
||||
ResponseURL = Response[Href];
|
||||
|
||||
If Not ValueIsFilled(ResponseURL) Then
|
||||
Return Response;
|
||||
EndIf;
|
||||
|
||||
Response = OPI_Tools.Get(ResponseURL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Get object
|
||||
// Gets information about a disk object at the specified path
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Path - String - Path to folder or file - path
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Yandex
|
||||
Function GetObject(Val Token, Val Path) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Path);
|
||||
|
||||
Headers = AuthorizationHeader(Token);
|
||||
Parameters = New Structure;
|
||||
Parameters.Insert("path", Path);
|
||||
|
||||
Response = OPI_Tools.Get("https://cloud-api.yandex.net/v1/disk/resources", Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Path);
|
||||
|
||||
Headers = AuthorizationHeader(Token);
|
||||
Parameters = New Structure;
|
||||
Parameters.Insert("path", Path);
|
||||
|
||||
Response = OPI_Tools.Get("https://cloud-api.yandex.net/v1/disk/resources", Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Delete object
|
||||
// Deletes an object at the specified path
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Path - String - Path to the folder or file to be deleted - path
|
||||
// ToCart - Boolean - To cart - can
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Yandex
|
||||
Function DeleteObject(Val Token, Val Path, Val ToCart = True) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Path);
|
||||
OPI_TypeConversion.GetBoolean(ToCart);
|
||||
|
||||
Headers = AuthorizationHeader(Token);
|
||||
|
||||
Parameters = New Structure;
|
||||
Parameters.Insert("path" , Path);
|
||||
Parameters.Insert("permanently", Not ToCart);
|
||||
|
||||
Response = OPI_Tools.Delete("https://cloud-api.yandex.net/v1/disk/resources", Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Path);
|
||||
OPI_TypeConversion.GetBoolean(ToCart);
|
||||
|
||||
Headers = AuthorizationHeader(Token);
|
||||
|
||||
Parameters = New Structure;
|
||||
Parameters.Insert("path" , Path);
|
||||
Parameters.Insert("permanently", Not ToCart);
|
||||
|
||||
Response = OPI_Tools.Delete("https://cloud-api.yandex.net/v1/disk/resources", Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Create object copy
|
||||
// Creates a copy of the object at the specified path and path to the original
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Original - String - Path to the original file or directory - from
|
||||
// Path - String - Destination path for the copy - to
|
||||
// Overwrite - Boolean - Overwrite if a file with the same name already exists - rewrite
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Yandex
|
||||
Function CreateObjectCopy(Val Token, Val Original, Val Path, Val Overwrite = False) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Original);
|
||||
OPI_TypeConversion.GetLine(Path);
|
||||
OPI_TypeConversion.GetBoolean(Overwrite);
|
||||
|
||||
Headers = AuthorizationHeader(Token);
|
||||
URL = "https://cloud-api.yandex.net/v1/disk/resources/copy";
|
||||
Href = "href";
|
||||
|
||||
Parameters = New Structure;
|
||||
Parameters.Insert("from" , Original);
|
||||
Parameters.Insert("path" , Path);
|
||||
Parameters.Insert("overwrite" , Overwrite);
|
||||
|
||||
Parameters = OPI_Tools.RequestParametersToString(Parameters);
|
||||
Response = OPI_Tools.Post(URL + Parameters, , Headers, False);
|
||||
|
||||
ResponseURL = Response[Href];
|
||||
|
||||
If Not ValueIsFilled(ResponseURL) Then
|
||||
Return Response;
|
||||
EndIf;
|
||||
|
||||
Response = OPI_Tools.Get(ResponseURL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Original);
|
||||
OPI_TypeConversion.GetLine(Path);
|
||||
OPI_TypeConversion.GetBoolean(Overwrite);
|
||||
|
||||
Headers = AuthorizationHeader(Token);
|
||||
URL = "https://cloud-api.yandex.net/v1/disk/resources/copy";
|
||||
Href = "href";
|
||||
|
||||
Parameters = New Structure;
|
||||
Parameters.Insert("from" , Original);
|
||||
Parameters.Insert("path" , Path);
|
||||
Parameters.Insert("overwrite" , Overwrite);
|
||||
|
||||
Parameters = OPI_Tools.RequestParametersToString(Parameters);
|
||||
Response = OPI_Tools.Post(URL + Parameters, , Headers, False);
|
||||
|
||||
ResponseURL = Response[Href];
|
||||
|
||||
If Not ValueIsFilled(ResponseURL) Then
|
||||
Return Response;
|
||||
EndIf;
|
||||
|
||||
Response = OPI_Tools.Get(ResponseURL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Get download link
|
||||
// Gets a download link for the file
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Path - String - Path to the file for downloading - path
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Yandex
|
||||
Function GetDownloadLink(Val Token, Val Path) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Path);
|
||||
|
||||
Headers = AuthorizationHeader(Token);
|
||||
|
||||
Parameters = New Structure;
|
||||
Parameters.Insert("path", Path);
|
||||
|
||||
Response = OPI_Tools.Get("https://cloud-api.yandex.net/v1/disk/resources/download", Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Path);
|
||||
|
||||
Headers = AuthorizationHeader(Token);
|
||||
|
||||
Parameters = New Structure;
|
||||
Parameters.Insert("path", Path);
|
||||
|
||||
Response = OPI_Tools.Get("https://cloud-api.yandex.net/v1/disk/resources/download", Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Download file
|
||||
// Downloads a file at the specified path
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Path - String - Path to the file for downloading - path
|
||||
// SavePath - String - File save path - out
|
||||
//
|
||||
// SavePath - String - File save path - out
|
||||
//
|
||||
// Return value:
|
||||
// BinaryData,String - Binary data or file path when SavePath parameter is specified
|
||||
Function DownloadFile(Val Token, Val Path, Val SavePath = "") Export
|
||||
|
||||
OPI_TypeConversion.GetLine(SavePath);
|
||||
Response = GetDownloadLink(Token, Path);
|
||||
URL = Response["href"];
|
||||
|
||||
If Not ValueIsFilled(URL) Then
|
||||
Return Response;
|
||||
EndIf;
|
||||
|
||||
Response = OPI_Tools.Get(URL, , , SavePath);
|
||||
|
||||
Return Response;
|
||||
|
||||
|
||||
OPI_TypeConversion.GetLine(SavePath);
|
||||
Response = GetDownloadLink(Token, Path);
|
||||
URL = Response["href"];
|
||||
|
||||
If Not ValueIsFilled(URL) Then
|
||||
Return Response;
|
||||
EndIf;
|
||||
|
||||
Response = OPI_Tools.Get(URL, , , SavePath);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Get list of files
|
||||
// Gets a list of files with or without filtering by type
|
||||
// List available typeоin: audio, backup, book, compressed, data, development,
|
||||
// diskimage, document, encoded, executable, flash, font,
|
||||
// List available typeоin: audio, backup, book, compressed, data, development,
|
||||
// diskimage, document, encoded, executable, flash, font,
|
||||
// mage, settings, spreadsheet, text, unknown, video, web
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Quantity - 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
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Yandex
|
||||
Function GetFilesList(Val Token
|
||||
, Val Quantity = 0
|
||||
, Val OffsetFromStart = 0
|
||||
, Val FilterByType = ""
|
||||
, Val SortByDate = False) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Quantity);
|
||||
OPI_TypeConversion.GetLine(OffsetFromStart);
|
||||
OPI_TypeConversion.GetLine(FilterByType);
|
||||
OPI_TypeConversion.GetBoolean(SortByDate);
|
||||
|
||||
Headers = AuthorizationHeader(Token);
|
||||
|
||||
Parameters = New Structure;
|
||||
|
||||
If ValueIsFilled(Quantity) Then
|
||||
Parameters.Insert("limit", OPI_Tools.NumberToString(Quantity));
|
||||
EndIf;
|
||||
|
||||
If ValueIsFilled(OffsetFromStart) Then
|
||||
Parameters.Insert("offset", OPI_Tools.NumberToString(OffsetFromStart));
|
||||
EndIf;
|
||||
|
||||
If ValueIsFilled(FilterByType) Then
|
||||
Parameters.Insert("media_type", FilterByType);
|
||||
EndIf;
|
||||
|
||||
If SortByDate Then
|
||||
Destination = "last-uploaded";
|
||||
Else
|
||||
Destination = "files";
|
||||
EndIf;
|
||||
|
||||
Response = OPI_Tools.Get("https://cloud-api.yandex.net/v1/disk/resources/" + Destination, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
, Val Quantity = 0
|
||||
, Val OffsetFromStart = 0
|
||||
, Val FilterByType = ""
|
||||
, Val SortByDate = False) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Quantity);
|
||||
OPI_TypeConversion.GetLine(OffsetFromStart);
|
||||
OPI_TypeConversion.GetLine(FilterByType);
|
||||
OPI_TypeConversion.GetBoolean(SortByDate);
|
||||
|
||||
Headers = AuthorizationHeader(Token);
|
||||
|
||||
Parameters = New Structure;
|
||||
|
||||
If ValueIsFilled(Quantity) Then
|
||||
Parameters.Insert("limit", OPI_Tools.NumberToString(Quantity));
|
||||
EndIf;
|
||||
|
||||
If ValueIsFilled(OffsetFromStart) Then
|
||||
Parameters.Insert("offset", OPI_Tools.NumberToString(OffsetFromStart));
|
||||
EndIf;
|
||||
|
||||
If ValueIsFilled(FilterByType) Then
|
||||
Parameters.Insert("media_type", FilterByType);
|
||||
EndIf;
|
||||
|
||||
If SortByDate Then
|
||||
Destination = "last-uploaded";
|
||||
Else
|
||||
Destination = "files";
|
||||
EndIf;
|
||||
|
||||
Response = OPI_Tools.Get("https://cloud-api.yandex.net/v1/disk/resources/" + Destination, Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Move object
|
||||
// Moves the object to the specified path and path to the original
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Original - String - Path to the original file or folder - from
|
||||
// Path - String - Destination path for moving - to
|
||||
// Overwrite - Boolean - Overwrite if a file with the same name already exists - rewrite
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Yandex
|
||||
Function MoveObject(Val Token, Val Original, Val Path, Val Overwrite = False) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Original);
|
||||
OPI_TypeConversion.GetLine(Path);
|
||||
OPI_TypeConversion.GetBoolean(Overwrite);
|
||||
|
||||
Headers = AuthorizationHeader(Token);
|
||||
URL = "https://cloud-api.yandex.net/v1/disk/resources/move";
|
||||
Href = "href";
|
||||
|
||||
Parameters = New Structure;
|
||||
Parameters.Insert("from" , Original);
|
||||
Parameters.Insert("path" , Path);
|
||||
Parameters.Insert("overwrite" , Overwrite);
|
||||
|
||||
Parameters = OPI_Tools.RequestParametersToString(Parameters);
|
||||
Response = OPI_Tools.Post(URL + Parameters, , Headers, False);
|
||||
ResponseURL = Response[Href];
|
||||
|
||||
If Not ValueIsFilled(ResponseURL) Then
|
||||
Return Response;
|
||||
EndIf;
|
||||
|
||||
Response = OPI_Tools.Get(ResponseURL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Original);
|
||||
OPI_TypeConversion.GetLine(Path);
|
||||
OPI_TypeConversion.GetBoolean(Overwrite);
|
||||
|
||||
Headers = AuthorizationHeader(Token);
|
||||
URL = "https://cloud-api.yandex.net/v1/disk/resources/move";
|
||||
Href = "href";
|
||||
|
||||
Parameters = New Structure;
|
||||
Parameters.Insert("from" , Original);
|
||||
Parameters.Insert("path" , Path);
|
||||
Parameters.Insert("overwrite" , Overwrite);
|
||||
|
||||
Parameters = OPI_Tools.RequestParametersToString(Parameters);
|
||||
Response = OPI_Tools.Post(URL + Parameters, , Headers, False);
|
||||
ResponseURL = Response[Href];
|
||||
|
||||
If Not ValueIsFilled(ResponseURL) Then
|
||||
Return Response;
|
||||
EndIf;
|
||||
|
||||
Response = OPI_Tools.Get(ResponseURL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Upload file
|
||||
// Uploads a file to disk at the specified path
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Path - String - Path for saving the file to disk - path
|
||||
// File - String, BinaryData - File for upload - file
|
||||
// Overwrite - Boolean - Overwrite if a file with the same name already exists - rewrite
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Yandex
|
||||
// Key-Value Pair - serialized JSON response from Yandex
|
||||
Function UploadFile(Val Token, Val Path, Val File, Val Overwrite = False) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Path);
|
||||
OPI_TypeConversion.GetBoolean(Overwrite);
|
||||
OPI_TypeConversion.GetBinaryData(File);
|
||||
|
||||
Headers = AuthorizationHeader(Token);
|
||||
Href = "href";
|
||||
File = New Structure("file", File);
|
||||
|
||||
Parameters = New Structure;
|
||||
Parameters.Insert("path" , Path);
|
||||
Parameters.Insert("overwrite" , Overwrite);
|
||||
|
||||
Response = OPI_Tools.Get("https://cloud-api.yandex.net/v1/disk/resources/upload", Parameters, Headers);
|
||||
URL = Response[Href];
|
||||
|
||||
If Not ValueIsFilled(URL) Then
|
||||
Return Response;
|
||||
EndIf;
|
||||
|
||||
Response = OPI_Tools.PutMultipart(URL, New Structure(), File, "multipart", Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Path);
|
||||
OPI_TypeConversion.GetBoolean(Overwrite);
|
||||
OPI_TypeConversion.GetBinaryData(File);
|
||||
|
||||
Headers = AuthorizationHeader(Token);
|
||||
Href = "href";
|
||||
File = New Structure("file", File);
|
||||
|
||||
Parameters = New Structure;
|
||||
Parameters.Insert("path" , Path);
|
||||
Parameters.Insert("overwrite" , Overwrite);
|
||||
|
||||
Response = OPI_Tools.Get("https://cloud-api.yandex.net/v1/disk/resources/upload", Parameters, Headers);
|
||||
URL = Response[Href];
|
||||
|
||||
If Not ValueIsFilled(URL) Then
|
||||
Return Response;
|
||||
EndIf;
|
||||
|
||||
Response = OPI_Tools.PutMultipart(URL, New Structure(), File, "multipart", Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Upload file by URL
|
||||
// Downloads a file to disk from the specified URL
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Path - String - Path to place the downloaded file - path
|
||||
// Address - String - File URL - url
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Yandex
|
||||
Function UploadFileByURL(Val Token, Val Path, Val Address) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Path);
|
||||
OPI_TypeConversion.GetLine(Address);
|
||||
|
||||
Headers = AuthorizationHeader(Token);
|
||||
URL = "https://cloud-api.yandex.net/v1/disk/resources/upload";
|
||||
|
||||
Parameters = New Structure;
|
||||
Parameters.Insert("url" , EncodeString(Address, StringEncodingMethod.URLInURLEncoding));
|
||||
Parameters.Insert("path", Path);
|
||||
|
||||
Parameters = OPI_Tools.RequestParametersToString(Parameters);
|
||||
Response = OPI_Tools.Post(URL + Parameters, , Headers, False);
|
||||
|
||||
Return Response;
|
||||
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Path);
|
||||
OPI_TypeConversion.GetLine(Address);
|
||||
|
||||
Headers = AuthorizationHeader(Token);
|
||||
URL = "https://cloud-api.yandex.net/v1/disk/resources/upload";
|
||||
|
||||
Parameters = New Structure;
|
||||
Parameters.Insert("url" , EncodeString(Address, StringEncodingMethod.URLInURLEncoding));
|
||||
Parameters.Insert("path", Path);
|
||||
|
||||
Parameters = OPI_Tools.RequestParametersToString(Parameters);
|
||||
Response = OPI_Tools.Post(URL + Parameters, , Headers, False);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
#EndRegion
|
||||
@@ -411,182 +411,182 @@ EndFunction
|
||||
|
||||
// Publish object
|
||||
// Publishes the disk object for public access
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Path - String - Path to the object to be published - path
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Yandex
|
||||
// Key-Value Pair - serialized JSON response from Yandex
|
||||
Function PublishObject(Val Token, Val Path) Export
|
||||
Return TogglePublicAccess(Token, Path, True);
|
||||
Return TogglePublicAccess(Token, Path, True);
|
||||
EndFunction
|
||||
|
||||
// Unpublish object
|
||||
// Unpublishes a previously published object
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Path - String - Path to the previously published object - path
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Yandex
|
||||
Function CancelObjectPublication(Val Token, Val Path) Export
|
||||
Return TogglePublicAccess(Token, Path, False);
|
||||
Return TogglePublicAccess(Token, Path, False);
|
||||
EndFunction
|
||||
|
||||
// Get published list объеtoтоin.
|
||||
// Gets a list of published objects
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// Token - String - Token - token
|
||||
// Quantity - Number - Number of returned objects - amount
|
||||
// OffsetFromStart - Number - Offset for getting objects not from the beginning of the list - offset
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Yandex
|
||||
Function GetPublishedObjectsList(Val Token, Val Quantity = 0, Val OffsetFromStart = 0) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Quantity);
|
||||
OPI_TypeConversion.GetLine(OffsetFromStart);
|
||||
|
||||
Headers = AuthorizationHeader(Token);
|
||||
|
||||
Parameters = New Structure;
|
||||
|
||||
If ValueIsFilled(Quantity) Then
|
||||
Parameters.Insert("limit", Quantity);
|
||||
EndIf;
|
||||
|
||||
If ValueIsFilled(OffsetFromStart) Then
|
||||
Parameters.Insert("offset", OffsetFromStart);
|
||||
EndIf;
|
||||
|
||||
Response = OPI_Tools.Get("https://cloud-api.yandex.net/v1/disk/resources/public", Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Quantity);
|
||||
OPI_TypeConversion.GetLine(OffsetFromStart);
|
||||
|
||||
Headers = AuthorizationHeader(Token);
|
||||
|
||||
Parameters = New Structure;
|
||||
|
||||
If ValueIsFilled(Quantity) Then
|
||||
Parameters.Insert("limit", Quantity);
|
||||
EndIf;
|
||||
|
||||
If ValueIsFilled(OffsetFromStart) Then
|
||||
Parameters.Insert("offset", OffsetFromStart);
|
||||
EndIf;
|
||||
|
||||
Response = OPI_Tools.Get("https://cloud-api.yandex.net/v1/disk/resources/public", Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Get public object
|
||||
// Gets information about the published object by its URL
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// URL - String - Object address - url
|
||||
// URL - String - Object address - url
|
||||
// Quantity - Number - Quantity inозinращаемых inложенных объеtoтоin (for directory) - amount
|
||||
// OffsetFromStart - Number - Offset for getting nested objects not from the beginning of the list - offset
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Yandex
|
||||
Function GetPublicObject(Val Token, Val URL, Val Quantity = 0, Val OffsetFromStart = 0) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(URL);
|
||||
OPI_TypeConversion.GetLine(Quantity);
|
||||
OPI_TypeConversion.GetLine(OffsetFromStart);
|
||||
|
||||
Headers = AuthorizationHeader(Token);
|
||||
|
||||
Parameters = New Structure;
|
||||
|
||||
If ValueIsFilled(Quantity) Then
|
||||
Parameters.Insert("limit", OPI_Tools.NumberToString(Quantity));
|
||||
EndIf;
|
||||
|
||||
If ValueIsFilled(OffsetFromStart) Then
|
||||
Parameters.Insert("offset", OPI_Tools.NumberToString(OffsetFromStart));
|
||||
EndIf;
|
||||
|
||||
Parameters.Insert("public_key", URL);
|
||||
|
||||
Response = OPI_Tools.Get("https://cloud-api.yandex.net/v1/disk/public/resources", Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(URL);
|
||||
OPI_TypeConversion.GetLine(Quantity);
|
||||
OPI_TypeConversion.GetLine(OffsetFromStart);
|
||||
|
||||
Headers = AuthorizationHeader(Token);
|
||||
|
||||
Parameters = New Structure;
|
||||
|
||||
If ValueIsFilled(Quantity) Then
|
||||
Parameters.Insert("limit", OPI_Tools.NumberToString(Quantity));
|
||||
EndIf;
|
||||
|
||||
If ValueIsFilled(OffsetFromStart) Then
|
||||
Parameters.Insert("offset", OPI_Tools.NumberToString(OffsetFromStart));
|
||||
EndIf;
|
||||
|
||||
Parameters.Insert("public_key", URL);
|
||||
|
||||
Response = OPI_Tools.Get("https://cloud-api.yandex.net/v1/disk/public/resources", Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Get download link for public object
|
||||
// Gets a direct link to download the public object
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// URL - String - Object address - url
|
||||
// Path - String - Path inside the object - path
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Yandex
|
||||
Function GetDownloadLinkForPublicObject(Val Token, Val URL, Val Path = "") Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(URL);
|
||||
OPI_TypeConversion.GetLine(Path);
|
||||
|
||||
Headers = AuthorizationHeader(Token);
|
||||
|
||||
Parameters = New Structure;
|
||||
|
||||
If ValueIsFilled(Path) Then
|
||||
Parameters.Insert("path", Path);
|
||||
EndIf;
|
||||
|
||||
Parameters.Insert("public_key", URL);
|
||||
|
||||
Response = OPI_Tools.Get("https://cloud-api.yandex.net/v1/disk/public/resources/download", Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(URL);
|
||||
OPI_TypeConversion.GetLine(Path);
|
||||
|
||||
Headers = AuthorizationHeader(Token);
|
||||
|
||||
Parameters = New Structure;
|
||||
|
||||
If ValueIsFilled(Path) Then
|
||||
Parameters.Insert("path", Path);
|
||||
EndIf;
|
||||
|
||||
Parameters.Insert("public_key", URL);
|
||||
|
||||
Response = OPI_Tools.Get("https://cloud-api.yandex.net/v1/disk/public/resources/download", Parameters, Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
|
||||
// Save public object to disk
|
||||
// Saves the public object to your disk
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// Token - String - Token - token
|
||||
// URL - String - Object address - url
|
||||
// From - String - Path inнутри публичного directory (тольtoо for папоto) - from
|
||||
// To - String - File save path - to
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Yandex
|
||||
Function SavePublicObjectToDisk(Val Token, Val URL, From = "", To = "") Export
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(URL);
|
||||
OPI_TypeConversion.GetLine(From);
|
||||
OPI_TypeConversion.GetLine(To);
|
||||
|
||||
Headers = AuthorizationHeader(Token);
|
||||
Address = "https://cloud-api.yandex.net/v1/disk/public/resources/save-to-disk";
|
||||
Href = "href";
|
||||
|
||||
Parameters = New Structure;
|
||||
Parameters.Insert("public_key", URL);
|
||||
|
||||
If ValueIsFilled(From) Then
|
||||
Parameters.Insert("path", From);
|
||||
EndIf;
|
||||
|
||||
If ValueIsFilled(To) Then
|
||||
Parameters.Insert("save_path", To);
|
||||
EndIf;
|
||||
|
||||
Parameters = OPI_Tools.RequestParametersToString(Parameters);
|
||||
Response = OPI_Tools.Post(Address + Parameters, , Headers, False);
|
||||
|
||||
ResponseURL = Response[Href];
|
||||
|
||||
If Not ValueIsFilled(ResponseURL) Then
|
||||
Return Response;
|
||||
EndIf;
|
||||
|
||||
Response = OPI_Tools.Get(ResponseURL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(URL);
|
||||
OPI_TypeConversion.GetLine(From);
|
||||
OPI_TypeConversion.GetLine(To);
|
||||
|
||||
Headers = AuthorizationHeader(Token);
|
||||
Address = "https://cloud-api.yandex.net/v1/disk/public/resources/save-to-disk";
|
||||
Href = "href";
|
||||
|
||||
Parameters = New Structure;
|
||||
Parameters.Insert("public_key", URL);
|
||||
|
||||
If ValueIsFilled(From) Then
|
||||
Parameters.Insert("path", From);
|
||||
EndIf;
|
||||
|
||||
If ValueIsFilled(To) Then
|
||||
Parameters.Insert("save_path", To);
|
||||
EndIf;
|
||||
|
||||
Parameters = OPI_Tools.RequestParametersToString(Parameters);
|
||||
Response = OPI_Tools.Post(Address + Parameters, , Headers, False);
|
||||
|
||||
ResponseURL = Response[Href];
|
||||
|
||||
If Not ValueIsFilled(ResponseURL) Then
|
||||
Return Response;
|
||||
EndIf;
|
||||
|
||||
Response = OPI_Tools.Get(ResponseURL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
|
||||
#EndRegion
|
||||
|
||||
#EndRegion
|
||||
@@ -594,42 +594,42 @@ EndFunction
|
||||
#Region ServiceProceduresAndFunctions
|
||||
|
||||
Function AuthorizationHeader(Val Token)
|
||||
|
||||
Headers = New Match;
|
||||
Headers.Insert("Authorization", "OAuth " + Token);
|
||||
|
||||
Return Headers;
|
||||
|
||||
|
||||
Headers = New Match;
|
||||
Headers.Insert("Authorization", "OAuth " + Token);
|
||||
|
||||
Return Headers;
|
||||
|
||||
EndFunction
|
||||
|
||||
Function TogglePublicAccess(Val Token, Val Path, Val PublicAccess)
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Path);
|
||||
OPI_TypeConversion.GetBoolean(PublicAccess);
|
||||
|
||||
Headers = AuthorizationHeader(Token);
|
||||
Destination = ?(PublicAccess, "publish", "unpublish");
|
||||
Href = "href";
|
||||
|
||||
URL = "https://cloud-api.yandex.net/v1/disk/resources/" + Destination;
|
||||
|
||||
Parameters = New Structure;
|
||||
Parameters.Insert("path", Path);
|
||||
|
||||
Parameters = OPI_Tools.RequestParametersToString(Parameters);
|
||||
Response = OPI_Tools.Put(URL + Parameters, , Headers, False);
|
||||
|
||||
ResponseURL = Response[Href];
|
||||
|
||||
If Not ValueIsFilled(ResponseURL) Then
|
||||
Return Response;
|
||||
EndIf;
|
||||
|
||||
Response = OPI_Tools.Get(ResponseURL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
Function TogglePublicAccess(Val Token, Val Path, Val PublicAccess)
|
||||
|
||||
OPI_TypeConversion.GetLine(Token);
|
||||
OPI_TypeConversion.GetLine(Path);
|
||||
OPI_TypeConversion.GetBoolean(PublicAccess);
|
||||
|
||||
Headers = AuthorizationHeader(Token);
|
||||
Destination = ?(PublicAccess, "publish", "unpublish");
|
||||
Href = "href";
|
||||
|
||||
URL = "https://cloud-api.yandex.net/v1/disk/resources/" + Destination;
|
||||
|
||||
Parameters = New Structure;
|
||||
Parameters.Insert("path", Path);
|
||||
|
||||
Parameters = OPI_Tools.RequestParametersToString(Parameters);
|
||||
Response = OPI_Tools.Put(URL + Parameters, , Headers, False);
|
||||
|
||||
ResponseURL = Response[Href];
|
||||
|
||||
If Not ValueIsFilled(ResponseURL) Then
|
||||
Return Response;
|
||||
EndIf;
|
||||
|
||||
Response = OPI_Tools.Get(ResponseURL, , Headers);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
#EndRegion
|
||||
|
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mdclass:CommonModule xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="af0b34e8-10fa-414f-a643-915210c6289a">
|
||||
<name>OPI_YandexDisk</name>
|
||||
<synonym>
|
||||
<key>ru</key>
|
||||
<value>Methodы work with Yandex Disk (OPI)</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
<name>OPI_YandexDisk</name>
|
||||
<synonym>
|
||||
<key>ru</key>
|
||||
<value>Methodы work with Yandex Disk (OPI)</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
</mdclass:CommonModule>
|
||||
|
@@ -36,77 +36,77 @@
|
||||
|
||||
// Get confirmation code
|
||||
// Gets the confirmation code and the address of the page where it needs to be entered
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// ClientId - String - Client id - id
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Yandex
|
||||
Function GetConfirmationCode(Val ClientId) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(ClientId);
|
||||
|
||||
Parameters = New Structure("client_id", ClientId);
|
||||
Response = OPI_Tools.Post("https://oauth.yandex.ru/device/code", Parameters, , False);
|
||||
|
||||
Return Response;
|
||||
|
||||
OPI_TypeConversion.GetLine(ClientId);
|
||||
|
||||
Parameters = New Structure("client_id", ClientId);
|
||||
Response = OPI_Tools.Post("https://oauth.yandex.ru/device/code", Parameters, , False);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Convert code to token
|
||||
// Converts the code to a token after entering the code when executing GetConfirmationCode
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// ClientId - String - Client id - id
|
||||
// ClientSecret - String - Client secret - secret
|
||||
// DeviceCode - String - device_code from GetConfirmationCode() - device
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Yandex
|
||||
Function ConvertCodeToToken(Val ClientId, Val ClientSecret, Val DeviceCode) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(ClientId);
|
||||
OPI_TypeConversion.GetLine(ClientSecret);
|
||||
OPI_TypeConversion.GetLine(DeviceCode);
|
||||
|
||||
Parameters = New Structure;
|
||||
Parameters.Insert("grant_type" , "device_code");
|
||||
Parameters.Insert("code" , DeviceCode);
|
||||
Parameters.Insert("client_id" , ClientId);
|
||||
Parameters.Insert("client_secret" , ClientSecret);
|
||||
|
||||
Response = OPI_Tools.Post("https://oauth.yandex.ru/token", Parameters, , False);
|
||||
|
||||
Return Response;
|
||||
|
||||
|
||||
OPI_TypeConversion.GetLine(ClientId);
|
||||
OPI_TypeConversion.GetLine(ClientSecret);
|
||||
OPI_TypeConversion.GetLine(DeviceCode);
|
||||
|
||||
Parameters = New Structure;
|
||||
Parameters.Insert("grant_type" , "device_code");
|
||||
Parameters.Insert("code" , DeviceCode);
|
||||
Parameters.Insert("client_id" , ClientId);
|
||||
Parameters.Insert("client_secret" , ClientSecret);
|
||||
|
||||
Response = OPI_Tools.Post("https://oauth.yandex.ru/token", Parameters, , False);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
// Refresh token
|
||||
// Updates token by Refresh token
|
||||
//
|
||||
//
|
||||
// Parameters:
|
||||
// ClientId - String - Client id - id
|
||||
// ClientSecret - String - Client secret - secret
|
||||
// RefreshToken - String - Refresh token - refresh
|
||||
//
|
||||
//
|
||||
// Return value:
|
||||
// Key-Value Pair - serialized JSON response from Yandex
|
||||
Function RefreshToken(Val ClientId, Val ClientSecret, Val RefreshToken) Export
|
||||
|
||||
OPI_TypeConversion.GetLine(ClientId);
|
||||
OPI_TypeConversion.GetLine(ClientSecret);
|
||||
OPI_TypeConversion.GetLine(RefreshToken);
|
||||
|
||||
Parameters = New Structure;
|
||||
Parameters.Insert("grant_type" , "refresh_token");
|
||||
Parameters.Insert("refresh_token" , RefreshToken);
|
||||
Parameters.Insert("client_id" , ClientId);
|
||||
Parameters.Insert("client_secret" , ClientSecret);
|
||||
|
||||
Response = OPI_Tools.Post("https://oauth.yandex.ru/token", Parameters, , False);
|
||||
|
||||
Return Response;
|
||||
|
||||
|
||||
OPI_TypeConversion.GetLine(ClientId);
|
||||
OPI_TypeConversion.GetLine(ClientSecret);
|
||||
OPI_TypeConversion.GetLine(RefreshToken);
|
||||
|
||||
Parameters = New Structure;
|
||||
Parameters.Insert("grant_type" , "refresh_token");
|
||||
Parameters.Insert("refresh_token" , RefreshToken);
|
||||
Parameters.Insert("client_id" , ClientId);
|
||||
Parameters.Insert("client_secret" , ClientSecret);
|
||||
|
||||
Response = OPI_Tools.Post("https://oauth.yandex.ru/token", Parameters, , False);
|
||||
|
||||
Return Response;
|
||||
|
||||
EndFunction
|
||||
|
||||
#EndRegion
|
||||
|
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mdclass:CommonModule xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="32379ca2-0f58-4143-9b34-cb552c54b962">
|
||||
<name>OPI_YandexID</name>
|
||||
<synonym>
|
||||
<key>ru</key>
|
||||
<value>Methodы work with Yandex ID (OPI)</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
<name>OPI_YandexID</name>
|
||||
<synonym>
|
||||
<key>ru</key>
|
||||
<value>Methodы work with Yandex ID (OPI)</value>
|
||||
</synonym>
|
||||
<server>true</server>
|
||||
<externalConnection>true</externalConnection>
|
||||
<clientOrdinaryApplication>true</clientOrdinaryApplication>
|
||||
</mdclass:CommonModule>
|
||||
|
@@ -1,70 +1,70 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mdclass:Configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" xmlns:mdclassExtension="http://g5.1c.ru/v8/dt/metadata/mdclass/extension" uuid="aa51f610-7ed3-4091-8908-8ecccf0aaf0f">
|
||||
<name>OpenIntegrations</name>
|
||||
<synonym>
|
||||
<key>ru</key>
|
||||
<value>Open integrations package</value>
|
||||
</synonym>
|
||||
<objectBelonging>Adopted</objectBelonging>
|
||||
<extension xsi:type="mdclassExtension:ConfigurationExtension">
|
||||
<defaultRunMode>Checked</defaultRunMode>
|
||||
<usePurposes>Checked</usePurposes>
|
||||
<interfaceCompatibilityMode>Checked</interfaceCompatibilityMode>
|
||||
</extension>
|
||||
<containedObjects classId="9cd510cd-abfc-11d4-9434-004095e12fc7" objectId="12689443-2950-4e3b-b313-9a692b6acac7"/>
|
||||
<containedObjects classId="9fcd25a0-4822-11d4-9414-008048da11f9" objectId="f6f98fbd-010a-4aba-8f11-01203bbc59c7"/>
|
||||
<containedObjects classId="e3687481-0a87-462c-a166-9f34594f9bba" objectId="33990ba2-16f0-473d-851f-a9132c777ed6"/>
|
||||
<containedObjects classId="9de14907-ec23-4a07-96f0-85521cb6b53b" objectId="917bb154-d76e-42a4-b161-336b7c57a1ac"/>
|
||||
<containedObjects classId="51f2d5d8-ea4d-4064-8892-82951750031e" objectId="793db0b3-8d01-4f55-982c-73cb3d4547da"/>
|
||||
<containedObjects classId="e68182ea-4237-4383-967f-90c1e3370bc7" objectId="c67ca98f-c017-4f18-8175-02819e09b383"/>
|
||||
<containedObjects classId="fb282519-d103-4dd3-bc12-cb271d631dfc" objectId="c9ed170a-ffaa-4859-9d92-fd1cbc7051b3"/>
|
||||
<keepMappingToExtendedConfigurationObjectsByIDs>true</keepMappingToExtendedConfigurationObjectsByIDs>
|
||||
<namePrefix>OPI_</namePrefix>
|
||||
<configurationExtensionCompatibilityMode>8.3.9</configurationExtensionCompatibilityMode>
|
||||
<configurationExtensionPurpose>Customization</configurationExtensionPurpose>
|
||||
<defaultRunMode>ManagedApplication</defaultRunMode>
|
||||
<usePurposes>PersonalComputer</usePurposes>
|
||||
<scriptVariant>Russian</scriptVariant>
|
||||
<vendor>Bayselonarrend</vendor>
|
||||
<version>1.9.0</version>
|
||||
<detailedInformation>
|
||||
<key>ru</key>
|
||||
<value>Open integrations package - toбор библиотеto for интеграции with неtoоторыми популярными API for 1C:Enterprise. He consists of general modules, each responsible for its own API, as well as several tool modules common for all.</value>
|
||||
</detailedInformation>
|
||||
<vendorInformationAddress>
|
||||
<key>ru</key>
|
||||
<value>https://github.com/Bayselonarrend</value>
|
||||
</vendorInformationAddress>
|
||||
<configurationInformationAddress>
|
||||
<key>ru</key>
|
||||
<value>https://github.com/Bayselonarrend/OpenIntegrations</value>
|
||||
</configurationInformationAddress>
|
||||
<languages uuid="0e858b44-34f3-4d20-986d-13290bb5ba5a">
|
||||
<name>Russian</name>
|
||||
<objectBelonging>Adopted</objectBelonging>
|
||||
<extension xsi:type="mdclassExtension:LanguageExtension">
|
||||
<languageCode>Checked</languageCode>
|
||||
</extension>
|
||||
<languageCode>ru</languageCode>
|
||||
</languages>
|
||||
<subsystems>Subsystem.OPI_Integrations</subsystems>
|
||||
<commonModules>CommonModule.OPI_Tools</commonModules>
|
||||
<commonModules>CommonModule.OPI_Cryptography</commonModules>
|
||||
<commonModules>CommonModule.OPI_TypeConversion</commonModules>
|
||||
<commonModules>CommonModule.OPI_Telegram</commonModules>
|
||||
<commonModules>CommonModule.OPI_VK</commonModules>
|
||||
<commonModules>CommonModule.OPI_Viber</commonModules>
|
||||
<commonModules>CommonModule.OPI_Twitter</commonModules>
|
||||
<commonModules>CommonModule.OPI_Notion</commonModules>
|
||||
<commonModules>CommonModule.OPI_YandexID</commonModules>
|
||||
<commonModules>CommonModule.OPI_YandexDisk</commonModules>
|
||||
<commonModules>CommonModule.OPI_GoogleWorkspace</commonModules>
|
||||
<commonModules>CommonModule.OPI_GoogleCalendar</commonModules>
|
||||
<commonModules>CommonModule.OPI_GoogleDrive</commonModules>
|
||||
<commonModules>CommonModule.OPI_GoogleSheets</commonModules>
|
||||
<commonModules>CommonModule.OPI_Slack</commonModules>
|
||||
<commonModules>CommonModule.OPI_Airtable</commonModules>
|
||||
<commonModules>CommonModule.OPI_Dropbox</commonModules>
|
||||
<commonModules>CommonModule.OPI_Tests</commonModules>
|
||||
<commonModules>CommonModule.OPI_TestDataRetrieval</commonModules>
|
||||
<name>OpenIntegrations</name>
|
||||
<synonym>
|
||||
<key>ru</key>
|
||||
<value>Open integrations package</value>
|
||||
</synonym>
|
||||
<objectBelonging>Adopted</objectBelonging>
|
||||
<extension xsi:type="mdclassExtension:ConfigurationExtension">
|
||||
<defaultRunMode>Checked</defaultRunMode>
|
||||
<usePurposes>Checked</usePurposes>
|
||||
<interfaceCompatibilityMode>Checked</interfaceCompatibilityMode>
|
||||
</extension>
|
||||
<containedObjects classId="9cd510cd-abfc-11d4-9434-004095e12fc7" objectId="12689443-2950-4e3b-b313-9a692b6acac7"/>
|
||||
<containedObjects classId="9fcd25a0-4822-11d4-9414-008048da11f9" objectId="f6f98fbd-010a-4aba-8f11-01203bbc59c7"/>
|
||||
<containedObjects classId="e3687481-0a87-462c-a166-9f34594f9bba" objectId="33990ba2-16f0-473d-851f-a9132c777ed6"/>
|
||||
<containedObjects classId="9de14907-ec23-4a07-96f0-85521cb6b53b" objectId="917bb154-d76e-42a4-b161-336b7c57a1ac"/>
|
||||
<containedObjects classId="51f2d5d8-ea4d-4064-8892-82951750031e" objectId="793db0b3-8d01-4f55-982c-73cb3d4547da"/>
|
||||
<containedObjects classId="e68182ea-4237-4383-967f-90c1e3370bc7" objectId="c67ca98f-c017-4f18-8175-02819e09b383"/>
|
||||
<containedObjects classId="fb282519-d103-4dd3-bc12-cb271d631dfc" objectId="c9ed170a-ffaa-4859-9d92-fd1cbc7051b3"/>
|
||||
<keepMappingToExtendedConfigurationObjectsByIDs>true</keepMappingToExtendedConfigurationObjectsByIDs>
|
||||
<namePrefix>OPI_</namePrefix>
|
||||
<configurationExtensionCompatibilityMode>8.3.9</configurationExtensionCompatibilityMode>
|
||||
<configurationExtensionPurpose>Customization</configurationExtensionPurpose>
|
||||
<defaultRunMode>ManagedApplication</defaultRunMode>
|
||||
<usePurposes>PersonalComputer</usePurposes>
|
||||
<scriptVariant>Russian</scriptVariant>
|
||||
<vendor>Bayselonarrend</vendor>
|
||||
<version>1.9.0</version>
|
||||
<detailedInformation>
|
||||
<key>ru</key>
|
||||
<value>Open integrations package - toбор библиотеto for интеграции with неtoоторыми популярными API for 1C:Enterprise. He consists of general modules, each responsible for its own API, as well as several tool modules common for all.</value>
|
||||
</detailedInformation>
|
||||
<vendorInformationAddress>
|
||||
<key>ru</key>
|
||||
<value>https://github.com/Bayselonarrend</value>
|
||||
</vendorInformationAddress>
|
||||
<configurationInformationAddress>
|
||||
<key>ru</key>
|
||||
<value>https://github.com/Bayselonarrend/OpenIntegrations</value>
|
||||
</configurationInformationAddress>
|
||||
<languages uuid="0e858b44-34f3-4d20-986d-13290bb5ba5a">
|
||||
<name>Russian</name>
|
||||
<objectBelonging>Adopted</objectBelonging>
|
||||
<extension xsi:type="mdclassExtension:LanguageExtension">
|
||||
<languageCode>Checked</languageCode>
|
||||
</extension>
|
||||
<languageCode>ru</languageCode>
|
||||
</languages>
|
||||
<subsystems>Subsystem.OPI_Integrations</subsystems>
|
||||
<commonModules>CommonModule.OPI_Tools</commonModules>
|
||||
<commonModules>CommonModule.OPI_Cryptography</commonModules>
|
||||
<commonModules>CommonModule.OPI_TypeConversion</commonModules>
|
||||
<commonModules>CommonModule.OPI_Telegram</commonModules>
|
||||
<commonModules>CommonModule.OPI_VK</commonModules>
|
||||
<commonModules>CommonModule.OPI_Viber</commonModules>
|
||||
<commonModules>CommonModule.OPI_Twitter</commonModules>
|
||||
<commonModules>CommonModule.OPI_Notion</commonModules>
|
||||
<commonModules>CommonModule.OPI_YandexID</commonModules>
|
||||
<commonModules>CommonModule.OPI_YandexDisk</commonModules>
|
||||
<commonModules>CommonModule.OPI_GoogleWorkspace</commonModules>
|
||||
<commonModules>CommonModule.OPI_GoogleCalendar</commonModules>
|
||||
<commonModules>CommonModule.OPI_GoogleDrive</commonModules>
|
||||
<commonModules>CommonModule.OPI_GoogleSheets</commonModules>
|
||||
<commonModules>CommonModule.OPI_Slack</commonModules>
|
||||
<commonModules>CommonModule.OPI_Airtable</commonModules>
|
||||
<commonModules>CommonModule.OPI_Dropbox</commonModules>
|
||||
<commonModules>CommonModule.OPI_Tests</commonModules>
|
||||
<commonModules>CommonModule.OPI_TestDataRetrieval</commonModules>
|
||||
</mdclass:Configuration>
|
||||
|
@@ -1,28 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<mdclass:Subsystem xmlns:mdclass="http://g5.1c.ru/v8/dt/metadata/mdclass" uuid="86c261d7-2729-405f-9d39-5d9104a56bd1">
|
||||
<name>OPI_Integrations</name>
|
||||
<synonym>
|
||||
<key>ru</key>
|
||||
<value>Integrations</value>
|
||||
</synonym>
|
||||
<includeHelpInContents>true</includeHelpInContents>
|
||||
<includeInCommandInterface>true</includeInCommandInterface>
|
||||
<content>CommonModule.OPI_Tools</content>
|
||||
<content>CommonModule.OPI_Cryptography</content>
|
||||
<content>CommonModule.OPI_TypeConversion</content>
|
||||
<content>CommonModule.OPI_VK</content>
|
||||
<content>CommonModule.OPI_Telegram</content>
|
||||
<content>CommonModule.OPI_Viber</content>
|
||||
<content>CommonModule.OPI_Twitter</content>
|
||||
<content>CommonModule.OPI_Notion</content>
|
||||
<content>CommonModule.OPI_YandexID</content>
|
||||
<content>CommonModule.OPI_YandexDisk</content>
|
||||
<content>CommonModule.OPI_GoogleWorkspace</content>
|
||||
<content>CommonModule.OPI_GoogleCalendar</content>
|
||||
<content>CommonModule.OPI_GoogleDrive</content>
|
||||
<content>CommonModule.OPI_GoogleSheets</content>
|
||||
<content>CommonModule.OPI_Slack</content>
|
||||
<content>CommonModule.OPI_Airtable</content>
|
||||
<content>CommonModule.OPI_Tests</content>
|
||||
<content>CommonModule.OPI_TestDataRetrieval</content>
|
||||
<name>OPI_Integrations</name>
|
||||
<synonym>
|
||||
<key>ru</key>
|
||||
<value>Integrations</value>
|
||||
</synonym>
|
||||
<includeHelpInContents>true</includeHelpInContents>
|
||||
<includeInCommandInterface>true</includeInCommandInterface>
|
||||
<content>CommonModule.OPI_Tools</content>
|
||||
<content>CommonModule.OPI_Cryptography</content>
|
||||
<content>CommonModule.OPI_TypeConversion</content>
|
||||
<content>CommonModule.OPI_VK</content>
|
||||
<content>CommonModule.OPI_Telegram</content>
|
||||
<content>CommonModule.OPI_Viber</content>
|
||||
<content>CommonModule.OPI_Twitter</content>
|
||||
<content>CommonModule.OPI_Notion</content>
|
||||
<content>CommonModule.OPI_YandexID</content>
|
||||
<content>CommonModule.OPI_YandexDisk</content>
|
||||
<content>CommonModule.OPI_GoogleWorkspace</content>
|
||||
<content>CommonModule.OPI_GoogleCalendar</content>
|
||||
<content>CommonModule.OPI_GoogleDrive</content>
|
||||
<content>CommonModule.OPI_GoogleSheets</content>
|
||||
<content>CommonModule.OPI_Slack</content>
|
||||
<content>CommonModule.OPI_Airtable</content>
|
||||
<content>CommonModule.OPI_Tests</content>
|
||||
<content>CommonModule.OPI_TestDataRetrieval</content>
|
||||
</mdclass:Subsystem>
|
||||
|
Reference in New Issue
Block a user