particle-api-js 9.4.1 → 10.1.0
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/.circleci/config.yml +7 -5
- package/CHANGELOG.md +11 -0
- package/{test/EventStream-e2e-browser.html → EventStream-e2e-browser.html} +0 -1
- package/{test/EventStream-e2e-node.js → EventStream-e2e-node.js} +2 -3
- package/README.md +2 -2
- package/RELEASE.md +1 -1
- package/dist/particle.min.js +1 -399
- package/dist/particle.min.js.map +1 -1
- package/docs/api.md +5223 -115
- package/fs.js +2 -0
- package/karma.conf.js +18 -6
- package/package.json +23 -26
- package/src/Agent.js +407 -0
- package/src/Client.js +170 -0
- package/src/Defaults.js +7 -0
- package/src/EventStream.js +263 -0
- package/src/Library.js +33 -0
- package/src/Particle.js +2644 -0
- package/test/Agent.integration.js +5 -4
- package/test/Agent.spec.js +174 -291
- package/test/Client.spec.js +7 -7
- package/test/Defaults.spec.js +2 -2
- package/test/EventStream.spec.js +6 -4
- package/test/FakeAgent.js +2 -2
- package/test/Library.spec.js +2 -2
- package/test/Particle.integration.js +7 -7
- package/test/Particle.spec.js +332 -18
- package/test/fixtures/index.js +4 -18
- package/test/support/FixtureHttpServer.js +5 -3
- package/test/test-setup.js +5 -5
- package/tsconfig.json +14 -0
- package/webpack.config.js +45 -0
- package/.babelrc +0 -4
- package/lib/Agent.js +0 -516
- package/lib/Agent.js.map +0 -1
- package/lib/Client.js +0 -312
- package/lib/Client.js.map +0 -1
- package/lib/Defaults.js +0 -14
- package/lib/Defaults.js.map +0 -1
- package/lib/EventStream.js +0 -335
- package/lib/EventStream.js.map +0 -1
- package/lib/Library.js +0 -67
- package/lib/Library.js.map +0 -1
- package/lib/Particle.js +0 -3248
- package/lib/Particle.js.map +0 -1
- package/lib/superagent-binary-parser.js +0 -20
- package/lib/superagent-binary-parser.js.map +0 -1
- package/test/Client.integration.js +0 -69
- package/test/fixtures/tarball.tar.gz +0 -0
- package/test/fixtures/test-library-publish-0.0.1.tar.gz +0 -0
- package/test/fixtures/test-library-publish-0.0.2.tar.gz +0 -0
package/.circleci/config.yml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
version: 2.1
|
|
2
2
|
|
|
3
3
|
orbs:
|
|
4
|
-
browser-tools: circleci/browser-tools@1
|
|
4
|
+
browser-tools: circleci/browser-tools@1
|
|
5
5
|
|
|
6
6
|
jobs:
|
|
7
7
|
run-tests:
|
|
@@ -23,15 +23,17 @@ jobs:
|
|
|
23
23
|
command: npm run test:ci
|
|
24
24
|
- when:
|
|
25
25
|
condition:
|
|
26
|
-
equal: ["16.
|
|
26
|
+
equal: ["16.20.0", << parameters.node-version >>]
|
|
27
27
|
steps:
|
|
28
|
-
- browser-tools/install-browser-tools
|
|
28
|
+
- browser-tools/install-browser-tools:
|
|
29
|
+
# Workaround for circleCI automatically targeting unstalbe build https://github.com/CircleCI-Public/browser-tools-orb/issues/90
|
|
30
|
+
chrome-version: 116.0.5845.96 # TODO: remove when chromedriver downloads are fixed
|
|
29
31
|
- run:
|
|
30
32
|
name: Run tests with browser
|
|
31
33
|
command: npm run test:browser
|
|
32
34
|
publish-npm:
|
|
33
35
|
docker:
|
|
34
|
-
- image: cimg/node:16.
|
|
36
|
+
- image: cimg/node:16.20.0 # Primary execution image
|
|
35
37
|
auth:
|
|
36
38
|
username: $DOCKERHUB_USERNAME
|
|
37
39
|
password: $DOCKERHUB_PASSWORD
|
|
@@ -59,7 +61,7 @@ workflows:
|
|
|
59
61
|
- particle-ci-private
|
|
60
62
|
matrix:
|
|
61
63
|
parameters:
|
|
62
|
-
node-version: ["12.22.12", "14.19.2", "16.
|
|
64
|
+
node-version: ["12.22.12", "14.19.2", "16.20.0"]
|
|
63
65
|
# run tests for all branches and tags
|
|
64
66
|
filters:
|
|
65
67
|
tags:
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# changelog
|
|
2
2
|
|
|
3
|
+
|
|
4
|
+
## 10.1.0 - 8 Sept 2023
|
|
5
|
+
|
|
6
|
+
* Use wepback to bundle for browser use
|
|
7
|
+
* Remove babel, browserify and their related dependencies
|
|
8
|
+
* Adds support for checkJS loose type/docs validations
|
|
9
|
+
|
|
10
|
+
## 10.0.0 - 8 Sept 2023
|
|
11
|
+
|
|
12
|
+
* Change library to handle requests from `superagent` to `fetch`/`node-fetch`
|
|
13
|
+
|
|
3
14
|
## 9.4.1 - 17 June 2022
|
|
4
15
|
|
|
5
16
|
* Fixes incompatible versions of `eslint`, `chai`, `sinon-chai` and `chai-as-promised`.
|
|
@@ -3,13 +3,12 @@
|
|
|
3
3
|
End-to-end test program for the event stream with Node
|
|
4
4
|
|
|
5
5
|
Steps:
|
|
6
|
-
-
|
|
7
|
-
- PARTICLE_API_TOKEN=<my-token> node test/EventStream-e2e-node.js
|
|
6
|
+
- PARTICLE_API_TOKEN=<my-token> node EventStream-e2e-node.js
|
|
8
7
|
- Follow the scenarios in EventStream.feature
|
|
9
8
|
|
|
10
9
|
*/
|
|
11
10
|
|
|
12
|
-
const Particle = require('
|
|
11
|
+
const Particle = require('./src/Particle');
|
|
13
12
|
const baseUrl = process.env.PARTICLE_API_BASE_URL || 'http://localhost:9090';
|
|
14
13
|
const auth = process.env.PARTICLE_API_TOKEN;
|
|
15
14
|
const particle = new Particle({ baseUrl });
|
package/README.md
CHANGED
|
@@ -51,7 +51,7 @@ The `Agent` integration tests ([source](./test/Agent.integration.js)) depend on
|
|
|
51
51
|
<summary><b>How to write scripts that execute against local code changes?</b></summary>
|
|
52
52
|
<p>
|
|
53
53
|
|
|
54
|
-
Source code lives in the `./src` directory and is built for release via the `npm run
|
|
54
|
+
Source code lives in the `./src` directory and is built for release via the `npm run build` command. To create a simple script file to test your changes, follow these steps:
|
|
55
55
|
|
|
56
56
|
1. create a `js` file on your local machine: `touch my-api-test.js` (somewhere outside of the root of this repo)
|
|
57
57
|
2. within your test `js` file, init the api client like so:
|
|
@@ -123,7 +123,7 @@ There [are many snippets of using Particle API JS on the Documentation website][
|
|
|
123
123
|
Make your changes to the files in the `src` directory, then from the project directory run:
|
|
124
124
|
|
|
125
125
|
```
|
|
126
|
-
$ npm run
|
|
126
|
+
$ npm run build
|
|
127
127
|
```
|
|
128
128
|
|
|
129
129
|
The `dist` directory will contain the compiled and minified files that can be included in your project.
|
package/RELEASE.md
CHANGED
|
@@ -9,4 +9,4 @@
|
|
|
9
9
|
5. Create a release on GitHub with the notes from the `CHANGELOG.md`
|
|
10
10
|
6. Point your project to the new version `npm install particle-api-js@latest`
|
|
11
11
|
|
|
12
|
-
- After updating major version, update the installation instructions in the [docs](https://github.com/particle-iot/docs/blob/master/src/content/reference/
|
|
12
|
+
- After updating major version, update the installation instructions in the [docs](https://github.com/particle-iot/docs/blob/master/src/content/reference/cloud-apis/javascript.md)
|