@enplug/sdk-dashboard
Advanced tools
Comparing version
{ | ||
"name": "@enplug/sdk-dashboard", | ||
"version": "5.2.2-zoning-1", | ||
"version": "5.2.2", | ||
"description": "Enplug Dashboard SDK", | ||
@@ -14,3 +14,3 @@ "main": "./src/index.ts", | ||
"start": "npm-run-all clean lint test", | ||
"publish-dev": "npm run bundle && npm publish --tag dev", | ||
"publish-dev": "npm run bundle:prod && npm publish --tag dev", | ||
"release": "npm run bundle && enplug-release-sdk", | ||
@@ -17,0 +17,0 @@ "release:prod": "npm run bundle:prod && enplug-release-sdk", |
@@ -15,5 +15,3 @@ import { | ||
DefaultAsset, | ||
ZoningAppsResponse, | ||
ZoningSlotInfo, | ||
} from '../types/external-types'; | ||
} from '../types/external-types'; | ||
import { BridgeBase } from './bridge/bridge-base'; | ||
@@ -156,4 +154,3 @@ import { validateArray, validateObject, validateString } from './utils'; | ||
*/ | ||
bulkDeployAssets<T>(assets: Array<Asset<T>>, dialogOptions: DeployDialogOptions = {}) | ||
: Promise<Array<Asset<T>>> { | ||
bulkDeployAssets<T>(assets: Array<Asset<T>>, dialogOptions: DeployDialogOptions = {}): Promise<Array<Asset<T>>> { | ||
validateArray(assets, 'You must provide an array of assets when deploying assets.'); | ||
@@ -300,82 +297,2 @@ validateObject(assets[0], 'You must provide an array of assets (objects) when deploying assets.'); | ||
/** | ||
* Loads list of banner/ticker widget apps | ||
*/ | ||
getZoningApps(): Promise<ZoningAppsResponse> { | ||
return this.bridge.sendMessage({ | ||
namespace: MessageNamespaces.App, | ||
name: MessageNames.GetZoningApps, | ||
}); | ||
} | ||
/** | ||
* Loads widget assets used in a given zoning asset layout | ||
*/ | ||
getZoningLayoutAssets(assetId: string): Promise<Array<Asset<any>>> { | ||
return this.bridge.sendMessage({ | ||
namespace: MessageNamespaces.App, | ||
name: MessageNames.GetZoningLayoutAssets, | ||
params: { | ||
assetId, | ||
}, | ||
}); | ||
} | ||
/** | ||
* Shows modal allowing to pick existing widget or create new | ||
*/ | ||
acquireZoningWidget( | ||
zoningAssetId: string, | ||
zone: 'banner' | 'ticker', zoneInfo: ZoningSlotInfo, | ||
widgetAppId: string, | ||
usedAssetsIds: string[], | ||
): Promise<Asset<any>> { | ||
validateString(widgetAppId, 'You must provide an widgetAppId parameter'); | ||
validateString(zone, 'You must provide an zone parameter'); | ||
validateObject(zoneInfo, 'You must provide a zoneInfo parameter'); | ||
return this.bridge.sendMessage({ | ||
namespace: MessageNamespaces.App, | ||
name: MessageNames.AcquireZoningWidget, | ||
params: { | ||
widgetAppId, | ||
zoningAssetId, | ||
zone, | ||
zoneInfo, | ||
usedAssetsIds, | ||
}, | ||
}); | ||
} | ||
/** | ||
* Fetches zoning data available after adding/editing a widget | ||
*/ | ||
editZoningWidget( | ||
zoningAssetId: string, | ||
zone: 'banner' | 'ticker', zoneInfo: ZoningSlotInfo, | ||
widgetAppId: string, widgetAssetId: string, | ||
): Promise<any> { | ||
return this.bridge.sendMessage({ | ||
namespace: MessageNamespaces.App, | ||
name: MessageNames.EditZoningWidget, | ||
params: { | ||
widgetAppId, | ||
zoningAssetId, | ||
widgetAssetId, | ||
zone, | ||
zoneInfo, | ||
}, | ||
}); | ||
} | ||
/** | ||
* Fetches zoning data available after adding/editing a widget | ||
*/ | ||
getZoningData(): Promise<any> { | ||
return this.bridge.sendMessage({ | ||
namespace: MessageNamespaces.App, | ||
name: MessageNames.GetZoningData, | ||
}); | ||
} | ||
/** | ||
* Loads available fonts for the current app or for specified appId. | ||
@@ -436,11 +353,9 @@ * @param {string?} appId | ||
*/ | ||
editTheme<AssetValue, FeedType>( | ||
themeDefinition: ThemeDefinition, | ||
theme: ThemeAsset<any>, | ||
previewUrl: string, | ||
previewAsset?: Array<Asset<AssetValue>>, | ||
layout?: Layout, | ||
fonts?: FontDefinition[], | ||
feedData?: FeedData<FeedType>, | ||
): Promise<ThemeAsset<AssetValue>> { | ||
editTheme<AssetValue, FeedType>(themeDefinition: ThemeDefinition, | ||
theme: ThemeAsset<any>, | ||
previewUrl: string, | ||
previewAsset?: Array<Asset<AssetValue>>, | ||
layout?: Layout, | ||
fonts?: FontDefinition[], | ||
feedData?: FeedData<FeedType>): Promise<ThemeAsset<AssetValue>> { | ||
validateObject(themeDefinition, 'You must provide the theme definition (object).'); | ||
@@ -510,16 +425,2 @@ | ||
} | ||
/** | ||
* Updates dashboard window url without reloading the page | ||
*/ | ||
appUrlChanged(appPath: string): Promise<any> { | ||
validateString(appPath, 'You must provide the appPath (string).'); | ||
return this.bridge.sendMessage({ | ||
namespace: MessageNamespaces.App, | ||
name: MessageNames.AppUrlChanged, | ||
params: { | ||
appPath, | ||
}, | ||
}); | ||
} | ||
} |
@@ -14,4 +14,3 @@ import { | ||
DataConnectionConfig, | ||
AssetPreviewRequest, | ||
} from '../types/external-types'; | ||
} from '../types/external-types'; | ||
import { BridgeBase } from './bridge/bridge-base'; | ||
@@ -135,11 +134,2 @@ import { validateArray, validateBool, validateFunction, validateObject, validateString } from './utils'; | ||
// TODO | ||
navigateToZoning(assetId?: string): Promise<any> { | ||
return this.bridge.sendMessage({ | ||
namespace: MessageNamespaces.Dashboard, | ||
name: MessageNames.NavigateToZoning, | ||
params: { assetId }, | ||
}); | ||
} | ||
/** | ||
@@ -155,4 +145,4 @@ * Opens a confirm window with Yes/No buttons and configurable messages. | ||
if (options) { | ||
validateString(options.title, 'Confirm box requires options.title to be set (string).'); | ||
validateString(options.text, 'Confirm box requires options.text to be set (string).'); | ||
validateString(options.title, 'Confirm box requires options.title to be set (string).'); | ||
validateString(options.text, 'Confirm box requires options.text to be set (string).'); | ||
} | ||
@@ -216,8 +206,7 @@ | ||
*/ | ||
preview<AssetValue, ThemeValue, FeedType>( | ||
url: string, | ||
asset: Asset<AssetValue>, | ||
theme: ThemeAsset<ThemeValue>, | ||
layout?: Layout, | ||
feedData?: FeedData<FeedType>): Promise<any> { | ||
preview<AssetValue, ThemeValue, FeedType>(url: string, | ||
asset: Asset<AssetValue>, | ||
theme: ThemeAsset<ThemeValue>, | ||
layout?: Layout, | ||
feedData?: FeedData<FeedType>): Promise<any> { | ||
return this.bridge.sendMessage({ | ||
@@ -237,38 +226,2 @@ namespace: MessageNamespaces.Dashboard, | ||
/** | ||
* todo | ||
*/ | ||
previewAsset<TAssetValue = any, TThemeValue = any, TFeedType = any>( | ||
request: AssetPreviewRequest<TAssetValue, TThemeValue, TFeedType>): Promise<any> { | ||
return this.bridge.sendMessage({ | ||
namespace: MessageNamespaces.Dashboard, | ||
name: MessageNames.PreviewAsset, | ||
params: { ...request }, | ||
}); | ||
} | ||
/** | ||
* todo | ||
*/ | ||
getAssetPreviewData(appId: string, asset: Asset<any>, origin: string) | ||
: Promise<{ | ||
previewType: 'app' | 'graphics' | 'video' | 'url', | ||
previewUrl: string, theme: any, feedData: any, locale: string, | ||
}> { | ||
validateString(appId, 'appId must be a string.'); | ||
validateObject(asset, 'asset must be an instance of Asset<any>.'); | ||
validateString(origin, 'origin must be a string.'); | ||
return this.bridge.sendMessage({ | ||
namespace: MessageNamespaces.Dashboard, | ||
name: MessageNames.GetAssetPreviewData, | ||
params: { | ||
appId, | ||
asset, | ||
origin, | ||
}, | ||
}); | ||
} | ||
/** | ||
* Sets the current callback for the title bar breadcrumb display selector dropdown. | ||
@@ -328,3 +281,3 @@ * Attaching a callback enables the dropdown, it is disabled by default. | ||
// Reset current buttons. | ||
this.currentButtons = {}; | ||
this.currentButtons = { }; | ||
@@ -435,4 +388,3 @@ buttons = Array.isArray(buttons) ? buttons : [buttons]; | ||
*/ | ||
processAssetResource<T>(accountId: string, appId: string, assets: Array<Asset<T>>) | ||
: Promise<any> { | ||
processAssetResource<T>(accountId: string, appId: string, assets: Array<Asset<T>>): Promise<any> { | ||
validateString(accountId, 'You must provide the accountId (string).'); | ||
@@ -439,0 +391,0 @@ validateString(appId, 'You must provide the appId (string).'); |
@@ -109,7 +109,2 @@ /** | ||
GetDefaultAssets = 'app.getDefaultAssets', | ||
GetZoningApps = 'app.getZoningApps', | ||
AcquireZoningWidget = 'app.acquireZoningWidget', | ||
GetZoningData = 'app.getZoningData', | ||
EditZoningWidget = 'app.editZoningWidget', | ||
GetZoningLayoutAssets = 'app.getZoningLayoutAssets', | ||
GetFonts = 'app.getFonts', | ||
@@ -122,3 +117,2 @@ GetThemes = 'app.getThemes', | ||
HasFeatureFlag = 'app.hasFeatureFlag', | ||
AppUrlChanged = 'app.appUrlChanged', | ||
Click = 'dashboard.click', | ||
@@ -130,3 +124,2 @@ ConfirmUnsavedChanges = 'dashboard.unsavedChanges', | ||
NavigateBack = 'dashboard.navigateBack', | ||
NavigateToZoning = 'dashboard.navigateToZoning', | ||
OpenConfirm = 'dashboard.confirm', | ||
@@ -137,4 +130,2 @@ PageError = 'dashboard.page.error', | ||
Preview = 'dashboard.preview', | ||
GetAssetPreviewData = 'dashboard.getAssetPreviewData', | ||
PreviewAsset = 'dashboard.previewAsset', | ||
SetDisplaySelectorCallback = 'dashboard.set.selectorCallback', | ||
@@ -141,0 +132,0 @@ SetDisplaySelectorVisibility = 'dashboard.set.selectorEnabled', |
@@ -7,15 +7,25 @@ /** These are meant to avaialable to client apps */ | ||
export interface BaseAsset<T> { | ||
/** WCF date = "/Date(137...)/" */ | ||
/** | ||
* WCF date = "/Date(137...)/" | ||
*/ | ||
Created?: string; | ||
/** Duration of play in seconds. */ | ||
/** | ||
* Duration of play in seconds. | ||
*/ | ||
Duration?: number; | ||
/** Asset ID */ | ||
/** | ||
* Asset ID | ||
*/ | ||
Id: string | null; | ||
/** Details of play schedule. */ | ||
/** | ||
* Details of play schedule. | ||
*/ | ||
Schedule?: Schedule; | ||
/** Value object provided when created. NOTE: Only objects allowed. */ | ||
/** | ||
* Value object provided when created. NOTE: Only objects allowed. | ||
*/ | ||
Value: T; | ||
@@ -27,37 +37,13 @@ | ||
/** Optional Theme Id if set */ | ||
/** | ||
* Optional Theme Id if set | ||
*/ | ||
ThemeId?: string; | ||
/** Optional, used when user is in the content approval flow */ | ||
/** | ||
* Optional, used when user is in the content approval flow | ||
*/ | ||
NeedsApproval?: boolean; | ||
} | ||
export interface Asset<T> extends BaseAsset<T> { | ||
/** Array of Ids of Display Groups this asset is currently deployed to */ | ||
VenueIds: string[]; | ||
/** Position within app's list of assets on a display group or in the library */ | ||
Order?: number; | ||
/** Asset version in the Content Approval flow */ | ||
Version?: number; | ||
IsZoningWidget?: boolean; | ||
/** Currently @ Value.Name - subject to change. Display name of the asset. used in lists. */ | ||
Name?: string; | ||
/** Currently @ Value.Zone - subject to change. Zoning widget asset slot type */ | ||
Zone?: 'banner' | 'ticker'; | ||
/** List of zoning assets on which the obj - a widget asset is placed */ | ||
ZoningAssetIds?: string[]; | ||
} | ||
export interface DefaultAsset<T> extends BaseAsset<T> { | ||
Level: DefaultAssetLevel; | ||
LevelId?: string; | ||
DeployedId?: string; | ||
} | ||
export interface AssetDataBackendValue { | ||
@@ -83,6 +69,4 @@ AssetId?: string; | ||
export interface DataBoundScheduleBackend { | ||
/** .NET TimeSpan */ | ||
Start: string; | ||
/** .NET TimeSpan */ | ||
EndAfter: string; | ||
Start: string; // .NET TimeSpan | ||
EndAfter: string; // .NET TimeSpan | ||
Yearly: boolean; | ||
@@ -127,24 +111,31 @@ } | ||
export interface Schedule { | ||
/** "2019-03-27T00:00:00" */ | ||
ActivationDate?: string; | ||
export interface Asset<T> extends BaseAsset<T> { | ||
/** | ||
* Array of Ids of Display Groups this asset is currently deployed to | ||
*/ | ||
VenueIds: string[]; | ||
/** Limit days */ | ||
ActiveDays: string[]; | ||
/** | ||
* Asset version in the Content Approval flow | ||
*/ | ||
Version?: number; | ||
} | ||
/** WCF date */ | ||
Created: string; | ||
export interface DefaultAsset<T> extends BaseAsset<T> { | ||
Level: DefaultAssetLevel; | ||
LevelId?: string; | ||
DeployedId?: string; | ||
} | ||
export interface Schedule { | ||
ActivationDate?: string; // "2019-03-27T00:00:00" | ||
ActiveDays: string[]; // Limit days | ||
Created: string; // WCF date | ||
DeleteWhenExpired: boolean; | ||
ExpirationCount: number; | ||
/** "2019-03-27T00:00:00" */ | ||
ExpirationDate: string; | ||
/** Schedule ID */ | ||
Id: string; | ||
ExpirationDate: string; // "2019-03-27T00:00:00" | ||
Id: string; // Schedule ID | ||
IsDeleted: boolean; | ||
IsPriority: boolean; | ||
/** WCF date */ | ||
LastSaved: string; | ||
LastSaved: string; // WCF date | ||
PlayTimes: TimeRange[]; | ||
@@ -155,6 +146,4 @@ Recurrence: number; | ||
export interface TimeRange { | ||
/** "09:00:00" */ | ||
StartTime: string; | ||
/** "22:59:00" */ | ||
EndTime: string; | ||
StartTime: string; // "09:00:00" | ||
EndTime: string; // "22:59:00" | ||
} | ||
@@ -211,19 +200,2 @@ | ||
export interface AssetPreviewRequest<TAssetValue, TThemeValue, TFeedType> { | ||
url?: string; // ? is ignored anyways | ||
asset: Asset<TAssetValue>; | ||
theme?: ThemeAsset<TThemeValue>; | ||
feedData?: FeedData<TFeedType>; | ||
layout?: Layout; | ||
zoningConfig?: ZoningConfig; | ||
} | ||
export interface ZoningConfig { | ||
zoning: 'banner' | 'ticker' | 'elevator'; | ||
ratioWidth: number; | ||
ratioHeight: number; | ||
width: number; | ||
height: number; | ||
} | ||
export interface FeedData<T> { | ||
@@ -312,4 +284,3 @@ socialItems?: any[]; | ||
uploadSourceAppId?: string; | ||
/** forceCrop should be used together with isMultipleSelection = false */ | ||
forceCrop?: boolean; | ||
forceCrop?: boolean; // forceCrop should be used together with isMultipleSelection = false | ||
cropForceAspectRatio?: number; | ||
@@ -355,21 +326,16 @@ cropMaximumImageWidth?: number; | ||
export interface EnplugUser { | ||
/** User id in the system */ | ||
id: string; | ||
/** Current user's account ID */ | ||
accountId: string; | ||
/** User access type */ | ||
type: string; | ||
id: string; // User id in the system | ||
accountId: string; // Current user's account ID | ||
type: string; // User access type | ||
data: { | ||
email: string; | ||
firstName: string; | ||
lastName: string; | ||
accountName: string; | ||
locale: string; | ||
accountStatus: string; | ||
email: string; | ||
firstName: string; | ||
lastName: string; | ||
accountName: string; | ||
locale: string; | ||
accountStatus: string; | ||
}; | ||
has: { | ||
rootAccess: boolean; | ||
limitedAccess: boolean; | ||
rootAccess: boolean; | ||
limitedAccess: boolean; | ||
}; | ||
@@ -379,7 +345,4 @@ } | ||
export interface DisplayGroup { | ||
/** e.g. English, Russian, French */ | ||
language: string; | ||
/** Landscape or Portrait */ | ||
orientation: string; | ||
language: string; // e.g. English, Russian, French | ||
orientation: string; // Landscape or Portrait | ||
timezone: string; | ||
@@ -389,6 +352,10 @@ } | ||
export interface DeployDialogOptions { | ||
/** Whether to show the schedule tab in the dialog. */ | ||
/** | ||
* Whether to show the schedule tab in the dialog. | ||
*/ | ||
showSchedule?: boolean; | ||
/** Schedule tab options. Relevant if `showSchedule` is true. */ | ||
/** | ||
* Schedule tab options. Relevant if `showSchedule` is true. | ||
*/ | ||
scheduleOptions?: { | ||
@@ -399,33 +366,33 @@ /** | ||
*/ | ||
showDuration?: boolean; | ||
showDuration: boolean; | ||
showLimitDays?: boolean; | ||
showLimitTime?: boolean; | ||
showScheduleForLater?: boolean; | ||
/** allow user to choose the schedule repeat options */ | ||
/** | ||
* allow user to choose the schedule repeat options | ||
*/ | ||
showRepeat?: boolean; | ||
/** allow user to edit Priotiy Play flag */ | ||
/** | ||
* allow user to edit Priotiy Play flag | ||
*/ | ||
showPriorityPlay?: boolean; | ||
/** Graphics app only this one */ | ||
/** | ||
* Graphics app only this one | ||
*/ | ||
setDefaultDurationForNewImages?: boolean; | ||
}; | ||
singleton?: boolean; | ||
isNew?: boolean; | ||
/** | ||
* Whether only one app-asset can be deployed to a Display Group | ||
* When `true` disables Display Groups with assets from the current app deployed | ||
* by default, other option is 'schedule' | ||
*/ | ||
singleton?: boolean; | ||
isNew?: boolean; | ||
/** by default, other option is 'schedule' */ | ||
initialTab?: string; | ||
/** Message to show when the save is successful */ | ||
/** | ||
* Message to show when the save is successful | ||
*/ | ||
successMessage?: string; | ||
/** Message to show while the save call is in progress */ | ||
/** | ||
* Message to show while the save call is in progress | ||
*/ | ||
loadingMessage?: string; | ||
/** | ||
@@ -436,23 +403,29 @@ * To force showing the DeployDialog when updating existing asset. | ||
showDeployDialog?: boolean; | ||
noDialog?: boolean; | ||
/** asset.Value props to validate */ | ||
/** | ||
* asset.Value props to validate | ||
*/ | ||
requiredAssetProps?: string[]; | ||
/** allow user to edit assets' tags */ | ||
/** | ||
* allow user to edit assets' tags | ||
*/ | ||
showTagsEditor?: boolean; | ||
/** Graphics and Arts app only this one - list of assets to traverse with < > buttons */ | ||
/** | ||
* Graphics and Arts app only this one - list of assets to traverse with < > buttons | ||
*/ | ||
assetsToNavigate?: Array<Asset<any>>; | ||
/** Graphics and Arts app only use this one */ | ||
/** | ||
* Graphics and Arts app only use this one | ||
*/ | ||
canNavigate?: boolean; | ||
/** Graphics and Arts app only use this one */ | ||
/** | ||
* Graphics and Arts app only use this one | ||
*/ | ||
showDetails?: boolean; | ||
/** The type of presented asset */ | ||
/** | ||
* The type of presented asset | ||
*/ | ||
detailsType?: 'graphic' | 'art'; | ||
/** Graphics and Arts app only use this one */ | ||
/** | ||
* Graphics and Arts app only use this one | ||
*/ | ||
showReporting?: boolean; | ||
@@ -463,49 +436,49 @@ } | ||
export interface FacebookAuthParams { | ||
FeedId: string; | ||
AdminAccessToken: string; | ||
PageId: string; | ||
FeedId: string; | ||
AdminAccessToken: string; | ||
PageId: string; | ||
} | ||
export interface TwitterSubscriptionStatusResponse { | ||
UsedFollows: string[]; | ||
UsedTracks: string[]; | ||
AllowedFollows: 0; | ||
AllowedTracks: 0; | ||
UsedFollows: string[]; | ||
UsedTracks: string[]; | ||
AllowedFollows: 0; | ||
AllowedTracks: 0; | ||
} | ||
export interface SocialItemMedia { | ||
Source: string; | ||
Type: string; | ||
Source: string; | ||
Type: string; | ||
} | ||
export interface SocialItemUser { | ||
Avatar: string; | ||
Link: string; | ||
Name: string; | ||
Avatar: string; | ||
Link: string; | ||
Name: string; | ||
} | ||
export interface SocialItem { | ||
Created: Date; | ||
FlaggedWords: any[]; | ||
Id: string; | ||
IsFavorited: boolean; | ||
Link: string; | ||
Media: SocialItemMedia; | ||
SocialItemId: string; | ||
SocialNetwork: string; | ||
Text: string; | ||
User: EnplugUser; | ||
Created: Date; | ||
FlaggedWords: any[]; | ||
Id: string; | ||
IsFavorited: boolean; | ||
Link: string; | ||
Media: SocialItemMedia; | ||
SocialItemId: string; | ||
SocialNetwork: string; | ||
Text: string; | ||
User: EnplugUser; | ||
} | ||
export interface SocialItemsResponse { | ||
__type: string; | ||
LiveItems: SocialItem[]; | ||
PendingItems: SocialItem[]; | ||
SocialNetworks: string[]; | ||
__type: string; | ||
LiveItems: SocialItem[]; | ||
PendingItems: SocialItem[]; | ||
SocialNetworks: string[]; | ||
} | ||
export interface PreapprovalDialogOptions { | ||
showVideoEnabled?: boolean; | ||
showImagesEnabled?: boolean; | ||
showConnectedUserNeedsApproval?: boolean; | ||
showVideoEnabled?: boolean; | ||
showImagesEnabled?: boolean; | ||
showConnectedUserNeedsApproval?: boolean; | ||
} | ||
@@ -566,4 +539,4 @@ | ||
// tslint:disable: no-empty-interface | ||
export interface ConnectionQueryParams extends ConnectionParams { } | ||
export interface ConnectionHttpHeaders extends ConnectionParams { } | ||
export interface ConnectionQueryParams extends ConnectionParams {} | ||
export interface ConnectionHttpHeaders extends ConnectionParams {} | ||
@@ -593,19 +566,1 @@ export type RefreshFrequency = 1 | 5 | 10 | 30; | ||
} | ||
export interface ZoningAppsResponse { | ||
BannerApps: ZoningApp[]; | ||
TickerApps: ZoningApp[]; | ||
} | ||
export interface ZoningApp { | ||
AppId: string; | ||
ConfigureUrl: string; | ||
Name: string; | ||
} | ||
export interface ZoningSlotInfo { | ||
width: number; | ||
height: number; | ||
ratioW: number; | ||
ratioH: number; | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
-50%203073
-8.49%3241
-8.37%