Skip to content

Commit

Permalink
fix ts check in examples/node
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysu committed Sep 18, 2023
1 parent e76750f commit 805548e
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 24 deletions.
7 changes: 4 additions & 3 deletions examples/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
"ts-node": "ts-node",
"eslint:fix": "pnpm run eslint --fix",
"eslint": "eslint scripts",
"lint": "pnpm run prettier && pnpm run eslint",
"lint:fix": "pnpm run prettier:fix && pnpm run eslint:fix",
"lint": "pnpm run prettier && pnpm run eslint && pnpm run tsc",
"lint:fix": "pnpm run prettier:fix && pnpm run eslint:fix && pnpm run tsc",
"prettier:fix": "prettier --write .",
"prettier": "prettier --check ."
"prettier": "prettier --check .",
"tsc": "tsc --noEmit"
},
"keywords": [],
"author": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async function main() {

// check the isFollowedByMe property
const justFollowedProfile = await lensClient.profile.fetch({
profileId: profileToUnfollowId,
forProfileId: profileToUnfollowId,
});

console.log(`Just followed profile`, {
Expand Down
4 changes: 2 additions & 2 deletions examples/node/scripts/profile/fetchProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ async function main() {

// by id
const profileById = await lensClient.profile.fetch({
profileId: '0x0635',
forProfileId: '0x0635',
});

console.log(`Profile fetched by id: `, { id: profileById.id, handle: profileById.handle });

// by handle
const profileByHandle = await lensClient.profile.fetch({
handle: 'lensprotocol.test',
forHandle: 'lensprotocol.test',
});

console.log(`Profile fetched by handle: `, {
Expand Down
2 changes: 1 addition & 1 deletion examples/node/scripts/profile/interests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ async function main() {

// fetch all interests
const { interests } = await lensClient.profile.fetch({
profileId: 'PROFILE_ID',
forProfileId: 'PROFILE_ID',
});

console.log(`Profile interests`, interests);
Expand Down
8 changes: 4 additions & 4 deletions examples/node/scripts/profile/profileStats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ async function main() {
});

// stats across the whole protocol
const protocolWideStats = await lensClient.profile.stats({ profileId: '0x20' });
const protocolWideStats = await lensClient.profile.stats({ forProfileId: '0x20' });

console.log('Result: ', protocolWideStats);

// stats for a specified apps
const statsForSpecifiedApps = await lensClient.profile.stats(
{
profileId: '0x20',
forProfileId: '0x20',
},
{ profileStatsArg: { forApps: ['APP_ID', 'ANOTHER_APP_ID'] } },
);
Expand All @@ -29,7 +29,7 @@ async function main() {
// filter open actions
const filteredOpenActions = await lensClient.profile.stats(
{
profileId: '0x20',
forProfileId: '0x20',
},
{
profileStatsCountOpenActionArgs: {
Expand All @@ -49,7 +49,7 @@ async function main() {
// stats for a specified app and with custom filters
const customFilteredStats = await lensClient.profile.stats(
{
profileId: '0x20',
forProfileId: '0x20',
},
{
profileStatsArg: { forApps: ['APP_ID'], customFilters: [CustomFiltersType.Gardeners] },
Expand Down
2 changes: 1 addition & 1 deletion examples/node/scripts/publication/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ async function main() {
});

const result = await client.publication.fetch({
for: '0x123-0x456',
forId: '0x123-0x456',
});

console.log(`Publication fetched by id: `, result);
Expand Down
2 changes: 1 addition & 1 deletion examples/node/scripts/publication/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ async function main() {

const result = await client.publication.stats({
request: {
for: '0x123',
forId: '0x123',
},
});

Expand Down
7 changes: 2 additions & 5 deletions examples/node/scripts/search/searchPublications.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CustomFiltersType, LensClient, PublicationType, development } from '@lens-protocol/client';
import { CustomFiltersType, LensClient, development } from '@lens-protocol/client';

async function main() {
const client = new LensClient({
Expand All @@ -9,9 +9,7 @@ async function main() {

const searchPostsForSearchTermResult = await client.search.publications({
query: searchTerm,
where: {
publicationTypes: [PublicationType.Post],
},
where: {},
});

searchPostsForSearchTermResult.items.map((publication) => {
Expand All @@ -25,7 +23,6 @@ async function main() {
query: searchTerm,
where: {
customFilters: [CustomFiltersType.Gardeners],
publishedOn: ['app-id'],
},
});

Expand Down
9 changes: 5 additions & 4 deletions examples/node/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"compilerOptions": {
"module": "commonjs",
"esModuleInterop": true,
"target": "es6",
"moduleResolution": "node"
"lib": ["es2015"],
"module": "commonjs",
"moduleResolution": "node",
"skipLibCheck": true,
"target": "es6"
},
"lib": ["es2015"],
"include": ["scripts"],
"ts-node": {
"transpileOnly": true
Expand Down
4 changes: 2 additions & 2 deletions packages/client/src/submodules/publication/Publication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class Publication {
* @example
* ```ts
* const result = await client.publication.fetch({
* for: '0x123-0x456',
* forId: '0x123-0x456',
* });
* ```
*/
Expand Down Expand Up @@ -164,7 +164,7 @@ export class Publication {
* ```ts
* const result = await client.publication.stats({
* request: {
* for: '0x123',
* forId: '0x123',
* },
* });
* ```
Expand Down

0 comments on commit 805548e

Please sign in to comment.