@veloceapps/api 8.0.0-193 → 8.0.0-195

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.
@@ -4,7 +4,7 @@ import * as i0 from '@angular/core';
4
4
  import { Injectable, NgModule } from '@angular/core';
5
5
  import * as i1 from '@veloceapps/core';
6
6
  import { uiDefinitionFromDTO, ConfigurationContextMode, isLegacyDocumentTemplate, DocxTemplater, QuoteDraft, StringUtils, Expression, toLatestFlow, isDefined, Operator, ModelTranslatorUtils, ProductModelsContainer, ModelUtils, EntityUtil, RuleGroupTypes, parseJsonSafely, uiDefinitionToDTO, BaseHttpService, XrayService } from '@veloceapps/core';
7
- import { noop, throwError, of, zip, forkJoin, map as map$1, catchError as catchError$1, switchMap as switchMap$1 } from 'rxjs';
7
+ import { noop, throwError, of, zip, forkJoin, map as map$1, from, catchError as catchError$1, switchMap as switchMap$1 } from 'rxjs';
8
8
  import { map, catchError, tap, switchMap, defaultIfEmpty } from 'rxjs/operators';
9
9
  import * as i2 from 'primeng/api';
10
10
  import { CurrencyPipe } from '@angular/common';
@@ -1553,20 +1553,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1553
1553
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
1554
1554
 
1555
1555
  class OrgInfoApiService {
1556
- constructor(http) {
1557
- this.http = http;
1558
- this.CANVAS_URL_FALLBACK = 'https://canvas.velocpq.com';
1559
- this.hostUrl = window.VELO_CANVAS_API ?? this.CANVAS_URL_FALLBACK;
1556
+ getOrgInfo$() {
1557
+ try {
1558
+ return window.doCanvasCall && window.ORGANIZATION_ID
1559
+ ? from(window.doCanvasCall(`org-info/${window.ORGANIZATION_ID}`)).pipe(map$1(data => JSON.parse(data)), catchError$1(() => of(undefined)))
1560
+ : of(undefined);
1561
+ }
1562
+ catch {
1563
+ return of(undefined);
1564
+ }
1560
1565
  }
1561
- getOrgInfo$(organizationId) {
1562
- return this.http.get(`${this.hostUrl}/org-info/${organizationId}`);
1566
+ getAvailableVersionsInfo$() {
1567
+ try {
1568
+ return window.doCanvasCall && window.ORGANIZATION_ID
1569
+ ? from(window.doCanvasCall('versions/available', 'include_all=true')).pipe(map$1(data => JSON.parse(data)), catchError$1(() => of(undefined)))
1570
+ : of(undefined);
1571
+ }
1572
+ catch {
1573
+ return of(undefined);
1574
+ }
1575
+ }
1576
+ upgradeVersion$(targetVersion) {
1577
+ try {
1578
+ return window.doCanvasCall && window.ORGANIZATION_ID
1579
+ ? from(window.doCanvasCall('versions/upgrade', `target_version=${targetVersion}`)).pipe(map$1(data => JSON.parse(data)), catchError$1(() => of(undefined)))
1580
+ : of(undefined);
1581
+ }
1582
+ catch {
1583
+ return of(undefined);
1584
+ }
1563
1585
  }
1564
1586
  }
1565
- OrgInfoApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrgInfoApiService, deps: [{ token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1587
+ OrgInfoApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrgInfoApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1566
1588
  OrgInfoApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrgInfoApiService });
1567
1589
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: OrgInfoApiService, decorators: [{
1568
1590
  type: Injectable
1569
- }], ctorParameters: function () { return [{ type: i1$1.HttpClient }]; } });
1591
+ }] });
1570
1592
 
1571
1593
  class PicklistsApiService {
1572
1594
  constructor(baseHttpService) {