@veloceapps/sdk 11.0.0-35 → 11.0.0-36

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,15 +1,15 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, InjectionToken, Optional, Inject, NgModule, inject, Directive, Input, LOCALE_ID, Pipe } from '@angular/core';
3
- import { DEFAULT_CURRENCY_ISO_CODE, DEFAULT_CURRENCY_SYMBOL, validateDateFormat, DEFAULT_DATE_FORMAT, DEFAULT_DECIMALS_COUNT, getSupportedDateFormats, DEFAULT_DECIMAL_SEPARATOR, DEFAULT_THOUSANDS_SEPARATOR, DEFAULT_ACTION_CODE_LABELS, parseJsonSafely, UITemplateType, SalesforceIdUtils, isDefined, UUID, extractErrorDetails, ConfigurationProcessorTypes, EntityUtil, DEFAULT_TIME_FORMAT, formatNumber } from '@veloceapps/core';
3
+ import { DEFAULT_CURRENCY_ISO_CODE, DEFAULT_CURRENCY_SYMBOL, validateDateFormat, DEFAULT_DATE_FORMAT, DEFAULT_DECIMALS_COUNT, getSupportedDateFormats, DEFAULT_DECIMAL_SEPARATOR, DEFAULT_THOUSANDS_SEPARATOR, DEFAULT_ACTION_CODE_LABELS, parseJsonSafely, isDefined, UITemplateType, SalesforceIdUtils, UUID, extractErrorDetails, ConfigurationProcessorTypes, EntityUtil, DEFAULT_TIME_FORMAT, formatNumber } from '@veloceapps/core';
4
4
  import * as i3 from '@veloceapps/api';
5
5
  import { ApiModule } from '@veloceapps/api';
6
6
  import * as i6 from '@veloceapps/components';
7
7
  import { ToastType, ConfirmationDialogModule } from '@veloceapps/components';
8
8
  import * as i1 from '@veloceapps/api/v2';
9
- import { tap, BehaviorSubject, map, switchMap, of, forkJoin, throwError, noop, filter as filter$1, Subject, catchError as catchError$1, combineLatest, finalize as finalize$1, buffer, debounceTime, share, take, distinctUntilChanged, shareReplay, takeUntil } from 'rxjs';
9
+ import { tap, BehaviorSubject, map, filter, switchMap, of, forkJoin, throwError, noop, Subject, catchError as catchError$1, combineLatest, finalize as finalize$1, buffer, debounceTime, share, take, distinctUntilChanged, shareReplay, takeUntil } from 'rxjs';
10
10
  import { uniqBy, flatten, omit, cloneDeep, assign, isEqual } from 'lodash';
11
11
  import * as i2 from 'primeng/api';
12
- import { filter, map as map$1, catchError, tap as tap$1, finalize } from 'rxjs/operators';
12
+ import { filter as filter$1, map as map$1, catchError, tap as tap$1, finalize } from 'rxjs/operators';
13
13
  import { NgControl } from '@angular/forms';
14
14
  import 'primeng/calendar';
15
15
  import { DATE_PIPE_DEFAULT_OPTIONS, formatDate } from '@angular/common';
@@ -161,6 +161,9 @@ class FlowInfoService {
161
161
  }
162
162
  return { ...this.contextSubj$.value };
163
163
  }
164
+ get context$() {
165
+ return this.contextSubj$.asObservable().pipe(filter(isDefined));
166
+ }
164
167
  get templates() {
165
168
  return this.templatesSubj$.value;
166
169
  }
