@tillhub/javascript-sdk 4.79.0 → 4.80.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.
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [4.80.0](https://github.com/tillhub/tillhub-sdk-javascript/compare/v4.79.0...v4.80.0) (2023-08-02)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **reservations:** add put service categories ([#7139](https://github.com/tillhub/tillhub-sdk-javascript/issues/7139)) ([74ce327](https://github.com/tillhub/tillhub-sdk-javascript/commit/74ce3278dd198088ef8641c6402e449419f41c5a))
|
|
7
|
+
|
|
1
8
|
# [4.79.0](https://github.com/tillhub/tillhub-sdk-javascript/compare/v4.78.0...v4.79.0) (2023-07-27)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -17,6 +17,7 @@ export interface ServiceCategoryResponse {
|
|
|
17
17
|
export interface ServiceCategoryItem {
|
|
18
18
|
name: string;
|
|
19
19
|
description?: string;
|
|
20
|
+
id?: string;
|
|
20
21
|
active?: boolean;
|
|
21
22
|
deleted?: boolean;
|
|
22
23
|
}
|
|
@@ -28,9 +29,15 @@ export declare class ServiceCategory extends ThBaseHandler {
|
|
|
28
29
|
uriHelper: UriHelper;
|
|
29
30
|
constructor(options: ServiceCategoryOptions, http: Client);
|
|
30
31
|
create(serviceCategory: ServiceCategoryItem): Promise<ServiceCategoryResponse>;
|
|
32
|
+
put(serviceCategoryId: string, serviceCategory: ServiceCategoryItem): Promise<ServiceCategoryResponse>;
|
|
31
33
|
}
|
|
32
34
|
export declare class ServiceCategoryCreationFailed extends BaseError {
|
|
33
35
|
message: string;
|
|
34
36
|
name: string;
|
|
35
37
|
constructor(message?: string, properties?: Record<string, unknown>);
|
|
36
38
|
}
|
|
39
|
+
export declare class ServiceCategoryPutFailed extends BaseError {
|
|
40
|
+
message: string;
|
|
41
|
+
name: string;
|
|
42
|
+
constructor(message?: string, properties?: Record<string, unknown>);
|
|
43
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ServiceCategoryCreationFailed = exports.ServiceCategory = void 0;
|
|
3
|
+
exports.ServiceCategoryPutFailed = exports.ServiceCategoryCreationFailed = exports.ServiceCategory = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var uri_helper_1 = require("../uri-helper");
|
|
6
6
|
var baseError_1 = require("../errors/baseError");
|
|
@@ -45,6 +45,31 @@ var ServiceCategory = (function (_super) {
|
|
|
45
45
|
});
|
|
46
46
|
});
|
|
47
47
|
};
|
|
48
|
+
ServiceCategory.prototype.put = function (serviceCategoryId, serviceCategory) {
|
|
49
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
50
|
+
var uri, response, error_2;
|
|
51
|
+
return tslib_1.__generator(this, function (_a) {
|
|
52
|
+
switch (_a.label) {
|
|
53
|
+
case 0:
|
|
54
|
+
uri = this.uriHelper.generateBaseUri("/" + serviceCategoryId);
|
|
55
|
+
_a.label = 1;
|
|
56
|
+
case 1:
|
|
57
|
+
_a.trys.push([1, 3, , 4]);
|
|
58
|
+
return [4, this.http.getClient().put(uri, serviceCategory)];
|
|
59
|
+
case 2:
|
|
60
|
+
response = _a.sent();
|
|
61
|
+
return [2, {
|
|
62
|
+
data: response.data.results[0],
|
|
63
|
+
metadata: { count: response.data.count }
|
|
64
|
+
}];
|
|
65
|
+
case 3:
|
|
66
|
+
error_2 = _a.sent();
|
|
67
|
+
throw new ServiceCategoryPutFailed(error_2.message, { error: error_2 });
|
|
68
|
+
case 4: return [2];
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
};
|
|
48
73
|
ServiceCategory.baseEndpoint = '/api/v0/service_categories';
|
|
49
74
|
return ServiceCategory;
|
|
50
75
|
}(base_1.ThBaseHandler));
|
|
@@ -62,4 +87,17 @@ var ServiceCategoryCreationFailed = (function (_super) {
|
|
|
62
87
|
return ServiceCategoryCreationFailed;
|
|
63
88
|
}(baseError_1.BaseError));
|
|
64
89
|
exports.ServiceCategoryCreationFailed = ServiceCategoryCreationFailed;
|
|
90
|
+
var ServiceCategoryPutFailed = (function (_super) {
|
|
91
|
+
tslib_1.__extends(ServiceCategoryPutFailed, _super);
|
|
92
|
+
function ServiceCategoryPutFailed(message, properties) {
|
|
93
|
+
if (message === void 0) { message = 'Could not alter the service category'; }
|
|
94
|
+
var _this = _super.call(this, message, properties) || this;
|
|
95
|
+
_this.message = message;
|
|
96
|
+
_this.name = 'ServiceCategoryPutFailed';
|
|
97
|
+
Object.setPrototypeOf(_this, ServiceCategoryPutFailed.prototype);
|
|
98
|
+
return _this;
|
|
99
|
+
}
|
|
100
|
+
return ServiceCategoryPutFailed;
|
|
101
|
+
}(baseError_1.BaseError));
|
|
102
|
+
exports.ServiceCategoryPutFailed = ServiceCategoryPutFailed;
|
|
65
103
|
//# sourceMappingURL=service_category.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service_category.js","sourceRoot":"","sources":["../../src/v0/service_category.ts"],"names":[],"mappings":";;;;AACA,4CAAyC;AACzC,iDAA+C;AAC/C,gCAAuC;
|
|
1
|
+
{"version":3,"file":"service_category.js","sourceRoot":"","sources":["../../src/v0/service_category.ts"],"names":[],"mappings":";;;;AACA,4CAAyC;AACzC,iDAA+C;AAC/C,gCAAuC;AAwBvC;IAAqC,2CAAa;IAOhD,yBAAa,OAA+B,EAAE,IAAY;;QAA1D,YACE,kBAAM,IAAI,EAAE;YACV,QAAQ,EAAE,eAAe,CAAC,YAAY;YACtC,IAAI,QAAE,OAAO,CAAC,IAAI,mCAAI,yBAAyB;SAChD,CAAC,SAOH;QANC,KAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,KAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAEhB,KAAI,C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