@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.
Files changed (64) hide show
  1. package/README.md +6 -0
  2. package/dist/actions/index.cjs +80 -0
  3. package/dist/actions/index.cjs.map +1 -1
  4. package/dist/actions/index.mjs +81 -1
  5. package/dist/actions/index.mjs.map +1 -1
  6. package/dist/cert/index.d.cts +3 -3
  7. package/dist/cert/index.d.ts +3 -3
  8. package/dist/{cert-RvXmdMke.d.ts → cert-ClacRx9y.d.ts} +1 -1
  9. package/dist/{cert-eOoxGMN1.d.cts → cert-DffLKURp.d.cts} +1 -1
  10. package/dist/cli/index.cjs +115 -28
  11. package/dist/cli/index.cjs.map +1 -1
  12. package/dist/cli/index.d.cts +1 -1
  13. package/dist/cli/index.d.ts +1 -1
  14. package/dist/cli/index.mjs +116 -29
  15. package/dist/cli/index.mjs.map +1 -1
  16. package/dist/client/index.cjs +76 -0
  17. package/dist/client/index.cjs.map +1 -1
  18. package/dist/client/index.d.cts +1 -1
  19. package/dist/client/index.d.ts +1 -1
  20. package/dist/client/index.mjs +71 -1
  21. package/dist/client/index.mjs.map +1 -1
  22. package/dist/deliver/index.d.cts +2 -2
  23. package/dist/deliver/index.d.ts +2 -2
  24. package/dist/{index-DGkgRnZp.d.cts → index-925_Ov7X.d.cts} +1 -1
  25. package/dist/{index-DfkIz7i0.d.cts → index-BbVQzSV1.d.cts} +1 -1
  26. package/dist/{index-BaNcf7jt.d.cts → index-BhGaVlK1.d.cts} +1 -1
  27. package/dist/{index-DjC_gmnL.d.ts → index-C-EEYXSE.d.ts} +1 -1
  28. package/dist/{index-D1GHEM3c.d.ts → index-C18cijCd.d.ts} +1 -1
  29. package/dist/{index-rTZOdMRE.d.ts → index-CBM5XZKC.d.ts} +1 -1
  30. package/dist/{index-lsuS2R1T.d.ts → index-CemR3UI9.d.ts} +32 -1
  31. package/dist/{index-laE3_wm9.d.cts → index-CmcFPn_G.d.cts} +1 -1
  32. package/dist/{index-DrmS802s.d.cts → index-CpGV1f0L.d.cts} +32 -1
  33. package/dist/{index-C01Rkrir.d.ts → index-D9YQQ3FM.d.ts} +1 -1
  34. package/dist/{index-C9mHBJED.d.ts → index-Dkf5sH1E.d.ts} +1 -1
  35. package/dist/{index-CAEiXVWd.d.ts → index-N6eV5yym.d.ts} +1 -1
  36. package/dist/{index-icIH5e5V.d.cts → index-O3EMrd5s.d.cts} +3 -3
  37. package/dist/{index-BvyZ4uiw.d.ts → index-Ol0RtbQA.d.ts} +3 -3
  38. package/dist/{index-DLJso7Vs.d.cts → index-_24DRp3a.d.cts} +1 -1
  39. package/dist/{index-DWOLZNlz.d.cts → index-isT08RuY.d.cts} +1 -1
  40. package/dist/{index-BE7bwNff.d.cts → index-on573dnO.d.cts} +1 -1
  41. package/dist/{index-CBf0-NUQ.d.ts → index-s2PigtDM.d.ts} +1 -1
  42. package/dist/index.cjs +118 -31
  43. package/dist/index.cjs.map +1 -1
  44. package/dist/index.d.cts +11 -11
  45. package/dist/index.d.ts +11 -11
  46. package/dist/index.mjs +118 -31
  47. package/dist/index.mjs.map +1 -1
  48. package/dist/lane/index.cjs +80 -0
  49. package/dist/lane/index.cjs.map +1 -1
  50. package/dist/lane/index.mjs +81 -1
  51. package/dist/lane/index.mjs.map +1 -1
  52. package/dist/match/index.d.cts +4 -4
  53. package/dist/match/index.d.ts +4 -4
  54. package/dist/pem/index.d.cts +2 -2
  55. package/dist/pem/index.d.ts +2 -2
  56. package/dist/pilot/index.d.cts +2 -2
  57. package/dist/pilot/index.d.ts +2 -2
  58. package/dist/precheck/index.d.cts +2 -2
  59. package/dist/precheck/index.d.ts +2 -2
  60. package/dist/produce/index.d.cts +2 -2
  61. package/dist/produce/index.d.ts +2 -2
  62. package/dist/sigh/index.d.cts +2 -2
  63. package/dist/sigh/index.d.ts +2 -2
  64. package/package.json +1 -1
package/README.md CHANGED
@@ -114,6 +114,12 @@ FASTNODE_USER=you@example.com npx @sitepong/fastnode rejections --app-id 1234567
114
114
  npx @sitepong/fastnode rejections --app-id 1234567890 --all --json
