Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

alaska-banner

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alaska-banner - npm Package Compare versions

Comparing version 0.11.22 to 0.12.0

routes/index.js

9

config/alaska-banner.js

@@ -1,6 +0,9 @@

// @flow
'use strict';
export default {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = {
prefix: '/banner',
controllers: false
};
};

@@ -1,6 +0,12 @@

import { Service } from 'alaska';
'use strict';
class BannerService extends Service {
Object.defineProperty(exports, "__esModule", {
value: true
});
var _alaska = require('alaska');
class BannerService extends _alaska.Service {
constructor(options) {
options = options || {};
options = options || { dir: '', id: '' };
options.dir = options.dir || __dirname;

@@ -12,2 +18,2 @@ options.id = options.id || 'alaska-banner';

export default new BannerService();
exports.default = new BannerService();

@@ -0,3 +1,7 @@

'use strict';
export default {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = {
Banner: 'Banner',

@@ -10,2 +14,2 @@ 'Start At': 'Start At',

Clicks: 'Clicks'
};
};

@@ -0,3 +1,7 @@

'use strict';
export default {
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = {
Banner: '广告图',

@@ -10,2 +14,2 @@ 'Start At': '开始时间',

Clicks: '点击次数'
};
};

@@ -1,102 +0,11 @@

// @flow
'use strict';
import { Model } from 'alaska';
Object.defineProperty(exports, "__esModule", {
value: true
});
export default class Banner extends Model {
static label = 'Banner';
static icon = 'picture-o';
static defaultSort = '-sort';
static defaultColumns = 'pic title position sort clicks activated startAt endAt';
static api = {
list: 1
};
var _alaska = require('alaska');
static defaultFilters = (ctx) => {
if (ctx.service.id === 'alaska-admin') return null;
return {
activated: true,
startAt: { $lte: new Date() },
endAt: { $gte: new Date() }
};
};
class Banner extends _alaska.Model {
static fields = {
title: {
label: 'Title',
type: String,
required: true
},
pic: {
label: 'Picture',
type: 'image'
},
position: {
label: 'Position',
type: 'select',
default: 'default',
options: [{
label: 'Default',
value: 'default'
}]
},
action: {
label: 'Action',
type: 'select',
default: 'url',
options: [{
label: 'URL',
value: 'url'
}]
},
url: {
label: 'URL',
type: String
},
sort: {
label: 'Sort',
type: Number,
default: 0,
private: true
},
clicks: {
label: 'Clicks',
type: Number,
default: 0,
private: true
},
activated: {
label: 'Activated',
type: Boolean,
private: true
},
startAt: {
label: 'Start At',
type: Date,
private: true
},
endAt: {
label: 'End At',
type: Date,
private: true,
index: true
},
createdAt: {
label: 'Created At',
type: Date,
private: true
}
};
title: string;
pic: Object;
position: string;
action: string;
url: string;
sort: number;
clicks: number;
activated: boolean;
startAt: Date;
endAt: Date;
createdAt: Date;
preSave() {

@@ -119,1 +28,85 @@ if (!this.startAt) {

}
exports.default = Banner;
Banner.label = 'Banner';
Banner.icon = 'picture-o';
Banner.defaultSort = '-sort';
Banner.defaultColumns = 'pic title position sort clicks activated startAt endAt';
Banner.api = {
list: 1
};
Banner.defaultFilters = ctx => {
if (ctx.service.id === 'alaska-admin') return null;
return {
activated: true,
startAt: { $lte: new Date() },
endAt: { $gte: new Date() }
};
};
Banner.fields = {
title: {
label: 'Title',
type: String,
required: true
},
pic: {
label: 'Picture',
type: 'image'
},
position: {
label: 'Position',
type: 'select',
default: 'default',
options: [{
label: 'Default',
value: 'default'
}]
},
action: {
label: 'Action',
type: 'select',
default: 'url',
options: [{
label: 'URL',
value: 'url'
}]
},
url: {
label: 'URL',
type: String
},
sort: {
label: 'Sort',
type: Number,
default: 0,
private: true
},
clicks: {
label: 'Clicks',
type: Number,
default: 0,
private: true
},
activated: {
label: 'Activated',
type: Boolean,
private: true
},
startAt: {
label: 'Start At',
type: Date,
private: true
},
endAt: {
label: 'End At',
type: Date,
private: true,
index: true
},
createdAt: {
label: 'Created At',
type: Date,
private: true
}
};
{
"name": "alaska-banner",
"version": "0.11.22",
"version": "0.12.0",
"description": "Alaska banner service",

@@ -9,6 +9,7 @@ "keywords": [

],
"alaska": "service",
"main": "index.js",
"repository": "https://github.com/maichong/alaska/tree/master/packages/alaska-banner",
"repository": "https://github.com/maichong/alaska/tree/master/src/alaska-banner",
"author": "Liang <liang@maichong.it> (https://github.com/liangxingchen)",
"license": "MIT"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc