From 1cddfd6e85cdbdc80a79c6818f6fe8461968b684 Mon Sep 17 00:00:00 2001 From: jrea Date: Wed, 27 Mar 2024 15:44:39 -0400 Subject: [PATCH] fix(server): use env vars, add fake phone home, integration tests --- lib/nile/CHANGELOG.md | 1397 ----------------- lib/nile/package.json | 50 - packages/server/.gitignore | 3 +- packages/server/README.md | 55 +- packages/server/jest.config.js | 8 +- packages/server/package.json | 6 +- packages/server/src/Server.test.ts | 5 +- packages/server/src/Server.ts | 15 +- packages/server/src/auth/auth.test.ts | 2 + packages/server/src/db/db.test.ts | 2 + packages/server/src/tenants/tenants.test.ts | 2 + packages/server/src/types.ts | 9 +- packages/server/src/users/users.test.ts | 2 + packages/server/src/utils/Config.ts | 130 -- packages/server/src/utils/Config/envVars.ts | 70 + packages/server/src/utils/Config/index.ts | 176 +++ packages/server/src/utils/Logger.ts | 23 + packages/server/src/utils/blockingFetch.ts | 38 - packages/server/src/utils/fetch.ts | 57 +- .../test/integration/integration.test.ts | 51 + yarn.lock | 62 +- 21 files changed, 504 insertions(+), 1659 deletions(-) delete mode 100644 lib/nile/CHANGELOG.md delete mode 100644 lib/nile/package.json delete mode 100644 packages/server/src/utils/Config.ts create mode 100644 packages/server/src/utils/Config/envVars.ts create mode 100644 packages/server/src/utils/Config/index.ts create mode 100644 packages/server/src/utils/Logger.ts delete mode 100644 packages/server/src/utils/blockingFetch.ts create mode 100644 packages/server/test/integration/integration.test.ts diff --git a/lib/nile/CHANGELOG.md b/lib/nile/CHANGELOG.md deleted file mode 100644 index ef46bc4c..00000000 --- a/lib/nile/CHANGELOG.md +++ /dev/null @@ -1,1397 +0,0 @@ -# Change Log - -All notable changes to this project will be documented in this file. -See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -# [2.0.0](https://github.com/niledatabase/nile-js/compare/v1.0.0...v2.0.0) (2024-03-25) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0](https://github.com/niledatabase/nile-js/compare/v1.0.0-alpha.202...v1.0.0) (2024-03-25) - -### Reverts - -- Revert "v1.0.0" ([6e8b04d](https://github.com/niledatabase/nile-js/commit/6e8b04dd13fe94a7f728bbc337c4d1167bd418f0)) -- Revert "v1.0.0" ([5ba064c](https://github.com/niledatabase/nile-js/commit/5ba064c143021867bdfe5c1240719e6b3dd9796e)) -- Revert "v2.0.0" ([d9c3663](https://github.com/niledatabase/nile-js/commit/d9c3663bf46a19fdde9ed41f99646755dc989ed1)) - -# [1.0.0-alpha.202](https://github.com/niledatabase/nile-js/compare/v1.0.0-alpha.201...v1.0.0-alpha.202) (2024-03-23) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.201](https://github.com/niledatabase/nile-js/compare/v1.0.0-alpha.200...v1.0.0-alpha.201) (2024-03-22) - -### Bug Fixes - -- remove tsdx from server ([ab90a21](https://github.com/niledatabase/nile-js/commit/ab90a21cb01789c2d0694c959a53aa36a230b444)) - -### Features - -- add listUser and updateUser to server API ([fdca116](https://github.com/niledatabase/nile-js/commit/fdca116e925c2d8df4470693e4ad77f389304f42)) - -# [1.0.0-alpha.200](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.199...v1.0.0-alpha.200) (2023-11-08) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.199](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.198...v1.0.0-alpha.199) (2023-10-27) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.198](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.197...v1.0.0-alpha.198) (2023-10-23) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.197](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.196...v1.0.0-alpha.197) (2023-10-20) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.196](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.195...v1.0.0-alpha.196) (2023-10-19) - -### Bug Fixes - -- tenant isolation ([8eb1e96](https://github.com/TheNileDev/nile-js/commit/8eb1e96cfb4aa024799abee0924c4abb2e680f44)) - -# [1.0.0-alpha.195](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.194...v1.0.0-alpha.195) (2023-10-11) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.194](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.193...v1.0.0-alpha.194) (2023-09-08) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.193](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.192...v1.0.0-alpha.193) (2023-08-16) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.192](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.191...v1.0.0-alpha.192) (2023-08-15) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.191](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.190...v1.0.0-alpha.191) (2023-08-11) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.190](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.189...v1.0.0-alpha.190) (2023-08-11) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.189](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.188...v1.0.0-alpha.189) (2023-08-11) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.188](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.187...v1.0.0-alpha.188) (2023-08-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.187](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.186...v1.0.0-alpha.187) (2023-08-07) - -### Bug Fixes - -- update spec, add sso login ([f28327b](https://github.com/TheNileDev/nile-js/commit/f28327b3e33caaf01c95970fc95946fdbb007316)) - -### Features - -- add okta rest and form ([1431cb5](https://github.com/TheNileDev/nile-js/commit/1431cb571787b70f50c83d1bf657c64a89d759a8)) - -# [1.0.0-alpha.186](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.185...v1.0.0-alpha.186) (2023-06-14) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.185](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.184...v1.0.0-alpha.185) (2023-06-14) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.184](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.183...v1.0.0-alpha.184) (2023-06-02) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.183](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.182...v1.0.0-alpha.183) (2023-06-02) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.182](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.181...v1.0.0-alpha.182) (2023-06-01) - -### Bug Fixes - -- **server:** type things better ([2eee417](https://github.com/TheNileDev/nile-js/commit/2eee41789c6df717f0ff88c6167033468e11c94e)) - -# [1.0.0-alpha.181](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.180...v1.0.0-alpha.181) (2023-05-25) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.180](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.179...v1.0.0-alpha.180) (2023-05-18) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.179](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.178...v1.0.0-alpha.179) (2023-05-17) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.178](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.177...v1.0.0-alpha.178) (2023-05-17) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.177](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.176...v1.0.0-alpha.177) (2023-05-12) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.176](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.175...v1.0.0-alpha.176) (2023-05-12) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.175](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.174...v1.0.0-alpha.175) (2023-05-12) - -### Bug Fixes - -- more tests, request correctly ([e382e75](https://github.com/TheNileDev/nile-js/commit/e382e75424e01b1f4a28bb8427adf5ee2091600c)) - -# [1.0.0-alpha.174](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.173...v1.0.0-alpha.174) (2023-05-11) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.173](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.172...v1.0.0-alpha.173) (2023-05-11) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.172](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.171...v1.0.0-alpha.172) (2023-05-11) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.171](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.170...v1.0.0-alpha.171) (2023-05-11) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.170](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.169...v1.0.0-alpha.170) (2023-05-11) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.169](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.168...v1.0.0-alpha.169) (2023-05-11) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.168](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.167...v1.0.0-alpha.168) (2023-05-11) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.167](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.166...v1.0.0-alpha.167) (2023-05-11) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.166](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.165...v1.0.0-alpha.166) (2023-05-11) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.165](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.164...v1.0.0-alpha.165) (2023-05-11) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.164](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.163...v1.0.0-alpha.164) (2023-05-11) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.163](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.162...v1.0.0-alpha.163) (2023-05-11) - -### Bug Fixes - -- add sign up ([dd67c3b](https://github.com/TheNileDev/nile-js/commit/dd67c3b3ca90f7cfba7ec1b43ba0333a9f057084)) - -# [1.0.0-alpha.162](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.161...v1.0.0-alpha.162) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.161](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.160...v1.0.0-alpha.161) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.160](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.159...v1.0.0-alpha.160) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.159](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.158...v1.0.0-alpha.159) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.158](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.157...v1.0.0-alpha.158) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.157](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.156...v1.0.0-alpha.157) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.156](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.155...v1.0.0-alpha.156) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.155](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.154...v1.0.0-alpha.155) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.154](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.153...v1.0.0-alpha.154) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.153](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.152...v1.0.0-alpha.153) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.152](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.151...v1.0.0-alpha.152) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.151](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.150...v1.0.0-alpha.151) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.150](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.149...v1.0.0-alpha.150) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.149](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.148...v1.0.0-alpha.149) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.148](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.147...v1.0.0-alpha.148) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.147](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.146...v1.0.0-alpha.147) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.146](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.145...v1.0.0-alpha.146) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.145](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.144...v1.0.0-alpha.145) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.144](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.143...v1.0.0-alpha.144) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.143](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.142...v1.0.0-alpha.143) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.142](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.141...v1.0.0-alpha.142) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.141](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.140...v1.0.0-alpha.141) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.140](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.139...v1.0.0-alpha.140) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.139](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.138...v1.0.0-alpha.139) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.138](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.137...v1.0.0-alpha.138) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.137](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.136...v1.0.0-alpha.137) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.136](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.135...v1.0.0-alpha.136) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.135](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.134...v1.0.0-alpha.135) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.134](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.133...v1.0.0-alpha.134) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.133](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.132...v1.0.0-alpha.133) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.132](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.131...v1.0.0-alpha.132) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.131](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.130...v1.0.0-alpha.131) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.130](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.129...v1.0.0-alpha.130) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.129](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.128...v1.0.0-alpha.129) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.128](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.127...v1.0.0-alpha.128) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.127](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.126...v1.0.0-alpha.127) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.126](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.125...v1.0.0-alpha.126) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.125](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.124...v1.0.0-alpha.125) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.124](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.123...v1.0.0-alpha.124) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.123](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.122...v1.0.0-alpha.123) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.122](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.121...v1.0.0-alpha.122) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.121](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.120...v1.0.0-alpha.121) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.120](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.119...v1.0.0-alpha.120) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.119](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.118...v1.0.0-alpha.119) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.118](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.117...v1.0.0-alpha.118) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.117](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.116...v1.0.0-alpha.117) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.116](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.115...v1.0.0-alpha.116) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.115](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.114...v1.0.0-alpha.115) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.114](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.113...v1.0.0-alpha.114) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.113](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.112...v1.0.0-alpha.113) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.112](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.111...v1.0.0-alpha.112) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.111](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.110...v1.0.0-alpha.111) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.110](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.109...v1.0.0-alpha.110) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.109](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.108...v1.0.0-alpha.109) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.108](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.107...v1.0.0-alpha.108) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.107](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.106...v1.0.0-alpha.107) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.106](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.105...v1.0.0-alpha.106) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.105](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.104...v1.0.0-alpha.105) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.104](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.103...v1.0.0-alpha.104) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.103](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.102...v1.0.0-alpha.103) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.102](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.101...v1.0.0-alpha.102) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.101](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.100...v1.0.0-alpha.101) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.100](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.99...v1.0.0-alpha.100) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.99](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.98...v1.0.0-alpha.99) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.98](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.97...v1.0.0-alpha.98) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.97](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.96...v1.0.0-alpha.97) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.96](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.95...v1.0.0-alpha.96) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.95](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.94...v1.0.0-alpha.95) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.94](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.93...v1.0.0-alpha.94) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.93](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.92...v1.0.0-alpha.93) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.92](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.91...v1.0.0-alpha.92) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.91](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.90...v1.0.0-alpha.91) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.90](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.89...v1.0.0-alpha.90) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.89](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.88...v1.0.0-alpha.89) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.88](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.87...v1.0.0-alpha.88) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.87](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.86...v1.0.0-alpha.87) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.86](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.85...v1.0.0-alpha.86) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.85](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.84...v1.0.0-alpha.85) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.84](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.83...v1.0.0-alpha.84) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.83](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.82...v1.0.0-alpha.83) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.82](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.81...v1.0.0-alpha.82) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.81](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.80...v1.0.0-alpha.81) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.80](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.79...v1.0.0-alpha.80) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.79](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.78...v1.0.0-alpha.79) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.78](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.77...v1.0.0-alpha.78) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.77](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.76...v1.0.0-alpha.77) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.76](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.75...v1.0.0-alpha.76) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.75](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.74...v1.0.0-alpha.75) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.74](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.73...v1.0.0-alpha.74) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.73](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.72...v1.0.0-alpha.73) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.72](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.71...v1.0.0-alpha.72) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.71](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.70...v1.0.0-alpha.71) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.70](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.69...v1.0.0-alpha.70) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.69](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.68...v1.0.0-alpha.69) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.68](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.67...v1.0.0-alpha.68) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.67](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.66...v1.0.0-alpha.67) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.66](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.65...v1.0.0-alpha.66) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.65](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.64...v1.0.0-alpha.65) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.64](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.63...v1.0.0-alpha.64) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.63](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.62...v1.0.0-alpha.63) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.62](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.61...v1.0.0-alpha.62) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.61](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.60...v1.0.0-alpha.61) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.60](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.59...v1.0.0-alpha.60) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.59](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.58...v1.0.0-alpha.59) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.58](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.57...v1.0.0-alpha.58) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.57](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.56...v1.0.0-alpha.57) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.56](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.55...v1.0.0-alpha.56) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.55](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.54...v1.0.0-alpha.55) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.54](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.53...v1.0.0-alpha.54) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.53](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.52...v1.0.0-alpha.53) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.52](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.51...v1.0.0-alpha.52) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.51](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.50...v1.0.0-alpha.51) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.50](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.49...v1.0.0-alpha.50) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.49](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.48...v1.0.0-alpha.49) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.48](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.47...v1.0.0-alpha.48) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.47](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.46...v1.0.0-alpha.47) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.46](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.45...v1.0.0-alpha.46) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.45](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.44...v1.0.0-alpha.45) (2023-05-10) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.44](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.43...v1.0.0-alpha.44) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.43](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.42...v1.0.0-alpha.43) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.42](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.41...v1.0.0-alpha.42) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.41](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.40...v1.0.0-alpha.41) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.40](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.39...v1.0.0-alpha.40) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.39](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.38...v1.0.0-alpha.39) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.38](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.37...v1.0.0-alpha.38) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.37](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.36...v1.0.0-alpha.37) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.36](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.35...v1.0.0-alpha.36) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.35](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.34...v1.0.0-alpha.35) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.34](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.33...v1.0.0-alpha.34) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.33](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.32...v1.0.0-alpha.33) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.32](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.31...v1.0.0-alpha.32) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.31](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.30...v1.0.0-alpha.31) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.30](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.29...v1.0.0-alpha.30) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.29](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.28...v1.0.0-alpha.29) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.28](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.27...v1.0.0-alpha.28) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.27](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.26...v1.0.0-alpha.27) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.26](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.25...v1.0.0-alpha.26) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.25](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.24...v1.0.0-alpha.25) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.24](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.23...v1.0.0-alpha.24) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.23](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.22...v1.0.0-alpha.23) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.22](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.21...v1.0.0-alpha.22) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.21](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.20...v1.0.0-alpha.21) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.20](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.19...v1.0.0-alpha.20) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.19](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.18...v1.0.0-alpha.19) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.18](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.17...v1.0.0-alpha.18) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.17](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.16...v1.0.0-alpha.17) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.16](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.15...v1.0.0-alpha.16) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.15](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.14...v1.0.0-alpha.15) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.14](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.13...v1.0.0-alpha.14) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.13](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.12...v1.0.0-alpha.13) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.12](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.11...v1.0.0-alpha.12) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.11](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.10...v1.0.0-alpha.11) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.10](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.9...v1.0.0-alpha.10) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.9](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.8...v1.0.0-alpha.9) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.8](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.7...v1.0.0-alpha.8) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.7](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.6...v1.0.0-alpha.7) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.6](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.5...v1.0.0-alpha.6) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.5](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.4...v1.0.0-alpha.5) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.4](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.3...v1.0.0-alpha.4) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.3](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.2...v1.0.0-alpha.3) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.2](https://github.com/TheNileDev/nile-js/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (2023-05-09) - -**Note:** Version bump only for package @niledatabase/js - -# [1.0.0-alpha.1](https://github.com/TheNileDev/nile-js/compare/v2.0.0-alpha.0...v1.0.0-alpha.1) (2023-05-09) - -### Reverts - -- Revert "v2.0.0-alpha.0" ([622bc7c](https://github.com/TheNileDev/nile-js/commit/622bc7c4162dca6359c379a15efbbe1073df9715)) - -# [1.0.0-alpha.0](https://github.com/TheNileDev/nile-js/compare/v0.38.2...v1.0.0-alpha.0) (2023-05-09) - -### Features - -- add server/browser ([e858d3d](https://github.com/TheNileDev/nile-js/commit/e858d3d93f1edd55a3efaa7ce37a8a3b359ffec2)) - -## [0.38.2](https://github.com/TheNileDev/nile-js/compare/v0.38.1...v0.38.2) (2023-05-04) - -**Note:** Version bump only for package @niledatabase/js - -## [0.38.1](https://github.com/TheNileDev/nile-js/compare/v0.38.0...v0.38.1) (2023-05-04) - -**Note:** Version bump only for package @niledatabase/js - -# [0.38.0](https://github.com/TheNileDev/nile-js/compare/v0.37.5...v0.38.0) (2023-05-04) - -**Note:** Version bump only for package @niledatabase/js - -## [0.37.5](https://github.com/TheNileDev/nile-js/compare/v0.37.4...v0.37.5) (2023-05-02) - -**Note:** Version bump only for package @niledatabase/js - -## [0.37.4](https://github.com/TheNileDev/nile-js/compare/v0.37.3...v0.37.4) (2023-05-02) - -**Note:** Version bump only for package @niledatabase/js - -## [0.37.3](https://github.com/TheNileDev/nile-js/compare/v0.37.2...v0.37.3) (2023-05-02) - -**Note:** Version bump only for package @niledatabase/js - -## [0.37.2](https://github.com/TheNileDev/nile-js/compare/v0.37.1...v0.37.2) (2023-05-02) - -**Note:** Version bump only for package @niledatabase/js - -## [0.37.1](https://github.com/TheNileDev/nile-js/compare/v0.37.0...v0.37.1) (2023-05-02) - -**Note:** Version bump only for package @niledatabase/js - -# [0.37.0](https://github.com/TheNileDev/nile-js/compare/v0.36.0...v0.37.0) (2023-05-01) - -**Note:** Version bump only for package @niledatabase/js - -# [0.36.0](https://github.com/TheNileDev/nile-js/compare/v0.35.5...v0.36.0) (2023-04-04) - -### Features - -- remove examples, export more src ([da85422](https://github.com/TheNileDev/nile-js/commit/da85422338d86a27b209f12436a50a6e01b47f2e)) - -## [0.35.5](https://github.com/TheNileDev/nile-js/compare/v0.35.4...v0.35.5) (2023-04-03) - -**Note:** Version bump only for package @niledatabase/js - -## [0.35.4](https://github.com/TheNileDev/nile-js/compare/v0.35.3...v0.35.4) (2023-02-13) - -### Bug Fixes - -- allow null auth token ([fea2bae](https://github.com/TheNileDev/nile-js/commit/fea2bae9d31dbe0db258e6e9d3437803a9b0953a)) - -## [0.35.3](https://github.com/TheNileDev/nile-js/compare/v0.35.2...v0.35.3) (2023-01-26) - -**Note:** Version bump only for package @niledatabase/js - -## [0.35.2](https://github.com/TheNileDev/nile-js/compare/v0.35.1...v0.35.2) (2023-01-26) - -### Bug Fixes - -- update spec ([5fec2ca](https://github.com/TheNileDev/nile-js/commit/5fec2ca324b58bc192c76a3fdad5203da2e60813)) - -## [0.35.1](https://github.com/TheNileDev/nile-js/compare/v0.35.0...v0.35.1) (2023-01-26) - -### Bug Fixes - -- **nile-js:** set token on Nile create ([f1da2e9](https://github.com/TheNileDev/nile-js/commit/f1da2e9dff7e7bd72e18c9d06b5021936bb0a5d0)) - -# [0.35.0](https://github.com/TheNileDev/nile-js/compare/v0.34.1...v0.35.0) (2023-01-25) - -### Features - -- **nile-js:** add option for token storage ([7329144](https://github.com/TheNileDev/nile-js/commit/7329144e7c9799e08f1bda44526543bbe5d862e5)) - -## [0.34.1](https://github.com/TheNileDev/nile-js/compare/v0.34.0...v0.34.1) (2023-01-25) - -**Note:** Version bump only for package @niledatabase/js - -# [0.34.0](https://github.com/TheNileDev/nile-js/compare/v0.33.1...v0.34.0) (2023-01-25) - -### Features - -- add useVerifyToken ([0b059a3](https://github.com/TheNileDev/nile-js/commit/0b059a35e13c5f73c593d9ab9742aef6e67ecb7f)) - -## [0.33.1](https://github.com/TheNileDev/nile-js/compare/v0.33.0...v0.33.1) (2022-12-13) - -### Bug Fixes - -- **nile-js:** add logout to oidc ([f1fd65e](https://github.com/TheNileDev/nile-js/commit/f1fd65ee466eda4b3523aa7cbb9a0177bed87951)) - -# [0.33.0](https://github.com/TheNileDev/nile-js/compare/v0.32.3...v0.33.0) (2022-12-05) - -### Bug Fixes - -- add response log when network errors occur ([9c6fc08](https://github.com/TheNileDev/nile-js/commit/9c6fc08790c5774f4f3832b94c30561219772018)) - -### Features - -- add oidc urls to client ([97b88a3](https://github.com/TheNileDev/nile-js/commit/97b88a397d2c9a092f055a4f816b5b7698152b0e)) - -## [0.32.3](https://github.com/TheNileDev/nile-js/compare/v0.32.2...v0.32.3) (2022-11-23) - -**Note:** Version bump only for package @niledatabase/js - -## [0.32.2](https://github.com/TheNileDev/nile-js/compare/v0.32.1...v0.32.2) (2022-11-23) - -**Note:** Version bump only for package @niledatabase/js - -## [0.32.1](https://github.com/TheNileDev/nile-js/compare/v0.32.0...v0.32.1) (2022-11-23) - -### Bug Fixes - -- add google login button, svgs in storybook, export Nile config ([3ea3ff3](https://github.com/TheNileDev/nile-js/commit/3ea3ff3954441238cdab3b8e49f1db2af1819129)) -- un-require workspace ([f7b569d](https://github.com/TheNileDev/nile-js/commit/f7b569dc2211b1e7a2b0fa759e982b64cc7ddfbb)) - -# [0.32.0](https://github.com/TheNileDev/nile-js/compare/v0.31.0...v0.32.0) (2022-11-22) - -### Features - -- update spec for oidc ([f1aad39](https://github.com/TheNileDev/nile-js/commit/f1aad395ddd9af3add5d28fc438acce3da5c8c4e)) - -# [0.31.0](https://github.com/TheNileDev/nile-js/compare/v0.30.2...v0.31.0) (2022-11-18) - -**Note:** Version bump only for package @niledatabase/js - -## [0.30.2](https://github.com/TheNileDev/nile-js/compare/v0.30.1...v0.30.2) (2022-11-08) - -**Note:** Version bump only for package @niledatabase/js - -## [0.30.1](https://github.com/TheNileDev/nile-js/compare/v0.30.0...v0.30.1) (2022-11-04) - -### Bug Fixes - -- add generated models back ([e0bf781](https://github.com/TheNileDev/nile-js/commit/e0bf7818f1afafffc1fd859a7fd8a5a94ff84381)) - -# [0.30.0](https://github.com/TheNileDev/nile-js/compare/v0.29.0...v0.30.0) (2022-11-04) - -### Bug Fixes - -- use js-yaml not sed ([3a02860](https://github.com/TheNileDev/nile-js/commit/3a02860c9ab6aceb296225426389ca6ac53b054a)) - -### Features - -- upgrade generator and spec ([10c9f9f](https://github.com/TheNileDev/nile-js/commit/10c9f9f314f09cf2aa11f8e4146ce3743302ccd9)) - -# [0.29.0](https://github.com/TheNileDev/nile-js/compare/v0.28.2...v0.29.0) (2022-11-02) - -**Note:** Version bump only for package @niledatabase/js - -## [0.28.2](https://github.com/TheNileDev/nile-js/compare/v0.28.1...v0.28.2) (2022-10-27) - -**Note:** Version bump only for package @niledatabase/js - -## [0.28.1](https://github.com/TheNileDev/nile-js/compare/v0.28.0...v0.28.1) (2022-10-27) - -**Note:** Version bump only for package @niledatabase/js - -# [0.28.0](https://github.com/TheNileDev/nile-js/compare/v0.27.2...v0.28.0) (2022-10-27) - -### Features - -- query keys for workspace access tokens ([dc9afa5](https://github.com/TheNileDev/nile-js/commit/dc9afa50cd7aa0cb370e018a2e923b22cdc27e7b)) - -## [0.27.2](https://github.com/TheNileDev/nile-js/compare/v0.27.1...v0.27.2) (2022-10-25) - -**Note:** Version bump only for package @niledatabase/js - -## [0.27.1](https://github.com/TheNileDev/nile-js/compare/v0.27.0...v0.27.1) (2022-10-24) - -### Bug Fixes - -- **nile-js:** update spec for accurate metrics aggregate ([3593bf6](https://github.com/TheNileDev/nile-js/commit/3593bf6dbc3f4ea62f7f9ef14ba4bc9099bc8b2a)) - -# [0.27.0](https://github.com/TheNileDev/nile-js/compare/v0.26.0...v0.27.0) (2022-10-19) - -### Features - -- **react:** add aggregations ([#652](https://github.com/TheNileDev/nile-js/issues/652)) ([110d8b6](https://github.com/TheNileDev/nile-js/commit/110d8b6f149ef8ee9c95bc09066ca7ebcf362c2c)) - -# [0.26.0](https://github.com/TheNileDev/nile-js/compare/v0.25.2...v0.26.0) (2022-10-12) - -**Note:** Version bump only for package @niledatabase/js - -## [0.25.2](https://github.com/TheNileDev/nile-js/compare/v0.25.1...v0.25.2) (2022-10-11) - -**Note:** Version bump only for package @niledatabase/js - -## [0.25.1](https://github.com/TheNileDev/nile-js/compare/v0.25.0...v0.25.1) (2022-10-11) - -**Note:** Version bump only for package @niledatabase/js - -# [0.25.0](https://github.com/TheNileDev/nile-js/compare/v0.24.0...v0.25.0) (2022-10-06) - -**Note:** Version bump only for package @niledatabase/js - -# [0.24.0](https://github.com/TheNileDev/nile-js/compare/v0.23.0...v0.24.0) (2022-09-30) - -### Features - -- removeUserFromOrg ([f763130](https://github.com/TheNileDev/nile-js/commit/f763130e31edeb52b7b6a317abf72919c1d5155a)) -- removeUserFromOrg, dynamic spec pull ([9672ce7](https://github.com/TheNileDev/nile-js/commit/9672ce7bdfa296f6f29b2674543bb557942c6f66)) - -# [0.23.0](https://github.com/TheNileDev/nile-js/compare/v0.22.3...v0.23.0) (2022-09-28) - -### Features - -- update spec, add metric aggregate ([856baf5](https://github.com/TheNileDev/nile-js/commit/856baf5cbc098611f48f756687160e862d33955b)) - -## [0.22.3](https://github.com/TheNileDev/nile-js/compare/v0.22.2...v0.22.3) (2022-09-26) - -**Note:** Version bump only for package @niledatabase/js - -## [0.22.2](https://github.com/TheNileDev/nile-js/compare/v0.22.1...v0.22.2) (2022-09-26) - -**Note:** Version bump only for package @niledatabase/js - -## [0.22.1](https://github.com/TheNileDev/nile-js/compare/v0.22.0...v0.22.1) (2022-09-23) - -**Note:** Version bump only for package @niledatabase/js - -# [0.22.0](https://github.com/TheNileDev/nile-js/compare/v0.21.0...v0.22.0) (2022-09-22) - -**Note:** Version bump only for package @niledatabase/js - -# [0.21.0](https://github.com/TheNileDev/nile-js/compare/v0.20.2...v0.21.0) (2022-09-21) - -### Features - -- add metrics ([0291eaa](https://github.com/TheNileDev/nile-js/commit/0291eaa36d63daaf1eb051923a94fa436fe8ca9b)) - -## [0.20.2](https://github.com/TheNileDev/nile-js/compare/v0.20.1...v0.20.2) (2022-09-19) - -### Bug Fixes - -- update readme ([4ac7ed9](https://github.com/TheNileDev/nile-js/commit/4ac7ed98b00ecf60bbb7e36ba4ce4c26b25deabc)) - -## [0.20.1](https://github.com/TheNileDev/nile-js/compare/v0.20.0...v0.20.1) (2022-09-16) - -### Bug Fixes - -- update spec, export types ([f04ef17](https://github.com/TheNileDev/nile-js/commit/f04ef176ef5e7f95121dc8fcb8a48fbf623ee5e1)) - -# [0.20.0](https://github.com/TheNileDev/nile-js/compare/v0.19.1...v0.20.0) (2022-09-16) - -### Features - -- add metrics methods to nile ([923f785](https://github.com/TheNileDev/nile-js/commit/923f785ec0ecfdee1f2b8344a0c316c96dcfa974)) -- update deps ([a76df31](https://github.com/TheNileDev/nile-js/commit/a76df317687977f667f84bb0affd03d0cc6edd18)) - -## [0.19.1](https://github.com/TheNileDev/nile-js/compare/v0.19.0...v0.19.1) (2022-09-12) - -### Bug Fixes - -- user bag of options in spec ([29d0230](https://github.com/TheNileDev/nile-js/commit/29d023002c9761872c0680636126824a28c704f1)) - -# [0.19.0](https://github.com/TheNileDev/nile-js/compare/v0.18.0...v0.19.0) (2022-09-12) - -### Features - -- rename to authz -> policies, user metadata bag ([e5cfb77](https://github.com/TheNileDev/nile-js/commit/e5cfb7775e0f4097de78dc0a53ced81269b3e342)) - -# [0.18.0](https://github.com/TheNileDev/nile-js/compare/v0.17.1...v0.18.0) (2022-09-06) - -### Bug Fixes - -- show better auth error on rebuild ([a983f18](https://github.com/TheNileDev/nile-js/commit/a983f18945057c98fdda980ac7baaddbe6217e80)) - -## [0.17.1](https://github.com/TheNileDev/nile-js/compare/v0.17.0...v0.17.1) (2022-09-01) - -**Note:** Version bump only for package @niledatabase/js - -# [0.17.0](https://github.com/TheNileDev/nile-js/compare/v0.16.3...v0.17.0) (2022-08-30) - -### Bug Fixes - -- add example for Nile.connect ([4932cc2](https://github.com/TheNileDev/nile-js/commit/4932cc28677bcd6c8099467b729ebed6a45d13d9)) - -### Features - -- **nile-js:** spec, connect interface, add authz ([4b431ce](https://github.com/TheNileDev/nile-js/commit/4b431ce6fad7a159cec2063eca200c7e15c95f51)) -- **nile-js:** support for auth token in rebuild ([82f9ccd](https://github.com/TheNileDev/nile-js/commit/82f9ccdb1aa805a182fc13b1ae72c54c5479bc68)) - -## [0.16.3](https://github.com/TheNileDev/nile-js/compare/v0.16.2...v0.16.3) (2022-08-25) - -**Note:** Version bump only for package @niledatabase/js - -## [0.16.2](https://github.com/TheNileDev/nile-js/compare/v0.16.1...v0.16.2) (2022-08-25) - -### Bug Fixes - -- remove nile-agent, pulumi package for self-contained events example ([09f809b](https://github.com/TheNileDev/nile-js/commit/09f809b102ff6a3c44d9a5620c7d88caa4be6841)) - -## [0.16.1](https://github.com/TheNileDev/nile-js/compare/v0.16.0...v0.16.1) (2022-08-18) - -**Note:** Version bump only for package @niledatabase/js - -# [0.16.0](https://github.com/TheNileDev/nile-js/compare/v0.15.0...v0.16.0) (2022-08-18) - -**Note:** Version bump only for package @niledatabase/js - -# [0.15.0](https://github.com/TheNileDev/nile-js/compare/v0.14.2...v0.15.0) (2022-08-17) - -**Note:** Version bump only for package @niledatabase/js - -## [0.14.2](https://github.com/TheNileDev/nile-js/compare/v0.14.1...v0.14.2) (2022-08-17) - -**Note:** Version bump only for package @niledatabase/js - -## [0.14.1](https://github.com/TheNileDev/nile-js/compare/v0.14.0...v0.14.1) (2022-08-17) - -**Note:** Version bump only for package @niledatabase/js - -# [0.14.0](https://github.com/TheNileDev/nile-js/compare/v0.13.1...v0.14.0) (2022-08-16) - -### Bug Fixes - -- **events-example:** linting on events, documentation ([fa464e5](https://github.com/TheNileDev/nile-js/commit/fa464e5a77aedd987aa996b9d47c571908f62ce3)) -- **nile-js:** add typedoc to events class ([e4f66e8](https://github.com/TheNileDev/nile-js/commit/e4f66e8f495d4936432f6a0fb00ed82125ee4bdb)) - -## [0.13.1](https://github.com/TheNileDev/nile-js/compare/v0.13.0...v0.13.1) (2022-08-02) - -### Bug Fixes - -- spec update ([544039f](https://github.com/TheNileDev/nile-js/commit/544039f5bc1055bde0f6a57879d09201bcb40e4d)) - -# [0.13.0](https://github.com/TheNileDev/nile-js/compare/v0.12.7...v0.13.0) (2022-07-22) - -**Note:** Version bump only for package @niledatabase/js - -## [0.12.7](https://github.com/TheNileDev/nile-js/compare/v0.12.6...v0.12.7) (2022-07-19) - -**Note:** Version bump only for package @niledatabase/js - -## [0.12.6](https://github.com/TheNileDev/nile-js/compare/v0.12.5...v0.12.6) (2022-07-14) - -**Note:** Version bump only for package @niledatabase/js - -## [0.12.5](https://github.com/TheNileDev/nile-js/compare/v0.12.4...v0.12.5) (2022-06-14) - -### Bug Fixes - -- make types less voidable ([d3ba4d5](https://github.com/TheNileDev/nile-js/commit/d3ba4d5f4824183bc05dbb17449874158334417a)) - -## [0.12.4](https://github.com/TheNileDev/nile-js/compare/v0.12.3...v0.12.4) (2022-06-14) - -### Bug Fixes - -- use initial workspace ([824c039](https://github.com/TheNileDev/nile-js/commit/824c0399db2dcb360b0599375c5e613c99f051b3)) - -## [0.12.3](https://github.com/TheNileDev/nile-js/compare/v0.12.2...v0.12.3) (2022-06-14) - -### Bug Fixes - -- document API ([6860995](https://github.com/TheNileDev/nile-js/commit/686099541a8acea527fcb485eb0fcf92b036f8de)) - -## [0.12.2](https://github.com/TheNileDev/nile-js/compare/v0.12.1...v0.12.2) (2022-06-07) - -### Bug Fixes - -- update spec ([123a149](https://github.com/TheNileDev/nile-js/commit/123a149a42abe11dd66089128fcff566650d65f2)) - -## [0.12.1](https://github.com/TheNileDev/nile-js/compare/v0.12.0...v0.12.1) (2022-05-31) - -### Bug Fixes - -- updateInstances -> updateInstance ([f9f5427](https://github.com/TheNileDev/nile-js/commit/f9f54276ab610033fb2dddc1e4e86a4e7ce8c498)) - -# [0.12.0](https://github.com/TheNileDev/nile-js/compare/v0.11.1...v0.12.0) (2022-05-31) - -- feat!: add support for workspaces ([8818bab](https://github.com/TheNileDev/nile-js/commit/8818babcdbb58d0e52e826fdfbdebda002bb9e88)) - -### BREAKING CHANGES - -- workspaces are a whole different structure and spec. - -## [0.11.1](https://github.com/TheNileDev/nile-js/compare/v0.11.0...v0.11.1) (2022-05-19) - -### Bug Fixes - -- show errors from the API, add better examples ([fec034f](https://github.com/TheNileDev/nile-js/commit/fec034f427d0712c3c1be5a34602e305180c041c)) - -# [0.11.0](https://github.com/TheNileDev/nile-js/compare/v0.10.1...v0.11.0) (2022-05-12) - -### Features - -- remove useFetch, implement react-query ([26cc6d4](https://github.com/TheNileDev/nile-js/commit/26cc6d4014aa831bf5781bc281636986c1344bc3)) - -## [0.10.1](https://github.com/TheNileDev/nile-js/compare/v0.10.0...v0.10.1) (2022-05-11) - -### Bug Fixes - -- add missing promises, fix forms ([d802d54](https://github.com/TheNileDev/nile-js/commit/d802d5467e869068f45188e6de7ed9105fd38f3c)) -- remove readOnly from spec ([5a89baf](https://github.com/TheNileDev/nile-js/commit/5a89baf86bb20c4a0a16a0de055d62e16a69f787)) - -# [0.10.0](https://github.com/TheNileDev/nile-js/compare/v0.9.0...v0.10.0) (2022-05-11) - -### Features - -- add useNileFetch hook ([471a0e9](https://github.com/TheNileDev/nile-js/commit/471a0e9c9055015b531f797ce99bbd31972c1d32)) - -### BREAKING CHANGES - -- changed sdk interface, added \*Raw functions and cancellation - -# [0.9.0](https://github.com/TheNileDev/nile-js/compare/v0.8.0...v0.9.0) (2022-05-02) - -### Features - -- update cli and api spec ([b8afbd5](https://github.com/TheNileDev/nile-js/commit/b8afbd534c22cb651000f2f06c472fc7f3ba078e)) - -# [0.8.0](https://github.com/TheNileDev/nile-js/compare/v0.7.3...v0.8.0) (2022-04-26) - -### Features - -- fetch latest spec, add cli ([8b03527](https://github.com/TheNileDev/nile-js/commit/8b03527468b76acf8a8f4579d94606c949c9b87f)) - -## [0.7.3](https://github.com/TheNileDev/nile-js/compare/v0.7.2...v0.7.3) (2022-04-12) - -### Bug Fixes - -- add more deps to js lib ([82e4269](https://github.com/TheNileDev/nile-js/commit/82e4269d5640816be3eac293592ef01c0ebfa8fb)) - -## [0.7.2](https://github.com/TheNileDev/nile-js/compare/v0.7.1...v0.7.2) (2022-04-12) - -### Bug Fixes - -- add url-parse as dep, not peer-dep ([f6aecaa](https://github.com/TheNileDev/nile-js/commit/f6aecaa9654572ceff41d7926f069cb0e293b1bc)) - -## [0.7.1](https://github.com/TheNileDev/nile-js/compare/v0.7.0...v0.7.1) (2022-04-12) - -### Bug Fixes - -- add url-parse to deps ([99935de](https://github.com/TheNileDev/nile-js/commit/99935de80cdedd3d890d0f931531190262b0deb5)) - -# [0.7.0](https://github.com/TheNileDev/nile-js/compare/v0.6.1...v0.7.0) (2022-04-11) - -**Note:** Version bump only for package @niledatabase/js - -## [0.6.1](https://github.com/TheNileDev/nile-js/compare/v0.6.0...v0.6.1) (2022-04-08) - -### Bug Fixes - -- only add bearer when auth token is set ([55a03ed](https://github.com/TheNileDev/nile-js/commit/55a03ed73c10608cdbad2af1a1171cd7d59e1867)) - -# [0.6.0](https://github.com/TheNileDev/nile-js/compare/v0.5.5...v0.6.0) (2022-04-07) - -### Features - -- add invites ([c948a3e](https://github.com/TheNileDev/nile-js/commit/c948a3eacbdb9b4d30d43726282680f7767b7663)) - -## [0.5.5](https://github.com/TheNileDev/nile-js/compare/v0.5.4...v0.5.5) (2022-04-07) - -**Note:** Version bump only for package @niledatabase/js - -### Features - -- add invites ([c948a3e](https://github.com/TheNileDev/nile-js/commit/c948a3eacbdb9b4d30d43726282680f7767b7663)) - -## [0.5.5](https://github.com/TheNileDev/nile-js/compare/v0.5.4...v0.5.5) (2022-04-07) - -**Note:** Version bump only for package @niledatabase/js - -## [0.5.4](https://github.com/TheNileDev/nile-js/compare/v0.5.3...v0.5.4) (2022-04-07) - -**Note:** Version bump only for package @niledatabase/js - -## [0.5.3](https://github.com/TheNileDev/nile-js/compare/v0.5.2...v0.5.3) (2022-04-07) - -**Note:** Version bump only for package @niledatabase/js - -## [0.5.2](https://github.com/TheNileDev/nile-js/compare/v0.5.1...v0.5.2) (2022-04-07) - -**Note:** Version bump only for package @niledatabase/js - -## [0.5.1](https://github.com/TheNileDev/nile-js/compare/v0.5.0...v0.5.1) (2022-04-07) - -**Note:** Version bump only for package @niledatabase/js - -# [0.5.0](https://github.com/TheNileDev/nile-js/compare/v0.4.0...v0.5.0) (2022-04-07) - -### Bug Fixes - -- request data from generated files correctly ([2c7be86](https://github.com/TheNileDev/nile-js/commit/2c7be86b2fbab45f26d61fd7596460f0600c4cc0)) - -### Features - -- add autogenerated openapi spec ([17c2557](https://github.com/TheNileDev/nile-js/commit/17c2557040f4b00648d934610f1c2cb3d1f3e240)) - -# [0.4.0](https://github.com/TheNileDev/nile-js/compare/v0.3.1...v0.4.0) (2022-03-30) - -### Features - -- update interface types, add tests ([31e860e](https://github.com/TheNileDev/nile-js/commit/31e860e95b1bcd49da6b06ab05a50cdcf11cd1e0)) - -## [0.3.1](https://github.com/TheNileDev/nile-js/compare/v0.3.0...v0.3.1) (2022-03-29) - -### Bug Fixes - -- update prepare for building types ([1f0b814](https://github.com/TheNileDev/nile-js/commit/1f0b814801a382b14e06f0432b15d987daa1a073)) - -# 0.3.0 (2022-03-29) - -### Bug Fixes - -- export types, better docs ([161ff49](https://github.com/TheNileDev/nile-js/commit/161ff495f889e1d91e02f1c32be0f21fb5255b52)) -- packaging of multiple packages ([cb8b85f](https://github.com/TheNileDev/nile-js/commit/cb8b85f6354afc084087930899662469040c22e3)) - -### Features - -- add create and read to lib, placeholder UI ([a0f9051](https://github.com/TheNileDev/nile-js/commit/a0f90510e142b0b41881b7906837089f7cc6ffea)) -- **nile-js:** add delete ([fd41d68](https://github.com/TheNileDev/nile-js/commit/fd41d68a663c4e778deae3c6d636af12a04a54a6)) -- **nile-js:** add update ([1e8985a](https://github.com/TheNileDev/nile-js/commit/1e8985adb36882bbc7b038af601118c76fb9c3e7)) - -## [0.2.2](https://github.com/TheNileDev/nile-js/compare/v0.2.1...v0.2.2) (2022-03-29) - -**Note:** Version bump only for package @niledatabase/js - -## [0.2.1](https://github.com/TheNileDev/nile-js/compare/v0.2.0...v0.2.1) (2022-03-29) - -### Bug Fixes - -- export types, better docs ([161ff49](https://github.com/TheNileDev/nile-js/commit/161ff495f889e1d91e02f1c32be0f21fb5255b52)) - -# [0.2.0](https://github.com/TheNileDev/nile-js/compare/v0.1.1...v0.2.0) (2022-03-28) - -**Note:** Version bump only for package @niledatabase/js - -## [0.1.1](https://github.com/TheNileDev/nile-js/compare/v0.1.0...v0.1.1) (2022-03-24) - -### Bug Fixes - -- packaging of multiple packages ([cb8b85f](https://github.com/TheNileDev/nile-js/commit/cb8b85f6354afc084087930899662469040c22e3)) - -# 0.1.0 (2022-03-24) - -### Features - -- add create and read to lib, placeholder UI ([a0f9051](https://github.com/TheNileDev/nile-js/commit/a0f90510e142b0b41881b7906837089f7cc6ffea)) -- **nile-js:** add delete ([fd41d68](https://github.com/TheNileDev/nile-js/commit/fd41d68a663c4e778deae3c6d636af12a04a54a6)) -- **nile-js:** add update ([1e8985a](https://github.com/TheNileDev/nile-js/commit/1e8985adb36882bbc7b038af601118c76fb9c3e7)) - -## 0.0.1 (2022-03-23) - -**Note:** Version bump only for package @niledatabase/nile-js diff --git a/lib/nile/package.json b/lib/nile/package.json deleted file mode 100644 index 3f667de0..00000000 --- a/lib/nile/package.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "version": "2.0.0", - "license": "MIT", - "main": "dist/index.js", - "typings": "dist/index.d.ts", - "files": [ - "dist" - ], - "engines": { - "node": ">=18" - }, - "scripts": { - "start": "dts watch", - "build": "dts build --tsconfig ./tsconfig.build.json && yarn build:types", - "prebuild": "./scripts/api-cleaner.mjs && ./scripts/rest-cleaner.mjs && yarn build:api:gen2 && yarn build:api:gen", - "build:types": "tsc -p tsconfig.build.json -d --declarationDir dist --emitDeclarationOnly", - "build:api:gen": "yarn openapi-generator-cli generate --skip-validate-spec -t templates -i spec/api.yaml -g typescript-fetch --package-name @niledatabase/js -o src/client --additional-properties=ngVersion=6.1.7,npmName=theniledev,supportsES6=true,npmVersion=6.9.0,withInterfaces=true,moduleName=Nile,typescriptThreePlus=true,projectName=@niledatabase/js", - "build:api:gen2": "yarn openapi-generator-cli generate --skip-validate-spec -t templates -i spec/api2.yaml -g typescript-fetch --package-name @niledatabase/js -o src/client2 --additional-properties=ngVersion=6.1.7,npmName=theniledev,supportsES6=true,npmVersion=6.9.0,withInterfaces=true,moduleName=Nile,typescriptThreePlus=true,projectName=@niledatabase/js", - "test": "dts test", - "prepare": "yarn prebuild && dts build --tsconfig ./tsconfig.build.json && yarn build:types" - }, - "name": "@niledatabase/js", - "author": "jrea", - "module": "dist/js.esm.js", - "devDependencies": { - "@openapitools/openapi-generator-cli": "^2.7.0", - "@size-limit/preset-small-lib": "^8.2.6", - "@types/jest": "^29.5.9", - "@types/node": "^18.18.11", - "dts-cli": "^2.0.3", - "tslib": "^2.6.2", - "typedoc": "^0.25.3", - "typedoc-plugin-markdown": "^3.17.1", - "typescript": "^4.9.5" - }, - "repository": { - "type": "git", - "url": "https://github.com/niledatabase/nile-js.git", - "directory": "lib/nile" - }, - "publishConfig": { - "access": "public" - }, - "dependencies": { - "es6-promise": "^4.2.8", - "js-yaml": "^4.1.0", - "node-fetch": "^3.3.2", - "sade": "^1.8.1" - } -} diff --git a/packages/server/.gitignore b/packages/server/.gitignore index 53c37a16..503ff42c 100644 --- a/packages/server/.gitignore +++ b/packages/server/.gitignore @@ -1 +1,2 @@ -dist \ No newline at end of file +dist +*.env* \ No newline at end of file diff --git a/packages/server/README.md b/packages/server/README.md index 3c8a3483..d67575f8 100644 --- a/packages/server/README.md +++ b/packages/server/README.md @@ -4,20 +4,59 @@ Consolidates the API and DB for working with Nile. ## Usage +### With configuration object + ```ts import Server from '@niledatabase/server'; const nile = Server({ - databaseId: String(process.env.NILE_DATABASE), - db: { - connection: { - user: process.env.NILE_USER, - password: process.env.NILE_PASSWORD, - }, - }, + user: 'username', + password: 'password', }); -await nile.api.createTenant({name: 'name'}) +await nile.api.createTenant({ name: 'name' }) await nile.db.("todo").withTenant('tenant-id'); ``` + +### With env vars + +```bash +NILEDB_USER=username +NILEDB_PASSWORD=password +``` + +```ts +import Server from '@niledatabase/server'; + +const nile = Server(); + +await nile.api.createTenant({ name: 'name' }) + +await nile.db.("todo").withTenant('tenant-id'); +``` + +## Phone home + +In addition to `user` and `password`, a fully configured SDK must also have values for `db.connection.host`, `databaseName`, and `databaseId`. If the values are not provided in either the `.env` file or the instance configuration, the SDK will automatically phone home to configure itself. For production, it is recommended to set those values. + +## Configuration + +Configuration passed to `Server` takes precedence over `.env` vars. + +| Property | Type | .env var | Description | +| ------------------ | ------------- | --------------- | ------------------------------------------------------------------------------------ | +| databaseId | `string` | NILEDB_ID | ID of the database. | +| username | `string` | NILEDB_USER | Username for database authentication. | +| password | `string` | NILEDB_PASSWORD | Password for database authentication. | +| databaseName | `string` | NILEDB_NAME | Name of the database. | +| tenantId | `string` | NILEDB_TENANT | ID of the tenant associated. | +| userId | `string` | | ID of the user associated. | +| db | `Knex.Config` | | Configuration object for [knex.js](https://knexjs.org/guide/#configuration-options). | +| db.connection.host | `string` | NILEDB_HOST | The host of the database. Default is `db.thenile.dev`. | +| db.connection.port | `number` | NILEDB_PORT | The port of the database. Default is `5432`. | +| api | `object` | | Configuration object for API settings. | +| api.basePath | `string` | NILEDB_API | Base host for API for a specific region. Default is `api.thenile.dev`. | +| api.cookieKey | `string` | | Key for API cookie. Default is `token`. | +| api.token | `string` | NILEDB_TOKEN | Token for API authentication. Mostly for debugging. | +| debug | `boolean` | | Flag for enabling debug mode. | diff --git a/packages/server/jest.config.js b/packages/server/jest.config.js index e7ac0ded..d193c3d1 100644 --- a/packages/server/jest.config.js +++ b/packages/server/jest.config.js @@ -1,11 +1,9 @@ +// eslint-disable-next-line @typescript-eslint/no-var-requires +require('dotenv').config(); + module.exports = { preset: 'ts-jest', testEnvironment: 'node', }; -process.env.USER = ''; -process.env.PASSWORD = ''; -process.env.WORKSPACE = ''; -process.env.DATABASE = ''; -process.env.USER_ID = ''; process.env.NODE_ENV = 'TEST'; diff --git a/packages/server/package.json b/packages/server/package.json index 7d3d85bd..f008138a 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -47,6 +47,7 @@ "@apidevtools/swagger-cli": "^4.0.4", "@babel/core": "^7.23.3", "@types/jest": "^29.5.9", + "@types/sync-fetch": "^0", "@typescript-eslint/parser": "^5.62.0", "babel-loader": "^9.1.3", "dts-cli": "^2.0.3", @@ -63,8 +64,11 @@ }, "dependencies": { "@niledatabase/js": "^2.0.0", + "dotenv": "^16.4.5", + "install": "^0.13.0", "jose": "^4.15.4", "knex": "^2.5.1", - "pg": "^8.11.3" + "pg": "^8.11.3", + "sync-fetch": "^0.5.2" } } diff --git a/packages/server/src/Server.test.ts b/packages/server/src/Server.test.ts index 58493ee6..5dc9ded8 100644 --- a/packages/server/src/Server.test.ts +++ b/packages/server/src/Server.test.ts @@ -1,9 +1,10 @@ import Nile from './Server'; describe('server', () => { - it('has reasonable defaults', () => { + fit('has reasonable defaults', () => { const config = { databaseId: 'databaseId', + databaseName: 'databaseName', username: 'username', password: 'password', }; @@ -11,7 +12,7 @@ describe('server', () => { expect(server.config.db.connection).toEqual({ host: 'db.thenile.dev', port: 5432, - database: 'databaseId', + database: 'databaseName', user: 'username', password: 'password', }); diff --git a/packages/server/src/Server.ts b/packages/server/src/Server.ts index f2322bd7..a505596d 100644 --- a/packages/server/src/Server.ts +++ b/packages/server/src/Server.ts @@ -1,4 +1,4 @@ -import { InstanceConfig, PgConnectionConfig, ServerConfig } from './types'; +import { InstanceConfig, ServerConfig } from './types'; import { Config } from './utils/Config'; import Auth from './auth'; import Users from './users'; @@ -34,7 +34,7 @@ class Server { private servers: Map; constructor(config?: ServerConfig) { - this.config = new Config(config); + this.config = new Config(config as ServerConfig, true); this.servers = new Map(); const [api] = init(this.config); this.api = api; @@ -43,22 +43,23 @@ class Server { watchTenantId((tenantId) => { this.tenantId = tenantId; }); + watchUserId((userId) => { this.userId = userId; }); + watchToken((token) => { this.token = token; }); } setConfig(cfg: Config) { - this.config = new Config(cfg); + this.config = new Config(cfg, false); } set databaseId(val: string | void) { if (val) { this.config.databaseId = val; - (this.config.db.connection as PgConnectionConfig).database = val; this.api.auth.databaseId = val; this.api.users.databaseId = val; this.api.tenants.databaseId = val; @@ -133,7 +134,7 @@ class Server { if (existing) { // be sure the config is up to date - const updatedConfig = new Config(_config); + const updatedConfig = new Config(_config, false); existing.setConfig(updatedConfig); // propagage special config items existing.tenantId = updatedConfig.tenantId; @@ -149,8 +150,8 @@ class Server { } // export default Server; -export default function Nile(config: ServerConfig) { +export default function Nile(config?: ServerConfig) { const server = new Server(config); - server.setConfig(new Config(config as ServerConfig)); + // server.setConfig(new Config(config as ServerConfig, false)); return server; } diff --git a/packages/server/src/auth/auth.test.ts b/packages/server/src/auth/auth.test.ts index 24ae24e8..11ac27e1 100644 --- a/packages/server/src/auth/auth.test.ts +++ b/packages/server/src/auth/auth.test.ts @@ -8,7 +8,9 @@ const baseConfig = [ 'api', 'createProvider', 'databaseId', + 'databaseName', 'db', + 'debug', 'getSSOCallbackUrl', 'listProviders', 'listTenantProviders', diff --git a/packages/server/src/db/db.test.ts b/packages/server/src/db/db.test.ts index 955bc121..22c1ebbf 100644 --- a/packages/server/src/db/db.test.ts +++ b/packages/server/src/db/db.test.ts @@ -5,8 +5,10 @@ describe('db', () => { it('has expected properties', () => { const db = new NileDB({ databaseId: 'databaseId', + databaseName: 'databaseName', username: 'username', password: 'password', + debug: false, db: { connection: { port: 4433 }, }, diff --git a/packages/server/src/tenants/tenants.test.ts b/packages/server/src/tenants/tenants.test.ts index da23c660..0868e0aa 100644 --- a/packages/server/src/tenants/tenants.test.ts +++ b/packages/server/src/tenants/tenants.test.ts @@ -9,7 +9,9 @@ const baseConfig = [ 'createTenant', 'getTenant', 'db', + 'debug', 'databaseId', + 'databaseName', 'username', 'password', ]; diff --git a/packages/server/src/types.ts b/packages/server/src/types.ts index cd7d396f..7183dcaa 100644 --- a/packages/server/src/types.ts +++ b/packages/server/src/types.ts @@ -12,11 +12,13 @@ export type Opts = { }; export type ServerConfig = { - databaseId: string; - username: string; - password: string; + databaseId?: string; + username?: string; + password?: string; + databaseName?: string; tenantId?: string | null | undefined; userId?: string | null | undefined; + debug?: boolean; db?: Knex.Config; api?: { basePath?: string; @@ -31,6 +33,7 @@ export type InstanceConfig = { password: string; tenantId?: string | null | undefined; userId?: string | null | undefined; + debug?: boolean; db?: Knex.Config; api?: { basePath?: string; diff --git a/packages/server/src/users/users.test.ts b/packages/server/src/users/users.test.ts index 1c38add9..85f67c8d 100644 --- a/packages/server/src/users/users.test.ts +++ b/packages/server/src/users/users.test.ts @@ -12,6 +12,8 @@ const baseConfig = [ 'listTenantUsers', 'listUsers', 'me', + 'databaseName', + 'debug', 'updateUser', 'username', 'password', diff --git a/packages/server/src/utils/Config.ts b/packages/server/src/utils/Config.ts deleted file mode 100644 index bbfbb579..00000000 --- a/packages/server/src/utils/Config.ts +++ /dev/null @@ -1,130 +0,0 @@ -import { PgConnectionConfig, PoolConfig, ServerConfig } from '../types'; - -import blockingFetch from './blockingFetch'; - -class ApiConfig { - public cookieKey?: string; - public basePath?: string; - private _token?: string; - constructor({ - basePath, - cookieKey, - token, - }: { - basePath: string; - cookieKey: string; - token: string | undefined; - }) { - this.basePath = basePath; - this.cookieKey = cookieKey; - this._token = token; - } - - public get token(): string | undefined { - return this._token; - } - - public set token(value: string | undefined) { - this._token = value; - } -} - -const niledatabase_url = 'thenile.dev'; -type DBConfig = { - connection: PgConnectionConfig; - pool?: PoolConfig; -}; - -function getBasePath(config?: ServerConfig) { - const database = blockingFetch( - `https://api.${niledatabase_url}/databases/${String(config?.databaseId)}` - ); - const apiUrl = 'apiUrl' in database ? database.apiUrl : ''; - const basePath = config?.api?.basePath ?? apiUrl; - if (basePath) { - return basePath; - } - return `https://api.${niledatabase_url}`; -} - -export class Config { - username: string; - password: string; - databaseId: string; - - db: DBConfig; - - api: ApiConfig; - - private _tenantId?: string | undefined | null; - private _userId?: string | undefined | null; - - public get tenantId(): string | undefined | null { - return this._tenantId; - } - - public set tenantId(value: string | undefined | null) { - this._tenantId = value; - } - - public get userId(): string | undefined | null { - return this._userId; - } - - public set userId(value: string | undefined | null) { - this._userId = value; - } - - constructor(_config?: ServerConfig) { - // always provided - this.databaseId = String(_config?.databaseId); - this.username = String(_config?.username); - this.password = String(_config?.password); - // set the context - this._tenantId = _config?.tenantId; - this._userId = _config?.userId; - // this endpoint does not exist - const basePath = getBasePath(_config); - // api config - this.api = new ApiConfig({ - basePath: String(basePath), - cookieKey: _config?.api?.cookieKey ?? 'token', - token: _config?.api?.token, - }); - - // db config - const host: string = - _config?.db && - _config.db.connection && - typeof _config.db?.connection !== 'string' && - 'host' in _config.db.connection - ? String(_config.db.connection.host) - : `db.${niledatabase_url}`; - - const port: number = - _config?.db?.connection && - typeof _config.db?.connection !== 'string' && - 'port' in _config.db.connection - ? Number(_config.db?.connection?.port) - : 5432; - - const baseCreds = { - user: this.username, - password: this.password, - }; - - const connection = { - host, - port, - database: _config?.databaseId, - ...(typeof _config?.db?.connection === 'object' - ? _config.db.connection - : baseCreds), - } as PgConnectionConfig; - - this.db = { - ..._config?.db, - connection, - }; - } -} diff --git a/packages/server/src/utils/Config/envVars.ts b/packages/server/src/utils/Config/envVars.ts new file mode 100644 index 00000000..b94f70bc --- /dev/null +++ b/packages/server/src/utils/Config/envVars.ts @@ -0,0 +1,70 @@ +import 'dotenv/config'; +import { ServerConfig } from '@niledatabase/server/types'; + +export const getDatbaseId = (_config?: ServerConfig) => + _config?.databaseId ? String(_config?.databaseId) : process.env.NILEDB_ID; + +export const getUsername = (_config?: ServerConfig) => + _config?.username ? String(_config?.username) : process.env.NILEDB_USER; + +export const getPassword = (_config?: ServerConfig) => + _config?.password ? String(_config.password) : process.env.NILEDB_PASSWORD; + +export const getToken = (_config?: ServerConfig) => + _config?.api?.token ? String(_config.api?.token) : process.env.NILEDB_TOKEN; + +export const getDatabaseName = (_config?: ServerConfig) => + _config?.databaseName + ? String(_config.databaseName) + : process.env.NILEDB_NAME; + +export const getTenantId = (_config?: ServerConfig): string | null => { + if (_config?.tenantId) { + return _config.tenantId; + } + if (process.env.NILEDB_TENANT) { + return process.env.NILEDB_TENANT; + } + return null; +}; + +export const getBasePath = (config?: ServerConfig) => { + const basePath = config?.api?.basePath; + if (basePath) { + return basePath; + } + + if (process.env.NILEDB_API) { + return `https://${process.env.NILEDB_API}`; + } + + return 'https://api.thenile.dev'; +}; + +export function getDbHost(_config?: ServerConfig) { + if ( + _config?.db && + _config.db.connection && + typeof _config.db?.connection !== 'string' && + 'host' in _config.db.connection + ) { + return _config.db.connection.host; + } else if (process.env.NILEDB_HOST) { + return process.env.NILEDB_HOST; + } + return 'db.thenile.dev'; +} + +export function getDbPort(_config?: ServerConfig): number { + if ( + _config?.db?.connection && + typeof _config.db?.connection !== 'string' && + 'port' in _config.db.connection + ) { + return Number(_config.db?.connection?.port); + } + if (process.env.NILEDB_PORT) { + return Number(process.env.NILEDB_PORT); + } + return 5432; +} diff --git a/packages/server/src/utils/Config/index.ts b/packages/server/src/utils/Config/index.ts new file mode 100644 index 00000000..664949f1 --- /dev/null +++ b/packages/server/src/utils/Config/index.ts @@ -0,0 +1,176 @@ +import syncFetch from 'sync-fetch'; + +import { PgConnectionConfig, PoolConfig, ServerConfig } from '../../types'; +import Logger from '../Logger'; + +import { + getBasePath, + getDatabaseName, + getDatbaseId, + getDbHost, + getDbPort, + getPassword, + getTenantId, + getToken, + getUsername, +} from './envVars'; + +type Database = { + name: string; + apiHost: string; + dbHost: string; + id: string; + message?: string; // is actually an error +}; +class ApiConfig { + public cookieKey?: string; + public basePath?: string; + private _token?: string; + constructor({ + basePath, + cookieKey, + token, + }: { + basePath: string; + cookieKey: string; + token: string | undefined; + }) { + this.basePath = basePath; + this.cookieKey = cookieKey; + this._token = token; + } + + public get token(): string | undefined { + return this._token; + } + + public set token(value: string | undefined) { + this._token = value; + } +} + +type DBConfig = { + connection: PgConnectionConfig; + pool?: PoolConfig; +}; + +export class Config { + username: string; + password: string; + databaseId: string; + databaseName: string; + + debug: boolean; + + db: DBConfig; + + api: ApiConfig; + + private _tenantId?: string | undefined | null; + private _userId?: string | undefined | null; + + public get tenantId(): string | undefined | null { + return this._tenantId; + } + + public set tenantId(value: string | undefined | null) { + this._tenantId = value; + } + + public get userId(): string | undefined | null { + return this._userId; + } + + public set userId(value: string | undefined | null) { + this._userId = value; + } + + constructor(_config: ServerConfig, allowPhoneHome?: boolean) { + const { info } = Logger(_config, '[config]'); + // always provided + this.databaseId = getDatbaseId(_config) as string; + this.username = getUsername(_config) as string; + this.password = getPassword(_config) as string; + this.databaseName = getDatabaseName(_config) as string; + this._tenantId = getTenantId(_config); + this.debug = Boolean(_config?.debug); + + let basePath = getBasePath(_config); + + let host = getDbHost(_config); + const port = getDbPort(_config); + + this._userId = _config?.userId; + + if (allowPhoneHome && (!host || !this.databaseName || !this.databaseId)) { + const database = phoneHome(_config); + info('[fetched database]', database); + if (process.env.NODE_ENV !== 'TEST') { + if ('message' in database) { + throw new Error( + 'Unable to obtain database config. Please set NILEDB_API, NILEDB_NAME, and NILEDB_HOST to the correct region in your .env file.' + ); + } + + if (typeof database === 'object') { + const { apiHost, dbHost, name, id } = database; + this.databaseId = id; + this.databaseName = name; + // gotta do something dumb here + const dburl = new URL(dbHost); + const apiurl = new URL(apiHost); + host = dburl.host; + basePath = apiurl.origin; + } + } + } + + this.api = new ApiConfig({ + basePath, + cookieKey: _config?.api?.cookieKey ?? 'token', + token: _config?.api?.token, + }); + + const baseCreds = { + user: this.username, + password: this.password, + }; + + const connection = { + host, + port, + database: this.databaseName, + ...(typeof _config?.db?.connection === 'object' + ? _config.db.connection + : baseCreds), + } as PgConnectionConfig; + + this.db = { + ..._config?.db, + connection, + }; + } +} + +function phoneHome(config: ServerConfig): Database { + const basePath = getBasePath(config); + const databaseId = getDatbaseId(config); + const url = `${basePath}/workspaces/nile_check/databases`; + const { info, error } = Logger(config, '[phone home]'); + info(url); + const res = syncFetch(url, { + headers: { + Authorization: `Bearer ${getToken()}`, + }, + }); + const possibleError = res.clone(); + try { + const json = res.json(); + const db = json.find((db: Database) => db.id === databaseId); + return db; + } catch (e) { + const message = possibleError.text(); + error(message); + return { message } as Database; + } +} diff --git a/packages/server/src/utils/Logger.ts b/packages/server/src/utils/Logger.ts new file mode 100644 index 00000000..58ffcb85 --- /dev/null +++ b/packages/server/src/utils/Logger.ts @@ -0,0 +1,23 @@ +import { ServerConfig } from '../types'; + +import { Config } from './Config'; + +export default function Logger( + config: Config | ServerConfig, + ...params: unknown[] +) { + return { + info(...args: unknown[]) { + if (config.debug) { + // eslint-disable-next-line no-console + console.info('[niledb]', ...params, ...args); + } + }, + error(...args: unknown[]) { + if (config.debug) { + // eslint-disable-next-line no-console + console.error('[niledb]', '[ERROR]', ...params, ...args); + } + }, + }; +} diff --git a/packages/server/src/utils/blockingFetch.ts b/packages/server/src/utils/blockingFetch.ts deleted file mode 100644 index c1a69117..00000000 --- a/packages/server/src/utils/blockingFetch.ts +++ /dev/null @@ -1,38 +0,0 @@ -import http from 'http'; -import https from 'https'; -// startup fetch to be sure everything is set before we continue -export default function blockingFetch(url: string): object { - if (process.env.NODE_ENV === 'TEST') { - return {}; - } - const protocol = url.startsWith('https') ? https : http; - - // Synchronously read the response data - const data = protocol - .get(url, (res) => { - if (res.statusCode !== 200) { - throw new Error(`Failed to fetch data: ${res.statusCode}`); - } - - let rawData = ''; - res.setEncoding('utf8'); - res.on('data', (chunk) => { - rawData += chunk; - }); - res.on('end', () => { - try { - // Parse the response data - const parsedData = JSON.parse(rawData); - return parsedData; - } catch (error) { - if (error instanceof Error) { - throw new Error('Error parsing response data:', error); - } - } - }); - }) - .on('error', (error) => { - throw new Error('Error fetching data:', error); - }); - return data; -} diff --git a/packages/server/src/utils/fetch.ts b/packages/server/src/utils/fetch.ts index 86cd5399..edc0712d 100644 --- a/packages/server/src/utils/fetch.ts +++ b/packages/server/src/utils/fetch.ts @@ -1,9 +1,13 @@ import { decodeJwt } from 'jose'; +import { ServerConfig } from '../types'; + import { ResponseError } from './ResponseError'; import { Config } from './Config'; import { NileRequest } from './Requester'; import { updateTenantId, updateUserId } from './Event'; +import { getToken } from './Config/envVars'; +import Logger from './Logger'; export const X_NILE_TENANT = 'x-nile-tenantId'; export const X_NILE_USER_ID = 'x-nile-userId'; @@ -64,6 +68,8 @@ export async function _fetch( path: string, opts?: RequestInit ): Promise { + const { info, error } = Logger(config, '[server]'); + const url = `${config.api?.basePath}${path}`; const cookieKey = config.api?.cookieKey; const headers = new Headers(opts?.headers); @@ -74,8 +80,11 @@ export async function _fetch( const token = getTokenFromCookie(headers, cookieKey); if (token) { basicHeaders.set('Authorization', `Bearer ${token}`); - } else if (config.api?.token) { - basicHeaders.set('Authorization', `Bearer ${config.api?.token}`); + } else if (getToken(config as unknown as ServerConfig)) { + basicHeaders.set( + 'Authorization', + `Bearer ${getToken(config as unknown as ServerConfig)}` + ); } } @@ -91,35 +100,73 @@ export async function _fetch( const useableUrl = url .replace('{tenantId}', encodeURIComponent(String(tenantId))) .replace('{userId}', encodeURIComponent(String(userId))); + + info('[fetch]', useableUrl); + const response = await fetch(useableUrl, { ...opts, headers: basicHeaders, }).catch((e) => { - // eslint-disable-next-line no-console - console.log(e); + error('[fetch]', '[response]', e); }); if (response && response.status >= 200 && response.status < 300) { + if (typeof response.clone === 'function') { + info('[fetch]', '[response]', await response.clone().json()); + } return response; } let res; + const errorHandler = + typeof response?.clone === 'function' ? response.clone() : null; + let msg = ''; try { res = await (response as Response)?.json(); } catch (e) { - /* do the default */ + if (errorHandler) { + msg = await errorHandler.text(); + if (msg) { + error('[fetch]', '[response]', `[status: ${errorHandler.status}]`, msg); + } + } + if (!msg) { + error('[fetch]', '[response]', e); + } } + if (msg) { + return new ResponseError(msg, { status: errorHandler?.status }); + } + if (res && 'message' in res) { const { message } = res; + error( + '[fetch]', + '[response]', + `[status: ${errorHandler?.status}]`, + message + ); return new ResponseError(message, { status: 400 }); } if (res && 'errors' in res) { const { errors: [message], } = res; + error( + '[fetch]', + '[response]', + `[status: ${errorHandler?.status}]`, + message + ); return new ResponseError(message, { status: 400 }); } + error( + '[fetch]', + '[response]', + `[status: ${errorHandler?.status}]`, + 'UNHANDLED ERROR' + ); return new ResponseError(null, { status: (response as Response)?.status ?? 500, }); diff --git a/packages/server/test/integration/integration.test.ts b/packages/server/test/integration/integration.test.ts new file mode 100644 index 00000000..90b91c02 --- /dev/null +++ b/packages/server/test/integration/integration.test.ts @@ -0,0 +1,51 @@ +import Server from '../../src/Server'; + +async function toJSON(body: BodyInit) { + const resp = new Response(body); + const error = resp.clone(); + if (resp.status < 199 || resp.status > 300) { + throw new Error('API fetch failed'); + } + try { + const json = await resp.json(); + return json; + } catch (e: unknown) { + const message = await error.text(); + if (message) { + throw new Error(message); + } + if (e && typeof e === 'object' && 'message' in e) { + throw new Error(String(e.message)); + } + } +} +describe.skip('api integration', () => { + it('does a bunch of api calls', async () => { + const nile = Server({ debug: true }); + const loginResp = await nile.api.auth.login({ + email: String(process.env.EMAIL), + password: String(process.env.PASSWORD), + }); + let body = await toJSON(loginResp.body); + expect(loginResp.status).toEqual(200); + nile.token = body.token.jwt; + expect(nile.token).toBe(body.token.jwt); + + const me = await nile.api.users.me(); + body = await toJSON(me.body); + expect(body.id).toEqual(process.env.USER_ID); + + const users = await nile.api.users.listTenantUsers(); + body = await toJSON(users.body); + expect(body.length).toBeGreaterThan(0); + + const tenantProviders = await nile.api.auth.listProviders(); + expect(tenantProviders.status).toEqual(200); + body = await toJSON(tenantProviders.body); + expect(body).not.toBeNull(); + + const tenants = await nile.api.tenants.getTenant(); + body = await toJSON(tenants.body); + expect(body.id).toEqual(process.env.TENANT_ID); + }); +}); diff --git a/yarn.lock b/yarn.lock index 98b596b3..b3b0afc4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3552,19 +3552,23 @@ __metadata: "@babel/core": "npm:^7.23.3" "@niledatabase/js": "npm:^2.0.0" "@types/jest": "npm:^29.5.9" + "@types/sync-fetch": "npm:^0" "@typescript-eslint/parser": "npm:^5.62.0" babel-loader: "npm:^9.1.3" + dotenv: "npm:^16.4.5" dts-cli: "npm:^2.0.3" eslint: "npm:^8.54.0" eslint-config-prettier: "npm:^8.10.0" eslint-plugin-prettier: "npm:^4.2.1" husky: "npm:^8.0.3" + install: "npm:^0.13.0" jest: "npm:^29.7.0" jest-environment-jsdom: "npm:^29.7.0" jose: "npm:^4.15.4" knex: "npm:^2.5.1" pg: "npm:^8.11.3" size-limit: "npm:^8.2.6" + sync-fetch: "npm:^0.5.2" ts-jest: "npm:^29.1.1" tslib: "npm:^2.6.2" typescript: "npm:^5.3.2" @@ -5959,6 +5963,15 @@ __metadata: languageName: node linkType: hard +"@types/node-fetch@npm:*": + version: 3.0.2 + resolution: "@types/node-fetch@npm:3.0.2" + dependencies: + node-fetch: "npm:*" + checksum: 10/b9f97bc4219c37f70299133b36389719cf4adacad46cea80df70f77d4a9f6999ea5be18a1ab90b34239b684cae032adeec10756cce8d2ae81c17f5e4c56fd4e9 + languageName: node + linkType: hard + "@types/node@npm:*": version: 20.11.30 resolution: "@types/node@npm:20.11.30" @@ -6138,6 +6151,15 @@ __metadata: languageName: node linkType: hard +"@types/sync-fetch@npm:^0": + version: 0.4.3 + resolution: "@types/sync-fetch@npm:0.4.3" + dependencies: + "@types/node-fetch": "npm:*" + checksum: 10/b867388e584de2aa6152ed1a9a6b4dc9e45913212d28fa887d72e0e331af0f31fdaf6f0e1fddb997c5c533643f4d5b2131860029cc42862d2a82cf8d209814de + languageName: node + linkType: hard + "@types/testing-library__jest-dom@npm:^5.9.1": version: 5.14.9 resolution: "@types/testing-library__jest-dom@npm:5.14.9" @@ -9596,7 +9618,7 @@ __metadata: languageName: node linkType: hard -"dotenv@npm:^16.0.0": +"dotenv@npm:^16.0.0, dotenv@npm:^16.4.5": version: 16.4.5 resolution: "dotenv@npm:16.4.5" checksum: 10/55a3134601115194ae0f924e54473459ed0d9fc340ae610b676e248cca45aa7c680d86365318ea964e6da4e2ea80c4514c1adab5adb43d6867fb57ff068f95c8 @@ -12534,6 +12556,13 @@ __metadata: languageName: node linkType: hard +"install@npm:^0.13.0": + version: 0.13.0 + resolution: "install@npm:0.13.0" + checksum: 10/587789343de46cfdac4d6f153ff1137f9620c80cbe7c97460ba549b79c55b97c47362ef1942cf977d5ddb7eedf2319104aa4c899f12e10788cb38b0e062b7a32 + languageName: node + linkType: hard + "internal-slot@npm:^1.0.4, internal-slot@npm:^1.0.7": version: 1.0.7 resolution: "internal-slot@npm:1.0.7" @@ -15261,6 +15290,17 @@ __metadata: languageName: node linkType: hard +"node-fetch@npm:*, node-fetch@npm:^3.3.2": + version: 3.3.2 + resolution: "node-fetch@npm:3.3.2" + dependencies: + data-uri-to-buffer: "npm:^4.0.0" + fetch-blob: "npm:^3.1.4" + formdata-polyfill: "npm:^4.0.10" + checksum: 10/24207ca8c81231c7c59151840e3fded461d67a31cf3e3b3968e12201a42f89ce4a0b5fb7079b1fa0a4655957b1ca9257553200f03a9f668b45ebad265ca5593d + languageName: node + linkType: hard + "node-fetch@npm:2.6.7": version: 2.6.7 resolution: "node-fetch@npm:2.6.7" @@ -15289,17 +15329,6 @@ __metadata: languageName: node linkType: hard -"node-fetch@npm:^3.3.2": - version: 3.3.2 - resolution: "node-fetch@npm:3.3.2" - dependencies: - data-uri-to-buffer: "npm:^4.0.0" - fetch-blob: "npm:^3.1.4" - formdata-polyfill: "npm:^4.0.10" - checksum: 10/24207ca8c81231c7c59151840e3fded461d67a31cf3e3b3968e12201a42f89ce4a0b5fb7079b1fa0a4655957b1ca9257553200f03a9f668b45ebad265ca5593d - languageName: node - linkType: hard - "node-gyp-build@npm:^4.3.0": version: 4.8.0 resolution: "node-gyp-build@npm:4.8.0" @@ -18930,6 +18959,15 @@ __metadata: languageName: node linkType: hard +"sync-fetch@npm:^0.5.2": + version: 0.5.2 + resolution: "sync-fetch@npm:0.5.2" + dependencies: + node-fetch: "npm:^2.6.1" + checksum: 10/4922deac9b7707e093d2cef9a6930d89c0bf0202e4593269f6935dd523ff04725b31dba51355f5b342c9893de08222ca7428181e7d0815bb9241acd56efa563e + languageName: node + linkType: hard + "synckit@npm:^0.8.6": version: 0.8.8 resolution: "synckit@npm:0.8.8"