@sitepong/fastnode 0.1.2 → 0.2.1

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 (70) hide show
  1. package/README.md +148 -0
  2. package/dist/actions/index.cjs +758 -110
  3. package/dist/actions/index.cjs.map +1 -1
  4. package/dist/actions/index.mjs +758 -110
  5. package/dist/actions/index.mjs.map +1 -1
  6. package/dist/cert/index.cjs +40 -0
  7. package/dist/cert/index.cjs.map +1 -1
  8. package/dist/cert/index.d.cts +3 -3
  9. package/dist/cert/index.d.ts +3 -3
  10. package/dist/cert/index.mjs +37 -1
  11. package/dist/cert/index.mjs.map +1 -1
  12. package/dist/{cert-owkOFNW8.d.ts → cert-e5GAgAPb.d.ts} +1 -1
  13. package/dist/{cert-BmJGtYtb.d.cts → cert-uLLdb5a7.d.cts} +1 -1
  14. package/dist/cli/index.cjs +758 -110
  15. package/dist/cli/index.cjs.map +1 -1
  16. package/dist/cli/index.d.cts +1 -1
  17. package/dist/cli/index.d.ts +1 -1
  18. package/dist/cli/index.mjs +758 -110
  19. package/dist/cli/index.mjs.map +1 -1
  20. package/dist/client/index.cjs +751 -109
  21. package/dist/client/index.cjs.map +1 -1
  22. package/dist/client/index.d.cts +1 -1
  23. package/dist/client/index.d.ts +1 -1
  24. package/dist/client/index.mjs +747 -110
  25. package/dist/client/index.mjs.map +1 -1
  26. package/dist/deliver/index.d.cts +2 -2
  27. package/dist/deliver/index.d.ts +2 -2
  28. package/dist/{index-BFdNOmPJ.d.cts → index-BN0iWhuw.d.cts} +1 -1
  29. package/dist/index-BNP7Bpu5.d.ts +61 -0
  30. package/dist/{index-1Vu2cRQ2.d.ts → index-BbY_H_f6.d.ts} +1 -1
  31. package/dist/{index-D6zjGlPL.d.cts → index-BgHagzj1.d.cts} +1 -1
  32. package/dist/{index-D5eihzwM.d.cts → index-BjkOUQcQ.d.cts} +1 -1
  33. package/dist/{index-D1Izm7qt.d.ts → index-BwwpAlk2.d.ts} +363 -2
  34. package/dist/{index-A5MimeQk.d.ts → index-C2YLoFVl.d.ts} +1 -1
  35. package/dist/{index-TfXqwuac.d.ts → index-CEldrbyz.d.ts} +1 -1
  36. package/dist/{index-BLubSlgK.d.cts → index-CdfgEZwh.d.cts} +363 -2
  37. package/dist/{index-DfCUVJX1.d.cts → index-Clyf4-lu.d.cts} +1 -1
  38. package/dist/index-CtydPNxA.d.cts +61 -0
  39. package/dist/{index-BQJIJlK7.d.cts → index-DHxi-QPC.d.cts} +3 -3
  40. package/dist/{index-BN0ubxjZ.d.ts → index-Di4Ic0EE.d.ts} +3 -3
  41. package/dist/{index-EcVvViW8.d.cts → index-DrCOh0Vh.d.cts} +1 -1
  42. package/dist/{index-B0yhu_LZ.d.ts → index-EKU_G1G5.d.ts} +1 -1
  43. package/dist/{index-CWNLnSOL.d.cts → index-XsMsVc3O.d.cts} +1 -1
  44. package/dist/{index-B9yXicrQ.d.ts → index-jeI44Q5G.d.ts} +1 -1
  45. package/dist/{index-DHw08dUc.d.ts → index-mddpvrRX.d.ts} +1 -1
  46. package/dist/index.cjs +1233 -110
  47. package/dist/index.cjs.map +1 -1
  48. package/dist/index.d.cts +226 -10
  49. package/dist/index.d.ts +226 -10
  50. package/dist/index.mjs +1230 -111
  51. package/dist/index.mjs.map +1 -1
  52. package/dist/lane/index.cjs +758 -110
  53. package/dist/lane/index.cjs.map +1 -1
  54. package/dist/lane/index.mjs +758 -110
  55. package/dist/lane/index.mjs.map +1 -1
  56. package/dist/match/index.d.cts +4 -4
  57. package/dist/match/index.d.ts +4 -4
  58. package/dist/pem/index.d.cts +2 -2
  59. package/dist/pem/index.d.ts +2 -2
  60. package/dist/pilot/index.d.cts +2 -2
  61. package/dist/pilot/index.d.ts +2 -2
  62. package/dist/precheck/index.d.cts +2 -2
  63. package/dist/precheck/index.d.ts +2 -2
  64. package/dist/produce/index.d.cts +2 -2
  65. package/dist/produce/index.d.ts +2 -2
  66. package/dist/sigh/index.d.cts +2 -2
  67. package/dist/sigh/index.d.ts +2 -2
  68. package/package.json +3 -1
  69. package/dist/index-DfirmFbC.d.ts +0 -32
  70. package/dist/index-lt819Jgj.d.cts +0 -32
