更新
更旧
/**
*
* Copyright (c) 2020 Silicon Labs
*
* 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.
*/
getAllSessionKeyValues: '/allKeyValues',
endpoint: '/endpoint',
endpointType: '/endpointType',
initialState: '/initialState',
option: '/option',
commandUpdate: '/command/update',
cluster: '/cluster',
attributeUpdate: '/attribute/update',
preview: '/preview/',
previewName: '/preview/:name',
previewNameIndex: '/preview/:name/:index',

Timotej Ecimovic
已提交
sql: '/sql',
addNewPackage: `/packages/add`,
zclExtension: `/zclExtension/:entity/:extensionId`,
zclCluster: '/zcl/cluster/',
zclDeviceType: '/zcl/deviceType/',
zclDomain: '/zcl/domain/',
zclBitmap: '/zcl/bitmap/',
zclEnum: '/zcl/enum/',
zclStruct: '/zcl/struct/',
endpointTypeClusters: '/zcl/endpointTypeClusters/',
endpointTypeAttributes: '/zcl/endpointTypeAttributes/',
endpointTypeCommands: '/zcl/endpointTypeCommands/',
deviceTypeClusters: '/zcl/deviceTypeClusters/',
deviceTypeAttributes: '/zcl/deviceTypeAttributes/',
deviceTypeCommands: '/zcl/deviceTypeCommands/',
const uiMode = {
ZIGBEE: `zigbee`,
}

Timotej Ecimovic
已提交
const httpCode = {
ok: 200,
badRequest: 400,
notFound: 404,
isSuccess: (code) => {
return code >= 200 && code < 300
},
}
const uc = {
// command id
componentTree: '/uc/component/tree',
componentAdd: '/uc/component/add',
componentRemove: '/uc/component/remove',
}
const ide = {
// request
open: '/file/open',
close: '/file/close',
save: '/file/save',
saveAs: '/file/saveAs',
rename: '/file/rename',
move: '/file/move',
isDirty: '/file/isDirty',
// response
openResponse: 'openResponse',

Timotej Ecimovic
已提交
const updateKey = {
deviceTypeRef: 'deviceTypeRef',
endpointId: 'endpointId',
endpointType: 'endpointType',
endpointVersion: 'endpointVersion',
networkId: 'networkId',

Timotej Ecimovic
已提交
name: 'name',
attributeSelected: 'selectedAttributes',
attributeSingleton: 'selectedSingleton',
attributeBounded: 'selectedBounded',
attributeDefault: 'defaultValue',
attributeReporting: 'selectedReporting',
attributeReportMin: 'reportingMin',
attributeReportMax: 'reportingMax',
attributeReportChange: 'reportableChange',
attributeStorage: 'storageOption',

Timotej Ecimovic
已提交
}
exports.param = {
sessionId: 'sessionId',

Timotej Ecimovic
已提交
path: 'path',

Timotej Ecimovic
已提交
exports.httpCode = httpCode
exports.uiMode = uiMode

Timotej Ecimovic
已提交
exports.updateKey = updateKey