1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00
market/content/publish/form.json
Moritz Kirstein fefb42aa07
Feat: Consumer Parameters (#1921)
* feat: add consumer parameters to publish

* fix: publish form validation

* feat: update consumer parameters form

* feat: add consumer parameter types

* feat: update consumer parameter validation

* feat: add consumer parameters structure

* feat: add InputOptions error handling

* feat: update consumer parameters validation

* feat: update transformPublishFromToDdo

* feat: add default options to parameter options

* fix: value handling for select and mutliselect

* feat: update "add new parameter" button label

* feat: remove unused publish form sections

* chore: remove console.log

* chore: remove comments

* feat: remove multiselect

* feat: add consumer parameters section label

* feat: update types

* feat: update edit form fields

* feat: parse consumer parameters in edit form

* feat: add consumer parameters field to edit

* feat: transform consumer parameters values before edit

* feat: update "required" type to select

* feat: update "required" type to select on edit form

* fix: error object access

* fix: edit flow crash

* fix: validation when consumer parameters are not selected

* feat: update validation for default consumer parameters value

* fix: types

* feat: add service consumer parameters to publish form

* chore: remove console.log

* feat: add service consumer parameters edit

* chore: remove comments

* fix: form edit metadata types

* feat: add consume algo parameter structure

* feat: consumer parameter required default value condition

* feat: add consumer parameter groups to assetActions

* fix: consumer parameters grouping

* feat: update consumer parameters alignment

* feat: update types

* feat: allow service consumer parameters on dataset asset type

* feat: add consumer parameters to ddo updated values in edit form

* feat: add "data service" consumer parameters to consumption form

* feat: allow service parameters on all asset types

* feat: update parameter consume form design

* feat: update asset actions consume parameters location

* feat: add service parameters to download assets

* refactor: consumer parameters actions

* refactor: form action name

* refactor: consumer parameters default input

* refactor: consumer parameters select input

* refactor: consumer parameter input

* fix: props name

* refactor: variable naming

* refactor: consumer parameters form validation

* refactor: rename consumer parameters types

* refactor: extract consumer parameters form data to separate file

* refactor: rename type

* feat: controlled tabs for consumer params

* feat: restore default value as required

* refactor: parse values before edit

* feat: add form to handle consumer parameters consumption

* feat: send consumer params with download request

* feat: send consumer params with compute request

* feat: handle compute form initialization

* chore: remove unused dependency

* feat: handle download form data initialization

* chore: remove console.log

* feat: update types

* fix: consumer parameter value types

* feat: update ConsumerParameter type

* feat: update ConsumerParameter type

* chore: add comments

* refactor: consumer parameters inputs

* refactor: rename data and algo service params

* refactor: consumer parameters form

* refactor: consumer parameter form styling

* refactor: make headers input reusable as KeyValueInput

* refactor: refactorings, reduce duplication (WIP)

* refactor: usercustomparameters consumption form creation/validation

* refactor: return undefined consistently if property path not found on object

* refactor: reuse fieldType and fieldOptions in DefaultInput

* fix: parse ddo consumer parameters for edit form

* fix: asset view crash for assets w/o consumer params

* fix: publish preview for assets with no consumer params

* fix: revert accidential rename of algoService

* fix: revert publish navigation padding change

* feat: update consumer parameters' labels and helpers

* fix: consumer parameters validation

* feat: update consumer parameter helper wording

* chore: merge conflicts

* feat: update types

* fix: validate form on consumer parameter deletion

* feat: add key value input placeholder props

* fix: handle boolean type consumer parameters in consume form (#38)

* Update src/components/Publish/_validation.ts

Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>

* Update src/components/Asset/AssetActions/ConsumerParameters/FormConsumerParameters.module.css

Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>

* Update src/components/Asset/Edit/_validation.ts

Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>

* Update src/components/Asset/AssetActions/ConsumerParameters/index.tsx

Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>

* Update src/components/Asset/AssetActions/ConsumerParameters/FormConsumerParameters.tsx

Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>

* Update src/components/@shared/FormInput/index.tsx

Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>

* Update src/components/@shared/FormInput/InputElement/ConsumerParameters/index.tsx

Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>

* Update src/components/@shared/FormInput/InputElement/ConsumerParameters/index.tsx

Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>

* Update src/components/@shared/FormInput/InputElement/ConsumerParameters/OptionsInput.tsx

Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>

* Update src/components/@shared/FormInput/InputElement/ConsumerParameters/FormActions.tsx

Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>

* Update src/@utils/provider.ts

Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>

* fix: import paths

* refactor: add consumer parameters validation types

* feat: add string length min/max to consumer parameters validation

* feat: add cp description to consume form

* feat: reduce character limit in CP tab title

* feat: update CP fields' placeholders and helpers

* fix: show only relevant CPs in asset actions

---------

Co-authored-by: Luca Milanese <luca.milanese90@gmail.com>
Co-authored-by: Jamie Hewitt <jamie.hewitt15@gmail.com>
2023-09-07 17:14:27 +03:00

292 lines
12 KiB
JSON

{
"metadata": {
"title": "Metadata",
"fields": [
{
"name": "nft",
"label": "Data NFT",
"type": "nft",
"help": "All metadata is stored on-chain in a newly deployed ERC-721 contract representing this asset, created with this name, symbol, description and image.",
"required": true
},
{
"name": "type",
"label": "Asset Type",
"type": "boxSelection",
"options": ["Dataset", "Algorithm"],
"required": true
},
{
"name": "name",
"label": "Title",
"placeholder": "e.g. Shapes of Desert Plants",
"required": true
},
{
"name": "description",
"label": "Description",
"help": "Add a thorough description with as much detail as possible. You can use [Markdown](https://daringfireball.net/projects/markdown/basics). You can change the description at any time. If you provide personal data, please note that it will remain in the transaction history. For more information on how personal data is handled within the metadata, please refer to our [privacy policy](/privacy/en).",
"type": "textarea",
"required": true
},
{
"name": "author",
"label": "Author",
"placeholder": "e.g. Jelly McJellyfish",
"help": "Give proper attribution for your dataset. You are welcome to use a pseudonym, and you can change your author name at any time. Please note that it will remain in the transaction history. For more information on how personal data is handled within the metadata, please refer to our [privacy policy](/privacy/en).",
"required": true
},
{
"name": "tags",
"label": "Tags",
"type": "tags",
"placeholder": "e.g. logistics"
},
{
"name": "dockerImage",
"label": "Docker Image",
"help": "Please select an image to run your algorithm.",
"type": "boxSelection",
"options": [
"populated from algorithmContainerPresets in Publish/_constants"
],
"required": true
},
{
"name": "dockerImageCustom",
"label": "Custom Docker Image",
"placeholder": "e.g. oceanprotocol/algo_dockers:node-vibrant or quay.io/startx/mariadb",
"help": "Provide the name and the tag of a public Docker hub image or the custom image if you have it hosted in a 3rd party repository",
"type": "container",
"required": true
},
{
"name": "dockerImageChecksum",
"label": "Docker Image Checksum",
"placeholder": "e.g. sha256:xiXqb7Vet0FbN9q0GFMgUdi5C22wjJT0i2G6lYKC2jl6QxkKzVz7KaPDgqfTMjNF",
"help": "Provide the checksum(DIGEST) of your docker image.",
"required": true
},
{
"name": "dockerImageCustomEntrypoint",
"label": "Docker Image Entrypoint",
"placeholder": "e.g. python $ALGO",
"help": "Provide the entrypoint for your algorithm.",
"required": true
},
{
"name": "usesConsumerParameters",
"label": "Algorithm custom parameters",
"help": "Algorithm custom parameters are used to define required consumer input before running the algorithm in a Compute-to-Data environment.",
"type": "checkbox",
"options": ["This asset uses algorithm custom parameters"],
"required": false
},
{
"name": "termsAndConditions",
"label": "Terms & Conditions",
"type": "checkbox",
"options": ["I agree to the Terms and Conditions"],
"required": true
}
]
},
"services": {
"title": "Access",
"fields": [
{
"name": "dataTokenOptions",
"label": "Datatoken",
"type": "datatoken",
"help": "The datatoken used for accessing this asset will be created with this name & symbol.",
"required": true
},
{
"name": "providerUrl",
"label": "Provider URL",
"type": "providerUrl",
"help": "Enter the URL for your custom [provider](https://github.com/oceanprotocol/provider/) or leave as is to use the default one. If you change your provider URL after adding your file, please add & validate your file again.",
"placeholder": "e.g. https://provider.oceanprotocol.com/",
"required": true
},
{
"name": "files",
"label": "File",
"prominentHelp": false,
"type": "tabs",
"fields": [
{
"value": "ipfs",
"title": "IPFS",
"label": "CID",
"placeholder": "e.g. bafkreidgvpkjawlxz6sffxzwgooowe5yt7i6wsyg236mfoks77nywkptdq",
"help": "This CID will be stored encrypted after publishing.",
"computeHelp": "For a compute dataset, your file should match the file type required by the algorithm, and should not exceed 1 GB in file size. ",
"prominentHelp": true,
"type": "files",
"required": true
},
{
"value": "arweave",
"title": "Arweave",
"label": "Transaction ID",
"placeholder": "e.g. DBRCL94j3QqdPaUtt4VWRen8rZfJZBb7Ey40iMpXfhtd",
"help": "This Transaction ID will be stored encrypted after publishing.",
"computeHelp": "For a compute dataset, your file should match the file type required by the algorithm, and should not exceed 1 GB in file size. ",
"prominentHelp": true,
"type": "files",
"required": true
},
{
"value": "url",
"title": "URL",
"label": "File",
"placeholder": "e.g. https://file.com/file.json",
"help": "This URL will be stored encrypted after publishing. **Please make sure that the endpoint is accessible over the internet and is not protected by a firewall or by credentials.**",
"computeHelp": "For a compute dataset, your file should match the file type required by the algorithm, and should not exceed 1 GB in file size. ",
"prominentHelp": true,
"type": "files",
"required": true,
"methods": true,
"innerFields": [
{
"value": "headers",
"title": "Headers",
"label": "Headers",
"placeholder_value": "Authorization",
"help": "This HEADERS will be stored encrypted after publishing.",
"type": "headers",
"required": false
}
]
},
{
"value": "graphql",
"title": "Graphql",
"label": "URL",
"placeholder": "e.g. http://172.15.0.15:8000/subgraphs/name/oceanprotocol/ocean-subgraph",
"help": "This URL will be stored encrypted after publishing.",
"computeHelp": "For a compute dataset, your file should match the file type required by the algorithm, and should not exceed 1 GB in file size. ",
"prominentHelp": true,
"type": "files",
"required": true,
"innerFields": [
{
"value": "headers",
"title": "Headers",
"label": "Headers",
"placeholder_value": "Authorization",
"help": "This HEADERS will be stored encrypted after publishing.",
"type": "headers",
"required": false
},
{
"value": "query",
"title": "Query",
"label": "Query",
"placeholder": "query{\n nfts(\n orderBy: createdTimestamp,\n orderDirection:desc\n ){\n id\n symbol\n createdTimestamp\n }\n}",
"help": "This QUERY will be stored encrypted after publishing.",
"type": "codeeditor",
"required": true
}
]
},
{
"value": "smartcontract",
"title": "Smartcontract",
"label": "Address",
"placeholder": "e.g. 0x8149276f275EEFAc110D74AFE8AFECEaeC7d1593",
"help": "This ADDRESS will be stored encrypted after publishing.",
"computeHelp": "For a compute dataset, your file should match the file type required by the algorithm, and should not exceed 1 GB in file size. ",
"prominentHelp": true,
"type": "files",
"required": true,
"innerFields": [
{
"value": "abi",
"title": "ABI",
"label": "ABI",
"placeholder": "{\n 'inputs': [],\n 'name': 'swapOceanFee',\n 'outputs': [{'internalType': 'uint256', 'name': '', 'type': 'uint256'}],\n 'stateMutability': 'view',\n 'type': 'function'\n}",
"help": "This ABI will be stored encrypted after publishing.",
"type": "codeeditor",
"required": true
}
]
}
],
"sortOptions": false,
"required": true
},
{
"name": "links",
"label": "Sample file",
"prominentHelp": false,
"type": "tabs",
"fields": [
{
"value": "url",
"title": "URL",
"label": "File",
"placeholder": "e.g. https://file.com/file.json",
"help": "This URL will be stored encrypted after publishing. **Please make sure that the endpoint is accessible over the internet and is not protected by a firewall or by credentials.**",
"computeHelp": "For a compute dataset, your file should match the file type required by the algorithm, and should not exceed 1 GB in file size. ",
"prominentHelp": true,
"type": "files",
"required": false
}
],
"required": false
},
{
"name": "algorithmPrivacy",
"label": "Algorithm Privacy",
"type": "checkbox",
"options": ["Keep my algorithm private for Compute-to-Data"],
"help": "By default, your algorithm can be downloaded for free or a fixed price, in addition to running in compute jobs. Enabling this option will prevent downloading, so your algorithm can only be run as part of a compute job on a dataset.",
"required": false
},
{
"name": "access",
"label": "Access Type",
"help": "Choose how you want your files to be accessible for the specified price.",
"type": "boxSelection",
"options": ["Access", "Compute"],
"required": true,
"disclaimer": "Please do not provide downloadable personal data without the consent of the data subjects.",
"disclaimerValues": ["Download"]
},
{
"name": "timeout",
"label": "Timeout",
"help": "Define how long buyers should be able to download the dataset again after the initial purchase.",
"type": "select",
"options": ["Forever", "1 day", "1 week", "1 month", "1 year"],
"sortOptions": false,
"required": true
},
{
"name": "usesConsumerParameters",
"label": "User defined parameters",
"help": "User defined parameters are used to filter or query the published asset.",
"type": "checkbox",
"options": ["This asset uses user defined parameters"],
"required": false
}
]
},
"pricing": {
"title": "Pricing",
"fields": [
{
"name": "dummy content, actual content is defined under 'create' key in ../price.json"
}
]
},
"preview": {
"title": "Preview"
},
"submission": {
"title": "Submit"
}
}