-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0f10754
commit 0026786
Showing
20 changed files
with
516 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,53 @@ | ||
import TelnyxResource from '../TelnyxResource'; | ||
import {ResponsePayload, TelnyxObject} from '../Types'; | ||
import * as utils from '../utils'; | ||
|
||
const telnyxMethod = TelnyxResource.method; | ||
|
||
const transformResponseData = ( | ||
response: ResponsePayload, | ||
telnyx: TelnyxObject, | ||
) => { | ||
return utils.addResourceToResponseData(response, telnyx, 'verifiedNumbers', { | ||
verify: telnyxMethod({ | ||
method: 'POST', | ||
path: '/{phone_number}/actions/verify', | ||
urlParams: ['phone_number'], | ||
paramsNames: ['phone_number'], | ||
paramsValues: [response.data.id as string], | ||
}), | ||
}); | ||
}; | ||
|
||
export const VerifiedNumbers = TelnyxResource.extend({ | ||
path: 'verified_numbers', | ||
includeBasic: ['list', 'retrieve', 'del'], | ||
includeBasic: ['list', 'del'], | ||
|
||
retrieve: telnyxMethod({ | ||
method: 'GET', | ||
path: '/{phone_number}', | ||
urlParams: ['phone_number'], | ||
|
||
transformResponseData: transformResponseData, | ||
}), | ||
|
||
create: telnyxMethod({ | ||
method: 'POST', | ||
|
||
transformResponseData: transformResponseData, | ||
}), | ||
|
||
request: telnyxMethod({ | ||
method: 'POST', | ||
|
||
transformResponseData: transformResponseData, | ||
}), | ||
|
||
verify: telnyxMethod({ | ||
method: 'POST', | ||
path: '/{phone_number}/actions/verify', | ||
urlParams: ['phone_number'], | ||
paramsNames: ['phone_number'], | ||
methodType: 'create', | ||
}), | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,14 @@ | ||
import TelnyxResource from '../TelnyxResource'; | ||
import * as utils from '../utils'; | ||
const telnyxMethod = TelnyxResource.method; | ||
|
||
import {ResponsePayload, TelnyxObject} from '../Types'; | ||
|
||
function transformResponseData( | ||
response: ResponsePayload, | ||
telnyx: TelnyxObject, | ||
) { | ||
return utils.addResourceToResponseData(response, telnyx, 'verifyProfiles', { | ||
retrieveVerifyProfileMessageTemplates: telnyxMethod({ | ||
method: 'GET', | ||
path: '/verify_profiles/templates', | ||
}), | ||
}); | ||
} | ||
const telnyxMethod = TelnyxResource.method; | ||
|
||
export const VerifyProfiles = TelnyxResource.extend({ | ||
path: 'verify_profiles', | ||
includeBasic: ['list', 'update', 'del'], | ||
|
||
save: telnyxMethod({ | ||
method: 'PATCH', | ||
path: '/{verify_profile_id}', | ||
urlParams: ['verify_profile_id'], | ||
paramsNames: ['id'], | ||
|
||
transformResponseData: transformResponseData, | ||
}), | ||
includeBasic: ['list', 'create', 'retrieve', 'update', 'del'], | ||
|
||
retrieve: telnyxMethod({ | ||
listTemplates: telnyxMethod({ | ||
method: 'GET', | ||
path: '/{verify_profile_id}', | ||
urlParams: ['verify_profile_id'], | ||
paramsNames: ['id'], | ||
|
||
transformResponseData: transformResponseData, | ||
}), | ||
|
||
create: telnyxMethod({ | ||
method: 'POST', | ||
|
||
transformResponseData: transformResponseData, | ||
path: '/templates', | ||
methodType: 'list', | ||
}), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.