@limrun/api 0.45.1 → 0.45.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/exec-client.d.mts +68 -9
  3. package/exec-client.d.mts.map +1 -1
  4. package/exec-client.d.ts +68 -9
  5. package/exec-client.d.ts.map +1 -1
  6. package/exec-client.js +19 -5
  7. package/exec-client.js.map +1 -1
  8. package/exec-client.mjs +19 -5
  9. package/exec-client.mjs.map +1 -1
  10. package/index.d.mts +1 -1
  11. package/index.d.mts.map +1 -1
  12. package/index.d.ts +1 -1
  13. package/index.d.ts.map +1 -1
  14. package/index.js.map +1 -1
  15. package/index.mjs.map +1 -1
  16. package/package.json +1 -1
  17. package/resources/gradle-instances-helpers.d.mts +8 -3
  18. package/resources/gradle-instances-helpers.d.mts.map +1 -1
  19. package/resources/gradle-instances-helpers.d.ts +8 -3
  20. package/resources/gradle-instances-helpers.d.ts.map +1 -1
  21. package/resources/gradle-instances-helpers.js +1 -0
  22. package/resources/gradle-instances-helpers.js.map +1 -1
  23. package/resources/gradle-instances-helpers.mjs +1 -0
  24. package/resources/gradle-instances-helpers.mjs.map +1 -1
  25. package/resources/xcode-instances-helpers.d.mts +7 -7
  26. package/resources/xcode-instances-helpers.d.mts.map +1 -1
  27. package/resources/xcode-instances-helpers.d.ts +7 -7
  28. package/resources/xcode-instances-helpers.d.ts.map +1 -1
  29. package/resources/xcode-instances-helpers.js +3 -1
  30. package/resources/xcode-instances-helpers.js.map +1 -1
  31. package/resources/xcode-instances-helpers.mjs +3 -1
  32. package/resources/xcode-instances-helpers.mjs.map +1 -1
  33. package/src/exec-client.ts +85 -13
  34. package/src/index.ts +4 -2
  35. package/src/resources/gradle-instances-helpers.ts +9 -2
  36. package/src/resources/xcode-instances-helpers.ts +10 -8
  37. package/src/version.ts +1 -1
  38. package/version.d.mts +1 -1
  39. package/version.d.ts +1 -1
  40. package/version.js +1 -1
  41. package/version.mjs +1 -1
@@ -37,7 +37,8 @@ export type XcodeBuildExecRequest = {
37
37
  certificatePassword?: string;
38
38
  provisioningProfileBase64?: string;
39
39
  };
40
- testflight?: TestflightUploadConfig;
40
+ /** Wire name retained for compatibility with the limbuild exec API. */
41
+ testflight?: AppStoreUploadConfig;
41
42
  buildSettings?: Record<string, string>;
42
43
  gitInit?: boolean;
43
44
  signedUploadUrl?: string;
