@start9labs/start-sdk 0.4.0-beta.50 → 0.4.0-beta.52

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 (165) hide show
  1. package/base/lib/Effects.d.ts +4 -0
  2. package/base/lib/actions/input/builder/inputSpec.d.ts +129 -8
  3. package/base/lib/actions/input/builder/inputSpec.js +223 -13
  4. package/base/lib/actions/input/builder/inputSpec.js.map +1 -1
  5. package/base/lib/actions/input/builder/inputSpecTools.d.ts +3 -3
  6. package/base/lib/actions/input/builder/list.d.ts +24 -3
  7. package/base/lib/actions/input/builder/list.js +26 -5
  8. package/base/lib/actions/input/builder/list.js.map +1 -1
  9. package/base/lib/actions/input/builder/value.d.ts +70 -16
  10. package/base/lib/actions/input/builder/value.js +89 -34
  11. package/base/lib/actions/input/builder/value.js.map +1 -1
  12. package/base/lib/actions/input/builder/variants.d.ts +14 -3
  13. package/base/lib/actions/input/builder/variants.js +22 -7
  14. package/base/lib/actions/input/builder/variants.js.map +1 -1
  15. package/base/lib/actions/input/inputSpecConstants.d.ts +203 -5
  16. package/base/lib/actions/input/inputSpecConstants.js +118 -38
  17. package/base/lib/actions/input/inputSpecConstants.js.map +1 -1
  18. package/base/lib/actions/input/inputSpecTypes.d.ts +99 -0
  19. package/base/lib/actions/input/inputSpecTypes.js +6 -1
  20. package/base/lib/actions/input/inputSpecTypes.js.map +1 -1
  21. package/base/lib/actions/setupActions.d.ts +6 -3
  22. package/base/lib/actions/setupActions.js +7 -4
  23. package/base/lib/actions/setupActions.js.map +1 -1
  24. package/base/lib/exver/index.d.ts +233 -2
  25. package/base/lib/exver/index.js +197 -3
  26. package/base/lib/exver/index.js.map +1 -1
  27. package/base/lib/index.d.ts +23 -1
  28. package/base/lib/index.js +4 -2
  29. package/base/lib/index.js.map +1 -1
  30. package/base/lib/inits/setupInit.d.ts +17 -0
  31. package/base/lib/inits/setupInit.js +7 -0
  32. package/base/lib/inits/setupInit.js.map +1 -1
  33. package/base/lib/inits/setupUninit.d.ts +12 -0
  34. package/base/lib/inits/setupUninit.js +7 -0
  35. package/base/lib/inits/setupUninit.js.map +1 -1
  36. package/base/lib/interfaces/Host.js +2 -4
  37. package/base/lib/interfaces/Host.js.map +1 -1
  38. package/base/lib/osBindings/GetOutboundGatewayParams.d.ts +4 -0
  39. package/base/lib/osBindings/GetOutboundGatewayParams.js +3 -0
  40. package/base/lib/osBindings/GetOutboundGatewayParams.js.map +1 -0
  41. package/base/lib/osBindings/ServerHostname.d.ts +1 -0
  42. package/base/lib/osBindings/ServerHostname.js +4 -0
  43. package/base/lib/osBindings/ServerHostname.js.map +1 -0
  44. package/base/lib/osBindings/ServerInfo.d.ts +1 -0
  45. package/base/lib/osBindings/SetServerHostnameParams.d.ts +4 -0
  46. package/base/lib/osBindings/SetServerHostnameParams.js +4 -0
  47. package/base/lib/osBindings/SetServerHostnameParams.js.map +1 -0
  48. package/base/lib/osBindings/SetupExecuteParams.d.ts +3 -1
  49. package/base/lib/osBindings/SmtpSecurity.d.ts +1 -0
  50. package/base/lib/osBindings/SmtpSecurity.js +4 -0
  51. package/base/lib/osBindings/SmtpSecurity.js.map +1 -0
  52. package/base/lib/osBindings/SmtpValue.d.ts +4 -2
  53. package/base/lib/osBindings/SmtpValue.js +0 -1
  54. package/base/lib/osBindings/SmtpValue.js.map +1 -1
  55. package/base/lib/osBindings/StartOsRecoveryInfo.d.ts +2 -2
  56. package/base/lib/osBindings/TestSmtpParams.d.ts +4 -2
  57. package/base/lib/osBindings/TestSmtpParams.js +0 -1
  58. package/base/lib/osBindings/TestSmtpParams.js.map +1 -1
  59. package/base/lib/osBindings/index.d.ts +4 -1
  60. package/base/lib/s9pk/index.d.ts +66 -0
  61. package/base/lib/s9pk/index.js +70 -1
  62. package/base/lib/s9pk/index.js.map +1 -1
  63. package/base/lib/types.d.ts +68 -2
  64. package/base/lib/types.js +14 -0
  65. package/base/lib/types.js.map +1 -1
  66. package/base/lib/util/GetOutboundGateway.d.ts +30 -0
  67. package/base/lib/util/GetOutboundGateway.js +90 -0
  68. package/base/lib/util/GetOutboundGateway.js.map +1 -0
  69. package/base/lib/util/asError.d.ts +8 -0
  70. package/base/lib/util/asError.js +8 -0
  71. package/base/lib/util/asError.js.map +1 -1
  72. package/base/lib/util/deepEqual.d.ts +15 -0
  73. package/base/lib/util/deepEqual.js +16 -2
  74. package/base/lib/util/deepEqual.js.map +1 -1
  75. package/base/lib/util/deepMerge.d.ts +18 -0
  76. package/base/lib/util/deepMerge.js +18 -0
  77. package/base/lib/util/deepMerge.js.map +1 -1
  78. package/base/lib/util/getDefaultString.d.ts +8 -0
  79. package/base/lib/util/getDefaultString.js +8 -0
  80. package/base/lib/util/getDefaultString.js.map +1 -1
  81. package/base/lib/util/graph.d.ts +57 -0
  82. package/base/lib/util/graph.js +47 -0
  83. package/base/lib/util/graph.js.map +1 -1
  84. package/base/lib/util/inMs.d.ts +15 -0
  85. package/base/lib/util/inMs.js +15 -0
  86. package/base/lib/util/inMs.js.map +1 -1
  87. package/base/lib/util/index.d.ts +1 -0
  88. package/base/lib/util/index.js +3 -1
  89. package/base/lib/util/index.js.map +1 -1
  90. package/base/lib/util/ip.d.ts +81 -0
  91. package/base/lib/util/ip.js +81 -0
  92. package/base/lib/util/ip.js.map +1 -1
  93. package/base/lib/util/once.d.ts +13 -0
  94. package/base/lib/util/once.js +13 -0
  95. package/base/lib/util/once.js.map +1 -1
  96. package/base/lib/util/patterns.d.ts +11 -0
  97. package/base/lib/util/patterns.js +11 -0
  98. package/base/lib/util/patterns.js.map +1 -1
  99. package/base/lib/util/regexes.d.ts +38 -0
  100. package/base/lib/util/regexes.js +38 -0
  101. package/base/lib/util/regexes.js.map +1 -1
  102. package/base/lib/util/splitCommand.d.ts +14 -0
  103. package/base/lib/util/splitCommand.js +15 -2
  104. package/base/lib/util/splitCommand.js.map +1 -1
  105. package/base/lib/util/stringFromStdErrOut.d.ts +7 -0
  106. package/base/lib/util/stringFromStdErrOut.js +7 -0
  107. package/base/lib/util/stringFromStdErrOut.js.map +1 -1
  108. package/base/lib/util/typeHelpers.d.ts +35 -0
  109. package/base/lib/util/typeHelpers.js +7 -0
  110. package/base/lib/util/typeHelpers.js.map +1 -1
  111. package/package/lib/StartSdk.d.ts +330 -3
  112. package/package/lib/StartSdk.js +143 -1
  113. package/package/lib/StartSdk.js.map +1 -1
  114. package/package/lib/backup/Backups.d.ts +71 -0
  115. package/package/lib/backup/Backups.js +69 -0
  116. package/package/lib/backup/Backups.js.map +1 -1
  117. package/package/lib/backup/setupBackups.d.ts +14 -0
  118. package/package/lib/backup/setupBackups.js +9 -0
  119. package/package/lib/backup/setupBackups.js.map +1 -1
  120. package/package/lib/health/HealthCheck.d.ts +16 -0
  121. package/package/lib/health/HealthCheck.js +16 -2
  122. package/package/lib/health/HealthCheck.js.map +1 -1
  123. package/package/lib/health/checkFns/HealthCheckResult.d.ts +6 -0
  124. package/package/lib/health/checkFns/index.d.ts +8 -0
  125. package/package/lib/health/checkFns/index.js +8 -0
  126. package/package/lib/health/checkFns/index.js.map +1 -1
  127. package/package/lib/index.d.ts +2 -2
  128. package/package/lib/index.js +2 -2
  129. package/package/lib/index.js.map +1 -1
  130. package/package/lib/mainFn/CommandController.d.ts +29 -0
  131. package/package/lib/mainFn/CommandController.js +29 -0
  132. package/package/lib/mainFn/CommandController.js.map +1 -1
  133. package/package/lib/mainFn/Daemon.d.ts +38 -2
  134. package/package/lib/mainFn/Daemon.js +38 -2
  135. package/package/lib/mainFn/Daemon.js.map +1 -1
  136. package/package/lib/mainFn/Daemons.d.ts +31 -0
  137. package/package/lib/mainFn/Daemons.js +13 -0
  138. package/package/lib/mainFn/Daemons.js.map +1 -1
  139. package/package/lib/mainFn/Mounts.d.ts +38 -0
  140. package/package/lib/mainFn/Mounts.js +38 -0
  141. package/package/lib/mainFn/Mounts.js.map +1 -1
  142. package/package/lib/mainFn/index.d.ts +1 -0
  143. package/package/lib/mainFn/index.js +1 -0
  144. package/package/lib/mainFn/index.js.map +1 -1
  145. package/package/lib/manifest/setupManifest.d.ts +9 -0
  146. package/package/lib/manifest/setupManifest.js +9 -0
  147. package/package/lib/manifest/setupManifest.js.map +1 -1
  148. package/package/lib/test/output.d.ts +2 -2
  149. package/package/lib/test/output.js +418 -329
  150. package/package/lib/test/output.js.map +1 -1
  151. package/package/lib/test/output.sdk.d.ts +193 -2
  152. package/package/lib/util/SubContainer.d.ts +46 -0
  153. package/package/lib/util/SubContainer.js +10 -0
  154. package/package/lib/util/SubContainer.js.map +1 -1
  155. package/package/lib/util/fileHelper.d.ts +43 -10
  156. package/package/lib/util/fileHelper.js +13 -11
  157. package/package/lib/util/fileHelper.js.map +1 -1
  158. package/package/lib/version/VersionGraph.d.ts +64 -13
  159. package/package/lib/version/VersionGraph.js +64 -18
  160. package/package/lib/version/VersionGraph.js.map +1 -1
  161. package/package/lib/version/VersionInfo.d.ts +17 -0
  162. package/package/lib/version/VersionInfo.js +12 -0
  163. package/package/lib/version/VersionInfo.js.map +1 -1
  164. package/package/package.json +9 -8
  165. package/package.json +9 -8
