diff --git a/js/folders.js b/js/folders.js index d1ea8ec..e16547e 100644 --- a/js/folders.js +++ b/js/folders.js @@ -6,11 +6,11 @@ export default class Folder { this.name = name; } - static async create(conn, name, region, version, template) { + static async create(conn, name, region, threads, template) { return await conn.httpPost(`/api/folders`, { name: name, region: region, - version: version, + threads: threads, template: template }) } @@ -25,11 +25,11 @@ export default class Folder { ) } - async update(name="", region="", version=false, template="") { + async update(name="", region="", threads=false, template="") { return await conn.httpPut(`/api/folders/${this.name}`, { name: name, region: region, - version: version, + threads: threads, template: template }) } @@ -40,8 +40,8 @@ export default class Folder { ) } - async createObject(path, data, object_type, version=false, template="") { - return await Document.create(this.conn, this.name, path, data, object_type, version, template); + async createObject(path, data, object_type, threads=false, template="") { + return await Document.create(this.conn, this.name, path, data, object_type, threads, template); } async listObjects() { diff --git a/js/kadalu_content_apis.js b/js/kadalu_content_apis.js index 304f5ac..5d95f20 100644 --- a/js/kadalu_content_apis.js +++ b/js/kadalu_content_apis.js @@ -234,8 +234,8 @@ export default class ContentAPI { return await Region.create(this, name, address); } - async createFolder(name, region, version, template) { - return await Folder.create(this, name, region, version, template); + async createFolder(name, region, threads, template) { + return await Folder.create(this, name, region, threads, template); } async listFolders() { @@ -246,12 +246,12 @@ export default class ContentAPI { return new Folder(this, name); } - async createObject(path, data, object_type, version = false, template = "") { - return await Document.create(this, "/", path, data, object_type, version, template); + async createObject(path, data, object_type, threads = false, template = "") { + return await Document.create(this, "/", path, data, object_type, threads, template); } - async uploadObject(filePath, object_type, path = "", version = false, template = "") { - return await Document.upload(this, "/", filePath, object_type, path, version, template); + async uploadObject(filePath, object_type, path = "", threads = false, template = "") { + return await Document.upload(this, "/", filePath, object_type, path, threads, template); } async listObjects() { diff --git a/js/objects.js b/js/objects.js index d298351..ba6e39e 100644 --- a/js/objects.js +++ b/js/objects.js @@ -13,7 +13,7 @@ export default class Document { this.path = path; } - static async create(conn, folder_name, path, data, object_type, version, template) { + static async create(conn, folder_name, path, data, object_type, threads, template) { folder_name = folder_name.replace(/^\//, ""); let url; if (folder_name === "") { @@ -27,7 +27,7 @@ export default class Document { path: path, type: object_type, data: data, - version: version, + threads: threads, template: template }) } diff --git a/python/kadalu_content_apis/__init__.py b/python/kadalu_content_apis/__init__.py index 721cac0..437f409 100644 --- a/python/kadalu_content_apis/__init__.py +++ b/python/kadalu_content_apis/__init__.py @@ -58,9 +58,9 @@ def create_region(self, name, address): return Region.create(self, name, address) - def create_folder(self, name, region="", version=False, template=None): + def create_folder(self, name, region="", threads=False, template=None): """ Create a new Folder """ - return Folder.create(self, name, region, version, template) + return Folder.create(self, name, region, threads, template) def list_folders(self, page=1, page_size=30): @@ -72,14 +72,14 @@ def folder(self, name): return Folder(self, name) - def create_object(self, path, data, object_type, version=False, template=None): + def create_object(self, path, data, object_type, threads=False, template=None): """ Create default("/") object """ - return Document.create(self, "/", path, data, object_type, version, template) + return Document.create(self, "/", path, data, object_type, threads, template) # TODO: Add path to `upload_object` - def upload_object(self, file_path, object_type, path="", version=False, template=None): + def upload_object(self, file_path, object_type, path="", threads=False, template=None): """ Create default("/") object """ - return Document.upload_create(self, "/", file_path, object_type, path, version, template) + return Document.upload_create(self, "/", file_path, object_type, path, threads, template) def list_objects(self, page=1, page_size=30): diff --git a/python/kadalu_content_apis/folders.py b/python/kadalu_content_apis/folders.py index 3d488e8..11edd08 100644 --- a/python/kadalu_content_apis/folders.py +++ b/python/kadalu_content_apis/folders.py @@ -15,7 +15,7 @@ def __init__(self, conn=None, name=None, data={}): # TODO: Handle Invalid Region Name, when only name is passed. @classmethod - def create(cls, conn, name, region, version, template): + def create(cls, conn, name, region, threads, template): """ Create folder """ resp = conn.http_post( @@ -23,7 +23,7 @@ def create(cls, conn, name, region, version, template): { "name" : name, "region": region, - "version": version, + "threads": threads, "template": template } ) @@ -58,7 +58,7 @@ def get(self): outdata.conn = self.conn return outdata - def update(self, name=None, region=None, version=None, template=None): + def update(self, name=None, region=None, threads=None, template=None): """ Update folders """ resp = self.conn.http_put( @@ -66,7 +66,7 @@ def update(self, name=None, region=None, version=None, template=None): { "name": name, "region": region, - "version": version, + "threads": threads, "template": template } ) @@ -85,14 +85,14 @@ def delete(self, recursive=False): return response_object_or_error(Folder, resp, 204) - def create_object(self, path, data, object_type, version=False, template=None): + def create_object(self, path, data, object_type, threads=False, template=None): """ Create object with folder-name """ - return Document.create(self.conn, self.name, path, data, object_type, version, template) + return Document.create(self.conn, self.name, path, data, object_type, threads, template) - def upload_object(self, file_path, object_type, path="", version=False, template=None): + def upload_object(self, file_path, object_type, path="", threads=False, template=None): """ Create default("/") object """ - return Document.upload_create(self.conn, self.name, file_path, object_type, path, version, template) + return Document.upload_create(self.conn, self.name, file_path, object_type, path, threads, template) def list_objects(self, page=1, page_size=30): diff --git a/python/kadalu_content_apis/objects.py b/python/kadalu_content_apis/objects.py index 79bd019..6acbf47 100644 --- a/python/kadalu_content_apis/objects.py +++ b/python/kadalu_content_apis/objects.py @@ -20,7 +20,7 @@ def __init__(self, conn=None, folder_name=None, path=None, data={}): @classmethod - def create(cls, conn, folder_name, path, data, object_type, version, template): + def create(cls, conn, folder_name, path, data, object_type, threads, template): """ Create object of both default("/") and with folder-name """ folder_name = folder_name.lstrip("/") @@ -34,7 +34,7 @@ def create(cls, conn, folder_name, path, data, object_type, version, template): "path": path, "type": object_type, "data": data, - "version": version, + "threads": threads, "template": template } ) @@ -44,7 +44,7 @@ def create(cls, conn, folder_name, path, data, object_type, version, template): return outdata @classmethod - def upload_create(cls, conn, folder_name, file_path, object_type, path, version, template): + def upload_create(cls, conn, folder_name, file_path, object_type, path, threads, template): """ Upload object data at file_path """ file_content = "" @@ -65,7 +65,7 @@ def upload_create(cls, conn, folder_name, file_path, object_type, path, version, data = { "path": path, "type": object_type, - "version": json.dumps(version), + "threads": json.dumps(threads), "template": template }