@start9labs/start-sdk 0.4.0-beta.3 → 0.4.0-beta.31

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 (224) hide show
  1. package/base/lib/Effects.d.ts +8 -34
  2. package/base/lib/actions/index.d.ts +13 -14
  3. package/base/lib/actions/index.js +4 -4
  4. package/base/lib/actions/index.js.map +1 -1
  5. package/base/lib/actions/input/builder/inputSpec.d.ts +15 -26
  6. package/base/lib/actions/input/builder/inputSpec.js +10 -27
  7. package/base/lib/actions/input/builder/inputSpec.js.map +1 -1
  8. package/base/lib/actions/input/builder/list.d.ts +12 -24
  9. package/base/lib/actions/input/builder/list.js +19 -33
  10. package/base/lib/actions/input/builder/list.js.map +1 -1
  11. package/base/lib/actions/input/builder/value.d.ts +331 -70
  12. package/base/lib/actions/input/builder/value.js +505 -188
  13. package/base/lib/actions/input/builder/value.js.map +1 -1
  14. package/base/lib/actions/input/builder/variants.d.ts +11 -23
  15. package/base/lib/actions/input/builder/variants.js +16 -26
  16. package/base/lib/actions/input/builder/variants.js.map +1 -1
  17. package/base/lib/actions/input/inputSpecConstants.d.ts +6 -6
  18. package/base/lib/actions/input/inputSpecConstants.js +29 -26
  19. package/base/lib/actions/input/inputSpecConstants.js.map +1 -1
  20. package/base/lib/actions/setupActions.d.ts +19 -15
  21. package/base/lib/actions/setupActions.js +37 -14
  22. package/base/lib/actions/setupActions.js.map +1 -1
  23. package/base/lib/dependencies/dependencies.d.ts +2 -2
  24. package/base/lib/dependencies/dependencies.js +23 -15
  25. package/base/lib/dependencies/dependencies.js.map +1 -1
  26. package/base/lib/dependencies/setupDependencies.d.ts +1 -3
  27. package/base/lib/dependencies/setupDependencies.js +3 -12
  28. package/base/lib/dependencies/setupDependencies.js.map +1 -1
  29. package/base/lib/index.d.ts +1 -0
  30. package/base/lib/index.js +2 -1
  31. package/base/lib/index.js.map +1 -1
  32. package/base/lib/inits/index.d.ts +2 -0
  33. package/base/lib/inits/index.js +19 -0
  34. package/base/lib/inits/index.js.map +1 -0
  35. package/base/lib/inits/setupInit.d.ts +9 -0
  36. package/base/lib/inits/setupInit.js +40 -0
  37. package/base/lib/inits/setupInit.js.map +1 -0
  38. package/base/lib/inits/setupUninit.d.ts +25 -0
  39. package/base/lib/inits/setupUninit.js +24 -0
  40. package/base/lib/inits/setupUninit.js.map +1 -0
  41. package/base/lib/interfaces/Host.js +18 -6
  42. package/base/lib/interfaces/Host.js.map +1 -1
  43. package/base/lib/interfaces/Origin.d.ts +2 -2
  44. package/base/lib/interfaces/Origin.js +3 -3
  45. package/base/lib/interfaces/Origin.js.map +1 -1
  46. package/base/lib/interfaces/ServiceInterfaceBuilder.d.ts +2 -2
  47. package/base/lib/interfaces/setupInterfaces.d.ts +2 -4
  48. package/base/lib/interfaces/setupInterfaces.js +8 -19
  49. package/base/lib/interfaces/setupInterfaces.js.map +1 -1
  50. package/base/lib/osBindings/AddCategoryParams.d.ts +0 -2
  51. package/base/lib/osBindings/AddPackageToCategoryParams.d.ts +5 -0
  52. package/base/lib/osBindings/AddPackageToCategoryParams.js +3 -0
  53. package/base/lib/osBindings/AddPackageToCategoryParams.js.map +1 -0
  54. package/base/lib/osBindings/AttachParams.d.ts +1 -0
  55. package/base/lib/osBindings/Category.d.ts +0 -2
  56. package/base/lib/osBindings/Category.js +1 -0
  57. package/base/lib/osBindings/Category.js.map +1 -1
  58. package/base/lib/osBindings/CheckDependenciesResult.d.ts +3 -3
  59. package/base/lib/osBindings/ClearTasksParams.d.ts +5 -0
  60. package/base/lib/osBindings/{UnsetPublicParams.js → ClearTasksParams.js} +1 -1
  61. package/base/lib/osBindings/ClearTasksParams.js.map +1 -0
  62. package/base/lib/osBindings/CreateTaskParams.d.ts +15 -0
  63. package/base/lib/osBindings/CreateTaskParams.js +3 -0
  64. package/base/lib/osBindings/CreateTaskParams.js.map +1 -0
  65. package/base/lib/osBindings/FileType.d.ts +1 -0
  66. package/base/lib/osBindings/{NetworkInterfaceSetPublicParams.js → FileType.js} +1 -1
  67. package/base/lib/osBindings/FileType.js.map +1 -0
  68. package/base/lib/osBindings/GetOsVersionParams.d.ts +3 -3
  69. package/base/lib/osBindings/GetPackageParams.d.ts +1 -1
  70. package/base/lib/osBindings/MainStatus.d.ts +0 -2
  71. package/base/lib/osBindings/Manifest.d.ts +1 -0
  72. package/base/lib/osBindings/MountTarget.d.ts +2 -0
  73. package/base/lib/osBindings/PackageDataEntry.d.ts +4 -5
  74. package/base/lib/osBindings/Progress.d.ts +2 -0
  75. package/base/lib/osBindings/Progress.js +0 -1
  76. package/base/lib/osBindings/Progress.js.map +1 -1
  77. package/base/lib/osBindings/ProgressUnits.d.ts +1 -0
  78. package/base/lib/osBindings/ProgressUnits.js +4 -0
  79. package/base/lib/osBindings/ProgressUnits.js.map +1 -0
  80. package/base/lib/osBindings/Proxies.d.ts +4 -0
  81. package/base/lib/osBindings/Proxies.js +3 -0
  82. package/base/lib/osBindings/Proxies.js.map +1 -0
  83. package/base/lib/osBindings/ProxyInfo.d.ts +4 -0
  84. package/base/lib/osBindings/ProxyInfo.js +4 -0
  85. package/base/lib/osBindings/ProxyInfo.js.map +1 -0
  86. package/base/lib/osBindings/RemoveAdminParams.d.ts +4 -0
  87. package/base/lib/osBindings/RemoveAdminParams.js +3 -0
  88. package/base/lib/osBindings/RemoveAdminParams.js.map +1 -0
  89. package/base/lib/osBindings/RemoveAssetParams.d.ts +4 -0
  90. package/base/lib/osBindings/RemoveAssetParams.js +4 -0
  91. package/base/lib/osBindings/RemoveAssetParams.js.map +1 -0
  92. package/base/lib/osBindings/RemovePackageFromCategoryParams.d.ts +5 -0
  93. package/base/lib/osBindings/RemovePackageFromCategoryParams.js +3 -0
  94. package/base/lib/osBindings/RemovePackageFromCategoryParams.js.map +1 -0
  95. package/base/lib/osBindings/RemovePackageParams.d.ts +6 -0
  96. package/base/lib/osBindings/RemovePackageParams.js +3 -0
  97. package/base/lib/osBindings/RemovePackageParams.js.map +1 -0
  98. package/base/lib/osBindings/ServerInfo.d.ts +1 -0
  99. package/base/lib/osBindings/SetupExecuteParams.d.ts +1 -0
  100. package/base/lib/osBindings/Task.d.ts +13 -0
  101. package/base/lib/osBindings/Task.js +3 -0
  102. package/base/lib/osBindings/Task.js.map +1 -0
  103. package/base/lib/osBindings/TaskCondition.d.ts +1 -0
  104. package/base/lib/osBindings/TaskCondition.js +4 -0
  105. package/base/lib/osBindings/TaskCondition.js.map +1 -0
  106. package/base/lib/osBindings/TaskEntry.d.ts +5 -0
  107. package/base/lib/osBindings/TaskEntry.js +3 -0
  108. package/base/lib/osBindings/TaskEntry.js.map +1 -0
  109. package/base/lib/osBindings/TaskInput.d.ts +4 -0
  110. package/base/lib/osBindings/TaskInput.js +4 -0
  111. package/base/lib/osBindings/TaskInput.js.map +1 -0
  112. package/base/lib/osBindings/TaskSeverity.d.ts +1 -0
  113. package/base/lib/osBindings/TaskSeverity.js +4 -0
  114. package/base/lib/osBindings/TaskSeverity.js.map +1 -0
  115. package/base/lib/osBindings/TaskTrigger.d.ts +5 -0
  116. package/base/lib/osBindings/TaskTrigger.js +3 -0
  117. package/base/lib/osBindings/TaskTrigger.js.map +1 -0
  118. package/base/lib/osBindings/index.d.ts +15 -11
  119. package/base/lib/s9pk/index.js +5 -7
  120. package/base/lib/s9pk/index.js.map +1 -1
  121. package/base/lib/types.d.ts +22 -33
  122. package/base/lib/types.js +13 -0
  123. package/base/lib/types.js.map +1 -1
  124. package/base/lib/util/GetSystemSmtp.d.ts +4 -0
  125. package/base/lib/util/GetSystemSmtp.js +32 -2
  126. package/base/lib/util/GetSystemSmtp.js.map +1 -1
  127. package/base/lib/util/getServiceInterface.d.ts +14 -0
  128. package/base/lib/util/getServiceInterface.js +70 -1
  129. package/base/lib/util/getServiceInterface.js.map +1 -1
  130. package/base/lib/util/getServiceInterfaces.d.ts +4 -0
  131. package/base/lib/util/getServiceInterfaces.js +34 -1
  132. package/base/lib/util/getServiceInterfaces.js.map +1 -1
  133. package/base/lib/util/index.d.ts +0 -1
  134. package/base/lib/util/index.js +1 -3
  135. package/base/lib/util/index.js.map +1 -1
  136. package/package/lib/StartSdk.d.ts +108 -570
  137. package/package/lib/StartSdk.js +112 -428
  138. package/package/lib/StartSdk.js.map +1 -1
  139. package/package/lib/backup/Backups.d.ts +15 -3
  140. package/package/lib/backup/Backups.js +44 -28
  141. package/package/lib/backup/Backups.js.map +1 -1
  142. package/package/lib/backup/setupBackups.d.ts +5 -2
  143. package/package/lib/backup/setupBackups.js +7 -5
  144. package/package/lib/backup/setupBackups.js.map +1 -1
  145. package/package/lib/health/HealthCheck.d.ts +0 -1
  146. package/package/lib/health/HealthCheck.js +1 -7
  147. package/package/lib/health/HealthCheck.js.map +1 -1
  148. package/package/lib/health/checkFns/runHealthScript.d.ts +2 -1
  149. package/package/lib/health/checkFns/runHealthScript.js +1 -1
  150. package/package/lib/health/checkFns/runHealthScript.js.map +1 -1
  151. package/package/lib/index.d.ts +0 -3
  152. package/package/lib/index.js +1 -8
  153. package/package/lib/index.js.map +1 -1
  154. package/package/lib/inits/index.d.ts +2 -3
  155. package/package/lib/inits/index.js +16 -3
  156. package/package/lib/inits/index.js.map +1 -1
  157. package/package/lib/inits/setupInit.d.ts +7 -13
  158. package/package/lib/inits/setupInit.js +22 -48
  159. package/package/lib/inits/setupInit.js.map +1 -1
  160. package/package/lib/inits/setupInstall.d.ts +10 -10
  161. package/package/lib/inits/setupInstall.js.map +1 -1
  162. package/package/lib/inits/setupUninit.d.ts +7 -0
  163. package/package/lib/inits/setupUninit.js +14 -0
  164. package/package/lib/inits/setupUninit.js.map +1 -0
  165. package/package/lib/inits/setupUninstall.d.ts +5 -5
  166. package/package/lib/inits/setupUninstall.js.map +1 -1
  167. package/package/lib/mainFn/CommandController.d.ts +6 -24
  168. package/package/lib/mainFn/CommandController.js +72 -48
  169. package/package/lib/mainFn/CommandController.js.map +1 -1
  170. package/package/lib/mainFn/Daemon.d.ts +15 -22
  171. package/package/lib/mainFn/Daemon.js +56 -13
  172. package/package/lib/mainFn/Daemon.js.map +1 -1
  173. package/package/lib/mainFn/Daemons.d.ts +72 -49
  174. package/package/lib/mainFn/Daemons.js +87 -23
  175. package/package/lib/mainFn/Daemons.js.map +1 -1
  176. package/package/lib/mainFn/HealthDaemon.d.ts +8 -7
  177. package/package/lib/mainFn/HealthDaemon.js +79 -38
  178. package/package/lib/mainFn/HealthDaemon.js.map +1 -1
  179. package/package/lib/mainFn/Mounts.d.ts +38 -43
  180. package/package/lib/mainFn/Mounts.js +19 -48
  181. package/package/lib/mainFn/Mounts.js.map +1 -1
  182. package/package/lib/mainFn/Oneshot.d.ts +12 -0
  183. package/package/lib/mainFn/Oneshot.js +23 -0
  184. package/package/lib/mainFn/Oneshot.js.map +1 -0
  185. package/package/lib/mainFn/index.d.ts +1 -1
  186. package/package/lib/manifest/setupManifest.js +2 -0
  187. package/package/lib/manifest/setupManifest.js.map +1 -1
  188. package/package/lib/store/getStore.js +7 -2
  189. package/package/lib/store/getStore.js.map +1 -1
  190. package/package/lib/test/host.test.js +1 -1
  191. package/package/lib/test/host.test.js.map +1 -1
  192. package/package/lib/test/inputSpecBuilder.test.js +152 -156
  193. package/package/lib/test/inputSpecBuilder.test.js.map +1 -1
  194. package/package/lib/test/output.d.ts +2 -113
  195. package/package/lib/test/output.js +41 -40
  196. package/package/lib/test/output.js.map +1 -1
  197. package/package/lib/test/output.sdk.d.ts +235 -901
  198. package/package/lib/test/output.sdk.js +0 -1
  199. package/package/lib/test/output.sdk.js.map +1 -1
  200. package/package/lib/test/output.test.js +12 -8
  201. package/package/lib/test/output.test.js.map +1 -1
  202. package/package/lib/util/Drop.d.ts +4 -2
  203. package/package/lib/util/Drop.js +32 -8
  204. package/package/lib/util/Drop.js.map +1 -1
  205. package/package/lib/util/GetSslCertificate.d.ts +4 -0
  206. package/package/lib/util/GetSslCertificate.js +34 -2
  207. package/package/lib/util/GetSslCertificate.js.map +1 -1
  208. package/package/lib/util/SubContainer.d.ts +164 -45
  209. package/package/lib/util/SubContainer.js +223 -100
  210. package/package/lib/util/SubContainer.js.map +1 -1
  211. package/package/lib/util/fileHelper.d.ts +46 -17
  212. package/package/lib/util/fileHelper.js +112 -41
  213. package/package/lib/util/fileHelper.js.map +1 -1
  214. package/package/lib/version/VersionGraph.d.ts +26 -5
  215. package/package/lib/version/VersionGraph.js +88 -22
  216. package/package/lib/version/VersionGraph.js.map +1 -1
  217. package/package/package.json +63 -0
  218. package/package/scripts/oldSpecToBuilder.js +5 -4
  219. package/package/scripts/oldSpecToBuilder.js.map +1 -1
  220. package/package.json +7 -8
  221. package/base/lib/osBindings/NetworkInterfaceSetPublicParams.d.ts +0 -4
  222. package/base/lib/osBindings/NetworkInterfaceSetPublicParams.js.map +0 -1
  223. package/base/lib/osBindings/UnsetPublicParams.d.ts +0 -3
  224. package/base/lib/osBindings/UnsetPublicParams.js.map +0 -1
