@@ -20,15 +20,15 @@ const features = [
2020const featureResources = _ . object ( _ . map ( features , function ( feature ) {
2121 const Klass = FeatureResource . extend ( {
2222 id : feature ,
23- eventTrackers : [ 'ga' , 'intercom' , ' stitch']
23+ eventTrackers : [ 'stitch' ]
2424 } ) ;
2525 return [ feature , new Klass ( ) ] ;
2626} ) ) ;
2727
2828// Geo Data uses `detected` as action
2929const GeoDataResource = FeatureResource . extend ( {
3030 id : 'Geo Data' ,
31- eventTrackers : [ 'ga' , 'intercom' , ' stitch'] ,
31+ eventTrackers : [ 'stitch' ] ,
3232 detected : function ( metadata , callback ) {
3333 this . _send_event ( metadata , callback ) ;
3434 }
@@ -37,7 +37,7 @@ const GeoDataResource = FeatureResource.extend({
3737// Collection uses `fetched` as action
3838const CollectionResource = FeatureResource . extend ( {
3939 id : 'Collection' ,
40- eventTrackers : [ 'ga' , 'intercom' , ' stitch'] ,
40+ eventTrackers : [ 'stitch' ] ,
4141 fetched : function ( metadata , callback ) {
4242 this . _send_event ( metadata , callback ) ;
4343 }
@@ -55,21 +55,117 @@ const DeploymentResource = FeatureResource.extend({
5555// Schema resource uses `sampled` as action
5656const SchemaResource = BaseResource . extend ( {
5757 id : 'Schema' ,
58- eventTrackers : [ 'ga' , 'intercom' , ' stitch'] ,
58+ eventTrackers : [ 'stitch' ] ,
5959 sampled : function ( metadata , callback ) {
6060 this . _send_event ( metadata , callback ) ;
6161 }
6262} ) ;
6363
64- // Index resource uses `detected ` as action
64+ // Index resource uses `fetched ` as action
6565const IndexesResource = BaseResource . extend ( {
6666 id : 'Indexes' ,
67- eventTrackers : [ 'ga' , 'intercom' , 'stitch' ] ,
67+ eventTrackers : [ 'stitch' ] ,
68+ fetched : function ( metadata , callback ) {
69+ this . _send_event ( metadata , callback ) ;
70+ }
71+ } ) ;
72+
73+ // Collection Stats uses 'fetched' as action
74+ const CollectionStatsResource = BaseResource . extend ( {
75+ id : 'Collection Stats' ,
76+ eventTrackers : [ 'stitch' ] ,
77+ fetched : function ( metadata , callback ) {
78+ this . _send_event ( metadata , callback ) ;
79+ }
80+ } ) ;
81+
82+ // Topology resources uses 'detected' as action
83+ const TopologyResource = BaseResource . extend ( {
84+ id : 'Topology' ,
85+ eventTrackers : [ 'stitch' ] ,
6886 detected : function ( metadata , callback ) {
6987 this . _send_event ( metadata , callback ) ;
7088 }
7189} ) ;
7290
91+ // Query resources uses 'applied' as action
92+ const QueryResource = BaseResource . extend ( {
93+ id : 'Query' ,
94+ eventTrackers : [ 'stitch' ] ,
95+ applied : function ( metadata , callback ) {
96+ this . _send_event ( metadata , callback ) ;
97+ }
98+ } ) ;
99+
100+ // Application resources uses 'connected' as action
101+ const ApplicationResource = BaseResource . extend ( {
102+ id : 'Application' ,
103+ eventTrackers : [ 'stitch' ] ,
104+ connected : function ( metadata , callback ) {
105+ this . _send_event ( metadata , callback ) ;
106+ }
107+ } ) ;
108+
109+ // ValidationRules resources uses 'fetched' as action
110+ const ValidationRulesResource = BaseResource . extend ( {
111+ id : 'Validation Rules' ,
112+ eventTrackers : [ 'stitch' ] ,
113+ fetched : function ( metadata , callback ) {
114+ this . _send_event ( metadata , callback ) ;
115+ }
116+ } ) ;
117+
118+ // Explain resources uses 'fetched' as action
119+ const ExplainResource = BaseResource . extend ( {
120+ id : 'Explain' ,
121+ eventTrackers : [ 'stitch' ] ,
122+ fetched : function ( metadata , callback ) {
123+ this . _send_event ( metadata , callback ) ;
124+ }
125+ } ) ;
126+
127+ // Document resources uses 'inserted', 'updated', and 'deleted' as actions
128+ const DocumentResource = BaseResource . extend ( {
129+ id : 'Document' ,
130+ eventTrackers : [ 'stitch' ] ,
131+ inserted : function ( metadata , callback ) {
132+ this . _send_event ( metadata , callback ) ;
133+ } ,
134+ updated : function ( metadata , callback ) {
135+ this . _send_event ( metadata , callback ) ;
136+ } ,
137+ deleted : function ( metadata , callback ) {
138+ this . _send_event ( metadata , callback ) ;
139+ }
140+ } ) ;
141+
142+ // Documents resources uses 'loaded' as action
143+ const DocumentsResource = BaseResource . extend ( {
144+ id : 'Documents' ,
145+ eventTrackers : [ 'stitch' ] ,
146+ loaded : function ( metadata , callback ) {
147+ this . _send_event ( metadata , callback ) ;
148+ }
149+ } ) ;
150+
151+ // DocumentsListView resources uses 'paginated' as action
152+ const DocumentsListViewResource = BaseResource . extend ( {
153+ id : 'Documents List View' ,
154+ eventTrackers : [ 'stitch' ] ,
155+ paginated : function ( metadata , callback ) {
156+ this . _send_event ( metadata , callback ) ;
157+ }
158+ } ) ;
159+
160+ // DocumentsTableView resources uses 'paginated' as action
161+ const DocumentsTableViewResource = BaseResource . extend ( {
162+ id : 'Documents Table View' ,
163+ eventTrackers : [ 'stitch' ] ,
164+ paginated : function ( metadata , callback ) {
165+ this . _send_event ( metadata , callback ) ;
166+ }
167+ } ) ;
168+
73169const AutoUpdateResource = BaseResource . extend ( {
74170 id : 'Auto Update' ,
75171 eventTrackers : [ 'ga' , 'intercom' , 'stitch' ] ,
@@ -99,6 +195,16 @@ featureResources.Collection = new CollectionResource();
99195featureResources . Deployment = new DeploymentResource ( ) ;
100196featureResources . Schema = new SchemaResource ( ) ;
101197featureResources . Indexes = new IndexesResource ( ) ;
198+ featureResources [ 'Collection Stats' ] = new CollectionStatsResource ( ) ;
199+ featureResources . Topology = new TopologyResource ( ) ;
200+ featureResources . Query = new QueryResource ( ) ;
201+ featureResources . Application = new ApplicationResource ( ) ;
202+ featureResources [ 'Validation Rules' ] = new ValidationRulesResource ( ) ;
203+ featureResources . Explain = new ExplainResource ( ) ;
204+ featureResources . Document = new DocumentResource ( ) ;
205+ featureResources . Documents = new DocumentsResource ( ) ;
206+ featureResources . DocumentsListView = new DocumentsListViewResource ( ) ;
207+ featureResources . DocumentsTableView = new DocumentsTableViewResource ( ) ;
102208
103209debug ( 'feature resources' , featureResources ) ;
104210
0 commit comments