@@ -20,15 +20,15 @@ const features = [
20
20
const featureResources = _ . object ( _ . map ( features , function ( feature ) {
21
21
const Klass = FeatureResource . extend ( {
22
22
id : feature ,
23
- eventTrackers : [ 'ga' , 'intercom' , ' stitch']
23
+ eventTrackers : [ 'stitch' ]
24
24
} ) ;
25
25
return [ feature , new Klass ( ) ] ;
26
26
} ) ) ;
27
27
28
28
// Geo Data uses `detected` as action
29
29
const GeoDataResource = FeatureResource . extend ( {
30
30
id : 'Geo Data' ,
31
- eventTrackers : [ 'ga' , 'intercom' , ' stitch'] ,
31
+ eventTrackers : [ 'stitch' ] ,
32
32
detected : function ( metadata , callback ) {
33
33
this . _send_event ( metadata , callback ) ;
34
34
}
@@ -37,7 +37,7 @@ const GeoDataResource = FeatureResource.extend({
37
37
// Collection uses `fetched` as action
38
38
const CollectionResource = FeatureResource . extend ( {
39
39
id : 'Collection' ,
40
- eventTrackers : [ 'ga' , 'intercom' , ' stitch'] ,
40
+ eventTrackers : [ 'stitch' ] ,
41
41
fetched : function ( metadata , callback ) {
42
42
this . _send_event ( metadata , callback ) ;
43
43
}
@@ -55,21 +55,117 @@ const DeploymentResource = FeatureResource.extend({
55
55
// Schema resource uses `sampled` as action
56
56
const SchemaResource = BaseResource . extend ( {
57
57
id : 'Schema' ,
58
- eventTrackers : [ 'ga' , 'intercom' , ' stitch'] ,
58
+ eventTrackers : [ 'stitch' ] ,
59
59
sampled : function ( metadata , callback ) {
60
60
this . _send_event ( metadata , callback ) ;
61
61
}
62
62
} ) ;
63
63
64
- // Index resource uses `detected ` as action
64
+ // Index resource uses `fetched ` as action
65
65
const IndexesResource = BaseResource . extend ( {
66
66
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' ] ,
68
86
detected : function ( metadata , callback ) {
69
87
this . _send_event ( metadata , callback ) ;
70
88
}
71
89
} ) ;
72
90
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
+
73
169
const AutoUpdateResource = BaseResource . extend ( {
74
170
id : 'Auto Update' ,
75
171
eventTrackers : [ 'ga' , 'intercom' , 'stitch' ] ,
@@ -99,6 +195,16 @@ featureResources.Collection = new CollectionResource();
99
195
featureResources . Deployment = new DeploymentResource ( ) ;
100
196
featureResources . Schema = new SchemaResource ( ) ;
101
197
featureResources . 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 ( ) ;
102
208
103
209
debug ( 'feature resources' , featureResources ) ;
104
210
0 commit comments