@kwiz/common 1.0.160 → 1.0.162

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.
package/lib/cjs/config.js CHANGED
@@ -1,9 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ReleaseStatus = exports.IsProduction = exports.IsLocalDev = exports.IsFastRing = exports.BuildNumber = exports.CommonConfig = exports.GetLogger = void 0;
3
+ exports.ReleaseStatus = exports.IsProduction = exports.IsLocalDev = exports.IsFastRing = exports.BuildNumber = exports.GetLogger = exports.CommonConfig = void 0;
4
4
  exports.config = config;
5
5
  const _dependencies_1 = require("./_dependencies");
6
6
  const exports_index_1 = require("./exports-index");
7
+ class CommonConfig {
8
+ constructor() { }
9
+ static get i() {
10
+ return _dependencies_1.configInfo;
11
+ }
12
+ }
13
+ exports.CommonConfig = CommonConfig;
14
+ var unconfigured = true;
7
15
  class GetLogger {
8
16
  constructor(name) {
9
17
  this.projectNameUsed = null;
@@ -13,22 +21,20 @@ class GetLogger {
13
21
  get i() {
14
22
  if (this.instance === null || this.projectNameUsed !== _dependencies_1.configInfo.ProjectName) {
15
23
  this.projectNameUsed = _dependencies_1.configInfo.ProjectName;
16
- this.instance = GetLoggerInternal(this.name);
24
+ if (unconfigured)
25
+ console.warn('@kwiz/common not configured yet! Call config before this code runs.');
26
+ this.instance = exports_index_1.ConsoleLogger.get(this.name, _dependencies_1.configInfo.ProjectName);
17
27
  }
18
28
  return this.instance;
19
29
  }
20
30
  ;
21
31
  }
22
32
  exports.GetLogger = GetLogger;
23
- var GetLoggerInternal = (name) => {
24
- console.warn('@kwiz/common not configured yet! Call config before this code runs.');
25
- return exports_index_1.ConsoleLogger.get(name);
26
- };
33
+ var unconfigured = true;
27
34
  ;
28
35
  function config(params) {
29
36
  (0, _dependencies_1.SetDependencies)(params);
30
- //initialize it and remove the warning. prefix will automatically use configInfo.ProjectName
31
- GetLoggerInternal = name => exports_index_1.ConsoleLogger.get(name);
37
+ unconfigured = false;
32
38
  const GetLogger = (name) => {
33
39
  return exports_index_1.ConsoleLogger.get(name, _dependencies_1.configInfo.ProjectName);
34
40
  };
@@ -39,12 +45,6 @@ function config(params) {
39
45
  configInfo: _dependencies_1.configInfo
40
46
  };
41
47
  }
42
- class CommonConfig {
43
- get i() {
44
- return _dependencies_1.configInfo;
45
- }
46
- }
47
- exports.CommonConfig = CommonConfig;
48
48
  /** @deprecated use configInfo instead */
49
49
  exports.BuildNumber = _dependencies_1.configInfo.BuildNumber;
50
50
  /** @deprecated use configInfo instead */
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":";;;AAuCA,wBAcC;AArDD,mDAA8D;AAC9D,mDAA8D;AAW9D,MAAa,SAAS;IAElB,YAAmB,IAAY;QAGvB,oBAAe,GAAW,IAAI,CAAC;QAC/B,aAAQ,GAAkB,IAAI,CAAC;QAHnC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;IAGD,IAAW,CAAC;QACR,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI,IAAI,IAAI,CAAC,eAAe,KAAK,0BAAU,CAAC,WAAW,EAAE,CAAC;YAC5E,IAAI,CAAC,eAAe,GAAG,0BAAU,CAAC,WAAW,CAAC;YAC9C,IAAI,CAAC,QAAQ,GAAG,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjD,CAAC;QACD,OAAO,IAAI,CAAC,QAAQ,CAAC;IACzB,CAAC;IAAA,CAAC;CACL;AAdD,8BAcC;AAED,IAAI,iBAAiB,GAAG,CAAC,IAAY,EAAE,EAAE;IACrC,OAAO,CAAC,IAAI,CAAC,qEAAqE,CAAC,CAAC;IACpF,OAAO,6BAAa,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC,CAAC;AAMD,CAAC;AAEF,SAAgB,MAAM,CAAC,MAAqB;IACxC,IAAA,+BAA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 -1,5 +1,12 @@
1
1
  import { configInfo, SetDependencies } from './_dependencies';
2
2
  import { ConsoleLogger } from './exports-index';
3
+ export class CommonConfig {
4
+ constructor() { }
5
+ static get i() {
6
+ return configInfo;
7
+ }
8
+ }
9
+ var unconfigured = true;
3
10
  export class GetLogger {
4
11
  constructor(name) {
5
12
  this.projectNameUsed = null;
@@ -9,21 +16,19 @@ export class GetLogger {
9
16
  get i() {
10
17
  if (this.instance === null || this.projectNameUsed !== configInfo.ProjectName) {
11
18
  this.projectNameUsed = configInfo.ProjectName;
12
- this.instance = GetLoggerInternal(this.name);
19
+ if (unconfigured)
20
+ console.warn('@kwiz/common not configured yet! Call config before this code runs.');
21
+ this.instance = ConsoleLogger.get(this.name, configInfo.ProjectName);
13
22
  }
14
23
  return this.instance;
15
24
  }
16
25
  ;
17
26
  }
18
- var GetLoggerInternal = (name) => {
19
- console.warn('@kwiz/common not configured yet! Call config before this code runs.');
20
- return ConsoleLogger.get(name);
21
- };
27
+ var unconfigured = true;
22
28
  ;
23
29
  export function config(params) {
24
30
  SetDependencies(params);
25
- //initialize it and remove the warning. prefix will automatically use configInfo.ProjectName
26
- GetLoggerInternal = name => ConsoleLogger.get(name);
31
+ unconfigured = false;
27
32
  const GetLogger = (name) => {
28
33
  return ConsoleLogger.get(name, configInfo.ProjectName);
29
34
  };
@@ -34,11 +39,6 @@ export function config(params) {
34
39
  configInfo
35
40
  };
36
41
  }
37
- export class CommonConfig {
38
- get i() {
39
- return configInfo;
40
- }
41
- }
42
42
  /** @deprecated use configInfo instead */
43
43
  export const BuildNumber = configInfo.BuildNumber;
44
44
  /** @deprecated use configInfo instead */
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAgB,MAAM,iBAAiB,CAAC;AAW9D,MAAM,OAAO,SAAS;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AED,IAAI,YAAY,GAAG,IAAI,CAAC;AAMvB,CAAC;AAEF,MAAM,UAAU,MAAM,CAAC,MAAqB;IACxC,eAAe,CAAC,MAAM,CAAC,CAAC;IACxB,YAAY,GAAG,KAAK,CAAC;IACrB,MAAM,SAAS,GAAG,CAAC,IAAY,EAAE,EAAE;QAC/B,OAAO,aAAa,CAAC,GAAG,CAAC,IAAI,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IAC3D,CAAC,CAAC;IAEF,OAAO;QACH,SAAS,EAAE,SAAS;QACpB,0CAA0C;QAC1C,MAAM,EAAE,SAAS;QACjB,UAAU;KACb,CAAA;AACL,CAAC;AAED,yCAAyC;AACzC,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC;AAClD,yCAAyC;AACzC,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC;AAChD,yCAAyC;AACzC,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAAC,UAAU,CAAC;AAChD,yCAAyC;AACzC,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC,YAAY,CAAC;AACpD,yCAAyC;AACzC,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAC,aAAa,CAAC"}
@@ -7,6 +7,10 @@ export interface iConfigInfo {
7
7
  ReleaseStatus: releasetypes;
8
8
  ProjectName: string;
9
9
  }
10
+ export declare class CommonConfig {
11
+ private constructor();
12
+ static get i(): iConfigInfo;
13
+ }
10
14
  export declare class GetLogger {
11
15
  private name;
12
16
  constructor(name: string);
@@ -25,9 +29,6 @@ export declare function config(params: iConfigParams): {
25
29
  logger: (name: string) => ConsoleLogger;
26
30
  configInfo: iConfigInfo;
27
31
  };
28
- export declare class CommonConfig {
29
- get i(): iConfigInfo;
30
- }
31
32
  /** @deprecated use configInfo instead */
32
33
  export declare const BuildNumber: string;
33
34
  /** @deprecated use configInfo instead */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kwiz/common",
3
- "version": "1.0.160",
3
+ "version": "1.0.162",
4
4
  "description": "KWIZ common utilities and helpers for M365 platform",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/esm/index.js",