@live-change/session-service 0.3.41 → 0.4.1

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/authenticator.js CHANGED
@@ -1,8 +1,8 @@
1
- const App = require('@live-change/framework')
1
+ import App from '@live-change/framework'
2
2
  const app = App.app()
3
- const definition = require('./definition.js')
4
- const { Session } = require('./model.js')
5
- const { createHmac } = require('crypto')
3
+ import definition from './definition.js'
4
+ import { Session } from './model.js'
5
+ import { createHmac } from 'crypto'
6
6
  const config = definition.config
7
7
 
8
8
  definition.authenticator({
package/definition.js CHANGED
@@ -1,11 +1,11 @@
1
- const App = require("@live-change/framework")
1
+ import App from '@live-change/framework'
2
2
  const app = App.app()
3
3
 
4
- const relationsPlugin = require('@live-change/relations-plugin')
4
+ import relationsPlugin from '@live-change/relations-plugin'
5
5
 
6
6
  const definition = app.createServiceDefinition({
7
7
  name: "session",
8
8
  use: [ relationsPlugin ]
9
9
  })
10
10
 
11
- module.exports = definition
11
+ export default definition
package/index.js CHANGED
@@ -1,7 +1,7 @@
1
- const App = require("@live-change/framework")
1
+ import App from '@live-change/framework'
2
2
  const app = App.app()
3
- const definition = require('./definition.js')
4
- const { Session } = require('./model.js')
3
+ import definition from './definition.js'
4
+ import { Session } from './model.js'
5
5
 
6
6
  definition.view({
7
7
  name: 'currentSession',
@@ -76,9 +76,9 @@ definition.trigger({
76
76
  }
77
77
  })
78
78
 
79
- require('./authenticator.js')
80
- require('./localIdValidator.js')
81
- require('./sessionProperty.js')
82
- require('./sessionItem.js')
79
+ import './authenticator.js'
80
+ import './localIdValidator.js'
81
+ import './sessionProperty.js'
82
+ import './sessionItem.js'
83
83
 
84
- module.exports = definition
84
+ export default definition
@@ -1,8 +1,8 @@
1
- const definition = require("./definition.js")
2
- const { decodeUid } = require("@live-change/uid")
1
+ import definition from './definition.js'
2
+ import { decodeUid } from "@live-change/uid"
3
3
 
4
4
  definition.processor(function(service, app) {
5
-
5
+
6
6
  service.validators.localId = (settings) => (value, context) => {
7
7
  if (!value) return
8
8
  //console.log("VALIDATE LOCAL ID", value, "=>", decodeUid(value), "BY", context.client)
package/model.js CHANGED
@@ -1,4 +1,4 @@
1
- const definition = require("./definition.js")
1
+ import definition from './definition.js'
2
2
 
3
3
  const Session = definition.model({
4
4
  name: "Session",
@@ -32,4 +32,4 @@ definition.event({
32
32
  }
33
33
  })
34
34
 
35
- module.exports = { Session }
35
+ export { Session }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/session-service",
3
- "version": "0.3.41",
3
+ "version": "0.4.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -20,10 +20,11 @@
20
20
  "name": "Michał Łaszczewski",
21
21
  "url": "https://www.viamage.com/"
22
22
  },
23
+ "type": "module",
23
24
  "dependencies": {
24
- "@live-change/framework": "0.7.39",
25
- "@live-change/relations-plugin": "0.7.39",
25
+ "@live-change/framework": "0.8.0",
26
+ "@live-change/relations-plugin": "0.8.0",
26
27
  "pluralize": "^8.0.0"
27
28
  },
28
- "gitHead": "cf7a4196465c134c4685571526754330d7c70475"
29
+ "gitHead": "74215655da2a4bc3ef73c62e5d79d988276165e8"
29
30
  }
package/sessionItem.js CHANGED
@@ -1,9 +1,10 @@
1
- const definition = require("./definition.js")
2
- const App = require("@live-change/framework")
3
- const { PropertyDefinition, ViewDefinition, IndexDefinition, ActionDefinition, EventDefinition } = App
4
- const { Session } = require("./model.js")
1
+ import definition from './definition.js'
2
+ import {
3
+ PropertyDefinition, ViewDefinition, IndexDefinition, ActionDefinition, EventDefinition
4
+ } from '@live-change/framework'
5
+ import { Session } from "./model.js"
5
6
 
6
- const pluralize = require('pluralize')
7
+ import pluralize from 'pluralize'
7
8
 
8
9
  definition.processor(function(service, app) {
9
10
 
@@ -1,7 +1,7 @@
1
- const definition = require("./definition.js")
2
- const App = require("@live-change/framework")
1
+ import definition from './definition.js'
2
+ import App from '@live-change/framework'
3
3
  const { PropertyDefinition, ViewDefinition, IndexDefinition, ActionDefinition, EventDefinition } = App
4
- const { Session } = require("./model.js")
4
+ import { Session } from "./model.js"
5
5
 
6
6
  definition.processor(function(service, app) {
7
7