@limrun/api 0.82.0 → 0.84.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/CHANGELOG.md +44 -0
- package/README.md +4 -6
- package/client.d.mts.map +1 -1
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/core/api-promise.d.mts.map +1 -1
- package/core/api-promise.d.ts.map +1 -1
- package/core/api-promise.js +0 -1
- package/core/api-promise.js.map +1 -1
- package/core/api-promise.mjs +0 -1
- package/core/api-promise.mjs.map +1 -1
- package/core/error.d.mts.map +1 -1
- package/core/error.d.ts.map +1 -1
- package/core/error.js +0 -1
- package/core/error.js.map +1 -1
- package/core/error.mjs +0 -1
- package/core/error.mjs.map +1 -1
- package/core/pagination.d.mts.map +1 -1
- package/core/pagination.d.ts.map +1 -1
- package/core/pagination.js +0 -1
- package/core/pagination.js.map +1 -1
- package/core/pagination.mjs +0 -1
- package/core/pagination.mjs.map +1 -1
- package/core/resource.d.mts.map +1 -1
- package/core/resource.d.ts.map +1 -1
- package/core/resource.js +0 -1
- package/core/resource.js.map +1 -1
- package/core/resource.mjs +0 -1
- package/core/resource.mjs.map +1 -1
- package/exec-client.d.mts +3 -3
- package/exec-client.d.ts +3 -3
- package/gradle-snapshot.d.mts +9 -1
- package/gradle-snapshot.d.mts.map +1 -1
- package/gradle-snapshot.d.ts +9 -1
- package/gradle-snapshot.d.ts.map +1 -1
- package/gradle-snapshot.js.map +1 -1
- package/gradle-snapshot.mjs.map +1 -1
- package/index.d.mts +1 -1
- package/index.d.mts.map +1 -1
- package/index.d.ts +1 -1
- package/index.d.ts.map +1 -1
- package/index.js +4 -3
- package/index.js.map +1 -1
- package/index.mjs +1 -1
- package/index.mjs.map +1 -1
- package/internal/builtin-types.d.mts.map +1 -1
- package/internal/builtin-types.d.ts.map +1 -1
- package/internal/builtin-types.js +0 -1
- package/internal/builtin-types.js.map +1 -1
- package/internal/builtin-types.mjs +0 -1
- package/internal/builtin-types.mjs.map +1 -1
- package/internal/daemon-snapshot.d.mts +29 -0
- package/internal/daemon-snapshot.d.mts.map +1 -0
- package/internal/daemon-snapshot.d.ts +29 -0
- package/internal/daemon-snapshot.d.ts.map +1 -0
- package/internal/daemon-snapshot.js +137 -0
- package/internal/daemon-snapshot.js.map +1 -0
- package/internal/daemon-snapshot.mjs +134 -0
- package/internal/daemon-snapshot.mjs.map +1 -0
- package/internal/detect-platform.d.mts.map +1 -1
- package/internal/detect-platform.d.ts.map +1 -1
- package/internal/detect-platform.js +0 -1
- package/internal/detect-platform.js.map +1 -1
- package/internal/detect-platform.mjs +0 -1
- package/internal/detect-platform.mjs.map +1 -1
- package/internal/errors.d.mts.map +1 -1
- package/internal/errors.d.ts.map +1 -1
- package/internal/errors.js +0 -1
- package/internal/errors.js.map +1 -1
- package/internal/errors.mjs +0 -1
- package/internal/errors.mjs.map +1 -1
- package/internal/headers.d.mts.map +1 -1
- package/internal/headers.d.ts.map +1 -1
- package/internal/headers.js +0 -1
- package/internal/headers.js.map +1 -1
- package/internal/headers.mjs +0 -1
- package/internal/headers.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +0 -1
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +0 -1
- package/internal/parse.mjs.map +1 -1
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts.map +1 -1
- package/internal/request-options.js +0 -1
- package/internal/request-options.js.map +1 -1
- package/internal/request-options.mjs +0 -1
- package/internal/request-options.mjs.map +1 -1
- package/internal/shim-types.d.mts.map +1 -1
- package/internal/shim-types.d.ts.map +1 -1
- package/internal/shim-types.js +6 -1
- package/internal/shim-types.js.map +1 -1
- package/internal/shim-types.mjs +6 -1
- package/internal/shim-types.mjs.map +1 -1
- package/internal/shims.d.mts.map +1 -1
- package/internal/shims.d.ts.map +1 -1
- package/internal/shims.js +6 -1
- package/internal/shims.js.map +1 -1
- package/internal/shims.mjs +6 -1
- package/internal/shims.mjs.map +1 -1
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts.map +1 -1
- package/internal/types.js +0 -1
- package/internal/types.js.map +1 -1
- package/internal/types.mjs +0 -1
- package/internal/types.mjs.map +1 -1
- package/internal/utils/base64.d.mts.map +1 -1
- package/internal/utils/base64.d.ts.map +1 -1
- package/internal/utils/base64.js +0 -1
- package/internal/utils/base64.js.map +1 -1
- package/internal/utils/base64.mjs +0 -1
- package/internal/utils/base64.mjs.map +1 -1
- package/internal/utils/env.d.mts.map +1 -1
- package/internal/utils/env.d.ts.map +1 -1
- package/internal/utils/env.js +0 -1
- package/internal/utils/env.js.map +1 -1
- package/internal/utils/env.mjs +0 -1
- package/internal/utils/env.mjs.map +1 -1
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js +0 -1
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +0 -1
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/query.d.mts.map +1 -1
- package/internal/utils/query.d.ts.map +1 -1
- package/internal/utils/query.js +0 -1
- package/internal/utils/query.js.map +1 -1
- package/internal/utils/query.mjs +0 -1
- package/internal/utils/query.mjs.map +1 -1
- package/internal/utils/sleep.d.mts.map +1 -1
- package/internal/utils/sleep.d.ts.map +1 -1
- package/internal/utils/sleep.js +0 -1
- package/internal/utils/sleep.js.map +1 -1
- package/internal/utils/sleep.mjs +0 -1
- package/internal/utils/sleep.mjs.map +1 -1
- package/internal/utils/uuid.d.mts.map +1 -1
- package/internal/utils/uuid.d.ts.map +1 -1
- package/internal/utils/uuid.js +0 -1
- package/internal/utils/uuid.js.map +1 -1
- package/internal/utils/uuid.mjs +0 -1
- package/internal/utils/uuid.mjs.map +1 -1
- package/internal/utils/values.d.mts.map +1 -1
- package/internal/utils/values.d.ts.map +1 -1
- package/internal/utils/values.js +0 -1
- package/internal/utils/values.js.map +1 -1
- package/internal/utils/values.mjs +0 -1
- package/internal/utils/values.mjs.map +1 -1
- package/internal/utils.d.mts.map +1 -1
- package/internal/utils.d.ts.map +1 -1
- package/internal/utils.js +0 -1
- package/internal/utils.js.map +1 -1
- package/internal/utils.mjs +0 -1
- package/internal/utils.mjs.map +1 -1
- package/package.json +2 -2
- package/resources/analytics.d.mts.map +1 -1
- package/resources/analytics.d.ts.map +1 -1
- package/resources/analytics.js +0 -1
- package/resources/analytics.js.map +1 -1
- package/resources/analytics.mjs +0 -1
- package/resources/analytics.mjs.map +1 -1
- package/resources/android-instances.d.mts.map +1 -1
- package/resources/android-instances.d.ts.map +1 -1
- package/resources/android-instances.js +0 -1
- package/resources/android-instances.js.map +1 -1
- package/resources/android-instances.mjs +0 -1
- package/resources/android-instances.mjs.map +1 -1
- package/resources/assets.d.mts.map +1 -1
- package/resources/assets.d.ts.map +1 -1
- package/resources/assets.js +0 -1
- package/resources/assets.js.map +1 -1
- package/resources/assets.mjs +0 -1
- package/resources/assets.mjs.map +1 -1
- package/resources/daemon-client-shared.d.mts.map +1 -1
- package/resources/daemon-client-shared.d.ts.map +1 -1
- package/resources/daemon-client-shared.js.map +1 -1
- package/resources/daemon-client-shared.mjs.map +1 -1
- package/resources/gradle-instances-helpers.d.mts.map +1 -1
- package/resources/gradle-instances-helpers.d.ts.map +1 -1
- package/resources/gradle-instances-helpers.js +25 -37
- package/resources/gradle-instances-helpers.js.map +1 -1
- package/resources/gradle-instances-helpers.mjs +25 -37
- package/resources/gradle-instances-helpers.mjs.map +1 -1
- package/resources/gradle-instances.d.mts.map +1 -1
- package/resources/gradle-instances.d.ts.map +1 -1
- package/resources/gradle-instances.js +0 -2
- package/resources/gradle-instances.js.map +1 -1
- package/resources/gradle-instances.mjs +0 -2
- package/resources/gradle-instances.mjs.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -2
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/ios-instances.d.mts.map +1 -1
- package/resources/ios-instances.d.ts.map +1 -1
- package/resources/ios-instances.js +0 -1
- package/resources/ios-instances.js.map +1 -1
- package/resources/ios-instances.mjs +0 -1
- package/resources/ios-instances.mjs.map +1 -1
- package/resources/macos-instances-helpers.d.mts +34 -3
- package/resources/macos-instances-helpers.d.mts.map +1 -1
- package/resources/macos-instances-helpers.d.ts +34 -3
- package/resources/macos-instances-helpers.d.ts.map +1 -1
- package/resources/macos-instances-helpers.js +112 -25
- package/resources/macos-instances-helpers.js.map +1 -1
- package/resources/macos-instances-helpers.mjs +110 -25
- package/resources/macos-instances-helpers.mjs.map +1 -1
- package/resources/macos-instances.d.mts.map +1 -1
- package/resources/macos-instances.d.ts.map +1 -1
- package/resources/macos-instances.js +0 -2
- package/resources/macos-instances.js.map +1 -1
- package/resources/macos-instances.mjs +0 -2
- package/resources/macos-instances.mjs.map +1 -1
- package/resources/scoped-tokens.d.mts.map +1 -1
- package/resources/scoped-tokens.d.ts.map +1 -1
- package/resources/scoped-tokens.js +0 -1
- package/resources/scoped-tokens.js.map +1 -1
- package/resources/scoped-tokens.mjs +0 -1
- package/resources/scoped-tokens.mjs.map +1 -1
- package/resources/xcode-instances-helpers.d.mts +3 -4
- package/resources/xcode-instances-helpers.d.mts.map +1 -1
- package/resources/xcode-instances-helpers.d.ts +3 -4
- package/resources/xcode-instances-helpers.d.ts.map +1 -1
- package/resources/xcode-instances-helpers.js.map +1 -1
- package/resources/xcode-instances-helpers.mjs.map +1 -1
- package/resources/xcode-instances.d.mts.map +1 -1
- package/resources/xcode-instances.d.ts.map +1 -1
- package/resources/xcode-instances.js +0 -1
- package/resources/xcode-instances.js.map +1 -1
- package/resources/xcode-instances.mjs +0 -1
- package/resources/xcode-instances.mjs.map +1 -1
- package/src/client.ts +0 -2
- package/src/core/api-promise.ts +0 -2
- package/src/core/error.ts +0 -2
- package/src/core/pagination.ts +0 -2
- package/src/core/resource.ts +0 -2
- package/src/exec-client.ts +3 -3
- package/src/gradle-snapshot.ts +9 -1
- package/src/index.ts +1 -2
- package/src/internal/builtin-types.ts +0 -2
- package/src/internal/daemon-snapshot.ts +144 -0
- package/src/internal/detect-platform.ts +0 -2
- package/src/internal/errors.ts +0 -2
- package/src/internal/headers.ts +0 -2
- package/src/internal/parse.ts +0 -2
- package/src/internal/request-options.ts +0 -2
- package/src/internal/shim-types.ts +0 -2
- package/src/internal/shims.ts +0 -2
- package/src/internal/types.ts +0 -2
- package/src/internal/utils/base64.ts +0 -2
- package/src/internal/utils/env.ts +0 -2
- package/src/internal/utils/log.ts +0 -2
- package/src/internal/utils/query.ts +0 -2
- package/src/internal/utils/sleep.ts +0 -2
- package/src/internal/utils/uuid.ts +0 -2
- package/src/internal/utils/values.ts +0 -2
- package/src/internal/utils.ts +0 -2
- package/src/resources/analytics.ts +0 -2
- package/src/resources/android-instances.ts +0 -2
- package/src/resources/assets.ts +0 -2
- package/src/resources/daemon-client-shared.ts +2 -4
- package/src/resources/gradle-instances-helpers.ts +27 -41
- package/src/resources/gradle-instances.ts +0 -3
- package/src/resources/index.ts +1 -2
- package/src/resources/ios-instances.ts +0 -2
- package/src/resources/macos-instances-helpers.ts +169 -29
- package/src/resources/macos-instances.ts +0 -3
- package/src/resources/scoped-tokens.ts +0 -2
- package/src/resources/xcode-instances-helpers.ts +3 -4
- package/src/resources/xcode-instances.ts +0 -2
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/src/lib/.keep +0 -4
|
@@ -52,6 +52,8 @@ import {
|
|
|
52
52
|
pushFile as pushLocalFile,
|
|
53
53
|
type PullResult,
|
|
54
54
|
} from '../internal/file-transfer';
|
|
55
|
+
import { LimrunError } from '../core/error';
|
|
56
|
+
import { followDaemonSnapshot } from '../internal/daemon-snapshot';
|
|
55
57
|
import { nodeProxyTransport } from '../internal/proxy-transport';
|
|
56
58
|
import nodePath from 'path';
|
|
57
59
|
import { createHash } from 'crypto';
|
|
@@ -318,9 +320,10 @@ export interface MacosClient {
|
|
|
318
320
|
*
|
|
319
321
|
* Each restore key is tried in order: its exact name first, then the newest asset whose name
|
|
320
322
|
* starts with it, skipping snapshots saved on another macOS build. Without `restoreKeys`,
|
|
321
|
-
* `key` is restored. Without either, nothing is restored
|
|
322
|
-
* and before using the guest; asking again joins the restore
|
|
323
|
-
* final progress event; `onProgress` sees every event, with
|
|
323
|
+
* `key` is restored. Without either, nothing is restored and it resolves with the save's state.
|
|
324
|
+
* Call it once the instance is ready and before using the guest; asking again joins the restore
|
|
325
|
+
* already running. Resolves with the final progress event; `onProgress` sees every event, with
|
|
326
|
+
* byte counts while downloading.
|
|
324
327
|
*/
|
|
325
328
|
restoreSnapshot(options: MacosSnapshotRestoreOptions): Promise<MacosSnapshotProgress>;
|
|
326
329
|
|
|
@@ -460,11 +463,33 @@ export interface MacosSnapshotRestoreOptions {
|
|
|
460
463
|
key?: string;
|
|
461
464
|
/** Asset names, or name prefixes, to restore from, in order. Defaults to `key`. */
|
|
462
465
|
restoreKeys?: string[];
|
|
466
|
+
/**
|
|
467
|
+
* A base64 AES-256 key, 32 random bytes, that encrypts the save and decrypts the restore. Limrun
|
|
468
|
+
* stores no copy, so a lost key makes the snapshot unreadable. Generate one with
|
|
469
|
+
* `openssl rand -base64 32`. An instance from before encrypted snapshots rejects it with
|
|
470
|
+
* `MacosSnapshotEncryptionUnsupportedError` and restores nothing.
|
|
471
|
+
*/
|
|
472
|
+
encryptionKey?: string;
|
|
473
|
+
/**
|
|
474
|
+
* Guest paths the save under `key` leaves out, each with everything under it, such as build
|
|
475
|
+
* output or secrets. A path is absolute or relative to the guest user's home, and may use `*`,
|
|
476
|
+
* `?` and `[...]` within a segment, a backslash escaping each, and `**` for any number of
|
|
477
|
+
* segments, as in `~/**\/node_modules`. Up to 100. They need `key` and are fixed with it.
|
|
478
|
+
*/
|
|
479
|
+
excludePaths?: string[];
|
|
480
|
+
/** Called once per distinct state, and again as the download progresses. */
|
|
463
481
|
onProgress?: (progress: MacosSnapshotProgress) => void;
|
|
482
|
+
/** How long to wait for the restore to end. Defaults to twenty minutes. */
|
|
483
|
+
timeoutMs?: number;
|
|
464
484
|
}
|
|
465
485
|
|
|
466
486
|
/** A restore's progress, as the instance reports it. */
|
|
467
487
|
export interface MacosSnapshotProgress {
|
|
488
|
+
/**
|
|
489
|
+
* The restore's phase. A request with neither `key` nor `restoreKeys` restores nothing and
|
|
490
|
+
* reports the save the instance runs when it terminates instead: the phase is then the save's,
|
|
491
|
+
* such as `idle`.
|
|
492
|
+
*/
|
|
468
493
|
phase: 'resolving' | 'downloading' | 'extracting' | 'restored' | 'skipped' | 'failed' | string;
|
|
469
494
|
/** The asset name the restore matched. */
|
|
470
495
|
key?: string;
|
|
@@ -547,6 +572,42 @@ class MacosInstancesHelpers extends MacosInstances {
|
|
|
547
572
|
return true;
|
|
548
573
|
},
|
|
549
574
|
});
|
|
575
|
+
// limacvm's restoreSnapshot over signaling, which every limacvm takes. Progress arrives as
|
|
576
|
+
// restoreSnapshotProgress before the result.
|
|
577
|
+
const restoreOverSignaling = async (
|
|
578
|
+
request: Record<string, unknown>,
|
|
579
|
+
onProgress: MacosSnapshotRestoreOptions['onProgress'],
|
|
580
|
+
): Promise<MacosSnapshotProgress> => {
|
|
581
|
+
const id = transport.nextId();
|
|
582
|
+
let last: MacosSnapshotProgress | undefined;
|
|
583
|
+
restoreProgress.set(id, (progress) => {
|
|
584
|
+
last = progress;
|
|
585
|
+
onProgress?.(progress);
|
|
586
|
+
});
|
|
587
|
+
try {
|
|
588
|
+
// A restore downloads the whole disk, so it waits as long as the connection lasts.
|
|
589
|
+
let final: MacosSnapshotProgress | undefined;
|
|
590
|
+
try {
|
|
591
|
+
final = await transport.request<MacosSnapshotProgress | undefined>(
|
|
592
|
+
'restoreSnapshot',
|
|
593
|
+
request,
|
|
594
|
+
(msg) => msg['progress'] as MacosSnapshotProgress | undefined,
|
|
595
|
+
0,
|
|
596
|
+
id,
|
|
597
|
+
);
|
|
598
|
+
} catch (error) {
|
|
599
|
+
// A failed restore is an outcome, as it was reported in its progress, not an error.
|
|
600
|
+
if (last?.phase === 'failed') return last;
|
|
601
|
+
throw error;
|
|
602
|
+
}
|
|
603
|
+
if (final && final !== last) onProgress?.(final);
|
|
604
|
+
const result = final ?? last;
|
|
605
|
+
if (!result) throw new Error('the instance finished the restore without reporting its progress');
|
|
606
|
+
return result;
|
|
607
|
+
} finally {
|
|
608
|
+
restoreProgress.delete(id);
|
|
609
|
+
}
|
|
610
|
+
};
|
|
550
611
|
const send = <T = void>(
|
|
551
612
|
type: string,
|
|
552
613
|
params: Record<string, unknown> = {},
|
|
@@ -882,36 +943,53 @@ class MacosInstancesHelpers extends MacosInstances {
|
|
|
882
943
|
onProgress,
|
|
883
944
|
key,
|
|
884
945
|
restoreKeys,
|
|
946
|
+
encryptionKey,
|
|
947
|
+
excludePaths,
|
|
948
|
+
timeoutMs = MACOS_RESTORE_TIMEOUT_MS,
|
|
885
949
|
}: MacosSnapshotRestoreOptions): Promise<MacosSnapshotProgress> {
|
|
886
|
-
const
|
|
950
|
+
const request = {
|
|
951
|
+
...(key !== undefined && { key }),
|
|
952
|
+
...(restoreKeys !== undefined && { restoreKeys }),
|
|
953
|
+
...(encryptionKey !== undefined && { encryptionKey }),
|
|
954
|
+
...(excludePaths !== undefined && { excludePaths }),
|
|
955
|
+
};
|
|
956
|
+
// A request for no restore reports the save, as signaling does.
|
|
957
|
+
const restores = (restoreKeys ?? (key !== undefined ? [key] : [])).length > 0;
|
|
887
958
|
let last: MacosSnapshotProgress | undefined;
|
|
888
|
-
|
|
889
|
-
last = progress;
|
|
890
|
-
onProgress?.(progress);
|
|
891
|
-
});
|
|
959
|
+
let reported = '';
|
|
892
960
|
try {
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
961
|
+
await followDaemonSnapshot<MacosSnapshotReport>({
|
|
962
|
+
apiUrl,
|
|
963
|
+
token,
|
|
964
|
+
request,
|
|
965
|
+
timeoutMs,
|
|
966
|
+
onStatus: (report) => {
|
|
967
|
+
last = macosSnapshotProgress(report, restores);
|
|
968
|
+
const seen = `${last.phase}/${last.reason ?? ''}/${last.doneBytes ?? ''}`;
|
|
969
|
+
if (seen !== reported) {
|
|
970
|
+
reported = seen;
|
|
971
|
+
onProgress?.(last);
|
|
972
|
+
}
|
|
973
|
+
return !restores || MACOS_RESTORE_TERMINAL.has(report.restore.phase);
|
|
974
|
+
},
|
|
975
|
+
unavailableError: () => new MacosSnapshotRequestUnavailableError(),
|
|
976
|
+
timeoutError: () =>
|
|
977
|
+
new Error(
|
|
978
|
+
`Timed out after ${Math.round(
|
|
979
|
+
timeoutMs / 1000,
|
|
980
|
+
)}s waiting for the disk snapshot restore to finish` +
|
|
981
|
+
(last ? ` (last phase: ${last.phase})` : ''),
|
|
982
|
+
),
|
|
983
|
+
});
|
|
984
|
+
return last!;
|
|
985
|
+
} catch (error) {
|
|
986
|
+
// An instance from before POST /snapshot takes the request over signaling only.
|
|
987
|
+
if (!(error instanceof MacosSnapshotRequestUnavailableError)) throw error;
|
|
914
988
|
}
|
|
989
|
+
// Every instance that encrypts snapshots takes POST /snapshot. An older one would ignore
|
|
990
|
+
// the key and save the guest unencrypted, so it gets no request at all.
|
|
991
|
+
if (encryptionKey !== undefined) throw new MacosSnapshotEncryptionUnsupportedError();
|
|
992
|
+
return restoreOverSignaling(request, onProgress);
|
|
915
993
|
},
|
|
916
994
|
|
|
917
995
|
async drag(from, to, options) {
|
|
@@ -966,3 +1044,65 @@ function validateRecordingId(recordingId: string): void {
|
|
|
966
1044
|
throw new Error('recordingId must match ^[a-z0-9][a-z0-9_-]{0,63}$');
|
|
967
1045
|
}
|
|
968
1046
|
}
|
|
1047
|
+
|
|
1048
|
+
/** Waits past the instance's own fifteen-minute bound on a restore before giving up on it. */
|
|
1049
|
+
const MACOS_RESTORE_TIMEOUT_MS = 20 * 60 * 1000;
|
|
1050
|
+
|
|
1051
|
+
const MACOS_RESTORE_TERMINAL = new Set(['disabled', 'restored', 'skipped', 'failed']);
|
|
1052
|
+
|
|
1053
|
+
/** POST /snapshot answered 404, so the instance predates it or keeps no snapshots. */
|
|
1054
|
+
class MacosSnapshotRequestUnavailableError extends Error {}
|
|
1055
|
+
|
|
1056
|
+
/**
|
|
1057
|
+
* `restoreSnapshot` was given an `encryptionKey` and the instance predates encrypted snapshots.
|
|
1058
|
+
* Nothing was restored, and the instance saves nothing. A new instance takes the key.
|
|
1059
|
+
*/
|
|
1060
|
+
export class MacosSnapshotEncryptionUnsupportedError extends LimrunError {
|
|
1061
|
+
constructor() {
|
|
1062
|
+
super(
|
|
1063
|
+
'This instance predates encrypted disk snapshots, so it cannot take an encryption key; create a new instance.',
|
|
1064
|
+
);
|
|
1065
|
+
this.name = 'MacosSnapshotEncryptionUnsupportedError';
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
/** The status limacvm answers POST and GET /snapshot with. */
|
|
1070
|
+
type MacosSnapshotReport = {
|
|
1071
|
+
restore: {
|
|
1072
|
+
phase: string;
|
|
1073
|
+
key?: string;
|
|
1074
|
+
matchKind?: string;
|
|
1075
|
+
source?: string;
|
|
1076
|
+
bytes?: number;
|
|
1077
|
+
doneBytes?: number;
|
|
1078
|
+
reason?: string;
|
|
1079
|
+
message?: string;
|
|
1080
|
+
};
|
|
1081
|
+
save: { phase: string; key?: string; reason?: string; message?: string };
|
|
1082
|
+
};
|
|
1083
|
+
|
|
1084
|
+
/** The report in the shape signaling's progress events have, which `restoreSnapshot` returns. */
|
|
1085
|
+
function macosSnapshotProgress(
|
|
1086
|
+
{ restore, save }: MacosSnapshotReport,
|
|
1087
|
+
restores: boolean,
|
|
1088
|
+
): MacosSnapshotProgress {
|
|
1089
|
+
if (!restores) {
|
|
1090
|
+
return {
|
|
1091
|
+
phase: save.phase,
|
|
1092
|
+
...(save.key && { key: save.key }),
|
|
1093
|
+
...(save.reason && { reason: save.reason }),
|
|
1094
|
+
...(save.message && { message: save.message }),
|
|
1095
|
+
};
|
|
1096
|
+
}
|
|
1097
|
+
return {
|
|
1098
|
+
phase: restore.phase,
|
|
1099
|
+
...(restore.key && { key: restore.key }),
|
|
1100
|
+
...(restore.matchKind && { matchKind: restore.matchKind }),
|
|
1101
|
+
...(restore.source && { source: restore.source }),
|
|
1102
|
+
...(restore.bytes && { totalBytes: restore.bytes, doneBytes: restore.doneBytes ?? 0 }),
|
|
1103
|
+
// A download that has not learned its total yet still reports its progress.
|
|
1104
|
+
...(!restore.bytes && restore.doneBytes && { doneBytes: restore.doneBytes }),
|
|
1105
|
+
...(restore.reason && { reason: restore.reason }),
|
|
1106
|
+
...(restore.message && { message: restore.message }),
|
|
1107
|
+
};
|
|
1108
|
+
}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
// Hand-written following the Stainless resource pattern; a future generation
|
|
2
|
-
// from the OpenAPI spec reconciles with this file.
|
|
3
|
-
|
|
4
1
|
import { APIResource } from '../core/resource';
|
|
5
2
|
import { APIPromise } from '../core/api-promise';
|
|
6
3
|
import { Items, type ItemsParams, PagePromise } from '../core/pagination';
|
|
@@ -181,10 +181,9 @@ export type XcodeProjectConfig = {
|
|
|
181
181
|
*/
|
|
182
182
|
runTests?: boolean;
|
|
183
183
|
/**
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
* test run.
|
|
184
|
+
* Keep the test run's result bundle, reported as
|
|
185
|
+
* ExecResult.xctest.resultBundle; fetch it with XcodeClient.pullResultBundle.
|
|
186
|
+
* Needs a testing action and a test run.
|
|
188
187
|
*/
|
|
189
188
|
resultBundle?: boolean;
|
|
190
189
|
/**
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.84.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.84.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.84.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.84.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|
package/src/lib/.keep
DELETED