Merge pull request #13497 from overleaf/jdt-extract-user-feature-set

Extract user feature set to analytics

GitOrigin-RevId: 41d25c9f32a01ffb27cf66217418d6014b20e841
This commit is contained in:
Jimmy Domagala-Tang 2023-06-28 10:19:56 -04:00 committed by Copybot
parent 137eda06f0
commit 6ee5f6a0a0
2 changed files with 104 additions and 2 deletions

84
package-lock.json generated
View file

@ -39360,7 +39360,7 @@
"minimist": "^1.2.7",
"mixpanel": "^0.13.0",
"moment": "^2.29.4",
"mongodb": "^3.6.6",
"mongodb": "^4.13.0",
"p-limit": "^2.3.0",
"pg": "^8.7.1",
"pg-copy-streams": "^2.2.2",
@ -39386,6 +39386,57 @@
"sinon-chai": "^3.7.0"
}
},
"services/analytics/node_modules/bson": {
"version": "4.7.2",
"resolved": "https://registry.npmjs.org/bson/-/bson-4.7.2.tgz",
"integrity": "sha512-Ry9wCtIZ5kGqkJoi6aD8KjxFZEx78guTQDnpXWiNthsxzrxAK/i8E6pCHAIZTbaEFWcOCvbecMukfK7XUvyLpQ==",
"dependencies": {
"buffer": "^5.6.0"
},
"engines": {
"node": ">=6.9.0"
}
},
"services/analytics/node_modules/buffer": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
"integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/feross"
},
{
"type": "patreon",
"url": "https://www.patreon.com/feross"
},
{
"type": "consulting",
"url": "https://feross.org/support"
}
],
"dependencies": {
"base64-js": "^1.3.1",
"ieee754": "^1.1.13"
}
},
"services/analytics/node_modules/mongodb": {
"version": "4.16.0",
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-4.16.0.tgz",
"integrity": "sha512-0EB113Fsucaq1wsY0dOhi1fmZOwFtLOtteQkiqOXGklvWMnSH3g2QS53f0KTP+/6qOkuoXE2JksubSZNmxeI+g==",
"dependencies": {
"bson": "^4.7.2",
"mongodb-connection-string-url": "^2.5.4",
"socks": "^2.7.1"
},
"engines": {
"node": ">=12.9.0"
},
"optionalDependencies": {
"@aws-sdk/credential-providers": "^3.186.0",
"saslprep": "^1.0.3"
}
},
"services/analytics/node_modules/p-limit": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
@ -48680,7 +48731,7 @@
"mixpanel": "^0.13.0",
"mocha": "^10.2.0",
"moment": "^2.29.4",
"mongodb": "^3.6.6",
"mongodb": "^4.13.0",
"p-limit": "^2.3.0",
"pg": "^8.7.1",
"pg-copy-streams": "^2.2.2",
@ -48697,6 +48748,35 @@
"yargs": "^17.0.0"
},
"dependencies": {
"bson": {
"version": "4.7.2",
"resolved": "https://registry.npmjs.org/bson/-/bson-4.7.2.tgz",
"integrity": "sha512-Ry9wCtIZ5kGqkJoi6aD8KjxFZEx78guTQDnpXWiNthsxzrxAK/i8E6pCHAIZTbaEFWcOCvbecMukfK7XUvyLpQ==",
"requires": {
"buffer": "^5.6.0"
}
},
"buffer": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
"integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
"requires": {
"base64-js": "^1.3.1",
"ieee754": "^1.1.13"
}
},
"mongodb": {
"version": "4.16.0",
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-4.16.0.tgz",
"integrity": "sha512-0EB113Fsucaq1wsY0dOhi1fmZOwFtLOtteQkiqOXGklvWMnSH3g2QS53f0KTP+/6qOkuoXE2JksubSZNmxeI+g==",
"requires": {
"@aws-sdk/credential-providers": "^3.186.0",
"bson": "^4.7.2",
"mongodb-connection-string-url": "^2.5.4",
"saslprep": "^1.0.3",
"socks": "^2.7.1"
}
},
"p-limit": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",

View file

@ -0,0 +1,22 @@
/* eslint-disable no-unused-vars */
const Helpers = require('./lib/helpers')
exports.tags = ['saas']
const index = {
key: {
featuresUpdatedAt: 1,
},
name: 'featuresUpdatedAt_1',
}
exports.migrate = async client => {
const { db } = client
await Helpers.addIndexesToCollection(db.users, [index])
}
exports.rollback = async client => {
const { db } = client
await Helpers.dropIndexesFromCollection(db.users, [index])
}