From 08c4f705665583918418ec76e2eb6fcd3e60c683 Mon Sep 17 00:00:00 2001 From: Cesare Naldi Date: Wed, 27 Sep 2023 22:10:11 +0200 Subject: [PATCH] Improves documentation and exported types --- package.json | 4 +- packages/client/package.json | 4 - packages/client/src/LensClient.ts | 1 + packages/client/src/context.ts | 5 + packages/client/src/environments.ts | 4 +- packages/client/src/gated/Gated.ts | 4 +- packages/client/src/gated/LensClient.ts | 2 +- packages/client/src/gated/index.ts | 193 +++ .../client/src/graphql/fragments.generated.ts | 1469 ++++++++--------- packages/client/src/graphql/fragments.graphql | 51 - packages/client/src/graphql/index.ts | 9 +- .../client/src/graphql/types.generated.ts | 9 +- packages/client/src/graphql/types.ts | 39 +- packages/client/src/index.ts | 38 +- packages/client/typedoc.json | 6 + packages/gated-content/src/environments.ts | 6 +- packages/shared-kernel/src/Result.ts | 10 + pnpm-lock.yaml | 73 +- typedoc.base.json | 13 + typedoc.json | 54 +- 20 files changed, 1045 insertions(+), 949 deletions(-) create mode 100644 packages/client/typedoc.json create mode 100644 typedoc.base.json diff --git a/package.json b/package.json index 17d2cc867e..b93ef928fe 100644 --- a/package.json +++ b/package.json @@ -21,12 +21,12 @@ }, "devDependencies": { "@changesets/cli": "^2.26.0", - "@mxssfd/typedoc-theme": "^1.0.6", + "@mxssfd/typedoc-theme": "^1.1.3", "@preconstruct/cli": "^2.3.0", "prettier": "^2.8.4", "rimraf": "^4.1.2", "turbo": "^1.8.1", - "typedoc": "^0.23.27", + "typedoc": "^0.25.1", "typescript": "^4.9.5" }, "resolutions": { diff --git a/packages/client/package.json b/packages/client/package.json index 65581d0dc0..a89a7882bf 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -93,10 +93,6 @@ ], "exports": true }, - "typedoc": { - "entryPoint": "./src/index.ts", - "tsconfig": "./tsconfig.json" - }, "peerDependencies": { "@lens-protocol/metadata": "0.1.0-alpha.29" } diff --git a/packages/client/src/LensClient.ts b/packages/client/src/LensClient.ts index 16e0cb8ce3..979ed74d2e 100644 --- a/packages/client/src/LensClient.ts +++ b/packages/client/src/LensClient.ts @@ -53,6 +53,7 @@ export type LensClientConfig = { /** * The LensClient is the main entry point for the LensClient SDK. + * * It provides access to all the different modules. * * @group LensClient diff --git a/packages/client/src/context.ts b/packages/client/src/context.ts index 83fb46bf2a..3b065253db 100644 --- a/packages/client/src/context.ts +++ b/packages/client/src/context.ts @@ -23,6 +23,11 @@ export type MediaTransformsConfig = { profileCover?: ImageTransform; }; +/** + * The LensClient context. + * + * @internal + */ export type LensContext = { environment: Environment; diff --git a/packages/client/src/environments.ts b/packages/client/src/environments.ts index d1110644ae..aa3475440f 100644 --- a/packages/client/src/environments.ts +++ b/packages/client/src/environments.ts @@ -23,12 +23,12 @@ export const production = new Environment( export const development = new Environment( 'development', - 'https://api-mumbai.lens.dev', + 'https://api-v2-mumbai.lens.dev/graphql', GatedEnvironments.development, ); export const sandbox = new Environment( 'sandbox', - 'https://api-sandbox-mumbai.lens.dev', + 'https://api-v2-mumbai.lens.dev/graphql', // same as development for now GatedEnvironments.sandbox, ); diff --git a/packages/client/src/gated/Gated.ts b/packages/client/src/gated/Gated.ts index 2dcbb18396..566daad786 100644 --- a/packages/client/src/gated/Gated.ts +++ b/packages/client/src/gated/Gated.ts @@ -9,7 +9,7 @@ import { failure, PromiseResult, success } from '@lens-protocol/shared-kernel'; import { Authentication } from '../authentication'; import { CredentialsExpiredError, NotAuthenticatedError } from '../errors'; -import { EncryptablePublicationMetadataFragment } from '../graphql'; +import { AnyEncryptablePublicationMetadataFragment } from '../graphql'; /** * Gated module. @@ -115,7 +115,7 @@ export class Gated { * } * ``` */ - async decryptPublicationMetadataFragment( + async decryptPublicationMetadataFragment( encryptedMetadata: T, ): PromiseResult { return this.authentication.requireAuthentication(async (profileId) => { diff --git a/packages/client/src/gated/LensClient.ts b/packages/client/src/gated/LensClient.ts index bb067a4be0..80f2c14416 100644 --- a/packages/client/src/gated/LensClient.ts +++ b/packages/client/src/gated/LensClient.ts @@ -30,7 +30,7 @@ export type LensClientConfig = base.LensClientConfig & { /** * Lens Protocol Client with token-gated content support. * - * @group LensClient + * It provides access to all the base {@link Base.LensClient} modules and the {@link Gated} module. * * @example * NodeJS example: diff --git a/packages/client/src/gated/index.ts b/packages/client/src/gated/index.ts index 0d68560990..1234e5c2b8 100644 --- a/packages/client/src/gated/index.ts +++ b/packages/client/src/gated/index.ts @@ -1,3 +1,196 @@ +/** + * The Gated module is a secondary entry point of the `@lens-protocol/client` package. + * It provides an alternative {@link Gated.LensClient} class that supports all the + * functionalities of the {@link Base.LensClient} plus the {@link Gated} module. + * + * The reason for this separation is that token-gated feature requires extra 3rd party dependencies + * that could potentially impact the bundle size of your application. This way the + * developer have the choice to opt-in for token-gated support only when needed. + * + * The usage is the same as the {@link Base.LensClient} class, but with the addition of + * token gated configuration {@link Gated.LensClientConfig}: `authentication`, `signer`, and `encryption`. + * + * ## Quick start + * + * Install: + * + * ```bash + * npm install zod @lens-protocol/metadata@latest @lens-protocol/client@alpha + * + * # OR + * + * yarn add zod @lens-protocol/metadata@latest @lens-protocol/client@alpha + * + * # OR + * + * pnpm add zod @lens-protocol/metadata@latest @lens-protocol/client@alpha + * ``` + * + * Typical NodeJS setup: + * ```ts + * import { Wallet } from 'ethers'; + * import { production } from '@lens-protocol/client'; + * import { LensClient } from '@lens-protocol/client/gated'; + * + * const signer = new Wallet(process.env.PRIVATE_KEY); + * + * const client = new LensClient({ + * environment: production, + * + * authentication: { + * domain: process.env.DOMAIN, + * uri: process.env.URI, + * }, + * + * signer, + * }); + * ``` + * + * Browser setup with `ethers` v6 and an EIP-1193 wallet (e.g. MetaMask): + * ```ts + * import { BrowserProvider } from 'ethers'; + * import { production } from '@lens-protocol/client'; + * import { LensClient } from '@lens-protocol/client/gated'; + * + * // wrap the EIP-1193 provider with ethers v6 BrowserProvider + * const provider = new BrowserProvider(window.ethereum); + * + * const client = new LensClient({ + * environment: production, + * + * authentication: { + * domain: window.location.hostname, + * uri: window.location.href, + * }, + * + * signer: await provider.getSigner(), + * }); + * ``` + * + * ## Encryption + * + * You can encrypt publication metadata using the {@link Gated.encryptPublicationMetadata} method. + * + * ```ts + * import { article, erc721OwnershipCondition } from '@lens-protocol/metadata'; + * + * // create metadata via '@lens-protocol/metadata' helpers + * const metadata = article({ content: '...' }); + * + * // encrypt the metadata specifying the access condition + * const result = await client.gated.encryptPublicationMetadata( + * metadata, + * erc721OwnershipCondition({ + * contract: { address: '0x...', chainId: 1 } + * }) + * ); + * + * // handle encryption errors + * if (result.isFailure()) { + * console.error(result.error); + * return; // bail out + * } + * + * // upload the encrypted metadata to your storage of choice + * const contentURI = await uploadToIPFS(result.value); + * + * // use the contentURI to create a publication + * const result = await client.publication.postOnchain({ contentURI }); + * ``` + * + * **What's happening?** + * 1) create metadata via `@lens-protocol/metadata` helpers, + * 2) encrypt it with the given access condition, + * 3) upload it to a public location (e.g. IPFS, Arweave, public S3 bucket), + * 4) use the resulting `contentURI` to create a Lens publication. + * + * ### Simple criteria + * + * Supported criteria available as helpers in the `@lens-protocol/metadata` package: + * - `collectCondition` - the collection of a given publication is required + * - `eoaOwnershipCondition` - the ownership of a given EOA is required + * - `erc20OwnershipCondition` - the ownership of a given ERC20 amount is required + * - `erc721OwnershipCondition` - the ownership of a given ERC721 token is required + * - `erc1155OwnershipCondition` - the ownership of a given ERC1155 token is required + * - `profileOwnershipCondition` - the ownership of a given profile is required + * - `followCondition` - following a given profile is required + * + * Refer to the [`@lens-protocol/metadata`](https://lens-protocol.github.io/metadata/) reference for more details. + * + * **Collect this publication** + * + * It's possible to define an access condition where one of the criteria is to collect the current publication. + * + * Because at the time of encryption the publication is not yet created, the {@link Base.Publication.predictNextOnChainPublicationId} can be + * used to predict the publication ID. + * + * ```ts + * const condition = collectCondition({ + * publicationId: await client.publication.predictNextOnChainPublicationId({ + * from: profile.id, + * }), + * thisPublication: true, // flag to indicate that the current publication is the one to collect + * }); + * ``` + * + * ### Compound criteria + * + * Multiple criteria can be combined using the `orCondition` and `andCondition` helpers. + * ```ts + * const result = await client.gated.encryptPublicationMetadata( + * metadata, + * orCondition([ + * profileOwnershipCondition({ + * profileId: profile.id, + * }), + * erc721OwnershipCondition({ + * contract: { address: '0x...', chainId: 1 } + * }) + * ]) + * ); + * ``` + * + * Supported compound criteria: + * - `andCondition` - up to 5 criteria can be combined using the AND operator (except `orCondition` and `andCondition`) + * - `orCondition` - up to 5 criteria can be combined using the OR operator (except `orCondition` and `andCondition`) + * + * ## Decryption + * + * You can decrypt publication metadata using the {@link Gated.decryptPublicationMetadataFragment} method. + * + * The method works seamlessly with publications returned by any `LensClient` method. + * + * ```ts + * import { isEncryptedPublicationMetadata } from '@lens-protocol/client/gated'; + * + * // fetch a publication, works with publications returned by any LensClient method + * const post = await client.publication.fetch({ forId: '...' }); + * + * // check if the publication metadata is encrypted + * if (isEncryptedPublicationMetadata(post.metadata)) { + * + * // decrypt the metadata + * const result = await client.gated.decryptPublicationMetadataFragment(post.metadata); + * + * // handle decryption errors + * if (result.isFailure()) { + * console.error(result.error); + * return; // bail out + * } + * + * // use the decrypted metadata + * console.log(result.value); + * } + * ``` + * + * ⚠️ In case you find yourself using this feature with publication metadata fragment not originated from the `LensClient` + * it's your responsibility to make sure the `PublicationMetadata` fragment is valid by making sure it: + * - has `__typename` defined at every level of the fragment + * - has the `encryptedWith` including ALL fields and sub-fields of the corresponding GQL node. + * + * @module Gated + */ + export * from './Gated'; export * from './LensClient'; export { isEncryptedPublicationMetadata } from '@lens-protocol/gated-content'; diff --git a/packages/client/src/graphql/fragments.generated.ts b/packages/client/src/graphql/fragments.generated.ts index d69eb60043..c4ac0be382 100644 --- a/packages/client/src/graphql/fragments.generated.ts +++ b/packages/client/src/graphql/fragments.generated.ts @@ -903,57 +903,6 @@ export type LiveStreamMetadataV3Fragment = { > | null; }; -export type PublicationMetadata_ArticleMetadataV3_Fragment = ArticleMetadataV3Fragment; - -export type PublicationMetadata_AudioMetadataV3_Fragment = AudioMetadataV3Fragment; - -export type PublicationMetadata_CheckingInMetadataV3_Fragment = CheckingInMetadataV3Fragment; - -export type PublicationMetadata_EmbedMetadataV3_Fragment = EmbedMetadataV3Fragment; - -export type PublicationMetadata_EventMetadataV3_Fragment = EventMetadataV3Fragment; - -export type PublicationMetadata_ImageMetadataV3_Fragment = ImageMetadataV3Fragment; - -export type PublicationMetadata_LegacyPublicationMetadata_Fragment = - LegacyPublicationMetadataFragment; - -export type PublicationMetadata_LinkMetadataV3_Fragment = LinkMetadataV3Fragment; - -export type PublicationMetadata_LiveStreamMetadataV3_Fragment = LiveStreamMetadataV3Fragment; - -export type PublicationMetadata_MintMetadataV3_Fragment = MintMetadataV3Fragment; - -export type PublicationMetadata_SpaceMetadataV3_Fragment = SpaceMetadataV3Fragment; - -export type PublicationMetadata_StoryMetadataV3_Fragment = StoryMetadataV3Fragment; - -export type PublicationMetadata_TextOnlyMetadataV3_Fragment = TextOnlyMetadataV3Fragment; - -export type PublicationMetadata_ThreeDMetadataV3_Fragment = ThreeDMetadataV3Fragment; - -export type PublicationMetadata_TransactionMetadataV3_Fragment = TransactionMetadataV3Fragment; - -export type PublicationMetadata_VideoMetadataV3_Fragment = VideoMetadataV3Fragment; - -export type PublicationMetadataFragment = - | PublicationMetadata_ArticleMetadataV3_Fragment - | PublicationMetadata_AudioMetadataV3_Fragment - | PublicationMetadata_CheckingInMetadataV3_Fragment - | PublicationMetadata_EmbedMetadataV3_Fragment - | PublicationMetadata_EventMetadataV3_Fragment - | PublicationMetadata_ImageMetadataV3_Fragment - | PublicationMetadata_LegacyPublicationMetadata_Fragment - | PublicationMetadata_LinkMetadataV3_Fragment - | PublicationMetadata_LiveStreamMetadataV3_Fragment - | PublicationMetadata_MintMetadataV3_Fragment - | PublicationMetadata_SpaceMetadataV3_Fragment - | PublicationMetadata_StoryMetadataV3_Fragment - | PublicationMetadata_TextOnlyMetadataV3_Fragment - | PublicationMetadata_ThreeDMetadataV3_Fragment - | PublicationMetadata_TransactionMetadataV3_Fragment - | PublicationMetadata_VideoMetadataV3_Fragment; - export type PostFragment = { __typename: 'Post'; id: string; @@ -1174,130 +1123,17 @@ export const PaginatedResultInfoFragmentDoc = gql` next } `; -export const AudioFragmentDoc = gql` - fragment Audio on Audio { - __typename - uri - mimeType - } -`; -export const AudioSetFragmentDoc = gql` - fragment AudioSet on AudioSet { - __typename - raw { - ...Audio - } - optimized { - ...Audio - } - } - ${AudioFragmentDoc} -`; -export const ImageFragmentDoc = gql` - fragment Image on Image { - __typename - uri - mimeType - width - height - } -`; -export const PublicationImageSetFragmentDoc = gql` - fragment PublicationImageSet on ImageSet { - __typename - raw { - ...Image - } - optimized { - ...Image - } - transformed(request: $publicationImageTransform) { - ...Image - } - } - ${ImageFragmentDoc} -`; -export const LegacyAudioItemFragmentDoc = gql` - fragment LegacyAudioItem on LegacyAudioItem { - __typename - audio { - ...AudioSet - } - cover { - ...PublicationImageSet - } - altTag - } - ${AudioSetFragmentDoc} - ${PublicationImageSetFragmentDoc} -`; -export const LegacyImageItemFragmentDoc = gql` - fragment LegacyImageItem on LegacyImageItem { - __typename - image { - ...PublicationImageSet - } - altTag - } - ${PublicationImageSetFragmentDoc} -`; -export const VideoFragmentDoc = gql` - fragment Video on Video { - __typename - uri - mimeType - } -`; -export const VideoSetFragmentDoc = gql` - fragment VideoSet on VideoSet { - __typename - raw { - ...Video - } - optimized { - ...Video - } - } - ${VideoFragmentDoc} -`; -export const LegacyVideoItemFragmentDoc = gql` - fragment LegacyVideoItem on LegacyVideoItem { - __typename - video { - ...VideoSet - } - cover { - ...PublicationImageSet - } - altTag - } - ${VideoSetFragmentDoc} - ${PublicationImageSetFragmentDoc} -`; -export const PublicationMarketplaceMetadataAttributeFragmentDoc = gql` - fragment PublicationMarketplaceMetadataAttribute on PublicationMarketplaceMetadataAttribute { +export const AppFragmentDoc = gql` + fragment App on App { __typename - displayType - traitType - value + id } `; -export const MarketplaceMetadataFragmentDoc = gql` - fragment MarketplaceMetadata on MarketplaceMetadata { +export const MomokaInfoFragmentDoc = gql` + fragment MomokaInfo on MomokaInfo { __typename - description - externalURL - name - attributes { - ...PublicationMarketplaceMetadataAttribute - } - image { - ...PublicationImageSet - } - animationUrl + proof } - ${PublicationMarketplaceMetadataAttributeFragmentDoc} - ${PublicationImageSetFragmentDoc} `; export const NetworkAddressFragmentDoc = gql` fragment NetworkAddress on NetworkAddress { @@ -1306,16 +1142,12 @@ export const NetworkAddressFragmentDoc = gql` chainId } `; -export const NftOwnershipConditionFragmentDoc = gql` - fragment NftOwnershipCondition on NftOwnershipCondition { +export const OptimisticStatusResultFragmentDoc = gql` + fragment OptimisticStatusResult on OptimisticStatusResult { __typename - contract { - ...NetworkAddress - } - contractType - tokenIds + value + isFinalisedOnchain } - ${NetworkAddressFragmentDoc} `; export const Erc20FragmentDoc = gql` fragment Erc20 on Erc20 { @@ -1361,411 +1193,693 @@ export const AmountFragmentDoc = gql` ${Erc20FragmentDoc} ${FiatAmountFragmentDoc} `; -export const Erc20OwnershipConditionFragmentDoc = gql` - fragment Erc20OwnershipCondition on Erc20OwnershipCondition { +export const FeeFollowModuleSettingsFragmentDoc = gql` + fragment FeeFollowModuleSettings on FeeFollowModuleSettings { __typename amount { ...Amount } - condition + contract { + ...NetworkAddress + } + recipient } ${AmountFragmentDoc} + ${NetworkAddressFragmentDoc} `; -export const EoaOwnershipConditionFragmentDoc = gql` - fragment EoaOwnershipCondition on EoaOwnershipCondition { +export const RevertFollowModuleSettingsFragmentDoc = gql` + fragment RevertFollowModuleSettings on RevertFollowModuleSettings { __typename - address + contract { + ...NetworkAddress + } } + ${NetworkAddressFragmentDoc} `; -export const ProfileOwnershipConditionFragmentDoc = gql` - fragment ProfileOwnershipCondition on ProfileOwnershipCondition { +export const UnknownFollowModuleSettingsFragmentDoc = gql` + fragment UnknownFollowModuleSettings on UnknownFollowModuleSettings { __typename - profileId + contract { + ...NetworkAddress + } + followModuleReturnData } + ${NetworkAddressFragmentDoc} `; -export const FollowConditionFragmentDoc = gql` - fragment FollowCondition on FollowCondition { +export const ImageFragmentDoc = gql` + fragment Image on Image { __typename - follow + uri + mimeType + width + height } `; -export const CollectConditionFragmentDoc = gql` - fragment CollectCondition on CollectCondition { +export const ProfilePictureSetFragmentDoc = gql` + fragment ProfilePictureSet on ImageSet { __typename - publicationId - thisPublication + raw { + ...Image + } + optimized { + ...Image + } + transformed(request: $profilePictureTransform) { + ...Image + } } + ${ImageFragmentDoc} `; -export const AndConditionFragmentDoc = gql` - fragment AndCondition on AndCondition { +export const NftImageFragmentDoc = gql` + fragment NftImage on NftImage { __typename - criteria { - ... on NftOwnershipCondition { - ...NftOwnershipCondition - } - ... on Erc20OwnershipCondition { - ...Erc20OwnershipCondition - } - ... on EoaOwnershipCondition { - ...EoaOwnershipCondition - } - ... on ProfileOwnershipCondition { - ...ProfileOwnershipCondition - } - ... on FollowCondition { - ...FollowCondition - } - ... on CollectCondition { - ...CollectCondition - } + collection { + ...NetworkAddress + } + tokenId + image { + ...ProfilePictureSet } + verified } - ${NftOwnershipConditionFragmentDoc} - ${Erc20OwnershipConditionFragmentDoc} - ${EoaOwnershipConditionFragmentDoc} - ${ProfileOwnershipConditionFragmentDoc} - ${FollowConditionFragmentDoc} - ${CollectConditionFragmentDoc} + ${NetworkAddressFragmentDoc} + ${ProfilePictureSetFragmentDoc} `; -export const OrConditionFragmentDoc = gql` - fragment OrCondition on OrCondition { +export const ProfileCoverSetFragmentDoc = gql` + fragment ProfileCoverSet on ImageSet { __typename - criteria { - ... on NftOwnershipCondition { - ...NftOwnershipCondition - } - ... on Erc20OwnershipCondition { - ...Erc20OwnershipCondition - } - ... on EoaOwnershipCondition { - ...EoaOwnershipCondition - } - ... on ProfileOwnershipCondition { - ...ProfileOwnershipCondition - } - ... on FollowCondition { - ...FollowCondition - } - ... on CollectCondition { - ...CollectCondition - } + raw { + ...Image + } + optimized { + ...Image + } + transformed(request: $profileCoverTransform) { + ...Image } } - ${NftOwnershipConditionFragmentDoc} - ${Erc20OwnershipConditionFragmentDoc} - ${EoaOwnershipConditionFragmentDoc} - ${ProfileOwnershipConditionFragmentDoc} - ${FollowConditionFragmentDoc} - ${CollectConditionFragmentDoc} + ${ImageFragmentDoc} `; -export const RootConditionFragmentDoc = gql` - fragment RootCondition on RootCondition { +export const ProfileFragmentDoc = gql` + fragment Profile on Profile { __typename - criteria { - ... on NftOwnershipCondition { - ...NftOwnershipCondition - } - ... on Erc20OwnershipCondition { - ...Erc20OwnershipCondition - } - ... on EoaOwnershipCondition { - ...EoaOwnershipCondition + id + ownedBy { + ...NetworkAddress + } + txHash + createdAt + operations { + __typename + id + isBlockedByMe { + ...OptimisticStatusResult } - ... on ProfileOwnershipCondition { - ...ProfileOwnershipCondition + isFollowedByMe { + ...OptimisticStatusResult } - ... on FollowCondition { - ...FollowCondition + isFollowingMe { + ...OptimisticStatusResult } - ... on CollectCondition { - ...CollectCondition + canBlock + canUnblock + canFollow + canUnfollow + } + interests + guardian { + protected + cooldownEndsOn + } + invitesLeft + onchainIdentity { + proofOfHumanity + ens { + name } - ... on AndCondition { - ...AndCondition + sybilDotOrg { + source { + twitter { + handle + } + } } - ... on OrCondition { - ...OrCondition + worldcoin { + isHuman } } - } - ${NftOwnershipConditionFragmentDoc} - ${Erc20OwnershipConditionFragmentDoc} - ${EoaOwnershipConditionFragmentDoc} - ${ProfileOwnershipConditionFragmentDoc} - ${FollowConditionFragmentDoc} - ${CollectConditionFragmentDoc} - ${AndConditionFragmentDoc} - ${OrConditionFragmentDoc} -`; -export const LegacyPublicationMetadataFragmentDoc = gql` - fragment LegacyPublicationMetadata on LegacyPublicationMetadata { - __typename - content - media { - ... on LegacyAudioItem { - ...LegacyAudioItem + followNftAddress { + ...NetworkAddress + } + followModule { + ... on FeeFollowModuleSettings { + ...FeeFollowModuleSettings } - ... on LegacyImageItem { - ...LegacyImageItem + ... on RevertFollowModuleSettings { + ...RevertFollowModuleSettings } - ... on LegacyVideoItem { - ...LegacyVideoItem + ... on UnknownFollowModuleSettings { + ...UnknownFollowModuleSettings } } - locale - tags - contentWarning - mainContentFocus - marketplace { - ...MarketplaceMetadata - } - encryptedWith { - __typename - encryptionKey - encryptedFields { - __typename - content - image - media { - __typename - uri - mimeType - altTag - cover + metadata { + displayName + bio + rawURI + picture { + ... on ImageSet { + ...ProfilePictureSet + } + ... on NftImage { + ...NftImage } - animationUrl - externalUrl } - accessCondition { - ...RootCondition + coverPicture { + ...ProfileCoverSet + } + attributes { + type + key + value } } + handle + sponsor + lensManager + invitedBy { + id + } } - ${LegacyAudioItemFragmentDoc} - ${LegacyImageItemFragmentDoc} - ${LegacyVideoItemFragmentDoc} - ${MarketplaceMetadataFragmentDoc} - ${RootConditionFragmentDoc} + ${NetworkAddressFragmentDoc} + ${OptimisticStatusResultFragmentDoc} + ${FeeFollowModuleSettingsFragmentDoc} + ${RevertFollowModuleSettingsFragmentDoc} + ${UnknownFollowModuleSettingsFragmentDoc} + ${ProfilePictureSetFragmentDoc} + ${NftImageFragmentDoc} + ${ProfileCoverSetFragmentDoc} `; -export const PublicationMetadataV3AttributeFragmentDoc = gql` - fragment PublicationMetadataV3Attribute on PublicationMetadataV3Attribute { +export const KnownCollectOpenActionResultFragmentDoc = gql` + fragment KnownCollectOpenActionResult on KnownCollectOpenActionResult { __typename - key - value + type } `; -export const PublicationMetadataEncryptionStrategyFragmentDoc = gql` - fragment PublicationMetadataEncryptionStrategy on PublicationMetadataV3LitEncryption { +export const UnknownOpenActionResultFragmentDoc = gql` + fragment UnknownOpenActionResult on UnknownOpenActionResult { __typename - encryptionKey - accessCondition { - ...RootCondition + address + category + initReturnData + } +`; +export const OpenActionResultFragmentDoc = gql` + fragment OpenActionResult on OpenActionResult { + ... on KnownCollectOpenActionResult { + ...KnownCollectOpenActionResult + } + ... on UnknownOpenActionResult { + ...UnknownOpenActionResult } - encryptedPaths } - ${RootConditionFragmentDoc} + ${KnownCollectOpenActionResultFragmentDoc} + ${UnknownOpenActionResultFragmentDoc} `; -export const EncryptableAudioFragmentDoc = gql` - fragment EncryptableAudio on EncryptableAudio { +export const CanDecryptResponseFragmentDoc = gql` + fragment CanDecryptResponse on CanDecryptResponse { __typename - mimeType - uri + result + reasons + extraDetails } `; -export const EncryptableAudioSetFragmentDoc = gql` - fragment EncryptableAudioSet on EncryptableAudioSet { +export const PublicationOperationsFragmentDoc = gql` + fragment PublicationOperations on PublicationOperations { __typename - raw { - ...EncryptableAudio + isNotInterested + hasBookmarked + hasReported + canAct(request: $publicationOperationsActedArgs) + hasActed(request: $publicationOperationsActedArgs) { + ...OptimisticStatusResult } - optimized { - ...Audio + actedOn(request: $publicationOperationsActedArgs) { + ...OpenActionResult + } + hasUpvoted: hasReacted(request: { type: UPVOTE }) + hasDownvoted: hasReacted(request: { type: DOWNVOTE }) + canComment + canMirror + hasMirrored + canDecrypt { + ...CanDecryptResponse } } - ${EncryptableAudioFragmentDoc} - ${AudioFragmentDoc} + ${OptimisticStatusResultFragmentDoc} + ${OpenActionResultFragmentDoc} + ${CanDecryptResponseFragmentDoc} `; -export const EncryptableImageFragmentDoc = gql` - fragment EncryptableImage on EncryptableImage { +export const AudioFragmentDoc = gql` + fragment Audio on Audio { __typename uri mimeType - width - height } `; -export const PublicationEncryptableImageSetFragmentDoc = gql` - fragment PublicationEncryptableImageSet on EncryptableImageSet { +export const AudioSetFragmentDoc = gql` + fragment AudioSet on AudioSet { __typename raw { - ...EncryptableImage + ...Audio + } + optimized { + ...Audio + } + } + ${AudioFragmentDoc} +`; +export const PublicationImageSetFragmentDoc = gql` + fragment PublicationImageSet on ImageSet { + __typename + raw { + ...Image } optimized { ...Image } + transformed(request: $publicationImageTransform) { + ...Image + } } - ${EncryptableImageFragmentDoc} ${ImageFragmentDoc} `; -export const PublicationMetadataMediaAudioFragmentDoc = gql` - fragment PublicationMetadataMediaAudio on PublicationMetadataMediaAudio { +export const LegacyAudioItemFragmentDoc = gql` + fragment LegacyAudioItem on LegacyAudioItem { __typename audio { - ...EncryptableAudioSet + ...AudioSet } cover { - ...PublicationEncryptableImageSet + ...PublicationImageSet } - duration - license - credits - artist - genre - recordLabel - lyrics + altTag } - ${EncryptableAudioSetFragmentDoc} - ${PublicationEncryptableImageSetFragmentDoc} + ${AudioSetFragmentDoc} + ${PublicationImageSetFragmentDoc} `; -export const EncryptableVideoFragmentDoc = gql` - fragment EncryptableVideo on EncryptableVideo { +export const LegacyImageItemFragmentDoc = gql` + fragment LegacyImageItem on LegacyImageItem { + __typename + image { + ...PublicationImageSet + } + altTag + } + ${PublicationImageSetFragmentDoc} +`; +export const VideoFragmentDoc = gql` + fragment Video on Video { __typename - mimeType uri + mimeType } `; -export const EncryptableVideoSetFragmentDoc = gql` - fragment EncryptableVideoSet on EncryptableVideoSet { +export const VideoSetFragmentDoc = gql` + fragment VideoSet on VideoSet { __typename raw { - ...EncryptableVideo + ...Video } optimized { ...Video } } - ${EncryptableVideoFragmentDoc} ${VideoFragmentDoc} `; -export const PublicationMetadataMediaVideoFragmentDoc = gql` - fragment PublicationMetadataMediaVideo on PublicationMetadataMediaVideo { +export const LegacyVideoItemFragmentDoc = gql` + fragment LegacyVideoItem on LegacyVideoItem { __typename video { - ...EncryptableVideoSet + ...VideoSet } cover { - ...PublicationEncryptableImageSet + ...PublicationImageSet } - duration - license altTag } - ${EncryptableVideoSetFragmentDoc} - ${PublicationEncryptableImageSetFragmentDoc} + ${VideoSetFragmentDoc} + ${PublicationImageSetFragmentDoc} `; -export const PublicationMetadataMediaImageFragmentDoc = gql` - fragment PublicationMetadataMediaImage on PublicationMetadataMediaImage { +export const PublicationMarketplaceMetadataAttributeFragmentDoc = gql` + fragment PublicationMarketplaceMetadataAttribute on PublicationMarketplaceMetadataAttribute { + __typename + displayType + traitType + value + } +`; +export const MarketplaceMetadataFragmentDoc = gql` + fragment MarketplaceMetadata on MarketplaceMetadata { __typename + description + externalURL + name + attributes { + ...PublicationMarketplaceMetadataAttribute + } image { - ...PublicationEncryptableImageSet + ...PublicationImageSet } - license + animationUrl } - ${PublicationEncryptableImageSetFragmentDoc} + ${PublicationMarketplaceMetadataAttributeFragmentDoc} + ${PublicationImageSetFragmentDoc} `; -export const AudioMetadataV3FragmentDoc = gql` - fragment AudioMetadataV3 on AudioMetadataV3 { +export const NftOwnershipConditionFragmentDoc = gql` + fragment NftOwnershipCondition on NftOwnershipCondition { __typename - id - rawURI - locale - tags - contentWarning - hideFromFeed - appId - marketplace { - ...MarketplaceMetadata + contract { + ...NetworkAddress } - attributes { - ...PublicationMetadataV3Attribute + contractType + tokenIds + } + ${NetworkAddressFragmentDoc} +`; +export const Erc20OwnershipConditionFragmentDoc = gql` + fragment Erc20OwnershipCondition on Erc20OwnershipCondition { + __typename + amount { + ...Amount } - encryptedWith { - ... on PublicationMetadataEncryptionStrategy { - ...PublicationMetadataEncryptionStrategy + condition + } + ${AmountFragmentDoc} +`; +export const EoaOwnershipConditionFragmentDoc = gql` + fragment EoaOwnershipCondition on EoaOwnershipCondition { + __typename + address + } +`; +export const ProfileOwnershipConditionFragmentDoc = gql` + fragment ProfileOwnershipCondition on ProfileOwnershipCondition { + __typename + profileId + } +`; +export const FollowConditionFragmentDoc = gql` + fragment FollowCondition on FollowCondition { + __typename + follow + } +`; +export const CollectConditionFragmentDoc = gql` + fragment CollectCondition on CollectCondition { + __typename + publicationId + thisPublication + } +`; +export const AndConditionFragmentDoc = gql` + fragment AndCondition on AndCondition { + __typename + criteria { + ... on NftOwnershipCondition { + ...NftOwnershipCondition } - } - asset { - ...PublicationMetadataMediaAudio - } - attachments { - ... on PublicationMetadataMediaVideo { - ...PublicationMetadataMediaVideo + ... on Erc20OwnershipCondition { + ...Erc20OwnershipCondition } - ... on PublicationMetadataMediaImage { - ...PublicationMetadataMediaImage + ... on EoaOwnershipCondition { + ...EoaOwnershipCondition } - ... on PublicationMetadataMediaAudio { - ...PublicationMetadataMediaAudio + ... on ProfileOwnershipCondition { + ...ProfileOwnershipCondition + } + ... on FollowCondition { + ...FollowCondition + } + ... on CollectCondition { + ...CollectCondition } } - title - content } - ${MarketplaceMetadataFragmentDoc} - ${PublicationMetadataV3AttributeFragmentDoc} - ${PublicationMetadataEncryptionStrategyFragmentDoc} - ${PublicationMetadataMediaAudioFragmentDoc} - ${PublicationMetadataMediaVideoFragmentDoc} - ${PublicationMetadataMediaImageFragmentDoc} + ${NftOwnershipConditionFragmentDoc} + ${Erc20OwnershipConditionFragmentDoc} + ${EoaOwnershipConditionFragmentDoc} + ${ProfileOwnershipConditionFragmentDoc} + ${FollowConditionFragmentDoc} + ${CollectConditionFragmentDoc} `; -export const VideoMetadataV3FragmentDoc = gql` - fragment VideoMetadataV3 on VideoMetadataV3 { +export const OrConditionFragmentDoc = gql` + fragment OrCondition on OrCondition { __typename - id - rawURI - locale - tags - contentWarning - hideFromFeed - appId - marketplace { - ...MarketplaceMetadata - } - attributes { - ...PublicationMetadataV3Attribute - } - encryptedWith { - ... on PublicationMetadataEncryptionStrategy { - ...PublicationMetadataEncryptionStrategy + criteria { + ... on NftOwnershipCondition { + ...NftOwnershipCondition } - } - asset { - ...PublicationMetadataMediaVideo - } - attachments { - ... on PublicationMetadataMediaVideo { - ...PublicationMetadataMediaVideo + ... on Erc20OwnershipCondition { + ...Erc20OwnershipCondition } - ... on PublicationMetadataMediaImage { - ...PublicationMetadataMediaImage + ... on EoaOwnershipCondition { + ...EoaOwnershipCondition } - ... on PublicationMetadataMediaAudio { - ...PublicationMetadataMediaAudio + ... on ProfileOwnershipCondition { + ...ProfileOwnershipCondition + } + ... on FollowCondition { + ...FollowCondition + } + ... on CollectCondition { + ...CollectCondition } } - isShortVideo - title - content } - ${MarketplaceMetadataFragmentDoc} - ${PublicationMetadataV3AttributeFragmentDoc} - ${PublicationMetadataEncryptionStrategyFragmentDoc} - ${PublicationMetadataMediaVideoFragmentDoc} - ${PublicationMetadataMediaImageFragmentDoc} - ${PublicationMetadataMediaAudioFragmentDoc} + ${NftOwnershipConditionFragmentDoc} + ${Erc20OwnershipConditionFragmentDoc} + ${EoaOwnershipConditionFragmentDoc} + ${ProfileOwnershipConditionFragmentDoc} + ${FollowConditionFragmentDoc} + ${CollectConditionFragmentDoc} `; -export const ImageMetadataV3FragmentDoc = gql` - fragment ImageMetadataV3 on ImageMetadataV3 { +export const RootConditionFragmentDoc = gql` + fragment RootCondition on RootCondition { + __typename + criteria { + ... on NftOwnershipCondition { + ...NftOwnershipCondition + } + ... on Erc20OwnershipCondition { + ...Erc20OwnershipCondition + } + ... on EoaOwnershipCondition { + ...EoaOwnershipCondition + } + ... on ProfileOwnershipCondition { + ...ProfileOwnershipCondition + } + ... on FollowCondition { + ...FollowCondition + } + ... on CollectCondition { + ...CollectCondition + } + ... on AndCondition { + ...AndCondition + } + ... on OrCondition { + ...OrCondition + } + } + } + ${NftOwnershipConditionFragmentDoc} + ${Erc20OwnershipConditionFragmentDoc} + ${EoaOwnershipConditionFragmentDoc} + ${ProfileOwnershipConditionFragmentDoc} + ${FollowConditionFragmentDoc} + ${CollectConditionFragmentDoc} + ${AndConditionFragmentDoc} + ${OrConditionFragmentDoc} +`; +export const LegacyPublicationMetadataFragmentDoc = gql` + fragment LegacyPublicationMetadata on LegacyPublicationMetadata { + __typename + content + media { + ... on LegacyAudioItem { + ...LegacyAudioItem + } + ... on LegacyImageItem { + ...LegacyImageItem + } + ... on LegacyVideoItem { + ...LegacyVideoItem + } + } + locale + tags + contentWarning + mainContentFocus + marketplace { + ...MarketplaceMetadata + } + encryptedWith { + __typename + encryptionKey + encryptedFields { + __typename + content + image + media { + __typename + uri + mimeType + altTag + cover + } + animationUrl + externalUrl + } + accessCondition { + ...RootCondition + } + } + } + ${LegacyAudioItemFragmentDoc} + ${LegacyImageItemFragmentDoc} + ${LegacyVideoItemFragmentDoc} + ${MarketplaceMetadataFragmentDoc} + ${RootConditionFragmentDoc} +`; +export const PublicationMetadataV3AttributeFragmentDoc = gql` + fragment PublicationMetadataV3Attribute on PublicationMetadataV3Attribute { + __typename + key + value + } +`; +export const PublicationMetadataEncryptionStrategyFragmentDoc = gql` + fragment PublicationMetadataEncryptionStrategy on PublicationMetadataV3LitEncryption { + __typename + encryptionKey + accessCondition { + ...RootCondition + } + encryptedPaths + } + ${RootConditionFragmentDoc} +`; +export const EncryptableAudioFragmentDoc = gql` + fragment EncryptableAudio on EncryptableAudio { + __typename + mimeType + uri + } +`; +export const EncryptableAudioSetFragmentDoc = gql` + fragment EncryptableAudioSet on EncryptableAudioSet { + __typename + raw { + ...EncryptableAudio + } + optimized { + ...Audio + } + } + ${EncryptableAudioFragmentDoc} + ${AudioFragmentDoc} +`; +export const EncryptableImageFragmentDoc = gql` + fragment EncryptableImage on EncryptableImage { + __typename + uri + mimeType + width + height + } +`; +export const PublicationEncryptableImageSetFragmentDoc = gql` + fragment PublicationEncryptableImageSet on EncryptableImageSet { + __typename + raw { + ...EncryptableImage + } + optimized { + ...Image + } + } + ${EncryptableImageFragmentDoc} + ${ImageFragmentDoc} +`; +export const PublicationMetadataMediaAudioFragmentDoc = gql` + fragment PublicationMetadataMediaAudio on PublicationMetadataMediaAudio { + __typename + audio { + ...EncryptableAudioSet + } + cover { + ...PublicationEncryptableImageSet + } + duration + license + credits + artist + genre + recordLabel + lyrics + } + ${EncryptableAudioSetFragmentDoc} + ${PublicationEncryptableImageSetFragmentDoc} +`; +export const EncryptableVideoFragmentDoc = gql` + fragment EncryptableVideo on EncryptableVideo { + __typename + mimeType + uri + } +`; +export const EncryptableVideoSetFragmentDoc = gql` + fragment EncryptableVideoSet on EncryptableVideoSet { + __typename + raw { + ...EncryptableVideo + } + optimized { + ...Video + } + } + ${EncryptableVideoFragmentDoc} + ${VideoFragmentDoc} +`; +export const PublicationMetadataMediaVideoFragmentDoc = gql` + fragment PublicationMetadataMediaVideo on PublicationMetadataMediaVideo { + __typename + video { + ...EncryptableVideoSet + } + cover { + ...PublicationEncryptableImageSet + } + duration + license + altTag + } + ${EncryptableVideoSetFragmentDoc} + ${PublicationEncryptableImageSetFragmentDoc} +`; +export const PublicationMetadataMediaImageFragmentDoc = gql` + fragment PublicationMetadataMediaImage on PublicationMetadataMediaImage { + __typename + image { + ...PublicationEncryptableImageSet + } + license + } + ${PublicationEncryptableImageSetFragmentDoc} +`; +export const AudioMetadataV3FragmentDoc = gql` + fragment AudioMetadataV3 on AudioMetadataV3 { __typename id rawURI @@ -1785,10 +1899,8 @@ export const ImageMetadataV3FragmentDoc = gql` ...PublicationMetadataEncryptionStrategy } } - title - content asset { - ...PublicationMetadataMediaImage + ...PublicationMetadataMediaAudio } attachments { ... on PublicationMetadataMediaVideo { @@ -1801,16 +1913,18 @@ export const ImageMetadataV3FragmentDoc = gql` ...PublicationMetadataMediaAudio } } + title + content } ${MarketplaceMetadataFragmentDoc} ${PublicationMetadataV3AttributeFragmentDoc} ${PublicationMetadataEncryptionStrategyFragmentDoc} - ${PublicationMetadataMediaImageFragmentDoc} - ${PublicationMetadataMediaVideoFragmentDoc} ${PublicationMetadataMediaAudioFragmentDoc} + ${PublicationMetadataMediaVideoFragmentDoc} + ${PublicationMetadataMediaImageFragmentDoc} `; -export const ArticleMetadataV3FragmentDoc = gql` - fragment ArticleMetadataV3 on ArticleMetadataV3 { +export const VideoMetadataV3FragmentDoc = gql` + fragment VideoMetadataV3 on VideoMetadataV3 { __typename id rawURI @@ -1830,8 +1944,9 @@ export const ArticleMetadataV3FragmentDoc = gql` ...PublicationMetadataEncryptionStrategy } } - title - content + asset { + ...PublicationMetadataMediaVideo + } attachments { ... on PublicationMetadataMediaVideo { ...PublicationMetadataMediaVideo @@ -1843,6 +1958,9 @@ export const ArticleMetadataV3FragmentDoc = gql` ...PublicationMetadataMediaAudio } } + isShortVideo + title + content } ${MarketplaceMetadataFragmentDoc} ${PublicationMetadataV3AttributeFragmentDoc} @@ -1851,11 +1969,98 @@ export const ArticleMetadataV3FragmentDoc = gql` ${PublicationMetadataMediaImageFragmentDoc} ${PublicationMetadataMediaAudioFragmentDoc} `; -export const GeoLocationFragmentDoc = gql` - fragment GeoLocation on GeoLocation { +export const ImageMetadataV3FragmentDoc = gql` + fragment ImageMetadataV3 on ImageMetadataV3 { __typename + id rawURI - latitude + locale + tags + contentWarning + hideFromFeed + appId + marketplace { + ...MarketplaceMetadata + } + attributes { + ...PublicationMetadataV3Attribute + } + encryptedWith { + ... on PublicationMetadataEncryptionStrategy { + ...PublicationMetadataEncryptionStrategy + } + } + title + content + asset { + ...PublicationMetadataMediaImage + } + attachments { + ... on PublicationMetadataMediaVideo { + ...PublicationMetadataMediaVideo + } + ... on PublicationMetadataMediaImage { + ...PublicationMetadataMediaImage + } + ... on PublicationMetadataMediaAudio { + ...PublicationMetadataMediaAudio + } + } + } + ${MarketplaceMetadataFragmentDoc} + ${PublicationMetadataV3AttributeFragmentDoc} + ${PublicationMetadataEncryptionStrategyFragmentDoc} + ${PublicationMetadataMediaImageFragmentDoc} + ${PublicationMetadataMediaVideoFragmentDoc} + ${PublicationMetadataMediaAudioFragmentDoc} +`; +export const ArticleMetadataV3FragmentDoc = gql` + fragment ArticleMetadataV3 on ArticleMetadataV3 { + __typename + id + rawURI + locale + tags + contentWarning + hideFromFeed + appId + marketplace { + ...MarketplaceMetadata + } + attributes { + ...PublicationMetadataV3Attribute + } + encryptedWith { + ... on PublicationMetadataEncryptionStrategy { + ...PublicationMetadataEncryptionStrategy + } + } + title + content + attachments { + ... on PublicationMetadataMediaVideo { + ...PublicationMetadataMediaVideo + } + ... on PublicationMetadataMediaImage { + ...PublicationMetadataMediaImage + } + ... on PublicationMetadataMediaAudio { + ...PublicationMetadataMediaAudio + } + } + } + ${MarketplaceMetadataFragmentDoc} + ${PublicationMetadataV3AttributeFragmentDoc} + ${PublicationMetadataEncryptionStrategyFragmentDoc} + ${PublicationMetadataMediaVideoFragmentDoc} + ${PublicationMetadataMediaImageFragmentDoc} + ${PublicationMetadataMediaAudioFragmentDoc} +`; +export const GeoLocationFragmentDoc = gql` + fragment GeoLocation on GeoLocation { + __typename + rawURI + latitude longitude } `; @@ -2337,330 +2542,6 @@ export const LiveStreamMetadataV3FragmentDoc = gql` ${PublicationMetadataMediaImageFragmentDoc} ${PublicationMetadataMediaAudioFragmentDoc} `; -export const PublicationMetadataFragmentDoc = gql` - fragment PublicationMetadata on PublicationMetadata { - ... on LegacyPublicationMetadata { - ...LegacyPublicationMetadata - } - ... on AudioMetadataV3 { - ...AudioMetadataV3 - } - ... on VideoMetadataV3 { - ...VideoMetadataV3 - } - ... on ImageMetadataV3 { - ...ImageMetadataV3 - } - ... on ArticleMetadataV3 { - ...ArticleMetadataV3 - } - ... on EventMetadataV3 { - ...EventMetadataV3 - } - ... on LinkMetadataV3 { - ...LinkMetadataV3 - } - ... on EmbedMetadataV3 { - ...EmbedMetadataV3 - } - ... on CheckingInMetadataV3 { - ...CheckingInMetadataV3 - } - ... on TextOnlyMetadataV3 { - ...TextOnlyMetadataV3 - } - ... on ThreeDMetadataV3 { - ...ThreeDMetadataV3 - } - ... on StoryMetadataV3 { - ...StoryMetadataV3 - } - ... on TransactionMetadataV3 { - ...TransactionMetadataV3 - } - ... on MintMetadataV3 { - ...MintMetadataV3 - } - ... on SpaceMetadataV3 { - ...SpaceMetadataV3 - } - ... on LiveStreamMetadataV3 { - ...LiveStreamMetadataV3 - } - } - ${LegacyPublicationMetadataFragmentDoc} - ${AudioMetadataV3FragmentDoc} - ${VideoMetadataV3FragmentDoc} - ${ImageMetadataV3FragmentDoc} - ${ArticleMetadataV3FragmentDoc} - ${EventMetadataV3FragmentDoc} - ${LinkMetadataV3FragmentDoc} - ${EmbedMetadataV3FragmentDoc} - ${CheckingInMetadataV3FragmentDoc} - ${TextOnlyMetadataV3FragmentDoc} - ${ThreeDMetadataV3FragmentDoc} - ${StoryMetadataV3FragmentDoc} - ${TransactionMetadataV3FragmentDoc} - ${MintMetadataV3FragmentDoc} - ${SpaceMetadataV3FragmentDoc} - ${LiveStreamMetadataV3FragmentDoc} -`; -export const AppFragmentDoc = gql` - fragment App on App { - __typename - id - } -`; -export const MomokaInfoFragmentDoc = gql` - fragment MomokaInfo on MomokaInfo { - __typename - proof - } -`; -export const OptimisticStatusResultFragmentDoc = gql` - fragment OptimisticStatusResult on OptimisticStatusResult { - __typename - value - isFinalisedOnchain - } -`; -export const FeeFollowModuleSettingsFragmentDoc = gql` - fragment FeeFollowModuleSettings on FeeFollowModuleSettings { - __typename - amount { - ...Amount - } - contract { - ...NetworkAddress - } - recipient - } - ${AmountFragmentDoc} - ${NetworkAddressFragmentDoc} -`; -export const RevertFollowModuleSettingsFragmentDoc = gql` - fragment RevertFollowModuleSettings on RevertFollowModuleSettings { - __typename - contract { - ...NetworkAddress - } - } - ${NetworkAddressFragmentDoc} -`; -export const UnknownFollowModuleSettingsFragmentDoc = gql` - fragment UnknownFollowModuleSettings on UnknownFollowModuleSettings { - __typename - contract { - ...NetworkAddress - } - followModuleReturnData - } - ${NetworkAddressFragmentDoc} -`; -export const ProfilePictureSetFragmentDoc = gql` - fragment ProfilePictureSet on ImageSet { - __typename - raw { - ...Image - } - optimized { - ...Image - } - transformed(request: $profilePictureTransform) { - ...Image - } - } - ${ImageFragmentDoc} -`; -export const NftImageFragmentDoc = gql` - fragment NftImage on NftImage { - __typename - collection { - ...NetworkAddress - } - tokenId - image { - ...ProfilePictureSet - } - verified - } - ${NetworkAddressFragmentDoc} - ${ProfilePictureSetFragmentDoc} -`; -export const ProfileCoverSetFragmentDoc = gql` - fragment ProfileCoverSet on ImageSet { - __typename - raw { - ...Image - } - optimized { - ...Image - } - transformed(request: $profileCoverTransform) { - ...Image - } - } - ${ImageFragmentDoc} -`; -export const ProfileFragmentDoc = gql` - fragment Profile on Profile { - __typename - id - ownedBy { - ...NetworkAddress - } - txHash - createdAt - operations { - __typename - id - isBlockedByMe { - ...OptimisticStatusResult - } - isFollowedByMe { - ...OptimisticStatusResult - } - isFollowingMe { - ...OptimisticStatusResult - } - canBlock - canUnblock - canFollow - canUnfollow - } - interests - guardian { - protected - cooldownEndsOn - } - invitesLeft - onchainIdentity { - proofOfHumanity - ens { - name - } - sybilDotOrg { - source { - twitter { - handle - } - } - } - worldcoin { - isHuman - } - } - followNftAddress { - ...NetworkAddress - } - followModule { - ... on FeeFollowModuleSettings { - ...FeeFollowModuleSettings - } - ... on RevertFollowModuleSettings { - ...RevertFollowModuleSettings - } - ... on UnknownFollowModuleSettings { - ...UnknownFollowModuleSettings - } - } - metadata { - displayName - bio - rawURI - picture { - ... on ImageSet { - ...ProfilePictureSet - } - ... on NftImage { - ...NftImage - } - } - coverPicture { - ...ProfileCoverSet - } - attributes { - type - key - value - } - } - handle - sponsor - lensManager - invitedBy { - id - } - } - ${NetworkAddressFragmentDoc} - ${OptimisticStatusResultFragmentDoc} - ${FeeFollowModuleSettingsFragmentDoc} - ${RevertFollowModuleSettingsFragmentDoc} - ${UnknownFollowModuleSettingsFragmentDoc} - ${ProfilePictureSetFragmentDoc} - ${NftImageFragmentDoc} - ${ProfileCoverSetFragmentDoc} -`; -export const KnownCollectOpenActionResultFragmentDoc = gql` - fragment KnownCollectOpenActionResult on KnownCollectOpenActionResult { - __typename - type - } -`; -export const UnknownOpenActionResultFragmentDoc = gql` - fragment UnknownOpenActionResult on UnknownOpenActionResult { - __typename - address - category - initReturnData - } -`; -export const OpenActionResultFragmentDoc = gql` - fragment OpenActionResult on OpenActionResult { - ... on KnownCollectOpenActionResult { - ...KnownCollectOpenActionResult - } - ... on UnknownOpenActionResult { - ...UnknownOpenActionResult - } - } - ${KnownCollectOpenActionResultFragmentDoc} - ${UnknownOpenActionResultFragmentDoc} -`; -export const CanDecryptResponseFragmentDoc = gql` - fragment CanDecryptResponse on CanDecryptResponse { - __typename - result - reasons - extraDetails - } -`; -export const PublicationOperationsFragmentDoc = gql` - fragment PublicationOperations on PublicationOperations { - __typename - isNotInterested - hasBookmarked - hasReported - canAct(request: $publicationOperationsActedArgs) - hasActed(request: $publicationOperationsActedArgs) { - ...OptimisticStatusResult - } - actedOn(request: $publicationOperationsActedArgs) { - ...OpenActionResult - } - hasUpvoted: hasReacted(request: { type: UPVOTE }) - hasDownvoted: hasReacted(request: { type: DOWNVOTE }) - canComment - canMirror - hasMirrored - canDecrypt { - ...CanDecryptResponse - } - } - ${OptimisticStatusResultFragmentDoc} - ${OpenActionResultFragmentDoc} - ${CanDecryptResponseFragmentDoc} -`; export const LegacyFreeCollectModuleSettingsFragmentDoc = gql` fragment LegacyFreeCollectModuleSettings on LegacyFreeCollectModuleSettings { contract { diff --git a/packages/client/src/graphql/fragments.graphql b/packages/client/src/graphql/fragments.graphql index ee7a0649ea..23d287a0c9 100644 --- a/packages/client/src/graphql/fragments.graphql +++ b/packages/client/src/graphql/fragments.graphql @@ -1399,57 +1399,6 @@ fragment LiveStreamMetadataV3 on LiveStreamMetadataV3 { } } -fragment PublicationMetadata on PublicationMetadata { - ... on LegacyPublicationMetadata { - ...LegacyPublicationMetadata - } - ... on AudioMetadataV3 { - ...AudioMetadataV3 - } - ... on VideoMetadataV3 { - ...VideoMetadataV3 - } - ... on ImageMetadataV3 { - ...ImageMetadataV3 - } - ... on ArticleMetadataV3 { - ...ArticleMetadataV3 - } - ... on EventMetadataV3 { - ...EventMetadataV3 - } - ... on LinkMetadataV3 { - ...LinkMetadataV3 - } - ... on EmbedMetadataV3 { - ...EmbedMetadataV3 - } - ... on CheckingInMetadataV3 { - ...CheckingInMetadataV3 - } - ... on TextOnlyMetadataV3 { - ...TextOnlyMetadataV3 - } - ... on ThreeDMetadataV3 { - ...ThreeDMetadataV3 - } - ... on StoryMetadataV3 { - ...StoryMetadataV3 - } - ... on TransactionMetadataV3 { - ...TransactionMetadataV3 - } - ... on MintMetadataV3 { - ...MintMetadataV3 - } - ... on SpaceMetadataV3 { - ...SpaceMetadataV3 - } - ... on LiveStreamMetadataV3 { - ...LiveStreamMetadataV3 - } -} - # publication fragments fragment Post on Post { __typename diff --git a/packages/client/src/graphql/index.ts b/packages/client/src/graphql/index.ts index e8791f87ee..a98d654cb4 100644 --- a/packages/client/src/graphql/index.ts +++ b/packages/client/src/graphql/index.ts @@ -31,6 +31,7 @@ export type { FiatFragment, FollowConditionFragment, FollowOnlyReferenceModuleSettingsFragment, + GeoLocationFragment, ImageFragment, ImageMetadataV3Fragment, KnownCollectOpenActionResultFragment, @@ -76,16 +77,19 @@ export type { PublicationMetadataMediaAudioFragment, PublicationMetadataMediaImageFragment, PublicationMetadataMediaVideoFragment, + PublicationMetadataV3AttributeFragment, PublicationOperationsFragment, QuoteBaseFragment, QuoteFragment, RelayErrorFragment, RelaySuccessFragment, RevertFollowModuleSettingsFragment, + RootConditionFragment, SimpleCollectOpenActionSettingsFragment, SpaceMetadataV3Fragment, StoryMetadataV3Fragment, TextOnlyMetadataV3Fragment, + ThreeDMetadataV3AssetFragment, ThreeDMetadataV3Fragment, TransactionMetadataV3Fragment, UnknownFollowModuleSettingsFragment, @@ -262,6 +266,7 @@ export { ExplorePublicationsOrderByType, ExplorePublicationType, FeedEventItemType, + FollowModuleType, LegacyPublicationMetadataMainFocusType, LensProfileManagerRelayErrorReasonType, LensTransactionFailureType, @@ -287,13 +292,13 @@ export { PublicationReportingSpamSubreason, PublicationsOrderByType, PublicationType, + ReferenceModuleType, RefreshPublicationMetadataResultType, RelayErrorReasonType, RelayRoleKey, + SearchPublicationType, TagSortCriteriaType, TriStateValue, - FollowModuleType, - ReferenceModuleType, } from './types.generated'; export * from './types'; diff --git a/packages/client/src/graphql/types.generated.ts b/packages/client/src/graphql/types.generated.ts index 3adac958e1..47355cd3f9 100644 --- a/packages/client/src/graphql/types.generated.ts +++ b/packages/client/src/graphql/types.generated.ts @@ -1215,10 +1215,11 @@ export type PublicationSearchRequest = { export type PublicationSearchWhere = { customFilters?: InputMaybe>; metadata?: InputMaybe; + publicationTypes?: InputMaybe>; }; export type PublicationStatsCountOpenActionArgs = { - anyOf: Array; + anyOf?: InputMaybe>; }; export type PublicationStatsInput = { @@ -1392,6 +1393,12 @@ export type RevenueFromPublicationsRequest = { publishedOn?: InputMaybe>; }; +export enum SearchPublicationType { + Comment = 'COMMENT', + Post = 'POST', + Quote = 'QUOTE', +} + export type SensitiveReasonInput = { reason: PublicationReportingReason; subreason: PublicationReportingSensitiveSubreason; diff --git a/packages/client/src/graphql/types.ts b/packages/client/src/graphql/types.ts index 7ebd31794c..a4cae42c70 100644 --- a/packages/client/src/graphql/types.ts +++ b/packages/client/src/graphql/types.ts @@ -5,7 +5,22 @@ import { MirrorFragment, PostFragment, QuoteFragment, - PublicationMetadataFragment, + ArticleMetadataV3Fragment, + AudioMetadataV3Fragment, + CheckingInMetadataV3Fragment, + EmbedMetadataV3Fragment, + EventMetadataV3Fragment, + ImageMetadataV3Fragment, + LegacyPublicationMetadataFragment, + LinkMetadataV3Fragment, + LiveStreamMetadataV3Fragment, + MintMetadataV3Fragment, + SpaceMetadataV3Fragment, + StoryMetadataV3Fragment, + TextOnlyMetadataV3Fragment, + ThreeDMetadataV3Fragment, + TransactionMetadataV3Fragment, + VideoMetadataV3Fragment, } from './fragments.generated'; export type AnyPublicationFragment = @@ -16,8 +31,26 @@ export type AnyPublicationFragment = export type PrimaryPublicationFragment = PostFragment | CommentFragment | QuoteFragment; +export type AnyPublicationMetadataFragment = + | ArticleMetadataV3Fragment + | AudioMetadataV3Fragment + | CheckingInMetadataV3Fragment + | EmbedMetadataV3Fragment + | EventMetadataV3Fragment + | ImageMetadataV3Fragment + | LegacyPublicationMetadataFragment + | LinkMetadataV3Fragment + | LiveStreamMetadataV3Fragment + | MintMetadataV3Fragment + | SpaceMetadataV3Fragment + | StoryMetadataV3Fragment + | TextOnlyMetadataV3Fragment + | ThreeDMetadataV3Fragment + | TransactionMetadataV3Fragment + | VideoMetadataV3Fragment; + /** * Any encrypted publication metadata regardless of its type, or capabilities */ -export type EncryptablePublicationMetadataFragment = - EncryptedFragmentOf; +export type AnyEncryptablePublicationMetadataFragment = + EncryptedFragmentOf; diff --git a/packages/client/src/index.ts b/packages/client/src/index.ts index bfc53fcbea..ecc2de9f4b 100644 --- a/packages/client/src/index.ts +++ b/packages/client/src/index.ts @@ -1,3 +1,37 @@ +/** + * @module Base + * + * @example + * Development example: + * ```ts + * import { LensClient, development } from '@lens-protocol/client'; + * + * const client = new LensClient({ + * environment: development + * }); + * ``` + * + * @example + * Production example: + * ```ts + * import { LensClient, production } from '@lens-protocol/client'; + * + * const client = new LensClient({ + * environment: production + * }); + * ``` + * + * @example + * Use [Web Storage API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API) to persist authentication state: + * ```ts + * const client = new LensClient({ + * environment: production, + * + * storage: window.localStorage, + * }); + * ``` + */ + export * from './LensClient'; export * from './environments'; export * from './errors'; @@ -19,7 +53,7 @@ export type { Result, Success, } from '@lens-protocol/shared-kernel'; -export type { IStorageProvider } from '@lens-protocol/storage'; +export type { IStorageProvider, InMemoryStorageProvider } from '@lens-protocol/storage'; export type { TypedData, TypedDataResponse } from './types'; -export type { MediaTransformsConfig } from './context'; +export type { LensContext, MediaTransformsConfig } from './context'; export type { PaginatedResult, PaginatedQueryData } from './helpers/buildPaginatedQueryResult'; diff --git a/packages/client/typedoc.json b/packages/client/typedoc.json new file mode 100644 index 0000000000..5292173407 --- /dev/null +++ b/packages/client/typedoc.json @@ -0,0 +1,6 @@ +{ + "tsconfig": "./tsconfig.json", + "extends": ["../../typedoc.base.json"], + "entryPoints": ["src/index.ts", "src/gated/index.ts"], + "intentionallyNotExported": ["Environment", "LensContext"] +} diff --git a/packages/gated-content/src/environments.ts b/packages/gated-content/src/environments.ts index f5c5967a63..d63b81265d 100644 --- a/packages/gated-content/src/environments.ts +++ b/packages/gated-content/src/environments.ts @@ -2,6 +2,8 @@ import { EthereumAddress } from '@lens-protocol/shared-kernel'; import { SupportedChains } from './conditions/types'; +export { SupportedChains }; + export type EnvironmentConfig = { name: 'production' | 'development' | 'sandbox' | string; chainId: number; @@ -20,12 +22,12 @@ export const development: EnvironmentConfig = { name: 'development', chainId: 80001, chainName: SupportedChains.MUMBAI, - contractAddress: '0x8fc44e306CCc61D7ab20Cf743247cfa330ac35bF', + contractAddress: '0x88a01ae97ab6ccbc8093511b466acd0edc1c30f1', }; export const sandbox: EnvironmentConfig = { name: 'sandbox', chainId: 80001, chainName: SupportedChains.MUMBAI, - contractAddress: '0x88a01ae97ab6ccbc8093511b466acd0edc1c30f1', + contractAddress: '0x88a01ae97ab6ccbc8093511b466acd0edc1c30f1', // same as development for now }; diff --git a/packages/shared-kernel/src/Result.ts b/packages/shared-kernel/src/Result.ts index b8d7de5a20..abcba54bfa 100644 --- a/packages/shared-kernel/src/Result.ts +++ b/packages/shared-kernel/src/Result.ts @@ -9,6 +9,8 @@ import { Narrow } from './ts-helpers/types'; * * @sealed * @privateRemarks DO NOT EXPORT, see type export later on + * @typeParam T - the success value type + * @typeParam E - the failure error type */ class Success { /** @internal */ @@ -35,6 +37,8 @@ class Success { * * @sealed * @privateRemarks DO NOT EXPORT, see type export later on + * @typeParam T - the success value type + * @typeParam E - the failure error type */ class Failure { /** @internal */ @@ -148,11 +152,17 @@ export interface IEquatableError> { * @see https://developer.apple.com/documentation/swift/result * @see https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-result/ * @see https://the-guild.dev/blog/graphql-error-handling-with-fp#monads-to-the-rescue + * + * @typeParam T - the success value type + * @typeParam E - the failure error type */ export type Result = Success | Failure; /** * A `PromiseResult` is a convenience type alias that represents either a {@link Result} in the context of asynchronous tasks. + * + * @typeParam T - the success value type + * @typeParam E - the failure error type */ export type PromiseResult = Promise>; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index be2bb6bc3f..8c3f19d21d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,8 +15,8 @@ importers: specifier: ^2.26.0 version: 2.26.0 '@mxssfd/typedoc-theme': - specifier: ^1.0.6 - version: 1.0.6(typedoc@0.23.27) + specifier: ^1.1.3 + version: 1.1.3(typedoc@0.25.1) '@preconstruct/cli': specifier: ^2.3.0 version: 2.3.0 @@ -30,8 +30,8 @@ importers: specifier: ^1.8.1 version: 1.8.1 typedoc: - specifier: ^0.23.27 - version: 0.23.27(typescript@4.9.5) + specifier: ^0.25.1 + version: 0.25.1(typescript@4.9.5) typescript: specifier: ^4.9.5 version: 4.9.5 @@ -1390,7 +1390,7 @@ packages: resolution: {integrity: sha512-xhlTqH0m31mnsG0tIP4ETgfSB6gXDaYYsUWTrlUV93fFQPI9dd8hE0Ot6MHLCtqgB32hwJAC3YZMWlXZw7AleA==} engines: {node: '>=14'} dependencies: - node-fetch: 2.6.12 + node-fetch: 2.7.0 transitivePeerDependencies: - encoding dev: true @@ -7803,13 +7803,13 @@ packages: '@motionone/dom': 10.16.2 tslib: 2.6.1 - /@mxssfd/typedoc-theme@1.0.6(typedoc@0.23.27): - resolution: {integrity: sha512-GmaVRWWCaL9jIr58uKyXuBS+yn5L4e5BznclGCB+VlDSGHfZEc8GZdVc4ApKFUC3UEtZkS3fWy9S5aJMQttUyQ==} + /@mxssfd/typedoc-theme@1.1.3(typedoc@0.25.1): + resolution: {integrity: sha512-/yP5rqhvibMpzXpmw0YLLRCpoj3uVWWlwyJseZXzGxTfiA6/fd1uubUqNoQAi2U19atMDonq8mQc+hlVctrX4g==} engines: {node: '>= 14'} peerDependencies: - typedoc: ^0.23.21 + typedoc: ^0.25.1 dependencies: - typedoc: 0.23.27(typescript@4.9.5) + typedoc: 0.25.1(typescript@4.9.5) dev: true /@near-js/crypto@0.0.3: @@ -7856,7 +7856,7 @@ packages: borsh: 0.7.0 http-errors: 1.8.1 optionalDependencies: - node-fetch: 2.6.12 + node-fetch: 2.7.0 transitivePeerDependencies: - encoding @@ -11668,7 +11668,7 @@ packages: normalize-path: 3.0.0 readdirp: 3.6.0 optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 /ci-info@2.0.0: resolution: {integrity: sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==} @@ -13874,8 +13874,8 @@ packages: dev: true optional: true - /fsevents@2.3.2: - resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} + /fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] requiresBuild: true @@ -15258,7 +15258,7 @@ packages: /isomorphic-fetch@3.0.0: resolution: {integrity: sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA==} dependencies: - node-fetch: 2.6.12 + node-fetch: 2.7.0 whatwg-fetch: 3.6.2 transitivePeerDependencies: - encoding @@ -15782,7 +15782,7 @@ packages: micromatch: 4.0.5 walker: 1.0.8 optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true /jest-haste-map@29.6.2: @@ -15801,7 +15801,7 @@ packages: micromatch: 4.0.5 walker: 1.0.8 optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true /jest-leak-detector@29.4.3: @@ -17150,8 +17150,8 @@ packages: dev: true optional: true - /marked@4.2.12: - resolution: {integrity: sha512-yr8hSKa3Fv4D3jdZmtMMPghgVt6TWbk86WQaWhDloQjRSQhMMYCAro7jP7VDJrjjdV8pxVxMssXS8B8Y5DZ5aw==} + /marked@4.3.0: + resolution: {integrity: sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==} engines: {node: '>= 12'} hasBin: true dev: true @@ -17380,9 +17380,9 @@ packages: brace-expansion: 2.0.1 dev: true - /minimatch@7.4.2: - resolution: {integrity: sha512-xy4q7wou3vUoC9k1xGTXc+awNdGaGVHtFUaey8tiX4H1QRc04DZ/rmDFwNm2EBsuYEhAZ6SgMmYf3InGY6OauA==} - engines: {node: '>=10'} + /minimatch@9.0.3: + resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} + engines: {node: '>=16 || 14 >=14.17'} dependencies: brace-expansion: 2.0.1 dev: true @@ -17662,6 +17662,17 @@ packages: dependencies: whatwg-url: 5.0.0 + /node-fetch@2.7.0: + resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} + engines: {node: 4.x || >=6.0.0} + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + dependencies: + whatwg-url: 5.0.0 + /node-gyp-build@4.3.0: resolution: {integrity: sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q==} hasBin: true @@ -19299,7 +19310,7 @@ packages: engines: {node: '>=10.0.0'} hasBin: true optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true /rollup@3.17.2: @@ -19307,7 +19318,7 @@ packages: engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true /rollup@3.26.2: @@ -19315,7 +19326,7 @@ packages: engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true /rpc-websockets@7.5.1: @@ -20726,16 +20737,16 @@ packages: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} dev: true - /typedoc@0.23.27(typescript@4.9.5): - resolution: {integrity: sha512-YKjlxX3LEhYbMCkemjlpNh1OKDiFa+ynqP0VRPsH28bEugrMTGI6l8DC6oX5kzFcUKKlYWKpZDSGWszuO/FR3g==} - engines: {node: '>= 14.14'} + /typedoc@0.25.1(typescript@4.9.5): + resolution: {integrity: sha512-c2ye3YUtGIadxN2O6YwPEXgrZcvhlZ6HlhWZ8jQRNzwLPn2ylhdGqdR8HbyDRyALP8J6lmSANILCkkIdNPFxqA==} + engines: {node: '>= 16'} hasBin: true peerDependencies: - typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x + typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x dependencies: lunr: 2.3.9 - marked: 4.2.12 - minimatch: 7.4.2 + marked: 4.3.0 + minimatch: 9.0.3 shiki: 0.14.1 typescript: 4.9.5 dev: true @@ -21184,7 +21195,7 @@ packages: postcss: 8.4.25 rollup: 3.26.2 optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true /vlq@0.2.3: diff --git a/typedoc.base.json b/typedoc.base.json new file mode 100644 index 0000000000..6052201708 --- /dev/null +++ b/typedoc.base.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://typedoc.org/schema.json", + "includeVersion": true, + "excludeExternals": false, + "excludeInternal": true, + "excludeNotDocumented": false, + "excludePrivate": true, + "excludeProtected": true, + "disableSources": true, + "gitRevision": "lens-v2", + "hideGenerator": true, + "intentionallyNotExported": [] +} diff --git a/typedoc.json b/typedoc.json index 09efbf33c1..045a30bc84 100644 --- a/typedoc.json +++ b/typedoc.json @@ -1,60 +1,10 @@ { "$schema": "https://typedoc.org/schema.json", - "entryPoints": [ - // "packages/react-web", - "packages/client" - ], + "entryPoints": ["packages/client"], "entryPointStrategy": "packages", - "excludeExternals": false, - "excludeInternal": false, - "excludeNotDocumented": false, - "excludePrivate": true, - "excludeProtected": true, - "gitRevision": "main", - "hideGenerator": true, "name": "Lens SDK Reference", "out": "docs", "readme": "none", "plugin": ["@mxssfd/typedoc-theme"], - "theme": "my-theme", - "disableSources": true, - "treatWarningsAsErrors": false, - "intentionallyNotExported": [ - // "AnyTransactionRequestModel", - // "SelfFundedProtocolTransactionRequest", - // "ContentInsightMatcher", - // "SnapshotPoll", - // "Undetermined", - // "EnvironmentConfig", - // "ProfileIdentifier" - ], - "categoryOrder": ["Components", "Hooks", "Utils", "*"], - "categorizeByGroup": true, - "sort": ["kind", "required-first", "alphabetical"], - "kindSortOrder": [ - "Reference", - "Project", - "Module", - "Namespace", - "Function", - "Class", - "Enum", - "EnumMember", - "Interface", - "Variable", - "TypeAlias", - "Constructor", - "Property", - "Accessor", - "Method", - "ObjectLiteral", - "Parameter", - "TypeParameter", - "TypeLiteral", - "CallSignature", - "ConstructorSignature", - "IndexSignature", - "GetSignature", - "SetSignature" - ] + "theme": "my-theme" }