Skip to content

Commit

Permalink
feat: Add new SSAI attributes (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulk4633 authored Oct 2, 2024
1 parent a637b24 commit 388f08d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Development

### Added

- SSAI attributes

## 1.2.0

### Fix
Expand Down
7 changes: 7 additions & 0 deletions src/types/queryAdAttributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ import { SelectableValue } from '@grafana/data';

const QUERY_AD_ATTRIBUTES = [
'ADVERTISER_NAME',
'AD_ABANDONMENT_RATE',
'AD_CLICKTHROUGH_URL',
'AD_DESCRIPTION',
'AD_DURATION',
'AD_FALLBACK_INDEX',
'AD_ID',
'AD_ID_PLAYER',
'AD_IMPRESSION_ID',
'AD_INDEX',
'AD_IS_PERSISTENT',
'AD_MODULE',
'AD_OFFSET',
Expand All @@ -27,6 +29,7 @@ const QUERY_AD_ATTRIBUTES = [
'AD_TAG_TYPE',
'AD_TAG_URL',
'AD_TITLE',
'AD_TYPE',
'AD_WRAPPER_ADS_COUNT',
'ANALYTICS_VERSION',
'APIORG_ID',
Expand All @@ -49,6 +52,7 @@ const QUERY_AD_ATTRIBUTES = [
'CLOSE_PERCENTAGE',
'CLOSE_POSITION',
'COMPLETED',
'COMPLETED_FAILED_BEACON_URL',
'COUNTRY',
'CREATIVE_AD_ID',
'CREATIVE_ID',
Expand Down Expand Up @@ -102,6 +106,7 @@ const QUERY_AD_ATTRIBUTES = [
'MEDIA_SERVER',
'MEDIA_URL',
'MIDPOINT',
'MIDPOINT_FAILED_BEACON_URL',
'MINUTE',
'MIN_SUGGESTED_DURATION',
'MONTH',
Expand All @@ -120,7 +125,9 @@ const QUERY_AD_ATTRIBUTES = [
'PLAYER_VERSION',
'PLAY_PERCENTAGE',
'QUARTILE_1',
'QUARTILE1_FAILED_BEACON_URL',
'QUARTILE_3',
'QUARTILE3_FAILED_BEACON_URL',
'REGION',
'SCREEN_HEIGHT',
'SCREEN_WIDTH',
Expand Down
4 changes: 4 additions & 0 deletions src/types/queryAttributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import { SelectableValue } from '@grafana/data';

const QUERY_ATTRIBUTES = [
'AD',
'AD_ID',
'AD_INDEX',
'AD_POSITION',
'AD_SYSTEM',
'ANALYTICS_VERSION',
'AUDIO_BITRATE',
'AUDIO_CODEC',
Expand Down
4 changes: 4 additions & 0 deletions src/utils/filterUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { QueryAttribute } from '../types/queryAttributes';

const isNullFilter = (filterAttribute: QueryAttribute | QueryAdAttribute): boolean => {
switch (filterAttribute) {
case 'AD_TYPE':
case 'CDN_PROVIDER':
case 'CUSTOM_DATA_1':
case 'CUSTOM_DATA_2':
Expand Down Expand Up @@ -63,6 +64,8 @@ const convertFilterForAds = (rawValue: string, filterAttribute: QueryAdAttribute
case 'IS_LINEAR':
return rawValue === 'true';

case 'AD_INDEX':
case 'AD_TYPE':
case 'AD_STARTUP_TIME':
case 'AD_WRAPPER_ADS_COUNT':
case 'AUDIO_BITRATE':
Expand Down Expand Up @@ -114,6 +117,7 @@ const convertFilter = (rawValue: string, filterAttribute: QueryAttribute) => {
return rawValue === 'true';

case 'AUDIO_BITRATE':
case 'AD_INDEX':
case 'BUFFERED':
case 'CLIENT_TIME':
case 'DOWNLOAD_SPEED':
Expand Down

0 comments on commit 388f08d

Please sign in to comment.