Elv Utils
MakeCsv
MakeCsv(
fields,
full
)
fields,
full
)
Create a CSV row with the specified fields with values from the metadata
Returns: string A CSV row
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
fields | array | ✓ | Array of fields in dot notation eg. ["public.name","public.nfts[0]"] |
full | object | ✓ | object metadata JOSN |
ReadCsvObjects
ReadCsvObjects(csvFile)
Read a CSV file and parse into a JSON object
Applies string substitutions on input:
- ${UUID}
CSV file format: id,field1,field2 iq_1111,value1,value2 iq_2222,value1,value2
Output format: { "iq_1111" : { "field1": "value1", "field2": "value2" }, "iq_2222" : { "field1": "value1", "field2": "value2" } }
Returns: object Map of object IDs to metadata
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
csvFile | string | ✓ | path to CSV file |
UpdateFabricUrl
UpdateFabricUrl(
url,
newHash
)
url,
newHash
)
Parse a fabric URL of format 'http(s)://host/.../q/hq__.../...' and replace the object hash with the newly provided one.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
url | string | ✓ | |
newHash | string | ✓ | Format 'hq__...' |