vydanne 0.4.0 → 0.4.2
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/package.json +1 -1
- package/src/client.mjs +6 -1
- package/src/play/commands/prerelease.mjs +16 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vydanne",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "App Store Connect + Google Play submission prep — the companion to zdymak (media). Native Node (no fastlane/Ruby/Python): localized listings, screenshot/preview/icon upload, ratings, review contact, accessibility & privacy labels, IAP, export docs, a diff of local-vs-store, and a preflight verifier that encodes the store gotchas. iOS/macOS via the ASC REST API; Android via the Play Developer Edits API (--store google).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"app-store-connect",
|
package/src/client.mjs
CHANGED
|
@@ -3,7 +3,12 @@ import { makeToken } from "./jwt.mjs";
|
|
|
3
3
|
const API = "https://api.appstoreconnect.apple.com";
|
|
4
4
|
const IRIS = "https://appstoreconnect.apple.com/iris";
|
|
5
5
|
const DEAD_VERSION = ["READY_FOR_SALE", "REMOVED_FROM_SALE", "REPLACED_WITH_NEW_VERSION"];
|
|
6
|
-
|
|
6
|
+
// READY_FOR_DISTRIBUTION is Apple's newer name for the LIVE app-info (they're migrating the
|
|
7
|
+
// state vocabulary; versions still report appStoreState=READY_FOR_SALE). Without it here,
|
|
8
|
+
// appInfo() treats the live record as editable and every name/subtitle PATCH comes back
|
|
9
|
+
// ENTITY_ERROR.ATTRIBUTE.INVALID.INVALID_STATE — which fails the whole locale in `fill`,
|
|
10
|
+
// release notes included, on any app that already has a version on sale.
|
|
11
|
+
const DEAD_INFO = ["READY_FOR_SALE", "READY_FOR_DISTRIBUTION", "REPLACED_WITH_NEW_VERSION", "REMOVED_FROM_SALE"];
|
|
7
12
|
|
|
8
13
|
// Thin ASC REST client. Encodes the gotchas: `iris` host (App Privacy 401s the JWT), version + app-info
|
|
9
14
|
// fetched from the FULL list (get_edit filters out READY_FOR_REVIEW), and individual localization reads
|
|
@@ -46,10 +46,22 @@ export async function run(config, client) {
|
|
|
46
46
|
|
|
47
47
|
const editId = await client.newEdit();
|
|
48
48
|
try {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
// Upload, or REUSE. Play rejects a versionCode it already holds, which is the right answer for an
|
|
50
|
+
// accidental re-upload but wrong for the common case of promoting a build you already pushed to one
|
|
51
|
+
// testing track onto another. The API names the code in its refusal, so take it and carry on — the
|
|
52
|
+
// bytes are already up there, and a bundle is immutable, so reusing it can't diverge from the file.
|
|
53
|
+
let versionCode;
|
|
54
|
+
try {
|
|
55
|
+
const bundle = await client.uploadBundle(editId, aab);
|
|
56
|
+
versionCode = bundle.versionCode;
|
|
57
|
+
if (!versionCode) throw new Error(`upload returned no versionCode: ${JSON.stringify(bundle).slice(0, 200)}`);
|
|
58
|
+
console.log(green(` uploaded versionCode ${versionCode}`));
|
|
59
|
+
} catch (e) {
|
|
60
|
+
const used = /Version code (\d+) has already been used/.exec(e.message);
|
|
61
|
+
if (!used) throw e;
|
|
62
|
+
versionCode = Number(used[1]);
|
|
63
|
+
console.log(yellow(` versionCode ${versionCode} already uploaded — reusing that bundle`));
|
|
64
|
+
}
|
|
53
65
|
|
|
54
66
|
const releaseNotes = readNotes(g.metadataDir, versionCode, g.defaultLocale);
|
|
55
67
|
if (releaseNotes.length) {
|