pryv 2.3.7 → 2.3.9
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/README.md +7 -3
- package/package.json +4 -1
- package/test/Browser.AuthController.test.js +1 -1
- package/test/Browser.test.js +2 -2
- package/test/Connection.test.js +4 -4
- package/test/Service.test.js +4 -4
- package/test/ServiceAssets.test.js +1 -1
- package/test/browser-index.html +1 -1
- package/test/utils.test.js +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# `pryv`: JS library for Pryv.io
|
|
2
2
|
|
|
3
|
+
[](https://codecov.io/gh/pryv/lib-js)
|
|
4
|
+
|
|
3
5
|
JavaScript library and add-ons for writing Node.js and browser apps connecting to a Pryv.io platform. It follows the [Pryv.io app guidelines](https://api.pryv.com/guides/app-guidelines/).
|
|
4
6
|
|
|
5
7
|
|
|
@@ -648,11 +650,11 @@ There is a possibility that you would like to register the user in another page.
|
|
|
648
650
|
|
|
649
651
|
You can find HTML examples in the [`./examples`](https://github.com/pryv/lib-js/blob/master/examples) directory. You can run them in two ways:
|
|
650
652
|
|
|
651
|
-
1. With [
|
|
653
|
+
1. With [backloop.dev](https://github.com/pryv/backloop.dev), which allows to run local code with a valid SSL certificate (you must have run `just build` beforehand):
|
|
652
654
|
```
|
|
653
655
|
just serve
|
|
654
656
|
```
|
|
655
|
-
then open the desired example page (e.g. [https://l.
|
|
657
|
+
then open the desired example page (e.g. [https://l.backloop.dev:9443/examples/auth.html](https://l.backloop.dev:9443/examples/auth.html)
|
|
656
658
|
2. As a simple HTML file, passing service information as JSON to avoid CORS issues
|
|
657
659
|
|
|
658
660
|
|
|
@@ -676,6 +678,8 @@ The project is structured as a monorepo with components (a.k.a. workspaces in NP
|
|
|
676
678
|
- `pryv-socket.io`: Socket.IO add-on
|
|
677
679
|
- `pryv-monitor`: Monitor add-on
|
|
678
680
|
|
|
681
|
+
|
|
682
|
+
|
|
679
683
|
The code follows the [Semi-Standard](https://github.com/standard/semistandard) style.
|
|
680
684
|
|
|
681
685
|
### Building for the browser
|
|
@@ -707,7 +711,7 @@ TEST_PRYVLIB_SERVICEINFO_URL="https://reg.${DOMAIN}/service/info" just test all
|
|
|
707
711
|
To run the tests against _in-development_ API server components (e.g. open-source or Entreprise), set `TEST_PRYVLIB_DNSLESS_URL`; for example:
|
|
708
712
|
|
|
709
713
|
```bash
|
|
710
|
-
TEST_PRYVLIB_DNSLESS_URL="http://l.
|
|
714
|
+
TEST_PRYVLIB_DNSLESS_URL="http://l.backloop.dev:3000/ just test all
|
|
711
715
|
```
|
|
712
716
|
|
|
713
717
|
#### Browser
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pryv",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.9",
|
|
4
4
|
"description": "Pryv JavaScript library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Pryv",
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
"type": "git",
|
|
15
15
|
"url": "git://github.com/pryv/lib-js"
|
|
16
16
|
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"superagent": "^8.0.6"
|
|
19
|
+
},
|
|
17
20
|
"license": "BSD-3-Clause",
|
|
18
21
|
"author": "Pryv S.A. <info@pryv.com> (https://pryv.com)",
|
|
19
22
|
"main": "src/index.js",
|
package/test/Browser.test.js
CHANGED
package/test/Connection.test.js
CHANGED
|
@@ -20,7 +20,7 @@ if (isNode) { // node
|
|
|
20
20
|
|
|
21
21
|
describe('Connection', () => {
|
|
22
22
|
before(async function () {
|
|
23
|
-
this.timeout(
|
|
23
|
+
this.timeout(15000);
|
|
24
24
|
await testData.prepare();
|
|
25
25
|
conn = new pryv.Connection(testData.apiEndpointWithToken);
|
|
26
26
|
|
|
@@ -90,7 +90,7 @@ describe('Connection', () => {
|
|
|
90
90
|
});
|
|
91
91
|
|
|
92
92
|
describe('.api()', function () {
|
|
93
|
-
this.timeout(
|
|
93
|
+
this.timeout(15000);
|
|
94
94
|
it('.api() events.get', async () => {
|
|
95
95
|
const res = await conn.api(
|
|
96
96
|
[
|
|
@@ -317,7 +317,7 @@ describe('Connection', () => {
|
|
|
317
317
|
});
|
|
318
318
|
|
|
319
319
|
describe('Streamed event get', function () {
|
|
320
|
-
this.timeout(
|
|
320
|
+
this.timeout(15000);
|
|
321
321
|
const now = (new Date()).getTime() / 1000 + 1000;
|
|
322
322
|
|
|
323
323
|
describe('Node & Browser', function () {
|
|
@@ -421,7 +421,7 @@ describe('Connection', () => {
|
|
|
421
421
|
{
|
|
422
422
|
method: 'accesses.create',
|
|
423
423
|
params: {
|
|
424
|
-
name: 'test',
|
|
424
|
+
name: 'test' + Math.round(Math.random() * 10000),
|
|
425
425
|
permissions: [
|
|
426
426
|
{
|
|
427
427
|
streamId: 'data',
|
package/test/Service.test.js
CHANGED
|
@@ -9,7 +9,7 @@ const isNode = (typeof window === 'undefined');
|
|
|
9
9
|
|
|
10
10
|
describe('Service', function () {
|
|
11
11
|
before(async function () {
|
|
12
|
-
this.timeout(
|
|
12
|
+
this.timeout(15000);
|
|
13
13
|
await testData.prepare();
|
|
14
14
|
});
|
|
15
15
|
|
|
@@ -36,7 +36,7 @@ describe('Service', function () {
|
|
|
36
36
|
});
|
|
37
37
|
|
|
38
38
|
it('login()', async function () {
|
|
39
|
-
this.timeout(
|
|
39
|
+
this.timeout(15000);
|
|
40
40
|
const pryvService = new pryv.Service(testData.serviceInfoUrl);
|
|
41
41
|
const conn = await pryvService.login(testData.username, testData.password, 'jslib-test');
|
|
42
42
|
expect(conn).to.exist;
|
|
@@ -69,13 +69,13 @@ describe('Service', function () {
|
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
it('login() failed on wrong password', async function () {
|
|
72
|
-
this.timeout(
|
|
72
|
+
this.timeout(15000);
|
|
73
73
|
const pryvService = new pryv.Service(testData.serviceInfoUrl);
|
|
74
74
|
await expect(pryvService.login(testData.username, 'bobby', 'jslib-test')).to.be.rejectedWith('The given username/password pair is invalid.');
|
|
75
75
|
});
|
|
76
76
|
|
|
77
77
|
it('login() failed on wrong username', async function () {
|
|
78
|
-
this.timeout(
|
|
78
|
+
this.timeout(15000);
|
|
79
79
|
const pryvService = new pryv.Service(testData.serviceInfoUrl);
|
|
80
80
|
// check if username is in path or domain
|
|
81
81
|
try {
|
package/test/browser-index.html
CHANGED