elasticsearch-mcp-vsee 0.5.12 → 0.5.13
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/build/server.d.ts +2 -1
- package/build/server.d.ts.map +1 -1
- package/build/server.js +65 -9
- package/build/server.js.map +1 -1
- package/build/tools/base-tool.d.ts +38 -0
- package/build/tools/base-tool.d.ts.map +1 -0
- package/build/tools/base-tool.js +67 -0
- package/build/tools/base-tool.js.map +1 -0
- package/build/tools/find-entities-by-metric.d.ts +314 -24
- package/build/tools/find-entities-by-metric.d.ts.map +1 -1
- package/build/tools/find-entities-by-metric.js +277 -284
- package/build/tools/find-entities-by-metric.js.map +1 -1
- package/build/tools/get-platform-breakdown.d.ts +60 -22
- package/build/tools/get-platform-breakdown.d.ts.map +1 -1
- package/build/tools/get-platform-breakdown.js +220 -266
- package/build/tools/get-platform-breakdown.js.map +1 -1
- package/build/tools/get-rating-distribution.d.ts +65 -25
- package/build/tools/get-rating-distribution.d.ts.map +1 -1
- package/build/tools/get-rating-distribution.js +206 -245
- package/build/tools/get-rating-distribution.js.map +1 -1
- package/build/tools/get-subscription-breakdown.d.ts +30 -15
- package/build/tools/get-subscription-breakdown.d.ts.map +1 -1
- package/build/tools/get-subscription-breakdown.js +140 -155
- package/build/tools/get-subscription-breakdown.js.map +1 -1
- package/build/tools/get-usage-leaderboard.d.ts +114 -0
- package/build/tools/get-usage-leaderboard.d.ts.map +1 -0
- package/build/tools/get-usage-leaderboard.js +169 -0
- package/build/tools/get-usage-leaderboard.js.map +1 -0
- package/build/tools/get-usage-profile.d.ts +83 -0
- package/build/tools/get-usage-profile.d.ts.map +1 -0
- package/build/tools/get-usage-profile.js +235 -0
- package/build/tools/get-usage-profile.js.map +1 -0
- package/build/tools/get-visit-trends.d.ts +59 -25
- package/build/tools/get-visit-trends.d.ts.map +1 -1
- package/build/tools/get-visit-trends.js +175 -242
- package/build/tools/get-visit-trends.js.map +1 -1
- package/build/tools/index.d.ts +4 -2
- package/build/tools/index.d.ts.map +1 -1
- package/build/tools/index.js +5 -3
- package/build/tools/index.js.map +1 -1
- package/build/tools/top-change.d.ts +56 -23
- package/build/tools/top-change.d.ts.map +1 -1
- package/build/tools/top-change.js +177 -193
- package/build/tools/top-change.js.map +1 -1
- package/build/tools/types.d.ts +24 -0
- package/build/tools/types.d.ts.map +1 -0
- package/build/tools/types.js +3 -0
- package/build/tools/types.js.map +1 -0
- package/build/utils/query-helpers.d.ts +10 -0
- package/build/utils/query-helpers.d.ts.map +1 -0
- package/build/utils/query-helpers.js +48 -0
- package/build/utils/query-helpers.js.map +1 -0
- package/package.json +1 -1
- package/build/tools/get-usage-summary.d.ts +0 -52
- package/build/tools/get-usage-summary.d.ts.map +0 -1
- package/build/tools/get-usage-summary.js +0 -273
- package/build/tools/get-usage-summary.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-rating-distribution.js","sourceRoot":"","sources":["../../src/tools/get-rating-distribution.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"get-rating-distribution.js","sourceRoot":"","sources":["../../src/tools/get-rating-distribution.ts"],"names":[],"mappings":";;;AAAA,iDAA0C;AAC1C,6BAAwB;AACxB,oEAA8D;AAC9D,gEAA+D;AAE/D,0EAAoE;AAEpE,MAAM,+BAA+B,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,UAAU,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,6DAA6D,CAAC;IAC3H,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,gEAAgE,CAAC;IAC3I,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE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AO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;SACjE,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,aAAa,CAAC,YAAY,EAAE;YACtC,WAAW,EAAE,wBAAwB,IAAI,CAAC,UAAU,iBAAiB,UAAU,UAAU,YAAY,OAAO,UAAU,EAAE;YACxH,SAAS,EAAE,IAAI;YACf,IAAI,EAAE;gBACJ,KAAK,EAAE,YAAY;gBACnB,GAAG,EAAE,UAAU;aAChB;YACD,aAAa,EAAE;gBACb,IAAI,EAAE,KAAK;gBACX,KAAK,EAAE,GAAG,IAAI,CAAC,UAAU,KAAK,MAAM,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,sBAAsB;gBACtJ,WAAW,EAAE,GAAG,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;gBAC3E,UAAU,EAAE,cAAc;gBAC1B,UAAU,EAAE,OAAO;aACpB;SACF,CAAC,CAAC;IACL,CAAC;CACF;AAjQD,8DAiQC"}
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { BaseTool } from './base-tool.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { StandardResponse } from './types.js';
|
|
4
|
+
declare const PeriodSummaryArgsSchema: z.ZodObject<{
|
|
5
|
+
startDate: z.ZodOptional<z.ZodString>;
|
|
6
|
+
endDate: z.ZodOptional<z.ZodString>;
|
|
7
|
+
}, "strict", z.ZodTypeAny, {
|
|
8
|
+
startDate?: string | undefined;
|
|
9
|
+
endDate?: string | undefined;
|
|
10
|
+
}, {
|
|
11
|
+
startDate?: string | undefined;
|
|
12
|
+
endDate?: string | undefined;
|
|
13
|
+
}>;
|
|
14
|
+
export type PeriodSummaryArgs = z.infer<typeof PeriodSummaryArgsSchema>;
|
|
7
15
|
export interface SubscriptionMetrics {
|
|
8
16
|
subscription: string;
|
|
9
17
|
count_records: number;
|
|
@@ -16,19 +24,26 @@ export interface SubscriptionMetrics {
|
|
|
16
24
|
avg_patient_rating: number | null;
|
|
17
25
|
patient_rating_count: number;
|
|
18
26
|
}
|
|
19
|
-
export
|
|
20
|
-
startDate: string;
|
|
21
|
-
endDate: string;
|
|
27
|
+
export type PeriodSummaryResult = StandardResponse<{
|
|
22
28
|
subscriptions: SubscriptionMetrics[];
|
|
23
29
|
total_records: number;
|
|
24
30
|
total_unique_accounts: number;
|
|
25
31
|
total_unique_providers: number;
|
|
26
32
|
total_unique_patients: number;
|
|
33
|
+
}>;
|
|
34
|
+
export declare class PeriodSummaryTool extends BaseTool<typeof PeriodSummaryArgsSchema, PeriodSummaryResult> {
|
|
35
|
+
constructor(elasticsearch: any, logger: any);
|
|
36
|
+
get schema(): z.ZodObject<{
|
|
37
|
+
startDate: z.ZodOptional<z.ZodString>;
|
|
38
|
+
endDate: z.ZodOptional<z.ZodString>;
|
|
39
|
+
}, "strict", z.ZodTypeAny, {
|
|
40
|
+
startDate?: string | undefined;
|
|
41
|
+
endDate?: string | undefined;
|
|
42
|
+
}, {
|
|
43
|
+
startDate?: string | undefined;
|
|
44
|
+
endDate?: string | undefined;
|
|
45
|
+
}>;
|
|
46
|
+
protected run(args: PeriodSummaryArgs): Promise<PeriodSummaryResult>;
|
|
27
47
|
}
|
|
28
|
-
export
|
|
29
|
-
private elasticsearch;
|
|
30
|
-
private logger;
|
|
31
|
-
constructor(elasticsearch: ElasticsearchManager, logger: Logger);
|
|
32
|
-
execute(args: unknown): Promise<PeriodSummaryResult>;
|
|
33
|
-
}
|
|
48
|
+
export {};
|
|
34
49
|
//# sourceMappingURL=get-subscription-breakdown.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-subscription-breakdown.d.ts","sourceRoot":"","sources":["../../src/tools/get-subscription-breakdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"get-subscription-breakdown.d.ts","sourceRoot":"","sources":["../../src/tools/get-subscription-breakdown.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAG9C,QAAA,MAAM,uBAAuB;;;;;;;;;EAGlB,CAAC;AAEZ,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,CAAC;IACjD,aAAa,EAAE,mBAAmB,EAAE,CAAC;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,qBAAqB,EAAE,MAAM,CAAC;CAC/B,CAAC,CAAC;AAEH,qBAAa,iBAAkB,SAAQ,QAAQ,CAAC,OAAO,uBAAuB,EAAE,mBAAmB,CAAC;gBACtF,aAAa,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG;IAI3C,IAAI,MAAM;;;;;;;;;OAET;cAEe,GAAG,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;CA6J3E"}
|
|
@@ -1,178 +1,163 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PeriodSummaryTool = void 0;
|
|
4
|
+
const base_tool_js_1 = require("./base-tool.js");
|
|
4
5
|
const zod_1 = require("zod");
|
|
5
|
-
const handlers_js_1 = require("../errors/handlers.js");
|
|
6
|
-
const aggregation_limits_js_1 = require("../utils/aggregation-limits.js");
|
|
7
6
|
const field_constants_js_1 = require("../utils/field-constants.js");
|
|
7
|
+
const query_helpers_js_1 = require("../utils/query-helpers.js");
|
|
8
|
+
const aggregation_limits_js_1 = require("../utils/aggregation-limits.js");
|
|
8
9
|
const PeriodSummaryArgsSchema = zod_1.z.object({
|
|
9
10
|
startDate: zod_1.z.string().optional().describe('Start date in ISO format (YYYY-MM-DD) or date math (e.g., "now-30d", "now-1y"). Defaults to "now-30d"'),
|
|
10
11
|
endDate: zod_1.z.string().optional().describe('End date in ISO format (YYYY-MM-DD) or date math (e.g., "now"). Defaults to "now"'),
|
|
11
12
|
}).strict();
|
|
12
|
-
class PeriodSummaryTool {
|
|
13
|
-
elasticsearch;
|
|
14
|
-
logger;
|
|
13
|
+
class PeriodSummaryTool extends base_tool_js_1.BaseTool {
|
|
15
14
|
constructor(elasticsearch, logger) {
|
|
16
|
-
|
|
17
|
-
this.logger = logger.child({ tool: 'get-subscription-breakdown' });
|
|
15
|
+
super(elasticsearch, logger, 'get-subscription-breakdown');
|
|
18
16
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
{
|
|
61
|
-
bool: {
|
|
62
|
-
should: [
|
|
63
|
-
{ exists: { field: callDurationField } },
|
|
64
|
-
{ term: { [meetingBasedField]: false } },
|
|
65
|
-
],
|
|
66
|
-
minimum_should_match: 1,
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
],
|
|
70
|
-
},
|
|
17
|
+
get schema() {
|
|
18
|
+
return PeriodSummaryArgsSchema;
|
|
19
|
+
}
|
|
20
|
+
async run(args) {
|
|
21
|
+
const { startIso: startDateIso, endIso: endDateIso } = this.resolveTimeRange(args.startDate, args.endDate, 'now-30d', 'now');
|
|
22
|
+
this.logger.info('Getting subscription breakdown', {
|
|
23
|
+
startDate: startDateIso,
|
|
24
|
+
endDate: endDateIso,
|
|
25
|
+
});
|
|
26
|
+
const client = this.elasticsearch.getClient();
|
|
27
|
+
const index = field_constants_js_1.FIELD_CONSTANTS.index;
|
|
28
|
+
const timeField = field_constants_js_1.FIELD_CONSTANTS.timeField;
|
|
29
|
+
const subscriptionField = field_constants_js_1.FIELD_CONSTANTS.subscriptionField;
|
|
30
|
+
const accountField = field_constants_js_1.FIELD_CONSTANTS.accountField;
|
|
31
|
+
const providerField = field_constants_js_1.FIELD_CONSTANTS.providerField;
|
|
32
|
+
const patientField = field_constants_js_1.FIELD_CONSTANTS.patientField;
|
|
33
|
+
const callDurationField = field_constants_js_1.FIELD_CONSTANTS.callDurationField;
|
|
34
|
+
const providerRatingField = field_constants_js_1.FIELD_CONSTANTS.providerRatingField;
|
|
35
|
+
const patientRatingField = field_constants_js_1.FIELD_CONSTANTS.patientRatingField;
|
|
36
|
+
const filters = (0, query_helpers_js_1.buildCommonFilters)({
|
|
37
|
+
startDate: startDateIso,
|
|
38
|
+
endDate: endDateIso,
|
|
39
|
+
excludeTestVisits: true
|
|
40
|
+
});
|
|
41
|
+
// Extra filters
|
|
42
|
+
filters.push({
|
|
43
|
+
bool: {
|
|
44
|
+
should: [
|
|
45
|
+
{ exists: { field: callDurationField } },
|
|
46
|
+
{ term: { [field_constants_js_1.FIELD_CONSTANTS.meetingBasedField]: false } },
|
|
47
|
+
],
|
|
48
|
+
minimum_should_match: 1,
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
const query = {
|
|
52
|
+
index,
|
|
53
|
+
size: 0,
|
|
54
|
+
body: {
|
|
55
|
+
query: {
|
|
56
|
+
bool: {
|
|
57
|
+
filter: filters,
|
|
71
58
|
},
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
59
|
+
},
|
|
60
|
+
aggs: {
|
|
61
|
+
by_subscription: {
|
|
62
|
+
terms: {
|
|
63
|
+
field: subscriptionField,
|
|
64
|
+
size: aggregation_limits_js_1.AGGREGATION_LIMITS.MEDIUM,
|
|
65
|
+
},
|
|
66
|
+
aggs: {
|
|
67
|
+
count_records: {
|
|
68
|
+
value_count: { field: timeField },
|
|
69
|
+
},
|
|
70
|
+
unique_accounts: {
|
|
71
|
+
cardinality: { field: accountField },
|
|
72
|
+
},
|
|
73
|
+
unique_providers: {
|
|
74
|
+
cardinality: { field: providerField },
|
|
77
75
|
},
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
avg: { field: providerRatingField },
|
|
96
|
-
},
|
|
97
|
-
provider_rating_count: {
|
|
98
|
-
value_count: { field: providerRatingField },
|
|
99
|
-
},
|
|
100
|
-
avg_patient_rating: {
|
|
101
|
-
avg: { field: patientRatingField },
|
|
102
|
-
},
|
|
103
|
-
patient_rating_count: {
|
|
104
|
-
value_count: { field: patientRatingField },
|
|
105
|
-
},
|
|
76
|
+
unique_patients: {
|
|
77
|
+
cardinality: { field: patientField },
|
|
78
|
+
},
|
|
79
|
+
avg_call_duration: {
|
|
80
|
+
avg: { field: callDurationField },
|
|
81
|
+
},
|
|
82
|
+
avg_provider_rating: {
|
|
83
|
+
avg: { field: providerRatingField },
|
|
84
|
+
},
|
|
85
|
+
provider_rating_count: {
|
|
86
|
+
value_count: { field: providerRatingField },
|
|
87
|
+
},
|
|
88
|
+
avg_patient_rating: {
|
|
89
|
+
avg: { field: patientRatingField },
|
|
90
|
+
},
|
|
91
|
+
patient_rating_count: {
|
|
92
|
+
value_count: { field: patientRatingField },
|
|
106
93
|
},
|
|
107
94
|
},
|
|
108
95
|
},
|
|
109
96
|
},
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
totalRecords += countRecords;
|
|
144
|
-
totalUniqueAccounts += uniqueAccounts;
|
|
145
|
-
totalUniqueProviders += uniqueProviders;
|
|
146
|
-
totalUniquePatients += uniquePatients;
|
|
147
|
-
}
|
|
148
|
-
// Note: Total unique counts are approximations (sum of per-subscription uniques).
|
|
149
|
-
// For exact totals, would need top-level aggregations, but per-subscription counts are accurate.
|
|
150
|
-
this.logger.info('Successfully retrieved subscription breakdown', {
|
|
151
|
-
subscriptionCount: subscriptions.length,
|
|
152
|
-
totalRecords,
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
this.logger.debug('Executing query', { query: JSON.stringify(query, null, 2) });
|
|
100
|
+
const response = await client.search(query);
|
|
101
|
+
const subscriptions = [];
|
|
102
|
+
const bySubscriptionAgg = response.aggregations?.by_subscription;
|
|
103
|
+
const buckets = bySubscriptionAgg?.buckets || [];
|
|
104
|
+
let totalRecords = 0;
|
|
105
|
+
let totalUniqueAccounts = 0;
|
|
106
|
+
let totalUniqueProviders = 0;
|
|
107
|
+
let totalUniquePatients = 0;
|
|
108
|
+
for (const bucket of buckets) {
|
|
109
|
+
const subscription = bucket.key;
|
|
110
|
+
const countRecords = bucket.count_records?.value || 0;
|
|
111
|
+
const uniqueAccounts = bucket.unique_accounts?.value || 0;
|
|
112
|
+
const uniqueProviders = bucket.unique_providers?.value || 0;
|
|
113
|
+
const uniquePatients = bucket.unique_patients?.value || 0;
|
|
114
|
+
const avgCallDuration = bucket.avg_call_duration?.value || null;
|
|
115
|
+
const avgProviderRating = bucket.avg_provider_rating?.value || null;
|
|
116
|
+
const providerRatingCount = bucket.provider_rating_count?.value || 0;
|
|
117
|
+
const avgPatientRating = bucket.avg_patient_rating?.value || null;
|
|
118
|
+
const patientRatingCount = bucket.patient_rating_count?.value || 0;
|
|
119
|
+
subscriptions.push({
|
|
120
|
+
subscription,
|
|
121
|
+
count_records: countRecords,
|
|
122
|
+
unique_accounts: uniqueAccounts,
|
|
123
|
+
unique_providers: uniqueProviders,
|
|
124
|
+
unique_patients: uniquePatients,
|
|
125
|
+
avg_call_duration: avgCallDuration ? Math.round(avgCallDuration * 100) / 100 : null,
|
|
126
|
+
avg_provider_rating: avgProviderRating ? Math.round(avgProviderRating * 100) / 100 : null,
|
|
127
|
+
provider_rating_count: providerRatingCount,
|
|
128
|
+
avg_patient_rating: avgPatientRating ? Math.round(avgPatientRating * 100) / 100 : null,
|
|
129
|
+
patient_rating_count: patientRatingCount,
|
|
153
130
|
});
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
total_records: totalRecords,
|
|
159
|
-
total_unique_accounts: totalUniqueAccounts,
|
|
160
|
-
total_unique_providers: totalUniqueProviders,
|
|
161
|
-
total_unique_patients: totalUniquePatients,
|
|
162
|
-
};
|
|
131
|
+
totalRecords += countRecords;
|
|
132
|
+
totalUniqueAccounts += uniqueAccounts;
|
|
133
|
+
totalUniqueProviders += uniqueProviders;
|
|
134
|
+
totalUniquePatients += uniquePatients;
|
|
163
135
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
136
|
+
this.logger.info('Successfully retrieved subscription breakdown', {
|
|
137
|
+
subscriptionCount: subscriptions.length,
|
|
138
|
+
totalRecords,
|
|
139
|
+
});
|
|
140
|
+
return this.buildResponse({
|
|
141
|
+
subscriptions,
|
|
142
|
+
total_records: totalRecords,
|
|
143
|
+
total_unique_accounts: totalUniqueAccounts,
|
|
144
|
+
total_unique_providers: totalUniqueProviders,
|
|
145
|
+
total_unique_patients: totalUniquePatients
|
|
146
|
+
}, {
|
|
147
|
+
description: `Subscription breakdown from ${startDateIso} to ${endDateIso}`,
|
|
148
|
+
arguments: args,
|
|
149
|
+
time: {
|
|
150
|
+
start: startDateIso,
|
|
151
|
+
end: endDateIso
|
|
152
|
+
},
|
|
153
|
+
visualization: {
|
|
154
|
+
type: 'table',
|
|
155
|
+
title: 'Subscription Breakdown',
|
|
156
|
+
description: `${startDateIso.split('T')[0]} to ${endDateIso.split('T')[0]}`,
|
|
157
|
+
xAxisLabel: 'Subscription Tier',
|
|
158
|
+
yAxisLabel: 'Records'
|
|
169
159
|
}
|
|
170
|
-
|
|
171
|
-
throw error;
|
|
172
|
-
}
|
|
173
|
-
this.logger.error('Failed to get period summary', {}, error);
|
|
174
|
-
throw new handlers_js_1.ElasticsearchError('Failed to get period summary from Elasticsearch', error, { args });
|
|
175
|
-
}
|
|
160
|
+
});
|
|
176
161
|
}
|
|
177
162
|
}
|
|
178
163
|
exports.PeriodSummaryTool = PeriodSummaryTool;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-subscription-breakdown.js","sourceRoot":"","sources":["../../src/tools/get-subscription-breakdown.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"get-subscription-breakdown.js","sourceRoot":"","sources":["../../src/tools/get-subscription-breakdown.ts"],"names":[],"mappings":";;;AAAA,iDAA0C;AAC1C,6BAAwB;AACxB,oEAA8D;AAC9D,gEAA+D;AAE/D,0EAAoE;AAEpE,MAAM,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IACvC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,uGAAuG,CAAC;IAClJ,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mFAAmF,CAAC;CAC7H,CAAC,CAAC,MAAM,EAAE,CAAC;AAyBZ,MAAa,iBAAkB,SAAQ,uBAA6D;IAClG,YAAY,aAAkB,EAAE,MAAW;QACzC,KAAK,CAAC,aAAa,EAAE,MAAM,EAAE,4BAA4B,CAAC,CAAC;IAC7D,CAAC;IAED,IAAI,MAAM;QACR,OAAO,uBAAuB,CAAC;IACjC,CAAC;IAES,KAAK,CAAC,GAAG,CAAC,IAAuB;QACzC,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,GAClD,IAAI,CAAC,gBAAgB,CAAC,IAA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CAAC,CAAC,EAAE;gBAC3E,UAAU,EAAE,mBAAmB;gBAC/B,UAAU,EAAE,SAAS;aACtB;SACF,CAAC,CAAC;IACL,CAAC;CACF;AAtKD,8CAsKC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { BaseTool } from './base-tool.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { StandardResponse } from './types.js';
|
|
4
|
+
declare const GetUsageLeaderboardArgsSchema: z.ZodEffects<z.ZodObject<{
|
|
5
|
+
entityType: z.ZodEnum<["account", "group", "provider_platform", "patient_platform", "provider_platform_version", "patient_platform_version"]>;
|
|
6
|
+
mode: z.ZodEnum<["top_n", "specific"]>;
|
|
7
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
8
|
+
entityValue: z.ZodOptional<z.ZodString>;
|
|
9
|
+
startDate: z.ZodOptional<z.ZodString>;
|
|
10
|
+
endDate: z.ZodOptional<z.ZodString>;
|
|
11
|
+
subscription: z.ZodOptional<z.ZodEnum<["Enterprise", "Premium", "FVC", "BVC", "Plus"]>>;
|
|
12
|
+
orderBy: z.ZodDefault<z.ZodEnum<["visit_count", "unique_accounts", "unique_groups", "unique_providers", "unique_patients"]>>;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
entityType: "account" | "group" | "provider_platform" | "patient_platform" | "provider_platform_version" | "patient_platform_version";
|
|
15
|
+
limit: number;
|
|
16
|
+
mode: "top_n" | "specific";
|
|
17
|
+
orderBy: "unique_accounts" | "unique_providers" | "unique_patients" | "unique_groups" | "visit_count";
|
|
18
|
+
startDate?: string | undefined;
|
|
19
|
+
endDate?: string | undefined;
|
|
20
|
+
subscription?: "Enterprise" | "Premium" | "FVC" | "BVC" | "Plus" | undefined;
|
|
21
|
+
entityValue?: string | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
entityType: "account" | "group" | "provider_platform" | "patient_platform" | "provider_platform_version" | "patient_platform_version";
|
|
24
|
+
mode: "top_n" | "specific";
|
|
25
|
+
startDate?: string | undefined;
|
|
26
|
+
endDate?: string | undefined;
|
|
27
|
+
subscription?: "Enterprise" | "Premium" | "FVC" | "BVC" | "Plus" | undefined;
|
|
28
|
+
limit?: number | undefined;
|
|
29
|
+
entityValue?: string | undefined;
|
|
30
|
+
orderBy?: "unique_accounts" | "unique_providers" | "unique_patients" | "unique_groups" | "visit_count" | undefined;
|
|
31
|
+
}>, {
|
|
32
|
+
entityType: "account" | "group" | "provider_platform" | "patient_platform" | "provider_platform_version" | "patient_platform_version";
|
|
33
|
+
limit: number;
|
|
34
|
+
mode: "top_n" | "specific";
|
|
35
|
+
orderBy: "unique_accounts" | "unique_providers" | "unique_patients" | "unique_groups" | "visit_count";
|
|
36
|
+
startDate?: string | undefined;
|
|
37
|
+
endDate?: string | undefined;
|
|
38
|
+
subscription?: "Enterprise" | "Premium" | "FVC" | "BVC" | "Plus" | undefined;
|
|
39
|
+
entityValue?: string | undefined;
|
|
40
|
+
}, {
|
|
41
|
+
entityType: "account" | "group" | "provider_platform" | "patient_platform" | "provider_platform_version" | "patient_platform_version";
|
|
42
|
+
mode: "top_n" | "specific";
|
|
43
|
+
startDate?: string | undefined;
|
|
44
|
+
endDate?: string | undefined;
|
|
45
|
+
subscription?: "Enterprise" | "Premium" | "FVC" | "BVC" | "Plus" | undefined;
|
|
46
|
+
limit?: number | undefined;
|
|
47
|
+
entityValue?: string | undefined;
|
|
48
|
+
orderBy?: "unique_accounts" | "unique_providers" | "unique_patients" | "unique_groups" | "visit_count" | undefined;
|
|
49
|
+
}>;
|
|
50
|
+
export type GetUsageLeaderboardArgs = z.infer<typeof GetUsageLeaderboardArgsSchema>;
|
|
51
|
+
export interface EntityUsageMetrics {
|
|
52
|
+
entity: string;
|
|
53
|
+
total_visits: number;
|
|
54
|
+
unique_accounts: number;
|
|
55
|
+
unique_groups: number;
|
|
56
|
+
unique_providers: number;
|
|
57
|
+
unique_patients: number;
|
|
58
|
+
avg_patient_rating: number | null;
|
|
59
|
+
avg_provider_rating: number | null;
|
|
60
|
+
avg_call_duration: number | null;
|
|
61
|
+
}
|
|
62
|
+
export type GetUsageLeaderboardResult = StandardResponse<EntityUsageMetrics[]>;
|
|
63
|
+
export declare class GetUsageLeaderboardTool extends BaseTool<typeof GetUsageLeaderboardArgsSchema, GetUsageLeaderboardResult> {
|
|
64
|
+
constructor(elasticsearch: any, logger: any);
|
|
65
|
+
get schema(): z.ZodEffects<z.ZodObject<{
|
|
66
|
+
entityType: z.ZodEnum<["account", "group", "provider_platform", "patient_platform", "provider_platform_version", "patient_platform_version"]>;
|
|
67
|
+
mode: z.ZodEnum<["top_n", "specific"]>;
|
|
68
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
69
|
+
entityValue: z.ZodOptional<z.ZodString>;
|
|
70
|
+
startDate: z.ZodOptional<z.ZodString>;
|
|
71
|
+
endDate: z.ZodOptional<z.ZodString>;
|
|
72
|
+
subscription: z.ZodOptional<z.ZodEnum<["Enterprise", "Premium", "FVC", "BVC", "Plus"]>>;
|
|
73
|
+
orderBy: z.ZodDefault<z.ZodEnum<["visit_count", "unique_accounts", "unique_groups", "unique_providers", "unique_patients"]>>;
|
|
74
|
+
}, "strip", z.ZodTypeAny, {
|
|
75
|
+
entityType: "account" | "group" | "provider_platform" | "patient_platform" | "provider_platform_version" | "patient_platform_version";
|
|
76
|
+
limit: number;
|
|
77
|
+
mode: "top_n" | "specific";
|
|
78
|
+
orderBy: "unique_accounts" | "unique_providers" | "unique_patients" | "unique_groups" | "visit_count";
|
|
79
|
+
startDate?: string | undefined;
|
|
80
|
+
endDate?: string | undefined;
|
|
81
|
+
subscription?: "Enterprise" | "Premium" | "FVC" | "BVC" | "Plus" | undefined;
|
|
82
|
+
entityValue?: string | undefined;
|
|
83
|
+
}, {
|
|
84
|
+
entityType: "account" | "group" | "provider_platform" | "patient_platform" | "provider_platform_version" | "patient_platform_version";
|
|
85
|
+
mode: "top_n" | "specific";
|
|
86
|
+
startDate?: string | undefined;
|
|
87
|
+
endDate?: string | undefined;
|
|
88
|
+
subscription?: "Enterprise" | "Premium" | "FVC" | "BVC" | "Plus" | undefined;
|
|
89
|
+
limit?: number | undefined;
|
|
90
|
+
entityValue?: string | undefined;
|
|
91
|
+
orderBy?: "unique_accounts" | "unique_providers" | "unique_patients" | "unique_groups" | "visit_count" | undefined;
|
|
92
|
+
}>, {
|
|
93
|
+
entityType: "account" | "group" | "provider_platform" | "patient_platform" | "provider_platform_version" | "patient_platform_version";
|
|
94
|
+
limit: number;
|
|
95
|
+
mode: "top_n" | "specific";
|
|
96
|
+
orderBy: "unique_accounts" | "unique_providers" | "unique_patients" | "unique_groups" | "visit_count";
|
|
97
|
+
startDate?: string | undefined;
|
|
98
|
+
endDate?: string | undefined;
|
|
99
|
+
subscription?: "Enterprise" | "Premium" | "FVC" | "BVC" | "Plus" | undefined;
|
|
100
|
+
entityValue?: string | undefined;
|
|
101
|
+
}, {
|
|
102
|
+
entityType: "account" | "group" | "provider_platform" | "patient_platform" | "provider_platform_version" | "patient_platform_version";
|
|
103
|
+
mode: "top_n" | "specific";
|
|
104
|
+
startDate?: string | undefined;
|
|
105
|
+
endDate?: string | undefined;
|
|
106
|
+
subscription?: "Enterprise" | "Premium" | "FVC" | "BVC" | "Plus" | undefined;
|
|
107
|
+
limit?: number | undefined;
|
|
108
|
+
entityValue?: string | undefined;
|
|
109
|
+
orderBy?: "unique_accounts" | "unique_providers" | "unique_patients" | "unique_groups" | "visit_count" | undefined;
|
|
110
|
+
}>;
|
|
111
|
+
protected run(args: GetUsageLeaderboardArgs): Promise<GetUsageLeaderboardResult>;
|
|
112
|
+
}
|
|
113
|
+
export {};
|
|
114
|
+
//# sourceMappingURL=get-usage-leaderboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-usage-leaderboard.d.ts","sourceRoot":"","sources":["../../src/tools/get-usage-leaderboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,QAAA,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwBjC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,MAAM,WAAW,kBAAkB;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAED,MAAM,MAAM,yBAAyB,GAAG,gBAAgB,CAAC,kBAAkB,EAAE,CAAC,CAAC;AAE/E,qBAAa,uBAAwB,SAAQ,QAAQ,CAAC,OAAO,6BAA6B,EAAE,yBAAyB,CAAC;gBACtG,aAAa,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG;IAI3C,IAAI,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAET;cAEe,GAAG,CAAC,IAAI,EAAE,uBAAuB,GAAG,OAAO,CAAC,yBAAyB,CAAC;CA+HzF"}
|