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/test/fixtures/index.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
const fixtures = {
|
|
3
|
-
'libraries.json': require('./libraries.json'),
|
|
4
|
-
'library.json': require('./library.json'),
|
|
5
|
-
'libraryVersions.json': require('./libraryVersions.json')
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
function read(filename) {
|
|
9
|
-
if (!fixtures[filename]) {
|
|
10
|
-
throw new Error(`Fixture ${filename} doesn't exit`);
|
|
11
|
-
}
|
|
12
|
-
return fixtures[filename];
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
module.exports = { read };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"data": [
|
|
3
|
-
{
|
|
4
|
-
"type": "libraries",
|
|
5
|
-
"id": "neopixel",
|
|
6
|
-
"links": {
|
|
7
|
-
"download": "https://binaries.particle.io/libraries/neopixel/neopixel-0.0.10.tar.gz"
|
|
8
|
-
},
|
|
9
|
-
"attributes": {
|
|
10
|
-
"name": "neopixel",
|
|
11
|
-
"version": "0.0.10",
|
|
12
|
-
"license": "GNU GPLv3",
|
|
13
|
-
"author": "Phil Burgess / Paint Your Dragon for Adafruit Industries",
|
|
14
|
-
"maintainer": "Brett Walach <technobly@gmail.com>",
|
|
15
|
-
"sentence": "Neopixel LED library",
|
|
16
|
-
"paragraph": "An Implementation of Adafruit's NeoPixel Library for the Spark Core, Particle Photon, P1, Electron and RedBear Duo",
|
|
17
|
-
"category": "Other",
|
|
18
|
-
"url": "https://github.com/technobly/SparkCore-NeoPixel",
|
|
19
|
-
"repository": "technobly/SparkCore-NeoPixel",
|
|
20
|
-
"architectures": [
|
|
21
|
-
"avr",
|
|
22
|
-
"spark-core",
|
|
23
|
-
"particle-photon",
|
|
24
|
-
"particle-p1",
|
|
25
|
-
"particle-electron",
|
|
26
|
-
"redbear-duo"
|
|
27
|
-
],
|
|
28
|
-
"dependencies": {}
|
|
29
|
-
},
|
|
30
|
-
"relationships": {}
|
|
31
|
-
}
|
|
32
|
-
]
|
|
33
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"data": {
|
|
3
|
-
"type": "libraries",
|
|
4
|
-
"id": "neopixel",
|
|
5
|
-
"links": {
|
|
6
|
-
"download": "https://binaries.particle.io/libraries/neopixel/neopixel-0.0.10.tar.gz"
|
|
7
|
-
},
|
|
8
|
-
"attributes": {
|
|
9
|
-
"name": "neopixel",
|
|
10
|
-
"version": "0.0.10",
|
|
11
|
-
"license": "GNU GPLv3",
|
|
12
|
-
"author": "Phil Burgess / Paint Your Dragon for Adafruit Industries",
|
|
13
|
-
"maintainer": "Brett Walach <technobly@gmail.com>",
|
|
14
|
-
"sentence": "Neopixel LED library",
|
|
15
|
-
"paragraph": "An Implementation of Adafruit's NeoPixel Library for the Spark Core, Particle Photon, P1, Electron and RedBear Duo",
|
|
16
|
-
"category": "Other",
|
|
17
|
-
"url": "https://github.com/technobly/SparkCore-NeoPixel",
|
|
18
|
-
"repository": "technobly/SparkCore-NeoPixel",
|
|
19
|
-
"architectures": [
|
|
20
|
-
"avr",
|
|
21
|
-
"spark-core",
|
|
22
|
-
"particle-photon",
|
|
23
|
-
"particle-p1",
|
|
24
|
-
"particle-electron",
|
|
25
|
-
"redbear-duo"
|
|
26
|
-
],
|
|
27
|
-
"dependencies": {}
|
|
28
|
-
},
|
|
29
|
-
"relationships": {}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"data": [
|
|
3
|
-
{
|
|
4
|
-
"type": "libraries",
|
|
5
|
-
"id": "neopixel",
|
|
6
|
-
"links": {
|
|
7
|
-
"download": "https://library-archives.particle.io/libraries/neopixel/neopixel-0.0.10.tar.gz"
|
|
8
|
-
},
|
|
9
|
-
"attributes": {
|
|
10
|
-
"name": "neopixel",
|
|
11
|
-
"version": "0.0.10",
|
|
12
|
-
"installs": 7385,
|
|
13
|
-
"license": "GNU GPLv3",
|
|
14
|
-
"author": "Adafruit, Technobly",
|
|
15
|
-
"maintainer": null,
|
|
16
|
-
"sentence": "An Implementation of Adafruit's NeoPixel Library for the Spark Core, Particle Photon, P1, Electron and RedBear Duo",
|
|
17
|
-
"paragraph": null,
|
|
18
|
-
"category": null,
|
|
19
|
-
"url": null,
|
|
20
|
-
"repository": null,
|
|
21
|
-
"architectures": [],
|
|
22
|
-
"dependencies": null,
|
|
23
|
-
"build": null
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"type": "libraries",
|
|
28
|
-
"id": "neopixel",
|
|
29
|
-
"links": {
|
|
30
|
-
"download": "https://library-archives.particle.io/libraries/neopixel/neopixel-0.0.9.tar.gz"
|
|
31
|
-
},
|
|
32
|
-
"attributes": {
|
|
33
|
-
"name": "neopixel",
|
|
34
|
-
"version": "0.0.9",
|
|
35
|
-
"installs": 7385,
|
|
36
|
-
"license": "GNU GPLv3",
|
|
37
|
-
"author": "Adafruit, Technobly",
|
|
38
|
-
"maintainer": null,
|
|
39
|
-
"sentence": "An Implementation of Adafruit's NeoPixel Library for the Spark Core, Photon, P1 and Electron",
|
|
40
|
-
"paragraph": null,
|
|
41
|
-
"category": null,
|
|
42
|
-
"url": null,
|
|
43
|
-
"repository": null,
|
|
44
|
-
"architectures": [],
|
|
45
|
-
"dependencies": null,
|
|
46
|
-
"build": null
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"type": "libraries",
|
|
51
|
-
"id": "neopixel",
|
|
52
|
-
"links": {
|
|
53
|
-
"download": "https://library-archives.particle.io/libraries/neopixel/neopixel-0.0.8.tar.gz"
|
|
54
|
-
},
|
|
55
|
-
"attributes": {
|
|
56
|
-
"name": "neopixel",
|
|
57
|
-
"version": "0.0.8",
|
|
58
|
-
"installs": 7385,
|
|
59
|
-
"license": "GNU GPLv3",
|
|
60
|
-
"author": "Adafruit, Technobly",
|
|
61
|
-
"maintainer": null,
|
|
62
|
-
"sentence": "An Implementation of Adafruit's NeoPixel Library for the Spark Core, Photon, P1 and Electron",
|
|
63
|
-
"paragraph": null,
|
|
64
|
-
"category": null,
|
|
65
|
-
"url": null,
|
|
66
|
-
"repository": null,
|
|
67
|
-
"architectures": [],
|
|
68
|
-
"dependencies": null,
|
|
69
|
-
"build": null
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
"type": "libraries",
|
|
74
|
-
"id": "neopixel",
|
|
75
|
-
"links": {
|
|
76
|
-
"download": "https://library-archives.particle.io/libraries/neopixel/neopixel-0.0.7.tar.gz"
|
|
77
|
-
},
|
|
78
|
-
"attributes": {
|
|
79
|
-
"name": "neopixel",
|
|
80
|
-
"version": "0.0.7",
|
|
81
|
-
"installs": 7385,
|
|
82
|
-
"license": "GNU GPLv3",
|
|
83
|
-
"author": "Adafruit, Technobly",
|
|
84
|
-
"maintainer": null,
|
|
85
|
-
"sentence": "An Implementation of Adafruit's NeoPixel Library for the Spark Core and Photon",
|
|
86
|
-
"paragraph": null,
|
|
87
|
-
"category": null,
|
|
88
|
-
"url": null,
|
|
89
|
-
"repository": null,
|
|
90
|
-
"architectures": [],
|
|
91
|
-
"dependencies": null,
|
|
92
|
-
"build": null
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
"type": "libraries",
|
|
97
|
-
"id": "neopixel",
|
|
98
|
-
"links": {
|
|
99
|
-
"download": "https://library-archives.particle.io/libraries/neopixel/neopixel-0.0.6.tar.gz"
|
|
100
|
-
},
|
|
101
|
-
"attributes": {
|
|
102
|
-
"name": "neopixel",
|
|
103
|
-
"version": "0.0.6",
|
|
104
|
-
"installs": 7385,
|
|
105
|
-
"license": "GNU GPLv3",
|
|
106
|
-
"author": "Adafruit, Technobly",
|
|
107
|
-
"maintainer": null,
|
|
108
|
-
"sentence": "An Implementation of Adafruit's NeoPixel Library for the Spark Core and Photon",
|
|
109
|
-
"paragraph": null,
|
|
110
|
-
"category": null,
|
|
111
|
-
"url": null,
|
|
112
|
-
"repository": null,
|
|
113
|
-
"architectures": [],
|
|
114
|
-
"dependencies": null,
|
|
115
|
-
"build": null
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
"type": "libraries",
|
|
120
|
-
"id": "neopixel",
|
|
121
|
-
"links": {
|
|
122
|
-
"download": "https://library-archives.particle.io/libraries/neopixel/neopixel-0.0.5.tar.gz"
|
|
123
|
-
},
|
|
124
|
-
"attributes": {
|
|
125
|
-
"name": "neopixel",
|
|
126
|
-
"version": "0.0.5",
|
|
127
|
-
"installs": 7385,
|
|
128
|
-
"license": "GNU GPLv3",
|
|
129
|
-
"author": "Adafruit, Technobly",
|
|
130
|
-
"maintainer": null,
|
|
131
|
-
"sentence": "An Implementation of Adafruit's NeoPixel Library for the Spark Core",
|
|
132
|
-
"paragraph": null,
|
|
133
|
-
"category": null,
|
|
134
|
-
"url": null,
|
|
135
|
-
"repository": null,
|
|
136
|
-
"architectures": [],
|
|
137
|
-
"dependencies": null,
|
|
138
|
-
"build": null
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
"type": "libraries",
|
|
143
|
-
"id": "neopixel",
|
|
144
|
-
"links": {
|
|
145
|
-
"download": "https://library-archives.particle.io/libraries/neopixel/neopixel-0.0.4.tar.gz"
|
|
146
|
-
},
|
|
147
|
-
"attributes": {
|
|
148
|
-
"name": "neopixel",
|
|
149
|
-
"version": "0.0.4",
|
|
150
|
-
"installs": 7385,
|
|
151
|
-
"license": "GNU GPLv3",
|
|
152
|
-
"author": "Adafruit, Technobly",
|
|
153
|
-
"maintainer": null,
|
|
154
|
-
"sentence": "An Implementation of Adafruit's NeoPixel Library for the Spark Core",
|
|
155
|
-
"paragraph": null,
|
|
156
|
-
"category": null,
|
|
157
|
-
"url": null,
|
|
158
|
-
"repository": null,
|
|
159
|
-
"architectures": [],
|
|
160
|
-
"dependencies": null,
|
|
161
|
-
"build": null
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
"type": "libraries",
|
|
166
|
-
"id": "neopixel",
|
|
167
|
-
"links": {
|
|
168
|
-
"download": "https://library-archives.particle.io/libraries/neopixel/neopixel-0.0.3.tar.gz"
|
|
169
|
-
},
|
|
170
|
-
"attributes": {
|
|
171
|
-
"name": "neopixel",
|
|
172
|
-
"version": "0.0.3",
|
|
173
|
-
"installs": 7385,
|
|
174
|
-
"license": "GNU GPLv3",
|
|
175
|
-
"author": "Adafruit, Technobly",
|
|
176
|
-
"maintainer": null,
|
|
177
|
-
"sentence": "An Implementation of Adafruit's NeoPixel Library for the Spark Core",
|
|
178
|
-
"paragraph": null,
|
|
179
|
-
"category": null,
|
|
180
|
-
"url": null,
|
|
181
|
-
"repository": null,
|
|
182
|
-
"architectures": [],
|
|
183
|
-
"dependencies": null,
|
|
184
|
-
"build": null
|
|
185
|
-
}
|
|
186
|
-
},
|
|
187
|
-
{
|
|
188
|
-
"type": "libraries",
|
|
189
|
-
"id": "neopixel",
|
|
190
|
-
"links": {
|
|
191
|
-
"download": "https://library-archives.particle.io/libraries/neopixel/neopixel-0.0.2.tar.gz"
|
|
192
|
-
},
|
|
193
|
-
"attributes": {
|
|
194
|
-
"name": "neopixel",
|
|
195
|
-
"version": "0.0.2",
|
|
196
|
-
"installs": 7385,
|
|
197
|
-
"license": "GNU GPLv3",
|
|
198
|
-
"author": "Adafruit, Technobly",
|
|
199
|
-
"maintainer": null,
|
|
200
|
-
"sentence": "An Implementation of Adafruit's NeoPixel Library for the Spark Core",
|
|
201
|
-
"paragraph": null,
|
|
202
|
-
"category": null,
|
|
203
|
-
"url": null,
|
|
204
|
-
"repository": null,
|
|
205
|
-
"architectures": [],
|
|
206
|
-
"dependencies": null,
|
|
207
|
-
"build": null
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
]
|
|
211
|
-
}
|
package/test/out.tmp
DELETED
|
Binary file
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// Serve files from the fixture folder
|
|
2
|
-
'use strict';
|
|
3
|
-
const express = require('express');
|
|
4
|
-
const fixtures = require('../fixtures');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class FixtureHttpServer {
|
|
8
|
-
constructor(){
|
|
9
|
-
this.app = express();
|
|
10
|
-
this.app.get('/:filename', (req, res) => {
|
|
11
|
-
res.writeHead(200, { 'Content-Type': 'application/octet-stream' });
|
|
12
|
-
res.end(fixtures.read(req.params['filename']), 'binary');
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// Call in a before() test hook
|
|
17
|
-
listen(){
|
|
18
|
-
return new Promise(fulfill => {
|
|
19
|
-
this.server = this.app.listen(0, fulfill);
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
url(){
|
|
24
|
-
return `http://localhost:${this.server.address().port}`;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
module.exports = FixtureHttpServer;
|
package/test/test-setup.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// Set up the Mocha test framework with the Chai assertion library and
|
|
2
|
-
// the Sinon mock library
|
|
3
|
-
'use strict';
|
|
4
|
-
const chai = require('chai');
|
|
5
|
-
const sinon = require('sinon');
|
|
6
|
-
const sinonChai = require('sinon-chai');
|
|
7
|
-
const chaiAsPromised = require('chai-as-promised');
|
|
8
|
-
|
|
9
|
-
chai.use(sinonChai);
|
|
10
|
-
chai.use(chaiAsPromised);
|
|
11
|
-
const expect = chai.expect;
|
|
12
|
-
|
|
13
|
-
module.exports = {
|
|
14
|
-
chai,
|
|
15
|
-
sinon,
|
|
16
|
-
expect
|
|
17
|
-
};
|
package/tsconfig.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"module": "commonjs",
|
|
4
|
-
"target": "es6",
|
|
5
|
-
"allowJs": true,
|
|
6
|
-
"checkJs": true,
|
|
7
|
-
"skipLibCheck": true,
|
|
8
|
-
"esModuleInterop": true,
|
|
9
|
-
"resolveJsonModule": true,
|
|
10
|
-
"strict": true,
|
|
11
|
-
"noImplicitAny": false,
|
|
12
|
-
"noEmit": true
|
|
13
|
-
},
|
|
14
|
-
"types": ["node"],
|
|
15
|
-
"include": [ "src" ],
|
|
16
|
-
"exclude": ["node_modules"]
|
|
17
|
-
}
|
package/webpack.config.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const webpack = require('webpack');
|
|
4
|
-
const TerserPlugin = require('terser-webpack-plugin');
|
|
5
|
-
|
|
6
|
-
module.exports = (env) => {
|
|
7
|
-
return {
|
|
8
|
-
mode: env.mode,
|
|
9
|
-
target: 'web',
|
|
10
|
-
entry: './src/Particle.js',
|
|
11
|
-
devtool: 'source-map',
|
|
12
|
-
output: {
|
|
13
|
-
filename: `particle${env.mode === 'production' ? '.min' : ''}.js`,
|
|
14
|
-
path: path.resolve(__dirname, 'dist'),
|
|
15
|
-
clean: true,
|
|
16
|
-
library: {
|
|
17
|
-
name: 'Particle',
|
|
18
|
-
type: 'var'
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
optimization: {
|
|
22
|
-
minimize: env.mode === 'production',
|
|
23
|
-
minimizer: [new TerserPlugin({
|
|
24
|
-
extractComments: false,
|
|
25
|
-
terserOptions: {
|
|
26
|
-
format: {
|
|
27
|
-
comments: false
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
})]
|
|
31
|
-
},
|
|
32
|
-
resolve: {
|
|
33
|
-
fallback: {
|
|
34
|
-
buffer: require.resolve('buffer'),
|
|
35
|
-
events: require.resolve('events'),
|
|
36
|
-
url: require.resolve('url')
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
plugins: [
|
|
40
|
-
new webpack.ProvidePlugin({
|
|
41
|
-
Buffer: ['buffer', 'Buffer'],
|
|
42
|
-
process: 'process/browser',
|
|
43
|
-
})
|
|
44
|
-
]
|
|
45
|
-
};
|
|
46
|
-
};
|