diff --git a/example/package-lock.json b/example/package-lock.json index c6744f7..6a6881a 100644 --- a/example/package-lock.json +++ b/example/package-lock.json @@ -1110,9 +1110,9 @@ }, "dependencies": { "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "rimraf": { @@ -1996,9 +1996,9 @@ } }, "ansi-regex": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz", + "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==" }, "ansi-styles": { "version": "4.3.0", @@ -2375,24 +2375,24 @@ "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" }, "big-integer": { - "version": "1.6.48", - "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.48.tgz", - "integrity": "sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w==" + "version": "1.6.51", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", + "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==" }, "bplist-creator": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.0.8.tgz", - "integrity": "sha512-Za9JKzD6fjLC16oX2wsXfc+qBEhJBJB1YPInoAQpMLhDuj5aVOv1baGeIQSq1Fr3OCqzvsoQcSBSwGId/Ja2PA==", + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.1.0.tgz", + "integrity": "sha512-sXaHZicyEEmY86WyueLTQesbeoH/mquvarJaQNbjuOQO+7gbFcDEWqKmcWA4cOTLzFlfgvkiVxolk1k5bBIpmg==", "requires": { - "stream-buffers": "~2.2.0" + "stream-buffers": "2.2.x" } }, "bplist-parser": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.2.0.tgz", - "integrity": "sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.3.1.tgz", + "integrity": "sha512-PyJxiNtA5T2PlLIeBot4lbp7rj4OadzjnMZD/G5zuBNt8ei/yCU7+wW0h2bag9vr8c+/WuRWmSxbqAl9hL1rBA==", "requires": { - "big-integer": "^1.6.44" + "big-integer": "1.6.x" } }, "brace-expansion": { @@ -2583,9 +2583,9 @@ }, "dependencies": { "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" }, "strip-ansi": { "version": "6.0.0", @@ -3234,9 +3234,9 @@ } }, "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "cross-spawn": { @@ -5684,9 +5684,9 @@ }, "dependencies": { "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" }, "fs-extra": { "version": "1.0.0", @@ -6015,9 +6015,9 @@ } }, "minimist": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" }, "mixin-deep": { "version": "1.3.2", @@ -6104,9 +6104,33 @@ } }, "node-fetch": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", - "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "requires": { + "whatwg-url": "^5.0.0" + }, + "dependencies": { + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + } + } }, "node-int64": { "version": "0.4.0", @@ -6654,13 +6678,12 @@ } }, "plist": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.2.tgz", - "integrity": "sha512-MSrkwZBdQ6YapHy87/8hDU8MnIcyxBKjeF+McXnr5A9MtffPewTs7G3hlpodT5TacyfIyFTaJEhh3GGcmasTgQ==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/plist/-/plist-3.0.5.tgz", + "integrity": "sha512-83vX4eYdQp3vP9SxuYgEM/G/pJQqLUz/V/xzPrzruLs7fz7jxGQ1msZ/mg1nwZxUSuOp4sb+/bEIbRrbzZRxDA==", "requires": { "base64-js": "^1.5.1", - "xmlbuilder": "^9.0.7", - "xmldom": "^0.5.0" + "xmlbuilder": "^9.0.7" } }, "posix-character-classes": { @@ -6701,9 +6724,9 @@ }, "dependencies": { "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" } } }, @@ -6889,6 +6912,13 @@ "strip-ansi": "^5.2.0", "sudo-prompt": "^9.0.0", "wcwidth": "^1.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" + } } }, "chalk": { @@ -7491,9 +7521,9 @@ } }, "shelljs": { - "version": "0.8.4", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz", - "integrity": "sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==", + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", + "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", "requires": { "glob": "^7.0.0", "interpret": "^1.0.0", @@ -7524,13 +7554,13 @@ "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" }, "simple-plist": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/simple-plist/-/simple-plist-1.1.1.tgz", - "integrity": "sha512-pKMCVKvZbZTsqYR6RKgLfBHkh2cV89GXcA/0CVPje3sOiNOnXA8+rp/ciAMZ7JRaUdLzlEM6JFfUn+fS6Nt3hg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/simple-plist/-/simple-plist-1.3.1.tgz", + "integrity": "sha512-iMSw5i0XseMnrhtIzRb7XpQEXepa9xhWxGUojHBL43SIpQuDQkh3Wpy67ZbDzZVr6EKxvwVChnVpdl8hEVLDiw==", "requires": { - "bplist-creator": "0.0.8", - "bplist-parser": "0.2.0", - "plist": "^3.0.1" + "bplist-creator": "0.1.0", + "bplist-parser": "0.3.1", + "plist": "^3.0.5" } }, "sisteransi": { @@ -7831,9 +7861,9 @@ }, "dependencies": { "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "strip-ansi": { @@ -7858,9 +7888,9 @@ }, "dependencies": { "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" }, "is-fullwidth-code-point": { "version": "3.0.0", @@ -8008,9 +8038,9 @@ } }, "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "astral-regex": { @@ -8111,9 +8141,9 @@ } }, "tmpl": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", - "integrity": "sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=" + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==" }, "to-fast-properties": { "version": "2.0.0", @@ -8551,9 +8581,9 @@ }, "dependencies": { "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" }, "strip-ansi": { "version": "6.0.0", @@ -8622,11 +8652,6 @@ "sax": "^1.2.1" } }, - "xmldom": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.5.0.tgz", - "integrity": "sha512-Foaj5FXVzgn7xFzsKeNIde9g6aFBxTPi37iwsno8QvApmtg7KYrr+OPyRHcJF7dud2a5nGRBXK3n0dL62Gf7PA==" - }, "xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", diff --git a/package-lock.json b/package-lock.json index 58338ce..a8247a5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3555,9 +3555,9 @@ } }, "@splitsoftware/splitio-commons": { - "version": "1.2.1-rc.10", - "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-1.2.1-rc.10.tgz", - "integrity": "sha512-Ne+0bUkKy1XBd4cI8BObcMP5jr1d+v98JzND0AHUVOuie2U6J9bvuZ+HBUvO7bhu9aSD0etjnip6dyK9CFrkGA==", + "version": "1.2.1-rc.11", + "resolved": "https://registry.npmjs.org/@splitsoftware/splitio-commons/-/splitio-commons-1.2.1-rc.11.tgz", + "integrity": "sha512-kiba0u5Fnn9O+MBKhM140KnVm7zsY77sIyBrTodOo2EKNHTw8p88eBPnLiR5rRyurQ8AJpMosdrlRphGuQLMYQ==", "requires": { "tslib": "^2.3.1" }, @@ -4583,27 +4583,27 @@ "dev": true }, "big-integer": { - "version": "1.6.48", - "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.48.tgz", - "integrity": "sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w==", + "version": "1.6.51", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", + "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==", "dev": true }, "bplist-creator": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.0.8.tgz", - "integrity": "sha512-Za9JKzD6fjLC16oX2wsXfc+qBEhJBJB1YPInoAQpMLhDuj5aVOv1baGeIQSq1Fr3OCqzvsoQcSBSwGId/Ja2PA==", + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.1.0.tgz", + "integrity": "sha512-sXaHZicyEEmY86WyueLTQesbeoH/mquvarJaQNbjuOQO+7gbFcDEWqKmcWA4cOTLzFlfgvkiVxolk1k5bBIpmg==", "dev": true, "requires": { - "stream-buffers": "~2.2.0" + "stream-buffers": "2.2.x" } }, "bplist-parser": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.2.0.tgz", - "integrity": "sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.3.1.tgz", + "integrity": "sha512-PyJxiNtA5T2PlLIeBot4lbp7rj4OadzjnMZD/G5zuBNt8ei/yCU7+wW0h2bag9vr8c+/WuRWmSxbqAl9hL1rBA==", "dev": true, "requires": { - "big-integer": "^1.6.44" + "big-integer": "1.6.x" } }, "brace-expansion": { @@ -13905,14 +13905,14 @@ "dev": true }, "simple-plist": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/simple-plist/-/simple-plist-1.1.1.tgz", - "integrity": "sha512-pKMCVKvZbZTsqYR6RKgLfBHkh2cV89GXcA/0CVPje3sOiNOnXA8+rp/ciAMZ7JRaUdLzlEM6JFfUn+fS6Nt3hg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/simple-plist/-/simple-plist-1.3.1.tgz", + "integrity": "sha512-iMSw5i0XseMnrhtIzRb7XpQEXepa9xhWxGUojHBL43SIpQuDQkh3Wpy67ZbDzZVr6EKxvwVChnVpdl8hEVLDiw==", "dev": true, "requires": { - "bplist-creator": "0.0.8", - "bplist-parser": "0.2.0", - "plist": "^3.0.1" + "bplist-creator": "0.1.0", + "bplist-parser": "0.3.1", + "plist": "^3.0.5" } }, "sisteransi": { diff --git a/package.json b/package.json index e574f3e..fe81b94 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ }, "homepage": "https://github.com/splitio/react-native-client#readme", "dependencies": { - "@splitsoftware/splitio-commons": "1.2.1-rc.10" + "@splitsoftware/splitio-commons": "1.2.1-rc.11" }, "devDependencies": { "@react-native-community/eslint-config": "^2.0.0", diff --git a/src/platform/getModules.ts b/src/platform/getModules.ts index f44d0cf..76650af 100644 --- a/src/platform/getModules.ts +++ b/src/platform/getModules.ts @@ -11,6 +11,7 @@ import { shouldAddPt } from '@splitsoftware/splitio-commons/src/trackers/impress import { ISdkFactoryParams } from '@splitsoftware/splitio-commons/src/sdkFactory/types'; import { ISettings } from '@splitsoftware/splitio-commons/src/types'; import { LOCALHOST_MODE } from '@splitsoftware/splitio-commons/src/utils/constants'; +import { userConsentProps } from '@splitsoftware/splitio-commons/src/sdkFactory/userConsentProps'; import { RNSignalListener } from './RNSignalListener'; import { getEventSource } from './getEventSource'; @@ -45,6 +46,8 @@ export function getModules(settings: ISettings): ISdkFactoryParams { SignalListener: RNSignalListener as ISdkFactoryParams['SignalListener'], impressionsObserverFactory: shouldAddPt(settings) ? impressionObserverCSFactory : undefined, + + extraProps: userConsentProps, }; if (settings.mode === LOCALHOST_MODE) { diff --git a/src/settings/__tests__/index.spec.ts b/src/settings/__tests__/index.spec.ts new file mode 100644 index 0000000..a9fc014 --- /dev/null +++ b/src/settings/__tests__/index.spec.ts @@ -0,0 +1,18 @@ +import { settingsValidator as slimSettingsValidator } from '../index'; +import { settingsValidator as fullSettingsValidator } from '../index'; + +test('SETTINGS / Consent is overwritable and "GRANTED" by default', () => { + [slimSettingsValidator, fullSettingsValidator].forEach((settingsValidator) => { + let settings = settingsValidator({}); + expect(settings.userConsent).toEqual('GRANTED'); // userConsent defaults to granted if not provided + + settings = settingsValidator({ userConsent: 'INVALID-VALUE' }); + expect(settings.userConsent).toEqual('GRANTED'); // userConsent defaults to granted if a wrong value is provided + + settings = settingsValidator({ userConsent: 'UNKNOWN' }); + expect(settings.userConsent).toEqual('UNKNOWN'); // userConsent can be overwritten + + settings = settingsValidator({ userConsent: 'declined' }); + expect(settings.userConsent).toEqual('DECLINED'); // userConsent can be overwritten + }); +}); diff --git a/src/settings/defaults.ts b/src/settings/defaults.ts index d7d5e08..90535be 100644 --- a/src/settings/defaults.ts +++ b/src/settings/defaults.ts @@ -1,3 +1,6 @@ +import { ConsentStatus } from '@splitsoftware/splitio-commons/src/types'; +import { CONSENT_GRANTED } from '@splitsoftware/splitio-commons/src/utils/constants'; + const packageVersion = '0.1.1-rc.0'; export const defaults = { @@ -12,6 +15,9 @@ export const defaults = { eventsFirstPushWindow: 10, }, + // Consent is considered granted by default + userConsent: CONSENT_GRANTED as ConsentStatus, + // Instance version. version: `reactnative-${packageVersion}`, diff --git a/src/settings/full.ts b/src/settings/full.ts index 13146d7..0ce7c37 100644 --- a/src/settings/full.ts +++ b/src/settings/full.ts @@ -5,16 +5,17 @@ import { validateStorageCS } from '@splitsoftware/splitio-commons/src/utils/sett import { validatePluggableIntegrations } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/integrations/pluggable'; import { validateLogger } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/logger/pluggableLogger'; import { validateLocalhostWithDefault } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/localhost/builtin'; +import { validateConsent } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/consent'; const params = { defaults, + acceptKey: true, // Client with bound key runtime: validateRuntime, storage: validateStorageCS, integrations: validatePluggableIntegrations, logger: validateLogger, - // Full SplitFactory returns a default instance, except a valid one is provided - localhost: validateLocalhostWithDefault, - consent: () => undefined, // @TODO replace to support user consent + localhost: validateLocalhostWithDefault, // Full SplitFactory provides a default localhost module, except a valid one is provided + consent: validateConsent, }; export function settingsValidator(config: any) { diff --git a/src/settings/index.ts b/src/settings/index.ts index 785b375..00f939f 100644 --- a/src/settings/index.ts +++ b/src/settings/index.ts @@ -5,16 +5,17 @@ import { validateStorageCS } from '@splitsoftware/splitio-commons/src/utils/sett import { validatePluggableIntegrations } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/integrations/pluggable'; import { validateLogger } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/logger/pluggableLogger'; import { validateLocalhost } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/localhost/pluggable'; +import { validateConsent } from '@splitsoftware/splitio-commons/src/utils/settingsValidation/consent'; const params = { defaults, + acceptKey: true, // Client with bound key runtime: validateRuntime, storage: validateStorageCS, integrations: validatePluggableIntegrations, logger: validateLogger, - // Slim SplitFactory validates that the localhost module is passed in localhost mode - localhost: validateLocalhost, - consent: () => undefined, // @TODO replace to support user consent + localhost: validateLocalhost, // Slim SplitFactory validates that the localhost module is passed in localhost mode + consent: validateConsent, }; export function settingsValidator(config: any) { diff --git a/types/splitio.d.ts b/types/splitio.d.ts index c529351..05e04b2 100644 --- a/types/splitio.d.ts +++ b/types/splitio.d.ts @@ -50,6 +50,7 @@ interface ISettings { readonly scheduler: { featuresRefreshRate: number, impressionsRefreshRate: number, + impressionsQueueSize: number, segmentsRefreshRate: number, offlineRefreshRate: number, eventsPushRate: number, @@ -81,7 +82,8 @@ interface ISettings { splitFilters: SplitIO.SplitFilter[], impressionsMode: SplitIO.ImpressionsMode, localhostMode?: SplitIO.LocalhostFactory - } + }, + readonly userConsent: SplitIO.ConsentStatus } /** * Log levels. @@ -334,12 +336,17 @@ declare namespace SplitIO { type Event = 'init::timeout' | 'init::ready' | 'init::cache-ready' | 'state::update'; /** * Split attributes should be on object with values of type string or number (dates should be sent as millis since epoch). - * @typedef {Object.} Attributes + * @typedef {Object.} Attributes * @see {@link https://help.split.io/hc/en-us/articles/4406066357901#attribute-syntax} */ type Attributes = { - [attributeName: string]: string | number | boolean | Array + [attributeName: string]: AttributeType }; + /** + * Type of an attribute value + * @typedef {string | number | boolean | Array} AttributeType + */ + type AttributeType = string | number | boolean | Array; /** * Split properties should be an object with values of type string, number, boolean or null. Size limit of ~31kb. * @typedef {Object.} Attributes @@ -583,6 +590,11 @@ declare namespace SplitIO { * @typedef {string} ImpressionsMode */ type ImpressionsMode = 'OPTIMIZED' | 'DEBUG'; + /** + * User consent status. + * @typedef {string} ConsentStatus + */ + type ConsentStatus = 'GRANTED' | 'DECLINED' | 'UNKNOWN'; /** * Logger * Its interface details are not part of the public API. It shouldn't be used directly. @@ -647,6 +659,13 @@ declare namespace SplitIO { * @default 60 */ impressionsRefreshRate?: number, + /** + * The maximum number of impression items we want to queue. If we queue more values, it will trigger a flush and reset the timer. + * If you use a 0 here, the queue will have no maximum size. + * @property {number} impressionsQueueSize + * @default 30000 + */ + impressionsQueueSize?: number, /** * The SDK polls Split servers for changes to segment definitions. This parameter controls this polling period in seconds. * @property {number} segmentsRefreshRate @@ -726,6 +745,17 @@ declare namespace SplitIO { * @todo at the moment there are not integrations to plug in React Native SDK. */ integrations?: IntegrationFactory[], + /** + * User consent status. Possible values are `'GRANTED'`, which is the default, `'DECLINED'` or `'UNKNOWN'`. + * - `'GRANTED'`: the user has granted consent for tracking events and impressions. The SDK will send them to Split cloud. + * - `'DECLINED'`: the user has declined consent for tracking events and impressions. The SDK will not send them to Split cloud. + * - `'UNKNOWN'`: the user has neither granted nor declined consent for tracking events and impressions. The SDK will track them in its internal storage, and eventually send + * them or not if the consent status is updated to 'GRANTED' or 'DECLINED' respectively. The status can be updated at any time with the `setUserConsent` factory method. + * + * @typedef {string} userConsent + * @default 'GRANTED' + */ + userConsent?: ConsentStatus } /** * This represents the interface for the SDK instance with synchronous storage and client-side API, @@ -752,7 +782,26 @@ declare namespace SplitIO { * @function manager * @returns {IManager} The manager instance. */ - manager(): IManager + manager(): IManager, + /** + * Set or update the user consent status. Possible values are `true` and `false`, which represent user consent `'GRANTED'` and `'DECLINED'` respectively. + * - `true ('GRANTED')`: the user has granted consent for tracking events and impressions. The SDK will send them to Split cloud. + * - `false ('DECLINED')`: the user has declined consent for tracking events and impressions. The SDK will not send them to Split cloud. + * + * NOTE: calling this method updates the user consent at a factory level, affecting all clients of the same factory. + * + * @function setUserConsent + * @param {boolean} userConsent The user consent status, true for 'GRANTED' and false for 'DECLINED'. + * @returns {boolean} Whether the provided param is a valid value (i.e., a boolean value) or not. + */ + setUserConsent(userConsent: boolean): boolean; + /** + * Get the user consent status. + * + * @function getUserConsent + * @returns {ConsentStatus} The user consent status. + */ + getUserConsent(): SplitIO.ConsentStatus; } /** @@ -918,6 +967,47 @@ declare namespace SplitIO { * @returns {boolean} Whether the event was added to the queue successfully or not. */ track(trafficType: string, eventType: string, value?: number, properties?: Properties): boolean, + /** + * Add an attribute to client's in memory attributes storage. + * + * @param {string} attributeName Attribute name + * @param {AttributeType} attributeValue Attribute value + * @returns {boolean} true if the attribute was stored and false otherwise + */ + setAttribute(attributeName: string, attributeValue: AttributeType): boolean, + /** + * Returns the attribute with the given key. + * + * @param {string} attributeName Attribute name + * @returns {AttributeType} Attribute with the given key + */ + getAttribute(attributeName: string): AttributeType, + /** + * Removes from client's in memory attributes storage the attribute with the given key. + * + * @param {string} attributeName + * @returns {boolean} true if attribute was removed and false otherwise + */ + removeAttribute(attributeName: string): boolean, + /** + * Add to client's in memory attributes storage the attributes in 'attributes'. + * + * @param {Attributes} attributes Object with attributes to store + * @returns true if attributes were stored an false otherwise + */ + setAttributes(attributes: Attributes): boolean, + /** + * Return all the attributes stored in client's in memory attributes storage. + * + * @returns {Attributes} returns all the stored attributes + */ + getAttributes(): Attributes, + /** + * Remove all the stored attributes in the client's in memory attribute storage. + * + * @returns {boolean} true if all attribute were removed and false otherwise + */ + clearAttributes(): boolean, } /** * Representation of a manager instance with synchronous storage of the SDK.