@start9labs/start-sdk 0.3.6-beta.1 → 0.3.6-beta.11

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 (199) hide show
  1. package/base/lib/Effects.d.ts +2 -7
  2. package/base/lib/actions/index.d.ts +4 -4
  3. package/base/lib/actions/index.js.map +1 -1
  4. package/base/lib/actions/input/builder/inputSpec.js.map +1 -1
  5. package/base/lib/actions/input/builder/value.d.ts +3 -0
  6. package/base/lib/actions/input/builder/value.js +87 -111
  7. package/base/lib/actions/input/builder/value.js.map +1 -1
  8. package/base/lib/actions/input/builder/variants.js.map +1 -1
  9. package/base/lib/actions/input/index.js +17 -7
  10. package/base/lib/actions/input/index.js.map +1 -1
  11. package/base/lib/actions/input/inputSpecConstants.js +2 -2
  12. package/base/lib/actions/input/inputSpecConstants.js.map +1 -1
  13. package/base/lib/actions/input/inputSpecTypes.js +1 -2
  14. package/base/lib/actions/input/inputSpecTypes.js.map +1 -1
  15. package/base/lib/actions/setupActions.d.ts +3 -3
  16. package/base/lib/actions/setupActions.js.map +1 -1
  17. package/base/lib/dependencies/dependencies.js +1 -2
  18. package/base/lib/dependencies/dependencies.js.map +1 -1
  19. package/base/lib/dependencies/setupDependencies.d.ts +1 -1
  20. package/base/lib/dependencies/setupDependencies.js +5 -4
  21. package/base/lib/dependencies/setupDependencies.js.map +1 -1
  22. package/base/lib/exver/exver.js.map +1 -1
  23. package/base/lib/exver/index.js +18 -9
  24. package/base/lib/exver/index.js.map +1 -1
  25. package/base/lib/index.js +17 -7
  26. package/base/lib/index.js.map +1 -1
  27. package/base/lib/interfaces/Host.d.ts +6 -13
  28. package/base/lib/interfaces/Host.js +3 -21
  29. package/base/lib/interfaces/Host.js.map +1 -1
  30. package/base/lib/interfaces/Origin.d.ts +4 -4
  31. package/base/lib/interfaces/Origin.js +1 -2
  32. package/base/lib/interfaces/Origin.js.map +1 -1
  33. package/base/lib/interfaces/ServiceInterfaceBuilder.d.ts +0 -2
  34. package/base/lib/interfaces/ServiceInterfaceBuilder.js.map +1 -1
  35. package/base/lib/osBindings/AcmeProvider.d.ts +1 -0
  36. package/base/lib/osBindings/{HostKind.js → AcmeProvider.js} +1 -1
  37. package/base/lib/osBindings/AcmeProvider.js.map +1 -0
  38. package/base/lib/osBindings/AcmeSettings.d.ts +0 -8
  39. package/base/lib/osBindings/BindParams.d.ts +0 -2
  40. package/base/lib/osBindings/BindingSetPublicParams.d.ts +4 -0
  41. package/base/lib/osBindings/BindingSetPublicParams.js +4 -0
  42. package/base/lib/osBindings/BindingSetPublicParams.js.map +1 -0
  43. package/base/lib/osBindings/DomainConfig.d.ts +5 -0
  44. package/base/lib/osBindings/{GetPrimaryUrlParams.js → DomainConfig.js} +1 -1
  45. package/base/lib/osBindings/DomainConfig.js.map +1 -0
  46. package/base/lib/osBindings/ExportServiceInterfaceParams.d.ts +0 -1
  47. package/base/lib/osBindings/ForgetInterfaceParams.d.ts +3 -0
  48. package/base/lib/osBindings/ForgetInterfaceParams.js +4 -0
  49. package/base/lib/osBindings/ForgetInterfaceParams.js.map +1 -0
  50. package/base/lib/osBindings/Host.d.ts +5 -4
  51. package/base/lib/osBindings/HostAddress.d.ts +3 -0
  52. package/base/lib/osBindings/HostAddress.js +0 -1
  53. package/base/lib/osBindings/HostAddress.js.map +1 -1
  54. package/base/lib/osBindings/ImageMetadata.d.ts +2 -0
  55. package/base/lib/osBindings/IpHostname.d.ts +1 -0
  56. package/base/lib/osBindings/IpInfo.d.ts +3 -0
  57. package/base/lib/osBindings/IpInfo.js +0 -1
  58. package/base/lib/osBindings/IpInfo.js.map +1 -1
  59. package/base/lib/osBindings/{SetPublicParams.d.ts → NetworkInterfaceSetPublicParams.d.ts} +1 -1
  60. package/base/lib/osBindings/NetworkInterfaceSetPublicParams.js +4 -0
  61. package/base/lib/osBindings/NetworkInterfaceSetPublicParams.js.map +1 -0
  62. package/base/lib/osBindings/NetworkInterfaceType.d.ts +1 -0
  63. package/base/lib/osBindings/{SetPublicParams.js → NetworkInterfaceType.js} +1 -1
  64. package/base/lib/osBindings/NetworkInterfaceType.js.map +1 -0
  65. package/base/lib/osBindings/ServerInfo.d.ts +6 -7
  66. package/base/lib/osBindings/ServiceInterface.d.ts +0 -1
  67. package/base/lib/osBindings/SetupResult.d.ts +1 -1
  68. package/base/lib/osBindings/TestSmtpParams.d.ts +8 -0
  69. package/base/lib/osBindings/{LanInfo.js → TestSmtpParams.js} +1 -1
  70. package/base/lib/osBindings/TestSmtpParams.js.map +1 -0
  71. package/base/lib/osBindings/index.d.ts +7 -3
  72. package/base/lib/s9pk/index.js +7 -10
  73. package/base/lib/s9pk/index.js.map +1 -1
  74. package/base/lib/s9pk/merkleArchive/directoryContents.js +1 -1
  75. package/base/lib/s9pk/merkleArchive/directoryContents.js.map +1 -1
  76. package/base/lib/s9pk/merkleArchive/fileContents.js.map +1 -1
  77. package/base/lib/s9pk/merkleArchive/index.js +1 -1
  78. package/base/lib/s9pk/merkleArchive/index.js.map +1 -1
  79. package/base/lib/s9pk/merkleArchive/varint.js +2 -2
  80. package/base/lib/s9pk/merkleArchive/varint.js.map +1 -1
  81. package/base/lib/types.d.ts +5 -28
  82. package/base/lib/types.js +25 -9
  83. package/base/lib/types.js.map +1 -1
  84. package/base/lib/util/GetSystemSmtp.d.ts +9 -4
  85. package/base/lib/util/GetSystemSmtp.js +20 -2
  86. package/base/lib/util/GetSystemSmtp.js.map +1 -1
  87. package/base/lib/util/Hostname.js +1 -2
  88. package/base/lib/util/Hostname.js.map +1 -1
  89. package/base/lib/util/PathBuilder.d.ts +1 -1
  90. package/base/lib/util/PathBuilder.js.map +1 -1
  91. package/base/lib/util/asError.js.map +1 -1
  92. package/base/lib/util/deepEqual.js +1 -2
  93. package/base/lib/util/deepEqual.js.map +1 -1
  94. package/base/lib/util/deepMerge.js +2 -3
  95. package/base/lib/util/deepMerge.js.map +1 -1
  96. package/base/lib/util/getDefaultString.js +1 -2
  97. package/base/lib/util/getDefaultString.js.map +1 -1
  98. package/base/lib/util/getRandomCharInSet.js +1 -2
  99. package/base/lib/util/getRandomCharInSet.js.map +1 -1
  100. package/base/lib/util/getRandomString.js +1 -2
  101. package/base/lib/util/getRandomString.js.map +1 -1
  102. package/base/lib/util/getServiceInterface.d.ts +9 -9
  103. package/base/lib/util/getServiceInterface.js +33 -19
  104. package/base/lib/util/getServiceInterface.js.map +1 -1
  105. package/base/lib/util/getServiceInterfaces.d.ts +7 -3
  106. package/base/lib/util/getServiceInterfaces.js +23 -18
  107. package/base/lib/util/getServiceInterfaces.js.map +1 -1
  108. package/base/lib/util/graph.js.map +1 -1
  109. package/base/lib/util/index.js +17 -7
  110. package/base/lib/util/index.js.map +1 -1
  111. package/base/lib/util/nullIfEmpty.js +1 -2
  112. package/base/lib/util/nullIfEmpty.js.map +1 -1
  113. package/base/lib/util/once.js +1 -2
  114. package/base/lib/util/once.js.map +1 -1
  115. package/base/lib/util/patterns.d.ts +2 -0
  116. package/base/lib/util/patterns.js +37 -19
  117. package/base/lib/util/patterns.js.map +1 -1
  118. package/base/lib/util/regexes.d.ts +20 -11
  119. package/base/lib/util/regexes.js +35 -13
  120. package/base/lib/util/regexes.js.map +1 -1
  121. package/base/lib/util/stringFromStdErrOut.js +2 -3
  122. package/base/lib/util/stringFromStdErrOut.js.map +1 -1
  123. package/package/lib/StartSdk.d.ts +75 -283
  124. package/package/lib/StartSdk.js +73 -33
  125. package/package/lib/StartSdk.js.map +1 -1
  126. package/package/lib/backup/Backups.js +18 -9
  127. package/package/lib/backup/Backups.js.map +1 -1
  128. package/package/lib/backup/setupBackups.js +1 -2
  129. package/package/lib/backup/setupBackups.js.map +1 -1
  130. package/package/lib/health/HealthCheck.d.ts +3 -1
  131. package/package/lib/health/HealthCheck.js +10 -8
  132. package/package/lib/health/HealthCheck.js.map +1 -1
  133. package/package/lib/health/checkFns/checkPortListening.d.ts +1 -1
  134. package/package/lib/health/checkFns/checkPortListening.js +28 -19
  135. package/package/lib/health/checkFns/checkPortListening.js.map +1 -1
  136. package/package/lib/health/checkFns/index.js +2 -2
  137. package/package/lib/health/checkFns/index.js.map +1 -1
  138. package/package/lib/index.js +17 -7
  139. package/package/lib/index.js.map +1 -1
  140. package/package/lib/inits/setupInit.js +1 -2
  141. package/package/lib/inits/setupInit.js.map +1 -1
  142. package/package/lib/inits/setupInstall.js +2 -2
  143. package/package/lib/inits/setupInstall.js.map +1 -1
  144. package/package/lib/inits/setupUninstall.js +2 -2
  145. package/package/lib/inits/setupUninstall.js.map +1 -1
  146. package/package/lib/mainFn/CommandController.d.ts +7 -9
  147. package/package/lib/mainFn/CommandController.js +97 -41
  148. package/package/lib/mainFn/CommandController.js.map +1 -1
  149. package/package/lib/mainFn/Daemon.d.ts +6 -8
  150. package/package/lib/mainFn/Daemon.js +6 -4
  151. package/package/lib/mainFn/Daemon.js.map +1 -1
  152. package/package/lib/mainFn/Daemons.d.ts +21 -21
  153. package/package/lib/mainFn/Daemons.js +24 -15
  154. package/package/lib/mainFn/Daemons.js.map +1 -1
  155. package/package/lib/mainFn/HealthDaemon.d.ts +4 -1
  156. package/package/lib/mainFn/HealthDaemon.js +18 -7
  157. package/package/lib/mainFn/HealthDaemon.js.map +1 -1
  158. package/package/lib/mainFn/Mounts.js.map +1 -1
  159. package/package/lib/mainFn/index.js +1 -1
  160. package/package/lib/mainFn/index.js.map +1 -1
  161. package/package/lib/manifest/setupManifest.js +12 -14
  162. package/package/lib/manifest/setupManifest.js.map +1 -1
  163. package/package/lib/store/getStore.d.ts +6 -2
  164. package/package/lib/store/getStore.js +22 -4
  165. package/package/lib/store/getStore.js.map +1 -1
  166. package/package/lib/test/host.test.js +1 -2
  167. package/package/lib/test/host.test.js.map +1 -1
  168. package/package/lib/test/output.sdk.d.ts +137 -125
  169. package/package/lib/test/output.test.js +1 -2
  170. package/package/lib/test/output.test.js.map +1 -1
  171. package/package/lib/trigger/changeOnFirstSuccess.js +2 -3
  172. package/package/lib/trigger/changeOnFirstSuccess.js.map +1 -1
  173. package/package/lib/trigger/cooldownTrigger.js +1 -2
  174. package/package/lib/trigger/cooldownTrigger.js.map +1 -1
  175. package/package/lib/trigger/lastStatus.js +2 -4
  176. package/package/lib/trigger/lastStatus.js.map +1 -1
  177. package/package/lib/util/GetSslCertificate.d.ts +7 -3
  178. package/package/lib/util/GetSslCertificate.js +21 -3
  179. package/package/lib/util/GetSslCertificate.js.map +1 -1
  180. package/package/lib/util/SubContainer.d.ts +4 -5
  181. package/package/lib/util/SubContainer.js +51 -20
  182. package/package/lib/util/SubContainer.js.map +1 -1
  183. package/package/lib/util/fileHelper.d.ts +3 -1
  184. package/package/lib/util/fileHelper.js +55 -20
  185. package/package/lib/util/fileHelper.js.map +1 -1
  186. package/package/lib/version/VersionGraph.js.map +1 -1
  187. package/package/scripts/oldSpecToBuilder.js +49 -45
  188. package/package/scripts/oldSpecToBuilder.js.map +1 -1
  189. package/package.json +2 -2
  190. package/base/lib/dependencies/Dependency.d.ts +0 -29
  191. package/base/lib/dependencies/Dependency.js +0 -10
  192. package/base/lib/dependencies/Dependency.js.map +0 -1
  193. package/base/lib/osBindings/GetPrimaryUrlParams.d.ts +0 -8
  194. package/base/lib/osBindings/GetPrimaryUrlParams.js.map +0 -1
  195. package/base/lib/osBindings/HostKind.d.ts +0 -1
  196. package/base/lib/osBindings/HostKind.js.map +0 -1
  197. package/base/lib/osBindings/LanInfo.d.ts +0 -4
  198. package/base/lib/osBindings/LanInfo.js.map +0 -1
  199. package/base/lib/osBindings/SetPublicParams.js.map +0 -1
