textiot
Version:
A framework for building web and native (IoT) Dapps on the IPFS network
90 lines (89 loc) • 4.13 kB
JavaScript
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Textile = void 0;
const account_1 = __importDefault(require("./modules/account"));
const blocks_1 = __importDefault(require("./modules/blocks"));
const cafes_1 = __importDefault(require("./modules/cafes"));
const config_1 = __importDefault(require("./modules/config"));
const comments_1 = __importDefault(require("./modules/comments"));
const contacts_1 = __importDefault(require("./modules/contacts"));
const events_1 = __importDefault(require("./modules/events"));
const feed_1 = __importDefault(require("./modules/feed"));
const file_1 = __importDefault(require("./modules/file"));
const files_1 = __importDefault(require("./modules/files"));
const invites_1 = __importDefault(require("./modules/invites"));
const ipfs_1 = __importDefault(require("./modules/ipfs"));
const likes_1 = __importDefault(require("./modules/likes"));
const logs_1 = __importDefault(require("./modules/logs"));
const messages_1 = __importDefault(require("./modules/messages"));
const notifications_1 = __importDefault(require("./modules/notifications"));
const profile_1 = __importDefault(require("./modules/profile"));
const schemas_1 = __importDefault(require("./modules/schemas"));
const observe_1 = __importDefault(require("./modules/observe"));
const threads_1 = __importDefault(require("./modules/threads"));
const tokens_1 = __importDefault(require("./modules/tokens"));
const utils_1 = __importDefault(require("./modules/utils"));
const api_1 = require("./core/api");
__exportStar(require("./models"), exports);
/**
* Textile is the main client class
*/
class Textile {
constructor(options) {
const _options = api_1.DEFAULT_API_OPTIONS;
if (options && options.port !== undefined) {
_options.port = options.port;
}
if (options && options.url !== undefined) {
_options.url = options.url;
}
if (options && options.version !== undefined) {
_options.version = options.version;
}
this.account = new account_1.default(_options);
this.blocks = new blocks_1.default(_options);
this.cafes = new cafes_1.default(_options);
this.config = new config_1.default(_options);
this.comments = new comments_1.default(_options);
this.contacts = new contacts_1.default(_options);
this.events = new events_1.default(_options);
this.feed = new feed_1.default(_options);
this.file = new file_1.default(_options);
this.files = new files_1.default(_options);
this.invites = new invites_1.default(_options);
this.ipfs = new ipfs_1.default(_options);
this.likes = new likes_1.default(_options);
this.logs = new logs_1.default(_options);
this.messages = new messages_1.default(_options);
this.notifications = new notifications_1.default(_options);
this.profile = new profile_1.default(_options);
this.schemas = new schemas_1.default(_options);
this.observe = new observe_1.default(_options);
this.threads = new threads_1.default(_options);
this.tokens = new tokens_1.default(_options);
this.utils = new utils_1.default(_options);
}
/**
* Returns a new instance of Textile
*
* @param [options] Textile TextileOptions object
*/
static create(options) {
return new this(options);
}
}
exports.Textile = Textile;
exports.default = new Textile();