@@ -1,54 +1,49 @@
1
1
  import { Value } from "../../base/lib/actions/input/builder/value";
2
- import { InputSpec, LazyBuild } from "../../base/lib/actions/input/builder/inputSpec";
3
- import { DefaultString, ListValueSpecText, Pattern, RandomString, ValueSpecDatetime, ValueSpecText } from "../../base/lib/actions/input/inputSpecTypes";
2
+ import { InputSpec } from "../../base/lib/actions/input/builder/inputSpec";
4
3
  import { Variants } from "../../base/lib/actions/input/builder/variants";
5
- import { Action, Actions } from "../../base/lib/actions/setupActions";
6
- import { SyncOptions, ServiceInterfaceId, PackageId, ServiceInterfaceType, Effects } from "../../base/lib/types";
4
+ import { Action, ActionInfo, Actions } from "../../base/lib/actions/setupActions";
5
+ import { ServiceInterfaceId, PackageId, ServiceInterfaceType, Effects } from "../../base/lib/types";
7
6
  import * as patterns from "../../base/lib/util/patterns";
8
7
  import { BackupSync, Backups } from "./backup/Backups";
9
- import { Daemons } from "./mainFn/Daemons";
10
- import { HealthCheck } from "./health/HealthCheck";
8
+ import { Daemon, Daemons } from "./mainFn/Daemons";
11
9
  import { checkPortListening } from "./health/checkFns/checkPortListening";
