particle-api-js 10.3.0 → 10.3.1
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/.eslintrc.js +23 -21
- package/CHANGELOG.md +8 -0
- package/EventStream-e2e-browser.html +7 -7
- package/EventStream-e2e-node.js +14 -14
- package/dist/particle.min.js +1 -1
- package/dist/particle.min.js.map +1 -1
- package/docs/api.md +3448 -875
- package/karma.conf.js +59 -59
- package/package.json +1 -1
- package/src/Agent.js +387 -363
- package/src/Client.js +162 -162
- package/src/Defaults.js +5 -5
- package/src/EventStream.js +254 -253
- package/src/Library.js +21 -21
- package/src/Particle.js +2685 -2649
- package/test/.eslintrc +5 -5
- package/test/Agent.integration.js +14 -14
- package/test/Agent.spec.js +495 -495
- package/test/Client.spec.js +203 -203
- package/test/Defaults.spec.js +20 -20
- package/test/EventStream.spec.js +231 -231
- package/test/FakeAgent.js +18 -18
- package/test/Library.spec.js +29 -29
- package/test/Particle.integration.js +29 -29
- package/test/Particle.spec.js +3127 -3127
- package/test/fixtures/index.js +7 -7
- package/test/support/FixtureHttpServer.js +16 -16
- package/test/test-setup.js +3 -3
- package/tsconfig.json +3 -1
- package/webpack.config.js +39 -39
package/.eslintrc.js
CHANGED
|
@@ -1,23 +1,25 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
2
|
+
extends: ['eslint-config-particle'],
|
|
3
|
+
parserOptions: {
|
|
4
|
+
sourceType: 'module'
|
|
5
|
+
},
|
|
6
|
+
env: {
|
|
7
|
+
browser: true,
|
|
8
|
+
commonjs: true,
|
|
9
|
+
es6: true,
|
|
10
|
+
node: true,
|
|
11
|
+
mocha: true,
|
|
12
|
+
worker: true,
|
|
13
|
+
serviceworker: true
|
|
14
|
+
},
|
|
15
|
+
rules: {
|
|
16
|
+
'no-prototype-builtins': 'off',
|
|
17
|
+
'no-redeclare': 'off',
|
|
18
|
+
camelcase: ['error', {
|
|
19
|
+
properties: 'never',
|
|
20
|
+
allow: ['redirect_uri']
|
|
21
|
+
}],
|
|
22
|
+
'no-mixed-spaces-and-tabs': 'error',
|
|
23
|
+
indent: ['error', 4]
|
|
24
|
+
}
|
|
23
25
|
};
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# changelog
|
|
2
2
|
|
|
3
|
+
## 10.3.1 - 6 December 2023
|
|
4
|
+
|
|
5
|
+
* Add `todayStats` query option to listLogicFunctions
|
|
6
|
+
* Add `scope`, `archived`, `page`, and `perPage` query options to listLedgers
|
|
7
|
+
* Add `page` and `perPage` query options to listLedgerInstances
|
|
8
|
+
* Add JSDocs for constructor
|
|
9
|
+
* Fix JSDocs across most functions in the library to be more accurate
|
|
10
|
+
|
|
3
11
|
## 10.3.0 - 7 November 2023
|
|
4
12
|
|
|
5
13
|
* Add support for sandbox accounts on all logic/ledger APIs by allowing the omission of the `org` property
|
|
@@ -22,16 +22,16 @@ const auth = '<my-token>';
|
|
|
22
22
|
const particle = new Particle({ baseUrl });
|
|
23
23
|
|
|
24
24
|
particle.getEventStream({ deviceId: 'mine', auth }).then(stream => {
|
|
25
|
-
|
|
25
|
+
console.log('event stream connected');
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
['event', 'error', 'disconnect', 'reconnect', 'reconnect-success', 'reconnect-error'].forEach(eventName => {
|
|
28
|
+
stream.on(eventName, (arg) => {
|
|
29
|
+
console.log(eventName, arg);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
32
|
|
|
33
33
|
}).catch(function (err) {
|
|
34
|
-
|
|
34
|
+
console.log(err);
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
</script>
|
package/EventStream-e2e-node.js
CHANGED
|
@@ -16,19 +16,19 @@ const particle = new Particle({ baseUrl });
|
|
|
16
16
|
|
|
17
17
|
/* eslint-disable no-console */
|
|
18
18
|
particle.getEventStream({ deviceId: 'mine', auth })
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
19
|
+
.then(stream => {
|
|
20
|
+
console.log('event stream connected');
|
|
21
|
+
|
|
22
|
+
['event', 'error', 'disconnect', 'reconnect', 'reconnect-success', 'reconnect-error']
|
|
23
|
+
.forEach(eventName => {
|
|
24
|
+
stream.on(eventName, (arg) => {
|
|
25
|
+
console.log(eventName, arg);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
})
|
|
29
|
+
.catch((err) => {
|
|
30
|
+
console.error(err);
|
|
31
|
+
process.exit(1);
|
|
32
|
+
});
|
|
33
33
|
/* eslint-enable no-console */
|
|
34
34
|
|