@serve.zone/interfaces 32.87.0 → 32.89.0
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/changelog.md +17 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/data/cloudaccess.d.ts +402 -0
- package/dist_ts/data/cloudaccess.js +685 -0
- package/dist_ts/data/cloudlyconfig.d.ts +20 -0
- package/dist_ts/data/cloudlyconfig.js +21 -1
- package/dist_ts/data/gatewayareas.d.ts +116 -21
- package/dist_ts/data/gatewayareas.js +36 -1
- package/dist_ts/data/gatewayareas.validation.d.ts +30 -1
- package/dist_ts/data/gatewayareas.validation.js +242 -38
- package/dist_ts/data/gatewayconnector.d.ts +2 -2
- package/dist_ts/data/gatewayconnector.js +20 -1
- package/dist_ts/data/gatewayintent.d.ts +154 -0
- package/dist_ts/data/gatewayintent.js +61 -0
- package/dist_ts/data/index.d.ts +2 -0
- package/dist_ts/data/index.js +3 -1
- package/dist_ts/data/witness.js +4 -9
- package/dist_ts/private/bearerencoding.d.ts +9 -0
- package/dist_ts/private/bearerencoding.js +17 -0
- package/dist_ts/private/storagecontract.js +3 -3
- package/dist_ts/requests/cloudaccess.d.ts +125 -0
- package/dist_ts/requests/cloudaccess.js +2 -0
- package/dist_ts/requests/gatewayconnector.d.ts +33 -1
- package/dist_ts/requests/index.d.ts +2 -1
- package/dist_ts/requests/index.js +3 -2
- package/package.json +1 -1
- package/readme.md +156 -10
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/data/cloudaccess.ts +1133 -0
- package/ts/data/cloudlyconfig.ts +27 -0
- package/ts/data/gatewayareas.ts +84 -21
- package/ts/data/gatewayareas.validation.ts +268 -36
- package/ts/data/gatewayconnector.ts +19 -0
- package/ts/data/gatewayintent.ts +209 -0
- package/ts/data/index.ts +2 -0
- package/ts/data/witness.ts +3 -10
- package/ts/private/bearerencoding.ts +24 -0
- package/ts/private/storagecontract.ts +2 -2
- package/ts/requests/cloudaccess.ts +201 -0
- package/ts/requests/gatewayconnector.ts +41 -1
- package/ts/requests/index.ts +2 -0
package/ts/data/cloudlyconfig.ts
CHANGED
|
@@ -177,6 +177,33 @@ export const cloudlyHostOptionalEnvironment = Object.freeze([
|
|
|
177
177
|
/** One variable the Cloudly server reads but starts without. */
|
|
178
178
|
export type TCloudlyHostOptionalEnvironmentName = typeof cloudlyHostOptionalEnvironment[number];
|
|
179
179
|
|
|
180
|
+
/**
|
|
181
|
+
* The host extras a host can advertise to the Cloudly it runs (Linus ruling 13, amendment points
|
|
182
|
+
* 12 and 17): optional offers Cloudly uses only when the host advertises them, never a precondition
|
|
183
|
+
* for its start or run, and never inferred from the host type (`SERVEZONE_APP_HOST_TYPE`) or by
|
|
184
|
+
* probing the environment.
|
|
185
|
+
*
|
|
186
|
+
* `relayIngress` (Linus ruling 141 C7): the host serves `SERVEZONE_PUBLIC_ORIGIN`'s TLS on a second
|
|
187
|
+
* listener the Cloudly container can reach and forwards that listener only to Cloudly's relayed
|
|
188
|
+
* port, which serves the human surface only; a request accepted there is relayed. Cloud access can
|
|
189
|
+
* be started only on a host that advertises it.
|
|
190
|
+
*
|
|
191
|
+
* No carrier advertises an extra yet, so none can be advertised or read (amendment 141a): ruling 15
|
|
192
|
+
* point 4 names the carrier, `IHostedAppLifecycleState.hostExtras`, which this package does not
|
|
193
|
+
* declare yet, and no environment variable of either list names the relayed port yet.
|
|
194
|
+
*/
|
|
195
|
+
export const cloudlyHostExtras = Object.freeze([
|
|
196
|
+
'relayIngress',
|
|
197
|
+
] as const);
|
|
198
|
+
|
|
199
|
+
/** One host extra. */
|
|
200
|
+
export type TCloudlyHostExtra = typeof cloudlyHostExtras[number];
|
|
201
|
+
|
|
202
|
+
/** True for one of `cloudlyHostExtras`. */
|
|
203
|
+
export const isCloudlyHostExtra = (valueArg: unknown): valueArg is TCloudlyHostExtra => (
|
|
204
|
+
(cloudlyHostExtras as readonly unknown[]).includes(valueArg)
|
|
205
|
+
);
|
|
206
|
+
|
|
180
207
|
/**
|
|
181
208
|
* Cloudly's health path on its listen port (`GET` or `HEAD`). It answers 200 with
|
|
182
209
|
* `{ healthy: true, checks }` while Cloudly runs and 503 otherwise; it states no version. Cloudly
|
package/ts/data/gatewayareas.ts
CHANGED
|
@@ -449,16 +449,30 @@ export interface IGatewayDnsRecordRow {
|
|
|
449
449
|
/** A `dcrouter`-source row of `domains`. */
|
|
450
450
|
domainId: string;
|
|
451
451
|
/**
|
|
452
|
-
*
|
|
453
|
-
*
|
|
452
|
+
* At most 253 characters of lowercase labels (letters, digits, `_` and inner `-`, 1 to 63
|
|
453
|
+
* characters, as a zone's), no trailing dot; the leftmost label may instead be exactly `*`, with at
|
|
454
|
+
* least one label after it (Linus ruling 129). Inside its zone: the zone's `name` itself, or a name
|
|
455
|
+
* that ends in `.` and the zone's `name`, compared as written. A name outside the form is refused,
|
|
456
|
+
* never repaired; whether a gateway answers a `*` name as a wildcard is the gateway's to state.
|
|
454
457
|
*/
|
|
455
458
|
name: string;
|
|
456
459
|
type: TGatewayDnsRecordType;
|
|
457
460
|
/**
|
|
458
|
-
* The record value in
|
|
459
|
-
*
|
|
460
|
-
*
|
|
461
|
-
*
|
|
461
|
+
* The record value in its one spelling per type, the one the gateway's record value owner emits
|
|
462
|
+
* (Linus ruling 129):
|
|
463
|
+
*
|
|
464
|
+
* - `A`: one IPv4 address as a dotted quad without leading zeros. `AAAA`: one IPv6 address in its
|
|
465
|
+
* RFC 5952 text (lowercase hex groups without leading zeros, the longest run of two or more
|
|
466
|
+
* zero groups written `::`, the first run on a tie), no IPv4 tail and no zone id. The contract's
|
|
467
|
+
* canonical address text, with nothing around it (Linus ruling 143 B): another spelling of the
|
|
468
|
+
* same address is refused, and any address of the family is a value.
|
|
469
|
+
* - `CNAME`, `NS`: one domain name: lowercase, no trailing dot, no whitespace, no empty label,
|
|
470
|
+
* each label at most 63 octets and the name at most 253.
|
|
471
|
+
* - `MX`: `<preference> <exchange>` with one space between: the preference 0 to 65535 without a
|
|
472
|
+
* leading zero, the exchange such a name, or `0 .` for a null MX.
|
|
473
|
+
* - `SOA`: `<mname> <rname> <serial> <refresh> <retry> <expire> <minimum>` with one space between
|
|
474
|
+
* each: two such names and five numbers from 0 to 4294967295 without a leading zero.
|
|
475
|
+
* - `CAA`: a text without whitespace around it. `TXT`: the text itself.
|
|
462
476
|
*/
|
|
463
477
|
value: string;
|
|
464
478
|
/** Seconds, positive. */
|
|
@@ -472,9 +486,10 @@ export interface IGatewayDnsRecordRow {
|
|
|
472
486
|
export interface IGatewayDnsStaticRecordRow {
|
|
473
487
|
/** `static-` followed by 64 lowercase hex digits. */
|
|
474
488
|
id: string;
|
|
489
|
+
/** The name form of `IGatewayDnsRecordRow.name`; a static record belongs to no zone row. */
|
|
475
490
|
name: string;
|
|
476
491
|
type: TGatewayDnsStaticRecordType;
|
|
477
|
-
/** As `IGatewayDnsRecordRow.value
|
|
492
|
+
/** As `IGatewayDnsRecordRow.value`: the one spelling of its type. */
|
|
478
493
|
value: string;
|
|
479
494
|
/** Seconds; `null` for the gateway's default. */
|
|
480
495
|
ttl: number | null;
|
|
@@ -486,6 +501,7 @@ export interface IGatewayDnsStaticRecordRow {
|
|
|
486
501
|
export interface IGatewayDnsProtectedHostnameRow {
|
|
487
502
|
/** The exact hostname: lowercase, no trailing dot, no wildcard. */
|
|
488
503
|
id: string;
|
|
504
|
+
/** Without whitespace around it: the gateway stores a reason trimmed. */
|
|
489
505
|
reason: string;
|
|
490
506
|
}
|
|
491
507
|
|
|
@@ -529,7 +545,8 @@ export interface IGatewayDnsArea {
|
|
|
529
545
|
protectedHostnames: IGatewayDnsProtectedHostnameRow[];
|
|
530
546
|
/**
|
|
531
547
|
* Zones the gateway may answer for once it has proven their delegation itself, keyed by zone
|
|
532
|
-
* name
|
|
548
|
+
* name: at least two labels of letters, digits and inner hyphens (no `_`), the form a delegation
|
|
549
|
+
* names. The proof and its evidence stay on the gateway; it serves the proven ones.
|
|
533
550
|
*/
|
|
534
551
|
authorityZones: IGatewayAreaKeyRow[];
|
|
535
552
|
clientHostnames: IGatewayDnsClientHostnameRow[];
|
|
@@ -803,7 +820,8 @@ export interface IGatewayMailPortConfig {
|
|
|
803
820
|
|
|
804
821
|
/**
|
|
805
822
|
* The mail server settings singleton (the stored settings, never the run-time options).
|
|
806
|
-
* `emailConfig` is SmartMTA's server options
|
|
823
|
+
* `emailConfig` is SmartMTA's server options; while `enabled` it names a non-blank `hostname` and
|
|
824
|
+
* `ports`, a non-empty list of ports 1 to 65535 (a gateway starts no mail server without them). `auth.users` and `auth.accounts` are out; the rest of
|
|
807
825
|
* `auth` (`required`, `methods`) travels inside `emailConfig` (Linus ruling 126, which amends ruling
|
|
808
826
|
* 121). SMTP accounts are rows of `smtpAccounts`; plaintext `auth.users` logins have no table form,
|
|
809
827
|
* so a gateway that holds one refuses to export by name. Host paths stay out, and `tls.keyPem` is
|
|
@@ -816,7 +834,10 @@ export interface IGatewayMailServerSettings {
|
|
|
816
834
|
/** `emailConfig.tls.keyPem`; only with `emailConfig.tls`. */
|
|
817
835
|
tlsKey: IGatewaySealedValue | null;
|
|
818
836
|
emailPortConfig: IGatewayMailPortConfig;
|
|
819
|
-
/**
|
|
837
|
+
/**
|
|
838
|
+
* The effective source: what the gateway serves for settings stored without one.
|
|
839
|
+
* `configuredMaterial` only with material in the table: `tlsKey`, or `emailConfig.tls.certPem`.
|
|
840
|
+
*/
|
|
820
841
|
tlsSource: 'managedCertificate' | 'configuredMaterial';
|
|
821
842
|
}
|
|
822
843
|
|
|
@@ -899,8 +920,8 @@ export type TGatewayMailIdentityInboundTarget =
|
|
|
899
920
|
|
|
900
921
|
/**
|
|
901
922
|
* One WorkApp mail identity, one row per identity. Its SMTP credential is a verifier with
|
|
902
|
-
* `gatewayMailIdentityScramIterations` iterations; the password
|
|
903
|
-
*
|
|
923
|
+
* `gatewayMailIdentityScramIterations` iterations (`deriveGatewayScramVerifier`); the password is
|
|
924
|
+
* never stored by the gateway or in a table.
|
|
904
925
|
*/
|
|
905
926
|
export interface IGatewayMailIdentityRow {
|
|
906
927
|
id: string;
|
|
@@ -948,11 +969,45 @@ export interface IGatewayMailArea {
|
|
|
948
969
|
// edges
|
|
949
970
|
// ---------------------------------------------------------------------------------------------
|
|
950
971
|
|
|
972
|
+
/**
|
|
973
|
+
* The ranges and bounds of an edge's settings (`IGatewayEdgePerformance`, `IGatewayEdgeEgress`), the
|
|
974
|
+
* ones a gateway's remote ingress engine takes; `validateGatewayAreaTables` refuses outside them: an
|
|
975
|
+
* integer outside its range as `invalid-value` (a wrong value), a list beyond its length as
|
|
976
|
+
* `bound-exceeded` (a document's size).
|
|
977
|
+
*/
|
|
978
|
+
export const gatewayEdgeSettingBounds = Object.freeze({
|
|
979
|
+
/** Each integer performance setting, inclusive. Only `maxHalfClosedStreams` may be 0 (it turns the retention off). */
|
|
980
|
+
performance: Object.freeze({
|
|
981
|
+
maxStreamsPerEdge: Object.freeze({ minimum: 1, maximum: 100_000 }),
|
|
982
|
+
totalWindowBudgetBytes: Object.freeze({ minimum: 1, maximum: 1_073_741_824 }),
|
|
983
|
+
minStreamWindowBytes: Object.freeze({ minimum: 1, maximum: 16_777_216 }),
|
|
984
|
+
maxStreamWindowBytes: Object.freeze({ minimum: 1, maximum: 134_217_728 }),
|
|
985
|
+
sustainedStreamWindowBytes: Object.freeze({ minimum: 1, maximum: 134_217_728 }),
|
|
986
|
+
quicDatagramReceiveBufferBytes: Object.freeze({ minimum: 1, maximum: 67_108_864 }),
|
|
987
|
+
streamFramePayloadBytes: Object.freeze({ minimum: 1, maximum: 16_777_216 }),
|
|
988
|
+
firstDataConnectTimeoutMs: Object.freeze({ minimum: 1, maximum: 3_600_000 }),
|
|
989
|
+
clientWriteTimeoutMs: Object.freeze({ minimum: 1, maximum: 3_600_000 }),
|
|
990
|
+
maxHalfClosedStreams: Object.freeze({ minimum: 0, maximum: 100_000 }),
|
|
991
|
+
halfCloseDrainTimeoutMs: Object.freeze({ minimum: 1, maximum: 3_600_000 }),
|
|
992
|
+
}),
|
|
993
|
+
/** Entries of `serverFirstPorts`. */
|
|
994
|
+
maximumServerFirstPorts: 128,
|
|
995
|
+
/** The client-first TLS port, which `serverFirstPorts` never names. */
|
|
996
|
+
clientFirstPort: 443,
|
|
997
|
+
/** The `allowedPorts` of every enabled egress policy, exactly (Linus ruling 129, Q3): outbound SMTP. */
|
|
998
|
+
egressAllowedPorts: Object.freeze([25] as const),
|
|
999
|
+
/** Entries of an egress policy's `deniedCidrs` and of its `allowedHostPatterns`. */
|
|
1000
|
+
maximumEgressListEntries: 128,
|
|
1001
|
+
/** An egress policy's `maxConcurrentStreams`, from 1. */
|
|
1002
|
+
maximumEgressConcurrentStreams: 100_000,
|
|
1003
|
+
} as const);
|
|
1004
|
+
|
|
951
1005
|
/**
|
|
952
1006
|
* dcrouter's `IRemoteIngressPerformanceConfig`, canonical; `null` members take the gateway default.
|
|
953
1007
|
* At least one member is set: settings that state nothing are the owner's `performance: null`, never
|
|
954
1008
|
* an object of `null` members (Linus ruling 125, Q-b7; the gateway stores and exports them as no
|
|
955
|
-
* setting).
|
|
1009
|
+
* setting). Every integer lies in its range of `gatewayEdgeSettingBounds.performance`, and neither
|
|
1010
|
+
* `minStreamWindowBytes` nor `sustainedStreamWindowBytes` is above a stated `maxStreamWindowBytes`.
|
|
956
1011
|
*/
|
|
957
1012
|
export interface IGatewayEdgePerformance {
|
|
958
1013
|
profile: 'balanced' | 'throughput' | 'highConcurrency' | null;
|
|
@@ -967,15 +1022,19 @@ export interface IGatewayEdgePerformance {
|
|
|
967
1022
|
clientWriteTimeoutMs: number | null;
|
|
968
1023
|
maxHalfClosedStreams: number | null;
|
|
969
1024
|
halfCloseDrainTimeoutMs: number | null;
|
|
970
|
-
/**
|
|
1025
|
+
/**
|
|
1026
|
+
* A non-empty set of at most `gatewayEdgeSettingBounds.maximumServerFirstPorts` ports, never 443
|
|
1027
|
+
* (client-first TLS); `null` for none (never `[]`).
|
|
1028
|
+
*/
|
|
971
1029
|
serverFirstPorts: number[] | null;
|
|
972
1030
|
}
|
|
973
1031
|
|
|
974
1032
|
/**
|
|
975
1033
|
* dcrouter's `IRemoteIngressEgressPolicyConfig`, canonical; `null` members take the gateway default.
|
|
976
|
-
* An enabled policy states its ports
|
|
977
|
-
*
|
|
978
|
-
*
|
|
1034
|
+
* An enabled policy states its ports, which are exactly `gatewayEdgeSettingBounds.egressAllowedPorts`
|
|
1035
|
+
* (`[25]`, never `null`; Linus ruling 129: a gateway opens no other egress port); a disabled one
|
|
1036
|
+
* states nothing else, every other member `null`, because the gateway keeps only `enabled` of it. A
|
|
1037
|
+
* list member is `null` or non-empty, never `[]` (Linus ruling 125, Q-b7).
|
|
979
1038
|
*
|
|
980
1039
|
* Always stated on an edge row (`IGatewayEdgeRow.egress`): the gateway reads an edge without a
|
|
981
1040
|
* policy and one with a disabled policy alike, so egress off has the one spelling
|
|
@@ -985,13 +1044,14 @@ export interface IGatewayEdgePerformance {
|
|
|
985
1044
|
*/
|
|
986
1045
|
export interface IGatewayEdgeEgress {
|
|
987
1046
|
enabled: boolean;
|
|
988
|
-
/**
|
|
1047
|
+
/** `[25]` exactly when `enabled`; `null` otherwise. */
|
|
989
1048
|
allowedPorts: number[] | null;
|
|
990
1049
|
allowPrivateRanges: boolean | null;
|
|
991
|
-
/** A non-empty set of CIDRs, or `null`. */
|
|
1050
|
+
/** A non-empty set of at most `gatewayEdgeSettingBounds.maximumEgressListEntries` CIDRs, each without whitespace around it, or `null`. */
|
|
992
1051
|
deniedCidrs: string[] | null;
|
|
993
|
-
/** A non-empty set of host patterns, or `null`. */
|
|
1052
|
+
/** A non-empty set of host patterns under the same bound and rule, or `null`. */
|
|
994
1053
|
allowedHostPatterns: string[] | null;
|
|
1054
|
+
/** 1 to `gatewayEdgeSettingBounds.maximumEgressConcurrentStreams`, or `null`. */
|
|
995
1055
|
maxConcurrentStreams: number | null;
|
|
996
1056
|
}
|
|
997
1057
|
|
|
@@ -1012,15 +1072,18 @@ export interface IGatewayEdgeRow {
|
|
|
1012
1072
|
egress: IGatewayEdgeEgress;
|
|
1013
1073
|
/** A set of tags (the gateway reads absent as empty). */
|
|
1014
1074
|
tags: string[];
|
|
1075
|
+
/** One IPv4 address in canonical text (a dotted quad without leading zeros). */
|
|
1015
1076
|
publicIp: string | null;
|
|
1016
|
-
/** dcrouter stores it as `publicIpV6`. */
|
|
1077
|
+
/** One IPv6 address in canonical text (RFC 5952). dcrouter stores it as `publicIpV6`. */
|
|
1017
1078
|
publicIpv6: string | null;
|
|
1079
|
+
/** A lowercase fully qualified name: two or more labels of letters, digits and inner hyphens, no trailing dot. */
|
|
1018
1080
|
mailHostname: string | null;
|
|
1019
1081
|
}
|
|
1020
1082
|
|
|
1021
1083
|
/** The tunnel hub singleton, without its listener port and TLS files. */
|
|
1022
1084
|
export interface IGatewayEdgeHubSettings {
|
|
1023
1085
|
enabled: boolean;
|
|
1086
|
+
/** Without whitespace around it. */
|
|
1024
1087
|
hubDomain: string | null;
|
|
1025
1088
|
performance: IGatewayEdgePerformance | null;
|
|
1026
1089
|
}
|