package/dist/index.d.cts CHANGED
@@ -1,17 +1,18 @@
1
- export { i as App, I as AppScreenshot, K as AppScreenshotSet, H as AppScreenshotsResource, A as AppStoreConnectClient, c as AppStoreConnectConfig, a as AppStoreConnectError, F as AppStoreVersion, G as AppStoreVersionLocalization, O as AppStoreVersionSubmission, E as AppStoreVersionsResource, w as AppsResource, l as BetaBuildLocalization, k as BetaGroup, y as BetaGroupsResource, j as Build, m as BuildBetaDetail, x as BuildsResource, B as BundleId, o as BundleIdCapability, u as BundleIdsResource, z as CapabilitiesResource, r as CapabilityOption, q as CapabilitySetting, p as CapabilitySettingInput, C as Certificate, s as CertificatesResource, D as Device, v as DevicesResource, h as JsonApiError, g as JsonApiListResponse, J as JsonApiResource, f as JsonApiResponse, L as ListParams, n as PreReleaseVersion, P as Profile, t as ProfilesResource, b as RateLimitError, R as RequestClient, e as RequestOptions, N as ReviewSubmission, M as ReviewSubmissionsResource, d as TokenConfig, T as TokenManager, U as UploadOperation } from './index-BLubSlgK.cjs';
1
+ import { A as AppleSession } from './index-CdfgEZwh.cjs';
2
+ export { j as App, K as AppScreenshot, M as AppScreenshotSet, I as AppScreenshotsResource, a as AppStoreConnectClient, d as AppStoreConnectConfig, b as AppStoreConnectError, G as AppStoreVersion, H as AppStoreVersionLocalization, Q as AppStoreVersionSubmission, F as AppStoreVersionsResource, x as AppsResource, m as BetaBuildLocalization, l as BetaGroup, z as BetaGroupsResource, k as Build, n as BuildBetaDetail, y as BuildsResource, B as BundleId, p as BundleIdCapability, v as BundleIdsResource, E as CapabilitiesResource, s as CapabilityOption, r as CapabilitySetting, q as CapabilitySettingInput, C as Certificate, t as CertificatesResource, D as Device, w as DevicesResource, i as JsonApiError, h as JsonApiListResponse, J as JsonApiResource, g as JsonApiResponse, L as ListParams, o as PreReleaseVersion, P as Profile, u as ProfilesResource, c as RateLimitError, R as RequestClient, f as RequestOptions, O as ReviewSubmission, N as ReviewSubmissionsResource, e as TokenConfig, T as TokenManager, U as UploadOperation } from './index-CdfgEZwh.cjs';
2
3
  export { A as AppStoreVersionState, i as BetaReviewState, h as BuildProcessingState, B as BundleIdPlatform, f as CapabilityOptionKey, e as CapabilitySettingsKey, d as CapabilityType, C as CertificateType, g as ContentRightsDeclaration, D as DeviceClass, c as DeviceStatus, E as ExportMethod, b as Platform, a as ProfileState, P as ProfileType, R as ReleaseType } from './enums-B609j2rb.cjs';
