@serve.zone/interfaces 32.72.0 → 32.73.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.
@@ -0,0 +1,160 @@
1
+ import { canonicalizeStrictJson, compareWireTokens, createCanonicalJsonSha256Hex } from '../private/canonicaljson.js';
2
+ /**
3
+ * Locations: the rooms Cloudly's physical objects stand in.
4
+ *
5
+ * A location is a record of its own, referenced by its `id` and named by one unique, renamable
6
+ * `name`. Objects carry the id: a cluster node in `IClusterNode.data.locationId`, the records later
7
+ * lanes add (gateway, edge, Onebox host) in a required `locationId` of their own. A cluster has no
8
+ * stored location: it stands where its nodes stand (`getClusterLocationId`), and an empty cluster
9
+ * stands nowhere. A BareMetal server stands where the node whose `data.baremetalId` names it
10
+ * stands; its `data.location` stays the provider's datacenter.
11
+ *
12
+ * Every Cloudly database holds exactly one initial location (`initialLocationId`, named
13
+ * `initialLocationName` until an administrator renames it). It receives every create that names no
14
+ * location for a cluster without nodes; a create for a cluster with nodes takes the cluster's.
15
+ */
16
+ export const locationContract = Object.freeze({
17
+ /** One lowercase RFC 1123 label. */
18
+ maximumNameLength: 63,
19
+ digestDomain: 'serve.zone/location-membership',
20
+ });
21
+ /**
22
+ * The id of the one location every Cloudly database holds; it never changes. Cloudly generates
23
+ * every other location's id with a generator that can never produce this one.
24
+ */
25
+ export const initialLocationId = 'location-initial';
26
+ /** The name the initial location is created with; an administrator may rename it. */
27
+ export const initialLocationName = 'initial';
28
+ const locationNameLabel = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/;
29
+ /** True for a location name: one lowercase RFC 1123 label of 1 to 63 characters. */
30
+ export const isLocationName = (valueArg) => (typeof valueArg === 'string'
31
+ && valueArg.length <= locationContract.maximumNameLength
32
+ && locationNameLabel.test(valueArg));
33
+ /**
34
+ * Every kind of stored object a location can hold, in canonical (`compareWireTokens`) order. A
35
+ * Cloudly records only some of them (`IReq_Any_Cloudly_GetLocations` answers which); a kind it does
36
+ * not record has no members anywhere. A cluster is no member: it stores no location and stands
37
+ * where its nodes stand (`getClusterLocationId`); `getClusters` lists a location's clusters through
38
+ * its `locationScope`.
39
+ */
40
+ export const locationMemberKinds = Object.freeze([
41
+ 'edge', 'gateway', 'node', 'oneboxHost',
42
+ ]);
43
+ /** True for one of `locationMemberKinds`. */
44
+ export const isLocationMemberKind = (valueArg) => (locationMemberKinds.includes(valueArg));
45
+ /**
46
+ * Every reason Cloudly answers instead of a location request or a create that names a location.
47
+ * Each travels by name as a `TypedResponseError`, and a refused request changes nothing.
48
+ */
49
+ export const locationRefusals = Object.freeze([
50
+ /**
51
+ * A create named a location but creates no node to stand in it (`createCluster` with `setupMode`
52
+ * `manual` or absent); name the location on `createNodeJumpCommand` instead. Checked before
53
+ * `location-not-found`.
54
+ */
55
+ 'location-needs-node',
56
+ /** No location of that id exists. */
57
+ 'location-not-found',
58
+ /** The name is not one lowercase RFC 1123 label (`isLocationName`). */
59
+ 'location-name-invalid',
60
+ /** Another location carries that name. */
61
+ 'location-name-taken',
62
+ /** No cluster of that id exists (`setClusterLocation`). */
63
+ 'cluster-not-found',
64
+ /**
65
+ * A create for a cluster with nodes named a location other than the cluster's:
66
+ * `createNodeJumpCommand` when it is asked, and the jump-code claim when the cluster gained nodes
67
+ * in another location after the code was made.
68
+ */
69
+ 'location-mismatch',
70
+ /**
71
+ * A create or a jump-code claim for a cluster whose nodes already stand in more than one
72
+ * location: a state Cloudly never writes, which `getClusterLocationId` reports by throwing
73
+ * `ClusterSpansLocationsError`. `setClusterLocation` never answers it: it writes every node of the
74
+ * cluster to the target location in one transaction, which also repairs a spanning cluster.
75
+ */
76
+ 'cluster-spans-locations',
77
+ /**
78
+ * The digest a confirmation states is not the location's current membership digest: read the
79
+ * location again and confirm what it holds now.
80
+ */
81
+ 'membership-changed',
82
+ /** A concurrent change to the same records won; nothing changed. Read again and retry. */
83
+ 'conflict',
84
+ ]);
85
+ /** What a `setClusterLocation` did; every outcome is a success. */
86
+ export const setClusterLocationOutcomes = Object.freeze([
87
+ /** Every node of the cluster, and the cluster's copy of each, now names the location. */
88
+ 'moved',
89
+ /** Every node already stood in the location; nothing was written. */
90
+ 'unchanged',
91
+ /** The cluster has no nodes, so it stands nowhere and nothing was moved. */
92
+ 'cluster-empty',
93
+ ]);
94
+ /** Thrown by `getClusterLocationId` for a cluster whose node copies disagree. */
95
+ export class ClusterSpansLocationsError extends Error {
96
+ refusal = 'cluster-spans-locations';
97
+ clusterId;
98
+ constructor(clusterIdArg) {
99
+ super(`Cluster ${clusterIdArg} spans locations.`);
100
+ this.name = 'ClusterSpansLocationsError';
101
+ this.clusterId = clusterIdArg;
102
+ }
103
+ }
104
+ /**
105
+ * The location a cluster stands in, read from its own `data.nodes` copies.
106
+ *
107
+ * `undefined` when the cluster has no nodes, or when no copy names a location (the cluster came
108
+ * from a controller without locations); such a cluster drops out of every location scope. Throws
109
+ * `ClusterSpansLocationsError` when the copies name different locations, or some name one and
110
+ * others none: Cloudly never writes that state, and no single answer would be true for it.
111
+ */
112
+ export const getClusterLocationId = (clusterArg) => {
113
+ const locationIds = new Set(clusterArg.data.nodes.map((nodeArg) => nodeArg.data.locationId));
114
+ if (locationIds.size > 1) {
115
+ throw new ClusterSpansLocationsError(clusterArg.id);
116
+ }
117
+ const [locationId] = locationIds;
118
+ return locationId;
119
+ };
120
+ /** True while the location's confirmed digest equals its current membership digest. */
121
+ export const isLocationMembershipConfirmed = (locationArg, membershipDigestArg) => locationArg.data.membershipConfirmation?.membershipDigest === membershipDigestArg;
122
+ const fail = (reasonArg) => {
123
+ throw new Error(`Location membership digest input rejected: ${reasonArg}.`);
124
+ };
125
+ const compareMembers = (leftArg, rightArg) => (compareWireTokens(leftArg.kind, rightArg.kind) || compareWireTokens(leftArg.id, rightArg.id));
126
+ /**
127
+ * The canonical JSON a membership digest hashes: the digest domain, the recorded kinds in
128
+ * canonical order and the members as `[kind, id]` pairs sorted by kind and then id. The order the
129
+ * caller lists either in does not matter. Throws for an unknown or repeated kind, a member of a
130
+ * kind not recorded, an empty id or a repeated member.
131
+ */
132
+ export const createLocationMembershipDigestInput = (membersArg, recordedKindsArg) => {
133
+ const recordedKinds = [...recordedKindsArg].sort(compareWireTokens);
134
+ recordedKinds.forEach((kindArg, indexArg) => {
135
+ if (!isLocationMemberKind(kindArg))
136
+ fail('unknown member kind');
137
+ if (indexArg > 0 && kindArg === recordedKinds[indexArg - 1])
138
+ fail('repeated member kind');
139
+ });
140
+ const members = [...membersArg].sort(compareMembers);
141
+ members.forEach((memberArg, indexArg) => {
142
+ if (!recordedKinds.includes(memberArg.kind))
143
+ fail('member of a kind not recorded');
144
+ if (typeof memberArg.id !== 'string' || memberArg.id.length === 0)
145
+ fail('member id empty');
146
+ if (indexArg > 0 && compareMembers(memberArg, members[indexArg - 1]) === 0)
147
+ fail('repeated member');
148
+ });
149
+ return canonicalizeStrictJson({
150
+ domain: locationContract.digestDomain,
151
+ recordedKinds,
152
+ members: members.map((memberArg) => [memberArg.kind, memberArg.id]),
153
+ }, fail, 'location membership');
154
+ };
155
+ /**
156
+ * `sha256:<hex>` of `createLocationMembershipDigestInput`, through Web Crypto, so Cloudly and a
157
+ * browser client compute the same value.
158
+ */
159
+ export const computeLocationMembershipDigest = async (membersArg, recordedKindsArg) => `sha256:${await createCanonicalJsonSha256Hex(createLocationMembershipDigestInput(membersArg, recordedKindsArg), fail)}`;
160
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYXRpb24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9kYXRhL2xvY2F0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxzQkFBc0IsRUFBRSxpQkFBaUIsRUFBRSw0QkFBNEIsRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBSXRIOzs7Ozs7Ozs7Ozs7O0dBYUc7QUFDSCxNQUFNLENBQU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zQixDQUFDO1FBQzVCLE1BQU0sRUFBRSxnQkFBZ0IsQ0FBQyxZQUFZO1FBQ3JDLGFBQWE7UUFDYixPQUFPLEVBQUUsT0FBTyxDQUFDLEdBQUcsQ0FBQyxDQUFDLFNBQVMsRUFBRSxFQUFFLENBQUMsQ0FBQyxTQUFTLENBQUMsSUFBSSxFQUFFLFNBQVMsQ0FBQyxFQUFFLENBQUMsQ0FBQztLQUNwRSxFQUFFLElBQUksRUFBRSxxQkFBcUIsQ0FBQyxDQUFDO0FBQ2xDLENBQUMsQ0FBQztBQUVGOzs7R0FHRztBQUNILE1BQU0sQ0FBQyxNQUFNLCtCQUErQixHQUFHLEtBQUssRUFDbEQsVUFBc0MsRUFDdEMsZ0JBQWdELEVBQ3hCLEVBQUUsQ0FBQyxVQUFVLE1BQU0sNEJBQTRCLENBQ3ZFLG1DQUFtQyxDQUFDLFVBQVUsRUFBRSxnQkFBZ0IsQ0FBQyxFQUFFLElBQUksQ0FDeEUsRUFBRSxDQUFDIn0=
@@ -1,13 +1,25 @@
1
1
  import * as plugins from '../plugins.js';
