This pull request includes several changes that enhance the project's functionality, improve the development environment, and modify the project's dependencies. The most significant changes involve the addition of a new login function in the src/auth.ts file, changes to environment variables in the src/env.ts file, and updates to the project's dependencies in the package.json file.
Changes to the project's functionality:
src/auth.ts: Added a new clientCredentialsLogin function that uses the fetch function from the undici library to make a POST request to the Matrix server for logging in. This function returns a promise that resolves to a LoginResponse object.
src/env.ts: Made several changes to the environment variables, including removing the MATRIX_ACCESS_TOKEN, MATRIX_BOT_USERNAME, and MATRIX_BOT_PASSWORD variables and adding the BOT_CLIENT_ID, BOT_CLIENT_SECRET, BOT_DEVICE_ID, OPENAI_ASSISTANT_ID, MIXPANEL_PROJECT_TOKEN, and API_URL variables. [1][2]
Improvements to the development environment:
.github/workflows/release.yml: Changed the images field in the docker/metadata-action@v4 action to use the github.repository_owner context instead of hardcoding the repository owner's name.
.vscode/launch.json: Added a new configuration file for Visual Studio Code that includes two configurations for debugging Node.js applications.
.vscode/settings.json: Added a new configuration file for Visual Studio Code that includes several settings for formatting code and managing dependencies.
docker-compose.yml: Added a new Docker Compose configuration file that defines a service for a PostgreSQL database.
Changes to the project's dependencies:
package.json: Made several changes to the project's dependencies, including changing the main field to point to the src/index.ts file, adding a dev script for running the TypeScript compiler in watch mode, updating the version of the @keyv/postgres package, and adding the jwt-decode, mixpanel, openai, undici, and tsx packages. [1][2]
This pull request includes several changes that enhance the project's functionality, improve the development environment, and modify the project's dependencies. The most significant changes involve the addition of a new login function in the
src/auth.ts
file, changes to environment variables in thesrc/env.ts
file, and updates to the project's dependencies in thepackage.json
file.Changes to the project's functionality:
src/auth.ts
: Added a newclientCredentialsLogin
function that uses thefetch
function from theundici
library to make a POST request to the Matrix server for logging in. This function returns a promise that resolves to aLoginResponse
object.src/env.ts
: Made several changes to the environment variables, including removing theMATRIX_ACCESS_TOKEN
,MATRIX_BOT_USERNAME
, andMATRIX_BOT_PASSWORD
variables and adding theBOT_CLIENT_ID
,BOT_CLIENT_SECRET
,BOT_DEVICE_ID
,OPENAI_ASSISTANT_ID
,MIXPANEL_PROJECT_TOKEN
, andAPI_URL
variables. [1] [2]Improvements to the development environment:
.github/workflows/release.yml
: Changed theimages
field in thedocker/metadata-action@v4
action to use thegithub.repository_owner
context instead of hardcoding the repository owner's name..vscode/launch.json
: Added a new configuration file for Visual Studio Code that includes two configurations for debugging Node.js applications..vscode/settings.json
: Added a new configuration file for Visual Studio Code that includes several settings for formatting code and managing dependencies.docker-compose.yml
: Added a new Docker Compose configuration file that defines a service for a PostgreSQL database.Changes to the project's dependencies:
package.json
: Made several changes to the project's dependencies, including changing themain
field to point to thesrc/index.ts
file, adding adev
script for running the TypeScript compiler in watch mode, updating the version of the@keyv/postgres
package, and adding thejwt-decode
,mixpanel
,openai
,undici
, andtsx
packages. [1] [2]