@oceanprotocol/lib 9.0.0-next.3 → 9.0.0-next.5

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.
@@ -141,6 +141,7 @@ export declare const PROTOCOL_COMMANDS: {
141
141
  SERVICE_STOP: string;
142
142
  SERVICE_RESTART: string;
143
143
  SERVICE_GET_STATUS: string;
144
+ SERVICE_LIST: string;
144
145
  SERVICE_EXTEND: string;
145
146
  SERVICE_GET_STREAMABLE_LOGS: string;
146
147
  };
@@ -76,6 +76,7 @@ export interface ServiceJob {
76
76
  status: ServiceStatusNumber;
77
77
  statusText: string;
78
78
  dateCreated: string;
79
+ updatedAt?: number;
79
80
  expiresAt: number;
80
81
  duration: number;
81
82
  exposedPorts: number[];
@@ -84,6 +85,13 @@ export interface ServiceJob {
84
85
  payment: ServiceJobPayment;
85
86
  extendPayments?: ServiceJobPayment[];
86
87
  }
88
+ export type ServiceJobListed = Omit<ServiceJob, 'dockerCmd' | 'dockerEntrypoint' | 'dockerfile' | 'additionalDockerFiles'>;
89
+ export interface ServiceListFilters {
90
+ status?: ServiceStatusNumber;
91
+ includeAllStatuses?: boolean;
92
+ fromTimestamp?: string;
93
+ updatedSince?: string;
94
+ }
87
95
  export interface ServicePayment {
88
96
  chainId: number;
89
97
  token: string;
@@ -1,5 +1,5 @@
1
1
  import { Signer } from 'ethers';
2
- import { StorageObject, FileInfo, ComputeJob, ComputeOutput, ComputeAlgorithm, ComputeAsset, ComputeEnvironment, ComputeResultStream, ProviderInitialize, ProviderComputeInitializeResults, ServiceEndpoint, UserCustomParameters, ComputeResourceRequest, ComputeJobMetadata, PolicyServerInitializeCommand, PolicyServerPassthroughCommand, dockerRegistryAuth, DownloadResponse, NodeStatus, NodeComputeJob, NodeLogEntry, PersistentStorageAccessList, PersistentStorageBucket, PersistentStorageCreateBucketRequest, PersistentStorageDeleteFileResponse, PersistentStorageFileEntry, PersistentStorageObject, PersistentStorageUpdateBucketResponse, ServiceJob, ServiceTemplatePublic, ServiceStartParams, ServiceUserData, ServicePayment, OceanNode, CompleteSignature, SignerOrAuthTokenOrSignature } from '../../@types/index.js';
2
+ import { StorageObject, FileInfo, ComputeJob, ComputeOutput, ComputeAlgorithm, ComputeAsset, ComputeEnvironment, ComputeResultStream, ProviderInitialize, ProviderComputeInitializeResults, ServiceEndpoint, UserCustomParameters, ComputeResourceRequest, ComputeJobMetadata, PolicyServerInitializeCommand, PolicyServerPassthroughCommand, dockerRegistryAuth, DownloadResponse, NodeStatus, NodeComputeJob, NodeLogEntry, PersistentStorageAccessList, PersistentStorageBucket, PersistentStorageCreateBucketRequest, PersistentStorageDeleteFileResponse, PersistentStorageFileEntry, PersistentStorageObject, PersistentStorageUpdateBucketResponse, ServiceJob, ServiceJobListed, ServiceListFilters, ServiceTemplatePublic, ServiceStartParams, ServiceUserData, ServicePayment, OceanNode, CompleteSignature, SignerOrAuthTokenOrSignature } from '../../@types/index.js';
3
3
  import { type DDO, type ValidateMetadata } from '@oceanprotocol/ddo-js';
4
4
  import { P2pProvider, type P2PConfig, type P2PRequestBodyStream } from './P2pProvider.js';
5
5
  export { OCEAN_P2P_PROTOCOL, type P2PConfig } from './P2pProvider.js';
@@ -36,6 +36,11 @@ export declare class BaseProvider {
36
36
  * @param {ComputeJob} job The compute job just started.
37
37
  */
38
38
  private notifyIncentiveBackendJobStarted;
39
+ /**
40
+ * @param {OceanNode} nodeUri The provider URI the service runs on.
41
+ * @param {ServiceJob} service The service job just started.
42
+ */
43
+ private notifyIncentiveBackendServiceStarted;
39
44
  computeStreamableLogs(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, jobId: string, signal?: AbortSignal): Promise<any>;
40
45
  computeStop(jobId: string, nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, agreementId?: string, signal?: AbortSignal): Promise<ComputeJob | ComputeJob[]>;
41
46
  computeStatus(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, jobId?: string, agreementId?: string, signal?: AbortSignal): Promise<ComputeJob | ComputeJob[]>;
@@ -79,6 +84,7 @@ export declare class BaseProvider {
79
84
  serviceExtend(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, serviceId: string, additionalDuration: number, payment: ServicePayment, signal?: AbortSignal): Promise<ServiceJob[]>;
80
85
  serviceRestart(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, serviceId: string, userData?: ServiceUserData, dockerCmd?: string[], dockerEntrypoint?: string[], signal?: AbortSignal): Promise<ServiceJob[]>;
81
86
  getServiceStatus(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, serviceId?: string, signal?: AbortSignal): Promise<ServiceJob[]>;
87
+ getServices(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, filters?: ServiceListFilters, signal?: AbortSignal): Promise<ServiceJobListed[]>;
82
88
  serviceGetStreamableLogs(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, serviceId: string, since?: string, signal?: AbortSignal): Promise<any>;
83
89
  fetchConfig(nodeUri: OceanNode, payload: Record<string, any>): Promise<any>;
84
90
  pushConfig(nodeUri: OceanNode, payload: Record<string, any>): Promise<any>;
@@ -1,5 +1,5 @@
1
1
  import { Signer } from 'ethers';
2
- import { StorageObject, FileInfo, ComputeJob, ComputeOutput, ComputeAlgorithm, ComputeAsset, ComputeEnvironment, ProviderInitialize, ProviderComputeInitializeResults, ServiceEndpoint, UserCustomParameters, ComputeResourceRequest, ComputeJobMetadata, PolicyServerInitializeCommand, PolicyServerPassthroughCommand, dockerRegistryAuth, ComputeResultStream, NodeStatus, NodeComputeJob, NodeLogEntry, PersistentStorageAccessList, PersistentStorageBucket, PersistentStorageCreateBucketRequest, PersistentStorageDeleteFileResponse, PersistentStorageFileEntry, PersistentStorageObject, PersistentStorageUpdateBucketResponse, ServiceJob, ServiceTemplatePublic, ServiceStartParams, ServiceUserData, ServicePayment, SignerOrAuthTokenOrSignature } from '../../@types/index.js';
2
+ import { StorageObject, FileInfo, ComputeJob, ComputeOutput, ComputeAlgorithm, ComputeAsset, ComputeEnvironment, ProviderInitialize, ProviderComputeInitializeResults, ServiceEndpoint, UserCustomParameters, ComputeResourceRequest, ComputeJobMetadata, PolicyServerInitializeCommand, PolicyServerPassthroughCommand, dockerRegistryAuth, ComputeResultStream, NodeStatus, NodeComputeJob, NodeLogEntry, PersistentStorageAccessList, PersistentStorageBucket, PersistentStorageCreateBucketRequest, PersistentStorageDeleteFileResponse, PersistentStorageFileEntry, PersistentStorageObject, PersistentStorageUpdateBucketResponse, ServiceJob, ServiceJobListed, ServiceListFilters, ServiceTemplatePublic, ServiceStartParams, ServiceUserData, ServicePayment, SignerOrAuthTokenOrSignature } from '../../@types/index.js';
3
3
  import { type DDO, type ValidateMetadata } from '@oceanprotocol/ddo-js';
4
4
  import { type P2PRequestBodyStream } from './P2pProvider.js';
5
5
  export declare class HttpProvider {
@@ -304,5 +304,13 @@ export declare class HttpProvider {
304
304
  * @return {Promise<ServiceJob[]>} The matching service jobs.
305
305
  */
306
306
  getServiceStatus(nodeUri: string, signerOrAuthToken: SignerOrAuthTokenOrSignature, serviceId?: string, signal?: AbortSignal): Promise<ServiceJob[]>;
307
+ /**
308
+ * Node-wide service listing (SERVICE_LIST). Authenticated but NOT owner-scoped: any
309
+ * consumer identity sees every owner's services, listing-sanitized (no userData, no
310
+ * dockerCmd/dockerEntrypoint, no Dockerfile). Default (no filters) returns only the
311
+ * services currently holding a resource reservation; see ServiceListFilters.
312
+ * @return {Promise<ServiceJobListed[]>} The matching service jobs.
313
+ */
314
+ getServices(nodeUri: string, signerOrAuthToken: SignerOrAuthTokenOrSignature, filters?: ServiceListFilters, signal?: AbortSignal): Promise<ServiceJobListed[]>;
307
315
  serviceGetStreamableLogs(nodeUri: string, signerOrAuthToken: SignerOrAuthTokenOrSignature, serviceId: string, since?: string, signal?: AbortSignal): Promise<any>;
308
316
  }
@@ -1,6 +1,6 @@
1
1
  import { type Libp2p, type Libp2pOptions } from 'libp2p';
2
2
  import { Signer } from 'ethers';
3
- import { StorageObject, FileInfo, ComputeJob, ComputeOutput, ComputeAlgorithm, ComputeAsset, ComputeEnvironment, ProviderInitialize, ProviderComputeInitializeResults, UserCustomParameters, ComputeResourceRequest, ComputeJobMetadata, PolicyServerInitializeCommand, PolicyServerPassthroughCommand, dockerRegistryAuth, DownloadResponse, ComputeResultStream, NodeStatus, NodeComputeJob, PersistentStorageAccessList, PersistentStorageBucket, PersistentStorageCreateBucketRequest, PersistentStorageDeleteFileResponse, PersistentStorageFileEntry, PersistentStorageObject, PersistentStorageUpdateBucketResponse, ServiceJob, ServiceTemplatePublic, ServiceStartParams, ServiceUserData, ServicePayment, OceanNode, SignerOrAuthTokenOrSignature } from '../../@types/index.js';
3
+ import { StorageObject, FileInfo, ComputeJob, ComputeOutput, ComputeAlgorithm, ComputeAsset, ComputeEnvironment, ProviderInitialize, ProviderComputeInitializeResults, UserCustomParameters, ComputeResourceRequest, ComputeJobMetadata, PolicyServerInitializeCommand, PolicyServerPassthroughCommand, dockerRegistryAuth, DownloadResponse, ComputeResultStream, NodeStatus, NodeComputeJob, PersistentStorageAccessList, PersistentStorageBucket, PersistentStorageCreateBucketRequest, PersistentStorageDeleteFileResponse, PersistentStorageFileEntry, PersistentStorageObject, PersistentStorageUpdateBucketResponse, ServiceJob, ServiceJobListed, ServiceListFilters, ServiceTemplatePublic, ServiceStartParams, ServiceUserData, ServicePayment, OceanNode, SignerOrAuthTokenOrSignature } from '../../@types/index.js';
4
4
  import { NodeLogEntry } from '../../@types/Provider.js';
5
5
  import { type DDO, type ValidateMetadata } from '@oceanprotocol/ddo-js';
6
6
  import { CID } from 'multiformats/cid';
@@ -220,6 +220,13 @@ export declare class P2pProvider {
220
220
  serviceExtend(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, serviceId: string, additionalDuration: number, payment: ServicePayment, signal?: AbortSignal): Promise<ServiceJob[]>;
221
221
  serviceRestart(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, serviceId: string, userData?: ServiceUserData, dockerCmd?: string[], dockerEntrypoint?: string[], signal?: AbortSignal): Promise<ServiceJob[]>;
222
222
  getServiceStatus(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, serviceId?: string, signal?: AbortSignal): Promise<ServiceJob[]>;
223
+ /**
224
+ * Node-wide service listing (SERVICE_LIST) via P2P. Authenticated but NOT owner-scoped:
225
+ * any consumer identity sees every owner's services, listing-sanitized (no userData, no
226
+ * dockerCmd/dockerEntrypoint, no Dockerfile). Default (no filters) returns only the
227
+ * services currently holding a resource reservation; see ServiceListFilters.
228
+ */
229
+ getServices(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, filters?: ServiceListFilters, signal?: AbortSignal): Promise<ServiceJobListed[]>;
223
230
  /**
224
231
  * Stream a running service's container logs via P2P. `since` optionally bounds the lower time
225
232
  * (Unix seconds, or a relative duration like '30s'/'2h'); omit for the full history then live.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oceanprotocol/lib",
3
3
  "source": "./src/index.ts",
4
- "version": "9.0.0-next.3",
4
+ "version": "9.0.0-next.5",
5
5
  "description": "JavaScript client library for Ocean Protocol",
6
6
  "main": "./dist/lib.cjs",
7
7
  "umd:main": "dist/lib.umd.js",