3
- export { i as cert } from './index-lt819Jgj.cjs';
4
- export { i as sigh } from './index-BFdNOmPJ.cjs';
5
- export { i as match } from './index-BQJIJlK7.cjs';
6
- export { i as produce } from './index-D5eihzwM.cjs';
7
- export { i as pilot } from './index-D6zjGlPL.cjs';
8
- export { i as deliver } from './index-CWNLnSOL.cjs';
9
- export { i as pem } from './index-EcVvViW8.cjs';
4
+ export { i as cert } from './index-CtydPNxA.cjs';
5
+ export { i as sigh } from './index-BN0iWhuw.cjs';
6
+ export { i as match } from './index-DHxi-QPC.cjs';
7
+ export { i as produce } from './index-BjkOUQcQ.cjs';
8
+ export { i as pilot } from './index-BgHagzj1.cjs';
9
+ export { i as deliver } from './index-XsMsVc3O.cjs';
10
+ export { i as pem } from './index-DrCOh0Vh.cjs';
10
11
  export { i as gym } from './index-DrUpRXRG.cjs';
11
12
  export { i as scan } from './index-BimqCmY8.cjs';
12
13
  export { i as snapshot } from './index-CR3BFPIz.cjs';
13
14
  export { i as trainer } from './index-BoU8qt8r.cjs';
14
- export { i as precheck } from './index-DfCUVJX1.cjs';
15
+ export { i as precheck } from './index-Clyf4-lu.cjs';
15
16
  export { i as frameit } from './index-BYonklf3.cjs';
16
17
  export { i as xcode } from './index-Cp6cjtd-.cjs';
17
18
  export { i as core } from './index-C2yG3wXA.cjs';
