telnyx 2.0.0-beta.0 → 2.0.0-beta.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.
Files changed (46) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/VERSION +1 -1
  3. package/dist/resources/AvailablePhoneNumbersBlocks.js +5 -0
  4. package/dist/resources/CallControlApplications.js +1 -1
  5. package/dist/resources/IpConnections.js +0 -1
  6. package/dist/resources/Ips.js +2 -2
  7. package/dist/resources/NumberOrders.js +24 -1
  8. package/dist/resources/PhoneNumbers.js +62 -13
  9. package/dist/resources/PhoneNumbersInboundChannels.js +4 -17
  10. package/dist/resources/{PhoneNumberRegulatoryRequirements.js → PhoneNumbersRegulatoryRequirements.js} +1 -1
  11. package/dist/resources/PhoneNumbersSlim.js +5 -0
  12. package/dist/resources/PortingOrders.js +6 -6
  13. package/dist/resources/Queues.js +7 -7
  14. package/dist/resources/Texml.js +23 -0
  15. package/dist/resources/TexmlApplications.js +31 -1
  16. package/dist/resources/Verifications.js +41 -36
  17. package/dist/resources/VerifiedNumbers.js +35 -1
  18. package/dist/resources/VerifyProfiles.js +4 -26
  19. package/dist/telnyx.js +8 -6
  20. package/dist/types/AddressesResource.d.ts +3 -1
  21. package/dist/types/AvailablePhoneNumbersBlocksResource.d.ts +20 -0
  22. package/dist/types/CallControlApplicationsResource.d.ts +8 -2
  23. package/dist/types/ConferencesResource.d.ts +14 -10
  24. package/dist/types/FaxApplicationsResource.d.ts +25 -19
  25. package/dist/types/FaxesResource.d.ts +9 -7
  26. package/dist/types/FqdnConnectionsResource.d.ts +11 -16
  27. package/dist/types/FqdnsResource.d.ts +14 -8
  28. package/dist/types/IpConnectionsResource.d.ts +11 -16
  29. package/dist/types/MessagingProfilesResource.d.ts +3 -1
  30. package/dist/types/NumberOrdersResource.d.ts +78 -0
  31. package/dist/types/PhoneNumbersInboundChannelsResource.d.ts +33 -0
  32. package/dist/types/PhoneNumbersMessagingResource.d.ts +18 -0
  33. package/dist/types/PhoneNumbersRegulatoryRequirementsResource.d.ts +20 -0
  34. package/dist/types/PhoneNumbersResource.d.ts +195 -0
  35. package/dist/types/PhoneNumbersSlimResource.d.ts +18 -0
  36. package/dist/types/PhoneNumbersVoiceResource.d.ts +18 -0
  37. package/dist/types/RegulatoryRequirementsResource.d.ts +18 -0
  38. package/dist/types/TexmlApplicationsResource.d.ts +30 -2
  39. package/dist/types/TexmlResource.d.ts +48 -0
  40. package/dist/types/VerificationsResource.d.ts +116 -0
  41. package/dist/types/VerifiedNumbersResource.d.ts +108 -0
  42. package/dist/types/VerifyProfilesResource.d.ts +84 -0
  43. package/dist/types/index.d.ts +26 -0
  44. package/package.json +1 -1
  45. package/dist/resources/PhoneNumberSearch.js +0 -14
  46. package/dist/resources/Verify.js +0 -50
package/CHANGELOG.md CHANGED
@@ -2,6 +2,21 @@
2
2
 
3
3
  ## v2
4
4
 
5
+ ### v2.0.0-beta.2
6
+
7
+ - Add missing `Texml` resource methods
8
+ - Add missing `PhoneNumbers`, `NumberOrders` and `RegulatoryRequirements` resource methods
9
+ - Update types on stale resources methods
10
+
11
+ ### v2.0.0-beta.1
12
+
13
+ - Fix `Queues` resource nested methods
14
+ - Fix `PortingOrders` and `Ips` resource nested methods param names
15
+ - Update legacy skipped tests
16
+ - Fix `Verifications`, `VerifyProfiles` and `VerifiedNumbers` resources method naming and params
17
+ - Remove dupe `Verify` resource
18
+ - Update nested methods types to match param values usage
19
+
5
20
  ### v2.0.0-beta.0
6
21
 
7
22
  - Move `AutorespConfigs` resource to be nested in `MessagingProfiles`
