Skip to content

Commit

Permalink
V2.0.0 Add Typescript support (#185)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
lucasassisrosa and mpareja-godaddy authored Feb 4, 2025
1 parent b09c0f4 commit 66d6d0d
Show file tree
Hide file tree
Showing 568 changed files with 108,539 additions and 22,394 deletions.
Binary file added .DS_Store
Binary file not shown.
4 changes: 4 additions & 0 deletions .env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
NODE_ENV=development
TELNYX_MOCK_PORT=12111
TELNYX_MOCK_OPEN_API_URI=https://raw.githubusercontent.com/team-telnyx/openapi/master/openapi/spec3.json
TELNYX_API_BASE=
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.node*.js
dist
node_modules
lib/Error.js
tsconfig.json
292 changes: 0 additions & 292 deletions .eslintrc.js

This file was deleted.

47 changes: 15 additions & 32 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,29 @@ name: CI

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]

jobs:
test:

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

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: setup-telnyx-prism-mock
run: source ./.github/scripts/before_install.sh
- run: npm ci
- run: npm run build --if-present
- name: Node ${{ matrix.node-version }}
run: npm test
- name: Report
run: npm run report
# - name: Coveralls Parallel
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.github_token }}
# flag-name: run-${{ matrix.node-version }}
# parallel: true
# finish:
# needs: test
# runs-on: ubuntu-latest
# steps:
# - name: Coveralls Finished
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.github_token }}
# parallel-finished: true
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: setup-telnyx-prism-mock
run: source ./.github/scripts/before_install.sh
- run: npm ci
- run: npm run build --if-present
- name: Node ${{ matrix.node-version }}
run: npm test
Loading

0 comments on commit 66d6d0d

Please sign in to comment.