@marktiderman/genesis-cli 1.6.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/README.md +156 -1
  2. package/dist/cli.js +2769 -567
  3. package/dist/cli.js.map +1 -1
  4. package/dist/{config-CUdwT-nY.d.ts → config-CrZbM3jD.d.ts} +45 -2
  5. package/dist/doctor.d.ts +2 -2
  6. package/dist/doctor.js +133 -5
  7. package/dist/doctor.js.map +1 -1
  8. package/dist/expo.d.ts +91 -8
  9. package/dist/expo.js +207 -14
  10. package/dist/expo.js.map +1 -1
  11. package/dist/genesis-catalog.json +502 -0
  12. package/dist/index.d.ts +1 -1
  13. package/dist/index.js +140 -9
  14. package/dist/index.js.map +1 -1
  15. package/dist/scaffolder.d.ts +1 -1
  16. package/dist/scaffolder.js +7 -4
  17. package/dist/scaffolder.js.map +1 -1
  18. package/dist/starter/.eas/scripts/rollout-health.mjs +85 -0
  19. package/dist/starter/.eas/workflows/deploy-production.yml +149 -0
  20. package/dist/starter/.eas/workflows/e2e.yml +77 -0
  21. package/dist/starter/.eas/workflows/pr-preview.yml +117 -0
  22. package/dist/starter/.eas/workflows/rollout.yml +120 -0
  23. package/dist/starter/.env.example +11 -0
  24. package/dist/starter/.fingerprintignore +7 -0
  25. package/dist/starter/.maestro/README.md +38 -0
  26. package/dist/starter/.maestro/config.yaml +5 -0
  27. package/dist/starter/.maestro/flows/deep-link.yaml +22 -0
  28. package/dist/starter/.maestro/flows/launch.yaml +17 -0
  29. package/dist/starter/.maestro/flows/settings-version.yaml +28 -0
  30. package/dist/starter/.maestro/flows/sign-in-screen.yaml +17 -0
  31. package/dist/starter/.maestro/subflows/sign-in.yaml +20 -0
  32. package/dist/starter/README.md +314 -0
  33. package/dist/starter/__tests__/app-config.test.ts +51 -0
  34. package/dist/starter/__tests__/check-in-photos.test.ts +57 -0
  35. package/dist/starter/__tests__/components/css-stub.js +2 -0
  36. package/dist/starter/__tests__/components/fake-supabase.ts +136 -0
  37. package/dist/starter/__tests__/components/links.test.ts +25 -0
  38. package/dist/starter/__tests__/components/render-app.ts +22 -0
  39. package/dist/starter/__tests__/components/reports.ts +10 -0
  40. package/dist/starter/__tests__/components/resolver.js +12 -0
  41. package/dist/starter/__tests__/components/root-layout.test.tsx +55 -0
  42. package/dist/starter/__tests__/components/session-storage.test.tsx +81 -0
  43. package/dist/starter/__tests__/components/settings.test.tsx +134 -0
  44. package/dist/starter/__tests__/components/setup.ts +69 -0
  45. package/dist/starter/__tests__/components/sign-in.test.tsx +90 -0
  46. package/dist/starter/__tests__/components/tabs-feature-off.test.tsx +19 -0
  47. package/dist/starter/__tests__/components/tabs.test.tsx +43 -0
  48. package/dist/starter/__tests__/components/tabs.ts +12 -0
  49. package/dist/starter/__tests__/entry.test.ts +28 -0
  50. package/dist/starter/__tests__/inline-copy.ts +59 -0
  51. package/dist/starter/__tests__/starter.test.ts +319 -0
  52. package/dist/starter/_gitignore +13 -0
  53. package/dist/starter/app.config.ts +44 -0
  54. package/dist/starter/babel.config.js +9 -0
  55. package/dist/starter/eas.json +47 -0
  56. package/dist/starter/eslint.config.js +5 -0
  57. package/dist/starter/genesis.config.json +12 -0
  58. package/dist/starter/global.css +3 -0
  59. package/dist/starter/index.ts +14 -0
  60. package/dist/starter/jest.config.js +36 -0
  61. package/dist/starter/metro.config.js +38 -0
  62. package/dist/starter/package.json +93 -0
  63. package/dist/starter/pnpm-workspace.yaml +73 -0
  64. package/dist/starter/src/app/(app)/(home)/_layout.tsx +6 -0
  65. package/dist/starter/src/app/(app)/(home)/check-in.tsx +41 -0
  66. package/dist/starter/src/app/(app)/(home)/index.tsx +34 -0
  67. package/dist/starter/src/app/(app)/_layout.tsx +27 -0
  68. package/dist/starter/src/app/(app)/notifications/_layout.tsx +6 -0
  69. package/dist/starter/src/app/(app)/notifications/index.tsx +36 -0
  70. package/dist/starter/src/app/(app)/settings/_layout.tsx +6 -0
  71. package/dist/starter/src/app/(app)/settings/index.tsx +96 -0
  72. package/dist/starter/src/app/(app)/settings/notifications.tsx +16 -0
  73. package/dist/starter/src/app/(app)/settings/support/[id].tsx +23 -0
  74. package/dist/starter/src/app/(app)/settings/support/ideas.tsx +20 -0
  75. package/dist/starter/src/app/(app)/settings/support/index.tsx +20 -0
  76. package/dist/starter/src/app/(app)/settings/support/new.tsx +35 -0
  77. package/dist/starter/src/app/(app)/settings/support/shipped.tsx +20 -0
  78. package/dist/starter/src/app/+native-intent.ts +11 -0
  79. package/dist/starter/src/app/_layout.tsx +20 -0
  80. package/dist/starter/src/app/sign-in.tsx +69 -0
  81. package/dist/starter/src/copy.ts +118 -0
  82. package/dist/starter/src/forms/check-in.json +121 -0
  83. package/dist/starter/src/lib/account.ts +42 -0
  84. package/dist/starter/src/lib/app.ts +52 -0
  85. package/dist/starter/src/lib/auth.ts +80 -0
  86. package/dist/starter/src/lib/check-in-photos.ts +66 -0
  87. package/dist/starter/src/lib/check-in.ts +85 -0
  88. package/dist/starter/src/lib/define-starter.ts +148 -0
  89. package/dist/starter/src/lib/devtools-overlay.ts +34 -0
  90. package/dist/starter/src/lib/devtools.ts +23 -0
  91. package/dist/starter/src/lib/env.ts +33 -0
  92. package/dist/starter/src/lib/google-signin.ts +23 -0
  93. package/dist/starter/src/lib/links.ts +40 -0
  94. package/dist/starter/src/lib/native-modules.ts +27 -0
  95. package/dist/starter/src/lib/notifications.ts +15 -0
  96. package/dist/starter/src/lib/observability.ts +45 -0
  97. package/dist/starter/src/lib/push.ts +49 -0
  98. package/dist/starter/src/lib/supabase.ts +65 -0
  99. package/dist/starter/src/lib/support.ts +44 -0
  100. package/dist/starter/src/lib/updates.ts +61 -0
  101. package/dist/starter/starter.config.ts +37 -0
  102. package/dist/starter/supabase/config.toml +26 -0
  103. package/dist/starter/supabase/functions/genesis-apple-revoke/apple.ts +237 -0
  104. package/dist/starter/supabase/functions/genesis-apple-revoke/handler.ts +227 -0
  105. package/dist/starter/supabase/functions/genesis-apple-revoke/index.ts +55 -0
  106. package/dist/starter/supabase/functions/genesis-push-send/expo.ts +117 -0
  107. package/dist/starter/supabase/functions/genesis-push-send/handler.ts +462 -0
  108. package/dist/starter/supabase/functions/genesis-push-send/index.ts +54 -0
  109. package/dist/starter/supabase/migrations/20261024000000_genesis_account_deletion.sql +133 -0
  110. package/dist/starter/supabase/migrations/20261024000100_genesis_app_release_policy.sql +82 -0
  111. package/dist/starter/supabase/migrations/20261024000200_genesis_apple_token_revocation.sql +205 -0
  112. package/dist/starter/supabase/migrations/20261024000400_genesis_push.sql +524 -0
  113. package/dist/starter/supabase/migrations/20261024000600_genesis_support.sql +846 -0
  114. package/dist/starter/supabase/tests/database/genesis_account_deletion.test.sql +138 -0
  115. package/dist/starter/supabase/tests/database/genesis_app_release_policy.test.sql +148 -0
  116. package/dist/starter/supabase/tests/database/genesis_apple_token_revocation.test.sql +230 -0
  117. package/dist/starter/supabase/tests/database/genesis_push.test.sql +407 -0
  118. package/dist/starter/supabase/tests/database/genesis_support.test.sql +552 -0
  119. package/dist/starter/tailwind.config.mjs +15 -0
  120. package/dist/starter/tsconfig.json +14 -0
  121. package/dist/starter/vitest.config.mts +7 -0
  122. package/dist/templates/ci/app-ci.yml +17 -0
  123. package/dist/templates/ci/genesis-upgrade.yml +21 -0
  124. package/dist/templates/ci/supabase-ci.yml +20 -0
  125. package/dist/templates/eas/eas.json +47 -0
  126. package/dist/templates/eas/scripts/rollout-health.mjs +85 -0
  127. package/dist/templates/eas/workflows/deploy-production.yml +149 -0
  128. package/dist/templates/eas/workflows/e2e.yml +77 -0
  129. package/dist/templates/eas/workflows/pr-preview.yml +117 -0
  130. package/dist/templates/eas/workflows/rollout.yml +120 -0
  131. package/dist/templates/maestro/config.yaml +5 -0
  132. package/dist/templates/maestro/flows/deep-link.yaml +22 -0
  133. package/dist/templates/maestro/flows/launch.yaml +17 -0
  134. package/dist/templates/maestro/flows/settings-version.yaml +28 -0
  135. package/dist/templates/maestro/flows/sign-in-screen.yaml +17 -0
  136. package/dist/templates/maestro/subflows/sign-in.yaml +20 -0
  137. package/dist/vite.js +133 -5
  138. package/dist/vite.js.map +1 -1
  139. package/package.json +4 -4
