Skip to content

Commit

Permalink
client: remove forApps from config to avoid confusion
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysu committed Oct 4, 2023
1 parent e665644 commit 13f3da9
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 26 deletions.
5 changes: 5 additions & 0 deletions .changeset/shy-pugs-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@lens-protocol/client": patch
---

Removed `forApps` from config as it was used only when quering for profile stats
7 changes: 0 additions & 7 deletions packages/client/src/LensClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,6 @@ export type LensClientConfig = {
* @see {@link MediaTransformsConfig} for more information
*/
mediaTransforms?: MediaTransformsConfig;

/**
* The app ids to use to read data from the Lens Protocol.
* If not provided, all apps will be used.
*/
forApps?: string[];
};

/**
Expand Down Expand Up @@ -79,7 +73,6 @@ export class LensClient {
environment: config.environment,
storage: config.storage || new InMemoryStorageProvider(),
mediaTransforms: config.mediaTransforms || {},
forApps: config.forApps || [],
};
this._authentication = new Authentication(this.context);
}
Expand Down
2 changes: 0 additions & 2 deletions packages/client/src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,4 @@ export type LensContext = {
storage: IStorageProvider;

mediaTransforms: MediaTransformsConfig;

forApps: string[];
};
9 changes: 0 additions & 9 deletions packages/client/src/helpers/buildImageTransformsFromConfig.ts

This file was deleted.

6 changes: 1 addition & 5 deletions packages/client/src/helpers/buildRequestFromConfig.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
import { LensContext } from '../context';
import { ImageTransform, ProfileStatsArg } from '../graphql/types.generated';
import { ImageTransform } from '../graphql';

type RequestFromConfig = {
publicationImageTransform?: ImageTransform;
profileCoverTransform?: ImageTransform;
profilePictureTransform?: ImageTransform;
profileStatsArg?: ProfileStatsArg;
};

export function buildRequestFromConfig(config: LensContext): RequestFromConfig {
return {
publicationImageTransform: config.mediaTransforms?.publication,
profileCoverTransform: config.mediaTransforms?.profileCover,
profilePictureTransform: config.mediaTransforms?.profilePicture,
profileStatsArg: {
forApps: config.forApps,
},
};
}
1 change: 0 additions & 1 deletion packages/client/src/helpers/requireAuthHeaders.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { requireAuthHeaders } from './requireAuthHeaders';
const context: LensContext = {
environment: buildTestEnvironment(),
storage: new InMemoryStorageProvider(),
forApps: [],
mediaTransforms: {},
};

Expand Down
1 change: 0 additions & 1 deletion packages/client/src/helpers/sdkAuthHeaderWrapper.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const context: LensContext = {
environment: buildTestEnvironment(),
mediaTransforms: {},
storage: new InMemoryStorageProvider(),
forApps: [],
};

describe(`Given the "${sdkAuthHeaderWrapper.name}" helper`, () => {
Expand Down
3 changes: 2 additions & 1 deletion packages/client/src/submodules/profile/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ProfileStatsCountOpenActionArgs } from '../../graphql/types.generated';
import { ProfileStatsArg, ProfileStatsCountOpenActionArgs } from '../../graphql/types.generated';

export type FetchProfileOptions = {
profileStatsArg?: ProfileStatsArg;
profileStatsCountOpenActionArgs?: ProfileStatsCountOpenActionArgs;
};

0 comments on commit 13f3da9

Please sign in to comment.