2
2
  import type { IBareMetal } from '../data/baremetal.js';
3
+ import type { ILocationScope } from '../data/location.js';
3
4
  import type { IIdentity } from '../data/user.js';
4
5
  export interface IRequest_Any_Cloudly_GetBaremetalServers extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IRequest_Any_Cloudly_GetBaremetalServers> {
5
6
  method: 'getBaremetalServers';
6
7
  request: {
7
8
  identity: IIdentity;
9
+ /**
10
+ * Only the servers standing in this location: those a node of the location names in its
11
+ * `data.baremetalId`. A server no node names stands nowhere and is never in a scoped answer;
12
+ * `IBareMetal.data.location` (the provider's datacenter) plays no part.
13
+ */
14
+ locationScope?: ILocationScope;
8
15
  };
9
16
  response: {
10
17
  baremetals: IBareMetal[];
18
+ /**
19
+ * The scope Cloudly applied, echoing `locationScope`. Absent from a Cloudly that ignored the
20
+ * scope (one without locations): its list is unscoped and must not be shown as scoped.
21
+ */
22
+ appliedLocationScope?: ILocationScope;
11
23
  };
12
24
  }
13
25
  export interface IRequest_Any_Cloudly_ControlBaremetal extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IRequest_Any_Cloudly_ControlBaremetal> {
@@ -1,5 +1,6 @@
1
1
  import * as userInterfaces from '../data/user.js';
2
2
  import * as clusterInterfaces from '../data/cluster.js';
3
+ import type * as locationInterfaces from '../data/location.js';
3
4
  import type * as relayCredentialInterfaces from '../data/clusterrelaycredential.js';
4
5
  import type * as clusterVpnInterfaces from '../data/clustervpn.js';
5
6
  import type { IClusterRuntime, TClusterRuntimeBlocker } from '../data/clusterruntime.js';
@@ -13,9 +14,19 @@ export interface IReq_Any_Cloudly_GetClusters extends plugins.typedrequestInterf
13
14
  method: 'getClusters';
14
15
  request: {
15
16
  identity: userInterfaces.IIdentity;
17
+ /**
18
+ * Only the clusters standing in this location (`data.getClusterLocationId`); a cluster without
19
+ * nodes stands nowhere and is never in a scoped answer.
20
+ */
21
+ locationScope?: locationInterfaces.ILocationScope;
16
22
  };
17
23
  response: {
18
24
  clusters: clusterInterfaces.ICluster[];
25
+ /**
26
+ * The scope Cloudly applied, echoing `locationScope`. Absent from a Cloudly that ignored the
27
+ * scope (one without locations): its list is unscoped and must not be shown as scoped.
28
+ */
29
+ appliedLocationScope?: locationInterfaces.ILocationScope;
19
30
  };
20
31
  }
