@live-change/vote-service 0.3.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/definition.js +11 -0
  2. package/index.js +28 -0
  3. package/package.json +28 -0
package/definition.js ADDED
@@ -0,0 +1,11 @@
1
+ const app = require("@live-change/framework").app()
2
+
3
+ const relationsPlugin = require('@live-change/relations-plugin')
4
+ const accessControlService = require('@live-change/access-control-service')
5
+
6
+ const definition = app.createServiceDefinition({
7
+ name: "vote",
8
+ use: [ relationsPlugin, accessControlService ]
9
+ })
10
+
11
+ module.exports = definition
package/index.js ADDED
@@ -0,0 +1,28 @@
1
+ const App = require("@live-change/framework")
2
+ const app = App.app()
3
+
4
+ const definition = require('./definition.js')
5
+
6
+ const Vote = definition.model({
7
+ name: "Vote",
8
+ sessionOrUserProperty: {
9
+ extendedWith: ['on'],
10
+ ownerReadAccess: () => true,
11
+ ownerWriteAccess: () => true,
12
+ },
13
+ properties: {
14
+ power: {
15
+ type: Number,
16
+ validation: ['nonEmpty'/*, {
17
+ name: 'switchBy',
18
+ prop: 'onType',
19
+ cases: {
20
+ ...definition.config.voteValidators
21
+ }
22
+ }*/],
23
+ defaultValue: 0
24
+ }
25
+ }
26
+ })
27
+
28
+ module.exports = definition
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@live-change/vote-service",
3
+ "version": "0.3.31",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "NODE_ENV=test tape tests/*"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/live-change/live-change-services.git"
12
+ },
13
+ "license": "MIT",
14
+ "bugs": {
15
+ "url": "https://github.com/live-change/live-change-services/issues"
16
+ },
17
+ "homepage": "https://github.com/live-change/live-change-services",
18
+ "author": {
19
+ "email": "michal@laszczewski.pl",
20
+ "name": "Michał Łaszczewski",
21
+ "url": "https://www.viamage.com/"
22
+ },
23
+ "dependencies": {
24
+ "@live-change/framework": "0.7.34",
25
+ "@live-change/relations-plugin": "0.7.34"
26
+ },
27
+ "gitHead": "ab367db8f3b8d25d19adcb6cdc15a9c9e25c6e60"
28
+ }