UNPKG

@mediarithmics/plugins-nodejs-sdk

Version:

This is the mediarithmics nodejs to help plugin developers bootstrapping their plugin without having to deal with most of the plugin boilerplate

90 lines (89 loc) 4.51 kB
import { Option } from '../../../utils'; import { AdLayoutPropertyResource, AssetFilePropertyResource, AssetFolderPropertyResource, BooleanPropertyResource, DataFilePropertyResource, DoublePropertyResource, IntPropertyResource, NativeDataPropertyResource, NativeImagePropertyResource, NativeTitlePropertyResource, PixelTagPropertyResource, RecommenderPropertyResource, StringPropertyResource, StyleSheetPropertyResource, UrlPropertyResource } from './ValueInterface'; export interface PluginPropertyResponse { status: string; data: PluginProperty[]; count: number; } export type PluginProperty = AssetFileProperty | AssetFolderProperty | DataFileProperty | UrlProperty | StringProperty | AdLayoutProperty | StyleSheetProperty | PixelTagProperty | DoubleProperty | BooleanProperty | IntProperty | RecommenderProperty | NativeDataProperty | NativeTitleProperty | NativeImageProperty; export type PropertyType = 'ASSET' | 'ASSET_FOLDER' | 'ASSET_FILE' | 'DATA_FILE' | 'URL' | 'STRING' | 'AD_LAYOUT' | 'STYLE_SHEET' | 'PIXEL_TAG' | 'DOUBLE' | 'BOOLEAN' | 'INT' | 'RECOMMENDER' | 'NATIVE_DATA' | 'NATIVE_TITLE' | 'NATIVE_IMAGE'; export type PropertyOrigin = 'PLUGIN_STATIC' | 'PLUGIN' | 'INSTANCE'; export interface AbstractProperty { technical_name: string; origin: PropertyOrigin; writable: boolean; deletable: boolean; } export interface AssetFileProperty extends AbstractProperty { property_type: 'ASSET_FILE' | 'ASSET'; value: AssetFilePropertyResource; } export interface AssetFolderProperty extends AbstractProperty { property_type: 'ASSET_FOLDER'; value: AssetFolderPropertyResource; } export interface DataFileProperty extends AbstractProperty { property_type: 'DATA_FILE'; value: DataFilePropertyResource; } export interface UrlProperty extends AbstractProperty { property_type: 'URL'; value: UrlPropertyResource; } export interface StringProperty extends AbstractProperty { property_type: 'STRING'; value: StringPropertyResource; } export interface AdLayoutProperty extends AbstractProperty { property_type: 'AD_LAYOUT'; value: AdLayoutPropertyResource; } export interface StyleSheetProperty extends AbstractProperty { property_type: 'STYLE_SHEET'; value: StyleSheetPropertyResource; } export interface PixelTagProperty extends AbstractProperty { property_type: 'PIXEL_TAG'; value: PixelTagPropertyResource; } export interface DoubleProperty extends AbstractProperty { property_type: 'DOUBLE'; value: DoublePropertyResource; } export interface BooleanProperty extends AbstractProperty { property_type: 'BOOLEAN'; value: BooleanPropertyResource; } export interface IntProperty extends AbstractProperty { property_type: 'INT'; value: IntPropertyResource; } export interface RecommenderProperty extends AbstractProperty { property_type: 'RECOMMENDER'; value: RecommenderPropertyResource; } export interface NativeDataProperty extends AbstractProperty { property_type: 'NATIVE_DATA'; value: NativeDataPropertyResource; } export interface NativeTitleProperty extends AbstractProperty { property_type: 'NATIVE_TITLE'; value: NativeTitlePropertyResource; } export interface NativeImageProperty extends AbstractProperty { property_type: 'NATIVE_IMAGE'; value: NativeImagePropertyResource; } export declare const asBooleanProperty: (p: PluginProperty) => Option<BooleanProperty>; export declare const asAssetFileProperty: (p: PluginProperty) => Option<AssetFileProperty>; export declare const asAssetFolderProperty: (p: PluginProperty) => Option<AssetFolderProperty>; export declare const asDataFileProperty: (p: PluginProperty) => Option<DataFileProperty>; export declare const asAdLayoutProperty: (p: PluginProperty) => Option<AdLayoutProperty>; export declare const asUrlProperty: (p: PluginProperty) => Option<UrlProperty>; export declare const asRecommenderProperty: (p: PluginProperty) => Option<RecommenderProperty>; export declare const asStringProperty: (p: PluginProperty) => Option<StringProperty>; export declare const asDoubleProperty: (p: PluginProperty) => Option<DoubleProperty>; export declare const asIntProperty: (p: PluginProperty) => Option<IntProperty>; export declare const asNativeDataProperty: (p: PluginProperty) => Option<NativeDataProperty>; export declare const asNativeTitleProperty: (p: PluginProperty) => Option<NativeTitleProperty>; export declare const asNativeImageProperty: (p: PluginProperty) => Option<NativeImageProperty>;