import Subscription from './Subscription'; import * as types from '../types'; export default class LoginEvent extends Subscription { /** * Get the query attributes. * * @returns {Array} */ getAttributes(): Array { return [ 'Id', 'CreatedDate', 'EventIdentifier', 'Username', 'EventDate', 'SourceIp', 'AdditionalInfo', 'ApiType', 'ApiVersion', 'Application', 'AuthServiceId', 'Browser', 'CipherSuite', 'ClientVersion', 'LoginGeoId', 'LoginHistoryId', 'LoginType', 'LoginUrl', 'Platform', 'Status', ]; } /** * Get the subscription context. * * @returns {types.Context} */ getContext(): types.Context { return { name: 'salesforce', subscription: 'loginEvent', }; } /** * Get the subscription name. * * @returns {String} */ getName(): String { return 'LoginEvent'; } /** * Get the subscription query. * * @returns {String} */ getQuery(): String { const attributes = this.getAttributes().join(', '); const time = this.getLastQueryTime(); return `SELECT ${attributes} FROM LoginEvent WHERE EventDate >= ${time}`; } }