@veloceapps/api 7.0.2-53 → 7.0.2-55

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, isLegacyUIDefinition, ModelTranslatorUtils, ConfigurationContextMode, isLegacyDocumentTemplate, DocxTemplater, QuoteDraft, StringUtils, Expression, Operator, 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, delay } from 'rxjs';
7
+ import { noop, throwError, of, zip, forkJoin, map as map$1, 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';
@@ -683,10 +683,21 @@ class SalesforceApiService {
683
683
  ...options,
684
684
  });
685
685
  }
686
+ /**
687
+ * @deprecated
688
+ */
686
689
  describe(objectName, fieldName, options) {
687
690
  const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields` + (fieldName ? `/${fieldName}` : '');
688
691
  return this.httpService.api({ url: methodUrl, ...options });
689
692
  }
693
+ describeObject(objectName, options) {
694
+ const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields`;
695
+ return this.httpService.api({ url: methodUrl, ...options });
696
+ }
697
+ describeField(objectName, fieldName, options) {
698
+ const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields/${fieldName}`;
699
+ return this.httpService.api({ url: methodUrl, ...options });
700
+ }
690
701
  describe2(objectName, fields, options) {
691
702
  const methodUrl = `${this.SERVICE_URL}/describe/${objectName}/fields`;
692
703
  return this.httpService.api({ method: 'post', url: methodUrl, body: fields, ...options });
@@ -2491,96 +2502,81 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImpor
2491
2502
  type: Injectable
2492
2503
  }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2493
2504
 
2494
- const categories = [
2495
- { id: '1', name: 'Category 1' },
2496
- { id: '2', name: 'Category 2', parentId: '1' },
2497
- { id: '3', name: 'Category 3', parentId: '1' },
2498
- { id: '4', name: 'Category 4' },
2499
- { id: '5', name: 'Category 5', parentId: '4' },
2500
- { id: '6', name: 'Category 6', parentId: '2' },
2501
- ];
2502
- const objects = [
2503
- {
2504
- id: '1',
2505
- name: 'Loyality_Data',
2506
- label: 'Loyality Data',
2507
- categoryId: '1',
2508
- columns: [
2509
- { name: 'Account', label: 'Account', type: 'OBJECT', objectName: 'Account' },
2510
- { name: 'Boolean', label: 'Boolean', type: 'BOOLEAN' },
2511
- { name: 'Date', label: 'Date', type: 'DATE' },
2512
- { name: 'Integer', label: 'Integer', type: 'INTEGER' },
2513
- { name: 'Discount', label: 'Discount, %', type: 'DECIMAL' },
2514
- { name: 'Level', label: 'Level', type: 'STRING' },
2515
- ],
2516
- data: [
2517
- {
2518
- id: '1',
2519
- Account: '001DH00000uEMFaYAO',
2520
- Boolean: true,
2521
- Integer: 1,
2522
- Date: '2023-06-30',
2523
- Discount: 33.5,
2524
- Level: 'Premium',
2525
- },
2526
- {
2527
- id: '2',
2528
- Account: '001DH00000uOdfjYAC',
2529
- Boolean: false,
2530
- Integer: 2,
2531
- Date: '2023-07-01',
2532
- Discount: 20.1,
2533
- Level: 'Advanced',
2534
- },
2535
- ],
2536
- },
2537
- {
2538
- id: '2',
2539
- name: 'New_object',
2540
- label: 'New object',
2541
- columns: [
2542
- { name: 'Account', label: 'Account', type: 'OBJECT', objectName: 'Account' },
2543
- { name: 'Boolean', label: 'Boolean', type: 'BOOLEAN' },
2544
- { name: 'Date', label: 'Date', type: 'DATE' },
2545
- { name: 'Integer', label: 'Integer', type: 'INTEGER' },
2546
- { name: 'Discount', label: 'Discount, %', type: 'DECIMAL' },
2547
- { name: 'Level', label: 'Level', type: 'STRING' },
2548
- ],
2549
- data: [
2550
- {
2551
- id: '1',
2552
- Account: '001DH00000uEMFaYAO',
2553
- Boolean: true,
2554
- Integer: 1,
2555
- Date: '2023-06-30',
2556
- Discount: 33.5,
2557
- Level: 'Premium',
2558
- },
2559
- {
2560
- id: '2',
2561
- Account: '001DH00000uEMRuYAO',
2562
- Boolean: false,
2563
- Integer: 2,
2564
- Date: '2023-07-01',
2565
- Discount: 20.1,
2566
- Level: 'Advanced',
2567
- },
2568
- ],
2569
- },
2570
- ];
2571
2505
  class VeloceObjectsApiService {
2572
- getCategories() {
2573
- return of(categories).pipe(delay(1000));
2506
+ constructor(baseHttpService) {
2507
+ this.baseHttpService = baseHttpService;
2508
+ this.serviceUrl = '/veloceobjects';
2509
+ this.updateCategory$ = (category) => {
2510
+ return this.baseHttpService.api({
2511
+ method: 'put',
2512
+ url: `${this.serviceUrl}/categories/${category.id}`,
2513
+ body: category,
2514
+ });
2515
+ };
2516
+ this.deleteCategory$ = (id) => {
2517
+ return this.baseHttpService.api({
2518
+ method: 'delete',
2519
+ url: `${this.serviceUrl}/categories/${id}`,
2520
+ });
2521
+ };
2522
+ this.searchObjects$ = (searchParams, expression) => {
2523
+ const params = new HttpParams({ fromObject: { ...searchParams } });
2524
+ return this.baseHttpService.api({
2525
+ method: 'post',
2526
+ url: `${this.serviceUrl}/search`,
2527
+ params,
2528
+ body: expression || {},
2529
+ });
2530
+ };
2531
+ this.deleteObject$ = (id) => {
2532
+ return this.baseHttpService.api({
2533
+ method: 'delete',
2534
+ url: `${this.serviceUrl}/${id}`,
2535
+ });
2536
+ };
2537
+ this.restoreObject$ = (id) => {
2538
+ return this.baseHttpService.api({
2539
+ method: 'patch',
2540
+ url: `${this.serviceUrl}/${id}/restore`,
2541
+ });
2542
+ };
2574
2543
  }
2575
- getObjects() {
2576
- return of(objects).pipe(delay(1000));
2544
+ fetchCategories$() {
2545
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/categories` });
2546
+ }
2547
+ createCategory$(category) {
2548
+ return this.baseHttpService.api({
2549
+ method: 'post',
2550
+ url: `${this.serviceUrl}/categories`,
2551
+ body: category,
2552
+ });
2553
+ }
2554
+ fetchObjects$() {
2555
+ return this.baseHttpService.api({ url: `${this.serviceUrl}` });
2556
+ }
2557
+ fetchObject$(id) {
2558
+ return this.baseHttpService.api({ url: `${this.serviceUrl}/${id}` });
2559
+ }
2560
+ createObject$(object) {
2561
+ return this.baseHttpService.api({
2562
+ method: 'post',
2563
+ url: `${this.serviceUrl}`,
2564
+ body: object,
2565
+ });
2566
+ }
2567
+ updateObject$(object) {
2568
+ return this.baseHttpService.api({
2569
+ method: 'put',
2570
+ url: `${this.serviceUrl}/${object.id}`,
2571
+ body: object,
2572
+ });
2577
2573
  }
2578
2574
  }
2579
- VeloceObjectsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: VeloceObjectsApiService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2575
+ VeloceObjectsApiService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: VeloceObjectsApiService, deps: [{ token: i1.BaseHttpService }], target: i0.ɵɵFactoryTarget.Injectable });
2580
2576
  VeloceObjectsApiService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: VeloceObjectsApiService });
2581
2577
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.8", ngImport: i0, type: VeloceObjectsApiService, decorators: [{
2582
2578
  type: Injectable
2583
- }] });
2579
+ }], ctorParameters: function () { return [{ type: i1.BaseHttpService }]; } });
2584
2580
 
2585
2581
  class ApiModule {
2586
2582
  }