import Subscription from './Subscription'; import * as types from '../types'; export default class ContentVersion extends Subscription { /** * Get the query attributes. * * @returns {Array} */ getAttributes(): Array { return ['Id', 'Title', 'Origin', 'TagCsv', 'OwnerId', 'Checksum', 'FileType', 'IsLatest', 'IsDeleted', 'ContentUrl', 'ContentSize', 'CreatedById', 'CreatedDate', 'Description', 'RatingCount', 'TextPreview', 'VersionData', 'PathOnClient', 'FileExtension', 'PublishStatus', 'SharingOption', 'VersionNumber', 'IsAssetEnabled', 'IsMajorVersion', 'SystemModstamp', 'ContentLocation', 'ReasonForChange', 'LastModifiedById', 'LastModifiedDate', 'ContentDocumentId', 'ContentModifiedById', 'ContentModifiedDate', 'FeaturedContentDate', 'NegativeRatingCount', 'PositiveRatingCount', 'ExternalDataSourceId', 'FeaturedContentBoost', 'ExternalDocumentInfo1', 'ExternalDocumentInfo2', 'FirstPublishLocationId']; } /** * Get the subscription context. * * @returns {types.Context} */ getContext(): types.Context { return { name: 'salesforce', subscription: 'contentVersion', }; } /** * Get the subscription name. * * @returns {String} */ getName(): String { return 'ContentVersion'; } /** * Get the subscription query. * * @returns {String} */ getQuery(): String { const attributes = this.getAttributes().join(', '); const time = this.getLastQueryTime(); return `SELECT ${attributes} FROM ContentVersion WHERE CreatedDate >= ${time}`; } }