@transcommerce/cwm-shared 1.1.35 → 1.1.37

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.
@@ -7,3 +7,4 @@ export type ApiConfig = {
7
7
  clientId: string;
8
8
  locationId: string;
9
9
  };
10
+ export declare const DEFAULT_API_CONFIG: ApiConfig;
@@ -1,15 +1,23 @@
1
- import { LogLevels } from '../log-levels';
2
- import { MsalLoginPrompts } from './msalLoginPrompts';
3
1
  export type AuthConfig = {
4
- logLevel: LogLevels;
2
+ logLevel: "None" | // No logging at all
3
+ "Error" | // This will only contain Errors
4
+ "Warn" | // This will Warnings and Errors
5
+ "Info" | // Default log level. This will contain Information, Warnings, and Error. This is used to provide general information about app flow but shouldn't contain values.
6
+ "Debug" | // Useful for debugging, This will contain Debug, Information, Warnings, and Error. If actual values are put in the logs, this should be chosen; they may need to be sanitized
7
+ "Trace";
5
8
  clientId: string;
6
9
  tenantId: string;
7
10
  authority: string;
8
11
  scopes: string;
9
12
  redirect_uri: string;
10
13
  logout_redirect_uri: string;
11
- prompt: MsalLoginPrompts;
14
+ prompt: 'none' | // Silent auth only. Fails if user interaction is required. Useful for checking SSO state.
15
+ 'login' | // Forces the user to enter credentials again. Always shows the sign‑in page.
16
+ 'select_account' | // Shows the account picker UI, even if only one account exists.
17
+ 'consent' | // Forces the consent screen to appear, even if consent was previously granted.
18
+ 'create';
12
19
  msalDiagnosticsEnabled: boolean;
13
20
  showPii: boolean;
14
21
  configConnectString: string;
15
22
  };
23
+ export declare const DEFAULT_AUTH_CONFIG: AuthConfig;
@@ -8,3 +8,4 @@ export type CarouselConfig = {
8
8
  speed: number;
9
9
  arrows: boolean;
10
10
  };
11
+ export declare const DEFAULT_CAROUSEL_CONFIG: CarouselConfig;
@@ -11,3 +11,4 @@ export type Configuration = {
11
11
  footerCarouselConfig: CarouselConfig;
12
12
  footerCarouselSlideConfig: Slide[];
13
13
  };
14
+ export declare const DEFAULT_CONFIGURATION: Configuration;
@@ -3,3 +3,4 @@ export type MenuBoardConfig = {
3
3
  autoScrollTimeout: number;
4
4
  dataAgeThreshold: number;
5
5
  };
6
+ export declare const DEFAULT_MENU_BOARD_CONFIG: MenuBoardConfig;
@@ -0,0 +1,8 @@
1
+ export interface SubscriptionConfig {
2
+ id: string;
3
+ amount: number;
4
+ days: number;
5
+ totalOccurrences: number;
6
+ trialOccurrences: number;
7
+ }
8
+ export declare const DEFAULT_SUBSCRIPTION_CONFIG: Partial<SubscriptionConfig>;
@@ -21,3 +21,4 @@ export declare class Customer {
21
21
  static MapToProfile(from: Customer): Profile;
22
22
  static MapFromProfile(from: Profile): Customer;
23
23
  }
24
+ export declare const DEFAULT_CUSTOMER: Customer;
@@ -4,3 +4,4 @@ export type InventoryApiResponse = {
4
4
  status: HttpStatusCode;
5
5
  data: FlowhubProduct[];
6
6
  };
7
+ export declare const DEFAULT_INVENTORY_API_RESPONSE: InventoryApiResponse;
@@ -1 +1,6 @@
1
- export type LogLevels = "Error" | "Warn" | "Debug" | "Info" | "None";
1
+ export type LogLevels = "None" | // No logging at all
2
+ "Error" | // This will only contain Errors
3
+ "Warn" | // This will Warnings and Errors
4
+ "Info" | // Default log level. This will contain Information, Warnings, and Error. This is used to provide general information about app flow but shouldn't contain values.
5
+ "Debug" | // Useful for debugging, This will contain Debug, Information, Warnings, and Error. If actual values are put in the logs, this should be chosen; they may need to be sanitized
6
+ "Trace";
@@ -18,3 +18,4 @@ export declare class Profile {
18
18
  static MapFromCustomer(from: Customer): Profile;
19
19
  static MapToCustomer(from: Profile): Customer;
20
20
  }
21
+ export declare const DEFAULT_PROFILE: Profile;
@@ -6,3 +6,4 @@ export type Slide = {
6
6
  textColor: 'red' | 'green' | 'blue' | 'yellow' | 'black' | 'white';
7
7
  backgroundColor: 'red' | 'green' | 'blue' | 'yellow' | 'black' | 'white';
8
8
  };
9
+ export declare const DEFAULT_SLIDE: Slide;
@@ -2,16 +2,16 @@ import { IBaseApiService } from './ibase-api.service';
2
2
  import { ApiConfig } from '../models/config/api-config';
3
3
  import { ConfigService } from './config.service';
4
4
  import { HttpClient } from '@angular/common/http';
5
- import { LogService } from './log.service';
5
+ import { ClassLoggerService } from './class-logger.service';
6
6
  import * as i0 from "@angular/core";
7
7
  export declare class BaseApiService implements IBaseApiService {
8
8
  configService: ConfigService;
9
9
  httpClient: HttpClient;
10
- logService: LogService;
10
+ logger: ClassLoggerService;
11
11
  config: ApiConfig;
12
12
  get apiBaseUrl(): string;
13
13
  get apiFullUrl(): string;
14
- constructor(configService: ConfigService, httpClient: HttpClient, logService: LogService);
14
+ constructor(configService: ConfigService, httpClient: HttpClient, logger: ClassLoggerService);
15
15
  static ɵfac: i0.ɵɵFactoryDeclaration<BaseApiService, never>;
16
16
  static ɵprov: i0.ɵɵInjectableDeclaration<BaseApiService>;
17
17
  }
