@oceanprotocol/lib 10.1.0 → 10.2.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.
@@ -65,6 +65,12 @@ export interface ComputeEnvFeatures {
65
65
  computeJobs?: boolean;
66
66
  services?: boolean;
67
67
  }
68
+ export interface ComputeEnvironmentServiceOnDemand {
69
+ nodeHost: string;
70
+ hostPortRange: [number, number];
71
+ usedHostPorts: number[];
72
+ maxPortsPerService: number;
73
+ }
68
74
  export interface ComputeEnvironment {
69
75
  id: string;
70
76
  description?: string;
@@ -89,6 +95,7 @@ export interface ComputeEnvironment {
89
95
  resources?: ComputeResource[];
90
96
  free?: ComputeEnvironmentFreeOptions;
91
97
  platform?: RunningPlatform;
98
+ serviceOnDemand?: ComputeEnvironmentServiceOnDemand;
92
99
  }
93
100
  export interface ComputeResult {
94
101
  filename: string;
@@ -108,6 +108,36 @@ export interface ServiceOutputArchive {
108
108
  createdAt: number;
109
109
  containerId: string;
110
110
  }
111
+ export type ServiceReadinessState = 'waiting' | 'ready' | 'failing' | 'unknown';
112
+ export interface ServiceReadiness {
113
+ state: ServiceReadinessState;
114
+ engine: string;
115
+ readySince?: number;
116
+ lastCheckedAt?: number;
117
+ consecutiveFailures?: number;
118
+ httpStatus?: number;
119
+ lastError?: string;
120
+ probedUrl?: string;
121
+ }
122
+ export interface ServiceImagePullProgress {
123
+ phase: 'downloading' | 'extracting' | 'complete';
124
+ downloadedBytes: number;
125
+ totalBytes: number;
126
+ percent: number;
127
+ layersTotal: number;
128
+ layersDone: number;
129
+ updatedAt: number;
130
+ }
131
+ export interface ServiceModelDownload {
132
+ modelId?: string;
133
+ downloadedBytes: number;
134
+ totalBytes?: number;
135
+ percent?: number;
136
+ filesComplete: number;
137
+ filesInFlight: number;
138
+ filesTotal?: number;
139
+ updatedAt: number;
140
+ }
111
141
  export interface ServiceJob {
112
142
  serviceId: string;
113
143
  clusterHash: string;
@@ -130,6 +160,7 @@ export interface ServiceJob {
130
160
  expiresAt: number;
131
161
  duration: number;
132
162
  exposedPorts: number[];
163
+ requestedHostPorts?: Record<string, number>;
133
164
  endpoints: ServiceJobEndpoint[];
134
165
  resources: any[];
135
166
  payment: ServiceJobPayment;
@@ -138,6 +169,9 @@ export interface ServiceJob {
138
169
  metadata?: ComputeJobMetadata;
139
170
  outputBucketId?: string;
140
171
  outputArchives?: ServiceOutputArchive[];
172
+ readiness?: ServiceReadiness;
173
+ imagePull?: ServiceImagePullProgress;
174
+ modelDownload?: ServiceModelDownload;
141
175
  }
142
176
  export type ServiceJobListed = Omit<ServiceJob, 'dockerCmd' | 'dockerEntrypoint' | 'dockerfile' | 'additionalDockerFiles' | 'runtimeMetrics' | 'outputArchives'>;
143
177
  export interface ServiceListFilters {
@@ -151,6 +185,10 @@ export interface ServicePayment {
151
185
  token: string;
152
186
  }
153
187
  export type ServiceUserData = Record<string, unknown>;
188
+ export interface ServicePortRequest {
189
+ containerPort: number;
190
+ hostPort?: number;
191
+ }
154
192
  export interface ServiceContainerSpec {
155
193
  image?: string;
156
194
  tag?: string;
@@ -161,6 +199,7 @@ export interface ServiceContainerSpec {
161
199
  dockerCmd?: string[];
162
200
  dockerEntrypoint?: string[];
163
201
  metadata?: ComputeJobMetadata;
202
+ ports?: ServicePortRequest[];
164
203
  }
165
204
  export type ServiceRestartParams = ServiceContainerSpec;
166
205
  export interface ServiceStartParams extends ServiceContainerSpec {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oceanprotocol/lib",
3
3
  "source": "./src/index.ts",
4
- "version": "10.1.0",
4
+ "version": "10.2.0",
5
5
  "description": "JavaScript client library for Ocean Protocol",
6
6
  "module": "./dist/lib.module.mjs",
7
7
  "type": "module",
@@ -91,10 +91,9 @@
91
91
  "@libp2p/websockets": "^10.1.21",
92
92
  "@multiformats/multiaddr": "^13.0.3",
93
93
  "@oasisprotocol/sapphire-ethers-v6": "^6.0.1",
94
- "@oceanprotocol/ddo-js": "^1.0.0",
94
+ "@oceanprotocol/ddo-js": "^1.1.0",
95
95
  "bignumber.js": "^11.1.5",
96
96
  "cross-fetch": "^4.1.0",
97
- "crypto-js": "^4.2.0",
98
97
  "decimal.js": "^10.6.0",
99
98
  "eciesjs": "^0.5.0",
100
99
  "ethers": "^6.17.0",
@@ -114,6 +113,7 @@
114
113
  "@types/node": "^26.2.0",
115
114
  "auto-changelog": "^2.6.0",
116
115
  "chai": "^6.2.2",
116
+ "crypto-js": "^4.2.0",
117
117
  "eslint": "^10.8.1",
118
118
  "eslint-config-prettier": "^10.1.8",
119
119
  "eslint-plugin-prettier": "^5.5.6",