medusa-stats 1.0.5
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/.medusa/server/src/admin/composite.png +0 -0
- package/.medusa/server/src/admin/index.js +10512 -0
- package/.medusa/server/src/admin/index.mjs +10510 -0
- package/.medusa/server/src/admin/params.png +0 -0
- package/.medusa/server/src/admin/view.png +0 -0
- package/.medusa/server/src/admin/visualizations.png +0 -0
- package/.medusa/server/src/api/admin/statistics/alert-logs/[id]/route.d.ts +6 -0
- package/.medusa/server/src/api/admin/statistics/alert-logs/[id]/route.js +18 -0
- package/.medusa/server/src/api/admin/statistics/alert-logs/route.d.ts +6 -0
- package/.medusa/server/src/api/admin/statistics/alert-logs/route.js +33 -0
- package/.medusa/server/src/api/admin/statistics/alerts/[id]/logs/route.d.ts +6 -0
- package/.medusa/server/src/api/admin/statistics/alerts/[id]/logs/route.js +23 -0
- package/.medusa/server/src/api/admin/statistics/alerts/[id]/route.d.ts +17 -0
- package/.medusa/server/src/api/admin/statistics/alerts/[id]/route.js +64 -0
- package/.medusa/server/src/api/admin/statistics/alerts/[id]/toggle/route.d.ts +6 -0
- package/.medusa/server/src/api/admin/statistics/alerts/[id]/toggle/route.js +18 -0
- package/.medusa/server/src/api/admin/statistics/alerts/route.d.ts +12 -0
- package/.medusa/server/src/api/admin/statistics/alerts/route.js +94 -0
- package/.medusa/server/src/api/admin/statistics/charts/[id]/route.d.ts +17 -0
- package/.medusa/server/src/api/admin/statistics/charts/[id]/route.js +50 -0
- package/.medusa/server/src/api/admin/statistics/charts/[id]/statistics/route.d.ts +15 -0
- package/.medusa/server/src/api/admin/statistics/charts/[id]/statistics/route.js +40 -0
- package/.medusa/server/src/api/admin/statistics/charts/route.d.ts +4 -0
- package/.medusa/server/src/api/admin/statistics/charts/route.js +55 -0
- package/.medusa/server/src/api/admin/statistics/options/[id]/calculate/route.d.ts +7 -0
- package/.medusa/server/src/api/admin/statistics/options/[id]/calculate/route.js +23 -0
- package/.medusa/server/src/api/admin/statistics/options/[id]/clone/route.d.ts +7 -0
- package/.medusa/server/src/api/admin/statistics/options/[id]/clone/route.js +15 -0
- package/.medusa/server/src/api/admin/statistics/options/[id]/route.d.ts +17 -0
- package/.medusa/server/src/api/admin/statistics/options/[id]/route.js +69 -0
- package/.medusa/server/src/api/admin/statistics/options/route.d.ts +12 -0
- package/.medusa/server/src/api/admin/statistics/options/route.js +87 -0
- package/.medusa/server/src/api/admin/statistics/providers/[id]/route.d.ts +6 -0
- package/.medusa/server/src/api/admin/statistics/providers/[id]/route.js +18 -0
- package/.medusa/server/src/api/admin/statistics/providers/[id]/statistics/route.d.ts +6 -0
- package/.medusa/server/src/api/admin/statistics/providers/[id]/statistics/route.js +18 -0
- package/.medusa/server/src/api/admin/statistics/providers/route.d.ts +7 -0
- package/.medusa/server/src/api/admin/statistics/providers/route.js +57 -0
- package/.medusa/server/src/api/admin/statistics/utils/option-graph.d.ts +3 -0
- package/.medusa/server/src/api/admin/statistics/utils/option-graph.js +34 -0
- package/.medusa/server/src/api/admin/statistics/views/[id]/calculate/route.d.ts +7 -0
- package/.medusa/server/src/api/admin/statistics/views/[id]/calculate/route.js +21 -0
- package/.medusa/server/src/api/admin/statistics/views/[id]/clone/route.d.ts +7 -0
- package/.medusa/server/src/api/admin/statistics/views/[id]/clone/route.js +21 -0
- package/.medusa/server/src/api/admin/statistics/views/[id]/route.d.ts +17 -0
- package/.medusa/server/src/api/admin/statistics/views/[id]/route.js +71 -0
- package/.medusa/server/src/api/admin/statistics/views/route.d.ts +12 -0
- package/.medusa/server/src/api/admin/statistics/views/route.js +74 -0
- package/.medusa/server/src/api/middlewares.d.ts +2 -0
- package/.medusa/server/src/api/middlewares.js +194 -0
- package/.medusa/server/src/api/validation/statistics/schemas.d.ts +1013 -0
- package/.medusa/server/src/api/validation/statistics/schemas.js +288 -0
- package/.medusa/server/src/index.d.ts +1 -0
- package/.medusa/server/src/index.js +18 -0
- package/.medusa/server/src/jobs/evaluate-statistics-alerts.d.ts +6 -0
- package/.medusa/server/src/jobs/evaluate-statistics-alerts.js +110 -0
- package/.medusa/server/src/links/statistics-alert-user.d.ts +2 -0
- package/.medusa/server/src/links/statistics-alert-user.js +16 -0
- package/.medusa/server/src/links/statistics-option-user.d.ts +2 -0
- package/.medusa/server/src/links/statistics-option-user.js +16 -0
- package/.medusa/server/src/loaders/statistics/index.d.ts +5 -0
- package/.medusa/server/src/loaders/statistics/index.js +47 -0
- package/.medusa/server/src/modules/statistics/index.d.ts +107 -0
- package/.medusa/server/src/modules/statistics/index.js +32 -0
- package/.medusa/server/src/modules/statistics/migrations/Migration20260223131741.d.ts +5 -0
- package/.medusa/server/src/modules/statistics/migrations/Migration20260223131741.js +57 -0
- package/.medusa/server/src/modules/statistics/models/alert-log.d.ts +74 -0
- package/.medusa/server/src/modules/statistics/models/alert-log.js +16 -0
- package/.medusa/server/src/modules/statistics/models/alert.d.ts +74 -0
- package/.medusa/server/src/modules/statistics/models/alert.js +24 -0
- package/.medusa/server/src/modules/statistics/models/chart.d.ts +81 -0
- package/.medusa/server/src/modules/statistics/models/chart.js +28 -0
- package/.medusa/server/src/modules/statistics/models/index.d.ts +7 -0
- package/.medusa/server/src/modules/statistics/models/index.js +24 -0
- package/.medusa/server/src/modules/statistics/models/option-input.d.ts +135 -0
- package/.medusa/server/src/modules/statistics/models/option-input.js +27 -0
- package/.medusa/server/src/modules/statistics/models/option.d.ts +78 -0
- package/.medusa/server/src/modules/statistics/models/option.js +41 -0
- package/.medusa/server/src/modules/statistics/models/provider.d.ts +75 -0
- package/.medusa/server/src/modules/statistics/models/provider.js +15 -0
- package/.medusa/server/src/modules/statistics/models/view.d.ts +79 -0
- package/.medusa/server/src/modules/statistics/models/view.js +30 -0
- package/.medusa/server/src/modules/statistics/providers/index.d.ts +1 -0
- package/.medusa/server/src/modules/statistics/providers/index.js +18 -0
- package/.medusa/server/src/modules/statistics/providers/provider.d.ts +254 -0
- package/.medusa/server/src/modules/statistics/providers/provider.js +307 -0
- package/.medusa/server/src/modules/statistics/service.d.ts +953 -0
- package/.medusa/server/src/modules/statistics/service.js +190 -0
- package/.medusa/server/src/modules/statistics/utils/dependency-option-map.d.ts +13 -0
- package/.medusa/server/src/modules/statistics/utils/dependency-option-map.js +67 -0
- package/.medusa/server/src/modules/statistics/utils/period-utils.d.ts +23 -0
- package/.medusa/server/src/modules/statistics/utils/period-utils.js +78 -0
- package/.medusa/server/src/modules/statistics/utils/time-series-utils.d.ts +6 -0
- package/.medusa/server/src/modules/statistics/utils/time-series-utils.js +8 -0
- package/.medusa/server/src/providers/common/index.d.ts +2 -0
- package/.medusa/server/src/providers/common/index.js +1232 -0
- package/.medusa/server/src/providers/composite/index.d.ts +2 -0
- package/.medusa/server/src/providers/composite/index.js +147 -0
- package/.medusa/server/src/workflows/statistics/calculate-single-statistic.d.ts +15 -0
- package/.medusa/server/src/workflows/statistics/calculate-single-statistic.js +28 -0
- package/.medusa/server/src/workflows/statistics/calculate-statistics.d.ts +20 -0
- package/.medusa/server/src/workflows/statistics/calculate-statistics.js +15 -0
- package/.medusa/server/src/workflows/statistics/calculate-view.d.ts +31 -0
- package/.medusa/server/src/workflows/statistics/calculate-view.js +30 -0
- package/.medusa/server/src/workflows/statistics/clone-view.d.ts +227 -0
- package/.medusa/server/src/workflows/statistics/clone-view.js +10 -0
- package/.medusa/server/src/workflows/statistics/create-alert.d.ts +139 -0
- package/.medusa/server/src/workflows/statistics/create-alert.js +12 -0
- package/.medusa/server/src/workflows/statistics/create-chart.d.ts +122 -0
- package/.medusa/server/src/workflows/statistics/create-chart.js +14 -0
- package/.medusa/server/src/workflows/statistics/create-view-with-options.d.ts +1342 -0
- package/.medusa/server/src/workflows/statistics/create-view-with-options.js +29 -0
- package/.medusa/server/src/workflows/statistics/delete-chart.d.ts +10 -0
- package/.medusa/server/src/workflows/statistics/delete-chart.js +14 -0
- package/.medusa/server/src/workflows/statistics/evaluate-alerts.d.ts +28 -0
- package/.medusa/server/src/workflows/statistics/evaluate-alerts.js +67 -0
- package/.medusa/server/src/workflows/statistics/get-available-statistics.d.ts +5 -0
- package/.medusa/server/src/workflows/statistics/get-available-statistics.js +10 -0
- package/.medusa/server/src/workflows/statistics/index.d.ts +14 -0
- package/.medusa/server/src/workflows/statistics/index.js +31 -0
- package/.medusa/server/src/workflows/statistics/manage-chart-statistics.d.ts +12 -0
- package/.medusa/server/src/workflows/statistics/manage-chart-statistics.js +14 -0
- package/.medusa/server/src/workflows/statistics/steps/calculate-statistics.d.ts +37 -0
- package/.medusa/server/src/workflows/statistics/steps/calculate-statistics.js +222 -0
- package/.medusa/server/src/workflows/statistics/steps/clone-view.d.ts +227 -0
- package/.medusa/server/src/workflows/statistics/steps/clone-view.js +39 -0
- package/.medusa/server/src/workflows/statistics/steps/create-alert-log-entries.d.ts +17 -0
- package/.medusa/server/src/workflows/statistics/steps/create-alert-log-entries.js +50 -0
- package/.medusa/server/src/workflows/statistics/steps/create-alert.d.ts +120 -0
- package/.medusa/server/src/workflows/statistics/steps/create-alert.js +21 -0
- package/.medusa/server/src/workflows/statistics/steps/create-chart.d.ts +118 -0
- package/.medusa/server/src/workflows/statistics/steps/create-chart.js +19 -0
- package/.medusa/server/src/workflows/statistics/steps/create-statistics-options.d.ts +117 -0
- package/.medusa/server/src/workflows/statistics/steps/create-statistics-options.js +16 -0
- package/.medusa/server/src/workflows/statistics/steps/create-statistics-view.d.ts +119 -0
- package/.medusa/server/src/workflows/statistics/steps/create-statistics-view.js +16 -0
- package/.medusa/server/src/workflows/statistics/steps/dedupe-alerts.d.ts +22 -0
- package/.medusa/server/src/workflows/statistics/steps/dedupe-alerts.js +64 -0
- package/.medusa/server/src/workflows/statistics/steps/delete-chart.d.ts +6 -0
- package/.medusa/server/src/workflows/statistics/steps/delete-chart.js +17 -0
- package/.medusa/server/src/workflows/statistics/steps/emit-alert-events.d.ts +17 -0
- package/.medusa/server/src/workflows/statistics/steps/emit-alert-events.js +41 -0
- package/.medusa/server/src/workflows/statistics/steps/evaluate-each-condition.d.ts +15 -0
- package/.medusa/server/src/workflows/statistics/steps/evaluate-each-condition.js +109 -0
- package/.medusa/server/src/workflows/statistics/steps/extract-alert-values.d.ts +12 -0
- package/.medusa/server/src/workflows/statistics/steps/extract-alert-values.js +86 -0
- package/.medusa/server/src/workflows/statistics/steps/fetch-active-alerts-for-option.d.ts +112 -0
- package/.medusa/server/src/workflows/statistics/steps/fetch-active-alerts-for-option.js +16 -0
- package/.medusa/server/src/workflows/statistics/steps/fetch-available-statistics.d.ts +4 -0
- package/.medusa/server/src/workflows/statistics/steps/fetch-available-statistics.js +39 -0
- package/.medusa/server/src/workflows/statistics/steps/fetch-option-with-relations.d.ts +112 -0
- package/.medusa/server/src/workflows/statistics/steps/fetch-option-with-relations.js +11 -0
- package/.medusa/server/src/workflows/statistics/steps/fetch-view-with-options.d.ts +112 -0
- package/.medusa/server/src/workflows/statistics/steps/fetch-view-with-options.js +20 -0
- package/.medusa/server/src/workflows/statistics/steps/manage-chart-statistics.d.ts +8 -0
- package/.medusa/server/src/workflows/statistics/steps/manage-chart-statistics.js +26 -0
- package/.medusa/server/src/workflows/statistics/steps/update-chart.d.ts +117 -0
- package/.medusa/server/src/workflows/statistics/steps/update-chart.js +32 -0
- package/.medusa/server/src/workflows/statistics/steps/update-view.d.ts +120 -0
- package/.medusa/server/src/workflows/statistics/steps/update-view.js +18 -0
- package/.medusa/server/src/workflows/statistics/steps/validate-alert-input.d.ts +1 -0
- package/.medusa/server/src/workflows/statistics/steps/validate-alert-input.js +34 -0
- package/.medusa/server/src/workflows/statistics/steps/validate-option-parameters.d.ts +21 -0
- package/.medusa/server/src/workflows/statistics/steps/validate-option-parameters.js +43 -0
- package/.medusa/server/src/workflows/statistics/steps/validate-view-input.d.ts +10 -0
- package/.medusa/server/src/workflows/statistics/steps/validate-view-input.js +15 -0
- package/.medusa/server/src/workflows/statistics/update-chart.d.ts +120 -0
- package/.medusa/server/src/workflows/statistics/update-chart.js +13 -0
- package/.medusa/server/src/workflows/statistics/update-view-configuration.d.ts +128 -0
- package/.medusa/server/src/workflows/statistics/update-view-configuration.js +18 -0
- package/.medusa/server/src/workflows/statistics/utils/cache-utils.d.ts +60 -0
- package/.medusa/server/src/workflows/statistics/utils/cache-utils.js +66 -0
- package/.medusa/server/src/workflows/statistics/utils/dependency-graph.d.ts +51 -0
- package/.medusa/server/src/workflows/statistics/utils/dependency-graph.js +131 -0
- package/.medusa/server/src/workflows/statistics/utils/parameter-utils.d.ts +54 -0
- package/.medusa/server/src/workflows/statistics/utils/parameter-utils.js +147 -0
- package/.medusa/server/src/workflows/statistics/validate-option-configuration.d.ts +9 -0
- package/.medusa/server/src/workflows/statistics/validate-option-configuration.js +35 -0
- package/README.md +310 -0
- package/package.json +87 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import StatisticsService from "./service";
|
|
2
|
+
export declare const STATISTICS_MODULE = "statistics";
|
|
3
|
+
declare const StatisticsModule: import("@medusajs/types").ModuleExports<typeof StatisticsService> & {
|
|
4
|
+
linkable: {
|
|
5
|
+
readonly statisticsView: {
|
|
6
|
+
id: {
|
|
7
|
+
serviceName: "statistics";
|
|
8
|
+
field: "statisticsView";
|
|
9
|
+
linkable: "statistics_view_id";
|
|
10
|
+
primaryKey: "id";
|
|
11
|
+
};
|
|
12
|
+
toJSON: () => {
|
|
13
|
+
serviceName: "statistics";
|
|
14
|
+
field: "statisticsView";
|
|
15
|
+
linkable: "statistics_view_id";
|
|
16
|
+
primaryKey: "id";
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
readonly statisticsOption: {
|
|
20
|
+
id: {
|
|
21
|
+
serviceName: "statistics";
|
|
22
|
+
field: "statisticsOption";
|
|
23
|
+
linkable: "statistics_option_id";
|
|
24
|
+
primaryKey: "id";
|
|
25
|
+
};
|
|
26
|
+
toJSON: () => {
|
|
27
|
+
serviceName: "statistics";
|
|
28
|
+
field: "statisticsOption";
|
|
29
|
+
linkable: "statistics_option_id";
|
|
30
|
+
primaryKey: "id";
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
readonly statisticsProvider: {
|
|
34
|
+
id: {
|
|
35
|
+
serviceName: "statistics";
|
|
36
|
+
field: "statisticsProvider";
|
|
37
|
+
linkable: "statistics_provider_id";
|
|
38
|
+
primaryKey: "id";
|
|
39
|
+
};
|
|
40
|
+
toJSON: () => {
|
|
41
|
+
serviceName: "statistics";
|
|
42
|
+
field: "statisticsProvider";
|
|
43
|
+
linkable: "statistics_provider_id";
|
|
44
|
+
primaryKey: "id";
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
readonly statisticsAlert: {
|
|
48
|
+
id: {
|
|
49
|
+
serviceName: "statistics";
|
|
50
|
+
field: "statisticsAlert";
|
|
51
|
+
linkable: "statistics_alert_id";
|
|
52
|
+
primaryKey: "id";
|
|
53
|
+
};
|
|
54
|
+
toJSON: () => {
|
|
55
|
+
serviceName: "statistics";
|
|
56
|
+
field: "statisticsAlert";
|
|
57
|
+
linkable: "statistics_alert_id";
|
|
58
|
+
primaryKey: "id";
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
readonly statisticsAlertLog: {
|
|
62
|
+
id: {
|
|
63
|
+
serviceName: "statistics";
|
|
64
|
+
field: "statisticsAlertLog";
|
|
65
|
+
linkable: "statistics_alert_log_id";
|
|
66
|
+
primaryKey: "id";
|
|
67
|
+
};
|
|
68
|
+
toJSON: () => {
|
|
69
|
+
serviceName: "statistics";
|
|
70
|
+
field: "statisticsAlertLog";
|
|
71
|
+
linkable: "statistics_alert_log_id";
|
|
72
|
+
primaryKey: "id";
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
readonly statisticsChart: {
|
|
76
|
+
id: {
|
|
77
|
+
serviceName: "statistics";
|
|
78
|
+
field: "statisticsChart";
|
|
79
|
+
linkable: "statistics_chart_id";
|
|
80
|
+
primaryKey: "id";
|
|
81
|
+
};
|
|
82
|
+
toJSON: () => {
|
|
83
|
+
serviceName: "statistics";
|
|
84
|
+
field: "statisticsChart";
|
|
85
|
+
linkable: "statistics_chart_id";
|
|
86
|
+
primaryKey: "id";
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
readonly statisticOptionInput: {
|
|
90
|
+
id: {
|
|
91
|
+
serviceName: "statistics";
|
|
92
|
+
field: "statisticOptionInput";
|
|
93
|
+
linkable: "statistic_option_input_id";
|
|
94
|
+
primaryKey: "id";
|
|
95
|
+
};
|
|
96
|
+
toJSON: () => {
|
|
97
|
+
serviceName: "statistics";
|
|
98
|
+
field: "statisticOptionInput";
|
|
99
|
+
linkable: "statistic_option_input_id";
|
|
100
|
+
primaryKey: "id";
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
export default StatisticsModule;
|
|
106
|
+
export * from "./providers";
|
|
107
|
+
export * from "./models";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.STATISTICS_MODULE = void 0;
|
|
21
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
22
|
+
const service_1 = __importDefault(require("./service"));
|
|
23
|
+
const statistics_1 = __importDefault(require("../../loaders/statistics"));
|
|
24
|
+
exports.STATISTICS_MODULE = "statistics";
|
|
25
|
+
const StatisticsModule = (0, utils_1.Module)(exports.STATISTICS_MODULE, {
|
|
26
|
+
service: service_1.default,
|
|
27
|
+
loaders: [statistics_1.default]
|
|
28
|
+
});
|
|
29
|
+
exports.default = StatisticsModule;
|
|
30
|
+
__exportStar(require("./providers"), exports);
|
|
31
|
+
__exportStar(require("./models"), exports);
|
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9zdGF0aXN0aWNzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEscURBQW1EO0FBQ25ELHdEQUEwQztBQUMxQywwRUFBd0Q7QUFFM0MsUUFBQSxpQkFBaUIsR0FBRyxZQUFZLENBQUM7QUFFOUMsTUFBTSxnQkFBZ0IsR0FBRyxJQUFBLGNBQU0sRUFBQyx5QkFBaUIsRUFBRTtJQUMvQyxPQUFPLEVBQUUsaUJBQWlCO0lBQzFCLE9BQU8sRUFBRSxDQUFDLG9CQUFnQixDQUFDO0NBQzlCLENBQUMsQ0FBQTtBQUVGLGtCQUFlLGdCQUFnQixDQUFDO0FBQ2hDLDhDQUE0QjtBQUM1QiwyQ0FBeUIifQ==
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Migration20260223131741 = void 0;
|
|
4
|
+
const migrations_1 = require("@medusajs/framework/mikro-orm/migrations");
|
|
5
|
+
class Migration20260223131741 extends migrations_1.Migration {
|
|
6
|
+
async up() {
|
|
7
|
+
this.addSql(`create table if not exists "statistics_provider" ("id" text not null, "display_name" text not null, "is_enabled" boolean not null default true, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "statistics_provider_pkey" primary key ("id"));`);
|
|
8
|
+
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_statistics_provider_deleted_at" ON "statistics_provider" ("deleted_at") WHERE deleted_at IS NULL;`);
|
|
9
|
+
this.addSql(`create table if not exists "statistics_option" ("id" text not null, "provider_option_name" text not null, "local_option_name" text not null, "data" jsonb not null, "visualization_config" jsonb null, "cache_options" jsonb null, "parameter_config" jsonb null, "preset" boolean not null default false, "provider_id" text not null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "statistics_option_pkey" primary key ("id"));`);
|
|
10
|
+
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_statistics_option_provider_id" ON "statistics_option" ("provider_id") WHERE deleted_at IS NULL;`);
|
|
11
|
+
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_statistics_option_deleted_at" ON "statistics_option" ("deleted_at") WHERE deleted_at IS NULL;`);
|
|
12
|
+
this.addSql(`create table if not exists "statistics_alert" ("id" text not null, "name" text not null, "description" text null, "option_id" text not null, "condition" jsonb not null, "period" jsonb null, "interval" integer not null default 86400, "severity" text check ("severity" in ('info', 'warning', 'critical')) not null default 'info', "is_enabled" boolean not null default true, "metadata" jsonb null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "statistics_alert_pkey" primary key ("id"));`);
|
|
13
|
+
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_statistics_alert_option_id" ON "statistics_alert" ("option_id") WHERE deleted_at IS NULL;`);
|
|
14
|
+
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_statistics_alert_deleted_at" ON "statistics_alert" ("deleted_at") WHERE deleted_at IS NULL;`);
|
|
15
|
+
this.addSql(`create table if not exists "statistics_alert_log" ("id" text not null, "alert_id" text not null, "triggered_at" timestamptz not null, "evaluation_data" jsonb not null, "evaluation_hash" text not null, "metadata" jsonb null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "statistics_alert_log_pkey" primary key ("id"));`);
|
|
16
|
+
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_statistics_alert_log_alert_id" ON "statistics_alert_log" ("alert_id") WHERE deleted_at IS NULL;`);
|
|
17
|
+
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_statistics_alert_log_deleted_at" ON "statistics_alert_log" ("deleted_at") WHERE deleted_at IS NULL;`);
|
|
18
|
+
this.addSql(`create table if not exists "statistic_option_input" ("id" text not null, "composite_option_id" text not null, "input_option_id" text not null, "parameter_name" text null, "order" integer null, "metadata" jsonb null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "statistic_option_input_pkey" primary key ("id"));`);
|
|
19
|
+
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_statistic_option_input_composite_option_id" ON "statistic_option_input" ("composite_option_id") WHERE deleted_at IS NULL;`);
|
|
20
|
+
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_statistic_option_input_input_option_id" ON "statistic_option_input" ("input_option_id") WHERE deleted_at IS NULL;`);
|
|
21
|
+
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_statistic_option_input_deleted_at" ON "statistic_option_input" ("deleted_at") WHERE deleted_at IS NULL;`);
|
|
22
|
+
this.addSql(`create table if not exists "statistics_view" ("id" text not null, "name" text not null, "description" text null, "stats_data" jsonb null, "period_type" text check ("period_type" in ('rolling', 'calendar', 'custom')) null, "period_config" jsonb null, "interval" integer null, "cache_options" jsonb null, "layout_config" jsonb not null default '{"preset":"compact"}', "metadata" jsonb not null default '{}', "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "statistics_view_pkey" primary key ("id"));`);
|
|
23
|
+
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_statistics_view_deleted_at" ON "statistics_view" ("deleted_at") WHERE deleted_at IS NULL;`);
|
|
24
|
+
this.addSql(`create table if not exists "statistics_chart" ("id" text not null, "name" text not null, "description" text null, "visualization_config" jsonb null, "layout" jsonb null, "view_id" text not null, "metadata" jsonb not null default '{}', "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "statistics_chart_pkey" primary key ("id"));`);
|
|
25
|
+
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_statistics_chart_view_id" ON "statistics_chart" ("view_id") WHERE deleted_at IS NULL;`);
|
|
26
|
+
this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_statistics_chart_deleted_at" ON "statistics_chart" ("deleted_at") WHERE deleted_at IS NULL;`);
|
|
27
|
+
this.addSql(`create table if not exists "statistics_chart_option" ("statistics_option_id" text not null, "statistics_chart_id" text not null, constraint "statistics_chart_option_pkey" primary key ("statistics_option_id", "statistics_chart_id"));`);
|
|
28
|
+
this.addSql(`alter table if exists "statistics_option" add constraint "statistics_option_provider_id_foreign" foreign key ("provider_id") references "statistics_provider" ("id") on update cascade;`);
|
|
29
|
+
this.addSql(`alter table if exists "statistics_alert" add constraint "statistics_alert_option_id_foreign" foreign key ("option_id") references "statistics_option" ("id") on update cascade on delete cascade;`);
|
|
30
|
+
this.addSql(`alter table if exists "statistics_alert_log" add constraint "statistics_alert_log_alert_id_foreign" foreign key ("alert_id") references "statistics_alert" ("id") on update cascade;`);
|
|
31
|
+
this.addSql(`alter table if exists "statistic_option_input" add constraint "statistic_option_input_composite_option_id_foreign" foreign key ("composite_option_id") references "statistics_option" ("id") on update cascade on delete cascade;`);
|
|
32
|
+
this.addSql(`alter table if exists "statistic_option_input" add constraint "statistic_option_input_input_option_id_foreign" foreign key ("input_option_id") references "statistics_option" ("id") on update cascade on delete cascade;`);
|
|
33
|
+
this.addSql(`alter table if exists "statistics_chart" add constraint "statistics_chart_view_id_foreign" foreign key ("view_id") references "statistics_view" ("id") on update cascade on delete cascade;`);
|
|
34
|
+
this.addSql(`alter table if exists "statistics_chart_option" add constraint "statistics_chart_option_statistics_option_id_foreign" foreign key ("statistics_option_id") references "statistics_option" ("id") on update cascade on delete cascade;`);
|
|
35
|
+
this.addSql(`alter table if exists "statistics_chart_option" add constraint "statistics_chart_option_statistics_chart_id_foreign" foreign key ("statistics_chart_id") references "statistics_chart" ("id") on update cascade on delete cascade;`);
|
|
36
|
+
}
|
|
37
|
+
async down() {
|
|
38
|
+
this.addSql(`alter table if exists "statistics_option" drop constraint if exists "statistics_option_provider_id_foreign";`);
|
|
39
|
+
this.addSql(`alter table if exists "statistics_alert" drop constraint if exists "statistics_alert_option_id_foreign";`);
|
|
40
|
+
this.addSql(`alter table if exists "statistic_option_input" drop constraint if exists "statistic_option_input_composite_option_id_foreign";`);
|
|
41
|
+
this.addSql(`alter table if exists "statistic_option_input" drop constraint if exists "statistic_option_input_input_option_id_foreign";`);
|
|
42
|
+
this.addSql(`alter table if exists "statistics_chart_option" drop constraint if exists "statistics_chart_option_statistics_option_id_foreign";`);
|
|
43
|
+
this.addSql(`alter table if exists "statistics_alert_log" drop constraint if exists "statistics_alert_log_alert_id_foreign";`);
|
|
44
|
+
this.addSql(`alter table if exists "statistics_chart" drop constraint if exists "statistics_chart_view_id_foreign";`);
|
|
45
|
+
this.addSql(`alter table if exists "statistics_chart_option" drop constraint if exists "statistics_chart_option_statistics_chart_id_foreign";`);
|
|
46
|
+
this.addSql(`drop table if exists "statistics_provider" cascade;`);
|
|
47
|
+
this.addSql(`drop table if exists "statistics_option" cascade;`);
|
|
48
|
+
this.addSql(`drop table if exists "statistics_alert" cascade;`);
|
|
49
|
+
this.addSql(`drop table if exists "statistics_alert_log" cascade;`);
|
|
50
|
+
this.addSql(`drop table if exists "statistic_option_input" cascade;`);
|
|
51
|
+
this.addSql(`drop table if exists "statistics_view" cascade;`);
|
|
52
|
+
this.addSql(`drop table if exists "statistics_chart" cascade;`);
|
|
53
|
+
this.addSql(`drop table if exists "statistics_chart_option" cascade;`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.Migration20260223131741 = Migration20260223131741;
|
|
57
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWlncmF0aW9uMjAyNjAyMjMxMzE3NDEuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9zdGF0aXN0aWNzL21pZ3JhdGlvbnMvTWlncmF0aW9uMjAyNjAyMjMxMzE3NDEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEseUVBQXFFO0FBRXJFLE1BQWEsdUJBQXdCLFNBQVEsc0JBQVM7SUFFM0MsS0FBSyxDQUFDLEVBQUU7UUFDZixJQUFJLENBQUMsTUFBTSxDQUFDLDZVQUE2VSxDQUFDLENBQUM7UUFDM1YsSUFBSSxDQUFDLE1BQU0sQ0FBQyxtSUFBbUksQ0FBQyxDQUFDO1FBRWpKLElBQUksQ0FBQyxNQUFNLENBQUMsbWdCQUFtZ0IsQ0FBQyxDQUFDO1FBQ2poQixJQUFJLENBQUMsTUFBTSxDQUFDLGlJQUFpSSxDQUFDLENBQUM7UUFDL0ksSUFBSSxDQUFDLE1BQU0sQ0FBQywrSEFBK0gsQ0FBQyxDQUFDO1FBRTdJLElBQUksQ0FBQyxNQUFNLENBQUMscWtCQUFxa0IsQ0FBQyxDQUFDO1FBQ25sQixJQUFJLENBQUMsTUFBTSxDQUFDLDJIQUEySCxDQUFDLENBQUM7UUFDekksSUFBSSxDQUFDLE1BQU0sQ0FBQyw2SEFBNkgsQ0FBQyxDQUFDO1FBRTNJLElBQUksQ0FBQyxNQUFNLENBQUMsOFpBQThaLENBQUMsQ0FBQztRQUM1YSxJQUFJLENBQUMsTUFBTSxDQUFDLGlJQUFpSSxDQUFDLENBQUM7UUFDL0ksSUFBSSxDQUFDLE1BQU0sQ0FBQyxxSUFBcUksQ0FBQyxDQUFDO1FBRW5KLElBQUksQ0FBQyxNQUFNLENBQUMsd1pBQXdaLENBQUMsQ0FBQztRQUN0YSxJQUFJLENBQUMsTUFBTSxDQUFDLDJKQUEySixDQUFDLENBQUM7UUFDekssSUFBSSxDQUFDLE1BQU0sQ0FBQyxtSkFBbUosQ0FBQyxDQUFDO1FBQ2pLLElBQUksQ0FBQyxNQUFNLENBQUMseUlBQXlJLENBQUMsQ0FBQztRQUV2SixJQUFJLENBQUMsTUFBTSxDQUFDLCtrQkFBK2tCLENBQUMsQ0FBQztRQUM3bEIsSUFBSSxDQUFDLE1BQU0sQ0FBQywySEFBMkgsQ0FBQyxDQUFDO1FBRXpJLElBQUksQ0FBQyxNQUFNLENBQUMscWFBQXFhLENBQUMsQ0FBQztRQUNuYixJQUFJLENBQUMsTUFBTSxDQUFDLHVIQUF1SCxDQUFDLENBQUM7UUFDckksSUFBSSxDQUFDLE1BQU0sQ0FBQyw2SEFBNkgsQ0FBQyxDQUFDO1FBRTNJLElBQUksQ0FBQyxNQUFNLENBQUMsME9BQTBPLENBQUMsQ0FBQztRQUV4UCxJQUFJLENBQUMsTUFBTSxDQUFDLHlMQUF5TCxDQUFDLENBQUM7UUFFdk0sSUFBSSxDQUFDLE1BQU0sQ0FBQyxtTUFBbU0sQ0FBQyxDQUFDO1FBRWpOLElBQUksQ0FBQyxNQUFNLENBQUMsc0xBQXNMLENBQUMsQ0FBQztRQUVwTSxJQUFJLENBQUMsTUFBTSxDQUFDLG1PQUFtTyxDQUFDLENBQUM7UUFDalAsSUFBSSxDQUFDLE1BQU0sQ0FBQywyTkFBMk4sQ0FBQyxDQUFDO1FBRXpPLElBQUksQ0FBQyxNQUFNLENBQUMsNkxBQTZMLENBQUMsQ0FBQztRQUUzTSxJQUFJLENBQUMsTUFBTSxDQUFDLHVPQUF1TyxDQUFDLENBQUM7UUFDclAsSUFBSSxDQUFDLE1BQU0sQ0FBQyxvT0FBb08sQ0FBQyxDQUFDO0lBQ3BQLENBQUM7SUFFUSxLQUFLLENBQUMsSUFBSTtRQUNqQixJQUFJLENBQUMsTUFBTSxDQUFDLDhHQUE4RyxDQUFDLENBQUM7UUFFNUgsSUFBSSxDQUFDLE1BQU0sQ0FBQywwR0FBMEcsQ0FBQyxDQUFDO1FBRXhILElBQUksQ0FBQyxNQUFNLENBQUMsZ0lBQWdJLENBQUMsQ0FBQztRQUU5SSxJQUFJLENBQUMsTUFBTSxDQUFDLDRIQUE0SCxDQUFDLENBQUM7UUFFMUksSUFBSSxDQUFDLE1BQU0sQ0FBQyxtSUFBbUksQ0FBQyxDQUFDO1FBRWpKLElBQUksQ0FBQyxNQUFNLENBQUMsaUhBQWlILENBQUMsQ0FBQztRQUUvSCxJQUFJLENBQUMsTUFBTSxDQUFDLHdHQUF3RyxDQUFDLENBQUM7UUFFdEgsSUFBSSxDQUFDLE1BQU0sQ0FBQyxrSUFBa0ksQ0FBQyxDQUFDO1FBRWhKLElBQUksQ0FBQyxNQUFNLENBQUMscURBQXFELENBQUMsQ0FBQztRQUVuRSxJQUFJLENBQUMsTUFBTSxDQUFDLG1EQUFtRCxDQUFDLENBQUM7UUFFakUsSUFBSSxDQUFDLE1BQU0sQ0FBQyxrREFBa0QsQ0FBQyxDQUFDO1FBRWhFLElBQUksQ0FBQyxNQUFNLENBQUMsc0RBQXNELENBQUMsQ0FBQztRQUVwRSxJQUFJLENBQUMsTUFBTSxDQUFDLHdEQUF3RCxDQUFDLENBQUM7UUFFdEUsSUFBSSxDQUFDLE1BQU0sQ0FBQyxpREFBaUQsQ0FBQyxDQUFDO1FBRS9ELElBQUksQ0FBQyxNQUFNLENBQUMsa0RBQWtELENBQUMsQ0FBQztRQUVoRSxJQUFJLENBQUMsTUFBTSxDQUFDLHlEQUF5RCxDQUFDLENBQUM7SUFDekUsQ0FBQztDQUVGO0FBakZELDBEQWlGQyJ9
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export declare const StatisticsAlertLog: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
2
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
3
|
+
alert: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
4
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
5
|
+
name: import("@medusajs/framework/utils").TextProperty;
|
|
6
|
+
description: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
7
|
+
option: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
8
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
9
|
+
provider_option_name: import("@medusajs/framework/utils").TextProperty;
|
|
10
|
+
local_option_name: import("@medusajs/framework/utils").TextProperty;
|
|
11
|
+
data: import("@medusajs/framework/utils").JSONProperty;
|
|
12
|
+
visualization_config: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
13
|
+
cache_options: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
14
|
+
parameter_config: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
15
|
+
preset: import("@medusajs/framework/utils").BooleanProperty;
|
|
16
|
+
provider: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
17
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
18
|
+
display_name: import("@medusajs/framework/utils").TextProperty;
|
|
19
|
+
is_enabled: import("@medusajs/framework/utils").BooleanProperty;
|
|
20
|
+
options: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "statistics_option">>;
|
|
21
|
+
}>, "statistics_provider">, undefined>;
|
|
22
|
+
alerts: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "statistics_alert">>;
|
|
23
|
+
charts: import("@medusajs/framework/utils").ManyToMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
24
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
25
|
+
name: import("@medusajs/framework/utils").TextProperty;
|
|
26
|
+
description: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
27
|
+
visualization_config: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
28
|
+
layout: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
29
|
+
view: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
30
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
31
|
+
name: import("@medusajs/framework/utils").TextProperty;
|
|
32
|
+
description: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
33
|
+
charts: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "statistics_chart">>;
|
|
34
|
+
stats_data: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
35
|
+
period_type: import("@medusajs/framework/utils").NullableModifier<"rolling" | "calendar" | "custom", import("@medusajs/framework/utils").EnumProperty<["rolling", "calendar", "custom"]>>;
|
|
36
|
+
period_config: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
37
|
+
interval: import("@medusajs/framework/utils").NullableModifier<number, import("@medusajs/framework/utils").NumberProperty>;
|
|
38
|
+
cache_options: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
39
|
+
layout_config: import("@medusajs/framework/utils").JSONProperty;
|
|
40
|
+
metadata: import("@medusajs/framework/utils").JSONProperty;
|
|
41
|
+
}>, "statistics_view">, undefined>;
|
|
42
|
+
statistics: import("@medusajs/framework/utils").ManyToMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "statistics_option">>;
|
|
43
|
+
metadata: import("@medusajs/framework/utils").JSONProperty;
|
|
44
|
+
}>, "statistics_chart">>;
|
|
45
|
+
input_dependencies: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
46
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
47
|
+
composite_option: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "statistics_option">, undefined>;
|
|
48
|
+
input_option: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "statistics_option">, undefined>;
|
|
49
|
+
parameter_name: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
50
|
+
order: import("@medusajs/framework/utils").NullableModifier<number, import("@medusajs/framework/utils").NumberProperty>;
|
|
51
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
52
|
+
}>, "statistic_option_input">>;
|
|
53
|
+
dependent_composites: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
54
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
55
|
+
composite_option: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "statistics_option">, undefined>;
|
|
56
|
+
input_option: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "statistics_option">, undefined>;
|
|
57
|
+
parameter_name: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
58
|
+
order: import("@medusajs/framework/utils").NullableModifier<number, import("@medusajs/framework/utils").NumberProperty>;
|
|
59
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
60
|
+
}>, "statistic_option_input">>;
|
|
61
|
+
}>, "statistics_option">, undefined>;
|
|
62
|
+
condition: import("@medusajs/framework/utils").JSONProperty;
|
|
63
|
+
period: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
64
|
+
interval: import("@medusajs/framework/utils").NumberProperty;
|
|
65
|
+
severity: import("@medusajs/framework/utils").EnumProperty<["info", "warning", "critical"]>;
|
|
66
|
+
is_enabled: import("@medusajs/framework/utils").BooleanProperty;
|
|
67
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
68
|
+
logs: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "statistics_alert_log">>;
|
|
69
|
+
}>, "statistics_alert">, undefined>;
|
|
70
|
+
triggered_at: import("@medusajs/framework/utils").DateTimeProperty;
|
|
71
|
+
evaluation_data: import("@medusajs/framework/utils").JSONProperty;
|
|
72
|
+
evaluation_hash: import("@medusajs/framework/utils").TextProperty;
|
|
73
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
74
|
+
}>, "statistics_alert_log">;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StatisticsAlertLog = void 0;
|
|
4
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
5
|
+
const alert_1 = require("./alert");
|
|
6
|
+
exports.StatisticsAlertLog = utils_1.model.define("statistics_alert_log", {
|
|
7
|
+
id: utils_1.model.id({ prefix: "stat_alert_log" }).primaryKey(),
|
|
8
|
+
alert: utils_1.model.belongsTo(() => alert_1.StatisticsAlert, {
|
|
9
|
+
mappedBy: "logs"
|
|
10
|
+
}),
|
|
11
|
+
triggered_at: utils_1.model.dateTime(),
|
|
12
|
+
evaluation_data: utils_1.model.json(),
|
|
13
|
+
evaluation_hash: utils_1.model.text(),
|
|
14
|
+
metadata: utils_1.model.json().nullable(),
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWxlcnQtbG9nLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL21vZHVsZXMvc3RhdGlzdGljcy9tb2RlbHMvYWxlcnQtbG9nLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHFEQUFrRDtBQUNsRCxtQ0FBMEM7QUFFN0IsUUFBQSxrQkFBa0IsR0FBRyxhQUFLLENBQUMsTUFBTSxDQUFDLHNCQUFzQixFQUFFO0lBQ25FLEVBQUUsRUFBRSxhQUFLLENBQUMsRUFBRSxDQUFDLEVBQUUsTUFBTSxFQUFFLGdCQUFnQixFQUFFLENBQUMsQ0FBQyxVQUFVLEVBQUU7SUFHdkQsS0FBSyxFQUFFLGFBQUssQ0FBQyxTQUFTLENBQUMsR0FBRyxFQUFFLENBQUMsdUJBQWUsRUFBRTtRQUMxQyxRQUFRLEVBQUUsTUFBTTtLQUNuQixDQUFDO0lBR0YsWUFBWSxFQUFFLGFBQUssQ0FBQyxRQUFRLEVBQUU7SUFDOUIsZUFBZSxFQUFFLGFBQUssQ0FBQyxJQUFJLEVBQUU7SUFDN0IsZUFBZSxFQUFFLGFBQUssQ0FBQyxJQUFJLEVBQUU7SUFHN0IsUUFBUSxFQUFFLGFBQUssQ0FBQyxJQUFJLEVBQUUsQ0FBQyxRQUFRLEVBQUU7Q0FDcEMsQ0FBQyxDQUFDIn0=
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export declare const StatisticsAlert: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
2
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
3
|
+
name: import("@medusajs/framework/utils").TextProperty;
|
|
4
|
+
description: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
5
|
+
option: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
6
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
7
|
+
provider_option_name: import("@medusajs/framework/utils").TextProperty;
|
|
8
|
+
local_option_name: import("@medusajs/framework/utils").TextProperty;
|
|
9
|
+
data: import("@medusajs/framework/utils").JSONProperty;
|
|
10
|
+
visualization_config: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
11
|
+
cache_options: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
12
|
+
parameter_config: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
13
|
+
preset: import("@medusajs/framework/utils").BooleanProperty;
|
|
14
|
+
provider: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
15
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
16
|
+
display_name: import("@medusajs/framework/utils").TextProperty;
|
|
17
|
+
is_enabled: import("@medusajs/framework/utils").BooleanProperty;
|
|
18
|
+
options: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "statistics_option">>;
|
|
19
|
+
}>, "statistics_provider">, undefined>;
|
|
20
|
+
alerts: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "statistics_alert">>;
|
|
21
|
+
charts: import("@medusajs/framework/utils").ManyToMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
22
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
23
|
+
name: import("@medusajs/framework/utils").TextProperty;
|
|
24
|
+
description: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
25
|
+
visualization_config: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
26
|
+
layout: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
27
|
+
view: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
28
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
29
|
+
name: import("@medusajs/framework/utils").TextProperty;
|
|
30
|
+
description: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
31
|
+
charts: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "statistics_chart">>;
|
|
32
|
+
stats_data: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
33
|
+
period_type: import("@medusajs/framework/utils").NullableModifier<"rolling" | "calendar" | "custom", import("@medusajs/framework/utils").EnumProperty<["rolling", "calendar", "custom"]>>;
|
|
34
|
+
period_config: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
35
|
+
interval: import("@medusajs/framework/utils").NullableModifier<number, import("@medusajs/framework/utils").NumberProperty>;
|
|
36
|
+
cache_options: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
37
|
+
layout_config: import("@medusajs/framework/utils").JSONProperty;
|
|
38
|
+
metadata: import("@medusajs/framework/utils").JSONProperty;
|
|
39
|
+
}>, "statistics_view">, undefined>;
|
|
40
|
+
statistics: import("@medusajs/framework/utils").ManyToMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "statistics_option">>;
|
|
41
|
+
metadata: import("@medusajs/framework/utils").JSONProperty;
|
|
42
|
+
}>, "statistics_chart">>;
|
|
43
|
+
input_dependencies: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
44
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
45
|
+
composite_option: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "statistics_option">, undefined>;
|
|
46
|
+
input_option: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "statistics_option">, undefined>;
|
|
47
|
+
parameter_name: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
48
|
+
order: import("@medusajs/framework/utils").NullableModifier<number, import("@medusajs/framework/utils").NumberProperty>;
|
|
49
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
50
|
+
}>, "statistic_option_input">>;
|
|
51
|
+
dependent_composites: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
52
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
53
|
+
composite_option: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "statistics_option">, undefined>;
|
|
54
|
+
input_option: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "statistics_option">, undefined>;
|
|
55
|
+
parameter_name: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
56
|
+
order: import("@medusajs/framework/utils").NullableModifier<number, import("@medusajs/framework/utils").NumberProperty>;
|
|
57
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
58
|
+
}>, "statistic_option_input">>;
|
|
59
|
+
}>, "statistics_option">, undefined>;
|
|
60
|
+
condition: import("@medusajs/framework/utils").JSONProperty;
|
|
61
|
+
period: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
62
|
+
interval: import("@medusajs/framework/utils").NumberProperty;
|
|
63
|
+
severity: import("@medusajs/framework/utils").EnumProperty<["info", "warning", "critical"]>;
|
|
64
|
+
is_enabled: import("@medusajs/framework/utils").BooleanProperty;
|
|
65
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
66
|
+
logs: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
67
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
68
|
+
alert: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "statistics_alert">, undefined>;
|
|
69
|
+
triggered_at: import("@medusajs/framework/utils").DateTimeProperty;
|
|
70
|
+
evaluation_data: import("@medusajs/framework/utils").JSONProperty;
|
|
71
|
+
evaluation_hash: import("@medusajs/framework/utils").TextProperty;
|
|
72
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
73
|
+
}>, "statistics_alert_log">>;
|
|
74
|
+
}>, "statistics_alert">;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StatisticsAlert = void 0;
|
|
4
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
5
|
+
const option_1 = require("./option");
|
|
6
|
+
const alert_log_1 = require("./alert-log");
|
|
7
|
+
exports.StatisticsAlert = utils_1.model.define("statistics_alert", {
|
|
8
|
+
id: utils_1.model.id({ prefix: "stat_alert" }).primaryKey(),
|
|
9
|
+
name: utils_1.model.text(),
|
|
10
|
+
description: utils_1.model.text().nullable(),
|
|
11
|
+
option: utils_1.model.belongsTo(() => option_1.StatisticsOption, {
|
|
12
|
+
mappedBy: "alerts"
|
|
13
|
+
}),
|
|
14
|
+
condition: utils_1.model.json(),
|
|
15
|
+
period: utils_1.model.json().nullable(),
|
|
16
|
+
interval: utils_1.model.number().default(86400),
|
|
17
|
+
severity: utils_1.model.enum(["info", "warning", "critical"]).default("info"),
|
|
18
|
+
is_enabled: utils_1.model.boolean().default(true),
|
|
19
|
+
metadata: utils_1.model.json().nullable(),
|
|
20
|
+
logs: utils_1.model.hasMany(() => alert_log_1.StatisticsAlertLog, {
|
|
21
|
+
mappedBy: "alert"
|
|
22
|
+
}),
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWxlcnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9zdGF0aXN0aWNzL21vZGVscy9hbGVydC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxxREFBa0Q7QUFDbEQscUNBQTRDO0FBQzVDLDJDQUFpRDtBQUVwQyxRQUFBLGVBQWUsR0FBRyxhQUFLLENBQUMsTUFBTSxDQUFDLGtCQUFrQixFQUFFO0lBQzVELEVBQUUsRUFBRSxhQUFLLENBQUMsRUFBRSxDQUFDLEVBQUUsTUFBTSxFQUFFLFlBQVksRUFBRSxDQUFDLENBQUMsVUFBVSxFQUFFO0lBQ25ELElBQUksRUFBRSxhQUFLLENBQUMsSUFBSSxFQUFFO0lBQ2xCLFdBQVcsRUFBRSxhQUFLLENBQUMsSUFBSSxFQUFFLENBQUMsUUFBUSxFQUFFO0lBR3BDLE1BQU0sRUFBRSxhQUFLLENBQUMsU0FBUyxDQUFDLEdBQUcsRUFBRSxDQUFDLHlCQUFnQixFQUFFO1FBQzVDLFFBQVEsRUFBRSxRQUFRO0tBQ3JCLENBQUM7SUFLRixTQUFTLEVBQUUsYUFBSyxDQUFDLElBQUksRUFBRTtJQUl2QixNQUFNLEVBQUUsYUFBSyxDQUFDLElBQUksRUFBRSxDQUFDLFFBQVEsRUFBRTtJQUcvQixRQUFRLEVBQUUsYUFBSyxDQUFDLE1BQU0sRUFBRSxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUM7SUFHdkMsUUFBUSxFQUFFLGFBQUssQ0FBQyxJQUFJLENBQUMsQ0FBQyxNQUFNLEVBQUUsU0FBUyxFQUFFLFVBQVUsQ0FBQyxDQUFDLENBQUMsT0FBTyxDQUFDLE1BQU0sQ0FBQztJQUNyRSxVQUFVLEVBQUUsYUFBSyxDQUFDLE9BQU8sRUFBRSxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUM7SUFDekMsUUFBUSxFQUFFLGFBQUssQ0FBQyxJQUFJLEVBQUUsQ0FBQyxRQUFRLEVBQUU7SUFHakMsSUFBSSxFQUFFLGFBQUssQ0FBQyxPQUFPLENBQUMsR0FBRyxFQUFFLENBQUMsOEJBQWtCLEVBQUU7UUFDMUMsUUFBUSxFQUFFLE9BQU87S0FDcEIsQ0FBQztDQUNMLENBQUMsQ0FBQyJ9
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a chart visualization that can contain multiple StatisticOptions.
|
|
3
|
+
* Supports combo charts where each option can have its own chart type (line, bar, area, etc.)
|
|
4
|
+
*
|
|
5
|
+
* StatisticsChart handles chart-wide settings (axes, legend, grid)
|
|
6
|
+
* StatisticsOption handles per-series settings (colors, line styles, chart type)
|
|
7
|
+
*/
|
|
8
|
+
export declare const StatisticsChart: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
9
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
10
|
+
name: import("@medusajs/framework/utils").TextProperty;
|
|
11
|
+
description: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
12
|
+
visualization_config: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
13
|
+
layout: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
14
|
+
view: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
15
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
16
|
+
name: import("@medusajs/framework/utils").TextProperty;
|
|
17
|
+
description: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
18
|
+
charts: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "statistics_chart">>;
|
|
19
|
+
stats_data: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
20
|
+
period_type: import("@medusajs/framework/utils").NullableModifier<"rolling" | "calendar" | "custom", import("@medusajs/framework/utils").EnumProperty<["rolling", "calendar", "custom"]>>;
|
|
21
|
+
period_config: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
22
|
+
interval: import("@medusajs/framework/utils").NullableModifier<number, import("@medusajs/framework/utils").NumberProperty>;
|
|
23
|
+
cache_options: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
24
|
+
layout_config: import("@medusajs/framework/utils").JSONProperty;
|
|
25
|
+
metadata: import("@medusajs/framework/utils").JSONProperty;
|
|
26
|
+
}>, "statistics_view">, undefined>;
|
|
27
|
+
statistics: import("@medusajs/framework/utils").ManyToMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
28
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
29
|
+
provider_option_name: import("@medusajs/framework/utils").TextProperty;
|
|
30
|
+
local_option_name: import("@medusajs/framework/utils").TextProperty;
|
|
31
|
+
data: import("@medusajs/framework/utils").JSONProperty;
|
|
32
|
+
visualization_config: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
33
|
+
cache_options: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
34
|
+
parameter_config: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
35
|
+
preset: import("@medusajs/framework/utils").BooleanProperty;
|
|
36
|
+
provider: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
37
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
38
|
+
display_name: import("@medusajs/framework/utils").TextProperty;
|
|
39
|
+
is_enabled: import("@medusajs/framework/utils").BooleanProperty;
|
|
40
|
+
options: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "statistics_option">>;
|
|
41
|
+
}>, "statistics_provider">, undefined>;
|
|
42
|
+
alerts: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
43
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
44
|
+
name: import("@medusajs/framework/utils").TextProperty;
|
|
45
|
+
description: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
46
|
+
option: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "statistics_option">, undefined>;
|
|
47
|
+
condition: import("@medusajs/framework/utils").JSONProperty;
|
|
48
|
+
period: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
49
|
+
interval: import("@medusajs/framework/utils").NumberProperty;
|
|
50
|
+
severity: import("@medusajs/framework/utils").EnumProperty<["info", "warning", "critical"]>;
|
|
51
|
+
is_enabled: import("@medusajs/framework/utils").BooleanProperty;
|
|
52
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
53
|
+
logs: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
54
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
55
|
+
alert: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "statistics_alert">, undefined>;
|
|
56
|
+
triggered_at: import("@medusajs/framework/utils").DateTimeProperty;
|
|
57
|
+
evaluation_data: import("@medusajs/framework/utils").JSONProperty;
|
|
58
|
+
evaluation_hash: import("@medusajs/framework/utils").TextProperty;
|
|
59
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
60
|
+
}>, "statistics_alert_log">>;
|
|
61
|
+
}>, "statistics_alert">>;
|
|
62
|
+
charts: import("@medusajs/framework/utils").ManyToMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "statistics_chart">>;
|
|
63
|
+
input_dependencies: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
64
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
65
|
+
composite_option: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "statistics_option">, undefined>;
|
|
66
|
+
input_option: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "statistics_option">, undefined>;
|
|
67
|
+
parameter_name: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
68
|
+
order: import("@medusajs/framework/utils").NullableModifier<number, import("@medusajs/framework/utils").NumberProperty>;
|
|
69
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
70
|
+
}>, "statistic_option_input">>;
|
|
71
|
+
dependent_composites: import("@medusajs/framework/utils").HasMany<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
72
|
+
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
73
|
+
composite_option: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "statistics_option">, undefined>;
|
|
74
|
+
input_option: import("@medusajs/framework/utils").BelongsTo<() => import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder</*elided*/ any>, "statistics_option">, undefined>;
|
|
75
|
+
parameter_name: import("@medusajs/framework/utils").NullableModifier<string, import("@medusajs/framework/utils").TextProperty>;
|
|
76
|
+
order: import("@medusajs/framework/utils").NullableModifier<number, import("@medusajs/framework/utils").NumberProperty>;
|
|
77
|
+
metadata: import("@medusajs/framework/utils").NullableModifier<Record<string, unknown>, import("@medusajs/framework/utils").JSONProperty>;
|
|
78
|
+
}>, "statistic_option_input">>;
|
|
79
|
+
}>, "statistics_option">>;
|
|
80
|
+
metadata: import("@medusajs/framework/utils").JSONProperty;
|
|
81
|
+
}>, "statistics_chart">;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StatisticsChart = void 0;
|
|
4
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
5
|
+
const view_1 = require("./view");
|
|
6
|
+
const option_1 = require("./option");
|
|
7
|
+
/**
|
|
8
|
+
* Represents a chart visualization that can contain multiple StatisticOptions.
|
|
9
|
+
* Supports combo charts where each option can have its own chart type (line, bar, area, etc.)
|
|
10
|
+
*
|
|
11
|
+
* StatisticsChart handles chart-wide settings (axes, legend, grid)
|
|
12
|
+
* StatisticsOption handles per-series settings (colors, line styles, chart type)
|
|
13
|
+
*/
|
|
14
|
+
exports.StatisticsChart = utils_1.model.define("statistics_chart", {
|
|
15
|
+
id: utils_1.model.id({ prefix: "stat_chart" }).primaryKey(),
|
|
16
|
+
name: utils_1.model.text(),
|
|
17
|
+
description: utils_1.model.text().nullable(),
|
|
18
|
+
visualization_config: utils_1.model.json().nullable(),
|
|
19
|
+
layout: utils_1.model.json().nullable(),
|
|
20
|
+
view: utils_1.model.belongsTo(() => view_1.StatisticsView, {
|
|
21
|
+
mappedBy: "charts"
|
|
22
|
+
}),
|
|
23
|
+
statistics: utils_1.model.manyToMany(() => option_1.StatisticsOption, {
|
|
24
|
+
mappedBy: "charts",
|
|
25
|
+
}),
|
|
26
|
+
metadata: utils_1.model.json().default({})
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hhcnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9zdGF0aXN0aWNzL21vZGVscy9jaGFydC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxxREFBa0Q7QUFDbEQsaUNBQXdDO0FBQ3hDLHFDQUE0QztBQUU1Qzs7Ozs7O0dBTUc7QUFDVSxRQUFBLGVBQWUsR0FBRyxhQUFLLENBQUMsTUFBTSxDQUFDLGtCQUFrQixFQUFFO0lBQzVELEVBQUUsRUFBRSxhQUFLLENBQUMsRUFBRSxDQUFDLEVBQUUsTUFBTSxFQUFFLFlBQVksRUFBRSxDQUFDLENBQUMsVUFBVSxFQUFFO0lBR25ELElBQUksRUFBRSxhQUFLLENBQUMsSUFBSSxFQUFFO0lBQ2xCLFdBQVcsRUFBRSxhQUFLLENBQUMsSUFBSSxFQUFFLENBQUMsUUFBUSxFQUFFO0lBSXBDLG9CQUFvQixFQUFFLGFBQUssQ0FBQyxJQUFJLEVBQUUsQ0FBQyxRQUFRLEVBQUU7SUFjN0MsTUFBTSxFQUFFLGFBQUssQ0FBQyxJQUFJLEVBQUUsQ0FBQyxRQUFRLEVBQUU7SUFHL0IsSUFBSSxFQUFFLGFBQUssQ0FBQyxTQUFTLENBQUMsR0FBRyxFQUFFLENBQUMscUJBQWMsRUFBRTtRQUN4QyxRQUFRLEVBQUUsUUFBUTtLQUNyQixDQUFDO0lBSUYsVUFBVSxFQUFFLGFBQUssQ0FBQyxVQUFVLENBQUMsR0FBRyxFQUFFLENBQUMseUJBQWdCLEVBQUU7UUFDakQsUUFBUSxFQUFFLFFBQVE7S0FDckIsQ0FBQztJQUdGLFFBQVEsRUFBRSxhQUFLLENBQUMsSUFBSSxFQUFFLENBQUMsT0FBTyxDQUFDLEVBQUUsQ0FBQztDQUNyQyxDQUFDLENBQUEifQ==
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./view"), exports);
|
|
18
|
+
__exportStar(require("./provider"), exports);
|
|
19
|
+
__exportStar(require("./option"), exports);
|
|
20
|
+
__exportStar(require("./option-input"), exports);
|
|
21
|
+
__exportStar(require("./alert"), exports);
|
|
22
|
+
__exportStar(require("./alert-log"), exports);
|
|
23
|
+
__exportStar(require("./chart"), exports);
|
|
24
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvbW9kdWxlcy9zdGF0aXN0aWNzL21vZGVscy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7O0FBQUEseUNBQXVCO0FBQ3ZCLDZDQUEyQjtBQUMzQiwyQ0FBeUI7QUFDekIsaURBQStCO0FBQy9CLDBDQUF3QjtBQUN4Qiw4Q0FBNEI7QUFDNUIsMENBQXdCIn0=
|