21
32
  export interface IReq_Any_Cloudly_GetClusterById extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_Any_Cloudly_GetClusterById> {
@@ -34,6 +45,15 @@ export interface IRequest_CreateCluster extends plugins.typedrequestInterfaces.i
34
45
  identity: userInterfaces.IIdentity;
35
46
  clusterName: string;
36
47
  setupMode?: 'manual' | 'hetzner' | 'aws' | 'digitalocean';
48
+ /**
49
+ * The location the node a provisioning setup mode creates stands in. Refused
50
+ * `location-needs-node` when the create makes no node to stand in it (`setupMode` `manual` or
51
+ * absent; name the location on `createNodeJumpCommand` instead), checked before
52
+ * `location-not-found`, which answers a location that does not exist. Absent, the created node
53
+ * stands in the location that receives unnamed creates (the initial location); a create that
54
+ * makes no node leaves the cluster empty, standing nowhere.
55
+ */
56
+ locationId?: string;
37
57
  };
38
58
  response: {
39
59
  cluster: clusterInterfaces.ICluster;
@@ -1,4 +1,4 @@
1
1
  import * as userInterfaces from '../data/user.js';
2
2
  import * as clusterInterfaces from '../data/cluster.js';
3
3
  import * as plugins from '../plugins.js';
4
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2x1c3Rlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzL3JlcXVlc3RzL2NsdXN0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLGNBQWMsTUFBTSxpQkFBaUIsQ0FBQztBQUNsRCxPQUFPLEtBQUssaUJBQWlCLE1BQU0sb0JBQW9CLENBQUM7QUFNeEQsT0FBTyxLQUFLLE9BQU8sTUFBTSxlQUFlLENBQUMifQ==
4
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2x1c3Rlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzL3JlcXVlc3RzL2NsdXN0ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLGNBQWMsTUFBTSxpQkFBaUIsQ0FBQztBQUNsRCxPQUFPLEtBQUssaUJBQWlCLE1BQU0sb0JBQW9CLENBQUM7QUFPeEQsT0FBTyxLQUFLLE9BQU8sTUFBTSxlQUFlLENBQUMifQ==
@@ -21,6 +21,7 @@ import * as hostedAppRequests from './hostedapp.js';
21
21
  import * as identityRequests from './identity.js';
22
22
  import * as imageRequests from './image.js';
23
23
  import * as informRequests from './inform.js';
24
+ import * as locationRequests from './location.js';
24
25
  import * as logRequests from './log.js';
25
26
  import * as mailRequests from './mail.js';
26
27
  import * as migrationRequests from './migration.js';
@@ -37,7 +38,7 @@ import * as statusRequests from './status.js';
37
38
  import * as taskRequests from './task.js';
38
39
  import * as versionRequests from './version.js';
39
40
  import * as webPushRequests from './webpush.js';
40
- export { adminRequests as admin, appStoreRequests as appstore, baremetalRequests as baremetal, baseOsRequests as baseos, backupRequests as backup, certificateRequests as certificate, clusterRequests as cluster, clusterIngressRequests as clusteringress, configRequests as config, coreMailRequests as coremail, coreMailAdminRequests as coremailAdmin, corestoreRequests as corestore, corestoreControlRequests as corestorecontrol, deploymentRequests as deployment, dnsRequests as dns, domainRequests as domain, externalRegistryRequests as externalRegistry, fleetCutoverRequests as fleetcutover, gatewayRequests as gateway, hostedAppRequests as hostedapp, identityRequests as identity, imageRequests as image, informRequests as inform, logRequests as log, mailRequests as mail, migrationRequests as migration, networkRequests as network, nodeRequests as node, palletRequests as pallet, platformRequests as platform, routingRequests as routing, runtimeSessionRequests as runtimesession, secretRequests as secret, serviceRequests as service, settingsRequests as settings, statusRequests as status, taskRequests as task, versionRequests as version, webPushRequests as webpush, };
41
+ export { adminRequests as admin, appStoreRequests as appstore, baremetalRequests as baremetal, baseOsRequests as baseos, backupRequests as backup, certificateRequests as certificate, clusterRequests as cluster, clusterIngressRequests as clusteringress, configRequests as config, coreMailRequests as coremail, coreMailAdminRequests as coremailAdmin, corestoreRequests as corestore, corestoreControlRequests as corestorecontrol, deploymentRequests as deployment, dnsRequests as dns, domainRequests as domain, externalRegistryRequests as externalRegistry, fleetCutoverRequests as fleetcutover, gatewayRequests as gateway, hostedAppRequests as hostedapp, identityRequests as identity, imageRequests as image, informRequests as inform, locationRequests as location, logRequests as log, mailRequests as mail, migrationRequests as migration, networkRequests as network, nodeRequests as node, palletRequests as pallet, platformRequests as platform, routingRequests as routing, runtimeSessionRequests as runtimesession, secretRequests as secret, serviceRequests as service, settingsRequests as settings, statusRequests as status, taskRequests as task, versionRequests as version, webPushRequests as webpush, };
41
42
  export * from './inform.js';
42
43
  export * from './hostedapp.js';
43
44
  export * from './mail.js';
@@ -22,6 +22,7 @@ import * as hostedAppRequests from './hostedapp.js';
22
22
  import * as identityRequests from './identity.js';
23
23
  import * as imageRequests from './image.js';
24
24
  import * as informRequests from './inform.js';
25
+ import * as locationRequests from './location.js';
25
26
  import * as logRequests from './log.js';
26
27
  import * as mailRequests from './mail.js';
27
28
  import * as migrationRequests from './migration.js';
@@ -38,9 +39,9 @@ import * as statusRequests from './status.js';
38
39
  import * as taskRequests from './task.js';
39
40
  import * as versionRequests from './version.js';
40
41
  import * as webPushRequests from './webpush.js';
41
- export { adminRequests as admin, appStoreRequests as appstore, baremetalRequests as baremetal, baseOsRequests as baseos, backupRequests as backup, certificateRequests as certificate, clusterRequests as cluster, clusterIngressRequests as clusteringress, configRequests as config, coreMailRequests as coremail, coreMailAdminRequests as coremailAdmin, corestoreRequests as corestore, corestoreControlRequests as corestorecontrol, deploymentRequests as deployment, dnsRequests as dns, domainRequests as domain, externalRegistryRequests as externalRegistry, fleetCutoverRequests as fleetcutover, gatewayRequests as gateway, hostedAppRequests as hostedapp, identityRequests as identity, imageRequests as image, informRequests as inform, logRequests as log, mailRequests as mail, migrationRequests as migration, networkRequests as network, nodeRequests as node, palletRequests as pallet, platformRequests as platform, routingRequests as routing, runtimeSessionRequests as runtimesession, secretRequests as secret, serviceRequests as service, settingsRequests as settings, statusRequests as status, taskRequests as task, versionRequests as version, webPushRequests as webpush, };
42
+ export { adminRequests as admin, appStoreRequests as appstore, baremetalRequests as baremetal, baseOsRequests as baseos, backupRequests as backup, certificateRequests as certificate, clusterRequests as cluster, clusterIngressRequests as clusteringress, configRequests as config, coreMailRequests as coremail, coreMailAdminRequests as coremailAdmin, corestoreRequests as corestore, corestoreControlRequests as corestorecontrol, deploymentRequests as deployment, dnsRequests as dns, domainRequests as domain, externalRegistryRequests as externalRegistry, fleetCutoverRequests as fleetcutover, gatewayRequests as gateway, hostedAppRequests as hostedapp, identityRequests as identity, imageRequests as image, informRequests as inform, locationRequests as location, logRequests as log, mailRequests as mail, migrationRequests as migration, networkRequests as network, nodeRequests as node, palletRequests as pallet, platformRequests as platform, routingRequests as routing, runtimeSessionRequests as runtimesession, secretRequests as secret, serviceRequests as service, settingsRequests as settings, statusRequests as status, taskRequests as task, versionRequests as version, webPushRequests as webpush, };
42
43
  export * from './inform.js';
43
44
  export * from './hostedapp.js';
44
45
  export * from './mail.js';
45
46
  export * from './webpush.js';
46
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9yZXF1ZXN0cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssT0FBTyxNQUFNLGVBQWUsQ0FBQztBQUV6QyxPQUFPLEtBQUssYUFBYSxNQUFNLFlBQVksQ0FBQztBQUM1QyxPQUFPLEtBQUssZ0JBQWdCLE1BQU0sZUFBZSxDQUFDO0FBQ2xELE9BQU8sS0FBSyxpQkFBaUIsTUFBTSxnQkFBZ0IsQ0FBQztBQUNwRCxPQUFPLEtBQUssY0FBYyxNQUFNLGFBQWEsQ0FBQztBQUM5QyxPQUFPLEtBQUssY0FBYyxNQUFNLGFBQWEsQ0FBQztBQUM5QyxPQUFPLEtBQUssbUJBQW1CLE1BQU0sa0JBQWtCLENBQUM7QUFDeEQsT0FBTyxLQUFLLGVBQWUsTUFBTSxjQUFjLENBQUM7QUFDaEQsT0FBTyxLQUFLLHNCQUFzQixNQUFNLHFCQUFxQixDQUFDO0FBQzlELE9BQU8sS0FBSyxjQUFjLE1BQU0sYUFBYSxDQUFDO0FBQzlDLE9BQU8sS0FBSyxnQkFBZ0IsTUFBTSxlQUFlLENBQUM7QUFDbEQsT0FBTyxLQUFLLHFCQUFxQixNQUFNLHFCQUFxQixDQUFDO0FBQzd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ha256Digest } from '../data/immutableimage.js';
4
+ import type { ILocation, ILocationView, TLocationMemberKind, TSetClusterLocationOutcome } from '../data/location.js';
5
+ import type { IIdentity } from '../data/user.js';
6
+ /** An administrator creates a location; refused `location-name-invalid` or `location-name-taken`. */
7
+ export interface IReq_Any_Cloudly_CreateLocation extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_Any_Cloudly_CreateLocation> {
8
+ method: 'createLocation';
9
+ request: {
10
+ identity: IIdentity;
11
+ /** `data.isLocationName`, unique among locations. */
12
+ name: string;
13
+ };
14
+ response: {
15
+ location: ILocation;
16
+ };
17
+ }
18
+ /**
19
+ * An administrator renames a location; its id and every reference stay. Renaming to the name it
20
+ * carries changes nothing. Refused `location-not-found`, `location-name-invalid` or
21
+ * `location-name-taken`.
22
+ */
23
+ export interface IReq_Any_Cloudly_RenameLocation extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_Any_Cloudly_RenameLocation> {
24
+ method: 'renameLocation';
25
+ request: {
26
+ identity: IIdentity;
27
+ locationId: string;
28
+ /** `data.isLocationName`, unique among locations. */
29
+ name: string;
30
+ };
31
+ response: {
32
+ location: ILocation;
33
+ };
34
+ }
35
+ /** Every location with its members, its membership digest and whether that membership is confirmed. */
36
+ export interface IReq_Any_Cloudly_GetLocations extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_Any_Cloudly_GetLocations> {
37
+ method: 'getLocations';
38
+ request: {
39
+ identity: IIdentity;
40
+ };
41
+ response: {
42
+ /** Sorted by location id; exactly one has `receivesUnnamedCreates`. */
43
+ locations: ILocationView[];
44
+ /**
45
+ * The member kinds this Cloudly records, in `data.locationMemberKinds` order; every view's
46
+ * digest covers them. A kind missing here has no members anywhere yet, so a confirmation
47
+ * cannot vouch for it.
48
+ */
49
+ recordedMemberKinds: TLocationMemberKind[];
50
+ };
51
+ }
52
+ /**
53
+ * An administrator moves a whole cluster to a location: every node of the cluster and the
54
+ * cluster's copy of each, in one transaction. A cluster without nodes stands nowhere, so the call
55
+ * moves nothing and answers `cluster-empty`. Refused `cluster-not-found`, `location-not-found` or
56
+ * `conflict`; never `cluster-spans-locations`, since the move also repairs a cluster whose nodes
57
+ * stand in more than one location.
58
+ */
59
+ export interface IReq_Any_Cloudly_SetClusterLocation extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_Any_Cloudly_SetClusterLocation> {
60
+ method: 'setClusterLocation';
61
+ request: {
62
+ identity: IIdentity;
63
+ clusterId: string;
64
+ locationId: string;
65
+ };
66
+ response: {
67
+ outcome: TSetClusterLocationOutcome;
68
+ /** The cluster as it now stands. */
69
+ cluster: ICluster;
70
+ };
71
+ }
72
+ /**
73
+ * An administrator confirms that a location holds everything it should, stating the
74
+ * `membershipDigest` of the view they read. Refused `membership-changed` when the location's
75
+ * membership is no longer that one, and `location-not-found`. The confirmation holds until the
76
+ * membership changes; nothing rewrites it then.
77
+ */
78
+ export interface IReq_Any_Cloudly_ConfirmLocationMembership extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_Any_Cloudly_ConfirmLocationMembership> {
79
+ method: 'confirmLocationMembership';
80
+ request: {
81
+ identity: IIdentity;
82
+ locationId: string;
83
+ membershipDigest: TSha256Digest;
84
+ };
85
+ response: {
86
+ location: ILocationView;
87
+ };
88
+ }
@@ -0,0 +1,2 @@
1
+ import * as plugins from '../plugins.js';
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYXRpb24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9yZXF1ZXN0cy9sb2NhdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssT0FBTyxNQUFNLGVBQWUsQ0FBQyJ9
@@ -3,6 +3,7 @@ import type { IBareMetal } from '../data/baremetal.js';
3
3
  import type { ICluster } from '../data/cluster.js';
