@maioradv/cms-basic-lib 1.2.9 → 1.3.1

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.
package/dist/client.js CHANGED
@@ -32,7 +32,7 @@ class MaiorCmsApiClient {
32
32
  axios_1.default.defaults.headers.common[types_1.ApiHeader.ApiVersion] = this.configApi.version;
33
33
  axios_1.default.defaults.headers.common[types_1.ApiHeader.ApiCacheControl] = this.configApi.disableCache ? 'no-cache' : 'caching';
34
34
  axios_1.default.defaults.headers.common['Content-Type'] = 'application/json';
35
- return axios_1.default;
35
+ return this.configApi.axios ? this.configApi.axios(axios_1.default) : axios_1.default;
36
36
  }
37
37
  _initModules() {
38
38
  this.authentication = new auth_1.default(this.client);
package/dist/config.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { AxiosStatic } from "axios";
1
2
  import { ApiVersion, WithRequired } from "./types";
2
3
  export type ApiConfigs = {
3
4
  host: string;
@@ -8,6 +9,7 @@ export type ApiConfigs = {
8
9
  version?: ApiVersion;
9
10
  sandbox?: boolean;
10
11
  disableCache?: boolean;
12
+ axios?: (axios: AxiosStatic) => AxiosStatic;
11
13
  };
12
14
  export type ValidatedApiConfigs = ApiConfigs & WithRequired<ApiConfigs, 'version' | 'sandbox'>;
13
15
  export declare function validateConfigs(configs: ApiConfigs): ValidatedApiConfigs;
@@ -1,5 +1,6 @@
1
1
  import { ApiModule } from "../model";
2
- import { CreateImportDto } from "./types";
2
+ import { CreateImportDto, CreatePdfDto } from "./types";
3
3
  export default class IO extends ApiModule {
4
4
  importExcel(args: CreateImportDto): Promise<void>;
5
+ createPdf(args: CreatePdfDto): Promise<boolean>;
5
6
  }
package/dist/io/index.js CHANGED
@@ -9,5 +9,8 @@ class IO extends model_1.ApiModule {
9
9
  }
10
10
  });
11
11
  }
12
+ createPdf(args) {
13
+ return this._call('post', '/pdf', args);
14
+ }
12
15
  }
13
16
  exports.default = IO;
@@ -2,3 +2,12 @@ import { ReadStream } from "fs";
2
2
  export type CreateImportDto = {
3
3
  file: ReadStream;
4
4
  };
5
+ export declare enum PdfModel {
6
+ tidelizio = "tidelizio"
7
+ }
8
+ export type CreatePdfDto = {
9
+ model: PdfModel;
10
+ locale: string;
11
+ email: string;
12
+ displayName: string;
13
+ };
package/dist/io/types.js CHANGED
@@ -1,2 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PdfModel = void 0;
4
+ var PdfModel;
5
+ (function (PdfModel) {
6
+ PdfModel["tidelizio"] = "tidelizio";
7
+ })(PdfModel || (exports.PdfModel = PdfModel = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maioradv/cms-basic-lib",
3
- "version": "1.2.9",
3
+ "version": "1.3.1",
4
4
  "description": "JS lib for Maior CMS Basic Api",
5
5
  "repository": "https://github.com/maioradv/cms-basic-lib.git",
6
6
  "author": "Maior ADV Srl",