particle-api-js 9.0.1 → 9.1.2

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/Particle.js"],"names":["Particle","options","context","agent","baseUrl","name","undefined","_isValidContext","Error","username","password","tokenDuration","headers","request","uri","method","form","grant_type","client_id","clientId","client_secret","clientSecret","expires_in","mfaToken","otp","mfa_token","auth","get","post","data","currentPassword","put","current_password","email","product","accountInfo","account_info","token","delete","access_token","full","query","tracking","deviceId","deviceName","groups","sortAttr","sortDir","page","perPage","Array","isArray","join","per_page","deviceUri","requestTransfer","id","request_transfer","file","files","deny","updateDevice","signal","notes","development","desiredFirmwareVersion","flash","desired_firmware_version","productId","product_id","iccid","promoCode","targetVersion","build_target_version","latest","console","warning","app","platformId","platform_id","binaryId","req","raw","_provideFileData","key","algorithm","deviceID","publicKey","toString","filename","order","Date","now","argument","args","org","toLowerCase","encodeURIComponent","connect","isPrivate","postData","private","event","url","device","rejectUnauthorized","noDefaults","hook","requestType","json","body","responseTemplate","responseTopic","responseEvent","errorResponseTopic","errorResponseEvent","hookId","settings","deviceid","integrationId","invalidateTokens","invalidate_tokens","head","iccids","country","sims","action","mbLimit","mb_limit","onlyFeatured","featured","limit","filter","sort","architectures","category","scope","excludeScopes","_asList","value","version","archive","visibility","force","type","redirect_uri","title","description","isForBrowser","responseType","then","res","xhr","response","buffer","parse","serialNumber","device_id","networkId","updateMeshNetwork","role","accept","config","dateRange","rectBl","rectTr","date_range","rect_bl","rect_tr","device_name","_buildContext","api","prototype","removeAccessToken","deleteAccessToken"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;;;AAGA;;;;;;;;;IASMA,Q;AACL;;;;;;;AAOA,qBAAyB;AAAA,MAAbC,OAAa,uEAAH,EAAG;AAAA;;AACxB;AACA,wBAAc,IAAd,sBAA8BA,OAA9B;AACA,OAAKC,OA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CAAmBE,iBAA1D;;kBAEe9K,Q","file":"Particle.js","sourcesContent":["import binaryParser from './superagent-binary-parser';\nimport Defaults from './Defaults';\nimport EventStream from './EventStream';\nimport Agent from './Agent';\nimport Client from './Client';\n\n\n/**\n * Particle Cloud API wrapper.\n *\n * See <https://docs.particle.io/reference/javascript/> for examples\n * of using the `Particle` class.\n *\n * Most Particle methods take a single unnamed argument object documented as\n * `options` with key/value pairs for each option.\n */\nclass Particle {\n\t/**\n\t * Contructor for the Cloud API wrapper.\n\t *\n\t * Create a new Particle object and call methods below on it.\n\t *\n\t * @param {Object} options Options for this API call Options to be used for all requests (see [Defaults](../src/Defaults.js))\n\t */\n\tconstructor(options = {}){\n\t\t// todo - this seems a bit dangerous - would be better to put all options/context in a contained object\n\t\tObject.assign(this, Defaults, options);\n\t\tthis.context = {};\n\t\tthis.agent = new Agent(this.baseUrl);\n\t}\n\n\t_isValidContext(name, context){\n\t\treturn (name==='tool' || name==='project') && context!==undefined;\n\t}\n\n\tsetContext(name, context){\n\t\tif (context!==undefined){\n\t\t\tif (this._isValidContext(name, context)){\n\t\t\t\tthis.context[name] = context;\n\t\t\t} else {\n\t\t\t\tthrow Error('uknown context name or undefined context: '+name);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Builds the final context from the context parameter and the context items in the api.\n\t * @param {Object} context The invocation context, this takes precedence over the local context.\n\t * @returns {Object} The context to use.\n\t * @private\n\t */\n\t_buildContext(context){\n\t\treturn Object.assign(this.context, context);\n\t}\n\n\t/**\n\t * Login to Particle Cloud using an existing Particle acccount.\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.username Username for the Particle account\n\t * @param {String} options.password Password for the Particle account\n\t * @param {Number} options.tokenDuration How long the access token should last in seconds\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Number} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tlogin({ username, password, tokenDuration = this.tokenDuration, headers, context }){\n\t\treturn this.request({\n\t\t\turi: '/oauth/token',\n\t\t\tmethod: 'post',\n\t\t\theaders,\n\t\t\tform: {\n\t\t\t\tusername,\n\t\t\t\tpassword,\n\t\t\t\tgrant_type: 'password',\n\t\t\t\tclient_id: this.clientId,\n\t\t\t\tclient_secret: this.clientSecret,\n\t\t\t\texpires_in: tokenDuration\n\t\t\t},\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * If login failed with an 'mfa_required' error, this must be called with a valid OTP code to login\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.mfaToken Given as 'mfa_token' in the error body of `.login()`.\n\t * @param {String} options.otp Current one-time-password generated from the authentication application\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Number} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tsendOtp({ mfaToken, otp, headers, context }){\n\t\treturn this.request({\n\t\t\turi: '/oauth/token',\n\t\t\tmethod: 'post',\n\t\t\theaders,\n\t\t\tform: {\n\t\t\t\tgrant_type: 'urn:custom:mfa-otp',\n\t\t\t\tmfa_token: mfaToken,\n\t\t\t\totp,\n\t\t\t\tclient_id: this.clientId,\n\t\t\t\tclient_secret: this.clientSecret\n\t\t\t},\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Enable MFA on the currently logged in user\n\t * @param {Object} options Options for this API call\n\t * @param {Object} options.auth Access token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tenableMfa({ auth, headers, context }){\n\t\treturn this.get({ uri: '/v1/user/mfa-enable', auth, headers, context });\n\t}\n\n\t/**\n\t * 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.\n\t * @param {Object} options Options for this API call\n\t * @param {Object} options.auth Access token\n\t * @param {Object} options.mfaToken Token given from previous step to\n\t * @param {Object} options.otp Current one-time-password generated from the authentication app\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tconfirmMfa({ mfaToken, otp, auth, headers, context }){\n\t\treturn this.post({\n\t\t\turi: '/v1/user/mfa-enable',\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tdata: { mfa_token: mfaToken, otp },\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Disable MFA for the user.\n\t * @param {Object} options Options for this API call\n\t * @param {Object} options.auth Access token\n\t * @param {Object} options.currentPassword User's current password\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tdisableMfa({ currentPassword, auth, headers, context }){\n\t\treturn this.put({\n\t\t\turi: '/v1/user/mfa-disable',\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tdata: { current_password: currentPassword },\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Create Customer for Product.\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.email Username for the Particle account\n\t * @param {String} options.password Password for the Particle account\n\t * @param {String} options.product Create the customer in this product ID or slug\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tcreateCustomer({ email, password, product, headers, context }){\n\t\treturn this.request({\n\t\t\turi: `/v1/products/${product}/customers`,\n\t\t\tmethod: 'post',\n\t\t\theaders,\n\t\t\tform: {\n\t\t\t\temail,\n\t\t\t\tpassword,\n\t\t\t\tgrant_type: 'client_credentials',\n\t\t\t\tclient_id: this.clientId,\n\t\t\t\tclient_secret: this.clientSecret\n\t\t\t},\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Login to Particle Cloud using an OAuth client.\n\t * @param {Object} options Options for this API call\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tloginAsClientOwner({ headers, context }){\n\t\treturn this.request({\n\t\t\turi: '/oauth/token',\n\t\t\tmethod: 'post',\n\t\t\theaders,\n\t\t\tform: {\n\t\t\t\tgrant_type: 'client_credentials',\n\t\t\t\tclient_id: this.clientId,\n\t\t\t\tclient_secret: this.clientSecret\n\t\t\t},\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Create a user account for the Particle Cloud\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.username Email of the new user\n\t * @param {String} options.password Password\n\t * @param {String} options.accountInfo Object that contains account information fields such as user real name, company name, business account flag etc\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tcreateUser({ username, password, accountInfo, headers, context }){\n\t\treturn this.post({\n\t\t\turi: '/v1/users',\n\t\t\theaders,\n\t\t\tdata: {\n\t\t\t\tusername,\n\t\t\t\tpassword,\n\t\t\t\taccount_info : accountInfo\n\t\t\t},\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Verify new user account via verification email\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.token The string token sent in the verification email\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tverifyUser({ token, headers, context }){\n\t\treturn this.post({\n\t\t\turi: '/v1/user/verify',\n\t\t\theaders,\n\t\t\tdata: { token },\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Send reset password email for a Particle Cloud user account\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.username Email of the user\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tresetPassword({ username, headers, context }){\n\t\treturn this.post({\n\t\t\turi: '/v1/user/password-reset',\n\t\t\theaders,\n\t\t\tdata: { username },\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Revoke an access token\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.username Username of the Particle cloud account that the token belongs to.\n\t * @param {String} options.password Password for the account\n\t * @param {String} options.token Access token you wish to revoke\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tdeleteAccessToken({ username, password, token, headers, context }){\n\t\treturn this.delete({\n\t\t\turi: `/v1/access_tokens/${token}`,\n\t\t\tauth: { username, password },\n\t\t\theaders,\n\t\t\tdata: { access_token: token },\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Revoke the current session access token\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tdeleteCurrentAccessToken({ auth, headers, context }){\n\t\treturn this.delete({\n\t\t\turi: '/v1/access_tokens/current',\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Delete the current user\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.auth Access Token\n\t * @param {String} options.password Password\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tdeleteUser({ auth, password, headers, context }){\n\t\treturn this.delete({\n\t\t\turi: '/v1/user',\n\t\t\tdata: { password },\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * List all valid access tokens for a Particle Cloud account\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.username Username\n\t * @param {String} options.password Password\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tlistAccessTokens({ username, password, headers, context }){\n\t\treturn this.get({\n\t\t\turi: '/v1/access_tokens',\n\t\t\tauth: { username, password },\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Retrieves the information that is used to identify the current login for tracking.\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.auth The access token\n\t * @param {Boolean} options.full When true, retrieve all information for registering a user with the tracking API. When false,\n\t * retrieve only the unique tracking ID for the current login.\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise<Object>} Resolve the tracking identify of the current login\n\t */\n\ttrackingIdentity({ full = false, auth, headers, context } = {}){\n\t\treturn this.get({\n\t\t\turi: '/v1/user/identify',\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tquery: (full ? undefined : { tracking: 1 }),\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * List devices claimed to the account or product\n\t * @param {Object} options Options for this API call\n\t * @param {String} [options.deviceId] (Product only) Filter results to devices with this ID (partial matching)\n\t * @param {String} [options.deviceName] (Product only) Filter results to devices with this name (partial matching)\n\t * @param {Array.<string>} [options.groups] (Product only) A list of full group names to filter results to devices belonging to these groups only.\n\t * @param {String} [options.sortAttr] (Product only) The attribute by which to sort results. See API docs for options.\n\t * @param {String} [options.sortDir] (Product only) The direction of sorting. See API docs for options.\n\t * @param {Number} [options.page] (Product only) Current page of results\n\t * @param {Number} [options.perPage] (Product only) Records per page\n\t * @param {String} [options.product] List devices in this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tlistDevices({ deviceId, deviceName, groups, sortAttr, sortDir, page, perPage, product, auth, headers, context }){\n\t\tlet uri, query;\n\n\t\tif (product){\n\t\t\turi = `/v1/products/${product}/devices`;\n\t\t\tgroups = Array.isArray(groups) ? groups.join(',') : undefined;\n\t\t\tquery = { deviceId, deviceName, groups, sortAttr, sortDir, page, per_page: perPage };\n\t\t} else {\n\t\t\turi = '/v1/devices';\n\t\t}\n\n\t\treturn this.get({ uri, auth, headers, query, context });\n\t}\n\n\t/**\n\t * Get detailed informationa about a device\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID or Name\n\t * @param {String} [options.product] Device in this product ID or slug\n\t * @param {String} options.auth Access token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tgetDevice({ deviceId, product, auth, headers, context }){\n\t\tconst uri = this.deviceUri({ deviceId, product });\n\t\treturn this.get({ uri, auth, headers, context });\n\t}\n\n\t/**\n\t * Claim a device to the account. The device must be online and unclaimed.\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tclaimDevice({ deviceId, requestTransfer, auth, headers, context }){\n\t\treturn this.post({\n\t\t\turi: '/v1/devices',\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tdata: {\n\t\t\t\tid: deviceId,\n\t\t\t\trequest_transfer: !!requestTransfer\n\t\t\t},\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Add a device to a product or move device out of quarantine.\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID\n\t * @param {Object} options.file A file that contains a single-column list of device IDs, device serial numbers, device IMEIs, or devie ICCIDs.\n\t * Node: Either a path or Buffer. Browser: a File or Blob.\n\t * @param {String} options.product Add to this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\taddDeviceToProduct({ deviceId, product, file, auth, headers, context }){\n\t\tlet files, data;\n\n\t\tif (file){\n\t\t\tfiles = { file };\n\t\t} else if (deviceId){\n\t\t\tdata = { id: deviceId };\n\t\t}\n\n\t\treturn this.request({\n\t\t\turi: `/v1/products/${product}/devices`,\n\t\t\tmethod: 'post',\n\t\t\theaders,\n\t\t\tdata,\n\t\t\tfiles,\n\t\t\tauth,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Unclaim / Remove a device from your account or product, or deny quarantine\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID or Name\n\t * @param {Boolean} [options.deny] (Product only) Deny this quarantined device, instead of removing an already approved device\n\t * @param {String} options.product Remove from this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tremoveDevice({ deviceId, deny, product, auth, headers, context }){\n\t\tconst uri = this.deviceUri({ deviceId, product });\n\t\tconst data = product ? { deny } : undefined;\n\t\treturn this.delete({ uri, data, auth, headers, context });\n\t}\n\n\t/**\n\t * Unclaim a product device its the owner, but keep it in the product\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID or Name\n\t * @param {String} options.product Remove from this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tremoveDeviceOwner({ deviceId, product, auth, headers, context }){\n\t\tconst uri = `/v1/products/${product}/devices/${deviceId}/owner`;\n\t\treturn this.delete({ uri, auth, headers, context });\n\t}\n\n\t/**\n\t * Rename a device\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID or Name\n\t * @param {String} options.name Desired Name\n\t * @param {String} [options.product] Rename device in this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\trenameDevice({ deviceId, name, product, auth, headers, context }){\n\t\treturn this.updateDevice({ deviceId, name, product, auth, headers, context });\n\t}\n\n\t/**\n\t * Instruct the device to turn on/off the LED in a rainbow pattern\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID or Name\n\t * @param {Boolean} options.signal Signal on or off\n\t * @param {String} [options.product] Device in this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tsignalDevice({ deviceId, signal, product, auth, headers, context }){\n\t\treturn this.updateDevice({ deviceId, signal, product, auth, headers, context });\n\t}\n\n\t/**\n\t * Store some notes about device\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID or Name\n\t * @param {String} options.notes Your notes about this device\n\t * @param {String} [options.product] Device in this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tsetDeviceNotes({ deviceId, notes, product, auth, headers, context }){\n\t\treturn this.updateDevice({ deviceId, notes, product, auth, headers, context });\n\t}\n\n\t/**\n\t * Mark device as being used in development of a product so it opts out of automatic firmware updates\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID or Name\n\t * @param {Boolean} options.development Set to true to mark as development, false to return to product fleet\n\t * @param {String} options.product Device in this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tmarkAsDevelopmentDevice({ deviceId, development = true, product, auth, headers, context }){\n\t\treturn this.updateDevice({ deviceId, development, product, auth, headers, context });\n\t}\n\n\t/**\n\t * Mark device as being used in development of a product so it opts out of automatic firmware updates\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID or Name\n\t * @param {Number} options.desiredFirmwareVersion Lock the product device to run this firmware version.\n\t * @param {Boolean} [options.flash] Immediately flash firmware indicated by desiredFirmwareVersion\n\t * @param {String} options.product Device in this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tlockDeviceProductFirmware({ deviceId, desiredFirmwareVersion, flash, product, auth, context }){\n\t\treturn this.updateDevice({ deviceId, desiredFirmwareVersion, flash, product, auth, context });\n\t}\n\n\t/**\n\t * Mark device as receiving automatic firmware updates\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID or Name\n\t * @param {String} options.product Device in this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tunlockDeviceProductFirmware({ deviceId, product, auth, headers, context }){\n\t\treturn this.updateDevice({ deviceId, desiredFirmwareVersion: null, product, auth, headers, context });\n\t}\n\n\t/**\n\t * Update multiple device attributes at the same time\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID or Name\n\t * @param {String} [options.name] Desired Name\n\t * @param {Boolean} options.signal Signal device on or off\n\t * @param {String} [options.notes] Your notes about this device\n\t * @param {Boolean} [options.development] (Product only) Set to true to mark as development, false to return to product fleet\n\t * @param {Number} [options.desiredFirmwareVersion] (Product only) Lock the product device to run this firmware version.\n\t * Pass `null` to unlock firmware and go back to released firmware.\n\t * @param {Boolean} [options.flash] (Product only) Immediately flash firmware indicated by desiredFirmwareVersion\n\t * @param {String} [options.product] Device in this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tupdateDevice({ deviceId, name, signal, notes, development, desiredFirmwareVersion, flash, product, auth, headers, context }){\n\t\tif (signal !== undefined){\n\t\t\tsignal = signal ? '1' : '0';\n\t\t}\n\n\t\tconst uri = this.deviceUri({ deviceId, product });\n\t\tconst data = product ?\n\t\t\t{ name, signal, notes, development, desired_firmware_version: desiredFirmwareVersion, flash } :\n\t\t\t{ name, signal, notes };\n\n\t\treturn this.put({ uri, auth, headers, data, context });\n\t}\n\n\t/**\n\t * Provision a new device for products that allow self-provisioning\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.productId Product ID where to create this device\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tprovisionDevice({ productId, auth, headers, context }){\n\t\treturn this.post({\n\t\t\turi: '/v1/devices',\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tdata: { product_id: productId },\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Generate a claim code to use in the device claiming process.\n\t * To generate a claim code for a product, the access token MUST belong to a\n\t * customer of the product.\n\t * @param {Object} options Options for this API call\n\t * @param {String} [options.iccid] ICCID of the SIM card used in the Electron\n\t * @param {String} [options.product] Device in this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tgetClaimCode({ iccid, product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/device_claims` : '/v1/device_claims';\n\t\treturn this.post({ uri, auth, headers, data: { iccid }, context });\n\t}\n\n\tvalidatePromoCode({ promoCode, auth, headers, context }){\n\t\treturn this.get({\n\t\t\turi: `/v1/promo_code/${promoCode}`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\tchangeProduct({ deviceId, productId, auth, headers, context }){\n\t\treturn this.put({\n\t\t\turi: `/v1/devices/${deviceId}`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tdata: { product_id: productId },\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Get the value of a device variable\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID or Name\n\t * @param {String} options.name Variable name\n\t * @param {String} [options.product] Device in this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tgetVariable({ deviceId, name, product, auth, headers, context }){\n\t\tconst uri = product ?\n\t\t\t`/v1/products/${product}/devices/${deviceId}/${name}` :\n\t\t\t`/v1/devices/${deviceId}/${name}`;\n\n\t\treturn this.get({ uri, auth, headers, context });\n\t}\n\n\t/**\n\t * Compile and flash application firmware to a device. Pass a pre-compiled binary to flash it directly to the device.\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID or Name\n\t * @param {String} options.product Flash device in this product ID or slug\n\t * @param {Object} options.files Object containing files to be compiled and flashed. Keys should be the filenames, including relative path, and the values should be a path or Buffer of the file contents in Node, or a File or Blob in the browser.\n\t * @param {String} [options.targetVersion=latest] System firmware version to compile against\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tflashDevice({ deviceId, product, files, targetVersion, auth, headers, context }){\n\t\tconst uri = this.deviceUri({ deviceId, product });\n\t\tconst form = {};\n\n\t\tif (targetVersion){\n\t\t\tform.build_target_version = targetVersion;\n\t\t} else {\n\t\t\tform.latest = 'true';\n\t\t}\n\n\t\treturn this.request({ uri, method: 'put', auth, headers, files, form, context });\n\t}\n\n\t/**\n\t * DEPRECATED: Flash the Tinker application to a device. Instead compile and flash the Tinker source code.\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID or Name\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tflashTinker({ deviceId, auth, headers, context }){\n\t\t/* eslint-disable no-console */\n\t\tif (console && console.warning){\n\t\t\tconsole.warning('Particle.flashTinker is deprecated');\n\t\t}\n\t\t/* eslint-enable no-console */\n\t\treturn this.put({\n\t\t\turi: `/v1/devices/${deviceId}`,\n\t\t\theaders,\n\t\t\tdata: { app: 'tinker' },\n\t\t\tauth,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Compile firmware using the Particle Cloud\n\t * @param {Object} options Options for this API call\n\t * @param {Object} options.files Object containing files to be compiled. Keys should be the filenames, including relative path, and the values should be a path or Buffer of the file contents in Node, or a File or Blob in the browser.\n\t * @param {Number} [options.platformId] Platform id number of the device you are compiling for. Common values are 0=Core, 6=Photon, 10=Electron.\n\t * @param {String} [options.targetVersion=latest] System firmware version to compile against\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tcompileCode({ files, platformId, targetVersion, auth, headers, context }){\n\t\tconst form = { platform_id: platformId };\n\n\t\tif (targetVersion){\n\t\t\tform.build_target_version = targetVersion;\n\t\t} else {\n\t\t\tform.latest = 'true';\n\t\t}\n\n\t\treturn this.request({\n\t\t\turi: '/v1/binaries',\n\t\t\tmethod: 'post',\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tfiles,\n\t\t\tform,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Download a firmware binary\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.binaryId Binary ID received from a successful compile call\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Request} A promise\n\t */\n\tdownloadFirmwareBinary({ binaryId, auth, headers, context }){\n\t\tlet req = this.request({\n\t\t\turi: `/v1/binaries/${binaryId}`,\n\t\t\tmethod: 'get',\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext,\n\t\t\traw: true\n\t\t});\n\n\t\treturn this._provideFileData(req);\n\t}\n\n\t/**\n\t * Send a new device public key to the Particle Cloud\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID or Name\n\t * @param {(String|Buffer)} options.key Public key contents\n\t * @param {String} [options.algorithm=rsa] Algorithm used to generate the public key. Valid values are `rsa` or `ecc`.\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tsendPublicKey({ deviceId, key, algorithm, auth, headers, context }){\n\t\treturn this.post({\n\t\t\turi: `/v1/provisioning/${deviceId}`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tdata: {\n\t\t\t\tdeviceID: deviceId,\n\t\t\t\tpublicKey: ( typeof key === 'string' ? key : key.toString() ),\n\t\t\t\tfilename: 'particle-api',\n\t\t\t\torder: `manual_${ Date.now() }`,\n\t\t\t\talgorithm: algorithm || 'rsa'\n\t\t\t},\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Call a device function\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID or Name\n\t * @param {String} options.name Function name\n\t * @param {String} options.argument Function argument\n\t * @param {String} [options.product] Device in this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tcallFunction({ deviceId, name, argument, product, auth, headers, context }){\n\t\tconst uri = product ?\n\t\t\t`/v1/products/${product}/devices/${deviceId}/${name}` :\n\t\t\t`/v1/devices/${deviceId}/${name}`;\n\t\treturn this.post({ uri, auth, headers, data: { args: argument }, context });\n\t}\n\n\t/**\n\t * Get a stream of events\n\t * @param {Object} options Options for this API call\n\t * @param {String} [options.deviceId] Device ID or Name, or `mine` to indicate only your devices.\n\t * @param {String} [options.name] Event Name\n\t * @param {String} [options.org] Organization Slug\n\t * @param {String} [options.product] Events for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @returns {Promise} If the promise resolves, the resolution value will be an EventStream object that will\n\t * emit 'event' events.\n\t */\n\tgetEventStream({ deviceId, name, org, product, auth }){\n\t\tlet uri = '/v1/';\n\t\tif (org){\n\t\t\turi += `orgs/${org}/`;\n\t\t}\n\n\t\tif (product){\n\t\t\turi += `products/${product}/`;\n\t\t}\n\n\t\tif (deviceId){\n\t\t\turi += 'devices/';\n\t\t\tif (!(deviceId.toLowerCase() === 'mine')){\n\t\t\t\turi += `${deviceId}/`;\n\t\t\t}\n\t\t}\n\n\t\turi += 'events';\n\n\t\tif (name){\n\t\t\turi += `/${encodeURIComponent(name)}`;\n\t\t}\n\n\t\treturn new EventStream(`${this.baseUrl}${uri}`, auth).connect();\n\t}\n\n\t/**\n\t * Publish a event to the Particle Cloud\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.name Event name\n\t * @param {String} options.data Event data\n\t * @param {Boolean} options.isPrivate Should the event be publicly available?\n\t * @param {String} [options.product] Event for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tpublishEvent({ name, data, isPrivate, product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/events` : '/v1/devices/events';\n\t\tconst postData = { name, data, private: isPrivate };\n\t\treturn this.post({ uri, auth, headers, data: postData, context });\n\t}\n\n\t/**\n\t * Create a webhook\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.event The name of the Particle event that should trigger the Webhook\n\t * @param {String} options.url The web address that will be targeted when the Webhook is triggered\n\t * @param {String} [options.device] Trigger Webhook only for this device ID or Name\n\t * @param {Boolean} [options.rejectUnauthorized] Set to `false` to skip SSL certificate validation of the target URL\n\t * @param {Boolean} [options.noDefaults] Don't include default event data in the webhook request\n\t * @param {Object} [options.hook] Webhook configuration settings\n\t * @param {String} [options.hook.method=POST] Type of web request triggered by the Webhook (GET, POST, PUT, or DELETE)\n\t * @param {Object} [options.hook.auth] Auth data like `{ username: 'me', password: '1234' }` to send via basic auth header with the Webhook request\n\t * @param {Object} [options.hook.headers] Additional headers to add to the Webhook like `{ 'X-ONE': '1', X-TWO: '2' }`\n\t * @param {Object} [options.hook.query] Query params to add to the Webhook request like `{ foo: 'foo', bar: 'bar' }`\n\t * @param {Object} [options.hook.json] JSON data to send with the Webhook request - sets `Content-Type` to `application/json`\n\t * @param {Object} [options.hook.form] Form data to send with the Webhook request - sets `Content-Type` to `application/x-www-form-urlencoded`\n\t * @param {String} [options.hook.body] Custom body to send with the Webhook request\n\t * @param {Object} [options.hook.responseTemplate] Template to use to customize the Webhook response body\n\t * @param {Object} [options.hook.responseEvent] The Webhook response event name that your devices can subscribe to\n\t * @param {Object} [options.hook.errorResponseEvent] The Webhook error response event name that your devices can subscribe to\n\t * @param {String} [options.product] Webhook for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tcreateWebhook({ event, url, device, rejectUnauthorized, noDefaults, hook, product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/webhooks` : '/v1/webhooks';\n\t\tconst data = { event, url, deviceId: device, rejectUnauthorized, noDefaults };\n\n\t\tif (hook){\n\t\t\tdata.requestType = hook.method;\n\t\t\tdata.auth = hook.auth;\n\t\t\tdata.headers = hook.headers;\n\t\t\tdata.query = hook.query;\n\t\t\tdata.json = hook.json;\n\t\t\tdata.form = hook.form;\n\t\t\tdata.body = hook.body;\n\t\t\tdata.responseTemplate = hook.responseTemplate;\n\t\t\tdata.responseTopic = hook.responseEvent;\n\t\t\tdata.errorResponseTopic = hook.errorResponseEvent;\n\t\t}\n\n\t\tif (!data.requestType){\n\t\t\tdata.requestType = 'POST';\n\t\t}\n\n\t\treturn this.post({ uri, auth, headers, data, context });\n\t}\n\n\t/**\n\t * Delete a webhook\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.hookId Webhook ID\n\t * @param {String} [options.product] Webhook for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tdeleteWebhook({ hookId, product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/webhooks/${hookId}` : `/v1/webhooks/${hookId}`;\n\t\treturn this.delete({ uri, auth, headers, context });\n\t}\n\n\t/**\n\t * List all webhooks owned by the account or product\n\t * @param {Object} options Options for this API call\n\t * @param {String} [options.product] Webhooks for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tlistWebhooks({ product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/webhooks` : '/v1/webhooks';\n\t\treturn this.get({ uri, auth, headers, context });\n\t}\n\n\t/**\n\t * Create an integration to send events to an external service\n *\n\t * See the API docs for details https://docs.particle.io/reference/api/#integrations-webhooks-\n\t *\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.event Event that triggers the integration\n\t * @param {Object} options.settings Settings specific to that integration type\n\t * @param {String} [options.deviceId] Trigger integration only for this device ID or Name\n\t * @param {String} [options.product] Integration for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tcreateIntegration({ event, settings, deviceId, product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/integrations` : '/v1/integrations';\n\t\tconst data = Object.assign({ event, deviceid: deviceId }, settings);\n\t\treturn this.post({ uri, data, auth, headers, context });\n\t}\n\n\t/**\n\t * Edit an integration to send events to an external service\n\t *\n\t * See the API docs for details https://docs.particle.io/reference/api/#integrations-webhooks-\n\t *\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.integrationId The integration to edit\n\t * @param {String} [options.event] Change the event that triggers the integration\n\t * @param {Object} [options.settings] Change the settings specific to that integration type\n\t * @param {String} [options.deviceId] Trigger integration only for this device ID or Name\n\t * @param {String} [options.product] Integration for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\teditIntegration({ integrationId, event, settings, deviceId, product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/integrations/${integrationId}` : `/v1/integrations/${integrationId}`;\n\t\tconst data = Object.assign({ event, deviceid: deviceId }, settings);\n\t\treturn this.put({ uri, auth, headers, data, context });\n\t}\n\n\t/**\n\t * Delete an integration to send events to an external service\n\t *\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.integrationId The integration to remove\n\t * @param {String} [options.product] Integration for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tdeleteIntegration({ integrationId, product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/integrations/${integrationId}` : `/v1/integrations/${integrationId}`;\n\t\treturn this.delete({ uri, auth, headers, context });\n\t}\n\n\t/**\n\t * List all integrations owned by the account or product\n\t * @param {Object} options Options for this API call\n\t * @param {String} [options.product] Integrations for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tlistIntegrations({ product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/integrations` : '/v1/integrations';\n\t\treturn this.get({ uri, auth, headers, context });\n\t}\n\n\t/**\n\t * Get details about the current user\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tgetUserInfo({ auth, headers, context }){\n\t\treturn this.get({ uri: '/v1/user', auth, headers, context });\n\t}\n\n\t/**\n\t * Set details on the current user\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.auth Access Token\n\t * @param {String} options.accountInfo Set user's extended info fields (name, business account, company name, etc)\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tsetUserInfo({ accountInfo, auth, headers, context }){\n\t\tconst data = { account_info: accountInfo };\n\t\treturn this.put({ uri: '/v1/user', auth, headers, data, context });\n\t}\n\n\t/**\n\t * Change username (i.e, email)\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.auth Access Token\n\t * @param {String} options.currentPassword Current password\n\t * @param {String} options.username New email\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tchangeUsername({ currentPassword, username, auth, headers, context }){\n\t\tconst data = { username, current_password: currentPassword };\n\t\treturn this.put({ uri: '/v1/user', auth, headers, data, context });\n\t}\n\n\t/**\n\t * Change user's password\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.auth Access Token\n\t * @param {String} options.currentPassword Current password\n\t * @param {String} options.password New password\n\t * @param {Boolean} options.invalidateTokens Should all tokens be invalidated\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tchangeUserPassword({ currentPassword, password, invalidateTokens = false, auth, headers, context }){\n\t\tconst data = { password, current_password: currentPassword };\n\n\t\tif (invalidateTokens) {\n\t\t\tdata.invalidate_tokens = true;\n\t\t}\n\n\t\treturn this.put({ uri: '/v1/user', auth, headers, data, context });\n\t}\n\n\t/**\n\t * List SIM cards owned by a user or product\n\t * @param {Object} options Options for this API call\n\t * @param {String} [options.iccid] (Product only) Filter to SIM cards matching this ICCID\n\t * @param {String} [options.deviceId] (Product only) Filter to SIM cards matching this device ID\n\t * @param {String} [options.deviceName] (Product only) Filter to SIM cards matching this device name\n\t * @param {Number} [options.page] (Product only) Current page of results\n\t * @param {Number} [options.perPage] (Product only) Records per page\n\t * @param {String} [options.product] SIM cards for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tlistSIMs({ iccid, deviceId, deviceName, page, perPage, product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/sims` : '/v1/sims';\n\t\tconst query = product ? { iccid, deviceId, deviceName, page, per_page: perPage } : undefined;\n\t\treturn this.get({ uri, auth, headers, query, context });\n\t}\n\n\t/**\n\t * Get data usage for one SIM card for the current billing period\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.iccid ICCID of the SIM card\n\t * @param {String} [options.product] SIM card for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tgetSIMDataUsage({ iccid, product, auth, headers, context }){\n\t\tconst uri = product ?\n\t\t\t`/v1/products/${product}/sims/${iccid}/data_usage` :\n\t\t\t`/v1/sims/${iccid}/data_usage`;\n\n\t\treturn this.get({ uri, auth, headers, context });\n\t}\n\n\t/**\n\t * Get data usage for all SIM cards in a product the current billing period\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.product SIM cards for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tgetFleetDataUsage({ product, auth, headers, context }){\n\t\treturn this.get({\n\t\t\turi: `/v1/products/${product}/sims/data_usage`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Check SIM status\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.iccid ICCID of the SIM card\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tcheckSIM({ iccid, auth, headers, context }){\n\t\treturn this.head({ uri: `/v1/sims/${iccid}`, auth, headers, context });\n\t}\n\n\t/**\n\t * Activate and add SIM cards to an account or product\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.iccid ICCID of the SIM card\n\t * @param {Array<String>} options.iccids (Product only) ICCID of multiple SIM cards to import\n\t * @param {String} options.country The ISO country code for the SIM cards\n\t * @param {String} [options.product] SIM cards for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tactivateSIM({ iccid, iccids, country, promoCode, product, auth, headers, context }){\n\t\t// promoCode is deprecated\n\t\ticcids = iccids || [iccid];\n\t\tconst uri = product ? `/v1/products/${product}/sims` : `/v1/sims/${iccid}`;\n\t\tconst data = product ?\n\t\t\t{ sims: iccids, country } :\n\t\t\t{ country, promoCode, action: 'activate' };\n\t\tconst method = product ? 'post' : 'put';\n\n\t\treturn this.request({ uri, method, headers, data, auth, context });\n\t}\n\n\t/**\n\t * Deactivate a SIM card so it doesn't incur data usage in future months.\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.iccid ICCID of the SIM card\n\t * @param {String} [options.product] SIM cards for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tdeactivateSIM({ iccid, product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/sims/${iccid}` : `/v1/sims/${iccid}`;\n\t\tconst data = { action: 'deactivate' };\n\t\treturn this.put({ uri, auth, headers, data, context });\n\t}\n\n\t/**\n\t * Reactivate a SIM card the was deactivated or unpause a SIM card that was automatically paused\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.iccid ICCID of the SIM card\n\t * @param {Number} [options.mbLimit] New monthly data limit. Necessary if unpausing a SIM card\n\t * @param {String} [options.product] SIM cards for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\treactivateSIM({ iccid, mbLimit, product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/sims/${iccid}` : `/v1/sims/${iccid}`;\n\t\tconst data = { mb_limit: mbLimit, action: 'reactivate' };\n\t\treturn this.put({ uri, auth, headers, data, context });\n\t}\n\n\t/**\n\t * Update SIM card data limit\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.iccid ICCID of the SIM card\n\t * @param {Array} options.mbLimit Data limit in megabyte for the SIM card\n\t * @param {String} [options.product] SIM cards for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tupdateSIM({ iccid, mbLimit, product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/sims/${iccid}` : `/v1/sims/${iccid}`;\n\t\tconst data = { mb_limit: mbLimit };\n\t\treturn this.put({ uri, auth, headers, data, context });\n\t}\n\n\t/**\n\t * Remove a SIM card from an account so it can be activated by a different account\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.iccid ICCID of the SIM card\n\t * @param {String} [options.product] SIM cards for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tremoveSIM({ iccid, product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/sims/${iccid}` : `/v1/sims/${iccid}`;\n\t\treturn this.delete({ uri, auth, headers, context });\n\t}\n\n\t/**\n\t * List valid build targets to be used for compiling\n\t * @param {Object} options Options for this API call\n\t * @param {Boolean} [options.onlyFeatured=false] Only list featured build targets\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tlistBuildTargets({ onlyFeatured, auth, headers, context }){\n\t\tconst query = onlyFeatured ? { featured: !!onlyFeatured } : undefined;\n\t\treturn this.get({ uri: '/v1/build_targets', auth, headers, query, context });\n\t}\n\n\t/**\n\t * List firmware libraries\n\t * @param {Object} options Options for this API call\n\t * @param {Number} options.page Page index (default, first page)\n\t * @param {Number} options.limit Number of items per page\n\t * @param {String} options.filter Search term for the libraries\n\t * @param {String} options.sort Ordering key for the library list\n\t * @param {Array<String>} options.architectures List of architectures to filter\n\t * @param {String} options.category Category to filter\n\t * @param {String} options.scope The library scope to list. Default is 'all'. Other values are\n\t * - 'all' - list public libraries and my private libraries\n\t * - 'public' - list only public libraries\n\t * - 'private' - list only my private libraries\n\t * - 'mine' - list my libraries (public and private)\n\t * - 'official' - list only official libraries\n\t * - 'verified' - list only verified libraries\n\t * - 'featured' - list only featured libraries\n\t * @param {String} options.excludeScopes list of scopes to exclude\n\t * @param {String} options.category Category to filter\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tlistLibraries({ page, limit, filter, sort, architectures, category, scope, excludeScopes, auth, headers, context }){\n\t\treturn this.get({\n\t\t\turi: '/v1/libraries',\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tquery: {\n\t\t\t\tpage,\n\t\t\t\tfilter,\n\t\t\t\tlimit,\n\t\t\t\tsort,\n\t\t\t\tarchitectures: this._asList(architectures),\n\t\t\t\tcategory,\n\t\t\t\tscope,\n\t\t\t\texcludeScopes: this._asList(excludeScopes)\n\t\t\t},\n\t\t\tcontext\n\t\t});\n\t}\n\n\t_asList(value){\n\t\treturn (Array.isArray(value) ? value.join(',') : value);\n\t}\n\n\t/**\n\t * Get firmware library details\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.name Name of the library to fetch\n\t * @param {String} options.version Version of the library to fetch (default: latest)\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tgetLibrary({ name, version, auth, headers, context }){\n\t\treturn this.get({\n\t\t\turi: `/v1/libraries/${name}`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tquery: { version },\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Firmware library details for each version\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.name Name of the library to fetch\n\t * @param {Number} options.page Page index (default, first page)\n\t * @param {Number} options.limit Number of items per page\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tgetLibraryVersions({ name, page, limit, auth, headers, context }){\n\t\treturn this.get({\n\t\t\turi: `/v1/libraries/${name}/versions`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tquery: { page, limit },\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Contribute a new library version from a compressed archive\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.archive Compressed archive file containing the library sources\n\t * Either a path or Buffer of the file contents in Node, or a File or Blob in the browser.\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tcontributeLibrary({ archive, auth, headers, context }){\n\t\tconst files = {\n\t\t\t'archive.tar.gz': archive\n\t\t};\n\n\t\treturn this.request({\n\t\t\turi: '/v1/libraries',\n\t\t\tmethod: 'post',\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tfiles,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Publish the latest version of a library to the public\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.name Name of the library to publish\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tpublishLibrary({ name, auth, headers, context }){\n\t\treturn this.request({\n\t\t\turi: `/v1/libraries/${name}`,\n\t\t\tmethod: 'patch',\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tdata: { visibility: 'public' },\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Delete one version of a library or an entire private library\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.name Name of the library to remove\n\t * @param {String} options.force Key to force deleting a public library\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tdeleteLibrary({ name, force, auth, headers, context }){\n\t\treturn this.delete({\n\t\t\turi: `/v1/libraries/${name}`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tdata: { force },\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Download an external file that may not be on the API\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.uri URL of the file.\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} Resolves to a buffer with the file data\n\t */\n\tdownloadFile({ uri, headers, context }){\n\t\tlet req = this.request({ uri, method: 'get', headers, context, raw: true });\n\t\treturn this._provideFileData(req);\n\t}\n\n\t/**\n\t * List OAuth client created by the account\n\t * @param {Object} options Options for this API call\n\t * @param {String} [options.product] List clients for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tlistOAuthClients({ product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/clients` : '/v1/clients';\n\t\treturn this.get({ uri, auth, headers, context });\n\t}\n\n\t/**\n\t * Create an OAuth client\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.name Name of the OAuth client\n\t * @param {String} options.type web, installed or web\n\t * @param {String} [options.redirect_uri] URL to redirect after OAuth flow. Only for type web.\n\t * @param {Object} [options.scope] Limits what the access tokens created by this client can do.\n\t * @param {String} [options.product] Create client for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tcreateOAuthClient({ name, type, redirect_uri, scope, product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/clients` : '/v1/clients';\n\t\tconst data = { name, type, redirect_uri, scope };\n\t\treturn this.post({ uri, auth, headers, data, context });\n\t}\n\n\t/**\n\t * Update an OAuth client\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.clientId The OAuth client to update\n\t * @param {String} [options.name] New Name of the OAuth client\n\t * @param {Object} [options.scope] New scope of the OAuth client\n\t * @param {String} [options.product] Update client linked to this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tupdateOAuthClient({ clientId, name, scope, product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/clients/${clientId}` : `/v1/clients/${clientId}`;\n\t\tconst data = { name, scope };\n\t\treturn this.put({ uri, data, auth, headers, context });\n\t}\n\n\t/**\n\t * Delete an OAuth client\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.clientId The OAuth client to update\n\t * @param {String} [options.product] OAuth client linked to this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tdeleteOAuthClient({ clientId, product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/clients/${clientId}` : `/v1/clients/${clientId}`;\n\t\treturn this.delete({ uri, auth, headers, context });\n\t}\n\n\t/**\n\t * List products the account has access to\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tlistProducts({ auth, headers, context }){\n\t\treturn this.get({ uri: '/v1/products', auth, headers, context });\n\t}\n\n\t/**\n\t * Get detailed information about a product\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.product Product ID or slug\n\t * @param {String} options.auth Access token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tgetProduct({ product, auth, headers, context }){\n\t\treturn this.get({ uri: `/v1/products/${product}`, auth, headers, context });\n\t}\n\n\t/**\n\t * List product firmware versions\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.product Firmware for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tlistProductFirmware({ product, auth, headers, context }){\n\t\treturn this.get({ uri: `/v1/products/${product}/firmware`, auth, headers, context });\n\t}\n\n\t/**\n\t * List product firmware versions\n\t * @param {Object} options Options for this API call\n\t * @param {Object} options.file Path or Buffer of the new firmware file\n\t * Either a path or Buffer of the file contents in Node, or a File or Blob in the browser.\n\t * @param {Number} options.version Version number of new firmware\n\t * @param {String} options.title Short identifier for the new firmware\n\t * @param {String} [options.description] Longer description for the new firmware\n\t * @param {String} options.product Firmware for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tuploadProductFirmware({ file, version, title, description, product, auth, headers, context }){\n\t\treturn this.request({\n\t\t\turi: `/v1/products/${product}/firmware`,\n\t\t\tmethod: 'post',\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tform: {\n\t\t\t\tversion,\n\t\t\t\ttitle,\n\t\t\t\tdescription\n\t\t\t},\n\t\t\tfiles: {\n\t\t\t\t'firmware.bin': file\n\t\t\t},\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Get information about a product firmware version\n\t * @param {Object} options Options for this API call\n\t * @param {Number} options.version Version number of firmware\n\t * @param {String} options.product Firmware for this product ID or slug\n\t * @param {String} options.auth Access token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tgetProductFirmware({ version, product, auth, headers, context }){\n\t\treturn this.get({\n\t\t\turi: `/v1/products/${product}/firmware/${version}`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Update information for a product firmware version\n\t * @param {Object} options Options for this API call\n\t * @param {Number} options.version Version number of new firmware\n\t * @param {String} [options.title] New title\n\t * @param {String} [options.description] New description\n\t * @param {String} options.product Firmware for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tupdateProductFirmware({ version, title, description, product, auth, headers, context }){\n\t\tconst uri = `/v1/products/${product}/firmware/${version}`;\n\t\treturn this.put({ uri, auth, headers, data: { title, description }, context });\n\t}\n\n\t/**\n\t * Download a product firmware binary\n\t * @param {Object} options Options for this API call\n\t * @param {Number} options.version Version number of new firmware\n\t * @param {String} options.product Firmware for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Request} A promise\n\t */\n\tdownloadProductFirmware({ version, product, auth, headers, context }){\n\t\tlet req = this.request({\n\t\t\turi: `/v1/products/${product}/firmware/${version}/binary`,\n\t\t\tmethod: 'get',\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext,\n\t\t\traw: true\n\t\t});\n\n\t\treturn this._provideFileData(req);\n\t}\n\n\t_provideFileData(req){\n\t\tif (this.agent.isForBrowser()){\n\t\t\treq = req.responseType('arraybuffer').then(res => {\n\t\t\t\tres.body = res.xhr.response;\n\t\t\t\treturn res;\n\t\t\t});\n\t\t} else {\n\t\t\treq = req.buffer(true).parse(binaryParser);\n\t\t}\n\t\treturn req.then(res => res.body);\n\t}\n\n\t/**\n\t * Release a product firmware version as the default version\n\t * @param {Object} options Options for this API call\n\t * @param {Number} options.version Version number of new firmware\n\t * @param {String} options.product Firmware for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\treleaseProductFirmware({ version, product, auth, headers, context }){\n\t\tconst uri = `/v1/products/${product}/firmware/release`;\n\t\treturn this.put({ uri, auth, headers, data: { version }, context });\n\t}\n\n\t/**\n\t * List product team members\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.product Team for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tlistTeamMembers({ product, auth, headers, context }){\n\t\treturn this.get({\n\t\t\turi: `/v1/products/${product}/team`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Invite Particle user to a product team\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.username Username for the Particle account\n\t * @param {String} options.product Team for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tinviteTeamMember({ username, product, auth, headers, context }){\n\t\treturn this.post({\n\t\t\turi: `/v1/products/${product}/team`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tdata: { username },\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Remove Particle user to a product team\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.username Username for the Particle account\n\t * @param {String} options.product Team for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tremoveTeamMember({ username, product, auth, headers, context }){\n\t\treturn this.delete({\n\t\t\turi: `/v1/products/${product}/team/${username}`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Fetch details about a serial number\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.serialNumber The serial number printed on the barcode of the device packaging\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tlookupSerialNumber({ serialNumber, auth, headers, context }){\n\t\treturn this.get({\n\t\t\turi: `/v1/serial_numbers/${serialNumber}`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Create a mesh network\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.name Network name\n\t * @param {String} options.deviceId Gateway device ID\n\t * @param {String} [options.iccid] ICCID of the active SIM card (only for cellular gateway devices)\n\t * @param {String} options.auth Access token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise<Object>} A promise\n\t */\n\tcreateMeshNetwork({ name, deviceId, iccid, auth, headers, context }){\n\t\treturn this.post({\n\t\t\turi: '/v1/networks',\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tdata: { name, device_id: deviceId, iccid },\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Remove a mesh network.\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.networkId Network ID or name\n\t * @param {String} options.auth Access token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise<Object>} A promise\n\t */\n\tremoveMeshNetwork({ networkId, auth, headers, context }){\n\t\treturn this.delete({ uri: `/v1/networks/${networkId}`, auth, headers, context });\n\t}\n\n\t/**\n\t * List all mesh networks\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.auth Access token\n\t * @param {Number} [options.page] Current page of results\n\t * @param {Number} [options.perPage] Records per page\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise<Object>} A promise\n\t */\n\tlistMeshNetworks({ page, perPage, auth, headers, context }){\n\t\tconst query = page ? { page, per_page: perPage } : undefined;\n\t\treturn this.get({ uri: '/v1/networks', auth, headers, query, context });\n\t}\n\n\t/**\n\t * Get information about a mesh network.\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.networkId Network ID or name\n\t * @param {String} options.auth Access token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise<Object>} A promise\n\t */\n\tgetMeshNetwork({ networkId, auth, headers, context }){\n\t\treturn this.get({ uri: `/v1/networks/${networkId}`, auth, headers, context });\n\t}\n\n\t/**\n\t * Modify a mesh network.\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.networkId Network ID or name\n\t * @param {String} options.action 'add-device', 'remove-device', 'gateway-enable' or 'gateway-disable'\n\t * @param {String} options.deviceId Device ID\n\t * @param {String} options.auth Access token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise<Object>} A promise\n\t */\n\tupdateMeshNetwork({ networkId, action, deviceId, auth, headers, context }){\n\t\treturn this.put({\n\t\t\turi: `/v1/networks/${networkId}`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tdata: { action, device_id: deviceId },\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Add a device to a mesh network.\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.networkId Network ID or name\n\t * @param {String} options.deviceId Device ID\n\t * @param {String} options.auth Access token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise<Object>} A promise\n\t */\n\taddMeshNetworkDevice({ networkId, deviceId, auth, headers, context }){\n\t\treturn this.updateMeshNetwork({\n\t\t\taction: 'add-device',\n\t\t\tnetworkId,\n\t\t\tdeviceId,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Remove a device from a mesh network.\n\t * @param {Object} options Options for this API call\n\t * @param {String} [options.networkId] Network ID or name\n\t * @param {String} options.deviceId Device ID\n\t * @param {String} options.auth Access token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise<Object>} A promise\n\t */\n\tremoveMeshNetworkDevice({ networkId, deviceId, auth, headers, context }){\n\t\tif (!networkId){\n\t\t\treturn this.delete({\n\t\t\t\turi: `/v1/devices/${deviceId}/network`,\n\t\t\t\tauth,\n\t\t\t\theaders, context\n\t\t\t});\n\t\t}\n\t\treturn this.updateMeshNetwork({\n\t\t\taction: 'remove-device',\n\t\t\tnetworkId,\n\t\t\tdeviceId,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * List all devices of a mesh network.\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.networkId Network ID or name\n\t * @param {String} options.auth Access token\n\t * @param {Number} [options.role] Device role: 'gateway' or 'node'\n\t * @param {Number} [options.page] Current page of results\n\t * @param {Number} [options.perPage] Records per page\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise<Object>} A promise\n\t */\n\tlistMeshNetworkDevices({ networkId, role, page, perPage, auth, headers, context }){\n\t\tconst query = (role || page) ? { role, page, per_page: perPage } : undefined;\n\t\treturn this.get({\n\t\t\turi: `/v1/networks/${networkId}/devices`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tquery,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Get product configuration\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.product Config for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tgetProductConfiguration({ auth, product, headers, context }){\n\t\treturn this.get({\n\t\t\turi: `/v1/products/${product}/config`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Get product configuration schema\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.product Config for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tgetProductConfigurationSchema({ auth, product, headers = {}, context }){\n\t\theaders.accept = 'application/schema+json';\n\t\treturn this.get({\n\t\t\turi: `/v1/products/${product}/config`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Get product device's configuration\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.product Config for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {String} options.deviceId Device ID to access\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tgetProductDeviceConfiguration({ auth, product, deviceId, headers, context }){\n\t\treturn this.get({\n\t\t\turi: `/v1/products/${product}/config/${deviceId}`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Get product device's configuration schema\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.product Config for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {String} options.deviceId Device ID to access\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tgetProductDeviceConfigurationSchema({ auth, product, deviceId, headers, context }){\n\t\theaders.accept = 'application/schema+json';\n\t\treturn this.get({\n\t\t\turi: `/v1/products/${product}/config/${deviceId}`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Set product configuration\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.product Config for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} opitons.config Product configuration to update\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tsetProductConfiguration({ auth, product, config, headers, context }){\n\t\treturn this.put({\n\t\t\turi: `/v1/products/${product}/config`,\n\t\t\tauth,\n\t\t\tdata: config,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Set product configuration for a specific device within the product\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.product Config for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} opitons.config Product configuration to update\n\t * @param {String} options.deviceId Device ID to access\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tsetProductDeviceConfiguration({ auth, product, deviceId, config, headers, context }){\n\t\treturn this.put({\n\t\t\turi: `/v1/products/${product}/config/${deviceId}`,\n\t\t\tdata: config,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Query location for devices within a product\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.product Locations for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {String} options.dateRange Start and end date in ISO8601 format, separated by comma, to query\n\t * @param {String} options.rectBl Bottom left of the rectangular bounding box to query. Latitude and longitude separated by comma\n\t * @param {String} options.rectTr Top right of the rectangular bounding box to query. Latitude and longitude separated by comma\n\t * @param {String} options.deviceId Device ID prefix to include in the query\n\t * @param {String} options.deviceName Device name prefix to include in the query\n\t * @param {String} options.groups Array of group names to include in the query\n\t * @param {String} options.page Page of results to display. Defaults to 1\n\t * @param {String} options.perPage Number of results per page. Defaults to 20. Maximum of 100\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tgetProductLocations({ auth, product, dateRange, rectBl, rectTr, deviceId, deviceName, groups, page, perPage, headers, context }){\n\t\treturn this.get({\n\t\t\turi: `/v1/products/${product}/locations`,\n\t\t\tquery: {\n\t\t\t\tdate_range: dateRange,\n\t\t\t\trect_bl: rectBl,\n\t\t\t\trect_tr: rectTr,\n\t\t\t\tdevice_id: deviceId,\n\t\t\t\tdevice_name: deviceName,\n\t\t\t\tgroups,\n\t\t\t\tpage,\n\t\t\t\tper_page: perPage\n\t\t\t},\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Query location for one device within a product\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.product Locations for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {String} options.dateRange Start and end date in ISO8601 format, separated by comma, to query\n\t * @param {String} options.rectBl Bottom left of the rectangular bounding box to query. Latitude and longitude separated by comma\n\t * @param {String} options.rectTr Top right of the rectangular bounding box to query. Latitude and longitude separated by comma\n\t * @param {String} options.deviceId Device ID to query\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tgetProductDeviceLocations({ auth, product, dateRange, rectBl, rectTr, deviceId, headers, context }){\n\t\treturn this.get({\n\t\t\turi: `/v1/products/${product}/locations/${deviceId}`,\n\t\t\tquery: {\n\t\t\t\tdate_range: dateRange,\n\t\t\t\trect_bl: rectBl,\n\t\t\t\trect_tr: rectTr\n\t\t\t},\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * API URI to access a device\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID to access\n\t * @param {String} [options.product] Device only in this product ID or slug\n\t * @private\n\t * @returns {string} URI\n\t */\n\tdeviceUri({ deviceId, product }){\n\t\treturn product ? `/v1/products/${product}/devices/${deviceId}` : `/v1/devices/${deviceId}`;\n\t}\n\n\tget({ uri, auth, headers, query, context }){\n\t\tcontext = this._buildContext(context);\n\t\treturn this.agent.get({ uri, auth, headers, query, context });\n\t}\n\n\thead({ uri, auth, headers, query, context }){\n\t\tcontext = this._buildContext(context);\n\t\treturn this.agent.head({ uri, auth, headers, query, context });\n\t}\n\n\tpost({ uri, auth, headers, data, context }){\n\t\tcontext = this._buildContext(context);\n\t\treturn this.agent.post({ uri, auth, headers, data, context });\n\t}\n\n\tput({ uri, auth, headers, data, context }){\n\t\tcontext = this._buildContext(context);\n\t\treturn this.agent.put({ uri, auth, headers, data, context });\n\t}\n\n\tdelete({ uri, auth, headers, data, context }){\n\t\tcontext = this._buildContext(context);\n\t\treturn this.agent.delete({ uri, auth, headers, data, context });\n\t}\n\n\trequest(args){\n\t\targs.context = this._buildContext(args.context);\n\t\treturn this.agent.request(args);\n\t}\n\n\tclient(options = {}){\n\t\treturn new Client(Object.assign({ api: this }, options));\n\t}\n}\n\n// Aliases for backwards compatibility\nParticle.prototype.removeAccessToken = Particle.prototype.deleteAccessToken;\n\nexport default Particle;\n"]}
1
+ {"version":3,"sources":["../src/Particle.js"],"names":["Particle","options","context","agent","baseUrl","name","undefined","_isValidContext","Error","username","password","tokenDuration","headers","request","uri","method","form","grant_type","client_id","clientId","client_secret","clientSecret","expires_in","mfaToken","otp","mfa_token","auth","get","invalidateTokens","data","invalidate_tokens","post","currentPassword","put","current_password","email","product","accountInfo","account_info","token","delete","access_token","query","full","tracking","deviceId","deviceName","groups","sortAttr","sortDir","page","perPage","Array","isArray","join","per_page","deviceUri","requestTransfer","id","request_transfer","file","files","deny","updateDevice","signal","notes","development","desiredFirmwareVersion","flash","desired_firmware_version","productId","product_id","iccid","promoCode","targetVersion","build_target_version","latest","console","warning","app","platformId","platform_id","binaryId","req","raw","_provideFileData","key","algorithm","deviceID","publicKey","toString","filename","order","Date","now","argument","args","org","toLowerCase","encodeURIComponent","connect","isPrivate","postData","private","event","url","device","rejectUnauthorized","noDefaults","hook","requestType","json","body","responseTemplate","responseTopic","responseEvent","errorResponseTopic","errorResponseEvent","hookId","settings","deviceid","integrationId","head","iccids","country","sims","action","mbLimit","mb_limit","onlyFeatured","featured","limit","filter","sort","architectures","category","scope","excludeScopes","_asList","value","version","archive","visibility","force","type","redirect_uri","title","description","isForBrowser","responseType","then","res","xhr","response","buffer","parse","serialNumber","device_id","networkId","updateMeshNetwork","role","accept","config","dateRange","rectBl","rectTr","date_range","rect_bl","rect_tr","device_name","_buildContext","api","prototype","removeAccessToken","deleteAccessToken"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;;;AAGA;;;;;;;;;IASMA,Q;AACL;;;;;;;AAOA,qBAAyB;AAAA,MAAbC,OAAa,uEAAH,EAAG;AAAA;;AACxB;AACA,wBAAc,IAAd,sBAA8BA,OAA9B;AACA,OAAKC,OAAL,GAAe,EAAf;AACA,OAAKC,KAAL,GAAa,oBAAU,KAAKC,OAAf,CAAb;AACA;;;;kCAEeC,I,EAAMH,O,EAAQ;AAC7B,UAAO,CAACG,SAAO,MAAP,IAAiBA,SAAO,SAAzB,KAAuCH,YAAUI,SAAxD;AACA;;;6BAEUD,I,EAAMH,O,EAAQ;AACxB,OAAIA,YAAUI,SAAd,EAAwB;AACvB,QAAI,KAAKC,eAAL,CAAqBF,IAArB,EAA2BH,OAA3B,CAAJ,EAAwC;AACvC,UAAKA,OAAL,CAAaG,IAAb,IAAqBH,OAArB;AACA,KAFD,MAEO;AACN,WAAMM,MAAM,+CAA6CH,IAAnD,CAAN;AACA;AACD;AACD;;AAED;;;;;;;;;gCAMcH,O,EAAQ;AAC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A;;;2BAEmB;AAAA,OAAb/F,OAAa,uEAAH,EAAG;;AACnB,UAAO,qBAAW,sBAAc,EAAE0K,KAAK,IAAP,EAAd,EAA6B1K,OAA7B,CAAX,CAAP;AACA;;;;;AAGF;;;AACAD,SAAS4K,SAAT,CAAmBC,iBAAnB,GAAuC7K,SAAS4K,SAAT,CAAmBE,iBAA1D;;kBAEe9K,Q","file":"Particle.js","sourcesContent":["import binaryParser from './superagent-binary-parser';\nimport Defaults from './Defaults';\nimport EventStream from './EventStream';\nimport Agent from './Agent';\nimport Client from './Client';\n\n\n/**\n * Particle Cloud API wrapper.\n *\n * See <https://docs.particle.io/reference/javascript/> for examples\n * of using the `Particle` class.\n *\n * Most Particle methods take a single unnamed argument object documented as\n * `options` with key/value pairs for each option.\n */\nclass Particle {\n\t/**\n\t * Contructor for the Cloud API wrapper.\n\t *\n\t * Create a new Particle object and call methods below on it.\n\t *\n\t * @param {Object} options Options for this API call Options to be used for all requests (see [Defaults](../src/Defaults.js))\n\t */\n\tconstructor(options = {}){\n\t\t// todo - this seems a bit dangerous - would be better to put all options/context in a contained object\n\t\tObject.assign(this, Defaults, options);\n\t\tthis.context = {};\n\t\tthis.agent = new Agent(this.baseUrl);\n\t}\n\n\t_isValidContext(name, context){\n\t\treturn (name==='tool' || name==='project') && context!==undefined;\n\t}\n\n\tsetContext(name, context){\n\t\tif (context!==undefined){\n\t\t\tif (this._isValidContext(name, context)){\n\t\t\t\tthis.context[name] = context;\n\t\t\t} else {\n\t\t\t\tthrow Error('uknown context name or undefined context: '+name);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Builds the final context from the context parameter and the context items in the api.\n\t * @param {Object} context The invocation context, this takes precedence over the local context.\n\t * @returns {Object} The context to use.\n\t * @private\n\t */\n\t_buildContext(context){\n\t\treturn Object.assign(this.context, context);\n\t}\n\n\t/**\n\t * Login to Particle Cloud using an existing Particle acccount.\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.username Username for the Particle account\n\t * @param {String} options.password Password for the Particle account\n\t * @param {Number} options.tokenDuration How long the access token should last in seconds\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Number} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tlogin({ username, password, tokenDuration = this.tokenDuration, headers, context }){\n\t\treturn this.request({\n\t\t\turi: '/oauth/token',\n\t\t\tmethod: 'post',\n\t\t\theaders,\n\t\t\tform: {\n\t\t\t\tusername,\n\t\t\t\tpassword,\n\t\t\t\tgrant_type: 'password',\n\t\t\t\tclient_id: this.clientId,\n\t\t\t\tclient_secret: this.clientSecret,\n\t\t\t\texpires_in: tokenDuration\n\t\t\t},\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * If login failed with an 'mfa_required' error, this must be called with a valid OTP code to login\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.mfaToken Given as 'mfa_token' in the error body of `.login()`.\n\t * @param {String} options.otp Current one-time-password generated from the authentication application\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Number} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tsendOtp({ mfaToken, otp, headers, context }){\n\t\treturn this.request({\n\t\t\turi: '/oauth/token',\n\t\t\tmethod: 'post',\n\t\t\theaders,\n\t\t\tform: {\n\t\t\t\tgrant_type: 'urn:custom:mfa-otp',\n\t\t\t\tmfa_token: mfaToken,\n\t\t\t\totp,\n\t\t\t\tclient_id: this.clientId,\n\t\t\t\tclient_secret: this.clientSecret\n\t\t\t},\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Enable MFA on the currently logged in user\n\t * @param {Object} options Options for this API call\n\t * @param {Object} options.auth Access token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tenableMfa({ auth, headers, context }){\n\t\treturn this.get({ uri: '/v1/user/mfa-enable', auth, headers, context });\n\t}\n\n\t/**\n\t * 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.\n\t * @param {Object} options Options for this API call\n\t * @param {Object} options.auth Access token\n\t * @param {Object} options.mfaToken Token given from previous step to\n\t * @param {Object} options.otp Current one-time-password generated from the authentication app\n\t * @param {Boolean} options.invalidateTokens Should all tokens be invalidated\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tconfirmMfa({ mfaToken, otp, invalidateTokens = false, auth, headers, context }){\n\t\tlet data = { mfa_token: mfaToken, otp };\n\n\t\tif (invalidateTokens) {\n\t\t\tdata.invalidate_tokens = true;\n\t\t}\n\n\t\treturn this.post({\n\t\t\turi: '/v1/user/mfa-enable',\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tdata,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Disable MFA for the user.\n\t * @param {Object} options Options for this API call\n\t * @param {Object} options.auth Access token\n\t * @param {Object} options.currentPassword User's current password\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tdisableMfa({ currentPassword, auth, headers, context }){\n\t\treturn this.put({\n\t\t\turi: '/v1/user/mfa-disable',\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tdata: { current_password: currentPassword },\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Create Customer for Product.\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.email Username for the Particle account\n\t * @param {String} options.password Password for the Particle account\n\t * @param {String} options.product Create the customer in this product ID or slug\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tcreateCustomer({ email, password, product, headers, context }){\n\t\treturn this.request({\n\t\t\turi: `/v1/products/${product}/customers`,\n\t\t\tmethod: 'post',\n\t\t\theaders,\n\t\t\tform: {\n\t\t\t\temail,\n\t\t\t\tpassword,\n\t\t\t\tgrant_type: 'client_credentials',\n\t\t\t\tclient_id: this.clientId,\n\t\t\t\tclient_secret: this.clientSecret\n\t\t\t},\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Login to Particle Cloud using an OAuth client.\n\t * @param {Object} options Options for this API call\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tloginAsClientOwner({ headers, context }){\n\t\treturn this.request({\n\t\t\turi: '/oauth/token',\n\t\t\tmethod: 'post',\n\t\t\theaders,\n\t\t\tform: {\n\t\t\t\tgrant_type: 'client_credentials',\n\t\t\t\tclient_id: this.clientId,\n\t\t\t\tclient_secret: this.clientSecret\n\t\t\t},\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Create a user account for the Particle Cloud\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.username Email of the new user\n\t * @param {String} options.password Password\n\t * @param {String} options.accountInfo Object that contains account information fields such as user real name, company name, business account flag etc\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tcreateUser({ username, password, accountInfo, headers, context }){\n\t\treturn this.post({\n\t\t\turi: '/v1/users',\n\t\t\theaders,\n\t\t\tdata: {\n\t\t\t\tusername,\n\t\t\t\tpassword,\n\t\t\t\taccount_info : accountInfo\n\t\t\t},\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Verify new user account via verification email\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.token The string token sent in the verification email\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tverifyUser({ token, headers, context }){\n\t\treturn this.post({\n\t\t\turi: '/v1/user/verify',\n\t\t\theaders,\n\t\t\tdata: { token },\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Send reset password email for a Particle Cloud user account\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.username Email of the user\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tresetPassword({ username, headers, context }){\n\t\treturn this.post({\n\t\t\turi: '/v1/user/password-reset',\n\t\t\theaders,\n\t\t\tdata: { username },\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Revoke an access token\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.username Username of the Particle cloud account that the token belongs to.\n\t * @param {String} options.password Password for the account\n\t * @param {String} options.token Access token you wish to revoke\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tdeleteAccessToken({ username, password, token, headers, context }){\n\t\treturn this.delete({\n\t\t\turi: `/v1/access_tokens/${token}`,\n\t\t\tauth: { username, password },\n\t\t\theaders,\n\t\t\tdata: { access_token: token },\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Revoke the current session access token\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tdeleteCurrentAccessToken({ auth, headers, context }){\n\t\treturn this.delete({\n\t\t\turi: '/v1/access_tokens/current',\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Revoke all active access tokens\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tdeleteActiveAccessTokens({ auth, headers, context }){\n\t\treturn this.delete({\n\t\t\turi: '/v1/access_tokens',\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Delete the current user\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.auth Access Token\n\t * @param {String} options.password Password\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tdeleteUser({ auth, password, headers, context }){\n\t\treturn this.delete({\n\t\t\turi: '/v1/user',\n\t\t\tdata: { password },\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * List all valid access tokens for a Particle Cloud account\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.username Username\n\t * @param {String} options.password Password\n\t * @param {String} options.otp Current one-time-password generated from the authentication application\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tlistAccessTokens({ username, password, otp, headers, context }){\n\t\treturn this.get({\n\t\t\turi: '/v1/access_tokens',\n\t\t\tauth: { username, password },\n\t\t\tquery: otp ? { otp } : undefined,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Retrieves the information that is used to identify the current login for tracking.\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.auth The access token\n\t * @param {Boolean} options.full When true, retrieve all information for registering a user with the tracking API. When false,\n\t * retrieve only the unique tracking ID for the current login.\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise<Object>} Resolve the tracking identify of the current login\n\t */\n\ttrackingIdentity({ full = false, auth, headers, context } = {}){\n\t\treturn this.get({\n\t\t\turi: '/v1/user/identify',\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tquery: (full ? undefined : { tracking: 1 }),\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * List devices claimed to the account or product\n\t * @param {Object} options Options for this API call\n\t * @param {String} [options.deviceId] (Product only) Filter results to devices with this ID (partial matching)\n\t * @param {String} [options.deviceName] (Product only) Filter results to devices with this name (partial matching)\n\t * @param {Array.<string>} [options.groups] (Product only) A list of full group names to filter results to devices belonging to these groups only.\n\t * @param {String} [options.sortAttr] (Product only) The attribute by which to sort results. See API docs for options.\n\t * @param {String} [options.sortDir] (Product only) The direction of sorting. See API docs for options.\n\t * @param {Number} [options.page] (Product only) Current page of results\n\t * @param {Number} [options.perPage] (Product only) Records per page\n\t * @param {String} [options.product] List devices in this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tlistDevices({ deviceId, deviceName, groups, sortAttr, sortDir, page, perPage, product, auth, headers, context }){\n\t\tlet uri, query;\n\n\t\tif (product){\n\t\t\turi = `/v1/products/${product}/devices`;\n\t\t\tgroups = Array.isArray(groups) ? groups.join(',') : undefined;\n\t\t\tquery = { deviceId, deviceName, groups, sortAttr, sortDir, page, per_page: perPage };\n\t\t} else {\n\t\t\turi = '/v1/devices';\n\t\t}\n\n\t\treturn this.get({ uri, auth, headers, query, context });\n\t}\n\n\t/**\n\t * Get detailed informationa about a device\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID or Name\n\t * @param {String} [options.product] Device in this product ID or slug\n\t * @param {String} options.auth Access token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tgetDevice({ deviceId, product, auth, headers, context }){\n\t\tconst uri = this.deviceUri({ deviceId, product });\n\t\treturn this.get({ uri, auth, headers, context });\n\t}\n\n\t/**\n\t * Claim a device to the account. The device must be online and unclaimed.\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tclaimDevice({ deviceId, requestTransfer, auth, headers, context }){\n\t\treturn this.post({\n\t\t\turi: '/v1/devices',\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tdata: {\n\t\t\t\tid: deviceId,\n\t\t\t\trequest_transfer: !!requestTransfer\n\t\t\t},\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Add a device to a product or move device out of quarantine.\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID\n\t * @param {Object} options.file A file that contains a single-column list of device IDs, device serial numbers, device IMEIs, or devie ICCIDs.\n\t * Node: Either a path or Buffer. Browser: a File or Blob.\n\t * @param {String} options.product Add to this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\taddDeviceToProduct({ deviceId, product, file, auth, headers, context }){\n\t\tlet files, data;\n\n\t\tif (file){\n\t\t\tfiles = { file };\n\t\t} else if (deviceId){\n\t\t\tdata = { id: deviceId };\n\t\t}\n\n\t\treturn this.request({\n\t\t\turi: `/v1/products/${product}/devices`,\n\t\t\tmethod: 'post',\n\t\t\theaders,\n\t\t\tdata,\n\t\t\tfiles,\n\t\t\tauth,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Unclaim / Remove a device from your account or product, or deny quarantine\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID or Name\n\t * @param {Boolean} [options.deny] (Product only) Deny this quarantined device, instead of removing an already approved device\n\t * @param {String} options.product Remove from this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tremoveDevice({ deviceId, deny, product, auth, headers, context }){\n\t\tconst uri = this.deviceUri({ deviceId, product });\n\t\tconst data = product ? { deny } : undefined;\n\t\treturn this.delete({ uri, data, auth, headers, context });\n\t}\n\n\t/**\n\t * Unclaim a product device its the owner, but keep it in the product\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID or Name\n\t * @param {String} options.product Remove from this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tremoveDeviceOwner({ deviceId, product, auth, headers, context }){\n\t\tconst uri = `/v1/products/${product}/devices/${deviceId}/owner`;\n\t\treturn this.delete({ uri, auth, headers, context });\n\t}\n\n\t/**\n\t * Rename a device\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID or Name\n\t * @param {String} options.name Desired Name\n\t * @param {String} [options.product] Rename device in this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\trenameDevice({ deviceId, name, product, auth, headers, context }){\n\t\treturn this.updateDevice({ deviceId, name, product, auth, headers, context });\n\t}\n\n\t/**\n\t * Instruct the device to turn on/off the LED in a rainbow pattern\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID or Name\n\t * @param {Boolean} options.signal Signal on or off\n\t * @param {String} [options.product] Device in this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tsignalDevice({ deviceId, signal, product, auth, headers, context }){\n\t\treturn this.updateDevice({ deviceId, signal, product, auth, headers, context });\n\t}\n\n\t/**\n\t * Store some notes about device\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID or Name\n\t * @param {String} options.notes Your notes about this device\n\t * @param {String} [options.product] Device in this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tsetDeviceNotes({ deviceId, notes, product, auth, headers, context }){\n\t\treturn this.updateDevice({ deviceId, notes, product, auth, headers, context });\n\t}\n\n\t/**\n\t * Mark device as being used in development of a product so it opts out of automatic firmware updates\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID or Name\n\t * @param {Boolean} options.development Set to true to mark as development, false to return to product fleet\n\t * @param {String} options.product Device in this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tmarkAsDevelopmentDevice({ deviceId, development = true, product, auth, headers, context }){\n\t\treturn this.updateDevice({ deviceId, development, product, auth, headers, context });\n\t}\n\n\t/**\n\t * Mark device as being used in development of a product so it opts out of automatic firmware updates\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID or Name\n\t * @param {Number} options.desiredFirmwareVersion Lock the product device to run this firmware version.\n\t * @param {Boolean} [options.flash] Immediately flash firmware indicated by desiredFirmwareVersion\n\t * @param {String} options.product Device in this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tlockDeviceProductFirmware({ deviceId, desiredFirmwareVersion, flash, product, auth, context }){\n\t\treturn this.updateDevice({ deviceId, desiredFirmwareVersion, flash, product, auth, context });\n\t}\n\n\t/**\n\t * Mark device as receiving automatic firmware updates\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID or Name\n\t * @param {String} options.product Device in this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tunlockDeviceProductFirmware({ deviceId, product, auth, headers, context }){\n\t\treturn this.updateDevice({ deviceId, desiredFirmwareVersion: null, product, auth, headers, context });\n\t}\n\n\t/**\n\t * Update multiple device attributes at the same time\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID or Name\n\t * @param {String} [options.name] Desired Name\n\t * @param {Boolean} options.signal Signal device on or off\n\t * @param {String} [options.notes] Your notes about this device\n\t * @param {Boolean} [options.development] (Product only) Set to true to mark as development, false to return to product fleet\n\t * @param {Number} [options.desiredFirmwareVersion] (Product only) Lock the product device to run this firmware version.\n\t * Pass `null` to unlock firmware and go back to released firmware.\n\t * @param {Boolean} [options.flash] (Product only) Immediately flash firmware indicated by desiredFirmwareVersion\n\t * @param {String} [options.product] Device in this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tupdateDevice({ deviceId, name, signal, notes, development, desiredFirmwareVersion, flash, product, auth, headers, context }){\n\t\tif (signal !== undefined){\n\t\t\tsignal = signal ? '1' : '0';\n\t\t}\n\n\t\tconst uri = this.deviceUri({ deviceId, product });\n\t\tconst data = product ?\n\t\t\t{ name, signal, notes, development, desired_firmware_version: desiredFirmwareVersion, flash } :\n\t\t\t{ name, signal, notes };\n\n\t\treturn this.put({ uri, auth, headers, data, context });\n\t}\n\n\t/**\n\t * Provision a new device for products that allow self-provisioning\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.productId Product ID where to create this device\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tprovisionDevice({ productId, auth, headers, context }){\n\t\treturn this.post({\n\t\t\turi: '/v1/devices',\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tdata: { product_id: productId },\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Generate a claim code to use in the device claiming process.\n\t * To generate a claim code for a product, the access token MUST belong to a\n\t * customer of the product.\n\t * @param {Object} options Options for this API call\n\t * @param {String} [options.iccid] ICCID of the SIM card used in the Electron\n\t * @param {String} [options.product] Device in this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tgetClaimCode({ iccid, product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/device_claims` : '/v1/device_claims';\n\t\treturn this.post({ uri, auth, headers, data: { iccid }, context });\n\t}\n\n\tvalidatePromoCode({ promoCode, auth, headers, context }){\n\t\treturn this.get({\n\t\t\turi: `/v1/promo_code/${promoCode}`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\tchangeProduct({ deviceId, productId, auth, headers, context }){\n\t\treturn this.put({\n\t\t\turi: `/v1/devices/${deviceId}`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tdata: { product_id: productId },\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Get the value of a device variable\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID or Name\n\t * @param {String} options.name Variable name\n\t * @param {String} [options.product] Device in this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tgetVariable({ deviceId, name, product, auth, headers, context }){\n\t\tconst uri = product ?\n\t\t\t`/v1/products/${product}/devices/${deviceId}/${name}` :\n\t\t\t`/v1/devices/${deviceId}/${name}`;\n\n\t\treturn this.get({ uri, auth, headers, context });\n\t}\n\n\t/**\n\t * Compile and flash application firmware to a device. Pass a pre-compiled binary to flash it directly to the device.\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID or Name\n\t * @param {String} options.product Flash device in this product ID or slug\n\t * @param {Object} options.files Object containing files to be compiled and flashed. Keys should be the filenames, including relative path, and the values should be a path or Buffer of the file contents in Node, or a File or Blob in the browser.\n\t * @param {String} [options.targetVersion=latest] System firmware version to compile against\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tflashDevice({ deviceId, product, files, targetVersion, auth, headers, context }){\n\t\tconst uri = this.deviceUri({ deviceId, product });\n\t\tconst form = {};\n\n\t\tif (targetVersion){\n\t\t\tform.build_target_version = targetVersion;\n\t\t} else {\n\t\t\tform.latest = 'true';\n\t\t}\n\n\t\treturn this.request({ uri, method: 'put', auth, headers, files, form, context });\n\t}\n\n\t/**\n\t * DEPRECATED: Flash the Tinker application to a device. Instead compile and flash the Tinker source code.\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID or Name\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tflashTinker({ deviceId, auth, headers, context }){\n\t\t/* eslint-disable no-console */\n\t\tif (console && console.warning){\n\t\t\tconsole.warning('Particle.flashTinker is deprecated');\n\t\t}\n\t\t/* eslint-enable no-console */\n\t\treturn this.put({\n\t\t\turi: `/v1/devices/${deviceId}`,\n\t\t\theaders,\n\t\t\tdata: { app: 'tinker' },\n\t\t\tauth,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Compile firmware using the Particle Cloud\n\t * @param {Object} options Options for this API call\n\t * @param {Object} options.files Object containing files to be compiled. Keys should be the filenames, including relative path, and the values should be a path or Buffer of the file contents in Node, or a File or Blob in the browser.\n\t * @param {Number} [options.platformId] Platform id number of the device you are compiling for. Common values are 0=Core, 6=Photon, 10=Electron.\n\t * @param {String} [options.targetVersion=latest] System firmware version to compile against\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tcompileCode({ files, platformId, targetVersion, auth, headers, context }){\n\t\tconst form = { platform_id: platformId };\n\n\t\tif (targetVersion){\n\t\t\tform.build_target_version = targetVersion;\n\t\t} else {\n\t\t\tform.latest = 'true';\n\t\t}\n\n\t\treturn this.request({\n\t\t\turi: '/v1/binaries',\n\t\t\tmethod: 'post',\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tfiles,\n\t\t\tform,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Download a firmware binary\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.binaryId Binary ID received from a successful compile call\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Request} A promise\n\t */\n\tdownloadFirmwareBinary({ binaryId, auth, headers, context }){\n\t\tlet req = this.request({\n\t\t\turi: `/v1/binaries/${binaryId}`,\n\t\t\tmethod: 'get',\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext,\n\t\t\traw: true\n\t\t});\n\n\t\treturn this._provideFileData(req);\n\t}\n\n\t/**\n\t * Send a new device public key to the Particle Cloud\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID or Name\n\t * @param {(String|Buffer)} options.key Public key contents\n\t * @param {String} [options.algorithm=rsa] Algorithm used to generate the public key. Valid values are `rsa` or `ecc`.\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tsendPublicKey({ deviceId, key, algorithm, auth, headers, context }){\n\t\treturn this.post({\n\t\t\turi: `/v1/provisioning/${deviceId}`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tdata: {\n\t\t\t\tdeviceID: deviceId,\n\t\t\t\tpublicKey: ( typeof key === 'string' ? key : key.toString() ),\n\t\t\t\tfilename: 'particle-api',\n\t\t\t\torder: `manual_${ Date.now() }`,\n\t\t\t\talgorithm: algorithm || 'rsa'\n\t\t\t},\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Call a device function\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID or Name\n\t * @param {String} options.name Function name\n\t * @param {String} options.argument Function argument\n\t * @param {String} [options.product] Device in this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tcallFunction({ deviceId, name, argument, product, auth, headers, context }){\n\t\tconst uri = product ?\n\t\t\t`/v1/products/${product}/devices/${deviceId}/${name}` :\n\t\t\t`/v1/devices/${deviceId}/${name}`;\n\t\treturn this.post({ uri, auth, headers, data: { args: argument }, context });\n\t}\n\n\t/**\n\t * Get a stream of events\n\t * @param {Object} options Options for this API call\n\t * @param {String} [options.deviceId] Device ID or Name, or `mine` to indicate only your devices.\n\t * @param {String} [options.name] Event Name\n\t * @param {String} [options.org] Organization Slug\n\t * @param {String} [options.product] Events for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @returns {Promise} If the promise resolves, the resolution value will be an EventStream object that will\n\t * emit 'event' events.\n\t */\n\tgetEventStream({ deviceId, name, org, product, auth }){\n\t\tlet uri = '/v1/';\n\t\tif (org){\n\t\t\turi += `orgs/${org}/`;\n\t\t}\n\n\t\tif (product){\n\t\t\turi += `products/${product}/`;\n\t\t}\n\n\t\tif (deviceId){\n\t\t\turi += 'devices/';\n\t\t\tif (!(deviceId.toLowerCase() === 'mine')){\n\t\t\t\turi += `${deviceId}/`;\n\t\t\t}\n\t\t}\n\n\t\turi += 'events';\n\n\t\tif (name){\n\t\t\turi += `/${encodeURIComponent(name)}`;\n\t\t}\n\n\t\treturn new EventStream(`${this.baseUrl}${uri}`, auth).connect();\n\t}\n\n\t/**\n\t * Publish a event to the Particle Cloud\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.name Event name\n\t * @param {String} options.data Event data\n\t * @param {Boolean} options.isPrivate Should the event be publicly available?\n\t * @param {String} [options.product] Event for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tpublishEvent({ name, data, isPrivate, product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/events` : '/v1/devices/events';\n\t\tconst postData = { name, data, private: isPrivate };\n\t\treturn this.post({ uri, auth, headers, data: postData, context });\n\t}\n\n\t/**\n\t * Create a webhook\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.event The name of the Particle event that should trigger the Webhook\n\t * @param {String} options.url The web address that will be targeted when the Webhook is triggered\n\t * @param {String} [options.device] Trigger Webhook only for this device ID or Name\n\t * @param {Boolean} [options.rejectUnauthorized] Set to `false` to skip SSL certificate validation of the target URL\n\t * @param {Boolean} [options.noDefaults] Don't include default event data in the webhook request\n\t * @param {Object} [options.hook] Webhook configuration settings\n\t * @param {String} [options.hook.method=POST] Type of web request triggered by the Webhook (GET, POST, PUT, or DELETE)\n\t * @param {Object} [options.hook.auth] Auth data like `{ username: 'me', password: '1234' }` to send via basic auth header with the Webhook request\n\t * @param {Object} [options.hook.headers] Additional headers to add to the Webhook like `{ 'X-ONE': '1', X-TWO: '2' }`\n\t * @param {Object} [options.hook.query] Query params to add to the Webhook request like `{ foo: 'foo', bar: 'bar' }`\n\t * @param {Object} [options.hook.json] JSON data to send with the Webhook request - sets `Content-Type` to `application/json`\n\t * @param {Object} [options.hook.form] Form data to send with the Webhook request - sets `Content-Type` to `application/x-www-form-urlencoded`\n\t * @param {String} [options.hook.body] Custom body to send with the Webhook request\n\t * @param {Object} [options.hook.responseTemplate] Template to use to customize the Webhook response body\n\t * @param {Object} [options.hook.responseEvent] The Webhook response event name that your devices can subscribe to\n\t * @param {Object} [options.hook.errorResponseEvent] The Webhook error response event name that your devices can subscribe to\n\t * @param {String} [options.product] Webhook for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tcreateWebhook({ event, url, device, rejectUnauthorized, noDefaults, hook, product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/webhooks` : '/v1/webhooks';\n\t\tconst data = { event, url, deviceId: device, rejectUnauthorized, noDefaults };\n\n\t\tif (hook){\n\t\t\tdata.requestType = hook.method;\n\t\t\tdata.auth = hook.auth;\n\t\t\tdata.headers = hook.headers;\n\t\t\tdata.query = hook.query;\n\t\t\tdata.json = hook.json;\n\t\t\tdata.form = hook.form;\n\t\t\tdata.body = hook.body;\n\t\t\tdata.responseTemplate = hook.responseTemplate;\n\t\t\tdata.responseTopic = hook.responseEvent;\n\t\t\tdata.errorResponseTopic = hook.errorResponseEvent;\n\t\t}\n\n\t\tif (!data.requestType){\n\t\t\tdata.requestType = 'POST';\n\t\t}\n\n\t\treturn this.post({ uri, auth, headers, data, context });\n\t}\n\n\t/**\n\t * Delete a webhook\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.hookId Webhook ID\n\t * @param {String} [options.product] Webhook for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tdeleteWebhook({ hookId, product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/webhooks/${hookId}` : `/v1/webhooks/${hookId}`;\n\t\treturn this.delete({ uri, auth, headers, context });\n\t}\n\n\t/**\n\t * List all webhooks owned by the account or product\n\t * @param {Object} options Options for this API call\n\t * @param {String} [options.product] Webhooks for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tlistWebhooks({ product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/webhooks` : '/v1/webhooks';\n\t\treturn this.get({ uri, auth, headers, context });\n\t}\n\n\t/**\n\t * Create an integration to send events to an external service\n *\n\t * See the API docs for details https://docs.particle.io/reference/api/#integrations-webhooks-\n\t *\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.event Event that triggers the integration\n\t * @param {Object} options.settings Settings specific to that integration type\n\t * @param {String} [options.deviceId] Trigger integration only for this device ID or Name\n\t * @param {String} [options.product] Integration for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tcreateIntegration({ event, settings, deviceId, product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/integrations` : '/v1/integrations';\n\t\tconst data = Object.assign({ event, deviceid: deviceId }, settings);\n\t\treturn this.post({ uri, data, auth, headers, context });\n\t}\n\n\t/**\n\t * Edit an integration to send events to an external service\n\t *\n\t * See the API docs for details https://docs.particle.io/reference/api/#integrations-webhooks-\n\t *\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.integrationId The integration to edit\n\t * @param {String} [options.event] Change the event that triggers the integration\n\t * @param {Object} [options.settings] Change the settings specific to that integration type\n\t * @param {String} [options.deviceId] Trigger integration only for this device ID or Name\n\t * @param {String} [options.product] Integration for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\teditIntegration({ integrationId, event, settings, deviceId, product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/integrations/${integrationId}` : `/v1/integrations/${integrationId}`;\n\t\tconst data = Object.assign({ event, deviceid: deviceId }, settings);\n\t\treturn this.put({ uri, auth, headers, data, context });\n\t}\n\n\t/**\n\t * Delete an integration to send events to an external service\n\t *\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.integrationId The integration to remove\n\t * @param {String} [options.product] Integration for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tdeleteIntegration({ integrationId, product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/integrations/${integrationId}` : `/v1/integrations/${integrationId}`;\n\t\treturn this.delete({ uri, auth, headers, context });\n\t}\n\n\t/**\n\t * List all integrations owned by the account or product\n\t * @param {Object} options Options for this API call\n\t * @param {String} [options.product] Integrations for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tlistIntegrations({ product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/integrations` : '/v1/integrations';\n\t\treturn this.get({ uri, auth, headers, context });\n\t}\n\n\t/**\n\t * Get details about the current user\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tgetUserInfo({ auth, headers, context }){\n\t\treturn this.get({ uri: '/v1/user', auth, headers, context });\n\t}\n\n\t/**\n\t * Set details on the current user\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.auth Access Token\n\t * @param {String} options.accountInfo Set user's extended info fields (name, business account, company name, etc)\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tsetUserInfo({ accountInfo, auth, headers, context }){\n\t\tconst data = { account_info: accountInfo };\n\t\treturn this.put({ uri: '/v1/user', auth, headers, data, context });\n\t}\n\n\t/**\n\t * Change username (i.e, email)\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.auth Access Token\n\t * @param {String} options.currentPassword Current password\n\t * @param {String} options.username New email\n\t * @param {Boolean} options.invalidateTokens Should all tokens be invalidated\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tchangeUsername({ currentPassword, username, invalidateTokens = false, auth, headers, context }){\n\t\tconst data = { username, current_password: currentPassword };\n\n\t\tif (invalidateTokens) {\n\t\t\tdata.invalidate_tokens = true;\n\t\t}\n\n\t\treturn this.put({ uri: '/v1/user', auth, headers, data, context });\n\t}\n\n\t/**\n\t * Change user's password\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.auth Access Token\n\t * @param {String} options.currentPassword Current password\n\t * @param {String} options.password New password\n\t * @param {Boolean} options.invalidateTokens Should all tokens be invalidated\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tchangeUserPassword({ currentPassword, password, invalidateTokens = false, auth, headers, context }){\n\t\tconst data = { password, current_password: currentPassword };\n\n\t\tif (invalidateTokens) {\n\t\t\tdata.invalidate_tokens = true;\n\t\t}\n\n\t\treturn this.put({ uri: '/v1/user', auth, headers, data, context });\n\t}\n\n\t/**\n\t * List SIM cards owned by a user or product\n\t * @param {Object} options Options for this API call\n\t * @param {String} [options.iccid] (Product only) Filter to SIM cards matching this ICCID\n\t * @param {String} [options.deviceId] (Product only) Filter to SIM cards matching this device ID\n\t * @param {String} [options.deviceName] (Product only) Filter to SIM cards matching this device name\n\t * @param {Number} [options.page] (Product only) Current page of results\n\t * @param {Number} [options.perPage] (Product only) Records per page\n\t * @param {String} [options.product] SIM cards for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tlistSIMs({ iccid, deviceId, deviceName, page, perPage, product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/sims` : '/v1/sims';\n\t\tconst query = product ? { iccid, deviceId, deviceName, page, per_page: perPage } : undefined;\n\t\treturn this.get({ uri, auth, headers, query, context });\n\t}\n\n\t/**\n\t * Get data usage for one SIM card for the current billing period\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.iccid ICCID of the SIM card\n\t * @param {String} [options.product] SIM card for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tgetSIMDataUsage({ iccid, product, auth, headers, context }){\n\t\tconst uri = product ?\n\t\t\t`/v1/products/${product}/sims/${iccid}/data_usage` :\n\t\t\t`/v1/sims/${iccid}/data_usage`;\n\n\t\treturn this.get({ uri, auth, headers, context });\n\t}\n\n\t/**\n\t * Get data usage for all SIM cards in a product the current billing period\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.product SIM cards for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tgetFleetDataUsage({ product, auth, headers, context }){\n\t\treturn this.get({\n\t\t\turi: `/v1/products/${product}/sims/data_usage`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Check SIM status\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.iccid ICCID of the SIM card\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tcheckSIM({ iccid, auth, headers, context }){\n\t\treturn this.head({ uri: `/v1/sims/${iccid}`, auth, headers, context });\n\t}\n\n\t/**\n\t * Activate and add SIM cards to an account or product\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.iccid ICCID of the SIM card\n\t * @param {Array<String>} options.iccids (Product only) ICCID of multiple SIM cards to import\n\t * @param {String} options.country The ISO country code for the SIM cards\n\t * @param {String} [options.product] SIM cards for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tactivateSIM({ iccid, iccids, country, promoCode, product, auth, headers, context }){\n\t\t// promoCode is deprecated\n\t\ticcids = iccids || [iccid];\n\t\tconst uri = product ? `/v1/products/${product}/sims` : `/v1/sims/${iccid}`;\n\t\tconst data = product ?\n\t\t\t{ sims: iccids, country } :\n\t\t\t{ country, promoCode, action: 'activate' };\n\t\tconst method = product ? 'post' : 'put';\n\n\t\treturn this.request({ uri, method, headers, data, auth, context });\n\t}\n\n\t/**\n\t * Deactivate a SIM card so it doesn't incur data usage in future months.\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.iccid ICCID of the SIM card\n\t * @param {String} [options.product] SIM cards for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tdeactivateSIM({ iccid, product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/sims/${iccid}` : `/v1/sims/${iccid}`;\n\t\tconst data = { action: 'deactivate' };\n\t\treturn this.put({ uri, auth, headers, data, context });\n\t}\n\n\t/**\n\t * Reactivate a SIM card the was deactivated or unpause a SIM card that was automatically paused\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.iccid ICCID of the SIM card\n\t * @param {Number} [options.mbLimit] New monthly data limit. Necessary if unpausing a SIM card\n\t * @param {String} [options.product] SIM cards for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\treactivateSIM({ iccid, mbLimit, product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/sims/${iccid}` : `/v1/sims/${iccid}`;\n\t\tconst data = { mb_limit: mbLimit, action: 'reactivate' };\n\t\treturn this.put({ uri, auth, headers, data, context });\n\t}\n\n\t/**\n\t * Update SIM card data limit\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.iccid ICCID of the SIM card\n\t * @param {Array} options.mbLimit Data limit in megabyte for the SIM card\n\t * @param {String} [options.product] SIM cards for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tupdateSIM({ iccid, mbLimit, product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/sims/${iccid}` : `/v1/sims/${iccid}`;\n\t\tconst data = { mb_limit: mbLimit };\n\t\treturn this.put({ uri, auth, headers, data, context });\n\t}\n\n\t/**\n\t * Remove a SIM card from an account so it can be activated by a different account\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.iccid ICCID of the SIM card\n\t * @param {String} [options.product] SIM cards for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tremoveSIM({ iccid, product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/sims/${iccid}` : `/v1/sims/${iccid}`;\n\t\treturn this.delete({ uri, auth, headers, context });\n\t}\n\n\t/**\n\t * List valid build targets to be used for compiling\n\t * @param {Object} options Options for this API call\n\t * @param {Boolean} [options.onlyFeatured=false] Only list featured build targets\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tlistBuildTargets({ onlyFeatured, auth, headers, context }){\n\t\tconst query = onlyFeatured ? { featured: !!onlyFeatured } : undefined;\n\t\treturn this.get({ uri: '/v1/build_targets', auth, headers, query, context });\n\t}\n\n\t/**\n\t * List firmware libraries\n\t * @param {Object} options Options for this API call\n\t * @param {Number} options.page Page index (default, first page)\n\t * @param {Number} options.limit Number of items per page\n\t * @param {String} options.filter Search term for the libraries\n\t * @param {String} options.sort Ordering key for the library list\n\t * @param {Array<String>} options.architectures List of architectures to filter\n\t * @param {String} options.category Category to filter\n\t * @param {String} options.scope The library scope to list. Default is 'all'. Other values are\n\t * - 'all' - list public libraries and my private libraries\n\t * - 'public' - list only public libraries\n\t * - 'private' - list only my private libraries\n\t * - 'mine' - list my libraries (public and private)\n\t * - 'official' - list only official libraries\n\t * - 'verified' - list only verified libraries\n\t * - 'featured' - list only featured libraries\n\t * @param {String} options.excludeScopes list of scopes to exclude\n\t * @param {String} options.category Category to filter\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tlistLibraries({ page, limit, filter, sort, architectures, category, scope, excludeScopes, auth, headers, context }){\n\t\treturn this.get({\n\t\t\turi: '/v1/libraries',\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tquery: {\n\t\t\t\tpage,\n\t\t\t\tfilter,\n\t\t\t\tlimit,\n\t\t\t\tsort,\n\t\t\t\tarchitectures: this._asList(architectures),\n\t\t\t\tcategory,\n\t\t\t\tscope,\n\t\t\t\texcludeScopes: this._asList(excludeScopes)\n\t\t\t},\n\t\t\tcontext\n\t\t});\n\t}\n\n\t_asList(value){\n\t\treturn (Array.isArray(value) ? value.join(',') : value);\n\t}\n\n\t/**\n\t * Get firmware library details\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.name Name of the library to fetch\n\t * @param {String} options.version Version of the library to fetch (default: latest)\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tgetLibrary({ name, version, auth, headers, context }){\n\t\treturn this.get({\n\t\t\turi: `/v1/libraries/${name}`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tquery: { version },\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Firmware library details for each version\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.name Name of the library to fetch\n\t * @param {Number} options.page Page index (default, first page)\n\t * @param {Number} options.limit Number of items per page\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tgetLibraryVersions({ name, page, limit, auth, headers, context }){\n\t\treturn this.get({\n\t\t\turi: `/v1/libraries/${name}/versions`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tquery: { page, limit },\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Contribute a new library version from a compressed archive\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.archive Compressed archive file containing the library sources\n\t * Either a path or Buffer of the file contents in Node, or a File or Blob in the browser.\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tcontributeLibrary({ archive, auth, headers, context }){\n\t\tconst files = {\n\t\t\t'archive.tar.gz': archive\n\t\t};\n\n\t\treturn this.request({\n\t\t\turi: '/v1/libraries',\n\t\t\tmethod: 'post',\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tfiles,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Publish the latest version of a library to the public\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.name Name of the library to publish\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tpublishLibrary({ name, auth, headers, context }){\n\t\treturn this.request({\n\t\t\turi: `/v1/libraries/${name}`,\n\t\t\tmethod: 'patch',\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tdata: { visibility: 'public' },\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Delete one version of a library or an entire private library\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.name Name of the library to remove\n\t * @param {String} options.force Key to force deleting a public library\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tdeleteLibrary({ name, force, auth, headers, context }){\n\t\treturn this.delete({\n\t\t\turi: `/v1/libraries/${name}`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tdata: { force },\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Download an external file that may not be on the API\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.uri URL of the file.\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} Resolves to a buffer with the file data\n\t */\n\tdownloadFile({ uri, headers, context }){\n\t\tlet req = this.request({ uri, method: 'get', headers, context, raw: true });\n\t\treturn this._provideFileData(req);\n\t}\n\n\t/**\n\t * List OAuth client created by the account\n\t * @param {Object} options Options for this API call\n\t * @param {String} [options.product] List clients for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tlistOAuthClients({ product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/clients` : '/v1/clients';\n\t\treturn this.get({ uri, auth, headers, context });\n\t}\n\n\t/**\n\t * Create an OAuth client\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.name Name of the OAuth client\n\t * @param {String} options.type web, installed or web\n\t * @param {String} [options.redirect_uri] URL to redirect after OAuth flow. Only for type web.\n\t * @param {Object} [options.scope] Limits what the access tokens created by this client can do.\n\t * @param {String} [options.product] Create client for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tcreateOAuthClient({ name, type, redirect_uri, scope, product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/clients` : '/v1/clients';\n\t\tconst data = { name, type, redirect_uri, scope };\n\t\treturn this.post({ uri, auth, headers, data, context });\n\t}\n\n\t/**\n\t * Update an OAuth client\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.clientId The OAuth client to update\n\t * @param {String} [options.name] New Name of the OAuth client\n\t * @param {Object} [options.scope] New scope of the OAuth client\n\t * @param {String} [options.product] Update client linked to this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tupdateOAuthClient({ clientId, name, scope, product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/clients/${clientId}` : `/v1/clients/${clientId}`;\n\t\tconst data = { name, scope };\n\t\treturn this.put({ uri, data, auth, headers, context });\n\t}\n\n\t/**\n\t * Delete an OAuth client\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.clientId The OAuth client to update\n\t * @param {String} [options.product] OAuth client linked to this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tdeleteOAuthClient({ clientId, product, auth, headers, context }){\n\t\tconst uri = product ? `/v1/products/${product}/clients/${clientId}` : `/v1/clients/${clientId}`;\n\t\treturn this.delete({ uri, auth, headers, context });\n\t}\n\n\t/**\n\t * List products the account has access to\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tlistProducts({ auth, headers, context }){\n\t\treturn this.get({ uri: '/v1/products', auth, headers, context });\n\t}\n\n\t/**\n\t * Get detailed information about a product\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.product Product ID or slug\n\t * @param {String} options.auth Access token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tgetProduct({ product, auth, headers, context }){\n\t\treturn this.get({ uri: `/v1/products/${product}`, auth, headers, context });\n\t}\n\n\t/**\n\t * List product firmware versions\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.product Firmware for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tlistProductFirmware({ product, auth, headers, context }){\n\t\treturn this.get({ uri: `/v1/products/${product}/firmware`, auth, headers, context });\n\t}\n\n\t/**\n\t * List product firmware versions\n\t * @param {Object} options Options for this API call\n\t * @param {Object} options.file Path or Buffer of the new firmware file\n\t * Either a path or Buffer of the file contents in Node, or a File or Blob in the browser.\n\t * @param {Number} options.version Version number of new firmware\n\t * @param {String} options.title Short identifier for the new firmware\n\t * @param {String} [options.description] Longer description for the new firmware\n\t * @param {String} options.product Firmware for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tuploadProductFirmware({ file, version, title, description, product, auth, headers, context }){\n\t\treturn this.request({\n\t\t\turi: `/v1/products/${product}/firmware`,\n\t\t\tmethod: 'post',\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tform: {\n\t\t\t\tversion,\n\t\t\t\ttitle,\n\t\t\t\tdescription\n\t\t\t},\n\t\t\tfiles: {\n\t\t\t\t'firmware.bin': file\n\t\t\t},\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Get information about a product firmware version\n\t * @param {Object} options Options for this API call\n\t * @param {Number} options.version Version number of firmware\n\t * @param {String} options.product Firmware for this product ID or slug\n\t * @param {String} options.auth Access token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tgetProductFirmware({ version, product, auth, headers, context }){\n\t\treturn this.get({\n\t\t\turi: `/v1/products/${product}/firmware/${version}`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Update information for a product firmware version\n\t * @param {Object} options Options for this API call\n\t * @param {Number} options.version Version number of new firmware\n\t * @param {String} [options.title] New title\n\t * @param {String} [options.description] New description\n\t * @param {String} options.product Firmware for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tupdateProductFirmware({ version, title, description, product, auth, headers, context }){\n\t\tconst uri = `/v1/products/${product}/firmware/${version}`;\n\t\treturn this.put({ uri, auth, headers, data: { title, description }, context });\n\t}\n\n\t/**\n\t * Download a product firmware binary\n\t * @param {Object} options Options for this API call\n\t * @param {Number} options.version Version number of new firmware\n\t * @param {String} options.product Firmware for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Request} A promise\n\t */\n\tdownloadProductFirmware({ version, product, auth, headers, context }){\n\t\tlet req = this.request({\n\t\t\turi: `/v1/products/${product}/firmware/${version}/binary`,\n\t\t\tmethod: 'get',\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext,\n\t\t\traw: true\n\t\t});\n\n\t\treturn this._provideFileData(req);\n\t}\n\n\t_provideFileData(req){\n\t\tif (this.agent.isForBrowser()){\n\t\t\treq = req.responseType('arraybuffer').then(res => {\n\t\t\t\tres.body = res.xhr.response;\n\t\t\t\treturn res;\n\t\t\t});\n\t\t} else {\n\t\t\treq = req.buffer(true).parse(binaryParser);\n\t\t}\n\t\treturn req.then(res => res.body);\n\t}\n\n\t/**\n\t * Release a product firmware version as the default version\n\t * @param {Object} options Options for this API call\n\t * @param {Number} options.version Version number of new firmware\n\t * @param {String} options.product Firmware for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\treleaseProductFirmware({ version, product, auth, headers, context }){\n\t\tconst uri = `/v1/products/${product}/firmware/release`;\n\t\treturn this.put({ uri, auth, headers, data: { version }, context });\n\t}\n\n\t/**\n\t * List product team members\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.product Team for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tlistTeamMembers({ product, auth, headers, context }){\n\t\treturn this.get({\n\t\t\turi: `/v1/products/${product}/team`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Invite Particle user to a product team\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.username Username for the Particle account\n\t * @param {String} options.product Team for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tinviteTeamMember({ username, product, auth, headers, context }){\n\t\treturn this.post({\n\t\t\turi: `/v1/products/${product}/team`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tdata: { username },\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Remove Particle user to a product team\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.username Username for the Particle account\n\t * @param {String} options.product Team for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tremoveTeamMember({ username, product, auth, headers, context }){\n\t\treturn this.delete({\n\t\t\turi: `/v1/products/${product}/team/${username}`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Fetch details about a serial number\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.serialNumber The serial number printed on the barcode of the device packaging\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tlookupSerialNumber({ serialNumber, auth, headers, context }){\n\t\treturn this.get({\n\t\t\turi: `/v1/serial_numbers/${serialNumber}`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Create a mesh network\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.name Network name\n\t * @param {String} options.deviceId Gateway device ID\n\t * @param {String} [options.iccid] ICCID of the active SIM card (only for cellular gateway devices)\n\t * @param {String} options.auth Access token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise<Object>} A promise\n\t */\n\tcreateMeshNetwork({ name, deviceId, iccid, auth, headers, context }){\n\t\treturn this.post({\n\t\t\turi: '/v1/networks',\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tdata: { name, device_id: deviceId, iccid },\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Remove a mesh network.\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.networkId Network ID or name\n\t * @param {String} options.auth Access token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise<Object>} A promise\n\t */\n\tremoveMeshNetwork({ networkId, auth, headers, context }){\n\t\treturn this.delete({ uri: `/v1/networks/${networkId}`, auth, headers, context });\n\t}\n\n\t/**\n\t * List all mesh networks\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.auth Access token\n\t * @param {Number} [options.page] Current page of results\n\t * @param {Number} [options.perPage] Records per page\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise<Object>} A promise\n\t */\n\tlistMeshNetworks({ page, perPage, auth, headers, context }){\n\t\tconst query = page ? { page, per_page: perPage } : undefined;\n\t\treturn this.get({ uri: '/v1/networks', auth, headers, query, context });\n\t}\n\n\t/**\n\t * Get information about a mesh network.\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.networkId Network ID or name\n\t * @param {String} options.auth Access token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise<Object>} A promise\n\t */\n\tgetMeshNetwork({ networkId, auth, headers, context }){\n\t\treturn this.get({ uri: `/v1/networks/${networkId}`, auth, headers, context });\n\t}\n\n\t/**\n\t * Modify a mesh network.\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.networkId Network ID or name\n\t * @param {String} options.action 'add-device', 'remove-device', 'gateway-enable' or 'gateway-disable'\n\t * @param {String} options.deviceId Device ID\n\t * @param {String} options.auth Access token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise<Object>} A promise\n\t */\n\tupdateMeshNetwork({ networkId, action, deviceId, auth, headers, context }){\n\t\treturn this.put({\n\t\t\turi: `/v1/networks/${networkId}`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tdata: { action, device_id: deviceId },\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Add a device to a mesh network.\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.networkId Network ID or name\n\t * @param {String} options.deviceId Device ID\n\t * @param {String} options.auth Access token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise<Object>} A promise\n\t */\n\taddMeshNetworkDevice({ networkId, deviceId, auth, headers, context }){\n\t\treturn this.updateMeshNetwork({\n\t\t\taction: 'add-device',\n\t\t\tnetworkId,\n\t\t\tdeviceId,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Remove a device from a mesh network.\n\t * @param {Object} options Options for this API call\n\t * @param {String} [options.networkId] Network ID or name\n\t * @param {String} options.deviceId Device ID\n\t * @param {String} options.auth Access token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise<Object>} A promise\n\t */\n\tremoveMeshNetworkDevice({ networkId, deviceId, auth, headers, context }){\n\t\tif (!networkId){\n\t\t\treturn this.delete({\n\t\t\t\turi: `/v1/devices/${deviceId}/network`,\n\t\t\t\tauth,\n\t\t\t\theaders, context\n\t\t\t});\n\t\t}\n\t\treturn this.updateMeshNetwork({\n\t\t\taction: 'remove-device',\n\t\t\tnetworkId,\n\t\t\tdeviceId,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * List all devices of a mesh network.\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.networkId Network ID or name\n\t * @param {String} options.auth Access token\n\t * @param {Number} [options.role] Device role: 'gateway' or 'node'\n\t * @param {Number} [options.page] Current page of results\n\t * @param {Number} [options.perPage] Records per page\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise<Object>} A promise\n\t */\n\tlistMeshNetworkDevices({ networkId, role, page, perPage, auth, headers, context }){\n\t\tconst query = (role || page) ? { role, page, per_page: perPage } : undefined;\n\t\treturn this.get({\n\t\t\turi: `/v1/networks/${networkId}/devices`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tquery,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Get product configuration\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.product Config for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tgetProductConfiguration({ auth, product, headers, context }){\n\t\treturn this.get({\n\t\t\turi: `/v1/products/${product}/config`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Get product configuration schema\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.product Config for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tgetProductConfigurationSchema({ auth, product, headers = {}, context }){\n\t\theaders.accept = 'application/schema+json';\n\t\treturn this.get({\n\t\t\turi: `/v1/products/${product}/config`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Get product device's configuration\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.product Config for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {String} options.deviceId Device ID to access\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tgetProductDeviceConfiguration({ auth, product, deviceId, headers, context }){\n\t\treturn this.get({\n\t\t\turi: `/v1/products/${product}/config/${deviceId}`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Get product device's configuration schema\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.product Config for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {String} options.deviceId Device ID to access\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tgetProductDeviceConfigurationSchema({ auth, product, deviceId, headers, context }){\n\t\theaders.accept = 'application/schema+json';\n\t\treturn this.get({\n\t\t\turi: `/v1/products/${product}/config/${deviceId}`,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Set product configuration\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.product Config for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} opitons.config Product configuration to update\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tsetProductConfiguration({ auth, product, config, headers, context }){\n\t\treturn this.put({\n\t\t\turi: `/v1/products/${product}/config`,\n\t\t\tauth,\n\t\t\tdata: config,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Set product configuration for a specific device within the product\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.product Config for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {Object} opitons.config Product configuration to update\n\t * @param {String} options.deviceId Device ID to access\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tsetProductDeviceConfiguration({ auth, product, deviceId, config, headers, context }){\n\t\treturn this.put({\n\t\t\turi: `/v1/products/${product}/config/${deviceId}`,\n\t\t\tdata: config,\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Query location for devices within a product\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.product Locations for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {String} options.dateRange Start and end date in ISO8601 format, separated by comma, to query\n\t * @param {String} options.rectBl Bottom left of the rectangular bounding box to query. Latitude and longitude separated by comma\n\t * @param {String} options.rectTr Top right of the rectangular bounding box to query. Latitude and longitude separated by comma\n\t * @param {String} options.deviceId Device ID prefix to include in the query\n\t * @param {String} options.deviceName Device name prefix to include in the query\n\t * @param {String} options.groups Array of group names to include in the query\n\t * @param {String} options.page Page of results to display. Defaults to 1\n\t * @param {String} options.perPage Number of results per page. Defaults to 20. Maximum of 100\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tgetProductLocations({ auth, product, dateRange, rectBl, rectTr, deviceId, deviceName, groups, page, perPage, headers, context }){\n\t\treturn this.get({\n\t\t\turi: `/v1/products/${product}/locations`,\n\t\t\tquery: {\n\t\t\t\tdate_range: dateRange,\n\t\t\t\trect_bl: rectBl,\n\t\t\t\trect_tr: rectTr,\n\t\t\t\tdevice_id: deviceId,\n\t\t\t\tdevice_name: deviceName,\n\t\t\t\tgroups,\n\t\t\t\tpage,\n\t\t\t\tper_page: perPage\n\t\t\t},\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * Query location for one device within a product\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.product Locations for this product ID or slug\n\t * @param {String} options.auth Access Token\n\t * @param {String} options.dateRange Start and end date in ISO8601 format, separated by comma, to query\n\t * @param {String} options.rectBl Bottom left of the rectangular bounding box to query. Latitude and longitude separated by comma\n\t * @param {String} options.rectTr Top right of the rectangular bounding box to query. Latitude and longitude separated by comma\n\t * @param {String} options.deviceId Device ID to query\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @param {Object} [options.headers] Key/Value pairs like `{ 'X-FOO': 'foo', X-BAR: 'bar' }` to send as headers.\n\t * @param {Object} [options.context] Request context\n\t * @returns {Promise} A promise\n\t */\n\tgetProductDeviceLocations({ auth, product, dateRange, rectBl, rectTr, deviceId, headers, context }){\n\t\treturn this.get({\n\t\t\turi: `/v1/products/${product}/locations/${deviceId}`,\n\t\t\tquery: {\n\t\t\t\tdate_range: dateRange,\n\t\t\t\trect_bl: rectBl,\n\t\t\t\trect_tr: rectTr\n\t\t\t},\n\t\t\tauth,\n\t\t\theaders,\n\t\t\tcontext\n\t\t});\n\t}\n\n\t/**\n\t * API URI to access a device\n\t * @param {Object} options Options for this API call\n\t * @param {String} options.deviceId Device ID to access\n\t * @param {String} [options.product] Device only in this product ID or slug\n\t * @private\n\t * @returns {string} URI\n\t */\n\tdeviceUri({ deviceId, product }){\n\t\treturn product ? `/v1/products/${product}/devices/${deviceId}` : `/v1/devices/${deviceId}`;\n\t}\n\n\tget({ uri, auth, headers, query, context }){\n\t\tcontext = this._buildContext(context);\n\t\treturn this.agent.get({ uri, auth, headers, query, context });\n\t}\n\n\thead({ uri, auth, headers, query, context }){\n\t\tcontext = this._buildContext(context);\n\t\treturn this.agent.head({ uri, auth, headers, query, context });\n\t}\n\n\tpost({ uri, auth, headers, data, context }){\n\t\tcontext = this._buildContext(context);\n\t\treturn this.agent.post({ uri, auth, headers, data, context });\n\t}\n\n\tput({ uri, auth, headers, data, context }){\n\t\tcontext = this._buildContext(context);\n\t\treturn this.agent.put({ uri, auth, headers, data, context });\n\t}\n\n\tdelete({ uri, auth, headers, data, context }){\n\t\tcontext = this._buildContext(context);\n\t\treturn this.agent.delete({ uri, auth, headers, data, context });\n\t}\n\n\trequest(args){\n\t\targs.context = this._buildContext(args.context);\n\t\treturn this.agent.request(args);\n\t}\n\n\tclient(options = {}){\n\t\treturn new Client(Object.assign({ api: this }, options));\n\t}\n}\n\n// Aliases for backwards compatibility\nParticle.prototype.removeAccessToken = Particle.prototype.deleteAccessToken;\n\nexport default Particle;\n"]}