@activepieces/pieces-common 0.2.28 → 0.2.29

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@activepieces/pieces-common",
3
- "version": "0.2.28",
3
+ "version": "0.2.29",
4
4
  "type": "commonjs",
5
5
  "dependencies": {
6
6
  "@anthropic-ai/sdk": "0.27.3",
@@ -1,8 +1,9 @@
1
1
  import { AxiosError } from 'axios';
2
2
  export declare class HttpError extends Error {
3
- private readonly _requestBody;
4
- private readonly _err;
5
- constructor(_requestBody: unknown, _err: AxiosError);
3
+ private readonly requestBody;
4
+ private readonly status;
5
+ private readonly responseBody;
6
+ constructor(requestBody: unknown, err: AxiosError);
6
7
  errorMessage(): {
7
8
  response: {
8
9
  status: number;
@@ -2,42 +2,43 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HttpError = void 0;
4
4
  class HttpError extends Error {
5
- constructor(_requestBody, _err) {
5
+ constructor(requestBody, err) {
6
6
  var _a, _b;
7
+ const status = ((_a = err === null || err === void 0 ? void 0 : err.response) === null || _a === void 0 ? void 0 : _a.status) || 500;
8
+ const responseBody = (_b = err === null || err === void 0 ? void 0 : err.response) === null || _b === void 0 ? void 0 : _b.data;
7
9
  super(JSON.stringify({
8
10
  response: {
9
- status: ((_a = _err === null || _err === void 0 ? void 0 : _err.response) === null || _a === void 0 ? void 0 : _a.status) || 500,
10
- body: (_b = _err === null || _err === void 0 ? void 0 : _err.response) === null || _b === void 0 ? void 0 : _b.data,
11
+ status: status,
12
+ body: responseBody,
11
13
  },
12
14
  request: {
13
- body: _requestBody,
15
+ body: requestBody,
14
16
  },
15
17
  }));
16
- this._requestBody = _requestBody;
17
- this._err = _err;
18
+ this.requestBody = requestBody;
19
+ this.status = status;
20
+ this.responseBody = responseBody;
18
21
  }
19
22
  errorMessage() {
20
- var _a, _b, _c, _d;
21
23
  return {
22
24
  response: {
23
- status: ((_b = (_a = this._err) === null || _a === void 0 ? void 0 : _a.response) === null || _b === void 0 ? void 0 : _b.status) || 500,
24
- body: (_d = (_c = this._err) === null || _c === void 0 ? void 0 : _c.response) === null || _d === void 0 ? void 0 : _d.data,
25
+ status: this.status,
26
+ body: this.responseBody,
25
27
  },
26
28
  request: {
27
- body: this._requestBody,
29
+ body: this.requestBody,
28
30
  },
29
31
  };
30
32
  }
31
33
  get response() {
32
- var _a, _b, _c, _d;
33
34
  return {
34
- status: ((_b = (_a = this._err) === null || _a === void 0 ? void 0 : _a.response) === null || _b === void 0 ? void 0 : _b.status) || 500,
35
- body: (_d = (_c = this._err) === null || _c === void 0 ? void 0 : _c.response) === null || _d === void 0 ? void 0 : _d.data,
35
+ status: this.status,
36
+ body: this.responseBody,
36
37
  };
37
38
  }
38
39
  get request() {
39
40
  return {
40
- body: this._requestBody,
41
+ body: this.requestBody,
41
42
  };
42
43
  }
43
44
  }
@@ -1 +1 @@
1
- {"version":3,"file":"http-error.js","sourceRoot":"","sources":["../../../../../../../../../packages/pieces/community/common/src/lib/http/core/http-error.ts"],"names":[],"mappings":";;;AAEA,MAAa,SAAU,SAAQ,KAAK;IAClC,YACmB,YAAqB,EACrB,IAAgB;;QAEjC,KAAK,CACH,IAAI,CAAC,SAAS,CAAC;YACb,QAAQ,EAAE;gBACR,MAAM,EAAE,CAAA,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,QAAQ,0CAAE,MAAM,KAAI,GAAG;gBACrC,IAAI,EAAE,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,QAAQ,0CAAE,IAAI;aAC3B;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,YAAY;aACnB;SACF,CAAC,CACH,CAAC;QAbe,iBAAY,GAAZ,YAAY,CAAS;QACrB,SAAI,GAAJ,IAAI,CAAY;IAanC,CAAC;IAEM,YAAY;;QACjB,OAAO;YACL,QAAQ,EAAE;gBACR,MAAM,EAAE,CAAA,MAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,QAAQ,0CAAE,MAAM,KAAI,GAAG;gBAC1C,IAAI,EAAE,MAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,QAAQ,0CAAE,IAAI;aAChC;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,IAAI,CAAC,YAAY;aACxB;SACF,CAAC;IACJ,CAAC;IAED,IAAI,QAAQ;;QACV,OAAO;YACL,MAAM,EAAE,CAAA,MAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,QAAQ,0CAAE,MAAM,KAAI,GAAG;YAC1C,IAAI,EAAE,MAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,QAAQ,0CAAE,IAAI;SAChC,CAAC;IACJ,CAAC;IAED,IAAI,OAAO;QACT,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,YAAY;SACxB,CAAC;IACJ,CAAC;CACF;AA1CD,8BA0CC"}
1
+ {"version":3,"file":"http-error.js","sourceRoot":"","sources":["../../../../../../../../../packages/pieces/community/common/src/lib/http/core/http-error.ts"],"names":[],"mappings":";;;AAEA,MAAa,SAAU,SAAQ,KAAK;IAIlC,YAA6B,WAAoB,EAAE,GAAe;;QAChE,MAAM,MAAM,GAAG,CAAA,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,QAAQ,0CAAE,MAAM,KAAI,GAAG,CAAC;QAC5C,MAAM,YAAY,GAAG,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,QAAQ,0CAAE,IAAI,CAAC;QAEzC,KAAK,CACH,IAAI,CAAC,SAAS,CAAC;YACb,QAAQ,EAAE;gBACR,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,YAAY;aACnB;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,WAAW;aAClB;SACF,CAAC,CACH,CAAC;QAdyB,gBAAW,GAAX,WAAW,CAAS;QAgB/C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;IACnC,CAAC;IAEM,YAAY;QACjB,OAAO;YACL,QAAQ,EAAE;gBACR,MAAM,EAAE,IAAI,CAAC,MAAM;gBACnB,IAAI,EAAE,IAAI,CAAC,YAAY;aACxB;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,IAAI,CAAC,WAAW;aACvB;SACF,CAAC;IACJ,CAAC;IAED,IAAI,QAAQ;QACV,OAAO;YACL,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,IAAI,EAAE,IAAI,CAAC,YAAY;SACxB,CAAC;IACJ,CAAC;IAED,IAAI,OAAO;QACT,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,WAAW;SACvB,CAAC;IACJ,CAAC;CACF;AAhDD,8BAgDC"}