json-fs-query 1.0.4 → 1.0.6
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/browser/jsonFsQuery.js +10158 -27750
- package/browser/jsonFsQuery.min.js +1 -1
- package/dist/data/introspect/create.d.ts +10 -10
- package/dist/data/introspect/create.js +47 -47
- package/dist/data/introspect/definitions/field.d.ts +27 -27
- package/dist/data/introspect/definitions/field.js +36 -36
- package/dist/data/introspect/definitions/key.d.ts +25 -25
- package/dist/data/introspect/definitions/key.js +53 -53
- package/dist/data/introspect/definitions/keyReference.d.ts +17 -17
- package/dist/data/introspect/definitions/keyReference.js +20 -20
- package/dist/data/introspect/definitions/record.d.ts +25 -25
- package/dist/data/introspect/definitions/record.js +32 -32
- package/dist/data/introspect/describe.js +15 -15
- package/dist/data/introspect/drop.js +37 -37
- package/dist/data/introspect/index.d.ts +7 -7
- package/dist/data/introspect/index.js +30 -30
- package/dist/data/introspect/policies/foreignKeyExists.d.ts +8 -8
- package/dist/data/introspect/policies/foreignKeyExists.js +25 -25
- package/dist/data/introspect/policies/hasDependents.d.ts +12 -12
- package/dist/data/introspect/policies/hasDependents.js +52 -52
- package/dist/data/introspect/policies/keyGenerate.d.ts +1 -1
- package/dist/data/introspect/policies/keyGenerate.js +17 -17
- package/dist/data/introspect/policies/keyUnique.d.ts +9 -9
- package/dist/data/introspect/policies/keyUnique.js +31 -31
- package/dist/data/introspect/policies/typeCheck.d.ts +11 -11
- package/dist/data/introspect/policies/typeCheck.js +57 -57
- package/dist/data/introspect/policies/typeEnum.d.ts +1 -1
- package/dist/data/introspect/policies/typeEnum.js +9 -9
- package/dist/data/introspect/policies/useDefault.d.ts +1 -1
- package/dist/data/introspect/policies/useDefault.js +8 -8
- package/dist/data/queries/deleteEntity.d.ts +1 -1
- package/dist/data/queries/deleteEntity.js +100 -100
- package/dist/data/queries/groupBy.d.ts +1 -1
- package/dist/data/queries/groupBy.js +22 -22
- package/dist/data/queries/insertEntity.d.ts +1 -1
- package/dist/data/queries/insertEntity.js +117 -117
- package/dist/data/queries/joinEntity.d.ts +1 -1
- package/dist/data/queries/joinEntity.js +32 -32
- package/dist/data/queries/joinEntity.min.js +1 -1
- package/dist/data/queries/limitOffset.d.ts +7 -7
- package/dist/data/queries/limitOffset.js +21 -21
- package/dist/data/queries/mergeJoins.d.ts +1 -1
- package/dist/data/queries/mergeJoins.js +19 -19
- package/dist/data/queries/mergeJoins.min.js +1 -1
- package/dist/data/queries/parser.d.ts +1 -1
- package/dist/data/queries/parser.js +19 -19
- package/dist/data/queries/parser.min.js +1 -1
- package/dist/data/queries/query.d.ts +1 -1
- package/dist/data/queries/query.js +18 -18
- package/dist/data/queries/query.min.js +1 -1
- package/dist/data/queries/readEntity.js +14 -14
- package/dist/data/queries/selectFields.d.ts +9 -9
- package/dist/data/queries/selectFields.js +36 -36
- package/dist/data/queries/sortBy.d.ts +1 -1
- package/dist/data/queries/sortBy.js +15 -15
- package/dist/data/queries/sortBy.min.js +1 -1
- package/dist/data/queries/updateEntity.d.ts +1 -1
- package/dist/data/queries/updateEntity.js +190 -190
- package/dist/data/queries/where.d.ts +6 -6
- package/dist/data/queries/where.js +56 -56
- package/dist/data/utilities/computeKeyValue.d.ts +12 -12
- package/dist/data/utilities/computeKeyValue.js +26 -26
- package/dist/data/utilities/config.d.ts +27 -27
- package/dist/data/utilities/config.js +45 -45
- package/dist/data/utilities/deregisterRecord.d.ts +7 -7
- package/dist/data/utilities/deregisterRecord.js +34 -34
- package/dist/data/utilities/getConditionIndexedList.js +47 -47
- package/dist/data/utilities/getConditionIndexedList.min.js +1 -1
- package/dist/data/utilities/getJoinIndexedList.js +76 -76
- package/dist/data/utilities/getJoinIndexedList.min.js +1 -1
- package/dist/data/utilities/getMatchingIndexes.js +28 -28
- package/dist/data/utilities/getMatchingIndexes.min.js +1 -1
- package/dist/data/utilities/matchIndexedJoins.js +61 -61
- package/dist/data/utilities/matchIndexedJoins.min.js +1 -1
- package/dist/data/utilities/mergeJoin.js +44 -44
- package/dist/data/utilities/mergeJoin.min.js +1 -1
- package/dist/data/utilities/parsers/findCommand.d.ts +9 -9
- package/dist/data/utilities/parsers/findCommand.js +25 -25
- package/dist/data/utilities/parsers/findConditions.d.ts +14 -14
- package/dist/data/utilities/parsers/findConditions.js +28 -28
- package/dist/data/utilities/parsers/findConditions.min.js +1 -1
- package/dist/data/utilities/parsers/findGroupBy.d.ts +8 -8
- package/dist/data/utilities/parsers/findGroupBy.js +22 -22
- package/dist/data/utilities/parsers/findInsertValues.d.ts +12 -12
- package/dist/data/utilities/parsers/findInsertValues.js +34 -34
- package/dist/data/utilities/parsers/findJoinClauses.d.ts +12 -12
- package/dist/data/utilities/parsers/findJoinClauses.js +27 -27
- package/dist/data/utilities/parsers/findJoinClauses.min.js +1 -1
- package/dist/data/utilities/parsers/findJoinEntity.d.ts +8 -8
- package/dist/data/utilities/parsers/findJoinEntity.js +22 -22
- package/dist/data/utilities/parsers/findLimit.d.ts +8 -8
- package/dist/data/utilities/parsers/findLimit.js +22 -22
- package/dist/data/utilities/parsers/findMergeJoins.d.ts +11 -11
- package/dist/data/utilities/parsers/findMergeJoins.js +26 -26
- package/dist/data/utilities/parsers/findMergeJoins.min.js +1 -1
- package/dist/data/utilities/parsers/findOffset.d.ts +8 -8
- package/dist/data/utilities/parsers/findOffset.js +22 -22
- package/dist/data/utilities/parsers/findSelects.d.ts +11 -11
- package/dist/data/utilities/parsers/findSelects.js +30 -30
- package/dist/data/utilities/parsers/findSelects.min.js +1 -1
- package/dist/data/utilities/parsers/findSortClauses.d.ts +11 -11
- package/dist/data/utilities/parsers/findSortClauses.js +30 -30
- package/dist/data/utilities/parsers/findSortClauses.min.js +1 -1
- package/dist/data/utilities/parsers/findUpdateValues.d.ts +14 -14
- package/dist/data/utilities/parsers/findUpdateValues.js +34 -34
- package/dist/data/utilities/parsers/isEntityProperty.js +6 -6
- package/dist/data/utilities/parsers/parseLiteralValue.d.ts +11 -11
- package/dist/data/utilities/parsers/parseLiteralValue.js +34 -34
- package/dist/data/utilities/parsers/parseQuery.d.ts +32 -32
- package/dist/data/utilities/parsers/parseQuery.js +51 -51
- package/dist/data/utilities/parsers/parseQuery.min.js +1 -1
- package/dist/data/utilities/parsers/removeFromQuery.js +6 -6
- package/dist/data/utilities/parsers/splitEntityProperty.js +13 -13
- package/dist/data/utilities/parsers/splitQueries.js +9 -9
- package/dist/data/utilities/reconcileJoin.js +26 -26
- package/dist/data/utilities/reconcileJoins.js +26 -26
- package/dist/data/utilities/reconcileJoins.min.js +1 -1
- package/dist/data/utilities/registerRecord.d.ts +7 -7
- package/dist/data/utilities/registerRecord.js +67 -67
- package/dist/data/utilities/removeFromIndex.d.ts +13 -13
- package/dist/data/utilities/removeFromIndex.js +44 -46
- package/dist/data/utilities/restrictIndexedList.js +45 -45
- package/dist/data/utilities/retrieveFile.js +28 -28
- package/dist/data/utilities/retrieveFile.min.js +1 -1
- package/dist/data/utilities/retrieveIndexes.d.ts +1 -1
- package/dist/data/utilities/retrieveIndexes.js +24 -24
- package/dist/data/utilities/retrieveIndexes.min.js +1 -1
- package/dist/data/utilities/retrieveRecord.js +9 -9
- package/dist/data/utilities/retrieveRecords.js +21 -21
- package/dist/data/utilities/retrieveRecords.min.js +1 -1
- package/dist/data/utilities/runQuery.d.ts +1 -1
- package/dist/data/utilities/runQuery.js +87 -87
- package/dist/data/utilities/updateIndex.d.ts +16 -16
- package/dist/data/utilities/updateIndex.js +56 -56
- package/dist/data/utilities/useJoinClause.d.ts +5 -5
- package/dist/data/utilities/useJoinClause.js +51 -51
- package/dist/index.d.ts +4 -4
- package/dist/index.js +42 -42
- package/package.json +9 -5
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports,
|
|
4
|
-
value: true
|
|
5
|
-
})
|
|
6
|
-
exports.useJoinClause = void 0
|
|
7
|
-
require(
|
|
8
|
-
require(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
function _interopRequireDefault
|
|
14
|
-
const useJoinClause = async ({
|
|
15
|
-
propertyA = null,
|
|
16
|
-
comparator = '=',
|
|
17
|
-
propertyB = null
|
|
18
|
-
} = {}, dataSets = {}, filterJoins = {}) => {
|
|
19
|
-
const {
|
|
20
|
-
entity: entityA,
|
|
21
|
-
property: propA
|
|
22
|
-
} = (0, _splitEntityProperty.splitEntityProperty)(propertyA)
|
|
23
|
-
const {
|
|
24
|
-
entity: entityB,
|
|
25
|
-
property: propB
|
|
26
|
-
} = (0, _splitEntityProperty.splitEntityProperty)(propertyB)
|
|
27
|
-
if (!Object.prototype.hasOwnProperty.call(dataSets, entityA)) {
|
|
28
|
-
dataSets = await (0, _readEntity.readEntity)(entityA, dataSets)
|
|
29
|
-
}
|
|
30
|
-
if (!Object.prototype.hasOwnProperty.call(dataSets, entityB)) {
|
|
31
|
-
dataSets = await (0, _readEntity.readEntity)(entityB, dataSets)
|
|
32
|
-
}
|
|
33
|
-
if (!Object.prototype.hasOwnProperty.call(filterJoins, entityA)) {
|
|
34
|
-
filterJoins[entityA] = _siFunciona.default.cloneObject(dataSets[entityA])
|
|
35
|
-
}
|
|
36
|
-
if (!Object.prototype.hasOwnProperty.call(filterJoins, entityB)) {
|
|
37
|
-
filterJoins[entityB] = _siFunciona.default.cloneObject(dataSets[entityB])
|
|
38
|
-
}
|
|
39
|
-
filterJoins[entityA] = filterJoins[entityB].reduce((dataA, dataB) => _siFunciona.default.mergeArrays(dataA, (0, _where.where)(filterJoins[entityA], {
|
|
40
|
-
property: propA,
|
|
41
|
-
comparator,
|
|
42
|
-
value: dataB[propB]
|
|
43
|
-
})), [])
|
|
44
|
-
filterJoins[entityB] = filterJoins[entityA].reduce((dataB, dataA) => _siFunciona.default.mergeArrays(dataB, (0, _where.where)(filterJoins[entityB], {
|
|
45
|
-
property: propB,
|
|
46
|
-
comparator,
|
|
47
|
-
value: dataA[propA]
|
|
48
|
-
})), [])
|
|
49
|
-
return filterJoins
|
|
50
|
-
}
|
|
51
|
-
exports.useJoinClause = useJoinClause
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useJoinClause = void 0;
|
|
7
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
|
8
|
+
require("core-js/modules/esnext.iterator.reduce.js");
|
|
9
|
+
var _readEntity = require("../queries/readEntity");
|
|
10
|
+
var _where = require("../queries/where");
|
|
11
|
+
var _splitEntityProperty = require("./parsers/splitEntityProperty");
|
|
12
|
+
var _siFunciona = _interopRequireDefault(require("si-funciona"));
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
const useJoinClause = async ({
|
|
15
|
+
propertyA = null,
|
|
16
|
+
comparator = '=',
|
|
17
|
+
propertyB = null
|
|
18
|
+
} = {}, dataSets = {}, filterJoins = {}) => {
|
|
19
|
+
const {
|
|
20
|
+
entity: entityA,
|
|
21
|
+
property: propA
|
|
22
|
+
} = (0, _splitEntityProperty.splitEntityProperty)(propertyA);
|
|
23
|
+
const {
|
|
24
|
+
entity: entityB,
|
|
25
|
+
property: propB
|
|
26
|
+
} = (0, _splitEntityProperty.splitEntityProperty)(propertyB);
|
|
27
|
+
if (!Object.prototype.hasOwnProperty.call(dataSets, entityA)) {
|
|
28
|
+
dataSets = await (0, _readEntity.readEntity)(entityA, dataSets);
|
|
29
|
+
}
|
|
30
|
+
if (!Object.prototype.hasOwnProperty.call(dataSets, entityB)) {
|
|
31
|
+
dataSets = await (0, _readEntity.readEntity)(entityB, dataSets);
|
|
32
|
+
}
|
|
33
|
+
if (!Object.prototype.hasOwnProperty.call(filterJoins, entityA)) {
|
|
34
|
+
filterJoins[entityA] = _siFunciona.default.cloneObject(dataSets[entityA]);
|
|
35
|
+
}
|
|
36
|
+
if (!Object.prototype.hasOwnProperty.call(filterJoins, entityB)) {
|
|
37
|
+
filterJoins[entityB] = _siFunciona.default.cloneObject(dataSets[entityB]);
|
|
38
|
+
}
|
|
39
|
+
filterJoins[entityA] = filterJoins[entityB].reduce((dataA, dataB) => _siFunciona.default.mergeArrays(dataA, (0, _where.where)(filterJoins[entityA], {
|
|
40
|
+
property: propA,
|
|
41
|
+
comparator,
|
|
42
|
+
value: dataB[propB]
|
|
43
|
+
})), []);
|
|
44
|
+
filterJoins[entityB] = filterJoins[entityA].reduce((dataB, dataA) => _siFunciona.default.mergeArrays(dataB, (0, _where.where)(filterJoins[entityB], {
|
|
45
|
+
property: propB,
|
|
46
|
+
comparator,
|
|
47
|
+
value: dataA[propA]
|
|
48
|
+
})), []);
|
|
49
|
+
return filterJoins;
|
|
50
|
+
};
|
|
51
|
+
exports.useJoinClause = useJoinClause;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { query } from './data/queries/query';
|
|
2
|
-
export { create, drop, describe } from './data/introspect';
|
|
3
|
-
export { configure } from './data/utilities/config';
|
|
4
|
-
export { fieldProperties, fieldDefinition, fieldName, keyProperties, keyDefinition, indexType, indexLocation, referenceProperties, reference, recordProperties, recordDefinition, recordPath, entityPath } from './data/introspect';
|
|
1
|
+
export { query } from './data/queries/query';
|
|
2
|
+
export { create, drop, describe } from './data/introspect';
|
|
3
|
+
export { configure } from './data/utilities/config';
|
|
4
|
+
export { fieldProperties, fieldDefinition, fieldName, keyProperties, keyDefinition, indexType, indexLocation, referenceProperties, reference, recordProperties, recordDefinition, recordPath, entityPath } from './data/introspect';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
require(
|
|
4
|
-
require(
|
|
5
|
-
require(
|
|
6
|
-
require(
|
|
7
|
-
Object.defineProperty(exports,
|
|
8
|
-
value: true
|
|
9
|
-
})
|
|
10
|
-
Object.defineProperty(exports,
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _config.configure
|
|
14
|
-
}
|
|
15
|
-
})
|
|
16
|
-
Object.defineProperty(exports,
|
|
17
|
-
enumerable: true,
|
|
18
|
-
get: function () {
|
|
19
|
-
return _introspect.create
|
|
20
|
-
}
|
|
21
|
-
})
|
|
22
|
-
Object.defineProperty(exports,
|
|
23
|
-
enumerable: true,
|
|
24
|
-
get: function () {
|
|
25
|
-
return _introspect.describe
|
|
26
|
-
}
|
|
27
|
-
})
|
|
28
|
-
Object.defineProperty(exports,
|
|
29
|
-
enumerable: true,
|
|
30
|
-
get: function () {
|
|
31
|
-
return _introspect.drop
|
|
32
|
-
}
|
|
33
|
-
})
|
|
34
|
-
Object.defineProperty(exports,
|
|
35
|
-
enumerable: true,
|
|
36
|
-
get: function () {
|
|
37
|
-
return _query.query
|
|
38
|
-
}
|
|
39
|
-
})
|
|
40
|
-
var _query = require(
|
|
41
|
-
var _introspect = require(
|
|
42
|
-
var _config = require(
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/esnext.async-iterator.constructor.js");
|
|
4
|
+
require("core-js/modules/esnext.async-iterator.drop.js");
|
|
5
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
|
6
|
+
require("core-js/modules/esnext.iterator.drop.js");
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
Object.defineProperty(exports, "configure", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _config.configure;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "create", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () {
|
|
19
|
+
return _introspect.create;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
Object.defineProperty(exports, "describe", {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function () {
|
|
25
|
+
return _introspect.describe;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports, "drop", {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function () {
|
|
31
|
+
return _introspect.drop;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
Object.defineProperty(exports, "query", {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function () {
|
|
37
|
+
return _query.query;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
var _query = require("./data/queries/query");
|
|
41
|
+
var _introspect = require("./data/introspect");
|
|
42
|
+
var _config = require("./data/utilities/config");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "json-fs-query",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "Use json files to manage and read data.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
"build": "gulp build",
|
|
15
15
|
"dev": "gulp",
|
|
16
16
|
"docs": "gulp docs",
|
|
17
|
+
"publish:bundle": "gulp copyFiles",
|
|
18
|
+
"release": "release-it",
|
|
19
|
+
"release:dry-run": "release-it --dry-run",
|
|
17
20
|
"sass": "gulp sass",
|
|
18
21
|
"test": "gulp testFull",
|
|
19
22
|
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
@@ -39,13 +42,14 @@
|
|
|
39
42
|
"homepage": "https://github.com/jheagle/json-file-db#readme",
|
|
40
43
|
"devDependencies": {
|
|
41
44
|
"gulp": "^5.0.1",
|
|
42
|
-
"js-build-tools": "^
|
|
43
|
-
"
|
|
45
|
+
"js-build-tools": "^6.3.0",
|
|
46
|
+
"release-it": "^21.1.1",
|
|
47
|
+
"test-filesystem": "^2.0.2",
|
|
44
48
|
"typedoc": "^0.28.20"
|
|
45
49
|
},
|
|
46
50
|
"dependencies": {
|
|
47
51
|
"browser-or-node": "^3.0.0",
|
|
48
|
-
"core-js": "^3.
|
|
49
|
-
"si-funciona": "^2.
|
|
52
|
+
"core-js": "^3.51.0",
|
|
53
|
+
"si-funciona": "^2.8.0"
|
|
50
54
|
}
|
|
51
55
|
}
|