@@ -110,12 +111,16 @@ export type GradleSigningConfig = {
110
111
 
111
112
  export type GradleBuildExecRequest = {
112
113
  command: 'gradlebuild';
113
- /** Gradle tasks to run. Omit for the server default (assembleDebug). */
114
+ /**
115
+ * Gradle tasks to run. Omit for the server default (assembleDebug, or
116
+ * bundleRelease when signing is set).
117
+ */
114
118
  tasks?: string[];
115
119
  /** Relative path to the Gradle root when auto-discovery is ambiguous. */
116
120
  projectPath?: string;
117
121
  reactNative?: GradleReactNativeConfig;
118
122
  signing?: GradleSigningConfig;
123
+ playstore?: GradlePlaystoreConfig;
119
124
  signedUploadUrl?: string;
120
125
  webhook?: WebhookConfig;
121
126
  additionalMetadata?: {
@@ -123,6 +128,45 @@ export type GradleBuildExecRequest = {
123
128
  };
124
129
  };
125
130
 
131
+ /**
132
+ * Publish the built AAB to a Google Play track after a successful build.
133
+ * Requires signing. Exactly one of accessToken or serviceAccountJsonBase64
134
+ * must be set; the credential is held in memory for the build duration
135
+ * only. Progress and failure causes stream as `playstore` SSE events.
136
+ */
137
+ export type GradlePlaystoreConfig = {
138
+ /** OAuth bearer token carrying the androidpublisher scope. */
139
+ accessToken?: string;
140
+ /** Base64-encoded service-account JSON key invited in Play Console. */
141
+ serviceAccountJsonBase64?: string;
142
+ /**
143
+ * Play track ID, passed to Google verbatim: internal (default), alpha,
144
+ * beta, production, or a custom closed-testing track. Publishing
145
+ * replaces the track's existing releases, including an in-progress
146
+ * staged rollout on that track.
147
+ */
148
+ track?: string;
149
+ /**
150
+ * completed (default) makes the release live on the track; draft
151
+ * commits it without rollout. Publishing to the production track
152
+ * requires setting it explicitly.
153
+ */
154
+ releaseStatus?: 'draft' | 'completed';
155
+ /** Package name to publish under. Omit to read it from the built AAB. */
156
+ packageName?: string;
157
+ /**
158
+ * Set the versionCode to one more than the highest already known to
159
+ * Google Play (1 for an app with no artifacts), so repeat publishes
160
+ * never collide. Resolved with the publish credential before the build
161
+ * and stamped into the workspace copy: android.versionCode in the Expo
162
+ * config (requires a static app.json), or the single literal
163
+ * versionCode in a native project's conventional app/ module build
164
+ * script (computed or flavor-split versionCodes are rejected at
165
+ * request time).
166
+ */
167
+ autoIncrementVersionCode?: boolean;
168
+ };
169
+
126
170
  export type RunExecRequest = {
127
171
  command: 'run';
128
172
  commandLine: string;
@@ -143,10 +187,16 @@ export type ExecResult = {
143
187
  status: 'SUCCEEDED' | 'FAILED' | 'CANCELLED';
144
188
  signedDownloadUrl?: string;
145
189
  /**
146
- * Last TestFlight state streamed by the server. Absent when the build ran
147
- * without a testflight request, or when the server predates the feature.
190
+ * Last App Store Connect upload state streamed by the server. Absent when
191
+ * the build ran without an App Store upload, or when the server predates
192
+ * the feature.
148
193
  */
149
- testflight?: TestflightEvent;
194
+ appstore?: AppStoreEvent;
195
+ /**
196
+ * Last Play Store state streamed by the server. Absent when the build ran
197
+ * without a playstore request, or when the server predates the feature.
198
+ */
199
+ playstore?: PlaystoreEvent;
150
200
  /**
151
201
  * True when the client gave up waiting for the build's event stream. The
152
202
  * exit code is fabricated in that case; the remote build may still be
@@ -155,14 +205,24 @@ export type ExecResult = {
155
205
  timedOut?: boolean;
156
206
  };
157
207
 
158
- export type TestflightEvent = {
159
- /** 'unknown' means a testflight event arrived but its payload was unreadable. */
208
+ export type AppStoreEvent = {
209
+ /** 'unknown' means an App Store upload event arrived but its payload was unreadable. */
160
210
  state: 'uploading' | 'processing' | 'accepted' | 'failed' | 'unknown';
161
211
  uploadId?: string;
162
212
  buildId?: string;
163
213
  };
164
214
 
165
- export type TestflightUploadConfig = {
215
+ export type PlaystoreEvent = {
216
+ /** 'unknown' means a playstore event arrived but its payload was unreadable. */
217
+ state: 'uploading' | 'accepted' | 'failed' | 'unknown';
218
+ versionCode?: number;
219
+ track?: string;
220
+ /** Machine-readable failure code; present only on failed. */
221
+ code?: string;
222
+ message?: string;
223
+ };
224
+
225
+ export type AppStoreUploadConfig = {
166
226
  /** App Store Connect API key ID, e.g. 2X9R4HXF34. */
167
227
  apiKeyId: string;
168
228
  /** Issuer ID for team API keys. Omit for individual API keys. */
@@ -255,7 +315,8 @@ export class ExecChildProcess implements PromiseLike<ExecResult> {
255
315
  private sseConnection: EventSourceClient | null = null;
256
316
  private killed = false;
257
317
  private detached = false;
258
- private testflightEvent: TestflightEvent | null = null;
318
+ private appStoreEvent: AppStoreEvent | null = null;
319
+ private playstoreEvent: PlaystoreEvent | null = null;
259
320
  private readonly options: ExecOptions;
260
321
  private readonly log: (level: 'debug' | 'info' | 'warn' | 'error', msg: string) => void;
261
322
 
@@ -475,7 +536,8 @@ export class ExecChildProcess implements PromiseLike<ExecResult> {
475
536
  execId: this.execId!,
476
537
  status,
477
538
  ...('additionalMetadata' in request ? request.additionalMetadata ?? {} : {}),
478
- ...(this.testflightEvent ? { testflight: this.testflightEvent } : {}),
539
+ ...(this.appStoreEvent ? { appstore: this.appStoreEvent } : {}),
540
+ ...(this.playstoreEvent ? { playstore: this.playstoreEvent } : {}),
479
541
  ...(timedOut ? { timedOut } : {}),
480
542
  };
481
543
 
@@ -511,13 +573,23 @@ export class ExecChildProcess implements PromiseLike<ExecResult> {
511
573
  this.stderr.emit('data', data);
512
574
  } else if (eventType === 'testflight') {
513
575
  try {
514
- this.testflightEvent = JSON.parse(data) as TestflightEvent;
576
+ this.appStoreEvent = JSON.parse(data) as AppStoreEvent;
515
577
  } catch {
516
- // The event itself proves the server ran the TestFlight step,
578
+ // The wire event itself proves the server ran the App Store upload,
517
579
  // so never let a payload glitch look like a missing feature.
518
- this.testflightEvent = { state: 'unknown' };
580
+ this.appStoreEvent = { state: 'unknown' };
519
581
  this.log('warn', `SSE testflight event has invalid data: ${data}`);
520
582
  }
583
+ } else if (eventType === 'playstore') {
584
+ try {
585
+ this.playstoreEvent = JSON.parse(data) as PlaystoreEvent;
586
+ } catch {
587
+ // Same contract as the App Store upload event: its presence proves the server
588
+ // ran the Play Store step, so a payload glitch must not
589
+ // read as a missing feature.
590
+ this.playstoreEvent = { state: 'unknown' };
591
+ this.log('warn', `SSE playstore event has invalid data: ${data}`);
592
+ }
521
593
  } else if (eventType === 'exitCode') {
522
594
  const exitCode = parseInt(data, 10);
523
595
  if (Number.isNaN(exitCode)) {
package/src/index.ts CHANGED
@@ -16,13 +16,15 @@ export {
16
16
  type XcodeBuildExecRequest,
17
17
  type GradleAndroidABI,
18
18
  type GradleBuildExecRequest,
19
+ type GradlePlaystoreConfig,
19
20
  type GradleReactNativeConfig,
20
21
  type GradleSigningConfig,
21
22
  type ExecOptions,
22
23
  type ExecResult,
23
24
  type ExecChildProcess,
24
- type TestflightEvent,
25
- type TestflightUploadConfig,
25
+ type AppStoreEvent,
26
+ type AppStoreUploadConfig,
27
+ type PlaystoreEvent,
26
28
  type WebhookConfig,
27
29
  } from './exec-client';
28
30
  export {
@@ -6,6 +6,7 @@ import {
6
6
  exec,
7
7
  type ExecChildProcess,
8
8
  type GradleBuildExecRequest,
9
+ type GradlePlaystoreConfig,
9
10
  type GradleReactNativeConfig,
10
11
  type GradleSigningConfig,
11
12
  type WebhookConfig,
@@ -47,11 +48,14 @@ export type GradleSyncOptions = {
47
48
  };
48
49
 
49
50
  export type GradleBuildOptions = {
50
- /** Gradle tasks to run. Omit for the server default (assembleDebug). */
51
+ /**
52
+ * Gradle tasks to run. Omit for the server default (assembleDebug, or
53
+ * bundleRelease when signing is set).
54
+ */
51
55
  tasks?: string[];
52
56
  /** Relative path to the Gradle root when auto-discovery is ambiguous. */
53
57
  projectPath?: string;
54
- /** Upload the built APK as a named org asset, or to a presigned URL. */
58
+ /** Upload the built artifact as a named org asset, or to a presigned URL. */
55
59
  upload?: { assetName: string; signedUploadUrl?: never } | { signedUploadUrl: string; assetName?: never };
56
60
  /** React Native / Expo tuning. */
57
61
  reactNative?: GradleReactNativeConfig;
@@ -62,6 +66,8 @@ export type GradleBuildOptions = {
62
66
  * build result. Delivery is best-effort and never fails the build.
63
67
  */
64
68
  webhook?: WebhookConfig;
69
+ /** Publish the signed AAB to Google Play; see GradlePlaystoreConfig. */
70
+ playstore?: GradlePlaystoreConfig;
65
71
  };
66
72
 
67
73
  export type GradleClient = {
@@ -159,6 +165,7 @@ export class GradleInstances extends GeneratedGradleInstances {
159
165
  ...(options?.reactNative && { reactNative: options.reactNative }),
160
166
  ...(options?.signing && { signing: options.signing }),
161
167
  ...(options?.webhook && { webhook: options.webhook }),
168
+ ...(options?.playstore && { playstore: options.playstore }),
162
169
  };
163
170
 
164
171
  if (options?.upload && 'assetName' in options.upload) {
@@ -5,13 +5,13 @@ import { RequestOptions } from '../internal/request-options';
5
5
  import { path } from '../internal/utils/path';
6
6
  import {
7
7
  exec,
8
+ type AppStoreUploadConfig,
8
9
  type ExecChildProcess,
9
10
  type ExecRequest,
10
- type TestflightUploadConfig,
11
11
  type WebhookConfig,
12
12
  } from '../exec-client';
13
13
 
14
- export type { TestflightUploadConfig, WebhookConfig } from '../exec-client';
14
+ export type { AppStoreUploadConfig, WebhookConfig } from '../exec-client';
15
15
  import {
16
16
  syncFolder as syncFolderImpl,
17
17
  type AdditionalFileSyncEntry,
@@ -145,12 +145,12 @@ export type XcodeBuildOptions = {
145
145
  upload?: { assetName: string } | { signedUploadUrl: string };
146
146
  signing?: XcodeSigningConfig;
147
147
  /**
148
- * Upload the signed device IPA to TestFlight after the build. Requires
149
- * signing and sdk=iphoneos. Check ExecResult.testflight on completion: it is
150
- * absent when the instance's limbuild predates the feature (old servers
151
- * silently ignore this option).
148
+ * Upload the signed device IPA to App Store Connect after the build.
149
+ * Requires signing and sdk=iphoneos. Check ExecResult.appstore on
150
+ * completion; it is absent when the instance's limbuild predates the
151
+ * feature (old servers silently ignore this option).
152
152
  */
153
- testflight?: TestflightUploadConfig;
153
+ appstore?: AppStoreUploadConfig;
154
154
  reactNative?: ReactNativeBuildConfig;
155
155
  /**
156
156
  * Explicit XcodeGen inputs for server-side project generation. By default
@@ -713,7 +713,9 @@ export class XcodeInstances extends GeneratedXcodeInstances {
713
713
  ...(options?.xcodegen && { xcodegen: options.xcodegen }),
714
714
  ...(options?.reactNative && { reactNative: options.reactNative }),
715
715
  ...(options?.signing && { signing: options.signing }),
716
- ...(options?.testflight && { testflight: options.testflight }),
716
+ // The SDK calls this App Store; limbuild's existing wire field remains
717
+ // testflight until the exec API is revised separately.
718
+ ...(options?.appstore && { testflight: options.appstore }),
717
719
  ...(options?.buildSettings && { buildSettings: options.buildSettings }),
718
720
  ...(options?.gitInit !== undefined && { gitInit: options.gitInit }),
719
721
  ...(options?.webhook && { webhook: options.webhook }),
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.45.1'; // x-release-please-version
1
+ export const VERSION = '0.45.2'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.45.1";
1
+ export declare const VERSION = "0.45.2";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.45.1";
1
+ export declare const VERSION = "0.45.2";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.45.1'; // x-release-please-version
4
+ exports.VERSION = '0.45.2'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.45.1'; // x-release-please-version
1
+ export const VERSION = '0.45.2'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map