@sitepong/fastnode 0.2.1 → 0.3.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 (126) hide show
  1. package/README.md +58 -1
  2. package/dist/actions/index.cjs +891 -72
  3. package/dist/actions/index.cjs.map +1 -1
  4. package/dist/actions/index.mjs +892 -73
  5. package/dist/actions/index.mjs.map +1 -1
  6. package/dist/apple-session-jUzBrql5.d.cts +122 -0
  7. package/dist/apple-session-jUzBrql5.d.ts +122 -0
  8. package/dist/cert/index.cjs +17868 -24
  9. package/dist/cert/index.cjs.map +1 -1
  10. package/dist/cert/index.d.cts +5 -4
  11. package/dist/cert/index.d.ts +5 -4
  12. package/dist/cert/index.mjs +17853 -7
  13. package/dist/cert/index.mjs.map +1 -1
  14. package/dist/{cert-e5GAgAPb.d.ts → cert-RvXmdMke.d.ts} +2 -2
  15. package/dist/{cert-uLLdb5a7.d.cts → cert-eOoxGMN1.d.cts} +2 -2
  16. package/dist/cli/index.cjs +1364 -78
  17. package/dist/cli/index.cjs.map +1 -1
  18. package/dist/cli/index.d.cts +3 -2
  19. package/dist/cli/index.d.ts +3 -2
  20. package/dist/cli/index.mjs +1365 -79
  21. package/dist/cli/index.mjs.map +1 -1
  22. package/dist/client/index.cjs +480 -31
  23. package/dist/client/index.cjs.map +1 -1
  24. package/dist/client/index.d.cts +3 -2
  25. package/dist/client/index.d.ts +3 -2
  26. package/dist/client/index.mjs +480 -31
  27. package/dist/client/index.mjs.map +1 -1
  28. package/dist/deliver/index.cjs +334 -13
  29. package/dist/deliver/index.cjs.map +1 -1
  30. package/dist/deliver/index.d.cts +4 -3
  31. package/dist/deliver/index.d.ts +4 -3
  32. package/dist/deliver/index.mjs +330 -15
  33. package/dist/deliver/index.mjs.map +1 -1
  34. package/dist/{enums-B609j2rb.d.cts → enums-yXNVh3UI.d.cts} +8 -1
  35. package/dist/{enums-B609j2rb.d.ts → enums-yXNVh3UI.d.ts} +8 -1
  36. package/dist/gradle/index.cjs +222 -0
  37. package/dist/gradle/index.cjs.map +1 -0
  38. package/dist/gradle/index.d.cts +1 -0
  39. package/dist/gradle/index.d.ts +1 -0
  40. package/dist/gradle/index.mjs +217 -0
  41. package/dist/gradle/index.mjs.map +1 -0
  42. package/dist/gym/index.d.cts +2 -2
  43. package/dist/gym/index.d.ts +2 -2
  44. package/dist/index-8djTPW8O.d.ts +104 -0
  45. package/dist/{index-DrUpRXRG.d.cts → index-B6-MJpO4.d.cts} +1 -1
  46. package/dist/{index-Clyf4-lu.d.cts → index-BE7bwNff.d.cts} +1 -1
  47. package/dist/index-BGhV0gS-.d.ts +65 -0
  48. package/dist/index-BaNcf7jt.d.cts +201 -0
  49. package/dist/{index-Di4Ic0EE.d.ts → index-BvyZ4uiw.d.ts} +3 -3
  50. package/dist/{index-CEldrbyz.d.ts → index-C01Rkrir.d.ts} +2 -2
  51. package/dist/{index-jeI44Q5G.d.ts → index-C9mHBJED.d.ts} +1 -1
  52. package/dist/{index-BgHagzj1.d.cts → index-CAEiXVWd.d.ts} +9 -1
  53. package/dist/index-CBf0-NUQ.d.ts +201 -0
  54. package/dist/index-CXJlvmB4.d.cts +63 -0
  55. package/dist/index-CXJlvmB4.d.ts +63 -0
  56. package/dist/{index-BNP7Bpu5.d.ts → index-D1GHEM3c.d.ts} +32 -3
  57. package/dist/index-DFstwgGK.d.cts +65 -0
  58. package/dist/{index-DrCOh0Vh.d.cts → index-DGkgRnZp.d.cts} +2 -2
  59. package/dist/{index-CtydPNxA.d.cts → index-DLJso7Vs.d.cts} +32 -3
  60. package/dist/{index-BN0iWhuw.d.cts → index-DWOLZNlz.d.cts} +2 -2
  61. package/dist/{index-BjkOUQcQ.d.cts → index-DfkIz7i0.d.cts} +18 -4
  62. package/dist/{index-EKU_G1G5.d.ts → index-DjC_gmnL.d.ts} +18 -4
  63. package/dist/index-DnHQ2uT2.d.cts +104 -0
  64. package/dist/{index-CdfgEZwh.d.cts → index-DrmS802s.d.cts} +356 -130
  65. package/dist/index-Dv-Mek07.d.cts +84 -0
  66. package/dist/index-Dv-Mek07.d.ts +84 -0
  67. package/dist/{index-DHxi-QPC.d.cts → index-icIH5e5V.d.cts} +3 -3
  68. package/dist/{index-mddpvrRX.d.ts → index-laE3_wm9.d.cts} +9 -1
  69. package/dist/{index-BwwpAlk2.d.ts → index-lsuS2R1T.d.ts} +356 -130
  70. package/dist/{index-DImN9PWc.d.ts → index-mEEB7An6.d.ts} +1 -1
  71. package/dist/{index-C2YLoFVl.d.ts → index-rTZOdMRE.d.ts} +2 -2
  72. package/dist/index.cjs +20496 -217
  73. package/dist/index.cjs.map +1 -1
  74. package/dist/index.d.cts +278 -22
  75. package/dist/index.d.ts +278 -22
  76. package/dist/index.mjs +20489 -220
  77. package/dist/index.mjs.map +1 -1
  78. package/dist/lane/index.cjs +891 -72
  79. package/dist/lane/index.cjs.map +1 -1
  80. package/dist/lane/index.mjs +892 -73
  81. package/dist/lane/index.mjs.map +1 -1
  82. package/dist/match/index.d.cts +6 -5
  83. package/dist/match/index.d.ts +6 -5
  84. package/dist/pem/index.d.cts +4 -3
  85. package/dist/pem/index.d.ts +4 -3
  86. package/dist/pilot/index.cjs +8 -4
  87. package/dist/pilot/index.cjs.map +1 -1
  88. package/dist/pilot/index.d.cts +4 -3
  89. package/dist/pilot/index.d.ts +4 -3
  90. package/dist/pilot/index.mjs +10 -6
  91. package/dist/pilot/index.mjs.map +1 -1
  92. package/dist/playstore/index.cjs +207 -0
  93. package/dist/playstore/index.cjs.map +1 -0
  94. package/dist/playstore/index.d.cts +1 -0
  95. package/dist/playstore/index.d.ts +1 -0
  96. package/dist/playstore/index.mjs +203 -0
  97. package/dist/playstore/index.mjs.map +1 -0
  98. package/dist/precheck/index.d.cts +4 -3
  99. package/dist/precheck/index.d.ts +4 -3
  100. package/dist/privacy/index.cjs +207 -0
  101. package/dist/privacy/index.cjs.map +1 -0
  102. package/dist/privacy/index.d.cts +2 -0
  103. package/dist/privacy/index.d.ts +2 -0
  104. package/dist/privacy/index.mjs +195 -0
  105. package/dist/privacy/index.mjs.map +1 -0
  106. package/dist/produce/index.cjs +38 -18
  107. package/dist/produce/index.cjs.map +1 -1
  108. package/dist/produce/index.d.cts +4 -3
  109. package/dist/produce/index.d.ts +4 -3
  110. package/dist/produce/index.mjs +38 -19
  111. package/dist/produce/index.mjs.map +1 -1
  112. package/dist/review/index.cjs +141 -0
  113. package/dist/review/index.cjs.map +1 -0
  114. package/dist/review/index.d.cts +2 -0
  115. package/dist/review/index.d.ts +2 -0
  116. package/dist/review/index.mjs +137 -0
  117. package/dist/review/index.mjs.map +1 -0
  118. package/dist/sigh/index.d.cts +4 -3
  119. package/dist/sigh/index.d.ts +4 -3
  120. package/dist/xcode/index.cjs +1 -1
  121. package/dist/xcode/index.cjs.map +1 -1
  122. package/dist/xcode/index.mjs +1 -1
  123. package/dist/xcode/index.mjs.map +1 -1
  124. package/package.json +27 -1
  125. package/dist/index-BbY_H_f6.d.ts +0 -99
  126. package/dist/index-XsMsVc3O.d.cts +0 -99
