Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discover: Add Hiding Feature, fix issues with theming and SQL queries. #4090

Open
wants to merge 161 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
161 commits
Select commit Hold shift + click to select a range
84ead5b
Fix Discover not working due to Database changes, fix styling
Podginator Jun 16, 2024
9b9aa02
Add ability to Hide items that you aren't interested in.
Podginator Jun 19, 2024
f4b13d1
Add ability to Hide items that you aren't interested in.
Podginator Jun 19, 2024
2515e6e
Fix Discover Stylings
Podginator Jun 20, 2024
85a9023
Merge main
Podginator Jun 20, 2024
7f4e0ee
Remove unused lib
Podginator Jun 20, 2024
0c8a9c1
Fix Lint
Podginator Jun 20, 2024
8f89cbe
Ensure that Discover picks up new feeds
Podginator Jun 20, 2024
8e558e2
Fix Bug where item wouldn't disappear
Podginator Jun 20, 2024
361199e
Fix Persistence issues
Podginator Jun 20, 2024
2aefeb1
Fix issue with linting
Podginator Jun 20, 2024
c30040a
Fix Ingestion of new Discover Feed issue
Podginator Jun 20, 2024
1921a08
Merge remote-tracking branch 'origin/main' into discover-fixes
Podginator Jun 26, 2024
c8b97c0
Merge branch 'omnivore-app:main' into discover-fixes
Podginator Jul 4, 2024
4644d6a
fix: Library Header layout shift
kyo-young Sep 29, 2024
2ad8b12
Bump Github Actions versions.
williamtheaker Oct 25, 2024
60303ff
Self-Hosting Changes
Podginator Oct 30, 2024
bb7b3c9
Fix Minio Environment Variable
Podginator Oct 30, 2024
593bac0
Just make pdfs successful, due to lack of PDFHandler
Podginator Oct 30, 2024
d4710a8
Fix issue where flag was set wrong
Podginator Oct 30, 2024
26c5ef3
Added an NGINX Example file
Podginator Oct 31, 2024
4607032
Add some documentation for self-hosting via Docker Compose
Podginator Oct 31, 2024
ae66e2e
Make some adjustments to Puppeteer due to failing sites.
Podginator Oct 31, 2024
b350fbd
adjust timings
Podginator Oct 31, 2024
322ec68
Add start of Mail Service
Podginator Nov 1, 2024
6f1ee6b
Fix Docker Files
Podginator Nov 1, 2024
222ba06
More email service stuff
Podginator Nov 2, 2024
55d9fa3
Fix merge
Podginator Nov 2, 2024
f510566
Merge branch 'self-host-updates' of github.com:podginator/omnivore in…
Podginator Nov 2, 2024
34e039e
Add Guide to use Zapier for Email-Importing.
Podginator Nov 2, 2024
8b845b5
Ensure that if no env is provided it uses the old email settings
Podginator Nov 2, 2024
e557fd0
Add some instructions for self-hosted email
Podginator Nov 3, 2024
b8226db
Add SNS Endpoints for Mail Watcher
Podginator Nov 3, 2024
f50e718
:q
Podginator Nov 3, 2024
af70b25
Add steps and functionality for using SES and SNS for email
Podginator Nov 3, 2024
2e3134c
Uncomment a few jobs.
Podginator Nov 3, 2024
e9ca6cb
Merge branch 'self-host-updates' of github.com:podginator/omnivore in…
Podginator Nov 3, 2024
ab51fc9
Added option for Firefox for parser. Was having issues with Chromium …
Podginator Nov 4, 2024
0e6c675
Add missing space.
Podginator Nov 5, 2024
6b7f170
Fix some wording on the Guide
Podginator Nov 6, 2024
104f481
update browser extension to handle self-hosted instances
Dadams2 Nov 8, 2024
276c560
add slight documentation to options page
Dadams2 Nov 8, 2024
9d41cc5
Fix Package
Podginator Nov 11, 2024
86465bc
Self-Hosting
Podginator Nov 12, 2024
1fa9b40
Not good, just working.
Podginator Nov 12, 2024
0387a92
Fix sizing issues
Podginator Nov 13, 2024
f71cf63
Fix sizing issues
Podginator Nov 13, 2024
1d3c519
Fix sizing issues
Podginator Nov 13, 2024
76bc50a
Re-enable scrolling
Podginator Nov 13, 2024
2a6ac23
Debug
Podginator Nov 13, 2024
5b50756
Try to fix scroll bug
Podginator Nov 13, 2024
3f64ebf
Fix starting topic
Podginator Nov 13, 2024
a66f92b
Fix MV
Podginator Nov 13, 2024
5246f62
Fix Resync
Podginator Nov 14, 2024
b187392
Testing
Podginator Nov 14, 2024
7812f94
This is not a good way to debug...
Podginator Nov 14, 2024
2d3971b
Refresh value in Promise
Podginator Nov 14, 2024
2b5572b
Fix RSS
Podginator Nov 14, 2024
64b6da3
Re-add Wired Handler
Podginator Nov 16, 2024
83981dc
Wired Adder
Podginator Nov 16, 2024
8a8c313
Fix Mobile view for Discover
Podginator Nov 17, 2024
5f1d0e6
Fix overflow
Podginator Nov 17, 2024
2262de6
Fix BG
Podginator Nov 17, 2024
698582c
Fix RSS Hiding
Podginator Nov 22, 2024
c27af01
Do raw handlers for Medium
Podginator Nov 22, 2024
eb2026e
Do raw handlers for Medium
Podginator Nov 22, 2024
7bebb45
Fix images in Medium
Podginator Nov 22, 2024
4f417a4
Fix Images
Podginator Nov 22, 2024
7bdf222
Update self-hosting/GUIDE.md
Podginator Nov 25, 2024
d42656b
Update Guide with other variables
Podginator Nov 27, 2024
685f542
Merge
Podginator Nov 27, 2024
be7102b
Add The Verge to JS-less handlers
Podginator Nov 28, 2024
55ba7b0
Update regex and image-proxy
Podginator Nov 28, 2024
e729225
Update self-hosting/nginx/nginx.conf
Podginator Nov 28, 2024
7fd4095
Update regex and image-proxy
Podginator Nov 28, 2024
a0f6f14
Update regex and image-proxy
Podginator Nov 28, 2024
99ed2bb
Update self-hosting/docker-compose/docker-compose.yml
Podginator Nov 28, 2024
7cbc1aa
Wrap ID
Podginator Nov 28, 2024
b82734d
Wrap ID
Podginator Nov 28, 2024
cfc8cef
Wrap ID
Podginator Nov 28, 2024
0bf58b7
Wrap ID
Podginator Nov 28, 2024
7cad796
Dumb typo
Podginator Nov 28, 2024
e423885
Fix Minio for Export
Podginator Nov 29, 2024
ad6a997
Revert yarn lock removal
Podginator Nov 29, 2024
da6ab7a
Merge to main
Podginator Nov 29, 2024
f16085f
Update GUIDE with newer NGINX
Podginator Dec 2, 2024
efe7e61
Update nginx config to include api/save route
Podginator Dec 3, 2024
ea69eb6
Enable Native PDF View for PDFS
Podginator Dec 8, 2024
eab1c2a
Enable Native PDF View for PDFS
Podginator Dec 8, 2024
b3fc97f
feat:lover packages test
m1xxos Dec 9, 2024
bc1aef7
feat:working build
m1xxos Dec 9, 2024
df80ae4
feat:alpine build
m1xxos Dec 9, 2024
ee32e16
docs:api dockerfile docs
m1xxos Dec 11, 2024
93d05c1
Write a PDF.js wrapper to replace pspdfkit
Podginator Dec 12, 2024
20a918f
Merge branch 'self-host-updates' into discover-fixes
Podginator Dec 13, 2024
52a0a55
Merge self-host
Podginator Dec 13, 2024
bc41ca2
Merge pull request #7 from m1xxos/self-host-updates
Podginator Dec 13, 2024
d9d0f01
Revert changes for replication, set settings to have default mode
Podginator Dec 13, 2024
0a00a45
Merge
Podginator Dec 13, 2024
af08111
Merge remote-tracking branch 'origin/self-host-updates' into discover…
Podginator Dec 13, 2024
a6074a9
build folder got removed due to gitignore on pdf
Podginator Dec 13, 2024
c62300b
Merge remote-tracking branch 'origin/self-host-updates' into discover…
Podginator Dec 13, 2024
bb7c7c8
Add Box shadow to pdf pages
Podginator Dec 13, 2024
5d3de71
Merge remote-tracking branch 'origin/self-host-updates' into discover…
Podginator Dec 13, 2024
c7fa382
Add Toggle for Progress in PDFS, enabled native viewer toggle
Podginator Dec 13, 2024
1c14cb8
Merge remote-tracking branch 'origin/self-host-updates' into discover…
Podginator Dec 13, 2024
e5f0c07
Update node version to LTS
Podginator Dec 14, 2024
9b9bf96
Update node version to LTS
Podginator Dec 14, 2024
9b926fe
Fix Linting issues
Podginator Dec 14, 2024
893d65d
Fix Linting issues
Podginator Dec 14, 2024
fe851a2
Make env variable nullable
Podginator Dec 14, 2024
39d6a61
Add touchend listener for mobile
Podginator Dec 14, 2024
3215435
Make changes to PDF for mobile
Podginator Dec 14, 2024
87064de
Merge self host
Podginator Dec 14, 2024
7b968c4
fix(android): change serverUrl to selfhosted first
weeebdev Dec 14, 2024
8a2906c
Merge branch 'self-host-updates' of github.com:Akasha-Chronicles/omni…
weeebdev Dec 14, 2024
735e396
Merge pull request #8 from Akasha-Chronicles/self-host-updates
Podginator Dec 14, 2024
d81f1bf
feat:2 stage alpine content fetch
m1xxos Dec 18, 2024
5785015
feat:separated start script
m1xxos Dec 18, 2024
7687bb0
fix:changed to node 22
m1xxos Dec 18, 2024
17ed3e3
Merge pull request #9 from m1xxos/self-host-updates
Podginator Dec 20, 2024
c9866da
Add back youtube functionality and add guide
Podginator Jan 1, 2025
2ea293d
Merge branch 'self-host-updates' of https://github.com/Podginator/omn…
Podginator Jan 4, 2025
b9e8aae
trigger build
Podginator Jan 5, 2025
63b8e48
Fix cache issue on YouTube
Podginator Jan 5, 2025
f9f2267
Allow empty AWS_S3_ENDPOINT
Podginator Jan 17, 2025
72a6419
Allow empty AWS_S3_ENDPOINT
Podginator Jan 17, 2025
c846fc3
Merge Self-host
Podginator Jan 17, 2025
2c17be6
Add GCHR for all images
Podginator Jan 17, 2025
72457ff
Add GCHR For self hosting.
Podginator Jan 17, 2025
e3e24a4
Add GCHR For self hosting.
Podginator Jan 17, 2025
0ac1cc6
Test prebuilt.
Podginator Jan 17, 2025
1a61453
Test prebuilt
Podginator Jan 17, 2025
4ae68a7
Test prebuilt...
Podginator Jan 17, 2025
384ca79
Merge pull request #4512 from Podginator/self-host-updates
Podginator Jan 17, 2025
2fc06e5
Fix web image
Podginator Jan 17, 2025
e4da481
Remove Web Image (For now)
Podginator Jan 17, 2025
43a80f8
Move docker-compose to images
Podginator Jan 17, 2025
42eab18
Move docker-compose to images
Podginator Jan 17, 2025
4f5fdd9
Move docker-compose files to correct locations
Podginator Jan 17, 2025
1c387d2
Remove the need for ARGS
Podginator Jan 17, 2025
d82bc89
Merge pull request #4444 from williamtheaker/main
Podginator Jan 17, 2025
06449ca
Merge pull request #4494 from Dadams2/main
Podginator Jan 17, 2025
e42208a
Merge pull request #4402 from youngkyo0504/fix/layout-shift
Podginator Jan 17, 2025
74b4c18
Update packages, and Typescript versions
Podginator Jan 17, 2025
4ed102a
Merge branch 'self-host-updates' of https://github.com/omnivore-app/o…
Podginator Jan 17, 2025
14a0846
:q
Podginator Jan 17, 2025
0dacd19
Merge
Podginator Jan 17, 2025
d082948
Fix
Podginator Jan 17, 2025
24813ac
Fix issues with build on Web
Podginator Jan 17, 2025
e31b812
Merge remote-tracking branch 'app-main/self-host-updates' into discov…
Podginator Jan 17, 2025
9bf1f1d
Correct push
Podginator Jan 17, 2025
cccff3f
Fix Linting issues
Podginator Jan 17, 2025
8b48b5e
Merge
Podginator Jan 17, 2025
7d8232e
Fix Trace import
Podginator Jan 17, 2025
25b94ac
Add missing types
Podginator Jan 17, 2025
45fa628
Merge remote-tracking branch 'app-main/self-host-updates' into discov…
Podginator Jan 17, 2025
c6cf7df
Fix Tasks
Podginator Jan 17, 2025
17e202e
Merge remote-tracking branch 'app-main/self-host-updates' into discov…
Podginator Jan 17, 2025
1d557a8
Merge main
Podginator Jan 28, 2025
02d1c5b
Fix PDF Worker
Podginator Jan 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions packages/api/src/generated/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,7 @@ export type DiscoverFeedArticle = {
author?: Maybe<Scalars['String']>;
description: Scalars['String'];
feed: Scalars['String'];
hidden?: Maybe<Scalars['Boolean']>;
id: Scalars['ID'];
image?: Maybe<Scalars['String']>;
publishedDate?: Maybe<Scalars['Date']>;
Expand Down Expand Up @@ -1364,6 +1365,29 @@ export type HiddenHomeSectionSuccess = {
section?: Maybe<HomeSection>;
};

export type HideDiscoverArticleError = {
__typename?: 'HideDiscoverArticleError';
errorCodes: Array<HideDiscoverArticleErrorCode>;
};

export enum HideDiscoverArticleErrorCode {
BadRequest = 'BAD_REQUEST',
NotFound = 'NOT_FOUND',
Unauthorized = 'UNAUTHORIZED'
}

export type HideDiscoverArticleInput = {
discoverArticleId: Scalars['ID'];
setHidden: Scalars['Boolean'];
};

export type HideDiscoverArticleResult = HideDiscoverArticleError | HideDiscoverArticleSuccess;

export type HideDiscoverArticleSuccess = {
__typename?: 'HideDiscoverArticleSuccess';
id: Scalars['ID'];
};

export type Highlight = {
__typename?: 'Highlight';
annotation?: Maybe<Scalars['String']>;
Expand Down Expand Up @@ -1863,6 +1887,7 @@ export type Mutation = {
generateApiKey: GenerateApiKeyResult;
googleLogin: LoginResult;
googleSignup: GoogleSignupResult;
hideDiscoverArticle: HideDiscoverArticleResult;
importFromIntegration: ImportFromIntegrationResult;
joinGroup: JoinGroupResult;
leaveGroup: LeaveGroupResult;
Expand Down Expand Up @@ -2063,6 +2088,11 @@ export type MutationGoogleSignupArgs = {
};


export type MutationHideDiscoverArticleArgs = {
input: HideDiscoverArticleInput;
};


export type MutationImportFromIntegrationArgs = {
integrationId: Scalars['ID'];
};
Expand Down Expand Up @@ -2544,6 +2574,7 @@ export type QueryGetDiscoverFeedArticlesArgs = {
discoverTopicId: Scalars['String'];
feedId?: InputMaybe<Scalars['ID']>;
first?: InputMaybe<Scalars['Int']>;
showHidden?: InputMaybe<Scalars['Boolean']>;
};


Expand Down Expand Up @@ -4661,6 +4692,11 @@ export type ResolversTypes = {
HiddenHomeSectionErrorCode: HiddenHomeSectionErrorCode;
HiddenHomeSectionResult: ResolversTypes['HiddenHomeSectionError'] | ResolversTypes['HiddenHomeSectionSuccess'];
HiddenHomeSectionSuccess: ResolverTypeWrapper<HiddenHomeSectionSuccess>;
HideDiscoverArticleError: ResolverTypeWrapper<HideDiscoverArticleError>;
HideDiscoverArticleErrorCode: HideDiscoverArticleErrorCode;
HideDiscoverArticleInput: HideDiscoverArticleInput;
HideDiscoverArticleResult: ResolversTypes['HideDiscoverArticleError'] | ResolversTypes['HideDiscoverArticleSuccess'];
HideDiscoverArticleSuccess: ResolverTypeWrapper<HideDiscoverArticleSuccess>;
Highlight: ResolverTypeWrapper<Highlight>;
HighlightEdge: ResolverTypeWrapper<HighlightEdge>;
HighlightReply: ResolverTypeWrapper<HighlightReply>;
Expand Down Expand Up @@ -5273,6 +5309,10 @@ export type ResolversParentTypes = {
HiddenHomeSectionError: HiddenHomeSectionError;
HiddenHomeSectionResult: ResolversParentTypes['HiddenHomeSectionError'] | ResolversParentTypes['HiddenHomeSectionSuccess'];
HiddenHomeSectionSuccess: HiddenHomeSectionSuccess;
HideDiscoverArticleError: HideDiscoverArticleError;
HideDiscoverArticleInput: HideDiscoverArticleInput;
HideDiscoverArticleResult: ResolversParentTypes['HideDiscoverArticleError'] | ResolversParentTypes['HideDiscoverArticleSuccess'];
HideDiscoverArticleSuccess: HideDiscoverArticleSuccess;
Highlight: Highlight;
HighlightEdge: HighlightEdge;
HighlightReply: HighlightReply;
Expand Down Expand Up @@ -6203,6 +6243,7 @@ export type DiscoverFeedArticleResolvers<ContextType = ResolverContext, ParentTy
author?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
description?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
feed?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
hidden?: Resolver<Maybe<ResolversTypes['Boolean']>, ParentType, ContextType>;
id?: Resolver<ResolversTypes['ID'], ParentType, ContextType>;
image?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
publishedDate?: Resolver<Maybe<ResolversTypes['Date']>, ParentType, ContextType>;
Expand Down Expand Up @@ -6552,6 +6593,20 @@ export type HiddenHomeSectionSuccessResolvers<ContextType = ResolverContext, Par
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
};

export type HideDiscoverArticleErrorResolvers<ContextType = ResolverContext, ParentType extends ResolversParentTypes['HideDiscoverArticleError'] = ResolversParentTypes['HideDiscoverArticleError']> = {
errorCodes?: Resolver<Array<ResolversTypes['HideDiscoverArticleErrorCode']>, ParentType, ContextType>;
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
};

export type HideDiscoverArticleResultResolvers<ContextType = ResolverContext, ParentType extends ResolversParentTypes['HideDiscoverArticleResult'] = ResolversParentTypes['HideDiscoverArticleResult']> = {
__resolveType: TypeResolveFn<'HideDiscoverArticleError' | 'HideDiscoverArticleSuccess', ParentType, ContextType>;
};

export type HideDiscoverArticleSuccessResolvers<ContextType = ResolverContext, ParentType extends ResolversParentTypes['HideDiscoverArticleSuccess'] = ResolversParentTypes['HideDiscoverArticleSuccess']> = {
id?: Resolver<ResolversTypes['ID'], ParentType, ContextType>;
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
};

export type HighlightResolvers<ContextType = ResolverContext, ParentType extends ResolversParentTypes['Highlight'] = ResolversParentTypes['Highlight']> = {
annotation?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
color?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
Expand Down Expand Up @@ -6945,6 +7000,7 @@ export type MutationResolvers<ContextType = ResolverContext, ParentType extends
generateApiKey?: Resolver<ResolversTypes['GenerateApiKeyResult'], ParentType, ContextType, RequireFields<MutationGenerateApiKeyArgs, 'input'>>;
googleLogin?: Resolver<ResolversTypes['LoginResult'], ParentType, ContextType, RequireFields<MutationGoogleLoginArgs, 'input'>>;
googleSignup?: Resolver<ResolversTypes['GoogleSignupResult'], ParentType, ContextType, RequireFields<MutationGoogleSignupArgs, 'input'>>;
hideDiscoverArticle?: Resolver<ResolversTypes['HideDiscoverArticleResult'], ParentType, ContextType, RequireFields<MutationHideDiscoverArticleArgs, 'input'>>;
importFromIntegration?: Resolver<ResolversTypes['ImportFromIntegrationResult'], ParentType, ContextType, RequireFields<MutationImportFromIntegrationArgs, 'integrationId'>>;
joinGroup?: Resolver<ResolversTypes['JoinGroupResult'], ParentType, ContextType, RequireFields<MutationJoinGroupArgs, 'inviteCode'>>;
leaveGroup?: Resolver<ResolversTypes['LeaveGroupResult'], ParentType, ContextType, RequireFields<MutationLeaveGroupArgs, 'groupId'>>;
Expand Down Expand Up @@ -8399,6 +8455,9 @@ export type Resolvers<ContextType = ResolverContext> = {
HiddenHomeSectionError?: HiddenHomeSectionErrorResolvers<ContextType>;
HiddenHomeSectionResult?: HiddenHomeSectionResultResolvers<ContextType>;
HiddenHomeSectionSuccess?: HiddenHomeSectionSuccessResolvers<ContextType>;
HideDiscoverArticleError?: HideDiscoverArticleErrorResolvers<ContextType>;
HideDiscoverArticleResult?: HideDiscoverArticleResultResolvers<ContextType>;
HideDiscoverArticleSuccess?: HideDiscoverArticleSuccessResolvers<ContextType>;
Highlight?: HighlightResolvers<ContextType>;
HighlightEdge?: HighlightEdgeResolvers<ContextType>;
HighlightReply?: HighlightReplyResolvers<ContextType>;
Expand Down
25 changes: 24 additions & 1 deletion packages/api/src/generated/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,7 @@ type DiscoverFeedArticle {
author: String
description: String!
feed: String!
hidden: Boolean
id: ID!
image: String
publishedDate: Date
Expand Down Expand Up @@ -1226,6 +1227,27 @@ type HiddenHomeSectionSuccess {
section: HomeSection
}

type HideDiscoverArticleError {
errorCodes: [HideDiscoverArticleErrorCode!]!
}

enum HideDiscoverArticleErrorCode {
BAD_REQUEST
NOT_FOUND
UNAUTHORIZED
}

input HideDiscoverArticleInput {
discoverArticleId: ID!
setHidden: Boolean!
}

union HideDiscoverArticleResult = HideDiscoverArticleError | HideDiscoverArticleSuccess

type HideDiscoverArticleSuccess {
id: ID!
}

type Highlight {
annotation: String
color: String
Expand Down Expand Up @@ -1684,6 +1706,7 @@ type Mutation {
generateApiKey(input: GenerateApiKeyInput!): GenerateApiKeyResult!
googleLogin(input: GoogleLoginInput!): LoginResult!
googleSignup(input: GoogleSignupInput!): GoogleSignupResult!
hideDiscoverArticle(input: HideDiscoverArticleInput!): HideDiscoverArticleResult!
importFromIntegration(integrationId: ID!): ImportFromIntegrationResult!
joinGroup(inviteCode: String!): JoinGroupResult!
leaveGroup(groupId: ID!): LeaveGroupResult!
Expand Down Expand Up @@ -1916,7 +1939,7 @@ type Query {
feeds(input: FeedsInput!): FeedsResult!
filters: FiltersResult!
folderPolicies: FolderPoliciesResult!
getDiscoverFeedArticles(after: String, discoverTopicId: String!, feedId: ID, first: Int): GetDiscoverFeedArticleResults!
getDiscoverFeedArticles(after: String, discoverTopicId: String!, feedId: ID, first: Int, showHidden: Boolean): GetDiscoverFeedArticleResults!
getUserPersonalization: GetUserPersonalizationResult!
groups: GroupsResult!
hello: String
Expand Down
8 changes: 8 additions & 0 deletions packages/api/src/jobs/discover_feed_added.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { DiscoverFeed } from '../generated/graphql'

export interface DiscoverFeedAddedJobData {
id: string
feed: DiscoverFeed
}

export const DISCOVER_FEED_ADDED_NAME = 'discover-feed-added'
1 change: 1 addition & 0 deletions packages/api/src/pubsub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ export enum EntityType {
HIGHLIGHT = 'HIGHLIGHT',
LABEL = 'LABEL',
RSS_FEED = 'FEED',
DISCOVER_FEED = 'DISCOVER_FEED',
}

export interface PubsubClient {
Expand Down
2 changes: 2 additions & 0 deletions packages/api/src/queue-processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ import { logger } from './utils/logger'

export const BACKEND_QUEUE_NAME = 'omnivore-backend-queue'
export const CONTENT_FETCH_QUEUE = 'omnivore-content-fetch-queue'
export const DISCOVER_QUEUE = 'omnivore-discover-queue'


export const JOB_VERSION = 'v001'

Expand Down
40 changes: 21 additions & 19 deletions packages/api/src/resolvers/discover_feeds/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,18 @@ import {
MutationAddDiscoverFeedArgs,
} from '../../generated/graphql'
import { authorized } from '../../utils/gql-utils'
import { rssParserConfig } from '../../utils/parser'
import { enqueueDiscoverJob } from '../../utils/createTask'

const RSS_PARSER_CONFIG = {
timeout: 5000, // 5 seconds
headers: {
// some rss feeds require user agent
'User-Agent':
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36',
Accept:
'application/rss+xml, application/rdf+xml;q=0.8, application/atom+xml;q=0.6, application/xml;q=0.4, text/xml;q=0.4, text/html;q=0.2',
},
}

const parser = new XMLParser({
ignoreAttributes: false,
Expand All @@ -23,10 +34,6 @@ const parser = new XMLParser({
ignorePiTags: false,
})

type DiscoverFeedRows = {
rows: DiscoverFeed[]
}

const extractAtomData = (
url: string,
feed: {
Expand Down Expand Up @@ -70,7 +77,7 @@ const handleExistingSubscription = async (
[userId, feed.id]
)

if (existingSubscription.rows > 1) {
if (existingSubscription.length > 0) {
return {
__typename: 'AddDiscoverFeedError',
errorCodes: [AddDiscoverFeedErrorCode.Conflict],
Expand All @@ -93,7 +100,7 @@ const addNewSubscription = async (
userId: string
): Promise<AddDiscoverFeedSuccess | AddDiscoverFeedError> => {
// First things first, we need to validate that this is an actual RSS or ATOM feed.
const response = await axios.get(url, rssParserConfig())
const response = await axios.get(url, RSS_PARSER_CONFIG)
const content = response.data

const contentType = response.headers['content-type']
Expand Down Expand Up @@ -157,26 +164,21 @@ export const addDiscoverFeedResolver = authorized<
AddDiscoverFeedSuccess,
AddDiscoverFeedError,
MutationAddDiscoverFeedArgs
>(async (_, { input: { url } }, { uid, log, pubsub }) => {
>(async (_, { input: { url } }, { uid, log }) => {
try {
const existingFeed = (await appDataSource.query(
'SELECT id from omnivore.discover_feed where link = $1',
[url]
)) as DiscoverFeedRows
)) as DiscoverFeed[]

if (existingFeed.rows.length > 0) {
return await handleExistingSubscription(existingFeed.rows[0], uid)
if (existingFeed.length > 0) {
return await handleExistingSubscription(existingFeed[0], uid)
}

const result = await addNewSubscription(url, uid)
// TODO: Add pubsub for new feed
// if (result.__typename == 'AddDiscoverFeedSuccess') {
// await pubsub.entityCreated(
// EntityType.RSS_FEED,
// { feed: result.feed, libraryItemId: 'NA' },
// uid
// )
// }
if (result.__typename == 'AddDiscoverFeedSuccess') {
await enqueueDiscoverJob({ id: result.feed.id, feed: result.feed })
}

return result
} catch (error) {
Expand Down
8 changes: 3 additions & 5 deletions packages/api/src/resolvers/discover_feeds/articles/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,12 @@ export const saveDiscoverArticleResolver = authorized<
}
}

const { rows: discoverArticles } = (await appDataSource.query(
const discoverArticles = (await appDataSource.query(
`SELECT url FROM omnivore.discover_feed_articles WHERE id=$1`,
[discoverArticleId]
)) as {
rows: {
url: string
}[]
}
url: string
}[]

if (discoverArticles.length != 1) {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@ export const deleteDiscoverArticleResolver = authorized<
}
}

const { rows: discoverArticles } = (await appDataSource.query(
const discoverArticles = (await appDataSource.query(
`SELECT article_save_id FROM omnivore.discover_feed_save_link WHERE discover_article_id=$1 and user_id=$2`,
[discoverArticleId, uid]
)) as {
rows: { article_save_id: string }[]
}
)) as { article_save_id: string }[]

if (discoverArticles.length != 1) {
return {
Expand Down
Loading
Loading