@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.
- package/README.md +148 -0
- package/dist/actions/index.cjs +758 -110
- package/dist/actions/index.cjs.map +1 -1
- package/dist/actions/index.mjs +758 -110
- package/dist/actions/index.mjs.map +1 -1
- package/dist/cert/index.cjs +40 -0
- package/dist/cert/index.cjs.map +1 -1
- package/dist/cert/index.d.cts +3 -3
- package/dist/cert/index.d.ts +3 -3
- package/dist/cert/index.mjs +37 -1
- package/dist/cert/index.mjs.map +1 -1
- package/dist/{cert-owkOFNW8.d.ts → cert-e5GAgAPb.d.ts} +1 -1
- package/dist/{cert-BmJGtYtb.d.cts → cert-uLLdb5a7.d.cts} +1 -1
- package/dist/cli/index.cjs +758 -110
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.d.cts +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.mjs +758 -110
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/index.cjs +751 -109
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.mjs +747 -110
- package/dist/client/index.mjs.map +1 -1
- package/dist/deliver/index.d.cts +2 -2
- package/dist/deliver/index.d.ts +2 -2
- package/dist/{index-BFdNOmPJ.d.cts → index-BN0iWhuw.d.cts} +1 -1
- package/dist/index-BNP7Bpu5.d.ts +61 -0
- package/dist/{index-1Vu2cRQ2.d.ts → index-BbY_H_f6.d.ts} +1 -1
- package/dist/{index-D6zjGlPL.d.cts → index-BgHagzj1.d.cts} +1 -1
- package/dist/{index-D5eihzwM.d.cts → index-BjkOUQcQ.d.cts} +1 -1
- package/dist/{index-D1Izm7qt.d.ts → index-BwwpAlk2.d.ts} +363 -2
- package/dist/{index-A5MimeQk.d.ts → index-C2YLoFVl.d.ts} +1 -1
- package/dist/{index-TfXqwuac.d.ts → index-CEldrbyz.d.ts} +1 -1
- package/dist/{index-BLubSlgK.d.cts → index-CdfgEZwh.d.cts} +363 -2
- package/dist/{index-DfCUVJX1.d.cts → index-Clyf4-lu.d.cts} +1 -1
- package/dist/index-CtydPNxA.d.cts +61 -0
- package/dist/{index-BQJIJlK7.d.cts → index-DHxi-QPC.d.cts} +3 -3
- package/dist/{index-BN0ubxjZ.d.ts → index-Di4Ic0EE.d.ts} +3 -3
- package/dist/{index-EcVvViW8.d.cts → index-DrCOh0Vh.d.cts} +1 -1
- package/dist/{index-B0yhu_LZ.d.ts → index-EKU_G1G5.d.ts} +1 -1
- package/dist/{index-CWNLnSOL.d.cts → index-XsMsVc3O.d.cts} +1 -1
- package/dist/{index-B9yXicrQ.d.ts → index-jeI44Q5G.d.ts} +1 -1
- package/dist/{index-DHw08dUc.d.ts → index-mddpvrRX.d.ts} +1 -1
- package/dist/index.cjs +1233 -110
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +226 -10
- package/dist/index.d.ts +226 -10
- package/dist/index.mjs +1230 -111
- package/dist/index.mjs.map +1 -1
- package/dist/lane/index.cjs +758 -110
- package/dist/lane/index.cjs.map +1 -1
- package/dist/lane/index.mjs +758 -110
- package/dist/lane/index.mjs.map +1 -1
- package/dist/match/index.d.cts +4 -4
- package/dist/match/index.d.ts +4 -4
- package/dist/pem/index.d.cts +2 -2
- package/dist/pem/index.d.ts +2 -2
- package/dist/pilot/index.d.cts +2 -2
- package/dist/pilot/index.d.ts +2 -2
- package/dist/precheck/index.d.cts +2 -2
- package/dist/precheck/index.d.ts +2 -2
- package/dist/produce/index.d.cts +2 -2
- package/dist/produce/index.d.ts +2 -2
- package/dist/sigh/index.d.cts +2 -2
- package/dist/sigh/index.d.ts +2 -2
- package/package.json +3 -1
- package/dist/index-DfirmFbC.d.ts +0 -32
- package/dist/index-lt819Jgj.d.cts +0 -32
|
@@ -1344,7 +1344,17 @@ declare class XcodeMetricsResource {
|
|
|
1344
1344
|
* Apple ID Session Authentication
|
|
1345
1345
|
* 1:1 port of Fastlane Spaceship client.rb + two_step_or_factor_client.rb
|
|
1346
1346
|
*
|
|
1347
|
-
*
|
|
1347
|
+
* Two flows:
|
|
1348
|
+
*
|
|
1349
|
+
* loginWithAppleId({ email, password, onPrompt })
|
|
1350
|
+
* - blocking, CLI-style. onPrompt is awaited to collect 2FA codes.
|
|
1351
|
+
*
|
|
1352
|
+
* beginLogin({ email, password }) → { kind: "logged_in" | "needs_2fa", ... }
|
|
1353
|
+
* submitTwoFactorCode({ pending, code, source, ... }) → AppleSession
|
|
1354
|
+
* requestSmsCode({ pending, phoneId, mode })
|
|
1355
|
+
* - HTTP-resumable. Used by the App Release wizard, where the 2FA
|
|
1356
|
+
* challenge is rendered in a browser modal and the code arrives in
|
|
1357
|
+
* a separate request.
|
|
1348
1358
|
*/
|
|
1349
1359
|
interface AppleSessionConfig {
|
|
1350
1360
|
email: string;
|
|
@@ -1367,6 +1377,53 @@ interface AppleSession {
|
|
|
1367
1377
|
teamId?: string;
|
|
1368
1378
|
pendingAgreements: ContractMessage[];
|
|
1369
1379
|
}
|
|
1380
|
+
/**
|
|
1381
|
+
* State held between beginLogin() and submitTwoFactorCode() — captures
|
|
1382
|
+
* everything needed to resume an in-progress 2FA flow across HTTP requests.
|
|
1383
|
+
* Stored server-side keyed by an opaque session id; never sent to the
|
|
1384
|
+
* browser (the browser only sees the opaque id).
|
|
1385
|
+
*/
|
|
1386
|
+
interface PendingLogin {
|
|
1387
|
+
cookies: Record<string, string>;
|
|
1388
|
+
sessionId: string;
|
|
1389
|
+
scnt: string;
|
|
1390
|
+
serviceKey: string;
|
|
1391
|
+
userEmail: string;
|
|
1392
|
+
}
|
|
1393
|
+
/**
|
|
1394
|
+
* Description of the 2FA challenge presented to the user.
|
|
1395
|
+
*
|
|
1396
|
+
* Modern 2FA accounts (the default for everyone) have `kind: "device"` —
|
|
1397
|
+
* Apple pushes the 6-digit code to all the user's trusted Apple devices
|
|
1398
|
+
* (iPhone, Mac, etc.) and the user types it into our wizard. The legacy
|
|
1399
|
+
* `trustedDevices` field is empty in this case; that field only ever
|
|
1400
|
+
* populates for old "two-step verification" accounts which are
|
|
1401
|
+
* essentially extinct.
|
|
1402
|
+
*
|
|
1403
|
+
* `kind: "phone_only"` is reserved for accounts that have no real Apple
|
|
1404
|
+
* devices (Apple's `noTrustedDevices === true` flag) — those accounts
|
|
1405
|
+
* must use SMS to a trusted phone number.
|
|
1406
|
+
*
|
|
1407
|
+
* Either way, the user can opt to receive the code via SMS instead by
|
|
1408
|
+
* picking from `trustedPhoneNumbers` and calling requestSmsCode().
|
|
1409
|
+
*/
|
|
1410
|
+
interface TwoFactorChallenge {
|
|
1411
|
+
kind: "device" | "phone_only";
|
|
1412
|
+
codeLength: number;
|
|
1413
|
+
trustedPhoneNumbers: {
|
|
1414
|
+
id: number;
|
|
1415
|
+
numberWithDialCode: string;
|
|
1416
|
+
pushMode?: string;
|
|
1417
|
+
}[];
|
|
1418
|
+
}
|
|
1419
|
+
type BeginLoginResult = {
|
|
1420
|
+
kind: "logged_in";
|
|
1421
|
+
session: AppleSession;
|
|
1422
|
+
} | {
|
|
1423
|
+
kind: "needs_2fa";
|
|
1424
|
+
pending: PendingLogin;
|
|
1425
|
+
challenge: TwoFactorChallenge;
|
|
1426
|
+
};
|
|
1370
1427
|
/** Thrown when an Apple Developer Program agreement needs to be accepted */
|
|
1371
1428
|
declare class ProgramLicenseAgreementError extends Error {
|
|
1372
1429
|
agreements: ContractMessage[];
|
|
@@ -1378,6 +1435,46 @@ declare class ProgramLicenseAgreementError extends Error {
|
|
|
1378
1435
|
* Call this after any portal API call. Mirrors Spaceship::Client#handle_itc_response.
|
|
1379
1436
|
*/
|
|
1380
1437
|
declare function checkPortalResponse(body: any, session?: AppleSession): void;
|
|
1438
|
+
/**
|
|
1439
|
+
* Step 1 of HTTP-resumable login: do the SIRP exchange and detect whether
|
|
1440
|
+
* 2FA is required. Returns either a fully-established session (no 2FA) or
|
|
1441
|
+
* a pending state + a description of the 2FA challenge.
|
|
1442
|
+
*/
|
|
1443
|
+
declare function beginLogin(config: {
|
|
1444
|
+
email: string;
|
|
1445
|
+
password: string;
|
|
1446
|
+
onLog?: (msg: string) => void;
|
|
1447
|
+
}): Promise<BeginLoginResult>;
|
|
1448
|
+
/**
|
|
1449
|
+
* Ask Apple to send an SMS / voice code to the chosen trusted phone.
|
|
1450
|
+
* Used by the wizard's "Send code via text instead" affordance.
|
|
1451
|
+
*/
|
|
1452
|
+
declare function requestSmsCode(input: {
|
|
1453
|
+
pending: PendingLogin;
|
|
1454
|
+
phoneId: number;
|
|
1455
|
+
mode?: "sms" | "voice";
|
|
1456
|
+
}): Promise<void>;
|
|
1457
|
+
/**
|
|
1458
|
+
* Step 2 of HTTP-resumable login: submit the 2FA code the user typed.
|
|
1459
|
+
* Returns a fully-established AppleSession on success.
|
|
1460
|
+
*
|
|
1461
|
+
* source = "device" → 4-digit code from a trusted Apple device
|
|
1462
|
+
* source = "phone" → 6-digit code from SMS / push to trusted phone
|
|
1463
|
+
*/
|
|
1464
|
+
declare function submitTwoFactorCode(input: {
|
|
1465
|
+
pending: PendingLogin;
|
|
1466
|
+
code: string;
|
|
1467
|
+
source: "device" | "phone";
|
|
1468
|
+
phoneId?: number;
|
|
1469
|
+
mode?: "sms" | "voice";
|
|
1470
|
+
onLog?: (msg: string) => void;
|
|
1471
|
+
}): Promise<AppleSession>;
|
|
1472
|
+
/**
|
|
1473
|
+
* Backward-compatible CLI-style login. Internally uses beginLogin +
|
|
1474
|
+
* submitTwoFactorCode but routes 2FA through the synchronous onPrompt
|
|
1475
|
+
* callback so existing scripts (test-login.ts, test-full-workflow.ts)
|
|
1476
|
+
* keep working.
|
|
1477
|
+
*/
|
|
1381
1478
|
declare function loginWithAppleId(config: AppleSessionConfig): Promise<AppleSession>;
|
|
1382
1479
|
|
|
1383
1480
|
/**
|
|
@@ -1400,6 +1497,120 @@ declare class PortalClient {
|
|
|
1400
1497
|
constructor(session: AppleSession, teamId: string);
|
|
1401
1498
|
/** Initialize CSRF tokens — must be called before mutations */
|
|
1402
1499
|
init(): Promise<void>;
|
|
1500
|
+
/**
|
|
1501
|
+
* JSON POST — different content type than the standard form-encoded
|
|
1502
|
+
* `post()`. Used by the App Store Connect API key endpoints
|
|
1503
|
+
* (`account/auth/key/v2/create`), which Spaceship discovered take a
|
|
1504
|
+
* JSON body even though every other portal mutation is form-encoded.
|
|
1505
|
+
*
|
|
1506
|
+
* Like the form-encoded `post()`, this also runs the response through
|
|
1507
|
+
* `checkPortalResponse` — Apple returns HTTP 200 even for errors and
|
|
1508
|
+
* encodes the error in `resultCode`/`userString` fields, so a raw
|
|
1509
|
+
* status check would silently miss real failures.
|
|
1510
|
+
*/
|
|
1511
|
+
private postJson;
|
|
1512
|
+
/**
|
|
1513
|
+
* GET helper for the portal endpoints that take query parameters
|
|
1514
|
+
* (currently just `account/auth/key/download`). Returns the raw text
|
|
1515
|
+
* since download endpoints can return PEMs or JSON depending on Apple's
|
|
1516
|
+
* mood — caller decides how to parse.
|
|
1517
|
+
*/
|
|
1518
|
+
private getRaw;
|
|
1519
|
+
/**
|
|
1520
|
+
* Create an App Store Connect API key via the developer portal's
|
|
1521
|
+
* `account/auth/key/v2/create` endpoint. Reverse-engineered from the
|
|
1522
|
+
* _current_ @expo/apple-utils npm package (v2.1.21), which is what
|
|
1523
|
+
* EAS CLI uses to manage Apple credentials in production.
|
|
1524
|
+
*
|
|
1525
|
+
* This differs from older published reverse-engineering guides:
|
|
1526
|
+
* • URL uses the `/v2/create` suffix (Apple kept it)
|
|
1527
|
+
* • Field is `serviceConfigurations`, shape is an object keyed by
|
|
1528
|
+
* service id (NOT `serviceConfigurationsRequests: [...]` array)
|
|
1529
|
+
* • Body REQUIRES `scope: "team"`
|
|
1530
|
+
* • Needs a scope-specific CSRF warmup via the `keys` endpoint
|
|
1531
|
+
* before the create call (EAS's `ensureCSRFAsync("keys", …)`)
|
|
1532
|
+
*
|
|
1533
|
+
* For an App Store Connect API key (PUBLIC_API, used by altool for
|
|
1534
|
+
* TestFlight uploads), `serviceConfigurations` is an empty object `{}`.
|
|
1535
|
+
* For an APNs auth key, it's `{ "U27F4V844T": [] }`. For MusicKit:
|
|
1536
|
+
* `{ "6A7HVUVQ3M": [musicId] }`, etc.
|
|
1537
|
+
*
|
|
1538
|
+
* Apple's name validator rejects parentheses, brackets, and most
|
|
1539
|
+
* punctuation — sanitize to alphanumeric + space + dash + underscore
|
|
1540
|
+
* + period and collapse whitespace.
|
|
1541
|
+
*/
|
|
1542
|
+
createApiKey(rawName: string, serviceConfigurations?: Record<string, unknown[]>): Promise<{
|
|
1543
|
+
keyId: string;
|
|
1544
|
+
raw: any;
|
|
1545
|
+
}>;
|
|
1546
|
+
/**
|
|
1547
|
+
* Fetch a single API key by id via `account/auth/key/get`. Reverse-
|
|
1548
|
+
* engineered from Spaceship's `get_key`. Returns the raw key record so
|
|
1549
|
+
* the caller can extract whatever fields it needs (e.g. issuerId).
|
|
1550
|
+
*
|
|
1551
|
+
* Form-encoded POST — same shape as every other PortalClient mutation
|
|
1552
|
+
* except the JSON `create` endpoint.
|
|
1553
|
+
*/
|
|
1554
|
+
getApiKey(keyId: string): Promise<any>;
|
|
1555
|
+
/**
|
|
1556
|
+
* Revoke an existing key. Form-encoded POST per Spaceship's
|
|
1557
|
+
* `revoke_key!`. Used for cleaning up orphan keys created during
|
|
1558
|
+
* failed wizard runs.
|
|
1559
|
+
*/
|
|
1560
|
+
revokeApiKey(keyId: string): Promise<void>;
|
|
1561
|
+
/** Apple's hardcoded service id for APNs auth keys (from Spaceship). */
|
|
1562
|
+
static readonly APNS_SERVICE_ID = "U27F4V844T";
|
|
1563
|
+
/**
|
|
1564
|
+
* Create an APNs Authentication Key (.p8) via the developer portal.
|
|
1565
|
+
*
|
|
1566
|
+
* Apple requires BOTH `serviceConfigurations` (the map) AND
|
|
1567
|
+
* `serviceConfigurationsRequests` (the array of full config objects)
|
|
1568
|
+
* in the v2/create body. Just sending the map alone results in
|
|
1569
|
+
* "No value was provided for the parameter 'serviceConfigurations'".
|
|
1570
|
+
*
|
|
1571
|
+
* The exact body comes from @expo/apple-utils v2.1.21 — both fields
|
|
1572
|
+
* are produced by separate functions (`d` for the map, `h` for the
|
|
1573
|
+
* array) and merged into the create payload.
|
|
1574
|
+
*
|
|
1575
|
+
* Apple also rejects duplicate key names ("Another key with same
|
|
1576
|
+
* name exists") — we dedupe by listing existing keys first and
|
|
1577
|
+
* appending " (N)" until we find a free slot, mirroring the
|
|
1578
|
+
* provisioning profile dedup.
|
|
1579
|
+
*/
|
|
1580
|
+
createApnsAuthKey(rawName: string): Promise<{
|
|
1581
|
+
keyId: string;
|
|
1582
|
+
pem: string;
|
|
1583
|
+
raw: any;
|
|
1584
|
+
}>;
|
|
1585
|
+
/**
|
|
1586
|
+
* Find existing APNs auth keys in the team. Used by the wizard to
|
|
1587
|
+
* detect "you already have one" cases and offer to reuse rather than
|
|
1588
|
+
* proliferate keys.
|
|
1589
|
+
*/
|
|
1590
|
+
listApnsAuthKeys(): Promise<{
|
|
1591
|
+
keyId: string;
|
|
1592
|
+
keyName: string;
|
|
1593
|
+
canDownload: boolean;
|
|
1594
|
+
}[]>;
|
|
1595
|
+
/**
|
|
1596
|
+
* Download an existing App Store Connect API key as PEM. Spaceship's
|
|
1597
|
+
* `download_key` endpoint — GET with teamId + keyId in query string.
|
|
1598
|
+
* Returns the raw .p8 PEM text. Apple shows the .p8 exactly once
|
|
1599
|
+
* (after creation), so call this immediately after createApiKey.
|
|
1600
|
+
*/
|
|
1601
|
+
downloadApiKey(keyId: string): Promise<string>;
|
|
1602
|
+
/**
|
|
1603
|
+
* List existing API keys via the portal. Used to discover the team's
|
|
1604
|
+
* issuer id — every key in the team shares the same issuer id, and
|
|
1605
|
+
* altool needs it alongside the key id and .p8 file.
|
|
1606
|
+
*
|
|
1607
|
+
* Form-encoded POST (NOT JSON), with pagination params, per Spaceship's
|
|
1608
|
+
* `list_keys` method. JSON returned 415 from this endpoint.
|
|
1609
|
+
*/
|
|
1610
|
+
listApiKeys(): Promise<{
|
|
1611
|
+
keys: any[];
|
|
1612
|
+
issuerId?: string;
|
|
1613
|
+
}>;
|
|
1403
1614
|
private post;
|
|
1404
1615
|
listTeams(): Promise<any[]>;
|
|
1405
1616
|
listAppIds(): Promise<any[]>;
|
|
@@ -1410,6 +1621,28 @@ declare class PortalClient {
|
|
|
1410
1621
|
enableIAP?: boolean;
|
|
1411
1622
|
}): Promise<any>;
|
|
1412
1623
|
deleteAppId(appIdId: string): Promise<void>;
|
|
1624
|
+
/**
|
|
1625
|
+
* Toggle a capability (a.k.a. "service") on a bundle ID. Mirrors
|
|
1626
|
+
* Spaceship::Portal's `update_service` — the legacy portal endpoint
|
|
1627
|
+
* still works and is the only session-cookie-authenticated way to flip
|
|
1628
|
+
* capabilities like Push Notifications and Sign in with Apple from
|
|
1629
|
+
* outside the Apple Developer web UI.
|
|
1630
|
+
*
|
|
1631
|
+
* Common service codes (from Spaceship portal/portal_client.rb):
|
|
1632
|
+
* push → push notifications
|
|
1633
|
+
* APG3427HIY → Sign in with Apple
|
|
1634
|
+
* IAD53UNK2F → in-app purchase
|
|
1635
|
+
* homeKit → HomeKit
|
|
1636
|
+
* healthKit → HealthKit
|
|
1637
|
+
*
|
|
1638
|
+
* @param featureType Apple's internal capability key (string code or short name)
|
|
1639
|
+
* @param enabled true → turn on, false → turn off
|
|
1640
|
+
*/
|
|
1641
|
+
setBundleCapability(params: {
|
|
1642
|
+
appIdId: string;
|
|
1643
|
+
featureType: string;
|
|
1644
|
+
enabled: boolean;
|
|
1645
|
+
}): Promise<void>;
|
|
1413
1646
|
listCertificates(types?: string[]): Promise<any[]>;
|
|
1414
1647
|
listPushCertificates(): Promise<any[]>;
|
|
1415
1648
|
createCertificate(params: {
|
|
@@ -1470,6 +1703,134 @@ declare class PortalClient {
|
|
|
1470
1703
|
static OLDER_IOS_CERTIFICATE_TYPES: readonly string[];
|
|
1471
1704
|
}
|
|
1472
1705
|
|
|
1706
|
+
/**
|
|
1707
|
+
* App Store Connect "iris" admin API client.
|
|
1708
|
+
*
|
|
1709
|
+
* The iris API lives at `https://appstoreconnect.apple.com/iris/v1/*` and
|
|
1710
|
+
* is what App Store Connect's own web UI uses for everything that doesn't
|
|
1711
|
+
* fit the public REST API (which requires JWT). Authentication is via the
|
|
1712
|
+
* Olympus session cookies we already obtain after SIRP + 2FA login.
|
|
1713
|
+
*
|
|
1714
|
+
* Notable iris endpoints (reverse-engineered from the App Store Connect
|
|
1715
|
+
* web app — Apple does not publish this API, so the shapes below are best
|
|
1716
|
+
* effort and may need iteration):
|
|
1717
|
+
*
|
|
1718
|
+
* POST /iris/v1/apiKeys
|
|
1719
|
+
* Body: { data: { type: "apiKeys", attributes: {
|
|
1720
|
+
* nickname, allAppsVisible, roles: ["DEVELOPER" | "APP_MANAGER" | ...]
|
|
1721
|
+
* }}}
|
|
1722
|
+
* Response: { data: { id, attributes: { nickname, kid, privateKey?, ... }}}
|
|
1723
|
+
*
|
|
1724
|
+
* `kid` is the key ID used in JWT auth (e.g. "2X9R4HXF34"). The
|
|
1725
|
+
* `privateKey` field, when present, contains the PEM-encoded .p8
|
|
1726
|
+
* content. Apple shows this exactly ONCE at creation time — if we
|
|
1727
|
+
* don't capture it, the key is bricked and must be revoked.
|
|
1728
|
+
*
|
|
1729
|
+
* GET /iris/v1/apiKeys
|
|
1730
|
+
* List existing keys. Used to find the issuer id.
|
|
1731
|
+
*
|
|
1732
|
+
* Roles the wizard uses: "APP_MANAGER" is the minimum needed for
|
|
1733
|
+
* TestFlight uploads via altool. Higher roles work too.
|
|
1734
|
+
*
|
|
1735
|
+
* Failure modes:
|
|
1736
|
+
* • 403 → user lacks Account Holder / Admin role → fall back to manual
|
|
1737
|
+
* • 4xx with `error.detail` → surface the message to the user
|
|
1738
|
+
* • 200 but no `privateKey` in response → endpoint shape changed,
|
|
1739
|
+
* surface so we can iterate
|
|
1740
|
+
*/
|
|
1741
|
+
|
|
1742
|
+
type ApiKeyRole = "ADMIN" | "FINANCE" | "ACCESS_TO_REPORTS" | "APP_MANAGER" | "DEVELOPER" | "MARKETING" | "SALES" | "CUSTOMER_SUPPORT";
|
|
1743
|
+
interface IrisApiKey {
|
|
1744
|
+
id: string;
|
|
1745
|
+
/** Key ID used for JWT auth (the short alphanumeric string) */
|
|
1746
|
+
kid: string;
|
|
1747
|
+
nickname: string;
|
|
1748
|
+
/** PEM-encoded .p8 private key — only present in create response, ONCE */
|
|
1749
|
+
privateKey?: string;
|
|
1750
|
+
/** Issuer id (UUID) — needed by altool/iTMSTransporter alongside the key id */
|
|
1751
|
+
issuerId?: string;
|
|
1752
|
+
roles: ApiKeyRole[];
|
|
1753
|
+
allAppsVisible: boolean;
|
|
1754
|
+
}
|
|
1755
|
+
declare class IrisClient {
|
|
1756
|
+
private session;
|
|
1757
|
+
private cookieStr;
|
|
1758
|
+
constructor(session: AppleSession);
|
|
1759
|
+
private buildHeaders;
|
|
1760
|
+
/**
|
|
1761
|
+
* Issue a request and absorb any new cookies (Apple rotates session
|
|
1762
|
+
* cookies on a lot of iris calls).
|
|
1763
|
+
*/
|
|
1764
|
+
private request;
|
|
1765
|
+
/**
|
|
1766
|
+
* List existing API keys. Used both as a sanity check (the user has
|
|
1767
|
+
* permission) and to discover the team's issuer id (which is the same
|
|
1768
|
+
* for every key in the team and is needed by altool).
|
|
1769
|
+
*
|
|
1770
|
+
* Important: Apple's iris endpoint rejects most query parameters with
|
|
1771
|
+
* `PARAMETER_ERROR.INVALID`. Call with no params and let the API return
|
|
1772
|
+
* its default page.
|
|
1773
|
+
*/
|
|
1774
|
+
listApiKeys(): Promise<{
|
|
1775
|
+
keys: IrisApiKey[];
|
|
1776
|
+
issuerId?: string;
|
|
1777
|
+
}>;
|
|
1778
|
+
/**
|
|
1779
|
+
* Create a new API key. Apple returns the .p8 PEM exactly once in the
|
|
1780
|
+
* create response — capture it immediately or the key is dead weight.
|
|
1781
|
+
*
|
|
1782
|
+
* `keyType` is required by Apple's iris API:
|
|
1783
|
+
* • PUBLIC_API — the standard team-wide API key (what TestFlight uploads need)
|
|
1784
|
+
* • MARKETING_API — for App Analytics access only
|
|
1785
|
+
*/
|
|
1786
|
+
createApiKey(input: {
|
|
1787
|
+
nickname: string;
|
|
1788
|
+
roles?: ApiKeyRole[];
|
|
1789
|
+
allAppsVisible?: boolean;
|
|
1790
|
+
keyType?: "PUBLIC_API" | "MARKETING_API";
|
|
1791
|
+
}): Promise<IrisApiKey>;
|
|
1792
|
+
/**
|
|
1793
|
+
* Fetch the .p8 PEM AND the team's issuer id for a previously-created
|
|
1794
|
+
* ASC API key. Both come back in a single request via:
|
|
1795
|
+
*
|
|
1796
|
+
* GET /iris/v1/apiKeys/{id}?fields[apiKeys]=privateKey&include=provider
|
|
1797
|
+
*
|
|
1798
|
+
* Sparse fieldset requesting ONLY `privateKey` is the magic that makes
|
|
1799
|
+
* Apple actually include the (base64-encoded) PEM in the response —
|
|
1800
|
+
* the default view returns `privateKey: null`. The `include=provider`
|
|
1801
|
+
* pulls the team's contentProvider record into `included[]`, and its
|
|
1802
|
+
* `id` field IS the issuer id altool needs (a UUID like
|
|
1803
|
+
* `cfadaf94-44ca-4c2c-8fa6-ecc28d3c7d0d`).
|
|
1804
|
+
*
|
|
1805
|
+
* Reverse-engineered from @expo/apple-utils v2.1.21 (the package that
|
|
1806
|
+
* powers EAS CLI), specifically the `ApiKey.downloadAsync` method
|
|
1807
|
+
* combined with `ApiKey.infoAsync` reading `provider?.id`.
|
|
1808
|
+
*
|
|
1809
|
+
* Returns `{ pem, issuerId }`, or `null` if Apple won't return the
|
|
1810
|
+
* private key (typically because the key was already downloaded once).
|
|
1811
|
+
*/
|
|
1812
|
+
fetchApiKeyPrivateKey(keyId: string): Promise<{
|
|
1813
|
+
pem: string;
|
|
1814
|
+
issuerId?: string;
|
|
1815
|
+
} | null>;
|
|
1816
|
+
/**
|
|
1817
|
+
* @deprecated Kept as a fallback probe for debugging. The real path
|
|
1818
|
+
* is the sparse fieldset above — everything in this brute-force list
|
|
1819
|
+
* returned 404 during testing. Left here so we can re-verify if Apple
|
|
1820
|
+
* changes anything.
|
|
1821
|
+
*/
|
|
1822
|
+
fetchApiKeyPrivateKeyBruteForce(keyId: string): Promise<string | null>;
|
|
1823
|
+
/** Internal: like request() but lets us override headers. */
|
|
1824
|
+
private requestWithHeaders;
|
|
1825
|
+
/** Internal: fetch an absolute URL with the session cookies. */
|
|
1826
|
+
private requestAbsolute;
|
|
1827
|
+
deleteApiKey(keyId: string): Promise<void>;
|
|
1828
|
+
}
|
|
1829
|
+
/** Thrown when the user doesn't have permission to use the iris admin API. */
|
|
1830
|
+
declare class IrisAuthError extends Error {
|
|
1831
|
+
constructor(message: string);
|
|
1832
|
+
}
|
|
1833
|
+
|
|
1473
1834
|
declare class AppStoreConnectClient {
|
|
1474
1835
|
readonly http: RequestClient;
|
|
1475
1836
|
readonly certificates: CertificatesResource;
|
|
@@ -1510,4 +1871,4 @@ declare class AppStoreConnectClient {
|
|
|
1510
1871
|
request<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
1511
1872
|
}
|
|
1512
1873
|
|
|
1513
|
-
export { type
|
|
1874
|
+
export { type ContractMessage as $, type AppleSession as A, type BundleId as B, type Certificate as C, type Device as D, CapabilitiesResource as E, AppStoreVersionsResource as F, type AppStoreVersion as G, type AppStoreVersionLocalization as H, AppScreenshotsResource as I, type JsonApiResource as J, type AppScreenshot as K, type ListParams as L, type AppScreenshotSet as M, ReviewSubmissionsResource as N, type ReviewSubmission as O, type Profile as P, type AppStoreVersionSubmission as Q, RequestClient as R, loginWithAppleId as S, TokenManager as T, type UploadOperation as U, beginLogin as V, submitTwoFactorCode as W, requestSmsCode as X, checkPortalResponse as Y, ProgramLicenseAgreementError as Z, type AppleSessionConfig as _, AppStoreConnectClient as a, type PendingLogin as a0, type TwoFactorChallenge as a1, type BeginLoginResult as a2, PortalClient as a3, IrisClient as a4, IrisAuthError as a5, type IrisApiKey as a6, type ApiKeyRole as a7, type JsonApiRelationship as a8, type JsonApiErrorResponse as a9, AppStoreConnectError as b, RateLimitError as c, type AppStoreConnectConfig as d, type TokenConfig as e, type RequestOptions as f, type JsonApiResponse as g, type JsonApiListResponse as h, type JsonApiError as i, type App as j, type Build as k, type BetaGroup as l, type BetaBuildLocalization as m, type BuildBetaDetail as n, type PreReleaseVersion$1 as o, type BundleIdCapability as p, type CapabilitySettingInput as q, type CapabilitySetting as r, type CapabilityOption as s, CertificatesResource as t, ProfilesResource as u, BundleIdsResource as v, DevicesResource as w, AppsResource as x, BuildsResource as y, BetaGroupsResource as z };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { C as CertOptions, a as CertResult, c as createCertificate, d as downloadCertificate, f as findValidCertificates, r as revokeCertificate, b as revokeExpiredCertificates } from './cert-uLLdb5a7.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Generate EC P-256 CSR — used by App Store Connect API (JWT auth).
|
|
5
|
+
*/
|
|
6
|
+
declare function generateCSR(): Promise<{
|
|
7
|
+
csr: string;
|
|
8
|
+
privateKey: string;
|
|
9
|
+
}>;
|
|
10
|
+
/**
|
|
11
|
+
* Generate RSA 2048 CSR — required by Apple Developer Portal (session auth).
|
|
12
|
+
* Matches Fastlane's create_certificate_signing_request which uses RSA 2048.
|
|
13
|
+
*/
|
|
14
|
+
declare function generateRSACSR(): {
|
|
15
|
+
csr: string;
|
|
16
|
+
privateKey: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* PKCS#12 (.p12) packaging — bundles a certificate + private key into an
|
|
21
|
+
* encrypted .p12 file, which is the format Apple's codesign, xcodebuild,
|
|
22
|
+
* and Fastlane's cert action all expect for distribution signing.
|
|
23
|
+
*
|
|
24
|
+
* Uses node-forge's pkcs12.toPkcs12Asn1 which emits the legacy-compatible
|
|
25
|
+
* format (3DES + RC2) that Keychain Access, iTMSTransporter, and older
|
|
26
|
+
* Apple tooling accept. OpenSSL 3's default format requires the -legacy
|
|
27
|
+
* flag and is not portable; node-forge sidesteps that entirely.
|
|
28
|
+
*/
|
|
29
|
+
interface BundleP12Options {
|
|
30
|
+
/** Certificate: PEM string, or raw DER Buffer as returned by PortalClient.downloadCertificate */
|
|
31
|
+
certificate: Buffer | string;
|
|
32
|
+
/** PEM-encoded RSA private key (as produced by generateRSACSR) */
|
|
33
|
+
privateKeyPem: string;
|
|
34
|
+
/** Password used to encrypt the .p12 */
|
|
35
|
+
password: string;
|
|
36
|
+
/** Friendly name embedded in the bag (shown in Keychain Access) */
|
|
37
|
+
friendlyName?: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Create a PKCS#12 buffer containing the given cert + private key,
|
|
41
|
+
* encrypted with `password`. Returns a Buffer suitable for writing to
|
|
42
|
+
* disk or uploading as a form field.
|
|
43
|
+
*/
|
|
44
|
+
declare function bundleP12(options: BundleP12Options): Buffer;
|
|
45
|
+
|
|
46
|
+
type index_BundleP12Options = BundleP12Options;
|
|
47
|
+
declare const index_CertOptions: typeof CertOptions;
|
|
48
|
+
declare const index_CertResult: typeof CertResult;
|
|
49
|
+
declare const index_bundleP12: typeof bundleP12;
|
|
50
|
+
declare const index_createCertificate: typeof createCertificate;
|
|
51
|
+
declare const index_downloadCertificate: typeof downloadCertificate;
|
|
52
|
+
declare const index_findValidCertificates: typeof findValidCertificates;
|
|
53
|
+
declare const index_generateCSR: typeof generateCSR;
|
|
54
|
+
declare const index_generateRSACSR: typeof generateRSACSR;
|
|
55
|
+
declare const index_revokeCertificate: typeof revokeCertificate;
|
|
56
|
+
declare const index_revokeExpiredCertificates: typeof revokeExpiredCertificates;
|
|
57
|
+
declare namespace index {
|
|
58
|
+
export { type index_BundleP12Options as BundleP12Options, index_CertOptions as CertOptions, index_CertResult as CertResult, index_bundleP12 as bundleP12, index_createCertificate as createCertificate, index_downloadCertificate as downloadCertificate, index_findValidCertificates as findValidCertificates, index_generateCSR as generateCSR, index_generateRSACSR as generateRSACSR, index_revokeCertificate as revokeCertificate, index_revokeExpiredCertificates as revokeExpiredCertificates };
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export { type BundleP12Options as B, generateRSACSR as a, bundleP12 as b, generateCSR as g, index as i };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as CertResult } from './cert-
|
|
3
|
-
import { S as SighResult } from './index-
|
|
1
|
+
import { a as AppStoreConnectClient } from './index-CdfgEZwh.cjs';
|
|
2
|
+
import { a as CertResult } from './cert-uLLdb5a7.cjs';
|
|
3
|
+
import { S as SighResult } from './index-BN0iWhuw.cjs';
|
|
4
4
|
|
|
5
5
|
type StorageMode = "git" | "s3" | "local";
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as CertResult } from './cert-
|
|
3
|
-
import { S as SighResult } from './index-
|
|
1
|
+
import { a as AppStoreConnectClient } from './index-BwwpAlk2.js';
|
|
2
|
+
import { a as CertResult } from './cert-e5GAgAPb.js';
|
|
3
|
+
import { S as SighResult } from './index-CEldrbyz.js';
|
|
4
4
|
|
|
5
5
|
type StorageMode = "git" | "s3" | "local";
|
|
6
6
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as AppStoreConnectClient } from './index-CdfgEZwh.cjs';
|
|
2
2
|
import { C as CertificateType } from './enums-B609j2rb.cjs';
|
|
3
3
|
|
|
4
4
|
type PushCertKind = "development" | "production" | "website" | "voip" | "passbook";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as AppStoreConnectClient, q as CapabilitySettingInput, B as BundleId, p as BundleIdCapability, j as App } from './index-BwwpAlk2.js';
|
|
2
2
|
import { B as BundleIdPlatform, d as CapabilityType } from './enums-B609j2rb.js';
|
|
3
3
|
|
|
4
4
|
interface ProduceOptions {
|