How to use the @signalk/signalk-schema.getSourceId function in @signalk/signalk-schema

To help you get started, we’ve selected a few @signalk/signalk-schema examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SignalK / signalk-server-node / src / interfaces / ws.js View on Github external
msg.updates.forEach(update => {
    let source = update.$source
    if (!source && update.source) {
      source = getSourceId(update.source)
    }

    if (source) {
      update.values.forEach(valuePath => {
        if (!pathSources[valuePath.path]) {
          pathSources[valuePath.path] = {}
        }
        if (
          !pathSources[valuePath.path][source] ||
          pathSources[valuePath.path][source] !== spark
        ) {
          if (pathSources[valuePath.path][source]) {
            console.log(
              `WARNING: got a new ws client for path ${valuePath.path} source ${source}`
            )
          }
github tkurki / signalk-to-influxdb / skToInflux.js View on Github external
function addSource(update, tags) {
  if ( update['$source'] ) {
    tags.source = update['$source']
  } else if ( update['source'] ) {
    tags.source = getSourceId(update['source'])
  }
  return tags
}
github SignalK / signalk-server-node / src / deltacache.js View on Github external
function ensureHasDollarSource(normalizedDelta) {
  let dollarSource = normalizedDelta.$source
  if (!dollarSource) {
    dollarSource = getSourceId(normalizedDelta.source)
    normalizedDelta.$source = dollarSource
  }
  return dollarSource
}
github SignalK / signalk-server-node / src / tokensecurity.js View on Github external
const notAllowed = delta.updates.find(update => {
        let source = update.$source
        if (!source) {
          source = getSourceId(update.source)
        }
        return update.values.find(valuePath => {
          return (
            strategy.checkACL(
              req.skPrincipal.identifier,
              context,
              valuePath.path,
              source,
              'write'
            ) === false
          )
        })
      })

@signalk/signalk-schema

SignalK specification schema as an npm module with tests

CC-BY-SA-2.0
Latest version published 5 months ago

Package Health Score

78 / 100
Full package analysis