@eui/cli 17.0.0-rc.6 → 17.0.0-rc.8

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.
@@ -1 +1 @@
1
- 17.0.0-rc.6
1
+ 17.0.0-rc.8
@@ -1,8 +1,6 @@
1
1
  module.exports = {
2
- id: 0,
2
+ userId: '',
3
3
  firstName: '',
4
4
  lastName: '',
5
5
  email: '',
6
- isAdmin: false,
7
- birthdate: null
8
6
  }
@@ -3,7 +3,6 @@ const uuid = require('uuid');
3
3
 
4
4
  module.exports = function (app, db) {
5
5
  db.then(db => {
6
-
7
6
  app.get('/api/user-details', (req, res) => {
8
7
  res.send(db.get('user-details'))
9
8
  });
@@ -12,13 +11,34 @@ module.exports = function (app, db) {
12
11
  res.send(db.get('users'))
13
12
  });
14
13
 
14
+ app.get('/api/users/:userId', (req, res) => {
15
+ res.send(
16
+ db.get('users')
17
+ .find({ userId: req.params.userId })
18
+ );
19
+ });
20
+
21
+ app.put('/api/users/:userId', (req, res) => {
22
+ db.get('users')
23
+ .find({ userId: req.params.userId })
24
+ .assign( { ...req.body } )
25
+ .write()
26
+ .then(user => res.send(user))
27
+ });
28
+
29
+ app.delete('/api/users/:userId', (req, res) => {
30
+ db.get('users')
31
+ .remove({ userId: req.params.userId })
32
+ .write()
33
+ .then(res.send())
34
+ });
35
+
15
36
  app.post('/api/users', (req, res) => {
16
37
  db.get('users')
17
- .push({ ...User, ...req.body, ...{ id: uuid.v1() } })
38
+ .push({ ...User, ...req.body, ...{ userId: uuid.v4() } })
18
39
  .last()
19
40
  .write()
20
41
  .then(user => res.send(user))
21
42
  });
22
-
23
43
  });
24
44
  };
@@ -1,12 +1,10 @@
1
1
  {
2
- "user-details": {
3
- "firstName": "John",
4
- "lastName": "Doe",
5
- "fullName": "John Doe",
6
- "organisationRef": {
7
- "id": "123456", "abbreviation": "DIGIT.B.3"
8
- },
9
- "userId": "doejohn",
10
- "email": "John.DOE@ec.europa.eu"
11
- }
2
+ "user-details": {
3
+ "userId": "doejohn",
4
+ "firstName": "John",
5
+ "lastName": "Doe",
6
+ "email": "John.DOE@ec.europa.eu"
7
+ },
8
+ "users": [
9
+ ]
12
10
  }
@@ -5,14 +5,16 @@ const low = require('lowdb');
5
5
  const FileAsync = require('lowdb/adapters/FileAsync');
6
6
  const adapter = new FileAsync('mock/db/db.json');
7
7
  const db = low(adapter);
8
- const cors = require('cors');
9
8
  const port = 3000;
10
9
 
10
+ app.use(express.json());
11
11
  app.use(bodyParser.urlencoded({ extended: true }));
12
- app.use(cors({
13
- origin: 'http://127.0.0.1:8080', // adapt to your need
14
- credentials: true,
15
- }));
12
+ // const cors = require('cors');
13
+ // if needed to be reached from another localhost server for local testing a distributed app f.e.
14
+ // app.use(cors({
15
+ // origin: 'http://127.0.0.1:8080',
16
+ // credentials: true,
17
+ // }));
16
18
 
17
19
  require('./app/routes')(app, db);
18
20
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eui-angular-app",
3
- "version": "17.0.0-rc.6",
3
+ "version": "17.0.0-rc.8",
4
4
  "license": "EUPL-1.1",
5
5
  "scripts": {
6
6
  "ng": "ng",
@@ -20,6 +20,6 @@
20
20
  },
21
21
  "private": true,
22
22
  "dependencies": {
23
- "@eui/deps-base": "17.0.0-rc.6"
23
+ "@eui/deps-base": "17.0.0-rc.8"
24
24
  }
25
25
  }
@@ -15,5 +15,9 @@ preInitApp(environment).then(() =>
15
15
  .catch((err) => console.error(err))
16
16
  );
17
17
 
18
- // eslint-disable-next-line
19
- (window as any).global = window;
18
+ declare global {
19
+ interface Window {
20
+ global: Window;
21
+ }
22
+ }
23
+ window.global = window;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eui-angular-app",
3
- "version": "17.0.0-rc.6",
3
+ "version": "17.0.0-rc.8",
4
4
  "license": "EUPL-1.1",
5
5
  "scripts": {
6
6
  "ng": "ng",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "private": true,
22
22
  "dependencies": {
23
- "@eui/deps-base": "17.0.0-rc.6",
23
+ "@eui/deps-base": "17.0.0-rc.8",
24
24
  "@eui/mobile-core": "15.1.0",
25
25
  "@eui/mobile-styles": "15.1.0"
26
26
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eui-angular-app",
3
- "version": "17.0.0-rc.6",
3
+ "version": "17.0.0-rc.8",
4
4
  "license": "EUPL-1.1",
5
5
  "scripts": {
6
6
  "ng": "ng",
@@ -21,6 +21,6 @@
21
21
  },
22
22
  "private": true,
23
23
  "dependencies": {
24
- "@eui/deps-base": "17.0.0-rc.6"
24
+ "@eui/deps-base": "17.0.0-rc.8"
25
25
  }
26
26
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eui-angular-app",
3
- "version": "17.0.0-rc.6",
3
+ "version": "17.0.0-rc.8",
4
4
  "license": "EUPL-1.1",
5
5
  "scripts": {
6
6
  "ng": "ng",
@@ -18,6 +18,6 @@
18
18
  },
19
19
  "private": true,
20
20
  "dependencies": {
21
- "@eui/deps-base": "17.0.0-rc.6"
21
+ "@eui/deps-base": "17.0.0-rc.8"
22
22
  }
23
23
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eui-angular-app",
3
- "version": "17.0.0-rc.6",
3
+ "version": "17.0.0-rc.8",
4
4
  "license": "EUPL-1.1",
5
5
  "description": "eUI JEE Symfony app scripts",
6
6
  "scripts": {
@@ -19,6 +19,6 @@
19
19
  },
20
20
  "private": true,
21
21
  "dependencies": {
22
- "@eui/deps-base": "17.0.0-rc.6"
22
+ "@eui/deps-base": "17.0.0-rc.8"
23
23
  }
24
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eui/cli",
3
- "version": "17.0.0-rc.6",
3
+ "version": "17.0.0-rc.8",
4
4
  "tag": "next",
5
5
  "license": "EUPL-1.1",
6
6
  "description": "eUI CLI app generator",