@veloceapps/sdk 11.0.0-9 → 11.0.0-91

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.
Files changed (183) hide show
  1. package/cms/cms.actions.d.ts +94 -29
  2. package/cms/components/element-renderer/element-renderer.component.d.ts +3 -10
  3. package/cms/components/preview/preview.component.d.ts +5 -6
  4. package/cms/components/preview/preview.types.d.ts +0 -4
  5. package/cms/services/element-context.service.d.ts +0 -1
  6. package/cms/types/common.types.d.ts +2 -0
  7. package/cms/types/index.d.ts +0 -1
  8. package/cms/utils/path.utils.d.ts +1 -2
  9. package/cms/vendor-map.d.ts +18 -40
  10. package/core/index.d.ts +1 -1
  11. package/core/modules/configuration/index.d.ts +4 -4
  12. package/core/modules/configuration/services/configuration-runtime.service.d.ts +8 -19
  13. package/core/modules/configuration/services/configuration-state.service.d.ts +8 -8
  14. package/core/modules/configuration/services/configuration.service.d.ts +22 -52
  15. package/core/modules/configuration/services/guided-selling.service.d.ts +13 -0
  16. package/core/modules/configuration/services/test-mode-configuration.service.d.ts +23 -0
  17. package/core/modules/configuration/types/configuration-runtime.types.d.ts +0 -5
  18. package/core/modules/configuration/types/configuration.types.d.ts +4 -2
  19. package/core/modules/configuration/types/index.d.ts +2 -0
  20. package/core/modules/flow-configuration/index.d.ts +0 -3
  21. package/core/modules/flow-configuration/services/flow-configuration.service.d.ts +11 -38
  22. package/core/operators/filter-successful-execute.operator.d.ts +3 -0
  23. package/core/operators/index.d.ts +1 -0
  24. package/core/services/catalog-products.service.d.ts +11 -0
  25. package/core/services/flow-info.service.d.ts +27 -12
  26. package/core/services/flow-state-configuration.service.d.ts +9 -8
  27. package/core/services/flow-state.service.d.ts +12 -24
  28. package/core/services/index.d.ts +3 -3
  29. package/core/services/integration.state.d.ts +1 -1
  30. package/core/services/product-images.service.d.ts +3 -3
  31. package/core/services/runtime-settings.service.d.ts +1 -1
  32. package/core/services/sales-transaction.service.d.ts +27 -0
  33. package/core/types/flow-customization.types.d.ts +2 -2
  34. package/core/types/flow-state.types.d.ts +2 -2
  35. package/core/types/index.d.ts +0 -1
  36. package/core/utils/index.d.ts +2 -2
  37. package/core/utils/transaction-item.utils.d.ts +7 -0
  38. package/core/utils/transaction-item.worker.d.ts +8 -0
  39. package/esm2020/cms/cms.actions.mjs +93 -71
  40. package/esm2020/cms/cms.default.mjs +2 -3
  41. package/esm2020/cms/components/element-renderer/element-renderer.component.mjs +7 -64
  42. package/esm2020/cms/components/element-tools-panel/element-tools-panel.component.mjs +3 -3
  43. package/esm2020/cms/components/preview/preview.component.mjs +19 -28
  44. package/esm2020/cms/components/preview/preview.types.mjs +1 -1
  45. package/esm2020/cms/services/element-context.service.mjs +1 -1
  46. package/esm2020/cms/types/common.types.mjs +1 -1
  47. package/esm2020/cms/types/index.mjs +1 -2
  48. package/esm2020/cms/utils/element.utils.mjs +3 -3
  49. package/esm2020/cms/utils/elements-resolver.mjs +16 -5
  50. package/esm2020/cms/utils/path.utils.mjs +1 -10
  51. package/esm2020/cms/vendor-map.mjs +18 -18
  52. package/esm2020/core/core.module.mjs +7 -7
  53. package/esm2020/core/index.mjs +2 -2
  54. package/esm2020/core/modules/configuration/configuration.module.mjs +17 -4
  55. package/esm2020/core/modules/configuration/index.mjs +5 -5
  56. package/esm2020/core/modules/configuration/services/configuration-runtime.service.mjs +16 -101
  57. package/esm2020/core/modules/configuration/services/configuration-state.service.mjs +69 -77
  58. package/esm2020/core/modules/configuration/services/configuration.service.mjs +115 -247
  59. package/esm2020/core/modules/configuration/services/guided-selling.service.mjs +47 -0
  60. package/esm2020/core/modules/configuration/services/test-mode-configuration.service.mjs +74 -0
  61. package/esm2020/core/modules/configuration/types/configuration-runtime.types.mjs +1 -1
  62. package/esm2020/core/modules/configuration/types/configuration.types.mjs +1 -1
  63. package/esm2020/core/modules/configuration/types/index.mjs +3 -0
  64. package/esm2020/core/modules/flow-configuration/flow-configuration.module.mjs +3 -4
  65. package/esm2020/core/modules/flow-configuration/index.mjs +1 -4
  66. package/esm2020/core/modules/flow-configuration/services/flow-configuration.service.mjs +44 -128
  67. package/esm2020/core/operators/filter-successful-execute.operator.mjs +5 -0
  68. package/esm2020/core/operators/index.mjs +2 -0
  69. package/esm2020/core/services/catalog-products.service.mjs +25 -0
  70. package/esm2020/core/services/flow-info.service.mjs +82 -31
  71. package/esm2020/core/services/flow-state-configuration.service.mjs +52 -25
  72. package/esm2020/core/services/flow-state.service.mjs +58 -180
  73. package/esm2020/core/services/index.mjs +4 -4
  74. package/esm2020/core/services/integration.state.mjs +2 -2
  75. package/esm2020/core/services/product-images.service.mjs +8 -8
  76. package/esm2020/core/services/runtime-settings.service.mjs +3 -3
  77. package/esm2020/core/services/sales-transaction.service.mjs +67 -0
  78. package/esm2020/core/types/flow-customization.types.mjs +1 -1
  79. package/esm2020/core/types/flow-state.types.mjs +1 -1
  80. package/esm2020/core/types/index.mjs +1 -2
  81. package/esm2020/core/utils/index.mjs +3 -3
  82. package/esm2020/core/utils/transaction-item.utils.mjs +60 -0
  83. package/esm2020/core/utils/transaction-item.worker.mjs +16 -0
  84. package/esm2020/src/components/flow-header/flow-header.component.mjs +8 -12
  85. package/esm2020/src/components/guided-selling/guided-selling.component.mjs +8 -12
  86. package/esm2020/src/flow-routing.module.mjs +12 -41
  87. package/esm2020/src/flow.component.mjs +5 -5
  88. package/esm2020/src/guards/flow.guard.mjs +13 -14
  89. package/esm2020/src/guards/product-unload.guard.mjs +7 -9
  90. package/esm2020/src/index.mjs +1 -3
  91. package/esm2020/src/pages/assets/assets.component.mjs +8 -9
  92. package/esm2020/src/pages/catalog/catalog.component.mjs +8 -9
  93. package/esm2020/src/pages/debug/debug.component.mjs +14 -23
  94. package/esm2020/src/pages/product/product.component.mjs +12 -89
  95. package/esm2020/src/pages/product/product.module.mjs +5 -5
  96. package/esm2020/src/pages/record-not-found/record-not-found.component.mjs +5 -6
  97. package/esm2020/src/pages/shopping-cart/shopping-cart.component.mjs +8 -9
  98. package/esm2020/src/resolvers/flow.resolver.mjs +10 -18
  99. package/esm2020/src/resolvers/pcm-model.resolver.mjs +12 -0
  100. package/esm2020/src/resolvers/sales-transaction.resolver.mjs +64 -0
  101. package/esm2020/src/resolvers/ui-definition.resolver.mjs +42 -0
  102. package/esm2020/src/services/flow-dialog.service.mjs +10 -31
  103. package/esm2020/src/services/flow-router.service.mjs +16 -33
  104. package/esm2020/src/services/flow.service.mjs +15 -54
  105. package/esm2020/src/types/index.mjs +2 -3
  106. package/esm2020/src/types/route.types.mjs +1 -1
  107. package/fesm2015/veloceapps-sdk-cms.mjs +163 -309
  108. package/fesm2015/veloceapps-sdk-cms.mjs.map +1 -1
  109. package/fesm2015/veloceapps-sdk-core.mjs +877 -1673
  110. package/fesm2015/veloceapps-sdk-core.mjs.map +1 -1
  111. package/fesm2015/veloceapps-sdk.mjs +192 -824
  112. package/fesm2015/veloceapps-sdk.mjs.map +1 -1
  113. package/fesm2020/veloceapps-sdk-cms.mjs +159 -300
  114. package/fesm2020/veloceapps-sdk-cms.mjs.map +1 -1
  115. package/fesm2020/veloceapps-sdk-core.mjs +954 -1758
  116. package/fesm2020/veloceapps-sdk-core.mjs.map +1 -1
  117. package/fesm2020/veloceapps-sdk.mjs +192 -818
  118. package/fesm2020/veloceapps-sdk.mjs.map +1 -1
  119. package/package.json +1 -1
  120. package/src/components/flow-header/flow-header.component.d.ts +3 -3
  121. package/src/components/guided-selling/guided-selling.component.d.ts +3 -3
  122. package/src/flow-routing.module.d.ts +1 -2
  123. package/src/flow.component.d.ts +2 -2
  124. package/src/guards/product-unload.guard.d.ts +5 -6
  125. package/src/index.d.ts +0 -2
  126. package/src/pages/assets/assets.component.d.ts +3 -3
  127. package/src/pages/catalog/catalog.component.d.ts +3 -3
  128. package/src/pages/debug/debug.component.d.ts +2 -5
  129. package/src/pages/product/product.component.d.ts +5 -14
  130. package/src/pages/product/product.module.d.ts +1 -1
  131. package/src/pages/record-not-found/record-not-found.component.d.ts +2 -3
  132. package/src/pages/shopping-cart/shopping-cart.component.d.ts +3 -3
  133. package/src/resolvers/flow.resolver.d.ts +5 -6
  134. package/src/resolvers/pcm-model.resolver.d.ts +3 -0
  135. package/src/resolvers/sales-transaction.resolver.d.ts +18 -0
  136. package/src/resolvers/ui-definition.resolver.d.ts +3 -0
  137. package/src/services/flow-dialog.service.d.ts +6 -8
  138. package/src/services/flow-router.service.d.ts +4 -6
  139. package/src/services/flow.service.d.ts +3 -7
  140. package/src/types/index.d.ts +1 -2
  141. package/src/types/route.types.d.ts +0 -5
  142. package/cms/plugins/configuration.plugin.d.ts +0 -23
  143. package/cms/types/configuration.types.d.ts +0 -21
  144. package/core/modules/configuration/helpers.d.ts +0 -6
  145. package/core/modules/configuration/services/runtime-context.service.d.ts +0 -12
  146. package/core/modules/flow-configuration/services/flow-update.service.d.ts +0 -13
  147. package/core/modules/flow-configuration/types/update.types.d.ts +0 -12
  148. package/core/services/context.service.d.ts +0 -23
  149. package/core/services/quote-draft.service.d.ts +0 -50
  150. package/core/types/runtime.types.d.ts +0 -30
  151. package/core/utils/line-item.utils.d.ts +0 -25
  152. package/core/utils/line-item.worker.d.ts +0 -9
  153. package/esm2020/cms/plugins/configuration.plugin.mjs +0 -109
  154. package/esm2020/cms/types/configuration.types.mjs +0 -2
  155. package/esm2020/core/modules/configuration/helpers.mjs +0 -73
  156. package/esm2020/core/modules/configuration/services/runtime-context.service.mjs +0 -45
  157. package/esm2020/core/modules/flow-configuration/services/flow-update.service.mjs +0 -138
  158. package/esm2020/core/modules/flow-configuration/types/update.types.mjs +0 -2
  159. package/esm2020/core/services/context.service.mjs +0 -91
  160. package/esm2020/core/services/quote-draft.service.mjs +0 -192
  161. package/esm2020/core/types/runtime.types.mjs +0 -16
  162. package/esm2020/core/utils/line-item.utils.mjs +0 -187
  163. package/esm2020/core/utils/line-item.worker.mjs +0 -19
  164. package/esm2020/src/guards/context.guard.mjs +0 -91
  165. package/esm2020/src/guards/index.mjs +0 -2
  166. package/esm2020/src/pages/remote/remote.component.mjs +0 -342
  167. package/esm2020/src/pages/remote/remote.module.mjs +0 -20
  168. package/esm2020/src/pages/remote/remote.types.mjs +0 -2
  169. package/esm2020/src/resolvers/quote.resolver.mjs +0 -82
  170. package/esm2020/src/types/context-route.types.mjs +0 -2
  171. package/esm2020/src/types/metrics.types.mjs +0 -2
  172. package/esm2020/src/utils/flow.utils.mjs +0 -25
  173. package/esm2020/src/utils/index.mjs +0 -2
  174. package/src/guards/context.guard.d.ts +0 -19
  175. package/src/guards/index.d.ts +0 -1
  176. package/src/pages/remote/remote.component.d.ts +0 -46
  177. package/src/pages/remote/remote.module.d.ts +0 -10
  178. package/src/pages/remote/remote.types.d.ts +0 -4
  179. package/src/resolvers/quote.resolver.d.ts +0 -19
  180. package/src/types/context-route.types.d.ts +0 -5
  181. package/src/types/metrics.types.d.ts +0 -5
  182. package/src/utils/flow.utils.d.ts +0 -8
  183. package/src/utils/index.d.ts +0 -1