4
4
  import type { IClusterNode, INodeAction, INodeMetricsSample, TNodeActionName } from '../data/clusternode.js';
5
5
  import type { IDeployment } from '../data/deployment.js';
6
+ import type { ILocationScope } from '../data/location.js';
6
7
  import type { INodeActionConfirmation, INodeActionPreview } from '../data/nodeaction.js';
7
8
  import type { ISparkFleetTarget, ISparkFleetTargetChange, ISparkNodeTargetHold } from '../data/sparkfleettarget.js';
8
9
  import type { IIdentity } from '../data/user.js';
@@ -119,6 +120,14 @@ export interface IReq_Any_Cloudly_CreateNodeJumpCommand extends plugins.typedreq
119
120
  * its name is proposed from that (`data.proposeClusterNodeName`).
120
121
  */
121
122
  nodeName?: string;
123
+ /**
124
+ * The location the new node stands in. Named, the location must exist (`location-not-found`)
125
+ * and, when the cluster has nodes, be the cluster's (`location-mismatch`); the jump code keeps
126
+ * it and the claim checks it again against the cluster as it stands then. Absent, the claim
127
+ * places the node in the cluster's location, or for a cluster without nodes in the location
128
+ * that receives unnamed creates (the initial location).
129
+ */
130
+ locationId?: string;
122
131
  };