@@ -12,11 +12,11 @@ export declare class ClassLoggerService {
12
12
  endOfMethod(): void;
13
13
  private get targetName();
14
14
  private get prefix();
15
- log(message?: any, ...optionalParams: any[]): void;
16
- debug(message?: any, ...optionalParams: any[]): void;
17
- info(message?: any, ...optionalParams: any[]): void;
18
- warn(message?: any, ...optionalParams: any[]): void;
19
15
  error(message?: any, ...optionalParams: any[]): void;
16
+ warn(message?: any, ...optionalParams: any[]): void;
17
+ info(message?: any, ...optionalParams: any[]): void;
18
+ debug(message?: any, ...optionalParams: any[]): void;
19
+ trace(message?: any, ...optionalParams: any[]): void;
20
20
  static ɵfac: i0.ɵɵFactoryDeclaration<ClassLoggerService, never>;
21
21
  static ɵprov: i0.ɵɵInjectableDeclaration<ClassLoggerService>;
22
22
  }
@@ -1,15 +1,15 @@
1
1
  import { Configuration } from '../models/config/configuration';
2
- import { LogService } from './log.service';
2
+ import { ClassLoggerService } from './class-logger.service';
3
3
  import * as i0 from "@angular/core";
4
4
  export declare class ConfigService {
5
- private logService;
5
+ private logger;
6
6
  mockData: boolean;
7
7
  private readonly configClient;
8
8
  private readonly configConnectString;
9
9
  private _configCache;
10
10
  protected get configCache(): Configuration;
11
11
  protected set configCache(value: Configuration);
12
- constructor(logService: LogService);
12
+ constructor(logger: ClassLoggerService);
13
13
  getConfigurationSettingAsync(key: string, label: string): Promise<string | undefined>;
14
14
  setConfigurationSettingAsync(templateName: string, label: string, setting: any, contentType?: "Text" | "HTML" | "JSON" | "XML"): Promise<void>;
15
15
  getConfigAsync(company: string): Promise<Configuration>;
@@ -1,12 +1,12 @@
1
1
  import { ConfigService } from './config.service';
2
2
  import { HttpClient } from '@angular/common/http';
3
3
  import { ApiConfig } from '../models/config/api-config';
4
- import { LogService } from './log.service';
4
+ import { ClassLoggerService } from './class-logger.service';
5
5
  export interface IBaseApiService {
6
6
  config: ApiConfig;
7
7
  get apiBaseUrl(): string;
8
8
  get apiFullUrl(): string;
9
9
  configService: ConfigService;
10
- logService: LogService;
10
+ logger: ClassLoggerService;
11
11
  httpClient: HttpClient;
12
12
  }
@@ -4,11 +4,11 @@ import { InventoryApiResponse } from '../models/inventory-api-response';
4
4
  import { Product } from '../models/product';
5
5
  import { BaseApiService } from './base-api.service';
6
6
  import { ConfigService } from './config.service';
7
- import { LogService } from './log.service';
7
+ import { ClassLoggerService } from './class-logger.service';
8
8
  import * as i0 from "@angular/core";
9
9
  export declare class InventoryApiService extends BaseApiService {
10
10
  useMockData: boolean;
11
- constructor(configService: ConfigService, httpClient: HttpClient, logService: LogService);
11
+ constructor(configService: ConfigService, httpClient: HttpClient, logger: ClassLoggerService);
12
12
  private get httpHeaders();
13
13
  get apiFullUrl(): string;
14
14
  getProductsAsync(companyName: string): Promise<InventoryApiResponse>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transcommerce/cwm-shared",
3
- "version": "1.1.35",
3
+ "version": "1.1.37",
4
4
  "engines": {
5
5
  "node": ">=18.0.0 <21.0.0"
6
6
  },
package/public-api.d.ts CHANGED
@@ -15,8 +15,8 @@ export * from './lib/models/config/api-config';
15
15
  export * from './lib/models/config/auth-config';
16
16
  export * from './lib/models/config/carousel-config';
17
17
  export * from './lib/models/config/configuration';
18
- export * from './lib/models/config/display-config';
19
18
  export * from './lib/models/config/menu-board-config';
19
+ export * from './lib/models/config/subscription-config';
20
20
  export * from './lib/models/add-subscription-request';
21
21
  export * from './lib/models/cannabinoid-information';
22
22
  export * from './lib/models/card-types';
@@ -1,14 +0,0 @@
1
- import { Font } from "../font";
2
- import { Image } from "../image";
3
- import { Slide } from "../slide";
4
- import { CarouselConfig } from "./carousel-config";
5
- import { Color } from '../color';
6
- export type DisplayConfig = {
7
- companyName: string;
8
- backgroundColor: Color;
9
- font: Font;
10
- headerLogo: Image;
11
- showFooterCarousel: boolean;
12
- footerCarouselConfig: CarouselConfig;
13
- footerCarouselSlides: Slide[];
14
- };
@@ -1,5 +0,0 @@
1
- export type MsalLoginPrompts = 'none' | // Silent auth only. Fails if user interaction is required. Useful for checking SSO state.
2
- 'login' | // Forces the user to enter credentials again. Always shows the sign‑in page.
3
- 'select_account' | // Shows the account picker UI, even if only one account exists.
4
- 'consent' | // Forces the consent screen to appear, even if consent was previously granted.
5
- 'create';