@skedulo/pulse-solution-services 0.0.20 → 0.0.21
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var __decorate=this&&this.__decorate||function(e,
|
|
1
|
+
"use strict";var __decorate=this&&this.__decorate||function(t,e,i,r){var n,a=arguments.length,o=a<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,r);else for(var l=t.length-1;l>=0;l--)(n=t[l])&&(o=(a<3?n(o):a>3?n(e,i,o):n(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o},__metadata=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},__awaiter=this&&this.__awaiter||function(t,e,i,r){return new(i||(i=Promise))((function(n,a){function o(t){try{s(r.next(t))}catch(t){a(t)}}function l(t){try{s(r.throw(t))}catch(t){a(t)}}function s(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,l)}s((r=r.apply(t,e||[])).next())}))};Object.defineProperty(exports,"__esModule",{value:!0}),exports.AvailabilityAPIClient=void 0;const constants_1=require("../constants"),monitor_call_1=require("../monitoring/decorators/monitor-call"),base_client_1=require("./base-client");class AvailabilityAPIClient extends base_client_1.BaseClient{fetchAvailability(t){return __awaiter(this,void 0,void 0,(function*(){var e,i,r,n;if(!t.resourceIds.length)throw new Error("At least one resource ID must be provided.");const a={resource_ids:t.resourceIds.join(","),start:t.start,end:t.end,mergedAvailabilities:null!==(i=null===(e=t.mergedAvailabilities)||void 0===e?void 0:e.toString())&&void 0!==i?i:"false",entries:null!==(n=null===(r=t.entries)||void 0===r?void 0:r.toString())&&void 0!==n?n:"true"};return yield this._performRequest({endpoint:constants_1.TENANT_ENDPOINTS.AVAILABILITY.SIMPLE,queryParams:a})}))}upsertPattern(t){return __awaiter(this,void 0,void 0,(function*(){if(!t.pattern.name)throw new Error("Pattern name is required.");const e=yield this._performRequest({endpoint:constants_1.TENANT_ENDPOINTS.AVAILABILITY.PATTERNS,method:"POST",body:t});if("string"==typeof e)return e;if(e&&"object"==typeof e&&"created"in e)return e.created;throw new Error("Unexpected response format from patterns API")}))}}exports.AvailabilityAPIClient=AvailabilityAPIClient,__decorate([(0,monitor_call_1.MonitorCall)(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",Promise)],AvailabilityAPIClient.prototype,"fetchAvailability",null),__decorate([(0,monitor_call_1.MonitorCall)(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",Promise)],AvailabilityAPIClient.prototype,"upsertPattern",null);
|
package/package.json
CHANGED