@sitepong/fastnode 0.1.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 (162) hide show
  1. package/README.md +81 -0
  2. package/bin/fastnode.js +13 -0
  3. package/bin/fastnode.ts +5 -0
  4. package/dist/actions/index.cjs +7405 -0
  5. package/dist/actions/index.cjs.map +1 -0
  6. package/dist/actions/index.d.cts +15 -0
  7. package/dist/actions/index.d.ts +15 -0
  8. package/dist/actions/index.mjs +7377 -0
  9. package/dist/actions/index.mjs.map +1 -0
  10. package/dist/cert/index.cjs +219 -0
  11. package/dist/cert/index.cjs.map +1 -0
  12. package/dist/cert/index.d.cts +4 -0
  13. package/dist/cert/index.d.ts +4 -0
  14. package/dist/cert/index.mjs +191 -0
  15. package/dist/cert/index.mjs.map +1 -0
  16. package/dist/cert-BmJGtYtb.d.cts +27 -0
  17. package/dist/cert-owkOFNW8.d.ts +27 -0
  18. package/dist/cli/index.cjs +7998 -0
  19. package/dist/cli/index.cjs.map +1 -0
  20. package/dist/cli/index.d.cts +9 -0
  21. package/dist/cli/index.d.ts +9 -0
  22. package/dist/cli/index.mjs +7972 -0
  23. package/dist/cli/index.mjs.map +1 -0
  24. package/dist/client/index.cjs +2592 -0
  25. package/dist/client/index.cjs.map +1 -0
  26. package/dist/client/index.d.cts +2 -0
  27. package/dist/client/index.d.ts +2 -0
  28. package/dist/client/index.mjs +2582 -0
  29. package/dist/client/index.mjs.map +1 -0
  30. package/dist/context-CymLkfrS.d.cts +13 -0
  31. package/dist/context-CymLkfrS.d.ts +13 -0
  32. package/dist/core/index.cjs +281 -0
  33. package/dist/core/index.cjs.map +1 -0
  34. package/dist/core/index.d.cts +1 -0
  35. package/dist/core/index.d.ts +1 -0
  36. package/dist/core/index.mjs +254 -0
  37. package/dist/core/index.mjs.map +1 -0
  38. package/dist/deliver/index.cjs +328 -0
  39. package/dist/deliver/index.cjs.map +1 -0
  40. package/dist/deliver/index.d.cts +3 -0
  41. package/dist/deliver/index.d.ts +3 -0
  42. package/dist/deliver/index.mjs +322 -0
  43. package/dist/deliver/index.mjs.map +1 -0
  44. package/dist/enums-B609j2rb.d.cts +20 -0
  45. package/dist/enums-B609j2rb.d.ts +20 -0
  46. package/dist/frameit/index.cjs +247 -0
  47. package/dist/frameit/index.cjs.map +1 -0
  48. package/dist/frameit/index.d.cts +1 -0
  49. package/dist/frameit/index.d.ts +1 -0
  50. package/dist/frameit/index.mjs +242 -0
  51. package/dist/frameit/index.mjs.map +1 -0
  52. package/dist/gym/index.cjs +356 -0
  53. package/dist/gym/index.cjs.map +1 -0
  54. package/dist/gym/index.d.cts +2 -0
  55. package/dist/gym/index.d.ts +2 -0
  56. package/dist/gym/index.mjs +346 -0
  57. package/dist/gym/index.mjs.map +1 -0
  58. package/dist/index-1Vu2cRQ2.d.ts +99 -0
  59. package/dist/index-A5MimeQk.d.ts +72 -0
  60. package/dist/index-B0yhu_LZ.d.ts +76 -0
  61. package/dist/index-B9yXicrQ.d.ts +62 -0
  62. package/dist/index-BFdNOmPJ.d.cts +53 -0
  63. package/dist/index-BLubSlgK.d.cts +1513 -0
  64. package/dist/index-BN0ubxjZ.d.ts +70 -0
  65. package/dist/index-BQJIJlK7.d.cts +70 -0
  66. package/dist/index-BYonklf3.d.cts +84 -0
  67. package/dist/index-BYonklf3.d.ts +84 -0
  68. package/dist/index-BimqCmY8.d.cts +78 -0
  69. package/dist/index-BimqCmY8.d.ts +78 -0
  70. package/dist/index-BoU8qt8r.d.cts +59 -0
  71. package/dist/index-BoU8qt8r.d.ts +59 -0
  72. package/dist/index-C2yG3wXA.d.cts +95 -0
  73. package/dist/index-C2yG3wXA.d.ts +95 -0
  74. package/dist/index-CR3BFPIz.d.cts +77 -0
  75. package/dist/index-CR3BFPIz.d.ts +77 -0
  76. package/dist/index-CWNLnSOL.d.cts +99 -0
  77. package/dist/index-Cp6cjtd-.d.cts +65 -0
  78. package/dist/index-Cp6cjtd-.d.ts +65 -0
  79. package/dist/index-D1Izm7qt.d.ts +1513 -0
  80. package/dist/index-D5eihzwM.d.cts +76 -0
  81. package/dist/index-DImN9PWc.d.ts +155 -0
  82. package/dist/index-DfCUVJX1.d.cts +62 -0
  83. package/dist/index-DfirmFbC.d.ts +32 -0
  84. package/dist/index-DkvinY7_.d.ts +54 -0
  85. package/dist/index-DrUpRXRG.d.cts +155 -0
  86. package/dist/index-EcVvViW8.d.cts +72 -0
  87. package/dist/index-HRiaaX-Q.d.cts +54 -0
  88. package/dist/index-TfXqwuac.d.ts +53 -0
  89. package/dist/index-lt819Jgj.d.cts +32 -0
  90. package/dist/index.cjs +8464 -0
  91. package/dist/index.cjs.map +1 -0
  92. package/dist/index.d.cts +23 -0
  93. package/dist/index.d.ts +23 -0
  94. package/dist/index.mjs +8410 -0
  95. package/dist/index.mjs.map +1 -0
  96. package/dist/lane/index.cjs +7641 -0
  97. package/dist/lane/index.cjs.map +1 -0
  98. package/dist/lane/index.d.cts +51 -0
  99. package/dist/lane/index.d.ts +51 -0
  100. package/dist/lane/index.mjs +7603 -0
  101. package/dist/lane/index.mjs.map +1 -0
  102. package/dist/match/index.cjs +942 -0
  103. package/dist/match/index.cjs.map +1 -0
  104. package/dist/match/index.d.cts +5 -0
  105. package/dist/match/index.d.ts +5 -0
  106. package/dist/match/index.mjs +913 -0
  107. package/dist/match/index.mjs.map +1 -0
  108. package/dist/pem/index.cjs +195 -0
  109. package/dist/pem/index.cjs.map +1 -0
  110. package/dist/pem/index.d.cts +3 -0
  111. package/dist/pem/index.d.ts +3 -0
  112. package/dist/pem/index.mjs +170 -0
  113. package/dist/pem/index.mjs.map +1 -0
  114. package/dist/pilot/index.cjs +206 -0
  115. package/dist/pilot/index.cjs.map +1 -0
  116. package/dist/pilot/index.d.cts +3 -0
  117. package/dist/pilot/index.d.ts +3 -0
  118. package/dist/pilot/index.mjs +196 -0
  119. package/dist/pilot/index.mjs.map +1 -0
  120. package/dist/precheck/index.cjs +277 -0
  121. package/dist/precheck/index.cjs.map +1 -0
  122. package/dist/precheck/index.d.cts +3 -0
  123. package/dist/precheck/index.d.ts +3 -0
  124. package/dist/precheck/index.mjs +274 -0
  125. package/dist/precheck/index.mjs.map +1 -0
  126. package/dist/produce/index.cjs +200 -0
  127. package/dist/produce/index.cjs.map +1 -0
  128. package/dist/produce/index.d.cts +3 -0
  129. package/dist/produce/index.d.ts +3 -0
  130. package/dist/produce/index.mjs +191 -0
  131. package/dist/produce/index.mjs.map +1 -0
  132. package/dist/scan/index.cjs +187 -0
  133. package/dist/scan/index.cjs.map +1 -0
  134. package/dist/scan/index.d.cts +1 -0
  135. package/dist/scan/index.d.ts +1 -0
  136. package/dist/scan/index.mjs +183 -0
  137. package/dist/scan/index.mjs.map +1 -0
  138. package/dist/sigh/index.cjs +203 -0
  139. package/dist/sigh/index.cjs.map +1 -0
  140. package/dist/sigh/index.d.cts +3 -0
  141. package/dist/sigh/index.d.ts +3 -0
  142. package/dist/sigh/index.mjs +198 -0
  143. package/dist/sigh/index.mjs.map +1 -0
  144. package/dist/snapshot/index.cjs +448 -0
  145. package/dist/snapshot/index.cjs.map +1 -0
  146. package/dist/snapshot/index.d.cts +1 -0
  147. package/dist/snapshot/index.d.ts +1 -0
  148. package/dist/snapshot/index.mjs +438 -0
  149. package/dist/snapshot/index.mjs.map +1 -0
  150. package/dist/trainer/index.cjs +395 -0
  151. package/dist/trainer/index.cjs.map +1 -0
  152. package/dist/trainer/index.d.cts +1 -0
  153. package/dist/trainer/index.d.ts +1 -0
  154. package/dist/trainer/index.mjs +372 -0
  155. package/dist/trainer/index.mjs.map +1 -0
  156. package/dist/xcode/index.cjs +188 -0
  157. package/dist/xcode/index.cjs.map +1 -0
  158. package/dist/xcode/index.d.cts +1 -0
  159. package/dist/xcode/index.d.ts +1 -0
  160. package/dist/xcode/index.mjs +176 -0
  161. package/dist/xcode/index.mjs.map +1 -0
  162. package/package.json +223 -0
