@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.
- package/base/lib/Effects.d.ts +4 -0
- package/base/lib/actions/input/builder/inputSpec.d.ts +129 -8
- package/base/lib/actions/input/builder/inputSpec.js +223 -13
- package/base/lib/actions/input/builder/inputSpec.js.map +1 -1
- package/base/lib/actions/input/builder/inputSpecTools.d.ts +3 -3
- package/base/lib/actions/input/builder/list.d.ts +24 -3
- package/base/lib/actions/input/builder/list.js +26 -5
- package/base/lib/actions/input/builder/list.js.map +1 -1
- package/base/lib/actions/input/builder/value.d.ts +70 -16
- package/base/lib/actions/input/builder/value.js +89 -34
- package/base/lib/actions/input/builder/value.js.map +1 -1
- package/base/lib/actions/input/builder/variants.d.ts +14 -3
- package/base/lib/actions/input/builder/variants.js +22 -7
- package/base/lib/actions/input/builder/variants.js.map +1 -1
- package/base/lib/actions/input/inputSpecConstants.d.ts +203 -5
- package/base/lib/actions/input/inputSpecConstants.js +118 -38
- package/base/lib/actions/input/inputSpecConstants.js.map +1 -1
- package/base/lib/actions/input/inputSpecTypes.d.ts +99 -0
- package/base/lib/actions/input/inputSpecTypes.js +6 -1
- package/base/lib/actions/input/inputSpecTypes.js.map +1 -1
- package/base/lib/actions/setupActions.d.ts +6 -3
- package/base/lib/actions/setupActions.js +7 -4
- package/base/lib/actions/setupActions.js.map +1 -1
- package/base/lib/exver/index.d.ts +233 -2
- package/base/lib/exver/index.js +197 -3
- package/base/lib/exver/index.js.map +1 -1
- package/base/lib/index.d.ts +23 -1
- package/base/lib/index.js +4 -2
- package/base/lib/index.js.map +1 -1
- package/base/lib/inits/setupInit.d.ts +17 -0
- package/base/lib/inits/setupInit.js +7 -0
- package/base/lib/inits/setupInit.js.map +1 -1
- package/base/lib/inits/setupUninit.d.ts +12 -0
- package/base/lib/inits/setupUninit.js +7 -0
- package/base/lib/inits/setupUninit.js.map +1 -1
- package/base/lib/interfaces/Host.js +2 -4
- package/base/lib/interfaces/Host.js.map +1 -1
- package/base/lib/osBindings/GetOutboundGatewayParams.d.ts +4 -0
- package/base/lib/osBindings/GetOutboundGatewayParams.js +3 -0
- package/base/lib/osBindings/GetOutboundGatewayParams.js.map +1 -0
- package/base/lib/osBindings/ServerHostname.d.ts +1 -0
- package/base/lib/osBindings/ServerHostname.js +4 -0
- package/base/lib/osBindings/ServerHostname.js.map +1 -0
- package/base/lib/osBindings/ServerInfo.d.ts +1 -0
- package/base/lib/osBindings/SetServerHostnameParams.d.ts +4 -0
- package/base/lib/osBindings/SetServerHostnameParams.js +4 -0
- package/base/lib/osBindings/SetServerHostnameParams.js.map +1 -0
- package/base/lib/osBindings/SetupExecuteParams.d.ts +3 -1
- package/base/lib/osBindings/SmtpSecurity.d.ts +1 -0
- package/base/lib/osBindings/SmtpSecurity.js +4 -0
- package/base/lib/osBindings/SmtpSecurity.js.map +1 -0
- package/base/lib/osBindings/SmtpValue.d.ts +4 -2
- package/base/lib/osBindings/SmtpValue.js +0 -1
- package/base/lib/osBindings/SmtpValue.js.map +1 -1
- package/base/lib/osBindings/StartOsRecoveryInfo.d.ts +2 -2
- package/base/lib/osBindings/TestSmtpParams.d.ts +4 -2
- package/base/lib/osBindings/TestSmtpParams.js +0 -1
- package/base/lib/osBindings/TestSmtpParams.js.map +1 -1
- package/base/lib/osBindings/index.d.ts +4 -1
- package/base/lib/s9pk/index.d.ts +66 -0
- package/base/lib/s9pk/index.js +70 -1
- package/base/lib/s9pk/index.js.map +1 -1
- package/base/lib/types.d.ts +68 -2
- package/base/lib/types.js +14 -0
- package/base/lib/types.js.map +1 -1
- package/base/lib/util/GetOutboundGateway.d.ts +30 -0
- package/base/lib/util/GetOutboundGateway.js +90 -0
- package/base/lib/util/GetOutboundGateway.js.map +1 -0
- package/base/lib/util/asError.d.ts +8 -0
- package/base/lib/util/asError.js +8 -0
- package/base/lib/util/asError.js.map +1 -1
- package/base/lib/util/deepEqual.d.ts +15 -0
- package/base/lib/util/deepEqual.js +16 -2
- package/base/lib/util/deepEqual.js.map +1 -1
- package/base/lib/util/deepMerge.d.ts +18 -0
- package/base/lib/util/deepMerge.js +18 -0
- package/base/lib/util/deepMerge.js.map +1 -1
- package/base/lib/util/getDefaultString.d.ts +8 -0
- package/base/lib/util/getDefaultString.js +8 -0
- package/base/lib/util/getDefaultString.js.map +1 -1
- package/base/lib/util/graph.d.ts +57 -0
- package/base/lib/util/graph.js +47 -0
- package/base/lib/util/graph.js.map +1 -1
- package/base/lib/util/inMs.d.ts +15 -0
- package/base/lib/util/inMs.js +15 -0
- package/base/lib/util/inMs.js.map +1 -1
- package/base/lib/util/index.d.ts +1 -0
- package/base/lib/util/index.js +3 -1
- package/base/lib/util/index.js.map +1 -1
- package/base/lib/util/ip.d.ts +81 -0
- package/base/lib/util/ip.js +81 -0
- package/base/lib/util/ip.js.map +1 -1
- package/base/lib/util/once.d.ts +13 -0
- package/base/lib/util/once.js +13 -0
- package/base/lib/util/once.js.map +1 -1
- package/base/lib/util/patterns.d.ts +11 -0
- package/base/lib/util/patterns.js +11 -0
- package/base/lib/util/patterns.js.map +1 -1
- package/base/lib/util/regexes.d.ts +38 -0
- package/base/lib/util/regexes.js +38 -0
- package/base/lib/util/regexes.js.map +1 -1
- package/base/lib/util/splitCommand.d.ts +14 -0
- package/base/lib/util/splitCommand.js +15 -2
- package/base/lib/util/splitCommand.js.map +1 -1
- package/base/lib/util/stringFromStdErrOut.d.ts +7 -0
- package/base/lib/util/stringFromStdErrOut.js +7 -0
- package/base/lib/util/stringFromStdErrOut.js.map +1 -1
- package/base/lib/util/typeHelpers.d.ts +35 -0
- package/base/lib/util/typeHelpers.js +7 -0
- package/base/lib/util/typeHelpers.js.map +1 -1
- package/package/lib/StartSdk.d.ts +330 -3
- package/package/lib/StartSdk.js +143 -1
- package/package/lib/StartSdk.js.map +1 -1
- package/package/lib/backup/Backups.d.ts +71 -0
- package/package/lib/backup/Backups.js +69 -0
- package/package/lib/backup/Backups.js.map +1 -1
- package/package/lib/backup/setupBackups.d.ts +14 -0
- package/package/lib/backup/setupBackups.js +9 -0
- package/package/lib/backup/setupBackups.js.map +1 -1
- package/package/lib/health/HealthCheck.d.ts +16 -0
- package/package/lib/health/HealthCheck.js +16 -2
- package/package/lib/health/HealthCheck.js.map +1 -1
- package/package/lib/health/checkFns/HealthCheckResult.d.ts +6 -0
- package/package/lib/health/checkFns/index.d.ts +8 -0
- package/package/lib/health/checkFns/index.js +8 -0
- package/package/lib/health/checkFns/index.js.map +1 -1
- package/package/lib/index.d.ts +2 -2
- package/package/lib/index.js +2 -2
- package/package/lib/index.js.map +1 -1
- package/package/lib/mainFn/CommandController.d.ts +29 -0
- package/package/lib/mainFn/CommandController.js +29 -0
- package/package/lib/mainFn/CommandController.js.map +1 -1
- package/package/lib/mainFn/Daemon.d.ts +38 -2
- package/package/lib/mainFn/Daemon.js +38 -2
- package/package/lib/mainFn/Daemon.js.map +1 -1
- package/package/lib/mainFn/Daemons.d.ts +31 -0
- package/package/lib/mainFn/Daemons.js +13 -0
- package/package/lib/mainFn/Daemons.js.map +1 -1
- package/package/lib/mainFn/Mounts.d.ts +38 -0
- package/package/lib/mainFn/Mounts.js +38 -0
- package/package/lib/mainFn/Mounts.js.map +1 -1
- package/package/lib/mainFn/index.d.ts +1 -0
- package/package/lib/mainFn/index.js +1 -0
- package/package/lib/mainFn/index.js.map +1 -1
- package/package/lib/manifest/setupManifest.d.ts +9 -0
- package/package/lib/manifest/setupManifest.js +9 -0
- package/package/lib/manifest/setupManifest.js.map +1 -1
- package/package/lib/test/output.d.ts +2 -2
- package/package/lib/test/output.js +418 -329
- package/package/lib/test/output.js.map +1 -1
- package/package/lib/test/output.sdk.d.ts +193 -2
- package/package/lib/util/SubContainer.d.ts +46 -0
- package/package/lib/util/SubContainer.js +10 -0
- package/package/lib/util/SubContainer.js.map +1 -1
- package/package/lib/util/fileHelper.d.ts +43 -10
- package/package/lib/util/fileHelper.js +13 -11
- package/package/lib/util/fileHelper.js.map +1 -1
- package/package/lib/version/VersionGraph.d.ts +64 -13
- package/package/lib/version/VersionGraph.js +64 -18
- package/package/lib/version/VersionGraph.js.map +1 -1
- package/package/lib/version/VersionInfo.d.ts +17 -0
- package/package/lib/version/VersionInfo.js +12 -0
- package/package/lib/version/VersionInfo.js.map +1 -1
- package/package/package.json +9 -8
- 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<
|
|
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<
|
|
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;
|