@codebucket/puppet-master 1.0.1 → 1.0.3

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/index.d.ts CHANGED
@@ -8,6 +8,7 @@ type puppeteerOpts = {
8
8
  pdfOptions?: any;
9
9
  otherPageFunctions?: any;
10
10
  pdfPath: string;
11
+ content: string;
11
12
  };
12
13
  export declare class PuppetMaster {
13
14
  private readonly axios;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,KAAK,IAAI,GAAG;IACR,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAClB,CAAA;AAED,KAAK,aAAa,GAAG;IACjB,aAAc,CAAC,EAAE,GAAG,CAAC;IACrB,WAAY,CAAC,EAAE,GAAG,CAAC;IACnB,UAAW,CAAC,EAAE,GAAG,CAAC;IAClB,kBAAmB,CAAC,EAAE,GAAG,CAAC;IAC1B,OAAO,EAAG,MAAM,CAAC;CACpB,CAAA;AAED,qBAAa,YAAY;IACrB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAQ;gBAElB,IAAI,EAAE,IAAI;IAShB,GAAG,CAAC,IAAI,EAAE,aAAa;CAahC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,KAAK,IAAI,GAAG;IACR,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAClB,CAAA;AAED,KAAK,aAAa,GAAG;IACjB,aAAc,CAAC,EAAE,GAAG,CAAC;IACrB,WAAY,CAAC,EAAE,GAAG,CAAC;IACnB,UAAW,CAAC,EAAE,GAAG,CAAC;IAClB,kBAAmB,CAAC,EAAE,GAAG,CAAC;IAC1B,OAAO,EAAG,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACnB,CAAA;AAED,qBAAa,YAAY;IACrB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAQ;gBAElB,IAAI,EAAE,IAAI;IAShB,GAAG,CAAC,IAAI,EAAE,aAAa;CAchC"}
package/dist/index.js CHANGED
@@ -50,7 +50,8 @@ class PuppetMaster {
50
50
  }
51
51
  catch (err) {
52
52
  if (err instanceof axios_1.AxiosError) {
53
- throw new Error(err.response?.data);
53
+ console.log(err.response?.data);
54
+ throw new Error(err.response?.data?.message);
54
55
  }
55
56
  throw err;
56
57
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codebucket/puppet-master",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "main": "dist/index",
5
5
  "types": "dist/index",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -17,6 +17,7 @@ type puppeteerOpts = {
17
17
  pdfOptions ?: any;
18
18
  otherPageFunctions ?: any;
19
19
  pdfPath : string;
20
+ content: string;
20
21
  }
21
22
 
22
23
  export class PuppetMaster {
@@ -39,7 +40,8 @@ export class PuppetMaster {
39
40
  await pipeline(request.data, fs.createWriteStream(opts.pdfPath));
40
41
  } catch (err) {
41
42
  if (err instanceof AxiosError) {
42
- throw new Error(err.response?.data);
43
+ console.log(err.response?.data);
44
+ throw new Error(err.response?.data?.message);
43
45
  }
44
46
  throw err;
45
47
  }