contentful.js icon indicating copy to clipboard operation
contentful.js copied to clipboard

typedefs do not include requestLogger, responseLogger

Open xenoterracide opened this issue 5 years ago • 1 comments

the docs say there should be a requestLogger and responseLogger however , the interface does not include them.

export interface CreateClientParams {
    space: string;
    accessToken: string;
    environment?: string;
    insecure?: boolean;
    host?: string;
    basePath?: string;
    httpAgent?: any;
    httpsAgent?: any;
    proxy?: AxiosProxyConfig;
    headers?: any;
    adapter?: any;
    application?: string;
    integration?: string;
    resolveLinks?: boolean;
    removeUnresolved?: boolean;
    retryOnError?: boolean;
    logHandler?: (level: ClientLogLevel, data?: any) => void;
    timeout?: number;
    retryLimit?: number;
}
> yarn info -A contentful                                                    # services -> feature/RS2-1252-dataloader-caching $ ! ? RC=1
└─ contentful@npm:7.14.7
   ├─ Version: 7.14.7
   │
   └─ Dependencies
      ├─ axios@npm:^0.20.0 → npm:0.20.0
      ├─ contentful-resolve-response@npm:^1.2.2 → npm:1.2.2
      ├─ contentful-sdk-core@npm:^6.4.5 → npm:6.4.5
      ├─ json-stringify-safe@npm:^5.0.1 → npm:5.0.1
      └─ lodash@npm:^4.17.11 → npm:4.17.20

as a side note, I see no documentation for what logHandler ... data might contain... it is also a best practice to use unknown now if you don't know the type.

xenoterracide avatar Oct 14 '20 19:10 xenoterracide

Hi @xenoterracide, thanks for bringing this to our attention. typing update PRs are always welcome :)

phoebeschmidt avatar Oct 15 '20 08:10 phoebeschmidt

Is this still relevant? I was also wondering about this, I'm looking to add a global responseLogger in v10 but the type is missing from CreateClientParams

quiro91 avatar Mar 17 '23 09:03 quiro91

:tada: This issue has been resolved in version 10.6.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: