From d67cb7cb895df793aa468c9fec7bb2f86ee082a9 Mon Sep 17 00:00:00 2001 From: dslucas <55889299+dslucas@users.noreply.github.com> Date: Tue, 29 Nov 2022 15:43:55 -0500 Subject: [PATCH] Make a few tweaks to TwitterApiCredentials and documentation --- docs/2_development.md | 3 --- src/server/middleware/twitter.middleware.ts | 4 ++-- src/server/serving.ts | 11 ++++++++--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/2_development.md b/docs/2_development.md index 22041ac..2b0e88c 100644 --- a/docs/2_development.md +++ b/docs/2_development.md @@ -145,9 +145,6 @@ The required fields are: be the server-side key created in [setup](1_setup.md) in GCP [Credentials](https://console.cloud.google.com/apis/credentials) - `cloudProjectId`: Your Google Cloud project ID - -The optional fields are: - - `twitterApiCredentials`: Your credentials for the Twitter APIs. All together, your config should look something like one of the two configs diff --git a/src/server/middleware/twitter.middleware.ts b/src/server/middleware/twitter.middleware.ts index 207fbf3..55bf015 100644 --- a/src/server/middleware/twitter.middleware.ts +++ b/src/server/middleware/twitter.middleware.ts @@ -298,8 +298,8 @@ function loadTwitterData( } const auth: AxiosBasicCredentials = { - username: credentials!.username, - password: credentials!.password, + username: credentials.username!, + password: credentials.password!, }; return axios diff --git a/src/server/serving.ts b/src/server/serving.ts index dda51fb..0961957 100644 --- a/src/server/serving.ts +++ b/src/server/serving.ts @@ -72,12 +72,17 @@ export interface Config { } export interface TwitterApiCredentials { - accountName: string; + // The below three fields are necessary if using Enterprise Full-Archive + // Search. + accountName?: string; + password?: string; + username?: string; + // The below two fields are necessary for the Blocks, Mutes, and Hide Replies + // APIs. appKey: string; appToken: string; + // Necessary if using v2 Full-Archive Search. bearerToken?: string; - password: string; - username: string; } export interface WebAppCredentials {