@mqarty/plugin-dev-phone 1.0.0-beta.6
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 +56 -0
- package/dist/commands/dev-phone.js +696 -0
- package/dist/public/index.html +1 -0
- package/dist/public/main.bundle.cdb730b5c05083a52467.js +3 -0
- package/dist/public/main.bundle.cdb730b5c05083a52467.js.LICENSE.txt +1 -0
- package/dist/public/main.bundle.cdb730b5c05083a52467.js.map +1 -0
- package/dist/public/oss-licenses.json +1200 -0
- package/dist/public/runtime.bundle.538e393eab2bfcac3383.js +2 -0
- package/dist/public/runtime.bundle.538e393eab2bfcac3383.js.map +1 -0
- package/dist/public/vendor.bundle.e29e611deedfc0e1b88e.js +397 -0
- package/dist/public/vendor.bundle.e29e611deedfc0e1b88e.js.LICENSE.txt +506 -0
- package/dist/public/vendor.bundle.e29e611deedfc0e1b88e.js.map +1 -0
- package/dist/serverless/functions/incoming-call-handler.js +8 -0
- package/dist/serverless/functions/incoming-message-handler.js +41 -0
- package/dist/serverless/functions/outbound-call-handler.js +17 -0
- package/dist/serverless/functions/sync-call-history.js +62 -0
- package/dist/utils/create-serverless-util.js +86 -0
- package/dist/utils/helpers.js +28 -0
- package/dist/utils/phone-number-utils.js +66 -0
- package/oclif.manifest.json +229 -0
- package/package.json +79 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Incoming call from PTSN to the dev phone browser
|
|
3
|
+
exports.handler = function (context, event, callback) {
|
|
4
|
+
let twiml = new Twilio.twiml.VoiceResponse();
|
|
5
|
+
const dial = twiml.dial({ answerOnBridge: true });
|
|
6
|
+
dial.client(context.DEV_PHONE_NAME);
|
|
7
|
+
return callback(null, twiml);
|
|
8
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Incoming Message Handler
|
|
3
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
5
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
6
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
7
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
8
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
9
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
exports.handler = function (context, event, callback) {
|
|
13
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
14
|
+
// receive an SMS and put into a conversation
|
|
15
|
+
const client = context.getTwilioClient({
|
|
16
|
+
userAgentExtension: [
|
|
17
|
+
`@mqarty/plugin-dev-phone/${context.DEV_PHONE_VERSION}`,
|
|
18
|
+
`@mqarty/plugin-dev-phone/serverless`,
|
|
19
|
+
'serverless-functions'
|
|
20
|
+
]
|
|
21
|
+
});
|
|
22
|
+
yield client.conversations
|
|
23
|
+
.services(context.CONVERSATION_SERVICE_SID)
|
|
24
|
+
.conversations(context.CONVERSATION_SID)
|
|
25
|
+
.messages
|
|
26
|
+
.create({
|
|
27
|
+
author: event.From,
|
|
28
|
+
body: event.Body,
|
|
29
|
+
attributes: {
|
|
30
|
+
fromCity: event.FromCity,
|
|
31
|
+
fromCountry: event.FromCountry,
|
|
32
|
+
messageSid: event.MessageSid,
|
|
33
|
+
numMedia: event.NumMedia
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
.then(message => console.log(message));
|
|
37
|
+
// Answer with an empty response
|
|
38
|
+
let twiml = new Twilio.twiml.MessagingResponse();
|
|
39
|
+
return callback(null, twiml);
|
|
40
|
+
});
|
|
41
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Create an outbound PTSN voip call
|
|
3
|
+
// params: from, to, identity
|
|
4
|
+
exports.handler = function (context, event, callback) {
|
|
5
|
+
let twiml = new Twilio.twiml.VoiceResponse();
|
|
6
|
+
if (!event.from || !event.to) {
|
|
7
|
+
return callback('You need to provide From and To params', null);
|
|
8
|
+
}
|
|
9
|
+
const dial = twiml.dial({
|
|
10
|
+
callerId: event.from,
|
|
11
|
+
});
|
|
12
|
+
dial.number({
|
|
13
|
+
statusCallback: `https://${context.DOMAIN_NAME}/sync-call-history`,
|
|
14
|
+
statusCallbackEvent: 'initiated ringing answered completed'
|
|
15
|
+
}, event.to);
|
|
16
|
+
return callback(null, twiml);
|
|
17
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
function updateCallStatusFromEvent(context, callSid, data) {
|
|
12
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
13
|
+
const client = context.getTwilioClient({
|
|
14
|
+
userAgentExtension: [
|
|
15
|
+
`@mqarty/plugin-dev-phone/${context.DEV_PHONE_VERSION}`,
|
|
16
|
+
`@mqarty/plugin-dev-phone/serverless`,
|
|
17
|
+
'serverless-functions'
|
|
18
|
+
]
|
|
19
|
+
});
|
|
20
|
+
try {
|
|
21
|
+
return yield client.sync
|
|
22
|
+
.services(context.SYNC_SERVICE_SID)
|
|
23
|
+
.syncMaps(context.CALL_LOG_MAP_NAME)
|
|
24
|
+
.syncMapItems(callSid)
|
|
25
|
+
.update({
|
|
26
|
+
data,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
catch (err) {
|
|
30
|
+
return yield client.sync
|
|
31
|
+
.services(context.SYNC_SERVICE_SID)
|
|
32
|
+
.syncMaps(context.CALL_LOG_MAP_NAME)
|
|
33
|
+
.syncMapItems
|
|
34
|
+
.create({
|
|
35
|
+
key: callSid,
|
|
36
|
+
data,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
exports.handler = function (context, event, callback) {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
console.log(`Call: ${event.CallSid} status: ${event.CallStatus}`);
|
|
44
|
+
try {
|
|
45
|
+
const data = {
|
|
46
|
+
Sid: event.CallSid,
|
|
47
|
+
Status: event.CallStatus,
|
|
48
|
+
Duration: event.CallDuration,
|
|
49
|
+
Direction: event.CallDirection,
|
|
50
|
+
From: event.From,
|
|
51
|
+
To: event.To,
|
|
52
|
+
Timestamp: event.Timestamp,
|
|
53
|
+
};
|
|
54
|
+
const item = yield updateCallStatusFromEvent(context, event.CallSid, data);
|
|
55
|
+
}
|
|
56
|
+
catch (err) {
|
|
57
|
+
console.error(err);
|
|
58
|
+
return callback(err);
|
|
59
|
+
}
|
|
60
|
+
return callback(null, {});
|
|
61
|
+
});
|
|
62
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.deployServerless = exports.constants = void 0;
|
|
16
|
+
const serverless_api_1 = require("@twilio-labs/serverless-api");
|
|
17
|
+
const fs_1 = __importDefault(require("fs"));
|
|
18
|
+
const path_1 = __importDefault(require("path"));
|
|
19
|
+
exports.constants = {
|
|
20
|
+
SYNC_CALL_HISTORY: 'sync-call-history',
|
|
21
|
+
INCOMING_CALL_HANDLER: 'incoming-call-handler',
|
|
22
|
+
OUTBOUND_CALL_HANDLER: 'outbound-call-handler',
|
|
23
|
+
INCOMING_MESSAGE_HANDLER: 'incoming-message-handler'
|
|
24
|
+
};
|
|
25
|
+
function deployServerless(context) {
|
|
26
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
const config = {
|
|
28
|
+
username: context.username,
|
|
29
|
+
password: context.password,
|
|
30
|
+
env: context.env,
|
|
31
|
+
pkgJson: {
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"twilio": "^3.71.3"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
serviceName: context.env.DEV_PHONE_NAME,
|
|
37
|
+
overrideExistingService: true,
|
|
38
|
+
functionsEnv: '',
|
|
39
|
+
functions: [
|
|
40
|
+
{
|
|
41
|
+
name: 'Sync Call History',
|
|
42
|
+
path: `/${exports.constants.SYNC_CALL_HISTORY}`,
|
|
43
|
+
content: fs_1.default.readFileSync(path_1.default.join(__dirname, `../serverless/functions/${exports.constants.SYNC_CALL_HISTORY}.js`)),
|
|
44
|
+
access: 'protected',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'Incoming Call Handler',
|
|
48
|
+
path: `/${exports.constants.INCOMING_CALL_HANDLER}`,
|
|
49
|
+
content: fs_1.default.readFileSync(path_1.default.join(__dirname, `../serverless/functions/${exports.constants.INCOMING_CALL_HANDLER}.js`)),
|
|
50
|
+
access: 'protected',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'Incoming Message Handler',
|
|
54
|
+
path: `/${exports.constants.INCOMING_MESSAGE_HANDLER}`,
|
|
55
|
+
content: fs_1.default.readFileSync(path_1.default.join(__dirname, `../serverless/functions/${exports.constants.INCOMING_MESSAGE_HANDLER}.js`)),
|
|
56
|
+
access: 'protected',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'Outbound Call Handler',
|
|
60
|
+
path: `/${exports.constants.OUTBOUND_CALL_HANDLER}`,
|
|
61
|
+
content: fs_1.default.readFileSync(path_1.default.join(__dirname, `../serverless/functions/${exports.constants.OUTBOUND_CALL_HANDLER}.js`)),
|
|
62
|
+
access: 'protected',
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
assets: []
|
|
66
|
+
};
|
|
67
|
+
try {
|
|
68
|
+
const client = new serverless_api_1.TwilioServerlessApiClient(config);
|
|
69
|
+
if (context.onUpdate) {
|
|
70
|
+
const onUpdate = context.onUpdate;
|
|
71
|
+
//@ts-ignore
|
|
72
|
+
client.on('status-update', (evt) => {
|
|
73
|
+
onUpdate(evt);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
//@ts-ignore
|
|
77
|
+
const result = yield client.deployProject(config);
|
|
78
|
+
return result;
|
|
79
|
+
}
|
|
80
|
+
catch (err) {
|
|
81
|
+
console.log(err);
|
|
82
|
+
throw new Error('Issue deploying functions. Try again later');
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
exports.deployServerless = deployServerless;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.getAvailablePort = exports.isValidPort = void 0;
|
|
16
|
+
const get_port_1 = __importDefault(require("get-port"));
|
|
17
|
+
function isValidPort(port) {
|
|
18
|
+
const portRegex = /^((6553[0-5])|(655[0-2][0-9])|(65[0-4][0-9]{2})|(6[0-4][0-9]{3})|([1-5][0-9]{4})|([0-5]{0,5})|([0-9]{1,4}))$/gi;
|
|
19
|
+
return portRegex.test(port);
|
|
20
|
+
}
|
|
21
|
+
exports.isValidPort = isValidPort;
|
|
22
|
+
function getAvailablePort() {
|
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
const availablePort = yield (0, get_port_1.default)({ port: [1337, 3000, 3001, 8000, 8080] });
|
|
25
|
+
return availablePort;
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
exports.getAvailablePort = getAvailablePort;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.removePhoneWebhooks = exports.updatePhoneWebhooks = exports.isVoiceUrlSet = exports.isSmsUrlSet = void 0;
|
|
13
|
+
function isSmsUrlSet(smsUrl) {
|
|
14
|
+
// consider it "unset" if it is blank, or at the default value
|
|
15
|
+
return smsUrl && smsUrl !== "" && smsUrl !== 'https://demo.twilio.com/welcome/sms/reply';
|
|
16
|
+
}
|
|
17
|
+
exports.isSmsUrlSet = isSmsUrlSet;
|
|
18
|
+
function isVoiceUrlSet(voiceUrl) {
|
|
19
|
+
// consider it "unset" if it is blank, or at the default value
|
|
20
|
+
return voiceUrl && voiceUrl !== "" && voiceUrl !== 'https://demo.twilio.com/welcome/voice/';
|
|
21
|
+
}
|
|
22
|
+
exports.isVoiceUrlSet = isVoiceUrlSet;
|
|
23
|
+
function updatePhoneWebhooks(selectedNumber, incomingPhoneNumbersApi, properties) {
|
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
if (!selectedNumber)
|
|
26
|
+
return;
|
|
27
|
+
console.log(`💻 Updating Voice and SMS webhooks for ${selectedNumber.phoneNumber}...`);
|
|
28
|
+
selectedNumber.voiceUrl = properties.voiceUrl;
|
|
29
|
+
selectedNumber.smsUrl = properties.smsUrl;
|
|
30
|
+
selectedNumber.statusCallback = properties.statusCallback;
|
|
31
|
+
try {
|
|
32
|
+
const updated = yield incomingPhoneNumbersApi(selectedNumber.sid)
|
|
33
|
+
.update({
|
|
34
|
+
voiceUrl: properties.voiceUrl,
|
|
35
|
+
smsUrl: properties.smsUrl,
|
|
36
|
+
statusCallback: properties.statusCallback,
|
|
37
|
+
});
|
|
38
|
+
console.log('✅ Webhooks updated\n');
|
|
39
|
+
return updated;
|
|
40
|
+
}
|
|
41
|
+
catch (err) {
|
|
42
|
+
console.error(err);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
exports.updatePhoneWebhooks = updatePhoneWebhooks;
|
|
47
|
+
function removePhoneWebhooks(activeNumber, incomingPhoneNumbersApi) {
|
|
48
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
+
if (!activeNumber)
|
|
50
|
+
return;
|
|
51
|
+
console.log(`🚮 Removing incoming Voice and SMS webhooks for ${activeNumber.phoneNumber}`);
|
|
52
|
+
try {
|
|
53
|
+
const updated = yield incomingPhoneNumbersApi(activeNumber.sid)
|
|
54
|
+
.update({
|
|
55
|
+
voiceUrl: "",
|
|
56
|
+
smsUrl: "",
|
|
57
|
+
statusCallback: "",
|
|
58
|
+
});
|
|
59
|
+
return updated;
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
console.error(err);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
exports.removePhoneWebhooks = removePhoneWebhooks;
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
{
|
|
2
|
+
"commands": {
|
|
3
|
+
"dev-phone": {
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"args": {},
|
|
6
|
+
"description": "Dev Phone local express server",
|
|
7
|
+
"flags": {
|
|
8
|
+
"cli-log-level": {
|
|
9
|
+
"char": "l",
|
|
10
|
+
"description": "Level of logging messages.",
|
|
11
|
+
"helpLabel": "-l",
|
|
12
|
+
"name": "cli-log-level",
|
|
13
|
+
"default": "info",
|
|
14
|
+
"hasDynamicHelp": false,
|
|
15
|
+
"helpValue": "(debug|info|warn|error|none)",
|
|
16
|
+
"multiple": false,
|
|
17
|
+
"options": [
|
|
18
|
+
"debug",
|
|
19
|
+
"info",
|
|
20
|
+
"warn",
|
|
21
|
+
"error",
|
|
22
|
+
"none"
|
|
23
|
+
],
|
|
24
|
+
"type": "option"
|
|
25
|
+
},
|
|
26
|
+
"cli-output-format": {
|
|
27
|
+
"char": "o",
|
|
28
|
+
"description": "Format of command output.",
|
|
29
|
+
"helpLabel": "-o",
|
|
30
|
+
"name": "cli-output-format",
|
|
31
|
+
"default": "columns",
|
|
32
|
+
"hasDynamicHelp": false,
|
|
33
|
+
"helpValue": "(columns|json|tsv|none)",
|
|
34
|
+
"multiple": false,
|
|
35
|
+
"options": [
|
|
36
|
+
"columns",
|
|
37
|
+
"json",
|
|
38
|
+
"tsv",
|
|
39
|
+
"none"
|
|
40
|
+
],
|
|
41
|
+
"type": "option"
|
|
42
|
+
},
|
|
43
|
+
"silent": {
|
|
44
|
+
"description": "Suppress output and logs. This is a shorthand for \"-l none -o none\".",
|
|
45
|
+
"name": "silent",
|
|
46
|
+
"allowNo": false,
|
|
47
|
+
"type": "boolean"
|
|
48
|
+
},
|
|
49
|
+
"profile": {
|
|
50
|
+
"char": "p",
|
|
51
|
+
"description": "Shorthand identifier for your profile.",
|
|
52
|
+
"name": "profile",
|
|
53
|
+
"hasDynamicHelp": false,
|
|
54
|
+
"multiple": false,
|
|
55
|
+
"type": "option"
|
|
56
|
+
},
|
|
57
|
+
"phone-number": {
|
|
58
|
+
"description": "Optional. Associates the Dev Phone with a phone number. Takes a number from the active profile on the Twilio CLI as the parameter.",
|
|
59
|
+
"name": "phone-number",
|
|
60
|
+
"hasDynamicHelp": false,
|
|
61
|
+
"multiple": false,
|
|
62
|
+
"type": "option"
|
|
63
|
+
},
|
|
64
|
+
"force": {
|
|
65
|
+
"char": "f",
|
|
66
|
+
"dependsOn": [
|
|
67
|
+
"phone-number"
|
|
68
|
+
],
|
|
69
|
+
"description": "Optional. Forces an overwrite of the phone number configuration.",
|
|
70
|
+
"name": "force",
|
|
71
|
+
"allowNo": false,
|
|
72
|
+
"type": "boolean"
|
|
73
|
+
},
|
|
74
|
+
"headless": {
|
|
75
|
+
"description": "Optional. Prevents the UI from automatically opening in the browser.",
|
|
76
|
+
"name": "headless",
|
|
77
|
+
"allowNo": false,
|
|
78
|
+
"type": "boolean"
|
|
79
|
+
},
|
|
80
|
+
"clear": {
|
|
81
|
+
"description": "Optional. Remove all dev-phone resources from your account before starting the dev-phone.",
|
|
82
|
+
"name": "clear",
|
|
83
|
+
"allowNo": false,
|
|
84
|
+
"type": "boolean"
|
|
85
|
+
},
|
|
86
|
+
"port": {
|
|
87
|
+
"description": "Optional. Configures the port of the Dev Phone UI. Takes a valid port as a parameter.",
|
|
88
|
+
"name": "port",
|
|
89
|
+
"hasDynamicHelp": false,
|
|
90
|
+
"multiple": false,
|
|
91
|
+
"type": "option"
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
"hasDynamicHelp": false,
|
|
95
|
+
"hiddenAliases": [],
|
|
96
|
+
"id": "dev-phone",
|
|
97
|
+
"pluginAlias": "@mqarty/plugin-dev-phone",
|
|
98
|
+
"pluginName": "@mqarty/plugin-dev-phone",
|
|
99
|
+
"pluginType": "core",
|
|
100
|
+
"strict": true,
|
|
101
|
+
"parse": true,
|
|
102
|
+
"parserOptions": {},
|
|
103
|
+
"accountSidFlag": {
|
|
104
|
+
"account-sid": {
|
|
105
|
+
"description": "Access resources for the specified account.",
|
|
106
|
+
"input": [],
|
|
107
|
+
"multiple": false,
|
|
108
|
+
"type": "option"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"limitFlags": {
|
|
112
|
+
"limit": {
|
|
113
|
+
"description": "The maximum number of resources to return. Use '--no-limit' to disable.",
|
|
114
|
+
"default": 50,
|
|
115
|
+
"exclusive": [
|
|
116
|
+
"no-limit"
|
|
117
|
+
],
|
|
118
|
+
"input": [],
|
|
119
|
+
"multiple": false,
|
|
120
|
+
"type": "option"
|
|
121
|
+
},
|
|
122
|
+
"no-limit": {
|
|
123
|
+
"default": false,
|
|
124
|
+
"hidden": true,
|
|
125
|
+
"exclusive": [
|
|
126
|
+
"limit"
|
|
127
|
+
],
|
|
128
|
+
"allowNo": false,
|
|
129
|
+
"type": "boolean"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"noHeader": {
|
|
133
|
+
"no-header": {
|
|
134
|
+
"description": "Skip including of headers while listing the data.",
|
|
135
|
+
"allowNo": false,
|
|
136
|
+
"type": "boolean"
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"PropertyFlags": {
|
|
140
|
+
"phone-number": {
|
|
141
|
+
"description": "Optional. Associates the Dev Phone with a phone number. Takes a number from the active profile on the Twilio CLI as the parameter.",
|
|
142
|
+
"input": [],
|
|
143
|
+
"multiple": false,
|
|
144
|
+
"type": "option"
|
|
145
|
+
},
|
|
146
|
+
"force": {
|
|
147
|
+
"char": "f",
|
|
148
|
+
"description": "Optional. Forces an overwrite of the phone number configuration.",
|
|
149
|
+
"dependsOn": [
|
|
150
|
+
"phone-number"
|
|
151
|
+
],
|
|
152
|
+
"allowNo": false,
|
|
153
|
+
"type": "boolean"
|
|
154
|
+
},
|
|
155
|
+
"headless": {
|
|
156
|
+
"description": "Optional. Prevents the UI from automatically opening in the browser.",
|
|
157
|
+
"default": false,
|
|
158
|
+
"allowNo": false,
|
|
159
|
+
"type": "boolean"
|
|
160
|
+
},
|
|
161
|
+
"clear": {
|
|
162
|
+
"description": "Optional. Remove all dev-phone resources from your account before starting the dev-phone.",
|
|
163
|
+
"default": false,
|
|
164
|
+
"allowNo": false,
|
|
165
|
+
"type": "boolean"
|
|
166
|
+
},
|
|
167
|
+
"port": {
|
|
168
|
+
"description": "Optional. Configures the port of the Dev Phone UI. Takes a valid port as a parameter.",
|
|
169
|
+
"input": [],
|
|
170
|
+
"multiple": false,
|
|
171
|
+
"type": "option"
|
|
172
|
+
},
|
|
173
|
+
"cli-log-level": {
|
|
174
|
+
"helpValue": "(debug|info|warn|error|none)",
|
|
175
|
+
"char": "l",
|
|
176
|
+
"helpLabel": "-l",
|
|
177
|
+
"default": "info",
|
|
178
|
+
"options": [
|
|
179
|
+
"debug",
|
|
180
|
+
"info",
|
|
181
|
+
"warn",
|
|
182
|
+
"error",
|
|
183
|
+
"none"
|
|
184
|
+
],
|
|
185
|
+
"description": "Level of logging messages.",
|
|
186
|
+
"input": [],
|
|
187
|
+
"multiple": false,
|
|
188
|
+
"type": "option"
|
|
189
|
+
},
|
|
190
|
+
"cli-output-format": {
|
|
191
|
+
"helpValue": "(columns|json|tsv|none)",
|
|
192
|
+
"char": "o",
|
|
193
|
+
"helpLabel": "-o",
|
|
194
|
+
"default": "columns",
|
|
195
|
+
"options": [
|
|
196
|
+
"columns",
|
|
197
|
+
"json",
|
|
198
|
+
"tsv",
|
|
199
|
+
"none"
|
|
200
|
+
],
|
|
201
|
+
"description": "Format of command output.",
|
|
202
|
+
"input": [],
|
|
203
|
+
"multiple": false,
|
|
204
|
+
"type": "option"
|
|
205
|
+
},
|
|
206
|
+
"silent": {
|
|
207
|
+
"description": "Suppress output and logs. This is a shorthand for \"-l none -o none\".",
|
|
208
|
+
"default": false,
|
|
209
|
+
"allowNo": false,
|
|
210
|
+
"type": "boolean"
|
|
211
|
+
},
|
|
212
|
+
"profile": {
|
|
213
|
+
"char": "p",
|
|
214
|
+
"description": "Shorthand identifier for your profile.",
|
|
215
|
+
"input": [],
|
|
216
|
+
"multiple": false,
|
|
217
|
+
"type": "option"
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
"isESM": false,
|
|
221
|
+
"relativePath": [
|
|
222
|
+
"dist",
|
|
223
|
+
"commands",
|
|
224
|
+
"dev-phone.js"
|
|
225
|
+
]
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
"version": "1.0.0-beta.6"
|
|
229
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mqarty/plugin-dev-phone",
|
|
3
|
+
"description": "Twilio Dev Phone",
|
|
4
|
+
"version": "1.0.0-beta.6",
|
|
5
|
+
"author": "mqarty",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/mqarty/dev-phone/issues"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"@inquirer/confirm": "^5.1.8",
|
|
11
|
+
"@oclif/core": "^1.13.6",
|
|
12
|
+
"@mqarty/dev-phone-ui": "^1.0.0-beta.3",
|
|
13
|
+
"@twilio-labs/serverless-api": "^5.4.0",
|
|
14
|
+
"@twilio/cli-core": "^7.0.0",
|
|
15
|
+
"express": "^4.17.1",
|
|
16
|
+
"get-port": "^5.1.1",
|
|
17
|
+
"open": "^8.4.0"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@oclif/test": "^1.2.5",
|
|
21
|
+
"@twilio/cli-test": "^2.1.0",
|
|
22
|
+
"@types/express": "^4.17.13",
|
|
23
|
+
"@types/open": "^6.2.1",
|
|
24
|
+
"chai": "^4.2.0",
|
|
25
|
+
"eslint": "^8.3.0",
|
|
26
|
+
"eslint-config-oclif": "^3.1.0",
|
|
27
|
+
"eslint-plugin-mocha": "^9.0.0",
|
|
28
|
+
"eslint-plugin-node": "^11.1.0",
|
|
29
|
+
"eslint-plugin-unicorn": "^39.0.0",
|
|
30
|
+
"globby": "^11.0.0",
|
|
31
|
+
"mocha": "^9.1.3",
|
|
32
|
+
"nyc": "^15.0.1",
|
|
33
|
+
"typescript": "^4.6.2"
|
|
34
|
+
},
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=10.0.0"
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"/oclif.manifest.json",
|
|
40
|
+
"/dist"
|
|
41
|
+
],
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"homepage": "https://github.com/mqarty/dev-phone/packages/dev-phone",
|
|
46
|
+
"keywords": [
|
|
47
|
+
"oclif-plugin"
|
|
48
|
+
],
|
|
49
|
+
"license": "MIT",
|
|
50
|
+
"oclif": {
|
|
51
|
+
"name": "dev-phone",
|
|
52
|
+
"commands": "./dist/commands",
|
|
53
|
+
"bin": "twilio",
|
|
54
|
+
"repositoryPrefix": "<%- repo %>/blob/<%- version %>/<%- commandPath %>",
|
|
55
|
+
"devPlugins": [
|
|
56
|
+
"@oclif/plugin-help"
|
|
57
|
+
],
|
|
58
|
+
"topics": {
|
|
59
|
+
"dev-phone": {
|
|
60
|
+
"description": "Twilio Dev Phone plugin"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"repository": {
|
|
65
|
+
"type": "git",
|
|
66
|
+
"url": "git+https://github.com/mqarty/dev-phone.git"
|
|
67
|
+
},
|
|
68
|
+
"scripts": {
|
|
69
|
+
"build": "tsc",
|
|
70
|
+
"postpack": "rm -f oclif.manifest.json",
|
|
71
|
+
"XX-posttest": "eslint --ignore-path .gitignore . && npm audit",
|
|
72
|
+
"prepack": "npx oclif manifest && npx oclif readme",
|
|
73
|
+
"test": "nyc --check-coverage --lines 90 --reporter=html --reporter=text mocha --forbid-only \"test/**/*.test.js\"",
|
|
74
|
+
"version": "npx oclif readme && git add README.md"
|
|
75
|
+
},
|
|
76
|
+
"directories": {
|
|
77
|
+
"test": "test"
|
|
78
|
+
}
|
|
79
|
+
}
|