particle-api-js 12.0.0 → 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/dist/particle.min.js +1 -1
- package/dist/particle.min.js.map +1 -1
- package/lib/package.json +2 -1
- package/lib/src/Agent.d.ts +4 -2
- package/lib/src/Agent.d.ts.map +1 -1
- package/lib/src/Agent.js +7 -2
- package/lib/src/Agent.js.map +1 -1
- package/lib/src/EventStream.d.ts +3 -1
- package/lib/src/EventStream.d.ts.map +1 -1
- package/lib/src/EventStream.js +8 -3
- package/lib/src/EventStream.js.map +1 -1
- package/lib/src/Particle.d.ts +272 -552
- package/lib/src/Particle.d.ts.map +1 -1
- package/lib/src/Particle.js +120 -336
- package/lib/src/Particle.js.map +1 -1
- package/lib/src/types/common.d.ts +2 -0
- package/lib/src/types/common.d.ts.map +1 -1
- package/lib/src/types/requests.d.ts +0 -99
- package/lib/src/types/requests.d.ts.map +1 -1
- package/lib/src/types/responses.d.ts +0 -23
- package/lib/src/types/responses.d.ts.map +1 -1
- package/package.json +2 -1
package/lib/src/Particle.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import EventStream = require('./EventStream');
|
|
2
2
|
import Agent = require('./Agent');
|
|
3
3
|
import Client = require('./Client');
|
|
4
|
-
import type
|
|
4
|
+
import type * as T from './types';
|
|
5
|
+
import { type Agent as HttpAgent } from 'http';
|
|
5
6
|
/**
|
|
6
7
|
* Particle Cloud API wrapper.
|
|
7
8
|
*
|
|
@@ -19,10 +20,11 @@ declare class Particle {
|
|
|
19
20
|
tokenDuration: number;
|
|
20
21
|
auth: string | undefined;
|
|
21
22
|
context: {
|
|
22
|
-
tool?: ToolContext;
|
|
23
|
-
project?: ProjectContext;
|
|
23
|
+
tool?: T.ToolContext;
|
|
24
|
+
project?: T.ProjectContext;
|
|
24
25
|
};
|
|
25
26
|
agent: Agent;
|
|
27
|
+
httpAgent: HttpAgent | undefined;
|
|
26
28
|
_defaultAuth?: string;
|
|
27
29
|
/**
|
|
28
30
|
* Contructor for the Cloud API wrapper.
|
|
@@ -35,27 +37,22 @@ declare class Particle {
|
|
|
35
37
|
* @param {string} [options.clientId]
|
|
36
38
|
* @param {number} [options.tokenDuration]
|
|
37
39
|
* @param {string} [options.auth] The access token. If not specified here, will have to be added to every request
|
|
40
|
+
* @param {HttpAgent} [options.httpAgent] The http.Agent to use for requests (e.g. an https-proxy-agent instance for corporate proxies)
|
|
38
41
|
*/
|
|
39
|
-
constructor(options?:
|
|
40
|
-
baseUrl?: string;
|
|
41
|
-
clientId?: string;
|
|
42
|
-
clientSecret?: string;
|
|
43
|
-
tokenDuration?: number;
|
|
44
|
-
auth?: string;
|
|
45
|
-
});
|
|
42
|
+
constructor(options?: T.ParticleOptions);
|
|
46
43
|
private _isValidContext;
|
|
47
44
|
/**
|
|
48
|
-
* @typedef {Object} ToolContext
|
|
45
|
+
* @typedef {Object} T.ToolContext
|
|
49
46
|
* @property {string} name
|
|
50
47
|
* @property {string | number} [version]
|
|
51
|
-
* @property {Omit<ToolContext, 'components'>[]} [components]
|
|
48
|
+
* @property {Omit<T.ToolContext, 'components'>[]} [components]
|
|
52
49
|
*/
|
|
53
50
|
/**
|
|
54
|
-
* @typedef {Record<string, string | number>} ProjectContext
|
|
51
|
+
* @typedef {Record<string, string | number>} T.ProjectContext
|
|
55
52
|
* @property {string} name
|
|
56
53
|
*/
|
|
57
54
|
/** @internal */
|
|
58
|
-
setContext(name: 'tool' | 'project', context: ToolContext | ProjectContext | undefined): void;
|
|
55
|
+
setContext(name: 'tool' | 'project', context: T.ToolContext | T.ProjectContext | undefined): void;
|
|
59
56
|
private _buildContext;
|
|
60
57
|
/**
|
|
61
58
|
* Login to Particle Cloud using an existing Particle acccount.
|
|
@@ -65,9 +62,9 @@ declare class Particle {
|
|
|
65
62
|
* @param {Number} options.tokenDuration How long the access token should last in seconds
|
|
66
63
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
67
64
|
* @param {Number} [options.context] Request context
|
|
68
|
-
* @returns {Promise<JSONResponse<LoginResponse>>} A promise that resolves with the response data
|
|
65
|
+
* @returns {Promise<T.JSONResponse<T.LoginResponse>>} A promise that resolves with the response data
|
|
69
66
|
*/
|
|
70
|
-
login({ username, password, tokenDuration, headers, context }: LoginOptions): Promise<JSONResponse<LoginResponse>>;
|
|
67
|
+
login({ username, password, tokenDuration, headers, context }: T.LoginOptions): Promise<T.JSONResponse<T.LoginResponse>>;
|
|
71
68
|
/**
|
|
72
69
|
* If login failed with an 'mfa_required' error, this must be called with a valid OTP code to login
|
|
73
70
|
* @param {Object} options Options for this API call
|
|
@@ -75,18 +72,18 @@ declare class Particle {
|
|
|
75
72
|
* @param {String} options.otp Current one-time-password generated from the authentication application
|
|
76
73
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
77
74
|
* @param {Number} [options.context] Request context
|
|
78
|
-
* @returns {Promise<JSONResponse<LoginResponse>>} A promise that resolves with the response data
|
|
75
|
+
* @returns {Promise<T.JSONResponse<T.LoginResponse>>} A promise that resolves with the response data
|
|
79
76
|
*/
|
|
80
|
-
sendOtp({ mfaToken, otp, headers, context }: SendOtpOptions): Promise<JSONResponse<LoginResponse>>;
|
|
77
|
+
sendOtp({ mfaToken, otp, headers, context }: T.SendOtpOptions): Promise<T.JSONResponse<T.LoginResponse>>;
|
|
81
78
|
/**
|
|
82
79
|
* Enable MFA on the currently logged in user
|
|
83
80
|
* @param {Object} options Options for this API call
|
|
84
81
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
85
82
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
86
83
|
* @param {Object} [options.context] Request context
|
|
87
|
-
* @returns {Promise<JSONResponse<EnableMfaResponse>>} A promise that resolves with the response data
|
|
84
|
+
* @returns {Promise<T.JSONResponse<T.EnableMfaResponse>>} A promise that resolves with the response data
|
|
88
85
|
*/
|
|
89
|
-
enableMfa({ auth, headers, context }: EnableMfaOptions): Promise<JSONResponse<EnableMfaResponse>>;
|
|
86
|
+
enableMfa({ auth, headers, context }: T.EnableMfaOptions): Promise<T.JSONResponse<T.EnableMfaResponse>>;
|
|
90
87
|
/**
|
|
91
88
|
* Confirm MFA for the user. This must be called with current TOTP code, determined from the results of enableMfa(). You will be prompted to enter an OTP code every time you login after enrollment is confirmed.
|
|
92
89
|
* @param {Object} options Options for this API call
|
|
@@ -96,9 +93,9 @@ declare class Particle {
|
|
|
96
93
|
* @param {Boolean} options.invalidateTokens Should all tokens be invalidated
|
|
97
94
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
98
95
|
* @param {Object} [options.context] Request context
|
|
99
|
-
* @returns {Promise<JSONResponse<ConfirmMfaResponse>>} A promise that resolves with the response data
|
|
96
|
+
* @returns {Promise<T.JSONResponse<T.ConfirmMfaResponse>>} A promise that resolves with the response data
|
|
100
97
|
*/
|
|
101
|
-
confirmMfa({ mfaToken, otp, invalidateTokens, auth, headers, context }: ConfirmMfaOptions): Promise<JSONResponse<ConfirmMfaResponse>>;
|
|
98
|
+
confirmMfa({ mfaToken, otp, invalidateTokens, auth, headers, context }: T.ConfirmMfaOptions): Promise<T.JSONResponse<T.ConfirmMfaResponse>>;
|
|
102
99
|
/**
|
|
103
100
|
* Disable MFA for the user.
|
|
104
101
|
* @param {Object} options Options for this API call
|
|
@@ -106,9 +103,9 @@ declare class Particle {
|
|
|
106
103
|
* @param {Object} options.currentPassword User's current password
|
|
107
104
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
108
105
|
* @param {Object} [options.context] Request context
|
|
109
|
-
* @returns {Promise<JSONResponse<OKResponse>>} A promise that resolves with the response data
|
|
106
|
+
* @returns {Promise<T.JSONResponse<T.OKResponse>>} A promise that resolves with the response data
|
|
110
107
|
*/
|
|
111
|
-
disableMfa({ currentPassword, auth, headers, context }: DisableMfaOptions): Promise<JSONResponse<OKResponse>>;
|
|
108
|
+
disableMfa({ currentPassword, auth, headers, context }: T.DisableMfaOptions): Promise<T.JSONResponse<T.OKResponse>>;
|
|
112
109
|
/**
|
|
113
110
|
* Create Customer for Product.
|
|
114
111
|
* @param {Object} options Options for this API call
|
|
@@ -117,17 +114,17 @@ declare class Particle {
|
|
|
117
114
|
* @param {String} options.product Create the customer in this product ID or slug
|
|
118
115
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
119
116
|
* @param {Object} [options.context] Request context
|
|
120
|
-
* @returns {Promise<JSONResponse<CreateCustomerResponse>>} A promise that resolves with the response data
|
|
117
|
+
* @returns {Promise<T.JSONResponse<T.CreateCustomerResponse>>} A promise that resolves with the response data
|
|
121
118
|
*/
|
|
122
|
-
createCustomer({ email, password, product, headers, context }: CreateCustomerOptions): Promise<JSONResponse<CreateCustomerResponse>>;
|
|
119
|
+
createCustomer({ email, password, product, headers, context }: T.CreateCustomerOptions): Promise<T.JSONResponse<T.CreateCustomerResponse>>;
|
|
123
120
|
/**
|
|
124
121
|
* Login to Particle Cloud using an OAuth client.
|
|
125
122
|
* @param {Object} options Options for this API call
|
|
126
123
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
127
124
|
* @param {Object} [options.context] Request context
|
|
128
|
-
* @returns {Promise<JSONResponse<LoginResponse>>} A promise that resolves with the response data
|
|
125
|
+
* @returns {Promise<T.JSONResponse<T.LoginResponse>>} A promise that resolves with the response data
|
|
129
126
|
*/
|
|
130
|
-
loginAsClientOwner({ headers, context }?: LoginAsClientOwnerOptions): Promise<JSONResponse<LoginResponse>>;
|
|
127
|
+
loginAsClientOwner({ headers, context }?: T.LoginAsClientOwnerOptions): Promise<T.JSONResponse<T.LoginResponse>>;
|
|
131
128
|
/**
|
|
132
129
|
* Create a user account for the Particle Cloud
|
|
133
130
|
* @param {Object} options Options for this API call
|
|
@@ -137,55 +134,45 @@ declare class Particle {
|
|
|
137
134
|
* @param {Object} [options.utm] Object that contains info about the campaign that lead to this user creation
|
|
138
135
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
139
136
|
* @param {Object} [options.context] Request context
|
|
140
|
-
* @returns {Promise<JSONResponse<OKResponse>>} A promise that resolves with the response data
|
|
137
|
+
* @returns {Promise<T.JSONResponse<T.OKResponse>>} A promise that resolves with the response data
|
|
141
138
|
*/
|
|
142
|
-
createUser({ username, password, accountInfo, utm, headers, context }:
|
|
143
|
-
username: string;
|
|
144
|
-
password: string;
|
|
145
|
-
accountInfo?: Record<string, string | number | boolean>;
|
|
146
|
-
utm?: Record<string, string>;
|
|
147
|
-
headers?: Record<string, string>;
|
|
148
|
-
context?: {
|
|
149
|
-
tool?: ToolContext;
|
|
150
|
-
project?: ProjectContext;
|
|
151
|
-
};
|
|
152
|
-
}): Promise<JSONResponse<OKResponse>>;
|
|
139
|
+
createUser({ username, password, accountInfo, utm, headers, context }: T.CreateUserOptions): Promise<T.JSONResponse<T.OKResponse>>;
|
|
153
140
|
/**
|
|
154
141
|
* Send reset password email for a Particle Cloud user account
|
|
155
142
|
* @param {Object} options Options for this API call
|
|
156
143
|
* @param {String} options.username Email of the user
|
|
157
144
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
158
145
|
* @param {Object} [options.context] Request context
|
|
159
|
-
* @returns {Promise<JSONResponse<OKResponse>>} A promise that resolves with the response data
|
|
146
|
+
* @returns {Promise<T.JSONResponse<T.OKResponse>>} A promise that resolves with the response data
|
|
160
147
|
*/
|
|
161
|
-
resetPassword({ username, headers, context }: ResetPasswordOptions): Promise<JSONResponse<OKResponse>>;
|
|
148
|
+
resetPassword({ username, headers, context }: T.ResetPasswordOptions): Promise<T.JSONResponse<T.OKResponse>>;
|
|
162
149
|
/**
|
|
163
150
|
* Revoke an access token
|
|
164
151
|
* @param {Object} options Options for this API call
|
|
165
152
|
* @param {String} options.token Access token you wish to revoke
|
|
166
153
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
167
154
|
* @param {Object} [options.context] Request context
|
|
168
|
-
* @returns {Promise<JSONResponse<OKResponse>>} A promise that resolves with the response data
|
|
155
|
+
* @returns {Promise<T.JSONResponse<T.OKResponse>>} A promise that resolves with the response data
|
|
169
156
|
*/
|
|
170
|
-
deleteAccessToken({ token, headers, context }: DeleteAccessTokenOptions): Promise<JSONResponse<OKResponse>>;
|
|
157
|
+
deleteAccessToken({ token, headers, context }: T.DeleteAccessTokenOptions): Promise<T.JSONResponse<T.OKResponse>>;
|
|
171
158
|
/**
|
|
172
159
|
* Revoke the current session access token
|
|
173
160
|
* @param {Object} options Options for this API call
|
|
174
161
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
175
162
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
176
163
|
* @param {Object} [options.context] Request context
|
|
177
|
-
* @returns {Promise<JSONResponse<OKResponse>>} A promise that resolves with the response data
|
|
164
|
+
* @returns {Promise<T.JSONResponse<T.OKResponse>>} A promise that resolves with the response data
|
|
178
165
|
*/
|
|
179
|
-
deleteCurrentAccessToken({ auth, headers, context }: DeleteCurrentAccessTokenOptions): Promise<JSONResponse<OKResponse>>;
|
|
166
|
+
deleteCurrentAccessToken({ auth, headers, context }: T.DeleteCurrentAccessTokenOptions): Promise<T.JSONResponse<T.OKResponse>>;
|
|
180
167
|
/**
|
|
181
168
|
* Revoke all active access tokens
|
|
182
169
|
* @param {Object} options Options for this API call
|
|
183
170
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
184
171
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
185
172
|
* @param {Object} [options.context] Request context
|
|
186
|
-
* @returns {Promise<JSONResponse<OKResponse>>} A promise that resolves with the response data
|
|
173
|
+
* @returns {Promise<T.JSONResponse<T.OKResponse>>} A promise that resolves with the response data
|
|
187
174
|
*/
|
|
188
|
-
deleteActiveAccessTokens({ auth, headers, context }: DeleteActiveAccessTokensOptions): Promise<JSONResponse<OKResponse>>;
|
|
175
|
+
deleteActiveAccessTokens({ auth, headers, context }: T.DeleteActiveAccessTokensOptions): Promise<T.JSONResponse<T.OKResponse>>;
|
|
189
176
|
/**
|
|
190
177
|
* Delete the current user
|
|
191
178
|
* @param {Object} options Options for this API call
|
|
@@ -193,9 +180,9 @@ declare class Particle {
|
|
|
193
180
|
* @param {String} options.password Password
|
|
194
181
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
195
182
|
* @param {Object} [options.context] Request context
|
|
196
|
-
* @returns {Promise<JSONResponse<OKResponse>>} A promise that resolves with the response data
|
|
183
|
+
* @returns {Promise<T.JSONResponse<T.OKResponse>>} A promise that resolves with the response data
|
|
197
184
|
*/
|
|
198
|
-
deleteUser({ auth, password, headers, context }: DeleteUserOptions): Promise<JSONResponse<OKResponse>>;
|
|
185
|
+
deleteUser({ auth, password, headers, context }: T.DeleteUserOptions): Promise<T.JSONResponse<T.OKResponse>>;
|
|
199
186
|
/**
|
|
200
187
|
* Retrieves the information that is used to identify the current login for tracking.
|
|
201
188
|
* @param {Object} [options] Options for this API call
|
|
@@ -204,9 +191,9 @@ declare class Particle {
|
|
|
204
191
|
* retrieve only the unique tracking ID for the current login.
|
|
205
192
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
206
193
|
* @param {Object} [options.context] Request context
|
|
207
|
-
* @returns {Promise<JSONResponse<TrackingIdentityResponse>>} A promise that resolves with the response data
|
|
194
|
+
* @returns {Promise<T.JSONResponse<T.TrackingIdentityResponse>>} A promise that resolves with the response data
|
|
208
195
|
*/
|
|
209
|
-
trackingIdentity({ full, auth, headers, context }?: TrackingIdentityOptions): Promise<JSONResponse<TrackingIdentityResponse>>;
|
|
196
|
+
trackingIdentity({ full, auth, headers, context }?: T.TrackingIdentityOptions): Promise<T.JSONResponse<T.TrackingIdentityResponse>>;
|
|
210
197
|
/**
|
|
211
198
|
* List devices claimed to the account or product
|
|
212
199
|
* @param {Object} options Options for this API call
|
|
@@ -221,24 +208,9 @@ declare class Particle {
|
|
|
221
208
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
222
209
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
223
210
|
* @param {Object} [options.context] Request context
|
|
224
|
-
* @returns {Promise<JSONResponse<DeviceInfo[]>>} A promise that resolves with the response data
|
|
225
|
-
*/
|
|
226
|
-
listDevices({ deviceId, deviceName, groups, sortAttr, sortDir, page, perPage, product, auth, headers, context }:
|
|
227
|
-
deviceId?: string;
|
|
228
|
-
deviceName?: string;
|
|
229
|
-
groups?: string[];
|
|
230
|
-
sortAttr?: string;
|
|
231
|
-
sortDir?: string;
|
|
232
|
-
page?: number;
|
|
233
|
-
perPage?: number;
|
|
234
|
-
product?: string | number;
|
|
235
|
-
auth?: string;
|
|
236
|
-
headers?: Record<string, string>;
|
|
237
|
-
context?: {
|
|
238
|
-
tool?: ToolContext;
|
|
239
|
-
project?: ProjectContext;
|
|
240
|
-
};
|
|
241
|
-
}): Promise<JSONResponse<DeviceInfo[]>>;
|
|
211
|
+
* @returns {Promise<T.JSONResponse<T.DeviceInfo[] | T.DeviceListResponse>>} A promise that resolves with the response data
|
|
212
|
+
*/
|
|
213
|
+
listDevices({ deviceId, deviceName, groups, sortAttr, sortDir, page, perPage, product, auth, headers, context }: T.ListDevicesOptions): Promise<T.JSONResponse<T.DeviceInfo[] | T.DeviceListResponse>>;
|
|
242
214
|
/**
|
|
243
215
|
* Get detailed informationa about a device
|
|
244
216
|
* @param {Object} options Options for this API call
|
|
@@ -247,9 +219,9 @@ declare class Particle {
|
|
|
247
219
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
248
220
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
249
221
|
* @param {Object} [options.context] Request context
|
|
250
|
-
* @returns {Promise<JSONResponse<DeviceInfo>>} A promise that resolves with the response data
|
|
222
|
+
* @returns {Promise<T.JSONResponse<T.DeviceInfo>>} A promise that resolves with the response data
|
|
251
223
|
*/
|
|
252
|
-
getDevice({ deviceId, product, auth, headers, context }: GetDeviceOptions): Promise<JSONResponse<DeviceInfo>>;
|
|
224
|
+
getDevice({ deviceId, product, auth, headers, context }: T.GetDeviceOptions): Promise<T.JSONResponse<T.DeviceInfo>>;
|
|
253
225
|
/**
|
|
254
226
|
* Claim a device to the account. The device must be online and unclaimed.
|
|
255
227
|
* @param {Object} options Options for this API call
|
|
@@ -258,9 +230,9 @@ declare class Particle {
|
|
|
258
230
|
* @param {boolean} options.requestTransfer True to request the device be transfered from another user
|
|
259
231
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
260
232
|
* @param {Object} [options.context] Request context
|
|
261
|
-
* @returns {Promise<JSONResponse<ClaimResponse>>} A promise that resolves with the response data
|
|
233
|
+
* @returns {Promise<T.JSONResponse<T.ClaimResponse>>} A promise that resolves with the response data
|
|
262
234
|
*/
|
|
263
|
-
claimDevice({ deviceId, requestTransfer, auth, headers, context }: ClaimDeviceOptions): Promise<JSONResponse<ClaimResponse>>;
|
|
235
|
+
claimDevice({ deviceId, requestTransfer, auth, headers, context }: T.ClaimDeviceOptions): Promise<T.JSONResponse<T.ClaimResponse>>;
|
|
264
236
|
/**
|
|
265
237
|
* Add a device to a product or move device out of quarantine.
|
|
266
238
|
* @param {Object} options Options for this API call
|
|
@@ -271,9 +243,9 @@ declare class Particle {
|
|
|
271
243
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
272
244
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
273
245
|
* @param {Object} [options.context] Request context
|
|
274
|
-
* @returns {Promise<JSONResponse<OKResponse>>} A promise that resolves with the response data
|
|
246
|
+
* @returns {Promise<T.JSONResponse<T.OKResponse>>} A promise that resolves with the response data
|
|
275
247
|
*/
|
|
276
|
-
addDeviceToProduct({ deviceId, product, file, auth, headers, context }: AddDeviceToProductOptions): Promise<JSONResponse<OKResponse>>;
|
|
248
|
+
addDeviceToProduct({ deviceId, product, file, auth, headers, context }: T.AddDeviceToProductOptions): Promise<T.JSONResponse<T.OKResponse>>;
|
|
277
249
|
/**
|
|
278
250
|
* Unclaim / Remove a device from your account or product, or deny quarantine
|
|
279
251
|
* @param {Object} options Options for this API call
|
|
@@ -283,9 +255,9 @@ declare class Particle {
|
|
|
283
255
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
284
256
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
285
257
|
* @param {Object} [options.context] Request context
|
|
286
|
-
* @returns {Promise<JSONResponse<OKResponse>>} A promise that resolves with the response data
|
|
258
|
+
* @returns {Promise<T.JSONResponse<T.OKResponse>>} A promise that resolves with the response data
|
|
287
259
|
*/
|
|
288
|
-
removeDevice({ deviceId, deny, product, auth, headers, context }: RemoveDeviceOptions): Promise<JSONResponse<OKResponse>>;
|
|
260
|
+
removeDevice({ deviceId, deny, product, auth, headers, context }: T.RemoveDeviceOptions): Promise<T.JSONResponse<T.OKResponse>>;
|
|
289
261
|
/**
|
|
290
262
|
* Unclaim a product device its the owner, but keep it in the product
|
|
291
263
|
* @param {Object} options Options for this API call
|
|
@@ -294,9 +266,9 @@ declare class Particle {
|
|
|
294
266
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
295
267
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
296
268
|
* @param {Object} [options.context] Request context
|
|
297
|
-
* @returns {Promise<JSONResponse<OKResponse>>} A promise that resolves with the response data
|
|
269
|
+
* @returns {Promise<T.JSONResponse<T.OKResponse>>} A promise that resolves with the response data
|
|
298
270
|
*/
|
|
299
|
-
removeDeviceOwner({ deviceId, product, auth, headers, context }: RemoveDeviceOwnerOptions): Promise<JSONResponse<OKResponse>>;
|
|
271
|
+
removeDeviceOwner({ deviceId, product, auth, headers, context }: T.RemoveDeviceOwnerOptions): Promise<T.JSONResponse<T.OKResponse>>;
|
|
300
272
|
/**
|
|
301
273
|
* Rename a device
|
|
302
274
|
* @param {Object} options Options for this API call
|
|
@@ -306,9 +278,9 @@ declare class Particle {
|
|
|
306
278
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
307
279
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
308
280
|
* @param {Object} [options.context] Request context
|
|
309
|
-
* @returns {Promise<JSONResponse<DeviceInfo>>} A promise that resolves with the response data
|
|
281
|
+
* @returns {Promise<T.JSONResponse<T.DeviceInfo>>} A promise that resolves with the response data
|
|
310
282
|
*/
|
|
311
|
-
renameDevice({ deviceId, name, product, auth, headers, context }: RenameDeviceOptions): Promise<JSONResponse<DeviceInfo>>;
|
|
283
|
+
renameDevice({ deviceId, name, product, auth, headers, context }: T.RenameDeviceOptions): Promise<T.JSONResponse<T.DeviceInfo>>;
|
|
312
284
|
/**
|
|
313
285
|
* Instruct the device to turn on/off the LED in a rainbow pattern
|
|
314
286
|
* @param {Object} options Options for this API call
|
|
@@ -318,9 +290,9 @@ declare class Particle {
|
|
|
318
290
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
319
291
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
320
292
|
* @param {Object} [options.context] Request context
|
|
321
|
-
* @returns {Promise<JSONResponse<DeviceInfo>>} A promise that resolves with the response data
|
|
293
|
+
* @returns {Promise<T.JSONResponse<T.DeviceInfo>>} A promise that resolves with the response data
|
|
322
294
|
*/
|
|
323
|
-
signalDevice({ deviceId, signal, product, auth, headers, context }: SignalDeviceOptions): Promise<JSONResponse<DeviceInfo>>;
|
|
295
|
+
signalDevice({ deviceId, signal, product, auth, headers, context }: T.SignalDeviceOptions): Promise<T.JSONResponse<T.DeviceInfo>>;
|
|
324
296
|
/**
|
|
325
297
|
* Store some notes about device
|
|
326
298
|
* @param {Object} options Options for this API call
|
|
@@ -330,7 +302,7 @@ declare class Particle {
|
|
|
330
302
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
331
303
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
332
304
|
* @param {Object} [options.context] Request context
|
|
333
|
-
* @returns {Promise<JSONResponse<DeviceInfo>>} A promise that resolves with the response data
|
|
305
|
+
* @returns {Promise<T.JSONResponse<T.DeviceInfo>>} A promise that resolves with the response data
|
|
334
306
|
*/
|
|
335
307
|
setDeviceNotes({ deviceId, notes, product, auth, headers, context }: {
|
|
336
308
|
deviceId: string;
|
|
@@ -339,10 +311,10 @@ declare class Particle {
|
|
|
339
311
|
auth?: string;
|
|
340
312
|
headers?: Record<string, string>;
|
|
341
313
|
context?: {
|
|
342
|
-
tool?: ToolContext;
|
|
343
|
-
project?: ProjectContext;
|
|
314
|
+
tool?: T.ToolContext;
|
|
315
|
+
project?: T.ProjectContext;
|
|
344
316
|
};
|
|
345
|
-
}): Promise<JSONResponse<DeviceInfo>>;
|
|
317
|
+
}): Promise<T.JSONResponse<T.DeviceInfo>>;
|
|
346
318
|
/**
|
|
347
319
|
* Mark device as being used in development of a product so it opts out of automatic firmware updates
|
|
348
320
|
* @param {Object} options Options for this API call
|
|
@@ -352,7 +324,7 @@ declare class Particle {
|
|
|
352
324
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
353
325
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
354
326
|
* @param {Object} [options.context] Request context
|
|
355
|
-
* @returns {Promise<JSONResponse<DeviceInfo>>} A promise that resolves with the response data
|
|
327
|
+
* @returns {Promise<T.JSONResponse<T.DeviceInfo>>} A promise that resolves with the response data
|
|
356
328
|
*/
|
|
357
329
|
markAsDevelopmentDevice({ deviceId, development, product, auth, headers, context }: {
|
|
358
330
|
deviceId: string;
|
|
@@ -361,10 +333,10 @@ declare class Particle {
|
|
|
361
333
|
auth?: string;
|
|
362
334
|
headers?: Record<string, string>;
|
|
363
335
|
context?: {
|
|
364
|
-
tool?: ToolContext;
|
|
365
|
-
project?: ProjectContext;
|
|
336
|
+
tool?: T.ToolContext;
|
|
337
|
+
project?: T.ProjectContext;
|
|
366
338
|
};
|
|
367
|
-
}): Promise<JSONResponse<DeviceInfo>>;
|
|
339
|
+
}): Promise<T.JSONResponse<T.DeviceInfo>>;
|
|
368
340
|
/**
|
|
369
341
|
* Mark device as being used in development of a product, so it opts out of automatic firmware updates
|
|
370
342
|
* @param {Object} options Options for this API call
|
|
@@ -375,7 +347,7 @@ declare class Particle {
|
|
|
375
347
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
376
348
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
377
349
|
* @param {Object} [options.context] Request context
|
|
378
|
-
* @returns {Promise<JSONResponse<DeviceInfo>>} A promise that resolves with the response data
|
|
350
|
+
* @returns {Promise<T.JSONResponse<T.DeviceInfo>>} A promise that resolves with the response data
|
|
379
351
|
*/
|
|
380
352
|
lockDeviceProductFirmware({ deviceId, desiredFirmwareVersion, flash, product, auth, headers, context }: {
|
|
381
353
|
deviceId: string;
|
|
@@ -385,10 +357,10 @@ declare class Particle {
|
|
|
385
357
|
auth?: string;
|
|
386
358
|
headers?: Record<string, string>;
|
|
387
359
|
context?: {
|
|
388
|
-
tool?: ToolContext;
|
|
389
|
-
project?: ProjectContext;
|
|
360
|
+
tool?: T.ToolContext;
|
|
361
|
+
project?: T.ProjectContext;
|
|
390
362
|
};
|
|
391
|
-
}): Promise<JSONResponse<DeviceInfo>>;
|
|
363
|
+
}): Promise<T.JSONResponse<T.DeviceInfo>>;
|
|
392
364
|
/**
|
|
393
365
|
* Mark device as receiving automatic firmware updates
|
|
394
366
|
* @param {Object} options Options for this API call
|
|
@@ -397,7 +369,7 @@ declare class Particle {
|
|
|
397
369
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
398
370
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
399
371
|
* @param {Object} [options.context] Request context
|
|
400
|
-
* @returns {Promise<JSONResponse<DeviceInfo>>} A promise that resolves with the response data
|
|
372
|
+
* @returns {Promise<T.JSONResponse<T.DeviceInfo>>} A promise that resolves with the response data
|
|
401
373
|
*/
|
|
402
374
|
unlockDeviceProductFirmware({ deviceId, product, auth, headers, context }: {
|
|
403
375
|
deviceId: string;
|
|
@@ -405,10 +377,10 @@ declare class Particle {
|
|
|
405
377
|
auth?: string;
|
|
406
378
|
headers?: Record<string, string>;
|
|
407
379
|
context?: {
|
|
408
|
-
tool?: ToolContext;
|
|
409
|
-
project?: ProjectContext;
|
|
380
|
+
tool?: T.ToolContext;
|
|
381
|
+
project?: T.ProjectContext;
|
|
410
382
|
};
|
|
411
|
-
}): Promise<JSONResponse<DeviceInfo>>;
|
|
383
|
+
}): Promise<T.JSONResponse<T.DeviceInfo>>;
|
|
412
384
|
/**
|
|
413
385
|
* Update multiple device attributes at the same time
|
|
414
386
|
* @param {Object} options Options for this API call
|
|
@@ -424,9 +396,9 @@ declare class Particle {
|
|
|
424
396
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
425
397
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
426
398
|
* @param {Object} [options.context] Request context
|
|
427
|
-
* @returns {Promise<JSONResponse<DeviceInfo>>} A promise that resolves with the response data
|
|
399
|
+
* @returns {Promise<T.JSONResponse<T.DeviceInfo>>} A promise that resolves with the response data
|
|
428
400
|
*/
|
|
429
|
-
updateDevice({ deviceId, name, signal, notes, development, desiredFirmwareVersion, flash, product, auth, headers, context }: UpdateDeviceOptions): Promise<JSONResponse<DeviceInfo>>;
|
|
401
|
+
updateDevice({ deviceId, name, signal, notes, development, desiredFirmwareVersion, flash, product, auth, headers, context }: T.UpdateDeviceOptions): Promise<T.JSONResponse<T.DeviceInfo>>;
|
|
430
402
|
/**
|
|
431
403
|
* Disable device protection.
|
|
432
404
|
*
|
|
@@ -443,9 +415,9 @@ declare class Particle {
|
|
|
443
415
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor.
|
|
444
416
|
* @param {Object} [options.headers] Key/value pairs to send as headers.
|
|
445
417
|
* @param {Object} [options.context] Request context.
|
|
446
|
-
* @returns {Promise<JSONResponse<OKResponse>>} A promise that resolves with the response data
|
|
418
|
+
* @returns {Promise<T.JSONResponse<T.OKResponse>>} A promise that resolves with the response data
|
|
447
419
|
*/
|
|
448
|
-
unprotectDevice({ deviceId, org, product, action, serverNonce, deviceNonce, deviceSignature, devicePublicKeyFingerprint, auth, headers, context }: UnprotectDeviceOptions): Promise<JSONResponse<OKResponse>>;
|
|
420
|
+
unprotectDevice({ deviceId, org, product, action, serverNonce, deviceNonce, deviceSignature, devicePublicKeyFingerprint, auth, headers, context }: T.UnprotectDeviceOptions): Promise<T.JSONResponse<T.OKResponse>>;
|
|
449
421
|
/**
|
|
450
422
|
* Provision a new device for products that allow self-provisioning
|
|
451
423
|
* @param {Object} options Options for this API call
|
|
@@ -453,9 +425,9 @@ declare class Particle {
|
|
|
453
425
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
454
426
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
455
427
|
* @param {Object} [options.context] Request context
|
|
456
|
-
* @returns {Promise<JSONResponse<DeviceInfo>>} A promise that resolves with the response data
|
|
428
|
+
* @returns {Promise<T.JSONResponse<T.DeviceInfo>>} A promise that resolves with the response data
|
|
457
429
|
*/
|
|
458
|
-
provisionDevice({ productId, auth, headers, context }: ProvisionDeviceOptions): Promise<JSONResponse<DeviceInfo>>;
|
|
430
|
+
provisionDevice({ productId, auth, headers, context }: T.ProvisionDeviceOptions): Promise<T.JSONResponse<T.DeviceInfo>>;
|
|
459
431
|
/**
|
|
460
432
|
* Generate a claim code to use in the device claiming process.
|
|
461
433
|
* To generate a claim code for a product, the access token MUST belong to a
|
|
@@ -466,9 +438,9 @@ declare class Particle {
|
|
|
466
438
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
467
439
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
468
440
|
* @param {Object} [options.context] Request context
|
|
469
|
-
* @returns {Promise<JSONResponse<ClaimCodeResponse>>} A promise that resolves with the response data
|
|
441
|
+
* @returns {Promise<T.JSONResponse<T.ClaimCodeResponse>>} A promise that resolves with the response data
|
|
470
442
|
*/
|
|
471
|
-
getClaimCode({ iccid, product, auth, headers, context }: GetClaimCodeOptions): Promise<JSONResponse<ClaimCodeResponse>>;
|
|
443
|
+
getClaimCode({ iccid, product, auth, headers, context }: T.GetClaimCodeOptions): Promise<T.JSONResponse<T.ClaimCodeResponse>>;
|
|
472
444
|
/**
|
|
473
445
|
* Get the value of a device variable
|
|
474
446
|
* @param {Object} options Options for this API call
|
|
@@ -478,9 +450,9 @@ declare class Particle {
|
|
|
478
450
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
479
451
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
480
452
|
* @param {Object} [options.context] Request context
|
|
481
|
-
* @returns {Promise<JSONResponse<DeviceVariableResponse>>} A promise that resolves with the response data
|
|
453
|
+
* @returns {Promise<T.JSONResponse<T.DeviceVariableResponse>>} A promise that resolves with the response data
|
|
482
454
|
*/
|
|
483
|
-
getVariable({ deviceId, name, product, auth, headers, context }: GetVariableOptions): Promise<JSONResponse<DeviceVariableResponse>>;
|
|
455
|
+
getVariable({ deviceId, name, product, auth, headers, context }: T.GetVariableOptions): Promise<T.JSONResponse<T.DeviceVariableResponse>>;
|
|
484
456
|
/**
|
|
485
457
|
* Compile and flash application firmware to a device. Pass a pre-compiled binary to flash it directly to the device.
|
|
486
458
|
* @param {Object} options Options for this API call
|
|
@@ -491,9 +463,9 @@ declare class Particle {
|
|
|
491
463
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
492
464
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
493
465
|
* @param {Object} [options.context] Request context
|
|
494
|
-
* @returns {Promise<JSONResponse<OKResponse>>} A promise that resolves with the response data
|
|
466
|
+
* @returns {Promise<T.JSONResponse<T.OKResponse>>} A promise that resolves with the response data
|
|
495
467
|
*/
|
|
496
|
-
flashDevice({ deviceId, product, files, targetVersion, auth, headers, context }: FlashDeviceOptions): Promise<JSONResponse<OKResponse>>;
|
|
468
|
+
flashDevice({ deviceId, product, files, targetVersion, auth, headers, context }: T.FlashDeviceOptions): Promise<T.JSONResponse<T.OKResponse>>;
|
|
497
469
|
/**
|
|
498
470
|
* Compile firmware using the Particle Cloud
|
|
499
471
|
* @param {Object} options Options for this API call
|
|
@@ -503,9 +475,9 @@ declare class Particle {
|
|
|
503
475
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
504
476
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
505
477
|
* @param {Object} [options.context] Request context
|
|
506
|
-
* @returns {Promise<JSONResponse<CompileResponse>>} A promise that resolves with the response data
|
|
478
|
+
* @returns {Promise<T.JSONResponse<T.CompileResponse>>} A promise that resolves with the response data
|
|
507
479
|
*/
|
|
508
|
-
compileCode({ files, platformId, targetVersion, auth, headers, context }: CompileCodeOptions): Promise<JSONResponse<CompileResponse>>;
|
|
480
|
+
compileCode({ files, platformId, targetVersion, auth, headers, context }: T.CompileCodeOptions): Promise<T.JSONResponse<T.CompileResponse>>;
|
|
509
481
|
/**
|
|
510
482
|
* Download a firmware binary
|
|
511
483
|
* @param {Object} options Options for this API call
|
|
@@ -515,7 +487,7 @@ declare class Particle {
|
|
|
515
487
|
* @param {Object} [options.context] Request context
|
|
516
488
|
* @returns {Promise<Buffer | ArrayBuffer>} A promise that resolves with the binary data
|
|
517
489
|
*/
|
|
518
|
-
downloadFirmwareBinary({ binaryId, auth, headers, context }: DownloadFirmwareBinaryOptions): Promise<Buffer | ArrayBuffer>;
|
|
490
|
+
downloadFirmwareBinary({ binaryId, auth, headers, context }: T.DownloadFirmwareBinaryOptions): Promise<Buffer | ArrayBuffer>;
|
|
519
491
|
/**
|
|
520
492
|
* Send a new device public key to the Particle Cloud
|
|
521
493
|
* @param {Object} options Options for this API call
|
|
@@ -525,19 +497,9 @@ declare class Particle {
|
|
|
525
497
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
526
498
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
527
499
|
* @param {Object} [options.context] Request context
|
|
528
|
-
* @returns {Promise<JSONResponse<OKResponse>>} A promise that resolves with the response data
|
|
500
|
+
* @returns {Promise<T.JSONResponse<T.OKResponse>>} A promise that resolves with the response data
|
|
529
501
|
*/
|
|
530
|
-
sendPublicKey({ deviceId, key, algorithm, auth, headers, context }:
|
|
531
|
-
deviceId: string;
|
|
532
|
-
key: string | Buffer;
|
|
533
|
-
algorithm?: string;
|
|
534
|
-
auth?: string;
|
|
535
|
-
headers?: Record<string, string>;
|
|
536
|
-
context?: {
|
|
537
|
-
tool?: ToolContext;
|
|
538
|
-
project?: ProjectContext;
|
|
539
|
-
};
|
|
540
|
-
}): Promise<JSONResponse<OKResponse>>;
|
|
502
|
+
sendPublicKey({ deviceId, key, algorithm, auth, headers, context }: T.SendPublicKeyOptions): Promise<T.JSONResponse<T.OKResponse>>;
|
|
541
503
|
/**
|
|
542
504
|
* Call a device function
|
|
543
505
|
* @param {Object} options Options for this API call
|
|
@@ -548,9 +510,9 @@ declare class Particle {
|
|
|
548
510
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
549
511
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
550
512
|
* @param {Object} [options.context] Request context
|
|
551
|
-
* @returns {Promise<JSONResponse<FunctionCallResponse>>} A promise that resolves with the response data
|
|
513
|
+
* @returns {Promise<T.JSONResponse<T.FunctionCallResponse>>} A promise that resolves with the response data
|
|
552
514
|
*/
|
|
553
|
-
callFunction({ deviceId, name, argument, product, auth, headers, context }: CallFunctionOptions): Promise<JSONResponse<FunctionCallResponse>>;
|
|
515
|
+
callFunction({ deviceId, name, argument, product, auth, headers, context }: T.CallFunctionOptions): Promise<T.JSONResponse<T.FunctionCallResponse>>;
|
|
554
516
|
/**
|
|
555
517
|
* Get a stream of events
|
|
556
518
|
* @param {Object} options Options for this API call
|
|
@@ -562,7 +524,7 @@ declare class Particle {
|
|
|
562
524
|
* @returns {Promise<EventStream>} A promise that resolves with the response data
|
|
563
525
|
* emit 'event' events.
|
|
564
526
|
*/
|
|
565
|
-
getEventStream({ deviceId, name, org, product, auth }: GetEventStreamOptions): Promise<EventStream>;
|
|
527
|
+
getEventStream({ deviceId, name, org, product, auth }: T.GetEventStreamOptions): Promise<EventStream>;
|
|
566
528
|
/**
|
|
567
529
|
* Publish a event to the Particle Cloud
|
|
568
530
|
* @param {Object} options Options for this API call
|
|
@@ -573,20 +535,9 @@ declare class Particle {
|
|
|
573
535
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
574
536
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
575
537
|
* @param {Object} [options.context] Request context
|
|
576
|
-
* @returns {Promise<JSONResponse<OKResponse>>} A promise that resolves with the response data
|
|
538
|
+
* @returns {Promise<T.JSONResponse<T.OKResponse>>} A promise that resolves with the response data
|
|
577
539
|
*/
|
|
578
|
-
publishEvent({ name, data, isPrivate, product, auth, headers, context }:
|
|
579
|
-
name: string;
|
|
580
|
-
data?: string;
|
|
581
|
-
isPrivate?: boolean;
|
|
582
|
-
product?: string | number;
|
|
583
|
-
auth?: string;
|
|
584
|
-
headers?: Record<string, string>;
|
|
585
|
-
context?: {
|
|
586
|
-
tool?: ToolContext;
|
|
587
|
-
project?: ProjectContext;
|
|
588
|
-
};
|
|
589
|
-
}): Promise<JSONResponse<OKResponse>>;
|
|
540
|
+
publishEvent({ name, data, isPrivate, product, auth, headers, context }: T.PublishEventOptions): Promise<T.JSONResponse<T.OKResponse>>;
|
|
590
541
|
/**
|
|
591
542
|
* @typedef {Object} Hook
|
|
592
543
|
* @property {String} [method=POST] Type of web request triggered by the Webhook (GET, POST, PUT, or DELETE)
|
|
@@ -613,34 +564,9 @@ declare class Particle {
|
|
|
613
564
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
614
565
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
615
566
|
* @param {Object} [options.context] Request context
|
|
616
|
-
* @returns {Promise<JSONResponse<CreateWebhookResponse>>} A promise that resolves with the response data
|
|
617
|
-
*/
|
|
618
|
-
createWebhook({ event, url, device, rejectUnauthorized, noDefaults, hook, product, auth, headers, context }:
|
|
619
|
-
event: string;
|
|
620
|
-
url: string;
|
|
621
|
-
device?: string;
|
|
622
|
-
rejectUnauthorized?: boolean;
|
|
623
|
-
noDefaults?: boolean;
|
|
624
|
-
hook?: {
|
|
625
|
-
method?: string;
|
|
626
|
-
auth?: Record<string, string>;
|
|
627
|
-
headers?: Record<string, string>;
|
|
628
|
-
query?: Record<string, string>;
|
|
629
|
-
json?: object;
|
|
630
|
-
form?: object;
|
|
631
|
-
body?: string;
|
|
632
|
-
responseTemplate?: string;
|
|
633
|
-
responseEvent?: string;
|
|
634
|
-
errorResponseEvent?: string;
|
|
635
|
-
};
|
|
636
|
-
product?: string | number;
|
|
637
|
-
auth?: string;
|
|
638
|
-
headers?: Record<string, string>;
|
|
639
|
-
context?: {
|
|
640
|
-
tool?: ToolContext;
|
|
641
|
-
project?: ProjectContext;
|
|
642
|
-
};
|
|
643
|
-
}): Promise<JSONResponse<CreateWebhookResponse>>;
|
|
567
|
+
* @returns {Promise<T.JSONResponse<T.CreateWebhookResponse>>} A promise that resolves with the response data
|
|
568
|
+
*/
|
|
569
|
+
createWebhook({ event, url, device, rejectUnauthorized, noDefaults, hook, product, auth, headers, context }: T.CreateWebhookOptions): Promise<T.JSONResponse<T.CreateWebhookResponse>>;
|
|
644
570
|
/**
|
|
645
571
|
* Delete a webhook
|
|
646
572
|
* @param {Object} options Options for this API call
|
|
@@ -649,9 +575,9 @@ declare class Particle {
|
|
|
649
575
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
650
576
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
651
577
|
* @param {Object} [options.context] Request context
|
|
652
|
-
* @returns {Promise<JSONResponse<OKResponse>>} A promise that resolves with the response data
|
|
578
|
+
* @returns {Promise<T.JSONResponse<T.OKResponse>>} A promise that resolves with the response data
|
|
653
579
|
*/
|
|
654
|
-
deleteWebhook({ hookId, product, auth, headers, context }: DeleteWebhookOptions): Promise<JSONResponse<OKResponse>>;
|
|
580
|
+
deleteWebhook({ hookId, product, auth, headers, context }: T.DeleteWebhookOptions): Promise<T.JSONResponse<T.OKResponse>>;
|
|
655
581
|
/**
|
|
656
582
|
* List all webhooks owned by the account or product
|
|
657
583
|
* @param {Object} options Options for this API call
|
|
@@ -659,9 +585,9 @@ declare class Particle {
|
|
|
659
585
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
660
586
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
661
587
|
* @param {Object} [options.context] Request context
|
|
662
|
-
* @returns {Promise<JSONResponse<WebhookInfo[]>>} A promise that resolves with the response data
|
|
588
|
+
* @returns {Promise<T.JSONResponse<T.WebhookInfo[]>>} A promise that resolves with the response data
|
|
663
589
|
*/
|
|
664
|
-
listWebhooks({ product, auth, headers, context }: ListWebhooksOptions): Promise<JSONResponse<WebhookInfo[]>>;
|
|
590
|
+
listWebhooks({ product, auth, headers, context }: T.ListWebhooksOptions): Promise<T.JSONResponse<T.WebhookInfo[]>>;
|
|
665
591
|
/**
|
|
666
592
|
* Create an integration to send events to an external service
|
|
667
593
|
*
|
|
@@ -675,9 +601,9 @@ declare class Particle {
|
|
|
675
601
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
676
602
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
677
603
|
* @param {Object} [options.context] Request context
|
|
678
|
-
* @returns {Promise<JSONResponse<IntegrationInfo>>} A promise that resolves with the response data
|
|
604
|
+
* @returns {Promise<T.JSONResponse<T.IntegrationInfo>>} A promise that resolves with the response data
|
|
679
605
|
*/
|
|
680
|
-
createIntegration({ event, settings, deviceId, product, auth, headers, context }: CreateIntegrationOptions): Promise<JSONResponse<IntegrationInfo>>;
|
|
606
|
+
createIntegration({ event, settings, deviceId, product, auth, headers, context }: T.CreateIntegrationOptions): Promise<T.JSONResponse<T.IntegrationInfo>>;
|
|
681
607
|
/**
|
|
682
608
|
* Edit an integration to send events to an external service
|
|
683
609
|
*
|
|
@@ -692,9 +618,9 @@ declare class Particle {
|
|
|
692
618
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
693
619
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
694
620
|
* @param {Object} [options.context] Request context
|
|
695
|
-
* @returns {Promise<JSONResponse<IntegrationInfo>>} A promise that resolves with the response data
|
|
621
|
+
* @returns {Promise<T.JSONResponse<T.IntegrationInfo>>} A promise that resolves with the response data
|
|
696
622
|
*/
|
|
697
|
-
editIntegration({ integrationId, event, settings, deviceId, product, auth, headers, context }: EditIntegrationOptions): Promise<JSONResponse<IntegrationInfo>>;
|
|
623
|
+
editIntegration({ integrationId, event, settings, deviceId, product, auth, headers, context }: T.EditIntegrationOptions): Promise<T.JSONResponse<T.IntegrationInfo>>;
|
|
698
624
|
/**
|
|
699
625
|
* Delete an integration to send events to an external service
|
|
700
626
|
*
|
|
@@ -704,9 +630,9 @@ declare class Particle {
|
|
|
704
630
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
705
631
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
706
632
|
* @param {Object} [options.context] Request context
|
|
707
|
-
* @returns {Promise<JSONResponse<OKResponse>>} A promise that resolves with the response data
|
|
633
|
+
* @returns {Promise<T.JSONResponse<T.OKResponse>>} A promise that resolves with the response data
|
|
708
634
|
*/
|
|
709
|
-
deleteIntegration({ integrationId, product, auth, headers, context }: DeleteIntegrationOptions): Promise<JSONResponse<OKResponse>>;
|
|
635
|
+
deleteIntegration({ integrationId, product, auth, headers, context }: T.DeleteIntegrationOptions): Promise<T.JSONResponse<T.OKResponse>>;
|
|
710
636
|
/**
|
|
711
637
|
* List all integrations owned by the account or product
|
|
712
638
|
* @param {Object} options Options for this API call
|
|
@@ -714,25 +640,25 @@ declare class Particle {
|
|
|
714
640
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
715
641
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
716
642
|
* @param {Object} [options.context] Request context
|
|
717
|
-
* @returns {Promise<JSONResponse<IntegrationInfo[]>>} A promise that resolves with the response data
|
|
643
|
+
* @returns {Promise<T.JSONResponse<T.IntegrationInfo[]>>} A promise that resolves with the response data
|
|
718
644
|
*/
|
|
719
|
-
listIntegrations({ product, auth, headers, context }: ListIntegrationsOptions): Promise<JSONResponse<IntegrationInfo[]>>;
|
|
645
|
+
listIntegrations({ product, auth, headers, context }: T.ListIntegrationsOptions): Promise<T.JSONResponse<T.IntegrationInfo[]>>;
|
|
720
646
|
/**
|
|
721
647
|
* Get details about the current user
|
|
722
648
|
* @param {Object} options Options for this API call
|
|
723
649
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
724
650
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
725
651
|
* @param {Object} [options.context] Request context
|
|
726
|
-
* @returns {Promise<JSONResponse<UserInfo>>} A promise that resolves with the response data
|
|
652
|
+
* @returns {Promise<T.JSONResponse<T.UserInfo>>} A promise that resolves with the response data
|
|
727
653
|
*/
|
|
728
654
|
getUserInfo({ auth, headers, context }: {
|
|
729
655
|
auth?: string;
|
|
730
656
|
headers?: Record<string, string>;
|
|
731
657
|
context?: {
|
|
732
|
-
tool?: ToolContext;
|
|
733
|
-
project?: ProjectContext;
|
|
658
|
+
tool?: T.ToolContext;
|
|
659
|
+
project?: T.ProjectContext;
|
|
734
660
|
};
|
|
735
|
-
}): Promise<JSONResponse<UserInfo>>;
|
|
661
|
+
}): Promise<T.JSONResponse<T.UserInfo>>;
|
|
736
662
|
/**
|
|
737
663
|
* Set details on the current user
|
|
738
664
|
* @param {Object} options Options for this API call
|
|
@@ -740,17 +666,9 @@ declare class Particle {
|
|
|
740
666
|
* @param {String} options.accountInfo Set user's extended info fields (name, business account, company name, etc)
|
|
741
667
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
742
668
|
* @param {Object} [options.context] Request context
|
|
743
|
-
* @returns {Promise<JSONResponse<UserInfo>>} A promise that resolves with the response data
|
|
669
|
+
* @returns {Promise<T.JSONResponse<T.UserInfo>>} A promise that resolves with the response data
|
|
744
670
|
*/
|
|
745
|
-
setUserInfo({ accountInfo, auth, headers, context }:
|
|
746
|
-
accountInfo?: Record<string, string | number | boolean>;
|
|
747
|
-
auth?: string;
|
|
748
|
-
headers?: Record<string, string>;
|
|
749
|
-
context?: {
|
|
750
|
-
tool?: ToolContext;
|
|
751
|
-
project?: ProjectContext;
|
|
752
|
-
};
|
|
753
|
-
}): Promise<JSONResponse<UserInfo>>;
|
|
671
|
+
setUserInfo({ accountInfo, auth, headers, context }: T.SetUserInfoOptions): Promise<T.JSONResponse<T.UserInfo>>;
|
|
754
672
|
/**
|
|
755
673
|
* Change username (i.e, email)
|
|
756
674
|
* @param {Object} options Options for this API call
|
|
@@ -760,9 +678,9 @@ declare class Particle {
|
|
|
760
678
|
* @param {Boolean} options.invalidateTokens Should all tokens be invalidated
|
|
761
679
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
762
680
|
* @param {Object} [options.context] Request context
|
|
763
|
-
* @returns {Promise<JSONResponse<OKResponse>>} A promise that resolves with the response data
|
|
681
|
+
* @returns {Promise<T.JSONResponse<T.OKResponse>>} A promise that resolves with the response data
|
|
764
682
|
*/
|
|
765
|
-
changeUsername({ currentPassword, username, invalidateTokens, auth, headers, context }: ChangeUsernameOptions): Promise<JSONResponse<OKResponse>>;
|
|
683
|
+
changeUsername({ currentPassword, username, invalidateTokens, auth, headers, context }: T.ChangeUsernameOptions): Promise<T.JSONResponse<T.OKResponse>>;
|
|
766
684
|
/**
|
|
767
685
|
* Change user's password
|
|
768
686
|
* @param {Object} options Options for this API call
|
|
@@ -772,9 +690,9 @@ declare class Particle {
|
|
|
772
690
|
* @param {Boolean} options.invalidateTokens Should all tokens be invalidated
|
|
773
691
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
774
692
|
* @param {Object} [options.context] Request context
|
|
775
|
-
* @returns {Promise<JSONResponse<OKResponse>>} A promise that resolves with the response data
|
|
693
|
+
* @returns {Promise<T.JSONResponse<T.OKResponse>>} A promise that resolves with the response data
|
|
776
694
|
*/
|
|
777
|
-
changeUserPassword({ currentPassword, password, invalidateTokens, auth, headers, context }: ChangeUserPasswordOptions): Promise<JSONResponse<OKResponse>>;
|
|
695
|
+
changeUserPassword({ currentPassword, password, invalidateTokens, auth, headers, context }: T.ChangeUserPasswordOptions): Promise<T.JSONResponse<T.OKResponse>>;
|
|
778
696
|
/**
|
|
779
697
|
* List SIM cards owned by a user or product
|
|
780
698
|
* @param {Object} options Options for this API call
|
|
@@ -787,9 +705,9 @@ declare class Particle {
|
|
|
787
705
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
788
706
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
789
707
|
* @param {Object} [options.context] Request context
|
|
790
|
-
* @returns {Promise<JSONResponse<SimInfo[]>>} A promise that resolves with the response data
|
|
708
|
+
* @returns {Promise<T.JSONResponse<T.SimInfo[]>>} A promise that resolves with the response data
|
|
791
709
|
*/
|
|
792
|
-
listSIMs({ iccid, deviceId, deviceName, page, perPage, product, auth, headers, context }: ListSIMsOptions): Promise<JSONResponse<SimInfo[]>>;
|
|
710
|
+
listSIMs({ iccid, deviceId, deviceName, page, perPage, product, auth, headers, context }: T.ListSIMsOptions): Promise<T.JSONResponse<T.SimInfo[]>>;
|
|
793
711
|
/**
|
|
794
712
|
* Get data usage for one SIM card for the current billing period
|
|
795
713
|
* @param {Object} options Options for this API call
|
|
@@ -798,9 +716,9 @@ declare class Particle {
|
|
|
798
716
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
799
717
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
800
718
|
* @param {Object} [options.context] Request context
|
|
801
|
-
* @returns {Promise<JSONResponse<SimDataUsage>>} A promise that resolves with the response data
|
|
719
|
+
* @returns {Promise<T.JSONResponse<T.SimDataUsage>>} A promise that resolves with the response data
|
|
802
720
|
*/
|
|
803
|
-
getSIMDataUsage({ iccid, product, auth, headers, context }: GetSIMDataUsageOptions): Promise<JSONResponse<SimDataUsage>>;
|
|
721
|
+
getSIMDataUsage({ iccid, product, auth, headers, context }: T.GetSIMDataUsageOptions): Promise<T.JSONResponse<T.SimDataUsage>>;
|
|
804
722
|
/**
|
|
805
723
|
* Get data usage for all SIM cards in a product the current billing period
|
|
806
724
|
* @param {Object} options Options for this API call
|
|
@@ -808,9 +726,9 @@ declare class Particle {
|
|
|
808
726
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
809
727
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
810
728
|
* @param {Object} [options.context] Request context
|
|
811
|
-
* @returns {Promise<JSONResponse<SimDataUsage>>} A promise that resolves with the response data
|
|
729
|
+
* @returns {Promise<T.JSONResponse<T.SimDataUsage>>} A promise that resolves with the response data
|
|
812
730
|
*/
|
|
813
|
-
getFleetDataUsage({ product, auth, headers, context }: GetFleetDataUsageOptions): Promise<JSONResponse<SimDataUsage>>;
|
|
731
|
+
getFleetDataUsage({ product, auth, headers, context }: T.GetFleetDataUsageOptions): Promise<T.JSONResponse<T.SimDataUsage>>;
|
|
814
732
|
/**
|
|
815
733
|
* Check SIM status
|
|
816
734
|
* @param {Object} options Options for this API call
|
|
@@ -818,58 +736,9 @@ declare class Particle {
|
|
|
818
736
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
819
737
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
820
738
|
* @param {Object} [options.context] Request context
|
|
821
|
-
* @returns {Promise<JSONResponse<SimInfo>>} A promise that resolves with the response data
|
|
822
|
-
*/
|
|
823
|
-
checkSIM({ iccid, auth, headers, context }: CheckSIMOptions): Promise<JSONResponse<SimInfo>>;
|
|
824
|
-
/**
|
|
825
|
-
* Activate and add SIM cards to an account or product
|
|
826
|
-
* @param {Object} options Options for this API call
|
|
827
|
-
* @param {String} options.iccid ICCID of the SIM card
|
|
828
|
-
* @param {Array<String>} options.iccids (Product only) ICCID of multiple SIM cards to import
|
|
829
|
-
* @param {String} options.country The ISO country code for the SIM cards
|
|
830
|
-
* @param {String} [options.product] SIM cards for this product ID or slug
|
|
831
|
-
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
832
|
-
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
833
|
-
* @param {Object} [options.context] Request context
|
|
834
|
-
* @param {any} [options.promoCode]
|
|
835
|
-
* @returns {Promise<JSONResponse<OKResponse>>} A promise that resolves with the response data
|
|
739
|
+
* @returns {Promise<T.JSONResponse<T.SimInfo>>} A promise that resolves with the response data
|
|
836
740
|
*/
|
|
837
|
-
|
|
838
|
-
/**
|
|
839
|
-
* Deactivate a SIM card so it doesn't incur data usage in future months.
|
|
840
|
-
* @param {Object} options Options for this API call
|
|
841
|
-
* @param {String} options.iccid ICCID of the SIM card
|
|
842
|
-
* @param {String} [options.product] SIM cards for this product ID or slug
|
|
843
|
-
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
844
|
-
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
845
|
-
* @param {Object} [options.context] Request context
|
|
846
|
-
* @returns {Promise<JSONResponse<OKResponse>>} A promise that resolves with the response data
|
|
847
|
-
*/
|
|
848
|
-
deactivateSIM({ iccid, product, auth, headers, context }: DeactivateSIMOptions): Promise<JSONResponse<OKResponse>>;
|
|
849
|
-
/**
|
|
850
|
-
* Reactivate a SIM card the was deactivated or unpause a SIM card that was automatically paused
|
|
851
|
-
* @param {Object} options Options for this API call
|
|
852
|
-
* @param {String} options.iccid ICCID of the SIM card
|
|
853
|
-
* @param {Number} [options.mbLimit] New monthly data limit. Necessary if unpausing a SIM card
|
|
854
|
-
* @param {String} [options.product] SIM cards for this product ID or slug
|
|
855
|
-
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
856
|
-
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
857
|
-
* @param {Object} [options.context] Request context
|
|
858
|
-
* @returns {Promise<JSONResponse<OKResponse>>} A promise that resolves with the response data
|
|
859
|
-
*/
|
|
860
|
-
reactivateSIM({ iccid, mbLimit, product, auth, headers, context }: ReactivateSIMOptions): Promise<JSONResponse<OKResponse>>;
|
|
861
|
-
/**
|
|
862
|
-
* Update SIM card data limit
|
|
863
|
-
* @param {Object} options Options for this API call
|
|
864
|
-
* @param {String} options.iccid ICCID of the SIM card
|
|
865
|
-
* @param {Array} options.mbLimit Data limit in megabyte for the SIM card
|
|
866
|
-
* @param {String} [options.product] SIM cards for this product ID or slug
|
|
867
|
-
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
868
|
-
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
869
|
-
* @param {Object} [options.context] Request context
|
|
870
|
-
* @returns {Promise<JSONResponse<SimInfo>>} A promise that resolves with the response data
|
|
871
|
-
*/
|
|
872
|
-
updateSIM({ iccid, mbLimit, product, auth, headers, context }: UpdateSIMOptions): Promise<JSONResponse<SimInfo>>;
|
|
741
|
+
checkSIM({ iccid, auth, headers, context }: T.CheckSIMOptions): Promise<T.JSONResponse<T.SimInfo>>;
|
|
873
742
|
/**
|
|
874
743
|
* Remove a SIM card from an account so it can be activated by a different account
|
|
875
744
|
* @param {Object} options Options for this API call
|
|
@@ -878,9 +747,9 @@ declare class Particle {
|
|
|
878
747
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
879
748
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
880
749
|
* @param {Object} [options.context] Request context
|
|
881
|
-
* @returns {Promise<JSONResponse<OKResponse>>} A promise that resolves with the response data
|
|
750
|
+
* @returns {Promise<T.JSONResponse<T.OKResponse>>} A promise that resolves with the response data
|
|
882
751
|
*/
|
|
883
|
-
removeSIM({ iccid, product, auth, headers, context }: RemoveSIMOptions): Promise<JSONResponse<OKResponse>>;
|
|
752
|
+
removeSIM({ iccid, product, auth, headers, context }: T.RemoveSIMOptions): Promise<T.JSONResponse<T.OKResponse>>;
|
|
884
753
|
/**
|
|
885
754
|
* List valid build targets to be used for compiling
|
|
886
755
|
* @param {Object} options Options for this API call
|
|
@@ -888,9 +757,9 @@ declare class Particle {
|
|
|
888
757
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
889
758
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
890
759
|
* @param {Object} [options.context] Request context
|
|
891
|
-
* @returns {Promise<JSONResponse<BuildTargetsResponse>>} A promise that resolves with the response data
|
|
760
|
+
* @returns {Promise<T.JSONResponse<T.BuildTargetsResponse>>} A promise that resolves with the response data
|
|
892
761
|
*/
|
|
893
|
-
listBuildTargets({ onlyFeatured, auth, headers, context }: ListBuildTargetsOptions): Promise<JSONResponse<BuildTargetsResponse>>;
|
|
762
|
+
listBuildTargets({ onlyFeatured, auth, headers, context }: T.ListBuildTargetsOptions): Promise<T.JSONResponse<T.BuildTargetsResponse>>;
|
|
894
763
|
/**
|
|
895
764
|
* List firmware libraries
|
|
896
765
|
* @param {Object} options Options for this API call
|
|
@@ -915,8 +784,8 @@ declare class Particle {
|
|
|
915
784
|
* @param {Object} [options.context] Request context
|
|
916
785
|
* @returns {Promise} A promise
|
|
917
786
|
*/
|
|
918
|
-
listLibraries({ page, limit, filter, sort, architectures, category, scope, excludeScopes, auth, headers, context }: ListLibrariesOptions): Promise<JSONResponse<{
|
|
919
|
-
data: LibraryInfo[];
|
|
787
|
+
listLibraries({ page, limit, filter, sort, architectures, category, scope, excludeScopes, auth, headers, context }: T.ListLibrariesOptions): Promise<T.JSONResponse<{
|
|
788
|
+
data: T.LibraryInfo[];
|
|
920
789
|
}>>;
|
|
921
790
|
private _asList;
|
|
922
791
|
/**
|
|
@@ -929,8 +798,8 @@ declare class Particle {
|
|
|
929
798
|
* @param {Object} [options.context] Request context
|
|
930
799
|
* @returns {Promise} A promise
|
|
931
800
|
*/
|
|
932
|
-
getLibrary({ name, version, auth, headers, context }: GetLibraryOptions): Promise<JSONResponse<{
|
|
933
|
-
data: LibraryInfo;
|
|
801
|
+
getLibrary({ name, version, auth, headers, context }: T.GetLibraryOptions): Promise<T.JSONResponse<{
|
|
802
|
+
data: T.LibraryInfo;
|
|
934
803
|
}>>;
|
|
935
804
|
/**
|
|
936
805
|
* Firmware library details for each version
|
|
@@ -943,8 +812,8 @@ declare class Particle {
|
|
|
943
812
|
* @param {Object} [options.context] Request context
|
|
944
813
|
* @returns {Promise} A promise
|
|
945
814
|
*/
|
|
946
|
-
getLibraryVersions({ name, page, limit, auth, headers, context }: GetLibraryVersionsOptions): Promise<JSONResponse<{
|
|
947
|
-
data: LibraryInfo[];
|
|
815
|
+
getLibraryVersions({ name, page, limit, auth, headers, context }: T.GetLibraryVersionsOptions): Promise<T.JSONResponse<{
|
|
816
|
+
data: T.LibraryInfo[];
|
|
948
817
|
}>>;
|
|
949
818
|
/**
|
|
950
819
|
* Contribute a new library version from a compressed archive
|
|
@@ -956,8 +825,8 @@ declare class Particle {
|
|
|
956
825
|
* @param {Object} [options.context] Request context
|
|
957
826
|
* @returns {Promise} A promise
|
|
958
827
|
*/
|
|
959
|
-
contributeLibrary({ archive, auth, headers, context }: ContributeLibraryOptions): Promise<JSONResponse<{
|
|
960
|
-
data: LibraryInfo;
|
|
828
|
+
contributeLibrary({ archive, auth, headers, context }: T.ContributeLibraryOptions): Promise<T.JSONResponse<{
|
|
829
|
+
data: T.LibraryInfo;
|
|
961
830
|
}>>;
|
|
962
831
|
/**
|
|
963
832
|
* Publish the latest version of a library to the public
|
|
@@ -968,8 +837,8 @@ declare class Particle {
|
|
|
968
837
|
* @param {Object} [options.context] Request context
|
|
969
838
|
* @returns {Promise} A promise
|
|
970
839
|
*/
|
|
971
|
-
publishLibrary({ name, auth, headers, context }: PublishLibraryOptions): Promise<JSONResponse<{
|
|
972
|
-
data: LibraryInfo;
|
|
840
|
+
publishLibrary({ name, auth, headers, context }: T.PublishLibraryOptions): Promise<T.JSONResponse<{
|
|
841
|
+
data: T.LibraryInfo;
|
|
973
842
|
}>>;
|
|
974
843
|
/**
|
|
975
844
|
* Delete one version of a library or an entire private library
|
|
@@ -979,9 +848,9 @@ declare class Particle {
|
|
|
979
848
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
980
849
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
981
850
|
* @param {Object} [options.context] Request context
|
|
982
|
-
* @returns {Promise<JSONResponse<OKResponse>>} A promise that resolves with the response data
|
|
851
|
+
* @returns {Promise<T.JSONResponse<T.OKResponse>>} A promise that resolves with the response data
|
|
983
852
|
*/
|
|
984
|
-
deleteLibrary({ name, force, auth, headers, context }: DeleteLibraryOptions): Promise<JSONResponse<OKResponse>>;
|
|
853
|
+
deleteLibrary({ name, force, auth, headers, context }: T.DeleteLibraryOptions): Promise<T.JSONResponse<T.OKResponse>>;
|
|
985
854
|
/**
|
|
986
855
|
* Download an external file that may not be on the API
|
|
987
856
|
* @param {Object} options Options for this API call
|
|
@@ -990,7 +859,7 @@ declare class Particle {
|
|
|
990
859
|
* @param {Object} [options.context] Request context
|
|
991
860
|
* @returns {Promise<Buffer | ArrayBuffer>} A promise that resolves with the binary data
|
|
992
861
|
*/
|
|
993
|
-
downloadFile({ uri, headers, context }: DownloadFileOptions): Promise<Buffer | ArrayBuffer>;
|
|
862
|
+
downloadFile({ uri, headers, context }: T.DownloadFileOptions): Promise<Buffer | ArrayBuffer>;
|
|
994
863
|
/**
|
|
995
864
|
* List OAuth client created by the account
|
|
996
865
|
* @param {Object} options Options for this API call
|
|
@@ -1000,8 +869,8 @@ declare class Particle {
|
|
|
1000
869
|
* @param {Object} [options.context] Request context
|
|
1001
870
|
* @returns {Promise} A promise
|
|
1002
871
|
*/
|
|
1003
|
-
listOAuthClients({ product, auth, headers, context }: ListOAuthClientsOptions): Promise<JSONResponse<{
|
|
1004
|
-
clients: OAuthClientInfo[];
|
|
872
|
+
listOAuthClients({ product, auth, headers, context }: T.ListOAuthClientsOptions): Promise<T.JSONResponse<{
|
|
873
|
+
clients: T.OAuthClientInfo[];
|
|
1005
874
|
}>>;
|
|
1006
875
|
/**
|
|
1007
876
|
* Create an OAuth client
|
|
@@ -1014,21 +883,9 @@ declare class Particle {
|
|
|
1014
883
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
1015
884
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1016
885
|
* @param {Object} [options.context] Request context
|
|
1017
|
-
* @returns {Promise<JSONResponse<OAuthClientInfo>>} A promise that resolves with the response data
|
|
886
|
+
* @returns {Promise<T.JSONResponse<T.OAuthClientInfo>>} A promise that resolves with the response data
|
|
1018
887
|
*/
|
|
1019
|
-
createOAuthClient({ name, type, redirect_uri, scope, product, auth, headers, context }:
|
|
1020
|
-
name: string;
|
|
1021
|
-
type: string;
|
|
1022
|
-
redirect_uri?: string;
|
|
1023
|
-
scope?: Record<string, string>;
|
|
1024
|
-
product?: string | number;
|
|
1025
|
-
auth?: string;
|
|
1026
|
-
headers?: Record<string, string>;
|
|
1027
|
-
context?: {
|
|
1028
|
-
tool?: ToolContext;
|
|
1029
|
-
project?: ProjectContext;
|
|
1030
|
-
};
|
|
1031
|
-
}): Promise<JSONResponse<OAuthClientInfo>>;
|
|
888
|
+
createOAuthClient({ name, type, redirect_uri, scope, product, auth, headers, context }: T.CreateOAuthClientOptions): Promise<T.JSONResponse<T.OAuthClientInfo>>;
|
|
1032
889
|
/**
|
|
1033
890
|
* Update an OAuth client
|
|
1034
891
|
* @param {Object} options Options for this API call
|
|
@@ -1039,9 +896,9 @@ declare class Particle {
|
|
|
1039
896
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
1040
897
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1041
898
|
* @param {Object} [options.context] Request context
|
|
1042
|
-
* @returns {Promise<JSONResponse<OAuthClientInfo>>} A promise that resolves with the response data
|
|
899
|
+
* @returns {Promise<T.JSONResponse<T.OAuthClientInfo>>} A promise that resolves with the response data
|
|
1043
900
|
*/
|
|
1044
|
-
updateOAuthClient({ clientId, name, scope, product, auth, headers, context }: UpdateOAuthClientOptions): Promise<JSONResponse<OAuthClientInfo>>;
|
|
901
|
+
updateOAuthClient({ clientId, name, scope, product, auth, headers, context }: T.UpdateOAuthClientOptions): Promise<T.JSONResponse<T.OAuthClientInfo>>;
|
|
1045
902
|
/**
|
|
1046
903
|
* Delete an OAuth client
|
|
1047
904
|
* @param {Object} options Options for this API call
|
|
@@ -1050,9 +907,9 @@ declare class Particle {
|
|
|
1050
907
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
1051
908
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1052
909
|
* @param {Object} [options.context] Request context
|
|
1053
|
-
* @returns {Promise<JSONResponse<OKResponse>>} A promise that resolves with the response data
|
|
910
|
+
* @returns {Promise<T.JSONResponse<T.OKResponse>>} A promise that resolves with the response data
|
|
1054
911
|
*/
|
|
1055
|
-
deleteOAuthClient({ clientId, product, auth, headers, context }: DeleteOAuthClientOptions): Promise<JSONResponse<OKResponse>>;
|
|
912
|
+
deleteOAuthClient({ clientId, product, auth, headers, context }: T.DeleteOAuthClientOptions): Promise<T.JSONResponse<T.OKResponse>>;
|
|
1056
913
|
/**
|
|
1057
914
|
* List products the account has access to
|
|
1058
915
|
* @param {Object} options Options for this API call
|
|
@@ -1061,8 +918,8 @@ declare class Particle {
|
|
|
1061
918
|
* @param {Object} [options.context] Request context
|
|
1062
919
|
* @returns {Promise} A promise
|
|
1063
920
|
*/
|
|
1064
|
-
listProducts({ auth, headers, context }: ListProductsOptions): Promise<JSONResponse<{
|
|
1065
|
-
products: ProductInfo[];
|
|
921
|
+
listProducts({ auth, headers, context }: T.ListProductsOptions): Promise<T.JSONResponse<{
|
|
922
|
+
products: T.ProductInfo[];
|
|
1066
923
|
}>>;
|
|
1067
924
|
/**
|
|
1068
925
|
* Get detailed information about a product
|
|
@@ -1073,8 +930,8 @@ declare class Particle {
|
|
|
1073
930
|
* @param {Object} [options.context] Request context
|
|
1074
931
|
* @returns {Promise} A promise
|
|
1075
932
|
*/
|
|
1076
|
-
getProduct({ product, auth, headers, context }: GetProductOptions): Promise<JSONResponse<{
|
|
1077
|
-
product: ProductInfo;
|
|
933
|
+
getProduct({ product, auth, headers, context }: T.GetProductOptions): Promise<T.JSONResponse<{
|
|
934
|
+
product: T.ProductInfo;
|
|
1078
935
|
}>>;
|
|
1079
936
|
/**
|
|
1080
937
|
* List product firmware versions
|
|
@@ -1083,9 +940,9 @@ declare class Particle {
|
|
|
1083
940
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
1084
941
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1085
942
|
* @param {Object} [options.context] Request context
|
|
1086
|
-
* @returns {Promise<JSONResponse<ProductFirmwareInfo[]>>} A promise that resolves with the response data
|
|
943
|
+
* @returns {Promise<T.JSONResponse<T.ProductFirmwareInfo[]>>} A promise that resolves with the response data
|
|
1087
944
|
*/
|
|
1088
|
-
listProductFirmware({ product, auth, headers, context }: ListProductFirmwareOptions): Promise<JSONResponse<ProductFirmwareInfo[]>>;
|
|
945
|
+
listProductFirmware({ product, auth, headers, context }: T.ListProductFirmwareOptions): Promise<T.JSONResponse<T.ProductFirmwareInfo[]>>;
|
|
1089
946
|
/**
|
|
1090
947
|
* List product firmware versions
|
|
1091
948
|
* @param {Object} options Options for this API call
|
|
@@ -1098,9 +955,9 @@ declare class Particle {
|
|
|
1098
955
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
1099
956
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1100
957
|
* @param {Object} [options.context] Request context
|
|
1101
|
-
* @returns {Promise<JSONResponse<ProductFirmwareInfo>>} A promise that resolves with the response data
|
|
958
|
+
* @returns {Promise<T.JSONResponse<T.ProductFirmwareInfo>>} A promise that resolves with the response data
|
|
1102
959
|
*/
|
|
1103
|
-
uploadProductFirmware({ file, version, title, description, product, auth, headers, context }: UploadProductFirmwareOptions): Promise<JSONResponse<ProductFirmwareInfo>>;
|
|
960
|
+
uploadProductFirmware({ file, version, title, description, product, auth, headers, context }: T.UploadProductFirmwareOptions): Promise<T.JSONResponse<T.ProductFirmwareInfo>>;
|
|
1104
961
|
/**
|
|
1105
962
|
* Get information about a product firmware version
|
|
1106
963
|
* @param {Object} options Options for this API call
|
|
@@ -1109,9 +966,9 @@ declare class Particle {
|
|
|
1109
966
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
1110
967
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1111
968
|
* @param {Object} [options.context] Request context
|
|
1112
|
-
* @returns {Promise<JSONResponse<ProductFirmwareInfo>>} A promise that resolves with the response data
|
|
969
|
+
* @returns {Promise<T.JSONResponse<T.ProductFirmwareInfo>>} A promise that resolves with the response data
|
|
1113
970
|
*/
|
|
1114
|
-
getProductFirmware({ version, product, auth, headers, context }: GetProductFirmwareOptions): Promise<JSONResponse<ProductFirmwareInfo>>;
|
|
971
|
+
getProductFirmware({ version, product, auth, headers, context }: T.GetProductFirmwareOptions): Promise<T.JSONResponse<T.ProductFirmwareInfo>>;
|
|
1115
972
|
/**
|
|
1116
973
|
* Update information for a product firmware version
|
|
1117
974
|
* @param {Object} options Options for this API call
|
|
@@ -1122,9 +979,9 @@ declare class Particle {
|
|
|
1122
979
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
1123
980
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1124
981
|
* @param {Object} [options.context] Request context
|
|
1125
|
-
* @returns {Promise<JSONResponse<ProductFirmwareInfo>>} A promise that resolves with the response data
|
|
982
|
+
* @returns {Promise<T.JSONResponse<T.ProductFirmwareInfo>>} A promise that resolves with the response data
|
|
1126
983
|
*/
|
|
1127
|
-
updateProductFirmware({ version, title, description, product, auth, headers, context }: UpdateProductFirmwareOptions): Promise<JSONResponse<ProductFirmwareInfo>>;
|
|
984
|
+
updateProductFirmware({ version, title, description, product, auth, headers, context }: T.UpdateProductFirmwareOptions): Promise<T.JSONResponse<T.ProductFirmwareInfo>>;
|
|
1128
985
|
/**
|
|
1129
986
|
* Download a product firmware binary
|
|
1130
987
|
* @param {Object} options Options for this API call
|
|
@@ -1135,7 +992,7 @@ declare class Particle {
|
|
|
1135
992
|
* @param {Object} [options.context] Request context
|
|
1136
993
|
* @returns {Promise<Buffer | ArrayBuffer>} A promise that resolves with the binary data
|
|
1137
994
|
*/
|
|
1138
|
-
downloadProductFirmware({ version, product, auth, headers, context }: DownloadProductFirmwareOptions): Promise<Buffer | ArrayBuffer>;
|
|
995
|
+
downloadProductFirmware({ version, product, auth, headers, context }: T.DownloadProductFirmwareOptions): Promise<Buffer | ArrayBuffer>;
|
|
1139
996
|
/**
|
|
1140
997
|
* Download a tachyon manufacturing backup files
|
|
1141
998
|
* @param {Object} options Options for this API call
|
|
@@ -1145,7 +1002,7 @@ declare class Particle {
|
|
|
1145
1002
|
* @param {Object} [options.context] Request context
|
|
1146
1003
|
* @returns {Promise<Buffer | ArrayBuffer>} A promise that resolves with the binary data
|
|
1147
1004
|
*/
|
|
1148
|
-
downloadManufacturingBackup({ deviceId, auth, headers, context }: DownloadManufacturingBackupOptions): Promise<Buffer | ArrayBuffer>;
|
|
1005
|
+
downloadManufacturingBackup({ deviceId, auth, headers, context }: T.DownloadManufacturingBackupOptions): Promise<Buffer | ArrayBuffer>;
|
|
1149
1006
|
/**
|
|
1150
1007
|
* Release a product firmware version as the default version
|
|
1151
1008
|
* @param {Object} options Options for this API call
|
|
@@ -1154,9 +1011,9 @@ declare class Particle {
|
|
|
1154
1011
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
1155
1012
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1156
1013
|
* @param {Object} [options.context] Request context
|
|
1157
|
-
* @returns {Promise<JSONResponse<OKResponse>>} A promise that resolves with the response data
|
|
1014
|
+
* @returns {Promise<T.JSONResponse<T.OKResponse>>} A promise that resolves with the response data
|
|
1158
1015
|
*/
|
|
1159
|
-
releaseProductFirmware({ version, product, product_default, groups, intelligent, auth, headers, context }: ReleaseFirmwareOptions): Promise<JSONResponse<OKResponse>>;
|
|
1016
|
+
releaseProductFirmware({ version, product, product_default, groups, intelligent, auth, headers, context }: T.ReleaseFirmwareOptions): Promise<T.JSONResponse<T.OKResponse>>;
|
|
1160
1017
|
/**
|
|
1161
1018
|
* List product team members
|
|
1162
1019
|
* @param {Object} options Options for this API call
|
|
@@ -1164,9 +1021,9 @@ declare class Particle {
|
|
|
1164
1021
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
1165
1022
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1166
1023
|
* @param {Object} [options.context] Request context
|
|
1167
|
-
* @returns {Promise<JSONResponse<TeamMember[]>>} A promise that resolves with the response data
|
|
1024
|
+
* @returns {Promise<T.JSONResponse<T.TeamMember[]>>} A promise that resolves with the response data
|
|
1168
1025
|
*/
|
|
1169
|
-
listTeamMembers({ product, auth, headers, context }: ListTeamMembersOptions): Promise<JSONResponse<TeamMember[]>>;
|
|
1026
|
+
listTeamMembers({ product, auth, headers, context }: T.ListTeamMembersOptions): Promise<T.JSONResponse<T.TeamMember[]>>;
|
|
1170
1027
|
/**
|
|
1171
1028
|
* Invite Particle user to a product team
|
|
1172
1029
|
* @param {Object} options Options for this API call
|
|
@@ -1175,9 +1032,9 @@ declare class Particle {
|
|
|
1175
1032
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
1176
1033
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1177
1034
|
* @param {Object} [options.context] Request context
|
|
1178
|
-
* @returns {Promise<JSONResponse<OKResponse>>} A promise that resolves with the response data
|
|
1035
|
+
* @returns {Promise<T.JSONResponse<T.OKResponse>>} A promise that resolves with the response data
|
|
1179
1036
|
*/
|
|
1180
|
-
inviteTeamMember({ username, product, auth, headers, context }: InviteTeamMemberOptions): Promise<JSONResponse<OKResponse>>;
|
|
1037
|
+
inviteTeamMember({ username, product, auth, headers, context }: T.InviteTeamMemberOptions): Promise<T.JSONResponse<T.OKResponse>>;
|
|
1181
1038
|
/**
|
|
1182
1039
|
* Remove Particle user to a product team
|
|
1183
1040
|
* @param {Object} options Options for this API call
|
|
@@ -1186,9 +1043,9 @@ declare class Particle {
|
|
|
1186
1043
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
1187
1044
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1188
1045
|
* @param {Object} [options.context] Request context
|
|
1189
|
-
* @returns {Promise<JSONResponse<OKResponse>>} A promise that resolves with the response data
|
|
1046
|
+
* @returns {Promise<T.JSONResponse<T.OKResponse>>} A promise that resolves with the response data
|
|
1190
1047
|
*/
|
|
1191
|
-
removeTeamMember({ username, product, auth, headers, context }: RemoveTeamMemberOptions): Promise<JSONResponse<OKResponse>>;
|
|
1048
|
+
removeTeamMember({ username, product, auth, headers, context }: T.RemoveTeamMemberOptions): Promise<T.JSONResponse<T.OKResponse>>;
|
|
1192
1049
|
/**
|
|
1193
1050
|
* Fetch details about a serial number
|
|
1194
1051
|
* @param {Object} options Options for this API call
|
|
@@ -1196,108 +1053,9 @@ declare class Particle {
|
|
|
1196
1053
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
1197
1054
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1198
1055
|
* @param {Object} [options.context] Request context
|
|
1199
|
-
* @returns {Promise<JSONResponse<SerialNumberResponse>>} A promise that resolves with the response data
|
|
1056
|
+
* @returns {Promise<T.JSONResponse<T.SerialNumberResponse>>} A promise that resolves with the response data
|
|
1200
1057
|
*/
|
|
1201
|
-
lookupSerialNumber({ serialNumber, auth, headers, context }: LookupSerialNumberOptions): Promise<JSONResponse<SerialNumberResponse>>;
|
|
1202
|
-
/**
|
|
1203
|
-
* Create a mesh network
|
|
1204
|
-
* @param {Object} options Options for this API call
|
|
1205
|
-
* @param {String} options.name Network name
|
|
1206
|
-
* @param {String} options.deviceId Gateway device ID
|
|
1207
|
-
* @param {String} [options.iccid] ICCID of the active SIM card (only for cellular gateway devices)
|
|
1208
|
-
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
1209
|
-
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1210
|
-
* @param {Object} [options.context] Request context
|
|
1211
|
-
* @returns {Promise<JSONResponse<NetworkInfo>>} A promise that resolves with the response data
|
|
1212
|
-
*/
|
|
1213
|
-
createMeshNetwork({ name, deviceId, iccid, auth, headers, context }: CreateMeshNetworkOptions): Promise<JSONResponse<NetworkInfo>>;
|
|
1214
|
-
/**
|
|
1215
|
-
* Remove a mesh network.
|
|
1216
|
-
* @param {Object} options Options for this API call
|
|
1217
|
-
* @param {String} options.networkId Network ID or name
|
|
1218
|
-
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
1219
|
-
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1220
|
-
* @param {Object} [options.context] Request context
|
|
1221
|
-
* @returns {Promise<JSONResponse<OKResponse>>} A promise that resolves with the response data
|
|
1222
|
-
*/
|
|
1223
|
-
removeMeshNetwork({ networkId, auth, headers, context }: RemoveMeshNetworkOptions): Promise<JSONResponse<OKResponse>>;
|
|
1224
|
-
/**
|
|
1225
|
-
* List all mesh networks
|
|
1226
|
-
* @param {Object} options Options for this API call
|
|
1227
|
-
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
1228
|
-
* @param {Number} [options.page] Current page of results
|
|
1229
|
-
* @param {Number} [options.perPage] Records per page
|
|
1230
|
-
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1231
|
-
* @param {Object} [options.context] Request context
|
|
1232
|
-
* @returns {Promise<JSONResponse<NetworkInfo[]>>} A promise that resolves with the response data
|
|
1233
|
-
*/
|
|
1234
|
-
listMeshNetworks({ page, perPage, auth, headers, context }: ListMeshNetworksOptions): Promise<JSONResponse<NetworkInfo[]>>;
|
|
1235
|
-
/**
|
|
1236
|
-
* Get information about a mesh network.
|
|
1237
|
-
* @param {Object} options Options for this API call
|
|
1238
|
-
* @param {String} options.networkId Network ID or name
|
|
1239
|
-
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
1240
|
-
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1241
|
-
* @param {Object} [options.context] Request context
|
|
1242
|
-
* @returns {Promise<JSONResponse<NetworkInfo>>} A promise that resolves with the response data
|
|
1243
|
-
*/
|
|
1244
|
-
getMeshNetwork({ networkId, auth, headers, context }: GetMeshNetworkOptions): Promise<JSONResponse<NetworkInfo>>;
|
|
1245
|
-
/**
|
|
1246
|
-
* Modify a mesh network.
|
|
1247
|
-
* @param {Object} options Options for this API call
|
|
1248
|
-
* @param {String} options.networkId Network ID or name
|
|
1249
|
-
* @param {String} options.action 'add-device', 'remove-device', 'gateway-enable' or 'gateway-disable'
|
|
1250
|
-
* @param {String} options.deviceId Device ID
|
|
1251
|
-
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
1252
|
-
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1253
|
-
* @param {Object} [options.context] Request context
|
|
1254
|
-
* @returns {Promise<JSONResponse<NetworkInfo>>} A promise that resolves with the response data
|
|
1255
|
-
*/
|
|
1256
|
-
updateMeshNetwork({ networkId, action, deviceId, auth, headers, context }: UpdateMeshNetworkOptions): Promise<JSONResponse<NetworkInfo>>;
|
|
1257
|
-
/**
|
|
1258
|
-
* Add a device to a mesh network.
|
|
1259
|
-
* @param {Object} options Options for this API call
|
|
1260
|
-
* @param {String} options.networkId Network ID or name
|
|
1261
|
-
* @param {String} options.deviceId Device ID
|
|
1262
|
-
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
1263
|
-
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1264
|
-
* @param {Object} [options.context] Request context
|
|
1265
|
-
* @returns {Promise<JSONResponse<NetworkInfo>>} A promise that resolves with the response data
|
|
1266
|
-
*/
|
|
1267
|
-
addMeshNetworkDevice({ networkId, deviceId, auth, headers, context }: {
|
|
1268
|
-
networkId: string;
|
|
1269
|
-
deviceId: string;
|
|
1270
|
-
auth?: string;
|
|
1271
|
-
headers?: Record<string, string>;
|
|
1272
|
-
context?: {
|
|
1273
|
-
tool?: ToolContext;
|
|
1274
|
-
project?: ProjectContext;
|
|
1275
|
-
};
|
|
1276
|
-
}): Promise<JSONResponse<NetworkInfo>>;
|
|
1277
|
-
/**
|
|
1278
|
-
* Remove a device from a mesh network.
|
|
1279
|
-
* @param {Object} options Options for this API call
|
|
1280
|
-
* @param {String} [options.networkId] Network ID or name
|
|
1281
|
-
* @param {String} options.deviceId Device ID
|
|
1282
|
-
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
1283
|
-
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1284
|
-
* @param {Object} [options.context] Request context
|
|
1285
|
-
* @returns {Promise<JSONResponse<OKResponse>>} A promise that resolves with the response data
|
|
1286
|
-
*/
|
|
1287
|
-
removeMeshNetworkDevice({ networkId, deviceId, auth, headers, context }: RemoveMeshNetworkDeviceOptions): Promise<JSONResponse<OKResponse>>;
|
|
1288
|
-
/**
|
|
1289
|
-
* List all devices of a mesh network.
|
|
1290
|
-
* @param {Object} options Options for this API call
|
|
1291
|
-
* @param {String} options.networkId Network ID or name
|
|
1292
|
-
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
1293
|
-
* @param {Number} [options.role] Device role: 'gateway' or 'node'
|
|
1294
|
-
* @param {Number} [options.page] Current page of results
|
|
1295
|
-
* @param {Number} [options.perPage] Records per page
|
|
1296
|
-
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1297
|
-
* @param {Object} [options.context] Request context
|
|
1298
|
-
* @returns {Promise<JSONResponse<DeviceInfo[]>>} A promise that resolves with the response data
|
|
1299
|
-
*/
|
|
1300
|
-
listMeshNetworkDevices({ networkId, role, page, perPage, auth, headers, context }: ListMeshNetworkDevicesOptions): Promise<JSONResponse<DeviceInfo[]>>;
|
|
1058
|
+
lookupSerialNumber({ serialNumber, auth, headers, context }: T.LookupSerialNumberOptions): Promise<T.JSONResponse<T.SerialNumberResponse>>;
|
|
1301
1059
|
/**
|
|
1302
1060
|
* Get product configuration
|
|
1303
1061
|
* @param {Object} options Options for this API call
|
|
@@ -1305,9 +1063,9 @@ declare class Particle {
|
|
|
1305
1063
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
1306
1064
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1307
1065
|
* @param {Object} [options.context] Request context
|
|
1308
|
-
* @returns {Promise<JSONResponse<ProductConfigurationResponse>>} A promise that resolves with the response data
|
|
1066
|
+
* @returns {Promise<T.JSONResponse<T.ProductConfigurationResponse>>} A promise that resolves with the response data
|
|
1309
1067
|
*/
|
|
1310
|
-
getProductConfiguration({ auth, product, headers, context }: GetProductConfigurationOptions): Promise<JSONResponse<ProductConfigurationResponse>>;
|
|
1068
|
+
getProductConfiguration({ auth, product, headers, context }: T.GetProductConfigurationOptions): Promise<T.JSONResponse<T.ProductConfigurationResponse>>;
|
|
1311
1069
|
/**
|
|
1312
1070
|
* Get product configuration schema
|
|
1313
1071
|
* @param {Object} options Options for this API call
|
|
@@ -1315,9 +1073,9 @@ declare class Particle {
|
|
|
1315
1073
|
* @param {string} [options.auth] The access token. Can be ignored if provided in constructor
|
|
1316
1074
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1317
1075
|
* @param {Object} [options.context] Request context
|
|
1318
|
-
* @returns {Promise<JSONResponse<object>>} A promise that resolves with the response data
|
|
1076
|
+
* @returns {Promise<T.JSONResponse<object>>} A promise that resolves with the response data
|
|
1319
1077
|
*/
|
|
1320
|
-
getProductConfigurationSchema({ auth, product, headers, context }: GetProductConfigurationSchemaOptions): Promise<JSONResponse<object>>;
|
|
1078
|
+
getProductConfigurationSchema({ auth, product, headers, context }: T.GetProductConfigurationSchemaOptions): Promise<T.JSONResponse<object>>;
|
|
1321
1079
|
/**
|
|
1322
1080
|
* Get product device's configuration
|
|
1323
1081
|
* @param {Object} options Options for this API call
|
|
@@ -1326,9 +1084,9 @@ declare class Particle {
|
|
|
1326
1084
|
* @param {String} options.deviceId Device ID to access
|
|
1327
1085
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1328
1086
|
* @param {Object} [options.context] Request context
|
|
1329
|
-
* @returns {Promise<JSONResponse<ProductConfigurationResponse>>} A promise that resolves with the response data
|
|
1087
|
+
* @returns {Promise<T.JSONResponse<T.ProductConfigurationResponse>>} A promise that resolves with the response data
|
|
1330
1088
|
*/
|
|
1331
|
-
getProductDeviceConfiguration({ auth, product, deviceId, headers, context }: GetProductDeviceConfigurationOptions): Promise<JSONResponse<ProductConfigurationResponse>>;
|
|
1089
|
+
getProductDeviceConfiguration({ auth, product, deviceId, headers, context }: T.GetProductDeviceConfigurationOptions): Promise<T.JSONResponse<T.ProductConfigurationResponse>>;
|
|
1332
1090
|
/**
|
|
1333
1091
|
* Get product device's configuration schema
|
|
1334
1092
|
* @param {Object} options Options for this API call
|
|
@@ -1337,9 +1095,9 @@ declare class Particle {
|
|
|
1337
1095
|
* @param {String} options.deviceId Device ID to access
|
|
1338
1096
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1339
1097
|
* @param {Object} [options.context] Request context
|
|
1340
|
-
* @returns {Promise<JSONResponse<object>>} A promise that resolves with the response data
|
|
1098
|
+
* @returns {Promise<T.JSONResponse<object>>} A promise that resolves with the response data
|
|
1341
1099
|
*/
|
|
1342
|
-
getProductDeviceConfigurationSchema({ auth, product, deviceId, headers, context }: GetProductDeviceConfigurationSchemaOptions): Promise<JSONResponse<object>>;
|
|
1100
|
+
getProductDeviceConfigurationSchema({ auth, product, deviceId, headers, context }: T.GetProductDeviceConfigurationSchemaOptions): Promise<T.JSONResponse<object>>;
|
|
1343
1101
|
/**
|
|
1344
1102
|
* Set product configuration
|
|
1345
1103
|
* @param {Object} options Options for this API call
|
|
@@ -1348,9 +1106,9 @@ declare class Particle {
|
|
|
1348
1106
|
* @param {Object} options.config Product configuration to update
|
|
1349
1107
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1350
1108
|
* @param {Object} [options.context] Request context
|
|
1351
|
-
* @returns {Promise<JSONResponse<ProductConfigurationResponse>>} A promise that resolves with the response data
|
|
1109
|
+
* @returns {Promise<T.JSONResponse<T.ProductConfigurationResponse>>} A promise that resolves with the response data
|
|
1352
1110
|
*/
|
|
1353
|
-
setProductConfiguration({ auth, product, config, headers, context }: SetProductConfigurationOptions): Promise<JSONResponse<ProductConfigurationResponse>>;
|
|
1111
|
+
setProductConfiguration({ auth, product, config, headers, context }: T.SetProductConfigurationOptions): Promise<T.JSONResponse<T.ProductConfigurationResponse>>;
|
|
1354
1112
|
/**
|
|
1355
1113
|
* Set product configuration for a specific device within the product
|
|
1356
1114
|
* @param {Object} options Options for this API call
|
|
@@ -1360,9 +1118,9 @@ declare class Particle {
|
|
|
1360
1118
|
* @param {String} options.deviceId Device ID to access
|
|
1361
1119
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1362
1120
|
* @param {Object} [options.context] Request context
|
|
1363
|
-
* @returns {Promise<JSONResponse<ProductConfigurationResponse>>} A promise that resolves with the response data
|
|
1121
|
+
* @returns {Promise<T.JSONResponse<T.ProductConfigurationResponse>>} A promise that resolves with the response data
|
|
1364
1122
|
*/
|
|
1365
|
-
setProductDeviceConfiguration({ auth, product, deviceId, config, headers, context }: SetProductDeviceConfigurationOptions): Promise<JSONResponse<ProductConfigurationResponse>>;
|
|
1123
|
+
setProductDeviceConfiguration({ auth, product, deviceId, config, headers, context }: T.SetProductDeviceConfigurationOptions): Promise<T.JSONResponse<T.ProductConfigurationResponse>>;
|
|
1366
1124
|
/**
|
|
1367
1125
|
* Query location for devices within a product
|
|
1368
1126
|
* @param {Object} options Options for this API call
|
|
@@ -1378,9 +1136,9 @@ declare class Particle {
|
|
|
1378
1136
|
* @param {String} options.perPage Number of results per page. Defaults to 20. Maximum of 100
|
|
1379
1137
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1380
1138
|
* @param {Object} [options.context] Request context
|
|
1381
|
-
* @returns {Promise<JSONResponse<LocationListResponse>>} A promise that resolves with the response data
|
|
1139
|
+
* @returns {Promise<T.JSONResponse<T.LocationListResponse>>} A promise that resolves with the response data
|
|
1382
1140
|
*/
|
|
1383
|
-
getProductLocations({ auth, product, dateRange, rectBl, rectTr, deviceId, deviceName, groups, page, perPage, headers, context }: GetProductLocationsOptions): Promise<JSONResponse<LocationListResponse>>;
|
|
1141
|
+
getProductLocations({ auth, product, dateRange, rectBl, rectTr, deviceId, deviceName, groups, page, perPage, headers, context }: T.GetProductLocationsOptions): Promise<T.JSONResponse<T.LocationListResponse>>;
|
|
1384
1142
|
/**
|
|
1385
1143
|
* Query location for one device within a product
|
|
1386
1144
|
* @param {Object} options Options for this API call
|
|
@@ -1394,9 +1152,9 @@ declare class Particle {
|
|
|
1394
1152
|
* @param {Object} [options.context] Request context
|
|
1395
1153
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1396
1154
|
* @param {Object} [options.context] Request context
|
|
1397
|
-
* @returns {Promise<JSONResponse<DeviceLocationInfo>>} A promise that resolves with the response data
|
|
1155
|
+
* @returns {Promise<T.JSONResponse<T.DeviceLocationInfo>>} A promise that resolves with the response data
|
|
1398
1156
|
*/
|
|
1399
|
-
getProductDeviceLocations({ auth, product, dateRange, rectBl, rectTr, deviceId, headers, context }: GetProductDeviceLocationsOptions): Promise<JSONResponse<DeviceLocationInfo>>;
|
|
1157
|
+
getProductDeviceLocations({ auth, product, dateRange, rectBl, rectTr, deviceId, headers, context }: T.GetProductDeviceLocationsOptions): Promise<T.JSONResponse<T.DeviceLocationInfo>>;
|
|
1400
1158
|
/**
|
|
1401
1159
|
* Executes the provided logic function once and returns the result. No logs, runs, etc are saved
|
|
1402
1160
|
*
|
|
@@ -1409,9 +1167,9 @@ declare class Particle {
|
|
|
1409
1167
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1410
1168
|
* @param {Object} [options.context] Request context
|
|
1411
1169
|
*
|
|
1412
|
-
* @returns {Promise<JSONResponse<ExecuteLogicResponse>>} A promise that resolves with the response data
|
|
1170
|
+
* @returns {Promise<T.JSONResponse<T.ExecuteLogicResponse>>} A promise that resolves with the response data
|
|
1413
1171
|
*/
|
|
1414
|
-
executeLogic({ auth, org, logic, headers, context }: ExecuteLogicOptions): Promise<JSONResponse<ExecuteLogicResponse>>;
|
|
1172
|
+
executeLogic({ auth, org, logic, headers, context }: T.ExecuteLogicOptions): Promise<T.JSONResponse<T.ExecuteLogicResponse>>;
|
|
1415
1173
|
/**
|
|
1416
1174
|
* Creates a new logic function in the specified organization or sandbox using the provided function data.
|
|
1417
1175
|
*
|
|
@@ -1428,29 +1186,10 @@ declare class Particle {
|
|
|
1428
1186
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1429
1187
|
* @param {Object} [options.context] Request context
|
|
1430
1188
|
*
|
|
1431
|
-
* @returns {Promise<RequestResponse>} A promise that resolves to the created logic function data.
|
|
1189
|
+
* @returns {Promise<T.RequestResponse>} A promise that resolves to the created logic function data.
|
|
1432
1190
|
*/
|
|
1433
|
-
createLogicFunction({ auth, org, logicFunction, headers, context }: {
|
|
1434
|
-
|
|
1435
|
-
org?: string;
|
|
1436
|
-
logicFunction: {
|
|
1437
|
-
name: string;
|
|
1438
|
-
description?: string;
|
|
1439
|
-
enabled?: boolean;
|
|
1440
|
-
source: {
|
|
1441
|
-
type: 'JavaScript';
|
|
1442
|
-
code: string;
|
|
1443
|
-
};
|
|
1444
|
-
logic_triggers?: object[];
|
|
1445
|
-
api_username?: string;
|
|
1446
|
-
};
|
|
1447
|
-
headers?: Record<string, string>;
|
|
1448
|
-
context?: {
|
|
1449
|
-
tool?: ToolContext;
|
|
1450
|
-
project?: ProjectContext;
|
|
1451
|
-
};
|
|
1452
|
-
}): Promise<JSONResponse<{
|
|
1453
|
-
logic_function: LogicFunction;
|
|
1191
|
+
createLogicFunction({ auth, org, logicFunction, headers, context }: T.CreateLogicFunctionOptions): Promise<T.JSONResponse<{
|
|
1192
|
+
logic_function: T.LogicFunction;
|
|
1454
1193
|
}>>;
|
|
1455
1194
|
/**
|
|
1456
1195
|
* Get a logic function in the specified organization or sandbox by logic function ID.
|
|
@@ -1462,10 +1201,10 @@ declare class Particle {
|
|
|
1462
1201
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1463
1202
|
* @param {Object} [options.context] Request context
|
|
1464
1203
|
*
|
|
1465
|
-
* @returns {Promise<RequestResponse>} A promise that resolves to the specified logic function data.
|
|
1204
|
+
* @returns {Promise<T.RequestResponse>} A promise that resolves to the specified logic function data.
|
|
1466
1205
|
*/
|
|
1467
|
-
getLogicFunction({ auth, org, logicFunctionId, headers, context }: GetLogicFunctionOptions): Promise<JSONResponse<{
|
|
1468
|
-
logic_function: LogicFunction;
|
|
1206
|
+
getLogicFunction({ auth, org, logicFunctionId, headers, context }: T.GetLogicFunctionOptions): Promise<T.JSONResponse<{
|
|
1207
|
+
logic_function: T.LogicFunction;
|
|
1469
1208
|
}>>;
|
|
1470
1209
|
/**
|
|
1471
1210
|
* Updates an existing logic function in the specified organization or sandbox using the provided function data.
|
|
@@ -1480,29 +1219,10 @@ declare class Particle {
|
|
|
1480
1219
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1481
1220
|
* @param {Object} [options.context] Request context.
|
|
1482
1221
|
*
|
|
1483
|
-
* @returns {Promise<RequestResponse>} A promise that resolves to the updated logic function data.
|
|
1222
|
+
* @returns {Promise<T.RequestResponse>} A promise that resolves to the updated logic function data.
|
|
1484
1223
|
*/
|
|
1485
|
-
updateLogicFunction({ auth, org, logicFunctionId, logicFunction, headers, context }: {
|
|
1486
|
-
|
|
1487
|
-
org?: string;
|
|
1488
|
-
logicFunctionId: string;
|
|
1489
|
-
logicFunction: {
|
|
1490
|
-
name?: string;
|
|
1491
|
-
description?: string;
|
|
1492
|
-
enabled?: boolean;
|
|
1493
|
-
source?: {
|
|
1494
|
-
type: 'JavaScript';
|
|
1495
|
-
code: string;
|
|
1496
|
-
};
|
|
1497
|
-
logic_triggers?: object[];
|
|
1498
|
-
};
|
|
1499
|
-
headers?: Record<string, string>;
|
|
1500
|
-
context?: {
|
|
1501
|
-
tool?: ToolContext;
|
|
1502
|
-
project?: ProjectContext;
|
|
1503
|
-
};
|
|
1504
|
-
}): Promise<JSONResponse<{
|
|
1505
|
-
logic_function: LogicFunction;
|
|
1224
|
+
updateLogicFunction({ auth, org, logicFunctionId, logicFunction, headers, context }: T.UpdateLogicFunctionOptions): Promise<T.JSONResponse<{
|
|
1225
|
+
logic_function: T.LogicFunction;
|
|
1506
1226
|
}>>;
|
|
1507
1227
|
/**
|
|
1508
1228
|
* Deletes a logic function in the specified organization or sandbox by logic function ID.
|
|
@@ -1514,9 +1234,9 @@ declare class Particle {
|
|
|
1514
1234
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1515
1235
|
* @param {Object} [options.context] Request context.
|
|
1516
1236
|
*
|
|
1517
|
-
* @returns {Promise<JSONResponse<OKResponse>>} A promise that resolves with the response data
|
|
1237
|
+
* @returns {Promise<T.JSONResponse<T.OKResponse>>} A promise that resolves with the response data
|
|
1518
1238
|
*/
|
|
1519
|
-
deleteLogicFunction({ auth, org, logicFunctionId, headers, context }: DeleteLogicFunctionOptions): Promise<JSONResponse<OKResponse>>;
|
|
1239
|
+
deleteLogicFunction({ auth, org, logicFunctionId, headers, context }: T.DeleteLogicFunctionOptions): Promise<T.JSONResponse<T.OKResponse>>;
|
|
1520
1240
|
/**
|
|
1521
1241
|
* Lists all logic functions in the specified organization or sandbox.
|
|
1522
1242
|
*
|
|
@@ -1527,10 +1247,10 @@ declare class Particle {
|
|
|
1527
1247
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1528
1248
|
* @param {Object} [options.context] Request context.
|
|
1529
1249
|
*
|
|
1530
|
-
* @returns {Promise<RequestResponse>} A promise that resolves to an array of logic functions data.
|
|
1250
|
+
* @returns {Promise<T.RequestResponse>} A promise that resolves to an array of logic functions data.
|
|
1531
1251
|
*/
|
|
1532
|
-
listLogicFunctions({ auth, org, todayStats, headers, context }: ListLogicFunctionsOptions): Promise<JSONResponse<{
|
|
1533
|
-
logic_functions: LogicFunction[];
|
|
1252
|
+
listLogicFunctions({ auth, org, todayStats, headers, context }: T.ListLogicFunctionsOptions): Promise<T.JSONResponse<{
|
|
1253
|
+
logic_functions: T.LogicFunction[];
|
|
1534
1254
|
}>>;
|
|
1535
1255
|
/**
|
|
1536
1256
|
* Lists all logic runs for the specified logic function in the specified organization or sandbox.
|
|
@@ -1542,10 +1262,10 @@ declare class Particle {
|
|
|
1542
1262
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1543
1263
|
* @param {Object} [options.context] Request context
|
|
1544
1264
|
*
|
|
1545
|
-
* @returns {Promise<RequestResponse>} A promise that resolves to an array of logic run data.
|
|
1265
|
+
* @returns {Promise<T.RequestResponse>} A promise that resolves to an array of logic run data.
|
|
1546
1266
|
*/
|
|
1547
|
-
listLogicRuns({ auth, org, logicFunctionId, headers, context }: ListLogicRunsOptions): Promise<JSONResponse<{
|
|
1548
|
-
logic_runs: LogicRun[];
|
|
1267
|
+
listLogicRuns({ auth, org, logicFunctionId, headers, context }: T.ListLogicRunsOptions): Promise<T.JSONResponse<{
|
|
1268
|
+
logic_runs: T.LogicRun[];
|
|
1549
1269
|
}>>;
|
|
1550
1270
|
/**
|
|
1551
1271
|
* Retrieves a logic run by its ID for the specified logic function in the specified organization or sandbox.
|
|
@@ -1558,10 +1278,10 @@ declare class Particle {
|
|
|
1558
1278
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1559
1279
|
* @param {Object} [options.context] Request context
|
|
1560
1280
|
*
|
|
1561
|
-
* @returns {Promise<RequestResponse>} A promise that resolves to an array of logic run data for the specified logic run ID.
|
|
1281
|
+
* @returns {Promise<T.RequestResponse>} A promise that resolves to an array of logic run data for the specified logic run ID.
|
|
1562
1282
|
*/
|
|
1563
|
-
getLogicRun({ auth, org, logicFunctionId, logicRunId, headers, context }: GetLogicRunOptions): Promise<JSONResponse<{
|
|
1564
|
-
logic_run: LogicRun;
|
|
1283
|
+
getLogicRun({ auth, org, logicFunctionId, logicRunId, headers, context }: T.GetLogicRunOptions): Promise<T.JSONResponse<{
|
|
1284
|
+
logic_run: T.LogicRun;
|
|
1565
1285
|
}>>;
|
|
1566
1286
|
/**
|
|
1567
1287
|
* Retrieves the logs for a logic run by its ID for the specified logic function in the specified organization or sandbox.
|
|
@@ -1574,10 +1294,10 @@ declare class Particle {
|
|
|
1574
1294
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1575
1295
|
* @param {Object} [options.context] Request context
|
|
1576
1296
|
*
|
|
1577
|
-
* @returns {Promise<RequestResponse>} A promise that resolves to the logs for the specified logic run ID.
|
|
1297
|
+
* @returns {Promise<T.RequestResponse>} A promise that resolves to the logs for the specified logic run ID.
|
|
1578
1298
|
*/
|
|
1579
|
-
getLogicRunLogs({ auth, org, logicFunctionId, logicRunId, headers, context }: GetLogicRunLogsOptions): Promise<JSONResponse<{
|
|
1580
|
-
logs: LogicRunLog[];
|
|
1299
|
+
getLogicRunLogs({ auth, org, logicFunctionId, logicRunId, headers, context }: T.GetLogicRunLogsOptions): Promise<T.JSONResponse<{
|
|
1300
|
+
logs: T.LogicRunLog[];
|
|
1581
1301
|
}>>;
|
|
1582
1302
|
/**
|
|
1583
1303
|
* Creates a new ledger definition in the specified organization or sandbox.
|
|
@@ -1589,9 +1309,9 @@ declare class Particle {
|
|
|
1589
1309
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1590
1310
|
* @param {Object} [options.context] Request context
|
|
1591
1311
|
*
|
|
1592
|
-
* @returns {Promise<JSONResponse<LedgerDefinition>>} A promise that resolves with the response data
|
|
1312
|
+
* @returns {Promise<T.JSONResponse<T.LedgerDefinition>>} A promise that resolves with the response data
|
|
1593
1313
|
*/
|
|
1594
|
-
createLedger({ auth, org, ledger, headers, context }: CreateLedgerOptions): Promise<JSONResponse<LedgerDefinition>>;
|
|
1314
|
+
createLedger({ auth, org, ledger, headers, context }: T.CreateLedgerOptions): Promise<T.JSONResponse<T.LedgerDefinition>>;
|
|
1595
1315
|
/**
|
|
1596
1316
|
* Get a ledger definition in the specified organization or sandbox by ledger name.
|
|
1597
1317
|
*
|
|
@@ -1602,9 +1322,9 @@ declare class Particle {
|
|
|
1602
1322
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1603
1323
|
* @param {Object} [options.context] Request context
|
|
1604
1324
|
*
|
|
1605
|
-
* @returns {Promise<JSONResponse<LedgerDefinition>>} A promise that resolves with the response data
|
|
1325
|
+
* @returns {Promise<T.JSONResponse<T.LedgerDefinition>>} A promise that resolves with the response data
|
|
1606
1326
|
*/
|
|
1607
|
-
getLedger({ auth, org, ledgerName, headers, context }: GetLedgerOptions): Promise<JSONResponse<LedgerDefinition>>;
|
|
1327
|
+
getLedger({ auth, org, ledgerName, headers, context }: T.GetLedgerOptions): Promise<T.JSONResponse<T.LedgerDefinition>>;
|
|
1608
1328
|
/**
|
|
1609
1329
|
* Updates an existing ledger definition in the specified organization or sandbox.
|
|
1610
1330
|
*
|
|
@@ -1616,9 +1336,9 @@ declare class Particle {
|
|
|
1616
1336
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1617
1337
|
* @param {Object} [options.context] Request context.
|
|
1618
1338
|
*
|
|
1619
|
-
* @returns {Promise<JSONResponse<LedgerDefinition>>} A promise that resolves with the response data
|
|
1339
|
+
* @returns {Promise<T.JSONResponse<T.LedgerDefinition>>} A promise that resolves with the response data
|
|
1620
1340
|
*/
|
|
1621
|
-
updateLedger({ auth, org, ledgerName, ledger, headers, context }: UpdateLedgerOptions): Promise<JSONResponse<LedgerDefinition>>;
|
|
1341
|
+
updateLedger({ auth, org, ledgerName, ledger, headers, context }: T.UpdateLedgerOptions): Promise<T.JSONResponse<T.LedgerDefinition>>;
|
|
1622
1342
|
/**
|
|
1623
1343
|
* Archives a ledger definition in the specified organization or sandbox by ledger name.
|
|
1624
1344
|
*
|
|
@@ -1629,9 +1349,9 @@ declare class Particle {
|
|
|
1629
1349
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1630
1350
|
* @param {Object} [options.context] Request context.
|
|
1631
1351
|
*
|
|
1632
|
-
* @returns {Promise<JSONResponse<OKResponse>>} A promise that resolves with the response data
|
|
1352
|
+
* @returns {Promise<T.JSONResponse<T.OKResponse>>} A promise that resolves with the response data
|
|
1633
1353
|
*/
|
|
1634
|
-
archiveLedger({ auth, org, ledgerName, headers, context }: ArchiveLedgerOptions): Promise<JSONResponse<OKResponse>>;
|
|
1354
|
+
archiveLedger({ auth, org, ledgerName, headers, context }: T.ArchiveLedgerOptions): Promise<T.JSONResponse<T.OKResponse>>;
|
|
1635
1355
|
/**
|
|
1636
1356
|
* @typedef {"Owner" | "Product" | "Device"} Scope
|
|
1637
1357
|
*/
|
|
@@ -1648,10 +1368,10 @@ declare class Particle {
|
|
|
1648
1368
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1649
1369
|
* @param {Object} [options.context] Request context.
|
|
1650
1370
|
*
|
|
1651
|
-
* @returns {Promise<RequestResponse>} A promise that resolves to an array of ledger definition data.
|
|
1371
|
+
* @returns {Promise<T.RequestResponse>} A promise that resolves to an array of ledger definition data.
|
|
1652
1372
|
*/
|
|
1653
|
-
listLedgers({ auth, org, scope, page, perPage, archived, headers, context }: ListLedgersOptions): Promise<JSONResponse<{
|
|
1654
|
-
ledger_definitions: LedgerDefinition[];
|
|
1373
|
+
listLedgers({ auth, org, scope, page, perPage, archived, headers, context }: T.ListLedgersOptions): Promise<T.JSONResponse<{
|
|
1374
|
+
ledger_definitions: T.LedgerDefinition[];
|
|
1655
1375
|
}>>;
|
|
1656
1376
|
/**
|
|
1657
1377
|
* Get ledger instance data.
|
|
@@ -1664,9 +1384,9 @@ declare class Particle {
|
|
|
1664
1384
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1665
1385
|
* @param {Object} [options.context] Request context
|
|
1666
1386
|
*
|
|
1667
|
-
* @returns {Promise<JSONResponse<LedgerInstance>>} A promise that resolves with the response data
|
|
1387
|
+
* @returns {Promise<T.JSONResponse<T.LedgerInstance>>} A promise that resolves with the response data
|
|
1668
1388
|
*/
|
|
1669
|
-
getLedgerInstance({ auth, org, ledgerName, scopeValue, headers, context }: GetLedgerInstanceOptions): Promise<JSONResponse<LedgerInstance>>;
|
|
1389
|
+
getLedgerInstance({ auth, org, ledgerName, scopeValue, headers, context }: T.GetLedgerInstanceOptions): Promise<T.JSONResponse<T.LedgerInstance>>;
|
|
1670
1390
|
/**
|
|
1671
1391
|
* @typedef {"Replace" | "Merge"} SetMode
|
|
1672
1392
|
*/
|
|
@@ -1683,9 +1403,9 @@ declare class Particle {
|
|
|
1683
1403
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1684
1404
|
* @param {Object} [options.context] Request context.
|
|
1685
1405
|
*
|
|
1686
|
-
* @returns {Promise<JSONResponse<LedgerInstance>>} A promise that resolves with the response data
|
|
1406
|
+
* @returns {Promise<T.JSONResponse<T.LedgerInstance>>} A promise that resolves with the response data
|
|
1687
1407
|
*/
|
|
1688
|
-
setLedgerInstance({ auth, org, ledgerName, scopeValue, instance, setMode, headers, context }: SetLedgerInstanceOptions): Promise<JSONResponse<LedgerInstance>>;
|
|
1408
|
+
setLedgerInstance({ auth, org, ledgerName, scopeValue, instance, setMode, headers, context }: T.SetLedgerInstanceOptions): Promise<T.JSONResponse<T.LedgerInstance>>;
|
|
1689
1409
|
/**
|
|
1690
1410
|
* Delete a ledger instance in the specified organization or sandbox by ledger name.
|
|
1691
1411
|
*
|
|
@@ -1697,9 +1417,9 @@ declare class Particle {
|
|
|
1697
1417
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1698
1418
|
* @param {Object} [options.context] Request context.
|
|
1699
1419
|
*
|
|
1700
|
-
* @returns {Promise<JSONResponse<OKResponse>>} A promise that resolves with the response data
|
|
1420
|
+
* @returns {Promise<T.JSONResponse<T.OKResponse>>} A promise that resolves with the response data
|
|
1701
1421
|
*/
|
|
1702
|
-
deleteLedgerInstance({ auth, org, ledgerName, scopeValue, headers, context }: DeleteLedgerInstanceOptions): Promise<JSONResponse<OKResponse>>;
|
|
1422
|
+
deleteLedgerInstance({ auth, org, ledgerName, scopeValue, headers, context }: T.DeleteLedgerInstanceOptions): Promise<T.JSONResponse<T.OKResponse>>;
|
|
1703
1423
|
/**
|
|
1704
1424
|
* Lists ledger instances in the specified organization or sandbox.
|
|
1705
1425
|
*
|
|
@@ -1712,9 +1432,9 @@ declare class Particle {
|
|
|
1712
1432
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1713
1433
|
* @param {Object} [options.context] Request context.
|
|
1714
1434
|
*
|
|
1715
|
-
* @returns {Promise<JSONResponse<LedgerInstanceListResponse>>} A promise that resolves with the response data
|
|
1435
|
+
* @returns {Promise<T.JSONResponse<T.LedgerInstanceListResponse>>} A promise that resolves with the response data
|
|
1716
1436
|
*/
|
|
1717
|
-
listLedgerInstances({ auth, org, ledgerName, page, perPage, headers, context }: ListLedgerInstancesOptions): Promise<JSONResponse<LedgerInstanceListResponse>>;
|
|
1437
|
+
listLedgerInstances({ auth, org, ledgerName, page, perPage, headers, context }: T.ListLedgerInstancesOptions): Promise<T.JSONResponse<T.LedgerInstanceListResponse>>;
|
|
1718
1438
|
/**
|
|
1719
1439
|
* List ledger instance versions
|
|
1720
1440
|
*
|
|
@@ -1728,9 +1448,9 @@ declare class Particle {
|
|
|
1728
1448
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1729
1449
|
* @param {Object} [options.context] Request context
|
|
1730
1450
|
*
|
|
1731
|
-
* @returns {Promise<JSONResponse<LedgerVersionListResponse>>} A promise that resolves with the response data
|
|
1451
|
+
* @returns {Promise<T.JSONResponse<T.LedgerVersionListResponse>>} A promise that resolves with the response data
|
|
1732
1452
|
*/
|
|
1733
|
-
listLedgerInstanceVersions({ auth, org, ledgerName, scopeValue, replacedBefore, replacedAfter, headers, context }: ListLedgerInstanceVersionsOptions): Promise<JSONResponse<LedgerVersionListResponse>>;
|
|
1453
|
+
listLedgerInstanceVersions({ auth, org, ledgerName, scopeValue, replacedBefore, replacedAfter, headers, context }: T.ListLedgerInstanceVersionsOptions): Promise<T.JSONResponse<T.LedgerVersionListResponse>>;
|
|
1734
1454
|
/**
|
|
1735
1455
|
* Get specific ledger instance version
|
|
1736
1456
|
*
|
|
@@ -1743,9 +1463,9 @@ declare class Particle {
|
|
|
1743
1463
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1744
1464
|
* @param {Object} [options.context] Request context
|
|
1745
1465
|
*
|
|
1746
|
-
* @returns {Promise<JSONResponse<LedgerInstance>>} A promise that resolves with the response data
|
|
1466
|
+
* @returns {Promise<T.JSONResponse<T.LedgerInstance>>} A promise that resolves with the response data
|
|
1747
1467
|
*/
|
|
1748
|
-
getLedgerInstanceVersion({ auth, org, ledgerName, scopeValue, version, headers, context }: GetLedgerInstanceVersionOptions): Promise<JSONResponse<LedgerInstance>>;
|
|
1468
|
+
getLedgerInstanceVersion({ auth, org, ledgerName, scopeValue, version, headers, context }: T.GetLedgerInstanceVersionOptions): Promise<T.JSONResponse<T.LedgerInstance>>;
|
|
1749
1469
|
/**
|
|
1750
1470
|
* List Device OS versions
|
|
1751
1471
|
*
|
|
@@ -1758,9 +1478,9 @@ declare class Particle {
|
|
|
1758
1478
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1759
1479
|
* @param {Object} [options.context] Request context
|
|
1760
1480
|
*
|
|
1761
|
-
* @returns {Promise<JSONResponse<DeviceOsVersion[]>>} A promise that resolves with the response data
|
|
1481
|
+
* @returns {Promise<T.JSONResponse<T.DeviceOsVersion[]>>} A promise that resolves with the response data
|
|
1762
1482
|
*/
|
|
1763
|
-
listDeviceOsVersions({ platformId, internalVersion, page, perPage, auth, headers, context }: ListDeviceOsVersionsOptions): Promise<JSONResponse<DeviceOsVersion[]>>;
|
|
1483
|
+
listDeviceOsVersions({ platformId, internalVersion, page, perPage, auth, headers, context }: T.ListDeviceOsVersionsOptions): Promise<T.JSONResponse<T.DeviceOsVersion[]>>;
|
|
1764
1484
|
/**
|
|
1765
1485
|
* Get a specific Device OS version
|
|
1766
1486
|
*
|
|
@@ -1771,9 +1491,9 @@ declare class Particle {
|
|
|
1771
1491
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1772
1492
|
* @param {Object} [options.context] Request context
|
|
1773
1493
|
*
|
|
1774
|
-
* @returns {Promise<JSONResponse<DeviceOsVersion>>} A promise that resolves with the response data
|
|
1494
|
+
* @returns {Promise<T.JSONResponse<T.DeviceOsVersion>>} A promise that resolves with the response data
|
|
1775
1495
|
*/
|
|
1776
|
-
getDeviceOsVersion({ version, platformId, auth, headers, context }: GetDeviceOsVersionOptions): Promise<JSONResponse<DeviceOsVersion>>;
|
|
1496
|
+
getDeviceOsVersion({ version, platformId, auth, headers, context }: T.GetDeviceOsVersionOptions): Promise<T.JSONResponse<T.DeviceOsVersion>>;
|
|
1777
1497
|
/**
|
|
1778
1498
|
* List environment variables for the given scope.
|
|
1779
1499
|
*
|
|
@@ -1786,9 +1506,9 @@ declare class Particle {
|
|
|
1786
1506
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1787
1507
|
* @param {Object} [options.context] Request context
|
|
1788
1508
|
*
|
|
1789
|
-
* @returns {Promise<JSONResponse<EnvVarsResponse>>} A promise that resolves with the env vars data
|
|
1509
|
+
* @returns {Promise<T.JSONResponse<T.EnvVarsResponse>>} A promise that resolves with the env vars data
|
|
1790
1510
|
*/
|
|
1791
|
-
listEnvVars({ product, org, deviceId, sandbox, auth, headers, context }: ListEnvVarsOptions): Promise<JSONResponse<EnvVarsResponse>>;
|
|
1511
|
+
listEnvVars({ product, org, deviceId, sandbox, auth, headers, context }: T.ListEnvVarsOptions): Promise<T.JSONResponse<T.EnvVarsResponse>>;
|
|
1792
1512
|
/**
|
|
1793
1513
|
* Bulk update environment variables with set/unset operations.
|
|
1794
1514
|
*
|
|
@@ -1802,9 +1522,9 @@ declare class Particle {
|
|
|
1802
1522
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1803
1523
|
* @param {Object} [options.context] Request context
|
|
1804
1524
|
*
|
|
1805
|
-
* @returns {Promise<JSONResponse<EnvVarsResponse>>} A promise that resolves with the updated env vars data
|
|
1525
|
+
* @returns {Promise<T.JSONResponse<T.EnvVarsResponse>>} A promise that resolves with the updated env vars data
|
|
1806
1526
|
*/
|
|
1807
|
-
updateEnvVars({ ops, product, org, deviceId, sandbox, auth, headers, context }: UpdateEnvVarsOptions): Promise<JSONResponse<EnvVarsResponse>>;
|
|
1527
|
+
updateEnvVars({ ops, product, org, deviceId, sandbox, auth, headers, context }: T.UpdateEnvVarsOptions): Promise<T.JSONResponse<T.EnvVarsResponse>>;
|
|
1808
1528
|
/**
|
|
1809
1529
|
* Set a single environment variable.
|
|
1810
1530
|
*
|
|
@@ -1819,9 +1539,9 @@ declare class Particle {
|
|
|
1819
1539
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1820
1540
|
* @param {Object} [options.context] Request context
|
|
1821
1541
|
*
|
|
1822
|
-
* @returns {Promise<JSONResponse<EnvVarsResponse>>} A promise that resolves with the updated env vars data
|
|
1542
|
+
* @returns {Promise<T.JSONResponse<T.EnvVarsResponse>>} A promise that resolves with the updated env vars data
|
|
1823
1543
|
*/
|
|
1824
|
-
setEnvVar({ key, value, product, org, deviceId, sandbox, auth, headers, context }: SetEnvVarOptions): Promise<JSONResponse<EnvVarsResponse>>;
|
|
1544
|
+
setEnvVar({ key, value, product, org, deviceId, sandbox, auth, headers, context }: T.SetEnvVarOptions): Promise<T.JSONResponse<T.EnvVarsResponse>>;
|
|
1825
1545
|
/**
|
|
1826
1546
|
* Delete a single environment variable.
|
|
1827
1547
|
*
|
|
@@ -1835,9 +1555,9 @@ declare class Particle {
|
|
|
1835
1555
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1836
1556
|
* @param {Object} [options.context] Request context
|
|
1837
1557
|
*
|
|
1838
|
-
* @returns {Promise<JSONResponse<EnvVarsResponse>>} A promise that resolves with the updated env vars data
|
|
1558
|
+
* @returns {Promise<T.JSONResponse<T.EnvVarsResponse>>} A promise that resolves with the updated env vars data
|
|
1839
1559
|
*/
|
|
1840
|
-
deleteEnvVar({ key, product, org, deviceId, sandbox, auth, headers, context }: DeleteEnvVarOptions): Promise<JSONResponse<EnvVarsResponse>>;
|
|
1560
|
+
deleteEnvVar({ key, product, org, deviceId, sandbox, auth, headers, context }: T.DeleteEnvVarOptions): Promise<T.JSONResponse<T.EnvVarsResponse>>;
|
|
1841
1561
|
/**
|
|
1842
1562
|
* Get the rendered (flattened) environment variables for the given scope.
|
|
1843
1563
|
*
|
|
@@ -1850,9 +1570,9 @@ declare class Particle {
|
|
|
1850
1570
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1851
1571
|
* @param {Object} [options.context] Request context
|
|
1852
1572
|
*
|
|
1853
|
-
* @returns {Promise<JSONResponse<EnvVarsRenderResponse>>} A promise that resolves with the rendered env vars
|
|
1573
|
+
* @returns {Promise<T.JSONResponse<T.EnvVarsRenderResponse>>} A promise that resolves with the rendered env vars
|
|
1854
1574
|
*/
|
|
1855
|
-
renderEnvVars({ product, org, deviceId, sandbox, auth, headers, context }: RenderEnvVarsOptions): Promise<JSONResponse<EnvVarsRenderResponse>>;
|
|
1575
|
+
renderEnvVars({ product, org, deviceId, sandbox, auth, headers, context }: T.RenderEnvVarsOptions): Promise<T.JSONResponse<T.EnvVarsRenderResponse>>;
|
|
1856
1576
|
/**
|
|
1857
1577
|
* Review the pending environment variables rollout changes.
|
|
1858
1578
|
*
|
|
@@ -1865,9 +1585,9 @@ declare class Particle {
|
|
|
1865
1585
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1866
1586
|
* @param {Object} [options.context] Request context
|
|
1867
1587
|
*
|
|
1868
|
-
* @returns {Promise<JSONResponse<EnvVarsRolloutResponse>>} A promise that resolves with the rollout diff
|
|
1588
|
+
* @returns {Promise<T.JSONResponse<T.EnvVarsRolloutResponse>>} A promise that resolves with the rollout diff
|
|
1869
1589
|
*/
|
|
1870
|
-
reviewEnvVarsRollout({ product, org, deviceId, sandbox, auth, headers, context }: ReviewEnvVarsRolloutOptions): Promise<JSONResponse<EnvVarsRolloutResponse>>;
|
|
1590
|
+
reviewEnvVarsRollout({ product, org, deviceId, sandbox, auth, headers, context }: T.ReviewEnvVarsRolloutOptions): Promise<T.JSONResponse<T.EnvVarsRolloutResponse>>;
|
|
1871
1591
|
/**
|
|
1872
1592
|
* Start rolling out environment variables to devices.
|
|
1873
1593
|
*
|
|
@@ -1881,9 +1601,9 @@ declare class Particle {
|
|
|
1881
1601
|
* @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1882
1602
|
* @param {Object} [options.context] Request context
|
|
1883
1603
|
*
|
|
1884
|
-
* @returns {Promise<JSONResponse<EnvVarsRolloutStartResponse>>} A promise that resolves with success status
|
|
1604
|
+
* @returns {Promise<T.JSONResponse<T.EnvVarsRolloutStartResponse>>} A promise that resolves with success status
|
|
1885
1605
|
*/
|
|
1886
|
-
startEnvVarsRollout({ when, product, org, deviceId, sandbox, auth, headers, context }: StartEnvVarsRolloutOptions): Promise<JSONResponse<EnvVarsRolloutStartResponse>>;
|
|
1606
|
+
startEnvVarsRollout({ when, product, org, deviceId, sandbox, auth, headers, context }: T.StartEnvVarsRolloutOptions): Promise<T.JSONResponse<T.EnvVarsRolloutStartResponse>>;
|
|
1887
1607
|
/**
|
|
1888
1608
|
* Set default auth token that will be used in each method if `auth` is not provided
|
|
1889
1609
|
* @param {string} auth The access token
|
|
@@ -1907,9 +1627,9 @@ declare class Particle {
|
|
|
1907
1627
|
* @param {object} [params.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1908
1628
|
* @param {object} [params.query] Key/Value pairs of query params or a correctly formatted string
|
|
1909
1629
|
* @param {object} [params.context] The invocation context, describing the tool and project
|
|
1910
|
-
* @returns {Promise<JSONResponse<T>>} A promise that resolves with the response data
|
|
1630
|
+
* @returns {Promise<T.JSONResponse<T>>} A promise that resolves with the response data
|
|
1911
1631
|
*/
|
|
1912
|
-
get<T = object>({ uri, auth, headers, query, context }: GetHeadOptions): Promise<JSONResponse<T>>;
|
|
1632
|
+
get<T = object>({ uri, auth, headers, query, context }: T.GetHeadOptions): Promise<T.JSONResponse<T>>;
|
|
1913
1633
|
/**
|
|
1914
1634
|
* Make a HEAD request
|
|
1915
1635
|
* @param {object} params
|
|
@@ -1918,9 +1638,9 @@ declare class Particle {
|
|
|
1918
1638
|
* @param {object} [params.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1919
1639
|
* @param {object} [params.query] Key/Value pairs of query params or a correctly formatted string
|
|
1920
1640
|
* @param {object} [params.context] The invocation context, describing the tool and project
|
|
1921
|
-
* @returns {Promise<JSONResponse<T>>} A promise that resolves with the response data
|
|
1641
|
+
* @returns {Promise<T.JSONResponse<T>>} A promise that resolves with the response data
|
|
1922
1642
|
*/
|
|
1923
|
-
head<T = object>({ uri, auth, headers, query, context }: GetHeadOptions): Promise<JSONResponse<T>>;
|
|
1643
|
+
head<T = object>({ uri, auth, headers, query, context }: T.GetHeadOptions): Promise<T.JSONResponse<T>>;
|
|
1924
1644
|
/**
|
|
1925
1645
|
* Make a POST request
|
|
1926
1646
|
* @param {object} params
|
|
@@ -1929,9 +1649,9 @@ declare class Particle {
|
|
|
1929
1649
|
* @param {object} [params.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1930
1650
|
* @param {object} [params.data] Object to send as JSON data in the body.
|
|
1931
1651
|
* @param {object} [params.context] The invocation context, describing the tool and project
|
|
1932
|
-
* @returns {Promise<JSONResponse<T>>} A promise that resolves with the response data
|
|
1652
|
+
* @returns {Promise<T.JSONResponse<T>>} A promise that resolves with the response data
|
|
1933
1653
|
*/
|
|
1934
|
-
post<T = object>({ uri, auth, headers, data, context }: MutateOptions): Promise<JSONResponse<T>>;
|
|
1654
|
+
post<T = object>({ uri, auth, headers, data, context }: T.MutateOptions): Promise<T.JSONResponse<T>>;
|
|
1935
1655
|
/**
|
|
1936
1656
|
* Make a PUT request
|
|
1937
1657
|
* @param {object} params
|
|
@@ -1941,9 +1661,9 @@ declare class Particle {
|
|
|
1941
1661
|
* @param {object} [params.data] Object to send as JSON data in the body.
|
|
1942
1662
|
* @param {object} [params.query] Key/Value pairs of query params or a correctly formatted string
|
|
1943
1663
|
* @param {object} [params.context] The invocation context, describing the tool and project
|
|
1944
|
-
* @returns {Promise<JSONResponse<T>>} A promise that resolves with the response data
|
|
1664
|
+
* @returns {Promise<T.JSONResponse<T>>} A promise that resolves with the response data
|
|
1945
1665
|
*/
|
|
1946
|
-
put<T = object>({ uri, auth, headers, data, query, context }: MutateOptions): Promise<JSONResponse<T>>;
|
|
1666
|
+
put<T = object>({ uri, auth, headers, data, query, context }: T.MutateOptions): Promise<T.JSONResponse<T>>;
|
|
1947
1667
|
/**
|
|
1948
1668
|
* Make a PATCH request
|
|
1949
1669
|
* @param {object} params
|
|
@@ -1952,9 +1672,9 @@ declare class Particle {
|
|
|
1952
1672
|
* @param {object} [params.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1953
1673
|
* @param {object} [params.data] Object to send as JSON data in the body.
|
|
1954
1674
|
* @param {object} [params.context] The invocation context, describing the tool and project
|
|
1955
|
-
* @returns {Promise<JSONResponse<T>>} A promise that resolves with the response data
|
|
1675
|
+
* @returns {Promise<T.JSONResponse<T>>} A promise that resolves with the response data
|
|
1956
1676
|
*/
|
|
1957
|
-
patch<T = object>({ uri, auth, headers, data, context }: MutateOptions): Promise<JSONResponse<T>>;
|
|
1677
|
+
patch<T = object>({ uri, auth, headers, data, context }: T.MutateOptions): Promise<T.JSONResponse<T>>;
|
|
1958
1678
|
/**
|
|
1959
1679
|
* Make a DELETE request
|
|
1960
1680
|
* @param {object} params
|
|
@@ -1963,9 +1683,9 @@ declare class Particle {
|
|
|
1963
1683
|
* @param {object} [params.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.
|
|
1964
1684
|
* @param {object} [params.data] Object to send as JSON data in the body.
|
|
1965
1685
|
* @param {object} [params.context] The invocation context, describing the tool and project
|
|
1966
|
-
* @returns {Promise<JSONResponse<T>>} A promise that resolves with the response data
|
|
1686
|
+
* @returns {Promise<T.JSONResponse<T>>} A promise that resolves with the response data
|
|
1967
1687
|
*/
|
|
1968
|
-
delete<T = object>({ uri, auth, headers, data, context }: MutateOptions): Promise<JSONResponse<T>>;
|
|
1688
|
+
delete<T = object>({ uri, auth, headers, data, context }: T.MutateOptions): Promise<T.JSONResponse<T>>;
|
|
1969
1689
|
/**
|
|
1970
1690
|
*
|
|
1971
1691
|
* @param {Object} args An obj with all the possible request configurations
|
|
@@ -1979,9 +1699,9 @@ declare class Particle {
|
|
|
1979
1699
|
* @param {Object} [args.files] Array of file names and file content
|
|
1980
1700
|
* @param {Object} [args.context] The invocation context, describing the tool and project.
|
|
1981
1701
|
* @param {boolean} [args.isBuffer] Indicate if the response should be treated as Buffer instead of JSON
|
|
1982
|
-
* @returns {Promise<RequestResponse>} A promise that resolves with the response data
|
|
1702
|
+
* @returns {Promise<T.RequestResponse>} A promise that resolves with the response data
|
|
1983
1703
|
*/
|
|
1984
|
-
request(args: AgentRequestOptions): Promise<RequestResponse>;
|
|
1704
|
+
request(args: T.AgentRequestOptions): Promise<T.RequestResponse>;
|
|
1985
1705
|
/** @internal */
|
|
1986
1706
|
client(options?: {
|
|
1987
1707
|
auth?: string;
|