@pofky/asc-mcp 1.9.15 → 1.10.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 (76) hide show
  1. package/README.md +24 -17
  2. package/USER_GUIDE.md +4 -4
  3. package/dist/index.js +6 -2
  4. package/dist/index.js.map +1 -1
  5. package/dist/instructions.d.ts.map +1 -1
  6. package/dist/instructions.js +2 -1
  7. package/dist/instructions.js.map +1 -1
  8. package/dist/preflight/apple-lists.d.ts +73 -0
  9. package/dist/preflight/apple-lists.d.ts.map +1 -0
  10. package/dist/preflight/apple-lists.js +141 -0
  11. package/dist/preflight/apple-lists.js.map +1 -0
  12. package/dist/preflight/binary-scan.d.ts +14 -0
  13. package/dist/preflight/binary-scan.d.ts.map +1 -0
  14. package/dist/preflight/binary-scan.js +114 -0
  15. package/dist/preflight/binary-scan.js.map +1 -0
  16. package/dist/preflight/checks/project.d.ts +6 -0
  17. package/dist/preflight/checks/project.d.ts.map +1 -0
  18. package/dist/preflight/checks/project.js +147 -0
  19. package/dist/preflight/checks/project.js.map +1 -0
  20. package/dist/preflight/checks/record.d.ts +18 -0
  21. package/dist/preflight/checks/record.d.ts.map +1 -0
  22. package/dist/preflight/checks/record.js +326 -0
  23. package/dist/preflight/checks/record.js.map +1 -0
  24. package/dist/preflight/checks/urls.d.ts +8 -0
  25. package/dist/preflight/checks/urls.d.ts.map +1 -0
  26. package/dist/preflight/checks/urls.js +109 -0
  27. package/dist/preflight/checks/urls.js.map +1 -0
  28. package/dist/preflight/gather.d.ts +47 -0
  29. package/dist/preflight/gather.d.ts.map +1 -0
  30. package/dist/preflight/gather.js +295 -0
  31. package/dist/preflight/gather.js.map +1 -0
  32. package/dist/preflight/plist.d.ts +16 -0
  33. package/dist/preflight/plist.d.ts.map +1 -0
  34. package/dist/preflight/plist.js +104 -0
  35. package/dist/preflight/plist.js.map +1 -0
  36. package/dist/preflight/project-files.d.ts +34 -0
  37. package/dist/preflight/project-files.d.ts.map +1 -0
  38. package/dist/preflight/project-files.js +124 -0
  39. package/dist/preflight/project-files.js.map +1 -0
  40. package/dist/preflight/project-scan.d.ts +4 -0
  41. package/dist/preflight/project-scan.d.ts.map +1 -0
  42. package/dist/preflight/project-scan.js +316 -0
  43. package/dist/preflight/project-scan.js.map +1 -0
  44. package/dist/preflight/report.d.ts +19 -0
  45. package/dist/preflight/report.d.ts.map +1 -0
  46. package/dist/preflight/report.js +111 -0
  47. package/dist/preflight/report.js.map +1 -0
  48. package/dist/preflight/rules.d.ts +333 -0
  49. package/dist/preflight/rules.d.ts.map +1 -0
  50. package/dist/preflight/rules.js +155 -0
  51. package/dist/preflight/rules.js.map +1 -0
  52. package/dist/preflight/run.d.ts +15 -0
  53. package/dist/preflight/run.d.ts.map +1 -0
  54. package/dist/preflight/run.js +84 -0
  55. package/dist/preflight/run.js.map +1 -0
  56. package/dist/preflight/types.d.ts +178 -0
  57. package/dist/preflight/types.d.ts.map +1 -0
  58. package/dist/preflight/types.js +8 -0
  59. package/dist/preflight/types.js.map +1 -0
  60. package/dist/preflight/url-probe.d.ts +16 -0
  61. package/dist/preflight/url-probe.d.ts.map +1 -0
  62. package/dist/preflight/url-probe.js +217 -0
  63. package/dist/preflight/url-probe.js.map +1 -0
  64. package/dist/prompts.js +7 -7
  65. package/dist/prompts.js.map +1 -1
  66. package/dist/tools/guide.js +4 -4
  67. package/dist/tools/guide.js.map +1 -1
  68. package/dist/tools/privacy.d.ts +3 -1
  69. package/dist/tools/privacy.d.ts.map +1 -1
  70. package/dist/tools/privacy.js +3 -1
  71. package/dist/tools/privacy.js.map +1 -1
  72. package/dist/tools/release-preflight.d.ts +2 -17
  73. package/dist/tools/release-preflight.d.ts.map +1 -1
  74. package/dist/tools/release-preflight.js +3 -444
  75. package/dist/tools/release-preflight.js.map +1 -1
  76. package/package.json +1 -1
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.findBuiltApp = findBuiltApp;
4
+ exports.plistAsXml = plistAsXml;
5
+ exports.scanExecutable = scanExecutable;
6
+ exports.listEmbeddedFrameworks = listEmbeddedFrameworks;
7
+ const node_child_process_1 = require("node:child_process");
8
+ const node_fs_1 = require("node:fs");
9
+ const promises_1 = require("node:fs/promises");
10
+ const node_path_1 = require("node:path");
11
+ const node_util_1 = require("node:util");
12
+ const apple_lists_js_1 = require("./apple-lists.js");
13
+ const plist_js_1 = require("./plist.js");
14
+ const run = (0, node_util_1.promisify)(node_child_process_1.execFile);
15
+ /** Bounds on tools reading a built app. `nm` on a large binary takes seconds, not minutes. */
16
+ const TOOL_TIMEOUT_MS = 20_000;
17
+ const TOOL_MAX_OUTPUT = 64 * 1024 * 1024;
18
+ /** Where Xcode-driven builds land inside a project, and how far down to look. */
19
+ const BUILD_OUTPUT_DIR = /^(build|derived_?data|archives?)([-_.].*)?$/i;
20
+ const BUILD_SEARCH_DEPTH = 6;
21
+ /**
22
+ * The executable inside an app, named by its own Info.plist. An app folder with
23
+ * no executable is what a failed or cleaned build leaves behind.
24
+ */
25
+ async function executableOf(appPath) {
26
+ const infoPath = [(0, node_path_1.join)(appPath, "Info.plist"), (0, node_path_1.join)(appPath, "Contents", "Info.plist")].find((p) => (0, node_fs_1.existsSync)(p));
27
+ if (!infoPath)
28
+ return null;
29
+ const info = (0, plist_js_1.parsePlist)(await plistAsXml(infoPath));
30
+ const name = typeof info === "object" && !Array.isArray(info) ? info.CFBundleExecutable : undefined;
31
+ if (typeof name !== "string")
32
+ return null;
33
+ return [(0, node_path_1.join)(appPath, name), (0, node_path_1.join)(appPath, "Contents", "MacOS", name)].find((p) => (0, node_fs_1.existsSync)(p)) ?? null;
34
+ }
35
+ /** How close a build is to what gets submitted. An archive is what gets uploaded. */
36
+ function buildRank(path) {
37
+ if (path.includes(".xcarchive"))
38
+ return 2;
39
+ return /Release-/.test(path) ? 1 : 0;
40
+ }
41
+ /** Finds the build closest to what gets submitted, newest first within a kind. */
42
+ async function findBuiltApp(root) {
43
+ if (root.endsWith(".app"))
44
+ return root;
45
+ const found = [];
46
+ const visit = async (dir, depth) => {
47
+ if (depth > BUILD_SEARCH_DEPTH)
48
+ return;
49
+ const entries = await (0, promises_1.readdir)(dir, { withFileTypes: true });
50
+ for (const entry of entries) {
51
+ if (!entry.isDirectory() || entry.isSymbolicLink())
52
+ continue;
53
+ const full = (0, node_path_1.join)(dir, entry.name);
54
+ if (entry.name.endsWith(".app")) {
55
+ // Simulator builds carry different symbols, and test runners are not the app.
56
+ if (/iphonesimulator|-Runner\.app$/i.test(full))
57
+ continue;
58
+ if (await executableOf(full))
59
+ found.push({ path: full, mtime: (await (0, promises_1.stat)(full)).mtimeMs });
60
+ continue;
61
+ }
62
+ if (!/^(SourcePackages|Index\.noindex|Intermediates\.noindex|\.git|node_modules)$/.test(entry.name))
63
+ await visit(full, depth + 1);
64
+ }
65
+ };
66
+ if (root.endsWith(".xcarchive"))
67
+ await visit(root, 0);
68
+ else {
69
+ const top = await (0, promises_1.readdir)(root, { withFileTypes: true });
70
+ for (const entry of top) {
71
+ if (entry.isDirectory() && !entry.isSymbolicLink() && BUILD_OUTPUT_DIR.test(entry.name))
72
+ await visit((0, node_path_1.join)(root, entry.name), 0);
73
+ }
74
+ }
75
+ found.sort((a, b) => buildRank(b.path) - buildRank(a.path) || b.mtime - a.mtime);
76
+ return found[0]?.path ?? null;
77
+ }
78
+ /** A property list as XML whichever format it is on disk. macOS only. */
79
+ async function plistAsXml(path) {
80
+ const { stdout } = await run("plutil", ["-convert", "xml1", "-o", "-", "--", path], { timeout: TOOL_TIMEOUT_MS, maxBuffer: TOOL_MAX_OUTPUT });
81
+ return stdout;
82
+ }
83
+ /** Categories whose APIs the app's own executable imports. Reads symbols; runs nothing. */
84
+ async function scanExecutable(appPath) {
85
+ const executable = await executableOf(appPath);
86
+ if (!executable)
87
+ throw new Error("its Info.plist names no executable that exists");
88
+ const { stdout } = await run("nm", ["-u", "--", executable], { timeout: TOOL_TIMEOUT_MS, maxBuffer: TOOL_MAX_OUTPUT });
89
+ const symbols = stdout.split("\n").map((l) => l.trim());
90
+ const exact = new Set(symbols);
91
+ const hits = [];
92
+ for (const [category, data] of Object.entries(apple_lists_js_1.REQUIRED_REASON_CATEGORIES)) {
93
+ const fragments = ("symbolFragments" in data ? data.symbolFragments : []);
94
+ const used = data.symbols.some((s) => exact.has(s)) || symbols.some((sym) => fragments.some((f) => sym.includes(f)));
95
+ if (used)
96
+ hits.push(category);
97
+ }
98
+ return hits;
99
+ }
100
+ /** Frameworks inside the app, each with whether it carries a privacy manifest. */
101
+ async function listEmbeddedFrameworks(appPath, root) {
102
+ const dir = (0, node_path_1.join)(appPath, "Frameworks");
103
+ if (!(0, node_fs_1.existsSync)(dir))
104
+ return [];
105
+ const entries = await (0, promises_1.readdir)(dir, { withFileTypes: true });
106
+ return entries
107
+ .filter((e) => e.name.endsWith(".framework"))
108
+ .map((e) => {
109
+ const full = (0, node_path_1.join)(dir, e.name);
110
+ const hasManifest = (0, node_fs_1.existsSync)((0, node_path_1.join)(full, "PrivacyInfo.xcprivacy")) || (0, node_fs_1.existsSync)((0, node_path_1.join)(full, "Resources", "PrivacyInfo.xcprivacy"));
111
+ return { name: e.name.replace(/\.framework$/, ""), hasManifest, rel: (0, node_path_1.relative)(root, full).split(node_path_1.sep).join("/") };
112
+ });
113
+ }
114
+ //# sourceMappingURL=binary-scan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binary-scan.js","sourceRoot":"","sources":["../../src/preflight/binary-scan.ts"],"names":[],"mappings":";;AAqCA,oCA2BC;AAGD,gCAGC;AAGD,wCAaC;AAED,wDAWC;AAnGD,2DAA8C;AAC9C,qCAAqC;AACrC,+CAAiD;AACjD,yCAAgD;AAChD,yCAAsC;AACtC,qDAA2F;AAC3F,yCAAwC;AAExC,MAAM,GAAG,GAAG,IAAA,qBAAS,EAAC,6BAAQ,CAAC,CAAC;AAEhC,8FAA8F;AAC9F,MAAM,eAAe,GAAG,MAAM,CAAC;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AAE,YAAY,CAAC,CAAC;IACxC,IAAI,CAAC,IAAA,oBAAU,EAAC,GAAG,CAAC;QAAE,OAAO,EAAE,CAAC;IAChC,MAAM,OAAO,GAAG,MAAM,IAAA,kBAAO,EAAC,GAAG,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5D,OAAO,OAAO;SACX,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;SAC5C,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACT,MAAM,IAAI,GAAG,IAAA,gBAAI,EAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;QAC/B,MAAM,WAAW,GAAG,IAAA,oBAAU,EAAC,IAAA,gBAAI,EAAC,IAAI,EAAE,uBAAuB,CAAC,CAAC,IAAI,IAAA,oBAAU,EAAC,IAAA,gBAAI,EAAC,IAAI,EAAE,WAAW,EAAE,uBAAuB,CAAC,CAAC,CAAC;QACpI,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,IAAA,oBAAQ,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,eAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;IACnH,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { Finding, ProjectInput } from "../types.js";
2
+ /** The project rules, or one line each saying why they did not run. */
3
+ export declare function checkProject(project: ProjectInput): Finding[];
4
+ /** Data types declared in the manifests, for the App Privacy page Apple's API cannot reach. */
5
+ export declare function declaredDataTypes(project: ProjectInput): string[];
6
+ //# sourceMappingURL=project.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../../src/preflight/checks/project.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAuB,MAAM,aAAa,CAAC;AA+F9E,uEAAuE;AACvE,wBAAgB,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,EAAE,CAe7D;AAED,+FAA+F;AAC/F,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,EAAE,CAQjE"}
@@ -0,0 +1,147 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkProject = checkProject;
4
+ exports.declaredDataTypes = declaredDataTypes;
5
+ const apple_lists_js_1 = require("../apple-lists.js");
6
+ const finding = (rule, status, saw, scope) => ({ rule, status, saw, scope });
7
+ const PROJECT_RULES = ["manifest.present", "manifest.reasons", "sdk.manifest", "plist.purpose", "plist.placeholder"];
8
+ const categoryLabel = (c) => apple_lists_js_1.REQUIRED_REASON_CATEGORIES[c]?.label ?? c;
9
+ const shortCategory = (c) => c.replace("NSPrivacyAccessedAPICategory", "");
10
+ function checkManifests(scan) {
11
+ const out = [];
12
+ const usable = scan.manifests.filter((m) => m.parsed.ok);
13
+ for (const m of scan.manifests) {
14
+ if (!m.parsed.ok)
15
+ out.push(finding("manifest.present", "fail", `It does not parse: ${m.parsed.reason}`, m.path));
16
+ else if (m.inProject === false)
17
+ out.push(finding("manifest.present", "warn", "It exists, and the Xcode project does not mention it, so it may not reach the app.", m.path));
18
+ }
19
+ if (!usable.length && !scan.manifests.length) {
20
+ const strong = scan.apis.filter((a) => a.strength === "strong");
21
+ if (strong.length)
22
+ out.push(finding("manifest.present", "fail", `No PrivacyInfo.xcprivacy, and this code uses ${strong.map((a) => categoryLabel(a.category)).join(", ")}.`));
23
+ else
24
+ out.push(finding("manifest.present", "pass", "No manifest, and no use of a listed API was found."));
25
+ }
26
+ else if (usable.length && !out.some((f) => f.rule === "manifest.present")) {
27
+ out.push(finding("manifest.present", "pass", `${usable.length} manifest(s) parsed.`));
28
+ }
29
+ const declared = new Map();
30
+ for (const m of usable) {
31
+ if (!m.parsed.ok)
32
+ continue;
33
+ for (const [category, reasons] of Object.entries(m.parsed.value.accessed))
34
+ declared.set(category, [...(declared.get(category) ?? []), ...reasons]);
35
+ }
36
+ let reasonFindings = 0;
37
+ for (const api of scan.apis) {
38
+ if (declared.has(api.category))
39
+ continue;
40
+ reasonFindings++;
41
+ if (api.strength === "strong")
42
+ out.push(finding("manifest.reasons", "fail", `${categoryLabel(api.category)} is used at ${api.where}, and ${shortCategory(api.category)} is not declared in a manifest. Add it with a reason code.`));
43
+ else
44
+ out.push(finding("manifest.reasons", "warn", `${api.where} looks like ${categoryLabel(api.category)} use, which would need declaring. If it is your own property, ignore this.`));
45
+ }
46
+ for (const [category, reasons] of declared) {
47
+ const entry = apple_lists_js_1.REQUIRED_REASON_CATEGORIES[category];
48
+ if (!entry) {
49
+ reasonFindings++;
50
+ out.push(finding("manifest.reasons", "fail", `${category.slice(0, 80)} is not a category Apple lists.`));
51
+ continue;
52
+ }
53
+ const allowed = entry.reasons;
54
+ const invalid = reasons.filter((r) => !allowed.includes(r));
55
+ if (!reasons.length) {
56
+ reasonFindings++;
57
+ out.push(finding("manifest.reasons", "fail", `${shortCategory(category)} is declared with no reason code. Apple's codes for it: ${allowed.join(", ")}.`));
58
+ }
59
+ else if (invalid.length) {
60
+ reasonFindings++;
61
+ out.push(finding("manifest.reasons", "fail", `${shortCategory(category)} declares ${invalid.map((r) => r.slice(0, 12)).join(", ")}, not one of Apple's codes for it: ${allowed.join(", ")}.`));
62
+ }
63
+ }
64
+ if (!reasonFindings)
65
+ out.push(finding("manifest.reasons", "pass", `${scan.apis.length} API categor${scan.apis.length === 1 ? "y" : "ies"} in use, all declared with valid codes.`));
66
+ return out;
67
+ }
68
+ function checkSdks(scan) {
69
+ if (!scan.sdks.length)
70
+ return [finding("sdk.manifest", "pass", "No SDK on Apple's list was found.")];
71
+ const out = [];
72
+ for (const sdk of scan.sdks) {
73
+ if (sdk.manifest === "absent")
74
+ out.push(finding("sdk.manifest", "fail", `Found through ${sdk.via} with no PrivacyInfo.xcprivacy in it.`, sdk.name));
75
+ else if (sdk.manifest === "not_on_disk")
76
+ out.push(finding("sdk.manifest", "warn", `Found through ${sdk.via}. Its source is not in this folder, so its manifest could not be seen. Check the version you use includes one, or archive and re-run.`, sdk.name));
77
+ else
78
+ out.push(finding("sdk.manifest", "pass", "Carries a manifest.", sdk.name));
79
+ }
80
+ return out;
81
+ }
82
+ function checkPlist(scan) {
83
+ const out = [];
84
+ let bad = 0;
85
+ for (const use of scan.purposes) {
86
+ const present = use.keys.filter((k) => k in scan.purposeKeys);
87
+ if (present.some((k) => scan.purposeKeys[k]))
88
+ continue;
89
+ bad++;
90
+ out.push(present.length
91
+ ? finding("plist.purpose", "fail", `${present[0]} is empty, and this code uses ${use.api} at ${use.where}.`)
92
+ : finding("plist.purpose", "fail", `This code uses ${use.api} at ${use.where}, and no ${use.keys[0]} was found.`));
93
+ }
94
+ if (!bad)
95
+ out.push(finding("plist.purpose", "pass", scan.purposes.length ? "Each permission in use has its purpose string." : "No API that needs a purpose string was found."));
96
+ for (const p of scan.placeholderKeys)
97
+ out.push(finding("plist.placeholder", "fail", `${p.key.replace(/[^\w.-]/g, "").slice(0, 60)} holds a sample value.`, p.where));
98
+ if (!scan.placeholderKeys.length)
99
+ out.push(finding("plist.placeholder", "pass", "No sample values found."));
100
+ return out;
101
+ }
102
+ /**
103
+ * File and key names come from a folder that may have been cloned from anyone,
104
+ * and an agent reads this report. One line each, printable, and short.
105
+ */
106
+ const printable = (f) => ({
107
+ ...f,
108
+ saw: f.saw.replace(/[^\x20-\x7e]/g, "").slice(0, 400),
109
+ scope: f.scope?.replace(/[^\x20-\x7e]/g, "").slice(0, 120),
110
+ });
111
+ /** The project rules, or one line each saying why they did not run. */
112
+ function checkProject(project) {
113
+ if (!project.provided)
114
+ return [finding("manifest.present", "skipped", "Pass project_path to check privacy manifests and purpose strings.", "project.*")];
115
+ // The caller asked for these rules and they did not run, so it is not clean.
116
+ if ("error" in project)
117
+ return [finding("manifest.present", "unknown", `Project rules did not run. ${project.error}`, "project.*")];
118
+ const scan = project.scan;
119
+ const out = [...checkManifests(scan), ...checkSdks(scan), ...checkPlist(scan)];
120
+ if (scan.truncated) {
121
+ // A partial scan cannot vouch for what it did not read.
122
+ for (const rule of PROJECT_RULES)
123
+ out.push(finding(rule, "unknown", `The scan was partial: ${scan.truncated}.`));
124
+ }
125
+ if (scan.otherApp)
126
+ out.push(finding("manifest.present", "unknown", scan.otherApp, "project.*"));
127
+ if (scan.plistIssue)
128
+ out.push(finding("plist.purpose", "unknown", scan.plistIssue));
129
+ if (scan.binaryUnreadable)
130
+ out.push(finding("manifest.reasons", "unknown", scan.binaryUnreadable, "built app"));
131
+ if (scan.binarySkipped)
132
+ out.push(finding("manifest.reasons", "skipped", scan.binarySkipped, "built app"));
133
+ return out.map(printable);
134
+ }
135
+ /** Data types declared in the manifests, for the App Privacy page Apple's API cannot reach. */
136
+ function declaredDataTypes(project) {
137
+ // Another app's data types would make a wrong checklist for this one.
138
+ if (!project.provided || !("scan" in project) || project.scan.otherApp)
139
+ return [];
140
+ const types = new Set();
141
+ for (const m of project.scan.manifests) {
142
+ if (m.parsed.ok)
143
+ m.parsed.value.collectedDataTypes.forEach((t) => types.add(t.replace("NSPrivacyCollectedDataType", "")));
144
+ }
145
+ return [...types].sort();
146
+ }
147
+ //# sourceMappingURL=project.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project.js","sourceRoot":"","sources":["../../../src/preflight/checks/project.ts"],"names":[],"mappings":";;AAkGA,oCAeC;AAGD,8CAQC;AA5HD,sDAA4F;AAI5F,MAAM,OAAO,GAAG,CAAC,IAAY,EAAE,MAAc,EAAE,GAAW,EAAE,KAAc,EAAW,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;AAEvH,MAAM,aAAa,GAAa,CAAC,kBAAkB,EAAE,kBAAkB,EA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,CAAC;IAChC,KAAK,MAAM,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;QACvC,IAAI,CAAC,CAAC,MAAM,CAAC,EAAE;YAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,4BAA4B,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IAC5H,CAAC;IACD,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;AAC3B,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { BuildInfo, Finding, Part, ProjectInput, RecordSnapshot, ScreenshotSet, VersionSnapshot } from "../types.js";
2
+ /** Apple's own rejections. DEVELOPER_REJECTED is the developer withdrawing it, which has no reasons to read. */
3
+ export declare const REJECTED_STATES: ReadonlySet<string>;
4
+ /** True or false when something says so, and null when nothing does. */
5
+ export declare function iPadEvidence(build: Part<BuildInfo | null>, project: ProjectInput, sets: ScreenshotSet[]): {
6
+ runsOnIpad: boolean | null;
7
+ how: string;
8
+ };
9
+ /** True at or above the SDK that brings the Duo rule; null when the number will not parse. */
10
+ export declare function isDuoSdk(sdkBuild: string | null): boolean | null;
11
+ /** Rules for one version of the app. */
12
+ export declare function checkVersion(v: VersionSnapshot, primaryLocale: string | null, project: ProjectInput, today: string, appId: string): Finding[];
13
+ /** Rules that belong to the app, whichever version is being looked at. */
14
+ export declare function checkApp(record: RecordSnapshot): Finding[];
15
+ /** The Terms of Use links a description holds. */
16
+ export declare function termsLinksIn(description: string | null): string[];
17
+ export declare function checkSubscriptionTerms(record: RecordSnapshot, v: VersionSnapshot): Finding[];
18
+ //# sourceMappingURL=record.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../../src/preflight/checks/record.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,cAAc,EAAE,aAAa,EAA+B,eAAe,EAAE,MAAM,aAAa,CAAC;AAEvJ,gHAAgH;AAChH,eAAO,MAAM,eAAe,EAAE,WAAW,CAAC,MAAM,CAAgE,CAAC;AA4CjH,wEAAwE;AACxE,wBAAgB,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG;IAAE,UAAU,EAAE,OAAO,GAAG,IAAI,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAerJ;AAED,8FAA8F;AAC9F,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,GAAG,IAAI,CAKhE;AAmHD,wCAAwC;AACxC,wBAAgB,YAAY,CAAC,CAAC,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,EAAE,CAqB7I;AAOD,0EAA0E;AAC1E,wBAAgB,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,EAAE,CAqC1D;AAED,kDAAkD;AAClD,wBAAgB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,EAAE,CAUjE;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC,EAAE,eAAe,GAAG,OAAO,EAAE,CAc5F"}