115
115
  ```
116
116
 
117
+ You sign in once: the Apple ID session (never the password) is saved to
118
+ `~/.fastnode/sessions` (0600; override with `FASTNODE_SESSION_DIR`), and later
119
+ `rejections` and `privacy` runs on the same Apple ID reuse it until Apple
120
+ expires it, with no password or 2FA prompt. `--fresh-login` forces a new
121
+ sign-in.
122
+
117
123
  It prints each submission waiting on you (`UNRESOLVED_ISSUES`), the guideline
118
124
  reasons App Review attached, and the message text. `--all` includes resolved
119
125
  submissions too. From code: `getReviewFeedback(session, appId)` in
@@ -6953,6 +6953,79 @@ var init_app_asset_library_placements = __esm({
6953
6953
  };
6954
6954
  }
6955
6955
  });
6956
+ function sessionDir() {
6957
+ return process.env.FASTNODE_SESSION_DIR || path.join(os.homedir(), ".fastnode", "sessions");
6958
+ }
6959
+ function fileFor(email) {
6960
+ const key = crypto.createHash("sha256").update(email.trim().toLowerCase()).digest("hex").slice(0, 16);
6961
+ return path.join(sessionDir(), `${key}.json`);
6962
+ }
6963
+ function ensureDir() {
6964
+ const dir = sessionDir();
6965
+ if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true, mode: 448 });
6966
+ fs.chmodSync(dir, 448);
6967
+ }
6968
+ function saveAppleSession(session) {
6969
+ ensureDir();
6970
+ const stored = { email: session.userEmail, savedAt: (/* @__PURE__ */ new Date()).toISOString(), session };
6971
+ const path$1 = fileFor(session.userEmail);
6972
+ fs.writeFileSync(path$1, JSON.stringify(stored), { mode: 384 });
6973
+ fs.chmodSync(path$1, 384);
6974
+ fs.writeFileSync(path.join(sessionDir(), "last-apple-id"), session.userEmail, { mode: 384 });
6975
+ }
6976
+ function clearAppleSession(email) {
6977
+ const path = fileFor(email);
6978
+ if (fs.existsSync(path)) fs.unlinkSync(path);
6979
+ }
6980
+ function lastAppleId() {
6981
+ try {
6982
+ return fs.readFileSync(path.join(sessionDir(), "last-apple-id"), "utf8").trim() || null;
6983
+ } catch {
6984
+ return null;
6985
+ }
6986
+ }
6987
+ async function loadAppleSession(email, fetchImpl = fetch) {
6988
+ const path = fileFor(email);
6989
+ if (!fs.existsSync(path)) return null;
6990
+ let stored;
6991
+ try {
6992
+ stored = JSON.parse(fs.readFileSync(path, "utf8"));
6993
+ } catch {
6994
+ return null;
6995
+ }
6996
+ const cookie = Object.entries(stored.session.cookies).map(([k, v]) => `${k}=${v}`).join("; ");
6997
+ try {
6998
+ const res = await fetchImpl(OLYMPUS_SESSION2, { headers: { Cookie: cookie, Accept: "application/json" } });
6999
+ if (!res.ok) {
7000
+ clearAppleSession(email);
7001
+ return null;
7002
+ }
7003
+ } catch {
7004
+ return null;
7005
+ }
7006
+ return stored.session;
7007
+ }
7008
+ async function signInWithAppleId(options) {
7009
+ const email = options.email || lastAppleId() || await options.askEmail();
7010
+ if (!options.fresh) {
7011
+ const saved = await loadAppleSession(email);
7012
+ if (saved) {
7013
+ options.onLog?.(`Using saved Apple ID session for ${email}`);
7014
+ return saved;
7015
+ }
7016
+ }
7017
+ const password = await options.askPassword(email);
7018
+ const session = await loginWithAppleId({ email, password, onLog: options.onLog });
7019
+ saveAppleSession(session);
7020
+ return session;
7021
+ }
7022
+ var OLYMPUS_SESSION2;
7023
+ var init_session_store = __esm({
7024
+ "src/client/session-store.ts"() {
7025
+ init_apple_session();
7026
+ OLYMPUS_SESSION2 = "https://appstoreconnect.apple.com/olympus/v1/session";
7027
+ }
7028
+ });
6956
7029
 
6957
7030
  // src/client/portal.ts
6958
7031
  function pickUniqueKeyName(base, taken) {
@@ -8031,8 +8104,14 @@ __export(client_exports, {
8031
8104
  TokenManager: () => TokenManager,
8032
8105
  beginLogin: () => beginLogin,
8033
8106
  checkPortalResponse: () => checkPortalResponse,
8107
+ clearAppleSession: () => clearAppleSession,
8108
+ lastAppleId: () => lastAppleId,
8109
+ loadAppleSession: () => loadAppleSession,
8034
8110
  loginWithAppleId: () => loginWithAppleId,
8035
8111
  requestSmsCode: () => requestSmsCode,
8112
+ saveAppleSession: () => saveAppleSession,
8113
+ sessionDir: () => sessionDir,
8114
+ signInWithAppleId: () => signInWithAppleId,
8036
8115
  submitTwoFactorCode: () => submitTwoFactorCode
8037
8116
  });
8038
8117
  var AppStoreConnectClient;
@@ -8080,6 +8159,7 @@ var init_client = __esm({
8080
8159
  init_auth();
8081
8160
  init_request();
8082
8161
  init_apple_session();
8162
+ init_session_store();
8083
8163
  init_portal();
8084
8164
  init_iris();
8085
8165
  AppStoreConnectClient = class {