@tillhub/javascript-sdk 4.84.0 → 4.85.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.85.0](https://github.com/tillhub/tillhub-sdk-javascript/compare/v4.84.0...v4.85.0) (2023-08-15)
2
+
3
+
4
+ ### Features
5
+
6
+ * **reservations:** update service ([#7319](https://github.com/tillhub/tillhub-sdk-javascript/issues/7319)) ([fc5596a](https://github.com/tillhub/tillhub-sdk-javascript/commit/fc5596a6cdf710ca3234929a9de26d0f64eeec05))
7
+
1
8
  # [4.84.0](https://github.com/tillhub/tillhub-sdk-javascript/compare/v4.83.0...v4.84.0) (2023-08-09)
2
9
 
3
10
 
@@ -31,9 +31,15 @@ export declare class Services extends ThBaseHandler {
31
31
  uriHelper: UriHelper;
32
32
  constructor(options: ServicesOptions, http: Client);
33
33
  create(service: ServicesObject): Promise<ServiceResponse>;
34
+ put(serviceId: string, service: ServicesObject): Promise<ServiceResponse>;
34
35
  }
35
36
  export declare class ServiceCreationFailed extends BaseError {
36
37
  message: string;
37
38
  name: string;
38
39
  constructor(message?: string, properties?: Record<string, unknown>);
39
40
  }
41
+ export declare class ServicePutFailed extends BaseError {
42
+ message: string;
43
+ name: string;
44
+ constructor(message?: string, properties?: Record<string, unknown>);
45
+ }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ServiceCreationFailed = exports.Services = void 0;
3
+ exports.ServicePutFailed = exports.ServiceCreationFailed = exports.Services = 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 Services = (function (_super) {
45
45
  });
46
46
  });
47
47
  };
48
+ Services.prototype.put = function (serviceId, service) {
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("/" + serviceId);
55
+ _a.label = 1;
56
+ case 1:
57
+ _a.trys.push([1, 3, , 4]);
58
+ return [4, this.http.getClient().put(uri, service)];
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 ServicePutFailed(error_2.message, { error: error_2 });
68
+ case 4: return [2];
69
+ }
70
+ });
71
+ });
72
+ };
48
73
  Services.baseEndpoint = '/api/v0/services';
49
74
  return Services;
50
75
  }(base_1.ThBaseHandler));
@@ -62,4 +87,17 @@ var ServiceCreationFailed = (function (_super) {
62
87
  return ServiceCreationFailed;
63
88
  }(baseError_1.BaseError));
64
89
  exports.ServiceCreationFailed = ServiceCreationFailed;
90
+ var ServicePutFailed = (function (_super) {
91
+ tslib_1.__extends(ServicePutFailed, _super);
92
+ function ServicePutFailed(message, properties) {
93
+ if (message === void 0) { message = 'Could not alter the service'; }
94
+ var _this = _super.call(this, message, properties) || this;
95
+ _this.message = message;
96
+ _this.name = 'ServicePutFailed';
97
+ Object.setPrototypeOf(_this, ServicePutFailed.prototype);
98
+ return _this;
99
+ }
100
+ return ServicePutFailed;
101
+ }(baseError_1.BaseError));
102
+ exports.ServicePutFailed = ServicePutFailed;
65
103
  //# sourceMappingURL=services.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"services.js","sourceRoot":"","sources":["../../src/v0/services.ts"],"names":[],"mappings":";;;;AACA,4CAAyC;AACzC,iDAA+C;AAC/C,gCAAuC;AA0BvC;IAA8B,oCAAa;IAOzC,kBAAa,OAAwB,EAAE,IAAY;;QAAnD,YACE,kBAAM,IAAI,EAAE;YACV,QAAQ,EAAE,QAAQ,CAAC,YAAY;YAC/B,IAAI,QAAE,OAAO,CAAC,IAAI,mCAAI,yBAAyB;SAChD,CA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kBAAkB,CAAA;QAM9B,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAA;;IACzD,CAAC;IACH,uBAAC;AAAD,CAAC,AATD,CAAsC,qBAAS,GAS9C;AATY,4CAAgB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tillhub/javascript-sdk",
3
- "version": "4.84.0",
3
+ "version": "4.85.0",
4
4
  "description": "The JavaScript (Browser) SDK for the Tillhub API.",
5
5
  "keywords": [],
6
6
  "main": "dist/tillhub-js.js",