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

release: 2.24.0 #391

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 20 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,26 @@ jobs:
node-version: '18'

- name: Install dependencies
run: |
yarn install
run: yarn install

- name: Check types
run: |
yarn build
run: ./scripts/lint
test:
name: test
runs-on: ubuntu-latest
if: github.repository == 'Modern-Treasury/modern-treasury-node'

steps:
- uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '18'

- name: Bootstrap
run: ./scripts/bootstrap

- name: Run tests
run: ./scripts/test


1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
node_modules
yarn-error.log
codegen.log
Brewfile.lock.json
dist
/deno
/*.tgz
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.23.0"
".": "2.24.0"
}
3 changes: 2 additions & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
configured_endpoints: 162
configured_endpoints: 158
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/modern-treasury-b8ef1dc20de340169529881f53e2a23e68dc24d7578316d167a098884250512a.yml
1 change: 1 addition & 0 deletions Brewfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
brew "node"
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
# Changelog

## 2.24.0 (2024-05-28)

Full Changelog: [v2.23.0...v2.24.0](https://github.com/Modern-Treasury/modern-treasury-node/compare/v2.23.0...v2.24.0)

### Features

* **api:** add currency to ledger account categories ([#405](https://github.com/Modern-Treasury/modern-treasury-node/issues/405)) ([84bc4a0](https://github.com/Modern-Treasury/modern-treasury-node/commit/84bc4a0f89ba2abd4c232cd346a0978d9f437bda))
* **api:** invoice overdue reminders ([59e3638](https://github.com/Modern-Treasury/modern-treasury-node/commit/59e36383759b57f7c30277a1bb4eda746720a8f7))
* **api:** mark ConnectionLegalEntity response properties as required ([#407](https://github.com/Modern-Treasury/modern-treasury-node/issues/407)) ([843dd77](https://github.com/Modern-Treasury/modern-treasury-node/commit/843dd7759ae5eded8ac565816ea26c837885a69b))
* **api:** remove deprecated ledger account payouts ([#406](https://github.com/Modern-Treasury/modern-treasury-node/issues/406)) ([59e3638](https://github.com/Modern-Treasury/modern-treasury-node/commit/59e36383759b57f7c30277a1bb4eda746720a8f7))
* **api:** updates ([#395](https://github.com/Modern-Treasury/modern-treasury-node/issues/395)) ([d627950](https://github.com/Modern-Treasury/modern-treasury-node/commit/d6279508016f41e6c4e095ea555313508ff64314))


### Bug Fixes

* **package:** revert recent client file change ([#398](https://github.com/Modern-Treasury/modern-treasury-node/issues/398)) ([e25a0fa](https://github.com/Modern-Treasury/modern-treasury-node/commit/e25a0fab22a47c779aac58d14d87cec0a3768442))


### Chores

* **docs:** add SECURITY.md ([#401](https://github.com/Modern-Treasury/modern-treasury-node/issues/401)) ([7da6a83](https://github.com/Modern-Treasury/modern-treasury-node/commit/7da6a8304155395bc5c0d0984df76d665306350e))
* **docs:** streamline payment purpose and vendor failure handling ([#402](https://github.com/Modern-Treasury/modern-treasury-node/issues/402)) ([d816b92](https://github.com/Modern-Treasury/modern-treasury-node/commit/d816b926e4891f4ff0a0da3c64742e87bd0c1348))
* **internal:** add link to openapi spec ([#392](https://github.com/Modern-Treasury/modern-treasury-node/issues/392)) ([272d794](https://github.com/Modern-Treasury/modern-treasury-node/commit/272d79431c4901b9677b58b03b9ea04e828a15eb))
* **internal:** add scripts/test, scripts/mock and add ci job ([#393](https://github.com/Modern-Treasury/modern-treasury-node/issues/393)) ([315be57](https://github.com/Modern-Treasury/modern-treasury-node/commit/315be57cb1f4206000e6986123a63789672ec8b4))
* **internal:** add slightly better logging to scripts ([#404](https://github.com/Modern-Treasury/modern-treasury-node/issues/404)) ([27e0062](https://github.com/Modern-Treasury/modern-treasury-node/commit/27e0062215d71db39b8dd840e1e359487c19745d))
* **internal:** forward arguments in scripts/test ([#394](https://github.com/Modern-Treasury/modern-treasury-node/issues/394)) ([f583eaf](https://github.com/Modern-Treasury/modern-treasury-node/commit/f583eafab9e417a1760ab077ee041c9b1d5bb237))
* **internal:** move client class to separate file ([#396](https://github.com/Modern-Treasury/modern-treasury-node/issues/396)) ([8877013](https://github.com/Modern-Treasury/modern-treasury-node/commit/88770139e5265bfc08e7bf7bc142b54bfb9b21bd))
* **internal:** refactor scripts ([#390](https://github.com/Modern-Treasury/modern-treasury-node/issues/390)) ([8f96c06](https://github.com/Modern-Treasury/modern-treasury-node/commit/8f96c069c19c50107d602b2051c48bf9b9f0a417))


### Refactors

* change import paths to be relative ([#403](https://github.com/Modern-Treasury/modern-treasury-node/issues/403)) ([00e1c3a](https://github.com/Modern-Treasury/modern-treasury-node/commit/00e1c3a68fac93d65ea7bfcf1293c79381f6ac46))

## 2.23.0 (2024-04-26)

Full Changelog: [v2.22.0...v2.23.0](https://github.com/Modern-Treasury/modern-treasury-node/compare/v2.22.0...v2.23.0)
Expand Down
27 changes: 27 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Security Policy

## Reporting Security Issues

This SDK is generated by [Stainless Software Inc](http://stainlessapi.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken.

To report a security issue, please contact the Stainless team at security@stainlessapi.com.

## Responsible Disclosure

We appreciate the efforts of security researchers and individuals who help us maintain the security of
SDKs we generate. If you believe you have found a security vulnerability, please adhere to responsible
disclosure practices by allowing us a reasonable amount of time to investigate and address the issue
before making any information public.

## Reporting Non-SDK Related Security Issues

If you encounter security issues that are not directly related to SDKs but pertain to the services
or products provided by Modern Treasury please follow the respective company's security reporting guidelines.

### Modern Treasury Terms and Policies

Please contact sdk-feedback@moderntreasury.com for any questions or concerns regarding security of our services.

---

Thank you for helping us keep the SDKs and systems they interact with secure.
13 changes: 0 additions & 13 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,19 +275,6 @@ Methods:
- <code title="get /api/ledger_account_balance_monitors">client.ledgerAccountBalanceMonitors.<a href="./src/resources/ledger-account-balance-monitors.ts">list</a>({ ...params }) -> LedgerAccountBalanceMonitorsPage</code>
- <code title="delete /api/ledger_account_balance_monitors/{id}">client.ledgerAccountBalanceMonitors.<a href="./src/resources/ledger-account-balance-monitors.ts">del</a>(id) -> LedgerAccountBalanceMonitor</code>

# LedgerAccountPayouts

Types:

- <code><a href="./src/resources/ledger-account-payouts.ts">LedgerAccountPayout</a></code>

Methods:

- <code title="post /api/ledger_account_payouts">client.ledgerAccountPayouts.<a href="./src/resources/ledger-account-payouts.ts">create</a>({ ...params }) -> LedgerAccountPayout</code>
- <code title="get /api/ledger_account_payouts/{id}">client.ledgerAccountPayouts.<a href="./src/resources/ledger-account-payouts.ts">retrieve</a>(id) -> LedgerAccountPayout</code>
- <code title="patch /api/ledger_account_payouts/{id}">client.ledgerAccountPayouts.<a href="./src/resources/ledger-account-payouts.ts">update</a>(id, { ...params }) -> LedgerAccountPayout</code>
- <code title="get /api/ledger_account_payouts">client.ledgerAccountPayouts.<a href="./src/resources/ledger-account-payouts.ts">list</a>({ ...params }) -> LedgerAccountPayoutsPage</code>

# LedgerAccountStatements

Types:
Expand Down
50 changes: 0 additions & 50 deletions bin/check-test-server

This file was deleted.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "modern-treasury",
"version": "2.23.0",
"version": "2.24.0",
"description": "The official TypeScript library for the Modern Treasury API",
"author": "Modern Treasury <sdk-feedback@moderntreasury.com>",
"types": "dist/index.d.ts",
Expand All @@ -15,13 +15,13 @@
"private": false,
"scripts": {
"test": "./scripts/test",
"build": "bash ./build",
"build": "./scripts/build",
"prepack": "echo 'to pack, run yarn build && (cd dist; yarn pack)' && exit 1",
"prepublishOnly": "echo 'to publish, run yarn build && (cd dist; yarn publish)' && exit 1",
"format": "prettier --write --cache --cache-strategy metadata . !dist",
"prepare": "if ./scripts/check-is-in-git-install.sh; then npm run build; fi",
"prepare": "if ./scripts/utils/check-is-in-git-install.sh; then ./scripts/build; fi",
"tsn": "ts-node -r tsconfig-paths/register",
"lint": "eslint --ext ts,js .",
"lint": "./scripts/lint",
"fix": "eslint --fix --ext ts,js ."
},
"dependencies": {
Expand Down
18 changes: 18 additions & 0 deletions scripts/bootstrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

set -e

cd "$(dirname "$0")/.."

if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then
brew bundle check >/dev/null 2>&1 || {
echo "==> Installing Homebrew dependencies…"
brew bundle
}
fi

echo "==> Installing Node dependencies…"

PACKAGE_MANAGER=$(command -v yarn >/dev/null 2>&1 && echo "yarn" || echo "npm")

$PACKAGE_MANAGER install
15 changes: 9 additions & 6 deletions build → scripts/build
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/usr/bin/env bash

set -exuo pipefail

node scripts/check-version.cjs
cd "$(dirname "$0")/.."

node scripts/utils/check-version.cjs

# Build into dist and will publish the package from there,
# so that src/resources/foo.ts becomes <package root>/resources/foo.js
Expand All @@ -22,7 +25,7 @@ if [ -e "bin/cli" ]; then
fi
# this converts the export map paths for the dist directory
# and does a few other minor things
node scripts/make-dist-package-json.cjs > dist/package.json
node scripts/utils/make-dist-package-json.cjs > dist/package.json

# build to .js/.mjs/.d.ts files
npm exec tsc-multi
Expand All @@ -32,22 +35,22 @@ cp src/_shims/auto/*.{d.ts,js,mjs} dist/_shims/auto
# we need to add exports = module.exports = Modern Treasury Node to index.js;
# No way to get that from index.ts because it would cause compile errors
# when building .mjs
node scripts/fix-index-exports.cjs
node scripts/utils/fix-index-exports.cjs
# with "moduleResolution": "nodenext", if ESM resolves to index.d.ts,
# it'll have TS errors on the default import. But if it resolves to
# index.d.mts the default import will work (even though both files have
# the same export default statement)
cp dist/index.d.ts dist/index.d.mts
cp tsconfig.dist-src.json dist/src/tsconfig.json

node scripts/postprocess-files.cjs
node scripts/utils/postprocess-files.cjs

# make sure that nothing crashes when we require the output CJS or
# import the output ESM
(cd dist && node -e 'require("modern-treasury")')
(cd dist && node -e 'import("modern-treasury")' --input-type=module)

if command -v deno &> /dev/null && [ -e ./build-deno ]
if command -v deno &> /dev/null && [ -e ./scripts/build-deno ]
then
./build-deno
./scripts/build-deno
fi
8 changes: 8 additions & 0 deletions scripts/format
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

set -e

cd "$(dirname "$0")/.."

echo "==> Running eslint --fix"
./node_modules/.bin/eslint --fix --ext ts,js .
8 changes: 8 additions & 0 deletions scripts/lint
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

set -e

cd "$(dirname "$0")/.."

echo "==> Running eslint"
./node_modules/.bin/eslint --ext ts,js .
13 changes: 10 additions & 3 deletions scripts/mock
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#!/usr/bin/env bash

if [ -z "$1" ]; then
set -e

cd "$(dirname "$0")/.."

if [[ -n "$1" && "$1" != '--'* ]]; then
URL="$1"
shift
else
Expand All @@ -13,11 +17,14 @@ if [ -z "$URL" ]; then
exit 1
fi

echo "==> Starting mock server with URL ${URL}"

# Run prism mock on the given spec
if [ "$1" == "--daemon" ]; then
npm exec prism mock "$URL" &> .prism.log &
npm exec --package=@stoplight/prism-cli@~5.8 -- prism mock "$URL" &> .prism.log &

# Wait for server to come online
echo -n "Waiting for server"
while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do
echo -n "."
sleep 0.1
Expand All @@ -30,5 +37,5 @@ if [ "$1" == "--daemon" ]; then

echo
else
npm exec prism mock "$URL"
npm exec --package=@stoplight/prism-cli@~5.8 -- prism mock "$URL"
fi
41 changes: 34 additions & 7 deletions scripts/test
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
#!/usr/bin/env bash

set -e

cd "$(dirname "$0")/.."

RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
NC='\033[0m' # No Color

function prism_is_running() {
curl --silent "http://localhost:4010" >/dev/null 2>&1
}
Expand All @@ -12,18 +21,36 @@ kill_server_on_port() {
fi
}

if ! prism_is_running; then
function is_overriding_api_base_url() {
[ -n "$TEST_API_BASE_URL" ]
}

if ! is_overriding_api_base_url && ! prism_is_running ; then
# When we exit this script, make sure to kill the background mock server process
trap 'kill_server_on_port 4010' EXIT

# Start the dev server
./scripts/mock --daemon
fi

# Sanity check and print a nice error message
if ! ./bin/check-test-server; then
exit
fi
if is_overriding_api_base_url ; then
echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}"
echo
elif ! prism_is_running ; then
echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server"
echo -e "running against your OpenAPI spec."
echo
echo -e "To run the server, pass in the path or url of your OpenAPI"
echo -e "spec to the prism command:"
echo
echo -e " \$ ${YELLOW}npm exec --package=@stoplight/prism-cli@~5.3.2 -- prism mock path/to/your.openapi.yml${NC}"
echo

exit 1
else
echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}"
echo
fi

# Run tests
./node_modules/.bin/jest
echo "==> Running tests"
./node_modules/.bin/jest "$@"