feat: Add Be and tbd skill, also added Roadmap file

This commit is contained in:
2026-05-10 16:32:12 -04:00
parent 3500ade13f
commit 0bb8885802
29587 changed files with 10611695 additions and 0 deletions

View File

@@ -0,0 +1,90 @@
/**
* @fileOverview
*
* Created on 4/18/16.
* @author Siggi Orn <siggi@jibo.com>
*/
"use strict";
var SuperSimpleStorage = require('supersimplestorage');
var DEFAULT_OPTIONS = {
storageFolder: 'tmp_storage_folder',
dotsToFolders: true,
fileExtension: 'txt'
};
var Node = (function () {
function Node(key, data, _storage) {
this.key = key;
this.data = data;
this._storage = _storage;
}
Node.prototype.save = function () {
var _this = this;
return new Promise(function (res, rej) {
_this._storage.save(_this.key, _this.data, function (content) { return res(); }, function (error) { return rej(error); });
});
};
return Node;
}());
exports.Node = Node;
var _Persistence = (function () {
function _Persistence(options) {
this._map = new Map();
var selectedOptions = options || DEFAULT_OPTIONS;
this._storage = new SuperSimpleStorage(selectedOptions);
}
_Persistence.prototype.get = function (key) {
var _this = this;
var node = this._map.get(key);
if (node) {
return Promise.resolve(node);
}
else {
return new Promise(function (res, rej) {
_this._storage.open(key, function (content) {
res(_this._createNode(key, content));
}, function (error) {
if (error.toString() === 'Storage item not found.') {
res(_this._createNode(key, {}));
}
else {
rej(error);
}
});
});
}
};
_Persistence.prototype._createNode = function (key, data) {
var node = new Node(key, data, this._storage);
this._map.set(key, node);
return node;
};
return _Persistence;
}());
exports._Persistence = _Persistence;
var persistence;
var Persistence = (function () {
function Persistence() {
throw new Error("This class shouldn't be instantiated, use 'getInstance'");
}
Persistence.getInstance = function (options) {
if (!persistence) {
persistence = new _Persistence(options);
}
return persistence;
};
/**
* Should only be called for testing purposes
* @param options
* @returns {_Persistence}
* @private
*/
Persistence._resetInstance = function (options) {
persistence = new _Persistence(options);
return persistence;
};
return Persistence;
}());
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = Persistence;
//# sourceMappingURL=../map/main/Persistence.js.map

View File

@@ -0,0 +1,12 @@
/**
* @fileOverview
*
* Created on 4/11/16.
* @author Siggi Orn <siggi@jibo.com>
*/
"use strict";
var jibo_cai_singleton_1 = require('jibo-cai-singleton');
var P = require('./Persistence');
module.exports = jibo_cai_singleton_1.default.getOrCreateSingleton(module, function () { return P; });
//# sourceMappingURL=../map/main/index.js.map