@ignos/api-client 20260506.122.1 → 20260507.123.1-alpha

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.
@@ -615,6 +615,51 @@ export declare class KpiAdminResourceClient extends AuthorizedApiBase implements
615
615
  updateCalendarSettings(cmd: UpdateCalendarSettingsCommand): Promise<CalendarSettingsDto>;
616
616
  protected processUpdateCalendarSettings(response: Response): Promise<CalendarSettingsDto>;
617
617
  }
618
+ export interface IKpiCalendarClient {
619
+ listCalendarDefinitions(): Promise<CalendarDefinitionDto[]>;
620
+ createCalendarDefinition(request: CreateCalendarDefinition): Promise<CalendarDefinitionDto>;
621
+ updateCalendarDefinition(id: string, request: UpdateCalendarDefinition): Promise<CalendarDefinitionDto>;
622
+ deleteCalendarDefinition(id: string): Promise<FileResponse>;
623
+ listResourceCalendarPeriods(): Promise<ResourceCalendarPeriodGroupDto[]>;
624
+ addResourceCalendarPeriod(request: AddResourceCalendarPeriod): Promise<ResourceCalendarPeriodDto>;
625
+ updateResourceCalendarPeriod(id: string, request: UpdateResourceCalendarPeriod): Promise<ResourceCalendarPeriodDto>;
626
+ deleteResourceCalendarPeriod(id: string): Promise<FileResponse>;
627
+ bulkAddResourceCalendarPeriods(request: BulkAddResourceCalendarPeriods): Promise<ResourceCalendarPeriodDto[]>;
628
+ copyResourceCalendarPeriod(id: string, request: CopyResourceCalendarPeriod): Promise<ResourceCalendarPeriodDto>;
629
+ migrateResourceCapacity(): Promise<MigrationResultDto>;
630
+ migrateCalendarIds(): Promise<MigrationResultDto>;
631
+ }
632
+ export declare class KpiCalendarClient extends AuthorizedApiBase implements IKpiCalendarClient {
633
+ private http;
634
+ private baseUrl;
635
+ constructor(configuration: IAccessTokenProvider, baseUrl?: string, http?: {
636
+ fetch(url: RequestInfo, init?: RequestInit): Promise<Response>;
637
+ });
638
+ listCalendarDefinitions(): Promise<CalendarDefinitionDto[]>;
639
+ protected processListCalendarDefinitions(response: Response): Promise<CalendarDefinitionDto[]>;
640
+ createCalendarDefinition(request: CreateCalendarDefinition): Promise<CalendarDefinitionDto>;
641
+ protected processCreateCalendarDefinition(response: Response): Promise<CalendarDefinitionDto>;
642
+ updateCalendarDefinition(id: string, request: UpdateCalendarDefinition): Promise<CalendarDefinitionDto>;
643
+ protected processUpdateCalendarDefinition(response: Response): Promise<CalendarDefinitionDto>;
644
+ deleteCalendarDefinition(id: string): Promise<FileResponse>;
645
+ protected processDeleteCalendarDefinition(response: Response): Promise<FileResponse>;
646
+ listResourceCalendarPeriods(): Promise<ResourceCalendarPeriodGroupDto[]>;
647
+ protected processListResourceCalendarPeriods(response: Response): Promise<ResourceCalendarPeriodGroupDto[]>;
648
+ addResourceCalendarPeriod(request: AddResourceCalendarPeriod): Promise<ResourceCalendarPeriodDto>;
649
+ protected processAddResourceCalendarPeriod(response: Response): Promise<ResourceCalendarPeriodDto>;
650
+ updateResourceCalendarPeriod(id: string, request: UpdateResourceCalendarPeriod): Promise<ResourceCalendarPeriodDto>;
651
+ protected processUpdateResourceCalendarPeriod(response: Response): Promise<ResourceCalendarPeriodDto>;
652
+ deleteResourceCalendarPeriod(id: string): Promise<FileResponse>;
653
+ protected processDeleteResourceCalendarPeriod(response: Response): Promise<FileResponse>;
654
+ bulkAddResourceCalendarPeriods(request: BulkAddResourceCalendarPeriods): Promise<ResourceCalendarPeriodDto[]>;
655
+ protected processBulkAddResourceCalendarPeriods(response: Response): Promise<ResourceCalendarPeriodDto[]>;
656
+ copyResourceCalendarPeriod(id: string, request: CopyResourceCalendarPeriod): Promise<ResourceCalendarPeriodDto>;
657
+ protected processCopyResourceCalendarPeriod(response: Response): Promise<ResourceCalendarPeriodDto>;
658
+ migrateResourceCapacity(): Promise<MigrationResultDto>;
659
+ protected processMigrateResourceCapacity(response: Response): Promise<MigrationResultDto>;
660
+ migrateCalendarIds(): Promise<MigrationResultDto>;
661
+ protected processMigrateCalendarIds(response: Response): Promise<MigrationResultDto>;
662
+ }
618
663
  export interface IKpiResourceClient {
619
664
  getResourceKpi(resourceExternalId: string | undefined, previousPeriodStartDate: Date | undefined, startDate: Date | undefined, endDate: Date | undefined, utcOffset: number | undefined): Promise<ResourceKpiDto>;
620
665
  getResourceDailyUptime(resourceExternalId: string | undefined, date: Date | undefined, utcOffset: number | undefined): Promise<ResourceDailyUptimeDto>;
@@ -4112,6 +4157,77 @@ export interface UpdateCalendarSettingsCommand {
4112
4157
  holidayHours?: number;
4113
4158
  defaultPerformancePercent?: number | null;
4114
4159
  }
4160
+ export interface CalendarDefinitionDto {
4161
+ id?: string;
4162
+ name?: string;
4163
+ hoursPerWeekday?: {
4164
+ [key in DayOfWeek]?: number;
4165
+ };
4166
+ created?: Date | null;
4167
+ updatedBy?: string | null;
4168
+ }
4169
+ export interface CreateCalendarDefinition {
4170
+ name: string;
4171
+ hoursPerWeekday: {
4172
+ [key in DayOfWeek]?: number;
4173
+ };
4174
+ }
4175
+ export interface UpdateCalendarDefinition {
4176
+ id: string;
4177
+ name?: string | null;
4178
+ hoursPerWeekday?: {
4179
+ [key in DayOfWeek]?: number;
4180
+ } | null;
4181
+ }
4182
+ export interface ResourceCalendarPeriodGroupDto {
4183
+ department?: string | null;
4184
+ resources?: ResourceCalendarPeriodsDto[];
4185
+ }
4186
+ export interface ResourceCalendarPeriodsDto {
4187
+ resourceExternalId?: string;
4188
+ resourceName?: string;
4189
+ periods?: ResourceCalendarPeriodDto[];
4190
+ }
4191
+ export interface ResourceCalendarPeriodDto {
4192
+ id?: string;
4193
+ resourceExternalId?: string;
4194
+ calendarDefinitionId?: string;
4195
+ calendarDefinitionName?: string;
4196
+ effectiveFrom?: string;
4197
+ effectiveTo?: string | null;
4198
+ targetPercent?: number;
4199
+ comment?: string | null;
4200
+ }
4201
+ export interface AddResourceCalendarPeriod {
4202
+ resourceExternalId: string;
4203
+ calendarDefinitionId: string;
4204
+ effectiveFrom: string;
4205
+ targetPercent: number;
4206
+ comment?: string | null;
4207
+ }
4208
+ export interface UpdateResourceCalendarPeriod {
4209
+ id: string;
4210
+ calendarDefinitionId?: string | null;
4211
+ targetPercent?: number | null;
4212
+ effectiveFrom?: string | null;
4213
+ comment?: string | null;
4214
+ }
4215
+ export interface BulkAddResourceCalendarPeriods {
4216
+ resourceExternalIds: string[];
4217
+ calendarDefinitionId: string;
4218
+ effectiveFrom: string;
4219
+ targetPercent: number;
4220
+ comment?: string | null;
4221
+ }
4222
+ export interface CopyResourceCalendarPeriod {
4223
+ sourcePeriodId: string;
4224
+ targetResourceExternalId: string;
4225
+ effectiveFrom: string;
4226
+ }
4227
+ export interface MigrationResultDto {
4228
+ created?: number;
4229
+ skipped?: number;
4230
+ }
4115
4231
  export interface ResourceKpiDto {
4116
4232
  uptimeToNow: number;
4117
4233
  uptimeToNowPreviousPeriod: number;
@@ -4152,6 +4268,7 @@ export interface ApplicationResourcesResourceGroupDto {
4152
4268
  id: string;
4153
4269
  name: string;
4154
4270
  companyId?: string | null;
4271
+ department?: string | null;
4155
4272
  resources: ResourceGroupMemberDto[];
4156
4273
  }
4157
4274
  export interface ResourceGroupMemberDto {
@@ -4480,6 +4480,490 @@ export class KpiAdminResourceClient extends AuthorizedApiBase {
4480
4480
  return Promise.resolve(null);
4481
4481
  }
4482
4482
  }
4483
+ export class KpiCalendarClient extends AuthorizedApiBase {
4484
+ constructor(configuration, baseUrl, http) {
4485
+ super(configuration);
4486
+ this.http = http ? http : window;
4487
+ this.baseUrl = baseUrl !== null && baseUrl !== void 0 ? baseUrl : "";
4488
+ }
4489
+ listCalendarDefinitions() {
4490
+ let url_ = this.baseUrl + "/resources/kpi/calendar-definitions";
4491
+ url_ = url_.replace(/[?&]$/, "");
4492
+ let options_ = {
4493
+ method: "GET",
4494
+ headers: {
4495
+ "Accept": "application/json"
4496
+ }
4497
+ };
4498
+ return this.transformOptions(options_).then(transformedOptions_ => {
4499
+ return this.http.fetch(url_, transformedOptions_);
4500
+ }).then((_response) => {
4501
+ return this.processListCalendarDefinitions(_response);
4502
+ });
4503
+ }
4504
+ processListCalendarDefinitions(response) {
4505
+ const status = response.status;
4506
+ let _headers = {};
4507
+ if (response.headers && response.headers.forEach) {
4508
+ response.headers.forEach((v, k) => _headers[k] = v);
4509
+ }
4510
+ ;
4511
+ if (status === 200) {
4512
+ return response.text().then((_responseText) => {
4513
+ let result200 = null;
4514
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4515
+ return result200;
4516
+ });
4517
+ }
4518
+ else if (status !== 200 && status !== 204) {
4519
+ return response.text().then((_responseText) => {
4520
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
4521
+ });
4522
+ }
4523
+ return Promise.resolve(null);
4524
+ }
4525
+ createCalendarDefinition(request) {
4526
+ let url_ = this.baseUrl + "/resources/kpi/calendar-definitions";
4527
+ url_ = url_.replace(/[?&]$/, "");
4528
+ const content_ = JSON.stringify(request);
4529
+ let options_ = {
4530
+ body: content_,
4531
+ method: "POST",
4532
+ headers: {
4533
+ "Content-Type": "application/json",
4534
+ "Accept": "application/json"
4535
+ }
4536
+ };
4537
+ return this.transformOptions(options_).then(transformedOptions_ => {
4538
+ return this.http.fetch(url_, transformedOptions_);
4539
+ }).then((_response) => {
4540
+ return this.processCreateCalendarDefinition(_response);
4541
+ });
4542
+ }
4543
+ processCreateCalendarDefinition(response) {
4544
+ const status = response.status;
4545
+ let _headers = {};
4546
+ if (response.headers && response.headers.forEach) {
4547
+ response.headers.forEach((v, k) => _headers[k] = v);
4548
+ }
4549
+ ;
4550
+ if (status === 200) {
4551
+ return response.text().then((_responseText) => {
4552
+ let result200 = null;
4553
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4554
+ return result200;
4555
+ });
4556
+ }
4557
+ else if (status !== 200 && status !== 204) {
4558
+ return response.text().then((_responseText) => {
4559
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
4560
+ });
4561
+ }
4562
+ return Promise.resolve(null);
4563
+ }
4564
+ updateCalendarDefinition(id, request) {
4565
+ let url_ = this.baseUrl + "/resources/kpi/calendar-definitions/{id}";
4566
+ if (id === undefined || id === null)
4567
+ throw new globalThis.Error("The parameter 'id' must be defined.");
4568
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
4569
+ url_ = url_.replace(/[?&]$/, "");
4570
+ const content_ = JSON.stringify(request);
4571
+ let options_ = {
4572
+ body: content_,
4573
+ method: "PUT",
4574
+ headers: {
4575
+ "Content-Type": "application/json",
4576
+ "Accept": "application/json"
4577
+ }
4578
+ };
4579
+ return this.transformOptions(options_).then(transformedOptions_ => {
4580
+ return this.http.fetch(url_, transformedOptions_);
4581
+ }).then((_response) => {
4582
+ return this.processUpdateCalendarDefinition(_response);
4583
+ });
4584
+ }
4585
+ processUpdateCalendarDefinition(response) {
4586
+ const status = response.status;
4587
+ let _headers = {};
4588
+ if (response.headers && response.headers.forEach) {
4589
+ response.headers.forEach((v, k) => _headers[k] = v);
4590
+ }
4591
+ ;
4592
+ if (status === 200) {
4593
+ return response.text().then((_responseText) => {
4594
+ let result200 = null;
4595
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4596
+ return result200;
4597
+ });
4598
+ }
4599
+ else if (status !== 200 && status !== 204) {
4600
+ return response.text().then((_responseText) => {
4601
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
4602
+ });
4603
+ }
4604
+ return Promise.resolve(null);
4605
+ }
4606
+ deleteCalendarDefinition(id) {
4607
+ let url_ = this.baseUrl + "/resources/kpi/calendar-definitions/{id}";
4608
+ if (id === undefined || id === null)
4609
+ throw new globalThis.Error("The parameter 'id' must be defined.");
4610
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
4611
+ url_ = url_.replace(/[?&]$/, "");
4612
+ let options_ = {
4613
+ method: "DELETE",
4614
+ headers: {
4615
+ "Accept": "application/octet-stream"
4616
+ }
4617
+ };
4618
+ return this.transformOptions(options_).then(transformedOptions_ => {
4619
+ return this.http.fetch(url_, transformedOptions_);
4620
+ }).then((_response) => {
4621
+ return this.processDeleteCalendarDefinition(_response);
4622
+ });
4623
+ }
4624
+ processDeleteCalendarDefinition(response) {
4625
+ const status = response.status;
4626
+ let _headers = {};
4627
+ if (response.headers && response.headers.forEach) {
4628
+ response.headers.forEach((v, k) => _headers[k] = v);
4629
+ }
4630
+ ;
4631
+ if (status === 200 || status === 206) {
4632
+ const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
4633
+ let fileNameMatch = contentDisposition ? /filename\*=(?:(\\?['"])(.*?)\1|(?:[^\s]+'.*?')?([^;\n]*))/g.exec(contentDisposition) : undefined;
4634
+ let fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[3] || fileNameMatch[2] : undefined;
4635
+ if (fileName) {
4636
+ fileName = decodeURIComponent(fileName);
4637
+ }
4638
+ else {
4639
+ fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
4640
+ fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
4641
+ }
4642
+ return response.blob().then(blob => { return { fileName: fileName, data: blob, status: status, headers: _headers }; });
4643
+ }
4644
+ else if (status !== 200 && status !== 204) {
4645
+ return response.text().then((_responseText) => {
4646
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
4647
+ });
4648
+ }
4649
+ return Promise.resolve(null);
4650
+ }
4651
+ listResourceCalendarPeriods() {
4652
+ let url_ = this.baseUrl + "/resources/kpi/calendar-periods";
4653
+ url_ = url_.replace(/[?&]$/, "");
4654
+ let options_ = {
4655
+ method: "GET",
4656
+ headers: {
4657
+ "Accept": "application/json"
4658
+ }
4659
+ };
4660
+ return this.transformOptions(options_).then(transformedOptions_ => {
4661
+ return this.http.fetch(url_, transformedOptions_);
4662
+ }).then((_response) => {
4663
+ return this.processListResourceCalendarPeriods(_response);
4664
+ });
4665
+ }
4666
+ processListResourceCalendarPeriods(response) {
4667
+ const status = response.status;
4668
+ let _headers = {};
4669
+ if (response.headers && response.headers.forEach) {
4670
+ response.headers.forEach((v, k) => _headers[k] = v);
4671
+ }
4672
+ ;
4673
+ if (status === 200) {
4674
+ return response.text().then((_responseText) => {
4675
+ let result200 = null;
4676
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4677
+ return result200;
4678
+ });
4679
+ }
4680
+ else if (status !== 200 && status !== 204) {
4681
+ return response.text().then((_responseText) => {
4682
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
4683
+ });
4684
+ }
4685
+ return Promise.resolve(null);
4686
+ }
4687
+ addResourceCalendarPeriod(request) {
4688
+ let url_ = this.baseUrl + "/resources/kpi/calendar-periods";
4689
+ url_ = url_.replace(/[?&]$/, "");
4690
+ const content_ = JSON.stringify(request);
4691
+ let options_ = {
4692
+ body: content_,
4693
+ method: "POST",
4694
+ headers: {
4695
+ "Content-Type": "application/json",
4696
+ "Accept": "application/json"
4697
+ }
4698
+ };
4699
+ return this.transformOptions(options_).then(transformedOptions_ => {
4700
+ return this.http.fetch(url_, transformedOptions_);
4701
+ }).then((_response) => {
4702
+ return this.processAddResourceCalendarPeriod(_response);
4703
+ });
4704
+ }
4705
+ processAddResourceCalendarPeriod(response) {
4706
+ const status = response.status;
4707
+ let _headers = {};
4708
+ if (response.headers && response.headers.forEach) {
4709
+ response.headers.forEach((v, k) => _headers[k] = v);
4710
+ }
4711
+ ;
4712
+ if (status === 200) {
4713
+ return response.text().then((_responseText) => {
4714
+ let result200 = null;
4715
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4716
+ return result200;
4717
+ });
4718
+ }
4719
+ else if (status !== 200 && status !== 204) {
4720
+ return response.text().then((_responseText) => {
4721
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
4722
+ });
4723
+ }
4724
+ return Promise.resolve(null);
4725
+ }
4726
+ updateResourceCalendarPeriod(id, request) {
4727
+ let url_ = this.baseUrl + "/resources/kpi/calendar-periods/{id}";
4728
+ if (id === undefined || id === null)
4729
+ throw new globalThis.Error("The parameter 'id' must be defined.");
4730
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
4731
+ url_ = url_.replace(/[?&]$/, "");
4732
+ const content_ = JSON.stringify(request);
4733
+ let options_ = {
4734
+ body: content_,
4735
+ method: "PUT",
4736
+ headers: {
4737
+ "Content-Type": "application/json",
4738
+ "Accept": "application/json"
4739
+ }
4740
+ };
4741
+ return this.transformOptions(options_).then(transformedOptions_ => {
4742
+ return this.http.fetch(url_, transformedOptions_);
4743
+ }).then((_response) => {
4744
+ return this.processUpdateResourceCalendarPeriod(_response);
4745
+ });
4746
+ }
4747
+ processUpdateResourceCalendarPeriod(response) {
4748
+ const status = response.status;
4749
+ let _headers = {};
4750
+ if (response.headers && response.headers.forEach) {
4751
+ response.headers.forEach((v, k) => _headers[k] = v);
4752
+ }
4753
+ ;
4754
+ if (status === 200) {
4755
+ return response.text().then((_responseText) => {
4756
+ let result200 = null;
4757
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4758
+ return result200;
4759
+ });
4760
+ }
4761
+ else if (status !== 200 && status !== 204) {
4762
+ return response.text().then((_responseText) => {
4763
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
4764
+ });
4765
+ }
4766
+ return Promise.resolve(null);
4767
+ }
4768
+ deleteResourceCalendarPeriod(id) {
4769
+ let url_ = this.baseUrl + "/resources/kpi/calendar-periods/{id}";
4770
+ if (id === undefined || id === null)
4771
+ throw new globalThis.Error("The parameter 'id' must be defined.");
4772
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
4773
+ url_ = url_.replace(/[?&]$/, "");
4774
+ let options_ = {
4775
+ method: "DELETE",
4776
+ headers: {
4777
+ "Accept": "application/octet-stream"
4778
+ }
4779
+ };
4780
+ return this.transformOptions(options_).then(transformedOptions_ => {
4781
+ return this.http.fetch(url_, transformedOptions_);
4782
+ }).then((_response) => {
4783
+ return this.processDeleteResourceCalendarPeriod(_response);
4784
+ });
4785
+ }
4786
+ processDeleteResourceCalendarPeriod(response) {
4787
+ const status = response.status;
4788
+ let _headers = {};
4789
+ if (response.headers && response.headers.forEach) {
4790
+ response.headers.forEach((v, k) => _headers[k] = v);
4791
+ }
4792
+ ;
4793
+ if (status === 200 || status === 206) {
4794
+ const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
4795
+ let fileNameMatch = contentDisposition ? /filename\*=(?:(\\?['"])(.*?)\1|(?:[^\s]+'.*?')?([^;\n]*))/g.exec(contentDisposition) : undefined;
4796
+ let fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[3] || fileNameMatch[2] : undefined;
4797
+ if (fileName) {
4798
+ fileName = decodeURIComponent(fileName);
4799
+ }
4800
+ else {
4801
+ fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
4802
+ fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
4803
+ }
4804
+ return response.blob().then(blob => { return { fileName: fileName, data: blob, status: status, headers: _headers }; });
4805
+ }
4806
+ else if (status !== 200 && status !== 204) {
4807
+ return response.text().then((_responseText) => {
4808
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
4809
+ });
4810
+ }
4811
+ return Promise.resolve(null);
4812
+ }
4813
+ bulkAddResourceCalendarPeriods(request) {
4814
+ let url_ = this.baseUrl + "/resources/kpi/calendar-periods/bulk";
4815
+ url_ = url_.replace(/[?&]$/, "");
4816
+ const content_ = JSON.stringify(request);
4817
+ let options_ = {
4818
+ body: content_,
4819
+ method: "POST",
4820
+ headers: {
4821
+ "Content-Type": "application/json",
4822
+ "Accept": "application/json"
4823
+ }
4824
+ };
4825
+ return this.transformOptions(options_).then(transformedOptions_ => {
4826
+ return this.http.fetch(url_, transformedOptions_);
4827
+ }).then((_response) => {
4828
+ return this.processBulkAddResourceCalendarPeriods(_response);
4829
+ });
4830
+ }
4831
+ processBulkAddResourceCalendarPeriods(response) {
4832
+ const status = response.status;
4833
+ let _headers = {};
4834
+ if (response.headers && response.headers.forEach) {
4835
+ response.headers.forEach((v, k) => _headers[k] = v);
4836
+ }
4837
+ ;
4838
+ if (status === 200) {
4839
+ return response.text().then((_responseText) => {
4840
+ let result200 = null;
4841
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4842
+ return result200;
4843
+ });
4844
+ }
4845
+ else if (status !== 200 && status !== 204) {
4846
+ return response.text().then((_responseText) => {
4847
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
4848
+ });
4849
+ }
4850
+ return Promise.resolve(null);
4851
+ }
4852
+ copyResourceCalendarPeriod(id, request) {
4853
+ let url_ = this.baseUrl + "/resources/kpi/calendar-periods/{id}/copy";
4854
+ if (id === undefined || id === null)
4855
+ throw new globalThis.Error("The parameter 'id' must be defined.");
4856
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
4857
+ url_ = url_.replace(/[?&]$/, "");
4858
+ const content_ = JSON.stringify(request);
4859
+ let options_ = {
4860
+ body: content_,
4861
+ method: "POST",
4862
+ headers: {
4863
+ "Content-Type": "application/json",
4864
+ "Accept": "application/json"
4865
+ }
4866
+ };
4867
+ return this.transformOptions(options_).then(transformedOptions_ => {
4868
+ return this.http.fetch(url_, transformedOptions_);
4869
+ }).then((_response) => {
4870
+ return this.processCopyResourceCalendarPeriod(_response);
4871
+ });
4872
+ }
4873
+ processCopyResourceCalendarPeriod(response) {
4874
+ const status = response.status;
4875
+ let _headers = {};
4876
+ if (response.headers && response.headers.forEach) {
4877
+ response.headers.forEach((v, k) => _headers[k] = v);
4878
+ }
4879
+ ;
4880
+ if (status === 200) {
4881
+ return response.text().then((_responseText) => {
4882
+ let result200 = null;
4883
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4884
+ return result200;
4885
+ });
4886
+ }
4887
+ else if (status !== 200 && status !== 204) {
4888
+ return response.text().then((_responseText) => {
4889
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
4890
+ });
4891
+ }
4892
+ return Promise.resolve(null);
4893
+ }
4894
+ migrateResourceCapacity() {
4895
+ let url_ = this.baseUrl + "/resources/kpi/calendar-periods/migrate";
4896
+ url_ = url_.replace(/[?&]$/, "");
4897
+ let options_ = {
4898
+ method: "POST",
4899
+ headers: {
4900
+ "Accept": "application/json"
4901
+ }
4902
+ };
4903
+ return this.transformOptions(options_).then(transformedOptions_ => {
4904
+ return this.http.fetch(url_, transformedOptions_);
4905
+ }).then((_response) => {
4906
+ return this.processMigrateResourceCapacity(_response);
4907
+ });
4908
+ }
4909
+ processMigrateResourceCapacity(response) {
4910
+ const status = response.status;
4911
+ let _headers = {};
4912
+ if (response.headers && response.headers.forEach) {
4913
+ response.headers.forEach((v, k) => _headers[k] = v);
4914
+ }
4915
+ ;
4916
+ if (status === 200) {
4917
+ return response.text().then((_responseText) => {
4918
+ let result200 = null;
4919
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4920
+ return result200;
4921
+ });
4922
+ }
4923
+ else if (status !== 200 && status !== 204) {
4924
+ return response.text().then((_responseText) => {
4925
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
4926
+ });
4927
+ }
4928
+ return Promise.resolve(null);
4929
+ }
4930
+ migrateCalendarIds() {
4931
+ let url_ = this.baseUrl + "/resources/kpi/calendar-periods/migrate-ids";
4932
+ url_ = url_.replace(/[?&]$/, "");
4933
+ let options_ = {
4934
+ method: "POST",
4935
+ headers: {
4936
+ "Accept": "application/json"
4937
+ }
4938
+ };
4939
+ return this.transformOptions(options_).then(transformedOptions_ => {
4940
+ return this.http.fetch(url_, transformedOptions_);
4941
+ }).then((_response) => {
4942
+ return this.processMigrateCalendarIds(_response);
4943
+ });
4944
+ }
4945
+ processMigrateCalendarIds(response) {
4946
+ const status = response.status;
4947
+ let _headers = {};
4948
+ if (response.headers && response.headers.forEach) {
4949
+ response.headers.forEach((v, k) => _headers[k] = v);
4950
+ }
4951
+ ;
4952
+ if (status === 200) {
4953
+ return response.text().then((_responseText) => {
4954
+ let result200 = null;
4955
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4956
+ return result200;
4957
+ });
4958
+ }
4959
+ else if (status !== 200 && status !== 204) {
4960
+ return response.text().then((_responseText) => {
4961
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
4962
+ });
4963
+ }
4964
+ return Promise.resolve(null);
4965
+ }
4966
+ }
4483
4967
  export class KpiResourceClient extends AuthorizedApiBase {
4484
4968
  constructor(configuration, baseUrl, http) {
4485
4969
  super(configuration);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ignos/api-client",
3
- "version": "20260506.122.1",
3
+ "version": "20260507.123.1-alpha",
4
4
  "description": "IGNOS API Client",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -4839,6 +4839,513 @@ export class KpiAdminResourceClient extends AuthorizedApiBase implements IKpiAdm
4839
4839
  }
4840
4840
  }
4841
4841
 
4842
+ export interface IKpiCalendarClient {
4843
+
4844
+ listCalendarDefinitions(): Promise<CalendarDefinitionDto[]>;
4845
+
4846
+ createCalendarDefinition(request: CreateCalendarDefinition): Promise<CalendarDefinitionDto>;
4847
+
4848
+ updateCalendarDefinition(id: string, request: UpdateCalendarDefinition): Promise<CalendarDefinitionDto>;
4849
+
4850
+ deleteCalendarDefinition(id: string): Promise<FileResponse>;
4851
+
4852
+ listResourceCalendarPeriods(): Promise<ResourceCalendarPeriodGroupDto[]>;
4853
+
4854
+ addResourceCalendarPeriod(request: AddResourceCalendarPeriod): Promise<ResourceCalendarPeriodDto>;
4855
+
4856
+ updateResourceCalendarPeriod(id: string, request: UpdateResourceCalendarPeriod): Promise<ResourceCalendarPeriodDto>;
4857
+
4858
+ deleteResourceCalendarPeriod(id: string): Promise<FileResponse>;
4859
+
4860
+ bulkAddResourceCalendarPeriods(request: BulkAddResourceCalendarPeriods): Promise<ResourceCalendarPeriodDto[]>;
4861
+
4862
+ copyResourceCalendarPeriod(id: string, request: CopyResourceCalendarPeriod): Promise<ResourceCalendarPeriodDto>;
4863
+
4864
+ migrateResourceCapacity(): Promise<MigrationResultDto>;
4865
+
4866
+ migrateCalendarIds(): Promise<MigrationResultDto>;
4867
+ }
4868
+
4869
+ export class KpiCalendarClient extends AuthorizedApiBase implements IKpiCalendarClient {
4870
+ private http: { fetch(url: RequestInfo, init?: RequestInit): Promise<Response> };
4871
+ private baseUrl: string;
4872
+
4873
+ constructor(configuration: IAccessTokenProvider, baseUrl?: string, http?: { fetch(url: RequestInfo, init?: RequestInit): Promise<Response> }) {
4874
+ super(configuration);
4875
+ this.http = http ? http : window as any;
4876
+ this.baseUrl = baseUrl ?? "";
4877
+ }
4878
+
4879
+ listCalendarDefinitions(): Promise<CalendarDefinitionDto[]> {
4880
+ let url_ = this.baseUrl + "/resources/kpi/calendar-definitions";
4881
+ url_ = url_.replace(/[?&]$/, "");
4882
+
4883
+ let options_: RequestInit = {
4884
+ method: "GET",
4885
+ headers: {
4886
+ "Accept": "application/json"
4887
+ }
4888
+ };
4889
+
4890
+ return this.transformOptions(options_).then(transformedOptions_ => {
4891
+ return this.http.fetch(url_, transformedOptions_);
4892
+ }).then((_response: Response) => {
4893
+ return this.processListCalendarDefinitions(_response);
4894
+ });
4895
+ }
4896
+
4897
+ protected processListCalendarDefinitions(response: Response): Promise<CalendarDefinitionDto[]> {
4898
+ const status = response.status;
4899
+ let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
4900
+ if (status === 200) {
4901
+ return response.text().then((_responseText) => {
4902
+ let result200: any = null;
4903
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as CalendarDefinitionDto[];
4904
+ return result200;
4905
+ });
4906
+ } else if (status !== 200 && status !== 204) {
4907
+ return response.text().then((_responseText) => {
4908
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
4909
+ });
4910
+ }
4911
+ return Promise.resolve<CalendarDefinitionDto[]>(null as any);
4912
+ }
4913
+
4914
+ createCalendarDefinition(request: CreateCalendarDefinition): Promise<CalendarDefinitionDto> {
4915
+ let url_ = this.baseUrl + "/resources/kpi/calendar-definitions";
4916
+ url_ = url_.replace(/[?&]$/, "");
4917
+
4918
+ const content_ = JSON.stringify(request);
4919
+
4920
+ let options_: RequestInit = {
4921
+ body: content_,
4922
+ method: "POST",
4923
+ headers: {
4924
+ "Content-Type": "application/json",
4925
+ "Accept": "application/json"
4926
+ }
4927
+ };
4928
+
4929
+ return this.transformOptions(options_).then(transformedOptions_ => {
4930
+ return this.http.fetch(url_, transformedOptions_);
4931
+ }).then((_response: Response) => {
4932
+ return this.processCreateCalendarDefinition(_response);
4933
+ });
4934
+ }
4935
+
4936
+ protected processCreateCalendarDefinition(response: Response): Promise<CalendarDefinitionDto> {
4937
+ const status = response.status;
4938
+ let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
4939
+ if (status === 200) {
4940
+ return response.text().then((_responseText) => {
4941
+ let result200: any = null;
4942
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as CalendarDefinitionDto;
4943
+ return result200;
4944
+ });
4945
+ } else if (status !== 200 && status !== 204) {
4946
+ return response.text().then((_responseText) => {
4947
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
4948
+ });
4949
+ }
4950
+ return Promise.resolve<CalendarDefinitionDto>(null as any);
4951
+ }
4952
+
4953
+ updateCalendarDefinition(id: string, request: UpdateCalendarDefinition): Promise<CalendarDefinitionDto> {
4954
+ let url_ = this.baseUrl + "/resources/kpi/calendar-definitions/{id}";
4955
+ if (id === undefined || id === null)
4956
+ throw new globalThis.Error("The parameter 'id' must be defined.");
4957
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
4958
+ url_ = url_.replace(/[?&]$/, "");
4959
+
4960
+ const content_ = JSON.stringify(request);
4961
+
4962
+ let options_: RequestInit = {
4963
+ body: content_,
4964
+ method: "PUT",
4965
+ headers: {
4966
+ "Content-Type": "application/json",
4967
+ "Accept": "application/json"
4968
+ }
4969
+ };
4970
+
4971
+ return this.transformOptions(options_).then(transformedOptions_ => {
4972
+ return this.http.fetch(url_, transformedOptions_);
4973
+ }).then((_response: Response) => {
4974
+ return this.processUpdateCalendarDefinition(_response);
4975
+ });
4976
+ }
4977
+
4978
+ protected processUpdateCalendarDefinition(response: Response): Promise<CalendarDefinitionDto> {
4979
+ const status = response.status;
4980
+ let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
4981
+ if (status === 200) {
4982
+ return response.text().then((_responseText) => {
4983
+ let result200: any = null;
4984
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as CalendarDefinitionDto;
4985
+ return result200;
4986
+ });
4987
+ } else if (status !== 200 && status !== 204) {
4988
+ return response.text().then((_responseText) => {
4989
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
4990
+ });
4991
+ }
4992
+ return Promise.resolve<CalendarDefinitionDto>(null as any);
4993
+ }
4994
+
4995
+ deleteCalendarDefinition(id: string): Promise<FileResponse> {
4996
+ let url_ = this.baseUrl + "/resources/kpi/calendar-definitions/{id}";
4997
+ if (id === undefined || id === null)
4998
+ throw new globalThis.Error("The parameter 'id' must be defined.");
4999
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
5000
+ url_ = url_.replace(/[?&]$/, "");
5001
+
5002
+ let options_: RequestInit = {
5003
+ method: "DELETE",
5004
+ headers: {
5005
+ "Accept": "application/octet-stream"
5006
+ }
5007
+ };
5008
+
5009
+ return this.transformOptions(options_).then(transformedOptions_ => {
5010
+ return this.http.fetch(url_, transformedOptions_);
5011
+ }).then((_response: Response) => {
5012
+ return this.processDeleteCalendarDefinition(_response);
5013
+ });
5014
+ }
5015
+
5016
+ protected processDeleteCalendarDefinition(response: Response): Promise<FileResponse> {
5017
+ const status = response.status;
5018
+ let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
5019
+ if (status === 200 || status === 206) {
5020
+ const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
5021
+ let fileNameMatch = contentDisposition ? /filename\*=(?:(\\?['"])(.*?)\1|(?:[^\s]+'.*?')?([^;\n]*))/g.exec(contentDisposition) : undefined;
5022
+ let fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[3] || fileNameMatch[2] : undefined;
5023
+ if (fileName) {
5024
+ fileName = decodeURIComponent(fileName);
5025
+ } else {
5026
+ fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
5027
+ fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
5028
+ }
5029
+ return response.blob().then(blob => { return { fileName: fileName, data: blob, status: status, headers: _headers }; });
5030
+ } else if (status !== 200 && status !== 204) {
5031
+ return response.text().then((_responseText) => {
5032
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
5033
+ });
5034
+ }
5035
+ return Promise.resolve<FileResponse>(null as any);
5036
+ }
5037
+
5038
+ listResourceCalendarPeriods(): Promise<ResourceCalendarPeriodGroupDto[]> {
5039
+ let url_ = this.baseUrl + "/resources/kpi/calendar-periods";
5040
+ url_ = url_.replace(/[?&]$/, "");
5041
+
5042
+ let options_: RequestInit = {
5043
+ method: "GET",
5044
+ headers: {
5045
+ "Accept": "application/json"
5046
+ }
5047
+ };
5048
+
5049
+ return this.transformOptions(options_).then(transformedOptions_ => {
5050
+ return this.http.fetch(url_, transformedOptions_);
5051
+ }).then((_response: Response) => {
5052
+ return this.processListResourceCalendarPeriods(_response);
5053
+ });
5054
+ }
5055
+
5056
+ protected processListResourceCalendarPeriods(response: Response): Promise<ResourceCalendarPeriodGroupDto[]> {
5057
+ const status = response.status;
5058
+ let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
5059
+ if (status === 200) {
5060
+ return response.text().then((_responseText) => {
5061
+ let result200: any = null;
5062
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as ResourceCalendarPeriodGroupDto[];
5063
+ return result200;
5064
+ });
5065
+ } else if (status !== 200 && status !== 204) {
5066
+ return response.text().then((_responseText) => {
5067
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
5068
+ });
5069
+ }
5070
+ return Promise.resolve<ResourceCalendarPeriodGroupDto[]>(null as any);
5071
+ }
5072
+
5073
+ addResourceCalendarPeriod(request: AddResourceCalendarPeriod): Promise<ResourceCalendarPeriodDto> {
5074
+ let url_ = this.baseUrl + "/resources/kpi/calendar-periods";
5075
+ url_ = url_.replace(/[?&]$/, "");
5076
+
5077
+ const content_ = JSON.stringify(request);
5078
+
5079
+ let options_: RequestInit = {
5080
+ body: content_,
5081
+ method: "POST",
5082
+ headers: {
5083
+ "Content-Type": "application/json",
5084
+ "Accept": "application/json"
5085
+ }
5086
+ };
5087
+
5088
+ return this.transformOptions(options_).then(transformedOptions_ => {
5089
+ return this.http.fetch(url_, transformedOptions_);
5090
+ }).then((_response: Response) => {
5091
+ return this.processAddResourceCalendarPeriod(_response);
5092
+ });
5093
+ }
5094
+
5095
+ protected processAddResourceCalendarPeriod(response: Response): Promise<ResourceCalendarPeriodDto> {
5096
+ const status = response.status;
5097
+ let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
5098
+ if (status === 200) {
5099
+ return response.text().then((_responseText) => {
5100
+ let result200: any = null;
5101
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as ResourceCalendarPeriodDto;
5102
+ return result200;
5103
+ });
5104
+ } else if (status !== 200 && status !== 204) {
5105
+ return response.text().then((_responseText) => {
5106
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
5107
+ });
5108
+ }
5109
+ return Promise.resolve<ResourceCalendarPeriodDto>(null as any);
5110
+ }
5111
+
5112
+ updateResourceCalendarPeriod(id: string, request: UpdateResourceCalendarPeriod): Promise<ResourceCalendarPeriodDto> {
5113
+ let url_ = this.baseUrl + "/resources/kpi/calendar-periods/{id}";
5114
+ if (id === undefined || id === null)
5115
+ throw new globalThis.Error("The parameter 'id' must be defined.");
5116
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
5117
+ url_ = url_.replace(/[?&]$/, "");
5118
+
5119
+ const content_ = JSON.stringify(request);
5120
+
5121
+ let options_: RequestInit = {
5122
+ body: content_,
5123
+ method: "PUT",
5124
+ headers: {
5125
+ "Content-Type": "application/json",
5126
+ "Accept": "application/json"
5127
+ }
5128
+ };
5129
+
5130
+ return this.transformOptions(options_).then(transformedOptions_ => {
5131
+ return this.http.fetch(url_, transformedOptions_);
5132
+ }).then((_response: Response) => {
5133
+ return this.processUpdateResourceCalendarPeriod(_response);
5134
+ });
5135
+ }
5136
+
5137
+ protected processUpdateResourceCalendarPeriod(response: Response): Promise<ResourceCalendarPeriodDto> {
5138
+ const status = response.status;
5139
+ let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
5140
+ if (status === 200) {
5141
+ return response.text().then((_responseText) => {
5142
+ let result200: any = null;
5143
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as ResourceCalendarPeriodDto;
5144
+ return result200;
5145
+ });
5146
+ } else if (status !== 200 && status !== 204) {
5147
+ return response.text().then((_responseText) => {
5148
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
5149
+ });
5150
+ }
5151
+ return Promise.resolve<ResourceCalendarPeriodDto>(null as any);
5152
+ }
5153
+
5154
+ deleteResourceCalendarPeriod(id: string): Promise<FileResponse> {
5155
+ let url_ = this.baseUrl + "/resources/kpi/calendar-periods/{id}";
5156
+ if (id === undefined || id === null)
5157
+ throw new globalThis.Error("The parameter 'id' must be defined.");
5158
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
5159
+ url_ = url_.replace(/[?&]$/, "");
5160
+
5161
+ let options_: RequestInit = {
5162
+ method: "DELETE",
5163
+ headers: {
5164
+ "Accept": "application/octet-stream"
5165
+ }
5166
+ };
5167
+
5168
+ return this.transformOptions(options_).then(transformedOptions_ => {
5169
+ return this.http.fetch(url_, transformedOptions_);
5170
+ }).then((_response: Response) => {
5171
+ return this.processDeleteResourceCalendarPeriod(_response);
5172
+ });
5173
+ }
5174
+
5175
+ protected processDeleteResourceCalendarPeriod(response: Response): Promise<FileResponse> {
5176
+ const status = response.status;
5177
+ let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
5178
+ if (status === 200 || status === 206) {
5179
+ const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
5180
+ let fileNameMatch = contentDisposition ? /filename\*=(?:(\\?['"])(.*?)\1|(?:[^\s]+'.*?')?([^;\n]*))/g.exec(contentDisposition) : undefined;
5181
+ let fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[3] || fileNameMatch[2] : undefined;
5182
+ if (fileName) {
5183
+ fileName = decodeURIComponent(fileName);
5184
+ } else {
5185
+ fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
5186
+ fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
5187
+ }
5188
+ return response.blob().then(blob => { return { fileName: fileName, data: blob, status: status, headers: _headers }; });
5189
+ } else if (status !== 200 && status !== 204) {
5190
+ return response.text().then((_responseText) => {
5191
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
5192
+ });
5193
+ }
5194
+ return Promise.resolve<FileResponse>(null as any);
5195
+ }
5196
+
5197
+ bulkAddResourceCalendarPeriods(request: BulkAddResourceCalendarPeriods): Promise<ResourceCalendarPeriodDto[]> {
5198
+ let url_ = this.baseUrl + "/resources/kpi/calendar-periods/bulk";
5199
+ url_ = url_.replace(/[?&]$/, "");
5200
+
5201
+ const content_ = JSON.stringify(request);
5202
+
5203
+ let options_: RequestInit = {
5204
+ body: content_,
5205
+ method: "POST",
5206
+ headers: {
5207
+ "Content-Type": "application/json",
5208
+ "Accept": "application/json"
5209
+ }
5210
+ };
5211
+
5212
+ return this.transformOptions(options_).then(transformedOptions_ => {
5213
+ return this.http.fetch(url_, transformedOptions_);
5214
+ }).then((_response: Response) => {
5215
+ return this.processBulkAddResourceCalendarPeriods(_response);
5216
+ });
5217
+ }
5218
+
5219
+ protected processBulkAddResourceCalendarPeriods(response: Response): Promise<ResourceCalendarPeriodDto[]> {
5220
+ const status = response.status;
5221
+ let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
5222
+ if (status === 200) {
5223
+ return response.text().then((_responseText) => {
5224
+ let result200: any = null;
5225
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as ResourceCalendarPeriodDto[];
5226
+ return result200;
5227
+ });
5228
+ } else if (status !== 200 && status !== 204) {
5229
+ return response.text().then((_responseText) => {
5230
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
5231
+ });
5232
+ }
5233
+ return Promise.resolve<ResourceCalendarPeriodDto[]>(null as any);
5234
+ }
5235
+
5236
+ copyResourceCalendarPeriod(id: string, request: CopyResourceCalendarPeriod): Promise<ResourceCalendarPeriodDto> {
5237
+ let url_ = this.baseUrl + "/resources/kpi/calendar-periods/{id}/copy";
5238
+ if (id === undefined || id === null)
5239
+ throw new globalThis.Error("The parameter 'id' must be defined.");
5240
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
5241
+ url_ = url_.replace(/[?&]$/, "");
5242
+
5243
+ const content_ = JSON.stringify(request);
5244
+
5245
+ let options_: RequestInit = {
5246
+ body: content_,
5247
+ method: "POST",
5248
+ headers: {
5249
+ "Content-Type": "application/json",
5250
+ "Accept": "application/json"
5251
+ }
5252
+ };
5253
+
5254
+ return this.transformOptions(options_).then(transformedOptions_ => {
5255
+ return this.http.fetch(url_, transformedOptions_);
5256
+ }).then((_response: Response) => {
5257
+ return this.processCopyResourceCalendarPeriod(_response);
5258
+ });
5259
+ }
5260
+
5261
+ protected processCopyResourceCalendarPeriod(response: Response): Promise<ResourceCalendarPeriodDto> {
5262
+ const status = response.status;
5263
+ let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
5264
+ if (status === 200) {
5265
+ return response.text().then((_responseText) => {
5266
+ let result200: any = null;
5267
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as ResourceCalendarPeriodDto;
5268
+ return result200;
5269
+ });
5270
+ } else if (status !== 200 && status !== 204) {
5271
+ return response.text().then((_responseText) => {
5272
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
5273
+ });
5274
+ }
5275
+ return Promise.resolve<ResourceCalendarPeriodDto>(null as any);
5276
+ }
5277
+
5278
+ migrateResourceCapacity(): Promise<MigrationResultDto> {
5279
+ let url_ = this.baseUrl + "/resources/kpi/calendar-periods/migrate";
5280
+ url_ = url_.replace(/[?&]$/, "");
5281
+
5282
+ let options_: RequestInit = {
5283
+ method: "POST",
5284
+ headers: {
5285
+ "Accept": "application/json"
5286
+ }
5287
+ };
5288
+
5289
+ return this.transformOptions(options_).then(transformedOptions_ => {
5290
+ return this.http.fetch(url_, transformedOptions_);
5291
+ }).then((_response: Response) => {
5292
+ return this.processMigrateResourceCapacity(_response);
5293
+ });
5294
+ }
5295
+
5296
+ protected processMigrateResourceCapacity(response: Response): Promise<MigrationResultDto> {
5297
+ const status = response.status;
5298
+ let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
5299
+ if (status === 200) {
5300
+ return response.text().then((_responseText) => {
5301
+ let result200: any = null;
5302
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as MigrationResultDto;
5303
+ return result200;
5304
+ });
5305
+ } else if (status !== 200 && status !== 204) {
5306
+ return response.text().then((_responseText) => {
5307
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
5308
+ });
5309
+ }
5310
+ return Promise.resolve<MigrationResultDto>(null as any);
5311
+ }
5312
+
5313
+ migrateCalendarIds(): Promise<MigrationResultDto> {
5314
+ let url_ = this.baseUrl + "/resources/kpi/calendar-periods/migrate-ids";
5315
+ url_ = url_.replace(/[?&]$/, "");
5316
+
5317
+ let options_: RequestInit = {
5318
+ method: "POST",
5319
+ headers: {
5320
+ "Accept": "application/json"
5321
+ }
5322
+ };
5323
+
5324
+ return this.transformOptions(options_).then(transformedOptions_ => {
5325
+ return this.http.fetch(url_, transformedOptions_);
5326
+ }).then((_response: Response) => {
5327
+ return this.processMigrateCalendarIds(_response);
5328
+ });
5329
+ }
5330
+
5331
+ protected processMigrateCalendarIds(response: Response): Promise<MigrationResultDto> {
5332
+ const status = response.status;
5333
+ let _headers: any = {}; if (response.headers && response.headers.forEach) { response.headers.forEach((v: any, k: any) => _headers[k] = v); };
5334
+ if (status === 200) {
5335
+ return response.text().then((_responseText) => {
5336
+ let result200: any = null;
5337
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver) as MigrationResultDto;
5338
+ return result200;
5339
+ });
5340
+ } else if (status !== 200 && status !== 204) {
5341
+ return response.text().then((_responseText) => {
5342
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
5343
+ });
5344
+ }
5345
+ return Promise.resolve<MigrationResultDto>(null as any);
5346
+ }
5347
+ }
5348
+
4842
5349
  export interface IKpiResourceClient {
4843
5350
 
4844
5351
  getResourceKpi(resourceExternalId: string | undefined, previousPeriodStartDate: Date | undefined, startDate: Date | undefined, endDate: Date | undefined, utcOffset: number | undefined): Promise<ResourceKpiDto>;
@@ -30511,6 +31018,82 @@ export interface UpdateCalendarSettingsCommand {
30511
31018
  defaultPerformancePercent?: number | null;
30512
31019
  }
30513
31020
 
31021
+ export interface CalendarDefinitionDto {
31022
+ id?: string;
31023
+ name?: string;
31024
+ hoursPerWeekday?: { [key in DayOfWeek]?: number; };
31025
+ created?: Date | null;
31026
+ updatedBy?: string | null;
31027
+ }
31028
+
31029
+ export interface CreateCalendarDefinition {
31030
+ name: string;
31031
+ hoursPerWeekday: { [key in DayOfWeek]?: number; };
31032
+ }
31033
+
31034
+ export interface UpdateCalendarDefinition {
31035
+ id: string;
31036
+ name?: string | null;
31037
+ hoursPerWeekday?: { [key in DayOfWeek]?: number; } | null;
31038
+ }
31039
+
31040
+ export interface ResourceCalendarPeriodGroupDto {
31041
+ department?: string | null;
31042
+ resources?: ResourceCalendarPeriodsDto[];
31043
+ }
31044
+
31045
+ export interface ResourceCalendarPeriodsDto {
31046
+ resourceExternalId?: string;
31047
+ resourceName?: string;
31048
+ periods?: ResourceCalendarPeriodDto[];
31049
+ }
31050
+
31051
+ export interface ResourceCalendarPeriodDto {
31052
+ id?: string;
31053
+ resourceExternalId?: string;
31054
+ calendarDefinitionId?: string;
31055
+ calendarDefinitionName?: string;
31056
+ effectiveFrom?: string;
31057
+ effectiveTo?: string | null;
31058
+ targetPercent?: number;
31059
+ comment?: string | null;
31060
+ }
31061
+
31062
+ export interface AddResourceCalendarPeriod {
31063
+ resourceExternalId: string;
31064
+ calendarDefinitionId: string;
31065
+ effectiveFrom: string;
31066
+ targetPercent: number;
31067
+ comment?: string | null;
31068
+ }
31069
+
31070
+ export interface UpdateResourceCalendarPeriod {
31071
+ id: string;
31072
+ calendarDefinitionId?: string | null;
31073
+ targetPercent?: number | null;
31074
+ effectiveFrom?: string | null;
31075
+ comment?: string | null;
31076
+ }
31077
+
31078
+ export interface BulkAddResourceCalendarPeriods {
31079
+ resourceExternalIds: string[];
31080
+ calendarDefinitionId: string;
31081
+ effectiveFrom: string;
31082
+ targetPercent: number;
31083
+ comment?: string | null;
31084
+ }
31085
+
31086
+ export interface CopyResourceCalendarPeriod {
31087
+ sourcePeriodId: string;
31088
+ targetResourceExternalId: string;
31089
+ effectiveFrom: string;
31090
+ }
31091
+
31092
+ export interface MigrationResultDto {
31093
+ created?: number;
31094
+ skipped?: number;
31095
+ }
31096
+
30514
31097
  export interface ResourceKpiDto {
30515
31098
  uptimeToNow: number;
30516
31099
  uptimeToNowPreviousPeriod: number;
@@ -30557,6 +31140,7 @@ export interface ApplicationResourcesResourceGroupDto {
30557
31140
  id: string;
30558
31141
  name: string;
30559
31142
  companyId?: string | null;
31143
+ department?: string | null;
30560
31144
  resources: ResourceGroupMemberDto[];
30561
31145
  }
30562
31146