12
10
  import { List } from "../../base/lib/actions/input/builder/list";
13
- import { InstallFn, PostInstall, PreInstall } from "./inits/setupInstall";
14
11
  import { SetupBackupsParams } from "./backup/setupBackups";
15
- import { UninstallFn } from "./inits/setupUninstall";
16
12
  import { changeOnFirstSuccess, cooldownTrigger } from "./trigger";
17
- import { UpdateServiceInterfaces } from "../../base/lib/interfaces/setupInterfaces";
18
13
  import { MultiHost, Scheme } from "../../base/lib/interfaces/Host";
19
14
  import { ServiceInterfaceBuilder } from "../../base/lib/interfaces/ServiceInterfaceBuilder";
20
15
  import { GetSystemSmtp } from "./util";
21
16
  import { nullIfEmpty } from "./util";
22
- import { CommandOptions, MountOptions, SubContainer } from "./util/SubContainer";
17
+ import { CommandOptions, SubContainer, SubContainerOwned } from "./util/SubContainer";
23
18
  import { Mounts } from "./mainFn/Mounts";
24
19
  import * as T from "../../base/lib/types";
25
- import { ExposedStorePaths } from "./store/setupExposeStore";
26
- import { PathBuilder } from "../../base/lib/util/PathBuilder";
27
20
  import { CheckDependencies } from "../../base/lib/dependencies/dependencies";
28
21
  import { GetSslCertificate } from "./util";
29
- import { VersionGraph } from "./version";
22
+ import { getDataVersion, setDataVersion } from "./version";
30
23
  import { MaybeFn } from "../../base/lib/actions/setupActions";
31
24
  import { GetInput } from "../../base/lib/actions/setupActions";
32
25
  import { Run } from "../../base/lib/actions/setupActions";
33
26
  import * as actions from "../../base/lib/actions";
34
- export declare const OSVersion: "0.4.0-alpha.0";
27
+ import { setupInit, setupUninit, setupOnInit, setupOnUninit } from "../../base/lib/inits";
28
+ export declare const OSVersion: "0.4.0-alpha.7";
35
29
  type AnyNeverCond<T extends any[], Then, Else> = T extends [] ? Else : T extends [never, ...Array<any>] ? Then : T extends [any, ...infer U] ? AnyNeverCond<U, Then, Else> : never;
