@nymphjs/client-node 1.0.0-beta.86 → 1.0.0-beta.88

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,16 @@
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-beta.88](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.87...v1.0.0-beta.88) (2025-01-30)
7
+
8
+ **Note:** Version bump only for package @nymphjs/client-node
9
+
10
+ # [1.0.0-beta.87](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.86...v1.0.0-beta.87) (2025-01-20)
11
+
12
+ ### Features
13
+
14
+ - deprecate node client and allow multiple client instances to each log in own users ([17b42f4](https://github.com/sciactive/nymphjs/commit/17b42f449f2355a3ce896b8e86a47edd660e9277))
15
+
6
16
  # [1.0.0-beta.86](https://github.com/sciactive/nymphjs/compare/v1.0.0-beta.85...v1.0.0-beta.86) (2024-12-28)
7
17
 
8
18
  **Note:** Version bump only for package @nymphjs/client-node
package/README.md CHANGED
@@ -2,40 +2,11 @@
2
2
 
3
3
  Powerful object data storage and querying.
4
4
 
5
- The Nymph Node Client lets you do everything the Nymph Client does, but from Node.JS instead of the browser.
6
-
7
- ## Installation
8
-
9
- ```sh
10
- npm install --save @nymphjs/client-node
11
- ```
12
-
13
- This package is the Nymph client for Node.js. You can find ES modules in `dist`, or TS source in `src`. There is also a **[browser client](https://github.com/sciactive/nymphjs/packages/client)**.
14
-
15
- This package provides fetch and WebSocket ponyfills to Nymph and handles Tilmeld auth tokens.
16
-
17
- ## Usage
18
-
19
- To use, require it instead of `@nymphjs/client`:
20
-
21
- ```ts
22
- const { Nymph, PubSub } = require('@nymphjs/client-node');
23
- ```
24
-
25
- Then set up Nymph and PubSub like normal:
26
-
27
- ```ts
28
- const nymphOptions = {
29
- restUrl: 'https://yournymphrestserver/path/to/your/endpoint',
30
- pubsubUrl: 'wss://yournymphpubsubserver',
31
- };
32
- const nymph = new Nymph(nymphOptions);
33
- const pubsub = new PubSub(nymphOptions, nymph);
34
- ```
5
+ This package is no longer needed, because Node.js since version 22 provides both `fetch` and `WebSocket`. Instead, use the [regular Nymph.js client package](https://www.npmjs.com/package/@nymphjs/client).
35
6
 
36
7
  # License
37
8
 
38
- Copyright 2021-2024 SciActive Inc
9
+ Copyright 2021-2025 SciActive Inc
39
10
 
40
11
  Licensed under the Apache License, Version 2.0 (the "License");
41
12
  you may not use this file except in compliance with the License.
package/dist/index.d.ts CHANGED
@@ -1,8 +1,2 @@
1
- import { Nymph, PubSub, type NymphOptions } from '@nymphjs/client';
2
- declare class NodeNymph extends Nymph {
3
- constructor(nymphOptions: NymphOptions);
4
- }
5
- declare class NodePubSub extends PubSub {
6
- constructor(nymphOptions: NymphOptions, nymph: Nymph);
7
- }
8
- export { NodeNymph as Nymph, NodePubSub as PubSub };
1
+ import { Nymph, PubSub } from '@nymphjs/client';
2
+ export { Nymph, PubSub };
package/dist/index.js CHANGED
@@ -1,39 +1,3 @@
1
- // Nymph expects fetch and WebSocket.
2
- import ws from 'websocket';
3
- import fetch from 'node-fetch';
4
1
  import { Nymph, PubSub } from '@nymphjs/client';
5
- // Make a shortcut for PubSub init.
6
- class NodeNymph extends Nymph {
7
- constructor(nymphOptions) {
8
- super({
9
- fetch: fetch,
10
- ...nymphOptions,
11
- });
12
- // Save the Tilmeld auth token and send it in the header.
13
- let authToken = null;
14
- this.on('request', (_url, options) => {
15
- if (authToken) {
16
- options.headers['X-TILMELDAUTH'] =
17
- authToken;
18
- }
19
- });
20
- this.on('response', (response) => {
21
- if (response.headers.has('X-TILMELDAUTH')) {
22
- authToken = response.headers.get('X-TILMELDAUTH');
23
- if (authToken === '') {
24
- authToken = null;
25
- }
26
- }
27
- });
28
- }
29
- }
30
- class NodePubSub extends PubSub {
31
- constructor(nymphOptions, nymph) {
32
- super({
33
- WebSocket: ws.w3cwebsocket,
34
- ...nymphOptions,
35
- }, nymph);
36
- }
37
- }
38
- export { NodeNymph as Nymph, NodePubSub as PubSub };
2
+ export { Nymph, PubSub };
39
3
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3B,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,EAAqB,MAAM,iBAAiB,CAAC;AAEnE,mCAAmC;AACnC,MAAM,SAAU,SAAQ,KAAK;IAC3B,YAAY,YAA0B;QACpC,KAAK,CAAC;YACJ,KAAK,EAAE,KAAsD;YAC7D,GAAG,YAAY;SAChB,CAAC,CAAC;QAEH,yDAAyD;QACzD,IAAI,SAAS,GAAkB,IAAI,CAAC;QACpC,IAAI,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,IAAY,EAAE,OAAoB,EAAE,EAAE;YACxD,IAAI,SAAS,EAAE,CAAC;gBACb,OAAO,CAAC,OAAkC,CAAC,eAAe,CAAC;oBAC1D,SAAS,CAAC;YACd,CAAC;QACH,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,QAAkB,EAAE,EAAE;YACzC,IAAI,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE,CAAC;gBAC1C,SAAS,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;gBAClD,IAAI,SAAS,KAAK,EAAE,EAAE,CAAC;oBACrB,SAAS,GAAG,IAAI,CAAC;gBACnB,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAM,UAAW,SAAQ,MAAM;IAC7B,YAAY,YAA0B,EAAE,KAAY;QAClD,KAAK,CACH;YACE,SAAS,EAAE,EAAE,CAAC,YAA2C;YACzD,GAAG,YAAY;SAChB,EACD,KAAK,CACN,CAAC;IACJ,CAAC;CACF;AAED,OAAO,EAAE,SAAS,IAAI,KAAK,EAAE,UAAU,IAAI,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nymphjs/client-node",
3
- "version": "1.0.0-beta.86",
3
+ "version": "1.0.0-beta.88",
4
4
  "description": "Nymph.js - Node Client",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -30,20 +30,13 @@
30
30
  "url": "https://github.com/sciactive/nymphjs/issues"
31
31
  },
32
32
  "license": "Apache-2.0",
33
- "dependencies": {
34
- "@nymphjs/client": "^1.0.0-beta.86",
35
- "node-fetch": "^3.3.2",
36
- "websocket": "^1.0.35"
37
- },
38
33
  "devDependencies": {
39
34
  "@tsconfig/recommended": "^1.0.8",
40
35
  "@types/jest": "^29.5.14",
41
- "@types/node-fetch": "^2.6.12",
42
- "@types/websocket": "^1.0.10",
43
36
  "jest": "^29.7.0",
44
37
  "ts-jest": "^29.2.5",
45
38
  "ts-node": "^10.9.2",
46
39
  "typescript": "^5.7.2"
47
40
  },
48
- "gitHead": "14a3b58c103192913b6e0a19ef6e91492019d234"
41
+ "gitHead": "056e2b49fde37bf9d93d6867a959ac31c8889c84"
49
42
  }
package/src/index.ts CHANGED
@@ -1,45 +1,3 @@
1
- // Nymph expects fetch and WebSocket.
2
- import ws from 'websocket';
3
- import fetch from 'node-fetch';
4
- import { Nymph, PubSub, type NymphOptions } from '@nymphjs/client';
1
+ import { Nymph, PubSub } from '@nymphjs/client';
5
2
 
6
- // Make a shortcut for PubSub init.
7
- class NodeNymph extends Nymph {
8
- constructor(nymphOptions: NymphOptions) {
9
- super({
10
- fetch: fetch as unknown as WindowOrWorkerGlobalScope['fetch'],
11
- ...nymphOptions,
12
- });
13
-
14
- // Save the Tilmeld auth token and send it in the header.
15
- let authToken: string | null = null;
16
- this.on('request', (_url: string, options: RequestInit) => {
17
- if (authToken) {
18
- (options.headers as Record<string, string>)['X-TILMELDAUTH'] =
19
- authToken;
20
- }
21
- });
22
- this.on('response', (response: Response) => {
23
- if (response.headers.has('X-TILMELDAUTH')) {
24
- authToken = response.headers.get('X-TILMELDAUTH');
25
- if (authToken === '') {
26
- authToken = null;
27
- }
28
- }
29
- });
30
- }
31
- }
32
-
33
- class NodePubSub extends PubSub {
34
- constructor(nymphOptions: NymphOptions, nymph: Nymph) {
35
- super(
36
- {
37
- WebSocket: ws.w3cwebsocket as unknown as typeof WebSocket,
38
- ...nymphOptions,
39
- },
40
- nymph,
41
- );
42
- }
43
- }
44
-
45
- export { NodeNymph as Nymph, NodePubSub as PubSub };
3
+ export { Nymph, PubSub };