package/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.0-beta.0
1
+ 2.0.0-beta.2
@@ -0,0 +1,5 @@
1
+ import TelnyxResource from '../TelnyxResource';
2
+ export const AvailablePhoneNumbersBlocks = TelnyxResource.extend({
3
+ path: 'available_phone_number_blocks',
4
+ includeBasic: ['list'],
5
+ });
@@ -21,7 +21,7 @@ function transformResponseData(response, telnyx) {
21
21
  }
22
22
  export const CallControlApplications = TelnyxResource.extend({
23
23
  path: 'call_control_applications',
24
- includeBasic: ['list', 'update'],
24
+ includeBasic: ['list', 'update', 'del'],
25
25
  create: telnyxMethod({
26
26
  method: 'POST',
27
27
  transformResponseData: transformResponseData,
@@ -24,7 +24,6 @@ export const IpConnections = 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',
@@ -8,14 +8,14 @@ function transformResponseData(response, telnyx) {
8
8
  path: '/{ipId}',
9
9
  urlParams: ['ipId'],
10
10
  paramsValues: [response.data.id],
11
- paramsNames: ['id'],
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: ['id'],
18
+ paramsNames: ['ipId'],
19
19
  }),
20
20
  });
21
21
  }
@@ -1,5 +1,28 @@
1
1
  import TelnyxResource from '../TelnyxResource';
2
+ import * as utils from '../utils';
3
+ const telnyxMethod = TelnyxResource.method;
4
+ function transformResponseData(response, telnyx) {
5
+ return utils.addResourceToResponseData(response, telnyx, 'numberOrders', {
6
+ update: telnyxMethod({
7
+ method: 'PATCH',
8
+ path: '/{number_order_id}',
9
+ urlParams: ['number_order_id'],
10
+ paramsValues: [response.data.id],
11
+ paramsNames: ['number_order_id'],
12
+ }),
13
+ });
14
+ }
2
15
  export const NumberOrders = TelnyxResource.extend({
3
16
  path: 'number_orders',
4
- includeBasic: ['list', 'retrieve', 'create', 'update'],
17
+ includeBasic: ['list', 'update'],
18
+ create: telnyxMethod({
19
+ method: 'POST',
20
+ transformResponseData: transformResponseData,
21
+ }),
22
+ retrieve: telnyxMethod({
23
+ method: 'GET',
24
+ path: '/{number_order_id}',
25
+ urlParams: ['number_order_id'],
26
+ transformResponseData: transformResponseData,
27
+ }),
5
28
  });
@@ -1,41 +1,90 @@
1
1
  import TelnyxResource from '../TelnyxResource';
2
- const telnyxMethod = TelnyxResource.method;
2
+ import * as utils from '../utils';
3
3
  import { PhoneNumbersMessaging } from './PhoneNumbersMessaging';
4
4
  import { PhoneNumbersVoice } from './PhoneNumbersVoice';
5
5
  import { PhoneNumbersInboundChannels } from './PhoneNumbersInboundChannels';
