@lossless.org/objectstorage 10.7.1 → 11.1.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.
Files changed (51) hide show
  1. package/.smartconfig.json +30 -10
  2. package/dist_rust/ruststorage_linux_amd64 +0 -0
  3. package/dist_rust/ruststorage_linux_amd64.tsrust-build.json +5 -5
  4. package/dist_rust/ruststorage_linux_amd64_musl +0 -0
  5. package/dist_rust/ruststorage_linux_amd64_musl.tsrust-build.json +5 -5
  6. package/dist_rust/ruststorage_linux_arm64 +0 -0
  7. package/dist_rust/ruststorage_linux_arm64.tsrust-build.json +5 -5
  8. package/dist_rust/ruststorage_linux_arm64_musl +0 -0
  9. package/dist_rust/ruststorage_linux_arm64_musl.tsrust-build.json +5 -5
  10. package/dist_rust/ruststorage_macos_amd64 +0 -0
  11. package/dist_rust/ruststorage_macos_amd64.tsrust-build.json +5 -5
  12. package/dist_rust/ruststorage_macos_arm64 +0 -0
  13. package/dist_rust/ruststorage_macos_arm64.tsrust-build.json +5 -5
  14. package/dist_ts/00_commitinfo_data.js +1 -1
  15. package/dist_ts/classes.dashboard.d.ts +49 -0
  16. package/dist_ts/classes.dashboard.js +234 -0
  17. package/dist_ts/dashboard.bundled.d.ts +4 -0
  18. package/dist_ts/dashboard.bundled.js +20 -0
  19. package/dist_ts/dashboard.interfaces.d.ts +132 -0
  20. package/dist_ts/dashboard.interfaces.js +2 -0
  21. package/dist_ts/dashboard.plugins.d.ts +5 -0
  22. package/dist_ts/dashboard.plugins.js +10 -0
  23. package/dist_ts/index.d.ts +219 -1
  24. package/dist_ts/index.js +209 -8
  25. package/package.json +17 -16
  26. package/readme.md +711 -30
  27. package/third-party-notices.md +21 -5
  28. package/third_party_licenses/borsh-1.8.1-license.txt +23 -0
  29. package/third_party_licenses/borsh-derive-1.8.1-apache-2.0.txt +201 -0
  30. package/third_party_licenses/cargo-dependencies.html +420 -0
  31. package/third_party_licenses/dyn-clone-1.0.20-license.txt +23 -0
  32. package/third_party_licenses/equivalent-1.0.3-license.txt +25 -0
  33. package/third_party_licenses/hashbrown-0.17.1-license.txt +25 -0
  34. package/third_party_licenses/indexmap-2.14.2-license.txt +25 -0
  35. package/third_party_licenses/inventory.json +310 -8
  36. package/third_party_licenses/proc-macro-crate-3.5.0-license.txt +23 -0
  37. package/third_party_licenses/ref-cast-1.0.27-license.txt +23 -0
  38. package/third_party_licenses/ref-cast-impl-1.0.27-license.txt +23 -0
  39. package/third_party_licenses/schemars-1.2.3-license.txt +21 -0
  40. package/third_party_licenses/syn-3.0.9-license.txt +23 -0
  41. package/third_party_licenses/toml_datetime-1.1.2-license.txt +19 -0
  42. package/third_party_licenses/toml_edit-0.25.17-license.txt +19 -0
  43. package/third_party_licenses/toml_parser-1.1.5-license.txt +19 -0
  44. package/third_party_licenses/winnow-1.0.4-license.txt +18 -0
  45. package/ts/00_commitinfo_data.ts +1 -1
  46. package/ts/classes.dashboard.ts +280 -0
  47. package/ts/dashboard.bundled.ts.third-party-notices.json +1741 -0
  48. package/ts/dashboard.bundled.ts.third-party-notices.txt +5015 -0
  49. package/ts/dashboard.interfaces.ts +148 -0
  50. package/ts/dashboard.plugins.ts +13 -0
  51. package/ts/index.ts +473 -14
