@nymphjs/server 1.0.0-alpha.1 → 1.0.0-alpha.5

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/CHANGELOG.md CHANGED
@@ -3,6 +3,31 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.0.0-alpha.5](https://github.com/sciactive/nymphjs/compare/v1.0.0-alpha.4...v1.0.0-alpha.5) (2021-09-30)
7
+
8
+ **Note:** Version bump only for package @nymphjs/server
9
+
10
+ # [1.0.0-alpha.4](https://github.com/sciactive/nymphjs/compare/v1.0.0-alpha.3...v1.0.0-alpha.4) (2021-09-27)
11
+
12
+ ### Features
13
+
14
+ - gate UIDs on Tilmeld with config and abilities ([99a9141](https://github.com/sciactive/nymphjs/commit/99a9141cc92fe3d1ad68d21e42de4e9b5493e4d9))
15
+ - use new instances of nymph for server and pubsub requests ([0c18fab](https://github.com/sciactive/nymphjs/commit/0c18faba2b55fe82c16806d221fc54d2cd42c992))
16
+
17
+ # [1.0.0-alpha.3](https://github.com/sciactive/nymphjs/compare/v1.0.0-alpha.2...v1.0.0-alpha.3) (2021-09-22)
18
+
19
+ ### Features
20
+
21
+ - allow multiple instances of Nymph Client ([81eacd7](https://github.com/sciactive/nymphjs/commit/81eacd7caff6f3c209d7d6dbfdac0414a1857c6d))
22
+ - move to fully instance based design, no more globals ([c036220](https://github.com/sciactive/nymphjs/commit/c0362209b90a475b8b85269a829b0ec6bed4465f))
23
+
24
+ # [1.0.0-alpha.2](https://github.com/sciactive/nymphjs/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (2021-09-21)
25
+
26
+ ### Features
27
+
28
+ - allow multiple instances of Nymph, including transactional instances ([8ff8bcf](https://github.com/sciactive/nymphjs/commit/8ff8bcf4d549998faa2b3d86440394d75bcdc202))
29
+ - support qref queries from the client ([3c8bef0](https://github.com/sciactive/nymphjs/commit/3c8bef0251111983b06eb13ad42a2afef80a1446))
30
+
6
31
  # 1.0.0-alpha.1 (2021-09-06)
7
32
 
8
33
  ### Bug Fixes
package/README.md CHANGED
@@ -16,25 +16,27 @@ You need to install Express, Nymph, and a Nymph driver, then you can use the RES
16
16
 
17
17
  ```ts
18
18
  import express from 'express';
19
+ import { Nymph } from '@nymphjs/nymph';
19
20
  import SQLite3Driver from '@nymphjs/driver-sqlite3';
20
- import Nymph from '@nymphjs/nymph';
21
- import rest from '@nymphjs/server';
21
+ import createServer from '@nymphjs/server';
22
22
 
23
23
  // Import all the entities you will be using on the server.
24
- import './entities/MyEntity';
24
+ import MyEntity from './entities/MyEntity';
25
25
 
26
26
  // Configure Nymph.
27
- const sqliteConfig = {
28
- filename: ':memory:',
29
- };
30
-
31
- Nymph.init({}, new SQLite3Driver(sqliteConfig));
27
+ const nymph = new Nymph(
28
+ {},
29
+ new SQLite3Driver({
30
+ filename: ':memory:',
31
+ })
32
+ );
33
+ nymph.addEntityClass(MyEntity);
32
34
 
33
35
  // Create your Express app.
34
36
  const app = express();
35
37
 
36
- // Use the REST server (with an optional path).
37
- app.use('/rest', rest);
38
+ // Create and use the REST server (with an optional path).
39
+ app.use('/rest', createServer(nymph));
38
40
 
39
41
  // Do anything else you need to do...
40
42
 
@@ -49,11 +51,14 @@ Now you can configure your client using your server's address (and the optional
49
51
  ```ts
50
52
  import { Nymph } from '@nymphjs/client';
51
53
 
52
- Nymph.init({
54
+ import MyEntity from './entities/MyEntityClient';
55
+
56
+ const nymph = new Nymph({
53
57
  // You should configure your Express server to
54
58
  // use HTTPS, but you don't have to.
55
59
  restUrl: 'https://mydomain.tld/rest',
56
60
  });
61
+ nymph.addEntityClass(MyEntity);
57
62
  ```
58
63
 
59
64
  # License
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const rest: import("express-serve-static-core").Express;
2
- export default rest;
1
+ import { Nymph } from '@nymphjs/nymph';
2
+ export default function createServer(nymph: Nymph): import("express-serve-static-core").Express;