summaryrefslogtreecommitdiff
path: root/node_modules/@jet-app/app-store/tmp/src/common/privacy/privacy-suppression.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/@jet-app/app-store/tmp/src/common/privacy/privacy-suppression.js')
-rw-r--r--node_modules/@jet-app/app-store/tmp/src/common/privacy/privacy-suppression.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/node_modules/@jet-app/app-store/tmp/src/common/privacy/privacy-suppression.js b/node_modules/@jet-app/app-store/tmp/src/common/privacy/privacy-suppression.js
new file mode 100644
index 0000000..f43144f
--- /dev/null
+++ b/node_modules/@jet-app/app-store/tmp/src/common/privacy/privacy-suppression.js
@@ -0,0 +1,34 @@
+import { isNothing } from "@jet/environment/types/optional";
+import * as serverData from "../../foundation/json-parsing/server-data";
+let suppressedPrivacyApps = null;
+function initialize(objectGraph) {
+ if (suppressedPrivacyApps !== null) {
+ return;
+ }
+ suppressedPrivacyApps = new Set();
+ for (const appId of objectGraph.bag.suppressedPrivacyAppIds) {
+ suppressedPrivacyApps.add(appId);
+ }
+}
+export function shouldSuppressPrivacyInformationForAdamId(objectGraph, adamId) {
+ initialize(objectGraph);
+ if (isNothing(suppressedPrivacyApps) || serverData.isNullOrEmpty(adamId)) {
+ return false;
+ }
+ return suppressedPrivacyApps.has(adamId);
+}
+export function shouldSuppressPrivacyInformationForBundleId(objectGraph, bundleId) {
+ initialize(objectGraph);
+ if (isNothing(suppressedPrivacyApps) || serverData.isNullOrEmpty(bundleId)) {
+ return false;
+ }
+ /// This handles a special case wildcard entry for macOS installers, to avoid the churn of adding new bundleIDs
+ /// for each macOS release. We specifically do not want to treat all entries in `suppressedPrivacyApps` as a regex,
+ /// as there is no expectation that any other entry will be a regex, and treating them as such may lead to false matches.
+ if (suppressedPrivacyApps.has("com.apple.InstallAssistant.*") &&
+ bundleId.startsWith("com.apple.InstallAssistant.")) {
+ return true;
+ }
+ return suppressedPrivacyApps.has(bundleId);
+}
+//# sourceMappingURL=privacy-suppression.js.map \ No newline at end of file