const recordEvent = ( service, args ) => ( { type: ANALYTICS_EVENT_RECORD, meta: { analytics: [ { type: ANALYTICS_EVENT_RECORD, payload: Object.assign( {}, { service }, args ), }, ], }, } )
function logPing (db, id, response) { var job = getById(db, id) var pings = job.pings.slice(0) pings.push(response) return db .get('queue') .find({ id: id }) .assign({ pings: pings }) .write() }
function setStorage (db, id, storage) { return db .get('queue') .find({ id: id }) .assign({ storage: storage }) .write() }
function createActions(store) { const houseActions = createActionsHouse(store); const integrationActions = createActionsIntegration(store); const actions = {}; return Object.assign({}, houseActions, integrationActions, actions); }
getAmendedFormData() { const formData = this.formRef.getFormData(); delete formData.check; return Object.assign({}, formData, { field: 'title', tags: formData.tags.split(','), }); }
/** * @api {get} /api/v1/service/:service_name/device getDevicesByService * @apiName getDevicesByService * @apiGroup Device */ async function getDevicesByService(req, res) { const params = Object.assign({}, req.query, { service: req.params.service_name, }); const devices = await gladys.device.get(params); res.json(devices); }
constructor(...serviceConfig) { super(...serviceConfig); this.count = Object.assign({}, INITIAL_COUNT_VALUE); this.ready = false; this.db = this.loadDatabase(); this.emitUpdate = _.debounce(this.emitUpdate.bind(this), 100); this.countNotifications(); }
Object.assign(event, { disconnected: true, subscribe: fake.resolves(null), unsubscribe: fake.resolves(null), publish: fake.yieldsAsync(null), internalEnd: fake.resolves(null), end: () => { mqttApi.disconnected = true; mqttApi.internalEnd(); }, })
export default function ( prototype ) { assign( prototype, EventEmitter.prototype ); prototype.emitChange = function () { this.emit( 'change' ); }; prototype.off = prototype.removeListener; }
function removeUserStepFromFlow( flow ) { if ( ! flow ) { return; } return assign( {}, flow, { steps: reject( flow.steps, ( stepName ) => stepConfig[ stepName ].providesToken ), } ); }
saveUser(user) { const mergedUser = Object.assign({}, this.user, user); this.user = mergedUser; keyValueStore.set(GATEWAY_USER_KEY, JSON.stringify(mergedUser)); }
export function runFastRules( post ) { if ( ! post ) { return post; } post = Object.assign( {}, post ); fastPostNormalizationRules( post ); return post; }
function createActions(store) { const houseActions = createActionsHouse(store); const integrationActions = createActionsIntegration(store); const actions = {}; return Object.assign({}, houseActions, integrationActions, actions); }