@live-change/password-authentication-service 0.3.40 → 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/change.js CHANGED
@@ -1,6 +1,5 @@
1
- const definition = require('./definition.js')
2
- const config = definition.config
3
- const { PasswordAuthentication, secretProperties } = require('./model.js')
1
+ import definition from './definition.js'
2
+ import { PasswordAuthentication, secretProperties } from './model.js'
4
3
 
5
4
  definition.action({
6
5
  name: 'setPassword',
package/definition.js CHANGED
@@ -1,9 +1,11 @@
1
- const app = require("@live-change/framework").app()
2
- const user = require('@live-change/user-service')
1
+ import App from '@live-change/framework'
2
+ const app = App.app()
3
+ import user from '@live-change/user-service'
4
+ import email from '@live-change/email-service'
3
5
 
4
6
  const definition = app.createServiceDefinition({
5
7
  name: "passwordAuthentication",
6
- use: [ user ]
8
+ use: [ user, email ]
7
9
  })
8
10
 
9
- module.exports = definition
11
+ export default definition
package/index.js CHANGED
@@ -1,13 +1,14 @@
1
- const definition = require('./definition.js')
1
+ import definition from './definition.js'
2
2
 
3
- require('./model.js')
4
- require('./change.js')
5
- require('./signIn.js')
6
- require('./reset.js')
3
+ import './model.js'
4
+ import './change.js'
5
+ import './signIn.js'
6
+ import './reset.js'
7
+
8
+ import passwordValidator from './passwordValidator.js'
7
9
 
8
10
  definition.processor(function(service, app) {
9
- service.validators.password = require('./passwordValidator.js')
11
+ service.validators.password = passwordValidator
10
12
  })
11
13
 
12
-
13
- module.exports = definition
14
+ export default definition
package/model.js CHANGED
@@ -1,5 +1,5 @@
1
- const crypto = require('crypto')
2
- const definition = require('./definition.js')
1
+ import crypto from 'crypto'
2
+ import definition from './definition.js'
3
3
  const config = definition.config
4
4
 
5
5
  const secretProperties = {
@@ -31,4 +31,4 @@ definition.event({
31
31
  }
32
32
  })
33
33
 
34
- module.exports = { PasswordAuthentication, secretProperties }
34
+ export { PasswordAuthentication, secretProperties }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/password-authentication-service",
3
- "version": "0.3.40",
3
+ "version": "0.4.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -20,9 +20,10 @@
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.38",
25
+ "@live-change/framework": "0.8.0",
25
26
  "nodemailer": "^6.7.2"
26
27
  },
27
- "gitHead": "d72cc68ee4c46242e5f6a51c303be4177a1c33cf"
28
+ "gitHead": "87010b19907140a326943f22cd538eafdc9c28f1"
28
29
  }
@@ -1,4 +1,4 @@
1
- module.exports = (settings) => (pass) => {
1
+ export default (settings) => (pass) => {
2
2
  if(!pass) return
3
3
  let digits = /\d/.test(pass)
4
4
  let lower = /[a-z]/.test(pass)
package/reset.js CHANGED
@@ -1,8 +1,9 @@
1
- const app = require("@live-change/framework").app()
2
- const { randomString } = require('@live-change/uid')
3
- const definition = require('./definition.js')
1
+ import App from '@live-change/framework'
2
+ const app = App.app()
3
+ import { randomString } from '@live-change/uid'
4
+ import definition from './definition.js'
4
5
  const config = definition.config
5
- const { PasswordAuthentication, secretProperties } = require('./model.js')
6
+ import { PasswordAuthentication, secretProperties } from './model.js'
6
7
 
7
8
  const User = definition.foreignModel('user', 'User')
8
9
 
package/signIn.js CHANGED
@@ -1,7 +1,7 @@
1
- const definition = require('./definition.js')
1
+ import definition from './definition.js'
2
2
  const config = definition.config
3
3
 
4
- const { PasswordAuthentication, secretProperties } = require('./model.js')
4
+ import { PasswordAuthentication, secretProperties } from './model.js'
5
5
 
6
6
  for(const contactType of config.contactTypes) {
7
7