@start9labs/start-sdk 0.3.6-alpha7 → 0.3.6-alpha8
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/cjs/lib/StartSdk.d.ts +2 -17
- package/cjs/lib/StartSdk.js +2 -8
- package/cjs/lib/StartSdk.js.map +1 -1
- package/cjs/lib/backup/Backups.js +2 -1
- package/cjs/lib/backup/Backups.js.map +1 -1
- package/cjs/lib/backup/setupBackups.d.ts +1 -1
- package/cjs/lib/backup/setupBackups.js +2 -1
- package/cjs/lib/backup/setupBackups.js.map +1 -1
- package/cjs/lib/config/setupConfig.js +2 -1
- package/cjs/lib/config/setupConfig.js.map +1 -1
- package/cjs/lib/exver/index.d.ts +2 -2
- package/cjs/lib/exver/index.js +1 -0
- package/cjs/lib/exver/index.js.map +1 -1
- package/cjs/lib/health/HealthCheck.js +2 -1
- package/cjs/lib/health/HealthCheck.js.map +1 -1
- package/cjs/lib/health/checkFns/checkWebUrl.js +2 -1
- package/cjs/lib/health/checkFns/checkWebUrl.js.map +1 -1
- package/cjs/lib/index.d.ts +1 -0
- package/cjs/lib/index.js +4 -0
- package/cjs/lib/index.js.map +1 -1
- package/cjs/lib/inits/migrations/Migration.d.ts +14 -27
- package/cjs/lib/inits/migrations/Migration.js +10 -3
- package/cjs/lib/inits/migrations/Migration.js.map +1 -1
- package/cjs/lib/inits/migrations/setupMigrations.d.ts +10 -5
- package/cjs/lib/inits/migrations/setupMigrations.js +90 -26
- package/cjs/lib/inits/migrations/setupMigrations.js.map +1 -1
- package/cjs/lib/inits/setupInit.d.ts +2 -2
- package/cjs/lib/inits/setupInit.js +29 -5
- package/cjs/lib/inits/setupInit.js.map +1 -1
- package/cjs/lib/inits/setupInstall.d.ts +1 -1
- package/cjs/lib/inits/setupInstall.js +4 -5
- package/cjs/lib/inits/setupInstall.js.map +1 -1
- package/cjs/lib/inits/setupUninstall.d.ts +1 -1
- package/cjs/lib/inits/setupUninstall.js +1 -1
- package/cjs/lib/inits/setupUninstall.js.map +1 -1
- package/cjs/lib/mainFn/CommandController.d.ts +7 -4
- package/cjs/lib/mainFn/CommandController.js +18 -8
- package/cjs/lib/mainFn/CommandController.js.map +1 -1
- package/cjs/lib/mainFn/Daemon.d.ts +4 -2
- package/cjs/lib/mainFn/Daemon.js +7 -2
- package/cjs/lib/mainFn/Daemon.js.map +1 -1
- package/cjs/lib/mainFn/Daemons.d.ts +2 -2
- package/cjs/lib/mainFn/HealthDaemon.d.ts +6 -3
- package/cjs/lib/mainFn/HealthDaemon.js +23 -35
- package/cjs/lib/mainFn/HealthDaemon.js.map +1 -1
- package/cjs/lib/manifest/ManifestTypes.d.ts +1 -10
- package/cjs/lib/manifest/setupManifest.d.ts +2 -2
- package/cjs/lib/manifest/setupManifest.js +6 -2
- package/cjs/lib/manifest/setupManifest.js.map +1 -1
- package/cjs/lib/osBindings/Manifest.d.ts +2 -0
- package/cjs/lib/osBindings/PackageDataEntry.d.ts +2 -0
- package/cjs/lib/osBindings/SetDataVersionParams.d.ts +3 -0
- package/cjs/lib/osBindings/SetDataVersionParams.js +4 -0
- package/cjs/lib/osBindings/SetDataVersionParams.js.map +1 -0
- package/cjs/lib/osBindings/index.d.ts +1 -3
- package/cjs/lib/s9pk/merkleArchive/varint.js +2 -1
- package/cjs/lib/s9pk/merkleArchive/varint.js.map +1 -1
- package/cjs/lib/test/configBuilder.test.js +7 -4
- package/cjs/lib/test/configBuilder.test.js.map +1 -1
- package/cjs/lib/test/graph.test.d.ts +1 -0
- package/cjs/lib/test/graph.test.js +78 -0
- package/cjs/lib/test/graph.test.js.map +1 -0
- package/cjs/lib/test/output.sdk.d.ts +2 -214
- package/cjs/lib/test/output.sdk.js +9 -3
- package/cjs/lib/test/output.sdk.js.map +1 -1
- package/cjs/lib/test/startosTypeValidation.test.js +2 -0
- package/cjs/lib/test/startosTypeValidation.test.js.map +1 -1
- package/cjs/lib/types.d.ts +18 -14
- package/cjs/lib/types.js.map +1 -1
- package/cjs/lib/util/Overlay.d.ts +39 -2
- package/cjs/lib/util/Overlay.js +38 -6
- package/cjs/lib/util/Overlay.js.map +1 -1
- package/cjs/lib/util/asError.d.ts +1 -0
- package/cjs/lib/util/asError.js +11 -0
- package/cjs/lib/util/asError.js.map +1 -0
- package/cjs/lib/util/graph.d.ts +19 -0
- package/cjs/lib/util/graph.js +206 -0
- package/cjs/lib/util/graph.js.map +1 -0
- package/cjs/lib/util/index.d.ts +1 -0
- package/cjs/lib/util/index.js +3 -1
- package/cjs/lib/util/index.js.map +1 -1
- package/cjs/lib/version/VersionGraph.d.ts +18 -0
- package/cjs/lib/version/VersionGraph.js +104 -0
- package/cjs/lib/version/VersionGraph.js.map +1 -0
- package/cjs/lib/version/VersionInfo.d.ts +44 -0
- package/cjs/lib/version/VersionInfo.js +48 -0
- package/cjs/lib/version/VersionInfo.js.map +1 -0
- package/cjs/lib/version/index.d.ts +2 -0
- package/cjs/lib/version/index.js +19 -0
- package/cjs/lib/version/index.js.map +1 -0
- package/cjs/lib/versionInfo/VersionInfo.d.ts +44 -0
- package/cjs/lib/versionInfo/VersionInfo.js +48 -0
- package/cjs/lib/versionInfo/VersionInfo.js.map +1 -0
- package/cjs/lib/versionInfo/setupVersionGraph.d.ts +19 -0
- package/cjs/lib/versionInfo/setupVersionGraph.js +108 -0
- package/cjs/lib/versionInfo/setupVersionGraph.js.map +1 -0
- package/mjs/lib/StartSdk.d.ts +2 -17
- package/mjs/lib/StartSdk.js +2 -8
- package/mjs/lib/StartSdk.js.map +1 -1
- package/mjs/lib/backup/Backups.js +2 -1
- package/mjs/lib/backup/Backups.js.map +1 -1
- package/mjs/lib/backup/setupBackups.d.ts +1 -1
- package/mjs/lib/backup/setupBackups.js +2 -1
- package/mjs/lib/backup/setupBackups.js.map +1 -1
- package/mjs/lib/config/setupConfig.js +1 -1
- package/mjs/lib/config/setupConfig.js.map +1 -1
- package/mjs/lib/exver/index.d.ts +2 -2
- package/mjs/lib/exver/index.js +1 -0
- package/mjs/lib/exver/index.js.map +1 -1
- package/mjs/lib/health/HealthCheck.js +2 -1
- package/mjs/lib/health/HealthCheck.js.map +1 -1
- package/mjs/lib/health/checkFns/checkWebUrl.js +2 -1
- package/mjs/lib/health/checkFns/checkWebUrl.js.map +1 -1
- package/mjs/lib/index.d.ts +1 -0
- package/mjs/lib/index.js +1 -0
- package/mjs/lib/index.js.map +1 -1
- package/mjs/lib/inits/migrations/Migration.d.ts +14 -27
- package/mjs/lib/inits/migrations/Migration.js +9 -2
- package/mjs/lib/inits/migrations/Migration.js.map +1 -1
- package/mjs/lib/inits/migrations/setupMigrations.d.ts +10 -5
- package/mjs/lib/inits/migrations/setupMigrations.js +92 -28
- package/mjs/lib/inits/migrations/setupMigrations.js.map +1 -1
- package/mjs/lib/inits/setupInit.d.ts +2 -2
- package/mjs/lib/inits/setupInit.js +29 -5
- package/mjs/lib/inits/setupInit.js.map +1 -1
- package/mjs/lib/inits/setupInstall.d.ts +1 -1
- package/mjs/lib/inits/setupInstall.js +4 -5
- package/mjs/lib/inits/setupInstall.js.map +1 -1
- package/mjs/lib/inits/setupUninstall.d.ts +1 -1
- package/mjs/lib/inits/setupUninstall.js +1 -1
- package/mjs/lib/inits/setupUninstall.js.map +1 -1
- package/mjs/lib/mainFn/CommandController.d.ts +7 -4
- package/mjs/lib/mainFn/CommandController.js +17 -9
- package/mjs/lib/mainFn/CommandController.js.map +1 -1
- package/mjs/lib/mainFn/Daemon.d.ts +4 -2
- package/mjs/lib/mainFn/Daemon.js +7 -3
- package/mjs/lib/mainFn/Daemon.js.map +1 -1
- package/mjs/lib/mainFn/Daemons.d.ts +2 -2
- package/mjs/lib/mainFn/HealthDaemon.d.ts +6 -3
- package/mjs/lib/mainFn/HealthDaemon.js +22 -21
- package/mjs/lib/mainFn/HealthDaemon.js.map +1 -1
- package/mjs/lib/manifest/ManifestTypes.d.ts +1 -10
- package/mjs/lib/manifest/setupManifest.d.ts +2 -2
- package/mjs/lib/manifest/setupManifest.js +6 -2
- package/mjs/lib/manifest/setupManifest.js.map +1 -1
- package/mjs/lib/osBindings/Manifest.d.ts +2 -0
- package/mjs/lib/osBindings/PackageDataEntry.d.ts +2 -0
- package/mjs/lib/osBindings/SetDataVersionParams.d.ts +3 -0
- package/mjs/lib/osBindings/SetDataVersionParams.js +3 -0
- package/mjs/lib/osBindings/SetDataVersionParams.js.map +1 -0
- package/mjs/lib/osBindings/index.d.ts +1 -3
- package/mjs/lib/s9pk/merkleArchive/varint.js +2 -1
- package/mjs/lib/s9pk/merkleArchive/varint.js.map +1 -1
- package/mjs/lib/test/configBuilder.test.js +7 -4
- package/mjs/lib/test/configBuilder.test.js.map +1 -1
- package/mjs/lib/test/graph.test.d.ts +1 -0
- package/mjs/lib/test/graph.test.js +76 -0
- package/mjs/lib/test/graph.test.js.map +1 -0
- package/mjs/lib/test/output.sdk.d.ts +2 -214
- package/mjs/lib/test/output.sdk.js +9 -3
- package/mjs/lib/test/output.sdk.js.map +1 -1
- package/mjs/lib/test/startosTypeValidation.test.js +2 -0
- package/mjs/lib/test/startosTypeValidation.test.js.map +1 -1
- package/mjs/lib/types.d.ts +18 -14
- package/mjs/lib/types.js.map +1 -1
- package/mjs/lib/util/Overlay.d.ts +39 -2
- package/mjs/lib/util/Overlay.js +37 -5
- package/mjs/lib/util/Overlay.js.map +1 -1
- package/mjs/lib/util/asError.d.ts +1 -0
- package/mjs/lib/util/asError.js +7 -0
- package/mjs/lib/util/asError.js.map +1 -0
- package/mjs/lib/util/graph.d.ts +19 -0
- package/mjs/lib/util/graph.js +201 -0
- package/mjs/lib/util/graph.js.map +1 -0
- package/mjs/lib/util/index.d.ts +1 -0
- package/mjs/lib/util/index.js +1 -0
- package/mjs/lib/util/index.js.map +1 -1
- package/mjs/lib/version/VersionGraph.d.ts +18 -0
- package/mjs/lib/version/VersionGraph.js +102 -0
- package/mjs/lib/version/VersionGraph.js.map +1 -0
- package/mjs/lib/version/VersionInfo.d.ts +44 -0
- package/mjs/lib/version/VersionInfo.js +45 -0
- package/mjs/lib/version/VersionInfo.js.map +1 -0
- package/mjs/lib/version/index.d.ts +2 -0
- package/mjs/lib/version/index.js +3 -0
- package/mjs/lib/version/index.js.map +1 -0
- package/mjs/lib/versionInfo/VersionInfo.d.ts +44 -0
- package/mjs/lib/versionInfo/VersionInfo.js +45 -0
- package/mjs/lib/versionInfo/VersionInfo.js.map +1 -0
- package/mjs/lib/versionInfo/setupVersionGraph.d.ts +19 -0
- package/mjs/lib/versionInfo/setupVersionGraph.js +105 -0
- package/mjs/lib/versionInfo/setupVersionGraph.js.map +1 -0
- package/mjs/lib/versionInfo/setupVersionInfo.d.ts +19 -0
- package/mjs/lib/versionInfo/setupVersionInfo.js +105 -0
- package/mjs/lib/versionInfo/setupVersionInfo.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
import { VersionGraph } from "../version/VersionGraph";
|
|
2
3
|
export type Manifest = any;
|
|
3
4
|
export declare const sdk: {
|
|
4
5
|
checkDependencies: <DependencyId extends string = string>(effects: import("../types").Effects, packageIds?: DependencyId[] | undefined) => Promise<import("../dependencies/dependencies").CheckDependencies<DependencyId>>;
|
|
@@ -78,8 +79,6 @@ export declare const sdk: {
|
|
|
78
79
|
}) => Promise<import("../types").ActionResult>) => import("../actions/createAction").CreatedAction<{
|
|
79
80
|
id: "testOutput";
|
|
80
81
|
title: string;
|
|
81
|
-
version: "1.0:0";
|
|
82
|
-
releaseNotes: string;
|
|
83
82
|
license: string;
|
|
84
83
|
replaces: never[];
|
|
85
84
|
wrapperRepo: string;
|
|
@@ -140,7 +139,6 @@ export declare const sdk: {
|
|
|
140
139
|
id: string;
|
|
141
140
|
description: string;
|
|
142
141
|
hasPrimary: boolean;
|
|
143
|
-
disabled: boolean;
|
|
144
142
|
type: import("../StartSdk").ServiceInterfaceType;
|
|
145
143
|
username: string | null;
|
|
146
144
|
path: string;
|
|
@@ -165,8 +163,6 @@ export declare const sdk: {
|
|
|
165
163
|
}> | import("../config/builder").Config<Type_1, never>) => import("../actions/createAction").CreatedAction<{
|
|
166
164
|
id: "testOutput";
|
|
167
165
|
title: string;
|
|
168
|
-
version: "1.0:0";
|
|
169
|
-
releaseNotes: string;
|
|
170
166
|
license: string;
|
|
171
167
|
replaces: never[];
|
|
172
168
|
wrapperRepo: string;
|
|
@@ -238,8 +234,6 @@ export declare const sdk: {
|
|
|
238
234
|
setupBackups: (...args: import("../backup/setupBackups").SetupBackupsParams<{
|
|
239
235
|
id: "testOutput";
|
|
240
236
|
title: string;
|
|
241
|
-
version: "1.0:0";
|
|
242
|
-
releaseNotes: string;
|
|
243
237
|
license: string;
|
|
244
238
|
replaces: never[];
|
|
245
239
|
wrapperRepo: string;
|
|
@@ -281,8 +275,6 @@ export declare const sdk: {
|
|
|
281
275
|
}>, Type_2 extends Record<string, any> = import("../config/builder/config").ExtractConfigType<ConfigType_2>>(spec: ConfigType_2, write: import("../config/setupConfig").Save<Type_2>, read: import("../config/setupConfig").Read<{
|
|
282
276
|
id: "testOutput";
|
|
283
277
|
title: string;
|
|
284
|
-
version: "1.0:0";
|
|
285
|
-
releaseNotes: string;
|
|
286
278
|
license: string;
|
|
287
279
|
replaces: never[];
|
|
288
280
|
wrapperRepo: string;
|
|
@@ -324,8 +316,6 @@ export declare const sdk: {
|
|
|
324
316
|
setupConfigRead: <ConfigSpec extends import("../config/builder").Config<Record<string, any>, any> | import("../config/builder").Config<Record<string, never>, never>>(_configSpec: ConfigSpec, fn: import("../config/setupConfig").Read<{
|
|
325
317
|
id: "testOutput";
|
|
326
318
|
title: string;
|
|
327
|
-
version: "1.0:0";
|
|
328
|
-
releaseNotes: string;
|
|
329
319
|
license: string;
|
|
330
320
|
replaces: never[];
|
|
331
321
|
wrapperRepo: string;
|
|
@@ -363,8 +353,6 @@ export declare const sdk: {
|
|
|
363
353
|
}, ConfigSpec>) => import("../config/setupConfig").Read<{
|
|
364
354
|
id: "testOutput";
|
|
365
355
|
title: string;
|
|
366
|
-
version: "1.0:0";
|
|
367
|
-
releaseNotes: string;
|
|
368
356
|
license: string;
|
|
369
357
|
replaces: never[];
|
|
370
358
|
wrapperRepo: string;
|
|
@@ -409,8 +397,6 @@ export declare const sdk: {
|
|
|
409
397
|
[x: string]: import("../dependencies/DependencyConfig").DependencyConfig<{
|
|
410
398
|
id: "testOutput";
|
|
411
399
|
title: string;
|
|
412
|
-
version: "1.0:0";
|
|
413
|
-
releaseNotes: string;
|
|
414
400
|
license: string;
|
|
415
401
|
replaces: never[];
|
|
416
402
|
wrapperRepo: string;
|
|
@@ -449,8 +435,6 @@ export declare const sdk: {
|
|
|
449
435
|
"remote-test": import("../dependencies/DependencyConfig").DependencyConfig<{
|
|
450
436
|
id: "testOutput";
|
|
451
437
|
title: string;
|
|
452
|
-
version: "1.0:0";
|
|
453
|
-
releaseNotes: string;
|
|
454
438
|
license: string;
|
|
455
439
|
replaces: never[];
|
|
456
440
|
wrapperRepo: string;
|
|
@@ -500,50 +484,9 @@ export declare const sdk: {
|
|
|
500
484
|
effects: import("../types").Effects;
|
|
501
485
|
input: Input_1;
|
|
502
486
|
}) => Promise<import("../config/setupConfig").DependenciesReceipt>;
|
|
503
|
-
setupInit: (
|
|
487
|
+
setupInit: (versions: VersionGraph<string>, install: import("../inits/setupInstall").Install<{
|
|
504
488
|
id: "testOutput";
|
|
505
489
|
title: string;
|
|
506
|
-
version: "1.0:0";
|
|
507
|
-
releaseNotes: string;
|
|
508
|
-
license: string;
|
|
509
|
-
replaces: never[];
|
|
510
|
-
wrapperRepo: string;
|
|
511
|
-
upstreamRepo: string;
|
|
512
|
-
supportSite: string;
|
|
513
|
-
marketingSite: string;
|
|
514
|
-
donationUrl: null;
|
|
515
|
-
description: {
|
|
516
|
-
short: string;
|
|
517
|
-
long: string;
|
|
518
|
-
};
|
|
519
|
-
containers: {};
|
|
520
|
-
images: {};
|
|
521
|
-
volumes: never[];
|
|
522
|
-
assets: never[];
|
|
523
|
-
alerts: {
|
|
524
|
-
install: null;
|
|
525
|
-
update: null;
|
|
526
|
-
uninstall: null;
|
|
527
|
-
restore: null;
|
|
528
|
-
start: null;
|
|
529
|
-
stop: null;
|
|
530
|
-
};
|
|
531
|
-
dependencies: {
|
|
532
|
-
"remote-test": {
|
|
533
|
-
description: string;
|
|
534
|
-
optional: false;
|
|
535
|
-
s9pk: string;
|
|
536
|
-
};
|
|
537
|
-
};
|
|
538
|
-
} & import("../osBindings").Manifest, {
|
|
539
|
-
storeRoot: {
|
|
540
|
-
storeLeaf: "value";
|
|
541
|
-
};
|
|
542
|
-
}>, install: import("../inits/setupInstall").Install<{
|
|
543
|
-
id: "testOutput";
|
|
544
|
-
title: string;
|
|
545
|
-
version: "1.0:0";
|
|
546
|
-
releaseNotes: string;
|
|
547
490
|
license: string;
|
|
548
491
|
replaces: never[];
|
|
549
492
|
wrapperRepo: string;
|
|
@@ -581,8 +524,6 @@ export declare const sdk: {
|
|
|
581
524
|
}>, uninstall: import("../inits/setupUninstall").Uninstall<{
|
|
582
525
|
id: "testOutput";
|
|
583
526
|
title: string;
|
|
584
|
-
version: "1.0:0";
|
|
585
|
-
releaseNotes: string;
|
|
586
527
|
license: string;
|
|
587
528
|
replaces: never[];
|
|
588
529
|
wrapperRepo: string;
|
|
@@ -620,8 +561,6 @@ export declare const sdk: {
|
|
|
620
561
|
}>, setInterfaces: import("../interfaces/setupInterfaces").SetInterfaces<{
|
|
621
562
|
id: "testOutput";
|
|
622
563
|
title: string;
|
|
623
|
-
version: "1.0:0";
|
|
624
|
-
releaseNotes: string;
|
|
625
564
|
license: string;
|
|
626
565
|
replaces: never[];
|
|
627
566
|
wrapperRepo: string;
|
|
@@ -666,8 +605,6 @@ export declare const sdk: {
|
|
|
666
605
|
setupInstall: (fn: import("../inits/setupInstall").InstallFn<{
|
|
667
606
|
id: "testOutput";
|
|
668
607
|
title: string;
|
|
669
|
-
version: "1.0:0";
|
|
670
|
-
releaseNotes: string;
|
|
671
608
|
license: string;
|
|
672
609
|
replaces: never[];
|
|
673
610
|
wrapperRepo: string;
|
|
@@ -705,8 +642,6 @@ export declare const sdk: {
|
|
|
705
642
|
}>) => import("../inits/setupInstall").Install<{
|
|
706
643
|
id: "testOutput";
|
|
707
644
|
title: string;
|
|
708
|
-
version: "1.0:0";
|
|
709
|
-
releaseNotes: string;
|
|
710
645
|
license: string;
|
|
711
646
|
replaces: never[];
|
|
712
647
|
wrapperRepo: string;
|
|
@@ -749,8 +684,6 @@ export declare const sdk: {
|
|
|
749
684
|
}>, fn: import("../interfaces/setupInterfaces").SetInterfaces<{
|
|
750
685
|
id: "testOutput";
|
|
751
686
|
title: string;
|
|
752
|
-
version: "1.0:0";
|
|
753
|
-
releaseNotes: string;
|
|
754
687
|
license: string;
|
|
755
688
|
replaces: never[];
|
|
756
689
|
wrapperRepo: string;
|
|
@@ -788,8 +721,6 @@ export declare const sdk: {
|
|
|
788
721
|
}, ConfigInput, Output>) => import("../interfaces/setupInterfaces").SetInterfaces<{
|
|
789
722
|
id: "testOutput";
|
|
790
723
|
title: string;
|
|
791
|
-
version: "1.0:0";
|
|
792
|
-
releaseNotes: string;
|
|
793
724
|
license: string;
|
|
794
725
|
replaces: never[];
|
|
795
726
|
wrapperRepo: string;
|
|
@@ -831,8 +762,6 @@ export declare const sdk: {
|
|
|
831
762
|
}) => Promise<import("..").Daemons<{
|
|
832
763
|
id: "testOutput";
|
|
833
764
|
title: string;
|
|
834
|
-
version: "1.0:0";
|
|
835
|
-
releaseNotes: string;
|
|
836
765
|
license: string;
|
|
837
766
|
replaces: never[];
|
|
838
767
|
wrapperRepo: string;
|
|
@@ -864,93 +793,12 @@ export declare const sdk: {
|
|
|
864
793
|
};
|
|
865
794
|
};
|
|
866
795
|
} & import("../osBindings").Manifest, any>>) => import("../types").ExpectedExports.main;
|
|
867
|
-
setupMigrations: <Migrations extends import("../inits/migrations/Migration").Migration<{
|
|
868
|
-
id: "testOutput";
|
|
869
|
-
title: string;
|
|
870
|
-
version: "1.0:0";
|
|
871
|
-
releaseNotes: string;
|
|
872
|
-
license: string;
|
|
873
|
-
replaces: never[];
|
|
874
|
-
wrapperRepo: string;
|
|
875
|
-
upstreamRepo: string;
|
|
876
|
-
supportSite: string;
|
|
877
|
-
marketingSite: string;
|
|
878
|
-
donationUrl: null;
|
|
879
|
-
description: {
|
|
880
|
-
short: string;
|
|
881
|
-
long: string;
|
|
882
|
-
};
|
|
883
|
-
containers: {};
|
|
884
|
-
images: {};
|
|
885
|
-
volumes: never[];
|
|
886
|
-
assets: never[];
|
|
887
|
-
alerts: {
|
|
888
|
-
install: null;
|
|
889
|
-
update: null;
|
|
890
|
-
uninstall: null;
|
|
891
|
-
restore: null;
|
|
892
|
-
start: null;
|
|
893
|
-
stop: null;
|
|
894
|
-
};
|
|
895
|
-
dependencies: {
|
|
896
|
-
"remote-test": {
|
|
897
|
-
description: string;
|
|
898
|
-
optional: false;
|
|
899
|
-
s9pk: string;
|
|
900
|
-
};
|
|
901
|
-
};
|
|
902
|
-
} & import("../osBindings").Manifest, {
|
|
903
|
-
storeRoot: {
|
|
904
|
-
storeLeaf: "value";
|
|
905
|
-
};
|
|
906
|
-
}, any>[]>(...migrations: import("../inits/migrations/setupMigrations").EnsureUniqueId<Migrations, Migrations, never>) => import("../inits/migrations/setupMigrations").Migrations<{
|
|
907
|
-
id: "testOutput";
|
|
908
|
-
title: string;
|
|
909
|
-
version: "1.0:0";
|
|
910
|
-
releaseNotes: string;
|
|
911
|
-
license: string;
|
|
912
|
-
replaces: never[];
|
|
913
|
-
wrapperRepo: string;
|
|
914
|
-
upstreamRepo: string;
|
|
915
|
-
supportSite: string;
|
|
916
|
-
marketingSite: string;
|
|
917
|
-
donationUrl: null;
|
|
918
|
-
description: {
|
|
919
|
-
short: string;
|
|
920
|
-
long: string;
|
|
921
|
-
};
|
|
922
|
-
containers: {};
|
|
923
|
-
images: {};
|
|
924
|
-
volumes: never[];
|
|
925
|
-
assets: never[];
|
|
926
|
-
alerts: {
|
|
927
|
-
install: null;
|
|
928
|
-
update: null;
|
|
929
|
-
uninstall: null;
|
|
930
|
-
restore: null;
|
|
931
|
-
start: null;
|
|
932
|
-
stop: null;
|
|
933
|
-
};
|
|
934
|
-
dependencies: {
|
|
935
|
-
"remote-test": {
|
|
936
|
-
description: string;
|
|
937
|
-
optional: false;
|
|
938
|
-
s9pk: string;
|
|
939
|
-
};
|
|
940
|
-
};
|
|
941
|
-
} & import("../osBindings").Manifest, {
|
|
942
|
-
storeRoot: {
|
|
943
|
-
storeLeaf: "value";
|
|
944
|
-
};
|
|
945
|
-
}>;
|
|
946
796
|
setupProperties: (fn: (options: {
|
|
947
797
|
effects: import("../types").Effects;
|
|
948
798
|
}) => Promise<import("../types").SdkPropertiesReturn>) => import("../types").ExpectedExports.properties;
|
|
949
799
|
setupUninstall: (fn: import("../inits/setupUninstall").UninstallFn<{
|
|
950
800
|
id: "testOutput";
|
|
951
801
|
title: string;
|
|
952
|
-
version: "1.0:0";
|
|
953
|
-
releaseNotes: string;
|
|
954
802
|
license: string;
|
|
955
803
|
replaces: never[];
|
|
956
804
|
wrapperRepo: string;
|
|
@@ -988,8 +836,6 @@ export declare const sdk: {
|
|
|
988
836
|
}>) => import("../inits/setupUninstall").Uninstall<{
|
|
989
837
|
id: "testOutput";
|
|
990
838
|
title: string;
|
|
991
|
-
version: "1.0:0";
|
|
992
|
-
releaseNotes: string;
|
|
993
839
|
license: string;
|
|
994
840
|
replaces: never[];
|
|
995
841
|
wrapperRepo: string;
|
|
@@ -1038,8 +884,6 @@ export declare const sdk: {
|
|
|
1038
884
|
of(): import("../mainFn/Mounts").Mounts<{
|
|
1039
885
|
id: "testOutput";
|
|
1040
886
|
title: string;
|
|
1041
|
-
version: "1.0:0";
|
|
1042
|
-
releaseNotes: string;
|
|
1043
887
|
license: string;
|
|
1044
888
|
replaces: never[];
|
|
1045
889
|
wrapperRepo: string;
|
|
@@ -1076,8 +920,6 @@ export declare const sdk: {
|
|
|
1076
920
|
volumes: (...volumeNames: never[]) => import("../backup/Backups").Backups<{
|
|
1077
921
|
id: "testOutput";
|
|
1078
922
|
title: string;
|
|
1079
|
-
version: "1.0:0";
|
|
1080
|
-
releaseNotes: string;
|
|
1081
923
|
license: string;
|
|
1082
924
|
replaces: never[];
|
|
1083
925
|
wrapperRepo: string;
|
|
@@ -1135,8 +977,6 @@ export declare const sdk: {
|
|
|
1135
977
|
}): import("..").Daemons<{
|
|
1136
978
|
id: "testOutput";
|
|
1137
979
|
title: string;
|
|
1138
|
-
version: "1.0:0";
|
|
1139
|
-
releaseNotes: string;
|
|
1140
980
|
license: string;
|
|
1141
981
|
replaces: never[];
|
|
1142
982
|
wrapperRepo: string;
|
|
@@ -1185,8 +1025,6 @@ export declare const sdk: {
|
|
|
1185
1025
|
}): import("../dependencies/DependencyConfig").DependencyConfig<{
|
|
1186
1026
|
id: "testOutput";
|
|
1187
1027
|
title: string;
|
|
1188
|
-
version: "1.0:0";
|
|
1189
|
-
releaseNotes: string;
|
|
1190
1028
|
license: string;
|
|
1191
1029
|
replaces: never[];
|
|
1192
1030
|
wrapperRepo: string;
|
|
@@ -1272,56 +1110,6 @@ export declare const sdk: {
|
|
|
1272
1110
|
};
|
|
1273
1111
|
}>;
|
|
1274
1112
|
};
|
|
1275
|
-
Migration: {
|
|
1276
|
-
of: <Version extends string>(options: {
|
|
1277
|
-
version: Version & import("../exver").ValidateExVer<Version>;
|
|
1278
|
-
up: (opts: {
|
|
1279
|
-
effects: import("../types").Effects;
|
|
1280
|
-
}) => Promise<void>;
|
|
1281
|
-
down: (opts: {
|
|
1282
|
-
effects: import("../types").Effects;
|
|
1283
|
-
}) => Promise<void>;
|
|
1284
|
-
}) => import("../inits/migrations/Migration").Migration<{
|
|
1285
|
-
id: "testOutput";
|
|
1286
|
-
title: string;
|
|
1287
|
-
version: "1.0:0";
|
|
1288
|
-
releaseNotes: string;
|
|
1289
|
-
license: string;
|
|
1290
|
-
replaces: never[];
|
|
1291
|
-
wrapperRepo: string;
|
|
1292
|
-
upstreamRepo: string;
|
|
1293
|
-
supportSite: string;
|
|
1294
|
-
marketingSite: string;
|
|
1295
|
-
donationUrl: null;
|
|
1296
|
-
description: {
|
|
1297
|
-
short: string;
|
|
1298
|
-
long: string;
|
|
1299
|
-
};
|
|
1300
|
-
containers: {};
|
|
1301
|
-
images: {};
|
|
1302
|
-
volumes: never[];
|
|
1303
|
-
assets: never[];
|
|
1304
|
-
alerts: {
|
|
1305
|
-
install: null;
|
|
1306
|
-
update: null;
|
|
1307
|
-
uninstall: null;
|
|
1308
|
-
restore: null;
|
|
1309
|
-
start: null;
|
|
1310
|
-
stop: null;
|
|
1311
|
-
};
|
|
1312
|
-
dependencies: {
|
|
1313
|
-
"remote-test": {
|
|
1314
|
-
description: string;
|
|
1315
|
-
optional: false;
|
|
1316
|
-
s9pk: string;
|
|
1317
|
-
};
|
|
1318
|
-
};
|
|
1319
|
-
} & import("../osBindings").Manifest, {
|
|
1320
|
-
storeRoot: {
|
|
1321
|
-
storeLeaf: "value";
|
|
1322
|
-
};
|
|
1323
|
-
}, Version>;
|
|
1324
|
-
};
|
|
1325
1113
|
StorePath: import("../store/PathBuilder").PathBuilder<{
|
|
1326
1114
|
storeRoot: {
|
|
1327
1115
|
storeLeaf: "value";
|
|
@@ -3,12 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.sdk = void 0;
|
|
4
4
|
const StartSdk_1 = require("../StartSdk");
|
|
5
5
|
const setupManifest_1 = require("../manifest/setupManifest");
|
|
6
|
+
const VersionInfo_1 = require("../version/VersionInfo");
|
|
7
|
+
const VersionGraph_1 = require("../version/VersionGraph");
|
|
6
8
|
exports.sdk = StartSdk_1.StartSdk.of()
|
|
7
|
-
.withManifest((0, setupManifest_1.setupManifest)({
|
|
9
|
+
.withManifest((0, setupManifest_1.setupManifest)(VersionGraph_1.VersionGraph.of(VersionInfo_1.VersionInfo.of({
|
|
10
|
+
version: "1.0.0:0",
|
|
11
|
+
releaseNotes: "",
|
|
12
|
+
migrations: {},
|
|
13
|
+
})
|
|
14
|
+
.satisfies("#other:1.0.0:0")
|
|
15
|
+
.satisfies("#other:2.0.0:0")), {
|
|
8
16
|
id: "testOutput",
|
|
9
17
|
title: "",
|
|
10
|
-
version: "1.0:0",
|
|
11
|
-
releaseNotes: "",
|
|
12
18
|
license: "",
|
|
13
19
|
replaces: [],
|
|
14
20
|
wrapperRepo: "",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.sdk.js","sourceRoot":"","sources":["../../../../lib/test/output.sdk.ts"],"names":[],"mappings":";;;AAAA,0CAAsC;AACtC,6DAAyD;
|
|
1
|
+
{"version":3,"file":"output.sdk.js","sourceRoot":"","sources":["../../../../lib/test/output.sdk.ts"],"names":[],"mappings":";;;AAAA,0CAAsC;AACtC,6DAAyD;AACzD,wDAAoD;AACpD,0DAAsD;AAGzC,QAAA,GAAG,GAAG,mBAAQ,CAAC,EAAE,EAAE;KAC7B,YAAY,CACX,IAAA,6BAAa,EACX,2BAAY,CAAC,EAAE,CACb,yBAAW,CAAC,EAAE,CAAC;IACb,OAAO,EAAE,SAAS;IAClB,YAAY,EAAE,EAAE;IAChB,UAAU,EAAE,EAAE;CACf,CAAC;KACC,SAAS,CAAC,gBAAgB,CAAC;KAC3B,SAAS,CAAC,gBAAgB,CAAC,CAC/B,EACD;IACE,EAAE,EAAE,YAAY;IAChB,KAAK,EAAE,EAAE;IACT,OAAO,EAAE,EAAE;IACX,QAAQ,EAAE,EAAE;IACZ,WAAW,EAAE,EAAE;IACf,YAAY,EAAE,EAAE;IAChB,WAAW,EAAE,EAAE;IACf,aAAa,EAAE,EAAE;IACjB,WAAW,EAAE,IAAI;IACjB,WAAW,EAAE;QACX,KAAK,EAAE,EAAE;QACT,IAAI,EAAE,EAAE;KACT;IACD,UAAU,EAAE,EAAE;IACd,MAAM,EAAE,EAAE;IACV,OAAO,EAAE,EAAE;IACX,MAAM,EAAE,EAAE;IACV,MAAM,EAAE;QACN,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,IAAI;QACZ,SAAS,EAAE,IAAI;QACf,OAAO,EAAE,IAAI;QACb,KAAK,EAAE,IAAI;QACX,IAAI,EAAE,IAAI;KACX;IACD,YAAY,EAAE;QACZ,aAAa,EAAE;YACb,WAAW,EAAE,EAAE;YACf,QAAQ,EAAE,KAAK;YACf,IAAI,EAAE,sCAAsC;SAC7C;KACF;CACF,CACF,CACF;KACA,SAAS,EAAyC;KAClD,KAAK,CAAC,IAAI,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startosTypeValidation.test.js","sourceRoot":"","sources":["../../../../lib/test/startosTypeValidation.test.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"startosTypeValidation.test.js","sourceRoot":"","sources":["../../../../lib/test/startosTypeValidation.test.ts"],"names":[],"mappings":";;AA0BA,SAAS,YAAY,CAAe,EAAgB,IAAG,CAAC;AAIxD,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,IAAI,CAAC,2BAA2B,EAAE,GAAG,EAAE;QACrC,MAAM,SAAS,GAAQ,EAAE,CAAA;QACzB,YAAY,CAIT;YACD,aAAa,EAAE,EAAmB;YAClC,oBAAoB,EAAE,EAAgC;YACtD,qBAAqB,EAAE,EAAiC;YACxD,aAAa,EAAE,SAAS;YACxB,oBAAoB,EAAE,SAAS;YAC/B,IAAI,EAAE,EAAgB;YACtB,WAAW,EAAE,EAAqC;YAClD,aAAa,EAAE,EAAyB;YACxC,OAAO,EAAE,SAAS;YAClB,QAAQ,EAAE,SAAS;YACnB,aAAa,EAAE,EAAmB;YAClC,cAAc,EAAE,EAA0B;YAC1C,cAAc,EAAE,SAAS;YACzB,SAAS,EAAE,EAAe;YAC1B,mBAAmB,EAAE,EAA+B;YACpD,iBAAiB,EAAE,EAA2C;YAC9D,SAAS,EAAE,EAAqB;YAChC,mBAAmB,EAAE,EAA6C;YAClE,eAAe,EAAE,EAA2B;YAC5C,KAAK,EAAE,EAAW;YAClB,aAAa,EAAE,EAAuC;YACtD,cAAc,EAAE,SAAS;YACzB,qBAAqB,EAAE,EAAiC;YACxD,sBAAsB,EAAE,SAAS;YACjC,sBAAsB,EAAE,EAAkC;YAC1D,aAAa,EAAE,EAAuC;YACtD,qBAAqB,EAAE,EAA+C;YACtE,YAAY,EAAE,EAAwB;YACtC,YAAY,EAAE,SAAS;YACvB,KAAK,EAAE,EAAiB;YACxB,iBAAiB,EAAE,EAA4B;YAC/C,eAAe,EAAE,SAAS;YAC1B,aAAa,EAAE,EAAmB;SACnC,CAAC,CAAA;QACF,YAAY,CACV,SAA0B,CAC3B,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
package/cjs/lib/types.d.ts
CHANGED
|
@@ -78,7 +78,6 @@ export declare namespace ExpectedExports {
|
|
|
78
78
|
*/
|
|
79
79
|
type init = (options: {
|
|
80
80
|
effects: Effects;
|
|
81
|
-
previousVersion: null | string;
|
|
82
81
|
}) => Promise<unknown>;
|
|
83
82
|
/** This will be ran during any time a package is uninstalled, for example during a update
|
|
84
83
|
* this will be called.
|
|
@@ -215,15 +214,15 @@ export type SdkPropertiesValue = {
|
|
|
215
214
|
description?: string;
|
|
216
215
|
} | {
|
|
217
216
|
type: "string";
|
|
218
|
-
/**
|
|
217
|
+
/** The value to display to the user */
|
|
219
218
|
value: string;
|
|
220
219
|
/** A human readable description or explanation of the value */
|
|
221
220
|
description?: string;
|
|
222
|
-
/**
|
|
221
|
+
/** Whether or not to mask the value, for example, when displaying a password */
|
|
223
222
|
masked: boolean;
|
|
224
|
-
/**
|
|
223
|
+
/** Whether or not to include a button for copying the value to clipboard */
|
|
225
224
|
copyable?: boolean;
|
|
226
|
-
/**
|
|
225
|
+
/** Whether or not to include a button for displaying the value as a QR code */
|
|
227
226
|
qr?: boolean;
|
|
228
227
|
};
|
|
229
228
|
export type SdkPropertiesReturn = {
|
|
@@ -237,15 +236,15 @@ export type PropertiesValue = {
|
|
|
237
236
|
description: string | null;
|
|
238
237
|
} | {
|
|
239
238
|
type: "string";
|
|
240
|
-
/**
|
|
239
|
+
/** The value to display to the user */
|
|
241
240
|
value: string;
|
|
242
241
|
/** A human readable description or explanation of the value */
|
|
243
242
|
description: string | null;
|
|
244
|
-
/**
|
|
243
|
+
/** Whether or not to mask the value, for example, when displaying a password */
|
|
245
244
|
masked: boolean;
|
|
246
|
-
/**
|
|
245
|
+
/** Whether or not to include a button for copying the value to clipboard */
|
|
247
246
|
copyable: boolean | null;
|
|
248
|
-
/**
|
|
247
|
+
/** Whether or not to include a button for displaying the value as a QR code */
|
|
249
248
|
qr: boolean | null;
|
|
250
249
|
};
|
|
251
250
|
export type PropertiesReturn = {
|
|
@@ -382,6 +381,12 @@ export type Effects = {
|
|
|
382
381
|
value: ExtractStore;
|
|
383
382
|
}): Promise<void>;
|
|
384
383
|
};
|
|
384
|
+
/** sets the version that this service's data has been migrated to */
|
|
385
|
+
setDataVersion(options: {
|
|
386
|
+
version: string;
|
|
387
|
+
}): Promise<void>;
|
|
388
|
+
/** returns the version that this service's data has been migrated to */
|
|
389
|
+
getDataVersion(): Promise<string | null>;
|
|
385
390
|
/** Returns globally configured SMTP settings, if they exist */
|
|
386
391
|
getSystemSmtp(options: {
|
|
387
392
|
callback?: () => void;
|
|
@@ -416,12 +421,11 @@ export type MigrationRes = {
|
|
|
416
421
|
configured: boolean;
|
|
417
422
|
};
|
|
418
423
|
export type ActionResult = {
|
|
424
|
+
version: "0";
|
|
419
425
|
message: string;
|
|
420
|
-
value:
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
qr: boolean;
|
|
424
|
-
};
|
|
426
|
+
value: string | null;
|
|
427
|
+
copyable: boolean;
|
|
428
|
+
qr: boolean;
|
|
425
429
|
};
|
|
426
430
|
export type SetResult = {
|
|
427
431
|
dependsOn: DependsOn;
|
package/cjs/lib/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../lib/types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oEAAmD;AA2BnD,+CAA4B;AAU5B,IAAiB,eAAe,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../lib/types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oEAAmD;AA2BnD,+CAA4B;AAU5B,IAAiB,eAAe,CAsF/B;AAtFD,WAAiB,eAAe;IAC9B,OAAO,EAAE,CAAC,CAAA;AAqFZ,CAAC,EAtFgB,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAsF/B"}
|
|
@@ -5,11 +5,35 @@ import * as T from "../types";
|
|
|
5
5
|
import * as cp from "child_process";
|
|
6
6
|
import { Buffer } from "node:buffer";
|
|
7
7
|
export declare const execFile: typeof cp.execFile.__promisify__;
|
|
8
|
-
|
|
8
|
+
type ExecResults = {
|
|
9
|
+
exitCode: number | null;
|
|
10
|
+
exitSignal: NodeJS.Signals | null;
|
|
11
|
+
stdout: string | Buffer;
|
|
12
|
+
stderr: string | Buffer;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* This is the type that is going to describe what an overlay could do. The main point of the
|
|
16
|
+
* overlay is to have commands that run in a chrooted environment. This is useful for running
|
|
17
|
+
* commands in a containerized environment. But, I wanted the destroy to sometimes be doable, for example the
|
|
18
|
+
* case where the overlay isn't owned by the process, the overlay shouldn't be destroyed.
|
|
19
|
+
*/
|
|
20
|
+
export interface ExecSpawnable {
|
|
21
|
+
get destroy(): undefined | (() => Promise<void>);
|
|
22
|
+
exec(command: string[], options?: CommandOptions, timeoutMs?: number | null): Promise<ExecResults>;
|
|
23
|
+
spawn(command: string[], options?: CommandOptions): Promise<cp.ChildProcessWithoutNullStreams>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Want to limit what we can do in a container, so we want to launch a container with a specific image and the mounts.
|
|
27
|
+
*
|
|
28
|
+
* Implements:
|
|
29
|
+
* @see {@link ExecSpawnable}
|
|
30
|
+
*/
|
|
31
|
+
export declare class Overlay implements ExecSpawnable {
|
|
9
32
|
readonly effects: T.Effects;
|
|
10
33
|
readonly imageId: T.ImageId;
|
|
11
34
|
readonly rootfs: string;
|
|
12
35
|
readonly guid: T.Guid;
|
|
36
|
+
private destroyed;
|
|
13
37
|
private constructor();
|
|
14
38
|
static of(effects: T.Effects, image: {
|
|
15
39
|
id: T.ImageId;
|
|
@@ -23,7 +47,7 @@ export declare class Overlay {
|
|
|
23
47
|
path: string;
|
|
24
48
|
}[], fn: (overlay: Overlay) => Promise<T>): Promise<T>;
|
|
25
49
|
mount(options: MountOptions, path: string): Promise<Overlay>;
|
|
26
|
-
destroy(): Promise<void>;
|
|
50
|
+
get destroy(): () => Promise<void>;
|
|
27
51
|
exec(command: string[], options?: CommandOptions, timeoutMs?: number | null): Promise<{
|
|
28
52
|
exitCode: number | null;
|
|
29
53
|
exitSignal: NodeJS.Signals | null;
|
|
@@ -32,6 +56,18 @@ export declare class Overlay {
|
|
|
32
56
|
}>;
|
|
33
57
|
spawn(command: string[], options?: CommandOptions): Promise<cp.ChildProcessWithoutNullStreams>;
|
|
34
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Take an overlay but remove the ability to add the mounts and the destroy function.
|
|
61
|
+
* Lets other functions, like health checks, to not destroy the parents.
|
|
62
|
+
*
|
|
63
|
+
*/
|
|
64
|
+
export declare class NonDestroyableOverlay implements ExecSpawnable {
|
|
65
|
+
private overlay;
|
|
66
|
+
constructor(overlay: ExecSpawnable);
|
|
67
|
+
get destroy(): undefined;
|
|
68
|
+
exec(command: string[], options?: CommandOptions, timeoutMs?: number | null): Promise<ExecResults>;
|
|
69
|
+
spawn(command: string[], options?: CommandOptions): Promise<cp.ChildProcessWithoutNullStreams>;
|
|
70
|
+
}
|
|
35
71
|
export type CommandOptions = {
|
|
36
72
|
env?: {
|
|
37
73
|
[variable: string]: string;
|
|
@@ -62,3 +98,4 @@ export type MountOptionsBackup = {
|
|
|
62
98
|
type: "backup";
|
|
63
99
|
subpath: string | null;
|
|
64
100
|
};
|
|
101
|
+
export {};
|
package/cjs/lib/util/Overlay.js
CHANGED
|
@@ -23,19 +23,26 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.Overlay = exports.execFile = void 0;
|
|
26
|
+
exports.NonDestroyableOverlay = exports.Overlay = exports.execFile = void 0;
|
|
27
27
|
const fs = __importStar(require("fs/promises"));
|
|
28
28
|
const cp = __importStar(require("child_process"));
|
|
29
29
|
const util_1 = require("util");
|
|
30
30
|
const node_buffer_1 = require("node:buffer");
|
|
31
31
|
exports.execFile = (0, util_1.promisify)(cp.execFile);
|
|
32
32
|
const WORKDIR = (imageId) => `/media/startos/images/${imageId}/`;
|
|
33
|
+
/**
|
|
34
|
+
* Want to limit what we can do in a container, so we want to launch a container with a specific image and the mounts.
|
|
35
|
+
*
|
|
36
|
+
* Implements:
|
|
37
|
+
* @see {@link ExecSpawnable}
|
|
38
|
+
*/
|
|
33
39
|
class Overlay {
|
|
34
40
|
constructor(effects, imageId, rootfs, guid) {
|
|
35
41
|
this.effects = effects;
|
|
36
42
|
this.imageId = imageId;
|
|
37
43
|
this.rootfs = rootfs;
|
|
38
44
|
this.guid = guid;
|
|
45
|
+
this.destroyed = false;
|
|
39
46
|
}
|
|
40
47
|
static async of(effects, image) {
|
|
41
48
|
const { id, sharedRun } = image;
|
|
@@ -81,7 +88,7 @@ class Overlay {
|
|
|
81
88
|
const from = `/media/startos/volumes/${options.id}${subpath}`;
|
|
82
89
|
await fs.mkdir(from, { recursive: true });
|
|
83
90
|
await fs.mkdir(path, { recursive: true });
|
|
84
|
-
await
|
|
91
|
+
await (0, exports.execFile)("mount", ["--bind", from, path]);
|
|
85
92
|
}
|
|
86
93
|
else if (options.type === "assets") {
|
|
87
94
|
const subpath = options.subpath
|
|
@@ -113,10 +120,15 @@ class Overlay {
|
|
|
113
120
|
}
|
|
114
121
|
return this;
|
|
115
122
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
123
|
+
get destroy() {
|
|
124
|
+
return async () => {
|
|
125
|
+
if (this.destroyed)
|
|
126
|
+
return;
|
|
127
|
+
this.destroyed = true;
|
|
128
|
+
const imageId = this.imageId;
|
|
129
|
+
const guid = this.guid;
|
|
130
|
+
await this.effects.destroyOverlayedImage({ guid });
|
|
131
|
+
};
|
|
120
132
|
}
|
|
121
133
|
async exec(command, options, timeoutMs = 30000) {
|
|
122
134
|
const imageMeta = await fs
|
|
@@ -203,4 +215,24 @@ class Overlay {
|
|
|
203
215
|
}
|
|
204
216
|
}
|
|
205
217
|
exports.Overlay = Overlay;
|
|
218
|
+
/**
|
|
219
|
+
* Take an overlay but remove the ability to add the mounts and the destroy function.
|
|
220
|
+
* Lets other functions, like health checks, to not destroy the parents.
|
|
221
|
+
*
|
|
222
|
+
*/
|
|
223
|
+
class NonDestroyableOverlay {
|
|
224
|
+
constructor(overlay) {
|
|
225
|
+
this.overlay = overlay;
|
|
226
|
+
}
|
|
227
|
+
get destroy() {
|
|
228
|
+
return undefined;
|
|
229
|
+
}
|
|
230
|
+
exec(command, options, timeoutMs) {
|
|
231
|
+
return this.overlay.exec(command, options, timeoutMs);
|
|
232
|
+
}
|
|
233
|
+
spawn(command, options) {
|
|
234
|
+
return this.overlay.spawn(command, options);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
exports.NonDestroyableOverlay = NonDestroyableOverlay;
|
|
206
238
|
//# sourceMappingURL=Overlay.js.map
|