From 087cb7a2320ecd2128f716f0169f76b267ada536 Mon Sep 17 00:00:00 2001 From: Harsh Date: Thu, 25 Jan 2024 15:11:20 +0530 Subject: [PATCH] Fixes styles of inline code snippets --- .../themes/enterprise/generated/graphql.ts | 386 +++++++++++++++++- .../enterprise/generated/schema.graphql | 272 +++++++++++- .../themes/enterprise/styles/index.css | 41 ++ .../themes/hashnode/generated/graphql.ts | 386 +++++++++++++++++- .../themes/hashnode/generated/schema.graphql | 272 +++++++++++- .../themes/personal/generated/graphql.ts | 386 +++++++++++++++++- .../themes/personal/generated/schema.graphql | 272 +++++++++++- .../themes/personal/styles/index.css | 41 ++ 8 files changed, 1975 insertions(+), 81 deletions(-) diff --git a/packages/blog-starter-kit/themes/enterprise/generated/graphql.ts b/packages/blog-starter-kit/themes/enterprise/generated/graphql.ts index e16abb6cc..cd99c0cc3 100644 --- a/packages/blog-starter-kit/themes/enterprise/generated/graphql.ts +++ b/packages/blog-starter-kit/themes/enterprise/generated/graphql.ts @@ -17,6 +17,16 @@ export type Scalars = { ObjectId: { input: string; output: string; } }; +export type AddCommentInput = { + contentMarkdown: Scalars['String']['input']; + postId: Scalars['ID']['input']; +}; + +export type AddCommentPayload = { + __typename?: 'AddCommentPayload'; + comment?: Maybe; +}; + export type AddPostToSeriesInput = { /** The ID of the post to be added to the series. */ postId: Scalars['ObjectId']['input']; @@ -30,6 +40,16 @@ export type AddPostToSeriesPayload = { series?: Maybe; }; +export type AddReplyInput = { + commentId: Scalars['ID']['input']; + contentMarkdown: Scalars['String']['input']; +}; + +export type AddReplyPayload = { + __typename?: 'AddReplyPayload'; + reply?: Maybe; +}; + /** * Contains the flag indicating if the audio blog feature is enabled or not. * User can enable or disable the audio blog feature from the publication settings. @@ -107,6 +127,17 @@ export type BetaFeature = Node & { url?: Maybe; }; +export type CancelScheduledDraftInput = { + /** The Draft ID of the scheduled draft. */ + draftId: Scalars['ID']['input']; +}; + +export type CancelScheduledDraftPayload = { + __typename?: 'CancelScheduledDraftPayload'; + /** Payload returned in response of cancel scheduled post mutation. */ + scheduledPost: ScheduledPost; +}; + /** * Contains basic information about the comment. * A comment is a response to a post. @@ -216,6 +247,18 @@ export type CoverImageOptionsInput = { stickCoverToBottom?: InputMaybe; }; +export type CreateWebhookInput = { + events: Array; + publicationId: Scalars['ID']['input']; + secret: Scalars['String']['input']; + url: Scalars['String']['input']; +}; + +export type CreateWebhookPayload = { + __typename?: 'CreateWebhookPayload'; + webhook?: Maybe; +}; + export type CustomCss = { __typename?: 'CustomCSS'; /** Custom CSS that will be applied on the publication homepage. */ @@ -251,6 +294,11 @@ export type DarkModePreferences = { logo?: Maybe; }; +export type DeleteWebhookPayload = { + __typename?: 'DeleteWebhookPayload'; + webhook?: Maybe; +}; + /** Contains the publication's domain information. */ export type DomainInfo = { __typename?: 'DomainInfo'; @@ -598,6 +646,26 @@ export type IUserPublicationsArgs = { first: Scalars['Int']['input']; }; +export type LikeCommentInput = { + commentId: Scalars['ID']['input']; + likesCount?: InputMaybe; +}; + +export type LikeCommentPayload = { + __typename?: 'LikeCommentPayload'; + comment?: Maybe; +}; + +export type LikePostInput = { + likesCount?: InputMaybe; + postId: Scalars['ID']['input']; +}; + +export type LikePostPayload = { + __typename?: 'LikePostPayload'; + post?: Maybe; +}; + /** Contains information about meta tags of the post. Used for SEO purpose. */ export type MetaTagsInput = { /** The description of the post used in og:description for SEO. */ @@ -610,12 +678,35 @@ export type MetaTagsInput = { export type Mutation = { __typename?: 'Mutation'; + /** Adds a comment to a post. */ + addComment: AddCommentPayload; /** Adds a post to a series. */ addPostToSeries: AddPostToSeriesPayload; + /** Adds a reply to a comment. */ + addReply: AddReplyPayload; + cancelScheduledDraft: CancelScheduledDraftPayload; + createWebhook: CreateWebhookPayload; + deleteWebhook: DeleteWebhookPayload; + /** Likes a comment. */ + likeComment: LikeCommentPayload; + /** Likes a post. */ + likePost: LikePostPayload; + /** Publishes an existing draft as a post. */ + publishDraft: PublishDraftPayload; /** Creates a new post. */ publishPost: PublishPostPayload; - /** Reschedule a post. */ - reschedulePost?: Maybe; + recommendPublications: RecommendPublicationsPayload; + /** Removes a comment from a post. */ + removeComment: RemoveCommentPayload; + /** Removes a post. */ + removePost: RemovePostPayload; + removeRecommendation: RemoveRecommendationPayload; + /** Removes a reply from a comment. */ + removeReply: RemoveReplyPayload; + /** Reschedule a draft. */ + rescheduleDraft: RescheduleDraftPayload; + resendWebhookRequest: ResendWebhookRequestPayload; + scheduleDraft: ScheduleDraftPayload; subscribeToNewsletter: SubscribeToNewsletterPayload; /** * Update the follow state for the user that is provided via id or username. @@ -624,8 +715,19 @@ export type Mutation = { * Only available to the authenticated user. */ toggleFollowUser: ToggleFollowUserPayload; + triggerWebhookTest: TriggerWebhookTestPayload; unsubscribeFromNewsletter: UnsubscribeFromNewsletterPayload; + /** Updates a comment on a post. */ + updateComment: UpdateCommentPayload; updatePost: UpdatePostPayload; + /** Updates a reply */ + updateReply: UpdateReplyPayload; + updateWebhook: UpdateWebhookPayload; +}; + + +export type MutationAddCommentArgs = { + input: AddCommentInput; }; @@ -634,13 +736,83 @@ export type MutationAddPostToSeriesArgs = { }; +export type MutationAddReplyArgs = { + input: AddReplyInput; +}; + + +export type MutationCancelScheduledDraftArgs = { + input: CancelScheduledDraftInput; +}; + + +export type MutationCreateWebhookArgs = { + input: CreateWebhookInput; +}; + + +export type MutationDeleteWebhookArgs = { + id: Scalars['ID']['input']; +}; + + +export type MutationLikeCommentArgs = { + input: LikeCommentInput; +}; + + +export type MutationLikePostArgs = { + input: LikePostInput; +}; + + +export type MutationPublishDraftArgs = { + input: PublishDraftInput; +}; + + export type MutationPublishPostArgs = { input: PublishPostInput; }; -export type MutationReschedulePostArgs = { - input: ReschedulePostInput; +export type MutationRecommendPublicationsArgs = { + input: RecommendPublicationsInput; +}; + + +export type MutationRemoveCommentArgs = { + input: RemoveCommentInput; +}; + + +export type MutationRemovePostArgs = { + input: RemovePostInput; +}; + + +export type MutationRemoveRecommendationArgs = { + input: RemoveRecommendationInput; +}; + + +export type MutationRemoveReplyArgs = { + input: RemoveReplyInput; +}; + + +export type MutationRescheduleDraftArgs = { + input: RescheduleDraftInput; +}; + + +export type MutationResendWebhookRequestArgs = { + input: ResendWebhookRequestInput; +}; + + +export type MutationScheduleDraftArgs = { + input: ScheduleDraftInput; }; @@ -655,15 +827,35 @@ export type MutationToggleFollowUserArgs = { }; +export type MutationTriggerWebhookTestArgs = { + input: TriggerWebhookTestInput; +}; + + export type MutationUnsubscribeFromNewsletterArgs = { input: UnsubscribeFromNewsletterInput; }; +export type MutationUpdateCommentArgs = { + input: UpdateCommentInput; +}; + + export type MutationUpdatePostArgs = { input: UpdatePostInput; }; + +export type MutationUpdateReplyArgs = { + input: UpdateReplyInput; +}; + + +export type MutationUpdateWebhookArgs = { + input: UpdateWebhookInput; +}; + /** * Basic information about the authenticated user. * User must be authenticated to use this type. @@ -1447,6 +1639,8 @@ export type PublicationIntegrations = { fathomSiteID?: Maybe; /** FB Pixel ID for integration with Facebook Pixel. */ fbPixelID?: Maybe; + /** Google Tag Manager ID for integration with Google Tag Manager. */ + gTagManagerID?: Maybe; /** Google Analytics Tracking ID for integration with Google Analytics. */ gaTrackingID?: Maybe; /** Hotjar Site ID for integration with Hotjar. */ @@ -1591,6 +1785,17 @@ export type PublicationUserRecommendingPublicationConnection = PageConnection & totalDocuments: Scalars['Int']['output']; }; +export type PublishDraftInput = { + /** The id of the draft that should be published */ + draftId: Scalars['ObjectId']['input']; +}; + +export type PublishDraftPayload = { + __typename?: 'PublishDraftPayload'; + /** The newly created post based on the draft */ + post?: Maybe; +}; + /** Contains information about the post to be published. */ export type PublishPostInput = { /** Ids of the co-authors of the post. */ @@ -1682,6 +1887,8 @@ export type Query = { feed: FeedPostConnection; /** Returns the current authenticated user. Only available to the authenticated user. */ me: MyUser; + /** Returns post by ID. Can be used to render post page on blog. */ + post?: Maybe; /** * Returns the publication with the given ID or host. * User can pass anyone of them. @@ -1712,6 +1919,11 @@ export type QueryFeedArgs = { }; +export type QueryPostArgs = { + id: Scalars['ID']['input']; +}; + + export type QueryPublicationArgs = { host?: InputMaybe; id?: InputMaybe; @@ -1763,6 +1975,16 @@ export type ReadTimeFeature = Feature & { isEnabled: Scalars['Boolean']['output']; }; +export type RecommendPublicationsInput = { + recommendedPublicationIds: Array; + recommendingPublicationId: Scalars['ID']['input']; +}; + +export type RecommendPublicationsPayload = { + __typename?: 'RecommendPublicationsPayload'; + recommendedPublications?: Maybe>; +}; + /** Contains a publication and a cursor for pagination. */ export type RecommendedPublicationEdge = Edge & { __typename?: 'RecommendedPublicationEdge'; @@ -1782,6 +2004,46 @@ export type RedirectionRule = { type: HttpRedirectionType; }; +export type RemoveCommentInput = { + id: Scalars['ID']['input']; +}; + +export type RemoveCommentPayload = { + __typename?: 'RemoveCommentPayload'; + comment?: Maybe; +}; + +export type RemovePostInput = { + /** The ID of the post to remove. */ + id: Scalars['ID']['input']; +}; + +export type RemovePostPayload = { + __typename?: 'RemovePostPayload'; + /** The deleted post. */ + post?: Maybe; +}; + +export type RemoveRecommendationInput = { + recommendedPublicationId: Scalars['ID']['input']; + recommendingPublicationId: Scalars['ID']['input']; +}; + +export type RemoveRecommendationPayload = { + __typename?: 'RemoveRecommendationPayload'; + recommendedPublication: Publication; +}; + +export type RemoveReplyInput = { + commentId: Scalars['ID']['input']; + replyId: Scalars['ID']['input']; +}; + +export type RemoveReplyPayload = { + __typename?: 'RemoveReplyPayload'; + reply?: Maybe; +}; + /** * Contains basic information about the reply. * A reply is a response to a comment. @@ -1807,11 +2069,27 @@ export type Reply = Node & { totalReactions: Scalars['Int']['output']; }; -export type ReschedulePostInput = { - /** The Draft ID of the scheduled post. */ - draftId: Scalars['ObjectId']['input']; - /** New scheduled date for the post to be rescheduled. */ - scheduledDate: Scalars['DateTime']['input']; +export type RescheduleDraftInput = { + /** The Draft ID of the scheduled draft. */ + draftId: Scalars['ID']['input']; + /** New scheduled date for the draft to be rescheduled. */ + publishAt: Scalars['DateTime']['input']; +}; + +export type RescheduleDraftPayload = { + __typename?: 'RescheduleDraftPayload'; + /** Payload returned in response of reschedulePost mutation. */ + scheduledPost: ScheduledPost; +}; + +export type ResendWebhookRequestInput = { + webhookId: Scalars['ID']['input']; + webhookMessageId: Scalars['ID']['input']; +}; + +export type ResendWebhookRequestPayload = { + __typename?: 'ResendWebhookRequestPayload'; + webhookMessage?: Maybe; }; /** Information to help in seo related meta tags. */ @@ -1823,6 +2101,21 @@ export type Seo = { title?: Maybe; }; +export type ScheduleDraftInput = { + /** The Author ID of the draft that should be published */ + authorId: Scalars['ID']['input']; + /** The id of the draft that should be published */ + draftId: Scalars['ID']['input']; + /** The date the draft should be published */ + publishAt: Scalars['DateTime']['input']; +}; + +export type ScheduleDraftPayload = { + __typename?: 'ScheduleDraftPayload'; + /** Payload returned in response of reschedulePost mutation. */ + scheduledPost: ScheduledPost; +}; + /** * Contains basic information about the scheduled post. * A scheduled post is a post that is scheduled to be published in the future. @@ -1843,12 +2136,6 @@ export type ScheduledPost = Node & { scheduledDate: Scalars['DateTime']['output']; }; -export type ScheduledPostPayload = { - __typename?: 'ScheduledPostPayload'; - /** Payload returned in response of reschedulePost mutation. */ - payload: ScheduledPost; -}; - /** Enum of all the scopes that can be used with the @requireAuth directive. */ export enum Scope { AcknowledgeEmailImport = 'acknowledge_email_import', @@ -1866,6 +2153,7 @@ export enum Scope { RemoveComment = 'remove_comment', RemoveReply = 'remove_reply', Signup = 'signup', + TeamHashnode = 'team_hashnode', UpdateComment = 'update_comment', UpdatePost = 'update_post', UpdateReply = 'update_reply', @@ -2159,6 +2447,15 @@ export type ToggleFollowUserPayload = { user?: Maybe; }; +export type TriggerWebhookTestInput = { + webhookId: Scalars['ID']['input']; +}; + +export type TriggerWebhookTestPayload = { + __typename?: 'TriggerWebhookTestPayload'; + webhook?: Maybe; +}; + export type UnsubscribeFromNewsletterInput = { /** The email that is currently subscribed. */ email: Scalars['String']['input']; @@ -2171,6 +2468,16 @@ export type UnsubscribeFromNewsletterPayload = { status?: Maybe; }; +export type UpdateCommentInput = { + contentMarkdown: Scalars['String']['input']; + id: Scalars['ID']['input']; +}; + +export type UpdateCommentPayload = { + __typename?: 'UpdateCommentPayload'; + comment?: Maybe; +}; + export type UpdatePostInput = { /** * Update co-authors of the post. @@ -2229,6 +2536,29 @@ export type UpdatePostSettingsInput = { pinToBlog?: InputMaybe; }; +export type UpdateReplyInput = { + commentId: Scalars['ID']['input']; + contentMarkdown: Scalars['String']['input']; + replyId: Scalars['ID']['input']; +}; + +export type UpdateReplyPayload = { + __typename?: 'UpdateReplyPayload'; + reply?: Maybe; +}; + +export type UpdateWebhookInput = { + events?: InputMaybe>; + id: Scalars['ID']['input']; + secret?: InputMaybe; + url?: InputMaybe; +}; + +export type UpdateWebhookPayload = { + __typename?: 'UpdateWebhookPayload'; + webhook?: Maybe; +}; + export enum UrlPattern { /** Post URLs contain the slug (for example `my slug`) and a random id (like `1234`) , e.g. "/my-slug-1234". */ Default = 'DEFAULT', @@ -2576,6 +2906,32 @@ export type WebhookMessageResponse = { timeToFirstByteMilliseconds?: Maybe; }; +export type Widget = Node & { + __typename?: 'Widget'; + /** Content of the widget, can be a simple string or HTML */ + content: Scalars['String']['output']; + /** The date and time the widget was created. */ + createdAt: Scalars['DateTime']['output']; + /** The unique identifier of the widget */ + id: Scalars['ID']['output']; + pinSettings?: Maybe; + /** WidgetId, can be embedded as %%[widgetId] in the article */ + widgetId: Scalars['String']['output']; +}; + +export enum WidgetPinLocation { + Bottom = 'BOTTOM', + Top = 'TOP' +} + +export type WidgetPinSettings = { + __typename?: 'WidgetPinSettings'; + /** Signifies if pinning of widget on all the articles of publication is enabled or not */ + isPinned: Scalars['Boolean']['output']; + /** Describes the location of the widget on the article, can be TOP or BOTTOM */ + location: WidgetPinLocation; +}; + export type PageInfoFragment = { __typename?: 'PageInfo', endCursor?: string | null, hasNextPage?: boolean | null }; export type PostFragment = { __typename?: 'Post', id: string, title: string, url: string, publishedAt: string, slug: string, brief: string, author: { __typename?: 'User', name: string, profilePicture?: string | null }, coverImage?: { __typename?: 'PostCoverImage', url: string } | null }; diff --git a/packages/blog-starter-kit/themes/enterprise/generated/schema.graphql b/packages/blog-starter-kit/themes/enterprise/generated/schema.graphql index 3e638faf6..b3879b4ea 100644 --- a/packages/blog-starter-kit/themes/enterprise/generated/schema.graphql +++ b/packages/blog-starter-kit/themes/enterprise/generated/schema.graphql @@ -11,6 +11,15 @@ directive @private on FIELD_DEFINITION | OBJECT directive @requireAuth(scopes: [Scope!]) on FIELD_DEFINITION | OBJECT +input AddCommentInput { + contentMarkdown: String! + postId: ID! +} + +type AddCommentPayload { + comment: Comment +} + input AddPostToSeriesInput { """The ID of the post to be added to the series.""" postId: ObjectId! @@ -23,6 +32,15 @@ type AddPostToSeriesPayload { series: Series } +input AddReplyInput { + commentId: ID! + contentMarkdown: String! +} + +type AddReplyPayload { + reply: Reply +} + """ Contains the flag indicating if the audio blog feature is enabled or not. User can enable or disable the audio blog feature from the publication settings. @@ -98,6 +116,16 @@ type BetaFeature implements Node { url: String } +input CancelScheduledDraftInput { + """The Draft ID of the scheduled draft.""" + draftId: ID! +} + +type CancelScheduledDraftPayload { + """Payload returned in response of cancel scheduled post mutation.""" + scheduledPost: ScheduledPost! +} + """ Contains basic information about the comment. A comment is a response to a post. @@ -211,6 +239,17 @@ input CoverImageOptionsInput { stickCoverToBottom: Boolean } +input CreateWebhookInput { + events: [WebhookEvent!]! + publicationId: ID! + secret: String! + url: String! +} + +type CreateWebhookPayload { + webhook: Webhook +} + type CustomCSS { """Custom CSS that will be applied on the publication homepage.""" home: String @@ -250,6 +289,10 @@ A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `dat """ scalar DateTime +type DeleteWebhookPayload { + webhook: Webhook +} + """Contains the publication's domain information.""" type DomainInfo { """The domain of the publication.""" @@ -619,6 +662,24 @@ interface IUser { username: String! } +input LikeCommentInput { + commentId: ID! + likesCount: Int = 1 +} + +type LikeCommentPayload { + comment: Comment +} + +input LikePostInput { + likesCount: Int = 1 + postId: ID! +} + +type LikePostPayload { + post: Post +} + """ Contains information about meta tags of the post. Used for SEO purpose. """ @@ -632,15 +693,44 @@ input MetaTagsInput { } type Mutation { + """Adds a comment to a post.""" + addComment(input: AddCommentInput!): AddCommentPayload! """Adds a post to a series.""" addPostToSeries(input: AddPostToSeriesInput!): AddPostToSeriesPayload! + """Adds a reply to a comment.""" + addReply(input: AddReplyInput!): AddReplyPayload! + cancelScheduledDraft(input: CancelScheduledDraftInput!): CancelScheduledDraftPayload! + createWebhook(input: CreateWebhookInput!): CreateWebhookPayload! + deleteWebhook(id: ID!): DeleteWebhookPayload! + """Likes a comment.""" + likeComment(input: LikeCommentInput!): LikeCommentPayload! + """Likes a post.""" + likePost(input: LikePostInput!): LikePostPayload! + """Publishes an existing draft as a post.""" + publishDraft( + """Information about the draft to be published.""" + input: PublishDraftInput! + ): PublishDraftPayload! """Creates a new post.""" publishPost( """Information about the post to be published.""" input: PublishPostInput! ): PublishPostPayload! - """Reschedule a post.""" - reschedulePost(input: ReschedulePostInput!): ScheduledPostPayload + recommendPublications(input: RecommendPublicationsInput!): RecommendPublicationsPayload! + """Removes a comment from a post.""" + removeComment(input: RemoveCommentInput!): RemoveCommentPayload! + """Removes a post.""" + removePost(input: RemovePostInput!): RemovePostPayload! + removeRecommendation(input: RemoveRecommendationInput!): RemoveRecommendationPayload! + """Removes a reply from a comment.""" + removeReply(input: RemoveReplyInput!): RemoveReplyPayload! + """Reschedule a draft.""" + rescheduleDraft(input: RescheduleDraftInput!): RescheduleDraftPayload! + resendWebhookRequest(input: ResendWebhookRequestInput!): ResendWebhookRequestPayload! + scheduleDraft( + """Information about the draft to be published.""" + input: ScheduleDraftInput! + ): ScheduleDraftPayload! subscribeToNewsletter(input: SubscribeToNewsletterInput!): SubscribeToNewsletterPayload! """ Update the follow state for the user that is provided via id or username. @@ -649,8 +739,14 @@ type Mutation { Only available to the authenticated user. """ toggleFollowUser(id: ID, username: String): ToggleFollowUserPayload! + triggerWebhookTest(input: TriggerWebhookTestInput!): TriggerWebhookTestPayload! unsubscribeFromNewsletter(input: UnsubscribeFromNewsletterInput!): UnsubscribeFromNewsletterPayload! + """Updates a comment on a post.""" + updateComment(input: UpdateCommentInput!): UpdateCommentPayload! updatePost(input: UpdatePostInput!): UpdatePostPayload! + """Updates a reply""" + updateReply(input: UpdateReplyInput!): UpdateReplyPayload! + updateWebhook(input: UpdateWebhookInput!): UpdateWebhookPayload! } """ @@ -1430,6 +1526,8 @@ type PublicationIntegrations { fathomSiteID: String """FB Pixel ID for integration with Facebook Pixel.""" fbPixelID: String + """Google Tag Manager ID for integration with Google Tag Manager.""" + gTagManagerID: String """Google Analytics Tracking ID for integration with Google Analytics.""" gaTrackingID: String """Hotjar Site ID for integration with Hotjar.""" @@ -1573,6 +1671,16 @@ type PublicationUserRecommendingPublicationConnection implements PageConnection totalDocuments: Int! } +input PublishDraftInput { + """The id of the draft that should be published""" + draftId: ObjectId! +} + +type PublishDraftPayload { + """The newly created post based on the draft""" + post: Post +} + """Contains information about the post to be published.""" input PublishPostInput { """Ids of the co-authors of the post.""" @@ -1682,6 +1790,11 @@ type Query { Returns the current authenticated user. Only available to the authenticated user. """ me: MyUser! + """Returns post by ID. Can be used to render post page on blog.""" + post( + """The ID of the post to be returned.""" + id: ID! + ): Post """ Returns the publication with the given ID or host. User can pass anyone of them. @@ -1745,6 +1858,15 @@ type ReadTimeFeature implements Feature { isEnabled: Boolean! } +input RecommendPublicationsInput { + recommendedPublicationIds: [ID!]! + recommendingPublicationId: ID! +} + +type RecommendPublicationsPayload { + recommendedPublications: [UserRecommendedPublicationEdge!] +} + """Contains a publication and a cursor for pagination.""" type RecommendedPublicationEdge implements Edge { """A cursor for use in pagination.""" @@ -1762,6 +1884,42 @@ type RedirectionRule { type: HttpRedirectionType! } +input RemoveCommentInput { + id: ID! +} + +type RemoveCommentPayload { + comment: Comment +} + +input RemovePostInput { + """The ID of the post to remove.""" + id: ID! +} + +type RemovePostPayload { + """The deleted post.""" + post: Post +} + +input RemoveRecommendationInput { + recommendedPublicationId: ID! + recommendingPublicationId: ID! +} + +type RemoveRecommendationPayload { + recommendedPublication: Publication! +} + +input RemoveReplyInput { + commentId: ID! + replyId: ID! +} + +type RemoveReplyPayload { + reply: Reply +} + """ Contains basic information about the reply. A reply is a response to a comment. @@ -1790,11 +1948,25 @@ type Reply implements Node { totalReactions: Int! } -input ReschedulePostInput { - """The Draft ID of the scheduled post.""" - draftId: ObjectId! - """New scheduled date for the post to be rescheduled.""" - scheduledDate: DateTime! +input RescheduleDraftInput { + """The Draft ID of the scheduled draft.""" + draftId: ID! + """New scheduled date for the draft to be rescheduled.""" + publishAt: DateTime! +} + +type RescheduleDraftPayload { + """Payload returned in response of reschedulePost mutation.""" + scheduledPost: ScheduledPost! +} + +input ResendWebhookRequestInput { + webhookId: ID! + webhookMessageId: ID! +} + +type ResendWebhookRequestPayload { + webhookMessage: WebhookMessage } """Information to help in seo related meta tags.""" @@ -1805,6 +1977,20 @@ type SEO { title: String } +input ScheduleDraftInput { + """The Author ID of the draft that should be published""" + authorId: ID! + """The id of the draft that should be published""" + draftId: ID! + """The date the draft should be published""" + publishAt: DateTime! +} + +type ScheduleDraftPayload { + """Payload returned in response of reschedulePost mutation.""" + scheduledPost: ScheduledPost! +} + """ Contains basic information about the scheduled post. A scheduled post is a post that is scheduled to be published in the future. @@ -1828,11 +2014,6 @@ type ScheduledPost implements Node { scheduledDate: DateTime! } -type ScheduledPostPayload { - """Payload returned in response of reschedulePost mutation.""" - payload: ScheduledPost! -} - """ Enum of all the scopes that can be used with the @requireAuth directive. """ @@ -1852,6 +2033,7 @@ enum Scope { remove_comment remove_reply signup + team_hashnode update_comment update_post update_reply @@ -2151,6 +2333,14 @@ type ToggleFollowUserPayload { user: User } +input TriggerWebhookTestInput { + webhookId: ID! +} + +type TriggerWebhookTestPayload { + webhook: Webhook +} + input UnsubscribeFromNewsletterInput { """The email that is currently subscribed.""" email: String! @@ -2162,6 +2352,15 @@ type UnsubscribeFromNewsletterPayload { status: NewsletterUnsubscribeStatus } +input UpdateCommentInput { + contentMarkdown: String! + id: ID! +} + +type UpdateCommentPayload { + comment: Comment +} + input UpdatePostInput { """ Update co-authors of the post. @@ -2227,6 +2426,27 @@ input UpdatePostSettingsInput { pinToBlog: Boolean } +input UpdateReplyInput { + commentId: ID! + contentMarkdown: String! + replyId: ID! +} + +type UpdateReplyPayload { + reply: Reply +} + +input UpdateWebhookInput { + events: [WebhookEvent!] + id: ID! + secret: String + url: String +} + +type UpdateWebhookPayload { + webhook: Webhook +} + enum UrlPattern { """ Post URLs contain the slug (for example `my slug`) and a random id (like `1234`) , e.g. "/my-slug-1234". @@ -2585,4 +2805,32 @@ type WebhookMessageResponse { The time it took from the moment the request has been send until the first byte of the response has been received. """ timeToFirstByteMilliseconds: Int +} + +type Widget implements Node { + """Content of the widget, can be a simple string or HTML""" + content: String! + """The date and time the widget was created.""" + createdAt: DateTime! + """The unique identifier of the widget""" + id: ID! + pinSettings: WidgetPinSettings + """WidgetId, can be embedded as %%[widgetId] in the article""" + widgetId: String! +} + +enum WidgetPinLocation { + BOTTOM + TOP +} + +type WidgetPinSettings { + """ + Signifies if pinning of widget on all the articles of publication is enabled or not + """ + isPinned: Boolean! + """ + Describes the location of the widget on the article, can be TOP or BOTTOM + """ + location: WidgetPinLocation! } \ No newline at end of file diff --git a/packages/blog-starter-kit/themes/enterprise/styles/index.css b/packages/blog-starter-kit/themes/enterprise/styles/index.css index f06b89943..8e1f9d0a7 100644 --- a/packages/blog-starter-kit/themes/enterprise/styles/index.css +++ b/packages/blog-starter-kit/themes/enterprise/styles/index.css @@ -4,4 +4,45 @@ .hashnode-content-style{ @apply prose break-words text-slate-950 first:prose-p:mt-0 prose-img:max-w-full prose-p:leading-snug prose-a:underline hover:prose-a:bg-primary-50 dark:hover:prose-a:text-primary-500 dark:hover:prose-a:bg-neutral-800 dark:text-neutral-50 prose-blockquote:leading-snug prose-a:leading-snug prose-figure:leading-snug prose-figcaption:leading-snug prose-pre:leading-snug prose-li:leading-snug prose-ul:leading-snug prose-ol:leading-snug prose-th:leading-snug prose-td:leading-snug lg:prose-xl dark:prose-invert dark:prose-pre:bg-neutral-900 first:prose-h1:mt-0 first:prose-h2:mt-0 first:prose-h3:mt-0 first:prose-h4:mt-0 first:prose-h5:mt-0; +} + +/* Override to remove the backtick */ +.hashnode-content-style :where(code):not(:where([class~="not-prose"],[class~="not-prose"] *))::before, .hashnode-content-style :where(code):not(:where([class~="not-prose"],[class~="not-prose"] *))::after { + content: none; +} + +.prose code { + border-radius: 0.25rem; + font-weight: 400 !important; + padding: 0.25rem; + --tw-text-opacity: 1; + color: rgba(0, 0, 0, var(--tw-text-opacity)); + font-size: 80%; + background: #f0efed; +} + +.dark .prose code { + --tw-bg-opacity: 1; + background-color: rgba(36, 41, 46, var(--tw-bg-opacity)); + --tw-text-opacity: 1; + color: rgba(238, 238, 238, var(--tw-text-opacity)); +} + +.prose pre { + padding-top: 2rem !important; + padding-bottom: 2rem !important; +} + +.prose pre code { + background-color: transparent; + border-radius: 0px; + font-weight: 500 !important; + padding: 0px; + font-size: 100%; + color: #fafafa; +} + +.dark .prose pre code { + background-color: transparent; + color: #ddd; } \ No newline at end of file diff --git a/packages/blog-starter-kit/themes/hashnode/generated/graphql.ts b/packages/blog-starter-kit/themes/hashnode/generated/graphql.ts index 3e120b70c..108c2161e 100644 --- a/packages/blog-starter-kit/themes/hashnode/generated/graphql.ts +++ b/packages/blog-starter-kit/themes/hashnode/generated/graphql.ts @@ -17,6 +17,16 @@ export type Scalars = { ObjectId: { input: string; output: string; } }; +export type AddCommentInput = { + contentMarkdown: Scalars['String']['input']; + postId: Scalars['ID']['input']; +}; + +export type AddCommentPayload = { + __typename?: 'AddCommentPayload'; + comment?: Maybe; +}; + export type AddPostToSeriesInput = { /** The ID of the post to be added to the series. */ postId: Scalars['ObjectId']['input']; @@ -30,6 +40,16 @@ export type AddPostToSeriesPayload = { series?: Maybe; }; +export type AddReplyInput = { + commentId: Scalars['ID']['input']; + contentMarkdown: Scalars['String']['input']; +}; + +export type AddReplyPayload = { + __typename?: 'AddReplyPayload'; + reply?: Maybe; +}; + /** * Contains the flag indicating if the audio blog feature is enabled or not. * User can enable or disable the audio blog feature from the publication settings. @@ -107,6 +127,17 @@ export type BetaFeature = Node & { url?: Maybe; }; +export type CancelScheduledDraftInput = { + /** The Draft ID of the scheduled draft. */ + draftId: Scalars['ID']['input']; +}; + +export type CancelScheduledDraftPayload = { + __typename?: 'CancelScheduledDraftPayload'; + /** Payload returned in response of cancel scheduled post mutation. */ + scheduledPost: ScheduledPost; +}; + /** * Contains basic information about the comment. * A comment is a response to a post. @@ -216,6 +247,18 @@ export type CoverImageOptionsInput = { stickCoverToBottom?: InputMaybe; }; +export type CreateWebhookInput = { + events: Array; + publicationId: Scalars['ID']['input']; + secret: Scalars['String']['input']; + url: Scalars['String']['input']; +}; + +export type CreateWebhookPayload = { + __typename?: 'CreateWebhookPayload'; + webhook?: Maybe; +}; + export type CustomCss = { __typename?: 'CustomCSS'; /** Custom CSS that will be applied on the publication homepage. */ @@ -251,6 +294,11 @@ export type DarkModePreferences = { logo?: Maybe; }; +export type DeleteWebhookPayload = { + __typename?: 'DeleteWebhookPayload'; + webhook?: Maybe; +}; + /** Contains the publication's domain information. */ export type DomainInfo = { __typename?: 'DomainInfo'; @@ -598,6 +646,26 @@ export type IUserPublicationsArgs = { first: Scalars['Int']['input']; }; +export type LikeCommentInput = { + commentId: Scalars['ID']['input']; + likesCount?: InputMaybe; +}; + +export type LikeCommentPayload = { + __typename?: 'LikeCommentPayload'; + comment?: Maybe; +}; + +export type LikePostInput = { + likesCount?: InputMaybe; + postId: Scalars['ID']['input']; +}; + +export type LikePostPayload = { + __typename?: 'LikePostPayload'; + post?: Maybe; +}; + /** Contains information about meta tags of the post. Used for SEO purpose. */ export type MetaTagsInput = { /** The description of the post used in og:description for SEO. */ @@ -610,12 +678,35 @@ export type MetaTagsInput = { export type Mutation = { __typename?: 'Mutation'; + /** Adds a comment to a post. */ + addComment: AddCommentPayload; /** Adds a post to a series. */ addPostToSeries: AddPostToSeriesPayload; + /** Adds a reply to a comment. */ + addReply: AddReplyPayload; + cancelScheduledDraft: CancelScheduledDraftPayload; + createWebhook: CreateWebhookPayload; + deleteWebhook: DeleteWebhookPayload; + /** Likes a comment. */ + likeComment: LikeCommentPayload; + /** Likes a post. */ + likePost: LikePostPayload; + /** Publishes an existing draft as a post. */ + publishDraft: PublishDraftPayload; /** Creates a new post. */ publishPost: PublishPostPayload; - /** Reschedule a post. */ - reschedulePost?: Maybe; + recommendPublications: RecommendPublicationsPayload; + /** Removes a comment from a post. */ + removeComment: RemoveCommentPayload; + /** Removes a post. */ + removePost: RemovePostPayload; + removeRecommendation: RemoveRecommendationPayload; + /** Removes a reply from a comment. */ + removeReply: RemoveReplyPayload; + /** Reschedule a draft. */ + rescheduleDraft: RescheduleDraftPayload; + resendWebhookRequest: ResendWebhookRequestPayload; + scheduleDraft: ScheduleDraftPayload; subscribeToNewsletter: SubscribeToNewsletterPayload; /** * Update the follow state for the user that is provided via id or username. @@ -624,8 +715,19 @@ export type Mutation = { * Only available to the authenticated user. */ toggleFollowUser: ToggleFollowUserPayload; + triggerWebhookTest: TriggerWebhookTestPayload; unsubscribeFromNewsletter: UnsubscribeFromNewsletterPayload; + /** Updates a comment on a post. */ + updateComment: UpdateCommentPayload; updatePost: UpdatePostPayload; + /** Updates a reply */ + updateReply: UpdateReplyPayload; + updateWebhook: UpdateWebhookPayload; +}; + + +export type MutationAddCommentArgs = { + input: AddCommentInput; }; @@ -634,13 +736,83 @@ export type MutationAddPostToSeriesArgs = { }; +export type MutationAddReplyArgs = { + input: AddReplyInput; +}; + + +export type MutationCancelScheduledDraftArgs = { + input: CancelScheduledDraftInput; +}; + + +export type MutationCreateWebhookArgs = { + input: CreateWebhookInput; +}; + + +export type MutationDeleteWebhookArgs = { + id: Scalars['ID']['input']; +}; + + +export type MutationLikeCommentArgs = { + input: LikeCommentInput; +}; + + +export type MutationLikePostArgs = { + input: LikePostInput; +}; + + +export type MutationPublishDraftArgs = { + input: PublishDraftInput; +}; + + export type MutationPublishPostArgs = { input: PublishPostInput; }; -export type MutationReschedulePostArgs = { - input: ReschedulePostInput; +export type MutationRecommendPublicationsArgs = { + input: RecommendPublicationsInput; +}; + + +export type MutationRemoveCommentArgs = { + input: RemoveCommentInput; +}; + + +export type MutationRemovePostArgs = { + input: RemovePostInput; +}; + + +export type MutationRemoveRecommendationArgs = { + input: RemoveRecommendationInput; +}; + + +export type MutationRemoveReplyArgs = { + input: RemoveReplyInput; +}; + + +export type MutationRescheduleDraftArgs = { + input: RescheduleDraftInput; +}; + + +export type MutationResendWebhookRequestArgs = { + input: ResendWebhookRequestInput; +}; + + +export type MutationScheduleDraftArgs = { + input: ScheduleDraftInput; }; @@ -655,15 +827,35 @@ export type MutationToggleFollowUserArgs = { }; +export type MutationTriggerWebhookTestArgs = { + input: TriggerWebhookTestInput; +}; + + export type MutationUnsubscribeFromNewsletterArgs = { input: UnsubscribeFromNewsletterInput; }; +export type MutationUpdateCommentArgs = { + input: UpdateCommentInput; +}; + + export type MutationUpdatePostArgs = { input: UpdatePostInput; }; + +export type MutationUpdateReplyArgs = { + input: UpdateReplyInput; +}; + + +export type MutationUpdateWebhookArgs = { + input: UpdateWebhookInput; +}; + /** * Basic information about the authenticated user. * User must be authenticated to use this type. @@ -1447,6 +1639,8 @@ export type PublicationIntegrations = { fathomSiteID?: Maybe; /** FB Pixel ID for integration with Facebook Pixel. */ fbPixelID?: Maybe; + /** Google Tag Manager ID for integration with Google Tag Manager. */ + gTagManagerID?: Maybe; /** Google Analytics Tracking ID for integration with Google Analytics. */ gaTrackingID?: Maybe; /** Hotjar Site ID for integration with Hotjar. */ @@ -1591,6 +1785,17 @@ export type PublicationUserRecommendingPublicationConnection = PageConnection & totalDocuments: Scalars['Int']['output']; }; +export type PublishDraftInput = { + /** The id of the draft that should be published */ + draftId: Scalars['ObjectId']['input']; +}; + +export type PublishDraftPayload = { + __typename?: 'PublishDraftPayload'; + /** The newly created post based on the draft */ + post?: Maybe; +}; + /** Contains information about the post to be published. */ export type PublishPostInput = { /** Ids of the co-authors of the post. */ @@ -1682,6 +1887,8 @@ export type Query = { feed: FeedPostConnection; /** Returns the current authenticated user. Only available to the authenticated user. */ me: MyUser; + /** Returns post by ID. Can be used to render post page on blog. */ + post?: Maybe; /** * Returns the publication with the given ID or host. * User can pass anyone of them. @@ -1712,6 +1919,11 @@ export type QueryFeedArgs = { }; +export type QueryPostArgs = { + id: Scalars['ID']['input']; +}; + + export type QueryPublicationArgs = { host?: InputMaybe; id?: InputMaybe; @@ -1763,6 +1975,16 @@ export type ReadTimeFeature = Feature & { isEnabled: Scalars['Boolean']['output']; }; +export type RecommendPublicationsInput = { + recommendedPublicationIds: Array; + recommendingPublicationId: Scalars['ID']['input']; +}; + +export type RecommendPublicationsPayload = { + __typename?: 'RecommendPublicationsPayload'; + recommendedPublications?: Maybe>; +}; + /** Contains a publication and a cursor for pagination. */ export type RecommendedPublicationEdge = Edge & { __typename?: 'RecommendedPublicationEdge'; @@ -1782,6 +2004,46 @@ export type RedirectionRule = { type: HttpRedirectionType; }; +export type RemoveCommentInput = { + id: Scalars['ID']['input']; +}; + +export type RemoveCommentPayload = { + __typename?: 'RemoveCommentPayload'; + comment?: Maybe; +}; + +export type RemovePostInput = { + /** The ID of the post to remove. */ + id: Scalars['ID']['input']; +}; + +export type RemovePostPayload = { + __typename?: 'RemovePostPayload'; + /** The deleted post. */ + post?: Maybe; +}; + +export type RemoveRecommendationInput = { + recommendedPublicationId: Scalars['ID']['input']; + recommendingPublicationId: Scalars['ID']['input']; +}; + +export type RemoveRecommendationPayload = { + __typename?: 'RemoveRecommendationPayload'; + recommendedPublication: Publication; +}; + +export type RemoveReplyInput = { + commentId: Scalars['ID']['input']; + replyId: Scalars['ID']['input']; +}; + +export type RemoveReplyPayload = { + __typename?: 'RemoveReplyPayload'; + reply?: Maybe; +}; + /** * Contains basic information about the reply. * A reply is a response to a comment. @@ -1807,11 +2069,27 @@ export type Reply = Node & { totalReactions: Scalars['Int']['output']; }; -export type ReschedulePostInput = { - /** The Draft ID of the scheduled post. */ - draftId: Scalars['ObjectId']['input']; - /** New scheduled date for the post to be rescheduled. */ - scheduledDate: Scalars['DateTime']['input']; +export type RescheduleDraftInput = { + /** The Draft ID of the scheduled draft. */ + draftId: Scalars['ID']['input']; + /** New scheduled date for the draft to be rescheduled. */ + publishAt: Scalars['DateTime']['input']; +}; + +export type RescheduleDraftPayload = { + __typename?: 'RescheduleDraftPayload'; + /** Payload returned in response of reschedulePost mutation. */ + scheduledPost: ScheduledPost; +}; + +export type ResendWebhookRequestInput = { + webhookId: Scalars['ID']['input']; + webhookMessageId: Scalars['ID']['input']; +}; + +export type ResendWebhookRequestPayload = { + __typename?: 'ResendWebhookRequestPayload'; + webhookMessage?: Maybe; }; /** Information to help in seo related meta tags. */ @@ -1823,6 +2101,21 @@ export type Seo = { title?: Maybe; }; +export type ScheduleDraftInput = { + /** The Author ID of the draft that should be published */ + authorId: Scalars['ID']['input']; + /** The id of the draft that should be published */ + draftId: Scalars['ID']['input']; + /** The date the draft should be published */ + publishAt: Scalars['DateTime']['input']; +}; + +export type ScheduleDraftPayload = { + __typename?: 'ScheduleDraftPayload'; + /** Payload returned in response of reschedulePost mutation. */ + scheduledPost: ScheduledPost; +}; + /** * Contains basic information about the scheduled post. * A scheduled post is a post that is scheduled to be published in the future. @@ -1843,12 +2136,6 @@ export type ScheduledPost = Node & { scheduledDate: Scalars['DateTime']['output']; }; -export type ScheduledPostPayload = { - __typename?: 'ScheduledPostPayload'; - /** Payload returned in response of reschedulePost mutation. */ - payload: ScheduledPost; -}; - /** Enum of all the scopes that can be used with the @requireAuth directive. */ export enum Scope { AcknowledgeEmailImport = 'acknowledge_email_import', @@ -1866,6 +2153,7 @@ export enum Scope { RemoveComment = 'remove_comment', RemoveReply = 'remove_reply', Signup = 'signup', + TeamHashnode = 'team_hashnode', UpdateComment = 'update_comment', UpdatePost = 'update_post', UpdateReply = 'update_reply', @@ -2159,6 +2447,15 @@ export type ToggleFollowUserPayload = { user?: Maybe; }; +export type TriggerWebhookTestInput = { + webhookId: Scalars['ID']['input']; +}; + +export type TriggerWebhookTestPayload = { + __typename?: 'TriggerWebhookTestPayload'; + webhook?: Maybe; +}; + export type UnsubscribeFromNewsletterInput = { /** The email that is currently subscribed. */ email: Scalars['String']['input']; @@ -2171,6 +2468,16 @@ export type UnsubscribeFromNewsletterPayload = { status?: Maybe; }; +export type UpdateCommentInput = { + contentMarkdown: Scalars['String']['input']; + id: Scalars['ID']['input']; +}; + +export type UpdateCommentPayload = { + __typename?: 'UpdateCommentPayload'; + comment?: Maybe; +}; + export type UpdatePostInput = { /** * Update co-authors of the post. @@ -2229,6 +2536,29 @@ export type UpdatePostSettingsInput = { pinToBlog?: InputMaybe; }; +export type UpdateReplyInput = { + commentId: Scalars['ID']['input']; + contentMarkdown: Scalars['String']['input']; + replyId: Scalars['ID']['input']; +}; + +export type UpdateReplyPayload = { + __typename?: 'UpdateReplyPayload'; + reply?: Maybe; +}; + +export type UpdateWebhookInput = { + events?: InputMaybe>; + id: Scalars['ID']['input']; + secret?: InputMaybe; + url?: InputMaybe; +}; + +export type UpdateWebhookPayload = { + __typename?: 'UpdateWebhookPayload'; + webhook?: Maybe; +}; + export enum UrlPattern { /** Post URLs contain the slug (for example `my slug`) and a random id (like `1234`) , e.g. "/my-slug-1234". */ Default = 'DEFAULT', @@ -2576,6 +2906,32 @@ export type WebhookMessageResponse = { timeToFirstByteMilliseconds?: Maybe; }; +export type Widget = Node & { + __typename?: 'Widget'; + /** Content of the widget, can be a simple string or HTML */ + content: Scalars['String']['output']; + /** The date and time the widget was created. */ + createdAt: Scalars['DateTime']['output']; + /** The unique identifier of the widget */ + id: Scalars['ID']['output']; + pinSettings?: Maybe; + /** WidgetId, can be embedded as %%[widgetId] in the article */ + widgetId: Scalars['String']['output']; +}; + +export enum WidgetPinLocation { + Bottom = 'BOTTOM', + Top = 'TOP' +} + +export type WidgetPinSettings = { + __typename?: 'WidgetPinSettings'; + /** Signifies if pinning of widget on all the articles of publication is enabled or not */ + isPinned: Scalars['Boolean']['output']; + /** Describes the location of the widget on the article, can be TOP or BOTTOM */ + location: WidgetPinLocation; +}; + export type DraftFragment = { __typename?: 'Draft', id: string, title?: string | null, canonicalUrl?: string | null, subtitle?: string | null, updatedAt: string, features: { __typename?: 'DraftFeatures', tableOfContents: { __typename?: 'TableOfContentsFeature', isEnabled: boolean, items: Array<{ __typename?: 'TableOfContentsItem', id: string, level: number, parentId?: string | null, slug: string, title: string }> } }, content?: { __typename?: 'Content', markdown: string } | null, coverImage?: { __typename?: 'DraftCoverImage', url: string } | null, author: { __typename?: 'User', id: string, name: string, username: string, profilePicture?: string | null }, tags: Array<{ __typename?: 'Tag', id: string, name: string, slug: string }> }; export type PageInfoFragment = { __typename?: 'PageInfo', endCursor?: string | null, hasNextPage?: boolean | null }; diff --git a/packages/blog-starter-kit/themes/hashnode/generated/schema.graphql b/packages/blog-starter-kit/themes/hashnode/generated/schema.graphql index 3e638faf6..b3879b4ea 100644 --- a/packages/blog-starter-kit/themes/hashnode/generated/schema.graphql +++ b/packages/blog-starter-kit/themes/hashnode/generated/schema.graphql @@ -11,6 +11,15 @@ directive @private on FIELD_DEFINITION | OBJECT directive @requireAuth(scopes: [Scope!]) on FIELD_DEFINITION | OBJECT +input AddCommentInput { + contentMarkdown: String! + postId: ID! +} + +type AddCommentPayload { + comment: Comment +} + input AddPostToSeriesInput { """The ID of the post to be added to the series.""" postId: ObjectId! @@ -23,6 +32,15 @@ type AddPostToSeriesPayload { series: Series } +input AddReplyInput { + commentId: ID! + contentMarkdown: String! +} + +type AddReplyPayload { + reply: Reply +} + """ Contains the flag indicating if the audio blog feature is enabled or not. User can enable or disable the audio blog feature from the publication settings. @@ -98,6 +116,16 @@ type BetaFeature implements Node { url: String } +input CancelScheduledDraftInput { + """The Draft ID of the scheduled draft.""" + draftId: ID! +} + +type CancelScheduledDraftPayload { + """Payload returned in response of cancel scheduled post mutation.""" + scheduledPost: ScheduledPost! +} + """ Contains basic information about the comment. A comment is a response to a post. @@ -211,6 +239,17 @@ input CoverImageOptionsInput { stickCoverToBottom: Boolean } +input CreateWebhookInput { + events: [WebhookEvent!]! + publicationId: ID! + secret: String! + url: String! +} + +type CreateWebhookPayload { + webhook: Webhook +} + type CustomCSS { """Custom CSS that will be applied on the publication homepage.""" home: String @@ -250,6 +289,10 @@ A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `dat """ scalar DateTime +type DeleteWebhookPayload { + webhook: Webhook +} + """Contains the publication's domain information.""" type DomainInfo { """The domain of the publication.""" @@ -619,6 +662,24 @@ interface IUser { username: String! } +input LikeCommentInput { + commentId: ID! + likesCount: Int = 1 +} + +type LikeCommentPayload { + comment: Comment +} + +input LikePostInput { + likesCount: Int = 1 + postId: ID! +} + +type LikePostPayload { + post: Post +} + """ Contains information about meta tags of the post. Used for SEO purpose. """ @@ -632,15 +693,44 @@ input MetaTagsInput { } type Mutation { + """Adds a comment to a post.""" + addComment(input: AddCommentInput!): AddCommentPayload! """Adds a post to a series.""" addPostToSeries(input: AddPostToSeriesInput!): AddPostToSeriesPayload! + """Adds a reply to a comment.""" + addReply(input: AddReplyInput!): AddReplyPayload! + cancelScheduledDraft(input: CancelScheduledDraftInput!): CancelScheduledDraftPayload! + createWebhook(input: CreateWebhookInput!): CreateWebhookPayload! + deleteWebhook(id: ID!): DeleteWebhookPayload! + """Likes a comment.""" + likeComment(input: LikeCommentInput!): LikeCommentPayload! + """Likes a post.""" + likePost(input: LikePostInput!): LikePostPayload! + """Publishes an existing draft as a post.""" + publishDraft( + """Information about the draft to be published.""" + input: PublishDraftInput! + ): PublishDraftPayload! """Creates a new post.""" publishPost( """Information about the post to be published.""" input: PublishPostInput! ): PublishPostPayload! - """Reschedule a post.""" - reschedulePost(input: ReschedulePostInput!): ScheduledPostPayload + recommendPublications(input: RecommendPublicationsInput!): RecommendPublicationsPayload! + """Removes a comment from a post.""" + removeComment(input: RemoveCommentInput!): RemoveCommentPayload! + """Removes a post.""" + removePost(input: RemovePostInput!): RemovePostPayload! + removeRecommendation(input: RemoveRecommendationInput!): RemoveRecommendationPayload! + """Removes a reply from a comment.""" + removeReply(input: RemoveReplyInput!): RemoveReplyPayload! + """Reschedule a draft.""" + rescheduleDraft(input: RescheduleDraftInput!): RescheduleDraftPayload! + resendWebhookRequest(input: ResendWebhookRequestInput!): ResendWebhookRequestPayload! + scheduleDraft( + """Information about the draft to be published.""" + input: ScheduleDraftInput! + ): ScheduleDraftPayload! subscribeToNewsletter(input: SubscribeToNewsletterInput!): SubscribeToNewsletterPayload! """ Update the follow state for the user that is provided via id or username. @@ -649,8 +739,14 @@ type Mutation { Only available to the authenticated user. """ toggleFollowUser(id: ID, username: String): ToggleFollowUserPayload! + triggerWebhookTest(input: TriggerWebhookTestInput!): TriggerWebhookTestPayload! unsubscribeFromNewsletter(input: UnsubscribeFromNewsletterInput!): UnsubscribeFromNewsletterPayload! + """Updates a comment on a post.""" + updateComment(input: UpdateCommentInput!): UpdateCommentPayload! updatePost(input: UpdatePostInput!): UpdatePostPayload! + """Updates a reply""" + updateReply(input: UpdateReplyInput!): UpdateReplyPayload! + updateWebhook(input: UpdateWebhookInput!): UpdateWebhookPayload! } """ @@ -1430,6 +1526,8 @@ type PublicationIntegrations { fathomSiteID: String """FB Pixel ID for integration with Facebook Pixel.""" fbPixelID: String + """Google Tag Manager ID for integration with Google Tag Manager.""" + gTagManagerID: String """Google Analytics Tracking ID for integration with Google Analytics.""" gaTrackingID: String """Hotjar Site ID for integration with Hotjar.""" @@ -1573,6 +1671,16 @@ type PublicationUserRecommendingPublicationConnection implements PageConnection totalDocuments: Int! } +input PublishDraftInput { + """The id of the draft that should be published""" + draftId: ObjectId! +} + +type PublishDraftPayload { + """The newly created post based on the draft""" + post: Post +} + """Contains information about the post to be published.""" input PublishPostInput { """Ids of the co-authors of the post.""" @@ -1682,6 +1790,11 @@ type Query { Returns the current authenticated user. Only available to the authenticated user. """ me: MyUser! + """Returns post by ID. Can be used to render post page on blog.""" + post( + """The ID of the post to be returned.""" + id: ID! + ): Post """ Returns the publication with the given ID or host. User can pass anyone of them. @@ -1745,6 +1858,15 @@ type ReadTimeFeature implements Feature { isEnabled: Boolean! } +input RecommendPublicationsInput { + recommendedPublicationIds: [ID!]! + recommendingPublicationId: ID! +} + +type RecommendPublicationsPayload { + recommendedPublications: [UserRecommendedPublicationEdge!] +} + """Contains a publication and a cursor for pagination.""" type RecommendedPublicationEdge implements Edge { """A cursor for use in pagination.""" @@ -1762,6 +1884,42 @@ type RedirectionRule { type: HttpRedirectionType! } +input RemoveCommentInput { + id: ID! +} + +type RemoveCommentPayload { + comment: Comment +} + +input RemovePostInput { + """The ID of the post to remove.""" + id: ID! +} + +type RemovePostPayload { + """The deleted post.""" + post: Post +} + +input RemoveRecommendationInput { + recommendedPublicationId: ID! + recommendingPublicationId: ID! +} + +type RemoveRecommendationPayload { + recommendedPublication: Publication! +} + +input RemoveReplyInput { + commentId: ID! + replyId: ID! +} + +type RemoveReplyPayload { + reply: Reply +} + """ Contains basic information about the reply. A reply is a response to a comment. @@ -1790,11 +1948,25 @@ type Reply implements Node { totalReactions: Int! } -input ReschedulePostInput { - """The Draft ID of the scheduled post.""" - draftId: ObjectId! - """New scheduled date for the post to be rescheduled.""" - scheduledDate: DateTime! +input RescheduleDraftInput { + """The Draft ID of the scheduled draft.""" + draftId: ID! + """New scheduled date for the draft to be rescheduled.""" + publishAt: DateTime! +} + +type RescheduleDraftPayload { + """Payload returned in response of reschedulePost mutation.""" + scheduledPost: ScheduledPost! +} + +input ResendWebhookRequestInput { + webhookId: ID! + webhookMessageId: ID! +} + +type ResendWebhookRequestPayload { + webhookMessage: WebhookMessage } """Information to help in seo related meta tags.""" @@ -1805,6 +1977,20 @@ type SEO { title: String } +input ScheduleDraftInput { + """The Author ID of the draft that should be published""" + authorId: ID! + """The id of the draft that should be published""" + draftId: ID! + """The date the draft should be published""" + publishAt: DateTime! +} + +type ScheduleDraftPayload { + """Payload returned in response of reschedulePost mutation.""" + scheduledPost: ScheduledPost! +} + """ Contains basic information about the scheduled post. A scheduled post is a post that is scheduled to be published in the future. @@ -1828,11 +2014,6 @@ type ScheduledPost implements Node { scheduledDate: DateTime! } -type ScheduledPostPayload { - """Payload returned in response of reschedulePost mutation.""" - payload: ScheduledPost! -} - """ Enum of all the scopes that can be used with the @requireAuth directive. """ @@ -1852,6 +2033,7 @@ enum Scope { remove_comment remove_reply signup + team_hashnode update_comment update_post update_reply @@ -2151,6 +2333,14 @@ type ToggleFollowUserPayload { user: User } +input TriggerWebhookTestInput { + webhookId: ID! +} + +type TriggerWebhookTestPayload { + webhook: Webhook +} + input UnsubscribeFromNewsletterInput { """The email that is currently subscribed.""" email: String! @@ -2162,6 +2352,15 @@ type UnsubscribeFromNewsletterPayload { status: NewsletterUnsubscribeStatus } +input UpdateCommentInput { + contentMarkdown: String! + id: ID! +} + +type UpdateCommentPayload { + comment: Comment +} + input UpdatePostInput { """ Update co-authors of the post. @@ -2227,6 +2426,27 @@ input UpdatePostSettingsInput { pinToBlog: Boolean } +input UpdateReplyInput { + commentId: ID! + contentMarkdown: String! + replyId: ID! +} + +type UpdateReplyPayload { + reply: Reply +} + +input UpdateWebhookInput { + events: [WebhookEvent!] + id: ID! + secret: String + url: String +} + +type UpdateWebhookPayload { + webhook: Webhook +} + enum UrlPattern { """ Post URLs contain the slug (for example `my slug`) and a random id (like `1234`) , e.g. "/my-slug-1234". @@ -2585,4 +2805,32 @@ type WebhookMessageResponse { The time it took from the moment the request has been send until the first byte of the response has been received. """ timeToFirstByteMilliseconds: Int +} + +type Widget implements Node { + """Content of the widget, can be a simple string or HTML""" + content: String! + """The date and time the widget was created.""" + createdAt: DateTime! + """The unique identifier of the widget""" + id: ID! + pinSettings: WidgetPinSettings + """WidgetId, can be embedded as %%[widgetId] in the article""" + widgetId: String! +} + +enum WidgetPinLocation { + BOTTOM + TOP +} + +type WidgetPinSettings { + """ + Signifies if pinning of widget on all the articles of publication is enabled or not + """ + isPinned: Boolean! + """ + Describes the location of the widget on the article, can be TOP or BOTTOM + """ + location: WidgetPinLocation! } \ No newline at end of file diff --git a/packages/blog-starter-kit/themes/personal/generated/graphql.ts b/packages/blog-starter-kit/themes/personal/generated/graphql.ts index 3254923b9..8463b7fbc 100644 --- a/packages/blog-starter-kit/themes/personal/generated/graphql.ts +++ b/packages/blog-starter-kit/themes/personal/generated/graphql.ts @@ -17,6 +17,16 @@ export type Scalars = { ObjectId: { input: string; output: string; } }; +export type AddCommentInput = { + contentMarkdown: Scalars['String']['input']; + postId: Scalars['ID']['input']; +}; + +export type AddCommentPayload = { + __typename?: 'AddCommentPayload'; + comment?: Maybe; +}; + export type AddPostToSeriesInput = { /** The ID of the post to be added to the series. */ postId: Scalars['ObjectId']['input']; @@ -30,6 +40,16 @@ export type AddPostToSeriesPayload = { series?: Maybe; }; +export type AddReplyInput = { + commentId: Scalars['ID']['input']; + contentMarkdown: Scalars['String']['input']; +}; + +export type AddReplyPayload = { + __typename?: 'AddReplyPayload'; + reply?: Maybe; +}; + /** * Contains the flag indicating if the audio blog feature is enabled or not. * User can enable or disable the audio blog feature from the publication settings. @@ -107,6 +127,17 @@ export type BetaFeature = Node & { url?: Maybe; }; +export type CancelScheduledDraftInput = { + /** The Draft ID of the scheduled draft. */ + draftId: Scalars['ID']['input']; +}; + +export type CancelScheduledDraftPayload = { + __typename?: 'CancelScheduledDraftPayload'; + /** Payload returned in response of cancel scheduled post mutation. */ + scheduledPost: ScheduledPost; +}; + /** * Contains basic information about the comment. * A comment is a response to a post. @@ -216,6 +247,18 @@ export type CoverImageOptionsInput = { stickCoverToBottom?: InputMaybe; }; +export type CreateWebhookInput = { + events: Array; + publicationId: Scalars['ID']['input']; + secret: Scalars['String']['input']; + url: Scalars['String']['input']; +}; + +export type CreateWebhookPayload = { + __typename?: 'CreateWebhookPayload'; + webhook?: Maybe; +}; + export type CustomCss = { __typename?: 'CustomCSS'; /** Custom CSS that will be applied on the publication homepage. */ @@ -251,6 +294,11 @@ export type DarkModePreferences = { logo?: Maybe; }; +export type DeleteWebhookPayload = { + __typename?: 'DeleteWebhookPayload'; + webhook?: Maybe; +}; + /** Contains the publication's domain information. */ export type DomainInfo = { __typename?: 'DomainInfo'; @@ -598,6 +646,26 @@ export type IUserPublicationsArgs = { first: Scalars['Int']['input']; }; +export type LikeCommentInput = { + commentId: Scalars['ID']['input']; + likesCount?: InputMaybe; +}; + +export type LikeCommentPayload = { + __typename?: 'LikeCommentPayload'; + comment?: Maybe; +}; + +export type LikePostInput = { + likesCount?: InputMaybe; + postId: Scalars['ID']['input']; +}; + +export type LikePostPayload = { + __typename?: 'LikePostPayload'; + post?: Maybe; +}; + /** Contains information about meta tags of the post. Used for SEO purpose. */ export type MetaTagsInput = { /** The description of the post used in og:description for SEO. */ @@ -610,12 +678,35 @@ export type MetaTagsInput = { export type Mutation = { __typename?: 'Mutation'; + /** Adds a comment to a post. */ + addComment: AddCommentPayload; /** Adds a post to a series. */ addPostToSeries: AddPostToSeriesPayload; + /** Adds a reply to a comment. */ + addReply: AddReplyPayload; + cancelScheduledDraft: CancelScheduledDraftPayload; + createWebhook: CreateWebhookPayload; + deleteWebhook: DeleteWebhookPayload; + /** Likes a comment. */ + likeComment: LikeCommentPayload; + /** Likes a post. */ + likePost: LikePostPayload; + /** Publishes an existing draft as a post. */ + publishDraft: PublishDraftPayload; /** Creates a new post. */ publishPost: PublishPostPayload; - /** Reschedule a post. */ - reschedulePost?: Maybe; + recommendPublications: RecommendPublicationsPayload; + /** Removes a comment from a post. */ + removeComment: RemoveCommentPayload; + /** Removes a post. */ + removePost: RemovePostPayload; + removeRecommendation: RemoveRecommendationPayload; + /** Removes a reply from a comment. */ + removeReply: RemoveReplyPayload; + /** Reschedule a draft. */ + rescheduleDraft: RescheduleDraftPayload; + resendWebhookRequest: ResendWebhookRequestPayload; + scheduleDraft: ScheduleDraftPayload; subscribeToNewsletter: SubscribeToNewsletterPayload; /** * Update the follow state for the user that is provided via id or username. @@ -624,8 +715,19 @@ export type Mutation = { * Only available to the authenticated user. */ toggleFollowUser: ToggleFollowUserPayload; + triggerWebhookTest: TriggerWebhookTestPayload; unsubscribeFromNewsletter: UnsubscribeFromNewsletterPayload; + /** Updates a comment on a post. */ + updateComment: UpdateCommentPayload; updatePost: UpdatePostPayload; + /** Updates a reply */ + updateReply: UpdateReplyPayload; + updateWebhook: UpdateWebhookPayload; +}; + + +export type MutationAddCommentArgs = { + input: AddCommentInput; }; @@ -634,13 +736,83 @@ export type MutationAddPostToSeriesArgs = { }; +export type MutationAddReplyArgs = { + input: AddReplyInput; +}; + + +export type MutationCancelScheduledDraftArgs = { + input: CancelScheduledDraftInput; +}; + + +export type MutationCreateWebhookArgs = { + input: CreateWebhookInput; +}; + + +export type MutationDeleteWebhookArgs = { + id: Scalars['ID']['input']; +}; + + +export type MutationLikeCommentArgs = { + input: LikeCommentInput; +}; + + +export type MutationLikePostArgs = { + input: LikePostInput; +}; + + +export type MutationPublishDraftArgs = { + input: PublishDraftInput; +}; + + export type MutationPublishPostArgs = { input: PublishPostInput; }; -export type MutationReschedulePostArgs = { - input: ReschedulePostInput; +export type MutationRecommendPublicationsArgs = { + input: RecommendPublicationsInput; +}; + + +export type MutationRemoveCommentArgs = { + input: RemoveCommentInput; +}; + + +export type MutationRemovePostArgs = { + input: RemovePostInput; +}; + + +export type MutationRemoveRecommendationArgs = { + input: RemoveRecommendationInput; +}; + + +export type MutationRemoveReplyArgs = { + input: RemoveReplyInput; +}; + + +export type MutationRescheduleDraftArgs = { + input: RescheduleDraftInput; +}; + + +export type MutationResendWebhookRequestArgs = { + input: ResendWebhookRequestInput; +}; + + +export type MutationScheduleDraftArgs = { + input: ScheduleDraftInput; }; @@ -655,15 +827,35 @@ export type MutationToggleFollowUserArgs = { }; +export type MutationTriggerWebhookTestArgs = { + input: TriggerWebhookTestInput; +}; + + export type MutationUnsubscribeFromNewsletterArgs = { input: UnsubscribeFromNewsletterInput; }; +export type MutationUpdateCommentArgs = { + input: UpdateCommentInput; +}; + + export type MutationUpdatePostArgs = { input: UpdatePostInput; }; + +export type MutationUpdateReplyArgs = { + input: UpdateReplyInput; +}; + + +export type MutationUpdateWebhookArgs = { + input: UpdateWebhookInput; +}; + /** * Basic information about the authenticated user. * User must be authenticated to use this type. @@ -1447,6 +1639,8 @@ export type PublicationIntegrations = { fathomSiteID?: Maybe; /** FB Pixel ID for integration with Facebook Pixel. */ fbPixelID?: Maybe; + /** Google Tag Manager ID for integration with Google Tag Manager. */ + gTagManagerID?: Maybe; /** Google Analytics Tracking ID for integration with Google Analytics. */ gaTrackingID?: Maybe; /** Hotjar Site ID for integration with Hotjar. */ @@ -1591,6 +1785,17 @@ export type PublicationUserRecommendingPublicationConnection = PageConnection & totalDocuments: Scalars['Int']['output']; }; +export type PublishDraftInput = { + /** The id of the draft that should be published */ + draftId: Scalars['ObjectId']['input']; +}; + +export type PublishDraftPayload = { + __typename?: 'PublishDraftPayload'; + /** The newly created post based on the draft */ + post?: Maybe; +}; + /** Contains information about the post to be published. */ export type PublishPostInput = { /** Ids of the co-authors of the post. */ @@ -1682,6 +1887,8 @@ export type Query = { feed: FeedPostConnection; /** Returns the current authenticated user. Only available to the authenticated user. */ me: MyUser; + /** Returns post by ID. Can be used to render post page on blog. */ + post?: Maybe; /** * Returns the publication with the given ID or host. * User can pass anyone of them. @@ -1712,6 +1919,11 @@ export type QueryFeedArgs = { }; +export type QueryPostArgs = { + id: Scalars['ID']['input']; +}; + + export type QueryPublicationArgs = { host?: InputMaybe; id?: InputMaybe; @@ -1763,6 +1975,16 @@ export type ReadTimeFeature = Feature & { isEnabled: Scalars['Boolean']['output']; }; +export type RecommendPublicationsInput = { + recommendedPublicationIds: Array; + recommendingPublicationId: Scalars['ID']['input']; +}; + +export type RecommendPublicationsPayload = { + __typename?: 'RecommendPublicationsPayload'; + recommendedPublications?: Maybe>; +}; + /** Contains a publication and a cursor for pagination. */ export type RecommendedPublicationEdge = Edge & { __typename?: 'RecommendedPublicationEdge'; @@ -1782,6 +2004,46 @@ export type RedirectionRule = { type: HttpRedirectionType; }; +export type RemoveCommentInput = { + id: Scalars['ID']['input']; +}; + +export type RemoveCommentPayload = { + __typename?: 'RemoveCommentPayload'; + comment?: Maybe; +}; + +export type RemovePostInput = { + /** The ID of the post to remove. */ + id: Scalars['ID']['input']; +}; + +export type RemovePostPayload = { + __typename?: 'RemovePostPayload'; + /** The deleted post. */ + post?: Maybe; +}; + +export type RemoveRecommendationInput = { + recommendedPublicationId: Scalars['ID']['input']; + recommendingPublicationId: Scalars['ID']['input']; +}; + +export type RemoveRecommendationPayload = { + __typename?: 'RemoveRecommendationPayload'; + recommendedPublication: Publication; +}; + +export type RemoveReplyInput = { + commentId: Scalars['ID']['input']; + replyId: Scalars['ID']['input']; +}; + +export type RemoveReplyPayload = { + __typename?: 'RemoveReplyPayload'; + reply?: Maybe; +}; + /** * Contains basic information about the reply. * A reply is a response to a comment. @@ -1807,11 +2069,27 @@ export type Reply = Node & { totalReactions: Scalars['Int']['output']; }; -export type ReschedulePostInput = { - /** The Draft ID of the scheduled post. */ - draftId: Scalars['ObjectId']['input']; - /** New scheduled date for the post to be rescheduled. */ - scheduledDate: Scalars['DateTime']['input']; +export type RescheduleDraftInput = { + /** The Draft ID of the scheduled draft. */ + draftId: Scalars['ID']['input']; + /** New scheduled date for the draft to be rescheduled. */ + publishAt: Scalars['DateTime']['input']; +}; + +export type RescheduleDraftPayload = { + __typename?: 'RescheduleDraftPayload'; + /** Payload returned in response of reschedulePost mutation. */ + scheduledPost: ScheduledPost; +}; + +export type ResendWebhookRequestInput = { + webhookId: Scalars['ID']['input']; + webhookMessageId: Scalars['ID']['input']; +}; + +export type ResendWebhookRequestPayload = { + __typename?: 'ResendWebhookRequestPayload'; + webhookMessage?: Maybe; }; /** Information to help in seo related meta tags. */ @@ -1823,6 +2101,21 @@ export type Seo = { title?: Maybe; }; +export type ScheduleDraftInput = { + /** The Author ID of the draft that should be published */ + authorId: Scalars['ID']['input']; + /** The id of the draft that should be published */ + draftId: Scalars['ID']['input']; + /** The date the draft should be published */ + publishAt: Scalars['DateTime']['input']; +}; + +export type ScheduleDraftPayload = { + __typename?: 'ScheduleDraftPayload'; + /** Payload returned in response of reschedulePost mutation. */ + scheduledPost: ScheduledPost; +}; + /** * Contains basic information about the scheduled post. * A scheduled post is a post that is scheduled to be published in the future. @@ -1843,12 +2136,6 @@ export type ScheduledPost = Node & { scheduledDate: Scalars['DateTime']['output']; }; -export type ScheduledPostPayload = { - __typename?: 'ScheduledPostPayload'; - /** Payload returned in response of reschedulePost mutation. */ - payload: ScheduledPost; -}; - /** Enum of all the scopes that can be used with the @requireAuth directive. */ export enum Scope { AcknowledgeEmailImport = 'acknowledge_email_import', @@ -1866,6 +2153,7 @@ export enum Scope { RemoveComment = 'remove_comment', RemoveReply = 'remove_reply', Signup = 'signup', + TeamHashnode = 'team_hashnode', UpdateComment = 'update_comment', UpdatePost = 'update_post', UpdateReply = 'update_reply', @@ -2159,6 +2447,15 @@ export type ToggleFollowUserPayload = { user?: Maybe; }; +export type TriggerWebhookTestInput = { + webhookId: Scalars['ID']['input']; +}; + +export type TriggerWebhookTestPayload = { + __typename?: 'TriggerWebhookTestPayload'; + webhook?: Maybe; +}; + export type UnsubscribeFromNewsletterInput = { /** The email that is currently subscribed. */ email: Scalars['String']['input']; @@ -2171,6 +2468,16 @@ export type UnsubscribeFromNewsletterPayload = { status?: Maybe; }; +export type UpdateCommentInput = { + contentMarkdown: Scalars['String']['input']; + id: Scalars['ID']['input']; +}; + +export type UpdateCommentPayload = { + __typename?: 'UpdateCommentPayload'; + comment?: Maybe; +}; + export type UpdatePostInput = { /** * Update co-authors of the post. @@ -2229,6 +2536,29 @@ export type UpdatePostSettingsInput = { pinToBlog?: InputMaybe; }; +export type UpdateReplyInput = { + commentId: Scalars['ID']['input']; + contentMarkdown: Scalars['String']['input']; + replyId: Scalars['ID']['input']; +}; + +export type UpdateReplyPayload = { + __typename?: 'UpdateReplyPayload'; + reply?: Maybe; +}; + +export type UpdateWebhookInput = { + events?: InputMaybe>; + id: Scalars['ID']['input']; + secret?: InputMaybe; + url?: InputMaybe; +}; + +export type UpdateWebhookPayload = { + __typename?: 'UpdateWebhookPayload'; + webhook?: Maybe; +}; + export enum UrlPattern { /** Post URLs contain the slug (for example `my slug`) and a random id (like `1234`) , e.g. "/my-slug-1234". */ Default = 'DEFAULT', @@ -2576,6 +2906,32 @@ export type WebhookMessageResponse = { timeToFirstByteMilliseconds?: Maybe; }; +export type Widget = Node & { + __typename?: 'Widget'; + /** Content of the widget, can be a simple string or HTML */ + content: Scalars['String']['output']; + /** The date and time the widget was created. */ + createdAt: Scalars['DateTime']['output']; + /** The unique identifier of the widget */ + id: Scalars['ID']['output']; + pinSettings?: Maybe; + /** WidgetId, can be embedded as %%[widgetId] in the article */ + widgetId: Scalars['String']['output']; +}; + +export enum WidgetPinLocation { + Bottom = 'BOTTOM', + Top = 'TOP' +} + +export type WidgetPinSettings = { + __typename?: 'WidgetPinSettings'; + /** Signifies if pinning of widget on all the articles of publication is enabled or not */ + isPinned: Scalars['Boolean']['output']; + /** Describes the location of the widget on the article, can be TOP or BOTTOM */ + location: WidgetPinLocation; +}; + export type PageInfoFragment = { __typename?: 'PageInfo', endCursor?: string | null, hasNextPage?: boolean | null }; export type PostFragment = { __typename?: 'Post', id: string, title: string, url: string, publishedAt: string, slug: string, brief: string, author: { __typename?: 'User', name: string, profilePicture?: string | null }, coverImage?: { __typename?: 'PostCoverImage', url: string } | null, comments: { __typename?: 'PostCommentConnection', totalDocuments: number } }; diff --git a/packages/blog-starter-kit/themes/personal/generated/schema.graphql b/packages/blog-starter-kit/themes/personal/generated/schema.graphql index 3e638faf6..b3879b4ea 100644 --- a/packages/blog-starter-kit/themes/personal/generated/schema.graphql +++ b/packages/blog-starter-kit/themes/personal/generated/schema.graphql @@ -11,6 +11,15 @@ directive @private on FIELD_DEFINITION | OBJECT directive @requireAuth(scopes: [Scope!]) on FIELD_DEFINITION | OBJECT +input AddCommentInput { + contentMarkdown: String! + postId: ID! +} + +type AddCommentPayload { + comment: Comment +} + input AddPostToSeriesInput { """The ID of the post to be added to the series.""" postId: ObjectId! @@ -23,6 +32,15 @@ type AddPostToSeriesPayload { series: Series } +input AddReplyInput { + commentId: ID! + contentMarkdown: String! +} + +type AddReplyPayload { + reply: Reply +} + """ Contains the flag indicating if the audio blog feature is enabled or not. User can enable or disable the audio blog feature from the publication settings. @@ -98,6 +116,16 @@ type BetaFeature implements Node { url: String } +input CancelScheduledDraftInput { + """The Draft ID of the scheduled draft.""" + draftId: ID! +} + +type CancelScheduledDraftPayload { + """Payload returned in response of cancel scheduled post mutation.""" + scheduledPost: ScheduledPost! +} + """ Contains basic information about the comment. A comment is a response to a post. @@ -211,6 +239,17 @@ input CoverImageOptionsInput { stickCoverToBottom: Boolean } +input CreateWebhookInput { + events: [WebhookEvent!]! + publicationId: ID! + secret: String! + url: String! +} + +type CreateWebhookPayload { + webhook: Webhook +} + type CustomCSS { """Custom CSS that will be applied on the publication homepage.""" home: String @@ -250,6 +289,10 @@ A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `dat """ scalar DateTime +type DeleteWebhookPayload { + webhook: Webhook +} + """Contains the publication's domain information.""" type DomainInfo { """The domain of the publication.""" @@ -619,6 +662,24 @@ interface IUser { username: String! } +input LikeCommentInput { + commentId: ID! + likesCount: Int = 1 +} + +type LikeCommentPayload { + comment: Comment +} + +input LikePostInput { + likesCount: Int = 1 + postId: ID! +} + +type LikePostPayload { + post: Post +} + """ Contains information about meta tags of the post. Used for SEO purpose. """ @@ -632,15 +693,44 @@ input MetaTagsInput { } type Mutation { + """Adds a comment to a post.""" + addComment(input: AddCommentInput!): AddCommentPayload! """Adds a post to a series.""" addPostToSeries(input: AddPostToSeriesInput!): AddPostToSeriesPayload! + """Adds a reply to a comment.""" + addReply(input: AddReplyInput!): AddReplyPayload! + cancelScheduledDraft(input: CancelScheduledDraftInput!): CancelScheduledDraftPayload! + createWebhook(input: CreateWebhookInput!): CreateWebhookPayload! + deleteWebhook(id: ID!): DeleteWebhookPayload! + """Likes a comment.""" + likeComment(input: LikeCommentInput!): LikeCommentPayload! + """Likes a post.""" + likePost(input: LikePostInput!): LikePostPayload! + """Publishes an existing draft as a post.""" + publishDraft( + """Information about the draft to be published.""" + input: PublishDraftInput! + ): PublishDraftPayload! """Creates a new post.""" publishPost( """Information about the post to be published.""" input: PublishPostInput! ): PublishPostPayload! - """Reschedule a post.""" - reschedulePost(input: ReschedulePostInput!): ScheduledPostPayload + recommendPublications(input: RecommendPublicationsInput!): RecommendPublicationsPayload! + """Removes a comment from a post.""" + removeComment(input: RemoveCommentInput!): RemoveCommentPayload! + """Removes a post.""" + removePost(input: RemovePostInput!): RemovePostPayload! + removeRecommendation(input: RemoveRecommendationInput!): RemoveRecommendationPayload! + """Removes a reply from a comment.""" + removeReply(input: RemoveReplyInput!): RemoveReplyPayload! + """Reschedule a draft.""" + rescheduleDraft(input: RescheduleDraftInput!): RescheduleDraftPayload! + resendWebhookRequest(input: ResendWebhookRequestInput!): ResendWebhookRequestPayload! + scheduleDraft( + """Information about the draft to be published.""" + input: ScheduleDraftInput! + ): ScheduleDraftPayload! subscribeToNewsletter(input: SubscribeToNewsletterInput!): SubscribeToNewsletterPayload! """ Update the follow state for the user that is provided via id or username. @@ -649,8 +739,14 @@ type Mutation { Only available to the authenticated user. """ toggleFollowUser(id: ID, username: String): ToggleFollowUserPayload! + triggerWebhookTest(input: TriggerWebhookTestInput!): TriggerWebhookTestPayload! unsubscribeFromNewsletter(input: UnsubscribeFromNewsletterInput!): UnsubscribeFromNewsletterPayload! + """Updates a comment on a post.""" + updateComment(input: UpdateCommentInput!): UpdateCommentPayload! updatePost(input: UpdatePostInput!): UpdatePostPayload! + """Updates a reply""" + updateReply(input: UpdateReplyInput!): UpdateReplyPayload! + updateWebhook(input: UpdateWebhookInput!): UpdateWebhookPayload! } """ @@ -1430,6 +1526,8 @@ type PublicationIntegrations { fathomSiteID: String """FB Pixel ID for integration with Facebook Pixel.""" fbPixelID: String + """Google Tag Manager ID for integration with Google Tag Manager.""" + gTagManagerID: String """Google Analytics Tracking ID for integration with Google Analytics.""" gaTrackingID: String """Hotjar Site ID for integration with Hotjar.""" @@ -1573,6 +1671,16 @@ type PublicationUserRecommendingPublicationConnection implements PageConnection totalDocuments: Int! } +input PublishDraftInput { + """The id of the draft that should be published""" + draftId: ObjectId! +} + +type PublishDraftPayload { + """The newly created post based on the draft""" + post: Post +} + """Contains information about the post to be published.""" input PublishPostInput { """Ids of the co-authors of the post.""" @@ -1682,6 +1790,11 @@ type Query { Returns the current authenticated user. Only available to the authenticated user. """ me: MyUser! + """Returns post by ID. Can be used to render post page on blog.""" + post( + """The ID of the post to be returned.""" + id: ID! + ): Post """ Returns the publication with the given ID or host. User can pass anyone of them. @@ -1745,6 +1858,15 @@ type ReadTimeFeature implements Feature { isEnabled: Boolean! } +input RecommendPublicationsInput { + recommendedPublicationIds: [ID!]! + recommendingPublicationId: ID! +} + +type RecommendPublicationsPayload { + recommendedPublications: [UserRecommendedPublicationEdge!] +} + """Contains a publication and a cursor for pagination.""" type RecommendedPublicationEdge implements Edge { """A cursor for use in pagination.""" @@ -1762,6 +1884,42 @@ type RedirectionRule { type: HttpRedirectionType! } +input RemoveCommentInput { + id: ID! +} + +type RemoveCommentPayload { + comment: Comment +} + +input RemovePostInput { + """The ID of the post to remove.""" + id: ID! +} + +type RemovePostPayload { + """The deleted post.""" + post: Post +} + +input RemoveRecommendationInput { + recommendedPublicationId: ID! + recommendingPublicationId: ID! +} + +type RemoveRecommendationPayload { + recommendedPublication: Publication! +} + +input RemoveReplyInput { + commentId: ID! + replyId: ID! +} + +type RemoveReplyPayload { + reply: Reply +} + """ Contains basic information about the reply. A reply is a response to a comment. @@ -1790,11 +1948,25 @@ type Reply implements Node { totalReactions: Int! } -input ReschedulePostInput { - """The Draft ID of the scheduled post.""" - draftId: ObjectId! - """New scheduled date for the post to be rescheduled.""" - scheduledDate: DateTime! +input RescheduleDraftInput { + """The Draft ID of the scheduled draft.""" + draftId: ID! + """New scheduled date for the draft to be rescheduled.""" + publishAt: DateTime! +} + +type RescheduleDraftPayload { + """Payload returned in response of reschedulePost mutation.""" + scheduledPost: ScheduledPost! +} + +input ResendWebhookRequestInput { + webhookId: ID! + webhookMessageId: ID! +} + +type ResendWebhookRequestPayload { + webhookMessage: WebhookMessage } """Information to help in seo related meta tags.""" @@ -1805,6 +1977,20 @@ type SEO { title: String } +input ScheduleDraftInput { + """The Author ID of the draft that should be published""" + authorId: ID! + """The id of the draft that should be published""" + draftId: ID! + """The date the draft should be published""" + publishAt: DateTime! +} + +type ScheduleDraftPayload { + """Payload returned in response of reschedulePost mutation.""" + scheduledPost: ScheduledPost! +} + """ Contains basic information about the scheduled post. A scheduled post is a post that is scheduled to be published in the future. @@ -1828,11 +2014,6 @@ type ScheduledPost implements Node { scheduledDate: DateTime! } -type ScheduledPostPayload { - """Payload returned in response of reschedulePost mutation.""" - payload: ScheduledPost! -} - """ Enum of all the scopes that can be used with the @requireAuth directive. """ @@ -1852,6 +2033,7 @@ enum Scope { remove_comment remove_reply signup + team_hashnode update_comment update_post update_reply @@ -2151,6 +2333,14 @@ type ToggleFollowUserPayload { user: User } +input TriggerWebhookTestInput { + webhookId: ID! +} + +type TriggerWebhookTestPayload { + webhook: Webhook +} + input UnsubscribeFromNewsletterInput { """The email that is currently subscribed.""" email: String! @@ -2162,6 +2352,15 @@ type UnsubscribeFromNewsletterPayload { status: NewsletterUnsubscribeStatus } +input UpdateCommentInput { + contentMarkdown: String! + id: ID! +} + +type UpdateCommentPayload { + comment: Comment +} + input UpdatePostInput { """ Update co-authors of the post. @@ -2227,6 +2426,27 @@ input UpdatePostSettingsInput { pinToBlog: Boolean } +input UpdateReplyInput { + commentId: ID! + contentMarkdown: String! + replyId: ID! +} + +type UpdateReplyPayload { + reply: Reply +} + +input UpdateWebhookInput { + events: [WebhookEvent!] + id: ID! + secret: String + url: String +} + +type UpdateWebhookPayload { + webhook: Webhook +} + enum UrlPattern { """ Post URLs contain the slug (for example `my slug`) and a random id (like `1234`) , e.g. "/my-slug-1234". @@ -2585,4 +2805,32 @@ type WebhookMessageResponse { The time it took from the moment the request has been send until the first byte of the response has been received. """ timeToFirstByteMilliseconds: Int +} + +type Widget implements Node { + """Content of the widget, can be a simple string or HTML""" + content: String! + """The date and time the widget was created.""" + createdAt: DateTime! + """The unique identifier of the widget""" + id: ID! + pinSettings: WidgetPinSettings + """WidgetId, can be embedded as %%[widgetId] in the article""" + widgetId: String! +} + +enum WidgetPinLocation { + BOTTOM + TOP +} + +type WidgetPinSettings { + """ + Signifies if pinning of widget on all the articles of publication is enabled or not + """ + isPinned: Boolean! + """ + Describes the location of the widget on the article, can be TOP or BOTTOM + """ + location: WidgetPinLocation! } \ No newline at end of file diff --git a/packages/blog-starter-kit/themes/personal/styles/index.css b/packages/blog-starter-kit/themes/personal/styles/index.css index f06b89943..8e1f9d0a7 100644 --- a/packages/blog-starter-kit/themes/personal/styles/index.css +++ b/packages/blog-starter-kit/themes/personal/styles/index.css @@ -4,4 +4,45 @@ .hashnode-content-style{ @apply prose break-words text-slate-950 first:prose-p:mt-0 prose-img:max-w-full prose-p:leading-snug prose-a:underline hover:prose-a:bg-primary-50 dark:hover:prose-a:text-primary-500 dark:hover:prose-a:bg-neutral-800 dark:text-neutral-50 prose-blockquote:leading-snug prose-a:leading-snug prose-figure:leading-snug prose-figcaption:leading-snug prose-pre:leading-snug prose-li:leading-snug prose-ul:leading-snug prose-ol:leading-snug prose-th:leading-snug prose-td:leading-snug lg:prose-xl dark:prose-invert dark:prose-pre:bg-neutral-900 first:prose-h1:mt-0 first:prose-h2:mt-0 first:prose-h3:mt-0 first:prose-h4:mt-0 first:prose-h5:mt-0; +} + +/* Override to remove the backtick */ +.hashnode-content-style :where(code):not(:where([class~="not-prose"],[class~="not-prose"] *))::before, .hashnode-content-style :where(code):not(:where([class~="not-prose"],[class~="not-prose"] *))::after { + content: none; +} + +.prose code { + border-radius: 0.25rem; + font-weight: 400 !important; + padding: 0.25rem; + --tw-text-opacity: 1; + color: rgba(0, 0, 0, var(--tw-text-opacity)); + font-size: 80%; + background: #f0efed; +} + +.dark .prose code { + --tw-bg-opacity: 1; + background-color: rgba(36, 41, 46, var(--tw-bg-opacity)); + --tw-text-opacity: 1; + color: rgba(238, 238, 238, var(--tw-text-opacity)); +} + +.prose pre { + padding-top: 2rem !important; + padding-bottom: 2rem !important; +} + +.prose pre code { + background-color: transparent; + border-radius: 0px; + font-weight: 500 !important; + padding: 0px; + font-size: 100%; + color: #fafafa; +} + +.dark .prose pre code { + background-color: transparent; + color: #ddd; } \ No newline at end of file