Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SWI-3688 Generate New SDK #1

Merged
merged 72 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from 71 commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
8031bdb
SWI-3688 Generate New SDK
ckoegel Oct 9, 2023
109536d
update SDK for operation servers
ckoegel Oct 13, 2023
dad082c
SWI-3686 Add Integration Tests
ckoegel Oct 13, 2023
052d212
add tests for voice api
ckoegel Oct 13, 2023
7f64d3b
capital R
ckoegel Oct 13, 2023
4574226
mfa tests
ckoegel Oct 13, 2023
37b396f
tn lookup tests
ckoegel Oct 13, 2023
918abdd
mfa and tn lookup http error tests
ckoegel Oct 13, 2023
b16806b
statistics api tests
ckoegel Oct 13, 2023
694f7ad
revert messages api (will have to investigate)
ckoegel Oct 13, 2023
398abc4
messages api tests
ckoegel Oct 13, 2023
1d57917
update conference and recording tests
ckoegel Oct 13, 2023
01e6905
update messages test
ckoegel Oct 13, 2023
2008088
add media tests
ckoegel Oct 13, 2023
51d49ea
small test fixes
ckoegel Oct 13, 2023
b9453e7
remove unnecessary deconstruction
ckoegel Oct 16, 2023
52d5c68
SWI-3735 Add BXML Library
ckoegel Oct 16, 2023
06d0702
add root classes
ckoegel Oct 16, 2023
581a902
begin adding non-nestable verbs
ckoegel Oct 16, 2023
b62db97
more nn verbs
ckoegel Oct 16, 2023
a08be94
nn verbs
ckoegel Oct 16, 2023
6821e8d
update comments
ckoegel Oct 16, 2023
1be1ade
final nn verbs
ckoegel Oct 16, 2023
59146f1
add nestable verbs
ckoegel Oct 16, 2023
9940c3d
update xml version
ckoegel Oct 16, 2023
1b17ec0
add unit tests for base bxml classes
ckoegel Oct 16, 2023
96ed52f
use consts for expected values
ckoegel Oct 16, 2023
ce3c09c
add unit tests for non-nestable verbs
ckoegel Oct 16, 2023
6426bbb
update SpeakSentence to sub >< with regex and add test
ckoegel Oct 17, 2023
4927fc3
spelling in forward test
ckoegel Oct 17, 2023
4bc6ab5
finish nn verb tests
ckoegel Oct 17, 2023
65104fe
update nestable verbs
ckoegel Oct 17, 2023
e7d0859
unit tests for nested verbs
ckoegel Oct 17, 2023
8921fea
SWI-3687 Add Unit Tests
ckoegel Oct 17, 2023
ff516a4
SWI-3689 Add Workflows and Issue Template
ckoegel Oct 17, 2023
b29c381
Merge branch 'SWI-3688' of https://github.com/Bandwidth/node-sdk into…
ckoegel Oct 17, 2023
ff3815c
Merge branch 'SWI-3686' of https://github.com/Bandwidth/node-sdk into…
ckoegel Oct 17, 2023
57ce52c
Merge branch 'SWI-3735' of https://github.com/Bandwidth/node-sdk into…
ckoegel Oct 17, 2023
835c7d0
Merge branch 'SWI-3687' of https://github.com/Bandwidth/node-sdk into…
ckoegel Oct 17, 2023
d0e4e55
try just node 18
ckoegel Oct 17, 2023
cac9938
try catch to see whats wrong
ckoegel Oct 18, 2023
7b930b6
removes references to ruby
ckoegel Oct 18, 2023
4a4d93e
remove try catch
ckoegel Oct 18, 2023
7365ea8
bring back all node versions
ckoegel Oct 18, 2023
94335c9
remove flaky message expiration assertion
ckoegel Oct 18, 2023
f6093eb
more try catches to find error
ckoegel Oct 18, 2023
f1c72b9
catch more errors
ckoegel Oct 18, 2023
4a6ad30
remove skipped tests and detectOpenHandles
ckoegel Oct 18, 2023
3a7bb0e
remove try catches
ckoegel Oct 18, 2023
2f1ed6a
remove beta deploy wf
ckoegel Oct 18, 2023
bf73581
Merge pull request #4 from Bandwidth/SWI-3687
ckoegel Oct 18, 2023
d532149
update timeout in recordings test
ckoegel Oct 18, 2023
436ca49
update timeout again just to be safe
ckoegel Oct 18, 2023
8429aca
add 403 tests
ckoegel Oct 18, 2023
cad5f2b
Merge branch 'SWI-3686' into SWI-3735
ckoegel Oct 18, 2023
72f5133
semi colons
ckoegel Oct 26, 2023
63e2279
Merge pull request #2 from Bandwidth/SWI-3686
ckoegel Oct 27, 2023
2431827
Merge pull request #3 from Bandwidth/SWI-3735
ckoegel Oct 27, 2023
a808545
Merge branch 'SWI-3688' of https://github.com/Bandwidth/node-sdk into…
ckoegel Oct 27, 2023
3f117a2
update templates
ckoegel Oct 27, 2023
aec93b4
update checkout and setup node versions
ckoegel Oct 30, 2023
b2c29a1
update checkout and node elsewhere
ckoegel Oct 30, 2023
752213d
this one didnt save :/
ckoegel Oct 30, 2023
0ce9300
SWI-3836 Update BXML Library and Add Integration Tests
ckoegel Oct 31, 2023
dd4fd22
update workflows
ckoegel Nov 1, 2023
e541462
regenerate on 7.1.0
ckoegel Nov 14, 2023
0c45900
Merge pull request #6 from Bandwidth/SWI-3836
ckoegel Nov 28, 2023
f18329c
Merge pull request #5 from Bandwidth/SWI-3689
ckoegel Nov 28, 2023
d15666f
add modelIndex template for bxml imports
ckoegel Nov 28, 2023
dfa2d0d
regenerate sdk
ckoegel Nov 28, 2023
e52980f
update package.json
ckoegel Nov 28, 2023
4478aa1
Update .github/workflows/update-sdk.yml
ckoegel Nov 30, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
name: Bug Report
about: Create a bug report.
title: '[BUG] Description'
labels: 'bug'
---

