@live-change/agreement-service 0.8.109

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.
package/agreement.js ADDED
@@ -0,0 +1,35 @@
1
+ import App from '@live-change/framework'
2
+ const app = App.app()
3
+
4
+ import definition from './definition.js'
5
+ import config from './config.js'
6
+
7
+ const Agreement = definition.model({
8
+ name: "Agreement",
9
+ sessionOrUserProperty: {
10
+ ownerReadAccess: () => true,
11
+ ownerWriteAccess: () => true,
12
+ },
13
+ properties: {
14
+ ...(
15
+ Object.fromEntries(
16
+ config.agreements
17
+ .map((agreement) => [agreement, {
18
+ type: Object,
19
+ softValidation: ['nonEmpty'],
20
+ default: false,
21
+ }])
22
+ )
23
+ ),
24
+ updatedAt: {
25
+ type: Date,
26
+ updated: () => new Date(),
27
+ },
28
+ createdAt: {
29
+ type: Date,
30
+ default: () => new Date(),
31
+ },
32
+ },
33
+ })
34
+
35
+ export { Agreement }
package/config.js ADDED
@@ -0,0 +1,15 @@
1
+ import definition from './definition.js'
2
+
3
+ const {
4
+ agreements = ['privacyPolicy', 'termsOfService']
5
+ } = definition.config
6
+
7
+ definition.clientConfig = {
8
+ agreements
9
+ }
10
+
11
+ const config = {
12
+ agreements
13
+ }
14
+
15
+ export default config
package/definition.js ADDED
@@ -0,0 +1,13 @@
1
+ import App from '@live-change/framework'
2
+ const app = App.app()
3
+
4
+ import userService from '@live-change/user-service'
5
+ import relationsPlugin from '@live-change/relations-plugin'
6
+ import accessControlService from '@live-change/access-control-service'
7
+
8
+ const definition = app.createServiceDefinition({
9
+ name: "agreement",
10
+ use: [ userService, relationsPlugin, accessControlService ]
11
+ })
12
+
13
+ export default definition
package/index.js ADDED
@@ -0,0 +1,8 @@
1
+ import App from '@live-change/framework'
2
+ const app = App.app()
3
+
4
+ import definition from './definition.js'
5
+
6
+ import './agreement.js'
7
+
8
+ export default definition
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@live-change/agreement-service",
3
+ "version": "0.8.109",
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-stack.git"
12
+ },
13
+ "license": "MIT",
14
+ "bugs": {
15
+ "url": "https://github.com/live-change/live-change-stack/issues"
16
+ },
17
+ "homepage": "https://github.com/live-change/live-change-stack",
18
+ "author": {
19
+ "email": "michal@laszczewski.pl",
20
+ "name": "Michał Łaszczewski",
21
+ "url": "https://www.viamage.com/"
22
+ },
23
+ "dependencies": {
24
+ "@live-change/access-control-service": "^0.8.109",
25
+ "@live-change/framework": "^0.8.109",
26
+ "@live-change/relations-plugin": "^0.8.109",
27
+ "@live-change/user-service": "^0.8.109"
28
+ },
29
+ "gitHead": "075bf3759fae6c40fb8e44d77d9f12c5c175e098",
30
+ "type": "module"
31
+ }