@kiminix/tp-client 1.26.0 → 1.27.0

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.
@@ -59,16 +59,31 @@ var BusinessAPIs = /** @class */ (function () {
59
59
  };
60
60
  BusinessAPIs.get = function (identifier) {
61
61
  return __awaiter(this, void 0, void 0, function () {
62
+ var _this = this;
62
63
  return __generator(this, function (_a) {
63
- switch (_a.label) {
64
- case 0: return [4 /*yield*/, axios.get(base + "/business/".concat(identifier))
65
- .then(function (response) {
66
- var data = response.data;
67
- data.createdAt = parseISO("".concat(data.createdAt));
68
- return data;
69
- })];
70
- case 1: return [2 /*return*/, _a.sent()];
71
- }
64
+ return [2 /*return*/, RequestUtils.send(function () { return __awaiter(_this, void 0, void 0, function () {
65
+ return __generator(this, function (_a) {
66
+ switch (_a.label) {
67
+ case 0: return [4 /*yield*/, axios.get(base + "/business/".concat(identifier))
68
+ .then(function (response) {
69
+ var data = response.data;
70
+ data.createdAt = parseISO("".concat(data.createdAt));
71
+ return data;
72
+ })
73
+ .catch(function (error) {
74
+ var _a;
75
+ var axiosError = error;
76
+ switch ((_a = axiosError === null || axiosError === void 0 ? void 0 : axiosError.response) === null || _a === void 0 ? void 0 : _a.status) {
77
+ case 404:
78
+ return undefined;
79
+ default:
80
+ throw error;
81
+ }
82
+ })];
83
+ case 1: return [2 /*return*/, _a.sent()];
84
+ }
85
+ });
86
+ }); })];
72
87
  });
73
88
  });
74
89
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kiminix/tp-client",
3
- "version": "1.26.0",
3
+ "version": "1.27.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [