-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add missing methods to set metadata in primitives #1053
base: next
Are you sure you want to change the base?
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -5,8 +5,15 @@ import type { | |||||
FeedRequest, | ||||||
FeedsRequest, | ||||||
Paginated, | ||||||
SetFeedMetadataRequest, | ||||||
SetFeedMetadataResult, | ||||||
} from '@lens-protocol/graphql'; | ||||||
import { | ||||||
CreateFeedMutation, | ||||||
FeedQuery, | ||||||
FeedsQuery, | ||||||
SetFeedMetadataMutation, | ||||||
} from '@lens-protocol/graphql'; | ||||||
import { CreateFeedMutation, FeedQuery, FeedsQuery } from '@lens-protocol/graphql'; | ||||||
import type { ResultAsync } from '@lens-protocol/types'; | ||||||
|
||||||
import type { AnyClient, SessionClient } from '../clients'; | ||||||
|
@@ -30,6 +37,27 @@ export function createFeed( | |||||
return client.mutation(CreateFeedMutation, { request }); | ||||||
} | ||||||
|
||||||
/** | ||||||
* Set Feed Metadata | ||||||
* | ||||||
* ```ts | ||||||
* const result = await setFeedMetadata(sessionClient, { | ||||||
* feed: evmAddress('0xe2f2a5C287993345a840db3B0845fbc70f5935a5'), | ||||||
* metadataUri: 'https://example.com/feed-metadata.json', | ||||||
* }); | ||||||
* ``` | ||||||
* | ||||||
* @param client - The session client logged as a builder. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
* @param request - The mutation request. | ||||||
* @returns Tiered transaction result. | ||||||
*/ | ||||||
export function setFeedMetadata( | ||||||
client: SessionClient, | ||||||
request: SetFeedMetadataRequest, | ||||||
): ResultAsync<SetFeedMetadataResult, UnexpectedError | UnauthenticatedError> { | ||||||
return client.mutation(SetFeedMetadataMutation, { request }); | ||||||
} | ||||||
|
||||||
/** | ||||||
* Fetch a Feed. | ||||||
* | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,15 @@ import type { | |
GraphRequest, | ||
GraphsRequest, | ||
Paginated, | ||
SetGraphMetadataRequest, | ||
SetGraphMetadataResult, | ||
} from '@lens-protocol/graphql'; | ||
import { | ||
CreateGraphMutation, | ||
GraphQuery, | ||
GraphsQuery, | ||
SetGraphMetadataMutation, | ||
} from '@lens-protocol/graphql'; | ||
import { CreateGraphMutation, GraphQuery, GraphsQuery } from '@lens-protocol/graphql'; | ||
import type { ResultAsync } from '@lens-protocol/types'; | ||
|
||
import type { AnyClient, SessionClient } from '../clients'; | ||
|
@@ -30,6 +37,27 @@ export function createGraph( | |
return client.mutation(CreateGraphMutation, { request }); | ||
} | ||
|
||
/** | ||
* Set Graph Metadata | ||
* | ||
* ```ts | ||
* const result = await setGraphMetadata(sessionClient, { | ||
* graph: evmAddress('0xe2f2a5C287993345a840db3B0845fbc70f5935a5'), | ||
* metadataUri: 'https://example.com/feed-metadata.json', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
* }); | ||
* ``` | ||
* | ||
* @param client - The session client logged as a builder. | ||
* @param request - The mutation request. | ||
* @returns Tiered transaction result. | ||
*/ | ||
export function setGraphMetadata( | ||
client: SessionClient, | ||
request: SetGraphMetadataRequest, | ||
): ResultAsync<SetGraphMetadataResult, UnexpectedError | UnauthenticatedError> { | ||
return client.mutation(SetGraphMetadataMutation, { request }); | ||
} | ||
|
||
/** | ||
* Fetch a Graph. | ||
* | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,8 @@ import type { | |
LeaveGroupRequest, | ||
LeaveGroupResult, | ||
Paginated, | ||
SetGroupMetadataRequest, | ||
SetGroupMetadataResult, | ||
} from '@lens-protocol/graphql'; | ||
import { | ||
CreateGroupMutation, | ||
|
@@ -22,6 +24,7 @@ import { | |
GroupsQuery, | ||
JoinGroupMutation, | ||
LeaveGroupMutation, | ||
SetGroupMetadataMutation, | ||
} from '@lens-protocol/graphql'; | ||
import type { ResultAsync } from '@lens-protocol/types'; | ||
|
||
|
@@ -46,6 +49,27 @@ export function createGroup( | |
return client.mutation(CreateGroupMutation, { request }); | ||
} | ||
|
||
/** | ||
* Set Group Metadata | ||
* | ||
* ```ts | ||
* const result = await setGroupMetadata(sessionClient, { | ||
* group: evmAddress('0xe2f2a5C287993345a840db3B0845fbc70f5935a5'), | ||
* metadataUri: 'https://example.com/feed-metadata.json', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. uri There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. with |
||
* }); | ||
* ``` | ||
* | ||
* @param client - The session client logged as a builder. | ||
* @param request - The mutation request. | ||
* @returns Tiered transaction result. | ||
*/ | ||
export function setGroupMetadata( | ||
client: SessionClient, | ||
request: SetGroupMetadataRequest, | ||
): ResultAsync<SetGroupMetadataResult, UnexpectedError | UnauthenticatedError> { | ||
return client.mutation(SetGroupMetadataMutation, { request }); | ||
} | ||
|
||
/** | ||
* Join a Group | ||
* | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,12 +4,15 @@ import type { | |
NamespaceRequest, | ||
NamespacesRequest, | ||
Paginated, | ||
SetNamespaceMetadataRequest, | ||
SetNamespaceMetadataResult, | ||
UsernameNamespace, | ||
} from '@lens-protocol/graphql'; | ||
import { | ||
CreateUsernameNamespaceMutation, | ||
NamespaceQuery, | ||
NamespacesQuery, | ||
SetNamespaceMetadataMutation, | ||
} from '@lens-protocol/graphql'; | ||
import type { ResultAsync } from '@lens-protocol/types'; | ||
|
||
|
@@ -37,6 +40,27 @@ export function createUsernameNamespace( | |
return client.mutation(CreateUsernameNamespaceMutation, { request }); | ||
} | ||
|
||
/** | ||
* Set Namespace Metadata | ||
* | ||
* ```ts | ||
* const result = await setNamespaceMetadata(sessionClient, { | ||
* namespace: evmAddress('0xe2f2a5C287993345a840db3B0845fbc70f5935a5'), | ||
* metadataUri: 'https://example.com/feed-metadata.json', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same |
||
* }); | ||
* ``` | ||
* | ||
* @param client - The session client logged as a builder. | ||
* @param request - The mutation request. | ||
* @returns Tiered transaction result. | ||
*/ | ||
export function setNamespaceMetadata( | ||
client: SessionClient, | ||
request: SetNamespaceMetadataRequest, | ||
): ResultAsync<SetNamespaceMetadataResult, UnexpectedError | UnauthenticatedError> { | ||
return client.mutation(SetNamespaceMetadataMutation, { request }); | ||
} | ||
|
||
/** | ||
* Fetch a Namespace. | ||
* | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -111,17 +111,20 @@ export function fetchUsername( | |||||||||||||
} | ||||||||||||||
|
||||||||||||||
/** | ||||||||||||||
* Fetch usernames owned by an address. | ||||||||||||||
* Fetch usernames. | ||||||||||||||
* Example: fetch usernames owned by a specific address. | ||||||||||||||
* | ||||||||||||||
* ```ts | ||||||||||||||
* const result = await fetchUsernames(anyClient, { | ||||||||||||||
* owner: evmAddress('0xe2f2a5C287993345a840db3B0845fbc70f5935a5'), | ||||||||||||||
* filter: { | ||||||||||||||
* owner: evmAddress('0xe2f2a5C287993345a840db3B0845fbc70f5935a5'), | ||||||||||||||
* }, | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
* }); | ||||||||||||||
* ``` | ||||||||||||||
* | ||||||||||||||
* @param client - Any Lens client. | ||||||||||||||
* @param request - The query request. | ||||||||||||||
* @returns The list of owned usernames. | ||||||||||||||
* @returns The list of usernames. | ||||||||||||||
*/ | ||||||||||||||
export function fetchUsernames( | ||||||||||||||
client: AnyClient, | ||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -960,3 +960,12 @@ export enum WhoReferencedPostOrderBy { | |
Oldest = 'OLDEST', | ||
AccountScore = 'ACCOUNT_SCORE', | ||
} | ||
|
||
/** | ||
* Enum for AppUsersOrderBy. | ||
*/ | ||
export enum AppUsersOrderBy { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please hook this into the scalar config? |
||
Alphabetical = 'ALPHABETICAL', | ||
AccountScore = 'ACCOUNT_SCORE', | ||
BestMatch = 'BEST_MATCH', | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uri