///
/// Copyright © 2016-2020 The Thingsboard Authors
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
import { FunctionArg, FunctionArgType, TbEditorCompletions } from '@shared/models/ace/completion.models';
export const entityIdHref = 'EntityId';
export const baseDataHref = 'Base data';
export const alarmDataHref = 'Alarm data';
export const alarmDataQueryHref = 'Alarm data query';
export const attributeScopeHref = 'Attribute scope';
export const entityTypeHref = 'EntityType';
export const pageDataHref = 'PageData';
export const deviceInfoHref = 'DeviceInfo';
export const assetInfoHref = 'AssetInfo';
export const entityViewInfoHref = 'EntityViewInfo';
export const entityRelationsQueryHref = 'EntityRelationsQuery';
export const entityRelationInfoHref = 'EntityRelationInfo';
export const dashboardInfoHref = 'DashboardInfo';
export const deviceHref = 'Device';
export const assetHref = 'Asset';
export const entityViewHref = 'entityView';
export const entityRelationHref = 'Entity relation';
export const dashboardHref = 'Dashboard';
export const customerHref = 'Customer';
export const attributeDataHref = 'Attribute Data';
export const userHref = 'User';
export const entityDataHref = 'Entity data';
export const entityDataQueryHref = 'Entity Data Query';
export const deviceCredentialsHref = 'DeviceCredentials';
export const entityFilterHref = 'Entity filter';
export const entityInfoHref = 'Entity info';
export const aliasEntityTypeHref = 'Alias Entity Type';
export const aliasFilterTypeHref = 'Alias filter type';
export const entityAliasHref = 'Entity alias';
export const dataKeyTypeHref = 'Data key type';
export const subscriptionInfoHref = 'Subscription info';
export const dataSourceHref = 'Datasource';
export const stateParamsHref = 'State params';
export const aliasInfoHref = 'Alias info';
export const entityAliasFilterHref = 'Entity alias filter';
export const entityAliasFilterResultHref = 'Entity alias filter result';
export const importEntityDataHref = 'Import entity data';
export const importEntitiesResultInfoHref = 'Import entities result info';
export const customDialogComponentHref = 'CustomDialogComponent';
export const pageLinkArg: FunctionArg = {
name: 'pageLink',
type: 'PageLink',
description: 'Page link object used to perform paginated request.'
};
export const requestConfigArg: FunctionArg = {
name: 'config',
type: 'RequestConfig',
description: 'HTTP request configuration.',
optional: true
};
export function observableReturnType(objectType: string): FunctionArgType {
return {
type: `Observable<${objectType}>`,
description: `An Observable of ${objectType} object.`
};
}
export function observableReturnTypeVariable(variableType: string): FunctionArgType {
return {
type: `Observable<${variableType}>`,
description: `An Observable of ${variableType} variable.`
};
}
export function observableVoid(): FunctionArgType {
return {
type: `Observable<void>`,
description: `An Observable.`
};
}
export function observableArrayReturnType(objectType: string): FunctionArgType {
return {
type: `Observable<Array<${objectType}>>`,
description: `An Observable of array of ${objectType} objects.`
};
}
export function observableBaseDataReturnType(objectType: string): FunctionArgType {
return {
type: `Observable<${baseDataHref}<${objectType}>>`,
description: `An Observable of page result as a ${baseDataHref} holding array of ${objectType} objects.`
};
}
export function observableArrayBaseDataReturnType(objectType: string): FunctionArgType {
return {
type: `Observable<Array<${baseDataHref}<${objectType}>>>`,
description: `An Observable of page result as a ${baseDataHref} holding array of ${objectType} objects.`
};
}
export function observablePageDataReturnType(objectType: string): FunctionArgType {
return {
type: `Observable<${pageDataHref}<${objectType}>>`,
description: `An Observable of page result as a ${pageDataHref} holding array of ${objectType} objects.`
};
}
export const serviceCompletions: TbEditorCompletions = {
deviceService: {
description: 'Device Service API
' +
'See DeviceService for API reference.',
meta: 'service',
type: 'DeviceService',
children: {
getTenantDeviceInfos: {
description: 'Get tenant devices',
meta: 'function',
args: [
pageLinkArg,
{ name: 'type', type: 'string', optional: true, description: 'Device type'},
requestConfigArg
],
return: observablePageDataReturnType(deviceInfoHref)
},
getCustomerDeviceInfos: {
description: 'Get customer devices',
meta: 'function',
args: [
{ name: 'customerId', type: 'string', description: 'Id of the customer'},
pageLinkArg,
{ name: 'type', type: 'string', optional: true, description: 'Device type'},
requestConfigArg
],
return: observablePageDataReturnType(deviceInfoHref)
},
getDevice: {
description: 'Get device by id',
meta: 'function',
args: [
{ name: 'deviceId', type: 'string', description: 'Id of the device'},
requestConfigArg
],
return: observableReturnType(deviceHref)
},
getDevices: {
description: 'Get devices by ids',
meta: 'function',
args: [
{ name: 'deviceIds', type: `Array<string>`, description: 'List of device ids'},
requestConfigArg
],
return: observableArrayReturnType(deviceHref)
},
getDeviceInfo: {
description: 'Get device info by id',
meta: 'function',
args: [
{ name: 'deviceId', type: 'string', description: 'Id of the device'},
requestConfigArg
],
return: observableReturnType(deviceInfoHref)
},
saveDevice: {
description: 'Save device',
meta: 'function',
args: [
{ name: 'device', type: deviceHref, description: 'Device object to save'},
requestConfigArg
],
return: observableReturnType(deviceHref)
},
deleteDevice: {
description: 'Delete device by id',
meta: 'function',
args: [
{ name: 'deviceId', type: 'string', description: 'Id of the device'},
requestConfigArg
],
return: observableVoid()
},
getDeviceTypes: {
description: 'Get all available devices types',
meta: 'function',
args: [
requestConfigArg
],
return: observableArrayReturnType('EntitySubtype')
},
getDeviceCredentials: {
description: 'Get device credentials by device id',
meta: 'function',
args: [
{ name: 'deviceId', type: 'string', description: 'Id of the device'},
{ name: 'sync', type: 'boolean', description: 'Whether to execute HTTP request synchronously (false by default)', optional: true},
requestConfigArg
],
return: observableReturnType(deviceCredentialsHref)
},
saveDeviceCredentials: {
description: 'Save device credentials',
meta: 'function',
args: [
{ name: 'deviceCredentials', type: deviceCredentialsHref, description: 'Device credentials object to save'},
requestConfigArg
],
return: observableReturnType(deviceCredentialsHref)
},
makeDevicePublic: {
description: 'Make device public (available from public dashboard)',
meta: 'function',
args: [
{ name: 'deviceId', type: 'string', description: 'Id of the device'},
requestConfigArg
],
return: observableReturnType(deviceHref)
},
assignDeviceToCustomer: {
description: 'Assign device to specific customer',
meta: 'function',
args: [
{ name: 'customerId', type: 'string', description: 'Id of the customer'},
{ name: 'deviceId', type: 'string', description: 'Id of the device'},
requestConfigArg
],
return: observableReturnType(deviceHref)
},
unassignDeviceFromCustomer: {
description: 'Unassign device from any customer',
meta: 'function',
args: [
{ name: 'deviceId', type: 'string', description: 'Id of the device'},
requestConfigArg
],
return: observableVoid()
},
sendOneWayRpcCommand: {
description: 'Send one way (without response) RPC command to the device.',
meta: 'function',
args: [
{ name: 'deviceId', type: 'string', description: 'Id of the device'},
{ name: 'requestBody', type: 'object', description: 'Request body to be sent to device'},
requestConfigArg
],
return: {
type: `Observable<any>`,
description: `A command execution Observable.`
}
},
sendTwoWayRpcCommand: {
description: 'Sends two way (with response) RPC command to the device.',
meta: 'function',
args: [
{ name: 'deviceId', type: 'string', description: 'Id of the device'},
{ name: 'requestBody', type: 'object', description: 'Request body to be sent to device'},
requestConfigArg
],
return: {
type: `Observable<any>`,
description: `A command execution Observable of response body.`
}
},
findByQuery: {
description: 'Find devices by search query',
meta: 'function',
args: [
{ name: 'query', type: 'DeviceSearchQuery',
description: 'Device search query object'},
requestConfigArg
],
return: observableArrayReturnType(deviceHref)
},
findByName: {
description: 'Find device by name',
meta: 'function',
args: [
{ name: 'deviceName', type: 'string',
description: 'Search device name'},
requestConfigArg
],
return: observableReturnType(deviceHref)
},
claimDevice: {
description: 'Send claim device request',
meta: 'function',
args: [
{ name: 'deviceName', type: 'string',
description: 'Claiming device name'},
requestConfigArg
],
return: observableReturnType('ClaimResult')
},
unclaimDevice: {
description: 'Send un-claim device request',
meta: 'function',
args: [
{ name: 'deviceName', type: 'string',
description: 'Device name to un-claim'},
requestConfigArg
],
return: observableVoid()
}
}
},
assetService: {
description: 'Asset Service API
' +
'See AssetService for API reference.',
meta: 'service',
type: 'AssetService',
children: {
getTenantAssetInfos: {
description: 'Get tenant asset',
meta: 'function',
args: [
pageLinkArg,
{name: 'type', type: 'string', optional: true, description: 'Asset type'},
requestConfigArg
],
return: observablePageDataReturnType(assetInfoHref)
},
getCustomerAssetInfos: {
description: 'Get customer assets',
meta: 'function',
args: [
{name: 'customerId', type: 'string', description: 'Id of the customer'},
pageLinkArg,
{name: 'type', type: 'string', optional: true, description: 'Asset type'},
requestConfigArg
],
return: observablePageDataReturnType(assetInfoHref)
},
getAsset: {
description: 'Get asset by id',
meta: 'function',
args: [
{name: 'assetId', type: 'string', description: 'Id of the asset'},
requestConfigArg
],
return: observableReturnType(assetHref)
},
getAssets: {
description: 'Get assets by ids',
meta: 'function',
args: [
{name: 'assetIds', type: `Array<string>`, description: 'Ids of the assets'},
requestConfigArg
],
return: observableArrayReturnType(assetHref)
},
getAssetInfo: {
description: 'Get asset info by id',
meta: 'function',
args: [
{name: 'assetId', type: 'string', description: 'Id of the assets'},
requestConfigArg
],
return: observableReturnType(assetInfoHref)
},
saveAsset: {
description: 'Save asset',
meta: 'function',
args: [
{name: 'asset', type: assetHref, description: 'Asset object to save'},
requestConfigArg
],
return: observableReturnType(assetHref)
},
deleteAsset: {
description: 'Delete asset by id',
meta: 'function',
args: [
{name: 'assetId', type: 'string', description: 'Id of the asset'},
requestConfigArg
],
return: observableVoid()
},
getAssetTypes: {
description: 'Get all available assets types',
meta: 'function',
args: [
requestConfigArg
],
return: observableArrayReturnType('EntitySubtype')
},
makeAssetPublic: {
description: 'Make asset public (available from public dashboard)',
meta: 'function',
args: [
{name: 'assetId', type: 'string', description: 'Id of the asset'},
requestConfigArg
],
return: observableReturnType(assetHref)
},
assignAssetToCustomer: {
description: 'Assign asset to specific customer',
meta: 'function',
args: [
{name: 'customerId', type: 'string', description: 'Id of the customer'},
{name: 'assetId', type: 'string', description: 'Id of the asset'},
requestConfigArg
],
return: observableReturnType(assetHref)
},
unassignAssetFromCustomer: {
description: 'Unassign asset from any customer',
meta: 'function',
args: [
{name: 'assetId', type: 'string', description: 'Id of the asset'},
requestConfigArg
],
return: observableVoid()
},
findByQuery: {
description: 'Find assets by search query',
meta: 'function',
args: [
{
name: 'query',
type: 'AssetSearchQuery',
description: 'Asset search query object'
},
requestConfigArg
],
return: observableArrayReturnType(assetHref)
},
findByName: {
description: 'Find asset by name',
meta: 'function',
args: [
{
name: 'assetName', type: 'string',
description: 'Search asset name'
},
requestConfigArg
],
return: observableReturnType(assetHref)
},
},
},
entityViewService: {
description: 'EntityView Service API
' +
'See EntityViewService for API reference.',
meta: 'service',
type: 'EntityViewService',
children: {
getTenantEntityViewInfos: {
description: 'Get tenant entity view infos',
meta: 'function',
args: [
pageLinkArg,
{name: 'type', type: 'string', optional: true, description: 'Entity view type'},
requestConfigArg
],
return: observablePageDataReturnType(entityViewInfoHref)
},
getCustomerEntityViewInfos: {
description: 'Get customer entities view infos by id',
meta: 'function',
args: [
{ name: 'customerId', type: 'string', description: 'Id of the customer'},
pageLinkArg,
{ name: 'type', type: 'string', optional: true, description: 'Entity view type'},
requestConfigArg
],
return: observablePageDataReturnType(entityViewInfoHref)
},
getEntityView: {
description: 'Get entity view by id',
meta: 'function',
args: [
{ name: 'entityViewId', type: 'string', description: 'Id of the entity view'},
requestConfigArg
],
return: observableReturnType(entityViewHref)
},
getEntityViewInfo: {
description: 'Get entity view info by id',
meta: 'function',
args: [
{name: 'entityViewId', type: 'string', description: 'Id of the entities view'},
requestConfigArg
],
return: observableReturnType(entityViewInfoHref)
},
saveEntityView: {
description: 'Save entity view',
meta: 'function',
args: [
{name: 'entityView', type: entityViewHref, description: 'Entity view object to save'},
requestConfigArg
],
return: observableReturnType(entityViewHref)
},
deleteEntityView: {
description: 'Delete entity view by id',
meta: 'function',
args: [
{name: 'entityViewId', type: 'string', description: 'Id of the entity view'},
requestConfigArg
],
return: observableVoid()
},
getEntityViewTypes: {
description: 'Get all available entity view types',
meta: 'function',
args: [
requestConfigArg
],
return: observableArrayReturnType('EntitySubtype')
},
makeEntityViewPublic: {
description: 'Make entity view public (available from public dashboard)',
meta: 'function',
args: [
{name: 'entityViewId', type: 'string', description: 'Id of the entity view'},
requestConfigArg
],
return: observableReturnType(entityViewHref)
},
assignEntityViewToCustomer: {
description: 'Assign entity view to specific customer',
meta: 'function',
args: [
{name: 'customerId', type: 'string', description: 'Id of the customer'},
{name: 'entityViewId', type: 'string', description: 'Id of the entity viewId'},
requestConfigArg
],
return: observableReturnType(entityViewHref)
},
unassignEntityViewFromCustomer: {
description: 'Unassign entity view from any customer',
meta: 'function',
args: [
{name: 'entityViewId', type: 'string', description: 'Id of the entity view'},
requestConfigArg
],
return: observableVoid()
},
findByQuery: {
description: 'Find entities view by search query',
meta: 'function',
args: [
{
name: 'query',
type: 'AssetSearchQuery',
description: 'Asset search query object'
},
requestConfigArg
],
return: observableArrayReturnType(entityViewHref)
},
}
},
customerService: {
description: 'Customer Service API
' +
'See CustomerService for API reference.',
meta: 'service',
type: 'CustomerService',
children: {
getCustomer: {
description: 'Get customer by id',
meta: 'function',
args: [
{name: 'customerId', type: 'string', description: 'Id of the customer'},
requestConfigArg
],
return: observableReturnType(customerHref)
},
getCustomers: {
description: 'Get customers by ids',
meta: 'function',
args: [
pageLinkArg,
requestConfigArg
],
return: observablePageDataReturnType(customerHref)
},
saveCustomer: {
description: 'Save customer',
meta: 'function',
args: [
{name: 'customer', type: customerHref, description: 'Customer object to save'},
requestConfigArg
],
return: observableReturnType(customerHref)
},
deleteCustomer: {
description: 'Delete customer by id',
meta: 'function',
args: [
{name: 'customerId', type: 'string', description: 'Id of the customer'},
requestConfigArg
],
return: observableVoid()
},
}
},
dashboardService: {
description: 'Dashboard Service API
' +
'See DashboardService for API reference.',
meta: 'service',
type: 'DashboardService',
children: {
getTenantDashboards: {
description: 'Get tenant dashboard',
meta: 'function',
args: [
pageLinkArg,
requestConfigArg
],
return: observablePageDataReturnType(dashboardInfoHref)
},
getTenantDashboardsByTenantId: {
description: 'Get tenant dashboards by id',
meta: 'function',
args: [
{name: 'tenantId', type: 'string', description: 'Id of the tenant'},
pageLinkArg
],
return: observablePageDataReturnType(dashboardInfoHref)
},
getCustomerDashboards: {
description: 'Get customer dashboard by id',
meta: 'function',
args: [
{name: 'customerId', type: 'string', description: 'Id of the customer'},
pageLinkArg,
requestConfigArg
],
return: observablePageDataReturnType(dashboardInfoHref)
},
getDashboard: {
description: 'Get dashboard by id',
meta: 'function',
args: [
{name: 'dashboardId', type: 'string', description: 'Id of the dashboard'},
requestConfigArg
],
return: observableReturnType(dashboardHref)
},
getDashboardInfo: {
description: 'Get dashboard info by id',
meta: 'function',
args: [
{name: 'dashboardId', type: 'string', description: 'Id of the dashboard'},
requestConfigArg
],
return: observableReturnType(dashboardInfoHref)
},
saveDashboard: {
description: 'Save dashboard',
meta: 'function',
args: [
{name: 'dashboard', type: dashboardHref, description: 'Dashboard object to save'},
requestConfigArg
],
return: observableReturnType(dashboardHref)
},
deleteDashboard: {
description: 'Delete dashboard by id',
meta: 'function',
args: [
{name: 'dashboardId', type: 'string', description: 'Id of the entity view'},
requestConfigArg
],
return: observableVoid()
},
assignDashboardToCustomer: {
description: 'Assign dashboard to specific customer',
meta: 'function',
args: [
{name: 'customerId', type: 'string', description: 'Id of the customer'},
{name: 'dashboardId', type: 'string', description: 'Id of the dashboard'},
requestConfigArg
],
return: observableReturnType(dashboardHref)
},
unassignDashboardFromCustomer: {
description: 'Unassign dashboard from any customer',
meta: 'function',
args: [
{name: 'customerId', type: 'string', description: 'Id of the customer'},
{name: 'dashboardId', type: 'string', description: 'Id of the dashboard'},
requestConfigArg
],
return: observableVoid()
},
makeDashboardPublic: {
description: 'Make dashboard public by id',
meta: 'function',
args: [
{name: 'dashboardId', type: 'string', description: 'Id of the dashboard'},
requestConfigArg
],
return: observableReturnType(dashboardHref)
},
makeDashboardPrivate: {
description: 'Make dashboard private by id',
meta: 'function',
args: [
{name: 'dashboardId', type: 'string', description: 'Id of the dashboard'},
requestConfigArg
],
return: observableReturnType(dashboardHref)
},
updateDashboardCustomers: {
description: 'Update dashboard by id',
meta: 'function',
args: [
{name: 'dashboardId', type: 'string', description: 'Id of the dashboard'},
{name: 'customerIds', type: `Array<string>`, description: 'Ids of the customers'},
requestConfigArg
],
return: observableReturnType(dashboardHref)
},
addDashboardCustomers: {
description: 'Add dashboard customers by ids',
meta: 'function',
args: [
{name: 'dashboardId', type: 'string', description: 'Id of the dashboard'},
{name: 'customerIds', type: `Array<string>`, description: 'Ids of the customers'},
requestConfigArg
],
return: observableReturnType(dashboardHref)
},
removeDashboardCustomers: {
description: 'Remove dashboard customers dy ids',
meta: 'function',
args: [
{name: 'dashboardId', type: 'string', description: 'Id of the dashboard'},
{name: 'customerIds', type: `Array<string>`, description: 'Id of the customers'},
requestConfigArg
],
return: observableArrayReturnType(dashboardHref)
},
getPublicDashboardLink: {
description: 'Get public dashboard link',
meta: 'function',
args: [
{name: 'dashboard', type: dashboardInfoHref, description: 'dashboard info'},
],
return: {
type: `string|null`,
description: `Returns dashboard url`
}
},
getServerTimeDiff: {
description: 'remove dashboard customers ',
meta: 'function',
args: [
],
return: observableReturnTypeVariable('number')
},
}
},
userService: {
description: 'User Service API
' +
'See UserService for API reference.',
meta: 'service',
type: 'UserService',
children: {
getUsers: {
description: 'Get users',
meta: 'function',
args: [
pageLinkArg,
requestConfigArg
],
return: observablePageDataReturnType(userHref)
},
getTenantAdmins: {
description: 'Get tenant admins by id',
meta: 'function',
args: [
{name: 'tenantId', type: 'string', description: 'Id of the tenant'},
pageLinkArg,
requestConfigArg
],
return: observablePageDataReturnType(userHref)
},
getCustomerUsers: {
description: 'Get customer users by id',
meta: 'function',
args: [
{name: 'customerId', type: 'string', description: 'id of the customer'},
pageLinkArg,
requestConfigArg
],
return: observablePageDataReturnType(userHref)
},
getUser: {
description: 'Get user by id',
meta: 'function',
args: [
{name: 'userId', type: 'string', description: 'id of the user'},
requestConfigArg
],
return: observableReturnType(userHref)
},
saveUser: {
description: 'Save user',
meta: 'function',
args: [
{name: 'user', type: userHref, description: 'User object to save'},
requestConfigArg
],
return: observableReturnType(userHref)
},
deleteUser: {
description: 'Delete user by id',
meta: 'function',
args: [
{name: 'userId', type: 'string', description: 'Id of the user'},
requestConfigArg
],
return: observableVoid()
},
setUserCredentialsEnabled: {
description: 'Set user credentials enabled by id',
meta: 'function',
args: [
{name: 'userId', type: 'string', description: 'Id of the user'},
{name: 'userCredentialsEnabled', type: 'boolean', description: 'User credentials enabled'},
requestConfigArg
],
return: observableReturnType(userHref)
},
getActivationLink: {
description: 'Get activation link by id',
meta: 'function',
args: [
{name: 'userId', type: 'string', description: 'Id of the user'},
requestConfigArg
],
return: observableReturnTypeVariable('string')
},
sendActivationEmail: {
description: 'Send activation email',
meta: 'function',
args: [
{name: 'email', type: 'string', description: 'Email of the user'},
requestConfigArg
],
return: observableVoid()
},
}
},
entityRelationService: {
description: 'Entity Relation Service API
' +
'See EntityRelationService for API reference.',
meta: 'service',
type: 'EntityRelationService',
children: {
saveRelation: {
description: 'Save relation',
meta: 'function',
args: [
{name: 'relation', type: entityRelationHref, description: 'Relation object to save'},
requestConfigArg
],
return: observableReturnType(entityRelationHref)
},
deleteRelation: {
description: 'Delete relation by ids',
meta: 'function',
args: [
{name: 'fromId', type: entityIdHref, description: 'From-id'},
{name: 'relationType', type: 'string', description: 'Relation type'},
{name: 'toId', type: entityIdHref, description: 'To-id'},
requestConfigArg
],
return: observableVoid()
},
deleteRelations: {
description: 'Delete relations by entity id',
meta: 'function',
args: [
{name: 'entityId', type: entityIdHref, description: 'Id to the entity'},
{name: 'relationType', type: 'string', description: 'Relation type'},
requestConfigArg
],
return: observableVoid()
},
getRelation: {
description: 'Get relation by ids',
meta: 'function',
args: [
{name: 'fromId', type: entityIdHref, description: 'From-id'},
{name: 'relationType', type: 'string', description: 'Relation type'},
{name: 'toId', type: entityIdHref, description: 'To-id'},
requestConfigArg
],
return: observableReturnType(entityRelationHref)
},
findByFrom: {
description: 'Find by from-id',
meta: 'function',
args: [
{name: 'fromId', type: entityIdHref, description: 'From-id'},
requestConfigArg
],
return: observableArrayReturnType(entityRelationHref)
},
findInfoByFrom: {
description: 'Find info by from-id',
meta: 'function',
args: [
{name: 'fromId', type: entityIdHref, description: 'From-id'},
requestConfigArg
],
return: observableArrayReturnType(entityRelationInfoHref)
},
findByFromAndType: {
description: 'Find by from-id and relation type',
meta: 'function',
args: [
{name: 'fromId', type: entityIdHref, description: 'From-id'},
{name: 'relationType', type: 'string', description: 'Relation type'},
requestConfigArg
],
return: observableArrayReturnType(entityRelationHref)
},
findByTo: {
description: 'Find by to-id',
meta: 'function',
args: [
{name: 'toId', type: entityIdHref, description: 'To-id'},
requestConfigArg
],
return: observableArrayReturnType(entityRelationHref)
},
findInfoByTo: {
description: 'Find info by to-id',
meta: 'function',
args: [
{name: 'toId', type: entityIdHref, description: 'To-id'},
requestConfigArg
],
return: observableArrayReturnType(entityRelationInfoHref)
},
findByToAndType: {
description: 'Find by to-id and relation type',
meta: 'function',
args: [
{name: 'toId', type: entityIdHref, description: 'To-id'},
{name: 'relationType', type: 'string', description: 'Relation type'},
requestConfigArg
],
return: observableArrayReturnType(entityRelationHref)
},
findByQuery: {
description: 'Find by query',
meta: 'function',
args: [
{name: 'query', type: entityRelationsQueryHref, description: 'Query'},
requestConfigArg
],
return: observableArrayReturnType(entityRelationHref)
},
findInfoByQuery: {
description: 'Find info by query',
meta: 'function',
args: [
{name: 'query', type: entityRelationsQueryHref, description: 'Query'},
requestConfigArg
],
return: observableArrayReturnType(entityRelationInfoHref)
},
}
},
attributeService: {
description: 'Attribute Service API
' +
'See AttributeService for API reference.',
meta: 'service',
type: 'AttributeService',
children: {
getEntityAttributes: {
description: 'Get entity attributes by id',
meta: 'function',
args: [
{name: 'entityId', type: entityIdHref, description: 'Id of the entity'},
{name: 'attributeScope', type: attributeScopeHref, description: 'Atribute scope'},
{name: 'keys', type: `Array<string>`, description: 'Array of the keys'},
requestConfigArg
],
return: observableArrayReturnType(attributeDataHref)
},
deleteEntityAttributes: {
description: 'Delete entity attributes by id',
meta: 'function',
args: [
{name: 'entityId', type: entityIdHref, description: 'Id of the entity'},
{name: 'attributeScope', type: attributeScopeHref, description: 'Atribute scope'},
{name: 'attributes', type: `array<${attributeDataHref}>`, description: 'Array of the attributes'},
requestConfigArg
],
return: observableReturnTypeVariable('any')
},
deleteEntityTimeseries: {
description: 'Delete entity timeseries by id',
meta: 'function',
args: [
{name: 'entityId', type: entityIdHref, description: 'Id of the entity'},
{name: 'timeseries', type: `Array<${attributeDataHref}>>`, description: 'Array of the timeseries'},
{name: 'deleteAllDataForKeys', type: 'boolean', optional: true, description: 'Delete all data for keys'},
requestConfigArg
],
return: observableReturnTypeVariable('any')
},
saveEntityAttributes: {
description: 'Save entity attributes',
meta: 'function',
args: [
{name: 'entityId', type: entityIdHref, description: 'Id of the entity'},
{name: 'attributeScope', type: attributeScopeHref, description: 'Attribute scope'},
{name: 'attributes', type: 'Array<${attributeDataHref}>>', description: 'Array of the attributes'},
requestConfigArg
],
return: observableReturnTypeVariable('any')
},
saveEntityTimeseries: {
description: 'Save entity timeseries',
meta: 'function',
args: [
{name: 'entityId', type: entityIdHref, description: 'Id of the entity'},
{name: 'timeseriesScope', type: 'string', description: 'Timeseries scope'},
{name: 'timeseries', type: `Array<attributeDataHref>`, description: 'Array of the timeseries'},
requestConfigArg
],
return: observableReturnTypeVariable('any')
},
}
},
entityService: {
description: 'Entity Service API
' +
'See EntityService for API reference.',
meta: 'service',
type: 'EntityService',
children: {
getEntity: {
description: 'Get entity by id',
meta: 'function',
args: [
{name: 'entityType', type: entityTypeHref, description: 'Entity type'},
{name: 'entityId', type: 'string', description: 'Id of the entity'},
requestConfigArg
],
return: observableBaseDataReturnType(entityIdHref)
},
getEntities: {
description: 'Get entities by ids',
meta: 'function',
args: [
{name: 'entityType', type: entityTypeHref, description: 'Entity type'},
{name: 'entityIds', type: `Array<string>`, description: 'Ids of the entities'},
requestConfigArg
],
return: observableArrayBaseDataReturnType(entityIdHref)
},
getEntitiesByNameFilter: {
description: 'Get entities by name filter',
meta: 'function',
args: [
{name: 'entityType', type: entityTypeHref, description: 'Entity type'},
{name: 'entityNameFilter', type: 'string', description: 'Name filter of the entity'},
{name: 'pageSize', type: 'number', description: 'Size of the page'},
{name: 'subType', type: 'string', optional: true, description: 'Subtype'},
requestConfigArg
],
return: observableArrayBaseDataReturnType(entityIdHref)
},
findEntityDataByQuery: {
description: 'Find entity data by query',
meta: 'function',
args: [
{name: 'query', type: entityDataQueryHref, description: 'Query'},
requestConfigArg
],
return: observablePageDataReturnType(entityDataHref)
},
findAlarmDataByQuery: {
description: 'Find alarm data by query',
meta: 'function',
args: [
{name: 'query', type: alarmDataQueryHref, description: 'Query'},
requestConfigArg
],
return: observablePageDataReturnType(alarmDataHref)
},
findEntityInfosByFilterAndName: {
description: 'Find entity infos by filter and name',
meta: 'function',
args: [
{name: 'filter', type: entityFilterHref, description: 'Filter of the entity'},
{name: 'searchText', type: 'string', description: 'Search text'},
requestConfigArg
],
return: observablePageDataReturnType(entityInfoHref)
},
findSingleEntityInfoByEntityFilter: {
description: 'Find single entity infos by filter of the entity ',
meta: 'function',
args: [
{name: 'filter', type: entityFilterHref, description: 'Filter of the entity'},
{name: 'searchText', type: 'string', description: 'search text'},
requestConfigArg
],
return: observableReturnType(entityInfoHref)
},
getAliasFilterTypesByEntityTypes: {
description: 'Get alias filter types by entity type',
meta: 'function',
args: [
{name: 'entityTypes', type: `Array<${entityTypeHref}|${aliasEntityTypeHref}>`, description: 'Entity types'},
{name: 'searchText', type: 'string', description: 'Search text'}
],
return: {
type: `Array<${aliasFilterTypeHref}$gt;`,
description: `Array of ${aliasFilterTypeHref} objects`
}
},
filterAliasByEntityTypes: {
description: 'Filter alias by entity type',
meta: 'function',
args: [
{name: 'entityAlias', type: entityAliasHref, description: 'Alias of the entity'},
{name: 'entityTypes', type: `Array<${entityTypeHref}|${aliasEntityTypeHref}>`, description: 'Entity types'}
],
return: {
type: 'boolean',
description: `Returns boolean variable based on the filter`
}
},
prepareAllowedEntityTypesList: {
description: 'Prepare allowed types of the entity list',
meta: 'function',
args: [
{name: 'allowedEntityTypes', type: `Array<${entityTypeHref}|${aliasEntityTypeHref}>`, description: 'Entity types'},
{name: 'useAliasEntityTypes', type: 'boolean', description: 'Use alias entity types'},
],
return: {
type: `Array<${entityTypeHref}|${aliasEntityTypeHref}>`,
description: `Returns entity types array`
}
},
getEntityKeys: {
description: 'Get entity keys by id',
meta: 'function',
args: [
{name: 'entityId', type: entityIdHref, description: 'id of the entity'},
{name: 'query', type: 'string', description: 'Query'},
{name: 'type', type: dataKeyTypeHref, description: 'Query'},
requestConfigArg
],
return: {
type: `Observable<Array<string>>`,
description: `An Observable of string variable.`
}
// observableArrayReturnType('string')
},
createDatasourcesFromSubscriptionsInfo: {
description: 'Create database from subscriptions info',
meta: 'function',
args: [
{name: 'subscriptionsInfo', type: 'array', description: 'Subscriptions info'}
],
return: {
type: `Array<${dataSourceHref}>`,
description: `Array of ${dataSourceHref} objects`
}
},
createAlarmSourceFromSubscriptionInfo: {
description: 'Create alarm source from subscriptions info',
meta: 'function',
args: [
{name: 'subscriptionInfo', type: subscriptionInfoHref, description: 'Subscription info'}
],
return: {
type: `${dataSourceHref}`,
description: `${dataSourceHref} object`
}
},
resolveAlias: {
description: 'Resolve alias',
meta: 'function',
args: [
{name: 'entityAlias', type: entityAliasHref, description: 'Alias of the entity'},
{name: 'stateParams', type: stateParamsHref, description: 'State params'},
],
return: observableReturnType(aliasInfoHref)
},
resolveAliasFilter: {
description: 'Resolve alias filter',
meta: 'function',
args: [
{name: 'filter', type: entityAliasFilterHref, description: 'Entity alias filter'},
{name: 'stateParams', type: stateParamsHref, description: 'State params'},
],
return: observableReturnType(entityAliasFilterResultHref)
},
checkEntityAlias: {
description: 'Check entity alias',
meta: 'function',
args: [
{name: 'entityAlias', type: entityAliasHref, description: 'Alias of the entity'},
],
return: observableReturnTypeVariable('boolean')
// observableReturnType('boolean')
},
saveEntityParameters: {
description: 'Save entity parameters',
meta: 'function',
args: [
{name: 'entityType', type: entityTypeHref, description: 'Entity type'},
{name: 'entityData', type: importEntityDataHref, description: 'Data of the entity'},
{name: 'update', type: 'boolean', description: 'Update'},
requestConfigArg
],
return: observableReturnType(importEntitiesResultInfoHref)
},
saveEntityData: {
description: 'Save entity data',
meta: 'function',
args: [
{name: 'entityId', type: entityIdHref, description: 'Id of the entity'},
{name: 'entityData', type: importEntityDataHref, description: 'Data of the entity'},
requestConfigArg
],
return: observableReturnTypeVariable('any')
// observableReturnType('any')
},
}
},
dialogs: {
description: 'Dialogs Service API
' +
'See DialogService for API reference.',
meta: 'service',
type: 'DialogService',
children: {
confirm: {
description: 'Confirm',
meta: 'function',
args: [
{name: 'title', type: 'string', description: 'Title'},
{name: 'message', type: 'string', description: 'Message'},
{name: 'cancel', type: 'string', optional: true, description: 'Cancel'},
{name: 'ok', type: 'string', optional: true, description: 'Ok'},
{name: 'fullscreen', type: 'boolean', optional: true, description: 'Fullscreen'},
],
return: observableReturnTypeVariable('boolean')
},
alert: {
description: 'Alert',
meta: 'function',
args: [
{name: 'title', type: 'string', description: 'Title'},
{name: 'message', type: 'string', description: 'Message'},
{name: 'ok', type: 'string', optional: true, description: 'Ok'},
{name: 'fullscreen', type: 'boolean', optional: true, description: 'Fullscreen'},
],
return: observableReturnTypeVariable('boolean')
},
colorPicker: {
description: 'Color picker',
meta: 'function',
args: [
{name: 'color', type: 'string', description: 'Сolor'},
],
return: observableReturnTypeVariable('string')
},
materialIconPicker: {
description: 'Material icon picker',
meta: 'function',
args: [
{name: 'icon', type: 'string', description: 'Icon'},
],
return: observableReturnTypeVariable('string')
},
forbidden: {
description: 'Forbidden',
meta: 'function',
args: [
],
return: observableReturnTypeVariable('boolean')
},
todo: {
description: 'To do',
meta: 'function',
args: [
],
return: observableReturnTypeVariable('any')
},
}
},
customDialog: {
description: 'Custom Dialog Service API
' +
'See CustomDialogService for API reference.',
meta: 'service',
type: 'CustomDialogService',
children: {
customDialog: {
description: 'Custom Dialog',
meta: 'function',
args: [
{name: 'template', type: 'string', description: 'Template'},
{name: 'controller', type: customDialogComponentHref, description: 'Controller'},
{name: 'data', type: 'any', description: 'Data'},
],
return: observableReturnTypeVariable('any')
},
}
},
date: {
description: 'Date Pipe
Formats a date value according to locale rules.
' +
'See DatePipe for API reference.',
meta: 'service',
type: 'DatePipe'
},
translate: {
description: 'Translate Service API
' +
'See TranslateService for API reference.',
meta: 'service',
type: 'TranslateService'
},
http: {
description: 'HTTP Client Service
' +
'See HttpClient for API reference.',
meta: 'service',
type: 'HttpClient'
},
sanitizer: {
description: 'DomSanitizer Service
' +
'See DomSanitizer for API reference.',
meta: 'service',
type: 'DomSanitizer'
}
};