mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
Add consumer parameter types (#1730)
* feat: add ConsumerParameter type * feat: add export for ConsumerParameter type * fix: ConsumerParameter.required type --------- Co-authored-by: Luca Milanese <luca.milanese90@gmail.com>
This commit is contained in:
parent
59568d292e
commit
e3dfa2997a
43
src/@types/DDO/ConsumerParameter.ts
Normal file
43
src/@types/DDO/ConsumerParameter.ts
Normal file
@ -0,0 +1,43 @@
|
||||
export interface ConsumerParameter {
|
||||
/**
|
||||
* Parameter name.
|
||||
* @type {string}
|
||||
*/
|
||||
name: string
|
||||
|
||||
/**
|
||||
* Field type.
|
||||
* @type {'text' | 'number' | 'boolean' | 'select'}
|
||||
*/
|
||||
type: 'text' | 'number' | 'boolean' | 'select'
|
||||
|
||||
/**
|
||||
* Displayed field label.
|
||||
* @type {string}
|
||||
*/
|
||||
label: string
|
||||
|
||||
/**
|
||||
* Defines if customer input for this field is mandatory.
|
||||
* @type {boolean}
|
||||
*/
|
||||
required: boolean
|
||||
|
||||
/**
|
||||
* Field description.
|
||||
* @type {string}
|
||||
*/
|
||||
description: string
|
||||
|
||||
/**
|
||||
* Field default value. For select types, string key of default option.
|
||||
* @type {string}
|
||||
*/
|
||||
default: string
|
||||
|
||||
/**
|
||||
* For select types, a list of options.
|
||||
* @type {string}
|
||||
*/
|
||||
options?: string
|
||||
}
|
@ -1,3 +1,5 @@
|
||||
import { ConsumerParameter } from './ConsumerParameter'
|
||||
|
||||
export interface MetadataAlgorithm {
|
||||
/**
|
||||
* Language used to implement the software.
|
||||
@ -46,6 +48,12 @@ export interface MetadataAlgorithm {
|
||||
*/
|
||||
checksum: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Array of objects describing the consumer parameters
|
||||
* @type {ConsumerParameter[]}
|
||||
*/
|
||||
consumerParameters?: ConsumerParameter[]
|
||||
}
|
||||
|
||||
export interface Metadata {
|
||||
|
@ -1,3 +1,5 @@
|
||||
import { ConsumerParameter } from './ConsumerParameter'
|
||||
|
||||
export interface PublisherTrustedAlgorithm {
|
||||
/**
|
||||
* The DID of the algorithm which is trusted by the publisher.
|
||||
@ -102,6 +104,12 @@ export interface Service {
|
||||
*/
|
||||
compute?: ServiceComputeOptions
|
||||
|
||||
/**
|
||||
* Array of objects describing the consumer parameters
|
||||
* @type {ConsumerParameter[]}
|
||||
*/
|
||||
consumerParameters?: ConsumerParameter[]
|
||||
|
||||
/**
|
||||
* Stores service specific additional information, this is customizable by publisher
|
||||
* @type {any}
|
||||
|
@ -2,6 +2,7 @@ export * from './DDO/Credentials'
|
||||
export * from './DDO/DDO'
|
||||
export * from './DDO/Event'
|
||||
export * from './DDO/Metadata'
|
||||
export * from './DDO/ConsumerParameter'
|
||||
export * from './DDO/Service'
|
||||
export * from './Asset'
|
||||
export * from './File'
|
||||
|
Loading…
x
Reference in New Issue
Block a user