123
132
  response: {
124
133
  jumpCode: string;
@@ -133,9 +142,16 @@ export interface IReq_Any_Cloudly_GetNodes extends plugins.typedrequestInterface
133
142
  request: {
134
143
  identity: IIdentity;
135
144
  clusterId?: string;
145
+ /** Only the nodes whose `data.locationId` is this location. */
146
+ locationScope?: ILocationScope;
136
147
  };
137
148
  response: {
138
149
  nodes: IClusterNode[];
150
+ /**
151
+ * The scope Cloudly applied, echoing `locationScope`. Absent from a Cloudly that ignored the
152
+ * scope (one without locations): its list is unscoped and must not be shown as scoped.
153
+ */
154
+ appliedLocationScope?: ILocationScope;
139
155
  };
140
156
  }
141
157
  export interface IReq_Any_Cloudly_GetNodeById extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_Any_Cloudly_GetNodeById> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serve.zone/interfaces",
3
- "version": "32.72.0",
3
+ "version": "32.73.0",
4
4
  "private": false,
5
5
  "description": "Shared TypeScript interfaces and TypedRequest contracts for the serve.zone ecosystem.",
6
6
  "exports": {
@@ -27,7 +27,7 @@
27
27
  "@tsclass/tsclass": "^9.5.1"
28
28
  },