@@ -0,0 +1,148 @@
1
+ import type { ITypedRequest, implementsTR } from '@api.global/typedrequest-interfaces';
2
+ import type { ITypedSocketEvent } from '@api.global/typedsocket';
3
+
4
+ /**
5
+ * Engine snapshot shapes, as `ObjectStorage.getClusterSnapshot()` returns
6
+ * them. The engine builds them from memory only: the drive states the last
7
+ * heartbeat probe left, runtime stats, healing state, S3 listener counters
8
+ * and a bounded ring of recent events. Times are milliseconds since the Unix
9
+ * epoch; absent values are `null`.
10
+ */
11
+ export interface IObjectStorageTelemetryEvent {
12
+ /** Numbered per node from 1; a gap means older events left the ring. */
13
+ seq: number;
14
+ at: number;
15
+ kind: 'engine' | 'peer' | 'drive' | 'healing';
16
+ severity: 'info' | 'warning' | 'error';
17
+ message: string;
18
+ }
19
+
20
+ /** S3 listener counters since the engine started; bytes include HTTP headers. */
21
+ export interface IObjectStorageTrafficCounters {
22
+ requestsTotal: number;
23
+ errorResponses: number;
24
+ bytesIn: number;
25
+ bytesOut: number;
26
+ }
27
+
28
+ export interface IObjectStorageStorageTotals {
29
+ bucketCount: number;
30
+ objectCount: number;
31
+ totalBytes: number;
32
+ }
33
+
34
+ export interface IObjectStorageDriveSnapshot {
35
+ index: number;
36
+ path: string;
37
+ status: 'online' | 'degraded' | 'offline' | 'healing';
38
+ totalBytes: number;
39
+ usedBytes: number;
40
+ availableBytes: number;
41
+ errorCount: number;
42
+ lastError: string | null;
43
+ lastCheck: number | null;
44
+ erasureSetId: number | null;
45
+ }
46
+
47
+ export interface IObjectStorageHealingSnapshot {
48
+ active: boolean;
49
+ scanIntervalMs: number;
50
+ lastRunStartedAt: number | null;
51
+ lastRunCompletedAt: number | null;
52
+ lastDurationMs: number | null;
53
+ shardsChecked: number | null;
54
+ shardsHealed: number | null;
55
+ shardsPending: number | null;
56
+ failed: number | null;
57
+ lastError: string | null;
58
+ }
59
+
60
+ /** What one node reports about itself; local and remote nodes share this shape. */
61
+ export interface IObjectStorageNodeSnapshot {
62
+ /** Absent in standalone mode. */
63
+ nodeId: string | null;
64
+ mode: 'standalone' | 'cluster';
65
+ startedAt: number;
66
+ capturedAt: number;
67
+ traffic: IObjectStorageTrafficCounters;
68
+ storage: IObjectStorageStorageTotals;
69
+ /** Local drives (cluster mode); empty in standalone mode. */
70
+ drives: IObjectStorageDriveSnapshot[];
71
+ healing: IObjectStorageHealingSnapshot | null;
72
+ /** Recent events, oldest first. */
73
+ events: IObjectStorageTelemetryEvent[];
74
+ }
75
+
76
+ export interface IObjectStoragePeerSnapshot {
77
+ nodeId: string;
78
+ status: 'online' | 'suspect' | 'offline';
79
+ quicAddress: string;
80
+ s3Address: string;
81
+ driveCount: number;
82
+ lastHeartbeat: number;
83
+ missedHeartbeats: number;
84
+ /** The peer's own snapshot, when it answered within a second. */
85
+ snapshot: IObjectStorageNodeSnapshot | null;
86
+ unavailableReason: string | null;
87
+ }
88
+
89
+ export interface IObjectStorageErasureSnapshot {
90
+ dataShards: number;
91
+ parityShards: number;
92
+ chunkSizeBytes: number;
93
+ totalShards: number;
94
+ readQuorum: number;
95
+ writeQuorum: number;
96
+ erasureSetCount: number;
97
+ }
98
+
99
+ export interface IObjectStorageClusterViewSnapshot {
100
+ nodeId: string;
101
+ quorumHealthy: boolean;
102
+ majorityHealthy: boolean;
103
+ erasure: IObjectStorageErasureSnapshot;
104
+ peers: IObjectStoragePeerSnapshot[];
105
+ }
106
+
107
+ export interface IObjectStorageClusterSnapshot {
108
+ capturedAt: number;
109
+ clusterEnabled: boolean;
110
+ local: IObjectStorageNodeSnapshot;
111
+ /** Absent in standalone mode. */
112
+ cluster: IObjectStorageClusterViewSnapshot | null;
113
+ }
114
+
115
+ /**
116
+ * Dashboard configuration. The dashboard is off unless `enabled` is true.
117
+ */
118
+ export interface IObjectStorageDashboardConfig {
119
+ enabled: boolean;
120
+ /** Interface the dashboard listens on. Default `127.0.0.1`. */
121
+ address?: string;
122
+ /** TCP port; `0` asks the OS for one. Default 3001; must differ from the S3 port. */
123
+ port?: number;
124
+ }
125
+
126
+ /** One dashboard sample, as pushed to every connected dashboard. */
127
+ export interface IObjectStorageDashboardSample {
128
+ sampledAt: number;
129
+ /** The snapshot, or `null` when the engine could not answer. */
130
+ snapshot: IObjectStorageClusterSnapshot | null;
131
+ error: string | null;
132
+ /** Events were left out of peer snapshots to keep the sample within the push limit. */
133
+ eventsTruncated: boolean;
134
+ }
135
+
136
+ /** Answers with the latest sample, taking one when none exists yet. */
137
+ export interface IReq_ObjectStorageDashboardGetSample
138
+ extends implementsTR<ITypedRequest, IReq_ObjectStorageDashboardGetSample> {
139
+ method: 'objectStorageDashboardGetSample';
140
+ request: Record<string, never>;
141
+ response: IObjectStorageDashboardSample;
142
+ }
143
+
144
+ /** Pushed every two seconds while at least one dashboard is connected. */
145
+ export interface IEvent_ObjectStorageDashboardSample
146
+ extends ITypedSocketEvent<IObjectStorageDashboardSample> {
147
+ name: 'objectStorageDashboardSample';
148
+ }
@@ -0,0 +1,13 @@
1
+ // Loaded only by the dashboard module, which `ObjectStorage` imports
2
+ // dynamically when the dashboard is enabled.
3
+
4
+ // @api.global scope
5
+ import * as typedrequest from '@api.global/typedrequest';
6
+ import * as typedsocket from '@api.global/typedsocket';
7
+
8
+ export { typedrequest, typedsocket };
9
+
10
+ // @push.rocks scope
11
+ import * as smartserve from '@push.rocks/smartserve';
12
+
13
+ export { smartserve };