36
- export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
30
+ export declare class StartSdk<Manifest extends T.SDKManifest> {
37
31
  readonly manifest: Manifest;
38
32
  private constructor();
39
- static of(): StartSdk<never, never>;
40
- withManifest<Manifest extends T.SDKManifest = never>(manifest: Manifest): StartSdk<Manifest, Store>;
41
- withStore<Store extends Record<string, any>>(): StartSdk<Manifest, Store>;
42
- build(isReady: AnyNeverCond<[Manifest, Store], "Build not ready", true>): {
33
+ static of(): StartSdk<never>;
34
+ withManifest<Manifest extends T.SDKManifest = never>(manifest: Manifest): StartSdk<Manifest>;
35
+ build(isReady: AnyNeverCond<[Manifest], "Build not ready", true>): {
36
+ setDataVersion: typeof setDataVersion;
37
+ getDataVersion: typeof getDataVersion;
43
38
  action: {
44
39
  run: <Input extends Record<string, unknown>>(options: {
45
40
  effects: T.Effects;
46
41
  actionId: T.ActionId;
47
42
  input?: actions.RunActionInput<Input>;
48
43
  }) => Promise<T.ActionResult | null>;
49
- request: <T extends Action<T.ActionId, any, any>>(effects: T.Effects, packageId: T.PackageId, action: T, severity: T.ActionSeverity, options?: actions.ActionRequestOptions<T>) => Promise<null>;
50
- requestOwn: <T extends Action<T.ActionId, Store, any>>(effects: T.Effects, action: T, severity: T.ActionSeverity, options?: actions.ActionRequestOptions<T>) => Promise<null>;
51
- clearRequest: (effects: T.Effects, ...replayIds: string[]) => Promise<null>;
44
+ createTask: <T extends ActionInfo<T.ActionId, any>>(effects: T.Effects, packageId: T.PackageId, action: T, severity: T.TaskSeverity, options?: actions.TaskOptions<T>) => Promise<null>;
45
+ createOwnTask: <T extends ActionInfo<T.ActionId, any>>(effects: T.Effects, action: T, severity: T.TaskSeverity, options?: actions.TaskOptions<T>) => Promise<null>;
46
+ clearTask: (effects: T.Effects, ...replayIds: string[]) => Promise<null>;
52
47
  };
53
48
  checkDependencies: <DependencyId extends keyof Manifest["dependencies"] & PackageId = keyof Manifest["dependencies"] & PackageId>(effects: Effects, packageIds?: DependencyId[]) => Promise<CheckDependencies<DependencyId>>;
54
49
  serviceInterface: {
@@ -67,26 +62,13 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
67
62
  once: () => Promise<string>;
68
63
  watch: () => AsyncGenerator<string, void, unknown>;
69
64
  onChange: (callback: (value: string | null, error?: Error) => void | Promise<void>) => void;
70
- };
71
- store: {
72
- get: <E extends Effects, StoreValue = unknown>(effects: E, packageId: string, path: PathBuilder<Store, StoreValue>) => import("./store/getStore").GetStore<Store, StoreValue>;
73
- getOwn: <E extends Effects, StoreValue = unknown>(effects: E, path: PathBuilder<Store, StoreValue>) => import("./store/getStore").GetStore<Store, StoreValue>;
74
- setOwn: <E extends Effects, Path extends PathBuilder<Store, unknown>>(effects: E, path: Path, value: Path extends PathBuilder<Store, infer Value> ? Value : never) => Promise<null>;
65
+ waitFor: (pred: (value: string | null) => boolean) => Promise<string | null>;
75
66
  };
76
67
  MultiHost: {
77
68
  of: (effects: Effects, id: string) => MultiHost;
78
69
  };
79
70
  nullIfEmpty: typeof nullIfEmpty;
80
71
  useEntrypoint: (overrideCmd?: string[]) => T.UseEntrypoint;
81
- runCommand: <A extends string>(effects: Effects, image: {
82
- imageId: keyof Manifest["images"] & T.ImageId;
83
- sharedRun?: boolean;
84
- }, command: T.CommandType, options: CommandOptions & {
85
- mounts: Mounts<Manifest>;
86
- }, name?: string) => Promise<{
87
- stdout: string | Buffer;
88
- stderr: string | Buffer;
89
- }>;
90
72
  /**
91
73
  * @description Use this class to create an Action. By convention, each Action should receive its own file.
92
74
  *
@@ -149,7 +131,7 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
149
131
  )
150
132
  * ```
151
133
  */
152
- withInput: <Id extends T.ActionId, InputSpecType extends Record<string, any> | InputSpec<any, any> | InputSpec<any, never>>(id: Id, metadata: MaybeFn<Omit<T.ActionMetadata, "hasInput">>, inputSpec: InputSpecType, getInput: GetInput<InputSpecType>, run: Run<InputSpecType>) => Action<Id, unknown, InputSpecType>;
134
+ withInput: <Id extends T.ActionId, Type extends Record<string, any>>(id: Id, metadata: MaybeFn<Omit<T.ActionMetadata, "hasInput">>, inputSpec: InputSpec<Type>, getInput: GetInput<Type>, run: Run<Type>) => Action<Id, Type>;
153
135
  /**
154
136
  * @description Use this function to create an action that does not accept form input
155
137
  * @param id - a unique ID for this action
@@ -159,6 +141,7 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
159
141
  * In this example, we create an action that returns a secret phrase for the user to see.
160
142
  *
161
143
  * ```
144
+ import { store } from '../file-models/store.json'
162
145
  import { sdk } from '../sdk'
163
146
 
164
147
  export const showSecretPhrase = sdk.Action.withoutInput(
@@ -183,9 +166,7 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
183
166
  'Below is your secret phrase. Use it to gain access to extraordinary places',
184
167
  result: {
185
168
  type: 'single',
186
- value: await sdk.store
187
- .getOwn(effects, sdk.StorePath.secretPhrase)
188
- .const(),
169
+ value: (await store.read.once())?.secretPhrase,
189
170
  copyable: true,
190
171
  qr: true,
191
172
  masked: true,
@@ -194,19 +175,19 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
194
175
  )
195
176
  * ```
196
177
  */
197
- withoutInput: <Id extends T.ActionId>(id: Id, metadata: MaybeFn<Omit<T.ActionMetadata, "hasInput">>, run: Run<{}>) => Action<Id, unknown, {}>;
178
+ withoutInput: <Id extends T.ActionId>(id: Id, metadata: MaybeFn<Omit<T.ActionMetadata, "hasInput">>, run: Run<{}>) => Action<Id, {}>;
198
179
  };
199
180
  inputSpecConstants: {
200
- smtpInputSpec: Value<import("../../base/lib/actions/input/builder/variants").UnionRes<never, {
181
+ smtpInputSpec: Value<import("../../base/lib/actions/input/builder/variants").UnionRes<{
201
182
  disabled: {
202
183
  name: string;
203
- spec: InputSpec<{}, Store_1>;
184
+ spec: InputSpec<{}>;
204
185
  };
205
186
  system: {
206
187
  name: string;
207
188
  spec: InputSpec<{
208
189
  customFrom: string | null;
209
- }, Store_1>;
190
+ }>;
210
191
  };
211
192
  custom: {
212
193
  name: string;
@@ -216,9 +197,9 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
216
197
  from: string;
217
198
  login: string;
218
199
  password: string | null | undefined;
219
- }, never>;
200
+ }>;
220
201
  };
221
- }, "disabled" | "system" | "custom">, never>;
202
+ }>>;
222
203
  };
223
204
  /**
224
205
  * @description Use this function to create a service interface.
@@ -237,7 +218,7 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
237
218
  schemeOverride: null,
238
219
  username: null,
239
220
  path: '',
240
- search: {},
221
+ query: {},
241
222
  })
242
223
  * ```
243
224
  */
@@ -248,14 +229,14 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
248
229
  id: string;
249
230
  /** The human readable description. */
250
231
  description: string;
251
- /** Affects how the interface appears to the user. One of: 'ui', 'api', 'p2p'. If 'ui', the user will see a "Launch UI" button */
232
+ /** Affects how the interface appears to the user. One of: 'ui', 'api', 'p2p'. If 'ui', the user will see an option to open the UI in a new tab */
252
233
  type: ServiceInterfaceType;
253
234
  /** (optional) prepends the provided username to all URLs. */
254
235
  username: null | string;
255
236
  /** (optional) appends the provided path to all URLs. */
256
237
  path: string;
257
238
  /** (optional) appends the provided query params to all URLs. */
