@digipair/skill-pushbullet 0.113.1 → 0.114.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.
- package/README.md +7 -0
- package/dist/index.cjs.js +39 -0
- package/dist/index.esm.js +37 -0
- package/{libs/skill-pushbullet → dist}/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -0
- package/{libs/skill-pushbullet → dist}/src/lib/skill-pushbullet.d.ts +1 -0
- package/dist/src/lib/skill-pushbullet.d.ts.map +1 -0
- package/package.json +26 -5
- package/index.cjs.js +0 -55
- package/index.d.ts +0 -1
- package/index.esm.js +0 -51
- /package/{index.cjs.d.ts → dist/index.d.ts} +0 -0
- /package/{schema.fr.json → dist/schema.fr.json} +0 -0
- /package/{schema.json → dist/schema.json} +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-unused-vars */ let PushbulletService = class PushbulletService {
|
|
4
|
+
constructor(context, params){
|
|
5
|
+
this.PUSHBULLET_ACCESS_TOKEN = context.privates.PUSHBULLET_ACCESS_TOKEN ?? params?.PUSHBULLET_ACCESS_TOKEN ?? process.env['PUSHBULLET_ACCESS_TOKEN'];
|
|
6
|
+
this.TARGET_DEVICE_ID = context.privates.PUSHBULLET_TARGET_DEVICE_ID ?? params?.PUSHBULLET_TARGET_DEVICE_ID ?? process.env['PUSHBULLET_TARGET_DEVICE_ID'];
|
|
7
|
+
this.API_ENDPOINT = context.privates.PUSHBULLET_API_ENDPOINT ?? params?.PUSHBULLET_API_ENDPOINT ?? process.env['PUSHBULLET_API_ENDPOINT'] ?? 'https://api.pushbullet.com/v2';
|
|
8
|
+
}
|
|
9
|
+
async call(url, method, data, headers, signal) {
|
|
10
|
+
const response = await fetch(`${this.API_ENDPOINT}${url}`, {
|
|
11
|
+
signal,
|
|
12
|
+
method,
|
|
13
|
+
headers: {
|
|
14
|
+
'Access-Token': this.PUSHBULLET_ACCESS_TOKEN,
|
|
15
|
+
...headers
|
|
16
|
+
},
|
|
17
|
+
body: data
|
|
18
|
+
});
|
|
19
|
+
if (!response.ok) throw new Error('[SKILL-PUSHBULLET] REQUEST FAILED: ' + response.status);
|
|
20
|
+
return await response.json();
|
|
21
|
+
}
|
|
22
|
+
async sendSms(params, _pinsSettingsList, context) {
|
|
23
|
+
const { message, phoneNumber } = params;
|
|
24
|
+
return await this.call('/texts', 'POST', JSON.stringify({
|
|
25
|
+
data: {
|
|
26
|
+
addresses: [
|
|
27
|
+
phoneNumber
|
|
28
|
+
],
|
|
29
|
+
message,
|
|
30
|
+
target_device_iden: this.TARGET_DEVICE_ID
|
|
31
|
+
}
|
|
32
|
+
}), {
|
|
33
|
+
'Content-Type': 'application/json'
|
|
34
|
+
}, context.protected?.signal);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
const sendSms = (params, pinsSettingsList, context)=>new PushbulletService(context, params).sendSms(params, pinsSettingsList, context);
|
|
38
|
+
|
|
39
|
+
exports.sendSms = sendSms;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-unused-vars */ let PushbulletService = class PushbulletService {
|
|
2
|
+
constructor(context, params){
|
|
3
|
+
this.PUSHBULLET_ACCESS_TOKEN = context.privates.PUSHBULLET_ACCESS_TOKEN ?? params?.PUSHBULLET_ACCESS_TOKEN ?? process.env['PUSHBULLET_ACCESS_TOKEN'];
|
|
4
|
+
this.TARGET_DEVICE_ID = context.privates.PUSHBULLET_TARGET_DEVICE_ID ?? params?.PUSHBULLET_TARGET_DEVICE_ID ?? process.env['PUSHBULLET_TARGET_DEVICE_ID'];
|
|
5
|
+
this.API_ENDPOINT = context.privates.PUSHBULLET_API_ENDPOINT ?? params?.PUSHBULLET_API_ENDPOINT ?? process.env['PUSHBULLET_API_ENDPOINT'] ?? 'https://api.pushbullet.com/v2';
|
|
6
|
+
}
|
|
7
|
+
async call(url, method, data, headers, signal) {
|
|
8
|
+
const response = await fetch(`${this.API_ENDPOINT}${url}`, {
|
|
9
|
+
signal,
|
|
10
|
+
method,
|
|
11
|
+
headers: {
|
|
12
|
+
'Access-Token': this.PUSHBULLET_ACCESS_TOKEN,
|
|
13
|
+
...headers
|
|
14
|
+
},
|
|
15
|
+
body: data
|
|
16
|
+
});
|
|
17
|
+
if (!response.ok) throw new Error('[SKILL-PUSHBULLET] REQUEST FAILED: ' + response.status);
|
|
18
|
+
return await response.json();
|
|
19
|
+
}
|
|
20
|
+
async sendSms(params, _pinsSettingsList, context) {
|
|
21
|
+
const { message, phoneNumber } = params;
|
|
22
|
+
return await this.call('/texts', 'POST', JSON.stringify({
|
|
23
|
+
data: {
|
|
24
|
+
addresses: [
|
|
25
|
+
phoneNumber
|
|
26
|
+
],
|
|
27
|
+
message,
|
|
28
|
+
target_device_iden: this.TARGET_DEVICE_ID
|
|
29
|
+
}
|
|
30
|
+
}), {
|
|
31
|
+
'Content-Type': 'application/json'
|
|
32
|
+
}, context.protected?.signal);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const sendSms = (params, pinsSettingsList, context)=>new PushbulletService(context, params).sendSms(params, pinsSettingsList, context);
|
|
36
|
+
|
|
37
|
+
export { sendSms };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-pushbullet.d.ts","sourceRoot":"","sources":["../../../src/lib/skill-pushbullet.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AA0DhD,eAAO,MAAM,OAAO,GAAI,QAAQ,GAAG,EAAE,kBAAkB,YAAY,EAAE,EAAE,SAAS,GAAG,iBACA,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@digipair/skill-pushbullet",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.114.2",
|
|
4
|
+
"main": "./dist/index.cjs.js",
|
|
5
|
+
"module": "./dist/index.esm.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
4
7
|
"keywords": [
|
|
5
8
|
"digipair",
|
|
6
9
|
"service",
|
|
7
10
|
"tool"
|
|
8
11
|
],
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.esm.js",
|
|
16
|
+
"default": "./dist/index.cjs.js"
|
|
17
|
+
},
|
|
18
|
+
"./index.esm.js": "./dist/index.esm.js",
|
|
19
|
+
"./index.cjs.js": "./dist/index.cjs.js",
|
|
20
|
+
"./package.json": "./package.json",
|
|
21
|
+
"./schema.json": "./dist/schema.json",
|
|
22
|
+
"./schema.fr.json": "./dist/schema.fr.json"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"README.md",
|
|
27
|
+
"package.json"
|
|
28
|
+
],
|
|
29
|
+
"nx": {
|
|
30
|
+
"name": "skill-pushbullet"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {}
|
|
33
|
+
}
|
package/index.cjs.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
function _extends() {
|
|
6
|
-
_extends = Object.assign || function assign(target) {
|
|
7
|
-
for(var i = 1; i < arguments.length; i++){
|
|
8
|
-
var source = arguments[i];
|
|
9
|
-
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
10
|
-
}
|
|
11
|
-
return target;
|
|
12
|
-
};
|
|
13
|
-
return _extends.apply(this, arguments);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
let PushbulletService = class PushbulletService {
|
|
17
|
-
async call(url, method, data, headers, signal) {
|
|
18
|
-
const response = await fetch(`${this.API_ENDPOINT}${url}`, {
|
|
19
|
-
signal,
|
|
20
|
-
method,
|
|
21
|
-
headers: _extends({
|
|
22
|
-
'Access-Token': this.PUSHBULLET_ACCESS_TOKEN
|
|
23
|
-
}, headers),
|
|
24
|
-
body: data
|
|
25
|
-
});
|
|
26
|
-
if (!response.ok) throw new Error('[SKILL-PUSHBULLET] REQUEST FAILED: ' + response.status);
|
|
27
|
-
return await response.json();
|
|
28
|
-
}
|
|
29
|
-
async sendSms(params, _pinsSettingsList, context) {
|
|
30
|
-
var _context_protected;
|
|
31
|
-
const { message, phoneNumber } = params;
|
|
32
|
-
return await this.call('/texts', 'POST', JSON.stringify({
|
|
33
|
-
data: {
|
|
34
|
-
addresses: [
|
|
35
|
-
phoneNumber
|
|
36
|
-
],
|
|
37
|
-
message,
|
|
38
|
-
target_device_iden: this.TARGET_DEVICE_ID
|
|
39
|
-
}
|
|
40
|
-
}), {
|
|
41
|
-
'Content-Type': 'application/json'
|
|
42
|
-
}, (_context_protected = context.protected) == null ? void 0 : _context_protected.signal);
|
|
43
|
-
}
|
|
44
|
-
constructor(context, params){
|
|
45
|
-
var _context_privates_PUSHBULLET_ACCESS_TOKEN, _ref;
|
|
46
|
-
this.PUSHBULLET_ACCESS_TOKEN = (_ref = (_context_privates_PUSHBULLET_ACCESS_TOKEN = context.privates.PUSHBULLET_ACCESS_TOKEN) != null ? _context_privates_PUSHBULLET_ACCESS_TOKEN : params == null ? void 0 : params.PUSHBULLET_ACCESS_TOKEN) != null ? _ref : process.env['PUSHBULLET_ACCESS_TOKEN'];
|
|
47
|
-
var _context_privates_PUSHBULLET_TARGET_DEVICE_ID, _ref1;
|
|
48
|
-
this.TARGET_DEVICE_ID = (_ref1 = (_context_privates_PUSHBULLET_TARGET_DEVICE_ID = context.privates.PUSHBULLET_TARGET_DEVICE_ID) != null ? _context_privates_PUSHBULLET_TARGET_DEVICE_ID : params == null ? void 0 : params.PUSHBULLET_TARGET_DEVICE_ID) != null ? _ref1 : process.env['PUSHBULLET_TARGET_DEVICE_ID'];
|
|
49
|
-
var _context_privates_PUSHBULLET_API_ENDPOINT, _ref2, _ref3;
|
|
50
|
-
this.API_ENDPOINT = (_ref3 = (_ref2 = (_context_privates_PUSHBULLET_API_ENDPOINT = context.privates.PUSHBULLET_API_ENDPOINT) != null ? _context_privates_PUSHBULLET_API_ENDPOINT : params == null ? void 0 : params.PUSHBULLET_API_ENDPOINT) != null ? _ref2 : process.env['PUSHBULLET_API_ENDPOINT']) != null ? _ref3 : 'https://api.pushbullet.com/v2';
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
const sendSms = (params, pinsSettingsList, context)=>new PushbulletService(context, params).sendSms(params, pinsSettingsList, context);
|
|
54
|
-
|
|
55
|
-
exports.sendSms = sendSms;
|
package/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './libs/skill-nuki/src/index';
|
package/index.esm.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
function _extends() {
|
|
2
|
-
_extends = Object.assign || function assign(target) {
|
|
3
|
-
for(var i = 1; i < arguments.length; i++){
|
|
4
|
-
var source = arguments[i];
|
|
5
|
-
for(var key in source)if (Object.prototype.hasOwnProperty.call(source, key)) target[key] = source[key];
|
|
6
|
-
}
|
|
7
|
-
return target;
|
|
8
|
-
};
|
|
9
|
-
return _extends.apply(this, arguments);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
let PushbulletService = class PushbulletService {
|
|
13
|
-
async call(url, method, data, headers, signal) {
|
|
14
|
-
const response = await fetch(`${this.API_ENDPOINT}${url}`, {
|
|
15
|
-
signal,
|
|
16
|
-
method,
|
|
17
|
-
headers: _extends({
|
|
18
|
-
'Access-Token': this.PUSHBULLET_ACCESS_TOKEN
|
|
19
|
-
}, headers),
|
|
20
|
-
body: data
|
|
21
|
-
});
|
|
22
|
-
if (!response.ok) throw new Error('[SKILL-PUSHBULLET] REQUEST FAILED: ' + response.status);
|
|
23
|
-
return await response.json();
|
|
24
|
-
}
|
|
25
|
-
async sendSms(params, _pinsSettingsList, context) {
|
|
26
|
-
var _context_protected;
|
|
27
|
-
const { message, phoneNumber } = params;
|
|
28
|
-
return await this.call('/texts', 'POST', JSON.stringify({
|
|
29
|
-
data: {
|
|
30
|
-
addresses: [
|
|
31
|
-
phoneNumber
|
|
32
|
-
],
|
|
33
|
-
message,
|
|
34
|
-
target_device_iden: this.TARGET_DEVICE_ID
|
|
35
|
-
}
|
|
36
|
-
}), {
|
|
37
|
-
'Content-Type': 'application/json'
|
|
38
|
-
}, (_context_protected = context.protected) == null ? void 0 : _context_protected.signal);
|
|
39
|
-
}
|
|
40
|
-
constructor(context, params){
|
|
41
|
-
var _context_privates_PUSHBULLET_ACCESS_TOKEN, _ref;
|
|
42
|
-
this.PUSHBULLET_ACCESS_TOKEN = (_ref = (_context_privates_PUSHBULLET_ACCESS_TOKEN = context.privates.PUSHBULLET_ACCESS_TOKEN) != null ? _context_privates_PUSHBULLET_ACCESS_TOKEN : params == null ? void 0 : params.PUSHBULLET_ACCESS_TOKEN) != null ? _ref : process.env['PUSHBULLET_ACCESS_TOKEN'];
|
|
43
|
-
var _context_privates_PUSHBULLET_TARGET_DEVICE_ID, _ref1;
|
|
44
|
-
this.TARGET_DEVICE_ID = (_ref1 = (_context_privates_PUSHBULLET_TARGET_DEVICE_ID = context.privates.PUSHBULLET_TARGET_DEVICE_ID) != null ? _context_privates_PUSHBULLET_TARGET_DEVICE_ID : params == null ? void 0 : params.PUSHBULLET_TARGET_DEVICE_ID) != null ? _ref1 : process.env['PUSHBULLET_TARGET_DEVICE_ID'];
|
|
45
|
-
var _context_privates_PUSHBULLET_API_ENDPOINT, _ref2, _ref3;
|
|
46
|
-
this.API_ENDPOINT = (_ref3 = (_ref2 = (_context_privates_PUSHBULLET_API_ENDPOINT = context.privates.PUSHBULLET_API_ENDPOINT) != null ? _context_privates_PUSHBULLET_API_ENDPOINT : params == null ? void 0 : params.PUSHBULLET_API_ENDPOINT) != null ? _ref2 : process.env['PUSHBULLET_API_ENDPOINT']) != null ? _ref3 : 'https://api.pushbullet.com/v2';
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
const sendSms = (params, pinsSettingsList, context)=>new PushbulletService(context, params).sendSms(params, pinsSettingsList, context);
|
|
50
|
-
|
|
51
|
-
export { sendSms };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|