@levo-so/core 0.1.64 → 0.1.65
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/dist/index.d.ts +6 -1
- package/dist/index.js +20 -8
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -947,6 +947,11 @@ declare namespace LevoEvent {
|
|
|
947
947
|
width: number;
|
|
948
948
|
height: number;
|
|
949
949
|
};
|
|
950
|
+
/** Invoice PDF file (same shape as qr_image), null if not generated */
|
|
951
|
+
invoice: (IMediaObject & {
|
|
952
|
+
width: number;
|
|
953
|
+
height: number;
|
|
954
|
+
}) | null;
|
|
950
955
|
created_at: Date;
|
|
951
956
|
updated_at: Date;
|
|
952
957
|
attendees: LevoEvent.Attendee.Root[];
|
|
@@ -1745,7 +1750,7 @@ declare const createLevoClient: (options: ILevoClientOptions) => {
|
|
|
1745
1750
|
warn: (...args: any[]) => void;
|
|
1746
1751
|
error: (...args: any[]) => void;
|
|
1747
1752
|
};
|
|
1748
|
-
readonly
|
|
1753
|
+
readonly fetch: wretch_addons_queryString.QueryStringAddon & wretch.Wretch<wretch_addons_queryString.QueryStringAddon, unknown, undefined>;
|
|
1749
1754
|
readonly APP_MODE: string;
|
|
1750
1755
|
readonly NODE_ENV: string;
|
|
1751
1756
|
readonly pageContext: IPageContext | null;
|
package/dist/index.js
CHANGED
|
@@ -48,7 +48,7 @@ var createLevoControl = (options) => {
|
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
};
|
|
51
|
-
var createHttpClient = (core,
|
|
51
|
+
var createHttpClient = (core, pageContext) => {
|
|
52
52
|
const wr = wretch(core.apiUrl).addon(queryStringAddon);
|
|
53
53
|
return {
|
|
54
54
|
get instance() {
|
|
@@ -64,7 +64,6 @@ var createHttpClient = (core, getPageContext) => {
|
|
|
64
64
|
"Levo-Workspace": core.workspace
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
|
-
const pageContext = getPageContext();
|
|
68
67
|
if (pageContext && typeof pageContext === "object" && Object.keys(pageContext).length > 0) {
|
|
69
68
|
options.headers = {
|
|
70
69
|
...options?.headers || {},
|
|
@@ -73,9 +72,7 @@ var createHttpClient = (core, getPageContext) => {
|
|
|
73
72
|
}
|
|
74
73
|
return wr.options(options);
|
|
75
74
|
},
|
|
76
|
-
|
|
77
|
-
return getPageContext();
|
|
78
|
-
}
|
|
75
|
+
pageContext
|
|
79
76
|
};
|
|
80
77
|
};
|
|
81
78
|
var createLogBatch = (options = {}) => {
|
|
@@ -154,6 +151,20 @@ var createLogBatch = (options = {}) => {
|
|
|
154
151
|
|
|
155
152
|
// src/logger/index.ts
|
|
156
153
|
var isBrowser = typeof window !== "undefined";
|
|
154
|
+
var getMethodName = (level) => {
|
|
155
|
+
switch (level) {
|
|
156
|
+
case 0 /* debug */:
|
|
157
|
+
return "log";
|
|
158
|
+
case 1 /* info */:
|
|
159
|
+
return "info";
|
|
160
|
+
case 2 /* warn */:
|
|
161
|
+
return "warn";
|
|
162
|
+
case 3 /* error */:
|
|
163
|
+
return "error";
|
|
164
|
+
default:
|
|
165
|
+
return "log";
|
|
166
|
+
}
|
|
167
|
+
};
|
|
157
168
|
var createLevoLogger = (core, options = {}) => {
|
|
158
169
|
const {
|
|
159
170
|
enableRemote = core.NODE_ENV !== "development",
|
|
@@ -230,7 +241,8 @@ var createLevoLogger = (core, options = {}) => {
|
|
|
230
241
|
batch.ingest(log2);
|
|
231
242
|
}
|
|
232
243
|
}
|
|
233
|
-
|
|
244
|
+
const method = getMethodName(level);
|
|
245
|
+
console[method](...messages);
|
|
234
246
|
};
|
|
235
247
|
const debug = (...args) => {
|
|
236
248
|
log(0 /* debug */, args);
|
|
@@ -580,7 +592,7 @@ var createLevoClient = (options) => {
|
|
|
580
592
|
} = options;
|
|
581
593
|
let _pageContext = pageContext;
|
|
582
594
|
const core = createLevoControl(coreOptions);
|
|
583
|
-
const httpsClient = createHttpClient(core,
|
|
595
|
+
const httpsClient = createHttpClient(core, _pageContext);
|
|
584
596
|
const blog = createLevoBlogModule(core, httpsClient);
|
|
585
597
|
const membership = createLevoMembershipModule(core, httpsClient);
|
|
586
598
|
const collection = createLevoCollectionModule(core, httpsClient);
|
|
@@ -614,7 +626,7 @@ var createLevoClient = (options) => {
|
|
|
614
626
|
get logger() {
|
|
615
627
|
return logger;
|
|
616
628
|
},
|
|
617
|
-
get
|
|
629
|
+
get fetch() {
|
|
618
630
|
return httpsClient.instance;
|
|
619
631
|
},
|
|
620
632
|
get APP_MODE() {
|