@@ -0,0 +1,346 @@
1
+ import { spawn } from 'child_process';
2
+ import { writeFile, mkdir, stat, readdir, rm } from 'fs/promises';
3
+ import { resolve, basename, join } from 'path';
4
+ import { tmpdir } from 'os';
5
+ import { randomUUID } from 'crypto';
6
+ import plist from 'plist';
7
+
8
+ // src/gym/index.ts
9
+
10
+ // src/xcode/platform.ts
11
+ function requireMacOS(feature) {
12
+ if (process.platform !== "darwin") {
13
+ throw new Error(
14
+ `${feature} requires macOS. This operation uses Xcode command-line tools which are not available on ${process.platform}.`
15
+ );
16
+ }
17
+ }
18
+ async function findFirst(dir, ext) {
19
+ const entries = await readdir(dir, { withFileTypes: true });
20
+ for (const entry of entries) {
21
+ if (entry.name.endsWith(ext) && !entry.name.startsWith(".")) {
22
+ return join(dir, entry.name);
23
+ }
24
+ }
25
+ return null;
26
+ }
27
+ async function xcodebuildList(args) {
28
+ return new Promise((res, rej) => {
29
+ const proc = spawn("xcodebuild", ["-list", "-json", ...args], {
30
+ stdio: ["ignore", "pipe", "pipe"]
31
+ });
32
+ const chunks = [];
33
+ const errChunks = [];
34
+ proc.stdout.on("data", (d) => chunks.push(d));
35
+ proc.stderr.on("data", (d) => errChunks.push(d));
36
+ proc.on("error", rej);
37
+ proc.on("close", (code) => {
38
+ if (code !== 0) {
39
+ const stderr = Buffer.concat(errChunks).toString("utf-8").trim();
40
+ rej(new Error("xcodebuild -list failed (exit " + code + "):\n" + stderr));
41
+ return;
42
+ }
43
+ const raw = Buffer.concat(chunks).toString("utf-8").trim();
44
+ try {
45
+ res(JSON.parse(raw));
46
+ } catch {
47
+ rej(new Error("Failed to parse xcodebuild -list JSON:\n" + raw));
48
+ }
49
+ });
50
+ });
51
+ }
52
+ async function detectValues(options) {
53
+ const searchDir = resolve(options.searchDir ?? process.cwd());
54
+ let workspace = options.workspace ?? null;
55
+ let project = options.project ?? null;
56
+ if (!workspace && !project) {
57
+ workspace = await findFirst(searchDir, ".xcworkspace");
58
+ }
59
+ if (!workspace && !project) {
60
+ project = await findFirst(searchDir, ".xcodeproj");
61
+ }
62
+ if (!workspace && !project) {
63
+ throw new Error(
64
+ "Could not find .xcworkspace or .xcodeproj in " + searchDir + ". Pass workspace or project explicitly."
65
+ );
66
+ }
67
+ const listArgs = [];
68
+ if (workspace) listArgs.push("-workspace", workspace);
69
+ else if (project) listArgs.push("-project", project);
70
+ const listOutput = await xcodebuildList(listArgs);
71
+ const schemes = listOutput.workspace?.schemes ?? listOutput.project?.schemes ?? [];
72
+ const configurations = listOutput.project?.configurations ?? [];
73
+ const targets = listOutput.project?.targets ?? [];
74
+ let scheme = options.scheme ?? null;
75
+ if (!scheme) {
76
+ if (schemes.length === 1) {
77
+ scheme = schemes[0];
78
+ } else if (schemes.length > 1) {
79
+ const refName = (workspace ? basename(workspace, ".xcworkspace") : null) ?? (project ? basename(project, ".xcodeproj") : null);
80
+ if (refName) {
81
+ const m = schemes.find((s) => s === refName);
82
+ if (m) scheme = m;
83
+ }
84
+ if (!scheme) {
85
+ throw new Error(
86
+ "Multiple schemes found: " + schemes.join(", ") + ". Pass scheme explicitly."
87
+ );
88
+ }
89
+ } else {
90
+ throw new Error(
91
+ "No schemes found in the Xcode project. Make sure the scheme is shared."
92
+ );
93
+ }
94
+ }
95
+ const configuration = options.configuration ?? "Release";
96
+ return {
97
+ workspace,
98
+ project,
99
+ scheme,
100
+ configuration,
101
+ schemes,
102
+ configurations,
103
+ targets
104
+ };
105
+ }
106
+ function inferSigningStyle(config) {
107
+ if (config.signingStyle) return config.signingStyle;
108
+ if (config.provisioningProfiles && Object.keys(config.provisioningProfiles).length > 0) {
109
+ return "manual";
110
+ }
111
+ return "automatic";
112
+ }
113
+ function buildExportOptions(config) {
114
+ const opts = {
115
+ method: config.exportMethod
116
+ };
117
+ const signingStyle = inferSigningStyle(config);
118
+ opts.signingStyle = signingStyle;
119
+ if (config.teamId) {
120
+ opts.teamID = config.teamId;
121
+ }
122
+ if (signingStyle === "manual" && config.provisioningProfiles) {
123
+ opts.provisioningProfiles = config.provisioningProfiles;
124
+ }
125
+ if (config.signingCertificate) {
126
+ opts.signingCertificate = config.signingCertificate;
127
+ }
128
+ opts.uploadBitcode = config.includeBitcode ?? false;
129
+ opts.compileBitcode = config.includeBitcode ?? false;
130
+ opts.uploadSymbols = config.includeSymbols ?? true;
131
+ if (config.destination) {
132
+ opts.destination = config.destination;
133
+ }
134
+ if (config.thinning) {
135
+ opts.thinning = config.thinning;
136
+ }
137
+ if (config.catalystPlatform) {
138
+ opts.distributionBundleIdentifier = void 0;
139
+ }
140
+ if (config.additionalOptions) {
141
+ Object.assign(opts, config.additionalOptions);
142
+ }
143
+ return opts;
144
+ }
145
+ function generateExportOptionsPlistXml(config) {
146
+ const opts = buildExportOptions(config);
147
+ return plist.build(opts);
148
+ }
149
+ async function writeExportOptionsPlist(dir, config) {
150
+ const xml = generateExportOptionsPlistXml(config);
151
+ const plistPath = join(dir, "exportOptions.plist");
152
+ await writeFile(plistPath, xml, "utf-8");
153
+ return plistPath;
154
+ }
155
+
156
+ // src/gym/index.ts
157
+ function runXcodebuild(args, onOutput) {
158
+ return new Promise((res, rej) => {
159
+ const proc = spawn("xcodebuild", args, {
160
+ stdio: ["ignore", "pipe", "pipe"]
161
+ });
162
+ const chunks = [];
163
+ const handleData = (data) => {
164
+ const text = data.toString("utf-8");
165
+ chunks.push(text);
166
+ if (onOutput) onOutput(text);
167
+ };
168
+ proc.stdout.on("data", handleData);
169
+ proc.stderr.on("data", handleData);
170
+ proc.on("error", rej);
171
+ proc.on("close", (code) => {
172
+ res({ exitCode: code ?? 1, output: chunks.join("") });
173
+ });
174
+ });
175
+ }
176
+ async function findFileWithExtension(dir, ext) {
177
+ let entries;
178
+ try {
179
+ entries = await readdir(dir, { withFileTypes: true });
180
+ } catch {
181
+ return null;
182
+ }
183
+ for (const entry of entries) {
184
+ const full = join(dir, entry.name);
185
+ if (entry.name.endsWith(ext) && !entry.isDirectory()) {
186
+ return full;
187
+ }
188
+ if (entry.isDirectory()) {
189
+ const found = await findFileWithExtension(full, ext);
190
+ if (found) return found;
191
+ }
192
+ }
193
+ return null;
194
+ }
195
+ async function compressDsyms(dsymDir, outputPath) {
196
+ return new Promise((res, rej) => {
197
+ const proc = spawn("tar", ["-czf", outputPath, "-C", dsymDir, "."], {
198
+ stdio: ["ignore", "pipe", "pipe"]
199
+ });
200
+ proc.on("error", rej);
201
+ proc.on("close", (code) => {
202
+ if (code !== 0) rej(new Error("tar failed with exit code " + code));
203
+ else res(outputPath);
204
+ });
205
+ });
206
+ }
207
+ async function buildApp(options) {
208
+ requireMacOS("gym");
209
+ const detected = await detectValues({
210
+ workspace: options.workspace,
211
+ project: options.project,
212
+ scheme: options.scheme,
213
+ configuration: options.configuration
214
+ });
215
+ const { workspace, project, scheme, configuration } = detected;
216
+ const outputDir = resolve(
217
+ options.outputDirectory ?? join(process.cwd(), "output")
218
+ );
219
+ await mkdir(outputDir, { recursive: true });
220
+ const archiveName = options.outputName ?? scheme;
221
+ const archivePath = options.archivePath ?? join(outputDir, archiveName + ".xcarchive");
222
+ const exportPath = join(outputDir, "export");
223
+ await mkdir(exportPath, { recursive: true });
224
+ const tmpDir = join(tmpdir(), "fastnode-gym-" + randomUUID());
225
+ await mkdir(tmpDir, { recursive: true });
226
+ const fullOutput = [];
227
+ const onOutput = (chunk) => {
228
+ fullOutput.push(chunk);
229
+ if (options.onOutput) options.onOutput(chunk);
230
+ };
231
+ try {
232
+ if (options.clean) {
233
+ const cleanArgs = ["clean"];
234
+ if (workspace) cleanArgs.push("-workspace", workspace);
235
+ else if (project) cleanArgs.push("-project", project);
236
+ cleanArgs.push("-scheme", scheme, "-configuration", configuration);
237
+ if (options.xcargs) cleanArgs.push(...options.xcargs.split(/\s+/));
238
+ const cleanResult = await runXcodebuild(cleanArgs, onOutput);
239
+ if (cleanResult.exitCode !== 0) {
240
+ return {
241
+ success: false,
242
+ exitCode: cleanResult.exitCode,
243
+ ipaPath: null,
244
+ pkgPath: null,
245
+ dsymPath: null,
246
+ archivePath,
247
+ output: fullOutput.join("")
248
+ };
249
+ }
250
+ }
251
+ const archiveArgs = ["archive"];
252
+ if (workspace) archiveArgs.push("-workspace", workspace);
253
+ else if (project) archiveArgs.push("-project", project);
254
+ archiveArgs.push("-scheme", scheme);
255
+ archiveArgs.push("-archivePath", archivePath);
256
+ archiveArgs.push("-configuration", configuration);
257
+ if (options.sdk) {
258
+ archiveArgs.push("-sdk", options.sdk);
259
+ }
260
+ if (options.destination) {
261
+ archiveArgs.push("-destination", options.destination);
262
+ }
263
+ if (options.derivedDataPath) {
264
+ archiveArgs.push("-derivedDataPath", options.derivedDataPath);
265
+ }
266
+ if (options.xcargs) {
267
+ archiveArgs.push(...options.xcargs.split(/\s+/));
268
+ }
269
+ const archiveResult = await runXcodebuild(archiveArgs, onOutput);
270
+ if (archiveResult.exitCode !== 0) {
271
+ return {
272
+ success: false,
273
+ exitCode: archiveResult.exitCode,
274
+ ipaPath: null,
275
+ pkgPath: null,
276
+ dsymPath: null,
277
+ archivePath,
278
+ output: fullOutput.join("")
279
+ };
280
+ }
281
+ const exportOptionsPlistPath = await writeExportOptionsPlist(tmpDir, {
282
+ exportMethod: options.exportMethod,
283
+ teamId: options.teamId,
284
+ provisioningProfiles: options.provisioningProfiles,
285
+ signingCertificate: options.codeSignIdentity,
286
+ includeBitcode: options.includeBitcode,
287
+ includeSymbols: options.includeSymbols,
288
+ additionalOptions: options.exportOptions
289
+ });
290
+ const exportArgs = [
291
+ "-exportArchive",
292
+ "-archivePath",
293
+ archivePath,
294
+ "-exportOptionsPlist",
295
+ exportOptionsPlistPath,
296
+ "-exportPath",
297
+ exportPath
298
+ ];
299
+ if (options.xcargs) {
300
+ exportArgs.push(...options.xcargs.split(/\s+/));
301
+ }
302
+ const exportResult = await runXcodebuild(exportArgs, onOutput);
303
+ if (exportResult.exitCode !== 0) {
304
+ return {
305
+ success: false,
306
+ exitCode: exportResult.exitCode,
307
+ ipaPath: null,
308
+ pkgPath: null,
309
+ dsymPath: null,
310
+ archivePath,
311
+ output: fullOutput.join("")
312
+ };
313
+ }
314
+ let ipaPath = await findFileWithExtension(exportPath, ".ipa");
315
+ let pkgPath = await findFileWithExtension(exportPath, ".pkg");
316
+ let dsymPath = null;
317
+ const dsymsDir = join(archivePath, "dSYMs");
318
+ try {
319
+ const dsymStat = await stat(dsymsDir);
320
+ if (dsymStat.isDirectory()) {
321
+ const dsymEntries = await readdir(dsymsDir);
322
+ if (dsymEntries.length > 0) {
323
+ dsymPath = join(outputDir, archiveName + ".app.dSYM.zip");
324
+ await compressDsyms(dsymsDir, dsymPath);
325
+ }
326
+ }
327
+ } catch {
328
+ }
329
+ return {
330
+ success: true,
331
+ exitCode: 0,
332
+ ipaPath,
333
+ pkgPath,
334
+ dsymPath,
335
+ archivePath,
336
+ output: fullOutput.join("")
337
+ };
338
+ } finally {
339
+ await rm(tmpDir, { recursive: true, force: true }).catch(() => {
340
+ });
341
+ }
342
+ }
343
+
344
+ export { buildApp, buildExportOptions, detectValues, generateExportOptionsPlistXml, writeExportOptionsPlist };
345
+ //# sourceMappingURL=index.mjs.map
346
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/xcode/platform.ts","../../src/gym/detect.ts","../../src/gym/export-options.ts","../../src/gym/index.ts"],"names":["join","spawn","readdir","resolve"],"mappings":";;;;;;;;;;AAAO,SAAS,aAAa,OAAA,EAAuB;AAClD,EAAA,IAAI,OAAA,CAAQ,aAAa,QAAA,EAAU;AACjC,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,CAAA,EAAG,OAAO,CAAA,yFAAA,EACoB,OAAA,CAAQ,QAAQ,CAAA,CAAA;AAAA,KAChD;AAAA,EACF;AACF;AC2BA,eAAe,SAAA,CAAU,KAAa,GAAA,EAAqC;AACzE,EAAA,MAAM,UAAU,MAAM,OAAA,CAAQ,KAAK,EAAE,aAAA,EAAe,MAAM,CAAA;AAC1D,EAAA,KAAA,MAAW,SAAS,OAAA,EAAS;AAC3B,IAAA,IAAI,KAAA,CAAM,IAAA,CAAK,QAAA,CAAS,GAAG,CAAA,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I,QAAA,GAA0B,IAAA;AAC9B,IAAA,MAAM,QAAA,GAAWA,IAAAA,CAAK,WAAA,EAAa,OAAO,CAAA;AAC1C,IAAA,IAAI;AACF,MAAA,MAAM,QAAA,GAAW,MAAM,IAAA,CAAK,QAAQ,CAAA;AACpC,MAAA,IAAI,QAAA,CAAS,aAAY,EAAG;AAC1B,QAAA,MAAM,WAAA,GAAc,MAAME,OAAAA,CAAQ,QAAQ,CAAA;AAC1C,QAAA,IAAI,WAAA,CAAY,SAAS,CAAA,EAAG;AAC1B,UAAA,QAAA,GAAWF,IAAAA,CAAK,SAAA,EAAW,WAAA,GAAc,eAAe,CAAA;AACxD,UAAA,MAAM,aAAA,CAAc,UAAU,QAAQ,CAAA;AAAA,QACxC;AAAA,MACF;AAAA,IACF,CAAA,CAAA,MAAQ;AAAA,IAER;AAEA,IAAA,OAAO;AAAA,MACL,OAAA,EAAS,IAAA;AAAA,MACT,QAAA,EAAU,CAAA;AAAA,MACV,OAAA;AAAA,MACA,OAAA;AAAA,MACA,QAAA;AAAA,MACA,WAAA;AAAA,MACA,MAAA,EAAQ,UAAA,CAAW,IAAA,CAAK,EAAE;AAAA,KAC5B;AAAA,EACF,CAAA,SAAE;AAEA,IAAA,MAAM,EAAA,CAAG,MAAA,EAAQ,EAAE,SAAA,EAAW,IAAA,EAAM,OAAO,IAAA,EAAM,CAAA,CAAE,KAAA,CAAM,MAAM;AAAA,IAAC,CAAC,CAAA;AAAA,EACnE;AACF","file":"index.mjs","sourcesContent":["export function requireMacOS(feature: string): void {\n if (process.platform !== \"darwin\") {\n throw new Error(\n `${feature} requires macOS. This operation uses Xcode command-line tools ` +\n `which are not available on ${process.platform}.`\n );\n }\n}\n\nexport function isMacOS(): boolean {\n return process.platform === \"darwin\";\n}\n","import { readdir } from \"node:fs/promises\";\nimport { join, resolve, basename } from \"node:path\";\nimport { spawn } from \"node:child_process\";\n\n// ── Types ──────────────────────────────────────────────────────────────────\n\nexport interface DetectedValues {\n workspace: string | null;\n project: string | null;\n scheme: string;\n configuration: string;\n schemes: string[];\n configurations: string[];\n targets: string[];\n}\n\nexport interface XcodeBuildListOutput {\n project?: {\n name: string;\n schemes: string[];\n configurations: string[];\n targets: string[];\n };\n workspace?: {\n name: string;\n schemes: string[];\n };\n}\n\n// ── Helpers ────────────────────────────────────────────────────────────────\n\n/**\n * Find the first file in `dir` matching the given extension.\n */\nasync function findFirst(dir: string, ext: string): Promise<string | null> {\n const entries = await readdir(dir, { withFileTypes: true });\n for (const entry of entries) {\n if (entry.name.endsWith(ext) && !entry.name.startsWith(\".\")) {\n return join(dir, entry.name);\n }\n }\n return null;\n}\n\n/**\n * Run `xcodebuild -list -json` and return parsed JSON.\n */\nasync function xcodebuildList(args: string[]): Promise<XcodeBuildListOutput> {\n return new Promise<XcodeBuildListOutput>((res, rej) => {\n const proc = spawn(\"xcodebuild\", [\"-list\", \"-json\", ...args], {\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n const chunks: Buffer[] = [];\n const errChunks: Buffer[] = [];\n proc.stdout.on(\"data\", (d: Buffer) => chunks.push(d));\n proc.stderr.on(\"data\", (d: Buffer) => errChunks.push(d));\n proc.on(\"error\", rej);\n proc.on(\"close\", (code) => {\n if (code !== 0) {\n const stderr = Buffer.concat(errChunks).toString(\"utf-8\").trim();\n rej(new Error(\"xcodebuild -list failed (exit \" + code + \"):\\n\" + stderr));\n return;\n }\n const raw = Buffer.concat(chunks).toString(\"utf-8\").trim();\n try {\n res(JSON.parse(raw) as XcodeBuildListOutput);\n } catch {\n rej(new Error(\"Failed to parse xcodebuild -list JSON:\\n\" + raw));\n }\n });\n });\n}\n\n// ── Public API ─────────────────────────────────────────────────────────────\n\n/**\n * Auto-detect the Xcode workspace/project, scheme, and configuration.\n *\n * Workspace/project resolution:\n * 1. Explicit option\n * 2. First `.xcworkspace` in searchDir\n * 3. First `.xcodeproj` in searchDir\n *\n * Scheme resolution:\n * 1. Explicit option\n * 2. Sole scheme -> auto-select\n * 3. Scheme matching workspace/project name\n * 4. Error\n */\nexport async function detectValues(options: {\n workspace?: string;\n project?: string;\n scheme?: string;\n configuration?: string;\n searchDir?: string;\n}): Promise<DetectedValues> {\n const searchDir = resolve(options.searchDir ?? process.cwd());\n\n // ── Resolve workspace / project ───────────────────────────────────────\n\n let workspace = options.workspace ?? null;\n let project = options.project ?? null;\n\n if (!workspace && !project) {\n workspace = await findFirst(searchDir, \".xcworkspace\");\n }\n if (!workspace && !project) {\n project = await findFirst(searchDir, \".xcodeproj\");\n }\n if (!workspace && !project) {\n throw new Error(\n \"Could not find .xcworkspace or .xcodeproj in \" + searchDir +\n \". Pass workspace or project explicitly.\",\n );\n }\n\n // ── Run xcodebuild -list ──────────────────────────────────────────────\n\n const listArgs: string[] = [];\n if (workspace) listArgs.push(\"-workspace\", workspace);\n else if (project) listArgs.push(\"-project\", project);\n\n const listOutput = await xcodebuildList(listArgs);\n\n const schemes: string[] =\n listOutput.workspace?.schemes ?? listOutput.project?.schemes ?? [];\n const configurations: string[] =\n listOutput.project?.configurations ?? [];\n const targets: string[] = listOutput.project?.targets ?? [];\n\n // ── Resolve scheme ────────────────────────────────────────────────────\n\n let scheme = options.scheme ?? null;\n\n if (!scheme) {\n if (schemes.length === 1) {\n scheme = schemes[0];\n } else if (schemes.length > 1) {\n const refName =\n (workspace ? basename(workspace, \".xcworkspace\") : null) ??\n (project ? basename(project, \".xcodeproj\") : null);\n if (refName) {\n const m = schemes.find((s) => s === refName);\n if (m) scheme = m;\n }\n if (!scheme) {\n throw new Error(\n \"Multiple schemes found: \" + schemes.join(\", \") +\n \". Pass scheme explicitly.\",\n );\n }\n } else {\n throw new Error(\n \"No schemes found in the Xcode project. Make sure the scheme is shared.\",\n );\n }\n }\n\n const configuration = options.configuration ?? \"Release\";\n\n return {\n workspace,\n project,\n scheme,\n configuration,\n schemes,\n configurations,\n targets,\n };\n}\n","import { writeFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport plist from \"plist\";\nimport type { ExportMethod } from \"../types/index.js\";\n\n// ── Types ──────────────────────────────────────────────────────────────────\n\nexport interface ExportOptionsPlistConfig {\n /** The export method: app-store, ad-hoc, development, enterprise, etc. */\n exportMethod: ExportMethod;\n /** Apple Developer team ID */\n teamId?: string;\n /**\n * Map of bundle identifier to provisioning profile name.\n * e.g. { \"com.example.app\": \"MyApp Distribution\" }\n */\n provisioningProfiles?: Record<string, string>;\n /** Whether to include bitcode (deprecated in Xcode 14+, defaults to false) */\n includeBitcode?: boolean;\n /** Whether to include symbols in the export (defaults to true) */\n includeSymbols?: boolean;\n /** Code signing identity, e.g. \"Apple Distribution: Company (TEAM_ID)\" */\n signingCertificate?: string;\n /** Signing style: \"manual\" or \"automatic\" */\n signingStyle?: \"manual\" | \"automatic\";\n /** Destination for export: \"export\" or \"upload\" */\n destination?: \"export\" | \"upload\";\n /** Whether to generate an app thinning report */\n thinning?: string;\n /** Catalyst platform: \"macos\" or \"ios\" */\n catalystPlatform?: string;\n /** Additional arbitrary keys to merge into the plist */\n additionalOptions?: Record<string, unknown>;\n}\n\n// ── Signing Style Inference ────────────────────────────────────────────────\n\nfunction inferSigningStyle(\n config: ExportOptionsPlistConfig,\n): \"manual\" | \"automatic\" {\n if (config.signingStyle) return config.signingStyle;\n // If provisioning profiles are specified, use manual signing\n if (\n config.provisioningProfiles &&\n Object.keys(config.provisioningProfiles).length > 0\n ) {\n return \"manual\";\n }\n return \"automatic\";\n}\n\n// ── Public API ─────────────────────────────────────────────────────────────\n\n/**\n * Build the exportOptions plist dictionary. Returns a plain object that can be\n * serialized to XML plist via the `plist` package.\n */\nexport function buildExportOptions(\n config: ExportOptionsPlistConfig,\n): Record<string, unknown> {\n const opts: Record<string, unknown> = {\n method: config.exportMethod,\n };\n\n const signingStyle = inferSigningStyle(config);\n opts.signingStyle = signingStyle;\n\n if (config.teamId) {\n opts.teamID = config.teamId;\n }\n\n if (signingStyle === \"manual\" && config.provisioningProfiles) {\n opts.provisioningProfiles = config.provisioningProfiles;\n }\n\n if (config.signingCertificate) {\n opts.signingCertificate = config.signingCertificate;\n }\n\n // Bitcode (default false for modern Xcode)\n opts.uploadBitcode = config.includeBitcode ?? false;\n opts.compileBitcode = config.includeBitcode ?? false;\n\n // Symbols (default true)\n opts.uploadSymbols = config.includeSymbols ?? true;\n\n if (config.destination) {\n opts.destination = config.destination;\n }\n\n if (config.thinning) {\n opts.thinning = config.thinning;\n }\n\n if (config.catalystPlatform) {\n // Apple expects \"macos\" or \"ios\"\n opts.distributionBundleIdentifier = undefined;\n }\n\n // Merge additional options last so they can override anything\n if (config.additionalOptions) {\n Object.assign(opts, config.additionalOptions);\n }\n\n return opts;\n}\n\n/**\n * Generate an exportOptions plist XML string from the given config.\n */\nexport function generateExportOptionsPlistXml(\n config: ExportOptionsPlistConfig,\n): string {\n const opts = buildExportOptions(config);\n return plist.build(opts as plist.PlistObject);\n}\n\n/**\n * Write an exportOptions.plist file to disk and return its path.\n *\n * @param dir - Directory to write the file into\n * @param config - Export options configuration\n * @returns The absolute path to the written plist file\n */\nexport async function writeExportOptionsPlist(\n dir: string,\n config: ExportOptionsPlistConfig,\n): Promise<string> {\n const xml = generateExportOptionsPlistXml(config);\n const plistPath = join(dir, \"exportOptions.plist\");\n await writeFile(plistPath, xml, \"utf-8\");\n return plistPath;\n}\n","import { spawn } from \"node:child_process\";\nimport { mkdir, readdir, rm, stat } from \"node:fs/promises\";\nimport { join, resolve } from \"node:path\";\nimport { tmpdir } from \"node:os\";\nimport { randomUUID } from \"node:crypto\";\n\nimport { requireMacOS } from \"../xcode/platform.js\";\nimport { detectValues } from \"./detect.js\";\nimport { writeExportOptionsPlist } from \"./export-options.js\";\nimport type { ExportMethod } from \"../types/index.js\";\n\n// ── Re-exports ─────────────────────────────────────────────────────────────\n\nexport { detectValues } from \"./detect.js\";\nexport type { DetectedValues, XcodeBuildListOutput } from \"./detect.js\";\nexport {\n buildExportOptions,\n generateExportOptionsPlistXml,\n writeExportOptionsPlist,\n} from \"./export-options.js\";\nexport type { ExportOptionsPlistConfig } from \"./export-options.js\";\n\n// ── Types ──────────────────────────────────────────────────────────────────\n\nexport interface GymOptions {\n scheme: string;\n workspace?: string;\n project?: string;\n configuration?: string;\n exportMethod: ExportMethod;\n teamId?: string;\n provisioningProfiles?: Record<string, string>;\n codeSignIdentity?: string;\n outputDirectory?: string;\n outputName?: string;\n clean?: boolean;\n archivePath?: string;\n derivedDataPath?: string;\n xcargs?: string;\n buildPath?: string;\n includeBitcode?: boolean;\n includeSymbols?: boolean;\n exportOptions?: Record<string, unknown>;\n sdk?: string;\n destination?: string;\n catalystPlatform?: string;\n disableXcpretty?: boolean;\n onOutput?: (chunk: string) => void;\n}\n\nexport interface GymResult {\n success: boolean;\n exitCode: number;\n ipaPath: string | null;\n pkgPath: string | null;\n dsymPath: string | null;\n archivePath: string;\n output: string;\n}\n\n// ── Internal helpers ───────────────────────────────────────────────────────\n\n/**\n * Spawn xcodebuild with the given args, streaming stdout/stderr to the\n * optional `onOutput` callback and collecting full output.\n */\nfunction runXcodebuild(\n args: string[],\n onOutput?: (chunk: string) => void,\n): Promise<{ exitCode: number; output: string }> {\n return new Promise((res, rej) => {\n const proc = spawn(\"xcodebuild\", args, {\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n\n const chunks: string[] = [];\n\n const handleData = (data: Buffer) => {\n const text = data.toString(\"utf-8\");\n chunks.push(text);\n if (onOutput) onOutput(text);\n };\n\n proc.stdout.on(\"data\", handleData);\n proc.stderr.on(\"data\", handleData);\n proc.on(\"error\", rej);\n proc.on(\"close\", (code) => {\n res({ exitCode: code ?? 1, output: chunks.join(\"\") });\n });\n });\n}\n\n/**\n * Recursively find the first file matching `ext` inside `dir`.\n */\nasync function findFileWithExtension(\n dir: string,\n ext: string,\n): Promise<string | null> {\n let entries;\n try {\n entries = await readdir(dir, { withFileTypes: true });\n } catch {\n return null;\n }\n for (const entry of entries) {\n const full = join(dir, entry.name);\n if (entry.name.endsWith(ext) && !entry.isDirectory()) {\n return full;\n }\n if (entry.isDirectory()) {\n const found = await findFileWithExtension(full, ext);\n if (found) return found;\n }\n }\n return null;\n}\n\n/**\n * Compress a directory to a .tar.gz file and return its path.\n */\nasync function compressDsyms(\n dsymDir: string,\n outputPath: string,\n): Promise<string> {\n return new Promise((res, rej) => {\n const proc = spawn(\"tar\", [\"-czf\", outputPath, \"-C\", dsymDir, \".\"], {\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n proc.on(\"error\", rej);\n proc.on(\"close\", (code) => {\n if (code !== 0) rej(new Error(\"tar failed with exit code \" + code));\n else res(outputPath);\n });\n });\n}\n\n// ── Main entry point ───────────────────────────────────────────────────────\n\n/**\n * Build an iOS/macOS app using xcodebuild archive + exportArchive.\n * This is the TypeScript equivalent of Fastlane's `gym` (alias `build_app`).\n *\n * Steps:\n * 1. requireMacOS(\"gym\")\n * 2. Detect values (workspace/project/scheme/config)\n * 3. Clean if requested\n * 4. Archive via `xcodebuild archive`\n * 5. Generate exportOptionsPlist\n * 6. Export via `xcodebuild -exportArchive`\n * 7. Find IPA/PKG, compress dSYMs\n * 8. Return GymResult\n */\nexport async function buildApp(options: GymOptions): Promise<GymResult> {\n requireMacOS(\"gym\");\n\n // ── 1. Detect values ──────────────────────────────────────────────────\n\n const detected = await detectValues({\n workspace: options.workspace,\n project: options.project,\n scheme: options.scheme,\n configuration: options.configuration,\n });\n\n const { workspace, project, scheme, configuration } = detected;\n\n // ── 2. Prepare paths ─────────────────────────────────────────────────\n\n const outputDir = resolve(\n options.outputDirectory ?? join(process.cwd(), \"output\"),\n );\n await mkdir(outputDir, { recursive: true });\n\n const archiveName = options.outputName ?? scheme;\n const archivePath =\n options.archivePath ?? join(outputDir, archiveName + \".xcarchive\");\n const exportPath = join(outputDir, \"export\");\n await mkdir(exportPath, { recursive: true });\n\n // Temp directory for the export options plist\n const tmpDir = join(tmpdir(), \"fastnode-gym-\" + randomUUID());\n await mkdir(tmpDir, { recursive: true });\n\n const fullOutput: string[] = [];\n const onOutput = (chunk: string) => {\n fullOutput.push(chunk);\n if (options.onOutput) options.onOutput(chunk);\n };\n\n try {\n // ── 3. Clean if requested ─────────────────────────────────────────\n\n if (options.clean) {\n const cleanArgs = [\"clean\"];\n if (workspace) cleanArgs.push(\"-workspace\", workspace);\n else if (project) cleanArgs.push(\"-project\", project);\n cleanArgs.push(\"-scheme\", scheme, \"-configuration\", configuration);\n if (options.xcargs) cleanArgs.push(...options.xcargs.split(/\\s+/));\n\n const cleanResult = await runXcodebuild(cleanArgs, onOutput);\n if (cleanResult.exitCode !== 0) {\n return {\n success: false,\n exitCode: cleanResult.exitCode,\n ipaPath: null,\n pkgPath: null,\n dsymPath: null,\n archivePath,\n output: fullOutput.join(\"\"),\n };\n }\n }\n\n // ── 4. Archive ────────────────────────────────────────────────────\n\n const archiveArgs: string[] = [\"archive\"];\n\n if (workspace) archiveArgs.push(\"-workspace\", workspace);\n else if (project) archiveArgs.push(\"-project\", project);\n\n archiveArgs.push(\"-scheme\", scheme);\n archiveArgs.push(\"-archivePath\", archivePath);\n archiveArgs.push(\"-configuration\", configuration);\n\n if (options.sdk) {\n archiveArgs.push(\"-sdk\", options.sdk);\n }\n if (options.destination) {\n archiveArgs.push(\"-destination\", options.destination);\n }\n if (options.derivedDataPath) {\n archiveArgs.push(\"-derivedDataPath\", options.derivedDataPath);\n }\n if (options.xcargs) {\n archiveArgs.push(...options.xcargs.split(/\\s+/));\n }\n\n const archiveResult = await runXcodebuild(archiveArgs, onOutput);\n if (archiveResult.exitCode !== 0) {\n return {\n success: false,\n exitCode: archiveResult.exitCode,\n ipaPath: null,\n pkgPath: null,\n dsymPath: null,\n archivePath,\n output: fullOutput.join(\"\"),\n };\n }\n\n // ── 5. Generate exportOptionsPlist ────────────────────────────────\n\n const exportOptionsPlistPath = await writeExportOptionsPlist(tmpDir, {\n exportMethod: options.exportMethod,\n teamId: options.teamId,\n provisioningProfiles: options.provisioningProfiles,\n signingCertificate: options.codeSignIdentity,\n includeBitcode: options.includeBitcode,\n includeSymbols: options.includeSymbols,\n additionalOptions: options.exportOptions,\n });\n\n // ── 6. Export archive ─────────────────────────────────────────────\n\n const exportArgs: string[] = [\n \"-exportArchive\",\n \"-archivePath\",\n archivePath,\n \"-exportOptionsPlist\",\n exportOptionsPlistPath,\n \"-exportPath\",\n exportPath,\n ];\n\n if (options.xcargs) {\n exportArgs.push(...options.xcargs.split(/\\s+/));\n }\n\n const exportResult = await runXcodebuild(exportArgs, onOutput);\n if (exportResult.exitCode !== 0) {\n return {\n success: false,\n exitCode: exportResult.exitCode,\n ipaPath: null,\n pkgPath: null,\n dsymPath: null,\n archivePath,\n output: fullOutput.join(\"\"),\n };\n }\n\n // ── 7. Find outputs ───────────────────────────────────────────────\n\n // Find IPA\n let ipaPath = await findFileWithExtension(exportPath, \".ipa\");\n\n // Find PKG (macOS installer)\n let pkgPath = await findFileWithExtension(exportPath, \".pkg\");\n\n // Compress dSYMs\n let dsymPath: string | null = null;\n const dsymsDir = join(archivePath, \"dSYMs\");\n try {\n const dsymStat = await stat(dsymsDir);\n if (dsymStat.isDirectory()) {\n const dsymEntries = await readdir(dsymsDir);\n if (dsymEntries.length > 0) {\n dsymPath = join(outputDir, archiveName + \".app.dSYM.zip\");\n await compressDsyms(dsymsDir, dsymPath);\n }\n }\n } catch {\n // No dSYMs directory — that's OK\n }\n\n return {\n success: true,\n exitCode: 0,\n ipaPath,\n pkgPath,\n dsymPath,\n archivePath,\n output: fullOutput.join(\"\"),\n };\n } finally {\n // Clean up temp directory\n await rm(tmpDir, { recursive: true, force: true }).catch(() => {});\n }\n}\n"]}
@@ -0,0 +1,99 @@
1
+ import { A as AppStoreConnectClient } from './index-D1Izm7qt.js';
2
+ import { b as Platform, R as ReleaseType } from './enums-B609j2rb.js';
3
+
4
+ interface LocalizedMetadata {
5
+ locale: string;
6
+ description?: string;
7
+ keywords?: string;
8
+ releaseNotes?: string;
9
+ supportUrl?: string;
10
+ marketingUrl?: string;
11
+ promotionalText?: string;
12
+ name?: string;
13
+ subtitle?: string;
14
+ privacyUrl?: string;
15
+ }
16
+ /**
17
+ * Review information submitted to App Store Connect for App Review.
18
+ * Mirrors Fastlane deliver's `review_first_name`, `review_last_name`,
19
+ * etc. (upload_metadata.rb lines 45-51), mapping to ASC's
20
+ * `appStoreReviewDetails` attribute names.
21
+ */
22
+ interface ReviewInformation {
23
+ firstName?: string;
24
+ lastName?: string;
25
+ phoneNumber?: string;
26
+ emailAddress?: string;
27
+ demoUser?: string;
28
+ demoPassword?: string;
29
+ notes?: string;
30
+ }
31
+ interface MetadataSet {
32
+ localizations: LocalizedMetadata[];
33
+ copyright?: string;
34
+ /** Typed review information extracted from `review_information/`. */
35
+ reviewInformation?: ReviewInformation;
36
+ /** Raw review information map, including any unrecognised filenames. */
37
+ reviewInfo?: Record<string, string>;
38
+ }
39
+ declare function loadMetadata(metadataPath: string): Promise<MetadataSet>;
40
+
41
+ interface DeliverOptions {
42
+ client: AppStoreConnectClient;
43
+ bundleIdentifier: string;
44
+ appVersion?: string;
45
+ platform?: Platform;
46
+ ipaPath?: string;
47
+ pkgPath?: string;
48
+ metadataPath?: string;
49
+ screenshotsPath?: string;
50
+ submitForReview?: boolean;
51
+ automaticRelease?: boolean;
52
+ releaseType?: ReleaseType;
53
+ skipBinaryUpload?: boolean;
54
+ skipMetadata?: boolean;
55
+ skipScreenshots?: boolean;
56
+ force?: boolean;
57
+ apiKeyId?: string;
58
+ apiIssuerId?: string;
59
+ apiPrivateKey?: string;
60
+ copyright?: string;
61
+ onOutput?: (chunk: string) => void;
62
+ }
63
+ interface DeliverResult {
64
+ appId: string;
65
+ versionId: string;
66
+ submitted: boolean;
67
+ }
68
+ declare function uploadToAppStore(options: DeliverOptions): Promise<DeliverResult>;
69
+ declare function submitForReview(options: {
70
+ client: AppStoreConnectClient;
71
+ appId: string;
72
+ versionId: string;
73
+ }): Promise<void>;
74
+ declare function uploadMetadata(options: {
75
+ client: AppStoreConnectClient;
76
+ appId: string;
77
+ versionId: string;
78
+ metadataPath: string;
79
+ }): Promise<void>;
80
+ declare function uploadScreenshots(options: {
81
+ client: AppStoreConnectClient;
82
+ versionId: string;
83
+ screenshotsPath: string;
84
+ }): Promise<void>;
85
+
86
+ type index_DeliverOptions = DeliverOptions;
87
+ type index_DeliverResult = DeliverResult;
88
+ type index_LocalizedMetadata = LocalizedMetadata;
89
+ type index_MetadataSet = MetadataSet;
90
+ declare const index_loadMetadata: typeof loadMetadata;
91
+ declare const index_submitForReview: typeof submitForReview;
92
+ declare const index_uploadMetadata: typeof uploadMetadata;
93
+ declare const index_uploadScreenshots: typeof uploadScreenshots;
94
+ declare const index_uploadToAppStore: typeof uploadToAppStore;
95
+ declare namespace index {
96
+ export { type index_DeliverOptions as DeliverOptions, type index_DeliverResult as DeliverResult, type index_LocalizedMetadata as LocalizedMetadata, type index_MetadataSet as MetadataSet, index_loadMetadata as loadMetadata, index_submitForReview as submitForReview, index_uploadMetadata as uploadMetadata, index_uploadScreenshots as uploadScreenshots, index_uploadToAppStore as uploadToAppStore };
97
+ }
98
+
99
+ export { type DeliverOptions as D, type LocalizedMetadata as L, type MetadataSet as M, type DeliverResult as a, uploadMetadata as b, uploadScreenshots as c, index as i, loadMetadata as l, submitForReview as s, uploadToAppStore as u };
@@ -0,0 +1,72 @@
1
+ import { A as AppStoreConnectClient } from './index-D1Izm7qt.js';
2
+ import { C as CertificateType } from './enums-B609j2rb.js';
3
+
4
+ type PushCertKind = "development" | "production" | "website" | "voip" | "passbook";
5
+ interface PemOptions {
6
+ client: AppStoreConnectClient;
7
+ bundleIdentifier: string;
8
+ development?: boolean;
9
+ websitePush?: boolean;
10
+ /** Voice-over-IP push cert (Portal type code `E5D663CMZW`). */
11
+ voipPush?: boolean;
12
+ /** Passbook/Wallet cert (Portal type code `Y3B2F3TYSI`). */
13
+ passbook?: boolean;
14
+ outputDir?: string;
15
+ p12Password?: string;
16
+ activeDaysLimit?: number;
17
+ force?: boolean;
18
+ platform?: "ios" | "macos";
19
+ generateP12?: boolean;
20
+ savePrivateKey?: boolean;
21
+ }
22
+ interface PemResult {
23
+ pemPath: string;
24
+ p12Path?: string;
25
+ keyPath?: string;
26
+ expiresAt: Date;
27
+ }
28
+ /**
29
+ * Resolve the push certificate descriptor for the given options. Returns:
30
+ * - `kind`: semantic certificate family (used in filename prefix)
31
+ * - `portalTypeCode`: Apple Developer Portal type code (matches Fastlane's
32
+ * `Spaceship::Portal::Certificate` codes in certificate.rb)
33
+ * - `ascCertificateType`: best-fit ASC `CertificateType` for the ASC API
34
+ * fallback path (note: push certs are really a Portal concept; the ASC
35
+ * cert types here only approximate the platform distinction).
36
+ */
37
+ declare function getPushCertificateType(options: {
38
+ development?: boolean;
39
+ websitePush?: boolean;
40
+ voipPush?: boolean;
41
+ passbook?: boolean;
42
+ platform?: "ios" | "macos";
43
+ }): {
44
+ kind: PushCertKind;
45
+ portalTypeCode: string;
46
+ ascCertificateType: CertificateType;
47
+ };
48
+ declare function createPushCertificate(options: PemOptions): Promise<PemResult>;
49
+ declare function renewPushCertificate(options: PemOptions): Promise<PemResult>;
50
+ declare function checkExpiration(options: {
51
+ client: AppStoreConnectClient;
52
+ bundleIdentifier: string;
53
+ development?: boolean;
54
+ activeDaysLimit?: number;
55
+ }): Promise<{
56
+ valid: boolean;
57
+ daysLeft: number;
58
+ expiresAt: Date | null;
59
+ }>;
60
+
61
+ type index_PemOptions = PemOptions;
62
+ type index_PemResult = PemResult;
63
+ type index_PushCertKind = PushCertKind;
64
+ declare const index_checkExpiration: typeof checkExpiration;
65
+ declare const index_createPushCertificate: typeof createPushCertificate;
66
+ declare const index_getPushCertificateType: typeof getPushCertificateType;
67
+ declare const index_renewPushCertificate: typeof renewPushCertificate;
68
+ declare namespace index {
69
+ export { type index_PemOptions as PemOptions, type index_PemResult as PemResult, type index_PushCertKind as PushCertKind, index_checkExpiration as checkExpiration, index_createPushCertificate as createPushCertificate, index_getPushCertificateType as getPushCertificateType, index_renewPushCertificate as renewPushCertificate };
70
+ }
71
+
72
+ export { type PushCertKind as P, type PemOptions as a, type PemResult as b, createPushCertificate as c, checkExpiration as d, getPushCertificateType as g, index as i, renewPushCertificate as r };
@@ -0,0 +1,76 @@
1
+ import { A as AppStoreConnectClient, p as CapabilitySettingInput, B as BundleId, o as BundleIdCapability, i as App } from './index-D1Izm7qt.js';
2
+ import { B as BundleIdPlatform, d as CapabilityType } from './enums-B609j2rb.js';
3
+
4
+ interface ProduceOptions {
5
+ client: AppStoreConnectClient;
6
+ bundleIdentifier: string;
7
+ appName: string;
8
+ platform?: BundleIdPlatform;
9
+ sku?: string;
10
+ primaryLocale?: string;
11
+ companyName?: string;
12
+ enableServices?: CapabilityType[];
13
+ }
14
+ /**
15
+ * Map from Fastlane's `produce` service name → App Store Connect
16
+ * `capabilityType`. Ported 1:1 from `produce/lib/produce/service.rb`'s
17
+ * `valid_services_for` list and `update` method, covering every service
18
+ * that Fastlane supports.
19
+ */
20
+ declare const SERVICE_NAME_TO_CAPABILITY: Record<string, CapabilityType>;
21
+ /**
22
+ * Build the `settings` payload for a capability whose service value is
23
+ * more than a plain boolean. Mirrors Fastlane's
24
+ * `Produce::Service#build_settings_for` applied per-service.
25
+ *
26
+ * Returns `undefined` when the service doesn't carry settings or the
27
+ * value is just `true`/`false`.
28
+ */
29
+ declare function buildCapabilitySettings(serviceName: string, value: string | boolean): CapabilitySettingInput[] | undefined;
30
+ declare function registerBundleId(options: {
31
+ client: AppStoreConnectClient;
32
+ identifier: string;
33
+ name: string;
34
+ platform?: BundleIdPlatform;
35
+ }): Promise<BundleId>;
36
+ declare function addCapability(options: {
37
+ client: AppStoreConnectClient;
38
+ bundleIdId: string;
39
+ capabilityType: CapabilityType;
40
+ settings?: CapabilitySettingInput[];
41
+ }): Promise<void>;
42
+ declare function removeCapability(options: {
43
+ client: AppStoreConnectClient;
44
+ capabilityId: string;
45
+ }): Promise<void>;
46
+ declare function listCapabilities(options: {
47
+ client: AppStoreConnectClient;
48
+ bundleIdId: string;
49
+ }): Promise<BundleIdCapability[]>;
50
+ declare function enableServices(options: {
51
+ client: AppStoreConnectClient;
52
+ bundleIdId: string;
53
+ /**
54
+ * Service names (Fastlane style, e.g. `data_protection`, `icloud`).
55
+ * Pass either a plain list of names or a record of name → value, where
56
+ * the value either is `true` or one of the per-service variants handled
57
+ * by `buildCapabilitySettings`.
58
+ */
59
+ services: string[] | Record<string, string | boolean>;
60
+ }): Promise<void>;
61
+ declare function createApp(options: ProduceOptions): Promise<App>;
62
+
63
+ type index_ProduceOptions = ProduceOptions;
64
+ declare const index_SERVICE_NAME_TO_CAPABILITY: typeof SERVICE_NAME_TO_CAPABILITY;
65
+ declare const index_addCapability: typeof addCapability;
66
+ declare const index_buildCapabilitySettings: typeof buildCapabilitySettings;
67
+ declare const index_createApp: typeof createApp;
68
+ declare const index_enableServices: typeof enableServices;
69
+ declare const index_listCapabilities: typeof listCapabilities;
70
+ declare const index_registerBundleId: typeof registerBundleId;
71
+ declare const index_removeCapability: typeof removeCapability;
72
+ declare namespace index {
73
+ export { type index_ProduceOptions as ProduceOptions, index_SERVICE_NAME_TO_CAPABILITY as SERVICE_NAME_TO_CAPABILITY, index_addCapability as addCapability, index_buildCapabilitySettings as buildCapabilitySettings, index_createApp as createApp, index_enableServices as enableServices, index_listCapabilities as listCapabilities, index_registerBundleId as registerBundleId, index_removeCapability as removeCapability };
74
+ }
75
+
76
+ export { type ProduceOptions as P, SERVICE_NAME_TO_CAPABILITY as S, addCapability as a, buildCapabilitySettings as b, removeCapability as c, createApp as d, enableServices as e, index as i, listCapabilities as l, registerBundleId as r };