@@ -198,11 +198,48 @@ interface GenesisLinks {
198
198
  /** Also add `webcredentials:` domains (password autofill). Default true. */
199
199
  webcredentials?: boolean;
200
200
  }
201
+ /**
202
+ * Apple's collected data types (`NSPrivacyCollectedDataType`), every one in
203
+ * Apple's reference, keyed by the stores' own words, lower case, as Genesis
204
+ * blocks name them in `privacy.collects`. Look one up with
205
+ * {@link privacyDataType}, which ignores case (blocks write `"device ID"`,
206
+ * `"user ID"`). The values are Apple's exact strings, `PhotosorVideos`
207
+ * included.
208
+ */
209
+ declare const PRIVACY_DATA_TYPES: Readonly<Record<string, string>>;
210
+ /** Apple's string for a data type in the stores' words, whatever its case, or undefined. */
211
+ declare function privacyDataType(type: string): string | undefined;
212
+ /** Apple's collection purposes (`NSPrivacyCollectedDataTypePurposes`), by the stores' words. */
213
+ declare const PRIVACY_PURPOSES: Readonly<Record<string, string>>;
214
+ /** One kind of data the app collects, as a Genesis block's `privacy.collects` entry says it. */
215
+ interface GenesisDataUse {
216
+ /** A key of {@link PRIVACY_DATA_TYPES}: `"email address"`, `"user id"`, `"crash data"`… */
217
+ type: string;
218
+ /** Keys of {@link PRIVACY_PURPOSES}: `"app functionality"`, `"analytics"`… */
219
+ purposes: string[];
220
+ /** Tied to the person's identity. */
221
+ linked: boolean;
222
+ /** Used to track the person across other companies' apps and websites. */
223
+ tracking: boolean;
224
+ }
225
+ /**
226
+ * The `privacy` block: what goes in the iOS privacy manifest's collected data
227
+ * types. Left out, the Genesis blocks the app's packages carry decide.
228
+ */
229
+ interface GenesisPrivacy {
230
+ /** The Genesis blocks whose data the app sends anywhere (`account`, `observability`, `push`). Default: found from package.json. */
231
+ blocks?: string[];
232
+ /** Every kind of data the app collects. Replaces what the blocks give, so list everything. */
233
+ collects?: GenesisDataUse[];
234
+ /** `NSPrivacyTracking`. Default false; true needs `NSPrivacyTrackingDomains` in app.config. */
235
+ tracking?: boolean;
236
+ }
201
237
  /** genesis.config.json, parsed, with its shared blocks validated. */