@@ -1,8 +1,3 @@
1
1
  export interface RuntimeInitializationProps {
2
2
  productId: string;
3
- offeringId?: string;
4
- defaultQty?: number;
5
- attributesMap?: Record<string, any>;
6
- defaultUIDefinitionId?: string;
7
- requiredUIDefinitionId?: string;
8
3
  }
@@ -1,7 +1,6 @@
1
1
  import { Product } from '@veloceapps/core';
2
2
  export interface GuidedSellingSubmitData {
3
- modelId: string;
4
- modelType: string;
3
+ orchestrationName: string;
5
4
  attributesMap: Record<string, any>;
6
5
  }
7
6
  export interface ExternalConfigurationProps {
@@ -12,3 +11,6 @@ export interface ExternalConfigurationProps {
12
11
  export interface NewConfigurationProps extends ExternalConfigurationProps {
13
12
  product: Product;
14
13
  }
14
+ export interface TestModeConfigurationOptions {
15
+ customizationMode?: boolean;
16
+ }
@@ -0,0 +1,2 @@
1
+ export * from './configuration.types';
2
+ export * from './configuration-runtime.types';
@@ -1,4 +1 @@
1
- export * from './flow-configuration.module';
2
1
  export * from './services/flow-configuration.service';
3
- export * from './services/flow-update.service';
4
- export * from './types/update.types';
@@ -1,50 +1,23 @@
1
- import { ProceduresApiService } from '@veloceapps/api';
2
- import { Charge, CompiledPricePlan, ConfigurationContext, LineItem, MetricRule, QuoteDraft } from '@veloceapps/core';
3
- import { Dictionary } from 'lodash';
1
+ import { OrchestrationsApiService } from '@veloceapps/api/v2';
2
+ import { TransactionContext } from '@veloceapps/core';
4
3
  import { Observable } from 'rxjs';
5
- import { ContextService } from '../../../services/context.service';
6
- import { QuoteDraftService } from '../../../services/quote-draft.service';
7
- import { ExternalConfigurationProps } from '../../configuration';
8
- import { ConfigurationService } from '../../configuration/services/configuration.service';
9
- import { FlowUpdateParams } from '../types/update.types';
10
- import { FlowUpdateService } from './flow-update.service';
11
4
  import { FlowInfoService } from '../../../services';
5
+ import { SalesTransactionService } from '../../../services/sales-transaction.service';
12
6
  import * as i0 from "@angular/core";
13
7
  export declare class FlowConfigurationService {
14
- private proceduresApiService;
15
- private contextService;
16
- private quoteDraftService;
17
- private updateService;
18
- private configurationService;
8
+ private orchestrationsApiService;
9
+ private salesTransactionService;
19
10
  private flowInfoService;
20
- /**
21
- * An event being fired when QuoteDraft was updated
22
- */
23
11
  updated$: Observable<void>;
24
12
  private updatedSubj$;
25
- constructor(proceduresApiService: ProceduresApiService, contextService: ContextService, quoteDraftService: QuoteDraftService, updateService: FlowUpdateService, configurationService: ConfigurationService, flowInfoService: FlowInfoService);
26
- calculate$(quoteDraft: QuoteDraft): Observable<void>;
27
- calculate(quoteDraft: QuoteDraft): void;
28
- update$(updates: FlowUpdateParams[]): Observable<QuoteDraft | null>;
29
- update(updates: FlowUpdateParams[]): void;
30
- revert$(lineItemId: string): Observable<QuoteDraft | null>;
31
- revert(lineItemId: string): void;
32
- delete$(ids: string[]): Observable<QuoteDraft | null>;
13
+ constructor(orchestrationsApiService: OrchestrationsApiService, salesTransactionService: SalesTransactionService, flowInfoService: FlowInfoService);
14
+ calculate$(state: TransactionContext): Observable<void>;
15
+ calculate(state: TransactionContext): void;
16
+ revert$(transactionItemId: string): Observable<TransactionContext | null>;
17
+ revert(transactionItemId: string): void;
18
+ delete$(ids: string[]): Observable<TransactionContext | null>;
33
19
  delete(ids: string[]): void;
34
- addTerm$(term: LineItem): Observable<QuoteDraft | null>;
35
- addToCart$(props: ExternalConfigurationProps): Observable<QuoteDraft | null>;
36
- get(): Observable<LineItem[]>;
37
- getSnapshot(): LineItem[];
38
- get charges$(): Observable<Dictionary<Charge>>;
39
- get pricePlans$(): Observable<Dictionary<CompiledPricePlan>>;
40
- get activeMetrics$(): Observable<MetricRule[]>;
41
- get chargesSnapshot(): Dictionary<Charge>;
42
- get pricePlansSnapshot(): Dictionary<CompiledPricePlan>;
43
- get activeMetricsSnapshot(): MetricRule[];
44
- get contextSnapshot(): ConfigurationContext;
45
- get context$(): Observable<ConfigurationContext>;
46
20
  private handleErrorAndBounceBack;
47
- private extendedApply$;
48
21
  static ɵfac: i0.ɵɵFactoryDeclaration<FlowConfigurationService, never>;
49
22
  static ɵprov: i0.ɵɵInjectableDeclaration<FlowConfigurationService>;
50
23
  }
@@ -0,0 +1,3 @@
1
+ import { FlowStateSelectorResponse } from '@veloceapps/core';
2
+ import { Observable } from 'rxjs';
3
+ export declare function filterSuccessfulExecute<T>(): (source: Observable<FlowStateSelectorResponse<T>>) => Observable<T>;
@@ -0,0 +1 @@
1
+ export * from './filter-successful-execute.operator';
@@ -0,0 +1,11 @@
1
+ import { CatalogProducts } from '@veloceapps/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class CatalogProductsService {
4
+ private stateSubj$;
5
+ state$: import("rxjs").Observable<CatalogProducts>;
6
+ get state(): CatalogProducts | null;
7
+ reset(): void;
8
+ setState(state: CatalogProducts): void;
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<CatalogProductsService, never>;
10
+ static ɵprov: i0.ɵɵInjectableDeclaration<CatalogProductsService>;
11
+ }
@@ -1,29 +1,44 @@
1
1
  import { Params } from '@angular/router';
2
- import { FlowsApiService, UITemplatesApiService } from '@veloceapps/api';
3
- import { Flow, UITemplate, UITemplateType } from '@veloceapps/core';
2
+ import { UITemplatesAdminApiService } from '@veloceapps/api/v2';
3
+ import { Flow, FlowContext, UITemplate, UITemplateType } from '@veloceapps/core';
4
4
  import { Observable } from 'rxjs';
5
- import { FlowCustomization } from '../types';
5
+ import { FlowCustomization } from '../types/flow-customization.types';
6
+ import { RuntimeSettingsService } from './runtime-settings.service';
6
7
  import * as i0 from "@angular/core";
7
8
  export declare class FlowInfoService {
8
- private flowsApiService;
9
- private templatesApiService;
9
+ private runtimeSettingsService;
10
+ private templatesAdminApiService;
10
11
  private customizationService?;
11
12
  flow$: Observable<Flow | null>;
12
- params?: Params;
13
- templates: {
13
+ templates$: Observable<{
14
14
  [key in UITemplateType]?: UITemplate;
15
+ }>;
16
+ get flow(): Flow;
17
+ get isFlowInitialized(): boolean;
18
+ get context(): FlowContext;
19
+ get context$(): Observable<FlowContext>;
20
+ get templates(): {
21
+ SHOPPING_CART?: UITemplate | undefined;
22
+ CONFIGURATION_UI?: UITemplate | undefined;
23
+ CATALOG?: UITemplate | undefined;
24
+ GUIDED_SELLING?: UITemplate | undefined;
25
+ FLOW_ENGINE?: UITemplate | undefined;
26
+ FLOW_HEADER?: UITemplate | undefined;
15
27
  };
16
- get flow(): Flow | null;
17
- set flow(value: Flow | null);
18
- get isLegacy(): boolean;
28
+ get isFlowEngineInitialized$(): Observable<boolean>;
19
29
  get isStateful(): boolean;
20
30
  private readonly defaultTemplates;
21
31
  private flowSubj$;
22
- constructor(flowsApiService: FlowsApiService, templatesApiService: UITemplatesApiService, customizationService?: FlowCustomization | undefined);
32
+ private templatesSubj$;
33
+ private contextSubj$;
34
+ constructor(runtimeSettingsService: RuntimeSettingsService, templatesAdminApiService: UITemplatesAdminApiService, customizationService?: FlowCustomization | undefined);
35
+ reset(): void;
23
36
  init$(flowId: string, routeQueryParams: Params): Observable<void>;
24
- cleanup(): void;
37
+ updateContext(update: Partial<FlowContext>): void;
38
+ private initFlow$;
25
39
  private initFlowTemplates$;
26
40
  private remapTemplateName;
41
+ private getFlowContextMode;
27
42
  static ɵfac: i0.ɵɵFactoryDeclaration<FlowInfoService, [null, null, { optional: true; }]>;
28
43
  static ɵprov: i0.ɵɵInjectableDeclaration<FlowInfoService>;
29
44
  }
@@ -1,19 +1,20 @@
1
- import { FlowStateApiService } from '@veloceapps/api';
2
1
  import { Observable } from 'rxjs';
3
- import { NewConfigurationProps } from '../modules/configuration';
4
- import { FlowConfigurationService } from '../modules/flow-configuration';
2
+ import { ConfigurationService } from '../modules/configuration/services/configuration.service';
3
+ import { NewConfigurationProps } from '../modules/configuration/types/configuration.types';
4
+ import { FlowConfigurationService } from '../modules/flow-configuration/services/flow-configuration.service';
5
5
  import { FlowInfoService } from './flow-info.service';
6
6
  import { FlowStateService } from './flow-state.service';
7
+ import { SalesTransactionService } from './sales-transaction.service';
7
8
  import * as i0 from "@angular/core";
8
9
  export declare class FlowStateConfigurationService {
9
10
  private flowInfoService;
10
- private flowConfigurationService;
11
- private flowStateApiService;
12
11
  private flowStateService;
13
- private configurationStateId$;
14
- constructor(flowInfoService: FlowInfoService, flowConfigurationService: FlowConfigurationService, flowStateApiService: FlowStateApiService, flowStateService: FlowStateService);
15
- get configurationStateId(): string | null;
12
+ private configurationService;
13
+ private salesTransactionService;
14
+ private flowConfigurationService;
15
+ constructor(flowInfoService: FlowInfoService, flowStateService: FlowStateService, configurationService: ConfigurationService, salesTransactionService: SalesTransactionService, flowConfigurationService: FlowConfigurationService);
16
16
  addToCart$(props: NewConfigurationProps): Observable<void>;
17
+ private configureExternal$;
17
18
  static ɵfac: i0.ɵɵFactoryDeclaration<FlowStateConfigurationService, never>;
18
19
  static ɵprov: i0.ɵɵInjectableDeclaration<FlowStateConfigurationService>;
19
20
  }
@@ -1,29 +1,23 @@
1
- import { ConfigurationProcessorsApiService, FlowStateApiService, QuoteApiService } from '@veloceapps/api';
1
+ import { FlowStateApiService } from '@veloceapps/api';
2
+ import { ConfigurationProcessorsApiService, SalesTransactionApiService } from '@veloceapps/api/v2';
2
3
  import { ToastService } from '@veloceapps/components';
3
- import { Charge, CompiledPricePlan, FlowStateExecutionRequest, FlowStateExecutionRequestDTO, FlowStateExecutionResult, FlowStateSelectorResponse, MetricRule, UITemplateType } from '@veloceapps/core';
4
- import { Dictionary } from 'lodash';
4
+ import { FlowStateExecutionRequest, FlowStateExecutionRequestDTO, FlowStateExecutionResult, FlowStateSelectorResponse, UITemplateType } from '@veloceapps/core';
5
5
  import { Observable } from 'rxjs';
6
6
  import { FlowConfigurationService } from '../modules';
7
7
  import { FlowCustomization } from '../types/flow-customization.types';
8
8
  import { FlowStateSubscriptionOptions } from '../types/flow-state.types';
9
- import { ContextService } from './context.service';
10
9
  import { FlowInfoService } from './flow-info.service';
11
- import { QuoteDraftService } from './quote-draft.service';
10
+ import { SalesTransactionService } from './sales-transaction.service';
12
11
  import * as i0 from "@angular/core";
13
12
  export declare class FlowStateService {
14
- private contextService;
15
- private quoteDraftService;
16
- private flowInfoService;
17
13
  private flowConfiguration;
18
- private processorsApiService;
14
+ private flowInfoService;
19
15
  private flowStateApiService;
20
- private quoteApiService;
16
+ private processorsApiService;
17
+ private salesTransactionApiService;
18
+ private salesTransactionService;
21
19
  private toastService;
22
20
  private customizationService?;
23
- charges$: Observable<Dictionary<Charge>>;
24
- pricePlans$: Observable<Dictionary<CompiledPricePlan>>;
25
- activeMetrics$: Observable<MetricRule[]>;
26
- isPriceListLocked$: Observable<boolean>;
27
21
  private readonly NOT_INITIALIZED;
28
22
  private readonly EXECUTION_BUFFER_TIME;
29
23
  private executedFunctions;
@@ -37,9 +31,9 @@ export declare class FlowStateService {
37
31
  private statefulRequestStream$;
38
32
  private statefulExecutionRequest$;
39
33
  private cleanup$;
40
- constructor(contextService: ContextService, quoteDraftService: QuoteDraftService, flowInfoService: FlowInfoService, flowConfiguration: FlowConfigurationService, processorsApiService: ConfigurationProcessorsApiService, flowStateApiService: FlowStateApiService, quoteApiService: QuoteApiService, toastService: ToastService, customizationService?: FlowCustomization | undefined);
34
+ constructor(flowConfiguration: FlowConfigurationService, flowInfoService: FlowInfoService, flowStateApiService: FlowStateApiService, processorsApiService: ConfigurationProcessorsApiService, salesTransactionApiService: SalesTransactionApiService, salesTransactionService: SalesTransactionService, toastService: ToastService, customizationService?: FlowCustomization | undefined);
41
35
  init$(): Observable<void>;
42
- cleanup(): void;
36
+ reset(): void;
43
37
  get hasUnsavedChanges(): boolean;
44
38
  get stateId(): string | null;
45
39
  get isExecutionInProgress$(): Observable<boolean>;
@@ -50,10 +44,7 @@ export declare class FlowStateService {
50
44
  select$<Response = unknown>(scope: UITemplateType, selectorName: string, inputData?: unknown): Observable<FlowStateSelectorResponse<Response>>;
51
45
  subscribe$<Response = unknown>(scope: UITemplateType, selectorName: string, inputData?: unknown, options?: FlowStateSubscriptionOptions): Observable<FlowStateSelectorResponse<Response>>;
52
46
  save$(): Observable<{
53
- quoteId: string;
54
- }>;
55
- submit$(): Observable<{
56
- quoteId: string;
47
+ id: string;
57
48
  }>;
58
49
  getFlowStore(): Record<string, unknown>;
59
50
  private getOwnerIdByScope;
@@ -65,18 +56,15 @@ export declare class FlowStateService {
65
56
  private initBufferedRequest$;
66
57
  private executeStateful$;
67
58
  private initStateless$;
68
- private calculate$;
69
59
  private executeStateless$;
70
60
  private executeStatelessActions;
71
61
  private executeStatelessSelectors;
72
- private getFlowSafe;
73
62
  private initProcessors$;
74
63
  private executeActionScript;
75
64
  private executeSelectorScript;
76
65
  private executeProcessorScript;
77
66
  private generateRequestId;
78
- private getDefaultExecutionRequestDTO;
79
67
  private checkStatefulChanges;
80
- static ɵfac: i0.ɵɵFactoryDeclaration<FlowStateService, [null, null, null, null, null, null, null, null, { optional: true; }]>;
68
+ static ɵfac: i0.ɵɵFactoryDeclaration<FlowStateService, [null, null, null, null, null, null, null, { optional: true; }]>;
81
69
  static ɵprov: i0.ɵɵInjectableDeclaration<FlowStateService>;
82
70
  }
@@ -1,8 +1,8 @@
1
- export * from './context.service';
2
1
  export * from './flow-info.service';
3
- export * from './flow-state.service';
4
2
  export * from './flow-state-configuration.service';
3
+ export * from './flow-state.service';
5
4
  export * from './integration.state';
6
5
  export * from './product-images.service';
7
- export * from './quote-draft.service';
8
6
  export * from './runtime-settings.service';
7
+ export * from './sales-transaction.service';
8
+ export * from './catalog-products.service';
@@ -10,7 +10,7 @@ export declare class IntegrationState<S = IntegrationStateModel> {
10
10
  dispatch(action: IntegrationAction): void;
11
11
  listen$<P = any>(actionType: string): Observable<P>;
12
12
  listenAll$<T extends IntegrationAction>(): Observable<T>;
13
- clear(): void;
13
+ reset(): void;
14
14
  static ɵfac: i0.ɵɵFactoryDeclaration<IntegrationState<any>, never>;
15
15
  static ɵprov: i0.ɵɵInjectableDeclaration<IntegrationState<any>>;
16
16
  }
@@ -1,10 +1,10 @@
1
- import { ProductApiService } from '@veloceapps/api';
1
+ import { ProductsAdminApiService } from '@veloceapps/api/v2';
2
2
  import { Observable } from 'rxjs';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class ProductImagesService {
5
- private productApiService;
5
+ private productsAdminApiService;
6
6
  private imagesMap$;
7
- constructor(productApiService: ProductApiService);
7
+ constructor(productsAdminApiService: ProductsAdminApiService);
8
8
  getImageUrl$(productId: string): Observable<string | null>;
9
9
  private fetchProductImage;
10
10
  static ɵfac: i0.ɵɵFactoryDeclaration<ProductImagesService, never>;
@@ -1,4 +1,4 @@
1
- import { ConfigurationSettingsApiService } from '@veloceapps/api';
1
+ import { ConfigurationSettingsApiService } from '@veloceapps/api/v2';
2
2
  import { RuntimeConfigurationSettings, RuntimeCurrencySettings, ShoppingCartSetting } from '@veloceapps/core';
3
3
  import { Observable } from 'rxjs';
4
4
  import { FormattingSettings } from '../types';
@@ -0,0 +1,27 @@
1
+ import { SalesTransactionApiService } from '@veloceapps/api/v2';
2
+ import { SalesTransactionItem, TransactionContext } from '@veloceapps/core';
3
+ import { Observable } from 'rxjs';
4
+ import * as i0 from "@angular/core";
5
+ export declare class SalesTransactionService {
6
+ private salesTransactionApiService;
7
+ private stateSubj$;
8
+ private isInitializedSubj$;
9
+ private hasUnsavedChangesSubj$;
10
+ private initialState;
11
+ hasUnsavedChanges$: Observable<boolean>;
12
+ state$: Observable<TransactionContext>;
13
+ get isInitialized$(): Observable<boolean>;
14
+ get isInitialized(): boolean;
15
+ set hasUnsavedChanges(value: boolean);
16
+ get hasUnsavedChanges(): boolean;
17
+ get state(): TransactionContext | null;
18
+ get hasProducts(): boolean;
19
+ constructor(salesTransactionApiService: SalesTransactionApiService);
20
+ init(headerId: string, params: Record<string, string>): Observable<TransactionContext>;
21
+ finalizeInit(): void;
22
+ reset(): void;
23
+ getInitialState(): SalesTransactionItem[];
24
+ setState(state: TransactionContext): void;
25
+ static ɵfac: i0.ɵɵFactoryDeclaration<SalesTransactionService, never>;
26
+ static ɵprov: i0.ɵɵInjectableDeclaration<SalesTransactionService>;
27
+ }
@@ -1,9 +1,9 @@
1
1
  import { InjectionToken } from '@angular/core';
2
- import { ConfigurationProcessor, TemplateComponentWithAttachments, UIDefinitionContainer, UITemplate } from '@veloceapps/core';
2
+ import { ConfigurationProcessor, FlowContext, TemplateComponentWithAttachments, UIDefinitionContainer, UITemplate } from '@veloceapps/core';
3
3
  import { Observable } from 'rxjs';
4
4
  export declare const FLOW_CUSTOMIZATION: InjectionToken<FlowCustomization>;
5
5
  export interface FlowCustomization {
6
- getUiDefinition?(productId: string): Observable<UIDefinitionContainer | null>;
6
+ getUiDefinition?(flowContext: FlowContext): Observable<UIDefinitionContainer | null>;
7
7
  getTemplates?(): Observable<UITemplate[]>;
8
8
  getTemplateComponents?(templateName: string): Observable<TemplateComponentWithAttachments[] | null>;
9
9
  getTemplateConfigurationProcessors?(templateName: string): Observable<ConfigurationProcessor[] | null>;
@@ -1,4 +1,4 @@
1
- import { AccountAssetsState } from '@veloceapps/core';
1
+ import { SalesTransactionItem } from '@veloceapps/core';
2
2
  export interface FlowStateSubscriptionOptions {
3
3
  /**
4
4
  * When 'true', don't execute action to retrieve current value
@@ -7,6 +7,6 @@ export interface FlowStateSubscriptionOptions {
7
7
  trackedChanges?: boolean;
8
8
  }
9
9
  export interface FlowStore {
10
- assets?: AccountAssetsState;
10
+ assets?: SalesTransactionItem[];
11
11
  [key: string]: unknown;
12
12
  }
@@ -2,5 +2,4 @@ export * from './flow-customization.types';
2
2
  export * from './formatting-settings.types';
3
3
  export * from './integration.types';
4
4
  export * from './pipe.types';
5
- export * from './runtime.types';
6
5
  export * from './ui-definition.types';
@@ -1,3 +1,3 @@
1
- export * from './line-item.utils';
2
- export * from './line-item.worker';
1
+ export * from './transaction-item.utils';
2
+ export * from './transaction-item.worker';
3
3
  export * from './ui-definition.utils';
@@ -0,0 +1,7 @@
1
+ import { SalesTransactionItem } from '@veloceapps/core';
2
+ export declare const findTransactionItem: (id: string, items: SalesTransactionItem[]) => SalesTransactionItem | undefined;
3
+ export declare const findTransactionItemWithComparator: (items: SalesTransactionItem[], comparator: (ti: SalesTransactionItem) => boolean) => SalesTransactionItem | undefined;
4
+ export declare const insertTransactionItem: (item: SalesTransactionItem, parentId: string, toInsert: SalesTransactionItem) => SalesTransactionItem;
5
+ export declare const removeTransactionItem: (item: SalesTransactionItem, idToRemove: string) => SalesTransactionItem;
6
+ export declare const replaceTransactionItem: (item: SalesTransactionItem, replaceTo: SalesTransactionItem) => SalesTransactionItem;
7
+ export declare const generateTransactionItem: (productId: string) => SalesTransactionItem;
@@ -0,0 +1,8 @@
1
+ import { SalesTransactionItem } from '@veloceapps/core';
2
+ export declare class TransactionItemWorker {
3
+ ti: SalesTransactionItem;
4
+ constructor(src: SalesTransactionItem);
5
+ insert(parentId: string, toInsert: SalesTransactionItem): TransactionItemWorker;
6
+ remove(id: string): TransactionItemWorker;
7
+ replace(toReplace: SalesTransactionItem): TransactionItemWorker;
8
+ }