@@ -12,7 +12,7 @@ import { SetupBackupsParams } from './backup/setupBackups';
12
12
  import { changeOnFirstSuccess, cooldownTrigger } from './trigger';
13
13
  import { MultiHost, Scheme } from '../../base/lib/interfaces/Host';
14
14
  import { ServiceInterfaceBuilder } from '../../base/lib/interfaces/ServiceInterfaceBuilder';
15
- import { GetSystemSmtp } from './util';
15
+ import { GetOutboundGateway, GetSystemSmtp } from './util';
16
16
  import { nullIfEmpty } from './util';
17
17
  import { getServiceInterface, getServiceInterfaces } from './util';
18
18
  import { CommandOptions, SubContainer } from './util/SubContainer';
@@ -29,34 +29,91 @@ import { DropGenerator } from '../../base/lib/util/Drop';
29
29
  import { getOwnServiceInterface } from '../../base/lib/util/getServiceInterface';
30
30
  import { getOwnServiceInterfaces } from '../../base/lib/util/getServiceInterfaces';
31
31
  import { Volumes } from './util/Volume';
32
+ /** The minimum StartOS version required by this SDK release */
32
33
  export declare const OSVersion: "0.4.0-alpha.20";
33
34
  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;
35
+ /**
36
+ * The top-level SDK facade for building StartOS service packages.
37
+ *
38
+ * Use `StartSdk.of()` to create an uninitialized instance, then call `.withManifest()`
39
+ * to bind it to a manifest, and finally `.build()` to obtain the full toolkit of helpers
40
+ * for actions, daemons, backups, interfaces, health checks, and more.
41
+ *
42
+ * @typeParam Manifest - The service manifest type; starts as `never` until `.withManifest()` is called.
43
+ */
34
44
  export declare class StartSdk<Manifest extends T.SDKManifest> {
35
45
  readonly manifest: Manifest;
36
46
  private constructor();
47
+ /**
48
+ * Create an uninitialized StartSdk instance. Call `.withManifest()` next.
49
+ * @returns A new StartSdk with no manifest bound.
50
+ */
37
51
  static of(): StartSdk<never>;
52
+ /**
53
+ * Bind a manifest to the SDK, producing a typed SDK instance.
54
+ * @param manifest - The service manifest definition
55
+ * @returns A new StartSdk instance parameterized by the given manifest type
56
+ */
38
57
  withManifest<Manifest extends T.SDKManifest = never>(manifest: Manifest): StartSdk<Manifest>;
39
58
  private ifPluginEnabled;
59
+ /**
60
+ * Finalize the SDK and return the full set of helpers for building a StartOS service.
61
+ *
62
+ * This method is only callable after `.withManifest()` has been called (enforced at the type level).
63
+ *
64
+ * @param isReady - Type-level gate; resolves to `true` only when a manifest is bound.
65
+ * @returns An object containing all SDK utilities: actions, daemons, backups, interfaces, health checks, volumes, triggers, and more.
66
+ */
40
67
  build(isReady: AnyNeverCond<[Manifest], 'Build not ready', true>): {
68
+ /** Persist the current data version to the StartOS effect system */
41
69
  setDataVersion: typeof setDataVersion;
70
+ /** Retrieve the current data version from the StartOS effect system */
42
71
  getDataVersion: typeof getDataVersion;
43
72
  action: {
73
+ /** Execute an action by its ID, optionally providing input */
44
74
  run: <Input extends Record<string, unknown>>(options: {
45
75
  effects: T.Effects;
46
76
  actionId: T.ActionId;
47
77
  input?: actions.RunActionInput<Input>;
48
78
  }) => Promise<T.ActionResult | null>;
79
+ /** Create a task notification for a specific package's action */
49
80
  createTask: <T extends ActionInfo<T.ActionId, any>>(effects: T.Effects, packageId: T.PackageId, action: T, severity: T.TaskSeverity, options?: actions.TaskOptions<T>) => Promise<null>;
81
+ /** Create a task notification for this service's own action (uses manifest.id automatically) */
50
82
  createOwnTask: <T extends ActionInfo<T.ActionId, any>>(effects: T.Effects, action: T, severity: T.TaskSeverity, options?: actions.TaskOptions<T>) => Promise<null>;
83
+ /**
84
+ * Clear one or more task notifications by their replay IDs
85
+ * @param effects - The effects context
86
+ * @param replayIds - One or more replay IDs of the tasks to clear
87
+ */
51
88
  clearTask: (effects: T.Effects, ...replayIds: string[]) => Promise<null>;
52
89
  };
90
+ /**
91
+ * Check whether the specified (or all) dependencies are satisfied.
92
+ * @param effects - The effects context
93
+ * @param packageIds - Optional subset of dependency IDs to check; defaults to all
94
+ * @returns An object describing which dependencies are satisfied and which are not
95
+ */
53
96
  checkDependencies: <DependencyId extends keyof Manifest["dependencies"] & T.PackageId = keyof Manifest["dependencies"] & T.PackageId>(effects: Effects, packageIds?: DependencyId[]) => Promise<CheckDependencies<DependencyId>>;
54
97
  serviceInterface: {
98
+ /** Retrieve a single service interface belonging to this package by its ID */
55
99
  getOwn: typeof getOwnServiceInterface;
100
+ /** Retrieve a single service interface from any package */
56
101
  get: typeof getServiceInterface;
102
+ /** Retrieve all service interfaces belonging to this package */
57
103
  getAllOwn: typeof getOwnServiceInterfaces;
104
+ /** Retrieve all service interfaces, optionally filtering by package */
58
105
  getAll: typeof getServiceInterfaces;
59
106
  };
107
+ /**
108
+ * Get the container IP address with reactive subscription support.
109
+ *
110
+ * Returns an object with multiple read strategies: `const()` for a value
111
+ * that retries on change, `once()` for a single read, `watch()` for an async
112
+ * generator, `onChange()` for a callback, and `waitFor()` to block until a predicate is met.
113
+ *
114
+ * @param effects - The effects context
115
+ * @param options - Optional filtering options (e.g. `containerId`)
116
+ */
60
117
  getContainerIp: (effects: T.Effects, options?: Omit<Parameters<T.Effects["getContainerIp"]>[0], "callback">) => {
61
118
  const: () => Promise<string>;
62
119
  once: () => Promise<string>;
@@ -69,9 +126,22 @@ export declare class StartSdk<Manifest extends T.SDKManifest> {
69
126
  waitFor: (pred: (value: string | null) => boolean) => Promise<string | null>;
70
127
  };
71
128
  MultiHost: {
129
+ /**
130
+ * Create a new MultiHost instance for binding ports and exporting interfaces.
131
+ * @param effects - The effects context
132
+ * @param id - A unique identifier for this multi-host group
133
+ */
72
134
  of: (effects: Effects, id: string) => MultiHost;
73
135
  };
136
+ /**
137
+ * Return `null` if the given string is empty, otherwise return the string unchanged.
138
+ * Useful for converting empty user input into explicit null values.
139
+ */
74
140
  nullIfEmpty: typeof nullIfEmpty;
141
+ /**
142
+ * Indicate that a daemon should use the container image's configured entrypoint.
143
+ * @param overrideCmd - Optional command arguments to append after the entrypoint
144
+ */
75
145
  useEntrypoint: (overrideCmd?: string[]) => T.UseEntrypoint;
76
146
  /**
77
147
  * @description Use this class to create an Action. By convention, each Action should receive its own file.
@@ -197,7 +267,61 @@ export declare class StartSdk<Manifest extends T.SDKManifest> {
197
267
  };
198
268
  custom: {
199
269
  name: string;
200
- spec: InputSpec<T.SmtpValue, T.SmtpValue>;
270
+ spec: InputSpec<{
271
+ provider: import("../../base/lib/actions/input/builder/variants").UnionRes<{
272
+ gmail: {
273
+ name: string;
274
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
275
+ };
276
+ ses: {
277
+ name: string;
278
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
279
+ };
280
+ sendgrid: {
281
+ name: string;
282
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
283
+ };
284
+ mailgun: {
285
+ name: string;
286
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
287
+ };
288
+ protonmail: {
289
+ name: string;
290
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
291
+ };
292
+ other: {
293
+ name: string;
294
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
295
+ };
296
+ }, "other" | "gmail" | "ses" | "sendgrid" | "mailgun" | "protonmail">;
297
+ }, {
298
+ provider: import("../../base/lib/actions/input/builder/variants").UnionResStaticValidatedAs<{
299
+ gmail: {
300
+ name: string;
301
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
302
+ };
303
+ ses: {
304
+ name: string;
305
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
306
+ };
307
+ sendgrid: {
308
+ name: string;
309
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
310
+ };
311
+ mailgun: {
312
+ name: string;
313
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
314
+ };
315
+ protonmail: {
316
+ name: string;
317
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
318
+ };
319
+ other: {
320
+ name: string;
321
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
322
+ };
323
+ }, "other" | "gmail" | "ses" | "sendgrid" | "mailgun" | "protonmail">;
324
+ }>;
201
325
  };
202
326
  }>, import("../../base/lib/actions/input/builder/variants").UnionResStaticValidatedAs<{
203
327
  disabled: {
@@ -214,9 +338,145 @@ export declare class StartSdk<Manifest extends T.SDKManifest> {
214
338
  };
215
339
  custom: {
216
340
  name: string;
217
- spec: InputSpec<T.SmtpValue, T.SmtpValue>;
341
+ spec: InputSpec<{
342
+ provider: import("../../base/lib/actions/input/builder/variants").UnionRes<{
343
+ gmail: {
344
+ name: string;
345
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
346
+ };
347
+ ses: {
348
+ name: string;
349
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
350
+ };
351
+ sendgrid: {
352
+ name: string;
353
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
354
+ };
355
+ mailgun: {
356
+ name: string;
357
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
358
+ };
359
+ protonmail: {
360
+ name: string;
361
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
362
+ };
363
+ other: {
364
+ name: string;
365
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
366
+ };
367
+ }, "other" | "gmail" | "ses" | "sendgrid" | "mailgun" | "protonmail">;
368
+ }, {
369
+ provider: import("../../base/lib/actions/input/builder/variants").UnionResStaticValidatedAs<{
370
+ gmail: {
371
+ name: string;
372
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
373
+ };
374
+ ses: {
375
+ name: string;
376
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
377
+ };
378
+ sendgrid: {
379
+ name: string;
380
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
381
+ };
382
+ mailgun: {
383
+ name: string;
384
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
385
+ };
386
+ protonmail: {
387
+ name: string;
388
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
389
+ };
390
+ other: {
391
+ name: string;
392
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
393
+ };
394
+ }, "other" | "gmail" | "ses" | "sendgrid" | "mailgun" | "protonmail">;
395
+ }>;
218
396
  };
219
397
  }>, unknown>;
398
+ systemSmtpSpec: InputSpec<{
399
+ provider: import("../../base/lib/actions/input/builder/variants").UnionRes<{
400
+ gmail: {
401
+ name: string;
402
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
403
+ };
404
+ ses: {
405
+ name: string;
406
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
407
+ };
408
+ sendgrid: {
409
+ name: string;
410
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
411
+ };
412
+ mailgun: {
413
+ name: string;
414
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
415
+ };
416
+ protonmail: {
417
+ name: string;
418
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
419
+ };
420
+ other: {
421
+ name: string;
422
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
423
+ };
424
+ }, "other" | "gmail" | "ses" | "sendgrid" | "mailgun" | "protonmail">;
425
+ }, {
426
+ provider: import("../../base/lib/actions/input/builder/variants").UnionResStaticValidatedAs<{
427
+ gmail: {
428
+ name: string;
429
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
430
+ };
431
+ ses: {
432
+ name: string;
433
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
434
+ };
435
+ sendgrid: {
436
+ name: string;
437
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
438
+ };
439
+ mailgun: {
440
+ name: string;
441
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
442
+ };
443
+ protonmail: {
444
+ name: string;
445
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
446
+ };
447
+ other: {
448
+ name: string;
449
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
450
+ };
451
+ }, "other" | "gmail" | "ses" | "sendgrid" | "mailgun" | "protonmail">;
452
+ }>;
453
+ customSmtp: InputSpec<T.SmtpValue, T.SmtpValue>;
454
+ smtpProviderVariants: Variants<{
455
+ gmail: {
456
+ name: string;
457
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
458
+ };
459
+ ses: {
460
+ name: string;
461
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
462
+ };
463
+ sendgrid: {
464
+ name: string;
465
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
466
+ };
467
+ mailgun: {
468
+ name: string;
469
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
470
+ };
471
+ protonmail: {
472
+ name: string;
473
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
474
+ };
475
+ other: {
476
+ name: string;
477
+ spec: InputSpec<T.SmtpValue, T.SmtpValue>;
478
+ };
479
+ }, unknown>;
220
480
  };
221
481
  /**
222
482
  * @description Use this function to create a service interface.
@@ -265,8 +525,24 @@ export declare class StartSdk<Manifest extends T.SDKManifest> {
265
525
  /** mask the url (recommended if it contains credentials such as an API key or password) */
266
526
  masked: boolean;
267
527
  }) => ServiceInterfaceBuilder;
528
+ /**
529
+ * Get the system SMTP configuration with reactive subscription support.
530
+ * @param effects - The effects context
531
+ */
268
532
  getSystemSmtp: <E extends Effects>(effects: E) => GetSystemSmtp;
533
+ /**
534
+ * Get the outbound network gateway address with reactive subscription support.
535
+ * @param effects - The effects context
536
+ */
537
+ getOutboundGateway: <E extends Effects>(effects: E) => GetOutboundGateway;
538
+ /**
539
+ * Get an SSL certificate for the given hostnames with reactive subscription support.
540
+ * @param effects - The effects context
541
+ * @param hostnames - The hostnames to obtain a certificate for
542
+ * @param algorithm - Optional algorithm preference (e.g. Ed25519)
543
+ */
269
544
  getSslCertificate: <E extends Effects>(effects: E, hostnames: string[], algorithm?: T.Algorithm) => GetSslCertificate;
545
+ /** Retrieve the manifest of any installed service package by its ID */
270
546
  getServiceManifest: typeof getServiceManifest;
271
547
  healthCheck: {
272
548
  checkPortListening: typeof checkPortListening;
@@ -281,6 +557,7 @@ export declare class StartSdk<Manifest extends T.SDKManifest> {
281
557
  message?: ((res: string) => string) | undefined;
282
558
  }) => Promise<import("./health/checkFns").HealthCheckResult>;
283
559
  };
