Commit f7b867a10c20da79991c6c1e9f81b6a0132d329f

Authored by Chantsova Ekaterina
1 parent 156f7d6a

Correct services arguments

... ... @@ -135,21 +135,20 @@ export function observableArrayReturnType(objectType: string): FunctionArgType {
135 135 };
136 136 }
137 137
138   -export function observableBaseDataReturnType(objectType: string): FunctionArgType {
  138 +export function observableBaseDataReturnType(): FunctionArgType {
139 139 return {
140   - type: `Observable<${baseDataHref}<${objectType}>>`,
141   - description: `An <code>Observable</code> of page result as a <code>${baseDataHref}</code> holding array of <code>${objectType}</code> objects.`
  140 + type: `Observable&lt;${baseDataHref}&lt;${entityIdHref}&gt;&gt;`,
  141 + description: `An <code>Observable</code> of <code>${baseDataHref}</code> object.`
142 142 };
143 143 }
144 144
145   -export function observableArrayBaseDataReturnType(objectType: string): FunctionArgType {
  145 +export function observableArrayBaseDataReturnType(): FunctionArgType {
146 146 return {
147   - type: `Observable&lt;Array&lt;${baseDataHref}&lt;${objectType}&gt;&gt;&gt;`,
148   - description: `An <code>Observable</code> of page result as a <code>${baseDataHref}</code> holding array of <code>${objectType}</code> objects.`
  147 + type: `Observable&lt;Array&lt;${baseDataHref}&lt;${entityIdHref}&gt;&gt;&gt;`,
  148 + description: `An <code>Observable</code> of array of <code>${baseDataHref}</code> objects.`
149 149 };
150 150 }
151 151
152   -
153 152 export function observablePageDataReturnType(objectType: string): FunctionArgType {
154 153 return {
155 154 type: `Observable&lt;${pageDataHref}&lt;${objectType}&gt;&gt;`,
... ... @@ -157,8 +156,6 @@ export function observablePageDataReturnType(objectType: string): FunctionArgTyp
157 156 };
158 157 }
159 158
160   -
161   -
162 159 export const serviceCompletions: TbEditorCompletions = {
163 160 deviceService: {
164 161 description: 'Device Service API<br>' +
... ... @@ -668,7 +665,8 @@ export const serviceCompletions: TbEditorCompletions = {
668 665 meta: 'function',
669 666 args: [
670 667 {name: 'tenantId', type: 'string', description: 'Id of the tenant'},
671   - pageLinkArg
  668 + pageLinkArg,
  669 + requestConfigArg
672 670 ],
673 671 return: observablePageDataReturnType(dashboardInfoHref)
674 672 },
... ... @@ -729,7 +727,7 @@ export const serviceCompletions: TbEditorCompletions = {
729 727 return: observableReturnType(dashboardHref)
730 728 },
731 729 unassignDashboardFromCustomer: {
732   - description: 'Unassign dashboard from any customer',
  730 + description: 'Unassign dashboard from specific customer',
733 731 meta: 'function',
734 732 args: [
735 733 {name: 'customerId', type: 'string', description: 'Id of the customer'},
... ... @@ -784,7 +782,7 @@ export const serviceCompletions: TbEditorCompletions = {
784 782 {name: 'customerIds', type: `Array&lt;string&gt;`, description: 'Id of the customers'},
785 783 requestConfigArg
786 784 ],
787   - return: observableArrayReturnType(dashboardHref)
  785 + return: observableReturnType(dashboardHref)
788 786 },
789 787 getPublicDashboardLink: {
790 788 description: 'Get public dashboard link',
... ... @@ -855,6 +853,7 @@ export const serviceCompletions: TbEditorCompletions = {
855 853 meta: 'function',
856 854 args: [
857 855 {name: 'user', type: userHref, description: 'User object to save'},
  856 + {name: 'sendActivationMail', type: 'boolean', description: 'Send activation email', optional: true},
858 857 requestConfigArg
859 858 ],
860 859 return: observableReturnType(userHref)
... ... @@ -876,7 +875,7 @@ export const serviceCompletions: TbEditorCompletions = {
876 875 {name: 'userCredentialsEnabled', type: 'boolean', description: 'User credentials enabled'},
877 876 requestConfigArg
878 877 ],
879   - return: observableReturnType(userHref)
  878 + return: observableReturnTypeVariable('any')
880 879 },
881 880 getActivationLink: {
882 881 description: 'Get activation link by id',
... ... @@ -929,7 +928,6 @@ export const serviceCompletions: TbEditorCompletions = {
929 928 meta: 'function',
930 929 args: [
931 930 {name: 'entityId', type: entityIdHref, description: 'Entity Id'},
932   - {name: 'relationType', type: 'string', description: 'Relation type'},
933 931 requestConfigArg
934 932 ],
935 933 return: observableVoid()
... ... @@ -1044,7 +1042,7 @@ export const serviceCompletions: TbEditorCompletions = {
1044 1042 args: [
1045 1043 {name: 'entityId', type: entityIdHref, description: 'Id of the entity'},
1046 1044 {name: 'attributeScope', type: attributeScopeHref, description: 'Attribute scope'},
1047   - {name: 'attributes', type: `array&lt;${attributeDataHref}&gt;`, description: 'Array of the attributes'},
  1045 + {name: 'attributes', type: `array&lt;${attributeDataHref}&gt;`, description: 'Array of the attributes data'},
1048 1046 requestConfigArg
1049 1047 ],
1050 1048 return: observableReturnTypeVariable('any')
... ... @@ -1054,7 +1052,7 @@ export const serviceCompletions: TbEditorCompletions = {
1054 1052 meta: 'function',
1055 1053 args: [
1056 1054 {name: 'entityId', type: entityIdHref, description: 'Id of the entity'},
1057   - {name: 'timeseries', type: `Array&lt;${attributeDataHref}&gt;>`, description: 'Array of the timeseries'},
  1055 + {name: 'timeseries', type: `Array&lt;${attributeDataHref}&gt;>`, description: 'Array of the timeseries data'},
1058 1056 {name: 'deleteAllDataForKeys', type: 'boolean', optional: true, description: 'Delete all data for keys'},
1059 1057 requestConfigArg
1060 1058 ],
... ... @@ -1066,7 +1064,7 @@ export const serviceCompletions: TbEditorCompletions = {
1066 1064 args: [
1067 1065 {name: 'entityId', type: entityIdHref, description: 'Id of the entity'},
1068 1066 {name: 'attributeScope', type: attributeScopeHref, description: 'Attribute scope'},
1069   - {name: 'attributes', type: 'Array&lt;${attributeDataHref}&gt;>', description: 'Array of the attributes'},
  1067 + {name: 'attributes', type: 'Array&lt;${attributeDataHref}&gt;>', description: 'Array of the attributes data'},
1070 1068 requestConfigArg
1071 1069 ],
1072 1070 return: observableReturnTypeVariable('any')
... ... @@ -1077,7 +1075,7 @@ export const serviceCompletions: TbEditorCompletions = {
1077 1075 args: [
1078 1076 {name: 'entityId', type: entityIdHref, description: 'Id of the entity'},
1079 1077 {name: 'timeseriesScope', type: 'string', description: 'Timeseries scope'},
1080   - {name: 'timeseries', type: `Array&lt;attributeDataHref&gt;`, description: 'Array of the timeseries'},
  1078 + {name: 'timeseries', type: `Array&lt;attributeDataHref&gt;`, description: 'Array of the timeseries data'},
1081 1079 requestConfigArg
1082 1080 ],
1083 1081 return: observableReturnTypeVariable('any')
... ... @@ -1098,7 +1096,7 @@ export const serviceCompletions: TbEditorCompletions = {
1098 1096 {name: 'entityId', type: 'string', description: 'Id of the entity'},
1099 1097 requestConfigArg
1100 1098 ],
1101   - return: observableBaseDataReturnType(entityIdHref)
  1099 + return: observableBaseDataReturnType()
1102 1100 },
1103 1101 getEntities: {
1104 1102 description: 'Get entities by ids',
... ... @@ -1108,7 +1106,7 @@ export const serviceCompletions: TbEditorCompletions = {
1108 1106 {name: 'entityIds', type: `Array&lt;string&gt;`, description: 'Ids of the entities'},
1109 1107 requestConfigArg
1110 1108 ],
1111   - return: observableArrayBaseDataReturnType(entityIdHref)
  1109 + return: observableArrayBaseDataReturnType()
1112 1110 },
1113 1111 getEntitiesByNameFilter: {
1114 1112 description: 'Get entities by name filter',
... ... @@ -1120,7 +1118,7 @@ export const serviceCompletions: TbEditorCompletions = {
1120 1118 {name: 'subType', type: 'string', optional: true, description: 'Subtype'},
1121 1119 requestConfigArg
1122 1120 ],
1123   - return: observableArrayBaseDataReturnType(entityIdHref)
  1121 + return: observableArrayBaseDataReturnType()
1124 1122 },
1125 1123 findEntityDataByQuery: {
1126 1124 description: 'Find entity data by query',
... ... @@ -1155,7 +1153,6 @@ export const serviceCompletions: TbEditorCompletions = {
1155 1153 meta: 'function',
1156 1154 args: [
1157 1155 {name: 'filter', type: entityFilterHref, description: 'Filter for the entity'},
1158   - {name: 'searchText', type: 'string', description: 'Search text'},
1159 1156 requestConfigArg
1160 1157 ],
1161 1158 return: observableReturnType(entityInfoHref)
... ... @@ -1164,8 +1161,7 @@ export const serviceCompletions: TbEditorCompletions = {
1164 1161 description: 'Get alias filter types by entity types',
1165 1162 meta: 'function',
1166 1163 args: [
1167   - {name: 'entityTypes', type: `Array&lt;${entityTypeHref}|${aliasEntityTypeHref}&gt;`, description: 'Entity types'},
1168   - {name: 'searchText', type: 'string', description: 'Search text'}
  1164 + {name: 'entityTypes', type: `Array&lt;${entityTypeHref}|${aliasEntityTypeHref}&gt;`, description: 'Entity types'}
1169 1165 ],
1170 1166 return: {
1171 1167 type: `Array&lt;${aliasFilterTypeHref}$gt;`,
... ... @@ -1354,7 +1350,7 @@ export const serviceCompletions: TbEditorCompletions = {
1354 1350 args: [
1355 1351 {name: 'template', type: 'string', description: 'Template'},
1356 1352 {name: 'controller', type: customDialogComponentHref, description: 'Controller'},
1357   - {name: 'data', type: 'any', description: 'Data'},
  1353 + {name: 'data', type: 'any', description: 'Data', optional: true},
1358 1354 ],
1359 1355 return: observableReturnTypeVariable('any')
1360 1356 },
... ...