@oceanprotocol/lib 9.0.0-next.5 → 9.0.0-next.7
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/dist/lib.cjs +2 -2
- package/dist/lib.module.mjs +2 -2
- package/dist/lib.umd.js +2 -2
- package/dist/types/@types/Services.d.ts +8 -4
- package/dist/types/services/providers/BaseProvider.d.ts +3 -2
- package/dist/types/services/providers/HttpProvider.d.ts +13 -6
- package/dist/types/services/providers/P2pProvider.d.ts +2 -2
- package/package.json +1 -1
|
@@ -97,18 +97,22 @@ export interface ServicePayment {
|
|
|
97
97
|
token: string;
|
|
98
98
|
}
|
|
99
99
|
export type ServiceUserData = Record<string, unknown>;
|
|
100
|
-
export interface
|
|
101
|
-
|
|
102
|
-
image: string;
|
|
100
|
+
export interface ServiceContainerSpec {
|
|
101
|
+
image?: string;
|
|
103
102
|
tag?: string;
|
|
104
103
|
checksum?: string;
|
|
105
104
|
dockerfile?: string;
|
|
106
105
|
additionalDockerFiles?: Record<string, string>;
|
|
106
|
+
userData?: ServiceUserData;
|
|
107
107
|
dockerCmd?: string[];
|
|
108
108
|
dockerEntrypoint?: string[];
|
|
109
|
+
}
|
|
110
|
+
export type ServiceRestartParams = ServiceContainerSpec;
|
|
111
|
+
export interface ServiceStartParams extends ServiceContainerSpec {
|
|
112
|
+
environment: string;
|
|
113
|
+
image: string;
|
|
109
114
|
exposedPorts?: number[];
|
|
110
115
|
resources?: ComputeResourceRequest[];
|
|
111
116
|
duration: number;
|
|
112
|
-
userData?: ServiceUserData;
|
|
113
117
|
payment: ServicePayment;
|
|
114
118
|
}
|
|
@@ -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, ServiceJobListed, ServiceListFilters, ServiceTemplatePublic, ServiceStartParams,
|
|
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, ServiceRestartParams, ServiceTemplatePublic, ServiceStartParams, 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';
|
|
@@ -41,6 +41,7 @@ export declare class BaseProvider {
|
|
|
41
41
|
* @param {ServiceJob} service The service job just started.
|
|
42
42
|
*/
|
|
43
43
|
private notifyIncentiveBackendServiceStarted;
|
|
44
|
+
private notifyIncentiveBackendServiceRestarted;
|
|
44
45
|
computeStreamableLogs(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, jobId: string, signal?: AbortSignal): Promise<any>;
|
|
45
46
|
computeStop(jobId: string, nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, agreementId?: string, signal?: AbortSignal): Promise<ComputeJob | ComputeJob[]>;
|
|
46
47
|
computeStatus(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, jobId?: string, agreementId?: string, signal?: AbortSignal): Promise<ComputeJob | ComputeJob[]>;
|
|
@@ -82,7 +83,7 @@ export declare class BaseProvider {
|
|
|
82
83
|
serviceStart(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, params: ServiceStartParams, signal?: AbortSignal): Promise<ServiceJob[]>;
|
|
83
84
|
serviceStop(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, serviceId: string, signal?: AbortSignal): Promise<ServiceJob[]>;
|
|
84
85
|
serviceExtend(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, serviceId: string, additionalDuration: number, payment: ServicePayment, signal?: AbortSignal): Promise<ServiceJob[]>;
|
|
85
|
-
serviceRestart(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, serviceId: string,
|
|
86
|
+
serviceRestart(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, serviceId: string, params?: ServiceRestartParams, signal?: AbortSignal): Promise<ServiceJob[]>;
|
|
86
87
|
getServiceStatus(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, serviceId?: string, signal?: AbortSignal): Promise<ServiceJob[]>;
|
|
87
88
|
getServices(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, filters?: ServiceListFilters, signal?: AbortSignal): Promise<ServiceJobListed[]>;
|
|
88
89
|
serviceGetStreamableLogs(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, serviceId: string, since?: string, signal?: AbortSignal): 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, ServiceJobListed, ServiceListFilters, ServiceTemplatePublic, ServiceStartParams,
|
|
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, ServiceRestartParams, ServiceTemplatePublic, ServiceStartParams, 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 {
|
|
@@ -291,13 +291,20 @@ export declare class HttpProvider {
|
|
|
291
291
|
*/
|
|
292
292
|
serviceExtend(nodeUri: string, signerOrAuthToken: SignerOrAuthTokenOrSignature, serviceId: string, additionalDuration: number, payment: ServicePayment, signal?: AbortSignal): Promise<ServiceJob[]>;
|
|
293
293
|
/**
|
|
294
|
-
* Restarts a running service (recreates the container)
|
|
295
|
-
*
|
|
296
|
-
*
|
|
297
|
-
*
|
|
294
|
+
* Restarts a running service (recreates the container) while keeping the same serviceId,
|
|
295
|
+
* payment, resources, host port(s) and expiry.
|
|
296
|
+
*
|
|
297
|
+
* The node treats the restart atomically. Passing no container-spec fields in `params`
|
|
298
|
+
* (REUSE mode) bounces the container on its stored spec unchanged. Passing ANY of
|
|
299
|
+
* `image`/`tag`/`checksum`/`dockerfile`/`additionalDockerFiles` (RESPEC mode) rebuilds the
|
|
300
|
+
* container entirely from `params`: `image` becomes mandatory, exactly one of
|
|
301
|
+
* `tag`/`checksum`/`dockerfile` applies, and a `dockerfile` requires `allowImageBuild` on
|
|
302
|
+
* the env (else the node replies 403). `userData`/`dockerCmd`/`dockerEntrypoint` are only
|
|
303
|
+
* sent when supplied — an omitted override reuses the node's stored value, whereas an
|
|
304
|
+
* explicit value (including `[]`) REPLACES it (matches ocean-node's restartService semantics).
|
|
298
305
|
* @return {Promise<ServiceJob[]>} The restarted service job (single-element array).
|
|
299
306
|
*/
|
|
300
|
-
serviceRestart(nodeUri: string, signerOrAuthToken: SignerOrAuthTokenOrSignature, serviceId: string,
|
|
307
|
+
serviceRestart(nodeUri: string, signerOrAuthToken: SignerOrAuthTokenOrSignature, serviceId: string, params?: ServiceRestartParams, signal?: AbortSignal): Promise<ServiceJob[]>;
|
|
301
308
|
/**
|
|
302
309
|
* Returns the caller's service jobs (userData stripped). Filter by `serviceId`,
|
|
303
310
|
* or omit it to list all of the caller's services. Requires a signature.
|
|
@@ -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, ServiceJobListed, ServiceListFilters, ServiceTemplatePublic, ServiceStartParams,
|
|
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, ServiceRestartParams, ServiceTemplatePublic, ServiceStartParams, 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';
|
|
@@ -218,7 +218,7 @@ export declare class P2pProvider {
|
|
|
218
218
|
serviceStart(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, params: ServiceStartParams, signal?: AbortSignal): Promise<ServiceJob[]>;
|
|
219
219
|
serviceStop(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, serviceId: string, signal?: AbortSignal): Promise<ServiceJob[]>;
|
|
220
220
|
serviceExtend(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, serviceId: string, additionalDuration: number, payment: ServicePayment, signal?: AbortSignal): Promise<ServiceJob[]>;
|
|
221
|
-
serviceRestart(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, serviceId: string,
|
|
221
|
+
serviceRestart(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, serviceId: string, params?: ServiceRestartParams, signal?: AbortSignal): Promise<ServiceJob[]>;
|
|
222
222
|
getServiceStatus(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, serviceId?: string, signal?: AbortSignal): Promise<ServiceJob[]>;
|
|
223
223
|
/**
|
|
224
224
|
* Node-wide service listing (SERVICE_LIST) via P2P. Authenticated but NOT owner-scoped:
|
package/package.json
CHANGED