storage API

CreateComponent

Create a global or local component

await storageInterface.createComponent({local: true,  component: {    name,    description: "",    version: "",    author: "",    website: "",    repository: "",    html: "",    bundle: {"stylesheet": {}, "script": {}},    sources: {"stylesheets": [], "scripts": []},    dependencies: [],    miscellaneous: [],    selector: "",    interface: "",    path  }});

Parameters

settings
JSON object
local
string- If the component is local or global
component
JSON object- The component object to add
files
JSON object
path
string- the path where the resource will be stored, must start with component name
blob
blob- The blob of the file resource

Return Value

A Promise that is resolved if the process went well

Details

An example of creating a global component with files:

var files = [{path: "a-component/mock/", blob: new Blob(["I'm mock/"])}, {  path: "a-component/components.json",  blob: new Blob([JSON.stringify({a: "json"})])}];await storageInterface.createComponent({  component: {    name: "a-component",    path: "components/a-component"}  },files);