@palgroup/simstream 0.11.0 → 0.12.0

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 CHANGED
@@ -53,6 +53,10 @@ Completing an upload publishes the build and moves its app's `latest` channel to
53
53
  `runBuild({ channel: 'com.example.app:latest' })` always opens the newest one. `setChannel(id, 'beta')`
54
54
  names others.
55
55
 
56
+ A session that is already open takes another build without being restarted:
57
+ `installBuild(session.session, { build: other.id })` puts it on that one simulator only — unlike `pushBuild`, which
58
+ goes to every session the key holds.
59
+
56
60
  ## When there is nothing free
57
61
 
58
62
  `startSession()` throws a `SimStreamError`. The `code` says what to do about it:
package/dist/index.d.ts CHANGED
@@ -383,6 +383,17 @@ export declare class SimStream {
383
383
  * link follows, so a demo and a tester see the same build without anybody reissuing anything.
384
384
  */
385
385
  runBuild(ref: BuildRef, opts?: StartOptions): Promise<Session>;
386
+ /**
387
+ * Put a registry build on ONE session that is already open — by id to pin it, or by channel to follow it.
388
+ *
389
+ * ‼️ THIS IS NOT pushBuild. A push goes to every session the key holds, which is right for "a new build landed, show
390
+ * it to whoever is looking" and wrong for a key that serves several people: one of them choosing yesterday's build
391
+ * would replace the app under all the others. The install runs after the answer; watch it land with appStatus.
392
+ */
393
+ installBuild(session: string, ref: BuildRef, opts?: {
394
+ launch?: boolean;
395
+ mode?: SimMode;
396
+ }): Promise<void>;
386
397
  /**
387
398
  * A fresh link to a session that is already running.
388
399
  *
package/dist/index.js CHANGED
@@ -218,6 +218,18 @@ class SimStream {
218
218
  async runBuild(ref, opts = {}) {
219
219
  return this.startSession({ ...opts, ...ref });
220
220
  }
221
+ /**
222
+ * Put a registry build on ONE session that is already open — by id to pin it, or by channel to follow it.
223
+ *
224
+ * ‼️ THIS IS NOT pushBuild. A push goes to every session the key holds, which is right for "a new build landed, show
225
+ * it to whoever is looking" and wrong for a key that serves several people: one of them choosing yesterday's build
226
+ * would replace the app under all the others. The install runs after the answer; watch it land with appStatus.
227
+ */
228
+ async installBuild(session, ref, opts = {}) {
229
+ const res = await this.request('POST', '/api/session/build', { session, ...ref, mode: opts.mode, launch: opts.launch });
230
+ if (res.status !== 200)
231
+ throw await this.errorFor(res);
232
+ }
221
233
  /**
222
234
  * A fresh link to a session that is already running.
223
235
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@palgroup/simstream",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "Start and drive remote iOS simulator sessions.",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.js",