@live-change/security-service 0.3.41 → 0.4.0

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/ban.js CHANGED
@@ -1,7 +1,8 @@
1
- const app = require("@live-change/framework").app()
2
- const definition = require('./definition.js')
3
- const { getClientKeysStrings, multiKeyIndexQuery, fastMultiKeyIndexQuery } = require('./utils.js')
4
- const lcp = require('@live-change/pattern')
1
+ import App from '@live-change/framework'
2
+ const app = App.app()
3
+ import definition from './definition.js'
4
+ import { getClientKeysStrings, multiKeyIndexQuery, fastMultiKeyIndexQuery } from './utils.js'
5
+ import lcp from '@live-change/pattern'
5
6
 
6
7
  const banProperties = {
7
8
  actions: {
@@ -317,4 +318,4 @@ definition.trigger({
317
318
  }
318
319
  })
319
320
 
320
- module.exports = { Ban }
321
+ export { Ban }
package/definition.js CHANGED
@@ -1,7 +1,8 @@
1
- const app = require("@live-change/framework").app()
1
+ import App from '@live-change/framework'
2
+ const app = App.app()
2
3
 
3
4
  const definition = app.createServiceDefinition({
4
5
  name: "security"
5
6
  })
6
7
 
7
- module.exports = definition
8
+ export default definition
package/event.js CHANGED
@@ -1,11 +1,12 @@
1
- const crypto = require('crypto')
2
- const app = require("@live-change/framework").app()
3
- const definition = require('./definition.js')
4
- const { getClientKeysObject, getClientKeysStrings} = require('./utils.js')
1
+ import crypto from 'crypto'
2
+ import App from '@live-change/framework'
3
+ const app = App.app()
4
+ import definition from './definition.js'
5
+ import { getClientKeysObject, getClientKeysStrings} from './utils.js'
5
6
 
6
- const lcp = require('@live-change/pattern')
7
- const lcpDb = require('@live-change/pattern-db')
8
- const { request } = require('http')
7
+ import lcp from '@live-change/pattern'
8
+ import lcpDb from '@live-change/pattern-db'
9
+ import { request } from 'http'
9
10
 
10
11
  const securityPatterns = definition.config?.patterns ?? []
11
12
  const relationsStore = lcpDb.relationsStore(app.dao, app.databaseName, 'security_relations')
package/index.js CHANGED
@@ -1,9 +1,10 @@
1
- const app = require("@live-change/framework").app()
1
+ import App from '@live-change/framework'
2
+ const app = App.app()
2
3
 
3
- const definition = require('./definition.js')
4
+ import definition from './definition.js'
4
5
 
5
- require('./ban.js')
6
- require('./event.js')
7
- require('./secured.js')
6
+ import './ban.js'
7
+ import './event.js'
8
+ import './secured.js'
8
9
 
9
- module.exports = definition
10
+ export default definition
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/security-service",
3
- "version": "0.3.41",
3
+ "version": "0.4.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -20,11 +20,12 @@
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/framework": "0.8.0",
25
26
  "@live-change/pattern": "0.2.1",
26
27
  "@live-change/pattern-db": "0.2.2",
27
28
  "nodemailer": "^6.7.2"
28
29
  },
29
- "gitHead": "cf7a4196465c134c4685571526754330d7c70475"
30
+ "gitHead": "87010b19907140a326943f22cd538eafdc9c28f1"
30
31
  }
package/secured.js CHANGED
@@ -1,6 +1,8 @@
1
- const definition = require('./definition.js')
2
- const { getClientKeysObject, getClientKeysStrings, multiKeyIndexQuery, fastMultiKeyIndexQuery } = require('./utils.js')
3
- const { Ban } = require('./ban.js')
1
+ import definition from './definition.js'
2
+ import {
3
+ getClientKeysObject, getClientKeysStrings, multiKeyIndexQuery, fastMultiKeyIndexQuery
4
+ } from './utils.js'
5
+ import { Ban } from './ban.js'
4
6
 
5
7
  async function getBans(client, actions) {
6
8
  const keys = []
package/utils.js CHANGED
@@ -1,5 +1,6 @@
1
- const app = require("@live-change/framework").app()
2
- const definition = require('./definition.js')
1
+ import App from '@live-change/framework'
2
+ const app = App.app()
3
+ import definition from './definition.js'
3
4
 
4
5
  const clientKeys = definition.config?.clientKeys ?? []
5
6
 
@@ -105,4 +106,4 @@ function getClientKeysObject(client, prefix = '') {
105
106
  }
106
107
  }
107
108
 
108
- module.exports = { multiKeyIndexQuery, fastMultiKeyIndexQuery, getClientKeysStrings, getClientKeysObject }
109
+ export { multiKeyIndexQuery, fastMultiKeyIndexQuery, getClientKeysStrings, getClientKeysObject }