From 0aa97be8023d9429926f5893ace48dd4eed8c41c Mon Sep 17 00:00:00 2001 From: Steve Perkins Date: Wed, 20 Dec 2023 21:38:01 +0000 Subject: [PATCH 01/18] fix es-indexer for local dev --- dev-tools/compose/docker-compose.discovery.prod.yml | 4 ++++ dev-tools/compose/docker-compose.test.yml | 1 - dev-tools/startup/discovery-provider.sh | 1 - .../discovery-provider/plugins/pedalboard/docker/startup.sh | 1 - packages/es-indexer/README.md | 1 - 5 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dev-tools/compose/docker-compose.discovery.prod.yml b/dev-tools/compose/docker-compose.discovery.prod.yml index e8b76e06da6..018fc10acc7 100644 --- a/dev-tools/compose/docker-compose.discovery.prod.yml +++ b/dev-tools/compose/docker-compose.discovery.prod.yml @@ -67,6 +67,9 @@ services: context: ${PROJECT_ROOT}/packages/es-indexer dockerfile: Dockerfile restart: unless-stopped + environment: + audius_elasticsearch_url: http://discovery-provider-elasticsearch:9200 + audius_db_url: 'postgresql://postgres:postgres@db:5432/discovery_provider_1' depends_on: db: condition: service_healthy @@ -113,6 +116,7 @@ services: audius_contracts_entity_manager_address: '${ENTITY_MANAGER_ADDRESS}' audius_eth_contracts_registry: '${ETH_REGISTRY_ADDRESS}' audius_eth_contracts_token: '${ETH_TOKEN_ADDRESS}' + audius_elasticsearch_url: http://discovery-provider-elasticsearch:9200 audius_solana_endpoint: 'http://solana-test-validator:8899' audius_solana_track_listen_count_address: '${SOLANA_TRACK_LISTEN_COUNT_PUBLIC_KEY}' diff --git a/dev-tools/compose/docker-compose.test.yml b/dev-tools/compose/docker-compose.test.yml index 06c55f4927b..8886ff8993e 100644 --- a/dev-tools/compose/docker-compose.test.yml +++ b/dev-tools/compose/docker-compose.test.yml @@ -239,7 +239,6 @@ services: audius_redis_url: 'redis://discovery-provider-redis:6379/00' audius_elasticsearch_url: 'http://discovery-provider-elasticsearch:9200' - audius_elasticsearch_run_indexer: 'true' volumes: - ${PROJECT_ROOT}/packages/discovery-provider:/audius-discovery-provider depends_on: diff --git a/dev-tools/startup/discovery-provider.sh b/dev-tools/startup/discovery-provider.sh index 7720243bc88..777b66def75 100644 --- a/dev-tools/startup/discovery-provider.sh +++ b/dev-tools/startup/discovery-provider.sh @@ -19,7 +19,6 @@ export audius_delegate_private_key=$(printenv "DP${replica}_DELEGATE_OWNER_PRIVA elasticsearch_host=$(nslookup $(hostname -i) | grep -o "name = .*" | grep -o "[^ ]\+$" | sed 's/discovery-provider/discovery-provider-elasticsearch/') if nslookup "$elasticsearch_host" >/dev/null 2>&1; then export audius_elasticsearch_url="http://$elasticsearch_host:9200" - export audius_elasticsearch_run_indexer="true" fi # Run register script in background diff --git a/packages/discovery-provider/plugins/pedalboard/docker/startup.sh b/packages/discovery-provider/plugins/pedalboard/docker/startup.sh index 53d43076f71..a602d2a14fd 100644 --- a/packages/discovery-provider/plugins/pedalboard/docker/startup.sh +++ b/packages/discovery-provider/plugins/pedalboard/docker/startup.sh @@ -22,7 +22,6 @@ export audius_delegate_private_key=$(printenv "DP${replica}_DELEGATE_OWNER_PRIVA elasticsearch_host="audius-protocol-discovery-provider-elasticsearch-${replica}" if nslookup "$elasticsearch_host" >/dev/null 2>&1; then export audius_elasticsearch_url="http://${elasticsearch_host}:9200" - export audius_elasticsearch_run_indexer="true" fi npm run dev \ No newline at end of file diff --git a/packages/es-indexer/README.md b/packages/es-indexer/README.md index e1f40b50f0d..e902373991d 100644 --- a/packages/es-indexer/README.md +++ b/packages/es-indexer/README.md @@ -6,7 +6,6 @@ To run in the discovery container, set env variables: ``` audius_elasticsearch_url=http://elasticsearch:9200 -audius_elasticsearch_run_indexer=true ``` ## Mapping Changes From aae109b3cb33f060060b6d38f13383448d8a4271 Mon Sep 17 00:00:00 2001 From: Steve Perkins Date: Wed, 20 Dec 2023 14:45:52 -0500 Subject: [PATCH 02/18] playlists.containTrackId method --- .../src/routers/playlist-router.ts | 24 ++++++++++++++++++- .../trpc-server/src/routers/search-router.ts | 2 +- packages/trpc-server/test/_fixtures.ts | 15 ++++++++++++ packages/trpc-server/test/search.test.ts | 11 ++++++++- 4 files changed, 49 insertions(+), 3 deletions(-) diff --git a/packages/trpc-server/src/routers/playlist-router.ts b/packages/trpc-server/src/routers/playlist-router.ts index 16173618fa2..194ead3b4e2 100644 --- a/packages/trpc-server/src/routers/playlist-router.ts +++ b/packages/trpc-server/src/routers/playlist-router.ts @@ -1,6 +1,7 @@ import { z } from 'zod' import { publicProcedure, router } from '../trpc' import { TRPCError } from '@trpc/server' +import { esc } from './search-router' export const playlistRouter = router({ get: publicProcedure.input(z.string()).query(async ({ ctx, input }) => { @@ -9,5 +10,26 @@ export const playlistRouter = router({ throw new TRPCError({ code: 'NOT_FOUND' }) } return row - }) + }), + + containTrackId: publicProcedure + .input(z.string()) + .query(async ({ ctx, input }) => { + const found = await esc.search({ + index: 'playlists', + query: { + bool: { + must: [ + { term: { 'playlist_contents.track_ids.track': input } }, + { term: { is_delete: false } }, + { term: { is_private: false } }, + ], + must_not: [], + should: [], + }, + }, + _source: false, + }) + return found.hits.hits.map((h) => h._id) + }), }) diff --git a/packages/trpc-server/src/routers/search-router.ts b/packages/trpc-server/src/routers/search-router.ts index b0298ef8170..f6691a9743e 100644 --- a/packages/trpc-server/src/routers/search-router.ts +++ b/packages/trpc-server/src/routers/search-router.ts @@ -3,7 +3,7 @@ import { publicProcedure, router } from '../trpc' import { TRPCError } from '@trpc/server' import { Client as ES } from '@elastic/elasticsearch' -const esc = new ES({ node: process.env.audius_elasticsearch_url }) +export const esc = new ES({ node: process.env.audius_elasticsearch_url }) export const searchRouter = router({ users: publicProcedure diff --git a/packages/trpc-server/test/_fixtures.ts b/packages/trpc-server/test/_fixtures.ts index 590734071b5..6eb7d363365 100644 --- a/packages/trpc-server/test/_fixtures.ts +++ b/packages/trpc-server/test/_fixtures.ts @@ -84,6 +84,13 @@ const fixtures = { trackId: 203, title: 'Dogs remix', }, + { + ownerId: 101, + trackId: 204, + title: 'Future dogs release', + isUnlisted: true, + releaseDate: dateAddDays(30), + }, ], } as TableFixture, @@ -105,12 +112,14 @@ const fixtures = { playlistOwnerId: 101, playlistId: 301, playlistName: "Steve's Playlist", + playlistContents: { track_ids: [{ track: 101 }, { track: 103 }] }, }, { playlistOwnerId: 101, playlistId: 302, playlistName: "Steve's private Playlist", isPrivate: true, + playlistContents: { track_ids: [{ track: 101 }, { track: 103 }] }, }, ], } as TableFixture, @@ -150,6 +159,12 @@ const fixtures = { } as TableFixture, } +function dateAddDays(dayDelta: number) { + const date = new Date() + date.setDate(date.getDate() + dayDelta) + return date +} + async function main() { // truncate tables for (const table of Object.keys(fixtures)) { diff --git a/packages/trpc-server/test/search.test.ts b/packages/trpc-server/test/search.test.ts index 22d46ab3ee8..3130947baa4 100644 --- a/packages/trpc-server/test/search.test.ts +++ b/packages/trpc-server/test/search.test.ts @@ -10,7 +10,9 @@ test('search user', async () => { { const userIds = await caller.search.users({ q: 'dave' }) - expect(userIds).toEqual(['102', '103']) + expect(userIds).length(2) + expect(userIds).toContain('102') + expect(userIds).toContain('103') } { @@ -34,3 +36,10 @@ test('search tracks', async () => { expect(trackIds).toEqual(['201']) } }) + +test('you can get playlists that contain a track id', async () => { + const caller = await testRouter() + + const playlistIds = await caller.playlists.containTrackId('101') + expect(playlistIds).toEqual(['301']) +}) From c9741c179b91302f3c0958e6679b6cacaee4c2a5 Mon Sep 17 00:00:00 2001 From: amendelsohn Date: Thu, 21 Dec 2023 17:15:29 -0800 Subject: [PATCH 03/18] wip --- package-lock.json | 92 +++++++++++++------ package.json | 1 + packages/es-indexer/package.json | 2 +- packages/trpc-server/.env | 2 + packages/trpc-server/src/db-tables.ts | 1 + packages/trpc-server/src/db.ts | 16 +++- .../src/routers/playlist-router.ts | 18 +++- packages/trpc-server/test/search.test.ts | 2 +- packages/web/.env/.env.stage | 1 - packages/web/package.json | 1 + .../src/components/track/GiantTrackTile.tsx | 13 ++- 11 files changed, 109 insertions(+), 40 deletions(-) create mode 100644 packages/trpc-server/.env diff --git a/package-lock.json b/package-lock.json index 071d59c0765..eb380b99c1b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14033,6 +14033,7 @@ "version": "1.18.0", "resolved": "https://registry.npmjs.org/@rmp135/sql-ts/-/sql-ts-1.18.0.tgz", "integrity": "sha512-2IsnIyZPGOZomi4zXfdKdNCVm8YPxBKSf16m5iRAyMZOqQTVCnXxnbLbkk7jGu3HNVJdEjbr9gP48Gy/MxQ4Wg==", + "dev": true, "dependencies": { "change-case": "^4.1.2", "handlebars": "^4.7.7", @@ -14075,6 +14076,7 @@ "version": "4.7.8", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", + "dev": true, "dependencies": { "minimist": "^1.2.5", "neo-async": "^2.6.2", @@ -14095,6 +14097,7 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -14102,7 +14105,8 @@ "node_modules/@rmp135/sql-ts/node_modules/wordwrap": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==" + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", + "dev": true }, "node_modules/@rollup/plugin-alias": { "version": "3.1.9", @@ -46464,6 +46468,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz", "integrity": "sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==", + "dev": true, "dependencies": { "pascal-case": "^3.1.2", "tslib": "^2.0.3" @@ -46472,7 +46477,8 @@ "node_modules/camel-case/node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true }, "node_modules/camelcase": { "version": "5.3.1", @@ -46595,6 +46601,7 @@ "version": "1.0.4", "resolved": "https://registry.npmjs.org/capital-case/-/capital-case-1.0.4.tgz", "integrity": "sha512-ds37W8CytHgwnhGGTi88pcPyR15qoNkOpYwmMMfnWqqWgESapLqvDx6huFjQ5vqWSn2Z06173XNA7LtMOeUh1A==", + "dev": true, "dependencies": { "no-case": "^3.0.4", "tslib": "^2.0.3", @@ -46604,7 +46611,8 @@ "node_modules/capital-case/node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true }, "node_modules/capture-exit": { "version": "2.0.0", @@ -46697,6 +46705,7 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/change-case/-/change-case-4.1.2.tgz", "integrity": "sha512-bSxY2ws9OtviILG1EiY5K7NNxkqg/JnRnFxLtKQ96JaviiIxi7djMrSd0ECT9AC+lttClmYwKw53BWpOMblo7A==", + "dev": true, "dependencies": { "camel-case": "^4.1.2", "capital-case": "^1.0.4", @@ -46715,7 +46724,8 @@ "node_modules/change-case/node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true }, "node_modules/char-regex": { "version": "1.0.2", @@ -48175,6 +48185,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/constant-case/-/constant-case-3.0.4.tgz", "integrity": "sha512-I2hSBi7Vvs7BEuJDr5dDHfzb/Ruj3FyvFyh7KLilAjNQw3Be+xgqUBA2W6scVEcL0hL1dwPRtIqEPVUCKkSsyQ==", + "dev": true, "dependencies": { "no-case": "^3.0.4", "tslib": "^2.0.3", @@ -48184,7 +48195,8 @@ "node_modules/constant-case/node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true }, "node_modules/constants-browserify": { "version": "1.0.0", @@ -61133,6 +61145,7 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/header-case/-/header-case-2.0.4.tgz", "integrity": "sha512-H/vuk5TEEVZwrR0lp2zed9OCo1uAILMlx0JEMgC26rzyJJ3N1v6XkwHHXJQdR2doSjcGPM6OKPYoJgf0plJ11Q==", + "dev": true, "dependencies": { "capital-case": "^1.0.4", "tslib": "^2.0.3" @@ -61141,7 +61154,8 @@ "node_modules/header-case/node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true }, "node_modules/headers-polyfill": { "version": "3.2.5", @@ -81263,6 +81277,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", "integrity": "sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==", + "dev": true, "dependencies": { "dot-case": "^3.0.4", "tslib": "^2.0.3" @@ -81271,7 +81286,8 @@ "node_modules/param-case/node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true }, "node_modules/parent-module": { "version": "1.0.1", @@ -81470,6 +81486,7 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz", "integrity": "sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==", + "dev": true, "dependencies": { "no-case": "^3.0.4", "tslib": "^2.0.3" @@ -81478,7 +81495,8 @@ "node_modules/pascal-case/node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true }, "node_modules/pascalcase": { "version": "0.1.1", @@ -81645,6 +81663,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/path-case/-/path-case-3.0.4.tgz", "integrity": "sha512-qO4qCFjXqVTrcbPt/hQfhTQ+VhFsqNKOPtytgNKkKxSoEp3XPUQ8ObFuePylOIok5gjn69ry8XiULxCwot3Wfg==", + "dev": true, "dependencies": { "dot-case": "^3.0.4", "tslib": "^2.0.3" @@ -81653,7 +81672,8 @@ "node_modules/path-case/node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true }, "node_modules/path-dirname": { "version": "1.0.2", @@ -81917,6 +81937,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.1.1.tgz", "integrity": "sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q==", + "dev": true, "optional": true }, "node_modules/pg-connection-string": { @@ -101944,6 +101965,7 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/sentence-case/-/sentence-case-3.0.4.tgz", "integrity": "sha512-8LS0JInaQMCRoQ7YUytAo/xUu5W2XnQxV2HI/6uM6U7CITS1RqPElr30V6uIqyMKM9lJGRVFy5/4CuzcixNYSg==", + "dev": true, "dependencies": { "no-case": "^3.0.4", "tslib": "^2.0.3", @@ -101953,7 +101975,8 @@ "node_modules/sentence-case/node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true }, "node_modules/sequelize": { "version": "4.41.2", @@ -111559,6 +111582,12 @@ "node": ">=14.0" } }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, "node_modules/unenv": { "version": "1.7.4", "resolved": "https://registry.npmjs.org/unenv/-/unenv-1.7.4.tgz", @@ -112563,6 +112592,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-2.0.2.tgz", "integrity": "sha512-KgdgDGJt2TpuwBUIjgG6lzw2GWFRCW9Qkfkiv0DxqHHLYJHmtmdUIKcZd8rHgFSjopVTlw6ggzCm1b8MFQwikg==", + "dev": true, "dependencies": { "tslib": "^2.0.3" } @@ -112571,6 +112601,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/upper-case-first/-/upper-case-first-2.0.2.tgz", "integrity": "sha512-514ppYHBaKwfJRK/pNC6c/OxfGa0obSnAl106u97Ed0I625Nin96KAjttZF6ZL3e1XLtphxnqrOi9iWgm+u+bg==", + "dev": true, "dependencies": { "tslib": "^2.0.3" } @@ -112578,12 +112609,14 @@ "node_modules/upper-case-first/node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true }, "node_modules/upper-case/node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "dev": true }, "node_modules/uri-js": { "version": "4.4.1", @@ -135924,11 +135957,11 @@ }, "devDependencies": { "@types/lodash": "4.14.182", - "@types/node": "17.0.29", + "@types/node": "20.10.2", "@types/pg": "8.6.5", "ts-node": "10.7.0", "tsconfig-paths": "3.14.1", - "typescript": "4.6.3" + "typescript": "5.2.2" } }, "packages/es-indexer/node_modules/@cspotcode/source-map-support": { @@ -135950,10 +135983,13 @@ "dev": true }, "packages/es-indexer/node_modules/@types/node": { - "version": "17.0.29", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.29.tgz", - "integrity": "sha512-tx5jMmMFwx7wBwq/V7OohKDVb/JwJU5qCVkeLMh1//xycAJ/ESuw9aJ9SEtlCZDYi2pBfe4JkisSoAtbOsBNAA==", - "dev": true + "version": "20.10.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.2.tgz", + "integrity": "sha512-37MXfxkb0vuIlRKHNxwCkb60PNBpR94u4efQuN4JgIAm66zfCDXGSAFCef9XUWFovX2R1ok6Z7MHhtdVXXkkIw==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } }, "packages/es-indexer/node_modules/acorn": { "version": "8.11.2", @@ -136186,16 +136222,16 @@ } }, "packages/es-indexer/node_modules/typescript": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz", - "integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, "packages/eslint-config-audius": { @@ -146748,7 +146784,7 @@ }, "packages/spl": { "name": "@audius/spl", - "version": "0.0.10", + "version": "0.0.12", "license": "Apache-2.0", "dependencies": { "@coral-xyz/anchor": "0.29.0", @@ -146762,17 +146798,18 @@ "name": "@audius/sql-ts", "version": "1.0.14", "license": "ISC", - "dependencies": { + "devDependencies": { "@rmp135/sql-ts": "1.18.0", + "dotenv": "^16.3.1", "knex": "2.5.1", "pg": "8.11.3" - }, - "devDependencies": {} + } }, "packages/sql-ts/node_modules/pg": { "version": "8.11.3", "resolved": "https://registry.npmjs.org/pg/-/pg-8.11.3.tgz", "integrity": "sha512-+9iuvG8QfaaUrrph+kpF24cXkH1YOOUeArRNYIxq1viYHZagBxrTno7cecY1Fa44tJeZvaoG+Djpkc3JwehN5g==", + "dev": true, "dependencies": { "buffer-writer": "2.0.0", "packet-reader": "1.0.0", @@ -146800,7 +146837,8 @@ "packages/sql-ts/node_modules/pg-connection-string": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.2.tgz", - "integrity": "sha512-ch6OwaeaPYcova4kKZ15sbJ2hKb/VP48ZD2gE7i1J+L4MspCtBMAx8nMgz7bksc7IojCIIWuEhHibSMFH8m8oA==" + "integrity": "sha512-ch6OwaeaPYcova4kKZ15sbJ2hKb/VP48ZD2gE7i1J+L4MspCtBMAx8nMgz7bksc7IojCIIWuEhHibSMFH8m8oA==", + "dev": true }, "packages/stems": { "name": "@audius/stems", diff --git a/package.json b/package.json index 121c7cc1695..9aca56baa3e 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "web:dev": "npm run start:dev -w audius-client", "web:prod": "npm run start:prod -w audius-client", "web:stage": "npm run start:stage -w audius-client", + "web:stage-local-trpc": "npm run start:stage-local-trpc -w audius-client", "DESKTOP====================================": "", "desktop:dev": "concurrently -k 'BROWSER=none npm run start:dev -w audius-client' 'wait-on http://0.0.0.0:3000 && npm run electron:localhost -w audius-client -- 3000'", "desktop:prod": "concurrently -k 'BROWSER=none npm run start:prod -w audius-client' 'wait-on http://0.0.0.0:3002 && npm run electron:localhost -w audius-client -- 3002'", diff --git a/packages/es-indexer/package.json b/packages/es-indexer/package.json index d3962b62e72..c69c4a9f5bf 100644 --- a/packages/es-indexer/package.json +++ b/packages/es-indexer/package.json @@ -20,7 +20,7 @@ "@types/pg": "8.6.5", "ts-node": "10.7.0", "tsconfig-paths": "3.14.1", - "typescript": "5.3.2" + "typescript": "5.2.2" }, "dependencies": { "@elastic/elasticsearch": "8.1.0", diff --git a/packages/trpc-server/.env b/packages/trpc-server/.env new file mode 100644 index 00000000000..dbc30709af5 --- /dev/null +++ b/packages/trpc-server/.env @@ -0,0 +1,2 @@ +audius_elasticsearch_url=http://35.209.86.3:9200 +audius_db_url=postgres://postgres:postgres@35.209.86.3:5432/audius_discovery diff --git a/packages/trpc-server/src/db-tables.ts b/packages/trpc-server/src/db-tables.ts index 59ba3eddc41..f6508af3a0e 100644 --- a/packages/trpc-server/src/db-tables.ts +++ b/packages/trpc-server/src/db-tables.ts @@ -370,6 +370,7 @@ export interface PlaylistRow { 'isPrivate': boolean; 'lastAddedTo'?: Date | null; 'metadataMultihash'?: string | null; + 'permalink'?: string | null; 'playlistContents': any; 'playlistId': number; 'playlistImageMultihash'?: string | null; diff --git a/packages/trpc-server/src/db.ts b/packages/trpc-server/src/db.ts index ffcb651d013..a0c95d91eb8 100644 --- a/packages/trpc-server/src/db.ts +++ b/packages/trpc-server/src/db.ts @@ -5,7 +5,7 @@ import { AggregateUserRow, PlaylistRow, TrackRow, - UserRow + UserRow, } from './db-tables' const connectionString = process.env.audius_db_url || '' @@ -25,9 +25,9 @@ export const sql = postgres(connectionString, { to: 20, from: [20], serialize: (x: any) => x.toString(), - parse: (x: any) => +x - } - } + parse: (x: any) => +x, + }, + }, }) export type AUser = UserRow & AggregateUserRow @@ -102,7 +102,13 @@ export type SelectPlaylistProps = { export async function selectPlaylistsCamel(p: SelectPlaylistProps) { return sql` select ${p.cols ? sql(p.cols) : sql`*`} - from playlists + from (select *, ( + select slug + from playlist_routes pr + where + pr.playlist_id = playlists.playlist_id and is_current = 'true' + ) as permalink + from playlists) as playlists_with_permalinks left join aggregate_playlist using (playlist_id, is_album) where is_current = true ${p.isAlbum != undefined ? sql`and is_album = ${p.isAlbum}` : sql``} diff --git a/packages/trpc-server/src/routers/playlist-router.ts b/packages/trpc-server/src/routers/playlist-router.ts index 194ead3b4e2..c35db7f00a3 100644 --- a/packages/trpc-server/src/routers/playlist-router.ts +++ b/packages/trpc-server/src/routers/playlist-router.ts @@ -2,6 +2,14 @@ import { z } from 'zod' import { publicProcedure, router } from '../trpc' import { TRPCError } from '@trpc/server' import { esc } from './search-router' +import { PlaylistRow } from '../db-tables' + +export type PlaylistRouteData = { + playlist_id: number + name: string + permalink: string + artist_id: number +} export const playlistRouter = router({ get: publicProcedure.input(z.string()).query(async ({ ctx, input }) => { @@ -13,14 +21,14 @@ export const playlistRouter = router({ }), containTrackId: publicProcedure - .input(z.string()) + .input(z.object({ trackId: z.number() })) .query(async ({ ctx, input }) => { - const found = await esc.search({ + const found = await esc.search({ index: 'playlists', query: { bool: { must: [ - { term: { 'playlist_contents.track_ids.track': input } }, + { term: { 'playlist_contents.track_ids.track': input.trackId } }, { term: { is_delete: false } }, { term: { is_private: false } }, ], @@ -30,6 +38,8 @@ export const playlistRouter = router({ }, _source: false, }) - return found.hits.hits.map((h) => h._id) + return await ctx.loaders.playlistLoader.loadMany( + found.hits.hits.map((h) => parseInt(h._id)) + ) }), }) diff --git a/packages/trpc-server/test/search.test.ts b/packages/trpc-server/test/search.test.ts index 3130947baa4..f70f9223cb3 100644 --- a/packages/trpc-server/test/search.test.ts +++ b/packages/trpc-server/test/search.test.ts @@ -40,6 +40,6 @@ test('search tracks', async () => { test('you can get playlists that contain a track id', async () => { const caller = await testRouter() - const playlistIds = await caller.playlists.containTrackId('101') + const playlistIds = await caller.playlists.containTrackId({ trackId: 101 }) expect(playlistIds).toEqual(['301']) }) diff --git a/packages/web/.env/.env.stage b/packages/web/.env/.env.stage index 9b18b735f6f..91ee276bfc4 100644 --- a/packages/web/.env/.env.stage +++ b/packages/web/.env/.env.stage @@ -16,7 +16,6 @@ VITE_ETH_TOKEN_ADDRESS=0x5375BE4c52fA29b26077B0F15ee5254D779676A6 VITE_ETH_OWNER_WALLET= VITE_WORMHOLE_ADDRESS=0xf6f45e4d836da1d4ecd43bb1074620bfb0b7e0d7 VITE_CLAIM_DISTRIBUTION_CONTRACT_ADDRESS=0x74b89B916c97d50557E8F944F32662fE52Ce378d - VITE_SOLANA_WEB3_CLUSTER=mainnet-beta VITE_SOLANA_CLUSTER_ENDPOINT=https://audius-fe.rpcpool.com VITE_WAUDIO_MINT_ADDRESS=BELGiMZQ34SDE6x2FUaML2UHDAgBLS64xvhXjX5tBBZo diff --git a/packages/web/package.json b/packages/web/package.json index cfcf56ae03d..0192cd8e6c2 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -10,6 +10,7 @@ "start": "vite", "start:dev": "npm run write-sha && npm run publish-scripts && env-cmd ./.env/.env.git env-cmd --no-override ./.env/.env.dev turbo run start", "start:stage": "npm run write-sha && npm run publish-scripts && env-cmd ./.env/.env.git env-cmd --no-override ./.env/.env.stage turbo run start", + "start:stage-local-trpc": "npm run write-sha && npm run publish-scripts && env-cmd ./.env/.env.git env-cmd --no-override ./.env/.env.stage-local-trpc turbo run start", "start:prod": "npm run write-sha && npm run publish-scripts && env-cmd ./.env/.env.git env-cmd --no-override ./.env/.env.prod env-cmd ./.env/.env.source-maps turbo run start", "preview:prod": "npm run build:prod && vite preview --outDir build-production", "prebuild": "npm run publish-scripts", diff --git a/packages/web/src/components/track/GiantTrackTile.tsx b/packages/web/src/components/track/GiantTrackTile.tsx index 2a128cd85a6..9533fe0b254 100644 --- a/packages/web/src/components/track/GiantTrackTile.tsx +++ b/packages/web/src/components/track/GiantTrackTile.tsx @@ -45,6 +45,7 @@ import { ComponentPlacement } from 'components/types' import { UserGeneratedText } from 'components/user-generated-text' import { getFeatureEnabled } from 'services/remote-config/featureFlagHelpers' import { moodMap } from 'utils/Moods' +import { trpc } from 'utils/trpcClientWeb' import { AiTrackSection } from './AiTrackSection' import Badge from './Badge' @@ -190,7 +191,14 @@ export const GiantTrackTile = ({ const showPreview = isUSDCPurchaseGated && (isOwner || !doesUserHaveAccess) // Play button is conditionally hidden for USDC-gated tracks when the user does not have access const showPlay = isUSDCPurchaseGated ? doesUserHaveAccess : true - + const { data: playlistIds, error } = trpc.playlists.containTrackId.useQuery( + { + trackId + }, + { + enabled: !!trackId + } + ) let isScheduledRelease = false if (!isPublishing && moment.utc(released).isAfter(moment())) { isScheduledRelease = true @@ -542,6 +550,9 @@ export const GiantTrackTile = ({ {isLoading && ( )} + from + {JSON.stringify(playlistIds)} + {JSON.stringify(error)} From 6fe79b2e27d10bd0289fe61801e9d91c25640ec5 Mon Sep 17 00:00:00 2001 From: amendelsohn Date: Tue, 26 Dec 2023 12:21:03 -0800 Subject: [PATCH 04/18] wip --- packages/web/src/components/track/GiantTrackTile.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/web/src/components/track/GiantTrackTile.tsx b/packages/web/src/components/track/GiantTrackTile.tsx index 9533fe0b254..e49295ae39a 100644 --- a/packages/web/src/components/track/GiantTrackTile.tsx +++ b/packages/web/src/components/track/GiantTrackTile.tsx @@ -15,6 +15,7 @@ import { getDogEarType, isPremiumContentUSDCPurchaseGated } from '@audius/common' +import { TextLink } from '@audius/harmony' import { Mood } from '@audius/sdk' import { Button, @@ -191,7 +192,7 @@ export const GiantTrackTile = ({ const showPreview = isUSDCPurchaseGated && (isOwner || !doesUserHaveAccess) // Play button is conditionally hidden for USDC-gated tracks when the user does not have access const showPlay = isUSDCPurchaseGated ? doesUserHaveAccess : true - const { data: playlistIds, error } = trpc.playlists.containTrackId.useQuery( + const { data: playlists } = trpc.playlists.containTrackId.useQuery( { trackId }, @@ -550,9 +551,10 @@ export const GiantTrackTile = ({ {isLoading && ( )} - from - {JSON.stringify(playlistIds)} - {JSON.stringify(error)} + from {playlists?.[0].permalink} + + {playlists?.[0].name} + From e274fc36f49be615dc08de6529c8cceb6ffbbdde Mon Sep 17 00:00:00 2001 From: amendelsohn Date: Tue, 26 Dec 2023 14:23:37 -0800 Subject: [PATCH 05/18] working except elasticsearch weirdness --- packages/trpc-server/src/db-tables.ts | 1225 +++++++++-------- packages/trpc-server/src/db.ts | 39 +- packages/trpc-server/src/loaders.ts | 14 +- .../src/routers/playlist-router.ts | 1 + .../src/components/track/GiantTrackTile.tsx | 22 +- 5 files changed, 665 insertions(+), 636 deletions(-) diff --git a/packages/trpc-server/src/db-tables.ts b/packages/trpc-server/src/db-tables.ts index f6508af3a0e..a96b81f8aad 100644 --- a/packages/trpc-server/src/db-tables.ts +++ b/packages/trpc-server/src/db-tables.ts @@ -1,809 +1,810 @@ /* -* This file was generated by a tool. -* Rerun sql-ts to regenerate this file. -*/ + * This file was generated by a tool. + * Rerun sql-ts to regenerate this file. + */ export interface AggregateDailyAppNameMetricRow { - 'applicationName': string; - 'count': number; - 'createdAt'?: Date; - 'id'?: number; - 'timestamp': Date; - 'updatedAt'?: Date; + applicationName: string + count: number + createdAt?: Date + id?: number + timestamp: Date + updatedAt?: Date } export interface AggregateDailyTotalUsersMetricRow { - 'count': number; - 'createdAt'?: Date; - 'id'?: number; - 'timestamp': Date; - 'updatedAt'?: Date; + count: number + createdAt?: Date + id?: number + timestamp: Date + updatedAt?: Date } export interface AggregateDailyUniqueUsersMetricRow { - 'count': number; - 'createdAt'?: Date; - 'id'?: number; - 'summedCount'?: number | null; - 'timestamp': Date; - 'updatedAt'?: Date; + count: number + createdAt?: Date + id?: number + summedCount?: number | null + timestamp: Date + updatedAt?: Date } export interface AggregateIntervalPlayRow { - 'createdAt'?: Date | null; - 'genre'?: string | null; - 'monthListenCounts'?: string | null; - 'trackId'?: number | null; - 'weekListenCounts'?: string | null; + createdAt?: Date | null + genre?: string | null + monthListenCounts?: string | null + trackId?: number | null + weekListenCounts?: string | null } export interface AggregateMonthlyAppNameMetricRow { - 'applicationName': string; - 'count': number; - 'createdAt'?: Date; - 'id'?: number; - 'timestamp': Date; - 'updatedAt'?: Date; + applicationName: string + count: number + createdAt?: Date + id?: number + timestamp: Date + updatedAt?: Date } export interface AggregateMonthlyPlayRow { - 'count': number; - 'playItemId': number; - 'timestamp'?: Date; + count: number + playItemId: number + timestamp?: Date } export interface AggregateMonthlyTotalUsersMetricRow { - 'count': number; - 'createdAt'?: Date; - 'id'?: number; - 'timestamp': Date; - 'updatedAt'?: Date; + count: number + createdAt?: Date + id?: number + timestamp: Date + updatedAt?: Date } export interface AggregateMonthlyUniqueUsersMetricRow { - 'count': number; - 'createdAt'?: Date; - 'id'?: number; - 'summedCount'?: number | null; - 'timestamp': Date; - 'updatedAt'?: Date; + count: number + createdAt?: Date + id?: number + summedCount?: number | null + timestamp: Date + updatedAt?: Date } export interface AggregatePlaylistRow { - 'isAlbum'?: boolean | null; - 'playlistId': number; - 'repostCount'?: number | null; - 'saveCount'?: number | null; + isAlbum?: boolean | null + playlistId: number + repostCount?: number | null + saveCount?: number | null } export interface AggregatePlayRow { - 'count'?: string | null; - 'playItemId': number; + count?: string | null + playItemId: number } export interface AggregateTrackRow { - 'repostCount'?: number; - 'saveCount'?: number; - 'trackId': number; + repostCount?: number + saveCount?: number + trackId: number } export interface AggregateUserRow { - 'albumCount'?: string | null; - 'followerCount'?: string | null; - 'followingCount'?: string | null; - 'playlistCount'?: string | null; - 'repostCount'?: string | null; - 'supporterCount'?: number; - 'supportingCount'?: number; - 'trackCount'?: string | null; - 'trackSaveCount'?: string | null; - 'userId': number; + albumCount?: string | null + followerCount?: string | null + followingCount?: string | null + playlistCount?: string | null + repostCount?: string | null + supporterCount?: number + supportingCount?: number + trackCount?: string | null + trackSaveCount?: string | null + userId: number } export interface AggregateUserTipRow { - 'amount': string; - 'receiverUserId': number; - 'senderUserId': number; + amount: string + receiverUserId: number + senderUserId: number } export interface AlembicVersionRow { - 'versionNum': string; + versionNum: string } export interface AppNameMetricRow { - 'applicationName': string; - 'count': number; - 'createdAt'?: Date; - 'id'?: string; - 'ip'?: string | null; - 'timestamp'?: Date; - 'updatedAt'?: Date; + applicationName: string + count: number + createdAt?: Date + id?: string + ip?: string | null + timestamp?: Date + updatedAt?: Date } export interface AppNameMetricsAllTimeRow { - 'count'?: string | null; - 'name'?: string | null; + count?: string | null + name?: string | null } export interface AppNameMetricsTrailingMonthRow { - 'count'?: string | null; - 'name'?: string | null; + count?: string | null + name?: string | null } export interface AppNameMetricsTrailingWeekRow { - 'count'?: string | null; - 'name'?: string | null; + count?: string | null + name?: string | null } export interface AssociatedWalletRow { - 'blockhash': string; - 'blocknumber': number; - 'chain': wallet_chain; - 'id'?: number; - 'isCurrent': boolean; - 'isDelete': boolean; - 'userId': number; - 'wallet': string; + blockhash: string + blocknumber: number + chain: wallet_chain + id?: number + isCurrent: boolean + isDelete: boolean + userId: number + wallet: string } export interface AudioTransactionsHistoryRow { - 'balance': string; - 'change': string; - 'createdAt'?: Date; - 'method': string; - 'signature': string; - 'slot': number; - 'transactionCreatedAt': Date; - 'transactionType': string; - 'txMetadata'?: string | null; - 'updatedAt'?: Date; - 'userBank': string; + balance: string + change: string + createdAt?: Date + method: string + signature: string + slot: number + transactionCreatedAt: Date + transactionType: string + txMetadata?: string | null + updatedAt?: Date + userBank: string } export interface AudiusDataTxRow { - 'signature': string; - 'slot': number; + signature: string + slot: number } export interface BlockRow { - 'blockhash': string; - 'isCurrent'?: boolean | null; - 'number'?: number | null; - 'parenthash'?: string | null; + blockhash: string + isCurrent?: boolean | null + number?: number | null + parenthash?: string | null } export interface ChallengeDisbursementRow { - 'amount': string; - 'challengeId': string; - 'signature': string; - 'slot': number; - 'specifier': string; - 'userId': number; + amount: string + challengeId: string + signature: string + slot: number + specifier: string + userId: number } export interface ChallengeListenStreakRow { - 'lastListenDate'?: Date | null; - 'listenStreak': number; - 'userId'?: number; + lastListenDate?: Date | null + listenStreak: number + userId?: number } export interface ChallengeProfileCompletionRow { - 'favorites': boolean; - 'follows': boolean; - 'profileCoverPhoto': boolean; - 'profileDescription': boolean; - 'profileName': boolean; - 'profilePicture': boolean; - 'reposts': boolean; - 'userId'?: number; + favorites: boolean + follows: boolean + profileCoverPhoto: boolean + profileDescription: boolean + profileName: boolean + profilePicture: boolean + reposts: boolean + userId?: number } export interface ChallengeRow { - 'active': boolean; - 'amount': string; - 'id': string; - 'startingBlock'?: number | null; - 'stepCount'?: number | null; - 'type': challengetype; + active: boolean + amount: string + id: string + startingBlock?: number | null + stepCount?: number | null + type: challengetype } export interface ChatRow { - 'chatId': string; - 'createdAt': Date; - 'lastMessage'?: string | null; - 'lastMessageAt': Date; + chatId: string + createdAt: Date + lastMessage?: string | null + lastMessageAt: Date } export interface ChatBanRow { - 'isBanned': boolean; - 'updatedAt': Date; - 'userId': number; + isBanned: boolean + updatedAt: Date + userId: number } export interface ChatBlockedUserRow { - 'blockeeUserId': number; - 'blockerUserId': number; - 'createdAt'?: Date; + blockeeUserId: number + blockerUserId: number + createdAt?: Date } export interface ChatMemberRow { - 'chatId': string; - 'clearedHistoryAt'?: Date | null; - 'createdAt': Date; - 'inviteCode': string; - 'invitedByUserId': number; - 'lastActiveAt'?: Date | null; - 'unreadCount'?: number; - 'userId': number; + chatId: string + clearedHistoryAt?: Date | null + createdAt: Date + inviteCode: string + invitedByUserId: number + lastActiveAt?: Date | null + unreadCount?: number + userId: number } export interface ChatMessageRow { - 'chatId': string; - 'ciphertext': string; - 'createdAt': Date; - 'messageId': string; - 'userId': number; + chatId: string + ciphertext: string + createdAt: Date + messageId: string + userId: number } export interface ChatMessageReactionRow { - 'createdAt'?: Date; - 'messageId': string; - 'reaction': string; - 'updatedAt'?: Date; - 'userId': number; + createdAt?: Date + messageId: string + reaction: string + updatedAt?: Date + userId: number } export interface ChatPermissionRow { - 'permits'?: string | null; - 'updatedAt'?: Date; - 'userId': number; + permits?: string | null + updatedAt?: Date + userId: number } export interface CidDataRow { - 'cid': string; - 'data'?: any | null; - 'type'?: string | null; + cid: string + data?: any | null + type?: string | null } export interface DelistStatusCursorRow { - 'createdAt': Date; - 'entity': delist_entity; - 'host': string; + createdAt: Date + entity: delist_entity + host: string } export interface DeveloperAppRow { - 'address': string; - 'blockhash'?: string | null; - 'blocknumber'?: number | null; - 'createdAt': Date; - 'description'?: string | null; - 'isCurrent': boolean; - 'isDelete'?: boolean; - 'isPersonalAccess'?: boolean; - 'name': string; - 'txhash': string; - 'updatedAt': Date; - 'userId'?: number | null; + address: string + blockhash?: string | null + blocknumber?: number | null + createdAt: Date + description?: string | null + isCurrent: boolean + isDelete?: boolean + isPersonalAccess?: boolean + name: string + txhash: string + updatedAt: Date + userId?: number | null } export interface EthBlockRow { - 'createdAt'?: Date; - 'lastScannedBlock'?: number; - 'updatedAt'?: Date; + createdAt?: Date + lastScannedBlock?: number + updatedAt?: Date } export interface FollowRow { - 'blockhash'?: string | null; - 'blocknumber'?: number | null; - 'createdAt': Date; - 'followeeUserId': number; - 'followerUserId': number; - 'isCurrent': boolean; - 'isDelete': boolean; - 'slot'?: number | null; - 'txhash'?: string; + blockhash?: string | null + blocknumber?: number | null + createdAt: Date + followeeUserId: number + followerUserId: number + isCurrent: boolean + isDelete: boolean + slot?: number | null + txhash?: string } export interface GrantRow { - 'blockhash'?: string | null; - 'blocknumber'?: number | null; - 'createdAt': Date; - 'granteeAddress': string; - 'isApproved'?: boolean; - 'isCurrent': boolean; - 'isRevoked'?: boolean; - 'txhash': string; - 'updatedAt': Date; - 'userId': number; + blockhash?: string | null + blocknumber?: number | null + createdAt: Date + granteeAddress: string + isApproved?: boolean + isCurrent: boolean + isRevoked?: boolean + txhash: string + updatedAt: Date + userId: number } export interface HourlyPlayCountRow { - 'hourlyTimestamp': Date; - 'playCount': number; + hourlyTimestamp: Date + playCount: number } export interface IndexingCheckpointRow { - 'lastCheckpoint': number; - 'signature'?: string | null; - 'tablename': string; + lastCheckpoint: number + signature?: string | null + tablename: string } export interface MilestoneRow { - 'blocknumber'?: number | null; - 'id': number; - 'name': string; - 'slot'?: number | null; - 'threshold': number; - 'timestamp': Date; + blocknumber?: number | null + id: number + name: string + slot?: number | null + threshold: number + timestamp: Date } export interface NotificationRow { - 'blocknumber'?: number | null; - 'data'?: any | null; - 'groupId': string; - 'id'?: number; - 'slot'?: number | null; - 'specifier': string; - 'timestamp': Date; - 'type': string; - 'typeV2'?: string | null; - 'userIds'?: any | null; + blocknumber?: number | null + data?: any | null + groupId: string + id?: number + slot?: number | null + specifier: string + timestamp: Date + type: string + typeV2?: string | null + userIds?: any | null } export interface NotificationSeenRow { - 'blockhash'?: string | null; - 'blocknumber'?: number | null; - 'seenAt': Date; - 'txhash'?: string | null; - 'userId': number; + blockhash?: string | null + blocknumber?: number | null + seenAt: Date + txhash?: string | null + userId: number } export interface PgStatStatementRow { - 'blkReadTime'?: number | null; - 'blkWriteTime'?: number | null; - 'calls'?: string | null; - 'dbid'?: any | null; - 'localBlksDirtied'?: string | null; - 'localBlksHit'?: string | null; - 'localBlksRead'?: string | null; - 'localBlksWritten'?: string | null; - 'maxTime'?: number | null; - 'meanTime'?: number | null; - 'minTime'?: number | null; - 'query'?: string | null; - 'queryid'?: string | null; - 'rows'?: string | null; - 'sharedBlksDirtied'?: string | null; - 'sharedBlksHit'?: string | null; - 'sharedBlksRead'?: string | null; - 'sharedBlksWritten'?: string | null; - 'stddevTime'?: number | null; - 'tempBlksRead'?: string | null; - 'tempBlksWritten'?: string | null; - 'totalTime'?: number | null; - 'userid'?: any | null; + blkReadTime?: number | null + blkWriteTime?: number | null + calls?: string | null + dbid?: any | null + localBlksDirtied?: string | null + localBlksHit?: string | null + localBlksRead?: string | null + localBlksWritten?: string | null + maxTime?: number | null + meanTime?: number | null + minTime?: number | null + query?: string | null + queryid?: string | null + rows?: string | null + sharedBlksDirtied?: string | null + sharedBlksHit?: string | null + sharedBlksRead?: string | null + sharedBlksWritten?: string | null + stddevTime?: number | null + tempBlksRead?: string | null + tempBlksWritten?: string | null + totalTime?: number | null + userid?: any | null } export interface PlaylistRouteRow { - 'blockhash': string; - 'blocknumber': number; - 'collisionId': number; - 'isCurrent': boolean; - 'ownerId': number; - 'playlistId': number; - 'slug': string; - 'titleSlug': string; - 'txhash': string; + blockhash: string + blocknumber: number + collisionId: number + isCurrent: boolean + ownerId: number + playlistId: number + slug: string + titleSlug: string + txhash: string } export interface PlaylistSeenRow { - 'blockhash'?: string | null; - 'blocknumber'?: number | null; - 'isCurrent': boolean; - 'playlistId': number; - 'seenAt': Date; - 'txhash'?: string | null; - 'userId': number; + blockhash?: string | null + blocknumber?: number | null + isCurrent: boolean + playlistId: number + seenAt: Date + txhash?: string | null + userId: number } export interface PlaylistRow { - 'blockhash'?: string | null; - 'blocknumber'?: number | null; - 'createdAt': Date; - 'description'?: string | null; - 'isAlbum': boolean; - 'isCurrent': boolean; - 'isDelete': boolean; - 'isImageAutogenerated'?: boolean; - 'isPrivate': boolean; - 'lastAddedTo'?: Date | null; - 'metadataMultihash'?: string | null; - 'permalink'?: string | null; - 'playlistContents': any; - 'playlistId': number; - 'playlistImageMultihash'?: string | null; - 'playlistImageSizesMultihash'?: string | null; - 'playlistName'?: string | null; - 'playlistOwnerId': number; - 'slot'?: number | null; - 'txhash'?: string; - 'upc'?: string | null; - 'updatedAt': Date; + blockhash?: string | null + blocknumber?: number | null + createdAt: Date + description?: string | null + isAlbum: boolean + isCurrent: boolean + isDelete: boolean + isImageAutogenerated?: boolean + isPrivate: boolean + lastAddedTo?: Date | null + metadataMultihash?: string | null + permalink?: string | null + playlistContents: any + playlistId: number + playlistImageMultihash?: string | null + playlistImageSizesMultihash?: string | null + playlistName?: string | null + playlistOwnerId: number + slot?: number | null + slug?: string | null + txhash?: string + upc?: string | null + updatedAt: Date } export interface PlayRow { - 'city'?: string | null; - 'country'?: string | null; - 'createdAt'?: Date; - 'id'?: number; - 'playItemId': number; - 'region'?: string | null; - 'signature'?: string | null; - 'slot'?: number | null; - 'source'?: string | null; - 'updatedAt'?: Date; - 'userId'?: number | null; + city?: string | null + country?: string | null + createdAt?: Date + id?: number + playItemId: number + region?: string | null + signature?: string | null + slot?: number | null + source?: string | null + updatedAt?: Date + userId?: number | null } export interface ReactionRow { - 'id'?: number; - 'reactedTo': string; - 'reactionType': string; - 'reactionValue': number; - 'senderWallet': string; - 'slot': number; - 'timestamp': Date; - 'txSignature'?: string | null; + id?: number + reactedTo: string + reactionType: string + reactionValue: number + senderWallet: string + slot: number + timestamp: Date + txSignature?: string | null } export interface RelatedArtistRow { - 'createdAt'?: Date; - 'relatedArtistUserId': number; - 'score': number; - 'userId': number; + createdAt?: Date + relatedArtistUserId: number + score: number + userId: number } export interface RemixeRow { - 'childTrackId': number; - 'parentTrackId': number; + childTrackId: number + parentTrackId: number } export interface RepostRow { - 'blockhash'?: string | null; - 'blocknumber'?: number | null; - 'createdAt': Date; - 'isCurrent': boolean; - 'isDelete': boolean; - 'isRepostOfRepost'?: boolean; - 'repostItemId': number; - 'repostType': reposttype; - 'slot'?: number | null; - 'txhash'?: string; - 'userId': number; + blockhash?: string | null + blocknumber?: number | null + createdAt: Date + isCurrent: boolean + isDelete: boolean + isRepostOfRepost?: boolean + repostItemId: number + repostType: reposttype + slot?: number | null + txhash?: string + userId: number } export interface RevertBlockRow { - 'blocknumber': number; - 'prevRecords': any; + blocknumber: number + prevRecords: any } export interface RewardManagerTxRow { - 'createdAt': Date; - 'signature': string; - 'slot': number; + createdAt: Date + signature: string + slot: number } export interface RewardsManagerBackfillTxRow { - 'createdAt': Date; - 'signature': string; - 'slot': number; + createdAt: Date + signature: string + slot: number } export interface RouteMetricRow { - 'count': number; - 'createdAt'?: Date; - 'id'?: string; - 'ip'?: string | null; - 'queryString'?: string; - 'routePath': string; - 'timestamp'?: Date; - 'updatedAt'?: Date; - 'version': string; + count: number + createdAt?: Date + id?: string + ip?: string | null + queryString?: string + routePath: string + timestamp?: Date + updatedAt?: Date + version: string } export interface RouteMetricsAllTimeRow { - 'count'?: string | null; - 'uniqueCount'?: string | null; + count?: string | null + uniqueCount?: string | null } export interface RouteMetricsDayBucketRow { - 'count'?: string | null; - 'time'?: Date | null; - 'uniqueCount'?: string | null; + count?: string | null + time?: Date | null + uniqueCount?: string | null } export interface RouteMetricsMonthBucketRow { - 'count'?: string | null; - 'time'?: Date | null; - 'uniqueCount'?: string | null; + count?: string | null + time?: Date | null + uniqueCount?: string | null } export interface RouteMetricsTrailingMonthRow { - 'count'?: string | null; - 'uniqueCount'?: string | null; + count?: string | null + uniqueCount?: string | null } export interface RouteMetricsTrailingWeekRow { - 'count'?: string | null; - 'uniqueCount'?: string | null; + count?: string | null + uniqueCount?: string | null } export interface RpcCursorRow { - 'relayedAt': Date; - 'relayedBy': string; + relayedAt: Date + relayedBy: string } export interface RpcErrorRow { - 'errorCount'?: number; - 'errorText': string; - 'lastAttempt': Date; - 'rpcLogJson': any; - 'sig': string; + errorCount?: number + errorText: string + lastAttempt: Date + rpcLogJson: any + sig: string } export interface RpcLogRow { - 'appliedAt': Date; - 'fromWallet': string; - 'relayedAt': Date; - 'relayedBy': string; - 'rpc': Object; - 'sig': string; + appliedAt: Date + fromWallet: string + relayedAt: Date + relayedBy: string + rpc: Object + sig: string } export interface SaveRow { - 'blockhash'?: string | null; - 'blocknumber'?: number | null; - 'createdAt': Date; - 'isCurrent': boolean; - 'isDelete': boolean; - 'isSaveOfRepost'?: boolean; - 'saveItemId': number; - 'saveType': savetype; - 'slot'?: number | null; - 'txhash'?: string; - 'userId': number; + blockhash?: string | null + blocknumber?: number | null + createdAt: Date + isCurrent: boolean + isDelete: boolean + isSaveOfRepost?: boolean + saveItemId: number + saveType: savetype + slot?: number | null + txhash?: string + userId: number } export interface SchemaMigrationRow { - 'version': string; + version: string } export interface SchemaVersionRow { - 'appliedAt'?: Date; - 'fileName': string; - 'md5'?: string | null; + appliedAt?: Date + fileName: string + md5?: string | null } export interface SkippedTransactionRow { - 'blockhash': string; - 'blocknumber': number; - 'createdAt'?: Date; - 'id'?: number; - 'level'?: skippedtransactionlevel; - 'txhash': string; - 'updatedAt'?: Date; + blockhash: string + blocknumber: number + createdAt?: Date + id?: number + level?: skippedtransactionlevel + txhash: string + updatedAt?: Date } export interface SplTokenBackfillTxRow { - 'createdAt': Date; - 'lastScannedSlot'?: number; - 'signature': string; - 'updatedAt': Date; + createdAt: Date + lastScannedSlot?: number + signature: string + updatedAt: Date } export interface SplTokenTxRow { - 'createdAt'?: Date; - 'lastScannedSlot': number; - 'signature': string; - 'updatedAt'?: Date; + createdAt?: Date + lastScannedSlot: number + signature: string + updatedAt?: Date } export interface StemRow { - 'childTrackId': number; - 'parentTrackId': number; + childTrackId: number + parentTrackId: number } export interface SubscriptionRow { - 'blockhash'?: string | null; - 'blocknumber'?: number | null; - 'createdAt'?: Date; - 'isCurrent': boolean; - 'isDelete': boolean; - 'subscriberId': number; - 'txhash'?: string; - 'userId': number; + blockhash?: string | null + blocknumber?: number | null + createdAt?: Date + isCurrent: boolean + isDelete: boolean + subscriberId: number + txhash?: string + userId: number } export interface SupporterRankUpRow { - 'rank': number; - 'receiverUserId': number; - 'senderUserId': number; - 'slot': number; + rank: number + receiverUserId: number + senderUserId: number + slot: number } export interface TagTrackUserRow { - 'ownerId'?: number | null; - 'tag'?: string | null; - 'trackId'?: number | null; + ownerId?: number | null + tag?: string | null + trackId?: number | null } export interface TrackDelistStatuseRow { - 'createdAt': Date; - 'delisted': boolean; - 'ownerId': number; - 'reason': delist_track_reason; - 'trackCid': string; - 'trackId': number; + createdAt: Date + delisted: boolean + ownerId: number + reason: delist_track_reason + trackCid: string + trackId: number } export interface TrackPriceHistoryRow { - 'blockTimestamp': Date; - 'blocknumber': number; - 'createdAt'?: Date; - 'splits': any; - 'totalPriceCents': string; - 'trackId': number; + blockTimestamp: Date + blocknumber: number + createdAt?: Date + splits: any + totalPriceCents: string + trackId: number } export interface TrackRouteRow { - 'blockhash': string; - 'blocknumber': number; - 'collisionId': number; - 'isCurrent': boolean; - 'ownerId': number; - 'slug': string; - 'titleSlug': string; - 'trackId': number; - 'txhash': string; + blockhash: string + blocknumber: number + collisionId: number + isCurrent: boolean + ownerId: number + slug: string + titleSlug: string + trackId: number + txhash: string } export interface TrackTrendingScoreRow { - 'createdAt': Date; - 'genre'?: string | null; - 'score': number; - 'timeRange': string; - 'trackId': number; - 'type': string; - 'version': string; + createdAt: Date + genre?: string | null + score: number + timeRange: string + trackId: number + type: string + version: string } export interface TrackRow { - 'aiAttributionUserId'?: number | null; - 'audioUploadId'?: string | null; - 'blockhash'?: string | null; - 'blocknumber'?: number | null; - 'coverArt'?: string | null; - 'coverArtSizes'?: string | null; - 'createDate'?: string | null; - 'createdAt': Date; - 'creditsSplits'?: string | null; - 'description'?: string | null; - 'download'?: any | null; - 'duration'?: number | null; - 'fieldVisibility'?: any | null; - 'fileType'?: string | null; - 'genre'?: string | null; - 'isAvailable'?: boolean; - 'isCurrent': boolean; - 'isDelete': boolean; - 'isPlaylistUpload'?: boolean; - 'isPremium'?: boolean; - 'isUnlisted'?: boolean; - 'isrc'?: string | null; - 'iswc'?: string | null; - 'license'?: string | null; - 'metadataMultihash'?: string | null; - 'mood'?: string | null; - 'ownerId': number; - 'premiumConditions'?: any | null; - 'previewCid'?: string | null; - 'previewStartSeconds'?: number | null; - 'releaseDate'?: string | null; - 'remixOf'?: any | null; - 'routeId'?: string | null; - 'slot'?: number | null; - 'stemOf'?: any | null; - 'tags'?: string | null; - 'title'?: string | null; - 'trackCid'?: string | null; - 'trackId': number; - 'trackSegments': any; - 'txhash'?: string; - 'updatedAt': Date; + aiAttributionUserId?: number | null + audioUploadId?: string | null + blockhash?: string | null + blocknumber?: number | null + coverArt?: string | null + coverArtSizes?: string | null + createDate?: string | null + createdAt: Date + creditsSplits?: string | null + description?: string | null + download?: any | null + duration?: number | null + fieldVisibility?: any | null + fileType?: string | null + genre?: string | null + isAvailable?: boolean + isCurrent: boolean + isDelete: boolean + isPlaylistUpload?: boolean + isPremium?: boolean + isUnlisted?: boolean + isrc?: string | null + iswc?: string | null + license?: string | null + metadataMultihash?: string | null + mood?: string | null + ownerId: number + premiumConditions?: any | null + previewCid?: string | null + previewStartSeconds?: number | null + releaseDate?: string | null + remixOf?: any | null + routeId?: string | null + slot?: number | null + stemOf?: any | null + tags?: string | null + title?: string | null + trackCid?: string | null + trackId: number + trackSegments: any + txhash?: string + updatedAt: Date } export interface TrendingParamRow { - 'genre'?: string | null; - 'karma'?: string | null; - 'ownerFollowerCount'?: string | null; - 'ownerId'?: number | null; - 'playCount'?: string | null; - 'repostCount'?: number | null; - 'repostMonthCount'?: string | null; - 'repostWeekCount'?: string | null; - 'repostYearCount'?: string | null; - 'saveCount'?: number | null; - 'saveMonthCount'?: string | null; - 'saveWeekCount'?: string | null; - 'saveYearCount'?: string | null; - 'trackId'?: number | null; + genre?: string | null + karma?: string | null + ownerFollowerCount?: string | null + ownerId?: number | null + playCount?: string | null + repostCount?: number | null + repostMonthCount?: string | null + repostWeekCount?: string | null + repostYearCount?: string | null + saveCount?: number | null + saveMonthCount?: string | null + saveWeekCount?: string | null + saveYearCount?: string | null + trackId?: number | null } export interface TrendingResultRow { - 'id'?: string | null; - 'rank': number; - 'type': string; - 'userId': number; - 'version': string; - 'week': Date; + id?: string | null + rank: number + type: string + userId: number + version: string + week: Date } export interface UsdcPurchaseRow { - 'amount': string; - 'buyerUserId': number; - 'contentId': number; - 'contentType': usdc_purchase_content_type; - 'createdAt'?: Date; - 'extraAmount'?: string; - 'sellerUserId': number; - 'signature': string; - 'slot': number; - 'updatedAt'?: Date; + amount: string + buyerUserId: number + contentId: number + contentType: usdc_purchase_content_type + createdAt?: Date + extraAmount?: string + sellerUserId: number + signature: string + slot: number + updatedAt?: Date } export interface UsdcTransactionsHistoryRow { - 'balance': string; - 'change': string; - 'createdAt'?: Date; - 'method': string; - 'signature': string; - 'slot': number; - 'transactionCreatedAt': Date; - 'transactionType': string; - 'txMetadata'?: string | null; - 'updatedAt'?: Date; - 'userBank': string; + balance: string + change: string + createdAt?: Date + method: string + signature: string + slot: number + transactionCreatedAt: Date + transactionType: string + txMetadata?: string | null + updatedAt?: Date + userBank: string } export interface UsdcUserBankAccountRow { - 'bankAccount': string; - 'createdAt'?: Date; - 'ethereumAddress': string; - 'signature': string; + bankAccount: string + createdAt?: Date + ethereumAddress: string + signature: string } export interface UserBalanceChangeRow { - 'blocknumber': number; - 'createdAt'?: Date; - 'currentBalance': string; - 'previousBalance': string; - 'updatedAt'?: Date; - 'userId'?: number; + blocknumber: number + createdAt?: Date + currentBalance: string + previousBalance: string + updatedAt?: Date + userId?: number } export interface UserBalanceRow { - 'associatedSolWalletsBalance'?: string; - 'associatedWalletsBalance'?: string; - 'balance': string; - 'createdAt'?: Date; - 'updatedAt'?: Date; - 'userId'?: number; - 'waudio'?: string | null; + associatedSolWalletsBalance?: string + associatedWalletsBalance?: string + balance: string + createdAt?: Date + updatedAt?: Date + userId?: number + waudio?: string | null } export interface UserBankAccountRow { - 'bankAccount': string; - 'createdAt': Date; - 'ethereumAddress': string; - 'signature': string; + bankAccount: string + createdAt: Date + ethereumAddress: string + signature: string } export interface UserBankBackfillTxRow { - 'createdAt': Date; - 'signature': string; - 'slot': number; + createdAt: Date + signature: string + slot: number } export interface UserBankTxRow { - 'createdAt': Date; - 'signature': string; - 'slot': number; + createdAt: Date + signature: string + slot: number } export interface UserChallengeRow { - 'challengeId': string; - 'completedBlocknumber'?: number | null; - 'currentStepCount'?: number | null; - 'isComplete': boolean; - 'specifier': string; - 'userId': number; + challengeId: string + completedBlocknumber?: number | null + currentStepCount?: number | null + isComplete: boolean + specifier: string + userId: number } export interface UserDelistStatuseRow { - 'createdAt': Date; - 'delisted': boolean; - 'reason': delist_user_reason; - 'userId': number; + createdAt: Date + delisted: boolean + reason: delist_user_reason + userId: number } export interface UserEventRow { - 'blockhash'?: string | null; - 'blocknumber'?: number | null; - 'id'?: number; - 'isCurrent': boolean; - 'isMobileUser'?: boolean; - 'referrer'?: number | null; - 'slot'?: number | null; - 'userId': number; + blockhash?: string | null + blocknumber?: number | null + id?: number + isCurrent: boolean + isMobileUser?: boolean + referrer?: number | null + slot?: number | null + userId: number } export interface UserListeningHistoryRow { - 'listeningHistory': any; - 'userId'?: number; + listeningHistory: any + userId?: number } export interface UserPubkeyRow { - 'pubkeyBase64': string; - 'userId': number; + pubkeyBase64: string + userId: number } export interface UserTipRow { - 'amount': string; - 'createdAt'?: Date; - 'receiverUserId': number; - 'senderUserId': number; - 'signature': string; - 'slot': number; - 'updatedAt'?: Date; + amount: string + createdAt?: Date + receiverUserId: number + senderUserId: number + signature: string + slot: number + updatedAt?: Date } export interface UserRow { - 'allowAiAttribution'?: boolean; - 'artistPickTrackId'?: number | null; - 'bio'?: string | null; - 'blockhash'?: string | null; - 'blocknumber'?: number | null; - 'coverPhoto'?: string | null; - 'coverPhotoSizes'?: string | null; - 'createdAt'?: Date; - 'creatorNodeEndpoint'?: string | null; - 'handle'?: string | null; - 'handleLc'?: string | null; - 'hasCollectibles'?: boolean; - 'isAvailable'?: boolean; - 'isCurrent': boolean; - 'isDeactivated'?: boolean; - 'isStorageV2'?: boolean; - 'isVerified'?: boolean; - 'location'?: string | null; - 'metadataMultihash'?: string | null; - 'name'?: string | null; - 'playlistLibrary'?: any | null; - 'primaryId'?: number | null; - 'profilePicture'?: string | null; - 'profilePictureSizes'?: string | null; - 'replicaSetUpdateSigner'?: string | null; - 'secondaryIds'?: any | null; - 'slot'?: number | null; - 'txhash'?: string; - 'updatedAt'?: Date; - 'userAuthorityAccount'?: string | null; - 'userId': number; - 'userStorageAccount'?: string | null; - 'wallet'?: string | null; + allowAiAttribution?: boolean + artistPickTrackId?: number | null + bio?: string | null + blockhash?: string | null + blocknumber?: number | null + coverPhoto?: string | null + coverPhotoSizes?: string | null + createdAt?: Date + creatorNodeEndpoint?: string | null + handle?: string | null + handleLc?: string | null + hasCollectibles?: boolean + isAvailable?: boolean + isCurrent: boolean + isDeactivated?: boolean + isStorageV2?: boolean + isVerified?: boolean + location?: string | null + metadataMultihash?: string | null + name?: string | null + playlistLibrary?: any | null + primaryId?: number | null + profilePicture?: string | null + profilePictureSizes?: string | null + replicaSetUpdateSigner?: string | null + secondaryIds?: any | null + slot?: number | null + txhash?: string + updatedAt?: Date + userAuthorityAccount?: string | null + userId: number + userStorageAccount?: string | null + wallet?: string | null } export enum wallet_chain { 'eth' = 'eth', diff --git a/packages/trpc-server/src/db.ts b/packages/trpc-server/src/db.ts index a0c95d91eb8..b1d7666158a 100644 --- a/packages/trpc-server/src/db.ts +++ b/packages/trpc-server/src/db.ts @@ -99,21 +99,40 @@ export type SelectPlaylistProps = { ownerId?: number } +type AugmentedPlaylistRows = (APlaylist & { + artistHandle?: string +})[] + export async function selectPlaylistsCamel(p: SelectPlaylistProps) { - return sql` - select ${p.cols ? sql(p.cols) : sql`*`} - from (select *, ( - select slug - from playlist_routes pr - where + const rows = await sql` + select users.handle as artist_handle, ${ + p.cols ? sql(p.cols) : sql`pl_with_slug.*` + } + from ( + select *, ( + select slug + from playlist_routes pr + where pr.playlist_id = playlists.playlist_id and is_current = 'true' - ) as permalink - from playlists) as playlists_with_permalinks + ) + from playlists + ) as pl_with_slug + left join users on playlist_owner_id = user_id left join aggregate_playlist using (playlist_id, is_album) - where is_current = true + where pl_with_slug.is_current = true ${p.isAlbum != undefined ? sql`and is_album = ${p.isAlbum}` : sql``} ${p.ids ? sql`and playlist_id in ${sql(p.ids)}` : sql``} ${p.ownerId ? sql`and playlist_owner_id = ${p.ownerId}` : sql``} - order by created_at desc + order by pl_with_slug.created_at desc ` + + if (p.cols && !p.cols?.includes('permalink')) return rows + rows.forEach((row) => { + row.permalink = `/${row.artistHandle}/${ + row.isAlbum ? 'album' : 'playlist' + }/${row.slug}` + delete row.artistHandle + }) + + return rows } diff --git a/packages/trpc-server/src/loaders.ts b/packages/trpc-server/src/loaders.ts index 49ce5f1052a..50574137d91 100644 --- a/packages/trpc-server/src/loaders.ts +++ b/packages/trpc-server/src/loaders.ts @@ -6,7 +6,7 @@ import { selectPlaylistsCamel, selectTracksCamel, selectUsersCamel, - sql + sql, } from './db' import { FollowRow, SubscriptionRow } from './db-tables' @@ -51,7 +51,7 @@ export const prepareLoaders = (myId: number | undefined) => ({ from subscriptions where is_delete = false and user_id in ${sql(ids)} - and subscriber_id = ${myId}` + and subscriber_id = ${myId}`, ]) for (const row of followRows) { @@ -68,7 +68,7 @@ export const prepareLoaders = (myId: number | undefined) => ({ return ids.map((id) => ({ followed: outboundIds.has(id), followsMe: inboundIds.has(id), - subscribed: subscribedIds.has(id) + subscribed: subscribedIds.has(id), })) } ), @@ -96,7 +96,9 @@ export const prepareLoaders = (myId: number | undefined) => ({ from reposts where is_delete = false and user_id = ${myId} - and repost_type in ${sql(kinds)} and repost_item_id in ${sql(ids)};` + and repost_type in ${sql(kinds)} and repost_item_id in ${sql( + ids + )};`, ]) for (const row of savedRows) { @@ -110,10 +112,10 @@ export const prepareLoaders = (myId: number | undefined) => ({ return ids.map((id) => ({ saved: saved.has(id), - reposted: reposted.has(id) + reposted: reposted.has(id), })) }) - } + }, }) function mapRowsUsingKey(keyName: string, rows: any[], keys: readonly any[]) { diff --git a/packages/trpc-server/src/routers/playlist-router.ts b/packages/trpc-server/src/routers/playlist-router.ts index c35db7f00a3..e12a9656c6d 100644 --- a/packages/trpc-server/src/routers/playlist-router.ts +++ b/packages/trpc-server/src/routers/playlist-router.ts @@ -38,6 +38,7 @@ export const playlistRouter = router({ }, _source: false, }) + return await ctx.loaders.playlistLoader.loadMany( found.hits.hits.map((h) => parseInt(h._id)) ) diff --git a/packages/web/src/components/track/GiantTrackTile.tsx b/packages/web/src/components/track/GiantTrackTile.tsx index e49295ae39a..cab8c7d85c6 100644 --- a/packages/web/src/components/track/GiantTrackTile.tsx +++ b/packages/web/src/components/track/GiantTrackTile.tsx @@ -15,7 +15,7 @@ import { getDogEarType, isPremiumContentUSDCPurchaseGated } from '@audius/common' -import { TextLink } from '@audius/harmony' +import { Flex, TextLink } from '@audius/harmony' import { Mood } from '@audius/sdk' import { Button, @@ -32,7 +32,7 @@ import moment from 'moment' import IconRobot from 'assets/img/robot.svg' import DownloadButtons from 'components/download-buttons/DownloadButtons' import { EntityActionButton } from 'components/entity-page/EntityActionButton' -import { UserLink } from 'components/link' +import { Link, UserLink } from 'components/link' import LoadingSpinner from 'components/loading-spinner/LoadingSpinner' import Menu from 'components/menu/Menu' import RepostFavoritesStats from 'components/repost-favorites-stats/RepostFavoritesStats' @@ -536,7 +536,7 @@ export const GiantTrackTile = ({ {isLoading && }
-
+ By -
+ {playlists?.[0].playlistName ? ( + <> + from + + + {playlists?.[0].playlistName} + + + + ) : null} + {isLoading && ( )} - from {playlists?.[0].permalink} - - {playlists?.[0].name} -
From 13be05615d0aa5514b4e802373f30784ba145043 Mon Sep 17 00:00:00 2001 From: amendelsohn Date: Tue, 26 Dec 2023 14:36:36 -0800 Subject: [PATCH 06/18] add collectionType arg --- .../trpc-server/src/routers/playlist-router.ts | 10 +++++++++- .../web/src/components/track/GiantTrackTile.tsx | 14 +++++++++----- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/packages/trpc-server/src/routers/playlist-router.ts b/packages/trpc-server/src/routers/playlist-router.ts index e12a9656c6d..c877edcc068 100644 --- a/packages/trpc-server/src/routers/playlist-router.ts +++ b/packages/trpc-server/src/routers/playlist-router.ts @@ -21,7 +21,9 @@ export const playlistRouter = router({ }), containTrackId: publicProcedure - .input(z.object({ trackId: z.number() })) + .input( + z.object({ trackId: z.number(), collectionType: z.string().optional() }) + ) .query(async ({ ctx, input }) => { const found = await esc.search({ index: 'playlists', @@ -31,6 +33,12 @@ export const playlistRouter = router({ { term: { 'playlist_contents.track_ids.track': input.trackId } }, { term: { is_delete: false } }, { term: { is_private: false } }, + ...(input.collectionType === 'album' + ? [{ term: { is_album: true } }] + : []), + ...(input.collectionType === 'playlist' + ? [{ term: { is_album: false } }] + : []), ], must_not: [], should: [], diff --git a/packages/web/src/components/track/GiantTrackTile.tsx b/packages/web/src/components/track/GiantTrackTile.tsx index cab8c7d85c6..18006ec27d8 100644 --- a/packages/web/src/components/track/GiantTrackTile.tsx +++ b/packages/web/src/components/track/GiantTrackTile.tsx @@ -26,6 +26,7 @@ import { IconHeart, IconKebabHorizontal } from '@audius/stems' +import { APlaylist } from '@audius/trpc-server/src/db' import cn from 'classnames' import moment from 'moment' @@ -187,6 +188,7 @@ export const GiantTrackTile = ({ ) const isUSDCPurchaseGated = isPremiumContentUSDCPurchaseGated(premiumConditions) + const isEditAlbumsEnabled = getFeatureEnabled(FeatureFlags.EDIT_ALBUMS) // Preview button is shown for USDC-gated tracks if user does not have access // or is the owner const showPreview = isUSDCPurchaseGated && (isOwner || !doesUserHaveAccess) @@ -194,12 +196,14 @@ export const GiantTrackTile = ({ const showPlay = isUSDCPurchaseGated ? doesUserHaveAccess : true const { data: playlists } = trpc.playlists.containTrackId.useQuery( { - trackId + trackId, + collectionType: 'album' }, { enabled: !!trackId } ) + const album = playlists?.[0] as unknown as APlaylist | undefined let isScheduledRelease = false if (!isPublishing && moment.utc(released).isAfter(moment())) { isScheduledRelease = true @@ -547,13 +551,13 @@ export const GiantTrackTile = ({ badgeSize={18} popover /> - {playlists?.[0].playlistName ? ( + {isEditAlbumsEnabled && + album?.playlistName && + album.permalink ? ( <> from - - {playlists?.[0].playlistName} - + {album.playlistName} ) : null} From 62af2e08f0be44ac7d16b805e6949783c6bfcc35 Mon Sep 17 00:00:00 2001 From: amendelsohn Date: Tue, 26 Dec 2023 14:46:23 -0800 Subject: [PATCH 07/18] env redacted --- packages/trpc-server/.env | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/trpc-server/.env b/packages/trpc-server/.env index dbc30709af5..b26b91b38ce 100644 --- a/packages/trpc-server/.env +++ b/packages/trpc-server/.env @@ -1,2 +1,2 @@ -audius_elasticsearch_url=http://35.209.86.3:9200 -audius_db_url=postgres://postgres:postgres@35.209.86.3:5432/audius_discovery +# audius_elasticsearch_url=http://...:9200 +# audius_db_url=postgres://postgres:postgres@...:5432/audius_discovery From 5e71b81f7f89401dd0971ab8c2d3d84f06114bed Mon Sep 17 00:00:00 2001 From: amendelsohn Date: Tue, 26 Dec 2023 15:26:24 -0800 Subject: [PATCH 08/18] pr feedback --- packages/trpc-server/src/db.ts | 13 +----------- packages/trpc-server/src/index.ts | 6 ++++-- packages/trpc-server/src/loaders.ts | 4 +--- packages/trpc-server/src/types.ts | 12 +++++++++++ packages/trpc-server/test/search.test.ts | 2 +- .../src/components/track/GiantTrackTile.tsx | 20 ++++++++----------- 6 files changed, 27 insertions(+), 30 deletions(-) create mode 100644 packages/trpc-server/src/types.ts diff --git a/packages/trpc-server/src/db.ts b/packages/trpc-server/src/db.ts index b1d7666158a..3b111135d50 100644 --- a/packages/trpc-server/src/db.ts +++ b/packages/trpc-server/src/db.ts @@ -1,12 +1,5 @@ import postgres from 'postgres' -import { - AggregatePlaylistRow, - AggregateTrackRow, - AggregateUserRow, - PlaylistRow, - TrackRow, - UserRow, -} from './db-tables' +import { APlaylist, ATrack, AUser } from './types' const connectionString = process.env.audius_db_url || '' @@ -30,10 +23,6 @@ export const sql = postgres(connectionString, { }, }) -export type AUser = UserRow & AggregateUserRow -export type ATrack = TrackRow & AggregateTrackRow -export type APlaylist = PlaylistRow & AggregatePlaylistRow - // // USERS // diff --git a/packages/trpc-server/src/index.ts b/packages/trpc-server/src/index.ts index e21ad0e4f34..f17e5d14aaa 100644 --- a/packages/trpc-server/src/index.ts +++ b/packages/trpc-server/src/index.ts @@ -15,11 +15,13 @@ export const appRouter = router({ search: searchRouter, version: publicProcedure.query(() => ({ - version: '0.0.2' - })) + version: '0.0.2', + })), }) export type AppRouter = typeof appRouter export type RouterInput = inferRouterInputs export type RouterOutput = inferRouterOutputs + +export * from './types' diff --git a/packages/trpc-server/src/loaders.ts b/packages/trpc-server/src/loaders.ts index 50574137d91..a92a240f3a5 100644 --- a/packages/trpc-server/src/loaders.ts +++ b/packages/trpc-server/src/loaders.ts @@ -1,14 +1,12 @@ import DataLoader from 'dataloader' import { - APlaylist, - ATrack, - AUser, selectPlaylistsCamel, selectTracksCamel, selectUsersCamel, sql, } from './db' import { FollowRow, SubscriptionRow } from './db-tables' +import { APlaylist, ATrack, AUser } from './types' export const prepareLoaders = (myId: number | undefined) => ({ // bulk load user by id diff --git a/packages/trpc-server/src/types.ts b/packages/trpc-server/src/types.ts new file mode 100644 index 00000000000..b42461b5c97 --- /dev/null +++ b/packages/trpc-server/src/types.ts @@ -0,0 +1,12 @@ +import { + AggregatePlaylistRow, + AggregateTrackRow, + AggregateUserRow, + PlaylistRow, + TrackRow, + UserRow, +} from './db-tables' + +export type AUser = UserRow & AggregateUserRow +export type ATrack = TrackRow & AggregateTrackRow +export type APlaylist = PlaylistRow & AggregatePlaylistRow diff --git a/packages/trpc-server/test/search.test.ts b/packages/trpc-server/test/search.test.ts index f70f9223cb3..271a820529f 100644 --- a/packages/trpc-server/test/search.test.ts +++ b/packages/trpc-server/test/search.test.ts @@ -37,7 +37,7 @@ test('search tracks', async () => { } }) -test('you can get playlists that contain a track id', async () => { +test('you can query for playlists that contain a track id', async () => { const caller = await testRouter() const playlistIds = await caller.playlists.containTrackId({ trackId: 101 }) diff --git a/packages/web/src/components/track/GiantTrackTile.tsx b/packages/web/src/components/track/GiantTrackTile.tsx index 18006ec27d8..ad2392c7498 100644 --- a/packages/web/src/components/track/GiantTrackTile.tsx +++ b/packages/web/src/components/track/GiantTrackTile.tsx @@ -26,7 +26,7 @@ import { IconHeart, IconKebabHorizontal } from '@audius/stems' -import { APlaylist } from '@audius/trpc-server/src/db' +import type { APlaylist } from '@audius/trpc-server' import cn from 'classnames' import moment from 'moment' @@ -47,6 +47,7 @@ import { ComponentPlacement } from 'components/types' import { UserGeneratedText } from 'components/user-generated-text' import { getFeatureEnabled } from 'services/remote-config/featureFlagHelpers' import { moodMap } from 'utils/Moods' +import { NOT_FOUND_PAGE } from 'utils/route' import { trpc } from 'utils/trpcClientWeb' import { AiTrackSection } from './AiTrackSection' @@ -195,13 +196,8 @@ export const GiantTrackTile = ({ // Play button is conditionally hidden for USDC-gated tracks when the user does not have access const showPlay = isUSDCPurchaseGated ? doesUserHaveAccess : true const { data: playlists } = trpc.playlists.containTrackId.useQuery( - { - trackId, - collectionType: 'album' - }, - { - enabled: !!trackId - } + { trackId, collectionType: 'album' }, + { enabled: !!trackId } ) const album = playlists?.[0] as unknown as APlaylist | undefined let isScheduledRelease = false @@ -551,13 +547,13 @@ export const GiantTrackTile = ({ badgeSize={18} popover /> - {isEditAlbumsEnabled && - album?.playlistName && - album.permalink ? ( + {isEditAlbumsEnabled && album ? ( <> from - {album.playlistName} + + {album.playlistName} + ) : null} From 78a2854d9db7c2fa38561dd4d83f24f88abf95f2 Mon Sep 17 00:00:00 2001 From: amendelsohn Date: Tue, 2 Jan 2024 14:39:03 -0800 Subject: [PATCH 09/18] env --- packages/trpc-server/.env | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/trpc-server/.env b/packages/trpc-server/.env index b26b91b38ce..80b30fb10c5 100644 --- a/packages/trpc-server/.env +++ b/packages/trpc-server/.env @@ -1,2 +1,2 @@ -# audius_elasticsearch_url=http://...:9200 -# audius_db_url=postgres://postgres:postgres@...:5432/audius_discovery +audius_elasticsearch_url=http://35.209.86.3:9200 +audius_db_url=postgres://postgres:postgres@35.209.86.3:5432/audius_discovery \ No newline at end of file From edf24bc4af4c014c659d1457c2aee0b40af43edb Mon Sep 17 00:00:00 2001 From: amendelsohn Date: Wed, 3 Jan 2024 14:16:48 -0800 Subject: [PATCH 10/18] trpc call works! --- .../src/routers/playlist-router.ts | 34 --------------- .../trpc-server/src/routers/track-router.ts | 41 ++++++++++++++++++- packages/trpc-server/test/search.test.ts | 4 +- 3 files changed, 42 insertions(+), 37 deletions(-) diff --git a/packages/trpc-server/src/routers/playlist-router.ts b/packages/trpc-server/src/routers/playlist-router.ts index c877edcc068..fa39c269a03 100644 --- a/packages/trpc-server/src/routers/playlist-router.ts +++ b/packages/trpc-server/src/routers/playlist-router.ts @@ -1,8 +1,6 @@ import { z } from 'zod' import { publicProcedure, router } from '../trpc' import { TRPCError } from '@trpc/server' -import { esc } from './search-router' -import { PlaylistRow } from '../db-tables' export type PlaylistRouteData = { playlist_id: number @@ -19,36 +17,4 @@ export const playlistRouter = router({ } return row }), - - containTrackId: publicProcedure - .input( - z.object({ trackId: z.number(), collectionType: z.string().optional() }) - ) - .query(async ({ ctx, input }) => { - const found = await esc.search({ - index: 'playlists', - query: { - bool: { - must: [ - { term: { 'playlist_contents.track_ids.track': input.trackId } }, - { term: { is_delete: false } }, - { term: { is_private: false } }, - ...(input.collectionType === 'album' - ? [{ term: { is_album: true } }] - : []), - ...(input.collectionType === 'playlist' - ? [{ term: { is_album: false } }] - : []), - ], - must_not: [], - should: [], - }, - }, - _source: false, - }) - - return await ctx.loaders.playlistLoader.loadMany( - found.hits.hits.map((h) => parseInt(h._id)) - ) - }), }) diff --git a/packages/trpc-server/src/routers/track-router.ts b/packages/trpc-server/src/routers/track-router.ts index ce855fa3709..8a90fd77dd0 100644 --- a/packages/trpc-server/src/routers/track-router.ts +++ b/packages/trpc-server/src/routers/track-router.ts @@ -1,6 +1,14 @@ import { z } from 'zod' import { publicProcedure, router } from '../trpc' import { TRPCError } from '@trpc/server' +import { esc } from './search-router' + +type AlbumBacklinkMetadata = { + playlist_id: number + playlist_name: string + permalink: string + playlist_owner_id: number +} export const trackRouter = router({ get: publicProcedure.input(z.string()).query(async ({ ctx, input }) => { @@ -9,5 +17,36 @@ export const trackRouter = router({ throw new TRPCError({ code: 'NOT_FOUND' }) } return row - }) + }), + + getAlbumBacklink: publicProcedure + .input(z.object({ trackId: z.number() })) + .query(async ({ input }) => { + const found = await esc.search({ + index: 'playlists', + query: { + bool: { + must: [ + { term: { 'playlist_contents.track_ids.track': input.trackId } }, + { term: { is_delete: false } }, + { term: { is_private: false } }, + { term: { is_album: true } }, + ], + must_not: [], + should: [], + }, + }, + size: 1, + sort: [{ created_at: { order: 'desc' } }], + _source: [ + 'playlist_id', + 'playlist_name', + 'permalink', + 'playlist_owner_id', + ], + }) + + const hits = found.hits.hits.map((h) => h._source) + return hits.length > 0 ? hits[0] : null + }), }) diff --git a/packages/trpc-server/test/search.test.ts b/packages/trpc-server/test/search.test.ts index 271a820529f..80d10a8f265 100644 --- a/packages/trpc-server/test/search.test.ts +++ b/packages/trpc-server/test/search.test.ts @@ -40,6 +40,6 @@ test('search tracks', async () => { test('you can query for playlists that contain a track id', async () => { const caller = await testRouter() - const playlistIds = await caller.playlists.containTrackId({ trackId: 101 }) - expect(playlistIds).toEqual(['301']) + const playlistIds = await caller.tracks.getAlbumBacklink({ trackId: 101 }) + expect(playlistIds?.playlist_id).toEqual(['301']) }) From 1f2cca8b31ca703398a5b45c7836e9dd03a19571 Mon Sep 17 00:00:00 2001 From: amendelsohn Date: Wed, 3 Jan 2024 16:21:45 -0800 Subject: [PATCH 11/18] album link on track --- package.json | 1 + packages/web/package.json | 3 +- .../src/components/track/GiantTrackTile.tsx | 43 ++++++++++++------- .../src/components/track/InfoLabel.module.css | 4 ++ 4 files changed, 34 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index cfff3fc5741..6b0bf10ba66 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "web:dev": "npm run start:dev -w audius-client", "web:prod": "npm run start:prod -w audius-client", "web:stage": "npm run start:stage -w audius-client", + "web:prod-local-trpc": "npm run start:prod-local-trpc -w audius-client", "web:stage-local-trpc": "npm run start:stage-local-trpc -w audius-client", "DESKTOP====================================": "", "desktop:dev": "concurrently -k 'BROWSER=none npm run start:dev -w audius-client' 'wait-on http://0.0.0.0:3000 && npm run electron:localhost -w audius-client -- 3000'", diff --git a/packages/web/package.json b/packages/web/package.json index e63904f25a9..b832e69ff3d 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -10,8 +10,9 @@ "start": "vite", "start:dev": "npm run write-sha && npm run publish-scripts && env-cmd ./.env/.env.git env-cmd --no-override ./.env/.env.dev turbo run start", "start:stage": "npm run write-sha && npm run publish-scripts && env-cmd ./.env/.env.git env-cmd --no-override ./.env/.env.stage turbo run start", - "start:stage-local-trpc": "npm run write-sha && npm run publish-scripts && env-cmd ./.env/.env.git env-cmd --no-override ./.env/.env.stage-local-trpc turbo run start", "start:prod": "npm run write-sha && npm run publish-scripts && env-cmd ./.env/.env.git env-cmd --no-override ./.env/.env.prod env-cmd ./.env/.env.source-maps turbo run start", + "start:stage-local-trpc": "npm run write-sha && npm run publish-scripts && env-cmd ./.env/.env.git env-cmd --no-override ./.env/.env.stage-local-trpc turbo run start", + "start:prod-local-trpc": "npm run write-sha && npm run publish-scripts && env-cmd ./.env/.env.git env-cmd --no-override ./.env/.env.prod-local-trpc turbo run start", "preview:prod": "npm run build:prod && vite preview --outDir build-production", "prebuild": "npm run publish-scripts", "build": "vite build && cp package.json build/package.json", diff --git a/packages/web/src/components/track/GiantTrackTile.tsx b/packages/web/src/components/track/GiantTrackTile.tsx index ad2392c7498..bf007a18f92 100644 --- a/packages/web/src/components/track/GiantTrackTile.tsx +++ b/packages/web/src/components/track/GiantTrackTile.tsx @@ -15,7 +15,7 @@ import { getDogEarType, isPremiumContentUSDCPurchaseGated } from '@audius/common' -import { Flex, TextLink } from '@audius/harmony' +import { Flex } from '@audius/harmony' import { Mood } from '@audius/sdk' import { Button, @@ -26,7 +26,6 @@ import { IconHeart, IconKebabHorizontal } from '@audius/stems' -import type { APlaylist } from '@audius/trpc-server' import cn from 'classnames' import moment from 'moment' @@ -47,7 +46,6 @@ import { ComponentPlacement } from 'components/types' import { UserGeneratedText } from 'components/user-generated-text' import { getFeatureEnabled } from 'services/remote-config/featureFlagHelpers' import { moodMap } from 'utils/Moods' -import { NOT_FOUND_PAGE } from 'utils/route' import { trpc } from 'utils/trpcClientWeb' import { AiTrackSection } from './AiTrackSection' @@ -195,11 +193,10 @@ export const GiantTrackTile = ({ const showPreview = isUSDCPurchaseGated && (isOwner || !doesUserHaveAccess) // Play button is conditionally hidden for USDC-gated tracks when the user does not have access const showPlay = isUSDCPurchaseGated ? doesUserHaveAccess : true - const { data: playlists } = trpc.playlists.containTrackId.useQuery( - { trackId, collectionType: 'album' }, + const { data: albumInfo } = trpc.tracks.getAlbumBacklink.useQuery( + { trackId }, { enabled: !!trackId } ) - const album = playlists?.[0] as unknown as APlaylist | undefined let isScheduledRelease = false if (!isPublishing && moment.utc(released).isAfter(moment())) { isScheduledRelease = true @@ -415,6 +412,29 @@ export const GiantTrackTile = ({ ) } + const renderAlbum = () => { + if (!isEditAlbumsEnabled || !albumInfo) return null + return ( + ({ + // the link is too tall + marginTop: spacing.negativeUnit + })} + > + {albumInfo.playlist_name} + + } + /> + ) + } + const renderReleased = () => { return ( !isUnlisted && @@ -547,16 +567,6 @@ export const GiantTrackTile = ({ badgeSize={18} popover /> - {isEditAlbumsEnabled && album ? ( - <> - from - - - {album.playlistName} - - - - ) : null} {isLoading && ( @@ -662,6 +672,7 @@ export const GiantTrackTile = ({ labelValue={`${formatSeconds(duration)}`} /> {renderReleased()} + {renderAlbum()} {renderGenre()} {renderMood()} {credits ? ( diff --git a/packages/web/src/components/track/InfoLabel.module.css b/packages/web/src/components/track/InfoLabel.module.css index 18cbb5506f7..480912e4971 100644 --- a/packages/web/src/components/track/InfoLabel.module.css +++ b/packages/web/src/components/track/InfoLabel.module.css @@ -22,6 +22,10 @@ text-transform: capitalize; word-break: keep-all; text-decoration: none; + + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } .labelValue > * { From b55fb2ff0e815a60c9f908eac55c476a66520380 Mon Sep 17 00:00:00 2001 From: amendelsohn Date: Wed, 3 Jan 2024 16:42:32 -0800 Subject: [PATCH 12/18] cleanup --- packages/trpc-server/src/routers/track-router.ts | 8 +------- packages/web/src/components/track/InfoLabel.module.css | 4 ---- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/packages/trpc-server/src/routers/track-router.ts b/packages/trpc-server/src/routers/track-router.ts index 8a90fd77dd0..c45d5fa3fa3 100644 --- a/packages/trpc-server/src/routers/track-router.ts +++ b/packages/trpc-server/src/routers/track-router.ts @@ -7,7 +7,6 @@ type AlbumBacklinkMetadata = { playlist_id: number playlist_name: string permalink: string - playlist_owner_id: number } export const trackRouter = router({ @@ -38,12 +37,7 @@ export const trackRouter = router({ }, size: 1, sort: [{ created_at: { order: 'desc' } }], - _source: [ - 'playlist_id', - 'playlist_name', - 'permalink', - 'playlist_owner_id', - ], + _source: ['playlist_id', 'playlist_name', 'permalink'], }) const hits = found.hits.hits.map((h) => h._source) diff --git a/packages/web/src/components/track/InfoLabel.module.css b/packages/web/src/components/track/InfoLabel.module.css index 480912e4971..18cbb5506f7 100644 --- a/packages/web/src/components/track/InfoLabel.module.css +++ b/packages/web/src/components/track/InfoLabel.module.css @@ -22,10 +22,6 @@ text-transform: capitalize; word-break: keep-all; text-decoration: none; - - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; } .labelValue > * { From 1ab86913a4ec2cb1e7151f810307d64881034cdf Mon Sep 17 00:00:00 2001 From: amendelsohn Date: Fri, 5 Jan 2024 12:40:36 -0800 Subject: [PATCH 13/18] remove local trpc web build commands --- package.json | 2 -- packages/trpc-server/src/routers/track-router.ts | 5 ++++- packages/web/package.json | 3 --- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 73b21f77e1d..f452ddb61d3 100644 --- a/package.json +++ b/package.json @@ -27,8 +27,6 @@ "web:dev": "npm run start:dev -w audius-client", "web:prod": "npm run start:prod -w audius-client", "web:stage": "npm run start:stage -w audius-client", - "web:prod-local-trpc": "npm run start:prod-local-trpc -w audius-client", - "web:stage-local-trpc": "npm run start:stage-local-trpc -w audius-client", "DESKTOP====================================": "", "desktop:dev": "concurrently -k 'BROWSER=none npm run start:dev -w audius-client' 'wait-on http://0.0.0.0:3000 && npm run electron:localhost -w audius-client -- 3000'", "desktop:prod": "concurrently -k 'BROWSER=none npm run start:prod -w audius-client' 'wait-on http://0.0.0.0:3002 && npm run electron:localhost -w audius-client -- 3002'", diff --git a/packages/trpc-server/src/routers/track-router.ts b/packages/trpc-server/src/routers/track-router.ts index c45d5fa3fa3..889f00b7e00 100644 --- a/packages/trpc-server/src/routers/track-router.ts +++ b/packages/trpc-server/src/routers/track-router.ts @@ -41,6 +41,9 @@ export const trackRouter = router({ }) const hits = found.hits.hits.map((h) => h._source) - return hits.length > 0 ? hits[0] : null + if (hits.length === 0) { + throw new TRPCError({ code: 'NOT_FOUND' }) + } + return hits[0] }), }) diff --git a/packages/web/package.json b/packages/web/package.json index 31e9f1185c8..7a44f2a0422 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -10,10 +10,7 @@ "start": "vite", "start:dev": "npm run write-sha && npm run publish-scripts && env-cmd ./.env/.env.git env-cmd --no-override ./.env/.env.dev turbo run start", "start:stage": "npm run write-sha && npm run publish-scripts && env-cmd ./.env/.env.git env-cmd --no-override ./.env/.env.stage turbo run start", - "start:stage-local-trpc": "npm run write-sha && npm run publish-scripts && env-cmd ./.env/.env.git env-cmd --no-override ./.env/.env.stage-local-trpc turbo run start", "start:prod": "npm run write-sha && npm run publish-scripts && env-cmd ./.env/.env.git env-cmd --no-override ./.env/.env.prod env-cmd ./.env/.env.source-maps turbo run start", - "start:stage-local-trpc": "npm run write-sha && npm run publish-scripts && env-cmd ./.env/.env.git env-cmd --no-override ./.env/.env.stage-local-trpc turbo run start", - "start:prod-local-trpc": "npm run write-sha && npm run publish-scripts && env-cmd ./.env/.env.git env-cmd --no-override ./.env/.env.prod-local-trpc turbo run start", "preview:prod": "npm run build:prod && vite preview --outDir build-production", "prebuild": "npm run publish-scripts", "build": "vite build && cp package.json build/package.json", From c8fc5b86e07f86aac598cd9044cfb7617988c4d6 Mon Sep 17 00:00:00 2001 From: amendelsohn Date: Fri, 5 Jan 2024 14:06:47 -0800 Subject: [PATCH 14/18] as const --- packages/trpc-server/src/routers/track-router.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/trpc-server/src/routers/track-router.ts b/packages/trpc-server/src/routers/track-router.ts index 889f00b7e00..4233bfdd023 100644 --- a/packages/trpc-server/src/routers/track-router.ts +++ b/packages/trpc-server/src/routers/track-router.ts @@ -36,7 +36,7 @@ export const trackRouter = router({ }, }, size: 1, - sort: [{ created_at: { order: 'desc' } }], + sort: [{ created_at: { order: 'desc' as const } }], _source: ['playlist_id', 'playlist_name', 'permalink'], }) From 627eaf6674aa363975e8b129c254f97598c7d1a1 Mon Sep 17 00:00:00 2001 From: amendelsohn Date: Fri, 5 Jan 2024 14:30:20 -0800 Subject: [PATCH 15/18] add trpc ts import paths --- package-lock.json | 4 ++-- packages/web/tsconfig.json | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 56770f2b40b..fd6f4359db9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -107789,7 +107789,7 @@ "dependencies": { "@audius/sdk": "*", "@types/multer": "1.4.11", - "cors": "^2.8.5", + "cors": "2.8.5", "dotenv": "16.3.1", "express": "4.18.2", "linkedom": "0.15.6", @@ -141055,7 +141055,7 @@ "@types/swagger-ui-express": "^4.1.4", "eslint": "^8.40.0", "tsx": "^3.12.7", - "typescript": "^5.1.3", + "typescript": "5.0.4", "vite-node": "^0.34.6", "vitest": "^0.34.6" } diff --git a/packages/web/tsconfig.json b/packages/web/tsconfig.json index ac0ae8f4c59..2cecddb9f4b 100644 --- a/packages/web/tsconfig.json +++ b/packages/web/tsconfig.json @@ -19,7 +19,10 @@ "jsxImportSource": "@emotion/react", "downlevelIteration": true, "noFallthroughCasesInSwitch": true, - "types": ["vite/client"] + "types": ["vite/client"], + "paths": { + "@audius/trpc-server": ["../trpc-server/src/index.ts"], + } }, "include": ["src"] } From 8267b2465ff4f9e589ea79813885facf43151b3d Mon Sep 17 00:00:00 2001 From: Dylan Jeffers Date: Fri, 5 Jan 2024 15:10:40 -0800 Subject: [PATCH 16/18] Update typescript version --- packages/trpc-server/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/trpc-server/package.json b/packages/trpc-server/package.json index 53c183b993d..d1a6aea401f 100644 --- a/packages/trpc-server/package.json +++ b/packages/trpc-server/package.json @@ -30,7 +30,7 @@ "@types/swagger-ui-express": "^4.1.4", "eslint": "^8.40.0", "tsx": "^3.12.7", - "typescript": "^5.1.3", + "typescript": "5.0.4", "vite-node": "^0.34.6", "vitest": "^0.34.6" } From 08b874c478487b908a20351c2de77c3d5bde6a32 Mon Sep 17 00:00:00 2001 From: Dylan Jeffers Date: Fri, 5 Jan 2024 15:21:07 -0800 Subject: [PATCH 17/18] Pin and upgrade versions --- package-lock.json | 209 ++++++++++++++++++++---------- packages/trpc-server/package.json | 26 ++-- 2 files changed, 153 insertions(+), 82 deletions(-) diff --git a/package-lock.json b/package-lock.json index fd6f4359db9..dd98b103bf2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3695,6 +3695,36 @@ "version": "0.3.1", "license": "MIT" }, + "node_modules/@esbuild-kit/cjs-loader": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/@esbuild-kit/cjs-loader/-/cjs-loader-2.4.4.tgz", + "integrity": "sha512-NfsJX4PdzhwSkfJukczyUiZGc7zNNWZcEAyqeISpDnn0PTfzMJR1aR8xAIPskBejIxBJbIgCCMzbaYa9SXepIg==", + "dev": true, + "dependencies": { + "@esbuild-kit/core-utils": "^3.2.3", + "get-tsconfig": "^4.7.0" + } + }, + "node_modules/@esbuild-kit/core-utils": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/@esbuild-kit/core-utils/-/core-utils-3.3.2.tgz", + "integrity": "sha512-sPRAnw9CdSsRmEtnsl2WXWdyquogVpB3yZ3dgwJfe8zrOzTsV7cJvmwrKVa+0ma5BoiGJ+BoqkMvawbayKUsqQ==", + "dev": true, + "dependencies": { + "esbuild": "~0.18.20", + "source-map-support": "^0.5.21" + } + }, + "node_modules/@esbuild-kit/esm-loader": { + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/@esbuild-kit/esm-loader/-/esm-loader-2.6.5.tgz", + "integrity": "sha512-FxEMIkJKnodyA1OaCUoEvbYRkoZlLZ4d/eXFu9Fh8CbBBgP5EmZxrfTRyN0qpXZ4vOvqnE5YdRdcrmUUXuU+dA==", + "dev": true, + "dependencies": { + "@esbuild-kit/core-utils": "^3.3.2", + "get-tsconfig": "^4.7.0" + } + }, "node_modules/@esbuild-plugins/node-globals-polyfill": { "version": "0.2.3", "dev": true, @@ -32783,13 +32813,6 @@ "react-dom": ">=16.8.0" } }, - "node_modules/@trpc/server": { - "version": "10.38.4", - "funding": [ - "https://trpc.io/sponsor" - ], - "license": "MIT" - }, "node_modules/@truffle/blockchain-utils": { "version": "0.0.18", "dev": true, @@ -35623,15 +35646,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/swagger-ui-express": { - "version": "4.1.5", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/express": "*", - "@types/serve-static": "*" - } - }, "node_modules/@types/tapable": { "version": "1.0.2", "dev": true, @@ -78103,14 +78117,6 @@ "node": ">=0.10.0" } }, - "node_modules/postgres": { - "version": "3.3.5", - "license": "Unlicense", - "funding": { - "type": "individual", - "url": "https://github.com/sponsors/porsager" - } - }, "node_modules/postgres-array": { "version": "2.0.0", "license": "MIT", @@ -99988,34 +99994,6 @@ "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" } }, - "node_modules/tsx": { - "version": "3.14.0", - "dev": true, - "license": "MIT", - "dependencies": { - "esbuild": "~0.18.20", - "get-tsconfig": "^4.7.2", - "source-map-support": "^0.5.21" - }, - "bin": { - "tsx": "dist/cli.mjs" - }, - "optionalDependencies": { - "fsevents": "~2.3.3" - } - }, - "node_modules/tsx/node_modules/fsevents": { - "version": "2.3.3", - "dev": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, "node_modules/tty-browserify": { "version": "0.0.0", "license": "MIT" @@ -141036,39 +141014,56 @@ "name": "@audius/trpc-server", "version": "0.0.14", "dependencies": { - "@elastic/elasticsearch": "^8.10.0", - "@trpc/server": "10.38.4", + "@elastic/elasticsearch": "8.11.0", + "@trpc/server": "10.45.0", "cors": "2.8.5", "dataloader": "2.2.2", - "debug": "^4.3.4", - "dotenv": "^16.3.1", + "debug": "4.3.4", + "dotenv": "16.3.1", "express": "4.18.2", - "postgres": "3.3.5", + "postgres": "3.4.3", "swagger-ui-express": "5.0.0", "trpc-openapi": "1.2.0", "zod": "3.22.2" }, "devDependencies": { - "@rmp135/sql-ts": "^1.18.0", - "@types/cors": "^2.8.13", - "@types/node": "^18.16.16", - "@types/swagger-ui-express": "^4.1.4", - "eslint": "^8.40.0", - "tsx": "^3.12.7", + "@rmp135/sql-ts": "1.18.0", + "@types/cors": "2.8.13", + "@types/node": "18.16.16", + "@types/swagger-ui-express": "4.1.4", + "eslint": "8.56.0", + "tsx": "3.12.7", "typescript": "5.0.4", - "vite-node": "^0.34.6", - "vitest": "^0.34.6" + "vite-node": "0.34.6", + "vitest": "0.34.6" } }, "packages/trpc-server/node_modules/@elastic/elasticsearch": { - "version": "8.10.0", - "license": "Apache-2.0", + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/@elastic/elasticsearch/-/elasticsearch-8.11.0.tgz", + "integrity": "sha512-1UEQFdGLuKdROLJnMTjegasRM3X9INm/PVADoIVgdTfuv6DeJ17UMuNwYSkCrLrC0trLjjGV4YganpbJJX/VLg==", "dependencies": { - "@elastic/transport": "^8.3.4", + "@elastic/transport": "^8.4.0", "tslib": "^2.4.0" }, "engines": { - "node": ">=14" + "node": ">=18" + } + }, + "packages/trpc-server/node_modules/@elastic/transport": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/@elastic/transport/-/transport-8.4.0.tgz", + "integrity": "sha512-Yb3fDa7yGD0ca3uMbL64M3vM1cE5h5uHmBcTjkdB4VpCasRNKSd09iDpwqX8zX1tbBtxcaKYLceKthWvPeIxTw==", + "dependencies": { + "debug": "^4.3.4", + "hpagent": "^1.0.0", + "ms": "^2.1.3", + "secure-json-parse": "^2.4.0", + "tslib": "^2.4.0", + "undici": "^5.22.1" + }, + "engines": { + "node": ">=16" } }, "packages/trpc-server/node_modules/@eslint/eslintrc": { @@ -141093,6 +141088,39 @@ "url": "https://opencollective.com/eslint" } }, + "packages/trpc-server/node_modules/@trpc/server": { + "version": "10.45.0", + "resolved": "https://registry.npmjs.org/@trpc/server/-/server-10.45.0.tgz", + "integrity": "sha512-2Fwzv6nqpE0Ie/G7PeS0EVR89zLm+c1Mw7T+RAGtU807j4oaUx0zGkBXTu5u9AI+j+BYNN2GZxJcuDTAecbr1A==", + "funding": [ + "https://trpc.io/sponsor" + ] + }, + "packages/trpc-server/node_modules/@types/cors": { + "version": "2.8.13", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.13.tgz", + "integrity": "sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "packages/trpc-server/node_modules/@types/node": { + "version": "18.16.16", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.16.16.tgz", + "integrity": "sha512-NpaM49IGQQAUlBhHMF82QH80J08os4ZmyF9MkpCzWAGuOHqE4gTEbhzd7L3l5LmWuZ6E0OiC1FweQ4tsiW35+g==", + "dev": true + }, + "packages/trpc-server/node_modules/@types/swagger-ui-express": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/@types/swagger-ui-express/-/swagger-ui-express-4.1.4.tgz", + "integrity": "sha512-h6dfIPFveCJKpStDtjrB+4pig4DAf9Uu2Z51RB7Fj3s6AifexmqhZxBoG50K/k3Afz7wyXsIAY5ZIDTlC2VjrQ==", + "dev": true, + "dependencies": { + "@types/express": "*", + "@types/serve-static": "*" + } + }, "packages/trpc-server/node_modules/ajv": { "version": "6.12.6", "dev": true, @@ -141411,6 +141439,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "packages/trpc-server/node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "packages/trpc-server/node_modules/glob-parent": { "version": "6.0.2", "dev": true, @@ -141535,6 +141577,18 @@ "version": "0.1.7", "license": "MIT" }, + "packages/trpc-server/node_modules/postgres": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/postgres/-/postgres-3.4.3.tgz", + "integrity": "sha512-iHJn4+M9vbTdHSdDzNkC0crHq+1CUdFhx+YqCE+SqWxPjm+Zu63jq7yZborOBF64c8pc58O5uMudyL1FQcHacA==", + "engines": { + "node": ">=12" + }, + "funding": { + "type": "individual", + "url": "https://github.com/sponsors/porsager" + } + }, "packages/trpc-server/node_modules/qs": { "version": "6.11.0", "license": "BSD-3-Clause", @@ -141652,6 +141706,23 @@ "version": "2.6.2", "license": "0BSD" }, + "packages/trpc-server/node_modules/tsx": { + "version": "3.12.7", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-3.12.7.tgz", + "integrity": "sha512-C2Ip+jPmqKd1GWVQDvz/Eyc6QJbGfE7NrR3fx5BpEHMZsEHoIxHL1j+lKdGobr8ovEyqeNkPLSKp6SCSOt7gmw==", + "dev": true, + "dependencies": { + "@esbuild-kit/cjs-loader": "^2.4.2", + "@esbuild-kit/core-utils": "^3.0.0", + "@esbuild-kit/esm-loader": "^2.5.5" + }, + "bin": { + "tsx": "dist/cli.js" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, "packages/trpc-server/node_modules/type-fest": { "version": "0.20.2", "dev": true, diff --git a/packages/trpc-server/package.json b/packages/trpc-server/package.json index d1a6aea401f..4e47d8feb30 100644 --- a/packages/trpc-server/package.json +++ b/packages/trpc-server/package.json @@ -11,27 +11,27 @@ "test": "vitest" }, "dependencies": { - "@elastic/elasticsearch": "^8.10.0", - "@trpc/server": "10.38.4", + "@elastic/elasticsearch": "8.11.0", + "@trpc/server": "10.45.0", "cors": "2.8.5", "dataloader": "2.2.2", - "debug": "^4.3.4", - "dotenv": "^16.3.1", + "debug": "4.3.4", + "dotenv": "16.3.1", "express": "4.18.2", - "postgres": "3.3.5", + "postgres": "3.4.3", "swagger-ui-express": "5.0.0", "trpc-openapi": "1.2.0", "zod": "3.22.2" }, "devDependencies": { - "@rmp135/sql-ts": "^1.18.0", - "@types/cors": "^2.8.13", - "@types/node": "^18.16.16", - "@types/swagger-ui-express": "^4.1.4", - "eslint": "^8.40.0", - "tsx": "^3.12.7", + "@rmp135/sql-ts": "1.18.0", + "@types/cors": "2.8.13", + "@types/node": "18.16.16", + "@types/swagger-ui-express": "4.1.4", + "eslint": "8.56.0", + "tsx": "3.12.7", "typescript": "5.0.4", - "vite-node": "^0.34.6", - "vitest": "^0.34.6" + "vite-node": "0.34.6", + "vitest": "0.34.6" } } From fe3b57e3e00278e7b312845b6bf8e08119fd1004 Mon Sep 17 00:00:00 2001 From: Dylan Jeffers Date: Fri, 5 Jan 2024 15:30:20 -0800 Subject: [PATCH 18/18] Fix again? --- package-lock.json | 18 +++++++++--------- packages/trpc-server/package.json | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index dd98b103bf2..6d4e3824f83 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32813,6 +32813,14 @@ "react-dom": ">=16.8.0" } }, + "node_modules/@trpc/server": { + "version": "10.38.4", + "resolved": "https://registry.npmjs.org/@trpc/server/-/server-10.38.4.tgz", + "integrity": "sha512-xSMTwnKA/Unxu5fbAkQ7cApHeWj1rTEA3XgrGDcPHn03fmeIidIKxronM46N46ZF4CCexey4JWzu89XxA16uIA==", + "funding": [ + "https://trpc.io/sponsor" + ] + }, "node_modules/@truffle/blockchain-utils": { "version": "0.0.18", "dev": true, @@ -141015,7 +141023,7 @@ "version": "0.0.14", "dependencies": { "@elastic/elasticsearch": "8.11.0", - "@trpc/server": "10.45.0", + "@trpc/server": "10.38.4", "cors": "2.8.5", "dataloader": "2.2.2", "debug": "4.3.4", @@ -141088,14 +141096,6 @@ "url": "https://opencollective.com/eslint" } }, - "packages/trpc-server/node_modules/@trpc/server": { - "version": "10.45.0", - "resolved": "https://registry.npmjs.org/@trpc/server/-/server-10.45.0.tgz", - "integrity": "sha512-2Fwzv6nqpE0Ie/G7PeS0EVR89zLm+c1Mw7T+RAGtU807j4oaUx0zGkBXTu5u9AI+j+BYNN2GZxJcuDTAecbr1A==", - "funding": [ - "https://trpc.io/sponsor" - ] - }, "packages/trpc-server/node_modules/@types/cors": { "version": "2.8.13", "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.13.tgz", diff --git a/packages/trpc-server/package.json b/packages/trpc-server/package.json index 4e47d8feb30..8f59dd7fb95 100644 --- a/packages/trpc-server/package.json +++ b/packages/trpc-server/package.json @@ -12,7 +12,7 @@ }, "dependencies": { "@elastic/elasticsearch": "8.11.0", - "@trpc/server": "10.45.0", + "@trpc/server": "10.38.4", "cors": "2.8.5", "dataloader": "2.2.2", "debug": "4.3.4",