@@ -1,7 +1,6 @@
1
- /// <reference types="node" />
2
1
  import { Value } from "../../base/lib/actions/input/builder/value";
3
- import { InputSpec, ExtractInputSpecType, LazyBuild } from "../../base/lib/actions/input/builder/inputSpec";
4
- import { DefaultString, ListValueSpecText, Pattern, RandomString, UniqueBy, ValueSpecDatetime, ValueSpecText } from "../../base/lib/actions/input/inputSpecTypes";
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";
5
4
  import { Variants } from "../../base/lib/actions/input/builder/variants";
6
5
  import { Action, Actions } from "../../base/lib/actions/setupActions";
7
6
  import { SyncOptions, ServiceInterfaceId, PackageId, HealthReceipt, ServiceInterfaceType, Effects } from "../../base/lib/types";
@@ -23,6 +22,7 @@ import { nullIfEmpty } from "./util";
23
22
  import { CommandOptions, MountOptions, SubContainer } from "./util/SubContainer";
24
23
  import { Mounts } from "./mainFn/Mounts";
25
24
  import * as T from "../../base/lib/types";
25
+ import { ExposedStorePaths } from "./store/setupExposeStore";
26
26
  import { PathBuilder } from "../../base/lib/util/PathBuilder";
27
27
  import { CheckDependencies } from "../../base/lib/dependencies/dependencies";
