@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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Variants = void 0;
|
|
4
|
-
const
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
5
|
/**
|
|
6
6
|
* Used in the the Value.select { @link './value.ts' }
|
|
7
7
|
* to indicate the type of select variants that are available. The key for the record passed in will be the
|
|
@@ -56,13 +56,23 @@ class Variants {
|
|
|
56
56
|
this.validator = validator;
|
|
57
57
|
this._TYPE = null;
|
|
58
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Creates a `Variants` instance from a record mapping variant keys to their display name and form spec.
|
|
61
|
+
*
|
|
62
|
+
* @param a - A record of `{ name: string, spec: InputSpec }` entries, one per variant
|
|
63
|
+
*/
|
|
59
64
|
static of(a) {
|
|
60
65
|
const staticValidators = {};
|
|
61
66
|
for (const key in a) {
|
|
62
67
|
const value = a[key];
|
|
63
68
|
staticValidators[key] = value.spec.validator;
|
|
64
69
|
}
|
|
65
|
-
const other =
|
|
70
|
+
const other = zod_1.z
|
|
71
|
+
.object(Object.fromEntries(Object.entries(staticValidators).map(([k, v]) => [
|
|
72
|
+
k,
|
|
73
|
+
zod_1.z.any().optional(),
|
|
74
|
+
])))
|
|
75
|
+
.optional();
|
|
66
76
|
return new Variants(async (options) => {
|
|
67
77
|
const validators = {};
|
|
68
78
|
const variants = {};
|
|
@@ -75,17 +85,22 @@ class Variants {
|
|
|
75
85
|
};
|
|
76
86
|
validators[key] = built.validator;
|
|
77
87
|
}
|
|
78
|
-
const other =
|
|
88
|
+
const other = zod_1.z
|
|
89
|
+
.object(Object.fromEntries(Object.entries(validators).map(([k, v]) => [
|
|
90
|
+
k,
|
|
91
|
+
zod_1.z.any().optional(),
|
|
92
|
+
])))
|
|
93
|
+
.optional();
|
|
79
94
|
return {
|
|
80
95
|
spec: variants,
|
|
81
|
-
validator:
|
|
82
|
-
selection:
|
|
96
|
+
validator: zod_1.z.union(Object.entries(validators).map(([k, v]) => zod_1.z.object({
|
|
97
|
+
selection: zod_1.z.literal(k),
|
|
83
98
|
value: v,
|
|
84
99
|
other,
|
|
85
100
|
}))),
|
|
86
101
|
};
|
|
87
|
-
},
|
|
88
|
-
selection:
|
|
102
|
+
}, zod_1.z.union(Object.entries(staticValidators).map(([k, v]) => zod_1.z.object({
|
|
103
|
+
selection: zod_1.z.literal(k),
|
|
89
104
|
value: v,
|
|
90
105
|
other,
|
|
91
106
|
}))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variants.js","sourceRoot":"","sources":["../../../../../../base/lib/actions/input/builder/variants.ts"],"names":[],"mappings":";;;AAQA,
|
|
1
|
+
{"version":3,"file":"variants.js","sourceRoot":"","sources":["../../../../../../base/lib/actions/input/builder/variants.ts"],"names":[],"mappings":";;;AAQA,6BAAuB;AAgDvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,MAAa,QAAQ;IASnB,YACS,KAMN,EACe,SAEf;QATM,UAAK,GAAL,KAAK,CAMX;QACe,cAAS,GAAT,SAAS,CAExB;QAEM,UAAK,GAA4B,IAAW,CAAA;IADlD,CAAC;IAEJ;;;;OAIG;IACH,MAAM,CAAC,EAAE,CAOP,CAAgB;QAChB,MAAM,gBAAgB,GAAG,EAIxB,CAAA;QACD,KAAK,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;YACpB,MAAM,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;YACpB,gBAAgB,CAAC,GAAG,CAAC,GAAG,KA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,OAAO,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CACxC,OAAC,CAAC,MAAM,CAAC;oBACP,SAAS,EAAE,OAAC,CAAC,OAAO,CAAC,CAAC,CAAC;oBACvB,KAAK,EAAE,CAAC;oBACR,KAAK;iBACN,CAAC,CAC4D,CAC1D;aACT,CAAA;QACH,CAAC,EACD,OAAC,CAAC,KAAK,CACL,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAC9C,OAAC,CAAC,MAAM,CAAC;YACP,SAAS,EAAE,OAAC,CAAC,OAAO,CAAC,CAAC,CAAC;YACvB,KAAK,EAAE,CAAC;YACR,KAAK;SACN,CAAC,CAC4D,CAC1D,CACT,CAAA;IACH,CAAC;CACF;AA9GD,4BA8GC"}
|
|
@@ -1,12 +1,102 @@
|
|
|
1
1
|
import { SmtpValue } from '../../types';
|
|
2
2
|
import { InputSpec } from './builder/inputSpec';
|
|
3
3
|
import { Value } from './builder/value';
|
|
4
|
+
import { Variants } from './builder/variants';
|
|
4
5
|
/**
|
|
5
|
-
* Base SMTP settings
|
|
6
|
+
* Base SMTP settings with no provider-specific defaults.
|
|
6
7
|
*/
|
|
7
|
-
export declare const customSmtp: InputSpec<SmtpValue>;
|
|
8
|
+
export declare const customSmtp: InputSpec<SmtpValue, SmtpValue>;
|
|
8
9
|
/**
|
|
9
|
-
*
|
|
10
|
+
* Provider presets for SMTP configuration.
|
|
11
|
+
* Each variant has SMTP fields pre-filled with the provider's recommended settings.
|
|
12
|
+
*/
|
|
13
|
+
export declare const smtpProviderVariants: Variants<{
|
|
14
|
+
gmail: {
|
|
15
|
+
name: string;
|
|
16
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
17
|
+
};
|
|
18
|
+
ses: {
|
|
19
|
+
name: string;
|
|
20
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
21
|
+
};
|
|
22
|
+
sendgrid: {
|
|
23
|
+
name: string;
|
|
24
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
25
|
+
};
|
|
26
|
+
mailgun: {
|
|
27
|
+
name: string;
|
|
28
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
29
|
+
};
|
|
30
|
+
protonmail: {
|
|
31
|
+
name: string;
|
|
32
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
33
|
+
};
|
|
34
|
+
other: {
|
|
35
|
+
name: string;
|
|
36
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
37
|
+
};
|
|
38
|
+
}, unknown>;
|
|
39
|
+
/**
|
|
40
|
+
* System SMTP settings with provider presets.
|
|
41
|
+
* Wraps smtpProviderVariants in a union for use by the system email settings page.
|
|
42
|
+
*/
|
|
43
|
+
export declare const systemSmtpSpec: InputSpec<{
|
|
44
|
+
provider: import("./builder/variants").UnionRes<{
|
|
45
|
+
gmail: {
|
|
46
|
+
name: string;
|
|
47
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
48
|
+
};
|
|
49
|
+
ses: {
|
|
50
|
+
name: string;
|
|
51
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
52
|
+
};
|
|
53
|
+
sendgrid: {
|
|
54
|
+
name: string;
|
|
55
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
56
|
+
};
|
|
57
|
+
mailgun: {
|
|
58
|
+
name: string;
|
|
59
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
60
|
+
};
|
|
61
|
+
protonmail: {
|
|
62
|
+
name: string;
|
|
63
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
64
|
+
};
|
|
65
|
+
other: {
|
|
66
|
+
name: string;
|
|
67
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
68
|
+
};
|
|
69
|
+
}, "other" | "gmail" | "ses" | "sendgrid" | "mailgun" | "protonmail">;
|
|
70
|
+
}, {
|
|
71
|
+
provider: import("./builder/variants").UnionResStaticValidatedAs<{
|
|
72
|
+
gmail: {
|
|
73
|
+
name: string;
|
|
74
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
75
|
+
};
|
|
76
|
+
ses: {
|
|
77
|
+
name: string;
|
|
78
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
79
|
+
};
|
|
80
|
+
sendgrid: {
|
|
81
|
+
name: string;
|
|
82
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
83
|
+
};
|
|
84
|
+
mailgun: {
|
|
85
|
+
name: string;
|
|
86
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
87
|
+
};
|
|
88
|
+
protonmail: {
|
|
89
|
+
name: string;
|
|
90
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
91
|
+
};
|
|
92
|
+
other: {
|
|
93
|
+
name: string;
|
|
94
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
95
|
+
};
|
|
96
|
+
}, "other" | "gmail" | "ses" | "sendgrid" | "mailgun" | "protonmail">;
|
|
97
|
+
}>;
|
|
98
|
+
/**
|
|
99
|
+
* For service inputSpec. Gives users 3 options for SMTP: (1) disabled, (2) use system SMTP settings, (3) use custom SMTP settings with provider presets
|
|
10
100
|
*/
|
|
11
101
|
export declare const smtpInputSpec: Value<import("./builder/variants").UnionRes<{
|
|
12
102
|
disabled: {
|
|
@@ -23,7 +113,61 @@ export declare const smtpInputSpec: Value<import("./builder/variants").UnionRes<
|
|
|
23
113
|
};
|
|
24
114
|
custom: {
|
|
25
115
|
name: string;
|
|
26
|
-
spec: InputSpec<
|
|
116
|
+
spec: InputSpec<{
|
|
117
|
+
provider: import("./builder/variants").UnionRes<{
|
|
118
|
+
gmail: {
|
|
119
|
+
name: string;
|
|
120
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
121
|
+
};
|
|
122
|
+
ses: {
|
|
123
|
+
name: string;
|
|
124
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
125
|
+
};
|
|
126
|
+
sendgrid: {
|
|
127
|
+
name: string;
|
|
128
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
129
|
+
};
|
|
130
|
+
mailgun: {
|
|
131
|
+
name: string;
|
|
132
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
133
|
+
};
|
|
134
|
+
protonmail: {
|
|
135
|
+
name: string;
|
|
136
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
137
|
+
};
|
|
138
|
+
other: {
|
|
139
|
+
name: string;
|
|
140
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
141
|
+
};
|
|
142
|
+
}, "other" | "gmail" | "ses" | "sendgrid" | "mailgun" | "protonmail">;
|
|
143
|
+
}, {
|
|
144
|
+
provider: import("./builder/variants").UnionResStaticValidatedAs<{
|
|
145
|
+
gmail: {
|
|
146
|
+
name: string;
|
|
147
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
148
|
+
};
|
|
149
|
+
ses: {
|
|
150
|
+
name: string;
|
|
151
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
152
|
+
};
|
|
153
|
+
sendgrid: {
|
|
154
|
+
name: string;
|
|
155
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
156
|
+
};
|
|
157
|
+
mailgun: {
|
|
158
|
+
name: string;
|
|
159
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
160
|
+
};
|
|
161
|
+
protonmail: {
|
|
162
|
+
name: string;
|
|
163
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
164
|
+
};
|
|
165
|
+
other: {
|
|
166
|
+
name: string;
|
|
167
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
168
|
+
};
|
|
169
|
+
}, "other" | "gmail" | "ses" | "sendgrid" | "mailgun" | "protonmail">;
|
|
170
|
+
}>;
|
|
27
171
|
};
|
|
28
172
|
}>, import("./builder/variants").UnionResStaticValidatedAs<{
|
|
29
173
|
disabled: {
|
|
@@ -40,6 +184,60 @@ export declare const smtpInputSpec: Value<import("./builder/variants").UnionRes<
|
|
|
40
184
|
};
|
|
41
185
|
custom: {
|
|
42
186
|
name: string;
|
|
43
|
-
spec: InputSpec<
|
|
187
|
+
spec: InputSpec<{
|
|
188
|
+
provider: import("./builder/variants").UnionRes<{
|
|
189
|
+
gmail: {
|
|
190
|
+
name: string;
|
|
191
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
192
|
+
};
|
|
193
|
+
ses: {
|
|
194
|
+
name: string;
|
|
195
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
196
|
+
};
|
|
197
|
+
sendgrid: {
|
|
198
|
+
name: string;
|
|
199
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
200
|
+
};
|
|
201
|
+
mailgun: {
|
|
202
|
+
name: string;
|
|
203
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
204
|
+
};
|
|
205
|
+
protonmail: {
|
|
206
|
+
name: string;
|
|
207
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
208
|
+
};
|
|
209
|
+
other: {
|
|
210
|
+
name: string;
|
|
211
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
212
|
+
};
|
|
213
|
+
}, "other" | "gmail" | "ses" | "sendgrid" | "mailgun" | "protonmail">;
|
|
214
|
+
}, {
|
|
215
|
+
provider: import("./builder/variants").UnionResStaticValidatedAs<{
|
|
216
|
+
gmail: {
|
|
217
|
+
name: string;
|
|
218
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
219
|
+
};
|
|
220
|
+
ses: {
|
|
221
|
+
name: string;
|
|
222
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
223
|
+
};
|
|
224
|
+
sendgrid: {
|
|
225
|
+
name: string;
|
|
226
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
227
|
+
};
|
|
228
|
+
mailgun: {
|
|
229
|
+
name: string;
|
|
230
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
231
|
+
};
|
|
232
|
+
protonmail: {
|
|
233
|
+
name: string;
|
|
234
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
235
|
+
};
|
|
236
|
+
other: {
|
|
237
|
+
name: string;
|
|
238
|
+
spec: InputSpec<SmtpValue, SmtpValue>;
|
|
239
|
+
};
|
|
240
|
+
}, "other" | "gmail" | "ses" | "sendgrid" | "mailgun" | "protonmail">;
|
|
241
|
+
}>;
|
|
44
242
|
};
|
|
45
243
|
}>, unknown>;
|
|
@@ -1,45 +1,120 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.smtpInputSpec = exports.customSmtp = void 0;
|
|
3
|
+
exports.smtpInputSpec = exports.systemSmtpSpec = exports.smtpProviderVariants = exports.customSmtp = void 0;
|
|
4
4
|
const util_1 = require("../../util");
|
|
5
5
|
const inputSpec_1 = require("./builder/inputSpec");
|
|
6
6
|
const value_1 = require("./builder/value");
|
|
7
7
|
const variants_1 = require("./builder/variants");
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Creates an SMTP field spec with provider-specific defaults pre-filled.
|
|
10
10
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
11
|
+
function smtpFields(defaults = {}) {
|
|
12
|
+
return inputSpec_1.InputSpec.of({
|
|
13
|
+
host: value_1.Value.text({
|
|
14
|
+
name: 'Host',
|
|
15
|
+
required: true,
|
|
16
|
+
default: defaults.host ?? null,
|
|
17
|
+
placeholder: 'smtp.example.com',
|
|
18
|
+
}),
|
|
19
|
+
port: value_1.Value.number({
|
|
20
|
+
name: 'Port',
|
|
21
|
+
required: true,
|
|
22
|
+
default: defaults.port ?? 587,
|
|
23
|
+
min: 1,
|
|
24
|
+
max: 65535,
|
|
25
|
+
integer: true,
|
|
26
|
+
}),
|
|
27
|
+
security: value_1.Value.select({
|
|
28
|
+
name: 'Connection Security',
|
|
29
|
+
default: defaults.security ?? 'starttls',
|
|
30
|
+
values: {
|
|
31
|
+
starttls: 'STARTTLS',
|
|
32
|
+
tls: 'TLS',
|
|
33
|
+
},
|
|
34
|
+
}),
|
|
35
|
+
from: value_1.Value.text({
|
|
36
|
+
name: 'From Address',
|
|
37
|
+
required: true,
|
|
38
|
+
default: null,
|
|
39
|
+
placeholder: 'Example Name <test@example.com>',
|
|
40
|
+
patterns: [util_1.Patterns.emailWithName],
|
|
41
|
+
}),
|
|
42
|
+
username: value_1.Value.text({
|
|
43
|
+
name: 'Username',
|
|
44
|
+
required: true,
|
|
45
|
+
default: null,
|
|
46
|
+
}),
|
|
47
|
+
password: value_1.Value.text({
|
|
48
|
+
name: 'Password',
|
|
49
|
+
required: false,
|
|
50
|
+
default: null,
|
|
51
|
+
masked: true,
|
|
52
|
+
}),
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Base SMTP settings with no provider-specific defaults.
|
|
57
|
+
*/
|
|
58
|
+
exports.customSmtp = smtpFields();
|
|
59
|
+
/**
|
|
60
|
+
* Provider presets for SMTP configuration.
|
|
61
|
+
* Each variant has SMTP fields pre-filled with the provider's recommended settings.
|
|
62
|
+
*/
|
|
63
|
+
exports.smtpProviderVariants = variants_1.Variants.of({
|
|
64
|
+
gmail: {
|
|
65
|
+
name: 'Gmail',
|
|
66
|
+
spec: smtpFields({
|
|
67
|
+
host: 'smtp.gmail.com',
|
|
68
|
+
port: 587,
|
|
69
|
+
security: 'starttls',
|
|
70
|
+
}),
|
|
71
|
+
},
|
|
72
|
+
ses: {
|
|
73
|
+
name: 'Amazon SES',
|
|
74
|
+
spec: smtpFields({
|
|
75
|
+
host: 'email-smtp.us-east-1.amazonaws.com',
|
|
76
|
+
port: 587,
|
|
77
|
+
security: 'starttls',
|
|
78
|
+
}),
|
|
79
|
+
},
|
|
80
|
+
sendgrid: {
|
|
81
|
+
name: 'SendGrid',
|
|
82
|
+
spec: smtpFields({
|
|
83
|
+
host: 'smtp.sendgrid.net',
|
|
84
|
+
port: 587,
|
|
85
|
+
security: 'starttls',
|
|
86
|
+
}),
|
|
87
|
+
},
|
|
88
|
+
mailgun: {
|
|
89
|
+
name: 'Mailgun',
|
|
90
|
+
spec: smtpFields({
|
|
91
|
+
host: 'smtp.mailgun.org',
|
|
92
|
+
port: 587,
|
|
93
|
+
security: 'starttls',
|
|
94
|
+
}),
|
|
95
|
+
},
|
|
96
|
+
protonmail: {
|
|
97
|
+
name: 'Proton Mail',
|
|
98
|
+
spec: smtpFields({
|
|
99
|
+
host: 'smtp.protonmail.ch',
|
|
100
|
+
port: 587,
|
|
101
|
+
security: 'starttls',
|
|
102
|
+
}),
|
|
103
|
+
},
|
|
104
|
+
other: {
|
|
105
|
+
name: 'Other',
|
|
106
|
+
spec: exports.customSmtp,
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
/**
|
|
110
|
+
* System SMTP settings with provider presets.
|
|
111
|
+
* Wraps smtpProviderVariants in a union for use by the system email settings page.
|
|
112
|
+
*/
|
|
113
|
+
exports.systemSmtpSpec = inputSpec_1.InputSpec.of({
|
|
114
|
+
provider: value_1.Value.union({
|
|
115
|
+
name: 'Provider',
|
|
41
116
|
default: null,
|
|
42
|
-
|
|
117
|
+
variants: exports.smtpProviderVariants,
|
|
43
118
|
}),
|
|
44
119
|
});
|
|
45
120
|
const smtpVariants = variants_1.Variants.of({
|
|
@@ -52,19 +127,24 @@ const smtpVariants = variants_1.Variants.of({
|
|
|
52
127
|
description: 'A custom from address for this service. If not provided, the system from address will be used.',
|
|
53
128
|
required: false,
|
|
54
129
|
default: null,
|
|
55
|
-
placeholder: '<
|
|
56
|
-
|
|
57
|
-
patterns: [util_1.Patterns.email],
|
|
130
|
+
placeholder: 'Name <test@example.com>',
|
|
131
|
+
patterns: [util_1.Patterns.emailWithName],
|
|
58
132
|
}),
|
|
59
133
|
}),
|
|
60
134
|
},
|
|
61
135
|
custom: {
|
|
62
136
|
name: 'Custom Credentials',
|
|
63
|
-
spec:
|
|
137
|
+
spec: inputSpec_1.InputSpec.of({
|
|
138
|
+
provider: value_1.Value.union({
|
|
139
|
+
name: 'Provider',
|
|
140
|
+
default: null,
|
|
141
|
+
variants: exports.smtpProviderVariants,
|
|
142
|
+
}),
|
|
143
|
+
}),
|
|
64
144
|
},
|
|
65
145
|
});
|
|
66
146
|
/**
|
|
67
|
-
* For service inputSpec. Gives users 3 options for SMTP: (1) disabled, (2) use system SMTP settings, (3) use custom SMTP settings
|
|
147
|
+
* For service inputSpec. Gives users 3 options for SMTP: (1) disabled, (2) use system SMTP settings, (3) use custom SMTP settings with provider presets
|
|
68
148
|
*/
|
|
69
149
|
exports.smtpInputSpec = value_1.Value.dynamicUnion(async ({ effects }) => {
|
|
70
150
|
const smtp = await new util_1.GetSystemSmtp(effects).once();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputSpecConstants.js","sourceRoot":"","sources":["../../../../../base/lib/actions/input/inputSpecConstants.ts"],"names":[],"mappings":";;;AACA,qCAAoD;AACpD,mDAA4D;AAC5D,2CAAuC;AACvC,iDAA6C;AAE7C;;GAEG;
|
|
1
|
+
{"version":3,"file":"inputSpecConstants.js","sourceRoot":"","sources":["../../../../../base/lib/actions/input/inputSpecConstants.ts"],"names":[],"mappings":";;;AACA,qCAAoD;AACpD,mDAA4D;AAC5D,2CAAuC;AACvC,iDAA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