202
238
  interface GenesisConfigFile {
203
239
  /** The whole parsed file, for blocks other readers own (`doctor`, `features`). */
204
240
  raw: Record<string, unknown>;
205
241
  links?: GenesisLinks;
242
+ privacy?: GenesisPrivacy;
206
243
  }
207
244
  interface LoadedConfig {
208
245
  config: DoctorConfig;
@@ -214,13 +251,19 @@ interface LoadedConfig {
214
251
  declare function loadConfig(root: string, configPath?: string): LoadedConfig;
215
252
  /**
216
253
  * Reads `<root>/genesis.config.json` and validates its shared blocks (today:
217
- * `links`). Returns null when the file doesn't exist; throws a
254
+ * `links` and `privacy`). Returns null when the file doesn't exist; throws a
218
255
  * GenesisConfigError naming the file when it isn't valid.
219
256
  */
220
257
  declare function readGenesisConfig(root: string): GenesisConfigFile | null;
258
+ /**
259
+ * Check a `privacy` block (genesis.config.json's, or the plugin's `privacy`
260
+ * option): a misspelt data type or purpose fails the build, since Xcode's
261
+ * privacy report ignores values it doesn't know.
262
+ */
263
+ declare function validatePrivacy(raw: unknown, source?: string): GenesisPrivacy;
221
264
  /** Check the `links` block, so a typo'd host fails the build instead of shipping links that never open. */
222
265
  declare function validateLinks(raw: unknown, source?: string): GenesisLinks;
223
266
  /** Check the shape, so a typo fails loudly instead of silently disabling a check. */
224
267
  declare function validateConfig(raw: unknown, source?: string): DoctorConfig;
225
268
 
226
- export { type AllowEntry as A, type DoctorConfig as D, type Finding as F, type GenesisLinks as G, type Level as L, type NativePackConfig as N, type PatternRule as P, type RuleSetting as R, type SourceFile as S, GenesisConfigError as a, DoctorConfigError as b, type DoctorContext as c, type DoctorPlugin as d, type DoctorResult as e, type GenesisConfigFile as f, type GenesisFacts as g, type DoctorPack as h, type FindingInput as i, type PluginSpec as j, type SupabasePackConfig as k, loadConfig as l, validateConfig as m, readGenesisConfig as r, validateLinks as v };
269
+ export { type AllowEntry as A, type DoctorConfig as D, type Finding as F, type GenesisDataUse as G, type Level as L, type NativePackConfig as N, PRIVACY_DATA_TYPES as P, type RuleSetting as R, type SourceFile as S, type GenesisPrivacy as a, type GenesisLinks as b, GenesisConfigError as c, PRIVACY_PURPOSES as d, validatePrivacy as e, DoctorConfigError as f, type DoctorContext as g, type DoctorPlugin as h, type DoctorResult as i, type GenesisConfigFile as j, type GenesisFacts as k, type PatternRule as l, type DoctorPack as m, type FindingInput as n, type PluginSpec as o, privacyDataType as p, type SupabasePackConfig as q, readGenesisConfig as r, loadConfig as s, validateConfig as t, validateLinks as v };
package/dist/doctor.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { D as DoctorConfig, g as GenesisFacts, P as PatternRule, d as DoctorPlugin, e as DoctorResult, F as Finding } from './config-CUdwT-nY.js';
2
- export { A as AllowEntry, b as DoctorConfigError, c as DoctorContext, h as DoctorPack, i as FindingInput, a as GenesisConfigError, f as GenesisConfigFile, G as GenesisLinks, L as Level, N as NativePackConfig, j as PluginSpec, R as RuleSetting, S as SourceFile, k as SupabasePackConfig, l as loadConfig, r as readGenesisConfig, m as validateConfig, v as validateLinks } from './config-CUdwT-nY.js';
1
+ import { D as DoctorConfig, k as GenesisFacts, l as PatternRule, h as DoctorPlugin, i as DoctorResult, F as Finding } from './config-CrZbM3jD.js';
2
+ export { A as AllowEntry, f as DoctorConfigError, g as DoctorContext, m as DoctorPack, n as FindingInput, c as GenesisConfigError, j as GenesisConfigFile, b as GenesisLinks, L as Level, N as NativePackConfig, o as PluginSpec, R as RuleSetting, S as SourceFile, q as SupabasePackConfig, s as loadConfig, r as readGenesisConfig, t as validateConfig, v as validateLinks } from './config-CrZbM3jD.js';
3
3
 
4
4
  /** The installed folder of `name`, looking in node_modules from `from` upward (works with hoisting and pnpm). */
5
5
  declare function findPackageDir(from: string, name: string): string | null;
package/dist/doctor.js CHANGED
@@ -51,6 +51,54 @@ var GenesisConfigError = class extends Error {
51
51
  var DoctorConfigError = class extends GenesisConfigError {
52
52
  name = "DoctorConfigError";
53
53
  };
54
+ var PRIVACY_DATA_TYPES = {
55
+ name: "NSPrivacyCollectedDataTypeName",
56
+ "email address": "NSPrivacyCollectedDataTypeEmailAddress",
57
+ "phone number": "NSPrivacyCollectedDataTypePhoneNumber",
58
+ "physical address": "NSPrivacyCollectedDataTypePhysicalAddress",
59
+ "other user contact info": "NSPrivacyCollectedDataTypeOtherUserContactInfo",
60
+ health: "NSPrivacyCollectedDataTypeHealth",
61
+ fitness: "NSPrivacyCollectedDataTypeFitness",
62
+ "payment info": "NSPrivacyCollectedDataTypePaymentInfo",
63
+ "credit info": "NSPrivacyCollectedDataTypeCreditInfo",
64
+ "other financial info": "NSPrivacyCollectedDataTypeOtherFinancialInfo",
65
+ "precise location": "NSPrivacyCollectedDataTypePreciseLocation",
66
+ "coarse location": "NSPrivacyCollectedDataTypeCoarseLocation",
67
+ "sensitive info": "NSPrivacyCollectedDataTypeSensitiveInfo",
68
+ contacts: "NSPrivacyCollectedDataTypeContacts",
69
+ "emails or text messages": "NSPrivacyCollectedDataTypeEmailsOrTextMessages",
70
+ "photos or videos": "NSPrivacyCollectedDataTypePhotosorVideos",
71
+ "audio data": "NSPrivacyCollectedDataTypeAudioData",
72
+ "gameplay content": "NSPrivacyCollectedDataTypeGameplayContent",
73
+ "customer support": "NSPrivacyCollectedDataTypeCustomerSupport",
74
+ "other user content": "NSPrivacyCollectedDataTypeOtherUserContent",
75
+ "browsing history": "NSPrivacyCollectedDataTypeBrowsingHistory",
76
+ "search history": "NSPrivacyCollectedDataTypeSearchHistory",
77
+ "user id": "NSPrivacyCollectedDataTypeUserID",
78
+ "device id": "NSPrivacyCollectedDataTypeDeviceID",
79
+ "purchase history": "NSPrivacyCollectedDataTypePurchaseHistory",
80
+ "product interaction": "NSPrivacyCollectedDataTypeProductInteraction",
81
+ "advertising data": "NSPrivacyCollectedDataTypeAdvertisingData",
82
+ "other usage data": "NSPrivacyCollectedDataTypeOtherUsageData",
83
+ "crash data": "NSPrivacyCollectedDataTypeCrashData",
84
+ "performance data": "NSPrivacyCollectedDataTypePerformanceData",
85
+ "other diagnostic data": "NSPrivacyCollectedDataTypeOtherDiagnosticData",
86
+ "environment scanning": "NSPrivacyCollectedDataTypeEnvironmentScanning",
87
+ hands: "NSPrivacyCollectedDataTypeHands",
88
+ head: "NSPrivacyCollectedDataTypeHead",
89
+ "other data types": "NSPrivacyCollectedDataTypeOtherDataTypes"
90
+ };
91
+ function privacyDataType(type) {
92
+ return PRIVACY_DATA_TYPES[type.toLowerCase()];
93
+ }
94
+ var PRIVACY_PURPOSES = {
95
+ "app functionality": "NSPrivacyCollectedDataTypePurposeAppFunctionality",
96
+ analytics: "NSPrivacyCollectedDataTypePurposeAnalytics",
97
+ "product personalization": "NSPrivacyCollectedDataTypePurposeProductPersonalization",
98
+ "developer advertising": "NSPrivacyCollectedDataTypePurposeDeveloperAdvertising",
99
+ "third-party advertising": "NSPrivacyCollectedDataTypePurposeThirdPartyAdvertising",
100
+ other: "NSPrivacyCollectedDataTypePurposeOther"
101
+ };
54
102
  var STRING_LISTS = ["src", "extensions", "ignore", "tokenFiles", "ignoreTokenPrefixes", "localPrimitiveDirs", "build"];
55
103
  var STRINGS = ["uiPackage", "rulesDoc"];
56
104
  var KNOWN = /* @__PURE__ */ new Set([
@@ -115,8 +163,48 @@ function readGenesisConfig(root) {
115
163
  if (!existsSync(file)) return null;
116
164
  const raw = readJson(file);
117
165
  if (!isObject(raw)) throw new GenesisConfigError(`${file}: the config must be a JSON object`);
118
- const links = raw.links === void 0 ? void 0 : validateLinks(raw.links, file);
119
- return links ? { raw, links } : { raw };
166
+ const out = { raw };
167
+ if (raw.links !== void 0) out.links = validateLinks(raw.links, file);
168
+ if (raw.privacy !== void 0) out.privacy = validatePrivacy(raw.privacy, file);
169
+ return out;
170
+ }
171
+ var PRIVACY_KEYS = /* @__PURE__ */ new Set(["blocks", "collects", "tracking"]);
172
+ var DATA_USE_KEYS = /* @__PURE__ */ new Set(["type", "purposes", "linked", "tracking"]);
173
+ function validatePrivacy(raw, source = "config") {
174
+ const fail = (msg) => {
175
+ throw new GenesisConfigError(`${source}: ${msg}`);
176
+ };
177
+ if (!isObject(raw)) fail(`"privacy" must be an object`);
178
+ const c = raw;
179
+ for (const key of Object.keys(c)) if (!PRIVACY_KEYS.has(key)) fail(`privacy: unknown setting "${key}"`);
180
+ const out = {};
181
+ if (c.blocks !== void 0) {
182
+ if (!isStringList(c.blocks)) fail(`privacy.blocks must be a list of block ids`);
183
+ out.blocks = [...new Set(c.blocks)];
184
+ }
185
+ if (c.tracking !== void 0) {
186
+ if (typeof c.tracking !== "boolean") fail(`privacy.tracking must be true or false`);
187
+ out.tracking = c.tracking;
188
+ }
189
+ if (c.collects !== void 0) {
190
+ if (!Array.isArray(c.collects)) fail(`privacy.collects must be a list`);
191
+ out.collects = c.collects.map((entry, i) => {
192
+ const where = `privacy.collects[${i}]`;
193
+ if (!isObject(entry)) return fail(`${where} must be an object`);
194
+ for (const key of Object.keys(entry)) if (!DATA_USE_KEYS.has(key)) fail(`${where}: unknown setting "${key}"`);
195
+ if (typeof entry.type !== "string" || !privacyDataType(entry.type)) {
196
+ fail(`${where}.type "${String(entry.type)}" is not one of ${Object.keys(PRIVACY_DATA_TYPES).join(", ")}`);
197
+ }
198
+ if (!isStringList(entry.purposes) || entry.purposes.length === 0) fail(`${where}.purposes must be a non-empty list`);
199
+ for (const p of entry.purposes) {
200
+ if (!(p in PRIVACY_PURPOSES)) fail(`${where}.purposes: "${p}" is not one of ${Object.keys(PRIVACY_PURPOSES).join(", ")}`);
201
+ }
202
+ if (typeof entry.linked !== "boolean") fail(`${where}.linked must be true or false`);
203
+ if (typeof entry.tracking !== "boolean") fail(`${where}.tracking must be true or false`);
204
+ return { type: entry.type, purposes: [...new Set(entry.purposes)], linked: entry.linked, tracking: entry.tracking };
205
+ });
206
+ }
207
+ return out;
120
208
  }
121
209
  var LINK_KEYS = /* @__PURE__ */ new Set(["hosts", "paths", "webcredentials"]);
122
210
  var HOST = /^(?=.{1,253}$)(\*\.)?([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/;
@@ -1019,11 +1107,51 @@ var NATIVE_WRAPPED_PRIMITIVES = Object.freeze({
1019
1107
  function wrappedPrimitivesIn(namedImports) {
1020
1108
  return namedImports.split(",").map((n) => n.trim()).filter((n) => n && !/^type\s/.test(n)).map((n) => n.split(/\s+as\s+/)[0].trim()).filter((n) => n && Object.hasOwn(NATIVE_WRAPPED_PRIMITIVES, n));
1021
1109
  }
1110
+ var api = (category, ...reasons) => ({
1111
+ NSPrivacyAccessedAPIType: `NSPrivacyAccessedAPICategory${category}`,
1112
+ NSPrivacyAccessedAPITypeReasons: reasons
1113
+ });
1022
1114
  var PRIVACY_APIS = {
1023
- "@react-native-async-storage/async-storage": [
1024
- { NSPrivacyAccessedAPIType: "NSPrivacyAccessedAPICategoryFileTimestamp", NSPrivacyAccessedAPITypeReasons: ["C617.1"] }
1025
- ]
1115
+ "react-native": [api("FileTimestamp", "C617.1"), api("UserDefaults", "CA92.1"), api("SystemBootTime", "35F9.1")],
1116
+ expo: [api("FileTimestamp", "0A2A.1", "3B52.1"), api("DiskSpace", "E174.1", "85F4.1"), api("UserDefaults", "CA92.1")],
1117
+ "expo-updates": [api("UserDefaults", "CA92.1")],
1118
+ "expo-application": [api("FileTimestamp", "C617.1")],
1119
+ "expo-notifications": [api("UserDefaults", "CA92.1")],
1120
+ "@react-native-async-storage/async-storage": [api("FileTimestamp", "C617.1")],
1121
+ "@sentry/react-native": [api("UserDefaults", "CA92.1"), api("SystemBootTime", "35F9.1"), api("FileTimestamp", "C617.1")]
1026
1122
  };
1123
+ var appFunctionality = (type, ...more) => ({
1124
+ type,
1125
+ purposes: ["app functionality", ...more],
1126
+ linked: true,
1127
+ tracking: false
1128
+ });
1129
+ ({
1130
+ account: {
1131
+ collects: [appFunctionality("email address"), appFunctionality("user id"), appFunctionality("name")]
1132
+ },
1133
+ observability: {
1134
+ collects: [
1135
+ appFunctionality("crash data"),
1136
+ appFunctionality("performance data"),
1137
+ appFunctionality("other diagnostic data"),
1138
+ appFunctionality("user id", "analytics"),
1139
+ { type: "product interaction", purposes: ["analytics"], linked: true, tracking: false }
1140
+ ]
1141
+ },
1142
+ push: {
1143
+ collects: [appFunctionality("device ID")]
1144
+ },
1145
+ support: {
1146
+ collects: [
1147
+ appFunctionality("user id"),
1148
+ appFunctionality("customer support"),
1149
+ appFunctionality("other user content"),
1150
+ appFunctionality("photos or videos"),
1151
+ appFunctionality("other diagnostic data")
1152
+ ]
1153
+ }
1154
+ });
1027
1155
  function privacyApisFor(dependencies2) {
1028
1156
  return Object.keys(PRIVACY_APIS).filter((pkg) => pkg in dependencies2).flatMap((pkg) => PRIVACY_APIS[pkg]);
1029
1157
  }