@ancon/wildcat-utils 1.25.4 → 1.25.6
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/logger/Logger.d.ts +1 -1
- package/logger/Logger.js +1 -1
- package/logger/Logger.mjs +9 -4
- package/logger/types.d.ts +2 -1
- package/outlet/constants.d.ts +0 -5
- package/outlet/constants.js +1 -1
- package/outlet/constants.mjs +6 -8
- package/outlet/getPartitionedOutletsList.js +1 -1
- package/outlet/getPartitionedOutletsList.mjs +1 -1
- package/outlet/types.d.ts +5 -0
- package/outlet/types.js +1 -1
- package/outlet/types.mjs +3 -2
- package/package.json +1 -1
package/logger/Logger.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ declare class Logger {
|
|
|
8
8
|
debug<T = unknown>(message: string, data?: T): void;
|
|
9
9
|
info<T = unknown>(message: string, data?: T): void;
|
|
10
10
|
warn<T = unknown>(message: string, data?: T): void;
|
|
11
|
-
error<T = unknown>(message: string, data?: T): void;
|
|
11
|
+
error<T = unknown, O = unknown>(message: string, data?: T, options?: O): void;
|
|
12
12
|
fatal<T = unknown>(message: string, data?: T): void;
|
|
13
13
|
}
|
|
14
14
|
export default Logger;
|
package/logger/Logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const i=require("./types.js");class
|
|
1
|
+
"use strict";const i=require("./types.js");class g{constructor(e){this.logStrategy=e}sanitize(e){return this.logStrategy.sanitize?this.logStrategy.sanitize(e):e}setLogStrategy(e){this.logStrategy=e}verbose(e,t){this.logStrategy.execute(i.LogLevel.Verbose,e,this.sanitize(t))}debug(e,t){this.logStrategy.execute(i.LogLevel.Debug,e,this.sanitize(t))}info(e,t){this.logStrategy.execute(i.LogLevel.Information,e,this.sanitize(t))}warn(e,t){this.logStrategy.execute(i.LogLevel.Warning,e,this.sanitize(t))}error(e,t,s){this.logStrategy.execute(i.LogLevel.Error,e,this.sanitize(t),s)}fatal(e,t){this.logStrategy.execute(i.LogLevel.Fatal,e,this.sanitize(t))}}module.exports=g;
|
package/logger/Logger.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LogLevel as i } from "./types.mjs";
|
|
2
|
-
class
|
|
2
|
+
class g {
|
|
3
3
|
constructor(t) {
|
|
4
4
|
this.logStrategy = t;
|
|
5
5
|
}
|
|
@@ -25,13 +25,18 @@ class a {
|
|
|
25
25
|
warn(t, e) {
|
|
26
26
|
this.logStrategy.execute(i.Warning, t, this.sanitize(e));
|
|
27
27
|
}
|
|
28
|
-
error(t, e) {
|
|
29
|
-
this.logStrategy.execute(
|
|
28
|
+
error(t, e, s) {
|
|
29
|
+
this.logStrategy.execute(
|
|
30
|
+
i.Error,
|
|
31
|
+
t,
|
|
32
|
+
this.sanitize(e),
|
|
33
|
+
s
|
|
34
|
+
);
|
|
30
35
|
}
|
|
31
36
|
fatal(t, e) {
|
|
32
37
|
this.logStrategy.execute(i.Fatal, t, this.sanitize(e));
|
|
33
38
|
}
|
|
34
39
|
}
|
|
35
40
|
export {
|
|
36
|
-
|
|
41
|
+
g as default
|
|
37
42
|
};
|
package/logger/types.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export interface LogStrategy {
|
|
|
16
16
|
* @param logLevel `LogLevel`
|
|
17
17
|
* @param message Message string
|
|
18
18
|
* @param data Any additional data to log. Sanitized if `sanitize()` method is implemented.
|
|
19
|
+
* @param options Any additional options to use when error logging
|
|
19
20
|
*/
|
|
20
|
-
execute(logLevel: LogLevel, message: string, data?: unknown): void;
|
|
21
|
+
execute(logLevel: LogLevel, message: string, data?: unknown, options?: unknown): void;
|
|
21
22
|
}
|
package/outlet/constants.d.ts
CHANGED
|
@@ -3,8 +3,3 @@ export declare const OnlineOrderFormatsArray: OrderFormat[];
|
|
|
3
3
|
export declare const OutletMapKeyFormatter = "YYYY-MM-DD";
|
|
4
4
|
export declare const OutletTimelineDayCount = 7;
|
|
5
5
|
export declare const OutletClosingLabelThreshold = 60;
|
|
6
|
-
export declare enum OutletListSection {
|
|
7
|
-
PreOrder = "PreOrder",
|
|
8
|
-
OrderNow = "OrderNow",
|
|
9
|
-
Closed = "Closed"
|
|
10
|
-
}
|
package/outlet/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@ancon/wildcat-types"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@ancon/wildcat-types"),r=[e.OrderFormat.EatIn,e.OrderFormat.TakeAway,e.OrderFormat.Delivery,e.OrderFormat.TableOrder],t="YYYY-MM-DD",a=7,o=60;exports.OnlineOrderFormatsArray=r;exports.OutletClosingLabelThreshold=o;exports.OutletMapKeyFormatter=t;exports.OutletTimelineDayCount=a;
|
package/outlet/constants.mjs
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { OrderFormat as e } from "@ancon/wildcat-types";
|
|
2
|
-
const
|
|
2
|
+
const r = [
|
|
3
3
|
e.EatIn,
|
|
4
4
|
e.TakeAway,
|
|
5
5
|
e.Delivery,
|
|
6
6
|
e.TableOrder
|
|
7
|
-
],
|
|
8
|
-
var o = /* @__PURE__ */ ((r) => (r.PreOrder = "PreOrder", r.OrderNow = "OrderNow", r.Closed = "Closed", r))(o || {});
|
|
7
|
+
], o = "YYYY-MM-DD", a = 7, l = 60;
|
|
9
8
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
o as
|
|
13
|
-
|
|
14
|
-
l as OutletTimelineDayCount
|
|
9
|
+
r as OnlineOrderFormatsArray,
|
|
10
|
+
l as OutletClosingLabelThreshold,
|
|
11
|
+
o as OutletMapKeyFormatter,
|
|
12
|
+
a as OutletTimelineDayCount
|
|
15
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("@ancon/wildcat-types"),
|
|
1
|
+
"use strict";const n=require("@ancon/wildcat-types"),u=require("./isOutletAcceptingPreOrders.js"),e=require("./types.js");function o(s){return s.reduce((r,t)=>{const i=u(t.orderFormatSettings);return t.state===n.OutletState.Open?r[e.OutletListSection.OrderNow].push(t):i?r[e.OutletListSection.PreOrder].push(t):r[e.OutletListSection.Closed].push(t),r},{[e.OutletListSection.OrderNow]:[],[e.OutletListSection.PreOrder]:[],[e.OutletListSection.Closed]:[]})}module.exports=o;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OutletState as o } from "@ancon/wildcat-types";
|
|
2
2
|
import d from "./isOutletAcceptingPreOrders.mjs";
|
|
3
|
-
import { OutletListSection as e } from "./
|
|
3
|
+
import { OutletListSection as e } from "./types.mjs";
|
|
4
4
|
function f(s) {
|
|
5
5
|
return s.reduce(
|
|
6
6
|
(t, r) => {
|
package/outlet/types.d.ts
CHANGED
package/outlet/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e=(
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e=(r=>(r[r.Interval=0]="Interval",r[r.Exception=1]="Exception",r))(e||{}),d=(r=>(r.PreOrder="PreOrder",r.OrderNow="OrderNow",r.Closed="Closed",r))(d||{});exports.OperatingHourType=e;exports.OutletListSection=d;
|
package/outlet/types.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
var
|
|
1
|
+
var d = /* @__PURE__ */ ((r) => (r[r.Interval = 0] = "Interval", r[r.Exception = 1] = "Exception", r))(d || {}), e = /* @__PURE__ */ ((r) => (r.PreOrder = "PreOrder", r.OrderNow = "OrderNow", r.Closed = "Closed", r))(e || {});
|
|
2
2
|
export {
|
|
3
|
-
|
|
3
|
+
d as OperatingHourType,
|
|
4
|
+
e as OutletListSection
|
|
4
5
|
};
|