Skip to content

Commit

Permalink
fix: missing use of new config
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarenaldi committed Dec 4, 2024
1 parent b5dd9f5 commit 2fe3769
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 37 deletions.
38 changes: 2 additions & 36 deletions packages/client/src/clients.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { type Logger, getLogger } from 'loglevel';

import { type AuthenticatedUser, authenticatedUser } from './AuthenticatedUser';
import { transactionStatus } from './actions';
import type { ClientConfig } from './config';
import { configureContext } from './context';
import {
AuthenticationError,
Expand All @@ -53,41 +54,6 @@ function takeValue<T>({
return data.value;
}

/**
* The options to configure the client.
*/
export type ClientOptions = {
/**
* The environment configuration to use (e.g. `mainnet`, `testnet`).
*/
environment: EnvironmentConfig;
/**
* Whether to enable caching.
*
* @defaultValue `false`
*/
cache?: boolean;
/**
* Whether to enable debug mode.
*
* @defaultValue `false`
*/
debug?: boolean;
/**
* The URL origin of the client.
*
* Use this to set the `Origin` header for requests from non-browser environments.
*/
origin?: string;

/**
* The storage provider to use.
*
* @defaultValue {@link InMemoryStorageProvider}
*/
storage?: IStorageProvider;
};

/**
* @internal
*/
Expand Down Expand Up @@ -211,7 +177,7 @@ export class PublicClient extends AbstractClient<UnexpectedError> {
* @param options - The options to configure the client.
* @returns The new instance of the client.
*/
static create(options: ClientOptions): PublicClient {
static create(options: ClientConfig): PublicClient {
return new PublicClient(configureContext(options));
}

Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { EnvironmentConfig } from '@lens-protocol/env';
import type { IStorageProvider } from '@lens-protocol/storage';

/**
* The client
* The client configuration.
*/
export type ClientConfig = {
/**
Expand Down
1 change: 1 addition & 0 deletions packages/client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ export * from '@lens-protocol/types';

export * from './clients';
export * from './config';
export type * from './context';
export * from './errors';
11 changes: 11 additions & 0 deletions packages/types/src/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,14 @@ export type Cursor = Tagged<string, 'Cursor'>;
* A DateTime string in ISO 8601 format.
*/
export type DateTime = Tagged<string, 'DateTime'>;

/**
* Beautify the readout of all of the members of that intersection.
*
* @see https://twitter.com/mattpocockuk/status/1622730173446557697
*
* @internal
*/
export type Prettify<T> = {
[K in keyof T]: T[K];
} & {};

0 comments on commit 2fe3769

Please sign in to comment.