diff --git a/apps/api/src/helpers/middlewares/validateHasCreatorToolsAccess.ts b/apps/api/src/helpers/middlewares/validateHasCreatorToolsAccess.ts index 5ba75a7c7724..df1cfc9d66d6 100644 --- a/apps/api/src/helpers/middlewares/validateHasCreatorToolsAccess.ts +++ b/apps/api/src/helpers/middlewares/validateHasCreatorToolsAccess.ts @@ -8,7 +8,7 @@ import catchedError from "../catchedError"; import { HEY_USER_AGENT, UNLEASH_API_URL } from "../constants"; /** - * Middleware to validate if the profile is staff + * Middleware to validate if the account is staff * @param req Incoming request * @param res Response * @param next Next function diff --git a/apps/api/src/helpers/middlewares/validateIsGardener.ts b/apps/api/src/helpers/middlewares/validateIsGardener.ts index 33dd7997a961..1961f0f2a1b6 100644 --- a/apps/api/src/helpers/middlewares/validateIsGardener.ts +++ b/apps/api/src/helpers/middlewares/validateIsGardener.ts @@ -8,7 +8,7 @@ import catchedError from "../catchedError"; import { HEY_USER_AGENT, UNLEASH_API_URL } from "../constants"; /** - * Middleware to validate if the profile is gardener + * Middleware to validate if the account is gardener * @param req Incoming request * @param res Response * @param next Next function diff --git a/apps/api/src/helpers/middlewares/validateIsStaff.ts b/apps/api/src/helpers/middlewares/validateIsStaff.ts index d82040f172b4..149eb752d6c2 100644 --- a/apps/api/src/helpers/middlewares/validateIsStaff.ts +++ b/apps/api/src/helpers/middlewares/validateIsStaff.ts @@ -8,7 +8,7 @@ import catchedError from "../catchedError"; import { HEY_USER_AGENT, UNLEASH_API_URL } from "../constants"; /** - * Middleware to validate if the profile is staff + * Middleware to validate if the account is staff * @param req Incoming request * @param res Response * @param next Next function diff --git a/apps/api/src/helpers/oembed/meta/getFrame.ts b/apps/api/src/helpers/oembed/meta/getFrame.ts index 9f796e57f580..a0a40580e4be 100644 --- a/apps/api/src/helpers/oembed/meta/getFrame.ts +++ b/apps/api/src/helpers/oembed/meta/getFrame.ts @@ -39,7 +39,7 @@ const getFrame = (document: Document, url?: string): Frame | null => { buttons.push({ action, button, postUrl: buttonPostUrl, target }); } - // Frames must be OpenFrame with accepted protocol of Lens (profile authentication) or anonymous (no authentication) + // Frames must be OpenFrame with accepted protocol of Lens (account authentication) or anonymous (no authentication) if (!lensFramesVersion && !acceptsAnonymous) { return null; } diff --git a/apps/api/src/helpers/webhooks/signup/sendSignupNotificationToSlack.ts b/apps/api/src/helpers/webhooks/signup/sendSignupNotificationToSlack.ts index 35f512c17f51..42bc8f462e07 100644 --- a/apps/api/src/helpers/webhooks/signup/sendSignupNotificationToSlack.ts +++ b/apps/api/src/helpers/webhooks/signup/sendSignupNotificationToSlack.ts @@ -83,11 +83,11 @@ const sendSignupNotificationToSlack = async (hash: Address) => { }, { short: false, - title: "Profile", + title: "Account", value: `https://hey.xyz/u/${handle}` } ], - text: ":tada: A new profile has been signed up to :hey:" + text: ":tada: A new account has been signed up to :hey:" }); logger.info( diff --git a/apps/api/src/routes/internal/account/get.ts b/apps/api/src/routes/internal/account/get.ts index e4db24318b9f..c9a0d614d899 100644 --- a/apps/api/src/routes/internal/account/get.ts +++ b/apps/api/src/routes/internal/account/get.ts @@ -51,7 +51,7 @@ export const get = [ })) }; - logger.info(`Internal profile fetched for ${id}`); + logger.info(`Internal account fetched for ${id}`); return res.status(200).json({ result: response, success: true }); } catch (error) { diff --git a/apps/api/src/routes/internal/account/report.ts b/apps/api/src/routes/internal/account/report.ts index 44e71651931a..f97a459d6092 100644 --- a/apps/api/src/routes/internal/account/report.ts +++ b/apps/api/src/routes/internal/account/report.ts @@ -60,7 +60,7 @@ export const post = [ } await reportPost(postId, subreasons, accessToken); - logger.info(`[Lens] Reported profile ${id}`); + logger.info(`[Lens] Reported account ${id}`); return res.status(200).json({ result: postId, success: true }); } catch (error) { diff --git a/apps/api/src/routes/internal/permissions/assign.ts b/apps/api/src/routes/internal/permissions/assign.ts index c4e71de91919..54b424dcec7d 100644 --- a/apps/api/src/routes/internal/permissions/assign.ts +++ b/apps/api/src/routes/internal/permissions/assign.ts @@ -18,7 +18,7 @@ export const postUpdateTasks = async ( enabled: boolean ) => { await delRedis(`preference:${accountId}`); - await delRedis(`profile:${accountId}`); + await delRedis(`account:${accountId}`); await sendSlackMessage({ channel: "#permissions", diff --git a/apps/api/src/routes/lists/accounts.ts b/apps/api/src/routes/lists/accounts.ts index 0e8a896ebd76..11b7a8d977df 100644 --- a/apps/api/src/routes/lists/accounts.ts +++ b/apps/api/src/routes/lists/accounts.ts @@ -17,24 +17,24 @@ export const get = [ } try { - const cacheKey = `list:profiles:${id}`; + const cacheKey = `list:accounts:${id}`; const cachedData = await getRedis(cacheKey); if (cachedData) { - logger.info(`(cached) List profiles fetched for ${id}`); + logger.info(`(cached) List accounts fetched for ${id}`); return res .status(200) .json({ result: JSON.parse(cachedData), success: true }); } - const listProfile = await prisma.listProfile.findMany({ + const listAccounts = await prisma.listProfile.findMany({ where: { listId: id as string } }); - const accountIds = listProfile.map((item) => item.profileId); + const accountIds = listAccounts.map((account) => account.profileId); const accountsList = accountIds.map((p) => `'${p}'`).join(","); - const profiles = await lensPg.query( + const accounts = await lensPg.query( ` SELECT profile_id FROM profile.record @@ -44,9 +44,9 @@ export const get = [ ` ); - const result = profiles.map((item) => item.profile_id); + const result = accounts.map((account) => account.profile_id); await setRedis(cacheKey, JSON.stringify(result)); - logger.info(`Lists profiles fetched for ${id}`); + logger.info(`Lists accounts fetched for ${id}`); return res.status(200).json({ result, success: true }); } catch (error) { diff --git a/apps/api/src/routes/lists/add.ts b/apps/api/src/routes/lists/add.ts index d6ca29d19150..8bbab438d6fe 100644 --- a/apps/api/src/routes/lists/add.ts +++ b/apps/api/src/routes/lists/add.ts @@ -42,17 +42,17 @@ export const post = [ try { const identityToken = req.headers["x-identity-token"] as string; const payload = parseJwt(identityToken); - const listProfilesCacheKey = `list:profiles:${listId}`; + const listAccountsCacheKey = `list:accounts:${listId}`; const listCacheKey = `list:${listId}`; const clearCache = async () => { await Promise.all([ - delRedis(listProfilesCacheKey), + delRedis(listAccountsCacheKey), delRedis(listCacheKey) ]); }; - const profile = await lensPg.query( + const account = await lensPg.query( ` SELECT EXISTS ( SELECT 1 FROM profile.record @@ -64,13 +64,13 @@ export const post = [ [accountId] ); - const hasProfile = profile[0]?.result; + const hasAccount = account[0]?.result; - if (!hasProfile) { + if (!hasAccount) { return notFound(res); } - // Check if the list exists and belongs to the authenticated user and the number of profiles in the list + // Check if the list exists and belongs to the authenticated user and the number of accounts in the list const [list, count] = await prisma.$transaction([ prisma.list.findUnique({ where: { id: listId, createdBy: payload.id } @@ -93,20 +93,20 @@ export const post = [ } if (add) { - const listProfile = await prisma.listProfile.create({ + const listAccount = await prisma.listProfile.create({ data: { listId, profileId: accountId } }); await clearCache(); - logger.info(`Added profile ${accountId} to list ${listId}`); + logger.info(`Added account ${accountId} to list ${listId}`); - return res.status(200).json({ result: listProfile, success: true }); + return res.status(200).json({ result: listAccount, success: true }); } await prisma.listProfile.delete({ where: { profileId_listId: { profileId: accountId, listId } } }); await clearCache(); - logger.info(`Removed profile ${accountId} from list ${listId}`); + logger.info(`Removed account ${accountId} from list ${listId}`); return res.status(200).json({ success: true }); } catch (error) { diff --git a/apps/api/src/routes/lists/all.ts b/apps/api/src/routes/lists/all.ts index 17b976cd7279..698dd27f9914 100644 --- a/apps/api/src/routes/lists/all.ts +++ b/apps/api/src/routes/lists/all.ts @@ -29,7 +29,7 @@ export const get = [ return { ...rest, - totalProfiles: _count.profiles, + totalAccounts: _count.profiles, totalPins: _count.pinnedList, pinned: pinnedList.length > 0, isAdded: profiles.length > 0 diff --git a/apps/api/src/routes/lists/delete.ts b/apps/api/src/routes/lists/delete.ts index 7eb805d03cc4..cedb7fbfd7ea 100644 --- a/apps/api/src/routes/lists/delete.ts +++ b/apps/api/src/routes/lists/delete.ts @@ -39,12 +39,12 @@ export const post = [ const identityToken = req.headers["x-identity-token"] as string; const payload = parseJwt(identityToken); const listCacheKey = `list:${id}`; - const listProfilesCacheKey = `list:profiles:${id}`; + const listAccountsCacheKey = `list:accounts:${id}`; const clearCache = async () => { await Promise.all([ delRedis(listCacheKey), - delRedis(listProfilesCacheKey) + delRedis(listAccountsCacheKey) ]); }; diff --git a/apps/api/src/routes/lists/get.ts b/apps/api/src/routes/lists/get.ts index 457955db4b61..08e8fda86a94 100644 --- a/apps/api/src/routes/lists/get.ts +++ b/apps/api/src/routes/lists/get.ts @@ -44,7 +44,7 @@ export const get = [ const result = { ...rest, profiles: profiles.map((account) => account.profileId), - totalProfiles: _count.profiles, + totalAccounts: _count.profiles, totalPins: _count.pinnedList, pinned: pinnedList.length > 0 }; diff --git a/apps/api/src/routes/lists/pinned.ts b/apps/api/src/routes/lists/pinned.ts index 521ffee06db8..672dd6230fd6 100644 --- a/apps/api/src/routes/lists/pinned.ts +++ b/apps/api/src/routes/lists/pinned.ts @@ -30,7 +30,7 @@ export const get = [ return { ...rest, - totalProfiles: _count.profiles, + totalAccounts: _count.profiles, totalPins: _count.pinnedList, pinned: pinnedList.length > 0 }; diff --git a/apps/api/src/routes/profile/get.ts b/apps/api/src/routes/profile/get.ts index 104c253558d0..7077a2402b7f 100644 --- a/apps/api/src/routes/profile/get.ts +++ b/apps/api/src/routes/profile/get.ts @@ -18,7 +18,7 @@ export const get = [ } try { - const cacheKey = `profile:${id}`; + const cacheKey = `account:${id}`; const cachedData = await getRedis(cacheKey); if (cachedData) { diff --git a/apps/api/src/routes/profile/status/clear.ts b/apps/api/src/routes/profile/status/clear.ts index fe424ce0db70..3c8b712f87b5 100644 --- a/apps/api/src/routes/profile/status/clear.ts +++ b/apps/api/src/routes/profile/status/clear.ts @@ -19,7 +19,7 @@ export const post = [ where: { id: payload.id } }); - await delRedis(`profile:${payload.id}`); + await delRedis(`account:${payload.id}`); logger.info(`Cleared profile status for ${payload.id}`); return res.status(200).json({ result: profileStatus, success: true }); diff --git a/apps/api/src/routes/profile/status/update.ts b/apps/api/src/routes/profile/status/update.ts index 78530df44c8e..840b2d7d1c60 100644 --- a/apps/api/src/routes/profile/status/update.ts +++ b/apps/api/src/routes/profile/status/update.ts @@ -47,8 +47,8 @@ export const post = [ where: { id: payload.id } }); - await delRedis(`profile:${payload.id}`); - logger.info(`Updated profile status for ${payload.id}`); + await delRedis(`account:${payload.id}`); + logger.info(`Updated account status for ${payload.id}`); return res.status(200).json({ result: profileStatus, success: true }); } catch (error) { diff --git a/apps/api/tests/lists/all.spec.ts b/apps/api/tests/lists/all.spec.ts index fc5515e02927..1bfbdcb8e89a 100644 --- a/apps/api/tests/lists/all.spec.ts +++ b/apps/api/tests/lists/all.spec.ts @@ -24,7 +24,7 @@ describe("GET /lists/all", () => { expect(data.result).toBeDefined(); expect(data.result.length).toBeGreaterThan(0); expect(data.result[0].totalPins).toStrictEqual(expect.any(Number)); - expect(data.result[0].totalProfiles).toStrictEqual(expect.any(Number)); + expect(data.result[0].totalAccounts).toStrictEqual(expect.any(Number)); }); test("should return 200 with isAdded as true if the user is added to the list", async () => { diff --git a/apps/api/tests/lists/get.spec.ts b/apps/api/tests/lists/get.spec.ts index e515a408aa74..c9448bfac709 100644 --- a/apps/api/tests/lists/get.spec.ts +++ b/apps/api/tests/lists/get.spec.ts @@ -37,6 +37,6 @@ describe("GET /lists/get", () => { expect(data.result.description).toBe(newList.description); expect(data.result.avatar).toBe(newList.avatar); expect(data.result.totalPins).toStrictEqual(expect.any(Number)); - expect(data.result.totalProfiles).toStrictEqual(expect.any(Number)); + expect(data.result.totalAccounts).toStrictEqual(expect.any(Number)); }); }); diff --git a/apps/api/tests/lists/pinned.spec.ts b/apps/api/tests/lists/pinned.spec.ts index c7037e2c2a4f..256b68c6879f 100644 --- a/apps/api/tests/lists/pinned.spec.ts +++ b/apps/api/tests/lists/pinned.spec.ts @@ -13,7 +13,7 @@ describe("GET /lists/pinned", () => { expect(data.result).toBeDefined(); expect(data.result.length).toBeGreaterThan(0); expect(data.result[0].totalPins).toStrictEqual(expect.any(Number)); - expect(data.result[0].totalProfiles).toStrictEqual(expect.any(Number)); + expect(data.result[0].totalAccounts).toStrictEqual(expect.any(Number)); expect(data.result[0].pinned).toBe(true); }); diff --git a/apps/api/tests/profile/get.spec.ts b/apps/api/tests/profile/get.spec.ts index 1e3e442bdb4c..112845d59b9c 100644 --- a/apps/api/tests/profile/get.spec.ts +++ b/apps/api/tests/profile/get.spec.ts @@ -14,7 +14,7 @@ describe("GET /profile/get", () => { }); test("should return 200 with status and theme", async () => { - await delRedis(`profile:${TEST_LENS_ID}`); + await delRedis(`account:${TEST_LENS_ID}`); const { data, status } = await axios.get(`${TEST_URL}/profile/get`, { params: { id: TEST_LENS_ID } }); diff --git a/apps/web/src/components/List/Details.tsx b/apps/web/src/components/List/Details.tsx index bc338db5b94a..a1c3b35b7b69 100644 --- a/apps/web/src/components/List/Details.tsx +++ b/apps/web/src/components/List/Details.tsx @@ -63,9 +63,9 @@ const Details: FC = ({ list }) => { className="text-left outline-offset-4" href={`/lists/${list.id}/accounts`} > -

{humanize(list.totalProfiles)}

+

{humanize(list.totalAccounts)}

- {plur("Profile", list.totalProfiles)} + {plur("Profile", list.totalAccounts)}
diff --git a/apps/web/src/components/Shared/Modal/AddToList.tsx b/apps/web/src/components/Shared/Modal/AddToList.tsx index 48219da49c47..041a92d03751 100644 --- a/apps/web/src/components/Shared/Modal/AddToList.tsx +++ b/apps/web/src/components/Shared/Modal/AddToList.tsx @@ -80,9 +80,9 @@ const AddToList: FC = () => { ? { ...list, isAdded: add, - totalProfiles: add - ? list.totalProfiles + 1 - : list.totalProfiles - 1 + totalAccounts: add + ? list.totalAccounts + 1 + : list.totalAccounts - 1 } : list ) diff --git a/apps/web/src/components/Shared/SingleList.tsx b/apps/web/src/components/Shared/SingleList.tsx index f9efc98158b1..aea2059bc250 100644 --- a/apps/web/src/components/Shared/SingleList.tsx +++ b/apps/web/src/components/Shared/SingleList.tsx @@ -31,7 +31,7 @@ const SingleList: FC = ({ list, linkToList = true }) => {
{list.name}
- {list.totalProfiles} {plur("Profile", list.totalProfiles)} + {list.totalAccounts} {plur("Profile", list.totalAccounts)}
diff --git a/packages/types/hey.d.ts b/packages/types/hey.d.ts index 8064874987ec..98f5a9e6ad0b 100644 --- a/packages/types/hey.d.ts +++ b/packages/types/hey.d.ts @@ -96,7 +96,7 @@ export type List = { name: string; description: string | null; avatar: string | null; - totalProfiles: number; + totalAccounts: number; totalPins: number; createdBy: string; isAdded?: boolean;