### Checklist
- [ ] Have you provided a description of the bug?
- [ ] Have you provided your Environment information?
- [ ] Have you provided a sample code snippet?
- [ ] Have you provided a stack trace?
- [ ] Have you outlined the expected behavior?

### Description
<!-- Please provide a clear and concise description of the bug. -->

### Environment Information
<!-- Please provide the version of the OS, SDK, and Environment you are experiencing the bug in. -->
- OS Version: _(e.g. Windows 10)_
- SDK Version: _(e.g. 1.1.0)_
- Environment: _(e.g. Node 18.16.0)_

### Sample Code Snippet
<!-- Please provide a code snippet that produces or is relevant to the bug. -->
```js
# Sample Code Snippet
```

### Stack Trace
<!-- Please provide the stack trace that shows the bug. -->
```shell
# Stack Trace
```

### Expected Behavior
<!-- Please outline the expected behavior of the SDK. -->

### Suggested Fix
<!-- If you have a fix or a suggestion for how this bug may be resolved, describe it here. -->
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Bandwidth Support
url: https://www.bandwidth.com/support/
about: Current customers can create tickets for our Support Team here.
68 changes: 68 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Deploy SDK

on:
release:
types:
- published

jobs:
deploy:
name: Deploy SDK to NPM
runs-on: ubuntu-latest
env:
BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }}
BW_USERNAME: ${{ secrets.BW_USERNAME }}
BW_PASSWORD: ${{ secrets.BW_PASSWORD }}
BW_USERNAME_FORBIDDEN: ${{ secrets.BW_USERNAME_FORBIDDEN }}
BW_PASSWORD_FORBIDDEN: ${{ secrets.BW_PASSWORD_FORBIDDEN }}
BW_VOICE_APPLICATION_ID: ${{ secrets.BW_VOICE_APPLICATION_ID }}
BW_MESSAGING_APPLICATION_ID: ${{ secrets.BW_MESSAGING_APPLICATION_ID }}
BW_NUMBER: ${{ secrets.BW_NUMBER }}
USER_NUMBER: ${{ secrets.USER_NUMBER }}
BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }}
OPERATING_SYSTEM: "ubuntu"
MANTECA_ACTIVE_NUMBER: ${{ secrets.MANTECA_ACTIVE_NUMBER }}
MANTECA_IDLE_NUMBER: ${{ secrets.MANTECA_IDLE_NUMBER }}
MANTECA_BASE_URL: ${{ secrets.MANTECA_BASE_URL }}
MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_APPLICATION_ID }}
BW_NUMBER_PROVIDER: ${{ secrets.BW_NUMBER_PROVIDER }}