29
29
  "devDependencies": {
30
- "@git.zone/tsrepo": "^1.1.1",
30
+ "@git.zone/tsrepo": "^2.0.0",
31
31
  "@types/node": "26.6.6",
32
32
  "typescript": "^6.0.3"
33
33
  },
package/readme.md CHANGED
@@ -3768,6 +3768,56 @@ const ingressReasons = data.validateClusterIngressRegistration({
3768
3768
  }); // []
3769
3769
  ```
3770
3770
 
3771
+ ### Locations
3772
+
3773
+ A location (`data.ILocation`) is a room Cloudly's physical objects stand in: one record with a
3774
+ fixed `id`, which every reference uses, and one unique, renamable `name`, one lowercase RFC 1123
3775
+ label (`data.isLocationName`). Every Cloudly database holds exactly one initial location
3776
+ (`data.initialLocationId`, created as `data.initialLocationName`, `initial`); it receives every
3777
+ create that names no location for a cluster without nodes, and `getLocations` marks it
3778
+ `receivesUnnamedCreates`.
3779
+
3780
+ - A node carries its location in `IClusterNode.data.locationId`, optional here because a
3781
+ controller without locations leaves it out; a Cloudly with locations sets it on every node.
3782
+ - A cluster stands where its nodes stand: `data.getClusterLocationId(cluster)` reads the cluster's
3783
+ `data.nodes` copies, answers `undefined` for a cluster without nodes (or one whose copies name no
3784
+ location) and throws `data.ClusterSpansLocationsError` when the copies disagree, a state Cloudly
3785
+ never writes. A cluster moves only whole (`setClusterLocation`), which writes every node to the
3786
+ target in one transaction and so also repairs a cluster that spans locations; it never answers
3787
+ `cluster-spans-locations`.
3788
+ - A BareMetal server stands where the node whose `data.baremetalId` names it stands;
3789
+ `IBareMetal.data.location` stays the provider's datacenter.
3790
+ - The member kinds are the stored kinds `data.locationMemberKinds` (`edge`, `gateway`, `node`,
3791
+ `oneboxHost`); `getLocations` answers which of them the Cloudly records
3792
+ (`recordedMemberKinds`). A cluster is no member and no part of the digest: `getClusters` with a
3793
+ `locationScope` lists the clusters standing in a location.
3794
+ - `data.initialLocationId` (`location-initial`) is fixed; Cloudly generates every other location id
3795
+ with a generator that can never produce it.
3796
+
3797
+ An administrator confirms a location's membership with the digest of the view they read
3798
+ (`confirmLocationMembership`). The location stores the confirmed digest; it is confirmed while that
3799
+ equals the current one (`data.isLocationMembershipConfirmed`), so nothing rewrites it when membership
3800
+ changes, and a confirmation of a stale digest is refused `membership-changed`.
3801
+ `data.computeLocationMembershipDigest(members, recordedKinds)` is `sha256:<hex>` (Web Crypto) of the
3802
+ canonical JSON of the sorted `[kind, id]` pairs and the recorded kinds
3803
+ (`data.createLocationMembershipDigestInput`), independent of the order either is listed in.
3804
+
3805
+ The requests (`requests.location`) are administrator-only, admitted by no delegated-admin scope:
3806
+ `createLocation`, `renameLocation`, `getLocations`, `setClusterLocation` (answers
3807
+ `data.setClusterLocationOutcomes`: `moved`, `unchanged`, or `cluster-empty` for a cluster without
3808
+ nodes) and `confirmLocationMembership`. Every refusal is one of `data.locationRefusals`.
3809
+ `createCluster` and `createNodeJumpCommand` take an optional `locationId`; for a cluster with nodes
3810
+ a named location must be the cluster's (`location-mismatch`). A `createCluster` that names a
3811
+ location but creates no node (`setupMode` `manual` or absent) is refused `location-needs-node`,
3812
+ checked before `location-not-found`: name the location on `createNodeJumpCommand` instead.
3813
+ `getClusters`, `getNodes` and `getBaremetalServers` take an optional `locationScope` and echo it as `appliedLocationScope`: a
3814
+ response without the echo comes from a Cloudly that ignored the scope and is not scoped.
3815
+
3816
+ Cloudly's 0.39.0 → 0.40.0 data step writes one transaction per cluster (the cluster document and
3817
+ all its node documents, setting `locationId` only where it is missing, so a rerun is safe) and one
3818
+ transaction per node whose `clusterId` names no existing cluster. It never calls
3819
+ `data.getClusterLocationId`, which throws for node copies that disagree.
3820
+
3771
3821
  ### Node Uplink Address
3772
3822
 
3773
3823
  A route to a node's published host ports needs the address that node answers on, and only the
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@serve.zone/interfaces',
6
- version: '32.72.0',
6
+ version: '32.73.0',
7
7
  description: 'Shared TypeScript interfaces and TypedRequest contracts for the serve.zone ecosystem.'
8
8
  }
@@ -16,5 +16,11 @@ export interface ICloudlyConfig {
16
16
  */
17
17
  listenPort?: string;
18
18
  sslMode?: 'none' | 'letsencrypt' | 'external';
19
+ /**
20
+ * @deprecated Human sign-in moves into Cloudly itself (AGL-1179): idp.global, Cloudly's own
21
+ * passkeys, and `cloudly login-token` minted inside the Cloudly container for the first admin and
22
+ * break-glass. Cloudly 34.0.0 no longer reads this key, and the next major of this package
23
+ * removes it.
24
+ */
19
25
  servezoneAdminaccount?: string;
20
26
  }
@@ -1734,7 +1734,15 @@ export interface IClusterNode {
1734
1734
  * Reference to the cluster this node belongs to
1735
1735
  */
1736
1736
  clusterId: string;
1737
-
1737
+
1738
+ /**
1739
+ * The location the node stands in (`ILocation.id`). Every Cloudly with locations sets it on
1740
+ * every node it stores and moves it only with the node's whole cluster
1741
+ * (`setClusterLocation`); only a controller without locations leaves it out. The cluster's
1742
+ * copies of its nodes carry it too, which `getClusterLocationId` reads.
1743
+ */
1744
+ locationId?: string;
1745
+
1738
1746
  /**
1739
1747
  * Reference to the physical server (if applicable)
1740
1748
  */
package/ts/data/index.ts CHANGED
@@ -90,6 +90,7 @@ export * from './serviceplatformownership.js';
90
90
  export * from './serviceports.js';
91
91
  export * from './serviceruntime.js';
92
92
  export * from './launchersecretowner.js';
93
+ export * from './location.js';
93
94
  export * from './servicevolumeinitialization.js';
94
95
  export * from './status.js';
95
96
  export * from './taskexecution.js';