258
- search: Record<string, string>;
239
+ query: Record<string, string>;
259
240
  /** (optional) overrides the protocol prefix provided by the bind function.
260
241
  *
261
242
  * @example `ftp://`
@@ -269,7 +250,6 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
269
250
  }) => ServiceInterfaceBuilder;
270
251
  getSystemSmtp: <E extends Effects>(effects: E) => GetSystemSmtp;
271
252
  getSslCerificate: <E extends Effects>(effects: E, hostnames: string[], algorithm?: T.Algorithm) => GetSslCertificate;
272
- HealthCheck: typeof HealthCheck;
273
253
  healthCheck: {
274
254
  checkPortListening: typeof checkPortListening;
275
255
  checkWebUrl: (effects: Effects, url: string, { timeout, successMessage, errorMessage, }?: {
@@ -277,7 +257,7 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
277
257
  successMessage?: string | undefined;
278
258
  errorMessage?: string | undefined;
279
259
  }) => Promise<import("./health/checkFns").HealthCheckResult>;
280
- runHealthScript: (runCommand: string[], subcontainer: SubContainer, { timeout, errorMessage, message, }?: {
260
+ runHealthScript: <Manifest_1 extends T.SDKManifest>(runCommand: string[], subcontainer: SubContainer<Manifest_1>, { timeout, errorMessage, message, }?: {
281
261
  timeout?: number | undefined;
282
262
  errorMessage?: string | undefined;
283
263
  message?: ((res: string) => string) | undefined;
@@ -299,8 +279,8 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
299
279
  * ```
300
280
  */
301
281
  Actions: {
302
- new (actions: {}): Actions<Store, {}>;
303
- of<Store_2>(): Actions<Store_2, {}>;
282
+ new (actions: {}): Actions<{}>;
283
+ of(): Actions<{}>;
304
284
  };
305
285
  /**
306
286
  * @description Use this function to determine which volumes are backed up when a user creates a backup, including advanced options.
@@ -329,16 +309,16 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
329
309
  */
330
310
  setupBackups: (options: SetupBackupsParams<Manifest>) => {
331
311
  createBackup: T.ExpectedExports.createBackup;
332
- restoreBackup: T.ExpectedExports.restoreBackup;
312
+ restoreInit: import("../../base/lib/inits").InitScript;
333
313
  };
334
314
  /**
335
315
  * @description Use this function to set dependency information.
336
316
  * @example
337
- * In this example, we create a perpetual dependency on Hello World >=1.0.0:0, where Hello World must be running and passing its "primary" health check.
317
+ * In this example, we create a dependency on Hello World >=1.0.0:0, where Hello World must be running and passing its "primary" health check.
338
318
  *
339
319
  * ```
340
320
  export const setDependencies = sdk.setupDependencies(
341
- async ({ effects, input }) => {
321
+ async ({ effects }) => {
342
322
  return {
343
323
  'hello-world': {
344
324
  kind: 'running',
@@ -349,76 +329,59 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
349
329
  },
350
330
  )
351
331
  * ```
352
- * @example
353
- * In this example, we create a conditional dependency on Hello World based on a hypothetical "needsWorld" boolean in our Store.
354
- * Using .const() ensures that if the "needsWorld" boolean changes, setupDependencies will re-run.
355
- *
356
- * ```
357
- export const setDependencies = sdk.setupDependencies(
358
- async ({ effects }) => {
359
- if (sdk.store.getOwn(sdk.StorePath.needsWorld).const()) {
360
- return {
361
- 'hello-world': {
362
- kind: 'running',
363
- versionRange: '>=1.0.0',
364
- healthChecks: ['primary'],
365
- },
366
- }
367
- }
368
- return {}
369
- },
370
- )
371
- * ```
372
332
  */
373
333
  setupDependencies: (fn: (options: {
374
334
  effects: T.Effects;
375
- }) => Promise<T.CurrentDependenciesResult<Manifest>>) => (options: {
376
- effects: T.Effects;
377
- }) => Promise<null>;
378
- setupInit: (versions: VersionGraph<string>, preInstall: PreInstall<Manifest, Store>, postInstall: PostInstall<Manifest, Store>, uninstall: import("./inits/setupUninstall").Uninstall<Manifest, Store>, setServiceInterfaces: UpdateServiceInterfaces<any>, setDependencies: (options: {
379
- effects: T.Effects;
380
- }) => Promise<null | void | undefined>, actions: Actions<Store, any>, initStore: Store, exposedStore: ExposedStorePaths) => {
381
- packageInit: T.ExpectedExports.packageInit;
382
- packageUninit: T.ExpectedExports.packageUninit;
383
- containerInit: T.ExpectedExports.containerInit;
384
- };
335
+ }) => Promise<T.CurrentDependenciesResult<Manifest>>) => (effects: T.Effects) => Promise<null>;
336
+ /**
337
+ * @description Use this function to create an InitScript that runs every time the service initializes (install, update, restore, rebuild, and server bootup)
338
+ */
339
+ setupOnInit: typeof setupOnInit;
385
340
  /**
386
- * @description Use this function to execute arbitrary logic *once*, on initial install *before* interfaces, actions, and dependencies are updated.
341
+ * @description Use this function to create an UninitScript that runs every time the service uninitializes (update, uninstall, and server shutdown)
342
+ */
343
+ setupOnUninit: typeof setupOnUninit;
344
+ /**
345
+ * @description Use this function to setup what happens when the service initializes.
346
+ *
347
+ * This happens when the server boots, or a service is installed, updated, or restored
348
+ *
349
+ * Not every init script does something on every initialization. For example, versions only does something on install or update
350
+ *
351
+ * These scripts are run in the order they are supplied
387
352
  * @example
388
- * In the this example, we initialize a config file
389
353
  *
390
354
  * ```
391
- const preInstall = sdk.setupPreInstall(async ({ effects }) => {
392
- await configFile.write(effects, { name: 'World' })
393
- })
355
+ export const init = sdk.setupInit(
356
+ restoreInit,
357
+ versions,
358
+ setDependencies,
359
+ setInterfaces,
360
+ actions,
361
+ postInstall,
362
+ )
394
363
  * ```
395
364
  */
396
- setupPreInstall: (fn: InstallFn<Manifest, Store>) => PreInstall<Manifest, Store>;
365
+ setupInit: typeof setupInit;
397
366
  /**
398
- * @description Use this function to execute arbitrary logic *once*, on initial install *after* interfaces, actions, and dependencies are updated.
367
+ * @description Use this function to setup what happens when the service uninitializes.
368
+ *
369
+ * This happens when the server shuts down, or a service is uninstalled or updated
370
+ *
371
+ * Not every uninit script does something on every uninitialization. For example, versions only does something on uninstall or update
372
+ *
373
+ * These scripts are run in the order they are supplied
399
374
  * @example
400
- * In the this example, we bootstrap our Store with a random, 16-char admin password.
401
375
  *
402
376
  * ```
403
- const postInstall = sdk.setupPostInstall(async ({ effects }) => {
404
- await sdk.store.setOwn(
405
- effects,
406
- sdk.StorePath.adminPassword,
407
- utils.getDefaultString({
408
- charset: 'a-z,A-Z,1-9,!,@,$,%,&,',
409
- len: 16,
410
- }),
411
- )
412
- })
377
+ export const uninit = sdk.setupUninit(
378
+ versions,
379
+ )
413
380
  * ```
414
381
  */
