@sitepong/fastnode 0.3.0 → 0.3.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 +6 -0
- package/dist/actions/index.cjs +80 -0
- package/dist/actions/index.cjs.map +1 -1
- package/dist/actions/index.mjs +81 -1
- package/dist/actions/index.mjs.map +1 -1
- package/dist/cert/index.d.cts +3 -3
- package/dist/cert/index.d.ts +3 -3
- package/dist/{cert-RvXmdMke.d.ts → cert-ClacRx9y.d.ts} +1 -1
- package/dist/{cert-eOoxGMN1.d.cts → cert-DffLKURp.d.cts} +1 -1
- package/dist/cli/index.cjs +115 -28
- 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 +116 -29
- package/dist/cli/index.mjs.map +1 -1
- package/dist/client/index.cjs +76 -0
- 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 +71 -1
- 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-DGkgRnZp.d.cts → index-925_Ov7X.d.cts} +1 -1
- package/dist/{index-DfkIz7i0.d.cts → index-BbVQzSV1.d.cts} +1 -1
- package/dist/{index-BaNcf7jt.d.cts → index-BhGaVlK1.d.cts} +1 -1
- package/dist/{index-DjC_gmnL.d.ts → index-C-EEYXSE.d.ts} +1 -1
- package/dist/{index-D1GHEM3c.d.ts → index-C18cijCd.d.ts} +1 -1
- package/dist/{index-rTZOdMRE.d.ts → index-CBM5XZKC.d.ts} +1 -1
- package/dist/{index-lsuS2R1T.d.ts → index-CemR3UI9.d.ts} +32 -1
- package/dist/{index-laE3_wm9.d.cts → index-CmcFPn_G.d.cts} +1 -1
- package/dist/{index-DrmS802s.d.cts → index-CpGV1f0L.d.cts} +32 -1
- package/dist/{index-C01Rkrir.d.ts → index-D9YQQ3FM.d.ts} +1 -1
- package/dist/{index-C9mHBJED.d.ts → index-Dkf5sH1E.d.ts} +1 -1
- package/dist/{index-CAEiXVWd.d.ts → index-N6eV5yym.d.ts} +1 -1
- package/dist/{index-icIH5e5V.d.cts → index-O3EMrd5s.d.cts} +3 -3
- package/dist/{index-BvyZ4uiw.d.ts → index-Ol0RtbQA.d.ts} +3 -3
- package/dist/{index-DLJso7Vs.d.cts → index-_24DRp3a.d.cts} +1 -1
- package/dist/{index-DWOLZNlz.d.cts → index-isT08RuY.d.cts} +1 -1
- package/dist/{index-BE7bwNff.d.cts → index-on573dnO.d.cts} +1 -1
- package/dist/{index-CBf0-NUQ.d.ts → index-s2PigtDM.d.ts} +1 -1
- package/dist/index.cjs +118 -31
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.mjs +118 -31
- package/dist/index.mjs.map +1 -1
- package/dist/lane/index.cjs +80 -0
- package/dist/lane/index.cjs.map +1 -1
- package/dist/lane/index.mjs +81 -1
- 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 +1 -1
package/dist/client/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { ai as ApiKeyRole, A as AppStoreConnectClient, c as AppStoreConnectConfig, a as AppStoreConnectError, ah as IrisApiKey, ag as IrisAuthError, af as IrisClient, h as JsonApiError, ak as JsonApiErrorResponse, g as JsonApiListResponse, aj as JsonApiRelationship, J as JsonApiResource, f as JsonApiResponse, L as ListParams, a8 as PortalClient, b as RateLimitError, R as RequestClient, e as RequestOptions, d as TokenConfig, T as TokenManager, ac as clearAppleSession, ad as lastAppleId, aa as loadAppleSession, ab as saveAppleSession, ae as sessionDir, a9 as signInWithAppleId } from '../index-CpGV1f0L.cjs';
|
|
2
2
|
export { A as AppleSession, a as AppleSessionConfig, B as BeginLoginResult, C as ContractMessage, d as PendingLogin, P as ProgramLicenseAgreementError, T as TwoFactorChallenge, b as beginLogin, c as checkPortalResponse, l as loginWithAppleId, r as requestSmsCode, s as submitTwoFactorCode } from '../apple-session-jUzBrql5.cjs';
|
|
3
3
|
import '../enums-yXNVh3UI.cjs';
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { ai as ApiKeyRole, A as AppStoreConnectClient, c as AppStoreConnectConfig, a as AppStoreConnectError, ah as IrisApiKey, ag as IrisAuthError, af as IrisClient, h as JsonApiError, ak as JsonApiErrorResponse, g as JsonApiListResponse, aj as JsonApiRelationship, J as JsonApiResource, f as JsonApiResponse, L as ListParams, a8 as PortalClient, b as RateLimitError, R as RequestClient, e as RequestOptions, d as TokenConfig, T as TokenManager, ac as clearAppleSession, ad as lastAppleId, aa as loadAppleSession, ab as saveAppleSession, ae as sessionDir, a9 as signInWithAppleId } from '../index-CemR3UI9.js';
|
|
2
2
|
export { A as AppleSession, a as AppleSessionConfig, B as BeginLoginResult, C as ContractMessage, d as PendingLogin, P as ProgramLicenseAgreementError, T as TwoFactorChallenge, b as beginLogin, c as checkPortalResponse, l as loginWithAppleId, r as requestSmsCode, s as submitTwoFactorCode } from '../apple-session-jUzBrql5.js';
|
|
3
3
|
import '../enums-yXNVh3UI.js';
|
package/dist/client/index.mjs
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { importPKCS8, SignJWT } from 'jose';
|
|
2
2
|
import { createHash, randomBytes, pbkdf2Sync } from 'crypto';
|
|
3
3
|
import { createInterface } from 'readline';
|
|
4
|
+
import { writeFileSync, chmodSync, existsSync, unlinkSync, readFileSync, mkdirSync } from 'fs';
|
|
5
|
+
import { homedir } from 'os';
|
|
6
|
+
import { join } from 'path';
|
|
4
7
|
|
|
5
8
|
// src/client/auth.ts
|
|
6
9
|
var MAX_TOKEN_DURATION = 1200;
|
|
@@ -2516,6 +2519,73 @@ var AppAssetLibraryPlacementsResource = class {
|
|
|
2516
2519
|
});
|
|
2517
2520
|
}
|
|
2518
2521
|
};
|
|
2522
|
+
var OLYMPUS_SESSION2 = "https://appstoreconnect.apple.com/olympus/v1/session";
|
|
2523
|
+
function sessionDir() {
|
|
2524
|
+
return process.env.FASTNODE_SESSION_DIR || join(homedir(), ".fastnode", "sessions");
|
|
2525
|
+
}
|
|
2526
|
+
function fileFor(email) {
|
|
2527
|
+
const key = createHash("sha256").update(email.trim().toLowerCase()).digest("hex").slice(0, 16);
|
|
2528
|
+
return join(sessionDir(), `${key}.json`);
|
|
2529
|
+
}
|
|
2530
|
+
function ensureDir() {
|
|
2531
|
+
const dir = sessionDir();
|
|
2532
|
+
if (!existsSync(dir)) mkdirSync(dir, { recursive: true, mode: 448 });
|
|
2533
|
+
chmodSync(dir, 448);
|
|
2534
|
+
}
|
|
2535
|
+
function saveAppleSession(session) {
|
|
2536
|
+
ensureDir();
|
|
2537
|
+
const stored = { email: session.userEmail, savedAt: (/* @__PURE__ */ new Date()).toISOString(), session };
|
|
2538
|
+
const path = fileFor(session.userEmail);
|
|
2539
|
+
writeFileSync(path, JSON.stringify(stored), { mode: 384 });
|
|
2540
|
+
chmodSync(path, 384);
|
|
2541
|
+
writeFileSync(join(sessionDir(), "last-apple-id"), session.userEmail, { mode: 384 });
|
|
2542
|
+
}
|
|
2543
|
+
function clearAppleSession(email) {
|
|
2544
|
+
const path = fileFor(email);
|
|
2545
|
+
if (existsSync(path)) unlinkSync(path);
|
|
2546
|
+
}
|
|
2547
|
+
function lastAppleId() {
|
|
2548
|
+
try {
|
|
2549
|
+
return readFileSync(join(sessionDir(), "last-apple-id"), "utf8").trim() || null;
|
|
2550
|
+
} catch {
|
|
2551
|
+
return null;
|
|
2552
|
+
}
|
|
2553
|
+
}
|
|
2554
|
+
async function loadAppleSession(email, fetchImpl = fetch) {
|
|
2555
|
+
const path = fileFor(email);
|
|
2556
|
+
if (!existsSync(path)) return null;
|
|
2557
|
+
let stored;
|
|
2558
|
+
try {
|
|
2559
|
+
stored = JSON.parse(readFileSync(path, "utf8"));
|
|
2560
|
+
} catch {
|
|
2561
|
+
return null;
|
|
2562
|
+
}
|
|
2563
|
+
const cookie = Object.entries(stored.session.cookies).map(([k, v]) => `${k}=${v}`).join("; ");
|
|
2564
|
+
try {
|
|
2565
|
+
const res = await fetchImpl(OLYMPUS_SESSION2, { headers: { Cookie: cookie, Accept: "application/json" } });
|
|
2566
|
+
if (!res.ok) {
|
|
2567
|
+
clearAppleSession(email);
|
|
2568
|
+
return null;
|
|
2569
|
+
}
|
|
2570
|
+
} catch {
|
|
2571
|
+
return null;
|
|
2572
|
+
}
|
|
2573
|
+
return stored.session;
|
|
2574
|
+
}
|
|
2575
|
+
async function signInWithAppleId(options) {
|
|
2576
|
+
const email = options.email || lastAppleId() || await options.askEmail();
|
|
2577
|
+
if (!options.fresh) {
|
|
2578
|
+
const saved = await loadAppleSession(email);
|
|
2579
|
+
if (saved) {
|
|
2580
|
+
options.onLog?.(`Using saved Apple ID session for ${email}`);
|
|
2581
|
+
return saved;
|
|
2582
|
+
}
|
|
2583
|
+
}
|
|
2584
|
+
const password = await options.askPassword(email);
|
|
2585
|
+
const session = await loginWithAppleId({ email, password, onLog: options.onLog });
|
|
2586
|
+
saveAppleSession(session);
|
|
2587
|
+
return session;
|
|
2588
|
+
}
|
|
2519
2589
|
|
|
2520
2590
|
// src/client/portal.ts
|
|
2521
2591
|
var PORTAL_BASE = "https://developer.apple.com/services-account/QH65B2";
|
|
@@ -3663,6 +3733,6 @@ var AppStoreConnectClient = class {
|
|
|
3663
3733
|
}
|
|
3664
3734
|
};
|
|
3665
3735
|
|
|
3666
|
-
export { AppStoreConnectClient, AppStoreConnectError, IrisAuthError, IrisClient, PortalClient, ProgramLicenseAgreementError, RateLimitError, RequestClient, TokenManager, beginLogin, checkPortalResponse, loginWithAppleId, requestSmsCode, submitTwoFactorCode };
|
|
3736
|
+
export { AppStoreConnectClient, AppStoreConnectError, IrisAuthError, IrisClient, PortalClient, ProgramLicenseAgreementError, RateLimitError, RequestClient, TokenManager, beginLogin, checkPortalResponse, clearAppleSession, lastAppleId, loadAppleSession, loginWithAppleId, requestSmsCode, saveAppleSession, sessionDir, signInWithAppleId, submitTwoFactorCode };
|
|
3667
3737
|
//# sourceMappingURL=index.mjs.map
|
|
3668
3738
|
//# sourceMappingURL=index.mjs.map
|