@ecodrix/erix-api 1.1.5 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +43 -11
- package/dist/ts/browser/index.global.js.map +1 -1
- package/dist/ts/cjs/index.cjs.map +1 -1
- package/dist/ts/cjs/index.d.cts +43 -11
- package/dist/ts/esm/index.d.ts +43 -11
- package/dist/ts/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/src/resources/crm/analytics.ts +49 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecodrix/erix-api",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"author": "ECODrIx Team <contact@ecodrix.com>",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Official Isomorphic SDK for the ECODrIx platform. Native support for WhatsApp, CRM, Storage, and Meetings across TS, JS, Python, and Java.",
|
|
@@ -14,11 +14,12 @@ export class Analytics extends APIResource {
|
|
|
14
14
|
* Retrieve high-level CRM performance KPIs.
|
|
15
15
|
* Includes total leads, pipeline value, won revenue, and conversion rates.
|
|
16
16
|
*
|
|
17
|
-
* @param params - Optional filters
|
|
18
|
-
* @returns KPI summary object.
|
|
17
|
+
* @param params - Optional filters including time range (24h, 7d, 30d, etc.) and custom date bounds.
|
|
18
|
+
* @returns {Promise<any>} KPI summary object containing core business metrics.
|
|
19
19
|
* @example
|
|
20
20
|
* ```typescript
|
|
21
21
|
* const stats = await erixClient.crm.analytics.overview({ range: "30d" });
|
|
22
|
+
* console.log(stats.avgScore);
|
|
22
23
|
* ```
|
|
23
24
|
*/
|
|
24
25
|
async overview<T = any>(params?: AnalyticsParams) {
|
|
@@ -27,9 +28,10 @@ export class Analytics extends APIResource {
|
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
* Get stage-by-stage lead counts and conversion percentages for a pipeline.
|
|
30
|
-
* Useful for identifying funnel bottlenecks.
|
|
31
|
+
* Useful for identifying funnel bottlenecks and drop-off points.
|
|
31
32
|
*
|
|
32
33
|
* @param pipelineId - The unique ID of the pipeline to analyze.
|
|
34
|
+
* @returns {Promise<any>} Array of funnel stages with count and conversion data.
|
|
33
35
|
* @example
|
|
34
36
|
* ```typescript
|
|
35
37
|
* const funnel = await erixClient.crm.analytics.funnel("pipe_123");
|
|
@@ -42,56 +44,88 @@ export class Analytics extends APIResource {
|
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
/**
|
|
45
|
-
* Revenue forecast: deal value × stage probability.
|
|
47
|
+
* Revenue forecast: Calculates expected revenue based on deal value × stage probability.
|
|
48
|
+
* Helps in sales planning and goal setting.
|
|
49
|
+
*
|
|
50
|
+
* @param pipelineId - Optional pipeline ID to filter the forecast.
|
|
51
|
+
* @returns {Promise<any>} Forecast data including weighted expected revenue.
|
|
52
|
+
* @example
|
|
53
|
+
* ```typescript
|
|
54
|
+
* const prognosis = await erixClient.crm.analytics.forecast("pipe_123");
|
|
55
|
+
* ```
|
|
46
56
|
*/
|
|
47
57
|
async forecast<T = any>(pipelineId?: string) {
|
|
48
|
-
return this.get<T>("/api/crm/analytics/forecast", {
|
|
58
|
+
return this.get<T>("/api/crm/analytics/forecast", {
|
|
59
|
+
params: { pipelineId },
|
|
60
|
+
} as any);
|
|
49
61
|
}
|
|
50
62
|
|
|
51
63
|
/**
|
|
52
|
-
* Lead source breakdown: count, conversion rate, total value per source.
|
|
64
|
+
* Lead source breakdown: count, conversion rate, and total value per source.
|
|
65
|
+
*
|
|
66
|
+
* @param params - Time range filters.
|
|
67
|
+
* @returns {Promise<any>} Breakdown of how different marketing channels are performing.
|
|
53
68
|
*/
|
|
54
69
|
async sources<T = any>(params?: AnalyticsParams) {
|
|
55
70
|
return this.get<T>("/api/crm/analytics/sources", { params } as any);
|
|
56
71
|
}
|
|
57
72
|
|
|
58
73
|
/**
|
|
59
|
-
* Team leaderboard: won deals, revenue, activity
|
|
74
|
+
* Team leaderboard: Evaluates agent performance across won deals, revenue, and activity.
|
|
75
|
+
*
|
|
76
|
+
* @param params - Time range filters.
|
|
77
|
+
* @returns {Promise<any>} Ranked list of team members by performance.
|
|
60
78
|
*/
|
|
61
79
|
async team<T = any>(params?: AnalyticsParams) {
|
|
62
80
|
return this.get<T>("/api/crm/analytics/team", { params } as any);
|
|
63
81
|
}
|
|
64
82
|
|
|
65
83
|
/**
|
|
66
|
-
* Daily activity counts by type.
|
|
84
|
+
* Activity heatmap: Daily activity counts by type.
|
|
85
|
+
* Ideal for visualizing engagement patterns on a calendar view.
|
|
86
|
+
*
|
|
87
|
+
* @param params - Time range filters.
|
|
88
|
+
* @returns {Promise<any>} Time-series data of team activities.
|
|
67
89
|
*/
|
|
68
90
|
async heatmap<T = any>(params?: AnalyticsParams) {
|
|
69
91
|
return this.get<T>("/api/crm/analytics/heatmap", { params } as any);
|
|
70
92
|
}
|
|
71
93
|
|
|
72
94
|
/**
|
|
73
|
-
* Score distribution:
|
|
95
|
+
* Score distribution: Groups leads into buckets based on their calculated score (0-100).
|
|
96
|
+
*
|
|
97
|
+
* @returns {Promise<any>} Volume of leads in different readiness tiers.
|
|
74
98
|
*/
|
|
75
99
|
async scores<T = any>() {
|
|
76
100
|
return this.get<T>("/api/crm/analytics/scores");
|
|
77
101
|
}
|
|
78
102
|
|
|
79
103
|
/**
|
|
80
|
-
* Avg time
|
|
104
|
+
* Avg time in stage: Measures the velocity of leads through the sales pipeline.
|
|
105
|
+
*
|
|
106
|
+
* @param pipelineId - Target pipeline ID.
|
|
107
|
+
* @returns {Promise<any>} Velocity metrics per stage.
|
|
81
108
|
*/
|
|
82
109
|
async stageTime<T = any>(pipelineId: string) {
|
|
83
|
-
return this.get<T>("/api/crm/analytics/stage-time", {
|
|
110
|
+
return this.get<T>("/api/crm/analytics/stage-time", {
|
|
111
|
+
params: { pipelineId },
|
|
112
|
+
} as any);
|
|
84
113
|
}
|
|
85
114
|
|
|
86
115
|
/**
|
|
87
|
-
* Tiered Growth Report matching business sophistication.
|
|
116
|
+
* Tiered Growth Report matching business sophistication (Pulse, Growth, Weapon).
|
|
117
|
+
* Provides deep tactical and strategic insights.
|
|
118
|
+
*
|
|
119
|
+
* @param params - Filtering and range parameters.
|
|
88
120
|
*/
|
|
89
121
|
async tiered<T = any>(params?: AnalyticsParams) {
|
|
90
122
|
return this.get<T>("/api/crm/analytics/tiered", { params } as any);
|
|
91
123
|
}
|
|
92
124
|
|
|
93
125
|
/**
|
|
94
|
-
* Consolidated analytics including CRM overview and WhatsApp.
|
|
126
|
+
* Consolidated analytics including CRM overview and WhatsApp messaging metrics.
|
|
127
|
+
*
|
|
128
|
+
* @param params - Time range filters.
|
|
95
129
|
*/
|
|
96
130
|
async summary<T = any>(params?: AnalyticsParams) {
|
|
97
131
|
return this.get<T>("/api/crm/analytics/summary", { params } as any);
|
|
@@ -99,15 +133,16 @@ export class Analytics extends APIResource {
|
|
|
99
133
|
|
|
100
134
|
/**
|
|
101
135
|
* Retrieve WhatsApp messaging volume and delivery performance analytics.
|
|
136
|
+
* Includes total sent, delivered, read, and daily volume trends.
|
|
102
137
|
*
|
|
103
138
|
* @param params - Optional filters (time range).
|
|
104
139
|
* @example
|
|
105
140
|
* ```typescript
|
|
106
141
|
* const waStats = await erixClient.crm.analytics.whatsapp({ range: "7d" });
|
|
142
|
+
* console.log(waStats.totalSent);
|
|
107
143
|
* ```
|
|
108
144
|
*/
|
|
109
145
|
async whatsapp<T = any>(params?: AnalyticsParams) {
|
|
110
146
|
return this.get<T>("/api/crm/analytics/whatsapp", { params } as any);
|
|
111
147
|
}
|
|
112
|
-
|
|
113
148
|
}
|