steps:
- name: Set Release Version
run: |
RELEASE_VERSION=${GITHUB_REF#refs/tags/v}
if [[ $RELEASE_VERSION =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-(beta|alpha|rc))(\.[0-9][0-9]*)?$ ]]; then
echo "PACKAGE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
else
echo 'Tag does not match expected semver regex pattern (^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-(beta|alpha|rc))(\.[0-9][0-9]*)?$)'
echo $RELEASE_VERSION
echo 'Please update your tag to match the expected regex pattern'
exit 1
fi

- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install Packages and Test
run: |
npm i
npm test

- name: Publish npm Package
run: |
npm version $PACKAGE_VERSION --no-git-tag-version
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

- uses: Bandwidth/[email protected]
if: always()
with:
job-status: ${{ job.status }}
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
slack-channel: ${{ secrets.SLACK_CHANNEL }}
64 changes: 64 additions & 0 deletions .github/workflows/test-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Test Main Branch Nightly

on:
schedule:
- cron: "0 4 * * *"

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

env:
BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }}
BW_USERNAME: ${{ secrets.BW_USERNAME }}
BW_PASSWORD: ${{ secrets.BW_PASSWORD }}
BW_USERNAME_FORBIDDEN: ${{ secrets.BW_USERNAME_FORBIDDEN }}
BW_PASSWORD_FORBIDDEN: ${{ secrets.BW_PASSWORD_FORBIDDEN }}
BW_VOICE_APPLICATION_ID: ${{ secrets.BW_VOICE_APPLICATION_ID }}
BW_MESSAGING_APPLICATION_ID: ${{ secrets.BW_MESSAGING_APPLICATION_ID }}
BW_NUMBER: ${{ secrets.BW_NUMBER }}
USER_NUMBER: ${{ secrets.USER_NUMBER }}
BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }}
MANTECA_ACTIVE_NUMBER: ${{ secrets.MANTECA_ACTIVE_NUMBER }}
MANTECA_IDLE_NUMBER: ${{ secrets.MANTECA_IDLE_NUMBER }}
MANTECA_BASE_URL: ${{ secrets.MANTECA_BASE_URL }}
MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_APPLICATION_ID }}

jobs:
test_main:
name: Test Main Branch Nightly
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2022, windows-2019, ubuntu-20.04, ubuntu-22.04]
node-version: [16, 18, 20]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: "main"

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install Packages and Test
run: |
yarn
yarn test
env:
OPERATING_SYSTEM: ${{ matrix.os }}

notify_for_failures:
name: Notify for Failures
needs: [test_main]
if: failure()
runs-on: ubuntu-latest
steps:
- name: Notify Slack of Failures
uses: Bandwidth/[email protected]
with:
job-status: failure
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
slack-channel: ${{ secrets.SLACK_CHANNEL }}
48 changes: 48 additions & 0 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Test PR

on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

env:
BW_ACCOUNT_ID: ${{ secrets.BW_ACCOUNT_ID }}
BW_USERNAME: ${{ secrets.BW_USERNAME }}
BW_PASSWORD: ${{ secrets.BW_PASSWORD }}
BW_USERNAME_FORBIDDEN: ${{ secrets.BW_USERNAME_FORBIDDEN }}
BW_PASSWORD_FORBIDDEN: ${{ secrets.BW_PASSWORD_FORBIDDEN }}
BW_VOICE_APPLICATION_ID: ${{ secrets.BW_VOICE_APPLICATION_ID }}
BW_MESSAGING_APPLICATION_ID: ${{ secrets.BW_MESSAGING_APPLICATION_ID }}
BW_NUMBER: ${{ secrets.BW_NUMBER }}
USER_NUMBER: ${{ secrets.USER_NUMBER }}
BASE_CALLBACK_URL: ${{ secrets.BASE_CALLBACK_URL }}
MANTECA_ACTIVE_NUMBER: ${{ secrets.MANTECA_ACTIVE_NUMBER }}
MANTECA_IDLE_NUMBER: ${{ secrets.MANTECA_IDLE_NUMBER }}
MANTECA_BASE_URL: ${{ secrets.MANTECA_BASE_URL }}
MANTECA_APPLICATION_ID: ${{ secrets.MANTECA_APPLICATION_ID }}

