@veloceapps/sdk 8.0.0-83 → 8.0.0-84

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. package/esm2020/src/components/doc-gen/doc-gen.component.mjs +11 -8
  2. package/esm2020/src/components/guided-selling/guided-selling.component.mjs +12 -10
  3. package/esm2020/src/flow-routing.module.mjs +4 -3
  4. package/esm2020/src/guards/flow.guard.mjs +19 -0
  5. package/esm2020/src/guards/root.guard.mjs +5 -2
  6. package/esm2020/src/pages/assets/assets.component.mjs +11 -11
  7. package/esm2020/src/pages/catalog/catalog.component.mjs +11 -11
  8. package/esm2020/src/pages/debug/debug.component.mjs +10 -14
  9. package/esm2020/src/pages/shopping-cart/shopping-cart.component.mjs +11 -11
  10. package/esm2020/src/resolvers/flow.resolver.mjs +15 -9
  11. package/esm2020/src/resolvers/quote.resolver.mjs +10 -6
  12. package/esm2020/src/services/flow.service.mjs +23 -8
  13. package/esm2020/src/utils/flow.utils.mjs +6 -2
  14. package/fesm2015/veloceapps-sdk.mjs +366 -330
  15. package/fesm2015/veloceapps-sdk.mjs.map +1 -1
  16. package/fesm2020/veloceapps-sdk.mjs +359 -321
  17. package/fesm2020/veloceapps-sdk.mjs.map +1 -1
  18. package/package.json +1 -1
  19. package/src/components/doc-gen/doc-gen.component.d.ts +4 -2
  20. package/src/components/guided-selling/guided-selling.component.d.ts +4 -3
  21. package/src/guards/flow.guard.d.ts +2 -0
  22. package/src/pages/assets/assets.component.d.ts +3 -3
  23. package/src/pages/catalog/catalog.component.d.ts +3 -3
  24. package/src/pages/debug/debug.component.d.ts +5 -8
  25. package/src/pages/shopping-cart/shopping-cart.component.d.ts +3 -3
  26. package/src/resolvers/flow.resolver.d.ts +3 -1
  27. package/src/resolvers/quote.resolver.d.ts +3 -1
  28. package/src/services/flow.service.d.ts +11 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veloceapps/sdk",
3
- "version": "8.0.0-83",
3
+ "version": "8.0.0-84",
4
4
  "private": false,