415
- setupPostInstall: (fn: InstallFn<Manifest, Store>) => PostInstall<Manifest, Store>;
382
+ setupUninit: typeof setupUninit;
416
383
  /**
417
384
  * @description Use this function to determine how this service will be hosted and served. The function executes on service install, service update, and inputSpec save.
418
- *
419
- * "input" will be of type `Input` for inputSpec save. It will be `null` for install and update.
420
- *
421
- * To learn about creating multi-hosts and interfaces, check out the {@link https://docs.start9.com/packaging-guide/learn/interfaces documentation}.
422
385
  * @param inputSpec - The inputSpec spec of this service as exported from /inputSpec/spec.
423
386
  * @param fn - an async function that returns an array of interface receipts. The function always has access to `effects`; it has access to `input` only after inputSpec save, otherwise `input` will be null.
424
387
  * @example
@@ -426,8 +389,7 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
426
389
  *
427
390
  * ```
428
391
  export const setInterfaces = sdk.setupInterfaces(
429
- inputSpecSpec,
430
- async ({ effects, input }) => {
392
+ async ({ effects }) => {
431
393
  // ** UI multi-host **
432
394
  const uiMulti = sdk.MultiHost.of(effects, 'ui-multi')
433
395
  const uiMultiOrigin = await uiMulti.bindPort(80, {
@@ -443,7 +405,7 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
443
405
  schemeOverride: null,
444
406
  username: null,
445
407
  path: '',
446
- search: {},
408
+ query: {},
447
409
  })
448
410
  // Admin UI
449
411
  const adminUi = sdk.createInterface(effects, {
@@ -455,7 +417,7 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
455
417
  schemeOverride: null,
456
418
  username: null,
457
419
  path: '/admin',
458
- search: {},
420
+ query: {},
459
421
  })
460
422
  // UI receipt
461
423
  const uiReceipt = await uiMultiOrigin.export([primaryUi, adminUi])
@@ -475,7 +437,7 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
475
437
  schemeOverride: null,
476
438
  username: null,
477
439
  path: '',
478
- search: {},
440
+ query: {},
479
441
  })
480
442
  // API receipt
481
443
  const apiReceipt = await apiMultiOrigin.export([api])
@@ -491,10 +453,6 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
491
453
  effects: Effects;
492
454
  started(onTerm: () => PromiseLike<void>): PromiseLike<null>;
493
455
  }) => Promise<Daemons<Manifest, any>>) => T.ExpectedExports.main;
494
- /**
495
- * Use this function to execute arbitrary logic *once*, on uninstall only. Most services will not use this.
496
- */
497
- setupUninstall: (fn: UninstallFn<Manifest, Store>) => import("./inits/setupUninstall").Uninstall<Manifest, Store>;
498
456
  trigger: {
499
457
  defaultTrigger: import("./trigger").Trigger;
500
458
  cooldownTrigger: typeof cooldownTrigger;
@@ -505,12 +463,12 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
505
463
  }) => import("./trigger").Trigger;
506
464
  };
507
465
  Mounts: {
508
- of(): Mounts<Manifest>;
466
+ of: () => Mounts<Manifest, never>;
509
467
  };
510
468
  Backups: {
511
- volumes: (...volumeNames: Array<Manifest["volumes"][number] & string>) => Backups<Manifest>;
512
- addSets: (...options: BackupSync<Manifest["volumes"][number] & string>[]) => Backups<Manifest>;
513
- withOptions: (options?: Partial<SyncOptions>) => Backups<Manifest>;
469
+ ofVolumes: (...volumeNames: Manifest["volumes"][number][]) => Backups<Manifest>;
470
+ ofSyncs: (...syncs: BackupSync<Manifest["volumes"][number]>[]) => Backups<Manifest>;
471
+ withOptions: (options?: Partial<T.SyncOptions>) => Backups<Manifest>;
514
472
  };
515
473
  InputSpec: {
516
474
  /**
@@ -540,447 +498,41 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
540
498
  })
541
499
  * ```
542
500
  */
543
- of: <Spec extends Record<string, Value<any, Store> | Value<any, never>>>(spec: Spec) => InputSpec<{ [K in keyof Spec]: Spec[K] extends Value<infer T, never> | Value<infer T, Store> ? T : never; }, Store>;
501
+ of: <Spec extends Record<string, Value<any>>>(spec: Spec) => InputSpec<{ [K in keyof Spec]: Spec[K] extends Value<infer T> ? T : never; }>;
502
+ };
503
+ Daemon: {
504
+ readonly of: <C extends SubContainer<Manifest, Effects> | null>(effects: T.Effects, subcontainer: C, exec: import("./mainFn/Daemons").DaemonCommandType<Manifest, C>) => Promise<Daemon<Manifest, SubContainer<Manifest, Effects> | null>>;
544
505
  };
545
506
  Daemons: {
546
- of(effects: Effects, started: (onTerm: () => PromiseLike<void>) => PromiseLike<null>, healthChecks: HealthCheck[]): Daemons<Manifest, never>;
507
+ of(effects: Effects, started: ((onTerm: () => PromiseLike<void>) => PromiseLike<null>) | null): Daemons<Manifest, never>;
547
508
  };
548
509
  SubContainer: {
510
+ /**
511
+ * @description Create a new SubContainer
512
+ * @param effects
513
+ * @param image - what container image to use
514
+ * @param mounts - what to mount to the subcontainer
515
+ * @param name - a name to use to refer to the subcontainer for debugging purposes
516
+ */
549
517
  of(effects: Effects, image: {
550
518
  imageId: T.ImageId & keyof Manifest["images"];
551
519
  sharedRun?: boolean;
552
- }, name: string): Promise<SubContainer>;
553
- with<T>(effects: T.Effects, image: {
554
- imageId: T.ImageId & keyof Manifest["images"];
555
- sharedRun?: boolean;
556
- }, mounts: {
557
- options: MountOptions;
558
- mountpoint: string;
559
- }[], name: string, fn: (subContainer: SubContainer) => Promise<T>): Promise<T>;
560
- };
561
- List: {
562
- /**
563
- * @description Create a list of text inputs.
564
- * @param a - attributes of the list itself.
565
- * @param aSpec - attributes describing each member of the list.
566
- */
567
- text: typeof List.text;
568
- /**
569
- * @description Create a list of objects.
570
- * @param a - attributes of the list itself.
571
- * @param aSpec - attributes describing each member of the list.
572
- */
573
- obj: <Type extends Record<string, any>>(a: Parameters<typeof List.obj<Type, Store>>[0], aSpec: Parameters<typeof List.obj<Type, Store>>[1]) => List<Type[], Store>;
520
+ }, mounts: Mounts<Manifest> | null, name: string): Promise<SubContainerOwned<Manifest, Effects>>;
574
521
  /**
575
- * @description Create a list of dynamic text inputs.
576
- * @param a - attributes of the list itself.
577
- * @param aSpec - attributes describing each member of the list.
522
+ * @description Run a function with a temporary SubContainer
523
+ * @param effects
524
+ * @param image - what container image to use
525
+ * @param mounts - what to mount to the subcontainer
526
+ * @param name - a name to use to refer to the ephemeral subcontainer for debugging purposes
578
527
  */
