@digipair/skill-nuki 0.48.3 → 0.49.1
Sign up to get free protection for your applications and to get access to all the features.
- package/index.cjs.js +8 -5
- package/index.esm.js +8 -5
- package/package.json +1 -1
package/index.cjs.js
CHANGED
@@ -14,8 +14,9 @@ function _extends() {
|
|
14
14
|
}
|
15
15
|
|
16
16
|
let NukiService = class NukiService {
|
17
|
-
async call(url, method, data
|
17
|
+
async call(url, method, data, headers, signal) {
|
18
18
|
const response = await fetch(`${this.API_ENDPOINT}${url}`, {
|
19
|
+
signal,
|
19
20
|
method,
|
20
21
|
headers: _extends({
|
21
22
|
Authorization: 'Bearer ' + this.NUKI_API_KEY
|
@@ -25,13 +26,15 @@ let NukiService = class NukiService {
|
|
25
26
|
if (!response.ok) throw new Error('[SKILL-NUKI] REQUEST FAILED: ' + response.status);
|
26
27
|
return await response.json();
|
27
28
|
}
|
28
|
-
async unlock(params, _pinsSettingsList,
|
29
|
+
async unlock(params, _pinsSettingsList, context) {
|
30
|
+
var _context_protected;
|
29
31
|
const { id } = params;
|
30
|
-
return await this.call(`/${id}/action/unlock`, 'POST');
|
32
|
+
return await this.call(`/${id}/action/unlock`, 'POST', null, {}, (_context_protected = context.protected) == null ? void 0 : _context_protected.signal);
|
31
33
|
}
|
32
|
-
async lock(params, _pinsSettingsList,
|
34
|
+
async lock(params, _pinsSettingsList, context) {
|
35
|
+
var _context_protected;
|
33
36
|
const { id } = params;
|
34
|
-
return await this.call(`/${id}/action/lock`, 'POST');
|
37
|
+
return await this.call(`/${id}/action/lock`, 'POST', null, {}, (_context_protected = context.protected) == null ? void 0 : _context_protected.signal);
|
35
38
|
}
|
36
39
|
constructor(context, params){
|
37
40
|
var _context_privates_NUKI_API_KEY, _ref;
|
package/index.esm.js
CHANGED
@@ -10,8 +10,9 @@ function _extends() {
|
|
10
10
|
}
|
11
11
|
|
12
12
|
let NukiService = class NukiService {
|
13
|
-
async call(url, method, data
|
13
|
+
async call(url, method, data, headers, signal) {
|
14
14
|
const response = await fetch(`${this.API_ENDPOINT}${url}`, {
|
15
|
+
signal,
|
15
16
|
method,
|
16
17
|
headers: _extends({
|
17
18
|
Authorization: 'Bearer ' + this.NUKI_API_KEY
|
@@ -21,13 +22,15 @@ let NukiService = class NukiService {
|
|
21
22
|
if (!response.ok) throw new Error('[SKILL-NUKI] REQUEST FAILED: ' + response.status);
|
22
23
|
return await response.json();
|
23
24
|
}
|
24
|
-
async unlock(params, _pinsSettingsList,
|
25
|
+
async unlock(params, _pinsSettingsList, context) {
|
26
|
+
var _context_protected;
|
25
27
|
const { id } = params;
|
26
|
-
return await this.call(`/${id}/action/unlock`, 'POST');
|
28
|
+
return await this.call(`/${id}/action/unlock`, 'POST', null, {}, (_context_protected = context.protected) == null ? void 0 : _context_protected.signal);
|
27
29
|
}
|
28
|
-
async lock(params, _pinsSettingsList,
|
30
|
+
async lock(params, _pinsSettingsList, context) {
|
31
|
+
var _context_protected;
|
29
32
|
const { id } = params;
|
30
|
-
return await this.call(`/${id}/action/lock`, 'POST');
|
33
|
+
return await this.call(`/${id}/action/lock`, 'POST', null, {}, (_context_protected = context.protected) == null ? void 0 : _context_protected.signal);
|
31
34
|
}
|
32
35
|
constructor(context, params){
|
33
36
|
var _context_privates_NUKI_API_KEY, _ref;
|