@serve.zone/interfaces 32.11.0 → 32.13.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/ts/data/index.ts CHANGED
@@ -17,6 +17,7 @@ export * from './docker.js';
17
17
  export * from './domain.js';
18
18
  export * from './event.js';
19
19
  export * from './externalregistry.js';
20
+ export * from './fleetcutover.js';
20
21
  export * from './gateway.js';
21
22
  export * from './hostedapp.js';
22
23
  export * from './image.js';
@@ -70,6 +70,8 @@ export const serviceRuntimeContract = Object.freeze({
70
70
  /** A node can run workloads only as an egress member of the protected authority, which admits at most this many. */
71
71
  maximumPinnedNodes: runtimeNetworkAuthorityContract.maximumEgressAuthorities,
72
72
  maximumPlatformEndpoints: runtimeNetworkAuthorityContract.maximumPlatformEndpoints,
73
+ /** The largest `limit` `getServiceRuntimeSpecs` accepts; Cloudly refuses a larger one. */
74
+ maximumSpecPageSize: 256,
73
75
  /** The largest `limit` `getClusterRuntimeAssignments` accepts; Cloudly refuses a larger one. */
74
76
  maximumAssignmentPageSize: 256,
75
77
  } as const);
@@ -0,0 +1,136 @@
1
+ import * as plugins from '../plugins.js';
2
+ import type { IIdentityCredential } from '../data/user.js';
3
+ import type { IClusterRuntime } from '../data/clusterruntime.js';
4
+ import type { IServiceRuntimeSpec } from '../data/serviceruntime.js';
5
+ import type {
6
+ IFleetCutoverAcceptedEvidenceReference,
7
+ IFleetCutoverCorestoreAdoptionReceipt,
8
+ IFleetCutoverIngressAuthority,
9
+ IFleetCutoverScope,
10
+ IFleetCutoverScopeClassificationRequest,
11
+ IFleetCutoverVolumeHandoffIntent,
12
+ TFleetCutoverPhaseAdvance,
13
+ TFleetCutoverRuntimeSpecRelease,
14
+ TFleetCutoverVolumeFence,
15
+ } from '../data/fleetcutover.js';
16
+
17
+ export interface IReq_Any_Cloudly_GetFleetCutoverScope
18
+ extends plugins.typedrequestInterfaces.implementsTR<
19
+ plugins.typedrequestInterfaces.ITypedRequest,
20
+ IReq_Any_Cloudly_GetFleetCutoverScope
21
+ > {
22
+ method: 'getFleetCutoverScope';
23
+ request: { identity: IIdentityCredential; clusterId: string };
24
+ response: { scope: IFleetCutoverScope | null };
25
+ }
26
+
27
+ /**
28
+ * The administrator classifies the exact current census candidate. Cloudly compares every entry
29
+ * with its current service, platform-service, credential, and storage authority before it may
30
+ * persist a complete scope; the request itself is no proof of those facts.
31
+ */
32
+ export interface IReq_Admin_Cloudly_ClassifyFleetCutoverScope
33
+ extends plugins.typedrequestInterfaces.implementsTR<
34
+ plugins.typedrequestInterfaces.ITypedRequest,
35
+ IReq_Admin_Cloudly_ClassifyFleetCutoverScope
36
+ > {
37
+ method: 'classifyFleetCutoverScope';
38
+ request: {
39
+ identity: IIdentityCredential;
40
+ classification: IFleetCutoverScopeClassificationRequest;
41
+ };
42
+ response: { scope: IFleetCutoverScope };
43
+ }
44
+
45
+ /**
46
+ * Forward-only legal phase CAS. All receipt references are dereferenced by Cloudly in the same
47
+ * transaction; caller-supplied records or booleans never satisfy a cutover condition.
48
+ */
49
+ export interface IReq_Admin_Cloudly_AdvanceFleetCutoverPhase
50
+ extends plugins.typedrequestInterfaces.implementsTR<
51
+ plugins.typedrequestInterfaces.ITypedRequest,
52
+ IReq_Admin_Cloudly_AdvanceFleetCutoverPhase
53
+ > {
54
+ method: 'advanceFleetCutoverPhase';
55
+ request: { identity: IIdentityCredential; advance: TFleetCutoverPhaseAdvance };
56
+ response: { runtime: IClusterRuntime; replayed: boolean };
57
+ }
58
+
59
+ /**
60
+ * The only cutover-specific hold release. Ingress releases first under an accepted empty public
61
+ * port policy; applications require the accepted ingress/port/route authority assembled later.
62
+ */
63
+ export interface IReq_Admin_Cloudly_ReleaseFleetCutoverRuntimeSpec
64
+ extends plugins.typedrequestInterfaces.implementsTR<
65
+ plugins.typedrequestInterfaces.ITypedRequest,
66
+ IReq_Admin_Cloudly_ReleaseFleetCutoverRuntimeSpec
67
+ > {
68
+ method: 'releaseFleetCutoverRuntimeSpec';
69
+ request: { identity: IIdentityCredential; release: TFleetCutoverRuntimeSpecRelease };
70
+ response: { spec: IServiceRuntimeSpec; replayed: boolean };
71
+ }
72
+
73
+ export interface IReq_Any_Cloudly_GetFleetCutoverIngressAuthority
74
+ extends plugins.typedrequestInterfaces.implementsTR<
75
+ plugins.typedrequestInterfaces.ITypedRequest,
76
+ IReq_Any_Cloudly_GetFleetCutoverIngressAuthority
77
+ > {
78
+ method: 'getFleetCutoverIngressAuthority';
79
+ request: { identity: IIdentityCredential; clusterId: string };
80
+ response: { authority: IFleetCutoverIngressAuthority | null };
81
+ }
82
+
83
+ /** Root-local only. Holding an intent creates negative storage authority and no runtime session. */
84
+ export interface IReq_PalletLocal_Pallet_HoldFleetCutoverVolumeFence
85
+ extends plugins.typedrequestInterfaces.implementsTR<
86
+ plugins.typedrequestInterfaces.ITypedRequest,
87
+ IReq_PalletLocal_Pallet_HoldFleetCutoverVolumeFence
88
+ > {
89
+ method: 'holdFleetCutoverVolumeFence';
90
+ request: { fenceId: string; handoffIntent: IFleetCutoverVolumeHandoffIntent };
91
+ response: { fence: Extract<TFleetCutoverVolumeFence, { state: 'held' }> };
92
+ }
93
+
94
+ export interface IReq_PalletLocal_Pallet_GetFleetCutoverVolumeFence
95
+ extends plugins.typedrequestInterfaces.implementsTR<
96
+ plugins.typedrequestInterfaces.ITypedRequest,
97
+ IReq_PalletLocal_Pallet_GetFleetCutoverVolumeFence
98
+ > {
99
+ method: 'getFleetCutoverVolumeFence';
100
+ request: { fenceId: string };
101
+ response: { fence: TFleetCutoverVolumeFence | null };
102
+ }
103
+
104
+ /**
105
+ * Pallet consumes the local fence only around a current accepted Corestore adoption result. The
106
+ * receipt carries the real ready storage-claim reference; the earlier handoff intent does not.
107
+ */
108
+ export interface IReq_PalletLocal_Pallet_ConsumeFleetCutoverVolumeFence
109
+ extends plugins.typedrequestInterfaces.implementsTR<
110
+ plugins.typedrequestInterfaces.ITypedRequest,
111
+ IReq_PalletLocal_Pallet_ConsumeFleetCutoverVolumeFence
112
+ > {
113
+ method: 'consumeFleetCutoverVolumeFence';
114
+ request: {
115
+ fence: IFleetCutoverAcceptedEvidenceReference;
116
+ adoption: IFleetCutoverCorestoreAdoptionReceipt;
117
+ };
118
+ response: { fence: Extract<TFleetCutoverVolumeFence, { state: 'consumed' }> };
119
+ }
120
+
121
+ /**
122
+ * Corestore owns the one-shot initial lineage/RWO CAS. The local caller supplies the held fence
123
+ * and server-owned handoff intent; Corestore returns the claim only after its provider is ready.
124
+ */
125
+ export interface IReq_Pallet_Corestore_AdoptFleetCutoverVolume
126
+ extends plugins.typedrequestInterfaces.implementsTR<
127
+ plugins.typedrequestInterfaces.ITypedRequest,
128
+ IReq_Pallet_Corestore_AdoptFleetCutoverVolume
129
+ > {
130
+ method: 'adoptFleetCutoverVolume';
131
+ request: {
132
+ handoffIntent: IFleetCutoverVolumeHandoffIntent;
133
+ palletFence: Extract<TFleetCutoverVolumeFence, { state: 'held' }>;
134
+ };
135
+ response: { adoption: IFleetCutoverCorestoreAdoptionReceipt };
136
+ }
@@ -16,6 +16,7 @@ import * as deploymentRequests from './deployment.js';
16
16
  import * as dnsRequests from './dns.js';