579
- dynamicText: (getA: LazyBuild<Store, {
580
- name: string;
581
- description?: string | null;
582
- warning?: string | null;
583
- default?: string[];
584
- minLength?: number | null;
585
- maxLength?: number | null;
586
- disabled?: false | string;
587
- generate?: null | RandomString;
588
- spec: {
589
- masked?: boolean;
590
- placeholder?: string | null;
591
- minLength?: number | null;
592
- maxLength?: number | null;
593
- patterns?: Pattern[];
594
- inputmode?: ListValueSpecText["inputmode"];
595
- };
596
- }>) => List<string[], Store>;
597
- };
598
- StorePath: PathBuilder<Store, Store>;
599
- Value: {
600
- /**
601
- * @description Displays a boolean toggle to enable/disable
602
- * @example
603
- * ```
604
- toggleExample: Value.toggle({
605
- // required
606
- name: 'Toggle Example',
607
- default: true,
608
-
609
- // optional
610
- description: null,
611
- warning: null,
612
- immutable: false,
613
- }),
614
- * ```
615
- */
616
- toggle: typeof Value.toggle;
617
- /**
618
- * @description Displays a text input field
619
- * @example
620
- * ```
621
- textExample: Value.text({
622
- // required
623
- name: 'Text Example',
624
- required: false,
625
- default: null,
626
-
627
- // optional
628
- description: null,
629
- placeholder: null,
630
- warning: null,
631
- generate: null,
632
- inputmode: 'text',
633
- masked: false,
634
- minLength: null,
635
- maxLength: null,
636
- patterns: [],
637
- immutable: false,
638
- }),
639
- * ```
640
- */
641
- text: typeof Value.text;
642
- /**
643
- * @description Displays a large textarea field for long form entry.
644
- * @example
645
- * ```
646
- textareaExample: Value.textarea({
647
- // required
648
- name: 'Textarea Example',
649
- required: false,
650
- default: null,
651
-
652
- // optional
653
- description: null,
654
- placeholder: null,
655
- warning: null,
656
- minLength: null,
657
- maxLength: null,
658
- immutable: false,
659
- }),
660
- * ```
661
- */
662
- textarea: typeof Value.textarea;
663
- /**
664
- * @description Displays a number input field
665
- * @example
666
- * ```
667
- numberExample: Value.number({
668
- // required
669
- name: 'Number Example',
670
- required: false,
671
- default: null,
672
- integer: true,
673
-
674
- // optional
675
- description: null,
676
- placeholder: null,
677
- warning: null,
678
- min: null,
679
- max: null,
680
- immutable: false,
681
- step: null,
682
- units: null,
683
- }),
684
- * ```
685
- */
686
- number: typeof Value.number;
687
- /**
688
- * @description Displays a browser-native color selector.
689
- * @example
690
- * ```
691
- colorExample: Value.color({
692
- // required
693
- name: 'Color Example',
694
- required: false,
695
- default: null,
696
-
697
- // optional
698
- description: null,
699
- warning: null,
700
- immutable: false,
701
- }),
702
- * ```
703
- */
704
- color: typeof Value.color;
705
- /**
706
- * @description Displays a browser-native date/time selector.
707
- * @example
708
- * ```
709
- datetimeExample: Value.datetime({
710
- // required
711
- name: 'Datetime Example',
712
- required: false,
713
- default: null,
714
-
715
- // optional
716
- description: null,
717
- warning: null,
718
- immutable: false,
719
- inputmode: 'datetime-local',
720
- min: null,
721
- max: null,
722
- }),
723
- * ```
724
- */
725
- datetime: typeof Value.datetime;
726
- /**
727
- * @description Displays a select modal with radio buttons, allowing for a single selection.
728
- * @example
729
- * ```
730
- selectExample: Value.select({
731
- // required
732
- name: 'Select Example',
733
- default: 'radio1',
734
- values: {
735
- radio1: 'Radio 1',
736
- radio2: 'Radio 2',
737
- },
738
-
739
- // optional
740
- description: null,
741
- warning: null,
742
- immutable: false,
743
- disabled: false,
744
- }),
745
- * ```
746
- */
747
- select: typeof Value.select;
748
- /**
749
- * @description Displays a select modal with checkboxes, allowing for multiple selections.
750
- * @example
751
- * ```
752
- multiselectExample: Value.multiselect({
753
- // required
754
- name: 'Multiselect Example',
755
- values: {
756
- option1: 'Option 1',
757
- option2: 'Option 2',
758
- },
759
- default: [],
760
-
761
- // optional
762
- description: null,
763
- warning: null,
764
- immutable: false,
765
- disabled: false,
766
- minlength: null,
767
- maxLength: null,
768
- }),
769
- * ```
770
- */
771
- multiselect: typeof Value.multiselect;
772
- /**
773
- * @description Display a collapsable grouping of additional fields, a "sub form". The second value is the inputSpec spec for the sub form.
774
- * @example
775
- * ```
776
- objectExample: Value.object(
777
- {
778
- // required
779
- name: 'Object Example',
780
-
781
- // optional
782
- description: null,
783
- warning: null,
784
- },
785
- InputSpec.of({}),
786
- ),
787
- * ```
788
- */
789
- object: typeof Value.object;
790
- /**
791
- * @description Displays a dropdown, allowing for a single selection. Depending on the selection, a different object ("sub form") is presented.
792
- * @example
793
- * ```
794
- unionExample: Value.union(
795
- {
796
- // required
797
- name: 'Union Example',
798
- default: 'option1',
799
-
800
- // optional
801
- description: null,
802
- warning: null,
803
- disabled: false,
804
- immutable: false,
805
- },
806
- Variants.of({
807
- option1: {
808
- name: 'Option 1',
809
- spec: InputSpec.of({}),
810
- },
811
- option2: {
812
- name: 'Option 2',
813
- spec: InputSpec.of({}),
814
- },
815
- }),
816
- ),
817
- * ```
818
- */
819
- union: typeof Value.union;
820
- /**
821
- * @description Presents an interface to add/remove/edit items in a list.
822
- * @example
823
- * In this example, we create a list of text inputs.
824
- *
825
- * ```
826
- listExampleText: Value.list(
827
- List.text(
828
- {
829
- // required
830
- name: 'Text List',
831
-
832
- // optional
833
- description: null,
834
- warning: null,
835
- default: [],
836
- minLength: null,
837
- maxLength: null,
838
- },
839
- {
840
- // required
841
- patterns: [],
842
-
843
- // optional
844
- placeholder: null,
845
- generate: null,
846
- inputmode: 'url',
847
- masked: false,
848
- minLength: null,
849
- maxLength: null,
850
- },
851
- ),
852
- ),
853
- * ```
854
- * @example
855
- * In this example, we create a list of objects.
856
- *
857
- * ```
858
- listExampleObject: Value.list(
859
- List.obj(
860
- {
861
- // required
862
- name: 'Object List',
863
-
864
- // optional
865
- description: null,
866
- warning: null,
867
- default: [],
868
- minLength: null,
869
- maxLength: null,
870
- },
871
- {
872
- // required
873
- spec: InputSpec.of({}),
874
-
875
- // optional
876
- displayAs: null,
877
- uniqueBy: null,
878
- },
879
- ),
880
- ),
881
- * ```
882
- */
883
- list: typeof Value.list;
884
- hidden: typeof Value.hidden;
885
- dynamicToggle: (a: LazyBuild<Store, {
886
- name: string;
887
- description?: string | null;
888
- warning?: string | null;
889
- default: boolean;
890
- disabled?: false | string;
891
- }>) => Value<boolean, Store>;
892
- dynamicText: (getA: LazyBuild<Store, {
893
- name: string;
894
- description?: string | null;
895
- warning?: string | null;
896
- default: DefaultString | null;
897
- required: boolean;
898
- masked?: boolean;
899
- placeholder?: string | null;
900
- minLength?: number | null;
901
- maxLength?: number | null;
902
- patterns?: Pattern[];
903
- inputmode?: ValueSpecText["inputmode"];
904
- disabled?: string | false;
905
- generate?: null | RandomString;
906
- }>) => Value<string | null, Store>;
907
- dynamicTextarea: (getA: LazyBuild<Store, {
908
- name: string;
909
- description?: string | null;
910
- warning?: string | null;
911
- default: string | null;
912
- required: boolean;
913
- minLength?: number | null;
914
- maxLength?: number | null;
915
- placeholder?: string | null;
916
- disabled?: false | string;
917
- }>) => Value<string | null, Store>;
918
- dynamicNumber: (getA: LazyBuild<Store, {
919
- name: string;
920
- description?: string | null;
921
- warning?: string | null;
922
- default: number | null;
923
- required: boolean;
924
- min?: number | null;
925
- max?: number | null;
926
- step?: number | null;
927
- integer: boolean;
928
- units?: string | null;
929
- placeholder?: string | null;
930
- disabled?: false | string;
931
- }>) => Value<number | null, Store>;
932
- dynamicColor: (getA: LazyBuild<Store, {
933
- name: string;
934
- description?: string | null;
935
- warning?: string | null;
936
- default: string | null;
937
- required: boolean;
938
- disabled?: false | string;
939
- }>) => Value<string | null, Store>;
940
- dynamicDatetime: (getA: LazyBuild<Store, {
941
- name: string;
942
- description?: string | null;
943
- warning?: string | null;
944
- default: string | null;
945
- required: boolean;
946
- inputmode?: ValueSpecDatetime["inputmode"];
947
- min?: string | null;
948
- max?: string | null;
949
- disabled?: false | string;
950
- }>) => Value<string | null, Store>;
951
- dynamicSelect: (getA: LazyBuild<Store, {
952
- name: string;
953
- description?: string | null;
954
- warning?: string | null;
955
- default: string;
956
- values: Record<string, string>;
957
- disabled?: false | string | string[];
958
- }>) => Value<string, Store>;
959
- dynamicMultiselect: (getA: LazyBuild<Store, {
960
- name: string;
961
- description?: string | null;
962
- warning?: string | null;
963
- default: string[];
964
- values: Record<string, string>;
965
- minLength?: number | null;
966
- maxLength?: number | null;
967
- disabled?: false | string | string[];
968
- }>) => Value<string[], Store>;
969
- filteredUnion: <VariantValues extends { [K in string]: {
970
- name: string;
971
- spec: InputSpec<any, Store> | InputSpec<any, never>;
972
- }; }>(getDisabledFn: Parameters<typeof Value.filteredUnion<VariantValues, Store>>[0], a: Parameters<typeof Value.filteredUnion<VariantValues, Store>>[1], aVariants: Parameters<typeof Value.filteredUnion<VariantValues, Store>>[2]) => Value<import("../../base/lib/actions/input/builder/variants").UnionRes<Store, VariantValues, keyof VariantValues & string> | import("../../base/lib/actions/input/builder/variants").UnionRes<never, VariantValues, keyof VariantValues & string>, Store>;
973
- dynamicUnion: <VariantValues extends { [K in string]: {
974
- name: string;
975
- spec: InputSpec<any, Store> | InputSpec<any, never>;
976
- }; }>(getA: Parameters<typeof Value.dynamicUnion<VariantValues, Store>>[0], aVariants: Parameters<typeof Value.dynamicUnion<VariantValues, Store>>[1]) => Value<import("../../base/lib/actions/input/builder/variants").UnionRes<Store, VariantValues, keyof VariantValues & string> | import("../../base/lib/actions/input/builder/variants").UnionRes<never, VariantValues, keyof VariantValues & string>, Store>;
977
- };
978
- Variants: {
979
- of: <VariantValues extends { [K in string]: {
980
- name: string;
981
- spec: InputSpec<any, Store>;
982
- }; }>(a: VariantValues) => Variants<VariantValues, Store>;
528
+ withTemp<T>(effects: T.Effects, image: {
529
+ imageId: T.ImageId & keyof Manifest["images"];
530
+ sharedRun?: boolean;
531
+ }, mounts: Mounts<Manifest> | null, name: string, fn: (subContainer: SubContainer<Manifest>) => Promise<T>): Promise<T>;
983
532
  };
