@levo-so/core 0.1.63 → 0.1.64
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 +1 -6
- package/dist/index.js +8 -20
- package/package.json +9 -9
package/dist/index.d.ts
CHANGED
|
@@ -947,11 +947,6 @@ 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;
|
|
955
950
|
created_at: Date;
|
|
956
951
|
updated_at: Date;
|
|
957
952
|
attendees: LevoEvent.Attendee.Root[];
|
|
@@ -1750,7 +1745,7 @@ declare const createLevoClient: (options: ILevoClientOptions) => {
|
|
|
1750
1745
|
warn: (...args: any[]) => void;
|
|
1751
1746
|
error: (...args: any[]) => void;
|
|
1752
1747
|
};
|
|
1753
|
-
readonly
|
|
1748
|
+
readonly levoFetch: wretch_addons_queryString.QueryStringAddon & wretch.Wretch<wretch_addons_queryString.QueryStringAddon, unknown, undefined>;
|
|
1754
1749
|
readonly APP_MODE: string;
|
|
1755
1750
|
readonly NODE_ENV: string;
|
|
1756
1751
|
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, getPageContext) => {
|
|
52
52
|
const wr = wretch(core.apiUrl).addon(queryStringAddon);
|
|
53
53
|
return {
|
|
54
54
|
get instance() {
|
|
@@ -64,6 +64,7 @@ var createHttpClient = (core, pageContext) => {
|
|
|
64
64
|
"Levo-Workspace": core.workspace
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
|
+
const pageContext = getPageContext();
|
|
67
68
|
if (pageContext && typeof pageContext === "object" && Object.keys(pageContext).length > 0) {
|
|
68
69
|
options.headers = {
|
|
69
70
|
...options?.headers || {},
|
|
@@ -72,7 +73,9 @@ var createHttpClient = (core, pageContext) => {
|
|
|
72
73
|
}
|
|
73
74
|
return wr.options(options);
|
|
74
75
|
},
|
|
75
|
-
pageContext
|
|
76
|
+
get pageContext() {
|
|
77
|
+
return getPageContext();
|
|
78
|
+
}
|
|
76
79
|
};
|
|
77
80
|
};
|
|
78
81
|
var createLogBatch = (options = {}) => {
|
|
@@ -151,20 +154,6 @@ var createLogBatch = (options = {}) => {
|
|
|
151
154
|
|
|
152
155
|
// src/logger/index.ts
|
|
153
156
|
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
|
-
};
|
|
168
157
|
var createLevoLogger = (core, options = {}) => {
|
|
169
158
|
const {
|
|
170
159
|
enableRemote = core.NODE_ENV !== "development",
|
|
@@ -241,8 +230,7 @@ var createLevoLogger = (core, options = {}) => {
|
|
|
241
230
|
batch.ingest(log2);
|
|
242
231
|
}
|
|
243
232
|
}
|
|
244
|
-
|
|
245
|
-
console[method](...messages);
|
|
233
|
+
console.log(...messages);
|
|
246
234
|
};
|
|
247
235
|
const debug = (...args) => {
|
|
248
236
|
log(0 /* debug */, args);
|
|
@@ -592,7 +580,7 @@ var createLevoClient = (options) => {
|
|
|
592
580
|
} = options;
|
|
593
581
|
let _pageContext = pageContext;
|
|
594
582
|
const core = createLevoControl(coreOptions);
|
|
595
|
-
const httpsClient = createHttpClient(core, _pageContext);
|
|
583
|
+
const httpsClient = createHttpClient(core, () => _pageContext);
|
|
596
584
|
const blog = createLevoBlogModule(core, httpsClient);
|
|
597
585
|
const membership = createLevoMembershipModule(core, httpsClient);
|
|
598
586
|
const collection = createLevoCollectionModule(core, httpsClient);
|
|
@@ -626,7 +614,7 @@ var createLevoClient = (options) => {
|
|
|
626
614
|
get logger() {
|
|
627
615
|
return logger;
|
|
628
616
|
},
|
|
629
|
-
get
|
|
617
|
+
get levoFetch() {
|
|
630
618
|
return httpsClient.instance;
|
|
631
619
|
},
|
|
632
620
|
get APP_MODE() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@levo-so/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.64",
|
|
4
4
|
"author": "Levo Engineering <devs@theinternetfolks.com>",
|
|
5
5
|
"description": "Levo common utilities",
|
|
6
6
|
"type": "module",
|
|
@@ -13,21 +13,15 @@
|
|
|
13
13
|
"!dist/**/*.d.ts.map",
|
|
14
14
|
"package.json"
|
|
15
15
|
],
|
|
16
|
-
"scripts": {
|
|
17
|
-
"clean": "rimraf dist node_modules .turbo",
|
|
18
|
-
"check-types": "tsc --noEmit",
|
|
19
|
-
"build": "tsup",
|
|
20
|
-
"dev": "tsup --watch"
|
|
21
|
-
},
|
|
22
16
|
"dependencies": {
|
|
23
17
|
"lodash-es": "4.17.21",
|
|
24
18
|
"wretch": "2.9.0"
|
|
25
19
|
},
|
|
26
20
|
"devDependencies": {
|
|
27
|
-
"@levo/ts-config": "workspace:*",
|
|
28
21
|
"@types/lodash-es": "4.17.12",
|
|
29
22
|
"tsup": "8.2.4",
|
|
30
|
-
"typescript": "5.9.3"
|
|
23
|
+
"typescript": "5.9.3",
|
|
24
|
+
"@levo/ts-config": "0.0.0"
|
|
31
25
|
},
|
|
32
26
|
"main": "./dist/index.js",
|
|
33
27
|
"module": "./dist/index.js",
|
|
@@ -37,5 +31,11 @@
|
|
|
37
31
|
"types": "./dist/index.d.ts",
|
|
38
32
|
"default": "./dist/index.js"
|
|
39
33
|
}
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"clean": "rimraf dist node_modules .turbo",
|
|
37
|
+
"check-types": "tsc --noEmit",
|
|
38
|
+
"build": "tsup",
|
|
39
|
+
"dev": "tsup --watch"
|
|
40
40
|
}
|
|
41
41
|
}
|