560
+ /** Common utility patterns (e.g. hostname regex, port validators) */
284
561
  patterns: typeof patterns;
285
562
  /**
286
563
  * @description Use this function to list every Action offered by the service. Actions will be displayed in the provided order.
@@ -467,24 +744,50 @@ export declare class StartSdk<Manifest extends T.SDKManifest> {
467
744
  * ```
468
745
  */
469
746
  setupInterfaces: import("../../base/lib/interfaces/setupInterfaces").SetupServiceInterfaces;
747
+ /**
748
+ * Define the main entrypoint for the service. The provided function should
749
+ * configure and return a `Daemons` instance describing all long-running processes.
750
+ * @param fn - Async function that receives `effects` and returns a `Daemons` instance
751
+ */
470
752
  setupMain: (fn: (o: {
471
753
  effects: Effects;
472
754
  }) => Promise<Daemons<Manifest, any>>) => T.ExpectedExports.main;
755
+ /** Built-in trigger strategies for controlling health-check polling intervals */
473
756
  trigger: {
757
+ /** Default trigger: polls at a fixed interval */
474
758
  defaultTrigger: import("./trigger").Trigger;
759
+ /** Trigger with a cooldown period between checks */
475
760
  cooldownTrigger: typeof cooldownTrigger;
761
+ /** Switches to a different interval after the first successful check */
476
762
  changeOnFirstSuccess: typeof changeOnFirstSuccess;
763
+ /** Uses different intervals based on success vs failure results */
477
764
  successFailure: (o: {
478
765
  duringSuccess: import("./trigger").Trigger;
479
766
  duringError: import("./trigger").Trigger;
480
767
  }) => import("./trigger").Trigger;
481
768
  };
