beanbagdb 0.5.3 → 0.5.41
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/dist/beanbagdb.esm.js +146 -79
- package/dist/beanbagdb.esm.js.map +1 -1
- package/package.json +1 -1
- package/rollup.config.js +20 -20
- package/src/index.js +1 -0
- package/src/utils.js +34 -29
- package/dist/beanbagdb.cjs.js +0 -153242
- package/dist/beanbagdb.cjs.js.map +0 -1
package/dist/beanbagdb.esm.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { readFile } from 'fs/promises';
|
|
2
1
|
import require$$0$3, { fileURLToPath } from 'url';
|
|
3
|
-
import require$$1$2, { dirname
|
|
2
|
+
import require$$1$2, { dirname } from 'path';
|
|
4
3
|
import crypto$1, { scryptSync, randomBytes, createCipheriv, createDecipheriv } from 'crypto';
|
|
5
4
|
import require$$3$1 from 'http';
|
|
6
5
|
import require$$4 from 'https';
|
|
@@ -17,20 +16,124 @@ import require$$2 from 'os';
|
|
|
17
16
|
import vm from 'vm';
|
|
18
17
|
|
|
19
18
|
function _mergeNamespaces(n, m) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
m.forEach(function (e) {
|
|
20
|
+
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
21
|
+
if (k !== 'default' && !(k in n)) {
|
|
22
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
23
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
24
|
+
enumerable: true,
|
|
25
|
+
get: function () { return e[k]; }
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
return Object.freeze(n);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
var name$1 = "beanbagdb";
|
|
34
|
+
var version$5 = "0.5.41";
|
|
35
|
+
var description$2 = "A JS library to introduce a schema layer to a No-SQL local database";
|
|
36
|
+
var main$1 = "dist/beanbagdb.esm.js";
|
|
37
|
+
var module = "dist/beanbagdb.esm.js";
|
|
38
|
+
var type$3 = "module";
|
|
39
|
+
var scripts$1 = {
|
|
40
|
+
test: "mocha",
|
|
41
|
+
build: "rollup -c",
|
|
42
|
+
prepublishOnly: "npm run build"
|
|
43
|
+
};
|
|
44
|
+
var repository$1 = {
|
|
45
|
+
type: "git",
|
|
46
|
+
url: "git+https://github.com/shubhvjain/beanbagdb.git"
|
|
47
|
+
};
|
|
48
|
+
var keywords$1 = [
|
|
49
|
+
"couchdb",
|
|
50
|
+
"pouchdb",
|
|
51
|
+
"local",
|
|
52
|
+
"database",
|
|
53
|
+
"schema"
|
|
54
|
+
];
|
|
55
|
+
var author$1 = "svj";
|
|
56
|
+
var license$1 = "ISC";
|
|
57
|
+
var bugs = {
|
|
58
|
+
url: "https://github.com/shubhvjain/beanbagdb/issues"
|
|
59
|
+
};
|
|
60
|
+
var homepage$1 = "https://github.com/shubhvjain/beanbagdb#readme";
|
|
61
|
+
var dependencies$2 = {
|
|
62
|
+
ajv: "^8.12.0",
|
|
63
|
+
dotenv: "^16.4.5",
|
|
64
|
+
nano: "^10.1.3",
|
|
65
|
+
pouchdb: "^9.0.0",
|
|
66
|
+
"pouchdb-adapter-memory": "^9.0.0",
|
|
67
|
+
"pouchdb-find": "^9.0.0"
|
|
68
|
+
};
|
|
69
|
+
var devDependencies$1 = {
|
|
70
|
+
"@rollup/plugin-commonjs": "^26.0.1",
|
|
71
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
72
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
73
|
+
"@rollup/plugin-replace": "^5.0.7",
|
|
74
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
75
|
+
chai: "^5.1.1",
|
|
76
|
+
mocha: "^10.7.3",
|
|
77
|
+
rollup: "^4.21.2"
|
|
78
|
+
};
|
|
79
|
+
var pkg = {
|
|
80
|
+
name: name$1,
|
|
81
|
+
version: version$5,
|
|
82
|
+
description: description$2,
|
|
83
|
+
main: main$1,
|
|
84
|
+
module: module,
|
|
85
|
+
type: type$3,
|
|
86
|
+
scripts: scripts$1,
|
|
87
|
+
repository: repository$1,
|
|
88
|
+
keywords: keywords$1,
|
|
89
|
+
author: author$1,
|
|
90
|
+
license: license$1,
|
|
91
|
+
bugs: bugs,
|
|
92
|
+
homepage: homepage$1,
|
|
93
|
+
dependencies: dependencies$2,
|
|
94
|
+
devDependencies: devDependencies$1
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// import { readFile } from 'fs/promises';
|
|
98
|
+
// import { fileURLToPath } from 'url';
|
|
99
|
+
// import { dirname, join } from 'path';
|
|
100
|
+
|
|
101
|
+
// // Get the current directory
|
|
102
|
+
// const __filename = fileURLToPath(import.meta.url);
|
|
103
|
+
// const __dirname = dirname(__filename);
|
|
104
|
+
|
|
105
|
+
// // Adjust path to point to the correct location of package.json (move up from /src)
|
|
106
|
+
// const packageJsonPath = join(__dirname, '../package.json'); // Adjust to point to the correct folder
|
|
107
|
+
|
|
108
|
+
// function isNode() {
|
|
109
|
+
// return typeof process !== 'undefined' && process.versions != null && process.versions.node != null;
|
|
110
|
+
// }
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
// // Function to read package.json and get the version
|
|
114
|
+
// async function getPackageVersionNode() {
|
|
115
|
+
// try {
|
|
116
|
+
// const data = await readFile(packageJsonPath, 'utf-8');
|
|
117
|
+
// const packageJson = JSON.parse(data);
|
|
118
|
+
// return packageJson.version;
|
|
119
|
+
// } catch (error) {
|
|
120
|
+
// console.error('Error reading package.json:', error);
|
|
121
|
+
// throw error;
|
|
122
|
+
// }
|
|
123
|
+
// }
|
|
124
|
+
|
|
125
|
+
async function getPackageVersion() {
|
|
126
|
+
//if (isNode()) {
|
|
127
|
+
// return await getPackageVersionNode(); // Node.js environment
|
|
128
|
+
//} else {
|
|
129
|
+
// return "0.5.41"; // Browser environment
|
|
130
|
+
//}
|
|
131
|
+
return pkg.version
|
|
32
132
|
}
|
|
33
133
|
|
|
134
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
135
|
+
dirname(__filename);
|
|
136
|
+
|
|
34
137
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
35
138
|
|
|
36
139
|
function getDefaultExportFromCjs (x) {
|
|
@@ -7540,42 +7643,6 @@ const editable_metadata_schema = {
|
|
|
7540
7643
|
}
|
|
7541
7644
|
};
|
|
7542
7645
|
|
|
7543
|
-
// Get the current directory
|
|
7544
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
7545
|
-
const __dirname$1 = dirname(__filename);
|
|
7546
|
-
|
|
7547
|
-
// Adjust path to point to the correct location of package.json (move up from /src)
|
|
7548
|
-
const packageJsonPath = join(__dirname$1, '../package.json'); // Adjust to point to the correct folder
|
|
7549
|
-
|
|
7550
|
-
function isNode() {
|
|
7551
|
-
return typeof process !== 'undefined' && process.versions != null && process.versions.node != null;
|
|
7552
|
-
}
|
|
7553
|
-
|
|
7554
|
-
|
|
7555
|
-
// Function to read package.json and get the version
|
|
7556
|
-
async function getPackageVersionNode() {
|
|
7557
|
-
try {
|
|
7558
|
-
const data = await readFile(packageJsonPath, 'utf-8');
|
|
7559
|
-
const packageJson = JSON.parse(data);
|
|
7560
|
-
return packageJson.version;
|
|
7561
|
-
} catch (error) {
|
|
7562
|
-
console.error('Error reading package.json:', error);
|
|
7563
|
-
throw error;
|
|
7564
|
-
}
|
|
7565
|
-
}
|
|
7566
|
-
|
|
7567
|
-
|
|
7568
|
-
|
|
7569
|
-
async function getPackageVersion() {
|
|
7570
|
-
if (isNode()) {
|
|
7571
|
-
return await getPackageVersionNode(); // Node.js environment
|
|
7572
|
-
} else {
|
|
7573
|
-
return "0.5.3"; // Browser environment
|
|
7574
|
-
}
|
|
7575
|
-
}
|
|
7576
|
-
|
|
7577
|
-
// getPackageVersion().then(version => console.log('Package version:', version));
|
|
7578
|
-
|
|
7579
7646
|
/**
|
|
7580
7647
|
* This the core class. it is not very useful in itself but can be used to generate a sub class for a specific database for eg CouchDB.
|
|
7581
7648
|
* It takes a db_instance argument, which , this class relies on perform CRUD operations on the data.
|
|
@@ -113227,14 +113294,14 @@ const punycode$1 = {
|
|
|
113227
113294
|
};
|
|
113228
113295
|
|
|
113229
113296
|
var punycode_es6 = /*#__PURE__*/Object.freeze({
|
|
113230
|
-
|
|
113231
|
-
|
|
113232
|
-
|
|
113233
|
-
|
|
113234
|
-
|
|
113235
|
-
|
|
113236
|
-
|
|
113237
|
-
|
|
113297
|
+
__proto__: null,
|
|
113298
|
+
decode: decode$1,
|
|
113299
|
+
default: punycode$1,
|
|
113300
|
+
encode: encode$2,
|
|
113301
|
+
toASCII: toASCII,
|
|
113302
|
+
toUnicode: toUnicode,
|
|
113303
|
+
ucs2decode: ucs2decode,
|
|
113304
|
+
ucs2encode: ucs2encode
|
|
113238
113305
|
});
|
|
113239
113306
|
|
|
113240
113307
|
var require$$0 = /*@__PURE__*/getAugmentedNamespace(punycode_es6);
|
|
@@ -126115,27 +126182,27 @@ var PrefixSecurityEnum_1 = cookie.PrefixSecurityEnum = PrefixSecurityEnum;
|
|
|
126115
126182
|
var ParameterError = cookie.ParameterError = validators.ParameterError;
|
|
126116
126183
|
|
|
126117
126184
|
var tough = /*#__PURE__*/_mergeNamespaces({
|
|
126118
|
-
|
|
126119
|
-
|
|
126120
|
-
|
|
126121
|
-
|
|
126122
|
-
|
|
126123
|
-
|
|
126124
|
-
|
|
126125
|
-
|
|
126126
|
-
|
|
126127
|
-
|
|
126128
|
-
|
|
126129
|
-
|
|
126130
|
-
|
|
126131
|
-
|
|
126132
|
-
|
|
126133
|
-
|
|
126134
|
-
|
|
126135
|
-
|
|
126136
|
-
|
|
126137
|
-
|
|
126138
|
-
|
|
126185
|
+
__proto__: null,
|
|
126186
|
+
Cookie: Cookie_1,
|
|
126187
|
+
CookieJar: CookieJar_1,
|
|
126188
|
+
MemoryCookieStore: MemoryCookieStore_1,
|
|
126189
|
+
ParameterError: ParameterError,
|
|
126190
|
+
PrefixSecurityEnum: PrefixSecurityEnum_1,
|
|
126191
|
+
Store: Store_1,
|
|
126192
|
+
canonicalDomain: canonicalDomain_1,
|
|
126193
|
+
cookieCompare: cookieCompare_1,
|
|
126194
|
+
default: cookie,
|
|
126195
|
+
defaultPath: defaultPath_1,
|
|
126196
|
+
domainMatch: domainMatch_1,
|
|
126197
|
+
formatDate: formatDate_1,
|
|
126198
|
+
fromJSON: fromJSON_1,
|
|
126199
|
+
getPublicSuffix: getPublicSuffix,
|
|
126200
|
+
parse: parse_1,
|
|
126201
|
+
parseDate: parseDate_1,
|
|
126202
|
+
pathMatch: pathMatch_1,
|
|
126203
|
+
permuteDomain: permuteDomain,
|
|
126204
|
+
permutePath: permutePath_1,
|
|
126205
|
+
version: version$2
|
|
126139
126206
|
}, [cookie]);
|
|
126140
126207
|
|
|
126141
126208
|
var setCookie = {exports: {}};
|