@ancon/wildcat-utils 1.10.1 → 1.11.0
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/index.d.ts +1 -0
- package/index.js +1 -1
- package/index.mjs +34 -27
- package/outlet/getListOutletOpeningHoursTable.js +1 -1
- package/outlet/getListOutletOpeningHoursTable.mjs +36 -35
- package/outlet/index.d.ts +2 -1
- package/outlet/index.js +1 -1
- package/outlet/index.mjs +3 -2
- package/outlet/types.d.ts +2 -1
- package/package.json +73 -27
- package/printing/index.d.ts +4 -0
- package/printing/index.js +1 -0
- package/printing/index.mjs +8 -0
- package/printing/isValidNetworkPrinter.d.ts +10 -0
- package/printing/isValidNetworkPrinter.js +1 -0
- package/printing/isValidNetworkPrinter.mjs +7 -0
- package/printing/isValidPrinter.d.ts +8 -0
- package/printing/isValidPrinter.js +1 -0
- package/printing/isValidPrinter.mjs +8 -0
- package/printing/isValidStarCloudPrinter.d.ts +10 -0
- package/printing/isValidStarCloudPrinter.js +1 -0
- package/printing/isValidStarCloudPrinter.mjs +7 -0
- package/user/getFullAddressString.d.ts +2 -2
- package/user/getFullAddressString.js +1 -1
- package/user/getFullAddressString.mjs +1 -1
- package/user/getFullName.d.ts +3 -2
- package/user/getFullName.js +1 -1
- package/user/getFullName.mjs +1 -1
- package/user/index.d.ts +3 -2
- package/user/index.js +1 -1
- package/user/index.mjs +4 -4
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./shared/enums.js"),r=require("./shared/isWithinFlag.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./shared/enums.js"),r=require("./shared/isWithinFlag.js"),i=require("./shared/generateId.js"),t=require("./outlet/getListOutletOpeningHoursTable.js"),n=require("./versioning/isVersionALessThanB.js"),s=require("./versioning/cleanVersionString.js"),o=require("./api/getUrlAndParams.js"),l=require("./api/getEndpointWithVersion.js"),g=require("./string/slugify.js"),a=require("./color/lighten.js"),u=require("./color/brighten.js"),d=require("./color/darken.js"),c=require("./user/getFullName.js"),q=require("./user/getFullAddressString.js"),_=require("./logger/Logger.js"),h=require("./logger/types.js"),p=require("./printing/isValidPrinter.js"),V=require("./printing/isValidNetworkPrinter.js"),L=require("./printing/isValidStarCloudPrinter.js");require("moment");require("@ancon/wildcat-types");require("compare-versions");require("tinycolor2");exports.DayOfWeek=e.DayOfWeek;exports.IntervalState=e.IntervalState;exports.IntervalType=e.IntervalType;exports.OrderFormat=e.OrderFormat;exports.isWithinFlag=r;exports.generateId=i;exports.getListOutletOpeningHoursTable=t;exports.isVersionALessThanB=n;exports.cleanVersionString=s;exports.getUrlAndParams=o;exports.getEndpointWithVersion=l;exports.slugify=g;exports.lighten=a;exports.brighten=u;exports.darken=d;exports.getFullName=c;exports.getFullAddressString=q;exports.Logger=_;exports.LogLevel=h.LogLevel;exports.isValidPrinter=p;exports.isValidNetworkPrinter=V;exports.isValidStarCloudPrinter=L;
|
package/index.mjs
CHANGED
|
@@ -1,40 +1,47 @@
|
|
|
1
|
-
import { DayOfWeek as
|
|
2
|
-
import { default as
|
|
1
|
+
import { DayOfWeek as l, IntervalState as s, IntervalType as i, OrderFormat as d } from "./shared/enums.mjs";
|
|
2
|
+
import { default as p } from "./shared/isWithinFlag.mjs";
|
|
3
3
|
import { default as n } from "./shared/generateId.mjs";
|
|
4
4
|
import { default as g } from "./outlet/getListOutletOpeningHoursTable.mjs";
|
|
5
5
|
import { default as h } from "./versioning/isVersionALessThanB.mjs";
|
|
6
6
|
import { default as F } from "./versioning/cleanVersionString.mjs";
|
|
7
|
-
import { default as
|
|
8
|
-
import { default as
|
|
9
|
-
import { default as
|
|
10
|
-
import { default as
|
|
11
|
-
import { default as
|
|
12
|
-
import { default as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { default as
|
|
16
|
-
import { LogLevel as
|
|
7
|
+
import { default as P } from "./api/getUrlAndParams.mjs";
|
|
8
|
+
import { default as k } from "./api/getEndpointWithVersion.mjs";
|
|
9
|
+
import { default as y } from "./string/slugify.mjs";
|
|
10
|
+
import { default as I } from "./color/lighten.mjs";
|
|
11
|
+
import { default as W } from "./color/brighten.mjs";
|
|
12
|
+
import { default as N } from "./color/darken.mjs";
|
|
13
|
+
import { default as w } from "./user/getFullName.mjs";
|
|
14
|
+
import { default as C } from "./user/getFullAddressString.mjs";
|
|
15
|
+
import { default as E } from "./logger/Logger.mjs";
|
|
16
|
+
import { LogLevel as U } from "./logger/types.mjs";
|
|
17
|
+
import { default as q } from "./printing/isValidPrinter.mjs";
|
|
18
|
+
import { default as G } from "./printing/isValidNetworkPrinter.mjs";
|
|
19
|
+
import { default as K } from "./printing/isValidStarCloudPrinter.mjs";
|
|
17
20
|
import "moment";
|
|
21
|
+
import "@ancon/wildcat-types";
|
|
18
22
|
import "compare-versions";
|
|
19
23
|
import "tinycolor2";
|
|
20
24
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
l as DayOfWeek,
|
|
26
|
+
s as IntervalState,
|
|
27
|
+
i as IntervalType,
|
|
28
|
+
U as LogLevel,
|
|
29
|
+
E as Logger,
|
|
30
|
+
d as OrderFormat,
|
|
31
|
+
W as brighten,
|
|
28
32
|
F as cleanVersionString,
|
|
29
|
-
|
|
33
|
+
N as darken,
|
|
30
34
|
n as generateId,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
35
|
+
k as getEndpointWithVersion,
|
|
36
|
+
C as getFullAddressString,
|
|
37
|
+
w as getFullName,
|
|
34
38
|
g as getListOutletOpeningHoursTable,
|
|
35
|
-
|
|
39
|
+
P as getUrlAndParams,
|
|
40
|
+
G as isValidNetworkPrinter,
|
|
41
|
+
q as isValidPrinter,
|
|
42
|
+
K as isValidStarCloudPrinter,
|
|
36
43
|
h as isVersionALessThanB,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
44
|
+
p as isWithinFlag,
|
|
45
|
+
I as lighten,
|
|
46
|
+
y as slugify
|
|
40
47
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const W=require("moment"),p=require("@ancon/wildcat-types"),s=require("../shared/enums.js"),F=require("../shared/isWithinFlag.js"),k=require("../shared/generateId.js"),l=[{id:p.OrderFormat.EatIn,name:"eatIn"},{id:p.OrderFormat.TakeAway,name:"takeaway"},{id:p.OrderFormat.TableOrder,name:"tableOrder"},{id:p.OrderFormat.Delivery,name:"delivery"}];function v(e){const r=W.utc(e).subtract(1,"day").startOf("day"),t=[];for(let i=0,o=r;i<7;i+=1)o=o.clone().add(1,"day").startOf("day"),t.push(o.clone());return t}function S(e){return[...e].sort((r,t)=>r.isoWeekday()-t.isoWeekday())}function g(e){return e.split(":").map(Number)}function T(e,r){const[t,i]=g(e.start),[o,a]=g(e.duration);if(e.type===s.IntervalType.Interval){const n=r.clone().add(t,"hour").add(i,"minute"),u=n.clone().add(o,"hour").add(a,"minute");return{id:e.id,start:n.toISOString(),end:u.toISOString()}}if(e.type===s.IntervalType.Exception){const n=W(e.fromDate),u=W(e.toDate);if(r.isBetween(n,u,void 0,"[]")){const O=r.clone().add(t,"hour").add(i,"minute"),y=O.clone().add(o,"hour").add(a,"minute");return{id:e.id,start:O.toISOString(),end:y.toISOString(),reason:e.reason}}return null}throw new Error("Invalid interval type")}function h(e,r,t){const i={[s.DayOfWeek.Monday]:1,[s.DayOfWeek.Tuesday]:2,[s.DayOfWeek.Wednesday]:3,[s.DayOfWeek.Thursday]:4,[s.DayOfWeek.Friday]:5,[s.DayOfWeek.Saturday]:6,[s.DayOfWeek.Sunday]:7};for(let o=0;o<r.length;o+=1){const a=r[o],n=a.isoWeekday(),u=e.dayOfWeek,y=(i[u]??null)===n||u===s.DayOfWeek.Everyday;if(t[n]||(t[n]={isoWeekday:n,key:"",open:[],adjusted:[],closed:[]}),y){const d=T(e,a);d&&(t[n].key+=d.id,e.type===s.IntervalType.Interval&&e.state===s.IntervalState.Open?t[n].open.push(d):e.type===s.IntervalType.Interval&&e.state===s.IntervalState.Closed?t[n].closed.push(d):e.type===s.IntervalType.Exception&&e.state===s.IntervalState.Open?t[n].adjusted.push(d):e.type===s.IntervalType.Exception&&e.state===s.IntervalState.Closed&&t[n].closed.push(d))}}}function D(e){switch(e.type){case s.IntervalType.Exception:return k("interval-exception");case s.IntervalType.Interval:return k("interval-normal");default:return k("interval-unknown")}}function M(e){const r=e.reduce((t,i)=>(l.forEach(o=>{F(o.id,i.orderFormats)&&(t[o.id]||(t[o.id]={orderFormat:o,intervals:[]}),t[o.id].intervals.push(...i.intervals.sort((a,n)=>a.dayOfWeek-n.dayOfWeek)))}),t),{});return Object.values(r)}function H(e){return e.reduce((r,t,i)=>{const o=r.findIndex(a=>a!==t&&!a.orderFormats.some(n=>t.orderFormats.some(u=>u.id===n.id))&&a.openingHours.every(n=>t.openingHours.some(u=>u.key===n.key))&&t.openingHours.every(n=>a.openingHours.some(u=>u.key===n.key)));if(o>=0){const a=r[o];return r.splice(o,1,{...a,orderFormats:[...t.orderFormats,...a.orderFormats]}),r.splice(i,1),r}return r},[...e])}function E(e){return e.map(r=>({...r,intervals:r.intervals.map(t=>({...t,id:D(t)}))}))}function w(e,r){const t=M(E(e.serviceDateTimes)),i=v(r),o=S(i),a=t.reduce((y,d)=>(y[d.orderFormat.id]||(y[d.orderFormat.id]={}),d.intervals.reduce((I,m)=>(h(m,o,I),I),y[d.orderFormat.id]),y),{}),n={[p.OrderFormat.EatIn]:l[0],[p.OrderFormat.TakeAway]:l[1],[p.OrderFormat.TableOrder]:l[2],[p.OrderFormat.Delivery]:l[3]},u=Object.entries(a).map(([y,d])=>({orderFormats:[n[Number(y)]],openingHours:Object.entries(d).map(([I,m])=>({isoWeekday:Number(I),key:m.key,open:m.open.sort((c,f)=>c.start.localeCompare(f.start)),adjusted:m.adjusted.sort((c,f)=>c.start.localeCompare(f.start)),closed:m.closed.sort((c,f)=>c.start.localeCompare(f.start))}))}));return H(u).sort((y,d)=>y.orderFormats[0].id-d.orderFormats[0].id)}module.exports=w;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import F from "moment";
|
|
2
|
-
import { OrderFormat as p
|
|
2
|
+
import { OrderFormat as p } from "@ancon/wildcat-types";
|
|
3
|
+
import { DayOfWeek as m, IntervalType as y, IntervalState as O } from "../shared/enums.mjs";
|
|
3
4
|
import h from "../shared/isWithinFlag.mjs";
|
|
4
5
|
import W from "../shared/generateId.mjs";
|
|
5
6
|
const k = [
|
|
6
7
|
{ id: p.EatIn, name: "eatIn" },
|
|
7
|
-
{ id: p.
|
|
8
|
+
{ id: p.TakeAway, name: "takeaway" },
|
|
8
9
|
{ id: p.TableOrder, name: "tableOrder" },
|
|
9
10
|
{ id: p.Delivery, name: "delivery" }
|
|
10
11
|
];
|
|
11
12
|
function M(e) {
|
|
12
13
|
const r = F.utc(e).subtract(1, "day").startOf("day"), t = [];
|
|
13
|
-
for (let a = 0,
|
|
14
|
-
|
|
14
|
+
for (let a = 0, n = r; a < 7; a += 1)
|
|
15
|
+
n = n.clone().add(1, "day").startOf("day"), t.push(n.clone());
|
|
15
16
|
return t;
|
|
16
17
|
}
|
|
17
18
|
function v(e) {
|
|
@@ -21,21 +22,21 @@ function S(e) {
|
|
|
21
22
|
return e.split(":").map(Number);
|
|
22
23
|
}
|
|
23
24
|
function H(e, r) {
|
|
24
|
-
const [t, a] = S(e.start), [
|
|
25
|
+
const [t, a] = S(e.start), [n, s] = S(
|
|
25
26
|
e.duration
|
|
26
27
|
);
|
|
27
28
|
if (e.type === y.Interval) {
|
|
28
|
-
const
|
|
29
|
+
const o = r.clone().add(t, "hour").add(a, "minute"), i = o.clone().add(n, "hour").add(s, "minute");
|
|
29
30
|
return {
|
|
30
31
|
id: e.id,
|
|
31
|
-
start:
|
|
32
|
+
start: o.toISOString(),
|
|
32
33
|
end: i.toISOString()
|
|
33
34
|
};
|
|
34
35
|
}
|
|
35
36
|
if (e.type === y.Exception) {
|
|
36
|
-
const
|
|
37
|
-
if (r.isBetween(
|
|
38
|
-
const I = r.clone().add(t, "hour").add(a, "minute"), u = I.clone().add(
|
|
37
|
+
const o = F(e.fromDate), i = F(e.toDate);
|
|
38
|
+
if (r.isBetween(o, i, void 0, "[]")) {
|
|
39
|
+
const I = r.clone().add(t, "hour").add(a, "minute"), u = I.clone().add(n, "hour").add(s, "minute");
|
|
39
40
|
return {
|
|
40
41
|
id: e.id,
|
|
41
42
|
start: I.toISOString(),
|
|
@@ -57,17 +58,17 @@ function E(e, r, t) {
|
|
|
57
58
|
[m.Saturday]: 6,
|
|
58
59
|
[m.Sunday]: 7
|
|
59
60
|
};
|
|
60
|
-
for (let
|
|
61
|
-
const s = r[
|
|
62
|
-
if (t[
|
|
63
|
-
isoWeekday:
|
|
61
|
+
for (let n = 0; n < r.length; n += 1) {
|
|
62
|
+
const s = r[n], o = s.isoWeekday(), i = e.dayOfWeek, u = (a[i] ?? null) === o || i === m.Everyday;
|
|
63
|
+
if (t[o] || (t[o] = {
|
|
64
|
+
isoWeekday: o,
|
|
64
65
|
key: "",
|
|
65
66
|
open: [],
|
|
66
67
|
adjusted: [],
|
|
67
68
|
closed: []
|
|
68
69
|
}), u) {
|
|
69
70
|
const d = H(e, s);
|
|
70
|
-
d && (t[
|
|
71
|
+
d && (t[o].key += d.id, e.type === y.Interval && e.state === O.Open ? t[o].open.push(d) : e.type === y.Interval && e.state === O.Closed ? t[o].closed.push(d) : e.type === y.Exception && e.state === O.Open ? t[o].adjusted.push(d) : e.type === y.Exception && e.state === O.Closed && t[o].closed.push(d));
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
74
|
}
|
|
@@ -83,13 +84,13 @@ function T(e) {
|
|
|
83
84
|
}
|
|
84
85
|
function x(e) {
|
|
85
86
|
const r = e.reduce(
|
|
86
|
-
(t, a) => (k.forEach((
|
|
87
|
-
h(
|
|
88
|
-
orderFormat:
|
|
87
|
+
(t, a) => (k.forEach((n) => {
|
|
88
|
+
h(n.id, a.orderFormats) && (t[n.id] || (t[n.id] = {
|
|
89
|
+
orderFormat: n,
|
|
89
90
|
intervals: []
|
|
90
|
-
}), t[
|
|
91
|
+
}), t[n.id].intervals.push(
|
|
91
92
|
...a.intervals.sort(
|
|
92
|
-
(s,
|
|
93
|
+
(s, o) => s.dayOfWeek - o.dayOfWeek
|
|
93
94
|
)
|
|
94
95
|
));
|
|
95
96
|
}), t),
|
|
@@ -100,20 +101,20 @@ function x(e) {
|
|
|
100
101
|
function j(e) {
|
|
101
102
|
return e.reduce(
|
|
102
103
|
(r, t, a) => {
|
|
103
|
-
const
|
|
104
|
+
const n = r.findIndex(
|
|
104
105
|
(s) => s !== t && !s.orderFormats.some(
|
|
105
|
-
(
|
|
106
|
-
(i) => i.id ===
|
|
106
|
+
(o) => t.orderFormats.some(
|
|
107
|
+
(i) => i.id === o.id
|
|
107
108
|
)
|
|
108
109
|
) && s.openingHours.every(
|
|
109
|
-
(
|
|
110
|
+
(o) => t.openingHours.some((i) => i.key === o.key)
|
|
110
111
|
) && t.openingHours.every(
|
|
111
|
-
(
|
|
112
|
+
(o) => s.openingHours.some((i) => i.key === o.key)
|
|
112
113
|
)
|
|
113
114
|
);
|
|
114
|
-
if (
|
|
115
|
-
const s = r[
|
|
116
|
-
return r.splice(
|
|
115
|
+
if (n >= 0) {
|
|
116
|
+
const s = r[n];
|
|
117
|
+
return r.splice(n, 1, {
|
|
117
118
|
...s,
|
|
118
119
|
orderFormats: [...t.orderFormats, ...s.orderFormats]
|
|
119
120
|
}), r.splice(a, 1), r;
|
|
@@ -132,21 +133,21 @@ function w(e) {
|
|
|
132
133
|
}))
|
|
133
134
|
}));
|
|
134
135
|
}
|
|
135
|
-
function
|
|
136
|
+
function B(e, r) {
|
|
136
137
|
const t = x(
|
|
137
138
|
w(e.serviceDateTimes)
|
|
138
|
-
), a = M(r),
|
|
139
|
-
(u, d) => (u[d.orderFormat.id] || (u[d.orderFormat.id] = {}), d.intervals.reduce((g, f) => (E(f,
|
|
139
|
+
), a = M(r), n = v(a), s = t.reduce(
|
|
140
|
+
(u, d) => (u[d.orderFormat.id] || (u[d.orderFormat.id] = {}), d.intervals.reduce((g, f) => (E(f, n, g), g), u[d.orderFormat.id]), u),
|
|
140
141
|
{}
|
|
141
|
-
),
|
|
142
|
+
), o = {
|
|
142
143
|
[p.EatIn]: k[0],
|
|
143
|
-
[p.
|
|
144
|
+
[p.TakeAway]: k[1],
|
|
144
145
|
[p.TableOrder]: k[2],
|
|
145
146
|
[p.Delivery]: k[3]
|
|
146
147
|
}, i = Object.entries(
|
|
147
148
|
s
|
|
148
149
|
).map(([u, d]) => ({
|
|
149
|
-
orderFormats: [
|
|
150
|
+
orderFormats: [o[Number(u)]],
|
|
150
151
|
openingHours: Object.entries(d).map(
|
|
151
152
|
([g, f]) => ({
|
|
152
153
|
isoWeekday: Number(g),
|
|
@@ -168,5 +169,5 @@ function A(e, r) {
|
|
|
168
169
|
);
|
|
169
170
|
}
|
|
170
171
|
export {
|
|
171
|
-
|
|
172
|
+
B as default
|
|
172
173
|
};
|
package/outlet/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import getListOutletOpeningHoursTable from './getListOutletOpeningHoursTable';
|
|
2
|
+
export { getListOutletOpeningHoursTable };
|
package/outlet/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./getListOutletOpeningHoursTable.js");require("moment");require("../shared/enums.js");require("../shared/isWithinFlag.js");require("../shared/generateId.js");exports.getListOutletOpeningHoursTable=e;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./getListOutletOpeningHoursTable.js");require("moment");require("@ancon/wildcat-types");require("../shared/enums.js");require("../shared/isWithinFlag.js");require("../shared/generateId.js");exports.getListOutletOpeningHoursTable=e;
|
package/outlet/index.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { default as
|
|
1
|
+
import { default as a } from "./getListOutletOpeningHoursTable.mjs";
|
|
2
2
|
import "moment";
|
|
3
|
+
import "@ancon/wildcat-types";
|
|
3
4
|
import "../shared/enums.mjs";
|
|
4
5
|
import "../shared/isWithinFlag.mjs";
|
|
5
6
|
import "../shared/generateId.mjs";
|
|
6
7
|
export {
|
|
7
|
-
|
|
8
|
+
a as getListOutletOpeningHoursTable
|
|
8
9
|
};
|
package/outlet/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OrderFormat } from '@ancon/wildcat-types';
|
|
2
|
+
import { DayOfWeek, IntervalState, IntervalType } from '../shared';
|
|
2
3
|
/** HH:mm:ss */
|
|
3
4
|
export declare type IntervalTimestamp = string;
|
|
4
5
|
export declare type Interval = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ancon/wildcat-utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "index.cjs",
|
|
6
6
|
"module": "index.js",
|
|
@@ -8,107 +8,153 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
"./api/getEndpointWithVersion": {
|
|
10
10
|
"import": "./api/getEndpointWithVersion.js",
|
|
11
|
-
"require": "./api/getEndpointWithVersion.cjs"
|
|
11
|
+
"require": "./api/getEndpointWithVersion.cjs",
|
|
12
|
+
"types": "./api/getEndpointWithVersion.d.ts"
|
|
12
13
|
},
|
|
13
14
|
"./api/getUrlAndParams": {
|
|
14
15
|
"import": "./api/getUrlAndParams.js",
|
|
15
|
-
"require": "./api/getUrlAndParams.cjs"
|
|
16
|
+
"require": "./api/getUrlAndParams.cjs",
|
|
17
|
+
"types": "./api/getUrlAndParams.d.ts"
|
|
16
18
|
},
|
|
17
19
|
"./api": {
|
|
18
20
|
"import": "./api/index.js",
|
|
19
|
-
"require": "./api/index.cjs"
|
|
21
|
+
"require": "./api/index.cjs",
|
|
22
|
+
"types": "./api/index.d.ts"
|
|
20
23
|
},
|
|
21
24
|
"./color/brighten": {
|
|
22
25
|
"import": "./color/brighten.js",
|
|
23
|
-
"require": "./color/brighten.cjs"
|
|
26
|
+
"require": "./color/brighten.cjs",
|
|
27
|
+
"types": "./color/brighten.d.ts"
|
|
24
28
|
},
|
|
25
29
|
"./color/darken": {
|
|
26
30
|
"import": "./color/darken.js",
|
|
27
|
-
"require": "./color/darken.cjs"
|
|
31
|
+
"require": "./color/darken.cjs",
|
|
32
|
+
"types": "./color/darken.d.ts"
|
|
28
33
|
},
|
|
29
34
|
"./color": {
|
|
30
35
|
"import": "./color/index.js",
|
|
31
|
-
"require": "./color/index.cjs"
|
|
36
|
+
"require": "./color/index.cjs",
|
|
37
|
+
"types": "./color/index.d.ts"
|
|
32
38
|
},
|
|
33
39
|
"./color/lighten": {
|
|
34
40
|
"import": "./color/lighten.js",
|
|
35
|
-
"require": "./color/lighten.cjs"
|
|
41
|
+
"require": "./color/lighten.cjs",
|
|
42
|
+
"types": "./color/lighten.d.ts"
|
|
36
43
|
},
|
|
37
44
|
".": {
|
|
38
45
|
"import": "./index.js",
|
|
39
|
-
"require": "./index.cjs"
|
|
46
|
+
"require": "./index.cjs",
|
|
47
|
+
"types": "./index.d.ts"
|
|
40
48
|
},
|
|
41
49
|
"./logger/Logger": {
|
|
42
50
|
"import": "./logger/Logger.js",
|
|
43
|
-
"require": "./logger/Logger.cjs"
|
|
51
|
+
"require": "./logger/Logger.cjs",
|
|
52
|
+
"types": "./logger/Logger.d.ts"
|
|
44
53
|
},
|
|
45
54
|
"./logger": {
|
|
46
55
|
"import": "./logger/index.js",
|
|
47
|
-
"require": "./logger/index.cjs"
|
|
56
|
+
"require": "./logger/index.cjs",
|
|
57
|
+
"types": "./logger/index.d.ts"
|
|
48
58
|
},
|
|
49
59
|
"./logger/types": {
|
|
50
60
|
"import": "./logger/types.js",
|
|
51
|
-
"require": "./logger/types.cjs"
|
|
61
|
+
"require": "./logger/types.cjs",
|
|
62
|
+
"types": "./logger/types.d.ts"
|
|
52
63
|
},
|
|
53
64
|
"./outlet/getListOutletOpeningHoursTable": {
|
|
54
65
|
"import": "./outlet/getListOutletOpeningHoursTable.js",
|
|
55
|
-
"require": "./outlet/getListOutletOpeningHoursTable.cjs"
|
|
66
|
+
"require": "./outlet/getListOutletOpeningHoursTable.cjs",
|
|
67
|
+
"types": "./outlet/getListOutletOpeningHoursTable.d.ts"
|
|
56
68
|
},
|
|
57
69
|
"./outlet": {
|
|
58
70
|
"import": "./outlet/index.js",
|
|
59
|
-
"require": "./outlet/index.cjs"
|
|
71
|
+
"require": "./outlet/index.cjs",
|
|
72
|
+
"types": "./outlet/index.d.ts"
|
|
60
73
|
},
|
|
61
74
|
"./outlet/types": {
|
|
62
75
|
"import": "./outlet/types.js",
|
|
63
|
-
"require": "./outlet/types.cjs"
|
|
76
|
+
"require": "./outlet/types.cjs",
|
|
77
|
+
"types": "./outlet/types.d.ts"
|
|
78
|
+
},
|
|
79
|
+
"./printing": {
|
|
80
|
+
"import": "./printing/index.js",
|
|
81
|
+
"require": "./printing/index.cjs",
|
|
82
|
+
"types": "./printing/index.d.ts"
|
|
83
|
+
},
|
|
84
|
+
"./printing/isValidNetworkPrinter": {
|
|
85
|
+
"import": "./printing/isValidNetworkPrinter.js",
|
|
86
|
+
"require": "./printing/isValidNetworkPrinter.cjs",
|
|
87
|
+
"types": "./printing/isValidNetworkPrinter.d.ts"
|
|
88
|
+
},
|
|
89
|
+
"./printing/isValidPrinter": {
|
|
90
|
+
"import": "./printing/isValidPrinter.js",
|
|
91
|
+
"require": "./printing/isValidPrinter.cjs",
|
|
92
|
+
"types": "./printing/isValidPrinter.d.ts"
|
|
93
|
+
},
|
|
94
|
+
"./printing/isValidStarCloudPrinter": {
|
|
95
|
+
"import": "./printing/isValidStarCloudPrinter.js",
|
|
96
|
+
"require": "./printing/isValidStarCloudPrinter.cjs",
|
|
97
|
+
"types": "./printing/isValidStarCloudPrinter.d.ts"
|
|
64
98
|
},
|
|
65
99
|
"./shared/enums": {
|
|
66
100
|
"import": "./shared/enums.js",
|
|
67
|
-
"require": "./shared/enums.cjs"
|
|
101
|
+
"require": "./shared/enums.cjs",
|
|
102
|
+
"types": "./shared/enums.d.ts"
|
|
68
103
|
},
|
|
69
104
|
"./shared/generateId": {
|
|
70
105
|
"import": "./shared/generateId.js",
|
|
71
|
-
"require": "./shared/generateId.cjs"
|
|
106
|
+
"require": "./shared/generateId.cjs",
|
|
107
|
+
"types": "./shared/generateId.d.ts"
|
|
72
108
|
},
|
|
73
109
|
"./shared": {
|
|
74
110
|
"import": "./shared/index.js",
|
|
75
|
-
"require": "./shared/index.cjs"
|
|
111
|
+
"require": "./shared/index.cjs",
|
|
112
|
+
"types": "./shared/index.d.ts"
|
|
76
113
|
},
|
|
77
114
|
"./shared/isWithinFlag": {
|
|
78
115
|
"import": "./shared/isWithinFlag.js",
|
|
79
|
-
"require": "./shared/isWithinFlag.cjs"
|
|
116
|
+
"require": "./shared/isWithinFlag.cjs",
|
|
117
|
+
"types": "./shared/isWithinFlag.d.ts"
|
|
80
118
|
},
|
|
81
119
|
"./string": {
|
|
82
120
|
"import": "./string/index.js",
|
|
83
|
-
"require": "./string/index.cjs"
|
|
121
|
+
"require": "./string/index.cjs",
|
|
122
|
+
"types": "./string/index.d.ts"
|
|
84
123
|
},
|
|
85
124
|
"./string/slugify": {
|
|
86
125
|
"import": "./string/slugify.js",
|
|
87
|
-
"require": "./string/slugify.cjs"
|
|
126
|
+
"require": "./string/slugify.cjs",
|
|
127
|
+
"types": "./string/slugify.d.ts"
|
|
88
128
|
},
|
|
89
129
|
"./user/getFullAddressString": {
|
|
90
130
|
"import": "./user/getFullAddressString.js",
|
|
91
|
-
"require": "./user/getFullAddressString.cjs"
|
|
131
|
+
"require": "./user/getFullAddressString.cjs",
|
|
132
|
+
"types": "./user/getFullAddressString.d.ts"
|
|
92
133
|
},
|
|
93
134
|
"./user/getFullName": {
|
|
94
135
|
"import": "./user/getFullName.js",
|
|
95
|
-
"require": "./user/getFullName.cjs"
|
|
136
|
+
"require": "./user/getFullName.cjs",
|
|
137
|
+
"types": "./user/getFullName.d.ts"
|
|
96
138
|
},
|
|
97
139
|
"./user": {
|
|
98
140
|
"import": "./user/index.js",
|
|
99
|
-
"require": "./user/index.cjs"
|
|
141
|
+
"require": "./user/index.cjs",
|
|
142
|
+
"types": "./user/index.d.ts"
|
|
100
143
|
},
|
|
101
144
|
"./versioning/cleanVersionString": {
|
|
102
145
|
"import": "./versioning/cleanVersionString.js",
|
|
103
|
-
"require": "./versioning/cleanVersionString.cjs"
|
|
146
|
+
"require": "./versioning/cleanVersionString.cjs",
|
|
147
|
+
"types": "./versioning/cleanVersionString.d.ts"
|
|
104
148
|
},
|
|
105
149
|
"./versioning": {
|
|
106
150
|
"import": "./versioning/index.js",
|
|
107
|
-
"require": "./versioning/index.cjs"
|
|
151
|
+
"require": "./versioning/index.cjs",
|
|
152
|
+
"types": "./versioning/index.d.ts"
|
|
108
153
|
},
|
|
109
154
|
"./versioning/isVersionALessThanB": {
|
|
110
155
|
"import": "./versioning/isVersionALessThanB.js",
|
|
111
|
-
"require": "./versioning/isVersionALessThanB.cjs"
|
|
156
|
+
"require": "./versioning/isVersionALessThanB.cjs",
|
|
157
|
+
"types": "./versioning/isVersionALessThanB.d.ts"
|
|
112
158
|
}
|
|
113
159
|
}
|
|
114
160
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./isValidPrinter.js"),r=require("./isValidNetworkPrinter.js"),t=require("./isValidStarCloudPrinter.js");exports.isValidPrinter=i;exports.isValidNetworkPrinter=r;exports.isValidStarCloudPrinter=t;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { default as a } from "./isValidPrinter.mjs";
|
|
2
|
+
import { default as i } from "./isValidNetworkPrinter.mjs";
|
|
3
|
+
import { default as d } from "./isValidStarCloudPrinter.mjs";
|
|
4
|
+
export {
|
|
5
|
+
i as isValidNetworkPrinter,
|
|
6
|
+
a as isValidPrinter,
|
|
7
|
+
d as isValidStarCloudPrinter
|
|
8
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Printer, PrinterHostAddress } from '@ancon/wildcat-types';
|
|
2
|
+
/**
|
|
3
|
+
* Check if printer is a valid network printer
|
|
4
|
+
* @param printer Printer object
|
|
5
|
+
* @returns Whether the printer object is considered a valid network printer
|
|
6
|
+
*/
|
|
7
|
+
declare function isValidNetworkPrinter(printer: unknown): printer is Printer & {
|
|
8
|
+
hostAddress: PrinterHostAddress;
|
|
9
|
+
};
|
|
10
|
+
export default isValidNetworkPrinter;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function u(t){const o=t==null?void 0:t.hostAddress;return!!(o!=null&&o.host)&&(o==null?void 0:o.port)!=null}module.exports=u;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Printer } from '@ancon/wildcat-types';
|
|
2
|
+
/**
|
|
3
|
+
* Check if printer is a valid printer (valid network printer OR valid Star Cloud printer)
|
|
4
|
+
* @param printer Printer object
|
|
5
|
+
* @returns Whether the printer object is considered a valid printer
|
|
6
|
+
*/
|
|
7
|
+
declare function isValidPrinter(printer: unknown): printer is Printer;
|
|
8
|
+
export default isValidPrinter;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=require("./isValidNetworkPrinter.js"),t=require("./isValidStarCloudPrinter.js");function n(i){return r(i)||t(i)}module.exports=n;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Printer } from '@ancon/wildcat-types';
|
|
2
|
+
/**
|
|
3
|
+
* Check if printer is a valid Star Cloud printer
|
|
4
|
+
* @param printer Printer object
|
|
5
|
+
* @returns Whether the printer object is considered a valid Star Cloud printer
|
|
6
|
+
*/
|
|
7
|
+
declare function isValidStarCloudPrinter(printer: unknown): printer is Printer & {
|
|
8
|
+
macAddress: string;
|
|
9
|
+
};
|
|
10
|
+
export default isValidStarCloudPrinter;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function d(s){const t=s==null?void 0:s.macAddress;return typeof t=="string"&&t.trim().length>0}module.exports=d;
|
|
@@ -5,5 +5,5 @@ declare type Address = {
|
|
|
5
5
|
state: string;
|
|
6
6
|
zipCode: string;
|
|
7
7
|
};
|
|
8
|
-
|
|
9
|
-
export
|
|
8
|
+
declare function getFullAddressString<T extends Nullable<Partial<Address>>>(address: T | null | undefined): string;
|
|
9
|
+
export default getFullAddressString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";function e(t){return t&&[t.street,t.city,t.state,t.zipCode].filter(Boolean).join(", ")||""}module.exports=e;
|
package/user/getFullName.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
declare function getFullName(arr: (string | null | undefined)[], fallback?: string): string;
|
|
2
|
+
declare function getFullName(obj: {
|
|
3
3
|
firstName?: string | null;
|
|
4
4
|
lastName?: string | null;
|
|
5
5
|
} | null | undefined, fallback?: string): string;
|
|
6
|
+
export default getFullName;
|
package/user/getFullName.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";function n(t,r="N/A"){try{if(Array.isArray(t))return t.filter(Boolean).join(" ")||r;const e=t;return e&&[e.firstName,e.lastName].filter(Boolean).join(" ")||r}catch{return r}}module.exports=n;
|
package/user/getFullName.mjs
CHANGED
package/user/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import getFullName from './getFullName';
|
|
2
|
+
import getFullAddressString from './getFullAddressString';
|
|
3
|
+
export { getFullName, getFullAddressString };
|
package/user/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./getFullName.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./getFullName.js"),r=require("./getFullAddressString.js");exports.getFullName=e;exports.getFullAddressString=r;
|
package/user/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { default as l } from "./getFullName.mjs";
|
|
2
|
+
import { default as a } from "./getFullAddressString.mjs";
|
|
3
3
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
a as getFullAddressString,
|
|
5
|
+
l as getFullName
|
|
6
6
|
};
|