telnyx 2.0.0-alpha.7 → 2.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/README.md +1 -1
- package/VERSION +1 -1
- package/dist/TelnyxResource.js +5 -1
- package/dist/resources/Brands.js +1 -1
- package/dist/resources/Calls.js +12 -1
- package/dist/resources/Conferences.js +27 -11
- package/dist/resources/IpConnections.js +0 -1
- package/dist/resources/Ips.js +2 -2
- package/dist/resources/MessagingProfiles.js +81 -24
- package/dist/resources/PortingOrders.js +6 -6
- package/dist/resources/Queues.js +7 -7
- package/dist/resources/Verifications.js +41 -36
- package/dist/resources/VerifiedNumbers.js +35 -1
- package/dist/resources/VerifyProfiles.js +4 -26
- package/dist/telnyx.js +0 -4
- package/dist/types/AddressesResource.d.ts +3 -1
- package/dist/types/BrandsResource.d.ts +26 -26
- package/dist/types/CallControlApplicationsResource.d.ts +8 -2
- package/dist/types/CallsResource.d.ts +196 -28
- package/dist/types/ChannelzonesResource.d.ts +12 -8
- package/dist/types/ConferencesResource.d.ts +117 -25
- package/dist/types/FaxApplicationsResource.d.ts +25 -19
- package/dist/types/FaxesResource.d.ts +9 -7
- package/dist/types/FqdnConnectionsResource.d.ts +11 -16
- package/dist/types/FqdnsResource.d.ts +14 -8
- package/dist/types/IpConnectionsResource.d.ts +11 -16
- package/dist/types/MessagingProfilesResource.d.ts +133 -9
- package/dist/types/VerificationsResource.d.ts +116 -0
- package/dist/types/VerifiedNumbersResource.d.ts +108 -0
- package/dist/types/VerifyProfilesResource.d.ts +84 -0
- package/dist/types/index.d.ts +6 -2
- package/package.json +1 -1
- package/dist/resources/AutorespConfigs.js +0 -11
- package/dist/resources/Verify.js +0 -50
- package/dist/types/AutorespConfigsResource.d.ts +0 -74
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
## v2
|
|
4
4
|
|
|
5
|
+
### v2.0.0-beta.1
|
|
6
|
+
|
|
7
|
+
- Fix `Queues` resource nested methods
|
|
8
|
+
- Fix `PortingOrders` and `Ips` resource nested methods param names
|
|
9
|
+
- Update legacy skipped tests
|
|
10
|
+
- Fix `Verifications`, `VerifyProfiles` and `VerifiedNumbers` resources method naming and params
|
|
11
|
+
- Remove dupe `Verify` resource
|
|
12
|
+
- Update nested methods types to match param values usage
|
|
13
|
+
|
|
14
|
+
### v2.0.0-beta.0
|
|
15
|
+
|
|
16
|
+
- Move `AutorespConfigs` resource to be nested in `MessagingProfiles`
|
|
17
|
+
- Fix nested resources in `Calls`, `MessagingProfiles` and `Conferences` ID usage instead of using constructors data
|
|
18
|
+
- Fix nested resources `Calls`, `MessagingProfiles` and `Conferences` method names
|
|
19
|
+
- Fix `Brand` resources method name
|
|
20
|
+
- Fix bug on `DELETE` operations empty `responseBody` JSON Parsing
|
|
21
|
+
- Update types on resources methods with multiple urlParams
|
|
22
|
+
- FIX: README Typo by @mpareja-godaddy in https://github.com/team-telnyx/telnyx-node/pull/186
|
|
23
|
+
|
|
5
24
|
### v2.0.0-alpha.7
|
|
6
25
|
|
|
7
26
|
- Export API callback `events` type definitions
|
package/README.md
CHANGED
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.0.0-
|
|
1
|
+
2.0.0-beta.1
|
package/dist/TelnyxResource.js
CHANGED
|
@@ -123,7 +123,11 @@ TelnyxResource.prototype = {
|
|
|
123
123
|
let responseBody;
|
|
124
124
|
try {
|
|
125
125
|
responseBody = utils.tryParseJSON(response);
|
|
126
|
-
|
|
126
|
+
// JSON response might be empty on deletion operations
|
|
127
|
+
if (!responseBody) {
|
|
128
|
+
responseBody = {};
|
|
129
|
+
}
|
|
130
|
+
else if (responseBody.errors) {
|
|
127
131
|
const error = {};
|
|
128
132
|
error.errors =
|
|
129
133
|
responseBody.errors;
|
package/dist/resources/Brands.js
CHANGED
|
@@ -30,7 +30,7 @@ export const Brands = TelnyxResource.extend({
|
|
|
30
30
|
urlParams: ['brandId'],
|
|
31
31
|
methodType: 'list',
|
|
32
32
|
}),
|
|
33
|
-
|
|
33
|
+
importExternalVettings: telnyxMethod({
|
|
34
34
|
method: 'PUT',
|
|
35
35
|
path: '/brand/{brandId}/externalVetting',
|
|
36
36
|
urlParams: ['brandId'],
|
package/dist/resources/Calls.js
CHANGED
|
@@ -32,12 +32,23 @@ const CALL_COMMANDS = [
|
|
|
32
32
|
'leave_queue',
|
|
33
33
|
];
|
|
34
34
|
function getSpec(callControlId) {
|
|
35
|
+
if (callControlId) {
|
|
36
|
+
return function (methodName) {
|
|
37
|
+
return {
|
|
38
|
+
method: 'POST',
|
|
39
|
+
path: `/{call_control_id}/actions/${methodName}`,
|
|
40
|
+
urlParams: ['call_control_id'],
|
|
41
|
+
paramsValues: [callControlId],
|
|
42
|
+
paramsNames: ['call_control_id'],
|
|
43
|
+
methodType: 'create',
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
}
|
|
35
47
|
return function (methodName) {
|
|
36
48
|
return {
|
|
37
49
|
method: 'POST',
|
|
38
50
|
path: `/{call_control_id}/actions/${methodName}`,
|
|
39
51
|
urlParams: ['call_control_id'],
|
|
40
|
-
paramsValues: [callControlId],
|
|
41
52
|
paramsNames: ['call_control_id'],
|
|
42
53
|
methodType: 'create',
|
|
43
54
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import TelnyxResource from '../TelnyxResource';
|
|
2
2
|
import * as utils from '../utils';
|
|
3
3
|
const telnyxMethod = TelnyxResource.method;
|
|
4
|
-
const
|
|
4
|
+
const CONFERENCES_COMMANDS = [
|
|
5
5
|
'join',
|
|
6
6
|
'mute',
|
|
7
7
|
'unmute',
|
|
@@ -18,17 +18,37 @@ const CONFERENCES = [
|
|
|
18
18
|
'record_pause',
|
|
19
19
|
];
|
|
20
20
|
function getSpec(conferenceId) {
|
|
21
|
+
if (conferenceId) {
|
|
22
|
+
return function (methodName) {
|
|
23
|
+
return {
|
|
24
|
+
method: 'POST',
|
|
25
|
+
path: `/{conferenceId}/actions/${methodName}`,
|
|
26
|
+
urlParams: ['conferenceId'],
|
|
27
|
+
paramsValues: [conferenceId],
|
|
28
|
+
paramsNames: ['conferenceId'],
|
|
29
|
+
methodType: 'create',
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
}
|
|
21
33
|
return function (methodName) {
|
|
22
34
|
return {
|
|
23
35
|
method: 'POST',
|
|
24
36
|
path: `/{conferenceId}/actions/${methodName}`,
|
|
25
37
|
urlParams: ['conferenceId'],
|
|
26
|
-
|
|
27
|
-
paramsNames: ['id'],
|
|
38
|
+
paramsNames: ['conferenceId'],
|
|
28
39
|
methodType: 'create',
|
|
29
40
|
};
|
|
30
41
|
};
|
|
31
42
|
}
|
|
43
|
+
const transformResponseData = (response, telnyx) => {
|
|
44
|
+
const methods = utils.createNestedMethods(telnyxMethod, CONFERENCES_COMMANDS, getSpec(response.data.id));
|
|
45
|
+
methods.listParticipants = telnyxMethod({
|
|
46
|
+
method: 'GET',
|
|
47
|
+
path: '/{conferenceId}/participants',
|
|
48
|
+
urlParams: ['conferenceId'],
|
|
49
|
+
});
|
|
50
|
+
return utils.addResourceToResponseData(response, telnyx, 'conferences', methods);
|
|
51
|
+
};
|
|
32
52
|
export const Conferences = TelnyxResource.extend({
|
|
33
53
|
path: 'conferences',
|
|
34
54
|
includeBasic: ['list'],
|
|
@@ -36,20 +56,16 @@ export const Conferences = TelnyxResource.extend({
|
|
|
36
56
|
method: 'GET',
|
|
37
57
|
path: '/{id}',
|
|
38
58
|
urlParams: ['id'],
|
|
39
|
-
transformResponseData:
|
|
40
|
-
return utils.addResourceToResponseData(response, telnyx, 'conferences', utils.createNestedMethods(telnyxMethod, CONFERENCES, getSpec(response.data.id)));
|
|
41
|
-
},
|
|
59
|
+
transformResponseData: transformResponseData,
|
|
42
60
|
}),
|
|
43
61
|
create: telnyxMethod({
|
|
44
62
|
method: 'POST',
|
|
45
|
-
transformResponseData:
|
|
46
|
-
return utils.addResourceToResponseData(response, telnyx, 'conferences', utils.createNestedMethods(telnyxMethod, CONFERENCES, getSpec(response.data.id)));
|
|
47
|
-
},
|
|
63
|
+
transformResponseData: transformResponseData,
|
|
48
64
|
}),
|
|
49
|
-
|
|
65
|
+
listParticipants: telnyxMethod({
|
|
50
66
|
method: 'GET',
|
|
51
67
|
path: '/{conferenceId}/participants',
|
|
52
68
|
urlParams: ['conferenceId'],
|
|
53
69
|
}),
|
|
54
|
-
instanceMethods: utils.createNestedMethods(telnyxMethod,
|
|
70
|
+
instanceMethods: utils.createNestedMethods(telnyxMethod, CONFERENCES_COMMANDS, getSpec()),
|
|
55
71
|
});
|
package/dist/resources/Ips.js
CHANGED
|
@@ -8,14 +8,14 @@ function transformResponseData(response, telnyx) {
|
|
|
8
8
|
path: '/{ipId}',
|
|
9
9
|
urlParams: ['ipId'],
|
|
10
10
|
paramsValues: [response.data.id],
|
|
11
|
-
paramsNames: ['
|
|
11
|
+
paramsNames: ['ipId'],
|
|
12
12
|
}),
|
|
13
13
|
update: telnyxMethod({
|
|
14
14
|
method: 'PATCH',
|
|
15
15
|
path: '/{ipId}',
|
|
16
16
|
urlParams: ['ipId'],
|
|
17
17
|
paramsValues: [response.data.id],
|
|
18
|
-
paramsNames: ['
|
|
18
|
+
paramsNames: ['ipId'],
|
|
19
19
|
}),
|
|
20
20
|
});
|
|
21
21
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import TelnyxResource from '../TelnyxResource';
|
|
2
2
|
import * as utils from '../utils';
|
|
3
3
|
const telnyxMethod = TelnyxResource.method;
|
|
4
|
-
const
|
|
4
|
+
const MESSAGING_PROFILES_COMMANDS = ['phone_numbers', 'short_codes'];
|
|
5
5
|
function getSpec(messagingProfileId) {
|
|
6
6
|
return function (methodName) {
|
|
7
7
|
return {
|
|
@@ -9,19 +9,65 @@ function getSpec(messagingProfileId) {
|
|
|
9
9
|
path: `/{messagingProfileId}/${methodName}`,
|
|
10
10
|
urlParams: ['messagingProfileId'],
|
|
11
11
|
paramsValues: [messagingProfileId],
|
|
12
|
-
paramsNames: ['
|
|
12
|
+
paramsNames: ['messagingProfileId'],
|
|
13
13
|
methodType: 'list',
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
const transformResponseData = (response, telnyx) => {
|
|
18
|
-
const methods = utils.createNestedMethods(telnyxMethod,
|
|
18
|
+
const methods = utils.createNestedMethods(telnyxMethod, MESSAGING_PROFILES_COMMANDS, getSpec(response.data.id));
|
|
19
19
|
methods.del = telnyxMethod({
|
|
20
20
|
method: 'DELETE',
|
|
21
21
|
path: '/{messagingProfileId}',
|
|
22
22
|
urlParams: ['messagingProfileId'],
|
|
23
23
|
paramsValues: [response.data.id],
|
|
24
|
-
paramsNames: ['
|
|
24
|
+
paramsNames: ['messagingProfileId'],
|
|
25
|
+
});
|
|
26
|
+
methods.listAutorespConfigs = telnyxMethod({
|
|
27
|
+
method: 'GET',
|
|
28
|
+
path: '/{profileId}/autoresp_configs',
|
|
29
|
+
urlParams: ['profileId'],
|
|
30
|
+
paramsValues: [response.data.id],
|
|
31
|
+
paramsNames: ['profileId'],
|
|
32
|
+
methodType: 'list',
|
|
33
|
+
});
|
|
34
|
+
methods.createAutorespConfig = telnyxMethod({
|
|
35
|
+
method: 'POST',
|
|
36
|
+
path: '/{profileId}/autoresp_configs',
|
|
37
|
+
urlParams: ['profileId'],
|
|
38
|
+
paramsValues: [response.data.id],
|
|
39
|
+
paramsNames: ['profileId'],
|
|
40
|
+
methodType: 'create',
|
|
41
|
+
});
|
|
42
|
+
methods.delAutorespConfig = telnyxMethod({
|
|
43
|
+
method: 'DELETE',
|
|
44
|
+
path: '/{profileId}/autoresp_configs/{autorespCfgId}',
|
|
45
|
+
paramsValues: [response.data.id],
|
|
46
|
+
urlParams: ['profileId', 'autorespCfgId'],
|
|
47
|
+
paramsNames: ['profileId', 'autorespCfgId'],
|
|
48
|
+
});
|
|
49
|
+
methods.retrieveAutorespConfig = telnyxMethod({
|
|
50
|
+
method: 'GET',
|
|
51
|
+
path: '/{profileId}/autoresp_configs/{autorespCfgId}',
|
|
52
|
+
paramsValues: [response.data.id],
|
|
53
|
+
urlParams: ['profileId', 'autorespCfgId'],
|
|
54
|
+
paramsNames: ['profileId', 'autorespCfgId'],
|
|
55
|
+
methodType: 'retrieve',
|
|
56
|
+
});
|
|
57
|
+
methods.updateAutorespConfig = telnyxMethod({
|
|
58
|
+
method: 'PUT',
|
|
59
|
+
path: '/{profileId}/autoresp_configs/{autorespCfgId}',
|
|
60
|
+
paramsValues: [response.data.id],
|
|
61
|
+
urlParams: ['profileId', 'autorespCfgId'],
|
|
62
|
+
paramsNames: ['profileId', 'autorespCfgId'],
|
|
63
|
+
});
|
|
64
|
+
methods.retrieveMetrics = telnyxMethod({
|
|
65
|
+
method: 'GET',
|
|
66
|
+
path: '/{messagingProfileId}/metrics',
|
|
67
|
+
urlParams: ['messagingProfileId'],
|
|
68
|
+
paramsValues: [response.data.id],
|
|
69
|
+
paramsNames: ['messagingProfileId'],
|
|
70
|
+
methodType: 'retrieve',
|
|
25
71
|
});
|
|
26
72
|
return utils.addResourceToResponseData(response, telnyx, 'messagingProfiles', methods);
|
|
27
73
|
};
|
|
@@ -44,38 +90,49 @@ export const MessagingProfiles = TelnyxResource.extend({
|
|
|
44
90
|
urlParams: ['messagingProfileId'],
|
|
45
91
|
methodType: 'list',
|
|
46
92
|
}),
|
|
47
|
-
phoneNumbers: telnyxMethod({
|
|
48
|
-
method: 'GET',
|
|
49
|
-
path: '/{messagingProfileId}/phone_numbers',
|
|
50
|
-
urlParams: ['messagingProfileId'],
|
|
51
|
-
}),
|
|
52
93
|
listShortCodes: telnyxMethod({
|
|
53
94
|
method: 'GET',
|
|
54
95
|
path: '/{messagingProfileId}/short_codes',
|
|
55
96
|
urlParams: ['messagingProfileId'],
|
|
56
97
|
methodType: 'list',
|
|
57
98
|
}),
|
|
58
|
-
|
|
99
|
+
listAutorespConfigs: telnyxMethod({
|
|
59
100
|
method: 'GET',
|
|
60
|
-
path: '/{
|
|
61
|
-
urlParams: ['
|
|
101
|
+
path: '/{profileId}/autoresp_configs',
|
|
102
|
+
urlParams: ['profileId'],
|
|
103
|
+
paramsNames: ['profileId'],
|
|
104
|
+
methodType: 'list',
|
|
62
105
|
}),
|
|
63
|
-
|
|
106
|
+
createAutorespConfig: telnyxMethod({
|
|
107
|
+
method: 'POST',
|
|
108
|
+
path: '/{profileId}/autoresp_configs',
|
|
109
|
+
urlParams: ['profileId'],
|
|
110
|
+
paramsNames: ['profileId'],
|
|
111
|
+
methodType: 'create',
|
|
112
|
+
}),
|
|
113
|
+
delAutorespConfig: telnyxMethod({
|
|
114
|
+
method: 'DELETE',
|
|
115
|
+
path: '/{profileId}/autoresp_configs/{autorespCfgId}',
|
|
116
|
+
urlParams: ['profileId', 'autorespCfgId'],
|
|
117
|
+
paramsNames: ['profileId', 'autorespCfgId'],
|
|
118
|
+
}),
|
|
119
|
+
retrieveAutorespConfig: telnyxMethod({
|
|
64
120
|
method: 'GET',
|
|
65
|
-
path: '/{
|
|
66
|
-
urlParams: ['
|
|
121
|
+
path: '/{profileId}/autoresp_configs/{autorespCfgId}',
|
|
122
|
+
urlParams: ['profileId', 'autorespCfgId'],
|
|
123
|
+
paramsNames: ['profileId', 'autorespCfgId'],
|
|
67
124
|
methodType: 'retrieve',
|
|
68
125
|
}),
|
|
69
|
-
|
|
70
|
-
method: '
|
|
71
|
-
path: '/{
|
|
72
|
-
urlParams: ['
|
|
73
|
-
|
|
126
|
+
updateAutorespConfig: telnyxMethod({
|
|
127
|
+
method: 'PUT',
|
|
128
|
+
path: '/{profileId}/autoresp_configs/{autorespCfgId}',
|
|
129
|
+
urlParams: ['profileId', 'autorespCfgId'],
|
|
130
|
+
paramsNames: ['profileId', 'autorespCfgId'],
|
|
74
131
|
}),
|
|
75
|
-
|
|
132
|
+
retrieveMetrics: telnyxMethod({
|
|
76
133
|
method: 'GET',
|
|
77
|
-
path: '/{
|
|
78
|
-
urlParams: ['
|
|
79
|
-
methodType: '
|
|
134
|
+
path: '/{id}/metrics',
|
|
135
|
+
urlParams: ['id'],
|
|
136
|
+
methodType: 'retrieve',
|
|
80
137
|
}),
|
|
81
138
|
});
|
|
@@ -8,14 +8,14 @@ function transformResponseData(response, telnyx) {
|
|
|
8
8
|
path: '/{portingOrderId}',
|
|
9
9
|
urlParams: ['portingOrderId'],
|
|
10
10
|
paramsValues: [response.data.id],
|
|
11
|
-
paramsNames: ['
|
|
11
|
+
paramsNames: ['portingOrderId'],
|
|
12
12
|
}),
|
|
13
13
|
update: telnyxMethod({
|
|
14
14
|
method: 'PATCH',
|
|
15
15
|
path: '/{portingOrderId}',
|
|
16
16
|
urlParams: ['portingOrderId'],
|
|
17
17
|
paramsValues: [response.data.id],
|
|
18
|
-
paramsNames: ['
|
|
18
|
+
paramsNames: ['portingOrderId'],
|
|
19
19
|
}),
|
|
20
20
|
});
|
|
21
21
|
}
|
|
@@ -24,12 +24,10 @@ export const PortingOrders = TelnyxResource.extend({
|
|
|
24
24
|
list: telnyxMethod({
|
|
25
25
|
method: 'GET',
|
|
26
26
|
methodType: 'list',
|
|
27
|
-
transformResponseData: transformResponseData,
|
|
28
27
|
}),
|
|
29
28
|
create: telnyxMethod({
|
|
30
29
|
method: 'POST',
|
|
31
30
|
methodType: 'create',
|
|
32
|
-
transformResponseData: transformResponseData,
|
|
33
31
|
}),
|
|
34
32
|
// include_phone_numbers query param
|
|
35
33
|
retrieve: telnyxMethod({
|
|
@@ -51,8 +49,10 @@ export const PortingOrders = TelnyxResource.extend({
|
|
|
51
49
|
}),
|
|
52
50
|
cancelOrder: telnyxMethod({
|
|
53
51
|
method: 'POST',
|
|
54
|
-
path: '/{
|
|
55
|
-
urlParams: ['
|
|
52
|
+
path: '/{orderId}/actions/cancel',
|
|
53
|
+
urlParams: ['orderId'],
|
|
54
|
+
paramsNames: ['orderId'],
|
|
55
|
+
methodType: 'create',
|
|
56
56
|
}),
|
|
57
57
|
listAllowedFocWindows: telnyxMethod({
|
|
58
58
|
method: 'GET',
|
package/dist/resources/Queues.js
CHANGED
|
@@ -16,12 +16,12 @@ function getSpec(queueName) {
|
|
|
16
16
|
}
|
|
17
17
|
function transformResponseData(response, telnyx) {
|
|
18
18
|
const methods = utils.createNestedMethods(telnyxMethod, ACTIONS, getSpec(response.data.name));
|
|
19
|
-
methods.
|
|
19
|
+
methods.retrieveCall = telnyxMethod({
|
|
20
20
|
method: 'GET',
|
|
21
|
-
path: '/{call_control_id}',
|
|
22
|
-
urlParams: ['call_control_id'],
|
|
23
|
-
paramsValues: [response.data.
|
|
24
|
-
paramsNames: ['call_control_id'],
|
|
21
|
+
path: '/{queue_name}/calls/{call_control_id}',
|
|
22
|
+
urlParams: ['queue_name', 'call_control_id'],
|
|
23
|
+
paramsValues: [response.data.queue_name],
|
|
24
|
+
paramsNames: ['queue_name', 'call_control_id'],
|
|
25
25
|
});
|
|
26
26
|
return utils.addResourceToResponseData(response, telnyx, 'queues', methods);
|
|
27
27
|
}
|
|
@@ -37,12 +37,12 @@ export const Queues = TelnyxResource.extend({
|
|
|
37
37
|
method: 'GET',
|
|
38
38
|
path: '/{queue_name}/calls',
|
|
39
39
|
urlParams: ['queue_name'],
|
|
40
|
-
transformResponseData: transformResponseData,
|
|
41
40
|
}),
|
|
42
41
|
retrieveCall: telnyxMethod({
|
|
43
42
|
method: 'GET',
|
|
44
43
|
path: '/{queue_name}/calls/{call_control_id}',
|
|
45
44
|
urlParams: ['queue_name', 'call_control_id'],
|
|
46
|
-
|
|
45
|
+
paramsNames: ['queue_name', 'call_control_id'],
|
|
46
|
+
methodType: 'retrieve',
|
|
47
47
|
}),
|
|
48
48
|
});
|
|
@@ -1,53 +1,58 @@
|
|
|
1
1
|
import TelnyxResource from '../TelnyxResource';
|
|
2
2
|
import * as utils from '../utils';
|
|
3
3
|
const telnyxMethod = TelnyxResource.method;
|
|
4
|
-
|
|
5
|
-
return utils.addResourceToResponseData(response, telnyx, '
|
|
6
|
-
|
|
4
|
+
const transformResponseData = (response, telnyx) => {
|
|
5
|
+
return utils.addResourceToResponseData(response, telnyx, 'verifiedNumbers', {
|
|
6
|
+
verify: telnyxMethod({
|
|
7
7
|
method: 'POST',
|
|
8
|
-
path: '/
|
|
9
|
-
transformResponseData: transformResponseData,
|
|
10
|
-
}),
|
|
11
|
-
call: telnyxMethod({
|
|
12
|
-
method: 'POST',
|
|
13
|
-
path: '/call',
|
|
14
|
-
transformResponseData: transformResponseData,
|
|
15
|
-
}),
|
|
16
|
-
flashcall: telnyxMethod({
|
|
17
|
-
method: 'POST',
|
|
18
|
-
path: '/flashcall',
|
|
19
|
-
transformResponseData: transformResponseData,
|
|
20
|
-
}),
|
|
21
|
-
byPhoneNumber: telnyxMethod({
|
|
22
|
-
method: 'GET',
|
|
23
|
-
path: '/verifications/by_phone_number/{phone_number}',
|
|
24
|
-
urlParams: ['phone_number'],
|
|
25
|
-
paramsValues: [response.data.id],
|
|
26
|
-
paramsNames: ['id'],
|
|
27
|
-
}),
|
|
28
|
-
verifyVerificationCodeByPhoneNumber: telnyxMethod({
|
|
29
|
-
method: 'POST',
|
|
30
|
-
path: '/by_phone_number/{phone_number}/actions/verify',
|
|
31
|
-
urlParams: ['phone_number'],
|
|
32
|
-
paramsValues: [response.data.id],
|
|
33
|
-
paramsNames: ['id'],
|
|
34
|
-
}),
|
|
35
|
-
verifyVerificationCodeById: telnyxMethod({
|
|
36
|
-
method: 'POST',
|
|
37
|
-
path: '/by_phone_number/{verification_id}/actions/verify',
|
|
8
|
+
path: '/{verification_id}/actions/verify',
|
|
38
9
|
urlParams: ['verification_id'],
|
|
10
|
+
paramsNames: ['verification_id'],
|
|
39
11
|
paramsValues: [response.data.id],
|
|
40
|
-
paramsNames: ['id'],
|
|
41
12
|
}),
|
|
42
13
|
});
|
|
43
|
-
}
|
|
14
|
+
};
|
|
44
15
|
export const Verifications = TelnyxResource.extend({
|
|
45
16
|
path: 'verifications',
|
|
46
|
-
|
|
17
|
+
callVerify: telnyxMethod({
|
|
18
|
+
method: 'POST',
|
|
19
|
+
path: '/call',
|
|
20
|
+
methodType: 'create',
|
|
21
|
+
}),
|
|
22
|
+
flashcallVerify: telnyxMethod({
|
|
23
|
+
method: 'POST',
|
|
24
|
+
path: '/flashcall',
|
|
25
|
+
methodType: 'create',
|
|
26
|
+
}),
|
|
27
|
+
smsVerify: telnyxMethod({
|
|
28
|
+
method: 'POST',
|
|
29
|
+
path: '/sms',
|
|
30
|
+
methodType: 'create',
|
|
31
|
+
}),
|
|
47
32
|
retrieve: telnyxMethod({
|
|
48
33
|
method: 'GET',
|
|
49
34
|
path: '/{verification_id}',
|
|
50
35
|
urlParams: ['verification_id'],
|
|
51
36
|
transformResponseData: transformResponseData,
|
|
52
37
|
}),
|
|
38
|
+
verify: telnyxMethod({
|
|
39
|
+
method: 'POST',
|
|
40
|
+
path: '/{verification_id}/actions/verify',
|
|
41
|
+
urlParams: ['verification_id'],
|
|
42
|
+
paramsNames: ['verification_id'],
|
|
43
|
+
}),
|
|
44
|
+
listByPhoneNumber: telnyxMethod({
|
|
45
|
+
method: 'GET',
|
|
46
|
+
path: '/by_phone_number/{phone_number}',
|
|
47
|
+
urlParams: ['phone_number'],
|
|
48
|
+
paramsNames: ['phone_number'],
|
|
49
|
+
methodType: 'list',
|
|
50
|
+
}),
|
|
51
|
+
verifyByPhoneNumber: telnyxMethod({
|
|
52
|
+
method: 'POST',
|
|
53
|
+
path: '/by_phone_number/{phone_number}/actions/verify',
|
|
54
|
+
urlParams: ['phone_number'],
|
|
55
|
+
paramsNames: ['phone_number'],
|
|
56
|
+
methodType: 'create',
|
|
57
|
+
}),
|
|
53
58
|
});
|
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
import TelnyxResource from '../TelnyxResource';
|
|
2
|
+
import * as utils from '../utils';
|
|
3
|
+
const telnyxMethod = TelnyxResource.method;
|
|
4
|
+
const transformResponseData = (response, telnyx) => {
|
|
5
|
+
return utils.addResourceToResponseData(response, telnyx, 'verifiedNumbers', {
|
|
6
|
+
verify: telnyxMethod({
|
|
7
|
+
method: 'POST',
|
|
8
|
+
path: '/{phone_number}/actions/verify',
|
|
9
|
+
urlParams: ['phone_number'],
|
|
10
|
+
paramsNames: ['phone_number'],
|
|
11
|
+
paramsValues: [response.data.id],
|
|
12
|
+
}),
|
|
13
|
+
});
|
|
14
|
+
};
|
|
2
15
|
export const VerifiedNumbers = TelnyxResource.extend({
|
|
3
16
|
path: 'verified_numbers',
|
|
4
|
-
includeBasic: ['list', '
|
|
17
|
+
includeBasic: ['list', 'del'],
|
|
18
|
+
retrieve: telnyxMethod({
|
|
19
|
+
method: 'GET',
|
|
20
|
+
path: '/{phone_number}',
|
|
21
|
+
urlParams: ['phone_number'],
|
|
22
|
+
transformResponseData: transformResponseData,
|
|
23
|
+
}),
|
|
24
|
+
create: telnyxMethod({
|
|
25
|
+
method: 'POST',
|
|
26
|
+
transformResponseData: transformResponseData,
|
|
27
|
+
}),
|
|
28
|
+
request: telnyxMethod({
|
|
29
|
+
method: 'POST',
|
|
30
|
+
transformResponseData: transformResponseData,
|
|
31
|
+
}),
|
|
32
|
+
verify: telnyxMethod({
|
|
33
|
+
method: 'POST',
|
|
34
|
+
path: '/{phone_number}/actions/verify',
|
|
35
|
+
urlParams: ['phone_number'],
|
|
36
|
+
paramsNames: ['phone_number'],
|
|
37
|
+
methodType: 'create',
|
|
38
|
+
}),
|
|
5
39
|
});
|
|
@@ -1,33 +1,11 @@
|
|
|
1
1
|
import TelnyxResource from '../TelnyxResource';
|
|
2
|
-
import * as utils from '../utils';
|
|
3
2
|
const telnyxMethod = TelnyxResource.method;
|
|
4
|
-
function transformResponseData(response, telnyx) {
|
|
5
|
-
return utils.addResourceToResponseData(response, telnyx, 'verifyProfiles', {
|
|
6
|
-
retrieveVerifyProfileMessageTemplates: telnyxMethod({
|
|
7
|
-
method: 'GET',
|
|
8
|
-
path: '/verify_profiles/templates',
|
|
9
|
-
}),
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
3
|
export const VerifyProfiles = TelnyxResource.extend({
|
|
13
4
|
path: 'verify_profiles',
|
|
14
|
-
includeBasic: ['list', 'update', 'del'],
|
|
15
|
-
|
|
16
|
-
method: 'PATCH',
|
|
17
|
-
path: '/{verify_profile_id}',
|
|
18
|
-
urlParams: ['verify_profile_id'],
|
|
19
|
-
paramsNames: ['id'],
|
|
20
|
-
transformResponseData: transformResponseData,
|
|
21
|
-
}),
|
|
22
|
-
retrieve: telnyxMethod({
|
|
5
|
+
includeBasic: ['list', 'create', 'retrieve', 'update', 'del'],
|
|
6
|
+
listTemplates: telnyxMethod({
|
|
23
7
|
method: 'GET',
|
|
24
|
-
path: '/
|
|
25
|
-
|
|
26
|
-
paramsNames: ['id'],
|
|
27
|
-
transformResponseData: transformResponseData,
|
|
28
|
-
}),
|
|
29
|
-
create: telnyxMethod({
|
|
30
|
-
method: 'POST',
|
|
31
|
-
transformResponseData: transformResponseData,
|
|
8
|
+
path: '/templates',
|
|
9
|
+
methodType: 'list',
|
|
32
10
|
}),
|
|
33
11
|
});
|
package/dist/telnyx.js
CHANGED
|
@@ -10,7 +10,6 @@ import { Actions } from './resources/Actions';
|
|
|
10
10
|
import { ActionsSimCards } from './resources/ActionsSimCards';
|
|
11
11
|
import { ActivateDeactivateBulkCredentials } from './resources/ActivateDeactivateBulkCredentials';
|
|
12
12
|
import { Addresses } from './resources/Addresses';
|
|
13
|
-
import { AutorespConfigs } from './resources/AutorespConfigs';
|
|
14
13
|
import { AiAssistants } from './resources/AiAssistants';
|
|
15
14
|
import { AiAudioTranscriptions } from './resources/AiAudioTranscriptions';
|
|
16
15
|
import { AiChatCompletions } from './resources/AiChatCompletions';
|
|
@@ -133,7 +132,6 @@ import { TelephonyCredentials } from './resources/TelephonyCredentials';
|
|
|
133
132
|
import { TexmlApplications } from './resources/TexmlApplications';
|
|
134
133
|
import { Verifications } from './resources/Verifications';
|
|
135
134
|
import { VerifiedNumbers } from './resources/VerifiedNumbers';
|
|
136
|
-
import { Verify } from './resources/Verify';
|
|
137
135
|
import { VerifyProfiles } from './resources/VerifyProfiles';
|
|
138
136
|
import { VirtualCrossConnects } from './resources/VirtualCrossConnects';
|
|
139
137
|
import { WdrDetailReports } from './resources/WdrDetailReports';
|
|
@@ -173,7 +171,6 @@ export function createTelnyx() {
|
|
|
173
171
|
ActionsSimCards,
|
|
174
172
|
ActivateDeactivateBulkCredentials,
|
|
175
173
|
Addresses,
|
|
176
|
-
AutorespConfigs,
|
|
177
174
|
AiAssistants,
|
|
178
175
|
AiAudioTranscriptions,
|
|
179
176
|
AiChatCompletions,
|
|
@@ -296,7 +293,6 @@ export function createTelnyx() {
|
|
|
296
293
|
TexmlApplications,
|
|
297
294
|
Verifications,
|
|
298
295
|
VerifiedNumbers,
|
|
299
|
-
Verify,
|
|
300
296
|
VerifyProfiles,
|
|
301
297
|
VirtualCrossConnects,
|
|
302
298
|
WdrDetailReports,
|
|
@@ -39,7 +39,9 @@ declare module 'telnyx' {
|
|
|
39
39
|
paths['/addresses/{id}']['delete']['responses']['200']['content']['application/json'];
|
|
40
40
|
|
|
41
41
|
type AddressesNestedMethods = {
|
|
42
|
-
del
|
|
42
|
+
del(
|
|
43
|
+
options?: RequestOptions,
|
|
44
|
+
): Promise<Telnyx.Response<Telnyx.AddressesDelResponse>>;
|
|
43
45
|
};
|
|
44
46
|
|
|
45
47
|
class AddressesResource {
|