@isaac-platform/isaac-integration-sdk
Version:
A Typescript SDK for integrating with ISAAC
37 lines (36 loc) • 1.73 kB
JavaScript
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
export class objectController {
constructor(isaacConn) {
this.isaacConn = isaacConn;
}
getObjects(bucket) {
return __awaiter(this, void 0, void 0, function* () {
return Promise.reject();
});
}
getObject(name, bucket) {
return __awaiter(this, void 0, void 0, function* () {
if (typeof bucket === "undefined")
bucket = "cms-media";
return this.isaacConn.getRequest(`objects/${bucket}/${name}`);
});
}
createObject() {
return __awaiter(this, void 0, void 0, function* () {
/* TODO: This is complicated behavior which will require the upload of a file.
Current plan is to split this behavior into three functions: createObject, requestObject, and uploadObject.
This will allow for more manual control of the upload if necessary by the end user but createObject will handle
the typical upload process.
*/
return Promise.reject();
});
}
}