533
+ List: typeof List;
534
+ Value: typeof Value;
535
+ Variants: typeof Variants;
984
536
  restart: (effects: Effects) => Promise<null>;
985
537
  shutdown: (effects: Effects) => Promise<null>;
986
538
  getStatus: (effects: Effects, options: {
@@ -991,19 +543,9 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
991
543
  dependencies: T.Dependencies;
992
544
  }) => Promise<null>;
993
545
  getDependencies: (effects: Effects) => Promise<T.DependencyRequirement[]>;
994
- mount: (effects: Effects, options: {
995
- location: string;
996
- target: {
997
- packageId: string;
998
- volumeId: string;
999
- subpath: string | null;
1000
- readonly: boolean;
1001
- };
1002
- }) => Promise<string>;
546
+ mount: (effects: Effects, options: T.MountParams) => Promise<string>;
1003
547
  getInstalledPackages: (effects: Effects) => Promise<string[]>;
1004
- exposeForDependents: (effects: Effects, options: {
1005
- paths: string[];
1006
- }) => Promise<null>;
548
+ setHealth: (effects: Effects, o: T.SetHealth) => Promise<null>;
1007
549
  getServicePortForward: (effects: Effects, options: {
1008
550
  packageId?: PackageId;
1009
551
  hostId: T.HostId;
@@ -1020,10 +562,6 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
1020
562
  hostnames: string[];
1021
563
  algorithm?: "ecdsa" | "ed25519";
1022
564
  }) => Promise<string>;
1023
- setDataVersion: (effects: Effects, options: {
1024
- version: string;
1025
- }) => Promise<null>;
1026
- getDataVersion: (effects: Effects) => Promise<string | null>;
1027
565
  manifest: Manifest;
1028
566
  };
1029
567
  }
@@ -1031,7 +569,7 @@ export declare function runCommand<Manifest extends T.SDKManifest>(effects: Effe
1031
569
  imageId: keyof Manifest["images"] & T.ImageId;
1032
570
  sharedRun?: boolean;
1033
571
  }, command: T.CommandType, options: CommandOptions & {
1034
- mounts: Mounts<Manifest>;
572
+ mounts: Mounts<Manifest> | null;
1035
573
  }, name?: string): Promise<{
1036
574
  stdout: string | Buffer;
1037
575
  stderr: string | Buffer;