6
+ const telnyxMethod = TelnyxResource.method;
7
+ function transformResponseData(response, telnyx) {
8
+ return utils.addResourceToResponseData(response, telnyx, 'phoneNumbers', {
9
+ del: telnyxMethod({
10
+ method: 'DELETE',
11
+ path: '/{intId}',
12
+ urlParams: ['intId'],
13
+ paramsValues: [response.data.id],
14
+ paramsNames: ['intId'],
15
+ }),
16
+ update: telnyxMethod({
17
+ method: 'PATCH',
18
+ path: '/{intId}',
19
+ urlParams: ['intId'],
20
+ paramsValues: [response.data.id],
21
+ paramsNames: ['intId'],
22
+ }),
23
+ });
24
+ }
6
25
  export const PhoneNumbers = TelnyxResource.extend({
7
26
  path: 'phone_numbers',
8
- includeBasic: ['list', 'retrieve', 'update', 'del'],
27
+ includeBasic: ['list', 'update', 'del'],
9
28
  nestedResources: {
10
29
  Messaging: PhoneNumbersMessaging,
11
30
  Voice: PhoneNumbersVoice,
12
31
  Inbound: PhoneNumbersInboundChannels,
13
32
  },
14
- retrieveVoiceSettings: telnyxMethod({
33
+ retrieve: telnyxMethod({
15
34
  method: 'GET',
16
- path: '/{id}/voice',
35
+ path: '/{id}',
17
36
  urlParams: ['id'],
37
+ transformResponseData: transformResponseData,
38
+ }),
39
+ retrieveVoiceSettings: telnyxMethod({
40
+ method: 'GET',
41
+ path: '/{intId}/voice',
42
+ urlParams: ['intId'],
43
+ paramsNames: ['intId'],
18
44
  methodType: 'retrieve',
19
45
  }),
20
46
  updateVoiceSettings: telnyxMethod({
21
47
  method: 'PATCH',
22
- path: '/{id}/voice',
23
- urlParams: ['id'],
48
+ path: '/{intId}/voice',
49
+ urlParams: ['intId'],
50
+ paramsNames: ['intId'],
24
51
  }),
25
52
  retrieveMessagingSettings: telnyxMethod({
26
53
  method: 'GET',
27
- path: '/{id}/messaging',
28
- urlParams: ['id'],
54
+ path: '/{intId}/messaging',
55
+ urlParams: ['intId'],
56
+ paramsNames: ['intId'],
29
57
  methodType: 'retrieve',
30
58
  }),
31
59
  updateMessagingSettings: telnyxMethod({
32
60
  method: 'PATCH',
33
- path: '/{id}/messaging',
34
- urlParams: ['id'],
61
+ path: '/{intId}/messaging',
62
+ urlParams: ['intId'],
63
+ paramsNames: ['intId'],
35
64
  }),
36
- setEmergencySettings: telnyxMethod({
65
+ enableEmergencySettings: telnyxMethod({
37
66
  method: 'POST',
38
- path: '/{id}/actions/enable_emergency',
39
- urlParams: ['id'],
67
+ path: '/{intId}/actions/enable_emergency',
68
+ urlParams: ['intId'],
69
+ paramsNames: ['intId'],
70
+ }),
71
+ retrieveVoicemail: telnyxMethod({
72
+ method: 'GET',
73
+ path: '/{phone_number_id}/voicemail',
74
+ urlParams: ['phone_number_id'],
75
+ paramsNames: ['phone_number_id'],
76
+ methodType: 'retrieve',
77
+ }),
78
+ createVoicemail: telnyxMethod({
79
+ method: 'POST',
80
+ path: '/{phone_number_id}/voicemail',
81
+ urlParams: ['phone_number_id'],
82
+ paramsNames: ['phone_number_id'],
83
+ }),
84
+ updateVoicemail: telnyxMethod({
85
+ method: 'PATCH',
86
+ path: '/{phone_number_id}/voicemail',
87
+ urlParams: ['phone_number_id'],
88
+ paramsNames: ['phone_number_id'],
40
89
  }),
41
90
  });
@@ -1,23 +1,10 @@
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, 'phoneNumbersInboundChannels', {
6
- update: telnyxMethod({
7
- method: 'PATCH',
8
- path: '',
9
- urlParams: ['channels'],
10
- paramsValues: [response.data.id],
11
- paramsNames: ['channels'],
12
- }),
13
- });
14
- }
15
3
  export const PhoneNumbersInboundChannels = TelnyxResource.extend({
16
4
  path: 'phone_numbers/inbound_channels',
17
- retrieve: telnyxMethod({
18
- method: 'GET',
19
- path: '',
20
- urlParams: [],
21
- transformResponseData: transformResponseData,
5
+ includeBasic: ['list'],
6
+ update: telnyxMethod({
7
+ method: 'PATCH',
8
+ methodType: 'update',
22
9
  }),
23
10
  });
@@ -1,5 +1,5 @@
1
1
  import TelnyxResource from '../TelnyxResource';
2
- export const PhoneNumberRegulatoryRequirements = TelnyxResource.extend({
2
+ export const PhoneNumbersRegulatoryRequirements = TelnyxResource.extend({
3
3
  path: 'phone_numbers_regulatory_requirements',
4
4
  includeBasic: ['list'],
5
5
  });
@@ -0,0 +1,5 @@
1
+ import TelnyxResource from '../TelnyxResource';
2
+ export const PhoneNumbersSlim = TelnyxResource.extend({
3
+ path: 'phone_numbers/slim',
4
+ includeBasic: ['list'],
5
+ });
@@ -8,14 +8,14 @@ function transformResponseData(response, telnyx) {
8
8
  path: '/{portingOrderId}',
9
9
  urlParams: ['portingOrderId'],
10
10
  paramsValues: [response.data.id],
11
- paramsNames: ['id'],
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: ['id'],
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: '/{id}/actions/cancel',
55
- urlParams: ['id'],
52
+ path: '/{orderId}/actions/cancel',
53
+ urlParams: ['orderId'],
54
+ paramsNames: ['orderId'],
55
+ methodType: 'create',
56
56
  }),
57
57
  listAllowedFocWindows: telnyxMethod({
58
58
  method: 'GET',
@@ -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.retrieve = telnyxMethod({
19
+ methods.retrieveCall = telnyxMethod({
20
20
  method: 'GET',
21
- path: '/{call_control_id}',
22
- urlParams: ['call_control_id'],
23
- paramsValues: [response.data.call_control_id],
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
- transformResponseData: transformResponseData,
45
+ paramsNames: ['queue_name', 'call_control_id'],
46
+ methodType: 'retrieve',
47
47
  }),
48
48
  });
@@ -0,0 +1,23 @@
1
+ import TelnyxResource from '../TelnyxResource';
2
+ const telnyxMethod = TelnyxResource.method;
3
+ export const Texml = TelnyxResource.extend({
4
+ path: 'texml',
5
+ createSecret: telnyxMethod({
6
+ method: 'POST',
7
+ path: '/secrets',
8
+ methodType: 'create',
9
+ }),
10
+ createCall: telnyxMethod({
11
+ method: 'POST',
12
+ path: '/calls/{application_id}',
13
+ urlParams: ['application_id'],
14
+ paramsNames: ['application_id'],
15
+ methodType: 'create',
16
+ }),
17
+ updateCall: telnyxMethod({
18
+ method: 'POST',
19
+ path: '/calls/{call_sid}/update',
20
+ urlParams: ['call_sid'],
21
+ paramsNames: ['call_sid'],
22
+ }),
23
+ });
@@ -1,5 +1,35 @@
1
1
  import TelnyxResource from '../TelnyxResource';
2
+ import * as utils from '../utils';
3
+ const telnyxMethod = TelnyxResource.method;
4
+ function transformResponseData(response, telnyx) {
5
+ return utils.addResourceToResponseData(response, telnyx, 'texmlApplications', {
6
+ del: telnyxMethod({
7
+ method: 'DELETE',
8
+ path: '/{texmlApplicationId}',
9
+ urlParams: ['texmlApplicationId'],
10
+ paramsValues: [response.data.id],
11
+ paramsNames: ['texmlApplicationId'],
12
+ }),
13
+ update: telnyxMethod({
14
+ method: 'PATCH',
15
+ path: '/{texmlApplicationId}',
16
+ urlParams: ['texmlApplicationId'],
17
+ paramsValues: [response.data.id],
18
+ paramsNames: ['texmlApplicationId'],
19
+ }),
20
+ });
21
+ }
2
22
  export const TexmlApplications = TelnyxResource.extend({
3
23
  path: 'texml_applications',
4
- includeBasic: ['list', 'create', 'retrieve', 'del', 'update'],
24
+ includeBasic: ['list', 'update', 'del'],
25
+ create: telnyxMethod({
26
+ method: 'POST',
27
+ transformResponseData: transformResponseData,
28
+ }),
29
+ retrieve: telnyxMethod({
30
+ method: 'GET',
31
+ path: '/{id}',
32
+ urlParams: ['id'],
33
+ transformResponseData: transformResponseData,
34
+ }),
5
35
  });
@@ -1,53 +1,58 @@
1
1
  import TelnyxResource from '../TelnyxResource';
2
2
  import * as utils from '../utils';
3
3
  const telnyxMethod = TelnyxResource.method;
4
- function transformResponseData(response, telnyx) {
5
- return utils.addResourceToResponseData(response, telnyx, 'verification', {
6
- sms: telnyxMethod({
4
+ const transformResponseData = (response, telnyx) => {
5
+ return utils.addResourceToResponseData(response, telnyx, 'verifiedNumbers', {
6
+ verify: telnyxMethod({
7
7
  method: 'POST',
8
- path: '/sms',
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
- includeBasic: ['update'],
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', 'retrieve', 'del'],
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
- save: telnyxMethod({
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: '/{verify_profile_id}',
25
- urlParams: ['verify_profile_id'],
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
@@ -88,11 +88,11 @@ import { PhoneNumberBlockOrders } from './resources/PhoneNumberBlockOrders';
88
88
  import { PhoneNumberBlocksBackgroundJobs } from './resources/PhoneNumberBlocksBackgroundJobs';
89
89
  import { PhoneNumberCampaigns } from './resources/PhoneNumberCampaigns';
90
90
  import { PhoneNumberOrderDocuments } from './resources/PhoneNumberOrderDocuments';
91
- import { PhoneNumberRegulatoryRequirements } from './resources/PhoneNumberRegulatoryRequirements';
92
91
  import { PhoneNumbers } from './resources/PhoneNumbers';
93
- import { PhoneNumberSearch } from './resources/PhoneNumberSearch';
94
92
  import { PhoneNumbersInboundChannels } from './resources/PhoneNumbersInboundChannels';
95
93
  import { PhoneNumbersMessaging } from './resources/PhoneNumbersMessaging';
94
+ import { PhoneNumbersRegulatoryRequirements } from './resources/PhoneNumbersRegulatoryRequirements';
95
+ import { PhoneNumbersSlim } from './resources/PhoneNumbersSlim';
96
96
  import { PhoneNumbersVoice } from './resources/PhoneNumbersVoice';
97
97
  import { PortabilityChecks } from './resources/PortabilityChecks';
98
98
  import { PortingEvents } from './resources/PortingEvents';
@@ -129,10 +129,10 @@ import { SimCardOrders } from './resources/SimCardOrders';
129
129
  import { SimCards } from './resources/SimCards';
130
130
  import { StorageBuckets } from './resources/StorageBuckets';
131
131
  import { TelephonyCredentials } from './resources/TelephonyCredentials';
132
+ import { Texml } from './resources/Texml';
132
133
  import { TexmlApplications } from './resources/TexmlApplications';
133
134
  import { Verifications } from './resources/Verifications';
134
135
  import { VerifiedNumbers } from './resources/VerifiedNumbers';
135
- import { Verify } from './resources/Verify';
136
136
  import { VerifyProfiles } from './resources/VerifyProfiles';
137
137
  import { VirtualCrossConnects } from './resources/VirtualCrossConnects';
138
138
  import { WdrDetailReports } from './resources/WdrDetailReports';
@@ -143,6 +143,7 @@ import { WirelessDetailRecordReports } from './resources/WirelessDetailRecordRep
143
143
  import TelnyxResource from './TelnyxResource';
144
144
  import * as _Error from './Error';
145
145
  import Webhooks from './Webhooks';
146
+ import { AvailablePhoneNumbersBlocks } from './resources/AvailablePhoneNumbersBlocks';
146
147
  export function createTelnyx() {
147
148
  Telnyx.DEFAULT_HOST = process.env.TELNYX_API_BASE || 'api.telnyx.com';
148
149
  Telnyx.DEFAULT_PORT = '443';
@@ -182,6 +183,7 @@ export function createTelnyx() {
182
183
  AiSummarize,
183
184
  AuthenticationProviders,
184
185
  AvailablePhoneNumbers,
186
+ AvailablePhoneNumbersBlocks,
185
187
  Balance,
186
188
  BillingGroups,
187
189
  Brands,
@@ -249,9 +251,9 @@ export function createTelnyx() {
249
251
  PhoneNumberBlocksBackgroundJobs,
250
252
  PhoneNumberCampaigns,
251
253
  PhoneNumberOrderDocuments,
252
- PhoneNumberRegulatoryRequirements,
254
+ PhoneNumbersRegulatoryRequirements,
255
+ PhoneNumbersSlim,
253
256
  PhoneNumbers,
254
- PhoneNumberSearch,
255
257
  PhoneNumbersInboundChannels,
256
258
  PhoneNumbersMessaging,
257
259
  PhoneNumbersVoice,
@@ -291,10 +293,10 @@ export function createTelnyx() {
291
293
  SimCards,
292
294
  StorageBuckets,
293
295
  TelephonyCredentials,
296
+ Texml,
294
297
  TexmlApplications,
295
298
  Verifications,
296
299
  VerifiedNumbers,
297
- Verify,
298
300
  VerifyProfiles,
299
301
  VirtualCrossConnects,
300
302
  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: AddressesResource['del'];
42
+ del(
43
+ options?: RequestOptions,
44
+ ): Promise<Telnyx.Response<Telnyx.AddressesDelResponse>>;
43
45
  };
44
46
 
45
47
  class AddressesResource {
@@ -0,0 +1,20 @@
1
+ import {paths} from './TelnyxAPI.js';
2
+
3
+ declare module 'telnyx' {
4
+ namespace Telnyx {
5
+ type AvailablePhoneNumbersBlocksListParams =
6
+ paths['/available_phone_number_blocks']['get']['parameters']['query'];
7
+
8
+ type AvailablePhoneNumbersBlocksListResponse =
9
+ paths['/available_phone_number_blocks']['get']['responses']['200']['content']['application/json'];
10
+
11
+ class AvailablePhoneNumbersBlocksResource {
12
+ list(
13
+ params?: AvailablePhoneNumbersBlocksListParams,
14
+ options?: RequestOptions,
15
+ ): Promise<
16
+ Telnyx.Response<Telnyx.AvailablePhoneNumbersBlocksListResponse>
17
+ >;
18
+ }
19
+ }
20
+ }