taon-storage 18.0.29 → 18.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/shared/shared_folder_info.txt +1 -1
- package/index.js +15 -2
- package/index.js.map +1 -1
- package/lib/build-info._auto-generated_.js.map +1 -1
- package/lib/constants.js +3 -3
- package/lib/constants.js.map +1 -1
- package/lib/file-stor.js +52 -82
- package/lib/file-stor.js.map +1 -1
- package/lib/helpers.js +4 -4
- package/lib/helpers.js.map +1 -1
- package/lib/index._auto-generated_.d.ts +1 -0
- package/lib/index._auto-generated_.js.map +1 -1
- package/lib/index.js +15 -2
- package/lib/index.js.map +1 -1
- package/lib/models.js.map +1 -1
- package/lib/storage.js +176 -231
- package/lib/storage.js.map +1 -1
- package/migrations/index.js +15 -2
- package/migrations/index.js.map +1 -1
- package/migrations/migrations_index._auto-generated_.d.ts +1 -0
- package/migrations/migrations_index._auto-generated_.js.map +1 -1
- package/package.json +7 -38
- package/src.d.ts +1 -1
- package/tmp-environment.json +8 -365
- package/browser/package.json +0 -25
- package/taon.jsonc +0 -30
- package/websql/package.json +0 -25
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
THIS FILE IS GENERATED. THIS FILE IS GENERATED. THIS FILE IS GENERATED.
|
|
2
2
|
|
|
3
|
-
Assets from this folder are being shipped with this npm package (taon-storage@18.0.
|
|
3
|
+
Assets from this folder are being shipped with this npm package (taon-storage@18.0.30)
|
|
4
4
|
created from this project.
|
|
5
5
|
|
|
6
6
|
THIS FILE IS GENERATED.THIS FILE IS GENERATED. THIS FILE IS GENERATED.
|
package/index.js
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
tslib_1.__exportStar(require("./lib"), exports);
|
|
17
|
+
__exportStar(require("./lib"), exports);
|
|
5
18
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":[""],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["/Users/dfilipiak/projects/npm/taon-dev/taon-storage/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-info._auto-generated_.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AACa,QAAA,wBAAwB,GAAG,KAAK,CAAC"}
|
|
1
|
+
{"version":3,"file":"build-info._auto-generated_.js","sourceRoot":"","sources":["/Users/dfilipiak/projects/npm/taon-dev/taon-storage/src/lib/build-info._auto-generated_.ts"],"names":[],"mappings":";;;AACa,QAAA,wBAAwB,GAAG,KAAK,CAAC"}
|
package/lib/constants.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.storeName = void 0;
|
|
4
4
|
//#region imports
|
|
5
|
-
|
|
5
|
+
const tnp_core_1 = require("tnp-core");
|
|
6
6
|
/* */
|
|
7
7
|
/* */
|
|
8
8
|
//#endregion
|
|
@@ -12,7 +12,7 @@ exports.storeName = 'taon-storage_';
|
|
|
12
12
|
/* */
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region constants / environment
|
|
15
|
-
|
|
15
|
+
let environment = {};
|
|
16
16
|
//#region @backend
|
|
17
17
|
// @ts-ignore
|
|
18
18
|
environment = global['ENV'];
|
|
@@ -22,7 +22,7 @@ environment = global['ENV'];
|
|
|
22
22
|
/* */
|
|
23
23
|
//#endregion
|
|
24
24
|
//#region constant / stor local storage
|
|
25
|
-
|
|
25
|
+
const websql = tnp_core_1.Helpers.isWebSQL ? 'websql' : '';
|
|
26
26
|
/* */
|
|
27
27
|
/* */
|
|
28
28
|
/* */
|
package/lib/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AAAA,iBAAiB;AACjB,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["/Users/dfilipiak/projects/npm/taon-dev/taon-storage/src/lib/constants.ts"],"names":[],"mappings":";;;AAAA,iBAAiB;AACjB,uCAAsC;AACtC,KAAK;AACL,KAAK;AAEL,YAAY;AAEZ,gCAAgC;AACnB,QAAA,SAAS,GAAG,eAAe,CAAA;AACxC,KAAK;AACL,KAAK;AAEL,YAAY;AAEZ,iCAAiC;AACjC,IAAI,WAAW,GAAG,EAAS,CAAC;AAC5B,kBAAkB;AAClB,aAAa;AACb,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AAC5B,YAAY;AACZ,KAAK;AACL,KAAK;AACL,KAAK;AAEL,YAAY;AAEZ,uCAAuC;AACvC,MAAM,MAAM,GAAG,kBAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;AAChD,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AAEL,YAAY;AAEZ,2CAA2C;AAC3C,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AACL,KAAK;AAEL,YAAY"}
|
package/lib/file-stor.js
CHANGED
|
@@ -1,94 +1,64 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FileStor = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
const tnp_core_1 = require("tnp-core");
|
|
5
|
+
class FileStor {
|
|
6
|
+
filePath;
|
|
7
|
+
useJSON;
|
|
8
|
+
constructor(filePath, useJSON = false) {
|
|
9
9
|
this.filePath = filePath;
|
|
10
10
|
this.useJSON = useJSON;
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
else {
|
|
26
|
-
tnp_core_1.Helpers.writeFile(_this.filePath, value);
|
|
27
|
-
callback(void 0, value);
|
|
28
|
-
resolve();
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
// pendingOperatins.push(promise);
|
|
32
|
-
return [4 /*yield*/, promise];
|
|
33
|
-
case 1:
|
|
34
|
-
// pendingOperatins.push(promise);
|
|
35
|
-
_a.sent();
|
|
36
|
-
return [2 /*return*/, void 0];
|
|
37
|
-
}
|
|
38
|
-
});
|
|
12
|
+
async setItem(key, value, callback) {
|
|
13
|
+
//#region @backendFunc
|
|
14
|
+
const promise = new Promise((resolve, reject) => {
|
|
15
|
+
if (this.useJSON) {
|
|
16
|
+
tnp_core_1.Helpers.writeJson(this.filePath, value);
|
|
17
|
+
callback(void 0, value);
|
|
18
|
+
resolve();
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
tnp_core_1.Helpers.writeFile(this.filePath, value);
|
|
22
|
+
callback(void 0, value);
|
|
23
|
+
resolve();
|
|
24
|
+
}
|
|
39
25
|
});
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
return
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
return [4 /*yield*/, promise];
|
|
61
|
-
case 1:
|
|
62
|
-
// pendingOperatins.push(promise);
|
|
63
|
-
return [2 /*return*/, _a.sent()];
|
|
64
|
-
}
|
|
65
|
-
});
|
|
26
|
+
// pendingOperatins.push(promise);
|
|
27
|
+
await promise;
|
|
28
|
+
return void 0;
|
|
29
|
+
//#endregion
|
|
30
|
+
}
|
|
31
|
+
async getItem(key, callback) {
|
|
32
|
+
//#region @backendFunc
|
|
33
|
+
const promise = new Promise((resolve, reject) => {
|
|
34
|
+
if (this.useJSON) {
|
|
35
|
+
const result = tnp_core_1.Helpers.readJson(this.filePath);
|
|
36
|
+
callback(void 0, result);
|
|
37
|
+
resolve(result);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
const result = tnp_core_1.Helpers.readFile(this.filePath);
|
|
41
|
+
callback(void 0, result);
|
|
42
|
+
resolve(result);
|
|
43
|
+
}
|
|
66
44
|
});
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
callback(void 0);
|
|
78
|
-
resolve();
|
|
79
|
-
});
|
|
80
|
-
// pendingOperatins.push(promise);
|
|
81
|
-
return [4 /*yield*/, promise];
|
|
82
|
-
case 1:
|
|
83
|
-
// pendingOperatins.push(promise);
|
|
84
|
-
_a.sent();
|
|
85
|
-
return [2 /*return*/, void 0];
|
|
86
|
-
}
|
|
87
|
-
});
|
|
45
|
+
// pendingOperatins.push(promise);
|
|
46
|
+
return await promise;
|
|
47
|
+
//#endregion
|
|
48
|
+
}
|
|
49
|
+
async removeItem(key, callback) {
|
|
50
|
+
//#region @backendFunc
|
|
51
|
+
const promise = new Promise((resolve, reject) => {
|
|
52
|
+
tnp_core_1.Helpers.remove(this.filePath, true);
|
|
53
|
+
callback(void 0);
|
|
54
|
+
resolve();
|
|
88
55
|
});
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
56
|
+
// pendingOperatins.push(promise);
|
|
57
|
+
await promise;
|
|
58
|
+
return void 0;
|
|
59
|
+
//#endregion
|
|
60
|
+
}
|
|
61
|
+
}
|
|
92
62
|
exports.FileStor = FileStor;
|
|
93
63
|
//#endregion
|
|
94
64
|
//# sourceMappingURL=file-stor.js.map
|
package/lib/file-stor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-stor.js","sourceRoot":"","sources":[""],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"file-stor.js","sourceRoot":"","sources":["/Users/dfilipiak/projects/npm/taon-dev/taon-storage/src/lib/file-stor.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AAInC,MAAa,QAAQ;IAMT;IACA;IAFV,YACU,QAAgB,EAChB,UAAU,KAAK;QADf,aAAQ,GAAR,QAAQ,CAAQ;QAChB,YAAO,GAAP,OAAO,CAAQ;IACrB,CAAC;IAEL,KAAK,CAAC,OAAO,CAAI,GAAW,EAAE,KAAQ,EAAE,QAAuC;QAC7E,sBAAsB;QACtB,MAAM,OAAO,GAAG,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACpD,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;gBACjB,kBAA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,EAAE,MAAM,EAAE,EAAE;YACpD,kBAAO,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YACpC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;YACjB,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC,CAAC;QACH,kCAAkC;QAClC,MAAM,OAAO,CAAC;QACd,OAAO,KAAK,CAAC,CAAC;QACd,YAAY;IACd,CAAC;CACF;AAzDD,4BAyDC;AACD,YAAY"}
|
package/lib/helpers.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.keyDefaultValueAreadySet = exports.keyValue = void 0;
|
|
4
|
-
|
|
4
|
+
const keyValue = (classFun, memberName) => {
|
|
5
5
|
// console.log('classname',classFun.name)
|
|
6
|
-
|
|
6
|
+
const res = `taon.localstorage.class.${classFun.name}.prop.${memberName}`;
|
|
7
7
|
return res;
|
|
8
8
|
};
|
|
9
9
|
exports.keyValue = keyValue;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
const keyDefaultValueAreadySet = (classFun, memberName) => {
|
|
11
|
+
const res = (0, exports.keyValue)(classFun, memberName) + 'defaultvalueisset';
|
|
12
12
|
return res;
|
|
13
13
|
};
|
|
14
14
|
exports.keyDefaultValueAreadySet = keyDefaultValueAreadySet;
|
package/lib/helpers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AACO,
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["/Users/dfilipiak/projects/npm/taon-dev/taon-storage/src/lib/helpers.ts"],"names":[],"mappings":";;;AACO,MAAM,QAAQ,GAAG,CAAC,QAAQ,EAAE,UAAU,EAAE,EAAE;IAC/C,yCAAyC;IACzC,MAAM,GAAG,GAAG,2BAA2B,QAAQ,CAAC,IAAI,SAAS,UAAU,EAAE,CAAA;IACzE,OAAO,GAAG,CAAC;AACb,CAAC,CAAA;AAJY,QAAA,QAAQ,YAIpB;AAEM,MAAM,wBAAwB,GAAG,CAAC,QAAQ,EAAE,UAAU,EAAE,EAAE;IAC/D,MAAM,GAAG,GAAG,IAAA,gBAAQ,EAAC,QAAQ,EAAE,UAAU,CAAC,GAAG,mBAAmB,CAAC;IACjE,OAAO,GAAG,CAAC;AACb,CAAC,CAAA;AAHY,QAAA,wBAAwB,4BAGpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index._auto-generated_.js","sourceRoot":"","sources":[""],"names":[],"mappings":"AAAA,cAAc;AACd,8CAA8C;AAC9C,2BAA2B;AAC3B,uDAAuD;AACvD,2CAA2C"}
|
|
1
|
+
{"version":3,"file":"index._auto-generated_.js","sourceRoot":"","sources":["/Users/dfilipiak/projects/npm/taon-dev/taon-storage/src/lib/index._auto-generated_.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,8CAA8C;AAC9C,2BAA2B;AAC3B,uDAAuD;AACvD,2CAA2C"}
|
package/lib/index.js
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* */
|
|
3
3
|
/* */
|
|
4
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
+
if (k2 === undefined) k2 = k;
|
|
6
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
+
}
|
|
10
|
+
Object.defineProperty(o, k2, desc);
|
|
11
|
+
}) : (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
o[k2] = m[k];
|
|
14
|
+
}));
|
|
15
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
16
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
17
|
+
};
|
|
4
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
|
|
6
|
-
tslib_1.__exportStar(require("./storage"), exports);
|
|
19
|
+
__exportStar(require("./storage"), exports);
|
|
7
20
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":[""],"names":[],"mappings":";AAAA,KAAK;AACL,KAAK
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["/Users/dfilipiak/projects/npm/taon-dev/taon-storage/src/lib/index.ts"],"names":[],"mappings":";AAAA,KAAK;AACL,KAAK;;;;;;;;;;;;;;;;AAEL,4CAA0B"}
|
package/lib/models.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.js","sourceRoot":"","sources":[""],"names":[],"mappings":";AAAA,KAAK;AACL,KAAK"}
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["/Users/dfilipiak/projects/npm/taon-dev/taon-storage/src/lib/models.ts"],"names":[],"mappings":";AAAA,KAAK;AACL,KAAK"}
|