@datocms/cma-client 0.1.0 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -936,7 +936,5 @@ declare const _default: {
936
936
  namespace: string;
937
937
  resourceClassName: string;
938
938
  })[];
939
- simpleTypings: string;
940
- typings: string;
941
939
  };
942
940
  export default _default;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@datocms/cma-client",
3
- "version": "0.1.0",
3
+ "version": "0.1.5",
4
4
  "description": "JS client for DatoCMS REST Content Management API",
5
5
  "keywords": [
6
6
  "datocms",
7
7
  "client"
8
8
  ],
9
9
  "author": "Stefano Verna <s.verna@datocms.com>",
10
- "homepage": "https://github.com/datocms/js-toolkit/tree/main/packages/cma-client#readme",
10
+ "homepage": "https://github.com/datocms/js-rest-api-clients/tree/main/packages/cma-client#readme",
11
11
  "license": "MIT",
12
12
  "main": "dist/cjs/index.js",
13
13
  "module": "dist/esm/index.js",
@@ -26,20 +26,20 @@
26
26
  },
27
27
  "repository": {
28
28
  "type": "git",
29
- "url": "git+https://github.com/datocms/js-toolkit.git"
29
+ "url": "git+https://github.com/datocms/js-rest-api-clients.git"
30
30
  },
31
31
  "scripts": {
32
32
  "build": "tsc && tsc --project ./tsconfig.esnext.json",
33
33
  "prebuild": "rimraf dist"
34
34
  },
35
35
  "bugs": {
36
- "url": "https://github.com/datocms/js-toolkit/issues"
36
+ "url": "https://github.com/datocms/js-rest-api-clients/issues"
37
37
  },
38
38
  "dependencies": {
39
- "@datocms/rest-client-utils": "^0.1.0"
39
+ "@datocms/rest-client-utils": "^0.1.5"
40
40
  },
41
41
  "devDependencies": {
42
- "@datocms/dashboard-client": "^0.1.0"
42
+ "@datocms/dashboard-client": "^0.1.5"
43
43
  },
44
- "gitHead": "41036fc6a62b20638bf91f8c9f58ff8ebabb69bf"
44
+ "gitHead": "dc93ff1a234e3e95a1db409b44c3fe538afd8a1e"
45
45
  }
@@ -1,7 +1,7 @@
1
1
  import { Client } from './generated/Client';
2
2
 
3
3
  export default class BaseResource {
4
- client: Client;
4
+ protected client: Client;
5
5
 
6
6
  constructor(client: Client) {
7
7
  this.client = client;
@@ -16,6 +16,7 @@ export type ClientConfigOptions = {
16
16
  environment?: string;
17
17
  extraHeaders?: Record<string, string>;
18
18
  logLevel?: LogLevel;
19
+ logFn?: (message: string) => void;
19
20
  autoRetry?: boolean;
20
21
  };
21
22
 
@@ -122,6 +123,7 @@ export class Client {
122
123
  return request<T>({
123
124
  ...this.config,
124
125
  ...options,
126
+ logFn: this.config.logFn || console.log,
125
127
  userAgent: `@datocms/cma-client`,
126
128
  baseUrl: this.baseUrl,
127
129
  preCallStack: new Error().stack,