particle-api-js 11.1.7 → 12.0.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/README.md +90 -10
- package/dist/particle.min.js +1 -1
- package/dist/particle.min.js.map +1 -1
- package/fs.d.ts +2 -0
- package/lib/fs.d.ts +2 -0
- package/lib/fs.js +3 -0
- package/lib/package.json +110 -0
- package/lib/src/Agent.d.ts +40 -0
- package/lib/src/Agent.d.ts.map +1 -0
- package/lib/src/Agent.js +233 -0
- package/lib/src/Agent.js.map +1 -0
- package/lib/src/Client.d.ts +80 -0
- package/lib/src/Client.d.ts.map +1 -0
- package/lib/src/Client.js +104 -0
- package/lib/src/Client.js.map +1 -0
- package/lib/src/Defaults.d.ts +6 -0
- package/lib/src/Defaults.d.ts.map +1 -0
- package/lib/src/Defaults.js +12 -0
- package/lib/src/Defaults.js.map +1 -0
- package/lib/src/EventStream.d.ts +31 -0
- package/lib/src/EventStream.d.ts.map +1 -0
- package/lib/src/EventStream.js +275 -0
- package/lib/src/EventStream.js.map +1 -0
- package/lib/src/Library.d.ts +33 -0
- package/lib/src/Library.d.ts.map +1 -0
- package/lib/src/Library.js +19 -0
- package/lib/src/Library.js.map +1 -0
- package/{src/Particle.js → lib/src/Particle.d.ts} +623 -1779
- package/lib/src/Particle.d.ts.map +1 -0
- package/lib/src/Particle.js +2578 -0
- package/lib/src/Particle.js.map +1 -0
- package/lib/src/types/common.d.ts +73 -0
- package/lib/src/types/common.d.ts.map +1 -0
- package/lib/src/types/common.js +3 -0
- package/lib/src/types/common.js.map +1 -0
- package/lib/src/types/index.d.ts +4 -0
- package/lib/src/types/index.d.ts.map +1 -0
- package/lib/src/types/index.js +20 -0
- package/lib/src/types/index.js.map +1 -0
- package/lib/src/types/requests.d.ts +568 -0
- package/lib/src/types/requests.d.ts.map +1 -0
- package/lib/src/types/requests.js +3 -0
- package/lib/src/types/requests.js.map +1 -0
- package/lib/src/types/responses.d.ts +449 -0
- package/lib/src/types/responses.d.ts.map +1 -0
- package/lib/src/types/responses.js +3 -0
- package/lib/src/types/responses.js.map +1 -0
- package/package.json +35 -14
- package/scripts/postprocess-docs.js +306 -0
- package/typedoc.json +20 -0
- package/.circleci/config.yml +0 -104
- package/.nvmrc +0 -1
- package/CHANGELOG.md +0 -404
- package/EventStream-e2e-browser.html +0 -39
- package/EventStream-e2e-node.js +0 -34
- package/RELEASE.md +0 -12
- package/bower.json +0 -30
- package/docs/api.md +0 -2594
- package/eslint.config.mjs +0 -7
- package/examples/login/login.html +0 -17
- package/karma.conf.js +0 -80
- package/src/Agent.js +0 -397
- package/src/Client.js +0 -171
- package/src/Defaults.js +0 -8
- package/src/EventStream.js +0 -269
- package/src/Library.js +0 -33
- package/test/Agent.integration.js +0 -23
- package/test/Agent.spec.js +0 -488
- package/test/Client.spec.js +0 -216
- package/test/Defaults.spec.js +0 -30
- package/test/EventStream.feature +0 -65
- package/test/EventStream.spec.js +0 -263
- package/test/FakeAgent.js +0 -27
- package/test/Library.spec.js +0 -40
- package/test/Particle.integration.js +0 -38
- package/test/Particle.spec.js +0 -3198
- package/test/fixtures/index.js +0 -15
- package/test/fixtures/libraries.json +0 -33
- package/test/fixtures/library.json +0 -31
- package/test/fixtures/libraryVersions.json +0 -211
- package/test/out.tmp +0 -0
- package/test/support/FixtureHttpServer.js +0 -28
- package/test/test-setup.js +0 -17
- package/tsconfig.json +0 -17
- package/webpack.config.js +0 -46
package/CHANGELOG.md
DELETED
|
@@ -1,404 +0,0 @@
|
|
|
1
|
-
# changelog
|
|
2
|
-
|
|
3
|
-
## 11.1.7 - 06 October 2025
|
|
4
|
-
* Add downloadManufacturingBackup method
|
|
5
|
-
|
|
6
|
-
## 11.1.6 - 20 September 2025
|
|
7
|
-
* Fix request params to support `FormData` passed in the data argument
|
|
8
|
-
* Update docs on queries receiving `data`
|
|
9
|
-
* Update eslint configuration
|
|
10
|
-
|
|
11
|
-
## 11.1.5 - 19 September 2025
|
|
12
|
-
* Ensure node 22 works as expected
|
|
13
|
-
* Remove node 12 validations
|
|
14
|
-
* Update eslint configuration
|
|
15
|
-
|
|
16
|
-
## 11.1.4 - 20 August 2025
|
|
17
|
-
* Clarify license is Apache 2.0
|
|
18
|
-
|
|
19
|
-
## 11.1.3 - 22 July 2025
|
|
20
|
-
* Bump form-data to resolve security warning
|
|
21
|
-
|
|
22
|
-
## 11.1.2 - 11 December 2024
|
|
23
|
-
* Add context docs for x-particle-tool and x-particle-project headers
|
|
24
|
-
|
|
25
|
-
## 11.1.1 - 5 November 2024
|
|
26
|
-
* Workaround for Firefox failing to open multiple event streams
|
|
27
|
-
|
|
28
|
-
## 11.1.0 - 3 October 2024
|
|
29
|
-
* Re-add `deleteAccessToken` method, but with basic auth removed
|
|
30
|
-
|
|
31
|
-
## 11.0.0 - 1 October 2024
|
|
32
|
-
* Remove `listAccessTokens` and `deleteAccessToken` methods that relied on HTTP basic auth
|
|
33
|
-
* Update EventStream to send access_token in the Authorization header instead. No functional change
|
|
34
|
-
|
|
35
|
-
## 10.6.0 - 21 August 2024
|
|
36
|
-
* Add DeviceOS versions endpoints
|
|
37
|
-
|
|
38
|
-
## 10.5.1 - 21 June 2024
|
|
39
|
-
* Don't add an empty query string to the URL
|
|
40
|
-
|
|
41
|
-
## 10.5.0 - 14 June 2024
|
|
42
|
-
* Add `unprotectDevice`
|
|
43
|
-
* Remove `changeProduct`
|
|
44
|
-
|
|
45
|
-
## 10.4.3 - 25 March 2024
|
|
46
|
-
* Add `utm` paramater to `createUser`
|
|
47
|
-
|
|
48
|
-
## 10.4.2 - 3 January 2024
|
|
49
|
-
* Add `setMode` arg to `setLedgerInstance`
|
|
50
|
-
* Fix a few incorrect logic function JSDocs
|
|
51
|
-
|
|
52
|
-
## 10.4.1 - 2 January 2024
|
|
53
|
-
|
|
54
|
-
* Fix `setLedgerInstance` taking wrong argument and passing a bad request body to the API
|
|
55
|
-
|
|
56
|
-
## 10.4.0 - 19 December 2023
|
|
57
|
-
|
|
58
|
-
* Add `listLedgerInstanceVersions` function
|
|
59
|
-
* Add `getLedgerInstanceVersion` function
|
|
60
|
-
|
|
61
|
-
## 10.3.1 - 6 December 2023
|
|
62
|
-
|
|
63
|
-
* Add `todayStats` query option to listLogicFunctions
|
|
64
|
-
* Add `scope`, `archived`, `page`, and `perPage` query options to listLedgers
|
|
65
|
-
* Add `page` and `perPage` query options to listLedgerInstances
|
|
66
|
-
* Add JSDocs for constructor
|
|
67
|
-
* Fix JSDocs across most functions in the library to be more accurate
|
|
68
|
-
|
|
69
|
-
## 10.3.0 - 7 November 2023
|
|
70
|
-
|
|
71
|
-
* Add support for sandbox accounts on all logic/ledger APIs by allowing the omission of the `org` property
|
|
72
|
-
* Add `executeLogic` function for testing logic functions before deploying them
|
|
73
|
-
|
|
74
|
-
## 10.2.0 - 6 October 2023
|
|
75
|
-
|
|
76
|
-
* Migrate LogicBlocks methods to LogicFunctions, LogicTriggers, and LogicRuns
|
|
77
|
-
|
|
78
|
-
## 10.1.0 - 8 Sept 2023
|
|
79
|
-
|
|
80
|
-
* Use wepback to bundle for browser use
|
|
81
|
-
* Remove babel, browserify and their related dependencies
|
|
82
|
-
* Adds support for checkJS loose type/docs validations
|
|
83
|
-
|
|
84
|
-
## 10.0.0 - 8 Sept 2023
|
|
85
|
-
|
|
86
|
-
* Change library to handle requests from `superagent` to `fetch`/`node-fetch`
|
|
87
|
-
|
|
88
|
-
## 9.4.1 - 17 June 2022
|
|
89
|
-
|
|
90
|
-
* Fixes incompatible versions of `eslint`, `chai`, `sinon-chai` and `chai-as-promised`.
|
|
91
|
-
|
|
92
|
-
## 9.4.0 - 14 June 2022
|
|
93
|
-
|
|
94
|
-
* Adds `.setDefaultAuth(auth)` so token authenticated methods don't need to pass their own auth token.
|
|
95
|
-
* Adds support for `auth` option in Particle constructor, calls `.setDefaultAuth()` if provided
|
|
96
|
-
* Fixes bug where `.setBaseUrl(baseUrl)` was not honored for `.getEventStream()` method (sc-105035)
|
|
97
|
-
|
|
98
|
-
## 9.3.0 - 8 June 2022
|
|
99
|
-
* Adds `.setBaseUrl(baseUrl)` to override backend api endpoint
|
|
100
|
-
|
|
101
|
-
## 9.2.0 - 30 May 2022
|
|
102
|
-
* Move to `node@16` and `npm@8` for local development
|
|
103
|
-
|
|
104
|
-
## 9.1.2 - 9 December 2021
|
|
105
|
-
* Fix library download
|
|
106
|
-
|
|
107
|
-
## 9.1.1 - 7 December 2021
|
|
108
|
-
* Use unforked copy of `stream-http` dependency
|
|
109
|
-
|
|
110
|
-
## 9.1.0 - 8 December 2020
|
|
111
|
-
* `.listAccessTokens()` accepts `otp` option to support users with MFA enabled
|
|
112
|
-
|
|
113
|
-
## 9.0.2 - 28 July 2020
|
|
114
|
-
* Add `.deleteActiveAccessTokens()` method
|
|
115
|
-
* Add `invalidateTokens` arguments to `.confirmMfa()` and `.changeUsername()` methods
|
|
116
|
-
|
|
117
|
-
## 9.0.1 - 1 June 2020
|
|
118
|
-
* Add `.getProductDeviceConfiguration()` and `.getProductDeviceConfigurationSchema()` methods
|
|
119
|
-
|
|
120
|
-
## 9.0.0 - 20 May 2020
|
|
121
|
-
* Add support for configuration and location services
|
|
122
|
-
* All top-level api methods optionally accept a `headers` option object
|
|
123
|
-
* Breaking: Base http methods (`.get()`, `.put()`, etc) on agent and particle classes accept options object vs. positional arguments ([see here](https://github.com/particle-iot/particle-api-js/pull/115/commits/c209a43ebcda53b9dc6857e1b54228906f506feb))
|
|
124
|
-
* Breaking: `.downloadFile()` method uses `uri` option (vs. `url`) ([docs](https://github.com/particle-iot/particle-api-js/blob/master/docs/api.md#downloadfile))
|
|
125
|
-
* Breaking: Refactored options object for the `.createWebhook()` method - hook-related options are now passed in via `options.hook` ([docs](https://github.com/particle-iot/particle-api-js/blob/master/docs/api.md#createwebhook))
|
|
126
|
-
|
|
127
|
-
## 8.4.0 - 28 April 2020
|
|
128
|
-
* Allow invalidating access tokens when changing password
|
|
129
|
-
|
|
130
|
-
## 8.3.0 - 11 February 2020
|
|
131
|
-
* Add delete user
|
|
132
|
-
|
|
133
|
-
## 8.2.1 - 4 February 2020
|
|
134
|
-
* fix file download methods `.downloadFile()`, `.downloadFirmwareBinary()`, and `.downloadProductFirmware()` [PR #112](https://github.com/particle-iot/particle-api-js/pull/112)
|
|
135
|
-
|
|
136
|
-
## 8.2.0 - 28 January 2020
|
|
137
|
-
* `.addDeviceToProduct()` accepts `file` option to facillitate bulk importing of devices [PR #109](https://github.com/particle-iot/particle-api-js/pull/109)
|
|
138
|
-
|
|
139
|
-
## 8.1.0 - 24 January 2020
|
|
140
|
-
* Add support for `groups` query parameter when listing product devices via `.listDevices()` [PR #108](https://github.com/particle-iot/particle-api-js/pull/108)
|
|
141
|
-
* Update `eslint` and related configuration [PR #107](https://github.com/particle-iot/particle-api-js/pull/107)
|
|
142
|
-
|
|
143
|
-
## 8.0.1 - 2 December 2019
|
|
144
|
-
* Update to latest superagent to fix deprecation warnings in Node v12
|
|
145
|
-
|
|
146
|
-
## 8.0.0 - 30 July 2019
|
|
147
|
-
|
|
148
|
-
* EventStream returned by getEventStream handles errors better [PR #99](https://github.com/particle-iot/particle-api-js/pull/99).
|
|
149
|
-
**Breaking changes for EventStream:**
|
|
150
|
-
- Only emits a single event named 'event' for each Particle event received instead of 2 events, one named 'event' and another named after the Particle event name. This behavior caused EventStream to disconnects if a Particle event named 'error' was published.
|
|
151
|
-
- Does not emit the 'error' event when a network error happens. Instead it emits 'disconnect' and automatically reconnects.
|
|
152
|
-
|
|
153
|
-
## 7.4.1 - 6 May 2019
|
|
154
|
-
* Do not require network ID to remove a device from its network [PR #103](https://github.com/particle-iot/particle-api-js/pull/103)
|
|
155
|
-
|
|
156
|
-
## 7.4.0 - 27 Feb 2019
|
|
157
|
-
* Add support for mesh network management [PR #98](https://github.com/particle-iot/particle-api-js/pull/98)
|
|
158
|
-
|
|
159
|
-
## 7.3.0 - 10 Jan 2019
|
|
160
|
-
* Support flashing product devices [PR #97](https://github.com/particle-iot/particle-api-js/pull/97)
|
|
161
|
-
|
|
162
|
-
## 7.2.3 - 4 Aug 2018
|
|
163
|
-
* Add sendOtp method to allow users enrolled in MFA/Two-Step Auth to login [PR #92](https://github.com/particle-iot/particle-api-js/pull/92)
|
|
164
|
-
|
|
165
|
-
## 7.2.2 - 23 Jul 2018
|
|
166
|
-
* Fix npm api key for publishing to registry
|
|
167
|
-
|
|
168
|
-
## 7.2.1 - 23 Jul 2018
|
|
169
|
-
* Support enrolling user in MFA/Two-step authentication
|
|
170
|
-
|
|
171
|
-
## 7.2.0 - 22 Mar 2018
|
|
172
|
-
* Support changing user's username(i.e., email) and password [PR #84](https://github.com/particle-iot/particle-api-js/pull/84)
|
|
173
|
-
|
|
174
|
-
## 7.1.1 - 13 Feb 2018
|
|
175
|
-
* Fix country parameter for activate sim [PR #81](https://github.com/particle-iot/particle-api-js/pull/81)
|
|
176
|
-
|
|
177
|
-
## 7.1.0 - 17 Jan 2018
|
|
178
|
-
|
|
179
|
-
* Update jsDelivr link [PR #66](https://github.com/particle-iot/particle-api-js/pull/66). Thanks @LukasDrgon!
|
|
180
|
-
* Stop auto reconnecting when event stream is intentionally disconnected [PR #69](https://github.com/particle-iot/particle-api-js/pull/69). Thanks @spacetc62!
|
|
181
|
-
* Add createCustomer [PR #78](https://github.com/particle-iot/particle-api-js/pull/78). Thanks @monkeytronics!
|
|
182
|
-
* Fix event stream exception when it is an HTML response [PR #64](https://github.com/particle-iot/particle-api-js/pull/64). Thanks @spacetc62!
|
|
183
|
-
* Update links after GitHub organization rename to `particle-iot` [PR #79](https://github.com/particle-iot/particle-api-js/pull/79)
|
|
184
|
-
|
|
185
|
-
## 7.0.1 - 16 Nov 2017
|
|
186
|
-
* Add loginAsClientOwner method
|
|
187
|
-
|
|
188
|
-
## 7.0.0 - 7 Nov 2017
|
|
189
|
-
* Update to latest superagent with support for nested directory. **Drops support for Node versions earlier than 4.**
|
|
190
|
-
* Add serial number endpoint
|
|
191
|
-
|
|
192
|
-
## 6.6.2 - 15 Sep 2017
|
|
193
|
-
* Fix nested directories bug
|
|
194
|
-
|
|
195
|
-
## 6.6.1 - 14 Sep 2017
|
|
196
|
-
* Update form-data to v1.0.0-relativepath.2
|
|
197
|
-
|
|
198
|
-
## 6.6.0 - 12 Sep 2017
|
|
199
|
-
|
|
200
|
-
* Add support for deleting current token
|
|
201
|
-
|
|
202
|
-
## 6.5.0 - 02 May 2017
|
|
203
|
-
|
|
204
|
-
* Add support for all product API endpoints.
|
|
205
|
-
* Add support for sending additional context with each call.
|
|
206
|
-
|
|
207
|
-
## 6.4.3 - 15 Feb 2017
|
|
208
|
-
|
|
209
|
-
* Create a wrapper for `listBuildTargets` in `Client.js`.
|
|
210
|
-
* Marked `compileCode`, `signalDevice`, `listDevices` and `listBuildTargets` as deprecated. Those methods will be removed in 6.5
|
|
211
|
-
|
|
212
|
-
## 6.4.2 - 05 Jan 2017
|
|
213
|
-
|
|
214
|
-
* Create a wrapper for `listDevices` in `Client.js`.
|
|
215
|
-
|
|
216
|
-
## 6.4.1 - 15 Dec 2016
|
|
217
|
-
|
|
218
|
-
* Add scopes to library listing
|
|
219
|
-
|
|
220
|
-
## 6.4.0 - 09 Nov 2016
|
|
221
|
-
|
|
222
|
-
* Create a wrapper for `signalDevice` in `Client.js`.
|
|
223
|
-
|
|
224
|
-
## 6.3.0 - 31 Oct 2016
|
|
225
|
-
|
|
226
|
-
* Add support for account verification endpoint via verifyUser function
|
|
227
|
-
* Change account_info input parameter in createUser and setUserInfo to be camel case - accountInfo
|
|
228
|
-
|
|
229
|
-
## 6.2.0 - 19 Oct 2016
|
|
230
|
-
|
|
231
|
-
* Add support for account information fields in createUser and setUserInfo
|
|
232
|
-
* Add "shortErrorDescription" in response body to contain English description only
|
|
233
|
-
|
|
234
|
-
## 6.1.0 - 19 Oct 2016
|
|
235
|
-
|
|
236
|
-
* Add library publish
|
|
237
|
-
|
|
238
|
-
## 6.0.8 - 17 Oct 2016
|
|
239
|
-
|
|
240
|
-
* Rename library publish to library contribute
|
|
241
|
-
|
|
242
|
-
## 6.0.7 - 29 Sept 2016
|
|
243
|
-
|
|
244
|
-
* Add library versions endpoint
|
|
245
|
-
|
|
246
|
-
## 6.0.6 - 19 Sept 2016
|
|
247
|
-
|
|
248
|
-
* Add library delete
|
|
249
|
-
|
|
250
|
-
## 6.0.5 - 8 Sept 2016
|
|
251
|
-
|
|
252
|
-
* Add library publish
|
|
253
|
-
|
|
254
|
-
## 6.0.4 - 30 Aug 2016
|
|
255
|
-
|
|
256
|
-
* Use only HTTP dependencies to be able to install on computers without git
|
|
257
|
-
|
|
258
|
-
## 6.0.3 - 25 Aug 2016
|
|
259
|
-
|
|
260
|
-
* Support nested directories when compiling sources
|
|
261
|
-
|
|
262
|
-
## 6.0.2 - 23 Aug 2016
|
|
263
|
-
|
|
264
|
-
* Add compile code to client
|
|
265
|
-
|
|
266
|
-
## 6.0.1 - 22 Aug 2016
|
|
267
|
-
|
|
268
|
-
* Fix the login method content type
|
|
269
|
-
|
|
270
|
-
## 6.0.0 - 17 Aug 2016
|
|
271
|
-
|
|
272
|
-
* Add libraries endpoints
|
|
273
|
-
* Add stateful client
|
|
274
|
-
* Add object interface for libraries
|
|
275
|
-
|
|
276
|
-
## 5.3.1 - 2 Aug 2016
|
|
277
|
-
|
|
278
|
-
* Handle empty event names in the event stream.
|
|
279
|
-
|
|
280
|
-
## 5.3.0 - 8 June 2016
|
|
281
|
-
|
|
282
|
-
* Add details to README
|
|
283
|
-
* Adding responseTemplate and responseTopic to webhook creation. Thanks @acasas! [#20](https://github.com/particle-iot/particle-api-js/pull/20)
|
|
284
|
-
* Add password reset route [#27](https://github.com/particle-iot/particle-api-js/pull/27)
|
|
285
|
-
* Make event stream compatible with new product routes [#28](https://github.com/particle-iot/particle-api-js/pull/28)
|
|
286
|
-
|
|
287
|
-
## 5.2.7 - 2 May 2016
|
|
288
|
-
|
|
289
|
-
* Fix files parameter default name to be `file` and not `file1`.
|
|
290
|
-
|
|
291
|
-
## 5.2.6 - 25 Mar 2016
|
|
292
|
-
|
|
293
|
-
* Don't double publish event stream events if the event is named `event`.
|
|
294
|
-
|
|
295
|
-
## 5.2.5 - 21 Mar 2016
|
|
296
|
-
|
|
297
|
-
* Handle `JSON.parse` exceptions when parsing event stream
|
|
298
|
-
|
|
299
|
-
## 5.2.4 - 21 Mar 2016
|
|
300
|
-
|
|
301
|
-
* `flashDevice` `latest` also needs to be a string, not a boolean. [#12](https://github.com/particle-iot/particle-api-js/issues/12)
|
|
302
|
-
|
|
303
|
-
## 5.2.3 - 11 Mar 2016
|
|
304
|
-
|
|
305
|
-
* Remove setting of `User-Agent` header because that is not allowed in browsers. [#10](https://github.com/particle-iot/particle-api-js/issues/10)
|
|
306
|
-
|
|
307
|
-
## 5.2.2 - 3 Mar 2016
|
|
308
|
-
|
|
309
|
-
* Fix named event streams by encoding event name.
|
|
310
|
-
* Move access token to query string to eliminate preflight CORS request.
|
|
311
|
-
* Use fork of `stream-http` that prevents usage of `fetch` because it does not abort.
|
|
312
|
-
* Use correct streaming mode of `stream-http`.
|
|
313
|
-
|
|
314
|
-
## 5.2.1 - 3 Mar 2016
|
|
315
|
-
|
|
316
|
-
* Improve cleanup on `abort`.
|
|
317
|
-
|
|
318
|
-
## 5.2.0 - 3 Mar 2016
|
|
319
|
-
|
|
320
|
-
* Add support for organization and product slugs to `getEventStream`.
|
|
321
|
-
|
|
322
|
-
## 5.1.1 - 26 Feb 2016
|
|
323
|
-
|
|
324
|
-
* `JSON.parse` HTTP response body for `getEventStream` error case.
|
|
325
|
-
|
|
326
|
-
## 5.1.0 - 26 Feb 2016
|
|
327
|
-
|
|
328
|
-
* Fix event stream. [#8](https://github.com/particle-iot/particle-api-js/issues/8)
|
|
329
|
-
* Add `downloadFirmwareBinary`
|
|
330
|
-
* Add ability to intercept requests for debugging
|
|
331
|
-
* Use library version for User-Agent
|
|
332
|
-
* Allow request transfer for `claimDevice`
|
|
333
|
-
* `signalDevice` needs to use strings, not numbers.
|
|
334
|
-
* `compileCode` `latest` should be a string, not a boolean.
|
|
335
|
-
|
|
336
|
-
## 5.0.2 - 24 Feb 2016
|
|
337
|
-
|
|
338
|
-
* Remove trailing slash from `baseUrl`. [#7](https://github.com/particle-iot/particle-api-js/issues/7)
|
|
339
|
-
|
|
340
|
-
## 5.0.1 - 18 Feb 2016
|
|
341
|
-
|
|
342
|
-
* Remove need for `require('particle-api-js').default` in CommonJS usage. It is now just `require('particle-api-js')`.
|
|
343
|
-
|
|
344
|
-
## 5.0.0 - 18 Feb 2016
|
|
345
|
-
|
|
346
|
-
* Removed need for `babel-runtime`.
|
|
347
|
-
* Add `flashDevice`, `compileCode`, and `listAccessTokens`.
|
|
348
|
-
* Add missing options to `createWebhook`.
|
|
349
|
-
* Remove `downloadFirmwareBinary`.
|
|
350
|
-
|
|
351
|
-
## 4.2.1 - 8 Feb 2016
|
|
352
|
-
|
|
353
|
-
* Update contributors.
|
|
354
|
-
|
|
355
|
-
## 4.2.0 - 8 Feb 2016
|
|
356
|
-
|
|
357
|
-
* Add `downloadFirmwareBinary`.
|
|
358
|
-
|
|
359
|
-
## 4.1.0 - 14 Jan 2016
|
|
360
|
-
|
|
361
|
-
* Add `validatePromoCode`.
|
|
362
|
-
* `activateSIM` now requires `promo_code` and `action`.
|
|
363
|
-
|
|
364
|
-
## 4.0.2 - 16 Nov 2015
|
|
365
|
-
|
|
366
|
-
* Fix old `code` reference.
|
|
367
|
-
|
|
368
|
-
## 4.0.1 - 16 Nov 2015
|
|
369
|
-
|
|
370
|
-
* Change `code` to `statusCode` in rejection.
|
|
371
|
-
|
|
372
|
-
## 4.0.0 - 16 Nov 2015
|
|
373
|
-
|
|
374
|
-
* Add `statusCode` to Promise fulfillment.
|
|
375
|
-
|
|
376
|
-
## 3.0.3 - 6 Nov 2015
|
|
377
|
-
|
|
378
|
-
* Add `listBuildTargets`.
|
|
379
|
-
|
|
380
|
-
## 3.0.2 - 5 Nov 2015
|
|
381
|
-
|
|
382
|
-
* Add `countryCode` to `activateSIM`.
|
|
383
|
-
|
|
384
|
-
## 3.0.1 - 26 Oct 2015
|
|
385
|
-
|
|
386
|
-
* Fix `activateSIM`.
|
|
387
|
-
|
|
388
|
-
## 3.0.0 - 26 Oct 2015
|
|
389
|
-
|
|
390
|
-
* Replace `request` with `superagent`.
|
|
391
|
-
* Add `iccid` to `getClaimCode`.
|
|
392
|
-
* Only use form encoding on `login` and `signup`.
|
|
393
|
-
|
|
394
|
-
## 2.0.1 - 23 Oct 2015
|
|
395
|
-
|
|
396
|
-
* Removed browser entry in package.json. This makes it possible to bundle the module with other apps that use browserify without causing relative pathing issues.
|
|
397
|
-
|
|
398
|
-
## 2.0.0 - 20 Oct 2015
|
|
399
|
-
|
|
400
|
-
* Improved error handling and reporting. Network errors and HTTP errors now both return `code` property that can be more easily used to programmatically detect error types.
|
|
401
|
-
|
|
402
|
-
## 1.0.1 - 24 Sep 2015
|
|
403
|
-
|
|
404
|
-
## 1.0.0 - 24 Sep 2015
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
End-to-end test program for the event stream in the browser
|
|
3
|
-
|
|
4
|
-
Steps:
|
|
5
|
-
- npm run build
|
|
6
|
-
- Replace the path to particle.min.js
|
|
7
|
-
- Replace your access token in `auth`
|
|
8
|
-
- Open this file in the browser
|
|
9
|
-
- Follow the scenarios in EventStream.feature
|
|
10
|
-
|
|
11
|
-
-->
|
|
12
|
-
|
|
13
|
-
<html>
|
|
14
|
-
<body>
|
|
15
|
-
<p>Open the Javascript Console</p>
|
|
16
|
-
<script type="text/javascript" src="file:///home/user/path/to/particle-api-js/dist/particle.min.js"></script>
|
|
17
|
-
<script type="text/javascript">
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const baseUrl = 'http://localhost:9090';
|
|
21
|
-
const auth = '<my-token>';
|
|
22
|
-
const particle = new Particle({ baseUrl });
|
|
23
|
-
|
|
24
|
-
particle.getEventStream({ deviceId: 'mine', auth }).then(stream => {
|
|
25
|
-
console.log('event stream connected');
|
|
26
|
-
|
|
27
|
-
['event', 'error', 'disconnect', 'reconnect', 'reconnect-success', 'reconnect-error'].forEach(eventName => {
|
|
28
|
-
stream.on(eventName, (arg) => {
|
|
29
|
-
console.log(eventName, arg);
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
}).catch(function (err) {
|
|
34
|
-
console.log(err);
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
</script>
|
|
38
|
-
</body>
|
|
39
|
-
</html>
|
package/EventStream-e2e-node.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
|
|
3
|
-
End-to-end test program for the event stream with Node
|
|
4
|
-
|
|
5
|
-
Steps:
|
|
6
|
-
- PARTICLE_API_TOKEN=<my-token> node EventStream-e2e-node.js
|
|
7
|
-
- Follow the scenarios in EventStream.feature
|
|
8
|
-
|
|
9
|
-
*/
|
|
10
|
-
'use strict';
|
|
11
|
-
const Particle = require('./src/Particle');
|
|
12
|
-
const baseUrl = process.env.PARTICLE_API_BASE_URL || 'http://localhost:9090';
|
|
13
|
-
const auth = process.env.PARTICLE_API_TOKEN;
|
|
14
|
-
const particle = new Particle({ baseUrl });
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
/* eslint-disable no-console */
|
|
18
|
-
particle.getEventStream({ deviceId: 'mine', auth })
|
|
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
|
-
/* eslint-enable no-console */
|
|
34
|
-
|
package/RELEASE.md
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# Releasing a new version
|
|
2
|
-
|
|
3
|
-
1. Merge your changes to master and be on `master`
|
|
4
|
-
2. Run `npm version <major|minor|patch>`
|
|
5
|
-
1. This builds the distribution file `particle.js.min` and generates the
|
|
6
|
-
API documentation. Before the command finishes, update `CHANGELOG.md`.
|
|
7
|
-
3. Push to origin `git push --follow-tags`
|
|
8
|
-
4. CircleCI will publish the npm package to the `latest` tag
|
|
9
|
-
5. Create a release on GitHub with the notes from the `CHANGELOG.md`
|
|
10
|
-
6. Point your project to the new version `npm install particle-api-js@latest`
|
|
11
|
-
|
|
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)
|
package/bower.json
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "particle-api-js",
|
|
3
|
-
"homepage": "https://github.com/particle-iot/particle-api-js",
|
|
4
|
-
"authors": [
|
|
5
|
-
"Bryce Kahle <bryce@particle.io>"
|
|
6
|
-
],
|
|
7
|
-
"description": "Particle API JavaScript library",
|
|
8
|
-
"main": "dist/particle.min.js",
|
|
9
|
-
"moduleType": [
|
|
10
|
-
"amd",
|
|
11
|
-
"globals",
|
|
12
|
-
"node"
|
|
13
|
-
],
|
|
14
|
-
"keywords": [
|
|
15
|
-
"particle",
|
|
16
|
-
"IoT"
|
|
17
|
-
],
|
|
18
|
-
"license": "LGPL-3.0",
|
|
19
|
-
"ignore": [
|
|
20
|
-
"**/.*",
|
|
21
|
-
"node_modules",
|
|
22
|
-
"bower_components",
|
|
23
|
-
"test",
|
|
24
|
-
"tests"
|
|
25
|
-
],
|
|
26
|
-
"repository": {
|
|
27
|
-
"type": "git",
|
|
28
|
-
"url": "git://github.com/particle-iot/particle-api-js.git"
|
|
29
|
-
}
|
|
30
|
-
}
|