482
769
  Mounts: {
770
+ /**
771
+ * Create an empty Mounts builder for declaring volume, asset, dependency, and backup mounts.
772
+ * @returns A new Mounts instance with no mounts configured
773
+ */
483
774
  of: () => Mounts<Manifest, never>;
484
775
  };
485
776
  Backups: {
777
+ /**
778
+ * Create a Backups configuration that backs up entire volumes by name.
779
+ * @param volumeNames - Volume IDs from the manifest to include in backups
780
+ */
486
781
  ofVolumes: (...volumeNames: Manifest["volumes"][number][]) => Backups<Manifest>;
782
+ /**
783
+ * Create a Backups configuration from explicit sync path pairs.
784
+ * @param syncs - Array of `{ dataPath, backupPath }` objects
785
+ */
487
786
  ofSyncs: (...syncs: import("./backup/Backups").BackupSync<Manifest["volumes"][number]>[]) => Backups<Manifest>;
787
+ /**
788
+ * Create a Backups configuration with custom rsync options (e.g. exclude patterns).
789
+ * @param options - Partial sync options to override defaults
790
+ */
488
791
  withOptions: (options?: Partial<T.SyncOptions>) => Backups<Manifest>;
489
792
  };
490
793
  InputSpec: {
@@ -518,9 +821,18 @@ export declare class StartSdk<Manifest extends T.SDKManifest> {
518
821
  of: <Spec extends Record<string, Value<any>>>(spec: Spec) => InputSpec<{ [K in keyof Spec]: Spec[K] extends Value<infer T extends any, any, unknown> ? T : never; }, { [K_1 in keyof Spec]: Spec[K_1] extends Value<any, infer T_1, unknown> ? T_1 : never; }>;
519
822
  };
520
823
  Daemon: {
824
+ /**
825
+ * Create a single Daemon that wraps a long-running process with automatic restart logic.
826
+ * Returns a curried function: call with `(effects, subcontainer, exec)`.
827
+ */
521
828
  readonly of: <C extends SubContainer<Manifest, Effects> | null>(effects: T.Effects, subcontainer: C, exec: import("./mainFn/Daemons").DaemonCommandType<Manifest, C>) => Daemon<Manifest, SubContainer<Manifest, Effects> | null>;
522
829
  };
523
830
  Daemons: {
831
+ /**
832
+ * Create a new Daemons builder for defining the service's daemon topology.
833
+ * Chain `.addDaemon()` calls to register each long-running process.
834
+ * @param effects - The effects context
835
+ */
524
836
  of(effects: Effects): Daemons<Manifest, never>;
525
837
  };
526
838
  SubContainer: {
@@ -609,10 +921,25 @@ export declare class StartSdk<Manifest extends T.SDKManifest> {
609
921
  hostnames: string[];
610
922
  algorithm?: "ecdsa" | "ed25519";
611
923
  }) => Promise<string>;
924
+ /** The bound service manifest */
612
925
  manifest: Manifest;
926
+ /** Volume path helpers derived from the manifest volume definitions */
613
927
  volumes: Volumes<Manifest>;
614
928
  };
615
929
  }
930
+ /**
931
+ * Run a one-shot command inside a temporary subcontainer.
932
+ *
933
+ * Creates a subcontainer, executes the command, and destroys the subcontainer when finished.
934
+ * Throws an {@link ExitError} if the command exits with a non-zero code or signal.
935
+ *
936
+ * @param effects - The effects context
937
+ * @param image - The container image to use
938
+ * @param command - The command to execute (string array or UseEntrypoint)
939
+ * @param options - Mount and command options
940
+ * @param name - Optional human-readable name for debugging
941
+ * @returns The stdout and stderr output of the command
942
+ */
616
943
  export declare function runCommand<Manifest extends T.SDKManifest>(effects: Effects, image: {
617
944
  imageId: keyof Manifest['images'] & T.ImageId;
618
945
  sharedRun?: boolean;