17
17
  import * as domainRequests from './domain.js';
18
18
  import * as externalRegistryRequests from './externalregistry.js';
19
+ import * as fleetCutoverRequests from './fleetcutover.js';
19
20
  import * as gatewayRequests from './gateway.js';
20
21
  import * as hostedAppRequests from './hostedapp.js';
21
22
  import * as identityRequests from './identity.js';
@@ -55,6 +56,7 @@ export {
55
56
  dnsRequests as dns,
56
57
  domainRequests as domain,
57
58
  externalRegistryRequests as externalRegistry,
59
+ fleetCutoverRequests as fleetcutover,
58
60
  gatewayRequests as gateway,
59
61
  hostedAppRequests as hostedapp,
60
62
  identityRequests as identity,
@@ -393,9 +393,10 @@ extends plugins.typedrequestInterfaces.implementsTR<
393
393
  /**
394
394
  * Writes the complete runtime spec of one service.
395
395
  *
396
- * `expectedRevision` is the revision the caller read, or `null` when the service has never had a
397
- * spec; any other stored revision refuses the write. Cloudly copies the organization from the
398
- * service and answers with the stored spec at its new revision.
396
+ * `expectedRevision` is the revision the caller read for the target `(serviceId, spec.clusterId)`,
397
+ * or `null` when that target has never had a spec; any other stored revision refuses the write.
398
+ * Cloudly copies the organization from the service and answers with the stored spec at its new
399
+ * target-local revision.
399
400
  */
400
401
  export interface IRequest_Any_Cloudly_SetServiceRuntimeSpec
401
402
  extends plugins.typedrequestInterfaces.implementsTR<
@@ -415,8 +416,20 @@ extends plugins.typedrequestInterfaces.implementsTR<
415
416
  }