@@ -375,7 +378,7 @@ function extractMetadata(uiDefinition) {
375
378
 
376
379
  class ConfigurationService {
377
380
  get state$() {
378
- return this.configurationStateSubj$.asObservable().pipe(filter(isDefined));
381
+ return this.configurationStateSubj$.asObservable().pipe(filter$1(isDefined));
379
382
  }
380
383
  get state() {
381
384
  return this.configurationStateSubj$.getValue();
@@ -384,7 +387,7 @@ class ConfigurationService {
384
387
  return this.previousConfigurationStateSubj$.getValue();
385
388
  }
386
389
  get root$() {
387
- return this.state$.pipe(map$1(state => state.salesTransactionItems[0]), filter(isDefined));
390
+ return this.state$.pipe(map$1(state => state.salesTransactionItems[0]), filter$1(isDefined));
388
391
  }
389
392
  get root() {
390
393
  return this.configurationStateSubj$.getValue()?.salesTransactionItems[0] ?? null;
@@ -570,7 +573,7 @@ class SalesTransactionService {
570
573
  this.hasUnsavedChangesSubj$ = new BehaviorSubject(false);
571
574
  this.initialState = [];
572
575
  this.hasUnsavedChanges$ = this.hasUnsavedChangesSubj$.asObservable();
573
- this.state$ = this.stateSubj$.asObservable().pipe(filter$1(isDefined));
576
+ this.state$ = this.stateSubj$.asObservable().pipe(filter(isDefined));
574
577
  }
575
578
  init(headerId, params) {
576
579
  return this.salesTransactionApiService.getState(headerId, params).pipe(tap(res => this.stateSubj$.next(res.salesTransaction)), map(res => res.salesTransaction));
@@ -688,7 +691,7 @@ class FlowStateService {
688
691
  all subscriptions get their updates according to updated State
689
692
  */
690
693
  this.isInitialized$()
691
- .pipe(filter$1(Boolean), filter$1(() => !this.flowInfoService.flow.properties.stateful), switchMap(() => this.flowConfiguration.updated$), switchMap(() => this.executeRequest$({}, true)))
694
+ .pipe(filter(Boolean), filter(() => !this.flowInfoService.flow.properties.stateful), switchMap(() => this.flowConfiguration.updated$), switchMap(() => this.executeRequest$({}, true)))
692
695
  .subscribe();
693
696
  }
694
697
  init$() {
@@ -783,7 +786,7 @@ class FlowStateService {
783
786
  this.executeRequest$(request).subscribe();
784
787
  }
785
788
  }
786
- return subscription.data$.pipe(filter$1(data => data != this.NOT_INITIALIZED), map(data => data), finalize$1(() => {
789
+ return subscription.data$.pipe(filter(data => data != this.NOT_INITIALIZED), map(data => data), finalize$1(() => {
787
790
  if (!this.subscriptions[requestId]?.data$.observed) {
788
791
  delete this.subscriptions[requestId];
789
792
  }
@@ -915,7 +918,7 @@ class FlowStateService {
915
918
  }));
916
919
  }
917
920
  executeStateful$(request) {
918
- return this.executionInProgress$.pipe(filter$1(inProgress => !inProgress), take(1), switchMap(() =>
921
+ return this.executionInProgress$.pipe(filter(inProgress => !inProgress), take(1), switchMap(() =>
919
922
  // make sure stream switches to statefulExecutionRequest$ before pushing an execution request
920
923
  combineLatest([
921
924
  this.statefulExecutionRequest$,
@@ -1118,7 +1121,7 @@ class IntegrationState {
1118
1121
  this.action$.next(action);
1119
1122
  }
1120
1123
  listen$(actionType) {
1121
- return this.action$.pipe(filter$1(action => action.type === actionType), map(action => action.payload));
1124
+ return this.action$.pipe(filter(action => action.type === actionType), map(action => action.payload));
1122
1125
  }
1123
1126
  listenAll$() {
1124
1127
  return this.action$.asObservable();
@@ -1271,7 +1274,7 @@ class ConfigurationStateService {
1271
1274
  this.executeRequest$(request).subscribe();
1272
1275
  }
1273
1276
  }
1274
- return subscription.data$.pipe(filter$1(data => data != this.NOT_INITIALIZED), map(data => data), distinctUntilChanged(), finalize$1(() => {
1277
+ return subscription.data$.pipe(filter(data => data != this.NOT_INITIALIZED), map(data => data), distinctUntilChanged(), finalize$1(() => {
1275
1278
  if (!this.subscriptions[requestId]?.data$.observed) {
1276
1279
  delete this.subscriptions[requestId];
1277
1280
  }
@@ -1445,7 +1448,7 @@ class ConfigurationStateService {
1445
1448
  }));
1446
1449
  }
1447
1450
  executeStateful$(request) {
1448
- return this.executionInProgress$.pipe(filter$1(inProgress => !inProgress), take(1), switchMap(() =>
1451
+ return this.executionInProgress$.pipe(filter(inProgress => !inProgress), take(1), switchMap(() =>
1449
1452
  // make sure stream switches to statefulExecutionRequest$ before pushing an execution request
1450
1453
  combineLatest([
1451
1454
  this.statefulExecutionRequest$,
@@ -1547,7 +1550,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1547
1550
  class CatalogProductsService {
1548
1551
  constructor() {
1549
1552
  this.stateSubj$ = new BehaviorSubject(null);
1550
- this.state$ = this.stateSubj$.asObservable().pipe(filter$1(isDefined));
1553
+ this.state$ = this.stateSubj$.asObservable().pipe(filter(isDefined));
1551
1554
  }
1552
1555
  get state() {
1553
1556
  return this.stateSubj$.getValue();
@@ -1663,6 +1666,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1663
1666
  }]
1664
1667
  }] });
1665
1668
 
1669
+ function filterSuccessfulExecute() {
1670
+ return (source) => source.pipe(filter((result) => result.success), map(r => r.result));
1671
+ }
1672
+
1666
1673
  class DatePipe {
1667
1674
  constructor() {
1668
1675
  this.locale = inject(LOCALE_ID);
@@ -1782,5 +1789,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImpor
1782
1789
  * Generated bundle index. Do not edit.
1783
1790
  */
1784
1791
 
1785
- export { ActionCodePipe, CalendarDirective, ConfigurationRuntimeService, ConfigurationService, ConfigurationStateService, DEFAULT_FORMATTING_SETTINGS, DatePipe, FLOW_CUSTOMIZATION, FORMATTING_SETTINGS_TOKEN, FlowConfigurationService, FlowInfoService, FlowStateConfigurationService, FlowStateService, IntegrationState, NumberPipe, PricePipe, ProductImagesService, RuntimeSettingsService, SalesTransactionService, SdkCoreModule, SdkDirectivesModule, SdkPipesModule, TestModeConfigurationService, TransactionItemWorker, UI_DEFINITION_VERSION, extractMetadata, findTransactionItem, findTransactionItemWithComparator, generateTransactionItem, insertTransactionItem, removeTransactionItem, replaceTransactionItem };
1792
+ export { ActionCodePipe, CalendarDirective, ConfigurationRuntimeService, ConfigurationService, ConfigurationStateService, DEFAULT_FORMATTING_SETTINGS, DatePipe, FLOW_CUSTOMIZATION, FORMATTING_SETTINGS_TOKEN, FlowConfigurationService, FlowInfoService, FlowStateConfigurationService, FlowStateService, IntegrationState, NumberPipe, PricePipe, ProductImagesService, RuntimeSettingsService, SalesTransactionService, SdkCoreModule, SdkDirectivesModule, SdkPipesModule, TestModeConfigurationService, TransactionItemWorker, UI_DEFINITION_VERSION, extractMetadata, filterSuccessfulExecute, findTransactionItem, findTransactionItemWithComparator, generateTransactionItem, insertTransactionItem, removeTransactionItem, replaceTransactionItem };
1786
1793
  //# sourceMappingURL=veloceapps-sdk-core.mjs.map