Skip to content

Commit 66d6d0d

Browse files
V2.0.0 Add Typescript support (#185)
* DOTCOM-3581: update deps and add typescript default config (#177) * update deps and add typescript default config * update prettier config * DOTCOM-3583: convert base files to typescript (#179) * update deps and add typescript default config * convert Telnyx main to typescript * bump version to v2 alpha * update changelog * convert Error and Telnyx method to typescript * update utils * convert autoPagination, makeRequest, TelnyxMethod and Webhooks * convert TelnyxResource * remove extra lint file * add types folder * update code comments on framework naming * specify error types * update eslint rules * add types generated from openapi specs * add TelnyxIncomingHttpHeaders type * add BalanceResource type defs * DOTCOM-3584: convert resource files and tests to typescript (#181) * update deps and add typescript default config * convert Telnyx main to typescript * bump version to v2 alpha * update changelog * convert Error and Telnyx method to typescript * update utils * convert autoPagination, makeRequest, TelnyxMethod and Webhooks * convert TelnyxResource * remove extra lint file * add types folder * update code comments on framework naming * specify error types * update eslint rules * add types generated from openapi specs * add TelnyxIncomingHttpHeaders type * add BalanceResource type defs * convert resource files and tests to typescript * update overall test setup * add autoPagination, telnyx, utils and Balance specs * add Webhooks tests * add autoPagination, telnyx.node, TelnyxResource, Webhooks and utils test * add MessagingProfiles resource * remove stale coverage report on README * fix Webhooks and utils tests * fix autoPagination specs * perform nock cleanup * fix Resources tests * fix Telnyx Module tests * update workflow to avoid timeouts * update test setup for Node 18 * add all resources * update legacy Payment resource * add import to Resources * add missing Resources tests * update Calls and Messaging types according to API specs * fix typos * fix Calls missing types and methods * update Call examples to Typescript * remove previous Call example * add Messaging example * update npm and node target versions * update examples lockfile and changelog * add more detailed instructions on env setup * update legacy Resources * update instructions for v2 usage * fix npm publish flow * release alpha.1 * update examples to use 2.0.0-alpha.1 * fix AI resource * update nested resources typing * update examples * add Addresses example * update resources method names and missing d types * remove unused resources * update changelog * update stale resources * add missing Messages endpoints * update type declarations * update changelog and bump alpha version * update changelog * update examples * update optional types * export events type defs * fix nested resources logic * FIX: README Typo (#186) * bump to beta * fix nested resources methods names * fix identity resources * add missing Texml resource methods * add missing inventory resources and methods * update package deps * add missing Errors type def * add Versions info * update changelog * update examples telnyx package dependency version * add contributing section * fix transformResponseData usage * fix porting types * update examples to use beta 4 * update telnyx api types * fix telnyx api types dupes * update events * update portout events resource * update telephony credentials resource * fix managed accounts tests * update sim cards resource * remove unused Number Order Documents resource * update changelog * update tsconfig and lib to include js extension * bump version to beta 5 * add connections example * update examples to use beta 5 * add numbers example * fix WebhookHeader type in type definitions * 2.0.0-beta.6 * fix linter on cc example * update tests * v2.0.0 --------- Co-authored-by: mpareja-godaddy <83242342+mpareja-godaddy@users.noreply.github.com>
1 parent b09c0f4 commit 66d6d0d

File tree

568 files changed

+108539
-22394
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

568 files changed

+108539
-22394
lines changed

.DS_Store

6 KB
Binary file not shown.

.env.local

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
NODE_ENV=development
2+
TELNYX_MOCK_PORT=12111
3+
TELNYX_MOCK_OPEN_API_URI=https://raw.githubusercontent.com/team-telnyx/openapi/master/openapi/spec3.json
4+
TELNYX_API_BASE=

.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
*.node*.js
2+
dist
23
node_modules
3-
lib/Error.js
4+
tsconfig.json

.eslintrc.js

Lines changed: 0 additions & 292 deletions
This file was deleted.

.github/workflows/node.js.yml

Lines changed: 15 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,29 @@ name: CI
55

66
on:
77
push:
8-
branches: [ master ]
8+
branches: [master]
99
pull_request:
10-
branches: [ master ]
10+
branches: [master]
1111

1212
jobs:
1313
test:
14-
1514
runs-on: ubuntu-latest
1615
env:
1716
TELNYX_MOCK_OPEN_API_URI: https://raw.githubusercontent.com/team-telnyx/openapi/master/openapi/spec3.json
1817
strategy:
18+
max-parallel: 1 # to make sure proxy server doesn't cause timeout on each individual run
1919
matrix:
20-
node-version: [18.x, 20.x]
20+
node-version: [18.x, 20.x, 22.x]
2121

2222
steps:
23-
- uses: actions/checkout@v2
24-
- name: Use Node.js ${{ matrix.node-version }}
25-
uses: actions/setup-node@v1
26-
with:
27-
node-version: ${{ matrix.node-version }}
28-
- name: setup-telnyx-prism-mock
29-
run: source ./.github/scripts/before_install.sh
30-
- run: npm ci
31-
- run: npm run build --if-present
32-
- name: Node ${{ matrix.node-version }}
33-
run: npm test
34-
- name: Report
35-
run: npm run report
36-
# - name: Coveralls Parallel
37-
# uses: coverallsapp/github-action@master
38-
# with:
39-
# github-token: ${{ secrets.github_token }}
40-
# flag-name: run-${{ matrix.node-version }}
41-
# parallel: true
42-
# finish:
43-
# needs: test
44-
# runs-on: ubuntu-latest
45-
# steps:
46-
# - name: Coveralls Finished
47-
# uses: coverallsapp/github-action@master
48-
# with:
49-
# github-token: ${{ secrets.github_token }}
50-
# parallel-finished: true
23+
- uses: actions/checkout@v4
24+
- name: Use Node.js ${{ matrix.node-version }}
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
- name: setup-telnyx-prism-mock
29+
run: source ./.github/scripts/before_install.sh
30+
- run: npm ci
31+
- run: npm run build --if-present
32+
- name: Node ${{ matrix.node-version }}
33+
run: npm test

0 commit comments

Comments
 (0)