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.
Files changed (51) hide show
  1. package/.circleci/config.yml +7 -5
  2. package/CHANGELOG.md +11 -0
  3. package/{test/EventStream-e2e-browser.html → EventStream-e2e-browser.html} +0 -1
  4. package/{test/EventStream-e2e-node.js → EventStream-e2e-node.js} +2 -3
  5. package/README.md +2 -2
  6. package/RELEASE.md +1 -1
  7. package/dist/particle.min.js +1 -399
  8. package/dist/particle.min.js.map +1 -1
  9. package/docs/api.md +5223 -115
  10. package/fs.js +2 -0
  11. package/karma.conf.js +18 -6
  12. package/package.json +23 -26
  13. package/src/Agent.js +407 -0
  14. package/src/Client.js +170 -0
  15. package/src/Defaults.js +7 -0
  16. package/src/EventStream.js +263 -0
  17. package/src/Library.js +33 -0
  18. package/src/Particle.js +2644 -0
  19. package/test/Agent.integration.js +5 -4
  20. package/test/Agent.spec.js +174 -291
  21. package/test/Client.spec.js +7 -7
  22. package/test/Defaults.spec.js +2 -2
  23. package/test/EventStream.spec.js +6 -4
  24. package/test/FakeAgent.js +2 -2
  25. package/test/Library.spec.js +2 -2
  26. package/test/Particle.integration.js +7 -7
  27. package/test/Particle.spec.js +332 -18
  28. package/test/fixtures/index.js +4 -18
  29. package/test/support/FixtureHttpServer.js +5 -3
  30. package/test/test-setup.js +5 -5
  31. package/tsconfig.json +14 -0
  32. package/webpack.config.js +45 -0
  33. package/.babelrc +0 -4
  34. package/lib/Agent.js +0 -516
  35. package/lib/Agent.js.map +0 -1
  36. package/lib/Client.js +0 -312
  37. package/lib/Client.js.map +0 -1
  38. package/lib/Defaults.js +0 -14
  39. package/lib/Defaults.js.map +0 -1
  40. package/lib/EventStream.js +0 -335
  41. package/lib/EventStream.js.map +0 -1
  42. package/lib/Library.js +0 -67
  43. package/lib/Library.js.map +0 -1
  44. package/lib/Particle.js +0 -3248
  45. package/lib/Particle.js.map +0 -1
  46. package/lib/superagent-binary-parser.js +0 -20
  47. package/lib/superagent-binary-parser.js.map +0 -1
  48. package/test/Client.integration.js +0 -69
  49. package/test/fixtures/tarball.tar.gz +0 -0
  50. package/test/fixtures/test-library-publish-0.0.1.tar.gz +0 -0
  51. package/test/fixtures/test-library-publish-0.0.2.tar.gz +0 -0
@@ -1,7 +1,7 @@
1
1
  version: 2.1
2
2
 
3
3
  orbs:
4
- browser-tools: circleci/browser-tools@1.1.0
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.15.0", << parameters.node-version >>]
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.15.0 # Primary execution image
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.15.0"]
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`.
@@ -2,7 +2,6 @@
2
2
  End-to-end test program for the event stream in the browser
3
3
 
4
4
  Steps:
5
- - npm run compile
6
5
  - npm run build
7
6
  - Replace the path to particle.min.js
8
7
  - Replace your access token in `auth`
@@ -3,13 +3,12 @@
3
3
  End-to-end test program for the event stream with Node
4
4
 
5
5
  Steps:
6
- - npm run compile
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('../lib/Particle');
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 compile` command. To create a simple script file to test your changes, follow these steps:
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 compile && npm run build
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/SDKs/javascript.md)
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)