28
28
  import { GetSslCertificate } from "./util";
@@ -42,44 +42,45 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
42
42
  build(isReady: AnyNeverCond<[Manifest, Store], "Build not ready", true>): {
43
43
  action: {
44
44
  run: <Input extends Record<string, unknown>>(options: {
45
- effects: Effects;
46
- actionId: string;
47
- input?: actions.RunActionInput<Input> | undefined;
45
+ effects: T.Effects;
46
+ actionId: T.ActionId;
47
+ input?: actions.RunActionInput<Input>;
48
48
  }) => Promise<T.ActionResult | null>;
49
- request: <T extends Action<string, any, any>>(effects: Effects, packageId: string, action: T, severity: T.ActionSeverity, options?: actions.ActionRequestOptions<T> | undefined) => Promise<null>;
50
- requestOwn: <T_1 extends Action<string, Store, any>>(effects: Effects, action: T_1, severity: T.ActionSeverity, options?: actions.ActionRequestOptions<T_1> | undefined) => Promise<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
51
  clearRequest: (effects: T.Effects, ...replayIds: string[]) => Promise<null>;
52
52
  };
53
- checkDependencies: <DependencyId extends keyof Manifest["dependencies"] & string = keyof Manifest["dependencies"] & string>(effects: Effects, packageIds?: DependencyId[] | undefined) => Promise<CheckDependencies<DependencyId>>;
53
+ checkDependencies: <DependencyId extends keyof Manifest["dependencies"] & PackageId = keyof Manifest["dependencies"] & PackageId>(effects: Effects, packageIds?: DependencyId[]) => Promise<CheckDependencies<DependencyId>>;
54
54
  serviceInterface: {
55
55
  getOwn: <E extends Effects>(effects: E, id: ServiceInterfaceId) => import("./util").GetServiceInterface;
56
- get: <E_1 extends Effects>(effects: E_1, opts: {
56
+ get: <E extends Effects>(effects: E, opts: {
57
57
  id: ServiceInterfaceId;
58
58
  packageId: PackageId;
59
59
  }) => import("./util").GetServiceInterface;
60
- getAllOwn: <E_2 extends Effects>(effects: E_2) => import("../../base/lib/util/getServiceInterfaces").GetServiceInterfaces;
61
- getAll: <E_3 extends Effects>(effects: E_3, opts: {
60
+ getAllOwn: <E extends Effects>(effects: E) => import("../../base/lib/util/getServiceInterfaces").GetServiceInterfaces;
61
+ getAll: <E extends Effects>(effects: E, opts: {
62
62
  packageId: PackageId;
63
63
  }) => import("../../base/lib/util/getServiceInterfaces").GetServiceInterfaces;
64
64
  };
65
65
  store: {
66
- get: <E_4 extends Effects, StoreValue = unknown>(effects: E_4, packageId: string, path: PathBuilder<Store, StoreValue>) => import("./store/getStore").GetStore<Store, StoreValue>;
67
- getOwn: <E_5 extends Effects, StoreValue_1 = unknown>(effects: E_5, path: PathBuilder<Store, StoreValue_1>) => import("./store/getStore").GetStore<Store, StoreValue_1>;
68
- setOwn: <E_6 extends Effects, Path extends import("../../base/lib/util/PathBuilder").PathBuilderStored<Store, unknown>>(effects: E_6, path: Path, value: Path extends PathBuilder<Store, infer Value_1> ? Value_1 : never) => Promise<null>;
66
+ get: <E extends Effects, StoreValue = unknown>(effects: E, packageId: string, path: PathBuilder<Store, StoreValue>) => import("./store/getStore").GetStore<Store, StoreValue>;
67
+ getOwn: <E extends Effects, StoreValue = unknown>(effects: E, path: PathBuilder<Store, StoreValue>) => import("./store/getStore").GetStore<Store, StoreValue>;
68
+ setOwn: <E extends Effects, Path extends PathBuilder<Store, unknown>>(effects: E, path: Path, value: Path extends PathBuilder<Store, infer Value> ? Value : never) => Promise<null>;
69
69
  };
70
- host: {
71
- multi: (effects: Effects, id: string) => MultiHost;
70
+ MultiHost: {
71
+ of: (effects: Effects, id: string) => MultiHost;
72
72
  };
73
73
  nullIfEmpty: typeof nullIfEmpty;
74
+ useEntrypoint: (overrideCmd?: string[]) => T.UseEntrypoint;
74
75
  runCommand: <A extends string>(effects: Effects, image: {
75
- id: keyof Manifest["images"] & T.ImageId;
76
+ imageId: keyof Manifest["images"] & T.ImageId;
76
77
  sharedRun?: boolean;
77
78
  }, command: T.CommandType, options: CommandOptions & {
78
79
  mounts?: {
79
80
  path: string;
80
81
  options: MountOptions;
81
- }[] | undefined;
82
- }, name: string) => Promise<{
82
+ }[];
83
+ }, name?: string) => Promise<{
83
84
  stdout: string | Buffer;
84
85
  stderr: string | Buffer;
85
86
  }>;
@@ -145,7 +146,7 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
145
146
  )
146
147
  * ```
147
148
  */
148
- withInput: <Id extends string, InputSpecType extends Record<string, any> | InputSpec<any, never> | InputSpec<any, any>, Type extends ExtractInputSpecType<InputSpecType> = ExtractInputSpecType<InputSpecType>>(id: Id, metadata: MaybeFn<Omit<T.ActionMetadata, "hasInput">>, inputSpec: InputSpecType, getInput: GetInput<Type>, run: Run<Type>) => Action<Id, unknown, InputSpecType>;
149
+ 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>;
149
150
  /**
150
151
  * @description Use this function to create an action that does not accept form input
151
152
  * @param id - a unique ID for this action
@@ -190,7 +191,7 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
190
191
  )
191
192
  * ```
192
193
  */
193
- withoutInput: <Id_1 extends string>(id: Id_1, metadata: MaybeFn<Omit<T.ActionMetadata, "hasInput">>, run: Run<{}>) => Action<Id_1, unknown, {}>;
194
+ withoutInput: <Id extends T.ActionId>(id: Id, metadata: MaybeFn<Omit<T.ActionMetadata, "hasInput">>, run: Run<{}>) => Action<Id, unknown, {}>;
194
195
  };
195
196
  inputSpecConstants: {
196
197
  smtpInputSpec: Value<import("../../base/lib/actions/input/builder/variants").UnionRes<never, {
@@ -229,7 +230,6 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
229
230
  id: 'ui',
230
231
  description: 'The primary web app for this service.',
231
232
  type: 'ui',
232
- hasPrimary: false,
233
233
  masked: false,
234
234
  schemeOverride: null,
235
235
  username: null,
@@ -245,8 +245,6 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
245
245
  id: string;
246
246
  /** The human readable description. */
247
247
  description: string;
248
- /** No effect until StartOS v0.4.0. If true, forces the user to select one URL (i.e. .onion, .local, or IP address) as the primary URL. This is needed by some services to function properly. */
249
- hasPrimary: boolean;
250
248
  /** Affects how the interface appears to the user. One of: 'ui', 'api', 'p2p'. If 'ui', the user will see a "Launch UI" button */
251
249
  type: ServiceInterfaceType;
252
250
  /** (optional) prepends the provided username to all URLs. */
@@ -266,8 +264,8 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
266
264
  /** TODO Aiden how would someone include a password in the URL? Whether or not to mask the URLs on the screen, for example, when they contain a password */
267
265
  masked: boolean;
268
266
  }) => ServiceInterfaceBuilder;
269
- getSystemSmtp: <E_7 extends Effects>(effects: E_7) => GetSystemSmtp;
270
- getSslCerificate: <E_8 extends Effects>(effects: E_8, hostnames: string[], algorithm?: T.Algorithm) => GetSslCertificate;
267
+ getSystemSmtp: <E extends Effects>(effects: E) => GetSystemSmtp;
268
+ getSslCerificate: <E extends Effects>(effects: E, hostnames: string[], algorithm?: T.Algorithm) => GetSslCertificate;
271
269
  HealthCheck: {
272
270
  of(effects: T.Effects, o: Omit<HealthCheckParams, "effects">): HealthReceipt;
273
271
  };
@@ -372,13 +370,13 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
372
370
  * ```
373
371
  */
374
372
  setupDependencies: (fn: (options: {
375
- effects: Effects;
373
+ effects: T.Effects;
376
374
  }) => Promise<T.CurrentDependenciesResult<Manifest>>) => (options: {
377
- effects: Effects;
375
+ effects: T.Effects;
378
376
  }) => Promise<null>;
379
377
  setupInit: (versions: VersionGraph<string>, install: Install<Manifest, Store>, uninstall: import("./inits/setupUninstall").Uninstall<Manifest, Store>, setServiceInterfaces: UpdateServiceInterfaces<any>, setDependencies: (options: {
380
- effects: Effects;
381
- }) => Promise<void | null | undefined>, actions: Actions<Store, any>, exposedStore: T.ExposedStorePaths) => {
378
+ effects: T.Effects;
379
+ }) => Promise<null | void | undefined>, actions: Actions<Store, any>, exposedStore: ExposedStorePaths) => {
382
380
  packageInit: T.ExpectedExports.packageInit;
383
381
  packageUninit: T.ExpectedExports.packageUninit;
384
382
  containerInit: T.ExpectedExports.containerInit;
@@ -418,7 +416,7 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
418
416
  inputSpecSpec,
419
417
  async ({ effects, input }) => {
420
418
  // ** UI multi-host **
421
- const uiMulti = sdk.host.multi(effects, 'ui-multi')
419
+ const uiMulti = sdk.MultiHost.of(effects, 'ui-multi')
422
420
  const uiMultiOrigin = await uiMulti.bindPort(80, {
423
421
  protocol: 'http',
424
422
  })
@@ -428,7 +426,6 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
428
426
  id: 'primary-ui',
429
427
  description: 'The primary web app for this service.',
430
428
  type: 'ui',
431
- hasPrimary: false,
432
429
  masked: false,
433
430
  schemeOverride: null,
434
431
  username: null,
@@ -441,7 +438,6 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
441
438
  id: 'admin-ui',
442
439
  description: 'The admin web app for this service.',
443
440
  type: 'ui',
444
- hasPrimary: false,
445
441
  masked: false,
446
442
  schemeOverride: null,
447
443
  username: null,
@@ -452,7 +448,7 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
452
448
  const uiReceipt = await uiMultiOrigin.export([primaryUi, adminUi])
453
449
 
454
450
  // ** API multi-host **
455
- const apiMulti = sdk.host.multi(effects, 'api-multi')
451
+ const apiMulti = sdk.MultiHost.of(effects, 'api-multi')
456
452
  const apiMultiOrigin = await apiMulti.bindPort(5959, {
457
453
  protocol: 'http',
458
454
  })
@@ -462,7 +458,6 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
462
458
  id: 'api',
463
459
  description: 'The advanced API for this service.',
464
460
  type: 'api',
465
- hasPrimary: false,
466
461
  masked: false,
467
462
  schemeOverride: null,
468
463
  username: null,
@@ -532,11 +527,24 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
532
527
  })
533
528
  * ```
534
529
  */
535
- of: <Spec extends Record<string, Value<any, never> | Value<any, Store>>>(spec: Spec) => InputSpec<{ [K in keyof Spec]: Spec[K] extends Value<infer T_2, never> | Value<infer T_2, Store> ? T_2 : never; }, Store>;
530
+ 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>;
536
531
  };
537
532
  Daemons: {
538
533
  of(effects: Effects, started: (onTerm: () => PromiseLike<void>) => PromiseLike<null>, healthReceipts: HealthReceipt[]): Daemons<Manifest, never>;
539
534
  };
535
+ SubContainer: {
536
+ of(effects: Effects, image: {
537
+ imageId: T.ImageId & keyof Manifest["images"];
538
+ sharedRun?: boolean;
539
+ }, name: string): Promise<SubContainer>;
540
+ with<T>(effects: T.Effects, image: {
541
+ imageId: T.ImageId & keyof Manifest["images"];
542
+ sharedRun?: boolean;
543
+ }, mounts: {
544
+ options: MountOptions;
545
+ path: string;
546
+ }[], name: string, fn: (subContainer: SubContainer) => Promise<T>): Promise<T>;
547
+ };
540
548
  List: {
541
549
  /**
542
550
  * @description Create a list of text inputs.
@@ -549,78 +557,7 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
549
557
  * @param a - attributes of the list itself.
550
558
  * @param aSpec - attributes describing each member of the list.
551
559
  */
552
- obj: <Type_1 extends Record<string, any>>(a: {
553
- name: string;
554
- description?: string | null;
555
- /** Presents a warning before adding/removing/editing a list item. */
556
- warning?: string | null;
557
- default?: [];
558
- minLength?: number | null;
559
- maxLength?: number | null;
560
- }, aSpec: {
561
- spec: InputSpec<Type_1, Store>;
562
- /**
563
- * @description The ID of a required field on the inner object whose value will be used to display items in the list.
564
- * @example
565
- * In this example, we use the value of the `label` field to display members of the list.
566
- *
567
- * ```
568
- spec: InputSpec.of({
569
- label: Value.text({
570
- name: 'Label',
571
- required: false,
572
- default: null,
573
- })
574
- })
575
- displayAs: 'label',
576
- uniqueBy: null,
577
- * ```
578
- *
579
- */
580
- displayAs?: string | null | undefined;
581
- /**
582
- * @description The ID(s) of required fields on the inner object whose value(s) will be used to enforce uniqueness in the list.
583
- * @example
584
- * In this example, we use the `label` field to enforce uniqueness, meaning the label field must be unique from other entries.
585
- *
586
- * ```
587
- spec: InputSpec.of({
588
- label: Value.text({
589
- name: 'Label',
590
- required: true,
591
- default: null,
592
- })
593
- pubkey: Value.text({
594
- name: 'Pubkey',
595
- required: true,
596
- default: null,
597
- })
598
- })
599
- displayAs: 'label',
600
- uniqueBy: 'label',
601
- * ```
602
- * @example
603
- * In this example, we use the `label` field AND the `pubkey` field to enforce uniqueness, meaning both these fields must be unique from other entries.
604
- *
605
- * ```
606
- spec: InputSpec.of({
607
- label: Value.text({
608
- name: 'Label',
609
- required: true,
610
- default: null,
611
- })
612
- pubkey: Value.text({
613
- name: 'Pubkey',
614
- required: true,
615
- default: null,
616
- })
617
- })
618
- displayAs: 'label',
619
- uniqueBy: { all: ['label', 'pubkey'] },
620
- * ```
621
- */
622
- uniqueBy?: UniqueBy | undefined;
623
- }) => List<Type_1[], Store>;
560
+ 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>;
624
561
  /**
625
562
  * @description Create a list of dynamic text inputs.
626
563
  * @param a - attributes of the list itself.
@@ -640,7 +577,7 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
640
577
  placeholder?: string | null;
641
578
  minLength?: number | null;
642
579
  maxLength?: number | null;
643
- patterns: Pattern[];
580
+ patterns?: Pattern[];
644
581
  inputmode?: ListValueSpecText["inputmode"];
645
582
  };
646
583
  }>) => List<string[], Store>;
@@ -935,7 +872,6 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
935
872
  dynamicToggle: (a: LazyBuild<Store, {
936
873
  name: string;
937
874
  description?: string | null;
938
- /** Presents a warning prompt before permitting the value to change. */
939
875
  warning?: string | null;
940
876
  default: boolean;
941
877
  disabled?: false | string;
@@ -943,53 +879,21 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
943
879
  dynamicText: (getA: LazyBuild<Store, {
944
880
  name: string;
945
881
  description?: string | null;
946
- /** Presents a warning prompt before permitting the value to change. */
947
882
  warning?: string | null;
948
- /**
949
- * @description optionally provide a default value.
950
- * @type { string | RandomString | null }
951
- * @example default: null
952
- * @example default: 'World'
953
- * @example default: { charset: 'abcdefg', len: 16 }
954
- */
955
883
  default: DefaultString | null;
956
884
  required: boolean;
957
- /**
958
- * @description Mask (aka camouflage) text input with dots: ● ● ●
959
- * @default false
960
- */
961
885
  masked?: boolean;
962
886
  placeholder?: string | null;
963
887
  minLength?: number | null;
964
888
  maxLength?: number | null;
965
- /**
966
- * @description A list of regular expressions to which the text must conform to pass validation. A human readable description is provided in case the validation fails.
967
- * @default []
968
- * @example
969
- * ```
970
- [
971
- {
972
- regex: "[a-z]",
973
- description: "May only contain lower case letters from the English alphabet."
974
- }
975
- ]
976
- * ```
977
- */
978
889
  patterns?: Pattern[];
979
- /**
980
- * @description Informs the browser how to behave and which keyboard to display on mobile
981
- * @default "text"
982
- */
983
890
  inputmode?: ValueSpecText["inputmode"];
984
- /**
985
- * @description Displays a button that will generate a random string according to the provided charset and len attributes.
986
- */
891
+ disabled?: string | false;
987
892
  generate?: null | RandomString;
988
893
  }>) => Value<string | null, Store>;
989
894
  dynamicTextarea: (getA: LazyBuild<Store, {
990
895
  name: string;
991
896
  description?: string | null;
992
- /** Presents a warning prompt before permitting the value to change. */
993
897
  warning?: string | null;
994
898
  default: string | null;
995
899
  required: boolean;
@@ -1001,30 +905,13 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
1001
905
  dynamicNumber: (getA: LazyBuild<Store, {
1002
906
  name: string;
1003
907
  description?: string | null;
1004
- /** Presents a warning prompt before permitting the value to change. */
1005
908
  warning?: string | null;
1006
- /**
1007
- * @description optionally provide a default value.
1008
- * @type { number | null }
1009
- * @example default: null
1010
- * @example default: 7
1011
- */
1012
909
  default: number | null;
1013
910
  required: boolean;
1014
911
  min?: number | null;
1015
912
  max?: number | null;
1016
- /**
1017
- * @description How much does the number increase/decrease when using the arrows provided by the browser.
1018
- * @default 1
1019
- */
1020
913
  step?: number | null;
1021
- /**
1022
- * @description Requires the number to be an integer.
1023
- */
1024
914
  integer: boolean;
1025
- /**
1026
- * @description Optionally display units to the right of the input box.
1027
- */
1028
915
  units?: string | null;
1029
916
  placeholder?: string | null;
1030
917
  disabled?: false | string;
@@ -1032,14 +919,7 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
1032
919
  dynamicColor: (getA: LazyBuild<Store, {
1033
920
  name: string;
1034
921
  description?: string | null;
1035
- /** Presents a warning prompt before permitting the value to change. */
1036
922
  warning?: string | null;
1037
- /**
1038
- * @description optionally provide a default value.
1039
- * @type { string | null }
1040
- * @example default: null
1041
- * @example default: 'ffffff'
1042
- */
1043
923
  default: string | null;
1044
924
  required: boolean;
1045
925
  disabled?: false | string;
@@ -1047,141 +927,52 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
1047
927
  dynamicDatetime: (getA: LazyBuild<Store, {
1048
928
  name: string;
1049
929
  description?: string | null;
1050
- /** Presents a warning prompt before permitting the value to change. */
1051
930
  warning?: string | null;
1052
- /**
1053
- * @description optionally provide a default value.
1054
- * @type { string | null }
1055
- * @example default: null
1056
- * @example default: '1985-12-16 18:00:00.000'
1057
- */
1058
- default: string;
931
+ default: string | null;
1059
932
  required: boolean;
1060
- /**
1061
- * @description Informs the browser how to behave and which date/time component to display.
1062
- * @default "datetime-local"
1063
- */
1064
933
  inputmode?: ValueSpecDatetime["inputmode"];
1065
934
  min?: string | null;
1066
935
  max?: string | null;
1067
936
  disabled?: false | string;
1068
937
  }>) => Value<string | null, Store>;
1069
- dynamicSelect: <Variants_1 extends Record<string, string>>(getA: LazyBuild<Store, {
938
+ dynamicSelect: (getA: LazyBuild<Store, {
1070
939
  name: string;
1071
- description?: string | null | undefined;
1072
- /** Presents a warning prompt before permitting the value to change. */
1073
- warning?: string | null | undefined;
1074
- /**
1075
- * @description provide a default value from the list of values.
1076
- * @type { default: string }
1077
- * @example default: 'radio1'
1078
- */
1079
- default: keyof Variants_1 & string;
1080
- required: boolean;
1081
- /**
1082
- * @description A mapping of unique radio options to their human readable display format.
1083
- * @example
1084
- * ```
1085
- {
1086
- radio1: "Radio 1"
1087
- radio2: "Radio 2"
1088
- radio3: "Radio 3"
1089
- }
1090
- * ```
1091
- */
1092
- values: Variants_1;
1093
- /**
1094
- * @options
1095
- * - false - The field can be modified.
1096
- * - string - The field cannot be modified. The provided text explains why.
1097
- * - string[] - The field can be modified, but the values contained in the array cannot be selected.
1098
- * @default false
1099
- */
1100
- disabled?: string | false | string[] | undefined;
940
+ description?: string | null;
941
+ warning?: string | null;
942
+ default: string;
943
+ values: Record<string, string>;
944
+ disabled?: false | string | string[];
1101
945
  }>) => Value<string, Store>;
1102
946
  dynamicMultiselect: (getA: LazyBuild<Store, {
1103
947
  name: string;
1104
948
  description?: string | null;
1105
- /** Presents a warning prompt before permitting the value to change. */
1106
949
  warning?: string | null;
1107
- /**
1108
- * @description A simple list of which options should be checked by default.
1109
- */
1110
950
  default: string[];
1111
- /**
1112
- * @description A mapping of checkbox options to their human readable display format.
1113
- * @example
1114
- * ```
1115
- {
1116
- option1: "Option 1"
1117
- option2: "Option 2"
1118
- option3: "Option 3"
1119
- }
1120
- * ```
1121
- */
1122
951
  values: Record<string, string>;
1123
952
  minLength?: number | null;
1124
953
  maxLength?: number | null;
1125
- /**
1126
- * @options
1127
- * - false - The field can be modified.
1128
- * - string - The field cannot be modified. The provided text explains why.
1129
- * - string[] - The field can be modified, but the values contained in the array cannot be selected.
1130
- * @default false
1131
- */
1132
954
  disabled?: false | string | string[];
1133
955
  }>) => Value<string[], Store>;
1134
- filteredUnion: <VariantValues extends {
1135
- [x: string]: {
1136
- name: string;
1137
- spec: InputSpec<any, Store> | InputSpec<any, never>;
1138
- };
1139
- }>(getDisabledFn: LazyBuild<Store, string[]>, a: {
956
+ filteredUnion: <VariantValues extends { [K in string]: {
1140
957
  name: string;
1141
- description?: string | null | undefined;
1142
- warning?: string | null | undefined;
1143
- default: keyof VariantValues & string;
1144
- }, aVariants: Variants<VariantValues, Store> | Variants<VariantValues, never>) => 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>;
1145
- dynamicUnion: <VariantValues_1 extends {
1146
- [x: string]: {
1147
- name: string;
1148
- spec: InputSpec<any, Store> | InputSpec<any, never>;
1149
- };
1150
- }>(getA: LazyBuild<Store, {
958
+ spec: InputSpec<any, Store> | InputSpec<any, never>;
959
+ }; }>(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>;
960
+ dynamicUnion: <VariantValues extends { [K in string]: {
1151
961
  name: string;
1152
- description?: string | null | undefined;
1153
- /** Presents a warning prompt before permitting the value to change. */
1154
- warning?: string | null | undefined;
1155
- /**
1156
- * @description provide a default value from the list of variants.
1157
- * @type { string }
1158
- * @example default: 'variant1'
1159
- */
1160
- default: keyof VariantValues_1 & string;
1161
- required: boolean;
1162
- /**
1163
- * @options
1164
- * - false - The field can be modified.
1165
- * - string - The field cannot be modified. The provided text explains why.
1166
- * - string[] - The field can be modified, but the values contained in the array cannot be selected.
1167
- * @default false
1168
- */
1169
- disabled: false | string | string[];
1170
- }>, aVariants: Variants<VariantValues_1, Store> | Variants<VariantValues_1, never>) => Value<import("../../base/lib/actions/input/builder/variants").UnionRes<Store, VariantValues_1, keyof VariantValues_1 & string> | import("../../base/lib/actions/input/builder/variants").UnionRes<never, VariantValues_1, keyof VariantValues_1 & string>, Store>;
962
+ spec: InputSpec<any, Store> | InputSpec<any, never>;
963
+ }; }>(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>;
1171
964
  };
1172
965
  Variants: {
1173
- of: <VariantValues_2 extends {
1174
- [x: string]: {
1175
- name: string;
1176
- spec: InputSpec<any, Store>;
1177
- };
1178
- }>(a: VariantValues_2) => Variants<VariantValues_2, Store>;
966
+ of: <VariantValues extends { [K in string]: {
967
+ name: string;
968
+ spec: InputSpec<any, Store>;
969
+ }; }>(a: VariantValues) => Variants<VariantValues, Store>;
1179
970
  };
1180
971
  restart: (effects: Effects) => Promise<null>;
1181
972
  shutdown: (effects: Effects) => Promise<null>;
1182
973
  getStatus: (effects: Effects, options: {
1183
- packageId?: string | undefined;
1184
- callback?: (() => void) | undefined;
974
+ packageId?: PackageId;
975
+ callback?: () => void;
1185
976
  }) => Promise<T.MainStatus>;
1186
977
  setDependencies: (effects: Effects, options: {
1187
978
  dependencies: T.Dependencies;
@@ -1201,20 +992,21 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
1201
992
  paths: string[];
1202
993
  }) => Promise<null>;
1203
994
  getServicePortForward: (effects: Effects, options: {
1204
- packageId?: string | undefined;
1205
- hostId: string;
995
+ packageId?: PackageId;
996
+ hostId: T.HostId;
1206
997
  internalPort: number;
1207
998
  }) => Promise<T.NetInfo>;
1208
999
  clearBindings: (effects: Effects, options: {
1209
1000
  except: {
1210
- id: string;
1001
+ id: T.HostId;
1211
1002
  internalPort: number;
1212
1003
  }[];
1213
1004
  }) => Promise<null>;
1214
1005
  getContainerIp: (effects: Effects) => Promise<string>;
1006
+ getOsIp: (effects: Effects) => Promise<string>;
1215
1007
  getSslKey: (effects: Effects, options: {
1216
1008
  hostnames: string[];
1217
- algorithm?: "ecdsa" | "ed25519" | undefined;
1009
+ algorithm?: "ecdsa" | "ed25519";
1218
1010
  }) => Promise<string>;
1219
1011
  setDataVersion: (effects: Effects, options: {
1220
1012
  version: string;
@@ -1224,14 +1016,14 @@ export declare class StartSdk<Manifest extends T.SDKManifest, Store> {
1224
1016
  };
1225
1017
  }
1226
1018
  export declare function runCommand<Manifest extends T.SDKManifest>(effects: Effects, image: {
1227
- id: keyof Manifest["images"] & T.ImageId;
1019
+ imageId: keyof Manifest["images"] & T.ImageId;
1228
1020
  sharedRun?: boolean;
1229
- }, command: string | [string, ...string[]], options: CommandOptions & {
1021
+ }, command: T.CommandType, options: CommandOptions & {
1230
1022
  mounts?: {
1231
1023
  path: string;
1232
1024
  options: MountOptions;
1233
1025
  }[];
1234
- }, name: string): Promise<{
1026
+ }, name?: string): Promise<{
1235
1027
  stdout: string | Buffer;
1236
1028
  stderr: string | Buffer;
1237
1029
  }>;