diff --git a/README.de.md b/README.de.md index 6326000e..9f5e9133 100644 --- a/README.de.md +++ b/README.de.md @@ -20,7 +20,7 @@
diff --git a/README.es.md b/README.es.md index f77874f5..8f8e7c42 100644 --- a/README.es.md +++ b/README.es.md @@ -20,7 +20,7 @@ diff --git a/README.fr.md b/README.fr.md index 52fa8318..d3ee4d6c 100644 --- a/README.fr.md +++ b/README.fr.md @@ -20,7 +20,7 @@ diff --git a/README.ja.md b/README.ja.md index 593d07c9..4f7b16b1 100644 --- a/README.ja.md +++ b/README.ja.md @@ -20,7 +20,7 @@ diff --git a/README.ko.md b/README.ko.md index fddce7fb..852d54ae 100644 --- a/README.ko.md +++ b/README.ko.md @@ -20,7 +20,7 @@ diff --git a/README.md b/README.md index 56a55cd6..96424ef0 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ diff --git a/README.pt-BR.md b/README.pt-BR.md index b76e6499..5f4d23df 100644 --- a/README.pt-BR.md +++ b/README.pt-BR.md @@ -20,7 +20,7 @@ diff --git a/README.ru.md b/README.ru.md index a61d26dd..6b47bf49 100644 --- a/README.ru.md +++ b/README.ru.md @@ -20,7 +20,7 @@ diff --git a/README.zh-CN.md b/README.zh-CN.md index 7b2e776f..c0daaf59 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -20,7 +20,7 @@ diff --git a/llms-full.txt b/llms-full.txt index fdb9674e..e0c61b3b 100644 --- a/llms-full.txt +++ b/llms-full.txt @@ -146,7 +146,7 @@ Each is declared in `launch.config.ts` (or a `*.config.json` sidecar) and reconc ## Commands -All 65 `launch` commands (205 store-API operations underneath, 2909 tests): +All 65 `launch` commands (205 store-API operations underneath, 2917 tests): - `launch init` - scaffold launch.config.ts (and .env.example) into the current repo - `launch adopt` - onboard an app that already ships: import its App Store Connect setup into config diff --git a/llms.txt b/llms.txt index 0cce729c..9aa27f8a 100644 --- a/llms.txt +++ b/llms.txt @@ -146,7 +146,7 @@ Each is declared in `launch.config.ts` (or a `*.config.json` sidecar) and reconc ## Commands -All 65 `launch` commands (205 store-API operations underneath, 2909 tests): +All 65 `launch` commands (205 store-API operations underneath, 2917 tests): - `launch init` - scaffold launch.config.ts (and .env.example) into the current repo - `launch adopt` - onboard an app that already ships: import its App Store Connect setup into config diff --git a/src/apple/ascClient.test.ts b/src/apple/ascClient.test.ts index ec33f7c9..cffcebea 100644 --- a/src/apple/ascClient.test.ts +++ b/src/apple/ascClient.test.ts @@ -3362,3 +3362,34 @@ describe('findBundleId - exact identifier, not substring (#291)', () => { expect(await client.findBundleId('com.example.sampleapp')).toBeNull(); }); }); + +describe('AppStoreConnectClient - app store versions', () => { + it('reads the attached build id from the build relationship, and asks Apple for it', async () => { + fetchMock.mockResolvedValueOnce( + fakeResponse( + 200, + JSON.stringify({ + data: [ + { + id: 'v-edit', + attributes: { versionString: '1.2.0', appStoreState: 'PREPARE_FOR_SUBMISSION' }, + relationships: { build: { data: { type: 'builds', id: 'b-42' } } }, + }, + { + id: 'v-empty', + attributes: { versionString: '1.1.0', appStoreState: 'READY_FOR_SALE' }, + relationships: { build: { data: null } }, + }, + ], + }), + ), + ); + const versions = await client.listAppStoreVersions('app1', 'IOS'); + const [requestUrl] = expectArrayElement(fetchMock.mock.calls, 0, 'mock call'); + expect(String(requestUrl)).toContain( + 'fields[appStoreVersions]=versionString,appStoreState,releaseType,build', + ); + expect(expectArrayElement(versions, 0, 'version').attachedBuildId).toBe('b-42'); + expect(expectArrayElement(versions, 1, 'version').attachedBuildId).toBeUndefined(); + }); +}); diff --git a/src/apple/ascClient.ts b/src/apple/ascClient.ts index 7654461f..c212c935 100644 --- a/src/apple/ascClient.ts +++ b/src/apple/ascClient.ts @@ -378,15 +378,21 @@ type ResourceSingle = { attributes: A; }; }; +/** + * One App Store Connect resource. `relationships` holds the `build` linkage only when the request named + * `build` in `fields`; Apple then returns its `data` linkage (null when no build is attached). + */ +type AppleResource