@ezpaarse-project/ezreeport-sdk-js 1.3.0 → 2.0.0-beta.1
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/README.md +9 -10
- package/dist/api-C_g0ldUn.d.ts +24 -0
- package/dist/api-D8l8Ds3U.mjs +19 -0
- package/dist/api-D8l8Ds3U.mjs.map +1 -0
- package/dist/api-DVzOqMA2.js +2 -0
- package/dist/api-DVzOqMA2.js.map +1 -0
- package/dist/auth.d.ts +47 -0
- package/dist/auth.js +2 -0
- package/dist/auth.js.map +1 -0
- package/dist/auth.mjs +7 -0
- package/dist/auth.mjs.map +1 -0
- package/dist/body-BqAn9vHJ.d.ts +16 -0
- package/dist/crons.d.ts +16 -0
- package/dist/crons.js +2 -0
- package/dist/crons.js.map +1 -0
- package/dist/crons.mjs +90 -0
- package/dist/crons.mjs.map +1 -0
- package/dist/decorator-C2gcn2rK.js +2 -0
- package/dist/decorator-C2gcn2rK.js.map +1 -0
- package/dist/decorator-DBkj--6g.mjs +26 -0
- package/dist/decorator-DBkj--6g.mjs.map +1 -0
- package/dist/elastic.d.ts +26 -0
- package/dist/elastic.js +2 -0
- package/dist/elastic.js.map +1 -0
- package/dist/elastic.mjs +45 -0
- package/dist/elastic.mjs.map +1 -0
- package/dist/fetch-Hd-ajPIl.js +2 -0
- package/dist/fetch-Hd-ajPIl.js.map +1 -0
- package/dist/fetch-xZFTa3q1.mjs +16 -0
- package/dist/fetch-xZFTa3q1.mjs.map +1 -0
- package/dist/health.d.ts +47 -0
- package/dist/health.js +2 -0
- package/dist/health.js.map +1 -0
- package/dist/health.mjs +41 -0
- package/dist/health.mjs.map +1 -0
- package/dist/helpers/aggregations.d.ts +109 -0
- package/dist/helpers/aggregations.js +2 -0
- package/dist/helpers/aggregations.js.map +1 -0
- package/dist/helpers/aggregations.mjs +42 -0
- package/dist/helpers/aggregations.mjs.map +1 -0
- package/dist/helpers/figures.d.ts +221 -0
- package/dist/helpers/figures.js +2 -0
- package/dist/helpers/figures.js.map +1 -0
- package/dist/helpers/figures.mjs +33 -0
- package/dist/helpers/figures.mjs.map +1 -0
- package/dist/helpers/filters.d.ts +8 -0
- package/dist/helpers/filters.js +2 -0
- package/dist/helpers/filters.js.map +1 -0
- package/dist/helpers/filters.mjs +7 -0
- package/dist/helpers/filters.mjs.map +1 -0
- package/dist/helpers/jobs.d.ts +109 -0
- package/dist/helpers/jobs.js +2 -0
- package/dist/helpers/jobs.js.map +1 -0
- package/dist/helpers/jobs.mjs +390 -0
- package/dist/helpers/jobs.mjs.map +1 -0
- package/dist/helpers/layouts.d.ts +19 -0
- package/dist/helpers/layouts.js +2 -0
- package/dist/helpers/layouts.js.map +1 -0
- package/dist/helpers/layouts.mjs +44 -0
- package/dist/helpers/layouts.mjs.map +1 -0
- package/dist/helpers/permissions.d.ts +15 -0
- package/dist/helpers/permissions.js +2 -0
- package/dist/helpers/permissions.js.map +1 -0
- package/dist/helpers/permissions.mjs +40 -0
- package/dist/helpers/permissions.mjs.map +1 -0
- package/dist/helpers/task-presets.d.ts +16 -0
- package/dist/helpers/task-presets.js +2 -0
- package/dist/helpers/task-presets.js.map +1 -0
- package/dist/helpers/task-presets.mjs +36 -0
- package/dist/helpers/task-presets.mjs.map +1 -0
- package/dist/helpers/tasks.d.ts +55 -0
- package/dist/helpers/tasks.js +2 -0
- package/dist/helpers/tasks.js.map +1 -0
- package/dist/helpers/tasks.mjs +191 -0
- package/dist/helpers/tasks.mjs.map +1 -0
- package/dist/helpers/templates.d.ts +34 -0
- package/dist/helpers/templates.js +2 -0
- package/dist/helpers/templates.js.map +1 -0
- package/dist/helpers/templates.mjs +130 -0
- package/dist/helpers/templates.mjs.map +1 -0
- package/dist/index-CWHjM0a3.d.ts +109 -0
- package/dist/index-btsFMVmd.js +2 -0
- package/dist/index-btsFMVmd.js.map +1 -0
- package/dist/index-niBfS4wD.mjs +331 -0
- package/dist/index-niBfS4wD.mjs.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +7 -0
- package/dist/index.mjs.map +1 -0
- package/dist/methods-BBsb3M5p.mjs +142 -0
- package/dist/methods-BBsb3M5p.mjs.map +1 -0
- package/dist/methods-BJfwYB1p.mjs +126 -0
- package/dist/methods-BJfwYB1p.mjs.map +1 -0
- package/dist/methods-CGdoP4Hi.js +2 -0
- package/dist/methods-CGdoP4Hi.js.map +1 -0
- package/dist/methods-CO0p8irP.js +2 -0
- package/dist/methods-CO0p8irP.js.map +1 -0
- package/dist/methods-DOB4Ry8E.mjs +147 -0
- package/dist/methods-DOB4Ry8E.mjs.map +1 -0
- package/dist/methods-DU5cbtLn.js +2 -0
- package/dist/methods-DU5cbtLn.js.map +1 -0
- package/dist/methods-DUqC5qzU.mjs +146 -0
- package/dist/methods-DUqC5qzU.mjs.map +1 -0
- package/dist/methods-DY2VLwGd.mjs +116 -0
- package/dist/methods-DY2VLwGd.mjs.map +1 -0
- package/dist/methods-Jar1Wkpj.js +2 -0
- package/dist/methods-Jar1Wkpj.js.map +1 -0
- package/dist/methods-M4GU2OL5.mjs +51 -0
- package/dist/methods-M4GU2OL5.mjs.map +1 -0
- package/dist/methods-cUjyNkoK.js +2 -0
- package/dist/methods-cUjyNkoK.js.map +1 -0
- package/dist/methods-uWDk6_pk.js +2 -0
- package/dist/methods-uWDk6_pk.js.map +1 -0
- package/dist/namespaces.d.ts +28 -0
- package/dist/namespaces.js +2 -0
- package/dist/namespaces.js.map +1 -0
- package/dist/namespaces.mjs +2 -0
- package/dist/namespaces.mjs.map +1 -0
- package/dist/queues.d.ts +6 -0
- package/dist/queues.js +2 -0
- package/dist/queues.js.map +1 -0
- package/dist/queues.mjs +10 -0
- package/dist/queues.mjs.map +1 -0
- package/dist/reports.d.ts +85 -0
- package/dist/reports.js +2 -0
- package/dist/reports.js.map +1 -0
- package/dist/reports.mjs +12 -0
- package/dist/reports.mjs.map +1 -0
- package/dist/task-activity.d.ts +33 -0
- package/dist/task-activity.js +2 -0
- package/dist/task-activity.js.map +1 -0
- package/dist/task-activity.mjs +66 -0
- package/dist/task-activity.mjs.map +1 -0
- package/dist/task-presets.d.ts +61 -0
- package/dist/task-presets.js +2 -0
- package/dist/task-presets.js.map +1 -0
- package/dist/task-presets.mjs +10 -0
- package/dist/task-presets.mjs.map +1 -0
- package/dist/tasks-1x680qAf.mjs +34 -0
- package/dist/tasks-1x680qAf.mjs.map +1 -0
- package/dist/tasks-CYqJgTvz.d.ts +12 -0
- package/dist/tasks-hn70eL7B.js +2 -0
- package/dist/tasks-hn70eL7B.js.map +1 -0
- package/dist/tasks.d.ts +60 -0
- package/dist/tasks.js +2 -0
- package/dist/tasks.js.map +1 -0
- package/dist/tasks.mjs +10 -0
- package/dist/tasks.mjs.map +1 -0
- package/dist/templates-BgRTZc5c.d.ts +14 -0
- package/dist/templates-yZjsVuN9.js +2 -0
- package/dist/templates-yZjsVuN9.js.map +1 -0
- package/dist/templates-zMmVXt6k.mjs +30 -0
- package/dist/templates-zMmVXt6k.mjs.map +1 -0
- package/dist/templates.d.ts +51 -0
- package/dist/templates.js +2 -0
- package/dist/templates.js.map +1 -0
- package/dist/templates.mjs +9 -0
- package/dist/templates.mjs.map +1 -0
- package/dist/transform-DzLAfSJo.js +2 -0
- package/dist/transform-DzLAfSJo.js.map +1 -0
- package/dist/transform-EpMTJExd.mjs +26 -0
- package/dist/transform-EpMTJExd.mjs.map +1 -0
- package/dist/types-CpDGJRQw.d.ts +48 -0
- package/dist/types-DcoMmjs3.d.ts +101 -0
- package/dist/types-jXqGnCKQ.d.ts +79 -0
- package/dist/types-y2f9Jb4M.d.ts +75 -0
- package/package.json +126 -25
- package/dist/browser/ezreeport-sdk-js.mjs +0 -979
- package/dist/browser/ezreeport-sdk-js.mjs.map +0 -1
- package/dist/browser/ezreeport-sdk-js.umd.js +0 -2
- package/dist/browser/ezreeport-sdk-js.umd.js.map +0 -1
- package/dist/node/ezreeport-sdk-js.js +0 -2
- package/dist/node/ezreeport-sdk-js.js.map +0 -1
- package/dist/node/ezreeport-sdk-js.mjs +0 -979
- package/dist/node/ezreeport-sdk-js.mjs.map +0 -1
- package/dist/types/index.d.ts +0 -32
- package/dist/types/lib/axios.d.ts +0 -51
- package/dist/types/lib/promises.d.ts +0 -21
- package/dist/types/lib/utils.d.ts +0 -27
- package/dist/types/modules/auth.d.ts +0 -90
- package/dist/types/modules/auth.public.d.ts +0 -1
- package/dist/types/modules/crons.d.ts +0 -102
- package/dist/types/modules/crons.public.d.ts +0 -1
- package/dist/types/modules/elastic.d.ts +0 -33
- package/dist/types/modules/elastic.public.d.ts +0 -1
- package/dist/types/modules/health.d.ts +0 -53
- package/dist/types/modules/health.public.d.ts +0 -1
- package/dist/types/modules/namespaces.d.ts +0 -29
- package/dist/types/modules/namespaces.public.d.ts +0 -1
- package/dist/types/modules/queues.d.ts +0 -120
- package/dist/types/modules/queues.public.d.ts +0 -1
- package/dist/types/modules/reports.d.ts +0 -204
- package/dist/types/modules/reports.public.d.ts +0 -1
- package/dist/types/modules/setup.d.ts +0 -17
- package/dist/types/modules/setup.public.d.ts +0 -2
- package/dist/types/modules/tasks.base.d.ts +0 -48
- package/dist/types/modules/tasks.d.ts +0 -249
- package/dist/types/modules/tasks.public.d.ts +0 -2
- package/dist/types/modules/tasksActivity.d.ts +0 -36
- package/dist/types/modules/tasksActivity.public.d.ts +0 -5
- package/dist/types/modules/tasksPresets.d.ts +0 -87
- package/dist/types/modules/tasksPresets.public.d.ts +0 -1
- package/dist/types/modules/templates.d.ts +0 -155
- package/dist/types/modules/templates.public.d.ts +0 -1
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
declare const aggregationTypes: readonly [{
|
|
2
|
+
readonly name: "avg";
|
|
3
|
+
readonly type: "metric";
|
|
4
|
+
readonly isCommonlyFound: true;
|
|
5
|
+
}, {
|
|
6
|
+
readonly name: "cardinality";
|
|
7
|
+
readonly type: "metric";
|
|
8
|
+
readonly isCommonlyFound: true;
|
|
9
|
+
}, {
|
|
10
|
+
readonly name: "max";
|
|
11
|
+
readonly type: "metric";
|
|
12
|
+
readonly isCommonlyFound: true;
|
|
13
|
+
}, {
|
|
14
|
+
readonly name: "min";
|
|
15
|
+
readonly type: "metric";
|
|
16
|
+
readonly isCommonlyFound: true;
|
|
17
|
+
}, {
|
|
18
|
+
readonly name: "percentile_ranks";
|
|
19
|
+
readonly type: "metric";
|
|
20
|
+
readonly isCommonlyFound: false;
|
|
21
|
+
}, {
|
|
22
|
+
readonly name: "percentiles";
|
|
23
|
+
readonly type: "metric";
|
|
24
|
+
readonly isCommonlyFound: false;
|
|
25
|
+
}, {
|
|
26
|
+
readonly name: "stats";
|
|
27
|
+
readonly type: "metric";
|
|
28
|
+
readonly isCommonlyFound: false;
|
|
29
|
+
}, {
|
|
30
|
+
readonly name: "sum";
|
|
31
|
+
readonly type: "metric";
|
|
32
|
+
readonly isCommonlyFound: true;
|
|
33
|
+
}, {
|
|
34
|
+
readonly name: "value_count";
|
|
35
|
+
readonly type: "metric";
|
|
36
|
+
readonly isCommonlyFound: false;
|
|
37
|
+
}, {
|
|
38
|
+
readonly name: "adjacency_matrix";
|
|
39
|
+
readonly type: "bucket";
|
|
40
|
+
readonly isCommonlyFound: false;
|
|
41
|
+
}, {
|
|
42
|
+
readonly name: "auto_date_histogram";
|
|
43
|
+
readonly type: "bucket";
|
|
44
|
+
readonly isCommonlyFound: false;
|
|
45
|
+
}, {
|
|
46
|
+
readonly name: "date_histogram";
|
|
47
|
+
readonly type: "bucket";
|
|
48
|
+
readonly isCommonlyFound: true;
|
|
49
|
+
}, {
|
|
50
|
+
readonly name: "diversified_sampler";
|
|
51
|
+
readonly type: "bucket";
|
|
52
|
+
readonly isCommonlyFound: false;
|
|
53
|
+
}, {
|
|
54
|
+
readonly name: "filters";
|
|
55
|
+
readonly type: "bucket";
|
|
56
|
+
readonly isCommonlyFound: false;
|
|
57
|
+
}, {
|
|
58
|
+
readonly name: "geo_grid";
|
|
59
|
+
readonly type: "bucket";
|
|
60
|
+
readonly isCommonlyFound: false;
|
|
61
|
+
}, {
|
|
62
|
+
readonly name: "histogram";
|
|
63
|
+
readonly type: "bucket";
|
|
64
|
+
readonly isCommonlyFound: false;
|
|
65
|
+
}, {
|
|
66
|
+
readonly name: "range";
|
|
67
|
+
readonly type: "bucket";
|
|
68
|
+
readonly isCommonlyFound: false;
|
|
69
|
+
}, {
|
|
70
|
+
readonly name: "sampler";
|
|
71
|
+
readonly type: "bucket";
|
|
72
|
+
readonly isCommonlyFound: false;
|
|
73
|
+
}, {
|
|
74
|
+
readonly name: "significant_terms";
|
|
75
|
+
readonly type: "bucket";
|
|
76
|
+
readonly isCommonlyFound: false;
|
|
77
|
+
}, {
|
|
78
|
+
readonly name: "terms";
|
|
79
|
+
readonly type: "bucket";
|
|
80
|
+
readonly isCommonlyFound: true;
|
|
81
|
+
}, {
|
|
82
|
+
readonly name: "top_hits";
|
|
83
|
+
readonly type: "bucket";
|
|
84
|
+
readonly isCommonlyFound: false;
|
|
85
|
+
}, {
|
|
86
|
+
readonly name: "variable_width_histogram";
|
|
87
|
+
readonly type: "bucket";
|
|
88
|
+
readonly isCommonlyFound: false;
|
|
89
|
+
}];
|
|
90
|
+
type AggregationName = typeof aggregationTypes[number]['name'];
|
|
91
|
+
type AggregationType = typeof aggregationTypes[number]['type'];
|
|
92
|
+
declare function isAggregationName(name: string): name is AggregationName;
|
|
93
|
+
|
|
94
|
+
type FigureRawAggregation = {
|
|
95
|
+
raw: Record<string, any>;
|
|
96
|
+
};
|
|
97
|
+
type FigureBaseAggregation = {
|
|
98
|
+
type: AggregationName;
|
|
99
|
+
field: string;
|
|
100
|
+
size?: number;
|
|
101
|
+
missing?: string;
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Type for aggregations used in figures, when fetching data
|
|
105
|
+
*/
|
|
106
|
+
type FigureAggregation = FigureBaseAggregation | FigureRawAggregation;
|
|
107
|
+
declare function isRawAggregation(agg: FigureAggregation): agg is FigureRawAggregation;
|
|
108
|
+
|
|
109
|
+
export { type AggregationName, type AggregationType, type FigureAggregation, type FigureBaseAggregation, type FigureRawAggregation, aggregationTypes, isAggregationName, isRawAggregation };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=[{name:"avg",type:"metric",isCommonlyFound:!0},{name:"cardinality",type:"metric",isCommonlyFound:!0},{name:"max",type:"metric",isCommonlyFound:!0},{name:"min",type:"metric",isCommonlyFound:!0},{name:"percentile_ranks",type:"metric",isCommonlyFound:!1},{name:"percentiles",type:"metric",isCommonlyFound:!1},{name:"stats",type:"metric",isCommonlyFound:!1},{name:"sum",type:"metric",isCommonlyFound:!0},{name:"value_count",type:"metric",isCommonlyFound:!1},{name:"adjacency_matrix",type:"bucket",isCommonlyFound:!1},{name:"auto_date_histogram",type:"bucket",isCommonlyFound:!1},{name:"date_histogram",type:"bucket",isCommonlyFound:!0},{name:"diversified_sampler",type:"bucket",isCommonlyFound:!1},{name:"filters",type:"bucket",isCommonlyFound:!1},{name:"geo_grid",type:"bucket",isCommonlyFound:!1},{name:"histogram",type:"bucket",isCommonlyFound:!1},{name:"range",type:"bucket",isCommonlyFound:!1},{name:"sampler",type:"bucket",isCommonlyFound:!1},{name:"significant_terms",type:"bucket",isCommonlyFound:!1},{name:"terms",type:"bucket",isCommonlyFound:!0},{name:"top_hits",type:"bucket",isCommonlyFound:!1},{name:"variable_width_histogram",type:"bucket",isCommonlyFound:!1}];function t(e){return n.some(m=>m.name===e)}function o(e){return"raw"in e}exports.aggregationTypes=n;exports.isAggregationName=t;exports.isRawAggregation=o;
|
|
2
|
+
//# sourceMappingURL=aggregations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregations.js","sources":["../../src/helpers/templates/editor/aggregations/types.ts","../../src/helpers/templates/editor/aggregations/index.ts"],"sourcesContent":["export const aggregationTypes = [\n { name: 'avg', type: 'metric', isCommonlyFound: true },\n { name: 'cardinality', type: 'metric', isCommonlyFound: true },\n { name: 'max', type: 'metric', isCommonlyFound: true },\n { name: 'min', type: 'metric', isCommonlyFound: true },\n { name: 'percentile_ranks', type: 'metric', isCommonlyFound: false },\n { name: 'percentiles', type: 'metric', isCommonlyFound: false },\n { name: 'stats', type: 'metric', isCommonlyFound: false },\n { name: 'sum', type: 'metric', isCommonlyFound: true },\n { name: 'value_count', type: 'metric', isCommonlyFound: false },\n\n // { name: 'cumulative_sum', type: 'pipeline', isCommonlyFound: false },\n // { name: 'derivative', type: 'pipeline', isCommonlyFound: false },\n // { name: 'max_bucket', type: 'pipeline', isCommonlyFound: false },\n // { name: 'min_bucket', type: 'pipeline', isCommonlyFound: false },\n // { name: 'moving_average', type: 'pipeline', isCommonlyFound: false },\n // { name: 'sum_bucket', type: 'pipeline', isCommonlyFound: false },\n\n { name: 'adjacency_matrix', type: 'bucket', isCommonlyFound: false },\n { name: 'auto_date_histogram', type: 'bucket', isCommonlyFound: false },\n { name: 'date_histogram', type: 'bucket', isCommonlyFound: true },\n { name: 'diversified_sampler', type: 'bucket', isCommonlyFound: false },\n { name: 'filters', type: 'bucket', isCommonlyFound: false },\n { name: 'geo_grid', type: 'bucket', isCommonlyFound: false },\n { name: 'histogram', type: 'bucket', isCommonlyFound: false },\n { name: 'range', type: 'bucket', isCommonlyFound: false },\n { name: 'sampler', type: 'bucket', isCommonlyFound: false },\n { name: 'significant_terms', type: 'bucket', isCommonlyFound: false },\n { name: 'terms', type: 'bucket', isCommonlyFound: true },\n { name: 'top_hits', type: 'bucket', isCommonlyFound: false },\n { name: 'variable_width_histogram', type: 'bucket', isCommonlyFound: false },\n] as const;\n\nexport type AggregationName = typeof aggregationTypes[number]['name'];\nexport type AggregationType = typeof aggregationTypes[number]['type'];\n\nexport function isAggregationName(name: string): name is AggregationName {\n return aggregationTypes.some((agg) => agg.name === name);\n}\n","import type { AggregationName } from './types';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type FigureRawAggregation = { raw: Record<string, any> };\n\nexport type FigureBaseAggregation = {\n type: AggregationName;\n field: string;\n size?: number;\n missing?: string\n};\n\n/**\n * Type for aggregations used in figures, when fetching data\n */\nexport type FigureAggregation = FigureBaseAggregation | FigureRawAggregation;\n\nexport function isRawAggregation(agg: FigureAggregation): agg is FigureRawAggregation {\n return 'raw' in agg;\n}\n\nexport * from './types';\n"],"names":["aggregationTypes","isAggregationName","name","agg","isRawAggregation"],"mappings":"gFAAO,MAAMA,EAAmB,CAC9B,CAAE,KAAM,MAAO,KAAM,SAAU,gBAAiB,EAAK,EACrD,CAAE,KAAM,cAAe,KAAM,SAAU,gBAAiB,EAAK,EAC7D,CAAE,KAAM,MAAO,KAAM,SAAU,gBAAiB,EAAK,EACrD,CAAE,KAAM,MAAO,KAAM,SAAU,gBAAiB,EAAK,EACrD,CAAE,KAAM,mBAAoB,KAAM,SAAU,gBAAiB,EAAM,EACnE,CAAE,KAAM,cAAe,KAAM,SAAU,gBAAiB,EAAM,EAC9D,CAAE,KAAM,QAAS,KAAM,SAAU,gBAAiB,EAAM,EACxD,CAAE,KAAM,MAAO,KAAM,SAAU,gBAAiB,EAAK,EACrD,CAAE,KAAM,cAAe,KAAM,SAAU,gBAAiB,EAAM,EAS9D,CAAE,KAAM,mBAAoB,KAAM,SAAU,gBAAiB,EAAM,EACnE,CAAE,KAAM,sBAAuB,KAAM,SAAU,gBAAiB,EAAM,EACtE,CAAE,KAAM,iBAAkB,KAAM,SAAU,gBAAiB,EAAK,EAChE,CAAE,KAAM,sBAAuB,KAAM,SAAU,gBAAiB,EAAM,EACtE,CAAE,KAAM,UAAW,KAAM,SAAU,gBAAiB,EAAM,EAC1D,CAAE,KAAM,WAAY,KAAM,SAAU,gBAAiB,EAAM,EAC3D,CAAE,KAAM,YAAa,KAAM,SAAU,gBAAiB,EAAM,EAC5D,CAAE,KAAM,QAAS,KAAM,SAAU,gBAAiB,EAAM,EACxD,CAAE,KAAM,UAAW,KAAM,SAAU,gBAAiB,EAAM,EAC1D,CAAE,KAAM,oBAAqB,KAAM,SAAU,gBAAiB,EAAM,EACpE,CAAE,KAAM,QAAS,KAAM,SAAU,gBAAiB,EAAK,EACvD,CAAE,KAAM,WAAY,KAAM,SAAU,gBAAiB,EAAM,EAC3D,CAAE,KAAM,2BAA4B,KAAM,SAAU,gBAAiB,EAAM,CAC7E,EAKO,SAASC,EAAkBC,EAAuC,CACvE,OAAOF,EAAiB,KAAMG,GAAQA,EAAI,OAASD,CAAI,CACzD,CCrBO,SAASE,EAAiBD,EAAqD,CACpF,MAAO,QAASA,CAClB"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const n = [
|
|
2
|
+
{ name: "avg", type: "metric", isCommonlyFound: !0 },
|
|
3
|
+
{ name: "cardinality", type: "metric", isCommonlyFound: !0 },
|
|
4
|
+
{ name: "max", type: "metric", isCommonlyFound: !0 },
|
|
5
|
+
{ name: "min", type: "metric", isCommonlyFound: !0 },
|
|
6
|
+
{ name: "percentile_ranks", type: "metric", isCommonlyFound: !1 },
|
|
7
|
+
{ name: "percentiles", type: "metric", isCommonlyFound: !1 },
|
|
8
|
+
{ name: "stats", type: "metric", isCommonlyFound: !1 },
|
|
9
|
+
{ name: "sum", type: "metric", isCommonlyFound: !0 },
|
|
10
|
+
{ name: "value_count", type: "metric", isCommonlyFound: !1 },
|
|
11
|
+
// { name: 'cumulative_sum', type: 'pipeline', isCommonlyFound: false },
|
|
12
|
+
// { name: 'derivative', type: 'pipeline', isCommonlyFound: false },
|
|
13
|
+
// { name: 'max_bucket', type: 'pipeline', isCommonlyFound: false },
|
|
14
|
+
// { name: 'min_bucket', type: 'pipeline', isCommonlyFound: false },
|
|
15
|
+
// { name: 'moving_average', type: 'pipeline', isCommonlyFound: false },
|
|
16
|
+
// { name: 'sum_bucket', type: 'pipeline', isCommonlyFound: false },
|
|
17
|
+
{ name: "adjacency_matrix", type: "bucket", isCommonlyFound: !1 },
|
|
18
|
+
{ name: "auto_date_histogram", type: "bucket", isCommonlyFound: !1 },
|
|
19
|
+
{ name: "date_histogram", type: "bucket", isCommonlyFound: !0 },
|
|
20
|
+
{ name: "diversified_sampler", type: "bucket", isCommonlyFound: !1 },
|
|
21
|
+
{ name: "filters", type: "bucket", isCommonlyFound: !1 },
|
|
22
|
+
{ name: "geo_grid", type: "bucket", isCommonlyFound: !1 },
|
|
23
|
+
{ name: "histogram", type: "bucket", isCommonlyFound: !1 },
|
|
24
|
+
{ name: "range", type: "bucket", isCommonlyFound: !1 },
|
|
25
|
+
{ name: "sampler", type: "bucket", isCommonlyFound: !1 },
|
|
26
|
+
{ name: "significant_terms", type: "bucket", isCommonlyFound: !1 },
|
|
27
|
+
{ name: "terms", type: "bucket", isCommonlyFound: !0 },
|
|
28
|
+
{ name: "top_hits", type: "bucket", isCommonlyFound: !1 },
|
|
29
|
+
{ name: "variable_width_histogram", type: "bucket", isCommonlyFound: !1 }
|
|
30
|
+
];
|
|
31
|
+
function o(e) {
|
|
32
|
+
return n.some((m) => m.name === e);
|
|
33
|
+
}
|
|
34
|
+
function t(e) {
|
|
35
|
+
return "raw" in e;
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
n as aggregationTypes,
|
|
39
|
+
o as isAggregationName,
|
|
40
|
+
t as isRawAggregation
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=aggregations.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregations.mjs","sources":["../../src/helpers/templates/editor/aggregations/types.ts","../../src/helpers/templates/editor/aggregations/index.ts"],"sourcesContent":["export const aggregationTypes = [\n { name: 'avg', type: 'metric', isCommonlyFound: true },\n { name: 'cardinality', type: 'metric', isCommonlyFound: true },\n { name: 'max', type: 'metric', isCommonlyFound: true },\n { name: 'min', type: 'metric', isCommonlyFound: true },\n { name: 'percentile_ranks', type: 'metric', isCommonlyFound: false },\n { name: 'percentiles', type: 'metric', isCommonlyFound: false },\n { name: 'stats', type: 'metric', isCommonlyFound: false },\n { name: 'sum', type: 'metric', isCommonlyFound: true },\n { name: 'value_count', type: 'metric', isCommonlyFound: false },\n\n // { name: 'cumulative_sum', type: 'pipeline', isCommonlyFound: false },\n // { name: 'derivative', type: 'pipeline', isCommonlyFound: false },\n // { name: 'max_bucket', type: 'pipeline', isCommonlyFound: false },\n // { name: 'min_bucket', type: 'pipeline', isCommonlyFound: false },\n // { name: 'moving_average', type: 'pipeline', isCommonlyFound: false },\n // { name: 'sum_bucket', type: 'pipeline', isCommonlyFound: false },\n\n { name: 'adjacency_matrix', type: 'bucket', isCommonlyFound: false },\n { name: 'auto_date_histogram', type: 'bucket', isCommonlyFound: false },\n { name: 'date_histogram', type: 'bucket', isCommonlyFound: true },\n { name: 'diversified_sampler', type: 'bucket', isCommonlyFound: false },\n { name: 'filters', type: 'bucket', isCommonlyFound: false },\n { name: 'geo_grid', type: 'bucket', isCommonlyFound: false },\n { name: 'histogram', type: 'bucket', isCommonlyFound: false },\n { name: 'range', type: 'bucket', isCommonlyFound: false },\n { name: 'sampler', type: 'bucket', isCommonlyFound: false },\n { name: 'significant_terms', type: 'bucket', isCommonlyFound: false },\n { name: 'terms', type: 'bucket', isCommonlyFound: true },\n { name: 'top_hits', type: 'bucket', isCommonlyFound: false },\n { name: 'variable_width_histogram', type: 'bucket', isCommonlyFound: false },\n] as const;\n\nexport type AggregationName = typeof aggregationTypes[number]['name'];\nexport type AggregationType = typeof aggregationTypes[number]['type'];\n\nexport function isAggregationName(name: string): name is AggregationName {\n return aggregationTypes.some((agg) => agg.name === name);\n}\n","import type { AggregationName } from './types';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type FigureRawAggregation = { raw: Record<string, any> };\n\nexport type FigureBaseAggregation = {\n type: AggregationName;\n field: string;\n size?: number;\n missing?: string\n};\n\n/**\n * Type for aggregations used in figures, when fetching data\n */\nexport type FigureAggregation = FigureBaseAggregation | FigureRawAggregation;\n\nexport function isRawAggregation(agg: FigureAggregation): agg is FigureRawAggregation {\n return 'raw' in agg;\n}\n\nexport * from './types';\n"],"names":["aggregationTypes","isAggregationName","name","agg","isRawAggregation"],"mappings":"AAAO,MAAMA,IAAmB;AAAA,EAC9B,EAAE,MAAM,OAAO,MAAM,UAAU,iBAAiB,GAAK;AAAA,EACrD,EAAE,MAAM,eAAe,MAAM,UAAU,iBAAiB,GAAK;AAAA,EAC7D,EAAE,MAAM,OAAO,MAAM,UAAU,iBAAiB,GAAK;AAAA,EACrD,EAAE,MAAM,OAAO,MAAM,UAAU,iBAAiB,GAAK;AAAA,EACrD,EAAE,MAAM,oBAAoB,MAAM,UAAU,iBAAiB,GAAM;AAAA,EACnE,EAAE,MAAM,eAAe,MAAM,UAAU,iBAAiB,GAAM;AAAA,EAC9D,EAAE,MAAM,SAAS,MAAM,UAAU,iBAAiB,GAAM;AAAA,EACxD,EAAE,MAAM,OAAO,MAAM,UAAU,iBAAiB,GAAK;AAAA,EACrD,EAAE,MAAM,eAAe,MAAM,UAAU,iBAAiB,GAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAS9D,EAAE,MAAM,oBAAoB,MAAM,UAAU,iBAAiB,GAAM;AAAA,EACnE,EAAE,MAAM,uBAAuB,MAAM,UAAU,iBAAiB,GAAM;AAAA,EACtE,EAAE,MAAM,kBAAkB,MAAM,UAAU,iBAAiB,GAAK;AAAA,EAChE,EAAE,MAAM,uBAAuB,MAAM,UAAU,iBAAiB,GAAM;AAAA,EACtE,EAAE,MAAM,WAAW,MAAM,UAAU,iBAAiB,GAAM;AAAA,EAC1D,EAAE,MAAM,YAAY,MAAM,UAAU,iBAAiB,GAAM;AAAA,EAC3D,EAAE,MAAM,aAAa,MAAM,UAAU,iBAAiB,GAAM;AAAA,EAC5D,EAAE,MAAM,SAAS,MAAM,UAAU,iBAAiB,GAAM;AAAA,EACxD,EAAE,MAAM,WAAW,MAAM,UAAU,iBAAiB,GAAM;AAAA,EAC1D,EAAE,MAAM,qBAAqB,MAAM,UAAU,iBAAiB,GAAM;AAAA,EACpE,EAAE,MAAM,SAAS,MAAM,UAAU,iBAAiB,GAAK;AAAA,EACvD,EAAE,MAAM,YAAY,MAAM,UAAU,iBAAiB,GAAM;AAAA,EAC3D,EAAE,MAAM,4BAA4B,MAAM,UAAU,iBAAiB,GAAM;AAC7E;AAKO,SAASC,EAAkBC,GAAuC;AACvE,SAAOF,EAAiB,KAAK,CAACG,MAAQA,EAAI,SAASD,CAAI;AACzD;ACrBO,SAASE,EAAiBD,GAAqD;AACpF,SAAO,SAASA;AAClB;"}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { c as TemplateFilter, d as TemplateBodyFigure } from '../types-DcoMmjs3.js';
|
|
2
|
+
import { FigureAggregation } from './aggregations.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Type for orders used in figures, when sorting data
|
|
6
|
+
* `false` means no sort, `true` means using the default sort
|
|
7
|
+
*/
|
|
8
|
+
type FigureOrder = boolean | 'asc' | 'desc';
|
|
9
|
+
|
|
10
|
+
interface FigureHelper {
|
|
11
|
+
readonly id: string;
|
|
12
|
+
readonly type: string;
|
|
13
|
+
params: Record<string, any>;
|
|
14
|
+
slots: Set<number>;
|
|
15
|
+
readonly hash: string;
|
|
16
|
+
}
|
|
17
|
+
interface FigureHelperWithData extends FigureHelper {
|
|
18
|
+
data: string | unknown[];
|
|
19
|
+
}
|
|
20
|
+
interface FigureHelperWithFilters extends FigureHelper {
|
|
21
|
+
filters: Map<string, TemplateFilter>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface MdFigure extends FigureHelperWithData {
|
|
25
|
+
readonly type: 'md';
|
|
26
|
+
data: string;
|
|
27
|
+
readonly params: {};
|
|
28
|
+
}
|
|
29
|
+
declare function createMdFigureHelper(data?: string, slots?: number[]): MdFigure;
|
|
30
|
+
declare function createMdFigureHelperFrom(figure: TemplateBodyFigure): MdFigure;
|
|
31
|
+
declare function mdHelperParamsToJSON(params: MdFigure['params']): TemplateBodyFigure['params'];
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Type for labels used in metrics
|
|
35
|
+
*/
|
|
36
|
+
interface MetricLabel {
|
|
37
|
+
/**
|
|
38
|
+
* The text of the label (rendered under the value)
|
|
39
|
+
*/
|
|
40
|
+
text: string;
|
|
41
|
+
/**
|
|
42
|
+
* The aggregation used to fetch data,
|
|
43
|
+
* if not set, the count of documents will be used
|
|
44
|
+
*/
|
|
45
|
+
aggregation?: FigureAggregation;
|
|
46
|
+
/**
|
|
47
|
+
* Format options used to format the data
|
|
48
|
+
*/
|
|
49
|
+
format?: {
|
|
50
|
+
type: 'date' | 'number';
|
|
51
|
+
params?: string[];
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
interface MetricFigureHelper extends FigureHelperWithFilters {
|
|
55
|
+
readonly type: 'metric';
|
|
56
|
+
params: {
|
|
57
|
+
labels: MetricLabel[];
|
|
58
|
+
order: FigureOrder;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
declare function createMetricFigureHelper(labels?: MetricLabel[], filters?: TemplateFilter[], order?: FigureOrder, slots?: number[]): MetricFigureHelper;
|
|
62
|
+
declare function createMetricFigureHelperFrom(figure: TemplateBodyFigure): MetricFigureHelper;
|
|
63
|
+
declare function metricHelperParamsToJSON(params: MetricFigureHelper['params']): TemplateBodyFigure['params'];
|
|
64
|
+
declare function getMetricLabelKey(label: MetricLabel): string;
|
|
65
|
+
declare function getAllMetricLabelKeysOfHelper(figure: MetricFigureHelper): string[];
|
|
66
|
+
declare function addMetricLabelOfHelper(figure: MetricFigureHelper, element: MetricLabel, index?: number): MetricFigureHelper;
|
|
67
|
+
declare function removeMetricLabelOfHelper(figure: MetricFigureHelper, element: MetricLabel): MetricFigureHelper;
|
|
68
|
+
declare function updateMetricLabelOfHelper(figure: MetricFigureHelper, oldElement: MetricLabel, newElement: MetricLabel): MetricFigureHelper;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Type for columns used in tables
|
|
72
|
+
*/
|
|
73
|
+
type TableColumn = {
|
|
74
|
+
/**
|
|
75
|
+
* The name of the column
|
|
76
|
+
*/
|
|
77
|
+
header: string;
|
|
78
|
+
/**
|
|
79
|
+
* Whether the column is a metric,
|
|
80
|
+
* can only be used once in a table
|
|
81
|
+
*/
|
|
82
|
+
metric?: boolean;
|
|
83
|
+
/**
|
|
84
|
+
* The aggregation used to fetch data,
|
|
85
|
+
* if not set, the "value" of the previous column will be used
|
|
86
|
+
*/
|
|
87
|
+
aggregation?: FigureAggregation;
|
|
88
|
+
/**
|
|
89
|
+
* The style of the cells in this column
|
|
90
|
+
*/
|
|
91
|
+
styles?: {
|
|
92
|
+
fontStyle?: 'normal' | 'bold' | 'italic' | 'bolditalic';
|
|
93
|
+
fillColor?: string | [number, number, number];
|
|
94
|
+
textColor?: string | [number, number, number];
|
|
95
|
+
headerColor?: string | [number, number, number];
|
|
96
|
+
halign?: 'left' | 'center' | 'right' | 'justify';
|
|
97
|
+
valign?: 'top' | 'middle' | 'bottom';
|
|
98
|
+
fontSize?: number;
|
|
99
|
+
lineColor?: string | [number, number, number];
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Type for tables
|
|
104
|
+
*/
|
|
105
|
+
interface TableFigureHelper extends FigureHelperWithFilters {
|
|
106
|
+
readonly type: 'table';
|
|
107
|
+
params: {
|
|
108
|
+
title: string;
|
|
109
|
+
columns: TableColumn[];
|
|
110
|
+
total?: boolean;
|
|
111
|
+
order?: FigureOrder;
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
declare function createTableFigureHelper(title?: string, columns?: TableColumn[], total?: boolean, filters?: TemplateFilter[], order?: FigureOrder, slots?: number[]): TableFigureHelper;
|
|
115
|
+
declare function createTableFigureHelperFrom(figure: TemplateBodyFigure): TableFigureHelper;
|
|
116
|
+
declare function tableHelperParamsToJSON(params: TableFigureHelper['params']): TemplateBodyFigure['params'];
|
|
117
|
+
declare function getTableColumnKey(column: TableColumn): string;
|
|
118
|
+
declare function getAllTableColumnKeysOfHelper(figure: TableFigureHelper): string[];
|
|
119
|
+
declare function addTableColumnOfHelper(figure: TableFigureHelper, element: TableColumn, index?: number): TableFigureHelper;
|
|
120
|
+
declare function removeTableColumnOfHelper(figure: TableFigureHelper, element: TableColumn): TableFigureHelper;
|
|
121
|
+
declare function updateTableColumnOfHelper(figure: TableFigureHelper, oldElement: TableColumn, newElement: TableColumn): TableFigureHelper;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Type for layers used in vega
|
|
125
|
+
*/
|
|
126
|
+
interface VegaLayer extends Record<string, unknown> {
|
|
127
|
+
/**
|
|
128
|
+
* The aggregation used to fetch data,
|
|
129
|
+
* if not set, the "value" of the label (or color if present) layer will be used
|
|
130
|
+
*/
|
|
131
|
+
aggregation?: FigureAggregation;
|
|
132
|
+
/**
|
|
133
|
+
* The title of the axis
|
|
134
|
+
*/
|
|
135
|
+
title?: string;
|
|
136
|
+
/**
|
|
137
|
+
* The legend, if `null` no legend will be shown
|
|
138
|
+
*/
|
|
139
|
+
legend?: null | {
|
|
140
|
+
title?: string;
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Type for data label options
|
|
145
|
+
*/
|
|
146
|
+
interface VegaDataLabelOptions {
|
|
147
|
+
format: 'percent' | 'numeric';
|
|
148
|
+
position?: 'out' | 'in';
|
|
149
|
+
showLabel?: boolean;
|
|
150
|
+
minValue?: number;
|
|
151
|
+
}
|
|
152
|
+
interface VegaFigureHelper extends FigureHelperWithFilters {
|
|
153
|
+
params: {
|
|
154
|
+
/**
|
|
155
|
+
* The title of the figure
|
|
156
|
+
*/
|
|
157
|
+
title: string;
|
|
158
|
+
/**
|
|
159
|
+
* Whether the axis should be inverted
|
|
160
|
+
*/
|
|
161
|
+
invertAxis?: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* The label layer of the figure, often used for the x axis
|
|
164
|
+
*/
|
|
165
|
+
label: VegaLayer;
|
|
166
|
+
/**
|
|
167
|
+
* The value layer of the figure, often used for the y axis
|
|
168
|
+
*/
|
|
169
|
+
value: VegaLayer;
|
|
170
|
+
/**
|
|
171
|
+
* The color layer of the figure, often used for splitting the value
|
|
172
|
+
*/
|
|
173
|
+
color?: VegaLayer;
|
|
174
|
+
/**
|
|
175
|
+
* The data label options
|
|
176
|
+
*
|
|
177
|
+
* Data labels are displayed on top of the value layer, and show details about values
|
|
178
|
+
*/
|
|
179
|
+
dataLabel?: VegaDataLabelOptions;
|
|
180
|
+
/**
|
|
181
|
+
* The order of the data in the chart
|
|
182
|
+
*/
|
|
183
|
+
order?: FigureOrder;
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
declare function createVegaFigureHelper(type: string, title?: string, label?: VegaLayer, value?: VegaLayer, color?: VegaLayer, dataLabel?: VegaDataLabelOptions, invertAxis?: boolean, filters?: TemplateFilter[], order?: FigureOrder, slots?: number[]): VegaFigureHelper;
|
|
187
|
+
declare function createVegaFigureHelperFrom(figure: TemplateBodyFigure): VegaFigureHelper;
|
|
188
|
+
declare function vegaHelperParamsToJSON(params: VegaFigureHelper['params']): TemplateBodyFigure['params'];
|
|
189
|
+
|
|
190
|
+
type AnyFigureHelper = MdFigure | MetricFigureHelper | TableFigureHelper | VegaFigureHelper;
|
|
191
|
+
type FigureHelperSet = Map<string, AnyFigureHelper>;
|
|
192
|
+
/**
|
|
193
|
+
* Create a figure helper
|
|
194
|
+
*
|
|
195
|
+
* @param figure The figure object
|
|
196
|
+
*
|
|
197
|
+
* @returns The figure helper
|
|
198
|
+
*/
|
|
199
|
+
declare function createFigureHelper(type: AnyFigureHelper['type'], filters?: TemplateFilter[], order?: FigureOrder, slots?: number[]): AnyFigureHelper;
|
|
200
|
+
/**
|
|
201
|
+
* Create a figure helper from a figure object
|
|
202
|
+
*
|
|
203
|
+
* @param figure The figure object
|
|
204
|
+
*
|
|
205
|
+
* @returns The figure helper
|
|
206
|
+
*/
|
|
207
|
+
declare function createFigureHelperFrom(figure: TemplateBodyFigure): AnyFigureHelper;
|
|
208
|
+
/**
|
|
209
|
+
* Create a figure object from a figure helper
|
|
210
|
+
*
|
|
211
|
+
* @param figure The figure helper
|
|
212
|
+
*
|
|
213
|
+
* @returns The figure object
|
|
214
|
+
*/
|
|
215
|
+
declare function figureHelperToJSON(figure: AnyFigureHelper): TemplateBodyFigure;
|
|
216
|
+
declare function isFigureHelperMarkdown(figure: AnyFigureHelper): figure is MdFigure;
|
|
217
|
+
declare function isFigureHelperMetric(figure: AnyFigureHelper): figure is MetricFigureHelper;
|
|
218
|
+
declare function isFigureHelperTable(figure: AnyFigureHelper): figure is TableFigureHelper;
|
|
219
|
+
declare function isFigureHelperVega(figure: AnyFigureHelper): figure is VegaFigureHelper;
|
|
220
|
+
|
|
221
|
+
export { type AnyFigureHelper, type FigureHelperSet, type FigureOrder, type MdFigure, type MetricFigureHelper, type MetricLabel, type TableColumn, type TableFigureHelper, type VegaDataLabelOptions, type VegaFigureHelper, type VegaLayer, addMetricLabelOfHelper, addTableColumnOfHelper, createFigureHelper, createFigureHelperFrom, createMdFigureHelper, createMdFigureHelperFrom, createMetricFigureHelper, createMetricFigureHelperFrom, createTableFigureHelper, createTableFigureHelperFrom, createVegaFigureHelper, createVegaFigureHelperFrom, figureHelperToJSON, getAllMetricLabelKeysOfHelper, getAllTableColumnKeysOfHelper, getMetricLabelKey, getTableColumnKey, isFigureHelperMarkdown, isFigureHelperMetric, isFigureHelperTable, isFigureHelperVega, mdHelperParamsToJSON, metricHelperParamsToJSON, removeMetricLabelOfHelper, removeTableColumnOfHelper, tableHelperParamsToJSON, updateMetricLabelOfHelper, updateTableColumnOfHelper, vegaHelperParamsToJSON };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../index-btsFMVmd.js");exports.addMetricLabelOfHelper=e.addMetricLabelOfHelper;exports.addTableColumnOfHelper=e.addTableColumnOfHelper;exports.createFigureHelper=e.createFigureHelper;exports.createFigureHelperFrom=e.createFigureHelperFrom;exports.createMdFigureHelper=e.createMdFigureHelper;exports.createMdFigureHelperFrom=e.createMdFigureHelperFrom;exports.createMetricFigureHelper=e.createMetricFigureHelper;exports.createMetricFigureHelperFrom=e.createMetricFigureHelperFrom;exports.createTableFigureHelper=e.createTableFigureHelper;exports.createTableFigureHelperFrom=e.createTableFigureHelperFrom;exports.createVegaFigureHelper=e.createVegaFigureHelper;exports.createVegaFigureHelperFrom=e.createVegaFigureHelperFrom;exports.figureHelperToJSON=e.figureHelperToJSON;exports.getAllMetricLabelKeysOfHelper=e.getAllMetricLabelKeysOfHelper;exports.getAllTableColumnKeysOfHelper=e.getAllTableColumnKeysOfHelper;exports.getMetricLabelKey=e.getMetricLabelKey;exports.getTableColumnKey=e.getTableColumnKey;exports.isFigureHelperMarkdown=e.isFigureHelperMarkdown;exports.isFigureHelperMetric=e.isFigureHelperMetric;exports.isFigureHelperTable=e.isFigureHelperTable;exports.isFigureHelperVega=e.isFigureHelperVega;exports.mdHelperParamsToJSON=e.mdHelperParamsToJSON;exports.metricHelperParamsToJSON=e.metricHelperParamsToJSON;exports.removeMetricLabelOfHelper=e.removeMetricLabelOfHelper;exports.removeTableColumnOfHelper=e.removeTableColumnOfHelper;exports.tableHelperParamsToJSON=e.tableHelperParamsToJSON;exports.updateMetricLabelOfHelper=e.updateMetricLabelOfHelper;exports.updateTableColumnOfHelper=e.updateTableColumnOfHelper;exports.vegaHelperParamsToJSON=e.vegaHelperParamsToJSON;
|
|
2
|
+
//# sourceMappingURL=figures.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"figures.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { q as a, y as l, a as s, c as p, g as i, h as t, j as H, k as g, s as u, t as o, B as c, C as m, f as F, p as b, x as O, o as T, w as d, i as f, b as M, d as n, e as C, m as y, l as J, r as L, z as N, v as S, u as v, A as K, D as P } from "../index-niBfS4wD.mjs";
|
|
2
|
+
export {
|
|
3
|
+
a as addMetricLabelOfHelper,
|
|
4
|
+
l as addTableColumnOfHelper,
|
|
5
|
+
s as createFigureHelper,
|
|
6
|
+
p as createFigureHelperFrom,
|
|
7
|
+
i as createMdFigureHelper,
|
|
8
|
+
t as createMdFigureHelperFrom,
|
|
9
|
+
H as createMetricFigureHelper,
|
|
10
|
+
g as createMetricFigureHelperFrom,
|
|
11
|
+
u as createTableFigureHelper,
|
|
12
|
+
o as createTableFigureHelperFrom,
|
|
13
|
+
c as createVegaFigureHelper,
|
|
14
|
+
m as createVegaFigureHelperFrom,
|
|
15
|
+
F as figureHelperToJSON,
|
|
16
|
+
b as getAllMetricLabelKeysOfHelper,
|
|
17
|
+
O as getAllTableColumnKeysOfHelper,
|
|
18
|
+
T as getMetricLabelKey,
|
|
19
|
+
d as getTableColumnKey,
|
|
20
|
+
f as isFigureHelperMarkdown,
|
|
21
|
+
M as isFigureHelperMetric,
|
|
22
|
+
n as isFigureHelperTable,
|
|
23
|
+
C as isFigureHelperVega,
|
|
24
|
+
y as mdHelperParamsToJSON,
|
|
25
|
+
J as metricHelperParamsToJSON,
|
|
26
|
+
L as removeMetricLabelOfHelper,
|
|
27
|
+
N as removeTableColumnOfHelper,
|
|
28
|
+
S as tableHelperParamsToJSON,
|
|
29
|
+
v as updateMetricLabelOfHelper,
|
|
30
|
+
K as updateTableColumnOfHelper,
|
|
31
|
+
P as vegaHelperParamsToJSON
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=figures.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"figures.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { c as TemplateFilter, b as TemplateRawFilter } from '../types-DcoMmjs3.js';
|
|
2
|
+
export { a as TemplateBasicFilter } from '../types-DcoMmjs3.js';
|
|
3
|
+
|
|
4
|
+
type TemplateFilterMap = Map<string, TemplateFilter>;
|
|
5
|
+
type AnyFilter = TemplateFilter;
|
|
6
|
+
declare function isRawFilter(filter: AnyFilter): filter is TemplateRawFilter;
|
|
7
|
+
|
|
8
|
+
export { TemplateFilter, type TemplateFilterMap, TemplateRawFilter, isRawFilter };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filters.js","sources":["../../src/helpers/templates/editor/filters/index.ts"],"sourcesContent":["import type { TemplateBasicFilter, TemplateRawFilter, TemplateFilter } from '~/modules/templates';\n\ntype TemplateFilterMap = Map<string, TemplateFilter>;\n\ntype AnyFilter = TemplateFilter;\n\nfunction isRawFilter(filter: AnyFilter): filter is TemplateRawFilter {\n return 'raw' in filter && filter.raw !== undefined;\n}\n\nexport {\n type TemplateBasicFilter,\n type TemplateRawFilter,\n type TemplateFilterMap,\n type TemplateFilter,\n isRawFilter,\n};\n"],"names":["isRawFilter","filter"],"mappings":"gFAMA,SAASA,EAAYC,EAAgD,CAC5D,MAAA,QAASA,GAAUA,EAAO,MAAQ,MAC3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filters.mjs","sources":["../../src/helpers/templates/editor/filters/index.ts"],"sourcesContent":["import type { TemplateBasicFilter, TemplateRawFilter, TemplateFilter } from '~/modules/templates';\n\ntype TemplateFilterMap = Map<string, TemplateFilter>;\n\ntype AnyFilter = TemplateFilter;\n\nfunction isRawFilter(filter: AnyFilter): filter is TemplateRawFilter {\n return 'raw' in filter && filter.raw !== undefined;\n}\n\nexport {\n type TemplateBasicFilter,\n type TemplateRawFilter,\n type TemplateFilterMap,\n type TemplateFilter,\n isRawFilter,\n};\n"],"names":["isRawFilter","filter"],"mappings":"AAMA,SAASA,EAAYC,GAAgD;AAC5D,SAAA,SAASA,KAAUA,EAAO,QAAQ;AAC3C;"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { A as ApiRequestOptions } from '../api-C_g0ldUn.js';
|
|
2
|
+
import { R as ReportResult, f as RawReportResult } from '../types-jXqGnCKQ.js';
|
|
3
|
+
import { T as Task } from '../types-y2f9Jb4M.js';
|
|
4
|
+
import { J as Job, G as GenerationData, M as MailData, a as MailError, P as PaginatedJobs, b as JobStatus } from '../index-CWHjM0a3.js';
|
|
5
|
+
import '../namespaces.js';
|
|
6
|
+
import '../types-DcoMmjs3.js';
|
|
7
|
+
|
|
8
|
+
interface EventfulListener<E extends Record<string, any[]>> {
|
|
9
|
+
on: <P extends keyof E>(eventName: P, listener: (...args: E[P]) => void) => this;
|
|
10
|
+
once: <P extends keyof E>(eventName: P, listener: (...args: E[P]) => void) => this;
|
|
11
|
+
off: <P extends keyof E>(eventName: P, listener: (...args: E[P]) => void) => this;
|
|
12
|
+
}
|
|
13
|
+
type EventfulPromise<T, E extends Record<string, any[]>> = Promise<T> & EventfulListener<E>;
|
|
14
|
+
|
|
15
|
+
type GenerationJob = Job<GenerationData, {
|
|
16
|
+
success: boolean;
|
|
17
|
+
}>;
|
|
18
|
+
type GenerationJobWithResult = Job<GenerationData, ReportResult>;
|
|
19
|
+
type MailJob = Job<MailData | MailError, {}>;
|
|
20
|
+
declare const isErrorMailJob: (job: MailJob) => job is Job<MailError, {}>;
|
|
21
|
+
declare const isDataMailJob: (job: MailJob) => job is Job<MailData, {}>;
|
|
22
|
+
type PaginatedGenerationJobs = PaginatedJobs<GenerationData, {
|
|
23
|
+
success: boolean;
|
|
24
|
+
}>;
|
|
25
|
+
/**
|
|
26
|
+
* Get jobs of the generation queue
|
|
27
|
+
*
|
|
28
|
+
* @returns jobs in queue
|
|
29
|
+
*/
|
|
30
|
+
declare function getGenerationJobs(opts?: ApiRequestOptions): Promise<PaginatedGenerationJobs>;
|
|
31
|
+
type PaginatedMailJobs = PaginatedJobs<MailData | MailError, {}>;
|
|
32
|
+
/**
|
|
33
|
+
* Get jobs of the mail queue
|
|
34
|
+
*
|
|
35
|
+
* @returns jobs in queue
|
|
36
|
+
*/
|
|
37
|
+
declare function getMailJobs(opts?: ApiRequestOptions): Promise<PaginatedMailJobs>;
|
|
38
|
+
/**
|
|
39
|
+
* Get specific generation job
|
|
40
|
+
*
|
|
41
|
+
* @param queueOrName Queue or queue's name
|
|
42
|
+
* @param jobOrId Job or job's id in queue
|
|
43
|
+
*
|
|
44
|
+
* @returns Job full info
|
|
45
|
+
*/
|
|
46
|
+
declare function getGenerationJob(jobOrId: Job<GenerationData> | string): Promise<GenerationJobWithResult>;
|
|
47
|
+
/**
|
|
48
|
+
* Get specific mail job
|
|
49
|
+
*
|
|
50
|
+
* @param queueOrName Queue or queue's name
|
|
51
|
+
* @param jobOrId Job or job's id in queue
|
|
52
|
+
*
|
|
53
|
+
* @returns Job full info
|
|
54
|
+
*/
|
|
55
|
+
declare function getMailJob(jobOrId: Job<MailData> | string): Promise<MailJob>;
|
|
56
|
+
/**
|
|
57
|
+
* Retry generation job that failed
|
|
58
|
+
*
|
|
59
|
+
* @param queueOrName Queue or queue's name
|
|
60
|
+
* @param jobOrId Job or job's id in queue
|
|
61
|
+
*
|
|
62
|
+
* @returns queue info
|
|
63
|
+
*/
|
|
64
|
+
declare function retryGenerationJob(jobOrId: Job<GenerationData> | string): Promise<Job<GenerationData, RawReportResult>>;
|
|
65
|
+
/**
|
|
66
|
+
* Retry mail job that failed
|
|
67
|
+
*
|
|
68
|
+
* @param queueOrName Queue or queue's name
|
|
69
|
+
* @param jobOrId Job or job's id in queue
|
|
70
|
+
*
|
|
71
|
+
* @returns queue info
|
|
72
|
+
*/
|
|
73
|
+
declare function retryMailJob(jobOrId: Job<MailData | MailError> | string): Promise<MailJob>;
|
|
74
|
+
type GenerationStartedEvent = {
|
|
75
|
+
queue: string;
|
|
76
|
+
jobId: string | number;
|
|
77
|
+
};
|
|
78
|
+
type GenerationProgressEvent = {
|
|
79
|
+
progress: number;
|
|
80
|
+
status: JobStatus;
|
|
81
|
+
};
|
|
82
|
+
type GenerationEvents = {
|
|
83
|
+
'started': [GenerationStartedEvent];
|
|
84
|
+
'progress': [GenerationProgressEvent];
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Start generation of a report and track progress
|
|
88
|
+
*
|
|
89
|
+
* @param taskOrId Task or Task's id
|
|
90
|
+
* @param targets Override targets, also enable first level of debugging
|
|
91
|
+
* @param period Override period, must match task's recurrence
|
|
92
|
+
*
|
|
93
|
+
* @fires #started When generation started. See `GenerationStartedEvent`.
|
|
94
|
+
* @fires #progress When generation progress. See `GenerationProgressEvent`. Job's progress is
|
|
95
|
+
* between 0 and 1
|
|
96
|
+
*
|
|
97
|
+
* @throws If job's fails. **Not if generation fails !**
|
|
98
|
+
*
|
|
99
|
+
* @returns When the report is ready, returns the report result
|
|
100
|
+
*/
|
|
101
|
+
declare function generateAndListenReportOfTask(taskOrId: Omit<Task, 'template'> | string, period?: {
|
|
102
|
+
start: Date;
|
|
103
|
+
end: Date;
|
|
104
|
+
}, targets?: string[], polling?: {
|
|
105
|
+
pending?: number;
|
|
106
|
+
active?: number;
|
|
107
|
+
} | number): EventfulPromise<ReportResult, GenerationEvents>;
|
|
108
|
+
|
|
109
|
+
export { type GenerationJob, type GenerationJobWithResult, type GenerationProgressEvent, type GenerationStartedEvent, type MailJob, type PaginatedMailJobs, generateAndListenReportOfTask, getGenerationJob, getGenerationJobs, getMailJob, getMailJobs, isDataMailJob, isErrorMailJob, retryGenerationJob, retryMailJob };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var Z=Object.defineProperty,ee=Object.defineProperties;var te=Object.getOwnPropertyDescriptors;var b=Object.getOwnPropertySymbols;var A=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var P=(e,t,n)=>t in e?Z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,l=(e,t)=>{for(var n in t||(t={}))A.call(t,n)&&P(e,n,t[n]);if(b)for(var n of b(t))N.call(t,n)&&P(e,n,t[n]);return e},m=(e,t)=>ee(e,te(t));var J=(e,t)=>{var n={};for(var r in e)A.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&b)for(var r of b(e))t.indexOf(r)<0&&N.call(e,r)&&(n[r]=e[r]);return n};var v=(e,t,n)=>new Promise((r,s)=>{var o=f=>{try{a(n.next(f))}catch(d){s(d)}},i=f=>{try{a(n.throw(f))}catch(d){s(d)}},a=f=>f.done?r(f.value):Promise.resolve(f.value).then(o,i);a((n=n.apply(e,t)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ne=require("date-fns"),h=require("../decorator-C2gcn2rK.js"),w=require("../methods-CGdoP4Hi.js"),re=require("../methods-cUjyNkoK.js"),c=require("../methods-DU5cbtLn.js");function se(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var M={exports:{}},y=typeof Reflect=="object"?Reflect:null,S=y&&typeof y.apply=="function"?y.apply:function(t,n,r){return Function.prototype.apply.call(t,n,r)},L;y&&typeof y.ownKeys=="function"?L=y.ownKeys:Object.getOwnPropertySymbols?L=function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:L=function(t){return Object.getOwnPropertyNames(t)};function ie(e){console&&console.warn&&console.warn(e)}var k=Number.isNaN||function(t){return t!==t};function u(){u.init.call(this)}M.exports=u;M.exports.once=fe;u.EventEmitter=u;u.prototype._events=void 0;u.prototype._eventsCount=0;u.prototype._maxListeners=void 0;var j=10;function _(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(u,"defaultMaxListeners",{enumerable:!0,get:function(){return j},set:function(e){if(typeof e!="number"||e<0||k(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");j=e}});u.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};u.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||k(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this};function G(e){return e._maxListeners===void 0?u.defaultMaxListeners:e._maxListeners}u.prototype.getMaxListeners=function(){return G(this)};u.prototype.emit=function(t){for(var n=[],r=1;r<arguments.length;r++)n.push(arguments[r]);var s=t==="error",o=this._events;if(o!==void 0)s=s&&o.error===void 0;else if(!s)return!1;if(s){var i;if(n.length>0&&(i=n[0]),i instanceof Error)throw i;var a=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw a.context=i,a}var f=o[t];if(f===void 0)return!1;if(typeof f=="function")S(f,this,n);else for(var d=f.length,g=W(f,d),r=0;r<d;++r)S(g[r],this,n);return!0};function F(e,t,n,r){var s,o,i;if(_(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),i=o[t]),i===void 0)i=o[t]=n,++e._eventsCount;else if(typeof i=="function"?i=o[t]=r?[n,i]:[i,n]:r?i.unshift(n):i.push(n),s=G(e),s>0&&i.length>s&&!i.warned){i.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=e,a.type=t,a.count=i.length,ie(a)}return e}u.prototype.addListener=function(t,n){return F(this,t,n,!1)};u.prototype.on=u.prototype.addListener;u.prototype.prependListener=function(t,n){return F(this,t,n,!0)};function oe(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function q(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},s=oe.bind(r);return s.listener=n,r.wrapFn=s,s}u.prototype.once=function(t,n){return _(n),this.on(t,q(this,t,n)),this};u.prototype.prependOnceListener=function(t,n){return _(n),this.prependListener(t,q(this,t,n)),this};u.prototype.removeListener=function(t,n){var r,s,o,i,a;if(_(n),s=this._events,s===void 0)return this;if(r=s[t],r===void 0)return this;if(r===n||r.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete s[t],s.removeListener&&this.emit("removeListener",t,r.listener||n));else if(typeof r!="function"){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===n||r[i].listener===n){a=r[i].listener,o=i;break}if(o<0)return this;o===0?r.shift():ue(r,o),r.length===1&&(s[t]=r[0]),s.removeListener!==void 0&&this.emit("removeListener",t,a||n)}return this};u.prototype.off=u.prototype.removeListener;u.prototype.removeAllListeners=function(t){var n,r,s;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[t]),this;if(arguments.length===0){var o=Object.keys(r),i;for(s=0;s<o.length;++s)i=o[s],i!=="removeListener"&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(n=r[t],typeof n=="function")this.removeListener(t,n);else if(n!==void 0)for(s=n.length-1;s>=0;s--)this.removeListener(t,n[s]);return this};function K(e,t,n){var r=e._events;if(r===void 0)return[];var s=r[t];return s===void 0?[]:typeof s=="function"?n?[s.listener||s]:[s]:n?ae(s):W(s,s.length)}u.prototype.listeners=function(t){return K(this,t,!0)};u.prototype.rawListeners=function(t){return K(this,t,!1)};u.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):Q.call(e,t)};u.prototype.listenerCount=Q;function Q(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}u.prototype.eventNames=function(){return this._eventsCount>0?L(this._events):[]};function W(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function ue(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function ae(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function fe(e,t){return new Promise(function(n,r){function s(i){e.removeListener(t,o),r(i)}function o(){typeof e.removeListener=="function"&&e.removeListener("error",s),n([].slice.call(arguments))}$(e,t,o,{once:!0}),t!=="error"&&ce(e,s,{once:!0})})}function ce(e,t,n){typeof e.on=="function"&&$(e,"error",t,n)}function $(e,t,n,r){if(typeof e.on=="function")r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener=="function")e.addEventListener(t,function s(o){r.once&&e.removeEventListener(t,s),n(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}var pe=M.exports;const de=se(pe),le=(e,t=new de)=>{const n={emit:(o,...i)=>(t.emit(o.toString(),...i),n)},r=e(n),s=Object.assign(r,{on:(o,i)=>(t.on(o.toString(),(...a)=>i(...a)),s),once:(o,i)=>(t.once(o.toString(),(...a)=>i(...a)),s),off:(o,i)=>(t.off(o.toString(),(...a)=>i(...a)),s)});return s},ve=e=>new Promise(t=>{setTimeout(t,e)}),he=e=>m(l({},e),{task:re.transformTask(e.task),period:e.period?w.transformPeriod(e.period):void 0}),me=e=>m(l({},e),{date:ne.parseISO(e.date)}),O=e=>m(l({},e),{data:he(e.data)}),R=e=>m(l({},e),{data:me(e.data)}),U=e=>"error"in e.data,ye=e=>!U(e);function H(e){return v(this,null,function*(){const r=yield c.getQueueJobs("generation",e),{items:t}=r,n=J(r,["items"]);return l({items:t.map(O)},n)})}h.assignDependencies(H,[c.getQueueJobs]);function I(e){return v(this,null,function*(){const r=yield c.getQueueJobs("mail",e),{items:t}=r,n=J(r,["items"]);return l({items:t.map(R)},n)})}h.assignDependencies(I,[c.getQueueJobs]);function E(e){return v(this,null,function*(){const t=typeof e=="string"?e:e.id,n=yield c.getJob("generation",t);return m(l({},O(n)),{result:n.result&&w.transformReportResult(n.result)})})}h.assignDependencies(E,[c.getJob]);function z(e){return v(this,null,function*(){const t=typeof e=="string"?e:e.id,n=yield c.getJob("mail",t);return R(n)})}h.assignDependencies(z,[c.getJob]);function B(e){return v(this,null,function*(){const t=typeof e=="string"||typeof e=="number"?e:e.id,n=yield c.retryJob("generation",t);return O(n)})}h.assignDependencies(B,[c.retryJob]);function V(e){return v(this,null,function*(){const t=typeof e=="string"||typeof e=="number"?e:e.id,n=yield c.retryJob("mail",t);return R(n)})}h.assignDependencies(V,[c.retryJob]);function X(e,t,n,r){var i,a;const s=new Set(["completed","failed","stuck"]),o={pending:typeof r=="number"?r:(i=r==null?void 0:r.pending)!=null?i:1e3,active:typeof r=="number"?r:(a=r==null?void 0:r.active)!=null?a:1e3};return le(f=>v(this,null,function*(){var x;const{queue:d,jobId:g}=yield w.generateReportOfTask(e,t,n);f.emit("started",{queue:d,jobId:g});let p;for(;!s.has((x=p==null?void 0:p.status)!=null?x:"");){const{progress:C,status:T,result:Y}=yield E(g);p={progress:C,status:T,result:Y},f.emit("progress",{progress:C,status:T});let D=o.pending;(p==null?void 0:p.status)==="active"&&(D=o.active),yield ve(D)}if(!(p!=null&&p.result))throw new Error("Job failed");return p.result}))}h.assignDependencies(X,[w.generateReportOfTask,E]);exports.generateAndListenReportOfTask=X;exports.getGenerationJob=E;exports.getGenerationJobs=H;exports.getMailJob=z;exports.getMailJobs=I;exports.isDataMailJob=ye;exports.isErrorMailJob=U;exports.retryGenerationJob=B;exports.retryMailJob=V;
|
|
2
|
+
//# sourceMappingURL=jobs.js.map
|