@@ -19,5 +20,220 @@ export { LaneCallback, LaneDefinition, RunLaneOptions, RunResult, afterAll, afte
19
20
  export { L as LaneContext } from './context-CymLkfrS.cjs';
20
21
  export { ActionDefinition, action, ensureActionsRegistered, getAction, listActions, registerAction } from './actions/index.cjs';
21
22
  export { createCli } from './cli/index.cjs';
22
- import './cert-BmJGtYtb.cjs';
23
+ import './cert-uLLdb5a7.cjs';
23
24
  import 'commander';
25
+
26
+ /**
27
+ * One-click Apple Developer setup — given an authenticated portal session,
28
+ * provisions everything needed to code-sign and upload iOS builds:
29
+ *
30
+ * • Bundle ID (created or reused)
31
+ * • Distribution certificate + RSA private key bundled into a .p12
32
+ * • App Store provisioning profile
33
+ * • Optional APNs Production push certificate (.p12)
34
+ * • Optional APNs Sandbox push certificate (.p12)
35
+ * • Optional revocation of existing distribution certificates first
36
+ * (used when the team is at the 3-cert distribution limit)
37
+ *
38
+ * Returns values shaped to match the `apple_credentials` form in the
39
+ * App Release product so an HTTP route or the in-page wizard can pre-fill
40
+ * the existing form fields.
41
+ *
42
+ * Three fields are intentionally left empty (asc_key_id, asc_issuer_id,
43
+ * asc_api_key_base64) — the App Store Connect API key still needs to be
44
+ * uploaded manually. Auto-creating ASC API keys via the iris admin API
45
+ * is a separate stretch goal.
46
+ */
47
+
48
+ interface OneClickInventory {
49
+ team: {
50
+ id: string;
51
+ name?: string;
52
+ };
53
+ bundleIds: {
54
+ appIdId: string;
55
+ identifier: string;
56
+ name: string;
57
+ }[];
58
+ /** Active distribution certs. Apple caps a team at 3. */
59
+ distributionCerts: {
60
+ certificateId: string;
61
+ name: string;
62
+ serialNumber?: string;
63
+ expirationDate?: string;
64
+ /** True when the cert is associated with a developer the user can identify. */
65
+ ownerName?: string;
66
+ }[];
67
+ distCertCapacity: {
68
+ used: number;
69
+ max: number;
70
+ };
71
+ /** Active APNs Authentication Keys. Apple caps a team at 2. */
72
+ apnsAuthKeys: {
73
+ keyId: string;
74
+ keyName: string;
75
+ dateCreated?: string;
76
+ }[];
77
+ apnsKeyCapacity: {
78
+ used: number;
79
+ max: number;
80
+ };
81
+ pushCerts: {
82
+ certificateId: string;
83
+ name: string;
84
+ type: "production" | "sandbox" | "other";
85
+ bundleIdentifier?: string;
86
+ expirationDate?: string;
87
+ }[];
88
+ profiles: {
89
+ provisioningProfileId: string;
90
+ name: string;
91
+ type: string;
92
+ status?: string;
93
+ expirationDate?: string;
94
+ }[];
95
+ }
96
+ interface OneClickOptions {
97
+ /** Generate a new distribution certificate. Default true; required for new credentials. */
98
+ generateDistributionCert?: boolean;
99
+ /** Generate an App Store provisioning profile. Default true. */
100
+ generateStoreProfile?: boolean;
101
+ /**
102
+ * Generate an App Store Connect API key (.p8). Default true. Created
103
+ * via Apple's iris admin API and downloaded via the sparse-fieldset
104
+ * endpoint that @expo/apple-utils uses. Required for TestFlight
105
+ * uploads via altool.
106
+ */
107
+ generateAscApiKey?: boolean;
108
+ /**
109
+ * Generate an APNs Authentication Key (.p8) for push notifications.
110
+ * Default true. ONE key per team works for ALL apps and never expires.
111
+ * The modern replacement for the legacy per-app .p12 push certs.
112
+ *
113
+ * Apple allows multiple APNs keys per team — the wizard always
114
+ * creates a new one when this flag is set, regardless of what's
115
+ * already in the team. Unrelated existing keys are not affected.
116
+ */
117
+ generateApnsAuthKey?: boolean;
118
+ /**
119
+ * Generate an APNs **Production** push certificate (.p12). Default
120
+ * false — the modern APNs Auth Key (.p8) above replaces this and is
121
+ * generally preferred. Only enable if a downstream integration
122
+ * specifically requires the legacy cert-based APNs path.
123
+ *
124
+ * Apple caps these at 1 per bundle per environment, so existing
125
+ * production push certs for the bundle are left alone (the wizard
126
+ * skips with a warning rather than revoking).
127
+ */
128
+ generatePushProductionCert?: boolean;
129
+ /**
130
+ * Generate an APNs **Sandbox** (development) push certificate (.p12).
131
+ * Default false. Same caveats as `generatePushProductionCert`.
132
+ */
133
+ generatePushSandboxCert?: boolean;
134
+ /** Enable Sign in with Apple capability on the bundle ID. Default true. */
135
+ enableSignInWithApple?: boolean;
136
+ /** Enable Push Notifications capability on the bundle ID. Default true. */
137
+ enablePushNotifications?: boolean;
138
+ /** Distribution cert IDs to revoke before creating the new one (for the 3-cert limit). */
139
+ revokeCertIds?: string[];
140
+ /** APNs auth key IDs to revoke before creating the new one (Apple caps APNs keys at 2/team). */
141
+ revokeApnsKeyIds?: string[];
142
+ }
143
+ interface OneClickInput {
144
+ session: AppleSession;
145
+ teamId: string;
146
+ bundleIdentifier: string;
147
+ appName: string;
148
+ options?: OneClickOptions;
149
+ /** Defaults to a random 32-char password. Override for deterministic tests. */
150
+ certPassword?: string;
151
+ /**
152
+ * Structured progress callback invoked at every step transition. The
153
+ * wizard UI uses this to render a live list of "in progress / done /
154
+ * failed" rows.
155
+ */
156
+ onProgress?: (event: ProgressEvent) => void;
157
+ }
158
+ type ProgressEvent = {
159
+ type: "step_start";
160
+ step: string;
161
+ label: string;
162
+ } | {
163
+ type: "step_done";
164
+ step: string;
165
+ label: string;
166
+ detail?: string;
167
+ } | {
168
+ type: "step_failed";
169
+ step: string;
170
+ label: string;
171
+ error: string;
172
+ };
173
+ interface AdditionalCertResult {
174
+ cert_type: "aps_production" | "aps_sandbox" | "apns_key";
175
+ cert_base64: string;
176
+ /**
177
+ * For .p12 cert types this is the .p12 password. For `apns_key` this
178
+ * is the APNs Key ID (the existing certs route stores it in the
179
+ * cert_password column for apns_key — see apple-credentials/certs/route.ts).
180
+ */
181
+ cert_password: string;
182
+ }
183
+ interface OneClickResult {
184
+ team_id: string;
185
+ bundle_identifier: string;
186
+ name: string;
187
+ dist_cert_base64: string;
188
+ private_key_base64: string;
189
+ cert_password: string;
190
+ provisioning_profile_base64: string;
191
+ profile_name: string;
192
+ asc_key_id: string;
193
+ asc_issuer_id: string;
194
+ asc_api_key_base64: string;
195
+ /** Additional certs to write to apple_credential_certs after credential is created. */
196
+ additional_certs: AdditionalCertResult[];
197
+ /** IDs of resources created (for debugging / rollback) */
198
+ created: {
199
+ bundleIdId?: string;
200
+ certificateId?: string;
201
+ provisioningProfileId?: string;
202
+ profileUuid?: string;
203
+ apnsAuthKeyId?: string;
204
+ ascApiKeyId?: string;
205
+ revokedCertIds: string[];
206
+ };
207
+ /** Non-fatal issues — e.g. "used existing bundle id" */
208
+ warnings: string[];
209
+ }
210
+ interface PortalTeam {
211
+ teamId: string;
212
+ name: string;
213
+ /** The team's role for this user (e.g. "Account Holder", "Admin", "Developer") */
214
+ role?: string;
215
+ /** The team's status (e.g. "active") */
216
+ status?: string;
217
+ }
218
+ /**
219
+ * List the developer-portal teams the user belongs to. Returns the
220
+ * 10-character alphanumeric `teamId` strings used by every other portal
221
+ * endpoint — these are different from the numeric `providerId` returned
222
+ * by the olympus session, which only works for App Store Connect REST
223
+ * API calls (and is not what the legacy portal endpoints want).
224
+ */
225
+ declare function oneClickListTeams(session: AppleSession): Promise<PortalTeam[]>;
226
+ /**
227
+ * Read the team's current state: bundle IDs, distribution cert capacity,
228
+ * push certs, profiles. Used by the wizard to render the configure screen
229
+ * and warn about hitting the 3-cert distribution limit.
230
+ */
231
+ declare function oneClickInventory(session: AppleSession, teamId: string): Promise<OneClickInventory>;
232
+ /**
233
+ * Run the orchestration. Emits structured progress events the wizard
234
+ * polls / streams to the browser. Throws on the first hard failure;
235
+ * recoverable issues land in `result.warnings`.
236
+ */
237
+ declare function oneClickSetup(input: OneClickInput): Promise<OneClickResult>;
238
+
239
+ export { type AdditionalCertResult, type OneClickInput, type OneClickInventory, type OneClickOptions, type OneClickResult, type PortalTeam, type ProgressEvent, oneClickInventory, oneClickListTeams, oneClickSetup };
package/dist/index.d.ts CHANGED
@@ -1,17 +1,18 @@
1
- export { i as App, I as AppScreenshot, K as AppScreenshotSet, H as AppScreenshotsResource, A as AppStoreConnectClient, c as AppStoreConnectConfig, a as AppStoreConnectError, F as AppStoreVersion, G as AppStoreVersionLocalization, O as AppStoreVersionSubmission, E as AppStoreVersionsResource, w as AppsResource, l as BetaBuildLocalization, k as BetaGroup, y as BetaGroupsResource, j as Build, m as BuildBetaDetail, x as BuildsResource, B as BundleId, o as BundleIdCapability, u as BundleIdsResource, z as CapabilitiesResource, r as CapabilityOption, q as CapabilitySetting, p as CapabilitySettingInput, C as Certificate, s as CertificatesResource, D as Device, v as DevicesResource, h as JsonApiError, g as JsonApiListResponse, J as JsonApiResource, f as JsonApiResponse, L as ListParams, n as PreReleaseVersion, P as Profile, t as ProfilesResource, b as RateLimitError, R as RequestClient, e as RequestOptions, N as ReviewSubmission, M as ReviewSubmissionsResource, d as TokenConfig, T as TokenManager, U as UploadOperation } from './index-D1Izm7qt.js';
1
+ import { A as AppleSession } from './index-BwwpAlk2.js';
2
+ export { j as App, K as AppScreenshot, M as AppScreenshotSet, I as AppScreenshotsResource, a as AppStoreConnectClient, d as AppStoreConnectConfig, b as AppStoreConnectError, G as AppStoreVersion, H as AppStoreVersionLocalization, Q as AppStoreVersionSubmission, F as AppStoreVersionsResource, x as AppsResource, m as BetaBuildLocalization, l as BetaGroup, z as BetaGroupsResource, k as Build, n as BuildBetaDetail, y as BuildsResource, B as BundleId, p as BundleIdCapability, v as BundleIdsResource, E as CapabilitiesResource, s as CapabilityOption, r as CapabilitySetting, q as CapabilitySettingInput, C as Certificate, t as CertificatesResource, D as Device, w as DevicesResource, i as JsonApiError, h as JsonApiListResponse, J as JsonApiResource, g as JsonApiResponse, L as ListParams, o as PreReleaseVersion, P as Profile, u as ProfilesResource, c as RateLimitError, R as RequestClient, f as RequestOptions, O as ReviewSubmission, N as ReviewSubmissionsResource, e as TokenConfig, T as TokenManager, U as UploadOperation } from './index-BwwpAlk2.js';
2
3
  export { A as AppStoreVersionState, i as BetaReviewState, h as BuildProcessingState, B as BundleIdPlatform, f as CapabilityOptionKey, e as CapabilitySettingsKey, d as CapabilityType, C as CertificateType, g as ContentRightsDeclaration, D as DeviceClass, c as DeviceStatus, E as ExportMethod, b as Platform, a as ProfileState, P as ProfileType, R as ReleaseType } from './enums-B609j2rb.js';
3
- export { i as cert } from './index-DfirmFbC.js';
4
- export { i as sigh } from './index-TfXqwuac.js';
5
- export { i as match } from './index-BN0ubxjZ.js';
6
- export { i as produce } from './index-B0yhu_LZ.js';
7
- export { i as pilot } from './index-DHw08dUc.js';
8
- export { i as deliver } from './index-1Vu2cRQ2.js';
9
- export { i as pem } from './index-A5MimeQk.js';
4
+ export { i as cert } from './index-BNP7Bpu5.js';
5
+ export { i as sigh } from './index-CEldrbyz.js';
6
+ export { i as match } from './index-Di4Ic0EE.js';
7
+ export { i as produce } from './index-EKU_G1G5.js';
8
+ export { i as pilot } from './index-mddpvrRX.js';
9
+ export { i as deliver } from './index-BbY_H_f6.js';
10
+ export { i as pem } from './index-C2YLoFVl.js';
10
11
  export { i as gym } from './index-DImN9PWc.js';
11
12
  export { i as scan } from './index-BimqCmY8.js';
12
13
  export { i as snapshot } from './index-CR3BFPIz.js';
13
14
  export { i as trainer } from './index-BoU8qt8r.js';
14
- export { i as precheck } from './index-B9yXicrQ.js';
15
+ export { i as precheck } from './index-jeI44Q5G.js';
15
16
  export { i as frameit } from './index-BYonklf3.js';
16
17
  export { i as xcode } from './index-Cp6cjtd-.js';
17
18
  export { i as core } from './index-C2yG3wXA.js';
@@ -19,5 +20,220 @@ export { LaneCallback, LaneDefinition, RunLaneOptions, RunResult, afterAll, afte
19
20
  export { L as LaneContext } from './context-CymLkfrS.js';
20
21
  export { ActionDefinition, action, ensureActionsRegistered, getAction, listActions, registerAction } from './actions/index.js';
21
22
  export { createCli } from './cli/index.js';
22
- import './cert-owkOFNW8.js';
23
+ import './cert-e5GAgAPb.js';
23
24
  import 'commander';
25
+
26
+ /**
27
+ * One-click Apple Developer setup — given an authenticated portal session,
28
+ * provisions everything needed to code-sign and upload iOS builds:
29
+ *
30
+ * • Bundle ID (created or reused)
31
+ * • Distribution certificate + RSA private key bundled into a .p12
32
+ * • App Store provisioning profile
33
+ * • Optional APNs Production push certificate (.p12)
34
+ * • Optional APNs Sandbox push certificate (.p12)
35
+ * • Optional revocation of existing distribution certificates first
36
+ * (used when the team is at the 3-cert distribution limit)
37
+ *
38
+ * Returns values shaped to match the `apple_credentials` form in the
39
+ * App Release product so an HTTP route or the in-page wizard can pre-fill
40
+ * the existing form fields.
41
+ *
42
+ * Three fields are intentionally left empty (asc_key_id, asc_issuer_id,
43
+ * asc_api_key_base64) — the App Store Connect API key still needs to be
44
+ * uploaded manually. Auto-creating ASC API keys via the iris admin API
45
+ * is a separate stretch goal.
46
+ */
47
+
48
+ interface OneClickInventory {
49
+ team: {
50
+ id: string;
51
+ name?: string;
52
+ };
53
+ bundleIds: {
54
+ appIdId: string;
55
+ identifier: string;
56
+ name: string;
57
+ }[];
58
+ /** Active distribution certs. Apple caps a team at 3. */
59
+ distributionCerts: {
60
+ certificateId: string;
61
+ name: string;
62
+ serialNumber?: string;
63
+ expirationDate?: string;
64
+ /** True when the cert is associated with a developer the user can identify. */
65
+ ownerName?: string;
66
+ }[];
67
+ distCertCapacity: {
68
+ used: number;
69
+ max: number;
70
+ };
71
+ /** Active APNs Authentication Keys. Apple caps a team at 2. */
72
+ apnsAuthKeys: {
73
+ keyId: string;
74
+ keyName: string;
75
+ dateCreated?: string;
76
+ }[];
77
+ apnsKeyCapacity: {
78
+ used: number;
79
+ max: number;
80
+ };
81
+ pushCerts: {
82
+ certificateId: string;
83
+ name: string;
84
+ type: "production" | "sandbox" | "other";
85
+ bundleIdentifier?: string;
86
+ expirationDate?: string;
87
+ }[];
88
+ profiles: {
89
+ provisioningProfileId: string;
90
+ name: string;
91
+ type: string;
92
+ status?: string;
93
+ expirationDate?: string;
94
+ }[];
95
+ }
96
+ interface OneClickOptions {
97
+ /** Generate a new distribution certificate. Default true; required for new credentials. */
98
+ generateDistributionCert?: boolean;
99
+ /** Generate an App Store provisioning profile. Default true. */
100
+ generateStoreProfile?: boolean;
101
+ /**
102
+ * Generate an App Store Connect API key (.p8). Default true. Created
103
+ * via Apple's iris admin API and downloaded via the sparse-fieldset
104
+ * endpoint that @expo/apple-utils uses. Required for TestFlight
105
+ * uploads via altool.
106
+ */
107
+ generateAscApiKey?: boolean;
108
+ /**
109
+ * Generate an APNs Authentication Key (.p8) for push notifications.
110
+ * Default true. ONE key per team works for ALL apps and never expires.
111
+ * The modern replacement for the legacy per-app .p12 push certs.
112
+ *
113
+ * Apple allows multiple APNs keys per team — the wizard always
114
+ * creates a new one when this flag is set, regardless of what's
115
+ * already in the team. Unrelated existing keys are not affected.
116
+ */
117
+ generateApnsAuthKey?: boolean;
118
+ /**
119
+ * Generate an APNs **Production** push certificate (.p12). Default
120
+ * false — the modern APNs Auth Key (.p8) above replaces this and is
121
+ * generally preferred. Only enable if a downstream integration
122
+ * specifically requires the legacy cert-based APNs path.
123
+ *
124
+ * Apple caps these at 1 per bundle per environment, so existing
125
+ * production push certs for the bundle are left alone (the wizard
126
+ * skips with a warning rather than revoking).
127
+ */
128
+ generatePushProductionCert?: boolean;
129
+ /**
130
+ * Generate an APNs **Sandbox** (development) push certificate (.p12).
131
+ * Default false. Same caveats as `generatePushProductionCert`.
132
+ */
133
+ generatePushSandboxCert?: boolean;
134
+ /** Enable Sign in with Apple capability on the bundle ID. Default true. */
135
+ enableSignInWithApple?: boolean;
136
+ /** Enable Push Notifications capability on the bundle ID. Default true. */
137
+ enablePushNotifications?: boolean;
138
+ /** Distribution cert IDs to revoke before creating the new one (for the 3-cert limit). */
139
+ revokeCertIds?: string[];
140
+ /** APNs auth key IDs to revoke before creating the new one (Apple caps APNs keys at 2/team). */
141
+ revokeApnsKeyIds?: string[];
142
+ }
143
+ interface OneClickInput {
144
+ session: AppleSession;
145
+ teamId: string;
146
+ bundleIdentifier: string;
147
+ appName: string;
148
+ options?: OneClickOptions;
149
+ /** Defaults to a random 32-char password. Override for deterministic tests. */
150
+ certPassword?: string;
151
+ /**
152
+ * Structured progress callback invoked at every step transition. The
153
+ * wizard UI uses this to render a live list of "in progress / done /
154
+ * failed" rows.
155
+ */
156
+ onProgress?: (event: ProgressEvent) => void;
157
+ }
158
+ type ProgressEvent = {
159
+ type: "step_start";
160
+ step: string;
161
+ label: string;
162
+ } | {
163
+ type: "step_done";
164
+ step: string;
165
+ label: string;
166
+ detail?: string;
167
+ } | {
168
+ type: "step_failed";
169
+ step: string;
170
+ label: string;
171
+ error: string;
172
+ };
173
+ interface AdditionalCertResult {
174
+ cert_type: "aps_production" | "aps_sandbox" | "apns_key";
175
+ cert_base64: string;
176
+ /**
177
+ * For .p12 cert types this is the .p12 password. For `apns_key` this
178
+ * is the APNs Key ID (the existing certs route stores it in the
179
+ * cert_password column for apns_key — see apple-credentials/certs/route.ts).
180
+ */
181
+ cert_password: string;
182
+ }
183
+ interface OneClickResult {
184
+ team_id: string;
185
+ bundle_identifier: string;
186
+ name: string;
187
+ dist_cert_base64: string;
188
+ private_key_base64: string;
189
+ cert_password: string;
190
+ provisioning_profile_base64: string;
191
+ profile_name: string;
192
+ asc_key_id: string;
193
+ asc_issuer_id: string;
194
+ asc_api_key_base64: string;
195
+ /** Additional certs to write to apple_credential_certs after credential is created. */
196
+ additional_certs: AdditionalCertResult[];
197
+ /** IDs of resources created (for debugging / rollback) */
198
+ created: {
199
+ bundleIdId?: string;
200
+ certificateId?: string;
201
+ provisioningProfileId?: string;
202
+ profileUuid?: string;
203
+ apnsAuthKeyId?: string;
204
+ ascApiKeyId?: string;
205
+ revokedCertIds: string[];
206
+ };
207
+ /** Non-fatal issues — e.g. "used existing bundle id" */
208
+ warnings: string[];
209
+ }
210
+ interface PortalTeam {
211
+ teamId: string;
212
+ name: string;
213
+ /** The team's role for this user (e.g. "Account Holder", "Admin", "Developer") */
214
+ role?: string;
215
+ /** The team's status (e.g. "active") */
216
+ status?: string;
217
+ }
218
+ /**
219
+ * List the developer-portal teams the user belongs to. Returns the
220
+ * 10-character alphanumeric `teamId` strings used by every other portal
221
+ * endpoint — these are different from the numeric `providerId` returned
222
+ * by the olympus session, which only works for App Store Connect REST
223
+ * API calls (and is not what the legacy portal endpoints want).
224
+ */
225
+ declare function oneClickListTeams(session: AppleSession): Promise<PortalTeam[]>;
226
+ /**
227
+ * Read the team's current state: bundle IDs, distribution cert capacity,
228
+ * push certs, profiles. Used by the wizard to render the configure screen
229
+ * and warn about hitting the 3-cert distribution limit.
230
+ */
231
+ declare function oneClickInventory(session: AppleSession, teamId: string): Promise<OneClickInventory>;
232
+ /**
233
+ * Run the orchestration. Emits structured progress events the wizard
234
+ * polls / streams to the browser. Throws on the first hard failure;
235
+ * recoverable issues land in `result.warnings`.
236
+ */
237
+ declare function oneClickSetup(input: OneClickInput): Promise<OneClickResult>;
238
+
239
+ export { type AdditionalCertResult, type OneClickInput, type OneClickInventory, type OneClickOptions, type OneClickResult, type PortalTeam, type ProgressEvent, oneClickInventory, oneClickListTeams, oneClickSetup };