@pisell/lowcode-renderer 1.0.1 → 1.0.2
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/es/api/report/index.js +2 -2
- package/es/config/index.d.ts +3 -2
- package/es/config/index.js +7 -1
- package/lib/api/report/index.js +1 -1
- package/lib/config/index.d.ts +3 -2
- package/lib/config/index.js +8 -0
- package/package.json +1 -1
package/es/api/report/index.js
CHANGED
|
@@ -3,9 +3,9 @@ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyri
|
|
|
3
3
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
4
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
5
|
import urls from "./URL";
|
|
6
|
-
import { injectedConfig } from "../../config";
|
|
6
|
+
import { getShopId, injectedConfig } from "../../config";
|
|
7
7
|
var getParams = function getParams(values) {
|
|
8
|
-
var shop_id =
|
|
8
|
+
var shop_id = getShopId();
|
|
9
9
|
var _ref = values || {},
|
|
10
10
|
date = _ref.date;
|
|
11
11
|
|
package/es/config/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
declare type InjectedConfigType = {
|
|
2
|
-
shop_id: number;
|
|
2
|
+
shop_id: number | (() => number);
|
|
3
3
|
request: any;
|
|
4
4
|
dayjs: any;
|
|
5
5
|
};
|
|
6
6
|
declare let injectedConfig: InjectedConfigType;
|
|
7
7
|
export declare const injectConfig: (context: InjectedConfigType) => void;
|
|
8
|
-
|
|
8
|
+
declare const getShopId: () => number;
|
|
9
|
+
export { injectedConfig, getShopId };
|
package/es/config/index.js
CHANGED
|
@@ -2,4 +2,10 @@ var injectedConfig = {};
|
|
|
2
2
|
export var injectConfig = function injectConfig(context) {
|
|
3
3
|
injectedConfig = context;
|
|
4
4
|
};
|
|
5
|
-
|
|
5
|
+
var getShopId = function getShopId() {
|
|
6
|
+
if (typeof injectedConfig.shop_id === "function") {
|
|
7
|
+
return injectedConfig.shop_id();
|
|
8
|
+
}
|
|
9
|
+
return injectedConfig.shop_id;
|
|
10
|
+
};
|
|
11
|
+
export { injectedConfig, getShopId };
|
package/lib/api/report/index.js
CHANGED
|
@@ -35,7 +35,7 @@ module.exports = __toCommonJS(report_exports);
|
|
|
35
35
|
var import_URL = __toESM(require("./URL"));
|
|
36
36
|
var import_config = require("../../config");
|
|
37
37
|
var getParams = (values) => {
|
|
38
|
-
let shop_id = import_config.
|
|
38
|
+
let shop_id = (0, import_config.getShopId)();
|
|
39
39
|
let { date } = values || {};
|
|
40
40
|
let start_at = 0;
|
|
41
41
|
let end_at = 0;
|
package/lib/config/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
declare type InjectedConfigType = {
|
|
2
|
-
shop_id: number;
|
|
2
|
+
shop_id: number | (() => number);
|
|
3
3
|
request: any;
|
|
4
4
|
dayjs: any;
|
|
5
5
|
};
|
|
6
6
|
declare let injectedConfig: InjectedConfigType;
|
|
7
7
|
export declare const injectConfig: (context: InjectedConfigType) => void;
|
|
8
|
-
|
|
8
|
+
declare const getShopId: () => number;
|
|
9
|
+
export { injectedConfig, getShopId };
|
package/lib/config/index.js
CHANGED
|
@@ -19,6 +19,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
// src/config/index.ts
|
|
20
20
|
var config_exports = {};
|
|
21
21
|
__export(config_exports, {
|
|
22
|
+
getShopId: () => getShopId,
|
|
22
23
|
injectConfig: () => injectConfig,
|
|
23
24
|
injectedConfig: () => injectedConfig
|
|
24
25
|
});
|
|
@@ -27,8 +28,15 @@ var injectedConfig = {};
|
|
|
27
28
|
var injectConfig = (context) => {
|
|
28
29
|
injectedConfig = context;
|
|
29
30
|
};
|
|
31
|
+
var getShopId = () => {
|
|
32
|
+
if (typeof injectedConfig.shop_id === "function") {
|
|
33
|
+
return injectedConfig.shop_id();
|
|
34
|
+
}
|
|
35
|
+
return injectedConfig.shop_id;
|
|
36
|
+
};
|
|
30
37
|
// Annotate the CommonJS export names for ESM import in node:
|
|
31
38
|
0 && (module.exports = {
|
|
39
|
+
getShopId,
|
|
32
40
|
injectConfig,
|
|
33
41
|
injectedConfig
|
|
34
42
|
});
|