package/dist/index.d.ts CHANGED
@@ -1,48 +1,51 @@
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';
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';
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';
11
- export { i as gym } from './index-DImN9PWc.js';
1
+ import { A as AppStoreConnectClient } from './index-lsuS2R1T.js';
2
+ export { i as App, Q as AppAssetLibrariesResource, S as AppAssetLibrary, Z as AppAssetLibraryDimensions, a0 as AppAssetLibraryImage, X as AppAssetLibraryImageSpec, _ as AppAssetLibraryImagesResource, a5 as AppAssetLibraryPlacement, a4 as AppAssetLibraryPlacementsResource, V as AppAssetLibraryRefDatum, W as AppAssetLibraryRefDatumAttributes, a1 as AppAssetLibraryVideo, Y as AppAssetLibraryVideoSpec, $ as AppAssetLibraryVideosResource, I as AppScreenshot, K as AppScreenshotSet, H as AppScreenshotsResource, 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, a2 as CreateAssetParams, D as Device, v as DevicesResource, h as JsonApiError, g as JsonApiListResponse, J as JsonApiResource, f as JsonApiResponse, L as ListParams, a6 as PlacementTarget, a7 as PlacementTargetKind, 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, a3 as UpdateAssetAttributes, U as UploadOperation } from './index-lsuS2R1T.js';
3
+ export { j as AppAssetLibraryAssetCategory, m as AppAssetLibraryAssetState, o as AppAssetLibraryFeature, k as AppAssetLibraryMediaType, p as AppAssetLibraryPlacementPlatform, n as AppAssetLibraryPlacementState, l as AppAssetLibraryPlacementType, 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-yXNVh3UI.js';
4
+ export { C as CertExpiryInfo, i as cert, p as parseCertificateExpiry } from './index-D1GHEM3c.js';
5
+ export { i as sigh } from './index-C01Rkrir.js';
6
+ export { i as match } from './index-BvyZ4uiw.js';
7
+ export { i as produce } from './index-DjC_gmnL.js';
8
+ export { i as pilot } from './index-CAEiXVWd.js';
9
+ export { i as deliver } from './index-CBf0-NUQ.js';
10
+ export { i as pem } from './index-rTZOdMRE.js';
11
+ export { i as gym } from './index-mEEB7An6.js';
12
+ export { i as gradle } from './index-Dv-Mek07.js';
13
+ export { i as playstore } from './index-CXJlvmB4.js';
12
14
  export { i as scan } from './index-BimqCmY8.js';
13
15
  export { i as snapshot } from './index-CR3BFPIz.js';
14
16
  export { i as trainer } from './index-BoU8qt8r.js';
15
- export { i as precheck } from './index-jeI44Q5G.js';
17
+ export { i as precheck } from './index-C9mHBJED.js';
18
+ export { i as privacy } from './index-8djTPW8O.js';
19
+ export { i as review } from './index-BGhV0gS-.js';
16
20
  export { i as frameit } from './index-BYonklf3.js';
17
21
  export { i as xcode } from './index-Cp6cjtd-.js';
18
22
  export { i as core } from './index-C2yG3wXA.js';
19
23
  export { LaneCallback, LaneDefinition, RunLaneOptions, RunResult, afterAll, afterEach, beforeAll, beforeEach, generateFastfileTemplate, lane, listAvailableLanes, loadFastfile, privateLane, runLane } from './lane/index.js';
20
24
  export { L as LaneContext } from './context-CymLkfrS.js';
21
25
  export { ActionDefinition, action, ensureActionsRegistered, getAction, listActions, registerAction } from './actions/index.js';
26
+ import { A as AppleSession } from './apple-session-jUzBrql5.js';
22
27
  export { createCli } from './cli/index.js';
23
- import './cert-e5GAgAPb.js';
28
+ import './cert-RvXmdMke.js';
24
29
  import 'commander';
25
30
 
26
31
  /**
27
32
  * One-click Apple Developer setup — given an authenticated portal session,
28
33
  * provisions everything needed to code-sign and upload iOS builds:
29
34
  *
30
- * • Bundle ID (created or reused)
35
+ * • Bundle ID (Developer Portal App ID, created or reused)
31
36
  * • Distribution certificate + RSA private key bundled into a .p12
32
37
  * • App Store provisioning profile
33
- * • Optional APNs Production push certificate (.p12)
34
- * • Optional APNs Sandbox push certificate (.p12)
38
+ * • App Store Connect API key (.p8) for TestFlight uploads
39
+ * • APNs Authentication Key (.p8) for push notifications
40
+ * • Push / Sign in with Apple capabilities on the bundle
41
+ * • App Store Connect app record (the "My Apps" entry uploads need)
42
+ * • Optional legacy APNs Production / Sandbox push certificates (.p12)
35
43
  * • Optional revocation of existing distribution certificates first
36
44
  * (used when the team is at the 3-cert distribution limit)
37
45
  *
38
46
  * Returns values shaped to match the `apple_credentials` form in the
39
47
  * App Release product so an HTTP route or the in-page wizard can pre-fill
40
48
  * 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
49
  */
47
50
 
48
51
  interface OneClickInventory {
@@ -54,6 +57,7 @@ interface OneClickInventory {
54
57
  appIdId: string;
55
58
  identifier: string;
56
59
  name: string;
60
+ capabilities?: string[];
57
61
  }[];
58
62
  /** Active distribution certs. Apple caps a team at 3. */
59
63
  distributionCerts: {
@@ -135,6 +139,27 @@ interface OneClickOptions {
135
139
  enableSignInWithApple?: boolean;
136
140
  /** Enable Push Notifications capability on the bundle ID. Default true. */
137
141
  enablePushNotifications?: boolean;
142
+ /** Enable Apple Pay capability on the bundle ID. Default false. Required for Stripe. */
143
+ enableApplePay?: boolean;
144
+ /**
145
+ * Enable the Associated Domains capability on the bundle ID (universal
146
+ * links, passkeys / webcredentials, app clips). Default false. The domain
147
+ * list itself ships in the app's entitlements — Apple only stores the
148
+ * on/off switch. Requires the ASC API key (same JWT-only path as Push).
149
+ */
150
+ enableAssociatedDomains?: boolean;
151
+ /** Merchant ID to register for Apple Pay (e.g. "merchant.com.example.app"). Required when enableApplePay is true. */
152
+ merchantId?: string;
153
+ /**
154
+ * Create the App Store Connect **app record** (the "My Apps" entry that
155
+ * TestFlight and App Store uploads require). Default true. Distinct
156
+ * from registering the bundle id in the Developer Portal — you need
157
+ * both. Requires an ASC API key to be created (step 7) since the call
158
+ * goes through the JWT-authenticated REST API. Non-fatal — if the app
159
+ * record can't be created (or already exists), the orchestrator
160
+ * records a warning and continues.
161
+ */
162
+ createAscAppRecord?: boolean;
138
163
  /** Distribution cert IDs to revoke before creating the new one (for the 3-cert limit). */
139
164
  revokeCertIds?: string[];
140
165
  /** APNs auth key IDs to revoke before creating the new one (Apple caps APNs keys at 2/team). */
@@ -146,8 +171,31 @@ interface OneClickInput {
146
171
  bundleIdentifier: string;
147
172
  appName: string;
148
173
  options?: OneClickOptions;
174
+ /**
175
+ * Reuse an existing shared distribution certificate instead of minting a new
176
+ * one (Apple caps a team at 3). The provisioning profile is still created —
177
+ * against this cert's portal id (resolved by serial when only the serial is
178
+ * known). When set, the result's dist_cert / private_key / cert_password come
179
+ * back empty because the secret lives on the shared signing account, not here.
180
+ */
181
+ reuseDistributionCert?: {
182
+ certificateId?: string;
183
+ certSerial?: string;
184
+ };
149
185
  /** Defaults to a random 32-char password. Override for deterministic tests. */
150
186
  certPassword?: string;
187
+ /**
188
+ * SKU for the App Store Connect app record. Arbitrary unique string
189
+ * Apple uses internally. Defaults to `<bundle_identifier>.<timestamp>`
190
+ * which is good enough for most automated flows.
191
+ */
192
+ sku?: string;
193
+ /**
194
+ * Primary locale for the App Store Connect app record. Defaults to
195
+ * `en-US`. Changing this after creation requires a support ticket so
196
+ * err on the side of sensible defaults.
197
+ */
198
+ primaryLocale?: string;
151
199
  /**
152
200
  * Structured progress callback invoked at every step transition. The
153
201
  * wizard UI uses this to render a live list of "in progress / done /
@@ -187,11 +235,31 @@ interface OneClickResult {
187
235
  dist_cert_base64: string;
188
236
  private_key_base64: string;
189
237
  cert_password: string;
238
+ /**
239
+ * Serial of the distribution certificate this run MINTED, and when it
240
+ * expires. Empty when the run reused a shared certificate rather than
241
+ * minting one.
242
+ *
243
+ * The serial is the only handle a later run can reuse a certificate by:
244
+ * reuse matches on serialNumber, while creation returns a certificateId,
245
+ * and the two are different identifiers. Without this the caller has a p12
246
+ * and no way to name what is inside it, so it stores a certificate nothing
247
+ * can ever reuse — and the next "use existing" mints another.
248
+ */
249
+ dist_cert_serial: string;
250
+ dist_cert_expires_at: string;
190
251
  provisioning_profile_base64: string;
191
252
  profile_name: string;
192
253
  asc_key_id: string;
193
254
  asc_issuer_id: string;
194
255
  asc_api_key_base64: string;
256
+ /**
257
+ * App Store Connect app-record id, populated when the record was
258
+ * created fresh OR already existed and we reused it. Empty string
259
+ * when creation was skipped or failed — check `warnings` for the
260
+ * reason in that case.
261
+ */
262
+ asc_app_id: string;
195
263
  /** Additional certs to write to apple_credential_certs after credential is created. */
196
264
  additional_certs: AdditionalCertResult[];
197
265
  /** IDs of resources created (for debugging / rollback) */
@@ -202,6 +270,7 @@ interface OneClickResult {
202
270
  profileUuid?: string;
203
271
  apnsAuthKeyId?: string;
204
272
  ascApiKeyId?: string;
273
+ ascAppId?: string;
205
274
  revokedCertIds: string[];
206
275
  };
207
276
  /** Non-fatal issues — e.g. "used existing bundle id" */
@@ -223,6 +292,43 @@ interface PortalTeam {
223
292
  * API calls (and is not what the legacy portal endpoints want).
224
293
  */
225
294
  declare function oneClickListTeams(session: AppleSession): Promise<PortalTeam[]>;
295
+ interface EnsureAppGroupInput {
296
+ session: AppleSession;
297
+ teamId: string;
298
+ /** The App Group identifier, e.g. `group.com.playspina.com`. */
299
+ groupIdentifier: string;
300
+ /** Human-readable name for the group. Defaults to the identifier. */
301
+ groupName?: string;
302
+ /**
303
+ * Bundle identifiers to associate the group with — typically the host
304
+ * app plus its extension(s), e.g. `["com.playspina.com",
305
+ * "com.playspina.com.MessagesExtension"]`. Each is resolved to its App ID
306
+ * (created if missing) before the group is enabled + associated.
307
+ */
308
+ bundleIdentifiers: string[];
309
+ onLog?: (msg: string) => void;
310
+ }
311
+ interface EnsureAppGroupResult {
312
+ /** Apple's internal handle for the group (used by profiles/association). */
313
+ appGroupId: string;
314
+ /** The `group.com.…` identifier. */
315
+ identifier: string;
316
+ /** Bundle identifiers successfully associated with the group. */
317
+ associated: string[];
318
+ /** Non-fatal issues (e.g. a capability toggle that Apple reported as already-on). */
319
+ warnings: string[];
320
+ }
321
+ /**
322
+ * Idempotently ensure an App Group exists and is associated with the given
323
+ * bundle identifiers, enabling the App Groups capability on each App ID
324
+ * first. This is the piece the `.p8` build pipeline cannot do — it requires
325
+ * the Apple ID session that onboarding already collects (see PortalClient's
326
+ * Application Groups section for why).
327
+ *
328
+ * Safe to re-run: the group is reused if it exists, capability-enable is
329
+ * best-effort (Apple no-ops when already on), and association is declarative.
330
+ */
331
+ declare function ensureAppGroup(input: EnsureAppGroupInput): Promise<EnsureAppGroupResult>;
226
332
  /**
227
333
  * Read the team's current state: bundle IDs, distribution cert capacity,
228
334
  * push certs, profiles. Used by the wizard to render the configure screen
@@ -236,4 +342,154 @@ declare function oneClickInventory(session: AppleSession, teamId: string): Promi
236
342
  */
237
343
  declare function oneClickSetup(input: OneClickInput): Promise<OneClickResult>;
238
344
 
239
- export { type AdditionalCertResult, type OneClickInput, type OneClickInventory, type OneClickOptions, type OneClickResult, type PortalTeam, type ProgressEvent, oneClickInventory, oneClickListTeams, oneClickSetup };
345
+ /**
346
+ * Apple Pay Payment Processing Certificate generation.
347
+ *
348
+ * The one manual Apple-portal step in wiring up in-app Apple Pay with a PSP
349
+ * (e.g. Stripe): the PSP hands you a CSR, which must be uploaded to the
350
+ * Merchant ID in Apple Developer to mint a Payment Processing Certificate, then
351
+ * the resulting `.cer` downloaded and given back to the PSP so it can decrypt
352
+ * payment tokens. This automates the Apple side end to end from the CSR.
353
+ *
354
+ * Merchant certs are created through the legacy session-cookie portal API
355
+ * (same as the merchant IDs themselves). Endpoint shapes are pinned in
356
+ * PortalClient (createApplePayCertificate / downloadApplePayCertificate),
357
+ * ported 1:1 from Spaceship.
358
+ */
359
+
360
+ interface ApplePayCertInput {
361
+ session: AppleSession;
362
+ /** The team the merchant ID lives on (the credential's team). */
363
+ teamId: string;
364
+ /** The merchant identifier (`merchant.…`) to mint the certificate on. */
365
+ merchantIdentifier: string;
366
+ /** PEM CSR string — the "Apple Pay CSR" the PSP (Stripe) gives you. */
367
+ csr: string;
368
+ onLog?: (m: string) => void;
369
+ }
370
+ interface ApplePayCertResult {
371
+ merchantIdentifier: string;
372
+ /** Apple's internal merchant id the cert was minted on. */
373
+ omcId: string;
374
+ /** Apple's certificate id (for later download / revoke). */
375
+ certificateId: string;
376
+ /** The DER `.cer` bytes, base64-encoded — upload this back to the PSP. */
377
+ certificateBase64: string;
378
+ }
379
+ /**
380
+ * Upload a CSR to a Merchant ID and return the minted Apple Pay Payment
381
+ * Processing Certificate. Idempotent-ish: Apple allows a small number of live
382
+ * certs per merchant; if you re-run with a new CSR it mints another.
383
+ *
384
+ * Throws a clear error if the merchant identifier doesn't exist on the team
385
+ * (the caller should add the Apple Pay capability first, which registers it).
386
+ */
387
+ declare function generateApplePayCertificate(input: ApplePayCertInput): Promise<ApplePayCertResult>;
388
+
389
+ /**
390
+ * Capability action registry — the individually-callable building blocks
391
+ * behind Apple credential provisioning.
392
+ *
393
+ * `oneClickSetup` composes these in sequence for first-time setup, but each
394
+ * action is also standalone and idempotent, so a "select → type → go" UI can
395
+ * add ONE capability (an app extension, an App Group, an APNs key, an extra
396
+ * cert) to an already-provisioned credential without re-running the whole
397
+ * flow — as long as it has a live Apple session (re-auth on demand when the
398
+ * server-side session has expired).
399
+ *
400
+ * Actions return portable `ProvisionArtifact`s (raw Apple bytes + ids). The
401
+ * API layer is responsible for persisting them (Vault + apple_credential_certs
402
+ * / credential patches) — this module stays free of any DB coupling.
403
+ */
404
+
405
+ interface ActionContext {
406
+ session: AppleSession;
407
+ teamId: string;
408
+ /** The primary app bundle id the credential is for (host app). */
409
+ bundleIdentifier: string;
410
+ /** Human-readable app name, used for cert/profile friendly names. */
411
+ appName: string;
412
+ /** Password to encrypt any generated .p12. Random if omitted. */
413
+ certPassword?: string;
414
+ /**
415
+ * Token-authenticated ASC REST client, when the credential has an ASC API
416
+ * key. Some capabilities (Associated Domains, Push, SIWA) can only be
417
+ * flipped via the ASC REST API — Apple removed their legacy portal
418
+ * endpoints — so actions that need it throw a clear error when absent.
419
+ */
420
+ ascClient?: AppStoreConnectClient;
421
+ onLog?: (m: string) => void;
422
+ }
423
+ type ArtifactKind = "apns_key" | "aps_production" | "aps_sandbox" | "distribution_cert" | "provisioning_profile" | "app_group" | "extension";
424
+ /**
425
+ * A portable provisioning result. `base64` holds the primary blob
426
+ * (.p8 / .p12), `secret` the secondary secret (a .p12 password, or an APNs
427
+ * Key ID), and `ids`/`meta` any Apple-side identifiers the caller may want
428
+ * to persist. The API layer maps each kind to its storage:
429
+ * apns_key / aps_* → apple_credential_certs
430
+ * distribution_cert → credential patch (dist/private-key/password secrets)
431
+ * app_group / extension → metadata / entitlements
432
+ */
433
+ interface ProvisionArtifact {
434
+ kind: ArtifactKind;
435
+ base64?: string;
436
+ secret?: string;
437
+ name?: string;
438
+ ids?: Record<string, string>;
439
+ meta?: Record<string, unknown>;
440
+ }
441
+ interface ActionResult {
442
+ artifacts: ProvisionArtifact[];
443
+ warnings: string[];
444
+ /** One-line human summary for the UI. */
445
+ summary: string;
446
+ }
447
+ interface ActionField {
448
+ key: string;
449
+ label: string;
450
+ type: "text" | "bundleId" | "select" | "boolean";
451
+ required?: boolean;
452
+ placeholder?: string;
453
+ help?: string;
454
+ options?: {
455
+ value: string;
456
+ label: string;
457
+ }[];
458
+ /** Default value the UI pre-fills. */
459
+ default?: string | boolean;
460
+ /**
461
+ * When set, the UI offers the team's existing values (fetched via
462
+ * listCapabilityInventory) as a pick-from-list-or-type-new combobox instead
463
+ * of a bare text input. `bundleIds` → existing App IDs; `appGroups` →
464
+ * existing App Groups.
465
+ */
466
+ source?: "bundleIds" | "appGroups";
467
+ }
468
+ interface CapabilityAction {
469
+ key: string;
470
+ label: string;
471
+ description: string;
472
+ fields: ActionField[];
473
+ run(ctx: ActionContext, params: Record<string, any>): Promise<ActionResult>;
474
+ }
475
+ declare const CAPABILITY_ACTIONS: Record<string, CapabilityAction>;
476
+ /** Serializable descriptors (no `run`) for a UI to render the action picker + forms. */
477
+ declare function listCapabilityActions(): Array<Omit<CapabilityAction, "run">>;
478
+ interface CapabilityInventory {
479
+ /** Existing App ID identifiers in the team, sorted. */
480
+ bundleIds: string[];
481
+ /** Existing App Groups in the team. */
482
+ appGroups: {
483
+ identifier: string;
484
+ name: string;
485
+ }[];
486
+ }
487
+ /**
488
+ * List the team's existing App IDs + App Groups, for the UI to offer as
489
+ * pick-from-existing options in fields tagged with a `source`. Read-only.
490
+ */
491
+ declare function listCapabilityInventory(session: AppleSession, teamId: string): Promise<CapabilityInventory>;
492
+ /** Run a single capability action by key. Throws on unknown key. */
493
+ declare function runCapabilityAction(key: string, ctx: ActionContext, params: Record<string, any>): Promise<ActionResult>;
494
+
495
+ export { type ActionContext, type ActionField, type ActionResult, type AdditionalCertResult, AppStoreConnectClient, type ApplePayCertInput, type ApplePayCertResult, type ArtifactKind, CAPABILITY_ACTIONS, type CapabilityAction, type CapabilityInventory, type EnsureAppGroupInput, type EnsureAppGroupResult, type OneClickInput, type OneClickInventory, type OneClickOptions, type OneClickResult, type PortalTeam, type ProgressEvent, type ProvisionArtifact, ensureAppGroup, generateApplePayCertificate, listCapabilityActions, listCapabilityInventory, oneClickInventory, oneClickListTeams, oneClickSetup, runCapabilityAction };