416
417
 
417
418
  /**
418
- * A service's runtime spec and the producer's verdict on it. Both are `null` before the first spec;
419
- * a spec's status is `null` until the producer first decides it.
419
+ * The named refusal data when a scalar runtime-spec read finds more than one cluster target.
420
+ *
421
+ * This travels as `TypedResponseError.errorData`. The condition needs an explicit cluster or the
422
+ * paged read, never a retry of the same ambiguous request.
423
+ */
424
+ export interface IServiceRuntimeSpecAmbiguityErrorData {
425
+ code: 'service-runtime-spec-ambiguous';
426
+ retryable: false;
427
+ }
428
+
429
+ /**
430
+ * The only runtime spec of a service and the producer's verdict on it. Zero targets answer both
431
+ * members as `null`; one target answers it, with `status: null` until the producer first decides it.
432
+ * More than one target refuses with `IServiceRuntimeSpecAmbiguityErrorData`; Cloudly never picks one.
420
433
  */
421
434
  export interface IRequest_Any_Cloudly_GetServiceRuntimeSpec
422
435
  extends plugins.typedrequestInterfaces.implementsTR<
@@ -433,6 +446,71 @@ extends plugins.typedrequestInterfaces.implementsTR<
433
446
  | { spec: IServiceRuntimeSpec; status: IServiceRuntimeStatus | null };