5
5
  "peerDependencies": {
6
6
  "@angular/animations": "~15.2.0",
@@ -4,6 +4,7 @@ import { ToastService } from '@veloceapps/components';
4
4
  import { UIDefinition } from '@veloceapps/core';
5
5
  import { ContextService, QuoteDraftService } from '@veloceapps/sdk/core';
6
6
  import { BehaviorSubject } from 'rxjs';
7
+ import { FlowService } from '../../services';
7
8
  import { FlowCustomization } from '../../types';
8
9
  import * as i0 from "@angular/core";
9
10
  export declare class DocGenComponent implements OnDestroy {
@@ -11,17 +12,18 @@ export declare class DocGenComponent implements OnDestroy {
11
12
  private contextService;
12
13
  private templatesApi;
13
14
  private toastService;
15
+ private flowService;
14
16
  private customizationService?;
15
17
  uiDefinition$: BehaviorSubject<UIDefinition | null>;
16
18
  private templateApiName;
17
19
  private destroy$;
18
- constructor(quoteDraftService: QuoteDraftService, contextService: ContextService, templatesApi: UITemplatesApiService, toastService: ToastService, customizationService?: FlowCustomization | undefined);
20
+ constructor(quoteDraftService: QuoteDraftService, contextService: ContextService, templatesApi: UITemplatesApiService, toastService: ToastService, flowService: FlowService, customizationService?: FlowCustomization | undefined);
19
21
  ngOnDestroy(): void;
20
22
  private initialize;
21
23
  private getTemplateRootComponent$;
22
24
  private getLocalTemplateComponentMeta$;
23
25
  private getDocGenComponentMeta$;
24
26
  private generateUIDefinition$;
25
- static ɵfac: i0.ɵɵFactoryDeclaration<DocGenComponent, [null, null, null, null, { optional: true; }]>;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<DocGenComponent, [null, null, null, null, null, { optional: true; }]>;
26
28
  static ɵcmp: i0.ɵɵComponentDeclaration<DocGenComponent, "vl-flow-doc-gen", never, {}, {}, never, never, false, never>;
27
29
  }
@@ -2,20 +2,21 @@ import { OnDestroy } from '@angular/core';
2
2
  import { UITemplatesApiService } from '@veloceapps/api';
3
3
  import { ToastService } from '@veloceapps/components';
4
4
  import { UIDefinition } from '@veloceapps/core';
5
- import { ContextService, QuoteDraftService } from '@veloceapps/sdk/core';
5
+ import { QuoteDraftService } from '@veloceapps/sdk/core';
6
6
  import { BehaviorSubject } from 'rxjs';
7
+ import { FlowService } from '../../services';
7
8
  import { FlowCustomization } from '../../types';
8
9
  import * as i0 from "@angular/core";
9
10
  export declare class GuidedSellingComponent implements OnDestroy {
10
11
  private quoteDraftService;
11
- private contextService;
12
12
  private templatesApi;
13
13
  private toastService;
14
+ private flowService;
14
15
  private customizationService?;
15
16
  uiDefinition$: BehaviorSubject<UIDefinition | null>;
16
17
  private templateApiName;
17
18
  private destroy$;
18
- constructor(quoteDraftService: QuoteDraftService, contextService: ContextService, templatesApi: UITemplatesApiService, toastService: ToastService, customizationService?: FlowCustomization | undefined);
19
+ constructor(quoteDraftService: QuoteDraftService, templatesApi: UITemplatesApiService, toastService: ToastService, flowService: FlowService, customizationService?: FlowCustomization | undefined);
19
20
  ngOnDestroy(): void;
20
21
  private initialize;
21
22
  private getTemplateRootComponent$;
@@ -0,0 +1,2 @@
1
+ import { CanActivateFn } from '@angular/router';
2
+ export declare const isFlowInitialized: CanActivateFn;
@@ -2,8 +2,8 @@ import { ChangeDetectorRef, OnDestroy, OnInit } from '@angular/core';
2
2
  import { UITemplatesApiService } from '@veloceapps/api';
3
3
  import { ToastService } from '@veloceapps/components';
4
4
  import { UIDefinition } from '@veloceapps/core';
5
- import { ContextService } from '@veloceapps/sdk/core';
6
5
  import { BehaviorSubject } from 'rxjs';
6
+ import { FlowService } from '../../services';
7
7
  import { FlowCustomization } from '../../types';
8
8
  import * as i0 from "@angular/core";
9
9
  interface State {
@@ -12,15 +12,15 @@ interface State {
12
12
  }
13
13
  export declare class AssetsComponent implements OnInit, OnDestroy {
14
14
  private templatesApi;
15
- private contextService;
16
15
  private cdr;
17
16
  private toastService;
17
+ private flowService;
18
18
  private customizationService?;
19
19
  uiDefinition?: UIDefinition;
20
20
  state$: BehaviorSubject<State>;
21
21
  private templateApiName;
22
22
  private destroyed$;
23
- constructor(templatesApi: UITemplatesApiService, contextService: ContextService, cdr: ChangeDetectorRef, toastService: ToastService, customizationService?: FlowCustomization | undefined);
23
+ constructor(templatesApi: UITemplatesApiService, cdr: ChangeDetectorRef, toastService: ToastService, flowService: FlowService, customizationService?: FlowCustomization | undefined);
24
24
  ngOnInit(): void;
25
25
  ngOnDestroy(): void;
26
26
  private getTemplateRootComponent$;
@@ -2,8 +2,8 @@ import { ChangeDetectorRef, OnDestroy, OnInit } from '@angular/core';
2
2
  import { UITemplatesApiService } from '@veloceapps/api';
3
3
  import { ToastService } from '@veloceapps/components';
4
4
  import { UIDefinition } from '@veloceapps/core';
5
- import { ContextService } from '@veloceapps/sdk/core';
6
5
  import { BehaviorSubject } from 'rxjs';
6
+ import { FlowService } from '../../services';
7
7
  import { FlowCustomization } from '../../types';
8
8
  import * as i0 from "@angular/core";
9
9
  interface State {
@@ -12,15 +12,15 @@ interface State {
12
12
  }
13
13
  export declare class CatalogComponent implements OnInit, OnDestroy {
14
14
  private templatesApi;
15
- private contextService;
16
15
  private cdr;
17
16
  private toastService;
17
+ private flowService;
18
18
  private customizationService?;
19
19
  uiDefinition?: UIDefinition;
20
20
  state$: BehaviorSubject<State>;
21
21
  private templateApiName;
22
22
  private destroyed$;
23
- constructor(templatesApi: UITemplatesApiService, contextService: ContextService, cdr: ChangeDetectorRef, toastService: ToastService, customizationService?: FlowCustomization | undefined);
23
+ constructor(templatesApi: UITemplatesApiService, cdr: ChangeDetectorRef, toastService: ToastService, flowService: FlowService, customizationService?: FlowCustomization | undefined);
24
24
  ngOnInit(): void;
25
25
  ngOnDestroy(): void;
26
26
  private getTemplateRootComponent$;
@@ -1,13 +1,10 @@
1
1
  import { FormControl, FormGroup } from '@angular/forms';
2
- import { ActivatedRoute, Router } from '@angular/router';
2
+ import { ActivatedRoute, Params, Router } from '@angular/router';
3
3
  import { FlowsApiService } from '@veloceapps/api';
4
- import { FlowProperties } from '@veloceapps/core';
4
+ import { Flow } from '@veloceapps/core';
5
5
  import { ContextService, QuoteDraftService } from '@veloceapps/sdk/core';
6
6
  import { Observable } from 'rxjs';
7
7
  import * as i0 from "@angular/core";
8
- interface FlowPropertiesExt extends FlowProperties {
9
- queryParamsStr: string;
10
- }
11
8
  export declare class DebugComponent {
12
9
  private flowsApiService;
13
10
  private router;
@@ -17,11 +14,11 @@ export declare class DebugComponent {
17
14
  form: FormGroup<{
18
15
  id: FormControl<string | null>;
19
16
  }>;
20
- selectedFlow?: FlowPropertiesExt;
21
- flows$: Observable<FlowPropertiesExt[]>;
17
+ selectedFlow?: Flow;
18
+ flows$: Observable<Flow[]>;
22
19
  constructor(flowsApiService: FlowsApiService, router: Router, activatedRoute: ActivatedRoute, context: ContextService, quoteDraftService: QuoteDraftService);
23
20
  runFlow(): void;
21
+ getQueryParamsString(params: Params): string;
24
22
  static ɵfac: i0.ɵɵFactoryDeclaration<DebugComponent, never>;
25
23
  static ɵcmp: i0.ɵɵComponentDeclaration<DebugComponent, "vl-flow-debug", never, {}, {}, never, never, false, never>;
26
24
  }
27
- export {};
@@ -2,8 +2,8 @@ import { ChangeDetectorRef, OnDestroy, OnInit } from '@angular/core';
2
2
  import { UITemplatesApiService } from '@veloceapps/api';
3
3
  import { ToastService } from '@veloceapps/components';
4
4
  import { UIDefinition } from '@veloceapps/core';
5
- import { ContextService } from '@veloceapps/sdk/core';
6
5
  import { BehaviorSubject } from 'rxjs';
6
+ import { FlowService } from '../../services';
7
7
  import { FlowCustomization } from '../../types';
8
8
  import * as i0 from "@angular/core";
9
9
  interface State {
@@ -12,15 +12,15 @@ interface State {
12
12
  }
13
13
  export declare class ShoppingCartComponent implements OnInit, OnDestroy {
14
14
  private templatesApi;
15
- private contextService;
16
15
  private cdr;
17
16
  private toastService;
17
+ private flowService;
18
18
  private customizationService?;
19
19
  uiDefinition?: UIDefinition;
20
20
  state$: BehaviorSubject<State>;
21
21
  private templateApiName;
22
22
  private destroyed$;
23
- constructor(templatesApi: UITemplatesApiService, contextService: ContextService, cdr: ChangeDetectorRef, toastService: ToastService, customizationService?: FlowCustomization | undefined);
23
+ constructor(templatesApi: UITemplatesApiService, cdr: ChangeDetectorRef, toastService: ToastService, flowService: FlowService, customizationService?: FlowCustomization | undefined);
24
24
  ngOnInit(): void;
25
25
  ngOnDestroy(): void;
26
26
  private getTemplateRootComponent$;
@@ -1,6 +1,7 @@
1
1
  import { ActivatedRouteSnapshot, Resolve, Router } from '@angular/router';
2
2
  import { FlowsApiService } from '@veloceapps/api';
3
3
  import { ContextService } from '@veloceapps/sdk/core';
4
+ import { FlowService } from '../services';
4
5
  import { FlowRouterService } from '../services/flow-router.service';
5
6
  import * as i0 from "@angular/core";
6
7
  export declare class FlowResolver implements Resolve<Promise<boolean>> {
@@ -8,7 +9,8 @@ export declare class FlowResolver implements Resolve<Promise<boolean>> {
8
9
  private flowsApiService;
9
10
  private routerService;
10
11
  private contextService;
11
- constructor(router: Router, flowsApiService: FlowsApiService, routerService: FlowRouterService, contextService: ContextService);
12
+ private flowService;
13
+ constructor(router: Router, flowsApiService: FlowsApiService, routerService: FlowRouterService, contextService: ContextService, flowService: FlowService);
12
14
  private handleError;
13
15
  resolve(route: ActivatedRouteSnapshot): any;
14
16
  static ɵfac: i0.ɵɵFactoryDeclaration<FlowResolver, never>;
@@ -2,6 +2,7 @@ import { ActivatedRouteSnapshot, Resolve, Router } from '@angular/router';
2
2
  import { IntegrationState } from '@veloceapps/sdk/cms';
3
3
  import { ContextService, FlowConfigurationService, QuoteDraftService } from '@veloceapps/sdk/core';
4
4
  import { Observable } from 'rxjs';
5
+ import { FlowService } from '../services';
5
6
  import { FlowRouterService } from '../services/flow-router.service';
6
7
  import * as i0 from "@angular/core";
7
8
  export declare class QuoteResolver implements Resolve<void | boolean> {
@@ -11,7 +12,8 @@ export declare class QuoteResolver implements Resolve<void | boolean> {
11
12
  private contextService;
12
13
  private flowConfiguration;
13
14
  private integrationState;
14
- constructor(router: Router, quoteDraftService: QuoteDraftService, routerService: FlowRouterService, contextService: ContextService, flowConfiguration: FlowConfigurationService, integrationState: IntegrationState);
15
+ private flowService;
16
+ constructor(router: Router, quoteDraftService: QuoteDraftService, routerService: FlowRouterService, contextService: ContextService, flowConfiguration: FlowConfigurationService, integrationState: IntegrationState, flowService: FlowService);
15
17
  private handleError;
16
18
  private calculate$;
17
19
  resolve(route: ActivatedRouteSnapshot): Observable<void | boolean>;
@@ -1,5 +1,8 @@
1
+ import { FlowsApiService } from '@veloceapps/api';
2
+ import { Flow } from '@veloceapps/core';
1
3
  import { IntegrationState } from '@veloceapps/sdk/cms';
2
4
  import { ConfigurationService, FlowConfigurationService, QuoteDraftService } from '@veloceapps/sdk/core';
5
+ import { Observable } from 'rxjs';
3
6
  import { FlowRouterService } from './flow-router.service';
4
7
  import * as i0 from "@angular/core";
5
8
  export declare class FlowService {
@@ -8,10 +11,16 @@ export declare class FlowService {
8
11
  private quoteDraftService;
9
12
  private configurationService;
10
13
  private flowConfigurationService;
14
+ private flowsApiService;
15
+ private readonly flowSubj$;
16
+ flow$: Observable<Flow | null>;
17
+ get flow(): Flow | null;
11
18
  private cleanup$;
12
- constructor(integrationState: IntegrationState, flowRouterService: FlowRouterService, quoteDraftService: QuoteDraftService, configurationService: ConfigurationService, flowConfigurationService: FlowConfigurationService);
13
- initSubscriptions(): void;
19
+ constructor(integrationState: IntegrationState, flowRouterService: FlowRouterService, quoteDraftService: QuoteDraftService, configurationService: ConfigurationService, flowConfigurationService: FlowConfigurationService, flowsApiService: FlowsApiService);
14
20
  cleanup(): void;
21
+ setFlow(flow?: Flow): void;
22
+ setFlowById$(flowId: string): Observable<boolean>;
23
+ initSubscriptions(): void;
15
24
  private updateFlowPath;
16
25
  static ɵfac: i0.ɵɵFactoryDeclaration<FlowService, never>;
17
26
  static ɵprov: i0.ɵɵInjectableDeclaration<FlowService>;