@start9labs/start-sdk 0.4.0-beta.57 → 0.4.0-beta.59
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 +1 -1
- package/base/lib/actions/input/inputSpecConstants.d.ts +6 -34
- package/base/lib/actions/input/inputSpecConstants.js +1 -5
- package/base/lib/actions/input/inputSpecConstants.js.map +1 -1
- package/base/lib/osBindings/SetupInfo.d.ts +1 -0
- package/base/lib/util/GetContainerIp.d.ts +13 -0
- package/base/lib/util/GetContainerIp.js +16 -0
- package/base/lib/util/GetContainerIp.js.map +1 -0
- package/base/lib/util/GetHostInfo.d.ts +15 -0
- package/base/lib/util/GetHostInfo.js +16 -0
- package/base/lib/util/GetHostInfo.js.map +1 -0
- package/base/lib/util/GetOutboundGateway.d.ts +4 -27
- package/base/lib/util/GetOutboundGateway.js +6 -82
- package/base/lib/util/GetOutboundGateway.js.map +1 -1
- package/base/lib/util/GetServiceManifest.d.ts +13 -0
- package/base/lib/util/GetServiceManifest.js +16 -0
- package/base/lib/util/GetServiceManifest.js.map +1 -0
- package/base/lib/util/GetSslCertificate.d.ts +14 -0
- package/base/lib/util/GetSslCertificate.js +16 -0
- package/base/lib/util/GetSslCertificate.js.map +1 -0
- package/base/lib/util/GetStatus.d.ts +13 -0
- package/base/lib/util/GetStatus.js +16 -0
- package/base/lib/util/GetStatus.js.map +1 -0
- package/base/lib/util/GetSystemSmtp.d.ts +4 -27
- package/base/lib/util/GetSystemSmtp.js +6 -82
- package/base/lib/util/GetSystemSmtp.js.map +1 -1
- package/base/lib/util/Watchable.d.ts +32 -0
- package/base/lib/util/Watchable.js +87 -0
- package/base/lib/util/Watchable.js.map +1 -0
- package/base/lib/util/getServiceInterface.d.ts +3 -2
- package/base/lib/util/getServiceInterface.js +4 -1
- package/base/lib/util/getServiceInterface.js.map +1 -1
- package/base/lib/util/index.d.ts +6 -0
- package/base/lib/util/index.js +13 -1
- package/base/lib/util/index.js.map +1 -1
- package/package/lib/StartSdk.d.ts +9 -37
- package/package/lib/test/output.sdk.d.ts +9 -37
- package/package/lib/version/VersionGraph.js +3 -0
- package/package/lib/version/VersionGraph.js.map +1 -1
- package/package/package.json +1 -1
- package/package.json +1 -1
package/base/lib/Effects.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ export type Effects = {
|
|
|
46
46
|
getStatus(options: {
|
|
47
47
|
packageId?: PackageId;
|
|
48
48
|
callback?: () => void;
|
|
49
|
-
}): Promise<StatusInfo>;
|
|
49
|
+
}): Promise<StatusInfo | null>;
|
|
50
50
|
/** DEPRECATED: indicate to the host os what runstate the service is in */
|
|
51
51
|
setMainStatus(options: SetMainStatus): Promise<null>;
|
|
52
52
|
/** Set the dependencies of what the service needs, usually run during the inputSpec action as a best practice */
|
|
@@ -56,10 +56,6 @@ export declare const customSmtp: InputSpec<{
|
|
|
56
56
|
* Each variant has SMTP fields pre-filled with the provider's recommended settings.
|
|
57
57
|
*/
|
|
58
58
|
export declare const smtpProviderVariants: Variants<{
|
|
59
|
-
none: {
|
|
60
|
-
name: string;
|
|
61
|
-
spec: InputSpec<{}, {}>;
|
|
62
|
-
};
|
|
63
59
|
gmail: {
|
|
64
60
|
name: string;
|
|
65
61
|
spec: InputSpec<{
|
|
@@ -367,10 +363,6 @@ export declare const smtpProviderVariants: Variants<{
|
|
|
367
363
|
*/
|
|
368
364
|
export declare const systemSmtpSpec: InputSpec<{
|
|
369
365
|
provider: import("./builder/variants").UnionRes<{
|
|
370
|
-
none: {
|
|
371
|
-
name: string;
|
|
372
|
-
spec: InputSpec<{}, {}>;
|
|
373
|
-
};
|
|
374
366
|
gmail: {
|
|
375
367
|
name: string;
|
|
376
368
|
spec: InputSpec<{
|
|
@@ -671,13 +663,9 @@ export declare const systemSmtpSpec: InputSpec<{
|
|
|
671
663
|
password: string | null;
|
|
672
664
|
}>;
|
|
673
665
|
};
|
|
674
|
-
}, "
|
|
666
|
+
}, "other" | "gmail" | "ses" | "sendgrid" | "mailgun" | "protonmail">;
|
|
675
667
|
}, {
|
|
676
668
|
provider: import("./builder/variants").UnionResStaticValidatedAs<{
|
|
677
|
-
none: {
|
|
678
|
-
name: string;
|
|
679
|
-
spec: InputSpec<{}, {}>;
|
|
680
|
-
};
|
|
681
669
|
gmail: {
|
|
682
670
|
name: string;
|
|
683
671
|
spec: InputSpec<{
|
|
@@ -978,7 +966,7 @@ export declare const systemSmtpSpec: InputSpec<{
|
|
|
978
966
|
password: string | null;
|
|
979
967
|
}>;
|
|
980
968
|
};
|
|
981
|
-
}, "
|
|
969
|
+
}, "other" | "gmail" | "ses" | "sendgrid" | "mailgun" | "protonmail">;
|
|
982
970
|
}>;
|
|
983
971
|
/**
|
|
984
972
|
* For service inputSpec. Gives users 3 options for SMTP: (1) disabled, (2) use system SMTP settings, (3) use custom SMTP settings with provider presets
|
|
@@ -1000,10 +988,6 @@ export declare const smtpInputSpec: Value<import("./builder/variants").UnionRes<
|
|
|
1000
988
|
name: string;
|
|
1001
989
|
spec: InputSpec<{
|
|
1002
990
|
provider: import("./builder/variants").UnionRes<{
|
|
1003
|
-
none: {
|
|
1004
|
-
name: string;
|
|
1005
|
-
spec: InputSpec<{}, {}>;
|
|
1006
|
-
};
|
|
1007
991
|
gmail: {
|
|
1008
992
|
name: string;
|
|
1009
993
|
spec: InputSpec<{
|
|
@@ -1304,13 +1288,9 @@ export declare const smtpInputSpec: Value<import("./builder/variants").UnionRes<
|
|
|
1304
1288
|
password: string | null;
|
|
1305
1289
|
}>;
|
|
1306
1290
|
};
|
|
1307
|
-
}, "
|
|
1291
|
+
}, "other" | "gmail" | "ses" | "sendgrid" | "mailgun" | "protonmail">;
|
|
1308
1292
|
}, {
|
|
1309
1293
|
provider: import("./builder/variants").UnionResStaticValidatedAs<{
|
|
1310
|
-
none: {
|
|
1311
|
-
name: string;
|
|
1312
|
-
spec: InputSpec<{}, {}>;
|
|
1313
|
-
};
|
|
1314
1294
|
gmail: {
|
|
1315
1295
|
name: string;
|
|
1316
1296
|
spec: InputSpec<{
|
|
@@ -1611,7 +1591,7 @@ export declare const smtpInputSpec: Value<import("./builder/variants").UnionRes<
|
|
|
1611
1591
|
password: string | null;
|
|
1612
1592
|
}>;
|
|
1613
1593
|
};
|
|
1614
|
-
}, "
|
|
1594
|
+
}, "other" | "gmail" | "ses" | "sendgrid" | "mailgun" | "protonmail">;
|
|
1615
1595
|
}>;
|
|
1616
1596
|
};
|
|
1617
1597
|
}>, import("./builder/variants").UnionResStaticValidatedAs<{
|
|
@@ -1631,10 +1611,6 @@ export declare const smtpInputSpec: Value<import("./builder/variants").UnionRes<
|
|
|
1631
1611
|
name: string;
|
|
1632
1612
|
spec: InputSpec<{
|
|
1633
1613
|
provider: import("./builder/variants").UnionRes<{
|
|
1634
|
-
none: {
|
|
1635
|
-
name: string;
|
|
1636
|
-
spec: InputSpec<{}, {}>;
|
|
1637
|
-
};
|
|
1638
1614
|
gmail: {
|
|
1639
1615
|
name: string;
|
|
1640
1616
|
spec: InputSpec<{
|
|
@@ -1935,13 +1911,9 @@ export declare const smtpInputSpec: Value<import("./builder/variants").UnionRes<
|
|
|
1935
1911
|
password: string | null;
|
|
1936
1912
|
}>;
|
|
1937
1913
|
};
|
|
1938
|
-
}, "
|
|
1914
|
+
}, "other" | "gmail" | "ses" | "sendgrid" | "mailgun" | "protonmail">;
|
|
1939
1915
|
}, {
|
|
1940
1916
|
provider: import("./builder/variants").UnionResStaticValidatedAs<{
|
|
1941
|
-
none: {
|
|
1942
|
-
name: string;
|
|
1943
|
-
spec: InputSpec<{}, {}>;
|
|
1944
|
-
};
|
|
1945
1917
|
gmail: {
|
|
1946
1918
|
name: string;
|
|
1947
1919
|
spec: InputSpec<{
|
|
@@ -2242,7 +2214,7 @@ export declare const smtpInputSpec: Value<import("./builder/variants").UnionRes<
|
|
|
2242
2214
|
password: string | null;
|
|
2243
2215
|
}>;
|
|
2244
2216
|
};
|
|
2245
|
-
}, "
|
|
2217
|
+
}, "other" | "gmail" | "ses" | "sendgrid" | "mailgun" | "protonmail">;
|
|
2246
2218
|
}>;
|
|
2247
2219
|
};
|
|
2248
2220
|
}>, unknown>;
|
|
@@ -76,10 +76,6 @@ exports.customSmtp = smtpFields();
|
|
|
76
76
|
* Each variant has SMTP fields pre-filled with the provider's recommended settings.
|
|
77
77
|
*/
|
|
78
78
|
exports.smtpProviderVariants = variants_1.Variants.of({
|
|
79
|
-
none: {
|
|
80
|
-
name: 'None',
|
|
81
|
-
spec: inputSpec_1.InputSpec.of({}),
|
|
82
|
-
},
|
|
83
79
|
gmail: {
|
|
84
80
|
name: 'Gmail',
|
|
85
81
|
spec: smtpFields({
|
|
@@ -131,7 +127,7 @@ exports.smtpProviderVariants = variants_1.Variants.of({
|
|
|
131
127
|
exports.systemSmtpSpec = inputSpec_1.InputSpec.of({
|
|
132
128
|
provider: value_1.Value.union({
|
|
133
129
|
name: 'Provider',
|
|
134
|
-
default: '
|
|
130
|
+
default: 'gmail',
|
|
135
131
|
variants: exports.smtpProviderVariants,
|
|
136
132
|
}),
|
|
137
133
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputSpecConstants.js","sourceRoot":"","sources":["../../../../../base/lib/actions/input/inputSpecConstants.ts"],"names":[],"mappings":";;;AAAA,qCAAoD;AACpD,mDAA+C;AAC/C,2CAAuC;AACvC,iDAA6C;AAE7C,MAAM,gBAAgB,GAAG,mBAAQ,CAAC,EAAE,CAAC;IACnC,GAAG,EAAE;QACH,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,qBAAS,CAAC,EAAE,CAAC;YACjB,IAAI,EAAE,aAAK,CAAC,WAAW,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;gBACnC,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,KAAK;gBACd,QAAQ,EAAE,eAAe;aAC1B,CAAC,CAAC;SACJ,CAAC;KACH;IACD,QAAQ,EAAE;QACR,IAAI,EAAE,UAAU;QACh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QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,IAAI;YACb,MAAM,EAAE,IAAI;SACb,CAAC;KACH,CAAC,CAAA;AACJ,CAAC;AAED;;GAEG;AACU,QAAA,UAAU,GAAG,UAAU,EAAE,CAAA;AAEtC;;;GAGG;AACU,QAAA,oBAAoB,GAAG,mBAAQ,CAAC,EAAE,CAAC;IAC9C,
|
|
1
|
+
{"version":3,"file":"inputSpecConstants.js","sourceRoot":"","sources":["../../../../../base/lib/actions/input/inputSpecConstants.ts"],"names":[],"mappings":";;;AAAA,qCAAoD;AACpD,mDAA+C;AAC/C,2CAAuC;AACvC,iDAA6C;AAE7C,MAAM,gBAAgB,GAAG,mBAAQ,CAAC,EAAE,CAAC;IACnC,GAAG,EAAE;QACH,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,qBAAS,CAAC,EAAE,CAAC;YACjB,IAAI,EAAE,aAAK,CAAC,WAAW,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;gBACnC,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,KAAK;gBACd,QAAQ,EAAE,eAAe;aAC1B,CAAC,CAAC;SACJ,CAAC;KACH;IACD,QAAQ,EAAE;QACR,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,qBAAS,CAAC,EAAE,CAAC;YACjB,IAAI,EAAE,aAAK,CAAC,MAAM,CAAC;gBACjB,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE,KAAK;gBACd,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE;aACrD,CAAC;SACH,CAAC;KACH;CACF,CAAC,CAAA;AAEF;;GAEG;AACH,SAAS,UAAU,CACjB,WAII,EAAE;IAEN,MAAM,QAAQ,GAAG,aAAK,CAAC,IAAI,CAAC;QAC1B,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,QAAQ,CA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OAAO,EAAE,IAAI;gBACb,WAAW,EAAE,yBAAyB;gBACtC,QAAQ,EAAE,CAAC,eAAQ,CAAC,aAAa,CAAC;aACnC,CAAC;SACH,CAAC;KACH;IACD,MAAM,EAAE;QACN,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE,qBAAS,CAAC,EAAE,CAAC;YACjB,QAAQ,EAAE,aAAK,CAAC,KAAK,CAAC;gBACpB,IAAI,EAAE,UAAU;gBAChB,OAAO,EAAE,IAAW;gBACpB,QAAQ,EAAE,4BAAoB;aAC/B,CAAC;SACH,CAAC;KACH;CACF,CAAC,CAAA;AACF;;GAEG;AACU,QAAA,aAAa,GAAG,aAAK,CAAC,YAAY,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;IACpE,MAAM,IAAI,GAAG,MAAM,IAAI,oBAAa,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAA;IACpD,MAAM,QAAQ,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;IACvC,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,sDAAsD;QACnE,OAAO,EAAE,UAAU;QACnB,QAAQ;QACR,QAAQ,EAAE,YAAY;KACvB,CAAA;AACH,CAAC,EAAE,YAAY,CAAC,SAAS,CAAC,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Effects } from '../Effects';
|
|
2
|
+
import { PackageId } from '../osBindings';
|
|
3
|
+
import { Watchable } from './Watchable';
|
|
4
|
+
export declare class GetContainerIp extends Watchable<string> {
|
|
5
|
+
readonly opts: {
|
|
6
|
+
packageId?: PackageId;
|
|
7
|
+
};
|
|
8
|
+
protected readonly label = "GetContainerIp";
|
|
9
|
+
constructor(effects: Effects, opts?: {
|
|
10
|
+
packageId?: PackageId;
|
|
11
|
+
});
|
|
12
|
+
protected call(callback?: () => void): Promise<string>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetContainerIp = void 0;
|
|
4
|
+
const Watchable_1 = require("./Watchable");
|
|
5
|
+
class GetContainerIp extends Watchable_1.Watchable {
|
|
6
|
+
constructor(effects, opts = {}) {
|
|
7
|
+
super(effects);
|
|
8
|
+
this.opts = opts;
|
|
9
|
+
this.label = 'GetContainerIp';
|
|
10
|
+
}
|
|
11
|
+
call(callback) {
|
|
12
|
+
return this.effects.getContainerIp({ ...this.opts, callback });
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.GetContainerIp = GetContainerIp;
|
|
16
|
+
//# sourceMappingURL=GetContainerIp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GetContainerIp.js","sourceRoot":"","sources":["../../../../base/lib/util/GetContainerIp.ts"],"names":[],"mappings":";;;AAEA,2CAAuC;AAEvC,MAAa,cAAe,SAAQ,qBAAiB;IAGnD,YACE,OAAgB,EACP,OAAkC,EAAE;QAE7C,KAAK,CAAC,OAAO,CAAC,CAAA;QAFL,SAAI,GAAJ,IAAI,CAAgC;QAJ5B,UAAK,GAAG,gBAAgB,CAAA;IAO3C,CAAC;IAES,IAAI,CAAC,QAAqB;QAClC,OAAO,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAA;IAChE,CAAC;CACF;AAbD,wCAaC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Effects } from '../Effects';
|
|
2
|
+
import { Host, HostId, PackageId } from '../osBindings';
|
|
3
|
+
import { Watchable } from './Watchable';
|
|
4
|
+
export declare class GetHostInfo extends Watchable<Host | null> {
|
|
5
|
+
readonly opts: {
|
|
6
|
+
hostId: HostId;
|
|
7
|
+
packageId?: PackageId;
|
|
8
|
+
};
|
|
9
|
+
protected readonly label = "GetHostInfo";
|
|
10
|
+
constructor(effects: Effects, opts: {
|
|
11
|
+
hostId: HostId;
|
|
12
|
+
packageId?: PackageId;
|
|
13
|
+
});
|
|
14
|
+
protected call(callback?: () => void): Promise<Host | null>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetHostInfo = void 0;
|
|
4
|
+
const Watchable_1 = require("./Watchable");
|
|
5
|
+
class GetHostInfo extends Watchable_1.Watchable {
|
|
6
|
+
constructor(effects, opts) {
|
|
7
|
+
super(effects);
|
|
8
|
+
this.opts = opts;
|
|
9
|
+
this.label = 'GetHostInfo';
|
|
10
|
+
}
|
|
11
|
+
call(callback) {
|
|
12
|
+
return this.effects.getHostInfo({ ...this.opts, callback });
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.GetHostInfo = GetHostInfo;
|
|
16
|
+
//# sourceMappingURL=GetHostInfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GetHostInfo.js","sourceRoot":"","sources":["../../../../base/lib/util/GetHostInfo.ts"],"names":[],"mappings":";;;AAEA,2CAAuC;AAEvC,MAAa,WAAY,SAAQ,qBAAsB;IAGrD,YACE,OAAgB,EACP,IAA+C;QAExD,KAAK,CAAC,OAAO,CAAC,CAAA;QAFL,SAAI,GAAJ,IAAI,CAA2C;QAJvC,UAAK,GAAG,aAAa,CAAA;IAOxC,CAAC;IAES,IAAI,CAAC,QAAqB;QAClC,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAA;IAC7D,CAAC;CACF;AAbD,kCAaC"}
|
|
@@ -1,30 +1,7 @@
|
|
|
1
1
|
import { Effects } from '../Effects';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { Watchable } from './Watchable';
|
|
3
|
+
export declare class GetOutboundGateway extends Watchable<string> {
|
|
4
|
+
protected readonly label = "GetOutboundGateway";
|
|
4
5
|
constructor(effects: Effects);
|
|
5
|
-
|
|
6
|
-
* Returns the effective outbound gateway. Reruns the context from which it has been called if the underlying value changes
|
|
7
|
-
*/
|
|
8
|
-
const(): Promise<string>;
|
|
9
|
-
/**
|
|
10
|
-
* Returns the effective outbound gateway. Does nothing if the value changes
|
|
11
|
-
*/
|
|
12
|
-
once(): Promise<string>;
|
|
13
|
-
private watchGen;
|
|
14
|
-
/**
|
|
15
|
-
* Watches the effective outbound gateway. Returns an async iterator that yields whenever the value changes
|
|
16
|
-
*/
|
|
17
|
-
watch(abort?: AbortSignal): AsyncGenerator<string, never, unknown>;
|
|
18
|
-
/**
|
|
19
|
-
* Watches the effective outbound gateway. Takes a custom callback function to run whenever the value changes
|
|
20
|
-
*/
|
|
21
|
-
onChange(callback: (value: string, error?: Error) => {
|
|
22
|
-
cancel: boolean;
|
|
23
|
-
} | Promise<{
|
|
24
|
-
cancel: boolean;
|
|
25
|
-
}>): void;
|
|
26
|
-
/**
|
|
27
|
-
* Watches the effective outbound gateway. Returns when the predicate is true
|
|
28
|
-
*/
|
|
29
|
-
waitFor(pred: (value: string) => boolean): Promise<string>;
|
|
6
|
+
protected call(callback?: () => void): Promise<string>;
|
|
30
7
|
}
|
|
@@ -1,90 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GetOutboundGateway = void 0;
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
class GetOutboundGateway {
|
|
4
|
+
const Watchable_1 = require("./Watchable");
|
|
5
|
+
class GetOutboundGateway extends Watchable_1.Watchable {
|
|
7
6
|
constructor(effects) {
|
|
8
|
-
|
|
7
|
+
super(effects);
|
|
8
|
+
this.label = 'GetOutboundGateway';
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*/
|
|
13
|
-
const() {
|
|
14
|
-
return this.effects.getOutboundGateway({
|
|
15
|
-
callback: this.effects.constRetry &&
|
|
16
|
-
(() => this.effects.constRetry && this.effects.constRetry()),
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Returns the effective outbound gateway. Does nothing if the value changes
|
|
21
|
-
*/
|
|
22
|
-
once() {
|
|
23
|
-
return this.effects.getOutboundGateway({});
|
|
24
|
-
}
|
|
25
|
-
async *watchGen(abort) {
|
|
26
|
-
const resolveCell = { resolve: () => { } };
|
|
27
|
-
this.effects.onLeaveContext(() => {
|
|
28
|
-
resolveCell.resolve();
|
|
29
|
-
});
|
|
30
|
-
abort?.addEventListener('abort', () => resolveCell.resolve());
|
|
31
|
-
while (this.effects.isInContext && !abort?.aborted) {
|
|
32
|
-
let callback = () => { };
|
|
33
|
-
const waitForNext = new Promise((resolve) => {
|
|
34
|
-
callback = resolve;
|
|
35
|
-
resolveCell.resolve = resolve;
|
|
36
|
-
});
|
|
37
|
-
yield await this.effects.getOutboundGateway({
|
|
38
|
-
callback: () => callback(),
|
|
39
|
-
});
|
|
40
|
-
await waitForNext;
|
|
41
|
-
}
|
|
42
|
-
return new Promise((_, rej) => rej(new AbortedError_1.AbortedError()));
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Watches the effective outbound gateway. Returns an async iterator that yields whenever the value changes
|
|
46
|
-
*/
|
|
47
|
-
watch(abort) {
|
|
48
|
-
const ctrl = new AbortController();
|
|
49
|
-
abort?.addEventListener('abort', () => ctrl.abort());
|
|
50
|
-
return Drop_1.DropGenerator.of(this.watchGen(ctrl.signal), () => ctrl.abort());
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Watches the effective outbound gateway. Takes a custom callback function to run whenever the value changes
|
|
54
|
-
*/
|
|
55
|
-
onChange(callback) {
|
|
56
|
-
;
|
|
57
|
-
(async () => {
|
|
58
|
-
const ctrl = new AbortController();
|
|
59
|
-
for await (const value of this.watch(ctrl.signal)) {
|
|
60
|
-
try {
|
|
61
|
-
const res = await callback(value);
|
|
62
|
-
if (res.cancel) {
|
|
63
|
-
ctrl.abort();
|
|
64
|
-
break;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
catch (e) {
|
|
68
|
-
console.error('callback function threw an error @ GetOutboundGateway.onChange', e);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
})()
|
|
72
|
-
.catch((e) => callback('', e))
|
|
73
|
-
.catch((e) => console.error('callback function threw an error @ GetOutboundGateway.onChange', e));
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Watches the effective outbound gateway. Returns when the predicate is true
|
|
77
|
-
*/
|
|
78
|
-
waitFor(pred) {
|
|
79
|
-
const ctrl = new AbortController();
|
|
80
|
-
return Drop_1.DropPromise.of(Promise.resolve().then(async () => {
|
|
81
|
-
for await (const next of this.watchGen(ctrl.signal)) {
|
|
82
|
-
if (pred(next)) {
|
|
83
|
-
return next;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
return '';
|
|
87
|
-
}), () => ctrl.abort());
|
|
10
|
+
call(callback) {
|
|
11
|
+
return this.effects.getOutboundGateway({ callback });
|
|
88
12
|
}
|
|
89
13
|
}
|
|
90
14
|
exports.GetOutboundGateway = GetOutboundGateway;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GetOutboundGateway.js","sourceRoot":"","sources":["../../../../base/lib/util/GetOutboundGateway.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"GetOutboundGateway.js","sourceRoot":"","sources":["../../../../base/lib/util/GetOutboundGateway.ts"],"names":[],"mappings":";;;AACA,2CAAuC;AAEvC,MAAa,kBAAmB,SAAQ,qBAAiB;IAGvD,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAA;QAHG,UAAK,GAAG,oBAAoB,CAAA;IAI/C,CAAC;IAES,IAAI,CAAC,QAAqB;QAClC,OAAO,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAA;IACtD,CAAC;CACF;AAVD,gDAUC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Effects } from '../Effects';
|
|
2
|
+
import { Manifest, PackageId } from '../osBindings';
|
|
3
|
+
import { Watchable } from './Watchable';
|
|
4
|
+
export declare class GetServiceManifest extends Watchable<Manifest> {
|
|
5
|
+
readonly opts: {
|
|
6
|
+
packageId: PackageId;
|
|
7
|
+
};
|
|
8
|
+
protected readonly label = "GetServiceManifest";
|
|
9
|
+
constructor(effects: Effects, opts: {
|
|
10
|
+
packageId: PackageId;
|
|
11
|
+
});
|
|
12
|
+
protected call(callback?: () => void): Promise<Manifest>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetServiceManifest = void 0;
|
|
4
|
+
const Watchable_1 = require("./Watchable");
|
|
5
|
+
class GetServiceManifest extends Watchable_1.Watchable {
|
|
6
|
+
constructor(effects, opts) {
|
|
7
|
+
super(effects);
|
|
8
|
+
this.opts = opts;
|
|
9
|
+
this.label = 'GetServiceManifest';
|
|
10
|
+
}
|
|
11
|
+
call(callback) {
|
|
12
|
+
return this.effects.getServiceManifest({ ...this.opts, callback });
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.GetServiceManifest = GetServiceManifest;
|
|
16
|
+
//# sourceMappingURL=GetServiceManifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GetServiceManifest.js","sourceRoot":"","sources":["../../../../base/lib/util/GetServiceManifest.ts"],"names":[],"mappings":";;;AAEA,2CAAuC;AAEvC,MAAa,kBAAmB,SAAQ,qBAAmB;IAGzD,YACE,OAAgB,EACP,IAA8B;QAEvC,KAAK,CAAC,OAAO,CAAC,CAAA;QAFL,SAAI,GAAJ,IAAI,CAA0B;QAJtB,UAAK,GAAG,oBAAoB,CAAA;IAO/C,CAAC;IAES,IAAI,CAAC,QAAqB;QAClC,OAAO,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAA;IACpE,CAAC;CACF;AAbD,gDAaC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Effects } from '../Effects';
|
|
2
|
+
import { Watchable } from './Watchable';
|
|
3
|
+
export declare class GetSslCertificate extends Watchable<[string, string, string]> {
|
|
4
|
+
readonly opts: {
|
|
5
|
+
hostnames: string[];
|
|
6
|
+
algorithm?: 'ecdsa' | 'ed25519';
|
|
7
|
+
};
|
|
8
|
+
protected readonly label = "GetSslCertificate";
|
|
9
|
+
constructor(effects: Effects, opts: {
|
|
10
|
+
hostnames: string[];
|
|
11
|
+
algorithm?: 'ecdsa' | 'ed25519';
|
|
12
|
+
});
|
|
13
|
+
protected call(callback?: () => void): Promise<[string, string, string]>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetSslCertificate = void 0;
|
|
4
|
+
const Watchable_1 = require("./Watchable");
|
|
5
|
+
class GetSslCertificate extends Watchable_1.Watchable {
|
|
6
|
+
constructor(effects, opts) {
|
|
7
|
+
super(effects);
|
|
8
|
+
this.opts = opts;
|
|
9
|
+
this.label = 'GetSslCertificate';
|
|
10
|
+
}
|
|
11
|
+
call(callback) {
|
|
12
|
+
return this.effects.getSslCertificate({ ...this.opts, callback });
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.GetSslCertificate = GetSslCertificate;
|
|
16
|
+
//# sourceMappingURL=GetSslCertificate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GetSslCertificate.js","sourceRoot":"","sources":["../../../../base/lib/util/GetSslCertificate.ts"],"names":[],"mappings":";;;AACA,2CAAuC;AAEvC,MAAa,iBAAkB,SAAQ,qBAAmC;IAGxE,YACE,OAAgB,EACP,IAGR;QAED,KAAK,CAAC,OAAO,CAAC,CAAA;QALL,SAAI,GAAJ,IAAI,CAGZ;QAPgB,UAAK,GAAG,mBAAmB,CAAA;IAU9C,CAAC;IAES,IAAI,CAAC,QAAqB;QAClC,OAAO,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAA;IACnE,CAAC;CACF;AAhBD,8CAgBC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Effects } from '../Effects';
|
|
2
|
+
import { PackageId, StatusInfo } from '../osBindings';
|
|
3
|
+
import { Watchable } from './Watchable';
|
|
4
|
+
export declare class GetStatus extends Watchable<StatusInfo | null> {
|
|
5
|
+
readonly opts: {
|
|
6
|
+
packageId?: PackageId;
|
|
7
|
+
};
|
|
8
|
+
protected readonly label = "GetStatus";
|
|
9
|
+
constructor(effects: Effects, opts?: {
|
|
10
|
+
packageId?: PackageId;
|
|
11
|
+
});
|
|
12
|
+
protected call(callback?: () => void): Promise<StatusInfo | null>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetStatus = void 0;
|
|
4
|
+
const Watchable_1 = require("./Watchable");
|
|
5
|
+
class GetStatus extends Watchable_1.Watchable {
|
|
6
|
+
constructor(effects, opts = {}) {
|
|
7
|
+
super(effects);
|
|
8
|
+
this.opts = opts;
|
|
9
|
+
this.label = 'GetStatus';
|
|
10
|
+
}
|
|
11
|
+
call(callback) {
|
|
12
|
+
return this.effects.getStatus({ ...this.opts, callback });
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.GetStatus = GetStatus;
|
|
16
|
+
//# sourceMappingURL=GetStatus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GetStatus.js","sourceRoot":"","sources":["../../../../base/lib/util/GetStatus.ts"],"names":[],"mappings":";;;AAEA,2CAAuC;AAEvC,MAAa,SAAU,SAAQ,qBAA4B;IAGzD,YACE,OAAgB,EACP,OAAkC,EAAE;QAE7C,KAAK,CAAC,OAAO,CAAC,CAAA;QAFL,SAAI,GAAJ,IAAI,CAAgC;QAJ5B,UAAK,GAAG,WAAW,CAAA;IAOtC,CAAC;IAES,IAAI,CAAC,QAAqB;QAClC,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAA;IAC3D,CAAC;CACF;AAbD,8BAaC"}
|
|
@@ -1,31 +1,8 @@
|
|
|
1
1
|
import { Effects } from '../Effects';
|
|
2
2
|
import * as T from '../types';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { Watchable } from './Watchable';
|
|
4
|
+
export declare class GetSystemSmtp extends Watchable<T.SmtpValue | null> {
|
|
5
|
+
protected readonly label = "GetSystemSmtp";
|
|
5
6
|
constructor(effects: Effects);
|
|
6
|
-
|
|
7
|
-
* Returns the system SMTP credentials. Reruns the context from which it has been called if the underlying value changes
|
|
8
|
-
*/
|
|
9
|
-
const(): Promise<T.SmtpValue | null>;
|
|
10
|
-
/**
|
|
11
|
-
* Returns the system SMTP credentials. Does nothing if the credentials change
|
|
12
|
-
*/
|
|
13
|
-
once(): Promise<T.SmtpValue | null>;
|
|
14
|
-
private watchGen;
|
|
15
|
-
/**
|
|
16
|
-
* Watches the system SMTP credentials. Returns an async iterator that yields whenever the value changes
|
|
17
|
-
*/
|
|
18
|
-
watch(abort?: AbortSignal): AsyncGenerator<T.SmtpValue | null, never, unknown>;
|
|
19
|
-
/**
|
|
20
|
-
* Watches the system SMTP credentials. Takes a custom callback function to run whenever the credentials change
|
|
21
|
-
*/
|
|
22
|
-
onChange(callback: (value: T.SmtpValue | null, error?: Error) => {
|
|
23
|
-
cancel: boolean;
|
|
24
|
-
} | Promise<{
|
|
25
|
-
cancel: boolean;
|
|
26
|
-
}>): void;
|
|
27
|
-
/**
|
|
28
|
-
* Watches the system SMTP credentials. Returns when the predicate is true
|
|
29
|
-
*/
|
|
30
|
-
waitFor(pred: (value: T.SmtpValue | null) => boolean): Promise<T.SmtpValue | null>;
|
|
7
|
+
protected call(callback?: () => void): Promise<T.SmtpValue | null>;
|
|
31
8
|
}
|
|
@@ -1,90 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.GetSystemSmtp = void 0;
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
class GetSystemSmtp {
|
|
4
|
+
const Watchable_1 = require("./Watchable");
|
|
5
|
+
class GetSystemSmtp extends Watchable_1.Watchable {
|
|
7
6
|
constructor(effects) {
|
|
8
|
-
|
|
7
|
+
super(effects);
|
|
8
|
+
this.label = 'GetSystemSmtp';
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*/
|
|
13
|
-
const() {
|
|
14
|
-
return this.effects.getSystemSmtp({
|
|
15
|
-
callback: this.effects.constRetry &&
|
|
16
|
-
(() => this.effects.constRetry && this.effects.constRetry()),
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Returns the system SMTP credentials. Does nothing if the credentials change
|
|
21
|
-
*/
|
|
22
|
-
once() {
|
|
23
|
-
return this.effects.getSystemSmtp({});
|
|
24
|
-
}
|
|
25
|
-
async *watchGen(abort) {
|
|
26
|
-
const resolveCell = { resolve: () => { } };
|
|
27
|
-
this.effects.onLeaveContext(() => {
|
|
28
|
-
resolveCell.resolve();
|
|
29
|
-
});
|
|
30
|
-
abort?.addEventListener('abort', () => resolveCell.resolve());
|
|
31
|
-
while (this.effects.isInContext && !abort?.aborted) {
|
|
32
|
-
let callback = () => { };
|
|
33
|
-
const waitForNext = new Promise((resolve) => {
|
|
34
|
-
callback = resolve;
|
|
35
|
-
resolveCell.resolve = resolve;
|
|
36
|
-
});
|
|
37
|
-
yield await this.effects.getSystemSmtp({
|
|
38
|
-
callback: () => callback(),
|
|
39
|
-
});
|
|
40
|
-
await waitForNext;
|
|
41
|
-
}
|
|
42
|
-
return new Promise((_, rej) => rej(new AbortedError_1.AbortedError()));
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Watches the system SMTP credentials. Returns an async iterator that yields whenever the value changes
|
|
46
|
-
*/
|
|
47
|
-
watch(abort) {
|
|
48
|
-
const ctrl = new AbortController();
|
|
49
|
-
abort?.addEventListener('abort', () => ctrl.abort());
|
|
50
|
-
return Drop_1.DropGenerator.of(this.watchGen(ctrl.signal), () => ctrl.abort());
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Watches the system SMTP credentials. Takes a custom callback function to run whenever the credentials change
|
|
54
|
-
*/
|
|
55
|
-
onChange(callback) {
|
|
56
|
-
;
|
|
57
|
-
(async () => {
|
|
58
|
-
const ctrl = new AbortController();
|
|
59
|
-
for await (const value of this.watch(ctrl.signal)) {
|
|
60
|
-
try {
|
|
61
|
-
const res = await callback(value);
|
|
62
|
-
if (res.cancel) {
|
|
63
|
-
ctrl.abort();
|
|
64
|
-
break;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
catch (e) {
|
|
68
|
-
console.error('callback function threw an error @ GetSystemSmtp.onChange', e);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
})()
|
|
72
|
-
.catch((e) => callback(null, e))
|
|
73
|
-
.catch((e) => console.error('callback function threw an error @ GetSystemSmtp.onChange', e));
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Watches the system SMTP credentials. Returns when the predicate is true
|
|
77
|
-
*/
|
|
78
|
-
waitFor(pred) {
|
|
79
|
-
const ctrl = new AbortController();
|
|
80
|
-
return Drop_1.DropPromise.of(Promise.resolve().then(async () => {
|
|
81
|
-
for await (const next of this.watchGen(ctrl.signal)) {
|
|
82
|
-
if (pred(next)) {
|
|
83
|
-
return next;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
return null;
|
|
87
|
-
}), () => ctrl.abort());
|
|
10
|
+
call(callback) {
|
|
11
|
+
return this.effects.getSystemSmtp({ callback });
|
|
88
12
|
}
|
|
89
13
|
}
|
|
90
14
|
exports.GetSystemSmtp = GetSystemSmtp;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GetSystemSmtp.js","sourceRoot":"","sources":["../../../../base/lib/util/GetSystemSmtp.ts"],"names":[],"mappings":";;;AAEA,
|
|
1
|
+
{"version":3,"file":"GetSystemSmtp.js","sourceRoot":"","sources":["../../../../base/lib/util/GetSystemSmtp.ts"],"names":[],"mappings":";;;AAEA,2CAAuC;AAEvC,MAAa,aAAc,SAAQ,qBAA6B;IAG9D,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,CAAC,CAAA;QAHG,UAAK,GAAG,eAAe,CAAA;IAI1C,CAAC;IAES,IAAI,CAAC,QAAqB;QAClC,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAA;IACjD,CAAC;CACF;AAVD,sCAUC"}
|