434
447
  }
435
448
 
449
+ /** One service's runtime spec for one exact cluster target, or no such target. */
450
+ export interface IRequest_Any_Cloudly_GetServiceRuntimeSpecForCluster
451
+ extends plugins.typedrequestInterfaces.implementsTR<
452
+ plugins.typedrequestInterfaces.ITypedRequest,
453
+ IRequest_Any_Cloudly_GetServiceRuntimeSpecForCluster
454
+ > {
455
+ method: 'getServiceRuntimeSpecForCluster';
456
+ request: {
457
+ identity: IIdentity;
458
+ serviceId: string;
459
+ clusterId: string;
460
+ };
461
+ response:
462
+ | { spec: null; status: null }
463
+ | { spec: IServiceRuntimeSpec; status: IServiceRuntimeStatus | null };
464
+ }
465
+
466
+ /**
467
+ * Every cluster target of one service, ordered by cluster id and read a bounded page at a time.
468
+ * `cursor` is opaque and `limit` runs from 1 through `serviceRuntimeContract.maximumSpecPageSize`;
469
+ * Cloudly refuses any other limit. A returned status belongs to the spec beside it.
470
+ */
471
+ export interface IRequest_Any_Cloudly_GetServiceRuntimeSpecs
472
+ extends plugins.typedrequestInterfaces.implementsTR<
473
+ plugins.typedrequestInterfaces.ITypedRequest,
474
+ IRequest_Any_Cloudly_GetServiceRuntimeSpecs
475
+ > {
476
+ method: 'getServiceRuntimeSpecs';
477
+ request: {
478
+ identity: IIdentity;
479
+ serviceId: string;
480
+ cursor: string | null;
481
+ limit: number;
482
+ };
483
+ response: {
484
+ entries: Array<{ spec: IServiceRuntimeSpec; status: IServiceRuntimeStatus | null }>;
485
+ nextCursor: string | null;
486
+ };
487
+ }
488
+
489
+ /**
490
+ * Removes one exact cluster target at the revision the administrator read.
491
+ *
492
+ * Cloudly derives every safety fact itself and fences them in the removal transaction: the current
493
+ * spec revision equals `expectedRevision`, that spec is held, every slot of this service on this
494
+ * cluster is fully settled and released, and the cluster's current phase still gives the spec
495
+ * producer authority. The caller supplies no phase, settlement, release or authority proof.
496
+ */
497
+ export interface IRequest_Any_Cloudly_RemoveServiceRuntimeSpecForCluster
498
+ extends plugins.typedrequestInterfaces.implementsTR<
499
+ plugins.typedrequestInterfaces.ITypedRequest,
500
+ IRequest_Any_Cloudly_RemoveServiceRuntimeSpecForCluster
501
+ > {
502
+ method: 'removeServiceRuntimeSpecForCluster';
503
+ request: {
504
+ identity: IIdentity;
505
+ serviceId: string;
506
+ clusterId: string;
507
+ expectedRevision: number;
508
+ };
509
+ response: {
510
+ removed: true;
511
+ };
512
+ }
513
+
436
514
  /** Every current runtime assignment of one service, one per replica slot. */
437
515
  export interface IRequest_Any_Cloudly_GetServiceRuntimeAssignments
438
516
  extends plugins.typedrequestInterfaces.implementsTR<