@aecworks/bimbox-bimserver-sdk-js
Version:
AECWorks BIMBox 产品线 BIMServer 的 sdk 的 JavaScript 实现,采用Typescript语言
89 lines • 5.33 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
}
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
import ServiceBase from '../base';
import { FilePageProxy } from '../proxies/file-page-proxy';
import { FilePathProxy } from '../proxies/file-path-proxy';
import { FileProxy } from '../proxies/file-proxy';
import { FolderProxy } from '../proxies/folder-proxy';
import * as proxy from '../proxy';
var GET_FILES = '/accounts';
var PROJECTS = '/projects';
var FilesService = /** @class */ (function (_super) {
__extends(FilesService, _super);
function FilesService() {
var _this = _super !== null && _super.apply(this, arguments) || this;
_this.getFolderPath = function (options) {
var promise = _super.prototype.get.call(_this, "/accounts/" + options.accountId + "/path", options.data);
return proxy.httpResultProxy(promise, FilePathProxy);
};
_this.getFiles = function (options) {
var promise = _super.prototype.get.call(_this, GET_FILES + ("/" + options.accountId + "/projects/" + options.projectId + "/folders/" + options.folderId));
return proxy.httpResultProxy(promise, FilePageProxy);
};
_this.postFolder = function (options) {
var promise = _super.prototype.post.call(_this, GET_FILES + ("/" + options.accountId + "/projects/" + options.projectId + "/parent/" + options.folderId + "/folder"), options.body);
return proxy.httpResultProxy(promise, FolderProxy);
};
_this.putFolder = function (options) {
var promise = _super.prototype.put.call(_this, GET_FILES + ("/" + options.accountId + "/projects/" + options.projectId + "/folders/" + options.folderId), options.body);
return proxy.httpResultProxy(promise, FolderProxy);
};
_this.putFile = function (options) {
var promise = _super.prototype.put.call(_this, GET_FILES + ("/" + options.accountId + "/projects/" + options.projectId + "/files/" + options.fileId), options.body);
return proxy.httpResultProxy(promise, FileProxy);
};
_this.deleteFolder = function (options) {
var promise = _super.prototype.delete.call(_this, GET_FILES + ("/" + options.accountId + "/projects/" + options.projectId + "/folders/" + options.folderId));
return proxy.httpResultProxy(promise);
};
_this.deleteFile = function (options) {
var promise = _super.prototype.delete.call(_this, GET_FILES + ("/" + options.accountId + "/projects/" + options.projectId + "/files/" + options.id), options);
return proxy.httpResultProxy(promise);
};
_this.getFileInfo = function (options) {
var promise = _super.prototype.get.call(_this, GET_FILES + ("/" + options.accountId + "/projects/" + options.projectId + "/files/" + options.fileId + "/info"));
return proxy.httpResultProxy(promise, FileProxy);
};
_this.postCopyFile = function (options) {
var promise = _super.prototype.post.call(_this, GET_FILES + ("/" + options.accountId + "/projects/" + options.projectId + "/parent/" + options.id + "/file"), options.body);
return proxy.httpResultProxy(promise, FileProxy);
};
// POST /accounts/{accountId}/projects/{projectId}/download/signedUrl
_this.getSigned = function (options) {
var promise = _super.prototype.post.call(_this, "/accounts/" + options.accountId + "/projects/" + options.projectId + "/download/signedUrl", options.body);
return proxy.httpResultProxy(promise);
};
// POST /projects/{projectId}/file/download/signedUrl 获取带有签证信息的下载文件的URL
_this.getFileSignedUrl = function (options) {
var promise = _super.prototype.post.call(_this, PROJECTS + "/" + options.projectId + "/file/download/signedUrl", options.data);
return proxy.httpResultProxy(promise);
};
_this.getFolderSignedUrl = function (options) {
var promise = _super.prototype.post.call(_this, PROJECTS + "/" + options.projectId + "/download/signedUrl", options.data);
return proxy.httpResultProxy(promise);
};
_this.detectFileExists = function (data) {
var promise = _super.prototype.post.call(_this, "/file/detectFileExists", data.data);
return proxy.httpResultProxy(promise);
};
_this.getFileTypes = function () {
var promise = _super.prototype.get.call(_this, "/filetypes");
return proxy.httpResultProxy(promise);
};
return _this;
}
return FilesService;
}(ServiceBase));
export { FilesService };
//# sourceMappingURL=files.js.map