jobs:
test_pr:
name: Test PR
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2022, windows-2019, ubuntu-20.04, ubuntu-22.04]
node-version: [16, 18, 20]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install Packages and Test
run: |
yarn
yarn test
env:
OPERATING_SYSTEM: ${{ matrix.os }}
95 changes: 95 additions & 0 deletions .github/workflows/update-sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Update SDK

on:
schedule:
- cron: "0 14 * * 2"
workflow_dispatch:

jobs:
update-sdk:
name: Update SDK if Necessary
runs-on: ubuntu-latest
outputs:
generate: ${{ steps.compare.outputs.generate }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Combine Product Specs
uses: Bandwidth/[email protected]
with:
token: ${{ secrets.DX_GITHUB_TOKEN }}

- name: Determine if a New SDK is Needed
id: compare
run: |
if cmp -s "bandwidth.yml" "api-specs/bandwidth.yml"; then :; else mv -f api-specs/bandwidth.yml bandwidth.yml; rm -r -f api-specs; echo "generate=true" >> $GITHUB_OUTPUT; fi

- name: Create JIRA Card for SDK Update
if: ${{ steps.compare.outputs.generate == 'true' }}
id: jira
run: |
JIRA_KEY=$(jq -r '.key' <<< $(curl -s -u $JIRA_USERNAME:$JIRA_TOKEN \
-X POST https://bandwidth-jira.atlassian.net/rest/api/2/issue \
-H "Content-Type: application/json" \
--data-binary @- << EOF
{
"fields": {
"project": {
"key": "SWI"
},
"summary": "[$LANGUAGE] Update SDK for New Spec Version",
"description": "Prepare the $LANGUAGE SDK for release based on the latest spec changes.",
"issuetype": {
"name": "Story"
},
"customfield_12108": "$LANGUAGE SDK is ready for release. Tests are created/updated if need be.",
"customfield_10205": "$EPIC",
"components": [{
"name": "Client SDKs"
}]
}
}
EOF
))
echo "jira-key=$JIRA_KEY" >> $GITHUB_OUTPUT
env:
LANGUAGE: Node
EPIC: SWI-1876
JIRA_USERNAME: ${{ secrets.JIRA_USERNAME }}
JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }}

- name: Build SDK
id: build
if: ${{ startsWith(steps.jira.outputs.jira-key, 'SWI') }}
uses: Bandwidth/[email protected]
with:
branch-name: ${{ steps.jira.outputs.jira-key }}
token: ${{ secrets.DX_GITHUB_TOKEN }}
openapi-generator-version: 7.0.0
language: typescript-axios
config: ./openapi-config.yml

- name: Setup Node
if: steps.build.outputs.changes
uses: actions/setup-node@v4

- name: Open Pull Request
if: steps.build.outputs.changes
run: |
gh pr create -B main -H Bandwidth:${{ steps.jira.outputs.jira-key }} -t '${{ steps.jira.outputs.jira-key }} Update SDK Based on Recent Spec Changes' -b 'Auto-generated by Update SDK Workflow'
env:
GITHUB_TOKEN: ${{ secrets.DX_GITHUB_TOKEN }}

notify-for-failures:
name: Notify for Failures
needs: [update-sdk]
if: failure()
runs-on: ubuntu-latest
steps:
- name: Notify Slack of Failures
uses: Bandwidth/[email protected]
with:
job-status: failure
slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }}
slack-channel: ${{ secrets.SLACK_CHANNEL }}
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
wwwroot/*.js
node_modules
typings
dist
yarn.lock
package-lock.json
coverage/
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm
4 changes: 4 additions & 0 deletions .openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

.gitignore
Loading