From 9361231626d538ecfdd28addefb63730309098fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Lula?= Date: Sun, 17 Sep 2023 19:37:01 +0200 Subject: [PATCH 1/2] Fix weekend breaking changes on lens-api v2 --- packages/client/codegen-api.yml | 1 + .../client/src/graphql/fragments.generated.ts | 144 ++++++++++-------- packages/client/src/graphql/fragments.graphql | 77 ++++++---- .../client/src/graphql/types.generated.ts | 63 ++++---- packages/client/src/submodules/feed/Feed.ts | 47 +++--- .../submodules/feed/graphql/feed.generated.ts | 55 ------- .../src/submodules/feed/graphql/feed.graphql | 45 +++--- .../momoka/graphql/momoka.generated.ts | 101 ++++++------ .../submodules/momoka/graphql/momoka.graphql | 59 ++++--- .../submodules/nfts/graphql/nfts.generated.ts | 6 +- .../src/submodules/nfts/graphql/nfts.graphql | 4 +- .../graphql/publication.generated.ts | 8 - .../publication/graphql/publication.graphql | 4 - .../submodules/reactions/Reactions.ts | 7 +- .../reactions/graphql/reactions.generated.ts | 34 ++++- .../reactions/graphql/reactions.graphql | 16 +- 16 files changed, 357 insertions(+), 314 deletions(-) diff --git a/packages/client/codegen-api.yml b/packages/client/codegen-api.yml index c065f3d1f4..145d6361f6 100644 --- a/packages/client/codegen-api.yml +++ b/packages/client/codegen-api.yml @@ -38,6 +38,7 @@ config: NftGalleryName: string Nonce: string OnchainPublicationId: string + PoapEventId: string ProfileId: string PublicationId: string Signature: string diff --git a/packages/client/src/graphql/fragments.generated.ts b/packages/client/src/graphql/fragments.generated.ts index 0474c4fc83..74cbf62b0f 100644 --- a/packages/client/src/graphql/fragments.generated.ts +++ b/packages/client/src/graphql/fragments.generated.ts @@ -42,23 +42,33 @@ export type GaslessFragment = { enabled: boolean; relay: NetworkAddressFragment export type NetworkAddressFragment = { address: string; chainId: string }; export type ImageFragment = { - url: string; + uri: string; width: number | null; height: number | null; imageMimeType: Types.ImageMimeType | null; }; -export type VideoFragment = { url: string; videoMimeType: Types.VideoMimeType | null }; +export type VideoFragment = { uri: string; videoMimeType: Types.VideoMimeType | null }; -export type VideoSetFragment = { rawURI: string; optimized: VideoFragment | null }; +export type VideoSetFragment = { raw: VideoFragment; optimized: VideoFragment | null }; -export type EncryptableVideoSetFragment = { rawURI: string; optimized: VideoFragment | null }; +export type EncryptableVideoFragment = { mimeType: Types.VideoMimeType | null; uri: string }; -export type AudioFragment = { url: string; audioMimeType: Types.AudioMimeType | null }; +export type EncryptableVideoSetFragment = { + raw: EncryptableVideoFragment; + optimized: VideoFragment | null; +}; + +export type AudioFragment = { uri: string; audioMimeType: Types.AudioMimeType | null }; + +export type AudioSetFragment = { raw: AudioFragment; optimized: AudioFragment | null }; -export type AudioSetFragment = { rawURI: string; optimized: AudioFragment | null }; +export type EncryptableAudioFragment = { mimeType: Types.AudioMimeType | null; uri: string }; -export type EncryptableAudioSetFragment = { rawURI: string; optimized: AudioFragment | null }; +export type EncryptableAudioSetFragment = { + raw: EncryptableAudioFragment; + optimized: AudioFragment | null; +}; export type LegacyAudioItemFragment = { altTag: string | null; @@ -75,13 +85,13 @@ export type LegacyVideoItemFragment = { }; export type ProfileCoverSetFragment = { - rawURI: string; + raw: ImageFragment; optimized: ImageFragment | null; transformed: ImageFragment | null; }; export type ProfilePictureSetFragment = { - rawURI: string; + raw: ImageFragment; optimized: ImageFragment | null; transformed: ImageFragment | null; }; @@ -276,7 +286,6 @@ export type CanDecryptResponseFragment = { }; export type PublicationOperationsFragment = { - id: string; isNotInterested: boolean; hasBookmarked: boolean; hasReported: boolean; @@ -351,13 +360,20 @@ export type OrConditionFragment = { }; export type PublicationImageSetFragment = { - rawURI: string; + raw: ImageFragment; optimized: ImageFragment | null; transformed: ImageFragment | null; }; +export type EncryptableImageFragment = { + uri: string; + mimeType: Types.ImageMimeType | null; + width: number | null; + height: number | null; +}; + export type PublicationEncryptableImageSetFragment = { - rawURI: string; + raw: EncryptableImageFragment; optimized: ImageFragment | null; }; @@ -380,14 +396,12 @@ export type PublicationMetadataMediaVideoFragment = { duration: number | null; license: Types.PublicationMetadataLicenseType | null; altTag: string | null; - videoMimeType: Types.VideoMimeType; video: EncryptableVideoSetFragment; cover: PublicationEncryptableImageSetFragment | null; }; export type PublicationMetadataMediaImageFragment = { license: Types.PublicationMetadataLicenseType | null; - imageMimeType: Types.ImageMimeType; image: PublicationEncryptableImageSetFragment; }; @@ -399,7 +413,6 @@ export type PublicationMetadataMediaAudioFragment = { genre: string | null; recordLabel: string | null; lyrics: string | null; - audioMimeType: Types.AudioMimeType; audio: EncryptableAudioSetFragment; cover: PublicationEncryptableImageSetFragment | null; }; @@ -447,7 +460,6 @@ export type VideoMetadataV3Fragment = { tags: Array | null; contentWarning: Types.PublicationContentWarningType | null; hideFromFeed: boolean; - globalReach: boolean; appId: string | null; isShortVideo: boolean; optionalContent: string | null; @@ -470,7 +482,6 @@ export type ImageMetadataV3Fragment = { tags: Array | null; contentWarning: Types.PublicationContentWarningType | null; hideFromFeed: boolean; - globalReach: boolean; appId: string | null; optionalContent: string | null; optionalTitle: string | null; @@ -492,7 +503,6 @@ export type ArticleMetadataV3Fragment = { tags: Array | null; contentWarning: Types.PublicationContentWarningType | null; hideFromFeed: boolean; - globalReach: boolean; appId: string | null; content: string; optionalTitle: string | null; @@ -513,7 +523,6 @@ export type EventMetadataV3Fragment = { tags: Array | null; contentWarning: Types.PublicationContentWarningType | null; hideFromFeed: boolean; - globalReach: boolean; appId: string | null; startsAt: string; endsAt: string; @@ -537,7 +546,6 @@ export type LinkMetadataV3Fragment = { tags: Array | null; contentWarning: Types.PublicationContentWarningType | null; hideFromFeed: boolean; - globalReach: boolean; appId: string | null; optionalContent: string | null; sharingLink: string; @@ -558,7 +566,6 @@ export type EmbedMetadataV3Fragment = { tags: Array | null; contentWarning: Types.PublicationContentWarningType | null; hideFromFeed: boolean; - globalReach: boolean; appId: string | null; optionalContent: string | null; embed: string; @@ -579,7 +586,6 @@ export type CheckingInMetadataV3Fragment = { tags: Array | null; contentWarning: Types.PublicationContentWarningType | null; hideFromFeed: boolean; - globalReach: boolean; appId: string | null; optionalContent: string | null; location: string; @@ -601,7 +607,6 @@ export type TextOnlyMetadataV3Fragment = { tags: Array | null; contentWarning: Types.PublicationContentWarningType | null; hideFromFeed: boolean; - globalReach: boolean; appId: string | null; content: string; marketplace: MarketplaceMetadataFragment | null; @@ -616,7 +621,6 @@ export type ThreeDMetadataV3Fragment = { tags: Array | null; contentWarning: Types.PublicationContentWarningType | null; hideFromFeed: boolean; - globalReach: boolean; appId: string | null; optionalContent: string | null; marketplace: MarketplaceMetadataFragment | null; @@ -643,7 +647,6 @@ export type StoryMetadataV3Fragment = { tags: Array | null; contentWarning: Types.PublicationContentWarningType | null; hideFromFeed: boolean; - globalReach: boolean; appId: string | null; optionalContent: string | null; marketplace: MarketplaceMetadataFragment | null; @@ -662,7 +665,6 @@ export type TransactionMetadataV3Fragment = { tags: Array | null; contentWarning: Types.PublicationContentWarningType | null; hideFromFeed: boolean; - globalReach: boolean; appId: string | null; optionalContent: string | null; type: Types.PublicationMetadataTransactionType; @@ -685,7 +687,6 @@ export type MintMetadataV3Fragment = { tags: Array | null; contentWarning: Types.PublicationContentWarningType | null; hideFromFeed: boolean; - globalReach: boolean; appId: string | null; optionalContent: string | null; mintLink: string; @@ -706,7 +707,6 @@ export type SpaceMetadataV3Fragment = { tags: Array | null; contentWarning: Types.PublicationContentWarningType | null; hideFromFeed: boolean; - globalReach: boolean; appId: string | null; optionalContent: string | null; title: string; @@ -729,7 +729,6 @@ export type LiveStreamMetadataV3Fragment = { tags: Array | null; contentWarning: Types.PublicationContentWarningType | null; hideFromFeed: boolean; - globalReach: boolean; appId: string | null; optionalContent: string | null; startsAt: string; @@ -860,7 +859,7 @@ export type MirrorFragment = { createdAt: string; publishedOn: AppFragment | null; momoka: MomokaInfoFragment | null; - mirrorOf: CommentFragment | PostFragment | QuoteFragment; + mirrorOn: CommentFragment | PostFragment | QuoteFragment; }; export type QuoteBaseFragment = { @@ -913,7 +912,7 @@ export type QuoteBaseFragment = { }; export type QuoteFragment = { - quotedOn: CommentBaseFragment | PostFragment | QuoteBaseFragment; + quoteOn: CommentBaseFragment | PostFragment | QuoteBaseFragment; } & QuoteBaseFragment; export type Eip712TypedDataDomainFragment = { @@ -947,7 +946,7 @@ export type CreateMomokaPublicationResultFragment = { export const ImageFragmentDoc = gql` fragment Image on Image { - url + uri imageMimeType: mimeType width height @@ -955,7 +954,9 @@ export const ImageFragmentDoc = gql` `; export const ProfileCoverSetFragmentDoc = gql` fragment ProfileCoverSet on ImageSet { - rawURI + raw { + ...Image + } optimized { ...Image } @@ -967,7 +968,9 @@ export const ProfileCoverSetFragmentDoc = gql` `; export const ProfilePictureSetFragmentDoc = gql` fragment ProfilePictureSet on ImageSet { - rawURI + raw { + ...Image + } optimized { ...Image } @@ -1203,7 +1206,6 @@ export const CanDecryptResponseFragmentDoc = gql` `; export const PublicationOperationsFragmentDoc = gql` fragment PublicationOperations on PublicationOperations { - id isNotInterested hasBookmarked hasReported @@ -1229,13 +1231,15 @@ export const PublicationOperationsFragmentDoc = gql` `; export const AudioFragmentDoc = gql` fragment Audio on Audio { - url + uri audioMimeType: mimeType } `; export const AudioSetFragmentDoc = gql` fragment AudioSet on AudioSet { - rawURI + raw { + ...Audio + } optimized { ...Audio } @@ -1244,7 +1248,9 @@ export const AudioSetFragmentDoc = gql` `; export const PublicationImageSetFragmentDoc = gql` fragment PublicationImageSet on ImageSet { - rawURI + raw { + ...Image + } optimized { ...Image } @@ -1278,13 +1284,15 @@ export const LegacyImageItemFragmentDoc = gql` `; export const VideoFragmentDoc = gql` fragment Video on Video { - url + uri videoMimeType: mimeType } `; export const VideoSetFragmentDoc = gql` fragment VideoSet on VideoSet { - rawURI + raw { + ...Video + } optimized { ...Video } @@ -1542,27 +1550,46 @@ export const PublicationMetadataEncryptionStrategyFragmentDoc = gql` ${AndConditionFragmentDoc} ${OrConditionFragmentDoc} `; +export const EncryptableVideoFragmentDoc = gql` + fragment EncryptableVideo on EncryptableVideo { + mimeType + uri + } +`; export const EncryptableVideoSetFragmentDoc = gql` fragment EncryptableVideoSet on EncryptableVideoSet { - rawURI + raw { + ...EncryptableVideo + } optimized { ...Video } } + ${EncryptableVideoFragmentDoc} ${VideoFragmentDoc} `; +export const EncryptableImageFragmentDoc = gql` + fragment EncryptableImage on EncryptableImage { + uri + mimeType + width + height + } +`; export const PublicationEncryptableImageSetFragmentDoc = gql` fragment PublicationEncryptableImageSet on EncryptableImageSet { - rawURI + raw { + ...EncryptableImage + } optimized { ...Image } } + ${EncryptableImageFragmentDoc} ${ImageFragmentDoc} `; export const PublicationMetadataMediaVideoFragmentDoc = gql` fragment PublicationMetadataMediaVideo on PublicationMetadataMediaVideo { - videoMimeType: type video { ...EncryptableVideoSet } @@ -1578,7 +1605,6 @@ export const PublicationMetadataMediaVideoFragmentDoc = gql` `; export const PublicationMetadataMediaImageFragmentDoc = gql` fragment PublicationMetadataMediaImage on PublicationMetadataMediaImage { - imageMimeType: type image { ...PublicationEncryptableImageSet } @@ -1586,18 +1612,26 @@ export const PublicationMetadataMediaImageFragmentDoc = gql` } ${PublicationEncryptableImageSetFragmentDoc} `; +export const EncryptableAudioFragmentDoc = gql` + fragment EncryptableAudio on EncryptableAudio { + mimeType + uri + } +`; export const EncryptableAudioSetFragmentDoc = gql` fragment EncryptableAudioSet on EncryptableAudioSet { - rawURI + raw { + ...EncryptableAudio + } optimized { ...Audio } } + ${EncryptableAudioFragmentDoc} ${AudioFragmentDoc} `; export const PublicationMetadataMediaAudioFragmentDoc = gql` fragment PublicationMetadataMediaAudio on PublicationMetadataMediaAudio { - audioMimeType: type audio { ...EncryptableAudioSet } @@ -1623,7 +1657,6 @@ export const VideoMetadataV3FragmentDoc = gql` tags contentWarning hideFromFeed - globalReach appId marketplace { ...MarketplaceMetadata @@ -1669,7 +1702,6 @@ export const ImageMetadataV3FragmentDoc = gql` tags contentWarning hideFromFeed - globalReach appId marketplace { ...MarketplaceMetadata @@ -1714,7 +1746,6 @@ export const ArticleMetadataV3FragmentDoc = gql` tags contentWarning hideFromFeed - globalReach appId marketplace { ...MarketplaceMetadata @@ -1756,7 +1787,6 @@ export const EventMetadataV3FragmentDoc = gql` tags contentWarning hideFromFeed - globalReach appId marketplace { ...MarketplaceMetadata @@ -1804,7 +1834,6 @@ export const LinkMetadataV3FragmentDoc = gql` tags contentWarning hideFromFeed - globalReach appId marketplace { ...MarketplaceMetadata @@ -1846,7 +1875,6 @@ export const EmbedMetadataV3FragmentDoc = gql` tags contentWarning hideFromFeed - globalReach appId marketplace { ...MarketplaceMetadata @@ -1888,7 +1916,6 @@ export const CheckingInMetadataV3FragmentDoc = gql` tags contentWarning hideFromFeed - globalReach appId marketplace { ...MarketplaceMetadata @@ -1934,7 +1961,6 @@ export const TextOnlyMetadataV3FragmentDoc = gql` tags contentWarning hideFromFeed - globalReach appId marketplace { ...MarketplaceMetadata @@ -1961,7 +1987,6 @@ export const ThreeDMetadataV3FragmentDoc = gql` tags contentWarning hideFromFeed - globalReach appId marketplace { ...MarketplaceMetadata @@ -2009,7 +2034,6 @@ export const StoryMetadataV3FragmentDoc = gql` tags contentWarning hideFromFeed - globalReach appId marketplace { ...MarketplaceMetadata @@ -2050,7 +2074,6 @@ export const TransactionMetadataV3FragmentDoc = gql` tags contentWarning hideFromFeed - globalReach appId marketplace { ...MarketplaceMetadata @@ -2094,7 +2117,6 @@ export const MintMetadataV3FragmentDoc = gql` tags contentWarning hideFromFeed - globalReach appId marketplace { ...MarketplaceMetadata @@ -2136,7 +2158,6 @@ export const SpaceMetadataV3FragmentDoc = gql` tags contentWarning hideFromFeed - globalReach appId marketplace { ...MarketplaceMetadata @@ -2180,7 +2201,6 @@ export const LiveStreamMetadataV3FragmentDoc = gql` tags contentWarning hideFromFeed - globalReach appId marketplace { ...MarketplaceMetadata @@ -2940,7 +2960,7 @@ export const CommentFragmentDoc = gql` export const QuoteFragmentDoc = gql` fragment Quote on Quote { ...QuoteBase - quotedOn { + quoteOn { ... on Post { ...Post } @@ -2969,7 +2989,7 @@ export const MirrorFragmentDoc = gql` } txHash createdAt - mirrorOf { + mirrorOn { ... on Post { ...Post } diff --git a/packages/client/src/graphql/fragments.graphql b/packages/client/src/graphql/fragments.graphql index 94d87816c7..a2753e1dda 100644 --- a/packages/client/src/graphql/fragments.graphql +++ b/packages/client/src/graphql/fragments.graphql @@ -73,45 +73,63 @@ fragment NetworkAddress on NetworkAddress { # media fragment Image on Image { - url + uri imageMimeType: mimeType width height } fragment Video on Video { - url + uri videoMimeType: mimeType } fragment VideoSet on VideoSet { - rawURI + raw { + ...Video + } optimized { ...Video } } +fragment EncryptableVideo on EncryptableVideo { + mimeType + uri +} + fragment EncryptableVideoSet on EncryptableVideoSet { - rawURI + raw { + ...EncryptableVideo + } optimized { ...Video } } fragment Audio on Audio { - url + uri audioMimeType: mimeType } fragment AudioSet on AudioSet { - rawURI + raw { + ...Audio + } optimized { ...Audio } } +fragment EncryptableAudio on EncryptableAudio { + mimeType + uri +} + fragment EncryptableAudioSet on EncryptableAudioSet { - rawURI + raw { + ...EncryptableAudio + } optimized { ...Audio } @@ -146,7 +164,9 @@ fragment LegacyVideoItem on LegacyVideoItem { # profile fragment ProfileCoverSet on ImageSet { - rawURI + raw { + ...Image + } optimized { ...Image } @@ -156,7 +176,9 @@ fragment ProfileCoverSet on ImageSet { } fragment ProfilePictureSet on ImageSet { - rawURI + raw { + ...Image + } optimized { ...Image } @@ -471,7 +493,6 @@ fragment CanDecryptResponse on CanDecryptResponse { } fragment PublicationOperations on PublicationOperations { - id isNotInterested hasBookmarked hasReported @@ -603,7 +624,9 @@ fragment OrCondition on OrCondition { # publication metadata fragment PublicationImageSet on ImageSet { - rawURI + raw { + ...Image + } optimized { ...Image } @@ -612,8 +635,17 @@ fragment PublicationImageSet on ImageSet { } } +fragment EncryptableImage on EncryptableImage { + uri + mimeType + width + height +} + fragment PublicationEncryptableImageSet on EncryptableImageSet { - rawURI + raw { + ...EncryptableImage + } optimized { ...Image } @@ -639,7 +671,6 @@ fragment MarketplaceMetadata on MarketplaceMetadata { } fragment PublicationMetadataMediaVideo on PublicationMetadataMediaVideo { - videoMimeType: type video { ...EncryptableVideoSet } @@ -652,7 +683,6 @@ fragment PublicationMetadataMediaVideo on PublicationMetadataMediaVideo { } fragment PublicationMetadataMediaImage on PublicationMetadataMediaImage { - imageMimeType: type image { ...PublicationEncryptableImageSet } @@ -660,7 +690,6 @@ fragment PublicationMetadataMediaImage on PublicationMetadataMediaImage { } fragment PublicationMetadataMediaAudio on PublicationMetadataMediaAudio { - audioMimeType: type audio { ...EncryptableAudioSet } @@ -746,7 +775,6 @@ fragment VideoMetadataV3 on VideoMetadataV3 { tags contentWarning hideFromFeed - globalReach appId marketplace { ...MarketplaceMetadata @@ -786,7 +814,6 @@ fragment ImageMetadataV3 on ImageMetadataV3 { tags contentWarning hideFromFeed - globalReach appId marketplace { ...MarketplaceMetadata @@ -825,7 +852,6 @@ fragment ArticleMetadataV3 on ArticleMetadataV3 { tags contentWarning hideFromFeed - globalReach appId marketplace { ...MarketplaceMetadata @@ -861,7 +887,6 @@ fragment EventMetadataV3 on EventMetadataV3 { tags contentWarning hideFromFeed - globalReach appId marketplace { ...MarketplaceMetadata @@ -903,7 +928,6 @@ fragment LinkMetadataV3 on LinkMetadataV3 { tags contentWarning hideFromFeed - globalReach appId marketplace { ...MarketplaceMetadata @@ -939,7 +963,6 @@ fragment EmbedMetadataV3 on EmbedMetadataV3 { tags contentWarning hideFromFeed - globalReach appId marketplace { ...MarketplaceMetadata @@ -975,7 +998,6 @@ fragment CheckingInMetadataV3 on CheckingInMetadataV3 { tags contentWarning hideFromFeed - globalReach appId marketplace { ...MarketplaceMetadata @@ -1015,7 +1037,6 @@ fragment TextOnlyMetadataV3 on TextOnlyMetadataV3 { tags contentWarning hideFromFeed - globalReach appId marketplace { ...MarketplaceMetadata @@ -1039,7 +1060,6 @@ fragment ThreeDMetadataV3 on ThreeDMetadataV3 { tags contentWarning hideFromFeed - globalReach appId marketplace { ...MarketplaceMetadata @@ -1081,7 +1101,6 @@ fragment StoryMetadataV3 on StoryMetadataV3 { tags contentWarning hideFromFeed - globalReach appId marketplace { ...MarketplaceMetadata @@ -1116,7 +1135,6 @@ fragment TransactionMetadataV3 on TransactionMetadataV3 { tags contentWarning hideFromFeed - globalReach appId marketplace { ...MarketplaceMetadata @@ -1154,7 +1172,6 @@ fragment MintMetadataV3 on MintMetadataV3 { tags contentWarning hideFromFeed - globalReach appId marketplace { ...MarketplaceMetadata @@ -1190,7 +1207,6 @@ fragment SpaceMetadataV3 on SpaceMetadataV3 { tags contentWarning hideFromFeed - globalReach appId marketplace { ...MarketplaceMetadata @@ -1228,7 +1244,6 @@ fragment LiveStreamMetadataV3 on LiveStreamMetadataV3 { tags contentWarning hideFromFeed - globalReach appId marketplace { ...MarketplaceMetadata @@ -1537,7 +1552,7 @@ fragment Mirror on Mirror { } txHash createdAt - mirrorOf { + mirrorOn { ... on Post { ...Post } @@ -1672,7 +1687,7 @@ fragment QuoteBase on Quote { fragment Quote on Quote { ...QuoteBase - quotedOn { + quoteOn { ... on Post { ...Post } diff --git a/packages/client/src/graphql/types.generated.ts b/packages/client/src/graphql/types.generated.ts index dea29d048c..d84939e35d 100644 --- a/packages/client/src/graphql/types.generated.ts +++ b/packages/client/src/graphql/types.generated.ts @@ -47,6 +47,7 @@ export type Scalars = { NftGalleryName: { input: string; output: string }; Nonce: { input: string; output: string }; OnchainPublicationId: { input: string; output: string }; + PoapEventId: { input: string; output: string }; ProfileId: { input: string; output: string }; PublicationId: { input: string; output: string }; Signature: { input: string; output: string }; @@ -126,11 +127,11 @@ export enum AudioMimeType { Aac = 'AAC', Flac = 'FLAC', Mp3 = 'MP3', - Mp4 = 'MP4', - Ogg = 'OGG', - Vnd = 'VND', + Mp4Audio = 'MP4_AUDIO', + OggAudio = 'OGG_AUDIO', Wav = 'WAV', - Webm = 'WEBM', + WavVnd = 'WAV_VND', + WebmAudio = 'WEBM_AUDIO', } export type BlockRequest = { @@ -192,6 +193,8 @@ export enum CollectOpenActionModuleType { LegacyRevertCollectModule = 'LegacyRevertCollectModule', LegacySimpleCollectModule = 'LegacySimpleCollectModule', LegacyTimedFeeCollectModule = 'LegacyTimedFeeCollectModule', + MultirecipientFeeCollectOpenActionModule = 'MultirecipientFeeCollectOpenActionModule', + SimpleCollectOpenActionModule = 'SimpleCollectOpenActionModule', UnknownOpenActionModule = 'UnknownOpenActionModule', } @@ -298,7 +301,6 @@ export type ExplorePublicationRequest = { }; export enum ExplorePublicationType { - Comment = 'COMMENT', Post = 'POST', Quote = 'QUOTE', } @@ -489,8 +491,10 @@ export enum ImageMimeType { Jpg = 'JPG', Png = 'PNG', Svg = 'SVG', + SvgXml = 'SVG_XML', Tiff = 'TIFF', Webp = 'WEBP', + XMsBmp = 'X_MS_BMP', } export type ImageTransform = { @@ -587,7 +591,7 @@ export type MomokaCommentRequest = { }; export type MomokaMirrorRequest = { - mirrorOf: Scalars['PublicationId']['input']; + mirrorOn: Scalars['PublicationId']['input']; }; export type MomokaPostRequest = { @@ -835,6 +839,8 @@ export type OnchainCommentRequest = { }; export type OnchainMirrorRequest = { + /** You can add information like app on a mirror or tracking stuff */ + metadataURI?: InputMaybe; mirrorOn: Scalars['PublicationId']['input']; mirrorReferenceModuleData?: InputMaybe; referrers?: InputMaybe>; @@ -909,12 +915,12 @@ export type PaginatedOffsetRequest = { }; export type PoapEventQueryRequest = { - eventId: Scalars['String']['input']; + eventId: Scalars['PoapEventId']['input']; }; export type PoapHoldersQueryRequest = { cursor?: InputMaybe; - eventId: Scalars['Float']['input']; + eventId: Scalars['PoapEventId']['input']; limit?: InputMaybe; }; @@ -923,6 +929,11 @@ export enum PoapTokenLayerType { Layer2 = 'Layer2', } +export enum PopularNftCollectionsOrder { + TotalLensProfileOwners = 'TotalLensProfileOwners', + TotalOwners = 'TotalOwners', +} + /** Popular NFT collections request */ export type PopularNftCollectionsRequest = { /** The chain ids to look for NFTs on. Ethereum and Polygon are supported. If omitted, it will look on both chains by default. */ @@ -933,6 +944,8 @@ export type PopularNftCollectionsRequest = { limit?: InputMaybe; /** Include only verified collections */ onlyVerified?: InputMaybe; + /** The ordering of Nft collection owners. Defaults to Total Lens Profile owners */ + orderBy?: InputMaybe; }; export type PrfRequest = { @@ -1100,6 +1113,7 @@ export type ProfilesManagedRequest = { cursor?: InputMaybe; /** The Ethereum address for which to retrieve managed profiles */ for: Scalars['EvmAddress']['input']; + includeOwned?: InputMaybe; limit?: InputMaybe; }; @@ -1141,7 +1155,7 @@ export type PublicationBookmarksWhere = { metadata?: InputMaybe; }; -export type PublicationCommentOf = { +export type PublicationCommentOn = { commentsRankingFilter?: InputMaybe; id: Scalars['PublicationId']['input']; }; @@ -1152,14 +1166,8 @@ export enum PublicationContentWarningType { Spoiler = 'SPOILER', } -export type PublicationForYouRequest = { - cursor?: InputMaybe; - for?: InputMaybe; - limit?: InputMaybe; -}; - export type PublicationMetadataContentWarningFilter = { - oneOf?: InputMaybe>; + oneOf: Array; }; export type PublicationMetadataFilters = { @@ -1310,8 +1318,7 @@ export type PublicationSearchRequest = { export type PublicationSearchWhere = { customFilters?: InputMaybe>; - publicationTypes?: InputMaybe>; - publishedOn?: InputMaybe>; + metadata?: InputMaybe; }; export type PublicationStatsCountOpenActionArgs = { @@ -1320,7 +1327,7 @@ export type PublicationStatsCountOpenActionArgs = { export type PublicationStatsInput = { customFilters?: InputMaybe>; - forApps?: InputMaybe>; + metadata?: InputMaybe; }; export type PublicationStatsReactionArgs = { @@ -1351,7 +1358,7 @@ export type PublicationsRequest = { cursor?: InputMaybe; limit?: InputMaybe; orderBy?: InputMaybe; - where: PublicationsWhere; + where?: InputMaybe; }; export type PublicationsTagsRequest = { @@ -1366,15 +1373,15 @@ export type PublicationsTagsWhere = { }; export type PublicationsWhere = { - acted?: InputMaybe>; - commentsOf?: InputMaybe; + actedBy?: InputMaybe; + commentOn?: InputMaybe; customFilters?: InputMaybe>; from?: InputMaybe>; metadata?: InputMaybe; - mirrorOf?: InputMaybe; + mirrorOn?: InputMaybe; publicationIds?: InputMaybe>; publicationTypes?: InputMaybe>; - quoteOf?: InputMaybe; + quoteOn?: InputMaybe; withOpenActions?: InputMaybe>; }; @@ -1447,6 +1454,7 @@ export enum RelayRoleKey { LensManager_8 = 'LENS_MANAGER_8', LensManager_9 = 'LENS_MANAGER_9', LensManager_10 = 'LENS_MANAGER_10', + LensManager_11 = 'LENS_MANAGER_11', LensManager_12 = 'LENS_MANAGER_12', LensManager_13 = 'LENS_MANAGER_13', LensManager_14 = 'LENS_MANAGER_14', @@ -1603,11 +1611,12 @@ export type VerifyRequest = { }; export enum VideoMimeType { - Gtlfbin = 'GTLFBIN', - Gtlfjson = 'GTLFJSON', + Gltf = 'GLTF', + GltfBinary = 'GLTF_BINARY', M4V = 'M4V', + Mov = 'MOV', Mp4 = 'MP4', - Mpg = 'MPG', + Mpeg = 'MPEG', Ogg = 'OGG', Ogv = 'OGV', Quicktime = 'QUICKTIME', diff --git a/packages/client/src/submodules/feed/Feed.ts b/packages/client/src/submodules/feed/Feed.ts index acca89541b..1197c9b319 100644 --- a/packages/client/src/submodules/feed/Feed.ts +++ b/packages/client/src/submodules/feed/Feed.ts @@ -5,11 +5,7 @@ import type { LensConfig } from '../../consts/config'; import type { CredentialsExpiredError, NotAuthenticatedError } from '../../consts/errors'; import { FetchGraphQLClient } from '../../graphql/FetchGraphQLClient'; import type { PostFragment, QuoteFragment } from '../../graphql/fragments.generated'; -import type { - FeedHighlightsRequest, - FeedRequest, - PublicationForYouRequest, -} from '../../graphql/types.generated'; +import type { FeedHighlightsRequest, FeedRequest } from '../../graphql/types.generated'; import { buildImageTransformsFromConfig, buildPaginatedQueryResult, @@ -79,24 +75,25 @@ export class Feed { }); } - async forYou( - request: PublicationForYouRequest, - ): PromiseResult< - PaginatedResult, - CredentialsExpiredError | NotAuthenticatedError - > { - return requireAuthHeaders(this.authentication, async (headers) => { - return buildPaginatedQueryResult(async (currRequest) => { - const result = await this.sdk.ForYou( - { - request: currRequest, - ...buildImageTransformsFromConfig(this.config.mediaTransforms), - }, - headers, - ); - - return result.data.result; - }, request); - }); - } + // Not yet ready to be exposed on production + // async forYou( + // request: PublicationForYouRequest, + // ): PromiseResult< + // PaginatedResult, + // CredentialsExpiredError | NotAuthenticatedError + // > { + // return requireAuthHeaders(this.authentication, async (headers) => { + // return buildPaginatedQueryResult(async (currRequest) => { + // const result = await this.sdk.ForYou( + // { + // request: currRequest, + // ...buildImageTransformsFromConfig(this.config.mediaTransforms), + // }, + // headers, + // ); + // + // return result.data.result; + // }, request); + // }); + // } } diff --git a/packages/client/src/submodules/feed/graphql/feed.generated.ts b/packages/client/src/submodules/feed/graphql/feed.generated.ts index 0dcf43a50a..f1da35ec3b 100644 --- a/packages/client/src/submodules/feed/graphql/feed.generated.ts +++ b/packages/client/src/submodules/feed/graphql/feed.generated.ts @@ -66,19 +66,6 @@ export type FeedHighlightsQuery = { result: { items: Array; pageInfo: PaginatedResultInfoFragment }; }; -export type ForYouQueryVariables = Types.Exact<{ - request: Types.PublicationForYouRequest; - publicationImageTransform?: Types.InputMaybe; - profileCoverTransform?: Types.InputMaybe; - profilePictureTransform?: Types.InputMaybe; - publicationOperationsActedArgs?: Types.InputMaybe; - rateRequest?: Types.InputMaybe; -}>; - -export type ForYouQuery = { - result: { items: Array; pageInfo: PaginatedResultInfoFragment }; -}; - export const ReactionEventFragmentDoc = gql` fragment ReactionEvent on ReactionEvent { by { @@ -167,33 +154,6 @@ export const FeedHighlightsDocument = gql` ${QuoteFragmentDoc} ${PaginatedResultInfoFragmentDoc} `; -export const ForYouDocument = gql` - query ForYou( - $request: PublicationForYouRequest! - $publicationImageTransform: ImageTransform = {} - $profileCoverTransform: ImageTransform = {} - $profilePictureTransform: ImageTransform = {} - $publicationOperationsActedArgs: PublicationOperationsActedArgs = {} - $rateRequest: RateRequest = { for: USD } - ) { - result: forYou(request: $request) { - items { - ... on Post { - ...Post - } - ... on Quote { - ...Quote - } - } - pageInfo { - ...PaginatedResultInfo - } - } - } - ${PostFragmentDoc} - ${QuoteFragmentDoc} - ${PaginatedResultInfoFragmentDoc} -`; export type SdkFunctionWrapper = ( action: (requestHeaders?: Record) => Promise, @@ -204,7 +164,6 @@ export type SdkFunctionWrapper = ( const defaultWrapper: SdkFunctionWrapper = (action, _operationName, _operationType) => action(); const FeedDocumentString = print(FeedDocument); const FeedHighlightsDocumentString = print(FeedHighlightsDocument); -const ForYouDocumentString = print(ForYouDocument); export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper = defaultWrapper) { return { Feed( @@ -240,20 +199,6 @@ export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper = 'query', ); }, - ForYou( - variables: ForYouQueryVariables, - requestHeaders?: GraphQLClientRequestHeaders, - ): Promise<{ data: ForYouQuery; extensions?: any; headers: Dom.Headers; status: number }> { - return withWrapper( - (wrappedRequestHeaders) => - client.rawRequest(ForYouDocumentString, variables, { - ...requestHeaders, - ...wrappedRequestHeaders, - }), - 'ForYou', - 'query', - ); - }, }; } export type Sdk = ReturnType; diff --git a/packages/client/src/submodules/feed/graphql/feed.graphql b/packages/client/src/submodules/feed/graphql/feed.graphql index 27bd76ae7b..78cc21dbb3 100644 --- a/packages/client/src/submodules/feed/graphql/feed.graphql +++ b/packages/client/src/submodules/feed/graphql/feed.graphql @@ -71,25 +71,26 @@ query FeedHighlights( } } -query ForYou( - $request: PublicationForYouRequest! - $publicationImageTransform: ImageTransform = {} - $profileCoverTransform: ImageTransform = {} - $profilePictureTransform: ImageTransform = {} - $publicationOperationsActedArgs: PublicationOperationsActedArgs = {} - $rateRequest: RateRequest = { for: USD } -) { - result: forYou(request: $request) { - items { - ... on Post { - ...Post - } - ... on Quote { - ...Quote - } - } - pageInfo { - ...PaginatedResultInfo - } - } -} +# Not yet ready for production use +#query ForYou( +# $request: PublicationForYouRequest! +# $publicationImageTransform: ImageTransform = {} +# $profileCoverTransform: ImageTransform = {} +# $profilePictureTransform: ImageTransform = {} +# $publicationOperationsActedArgs: PublicationOperationsActedArgs = {} +# $rateRequest: RateRequest = { for: USD } +#) { +# result: forYou(request: $request) { +# items { +# ... on Post { +# ...Post +# } +# ... on Quote { +# ...Quote +# } +# } +# pageInfo { +# ...PaginatedResultInfo +# } +# } +#} diff --git a/packages/client/src/submodules/momoka/graphql/momoka.generated.ts b/packages/client/src/submodules/momoka/graphql/momoka.generated.ts index 7ab446a5e0..3499b0b329 100644 --- a/packages/client/src/submodules/momoka/graphql/momoka.generated.ts +++ b/packages/client/src/submodules/momoka/graphql/momoka.generated.ts @@ -1,29 +1,14 @@ // @ts-nocheck import * as Types from '../../../graphql/types.generated'; -import { - AppFragment, - ProfileFieldsFragment, - PostFragment, - QuoteFragment, - ProfileFragment, - PaginatedResultInfoFragment, - CommentFragment, - MirrorFragment, -} from '../../../graphql/fragments.generated'; +import { AppFragment, PaginatedResultInfoFragment } from '../../../graphql/fragments.generated'; import { GraphQLClient } from 'graphql-request'; import { GraphQLClientRequestHeaders } from 'graphql-request/build/cjs/types'; import { print } from 'graphql'; import gql from 'graphql-tag'; import { AppFragmentDoc, - ProfileFieldsFragmentDoc, - PostFragmentDoc, - QuoteFragmentDoc, - ProfileFragmentDoc, PaginatedResultInfoFragmentDoc, - CommentFragmentDoc, - MirrorFragmentDoc, } from '../../../graphql/fragments.generated'; export type MomokaVerificationStatusSuccessFragment = { verified: boolean }; @@ -33,9 +18,8 @@ export type MomokaPostTransactionFragment = { transactionId: string; submitter: string; createdAt: string; - publicationId: string; app: AppFragment | null; - profile: ProfileFieldsFragment; + publication: { id: string }; verificationStatus: | MomokaVerificationStatusFailureFragment | MomokaVerificationStatusSuccessFragment; @@ -45,42 +29,36 @@ export type MomokaCommentTransactionFragment = { transactionId: string; submitter: string; createdAt: string; - publicationId: string; - commentedOnProfileId: string; - commentedOnPublicationId: string; app: AppFragment | null; verificationStatus: | MomokaVerificationStatusFailureFragment | MomokaVerificationStatusSuccessFragment; - profile: ProfileFieldsFragment; + publication: { id: string }; + commentOn: { id: string } | { id: string } | { id: string }; }; export type MomokaMirrorTransactionFragment = { transactionId: string; submitter: string; createdAt: string; - publicationId: string; - mirrorOfProfileId: string; - mirrorOfPublicationId: string; app: AppFragment | null; verificationStatus: | MomokaVerificationStatusFailureFragment | MomokaVerificationStatusSuccessFragment; - profile: ProfileFieldsFragment; + publication: { id: string }; + mirrorOn: { id: string } | { id: string } | { id: string }; }; export type MomokaQuoteTransactionFragment = { transactionId: string; submitter: string; createdAt: string; - publicationId: string; - quotedOnProfileId: string; - quotedOnPublicationId: string; app: AppFragment | null; verificationStatus: | MomokaVerificationStatusFailureFragment | MomokaVerificationStatusSuccessFragment; - profile: ProfileFieldsFragment; + publication: { id: string }; + quoteOn: { id: string } | { id: string } | { id: string }; }; export type MomokaSubmitterResultFragment = { @@ -152,10 +130,9 @@ export const MomokaPostTransactionFragmentDoc = gql` app { ...App } - profile { - ...ProfileFields + publication { + id } - publicationId verificationStatus { ... on MomokaVerificationStatusSuccess { ...MomokaVerificationStatusSuccess @@ -166,7 +143,6 @@ export const MomokaPostTransactionFragmentDoc = gql` } } ${AppFragmentDoc} - ${ProfileFieldsFragmentDoc} ${MomokaVerificationStatusSuccessFragmentDoc} ${MomokaVerificationStatusFailureFragmentDoc} `; @@ -186,17 +162,24 @@ export const MomokaCommentTransactionFragmentDoc = gql` ...MomokaVerificationStatusFailure } } - profile { - ...ProfileFields + publication { + id + } + commentOn { + ... on Post { + id + } + ... on Comment { + id + } + ... on Quote { + id + } } - publicationId - commentedOnProfileId - commentedOnPublicationId } ${AppFragmentDoc} ${MomokaVerificationStatusSuccessFragmentDoc} ${MomokaVerificationStatusFailureFragmentDoc} - ${ProfileFieldsFragmentDoc} `; export const MomokaMirrorTransactionFragmentDoc = gql` fragment MomokaMirrorTransaction on MomokaMirrorTransaction { @@ -214,17 +197,24 @@ export const MomokaMirrorTransactionFragmentDoc = gql` ...MomokaVerificationStatusFailure } } - profile { - ...ProfileFields + publication { + id + } + mirrorOn { + ... on Post { + id + } + ... on Comment { + id + } + ... on Quote { + id + } } - publicationId - mirrorOfProfileId - mirrorOfPublicationId } ${AppFragmentDoc} ${MomokaVerificationStatusSuccessFragmentDoc} ${MomokaVerificationStatusFailureFragmentDoc} - ${ProfileFieldsFragmentDoc} `; export const MomokaQuoteTransactionFragmentDoc = gql` fragment MomokaQuoteTransaction on MomokaQuoteTransaction { @@ -242,17 +232,24 @@ export const MomokaQuoteTransactionFragmentDoc = gql` ...MomokaVerificationStatusFailure } } - profile { - ...ProfileFields + publication { + id + } + quoteOn { + ... on Post { + id + } + ... on Comment { + id + } + ... on Quote { + id + } } - publicationId - quotedOnProfileId - quotedOnPublicationId } ${AppFragmentDoc} ${MomokaVerificationStatusSuccessFragmentDoc} ${MomokaVerificationStatusFailureFragmentDoc} - ${ProfileFieldsFragmentDoc} `; export const MomokaSubmitterResultFragmentDoc = gql` fragment MomokaSubmitterResult on MomokaSubmitterResult { diff --git a/packages/client/src/submodules/momoka/graphql/momoka.graphql b/packages/client/src/submodules/momoka/graphql/momoka.graphql index af54dba73f..5abd695d0d 100644 --- a/packages/client/src/submodules/momoka/graphql/momoka.graphql +++ b/packages/client/src/submodules/momoka/graphql/momoka.graphql @@ -14,10 +14,9 @@ fragment MomokaPostTransaction on MomokaPostTransaction { app { ...App } - profile { - ...ProfileFields + publication { + id } - publicationId verificationStatus { ... on MomokaVerificationStatusSuccess { ...MomokaVerificationStatusSuccess @@ -43,12 +42,20 @@ fragment MomokaCommentTransaction on MomokaCommentTransaction { ...MomokaVerificationStatusFailure } } - profile { - ...ProfileFields + publication { + id + } + commentOn { + ... on Post { + id + } + ... on Comment { + id + } + ... on Quote { + id + } } - publicationId - commentedOnProfileId - commentedOnPublicationId } fragment MomokaMirrorTransaction on MomokaMirrorTransaction { @@ -66,12 +73,20 @@ fragment MomokaMirrorTransaction on MomokaMirrorTransaction { ...MomokaVerificationStatusFailure } } - profile { - ...ProfileFields + publication { + id + } + mirrorOn { + ... on Post { + id + } + ... on Comment { + id + } + ... on Quote { + id + } } - publicationId - mirrorOfProfileId - mirrorOfPublicationId } fragment MomokaQuoteTransaction on MomokaQuoteTransaction { @@ -89,12 +104,20 @@ fragment MomokaQuoteTransaction on MomokaQuoteTransaction { ...MomokaVerificationStatusFailure } } - profile { - ...ProfileFields + publication { + id + } + quoteOn { + ... on Post { + id + } + ... on Comment { + id + } + ... on Quote { + id + } } - publicationId - quotedOnProfileId - quotedOnPublicationId } fragment MomokaSubmitterResult on MomokaSubmitterResult { diff --git a/packages/client/src/submodules/nfts/graphql/nfts.generated.ts b/packages/client/src/submodules/nfts/graphql/nfts.generated.ts index 85a79db955..85f9432796 100644 --- a/packages/client/src/submodules/nfts/graphql/nfts.generated.ts +++ b/packages/client/src/submodules/nfts/graphql/nfts.generated.ts @@ -32,7 +32,7 @@ export type NftCollectionFragment = { export type NftMetadataFragment = { name: string | null; description: string | null; - image: { rawURI: string; optimized: ImageFragment | null } | null; + image: { raw: ImageFragment; optimized: ImageFragment | null } | null; }; export type NftFragment = { @@ -133,7 +133,9 @@ export const NftMetadataFragmentDoc = gql` name description image { - rawURI + raw { + ...Image + } optimized { ...Image } diff --git a/packages/client/src/submodules/nfts/graphql/nfts.graphql b/packages/client/src/submodules/nfts/graphql/nfts.graphql index 6197781b04..5c97edc8f3 100644 --- a/packages/client/src/submodules/nfts/graphql/nfts.graphql +++ b/packages/client/src/submodules/nfts/graphql/nfts.graphql @@ -17,7 +17,9 @@ fragment NftMetadata on NftMetadata { name description image { - rawURI + raw { + ...Image + } optimized { ...Image } diff --git a/packages/client/src/submodules/publication/graphql/publication.generated.ts b/packages/client/src/submodules/publication/graphql/publication.generated.ts index 8dbf3c24a1..7eb6b6746e 100644 --- a/packages/client/src/submodules/publication/graphql/publication.generated.ts +++ b/packages/client/src/submodules/publication/graphql/publication.generated.ts @@ -45,10 +45,6 @@ export type PublicationStatsFragment = { countOpenActions: number; upvoteReactions: number; downvoteReactions: number; - additionalArgs: { - forApps: Array | null; - customFilters: Array | null; - } | null; }; export type PublicationQueryVariables = Types.Exact<{ @@ -423,10 +419,6 @@ export const PublicationValidateMetadataResultFragmentDoc = gql` `; export const PublicationStatsFragmentDoc = gql` fragment PublicationStats on PublicationStats { - additionalArgs { - forApps - customFilters - } id comments mirrors diff --git a/packages/client/src/submodules/publication/graphql/publication.graphql b/packages/client/src/submodules/publication/graphql/publication.graphql index 961bf90bd2..d9f7419343 100644 --- a/packages/client/src/submodules/publication/graphql/publication.graphql +++ b/packages/client/src/submodules/publication/graphql/publication.graphql @@ -10,10 +10,6 @@ fragment PublicationValidateMetadataResult on PublicationValidateMetadataResult } fragment PublicationStats on PublicationStats { - additionalArgs { - forApps - customFilters - } id comments mirrors diff --git a/packages/client/src/submodules/publication/submodules/reactions/Reactions.ts b/packages/client/src/submodules/publication/submodules/reactions/Reactions.ts index b77b10012f..8d8f7a49d1 100644 --- a/packages/client/src/submodules/publication/submodules/reactions/Reactions.ts +++ b/packages/client/src/submodules/publication/submodules/reactions/Reactions.ts @@ -4,7 +4,6 @@ import type { Authentication } from '../../../../authentication'; import type { LensConfig } from '../../../../consts/config'; import type { CredentialsExpiredError, NotAuthenticatedError } from '../../../../consts/errors'; import { FetchGraphQLClient } from '../../../../graphql/FetchGraphQLClient'; -import { ProfileFragment } from '../../../../graphql/fragments.generated'; import type { ReactionRequest, WhoReactedPublicationRequest, @@ -16,7 +15,7 @@ import { requireAuthHeaders, sdkAuthHeaderWrapper, } from '../../../../helpers'; -import { getSdk, Sdk } from './graphql/reactions.generated'; +import { getSdk, ProfileWhoReactedResultFragment, Sdk } from './graphql/reactions.generated'; /** * React to publications off-chain. @@ -103,7 +102,9 @@ export class Reactions { * }); * ``` */ - async fetch(request: WhoReactedPublicationRequest): Promise> { + async fetch( + request: WhoReactedPublicationRequest, + ): Promise> { return buildPaginatedQueryResult(async (currRequest) => { const result = await this.sdk.WhoReactedPublication({ request: currRequest, diff --git a/packages/client/src/submodules/publication/submodules/reactions/graphql/reactions.generated.ts b/packages/client/src/submodules/publication/submodules/reactions/graphql/reactions.generated.ts index d9ec657987..a688adc5e7 100644 --- a/packages/client/src/submodules/publication/submodules/reactions/graphql/reactions.generated.ts +++ b/packages/client/src/submodules/publication/submodules/reactions/graphql/reactions.generated.ts @@ -25,6 +25,16 @@ export type RemoveReactionMutationVariables = Types.Exact<{ export type RemoveReactionMutation = { removeReaction: string | null }; +export type ProfileReactionResultFragment = { + reaction: Types.PublicationReactionType; + reactionAt: string; +}; + +export type ProfileWhoReactedResultFragment = { + profile: ProfileFragment; + reactions: Array; +}; + export type WhoReactedPublicationQueryVariables = Types.Exact<{ request: Types.WhoReactedPublicationRequest; profileCoverTransform?: Types.InputMaybe; @@ -33,9 +43,27 @@ export type WhoReactedPublicationQueryVariables = Types.Exact<{ }>; export type WhoReactedPublicationQuery = { - result: { items: Array; pageInfo: PaginatedResultInfoFragment }; + result: { items: Array; pageInfo: PaginatedResultInfoFragment }; }; +export const ProfileReactionResultFragmentDoc = gql` + fragment ProfileReactionResult on ProfileReactionResult { + reaction + reactionAt + } +`; +export const ProfileWhoReactedResultFragmentDoc = gql` + fragment ProfileWhoReactedResult on ProfileWhoReactedResult { + profile { + ...Profile + } + reactions { + ...ProfileReactionResult + } + } + ${ProfileFragmentDoc} + ${ProfileReactionResultFragmentDoc} +`; export const AddReactionDocument = gql` mutation AddReaction($request: ReactionRequest!) { addReaction(request: $request) @@ -55,14 +83,14 @@ export const WhoReactedPublicationDocument = gql` ) { result: whoReactedPublication(request: $request) { items { - ...Profile + ...ProfileWhoReactedResult } pageInfo { ...PaginatedResultInfo } } } - ${ProfileFragmentDoc} + ${ProfileWhoReactedResultFragmentDoc} ${PaginatedResultInfoFragmentDoc} `; diff --git a/packages/client/src/submodules/publication/submodules/reactions/graphql/reactions.graphql b/packages/client/src/submodules/publication/submodules/reactions/graphql/reactions.graphql index bcc98bab42..7971a0a995 100644 --- a/packages/client/src/submodules/publication/submodules/reactions/graphql/reactions.graphql +++ b/packages/client/src/submodules/publication/submodules/reactions/graphql/reactions.graphql @@ -6,6 +6,20 @@ mutation RemoveReaction($request: ReactionRequest!) { removeReaction(request: $request) } +fragment ProfileReactionResult on ProfileReactionResult { + reaction + reactionAt +} + +fragment ProfileWhoReactedResult on ProfileWhoReactedResult { + profile { + ...Profile + } + reactions { + ...ProfileReactionResult + } +} + query WhoReactedPublication( $request: WhoReactedPublicationRequest! $profileCoverTransform: ImageTransform = {} @@ -14,7 +28,7 @@ query WhoReactedPublication( ) { result: whoReactedPublication(request: $request) { items { - ...Profile + ...ProfileWhoReactedResult } pageInfo { ...PaginatedResultInfo From e2a9a8dcb3c9930e4eccd28ed1cf919e31c11c5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Lula?= Date: Sun, 17 Sep 2023 19:47:36 +0200 Subject: [PATCH 2/2] Fix `node` example --- examples/node/scripts/feed/forYou.ts | 41 ++++++++++--------- .../scripts/publication/reactions/fetch.ts | 5 ++- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/examples/node/scripts/feed/forYou.ts b/examples/node/scripts/feed/forYou.ts index 4c6416ed5e..abc7381c43 100644 --- a/examples/node/scripts/feed/forYou.ts +++ b/examples/node/scripts/feed/forYou.ts @@ -1,20 +1,21 @@ -import { LensClient, development } from '@lens-protocol/client'; - -async function main() { - const client = new LensClient({ - environment: development, - }); - - const profileId = 'PROFILE_ID'; - - const forYouFeedResult = await client.feed.forYou({ - for: profileId, - }); - - console.log(`For you feed for ${profileId}`); - forYouFeedResult.unwrap().items.map((item) => { - console.log(`For you feed item`, JSON.stringify(item)); - }); -} - -main(); +// `forYou` not yet ready to be exposed on production +// import { LensClient, development } from '@lens-protocol/client'; +// +// async function main() { +// const client = new LensClient({ +// environment: development, +// }); +// +// const profileId = 'PROFILE_ID'; +// +// const forYouFeedResult = await client.feed.forYou({ +// for: profileId, +// }); +// +// console.log(`For you feed for ${profileId}`); +// forYouFeedResult.unwrap().items.map((item) => { +// console.log(`For you feed item`, JSON.stringify(item)); +// }); +// } +// +// main(); diff --git a/examples/node/scripts/publication/reactions/fetch.ts b/examples/node/scripts/publication/reactions/fetch.ts index a5beb185fb..4f3f7bb694 100644 --- a/examples/node/scripts/publication/reactions/fetch.ts +++ b/examples/node/scripts/publication/reactions/fetch.ts @@ -13,8 +13,9 @@ async function main() { console.log( `Profiles who reacted to publication: `, profilesWhoReacted.items.map((item) => ({ - profileId: item.id, - handle: item.handle, + profileId: item.profile.id, + handle: item.profile.handle, + reactions: item.reactions, })), ); }