couchset 0.0.0 → 0.0.5
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/LICENSE +21 -0
- package/README.md +231 -0
- package/dist/automate/index.d.ts +4 -0
- package/dist/automate/index.js +17 -0
- package/dist/automate/index.js.map +1 -0
- package/dist/automate/middlewares/index.d.ts +1 -0
- package/dist/automate/middlewares/index.js +14 -0
- package/dist/automate/middlewares/index.js.map +1 -0
- package/dist/automate/middlewares/isAuth.d.ts +7 -0
- package/dist/automate/middlewares/isAuth.js +28 -0
- package/dist/automate/middlewares/isAuth.js.map +1 -0
- package/dist/automate/model/client.d.ts +12 -0
- package/dist/automate/model/client.js +33 -0
- package/dist/automate/model/client.js.map +1 -0
- package/dist/automate/model/index.d.ts +44 -0
- package/dist/automate/model/index.js +304 -0
- package/dist/automate/model/index.js.map +1 -0
- package/dist/automate/morpheus/index.d.ts +14 -0
- package/dist/automate/morpheus/index.js +171 -0
- package/dist/automate/morpheus/index.js.map +1 -0
- package/dist/automate/writer/index.d.ts +10 -0
- package/dist/automate/writer/index.js +72 -0
- package/dist/automate/writer/index.js.map +1 -0
- package/dist/config/index.d.ts +3 -0
- package/dist/config/index.js +8 -0
- package/dist/config/index.js.map +1 -0
- package/dist/connection.d.ts +36 -0
- package/dist/connection.js +129 -0
- package/dist/connection.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +80 -0
- package/dist/index.js.map +1 -0
- package/dist/model/index.d.ts +107 -0
- package/dist/model/index.js +329 -0
- package/dist/model/index.js.map +1 -0
- package/dist/pagination/index.d.ts +1 -0
- package/dist/pagination/index.js +14 -0
- package/dist/pagination/index.js.map +1 -0
- package/dist/pagination/pagination.d.ts +19 -0
- package/dist/pagination/pagination.js +97 -0
- package/dist/pagination/pagination.js.map +1 -0
- package/dist/query/base-query.d.ts +17 -0
- package/dist/query/base-query.js +15 -0
- package/dist/query/base-query.js.map +1 -0
- package/dist/query/exceptions.d.ts +24 -0
- package/dist/query/exceptions.js +90 -0
- package/dist/query/exceptions.js.map +1 -0
- package/dist/query/helpers/builders.d.ts +64 -0
- package/dist/query/helpers/builders.js +415 -0
- package/dist/query/helpers/builders.js.map +1 -0
- package/dist/query/helpers/dictionary.d.ts +45 -0
- package/dist/query/helpers/dictionary.js +105 -0
- package/dist/query/helpers/dictionary.js.map +1 -0
- package/dist/query/helpers/index.d.ts +3 -0
- package/dist/query/helpers/index.js +16 -0
- package/dist/query/helpers/index.js.map +1 -0
- package/dist/query/helpers/reservedWords.d.ts +1 -0
- package/dist/query/helpers/reservedWords.js +200 -0
- package/dist/query/helpers/reservedWords.js.map +1 -0
- package/dist/query/index.d.ts +5 -0
- package/dist/query/index.js +27 -0
- package/dist/query/index.js.map +1 -0
- package/dist/query/interface/query.types.d.ts +236 -0
- package/dist/query/interface/query.types.js +3 -0
- package/dist/query/interface/query.types.js.map +1 -0
- package/dist/query/query.cluster.d.ts +14 -0
- package/dist/query/query.cluster.js +80 -0
- package/dist/query/query.cluster.js.map +1 -0
- package/dist/query/query.d.ts +321 -0
- package/dist/query/query.js +457 -0
- package/dist/query/query.js.map +1 -0
- package/dist/query/utils.d.ts +8 -0
- package/dist/query/utils.js +56 -0
- package/dist/query/utils.js.map +1 -0
- package/dist/search/customQuery.d.ts +17 -0
- package/dist/search/customQuery.js +83 -0
- package/dist/search/customQuery.js.map +1 -0
- package/dist/search/index.d.ts +1 -0
- package/dist/search/index.js +14 -0
- package/dist/search/index.js.map +1 -0
- package/dist/shared/ContextType.d.ts +27 -0
- package/dist/shared/ContextType.js +55 -0
- package/dist/shared/ContextType.js.map +1 -0
- package/dist/shared/common.model.d.ts +37 -0
- package/dist/shared/common.model.js +148 -0
- package/dist/shared/common.model.js.map +1 -0
- package/dist/shared/index.d.ts +2 -0
- package/dist/shared/index.js +15 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/utils/awaitTo.d.ts +17 -0
- package/dist/utils/awaitTo.js +31 -0
- package/dist/utils/awaitTo.js.map +1 -0
- package/dist/utils/date.d.ts +11 -0
- package/dist/utils/date.js +21 -0
- package/dist/utils/date.js.map +1 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.js +18 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/log.d.ts +9 -0
- package/dist/utils/log.js +19 -0
- package/dist/utils/log.js.map +1 -0
- package/dist/utils/text.utils.d.ts +14 -0
- package/dist/utils/text.utils.js +45 -0
- package/dist/utils/text.utils.js.map +1 -0
- package/dist/utils/utils.schema.d.ts +6 -0
- package/dist/utils/utils.schema.js +33 -0
- package/dist/utils/utils.schema.js.map +1 -0
- package/dist/uuid.d.ts +1 -0
- package/dist/uuid.js +9 -0
- package/dist/uuid.js.map +1 -0
- package/docs/couch.png +0 -0
- package/docs/couchset.png +0 -0
- package/docs/couchset_logo.png +0 -0
- package/package.json +108 -30
- package/register/index.js +1 -0
- package/register/transpile-only.js +3 -0
- package/register/type-check.js +3 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CollectionSatisfiesOperatorDict = exports.CollectionInWithinOperatorDict = exports.CollectionSelectOperatorDict = exports.LogicalOperatorDict = exports.ComparisonMultipleOperatorDict = exports.ComparisonSingleStringOperatorDict = exports.ComparisonSingleOperatorDict = exports.ComparisonEmptyOperatorDict = exports.ReturnResultDict = exports.ResultExprDict = exports.AggDict = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Dictionary for handling aggregation functions.
|
|
6
|
+
* */
|
|
7
|
+
exports.AggDict = {
|
|
8
|
+
$arrayAgg: 'ARRAY_AGG',
|
|
9
|
+
$avg: 'AVG',
|
|
10
|
+
$mean: 'MEAN',
|
|
11
|
+
$count: 'COUNT',
|
|
12
|
+
$countn: 'COUNTN',
|
|
13
|
+
$max: 'MAX',
|
|
14
|
+
$median: 'MEDIAN',
|
|
15
|
+
$min: 'MIN',
|
|
16
|
+
$stddev: 'STDDEV',
|
|
17
|
+
$stddevPop: 'STDDEV_POP',
|
|
18
|
+
$stddevSamp: 'STDDEV_SAMP',
|
|
19
|
+
$sum: 'SUM',
|
|
20
|
+
$variance: 'VARIANCE',
|
|
21
|
+
$variancePop: 'VARIANCE_POP',
|
|
22
|
+
$varianceSamp: 'VARIANCE_SAMP',
|
|
23
|
+
$varPop: 'VAR_POP',
|
|
24
|
+
$varSamp: 'VAR_SAMP',
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Dictionary for handling result expressions RAW | ELEMENT | VALUE
|
|
28
|
+
* */
|
|
29
|
+
exports.ResultExprDict = {
|
|
30
|
+
$raw: 'RAW',
|
|
31
|
+
$element: 'ELEMENT',
|
|
32
|
+
$value: 'VALUE',
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Dictionary for handling result expressions ALL | DISTINCT
|
|
36
|
+
* */
|
|
37
|
+
exports.ReturnResultDict = {
|
|
38
|
+
$all: 'ALL',
|
|
39
|
+
$distinct: 'DISTINCT',
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Dictionary for handling Boolean comparison operators
|
|
43
|
+
* */
|
|
44
|
+
exports.ComparisonEmptyOperatorDict = {
|
|
45
|
+
$isNull: 'IS NULL',
|
|
46
|
+
$isNotNull: 'IS NOT NULL',
|
|
47
|
+
$isMissing: 'IS MISSING',
|
|
48
|
+
$isNotMissing: 'IS NOT MISSING',
|
|
49
|
+
$isValued: 'IS VALUED',
|
|
50
|
+
$isNotValued: 'IS NOT VALUED',
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Dictionary for handling Numeric comparison operators
|
|
54
|
+
* */
|
|
55
|
+
exports.ComparisonSingleOperatorDict = {
|
|
56
|
+
$eq: '=',
|
|
57
|
+
$neq: '!=',
|
|
58
|
+
$gt: '>',
|
|
59
|
+
$gte: '>=',
|
|
60
|
+
$lt: '<',
|
|
61
|
+
$lte: '<=',
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Dictionary for handling String comparison operators
|
|
65
|
+
* */
|
|
66
|
+
exports.ComparisonSingleStringOperatorDict = {
|
|
67
|
+
$like: 'LIKE',
|
|
68
|
+
$notLike: 'NOT LIKE',
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Dictionary for handling Range comparison operators
|
|
72
|
+
* */
|
|
73
|
+
exports.ComparisonMultipleOperatorDict = {
|
|
74
|
+
$btw: 'BETWEEN',
|
|
75
|
+
$notBtw: 'NOT BETWEEN',
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Dictionary for handling logical operators
|
|
79
|
+
* */
|
|
80
|
+
exports.LogicalOperatorDict = {
|
|
81
|
+
$and: 'AND',
|
|
82
|
+
$or: 'OR',
|
|
83
|
+
$not: 'NOT',
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Dictionary for handling collection select operators
|
|
87
|
+
* */
|
|
88
|
+
exports.CollectionSelectOperatorDict = {
|
|
89
|
+
$any: 'ANY',
|
|
90
|
+
$every: 'EVERY',
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Dictionary for handling collection (in | within) operators
|
|
94
|
+
* */
|
|
95
|
+
exports.CollectionInWithinOperatorDict = {
|
|
96
|
+
$in: 'IN',
|
|
97
|
+
$within: 'WITHIN',
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Dictionary for handling collection satisfies operators
|
|
101
|
+
* */
|
|
102
|
+
exports.CollectionSatisfiesOperatorDict = {
|
|
103
|
+
$satisfies: 'SATISFIES',
|
|
104
|
+
};
|
|
105
|
+
//# sourceMappingURL=dictionary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dictionary.js","sourceRoot":"","sources":["../../../src/query/helpers/dictionary.ts"],"names":[],"mappings":";;;AAcA;;KAEK;AACQ,QAAA,OAAO,GAA4B;IAC5C,SAAS,EAAE,WAAW;IACtB,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,OAAO;IACf,OAAO,EAAE,QAAQ;IACjB,IAAI,EAAE,KAAK;IACX,OAAO,EAAE,QAAQ;IACjB,IAAI,EAAE,KAAK;IACX,OAAO,EAAE,QAAQ;IACjB,UAAU,EAAE,YAAY;IACxB,WAAW,EAAE,aAAa;IAC1B,IAAI,EAAE,KAAK;IACX,SAAS,EAAE,UAAU;IACrB,YAAY,EAAE,cAAc;IAC5B,aAAa,EAAE,eAAe;IAC9B,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;CACvB,CAAC;AAEF;;KAEK;AACQ,QAAA,cAAc,GAAmC;IAC1D,IAAI,EAAE,KAAK;IACX,QAAQ,EAAE,SAAS;IACnB,MAAM,EAAE,OAAO;CAClB,CAAC;AAEF;;KAEK;AACQ,QAAA,gBAAgB,GAAqC;IAC9D,IAAI,EAAE,KAAK;IACX,SAAS,EAAE,UAAU;CACxB,CAAC;AAEF;;KAEK;AACQ,QAAA,2BAA2B,GAAgD;IACpF,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,aAAa;IACzB,UAAU,EAAE,YAAY;IACxB,aAAa,EAAE,gBAAgB;IAC/B,SAAS,EAAE,WAAW;IACtB,YAAY,EAAE,eAAe;CAChC,CAAC;AAEF;;KAEK;AACQ,QAAA,4BAA4B,GAAiD;IACtF,GAAG,EAAE,GAAG;IACR,IAAI,EAAE,IAAI;IACV,GAAG,EAAE,GAAG;IACR,IAAI,EAAE,IAAI;IACV,GAAG,EAAE,GAAG;IACR,IAAI,EAAE,IAAI;CACb,CAAC;AAEF;;KAEK;AACQ,QAAA,kCAAkC,GAG3C;IACA,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,UAAU;CACvB,CAAC;AAEF;;KAEK;AACQ,QAAA,8BAA8B,GAAmD;IAC1F,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,aAAa;CACzB,CAAC;AAEF;;KAEK;AACQ,QAAA,mBAAmB,GAAwC;IACpE,IAAI,EAAE,KAAK;IACX,GAAG,EAAE,IAAI;IACT,IAAI,EAAE,KAAK;CACd,CAAC;AAEF;;KAEK;AACQ,QAAA,4BAA4B,GAA6C;IAClF,IAAI,EAAE,KAAK;IACX,MAAM,EAAE,OAAO;CAClB,CAAC;AAEF;;KAEK;AACQ,QAAA,8BAA8B,GAA+C;IACtF,GAAG,EAAE,IAAI;IACT,OAAO,EAAE,QAAQ;CACpB,CAAC;AAEF;;KAEK;AACQ,QAAA,+BAA+B,GAAgD;IACxF,UAAU,EAAE,WAAW;CAC1B,CAAC","sourcesContent":["import {\n AggType,\n CollectionSelectOperator,\n CollectionInWithinOperator,\n ComparisonEmptyOperatorType,\n ComparisonMultipleOperatorType,\n ComparisonSingleOperatorType,\n ComparisonSingleStringOperatorType,\n LogicalOperatorType,\n ResultExprType,\n ReturnResultType,\n CollectionSatisfiesOperator,\n} from '../interface/query.types';\n\n/**\n * Dictionary for handling aggregation functions.\n * */\nexport const AggDict: Record<AggType, string> = {\n $arrayAgg: 'ARRAY_AGG',\n $avg: 'AVG',\n $mean: 'MEAN',\n $count: 'COUNT',\n $countn: 'COUNTN',\n $max: 'MAX',\n $median: 'MEDIAN',\n $min: 'MIN',\n $stddev: 'STDDEV',\n $stddevPop: 'STDDEV_POP',\n $stddevSamp: 'STDDEV_SAMP',\n $sum: 'SUM',\n $variance: 'VARIANCE',\n $variancePop: 'VARIANCE_POP',\n $varianceSamp: 'VARIANCE_SAMP',\n $varPop: 'VAR_POP',\n $varSamp: 'VAR_SAMP',\n};\n\n/**\n * Dictionary for handling result expressions RAW | ELEMENT | VALUE\n * */\nexport const ResultExprDict: Record<ResultExprType, string> = {\n $raw: 'RAW',\n $element: 'ELEMENT',\n $value: 'VALUE',\n};\n\n/**\n * Dictionary for handling result expressions ALL | DISTINCT\n * */\nexport const ReturnResultDict: Record<ReturnResultType, string> = {\n $all: 'ALL',\n $distinct: 'DISTINCT',\n};\n\n/**\n * Dictionary for handling Boolean comparison operators\n * */\nexport const ComparisonEmptyOperatorDict: Record<ComparisonEmptyOperatorType, string> = {\n $isNull: 'IS NULL',\n $isNotNull: 'IS NOT NULL',\n $isMissing: 'IS MISSING',\n $isNotMissing: 'IS NOT MISSING',\n $isValued: 'IS VALUED',\n $isNotValued: 'IS NOT VALUED',\n};\n\n/**\n * Dictionary for handling Numeric comparison operators\n * */\nexport const ComparisonSingleOperatorDict: Record<ComparisonSingleOperatorType, string> = {\n $eq: '=',\n $neq: '!=',\n $gt: '>',\n $gte: '>=',\n $lt: '<',\n $lte: '<=',\n};\n\n/**\n * Dictionary for handling String comparison operators\n * */\nexport const ComparisonSingleStringOperatorDict: Record<\n ComparisonSingleStringOperatorType,\n string\n> = {\n $like: 'LIKE',\n $notLike: 'NOT LIKE',\n};\n\n/**\n * Dictionary for handling Range comparison operators\n * */\nexport const ComparisonMultipleOperatorDict: Record<ComparisonMultipleOperatorType, string> = {\n $btw: 'BETWEEN',\n $notBtw: 'NOT BETWEEN',\n};\n\n/**\n * Dictionary for handling logical operators\n * */\nexport const LogicalOperatorDict: Record<LogicalOperatorType, string> = {\n $and: 'AND',\n $or: 'OR',\n $not: 'NOT',\n};\n\n/**\n * Dictionary for handling collection select operators\n * */\nexport const CollectionSelectOperatorDict: Record<CollectionSelectOperator, string> = {\n $any: 'ANY',\n $every: 'EVERY',\n};\n\n/**\n * Dictionary for handling collection (in | within) operators\n * */\nexport const CollectionInWithinOperatorDict: Record<CollectionInWithinOperator, string> = {\n $in: 'IN',\n $within: 'WITHIN',\n};\n\n/**\n * Dictionary for handling collection satisfies operators\n * */\nexport const CollectionSatisfiesOperatorDict: Record<CollectionSatisfiesOperator, string> = {\n $satisfies: 'SATISFIES',\n};\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.n1qlReservedWords = exports.ReturnResultDict = exports.ResultExprDict = exports.AggDict = exports.buildSelectArrayExpr = exports.buildIndexExpr = exports.buildWhereClauseExpr = exports.buildSelectExpr = exports.selectBuilder = void 0;
|
|
4
|
+
var builders_1 = require("./builders");
|
|
5
|
+
Object.defineProperty(exports, "selectBuilder", { enumerable: true, get: function () { return builders_1.selectBuilder; } });
|
|
6
|
+
Object.defineProperty(exports, "buildSelectExpr", { enumerable: true, get: function () { return builders_1.buildSelectExpr; } });
|
|
7
|
+
Object.defineProperty(exports, "buildWhereClauseExpr", { enumerable: true, get: function () { return builders_1.buildWhereClauseExpr; } });
|
|
8
|
+
Object.defineProperty(exports, "buildIndexExpr", { enumerable: true, get: function () { return builders_1.buildIndexExpr; } });
|
|
9
|
+
Object.defineProperty(exports, "buildSelectArrayExpr", { enumerable: true, get: function () { return builders_1.buildSelectArrayExpr; } });
|
|
10
|
+
var dictionary_1 = require("./dictionary");
|
|
11
|
+
Object.defineProperty(exports, "AggDict", { enumerable: true, get: function () { return dictionary_1.AggDict; } });
|
|
12
|
+
Object.defineProperty(exports, "ResultExprDict", { enumerable: true, get: function () { return dictionary_1.ResultExprDict; } });
|
|
13
|
+
Object.defineProperty(exports, "ReturnResultDict", { enumerable: true, get: function () { return dictionary_1.ReturnResultDict; } });
|
|
14
|
+
var reservedWords_1 = require("./reservedWords");
|
|
15
|
+
Object.defineProperty(exports, "n1qlReservedWords", { enumerable: true, get: function () { return reservedWords_1.n1qlReservedWords; } });
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/query/helpers/index.ts"],"names":[],"mappings":";;;AAAA,uCAMoB;AALhB,yGAAA,aAAa,OAAA;AACb,2GAAA,eAAe,OAAA;AACf,gHAAA,oBAAoB,OAAA;AACpB,0GAAA,cAAc,OAAA;AACd,gHAAA,oBAAoB,OAAA;AAExB,2CAAuE;AAA/D,qGAAA,OAAO,OAAA;AAAE,4GAAA,cAAc,OAAA;AAAE,8GAAA,gBAAgB,OAAA;AACjD,iDAAkD;AAA1C,kHAAA,iBAAiB,OAAA","sourcesContent":["export {\n selectBuilder,\n buildSelectExpr,\n buildWhereClauseExpr,\n buildIndexExpr,\n buildSelectArrayExpr,\n} from './builders';\nexport {AggDict, ResultExprDict, ReturnResultDict} from './dictionary';\nexport {n1qlReservedWords} from './reservedWords';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const n1qlReservedWords: string[];
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.n1qlReservedWords = void 0;
|
|
4
|
+
exports.n1qlReservedWords = [
|
|
5
|
+
'ADVISE',
|
|
6
|
+
'ALL',
|
|
7
|
+
'ALTER',
|
|
8
|
+
'ANALYZE',
|
|
9
|
+
'AND',
|
|
10
|
+
'ANY',
|
|
11
|
+
'ARRAY',
|
|
12
|
+
'AS',
|
|
13
|
+
'ASC',
|
|
14
|
+
'BEGIN',
|
|
15
|
+
'BETWEEN',
|
|
16
|
+
'BINARY',
|
|
17
|
+
'BOOLEAN',
|
|
18
|
+
'BREAK',
|
|
19
|
+
'BUCKET',
|
|
20
|
+
'BUILD',
|
|
21
|
+
'BY',
|
|
22
|
+
'CALL',
|
|
23
|
+
'CASE',
|
|
24
|
+
'CAST',
|
|
25
|
+
'CLUSTER',
|
|
26
|
+
'COLLATE',
|
|
27
|
+
'COLLECTION',
|
|
28
|
+
'COMMIT',
|
|
29
|
+
'CONNECT',
|
|
30
|
+
'CONTINUE',
|
|
31
|
+
'CORRELATED',
|
|
32
|
+
'COVER',
|
|
33
|
+
'CREATE',
|
|
34
|
+
'CURRENT',
|
|
35
|
+
'DATABASE',
|
|
36
|
+
'DATASET',
|
|
37
|
+
'DATASTORE',
|
|
38
|
+
'DECLARE',
|
|
39
|
+
'DECREMENT',
|
|
40
|
+
'DELETE',
|
|
41
|
+
'DERIVED',
|
|
42
|
+
'DESC',
|
|
43
|
+
'DESCRIBE',
|
|
44
|
+
'DISTINCT',
|
|
45
|
+
'DO',
|
|
46
|
+
'DROP',
|
|
47
|
+
'EACH',
|
|
48
|
+
'ELEMENT',
|
|
49
|
+
'ELSE',
|
|
50
|
+
'END',
|
|
51
|
+
'EVERY',
|
|
52
|
+
'EXCEPT',
|
|
53
|
+
'EXCLUDE',
|
|
54
|
+
'EXECUTE',
|
|
55
|
+
'EXISTS',
|
|
56
|
+
'EXPLAIN',
|
|
57
|
+
'FALSE',
|
|
58
|
+
'FETCH',
|
|
59
|
+
'FIRST',
|
|
60
|
+
'FLATTEN',
|
|
61
|
+
'FOLLOWING',
|
|
62
|
+
'FOR',
|
|
63
|
+
'FORCE',
|
|
64
|
+
'FROM',
|
|
65
|
+
'FTS',
|
|
66
|
+
'FUNCTION',
|
|
67
|
+
'GOLANG',
|
|
68
|
+
'GRANT',
|
|
69
|
+
'GROUP',
|
|
70
|
+
'GROUPS',
|
|
71
|
+
'GSI',
|
|
72
|
+
'HASH',
|
|
73
|
+
'HAVING',
|
|
74
|
+
'IF',
|
|
75
|
+
'IGNORE',
|
|
76
|
+
'ILIKE',
|
|
77
|
+
'IN',
|
|
78
|
+
'INCLUDE',
|
|
79
|
+
'INCREMENT',
|
|
80
|
+
'INDEX',
|
|
81
|
+
'INFER',
|
|
82
|
+
'INLINE',
|
|
83
|
+
'INNER',
|
|
84
|
+
'INSERT',
|
|
85
|
+
'INTERSECT',
|
|
86
|
+
'INTO',
|
|
87
|
+
'IS',
|
|
88
|
+
'JAVASCRIPT',
|
|
89
|
+
'JOIN',
|
|
90
|
+
'KEY',
|
|
91
|
+
'KEYS',
|
|
92
|
+
'KEYSPACE',
|
|
93
|
+
'KNOWN',
|
|
94
|
+
'LANGUAGE',
|
|
95
|
+
'LAST',
|
|
96
|
+
'LEFT',
|
|
97
|
+
'LET',
|
|
98
|
+
'LETTING',
|
|
99
|
+
'LIKE',
|
|
100
|
+
'LIMIT',
|
|
101
|
+
'LSM',
|
|
102
|
+
'MAP',
|
|
103
|
+
'MAPPING',
|
|
104
|
+
'MATCHED',
|
|
105
|
+
'MATERIALIZED',
|
|
106
|
+
'MERGE',
|
|
107
|
+
'MINUS',
|
|
108
|
+
'MISSING',
|
|
109
|
+
'NAMESPACE',
|
|
110
|
+
'NEST',
|
|
111
|
+
'NL',
|
|
112
|
+
'NO',
|
|
113
|
+
'NOT',
|
|
114
|
+
'NTH_VALUE',
|
|
115
|
+
'NULL',
|
|
116
|
+
'NULLS',
|
|
117
|
+
'NUMBER',
|
|
118
|
+
'OBJECT',
|
|
119
|
+
'OFFSET',
|
|
120
|
+
'ON',
|
|
121
|
+
'OPTION',
|
|
122
|
+
'OPTIONS [1]',
|
|
123
|
+
'OR',
|
|
124
|
+
'ORDER',
|
|
125
|
+
'OTHERS',
|
|
126
|
+
'OUTER',
|
|
127
|
+
'OVER',
|
|
128
|
+
'PARSE',
|
|
129
|
+
'PARTITION',
|
|
130
|
+
'PASSWORD',
|
|
131
|
+
'PATH',
|
|
132
|
+
'POOL',
|
|
133
|
+
'PRECEDING',
|
|
134
|
+
'PREPARE',
|
|
135
|
+
'PRIMARY',
|
|
136
|
+
'PRIVATE',
|
|
137
|
+
'PRIVILEGE',
|
|
138
|
+
'PROBE',
|
|
139
|
+
'PROCEDURE',
|
|
140
|
+
'PUBLIC',
|
|
141
|
+
'RANGE',
|
|
142
|
+
'RAW',
|
|
143
|
+
'REALM',
|
|
144
|
+
'REDUCE',
|
|
145
|
+
'RENAME',
|
|
146
|
+
'RESPECT',
|
|
147
|
+
'RETURN',
|
|
148
|
+
'RETURNING',
|
|
149
|
+
'REVOKE',
|
|
150
|
+
'RIGHT',
|
|
151
|
+
'ROLE',
|
|
152
|
+
'ROLLBACK',
|
|
153
|
+
'ROW',
|
|
154
|
+
'ROWS',
|
|
155
|
+
'SATISFIES',
|
|
156
|
+
'SCHEMA',
|
|
157
|
+
'SELECT',
|
|
158
|
+
'SELF',
|
|
159
|
+
'SEMI',
|
|
160
|
+
'SET',
|
|
161
|
+
'SHOW',
|
|
162
|
+
'SOME',
|
|
163
|
+
'START',
|
|
164
|
+
'STATISTICS',
|
|
165
|
+
'STRING',
|
|
166
|
+
'SYSTEM',
|
|
167
|
+
'THEN',
|
|
168
|
+
'TIES',
|
|
169
|
+
'TO',
|
|
170
|
+
'TRANSACTION',
|
|
171
|
+
'TRIGGER',
|
|
172
|
+
'TRUE',
|
|
173
|
+
'TRUNCATE',
|
|
174
|
+
'UNBOUNDED',
|
|
175
|
+
'UNDER',
|
|
176
|
+
'UNION',
|
|
177
|
+
'UNIQUE',
|
|
178
|
+
'UNKNOWN',
|
|
179
|
+
'UNNEST',
|
|
180
|
+
'UNSET',
|
|
181
|
+
'UPDATE',
|
|
182
|
+
'UPSERT',
|
|
183
|
+
'USE',
|
|
184
|
+
'USER',
|
|
185
|
+
'USING',
|
|
186
|
+
'VALIDATE',
|
|
187
|
+
'VALUE',
|
|
188
|
+
'VALUED',
|
|
189
|
+
'VALUES',
|
|
190
|
+
'VIA',
|
|
191
|
+
'VIEW',
|
|
192
|
+
'WHEN',
|
|
193
|
+
'WHERE',
|
|
194
|
+
'WHILE',
|
|
195
|
+
'WITH',
|
|
196
|
+
'WITHIN',
|
|
197
|
+
'WORK',
|
|
198
|
+
'XOR',
|
|
199
|
+
];
|
|
200
|
+
//# sourceMappingURL=reservedWords.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reservedWords.js","sourceRoot":"","sources":["../../../src/query/helpers/reservedWords.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAa;IACvC,QAAQ;IACR,KAAK;IACL,OAAO;IACP,SAAS;IACT,KAAK;IACL,KAAK;IACL,OAAO;IACP,IAAI;IACJ,KAAK;IACL,OAAO;IACP,SAAS;IACT,QAAQ;IACR,SAAS;IACT,OAAO;IACP,QAAQ;IACR,OAAO;IACP,IAAI;IACJ,MAAM;IACN,MAAM;IACN,MAAM;IACN,SAAS;IACT,SAAS;IACT,YAAY;IACZ,QAAQ;IACR,SAAS;IACT,UAAU;IACV,YAAY;IACZ,OAAO;IACP,QAAQ;IACR,SAAS;IACT,UAAU;IACV,SAAS;IACT,WAAW;IACX,SAAS;IACT,WAAW;IACX,QAAQ;IACR,SAAS;IACT,MAAM;IACN,UAAU;IACV,UAAU;IACV,IAAI;IACJ,MAAM;IACN,MAAM;IACN,SAAS;IACT,MAAM;IACN,KAAK;IACL,OAAO;IACP,QAAQ;IACR,SAAS;IACT,SAAS;IACT,QAAQ;IACR,SAAS;IACT,OAAO;IACP,OAAO;IACP,OAAO;IACP,SAAS;IACT,WAAW;IACX,KAAK;IACL,OAAO;IACP,MAAM;IACN,KAAK;IACL,UAAU;IACV,QAAQ;IACR,OAAO;IACP,OAAO;IACP,QAAQ;IACR,KAAK;IACL,MAAM;IACN,QAAQ;IACR,IAAI;IACJ,QAAQ;IACR,OAAO;IACP,IAAI;IACJ,SAAS;IACT,WAAW;IACX,OAAO;IACP,OAAO;IACP,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,WAAW;IACX,MAAM;IACN,IAAI;IACJ,YAAY;IACZ,MAAM;IACN,KAAK;IACL,MAAM;IACN,UAAU;IACV,OAAO;IACP,UAAU;IACV,MAAM;IACN,MAAM;IACN,KAAK;IACL,SAAS;IACT,MAAM;IACN,OAAO;IACP,KAAK;IACL,KAAK;IACL,SAAS;IACT,SAAS;IACT,cAAc;IACd,OAAO;IACP,OAAO;IACP,SAAS;IACT,WAAW;IACX,MAAM;IACN,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,WAAW;IACX,MAAM;IACN,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,IAAI;IACJ,QAAQ;IACR,aAAa;IACb,IAAI;IACJ,OAAO;IACP,QAAQ;IACR,OAAO;IACP,MAAM;IACN,OAAO;IACP,WAAW;IACX,UAAU;IACV,MAAM;IACN,MAAM;IACN,WAAW;IACX,SAAS;IACT,SAAS;IACT,SAAS;IACT,WAAW;IACX,OAAO;IACP,WAAW;IACX,QAAQ;IACR,OAAO;IACP,KAAK;IACL,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,WAAW;IACX,QAAQ;IACR,OAAO;IACP,MAAM;IACN,UAAU;IACV,KAAK;IACL,MAAM;IACN,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,MAAM;IACN,KAAK;IACL,MAAM;IACN,MAAM;IACN,OAAO;IACP,YAAY;IACZ,QAAQ;IACR,QAAQ;IACR,MAAM;IACN,MAAM;IACN,IAAI;IACJ,aAAa;IACb,SAAS;IACT,MAAM;IACN,UAAU;IACV,WAAW;IACX,OAAO;IACP,OAAO;IACP,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,KAAK;IACL,MAAM;IACN,OAAO;IACP,UAAU;IACV,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,KAAK;IACL,MAAM;IACN,MAAM;IACN,OAAO;IACP,OAAO;IACP,MAAM;IACN,QAAQ;IACR,MAAM;IACN,KAAK;CACR,CAAC","sourcesContent":["export const n1qlReservedWords: string[] = [\n 'ADVISE',\n 'ALL',\n 'ALTER',\n 'ANALYZE',\n 'AND',\n 'ANY',\n 'ARRAY',\n 'AS',\n 'ASC',\n 'BEGIN',\n 'BETWEEN',\n 'BINARY',\n 'BOOLEAN',\n 'BREAK',\n 'BUCKET',\n 'BUILD',\n 'BY',\n 'CALL',\n 'CASE',\n 'CAST',\n 'CLUSTER',\n 'COLLATE',\n 'COLLECTION',\n 'COMMIT',\n 'CONNECT',\n 'CONTINUE',\n 'CORRELATED',\n 'COVER',\n 'CREATE',\n 'CURRENT',\n 'DATABASE',\n 'DATASET',\n 'DATASTORE',\n 'DECLARE',\n 'DECREMENT',\n 'DELETE',\n 'DERIVED',\n 'DESC',\n 'DESCRIBE',\n 'DISTINCT',\n 'DO',\n 'DROP',\n 'EACH',\n 'ELEMENT',\n 'ELSE',\n 'END',\n 'EVERY',\n 'EXCEPT',\n 'EXCLUDE',\n 'EXECUTE',\n 'EXISTS',\n 'EXPLAIN',\n 'FALSE',\n 'FETCH',\n 'FIRST',\n 'FLATTEN',\n 'FOLLOWING',\n 'FOR',\n 'FORCE',\n 'FROM',\n 'FTS',\n 'FUNCTION',\n 'GOLANG',\n 'GRANT',\n 'GROUP',\n 'GROUPS',\n 'GSI',\n 'HASH',\n 'HAVING',\n 'IF',\n 'IGNORE',\n 'ILIKE',\n 'IN',\n 'INCLUDE',\n 'INCREMENT',\n 'INDEX',\n 'INFER',\n 'INLINE',\n 'INNER',\n 'INSERT',\n 'INTERSECT',\n 'INTO',\n 'IS',\n 'JAVASCRIPT',\n 'JOIN',\n 'KEY',\n 'KEYS',\n 'KEYSPACE',\n 'KNOWN',\n 'LANGUAGE',\n 'LAST',\n 'LEFT',\n 'LET',\n 'LETTING',\n 'LIKE',\n 'LIMIT',\n 'LSM',\n 'MAP',\n 'MAPPING',\n 'MATCHED',\n 'MATERIALIZED',\n 'MERGE',\n 'MINUS',\n 'MISSING',\n 'NAMESPACE',\n 'NEST',\n 'NL',\n 'NO',\n 'NOT',\n 'NTH_VALUE',\n 'NULL',\n 'NULLS',\n 'NUMBER',\n 'OBJECT',\n 'OFFSET',\n 'ON',\n 'OPTION',\n 'OPTIONS [1]',\n 'OR',\n 'ORDER',\n 'OTHERS',\n 'OUTER',\n 'OVER',\n 'PARSE',\n 'PARTITION',\n 'PASSWORD',\n 'PATH',\n 'POOL',\n 'PRECEDING',\n 'PREPARE',\n 'PRIMARY',\n 'PRIVATE',\n 'PRIVILEGE',\n 'PROBE',\n 'PROCEDURE',\n 'PUBLIC',\n 'RANGE',\n 'RAW',\n 'REALM',\n 'REDUCE',\n 'RENAME',\n 'RESPECT',\n 'RETURN',\n 'RETURNING',\n 'REVOKE',\n 'RIGHT',\n 'ROLE',\n 'ROLLBACK',\n 'ROW',\n 'ROWS',\n 'SATISFIES',\n 'SCHEMA',\n 'SELECT',\n 'SELF',\n 'SEMI',\n 'SET',\n 'SHOW',\n 'SOME',\n 'START',\n 'STATISTICS',\n 'STRING',\n 'SYSTEM',\n 'THEN',\n 'TIES',\n 'TO',\n 'TRANSACTION',\n 'TRIGGER',\n 'TRUE',\n 'TRUNCATE',\n 'UNBOUNDED',\n 'UNDER',\n 'UNION',\n 'UNIQUE',\n 'UNKNOWN',\n 'UNNEST',\n 'UNSET',\n 'UPDATE',\n 'UPSERT',\n 'USE',\n 'USER',\n 'USING',\n 'VALIDATE',\n 'VALUE',\n 'VALUED',\n 'VALUES',\n 'VIA',\n 'VIEW',\n 'WHEN',\n 'WHERE',\n 'WHILE',\n 'WITH',\n 'WITHIN',\n 'WORK',\n 'XOR',\n];\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { selectBuilder, buildSelectExpr, buildWhereClauseExpr, buildIndexExpr, buildSelectArrayExpr, AggDict, ResultExprDict, ReturnResultDict, } from './helpers';
|
|
2
|
+
export { SelectClauseException, MultipleQueryTypesException, WhereClauseException, QueryOperatorNotFoundException, IndexParamsUsingGSIExceptions, InWithinOperatorExceptions, QueryGroupByParamsException, IndexParamsOnExceptions, } from './exceptions';
|
|
3
|
+
export { QueryBuilder } from './query';
|
|
4
|
+
export { ILetExpr, SortType, ISelectType, LogicalWhereExpr, ComparisonWhereExpr, IField, IIndexOnParams, IIndexWithParams, IndexType, ISelectAggType, AggType, ComparisonEmptyOperatorType, ComparisonMultipleOperatorType, ComparisonSingleStringOperatorType, ComparisonSingleOperatorType, LogicalOperatorType, ResultExprType, ReturnResultType, } from './interface/query.types';
|
|
5
|
+
export { parseStringSelectExpr, escapeReservedWords } from './utils';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.escapeReservedWords = exports.parseStringSelectExpr = exports.QueryBuilder = exports.IndexParamsOnExceptions = exports.QueryGroupByParamsException = exports.InWithinOperatorExceptions = exports.IndexParamsUsingGSIExceptions = exports.QueryOperatorNotFoundException = exports.WhereClauseException = exports.MultipleQueryTypesException = exports.SelectClauseException = exports.ReturnResultDict = exports.ResultExprDict = exports.AggDict = exports.buildSelectArrayExpr = exports.buildIndexExpr = exports.buildWhereClauseExpr = exports.buildSelectExpr = exports.selectBuilder = void 0;
|
|
4
|
+
var helpers_1 = require("./helpers");
|
|
5
|
+
Object.defineProperty(exports, "selectBuilder", { enumerable: true, get: function () { return helpers_1.selectBuilder; } });
|
|
6
|
+
Object.defineProperty(exports, "buildSelectExpr", { enumerable: true, get: function () { return helpers_1.buildSelectExpr; } });
|
|
7
|
+
Object.defineProperty(exports, "buildWhereClauseExpr", { enumerable: true, get: function () { return helpers_1.buildWhereClauseExpr; } });
|
|
8
|
+
Object.defineProperty(exports, "buildIndexExpr", { enumerable: true, get: function () { return helpers_1.buildIndexExpr; } });
|
|
9
|
+
Object.defineProperty(exports, "buildSelectArrayExpr", { enumerable: true, get: function () { return helpers_1.buildSelectArrayExpr; } });
|
|
10
|
+
Object.defineProperty(exports, "AggDict", { enumerable: true, get: function () { return helpers_1.AggDict; } });
|
|
11
|
+
Object.defineProperty(exports, "ResultExprDict", { enumerable: true, get: function () { return helpers_1.ResultExprDict; } });
|
|
12
|
+
Object.defineProperty(exports, "ReturnResultDict", { enumerable: true, get: function () { return helpers_1.ReturnResultDict; } });
|
|
13
|
+
var exceptions_1 = require("./exceptions");
|
|
14
|
+
Object.defineProperty(exports, "SelectClauseException", { enumerable: true, get: function () { return exceptions_1.SelectClauseException; } });
|
|
15
|
+
Object.defineProperty(exports, "MultipleQueryTypesException", { enumerable: true, get: function () { return exceptions_1.MultipleQueryTypesException; } });
|
|
16
|
+
Object.defineProperty(exports, "WhereClauseException", { enumerable: true, get: function () { return exceptions_1.WhereClauseException; } });
|
|
17
|
+
Object.defineProperty(exports, "QueryOperatorNotFoundException", { enumerable: true, get: function () { return exceptions_1.QueryOperatorNotFoundException; } });
|
|
18
|
+
Object.defineProperty(exports, "IndexParamsUsingGSIExceptions", { enumerable: true, get: function () { return exceptions_1.IndexParamsUsingGSIExceptions; } });
|
|
19
|
+
Object.defineProperty(exports, "InWithinOperatorExceptions", { enumerable: true, get: function () { return exceptions_1.InWithinOperatorExceptions; } });
|
|
20
|
+
Object.defineProperty(exports, "QueryGroupByParamsException", { enumerable: true, get: function () { return exceptions_1.QueryGroupByParamsException; } });
|
|
21
|
+
Object.defineProperty(exports, "IndexParamsOnExceptions", { enumerable: true, get: function () { return exceptions_1.IndexParamsOnExceptions; } });
|
|
22
|
+
var query_1 = require("./query");
|
|
23
|
+
Object.defineProperty(exports, "QueryBuilder", { enumerable: true, get: function () { return query_1.QueryBuilder; } });
|
|
24
|
+
var utils_1 = require("./utils");
|
|
25
|
+
Object.defineProperty(exports, "parseStringSelectExpr", { enumerable: true, get: function () { return utils_1.parseStringSelectExpr; } });
|
|
26
|
+
Object.defineProperty(exports, "escapeReservedWords", { enumerable: true, get: function () { return utils_1.escapeReservedWords; } });
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/query/index.ts"],"names":[],"mappings":";;;AAAA,qCASmB;AARf,wGAAA,aAAa,OAAA;AACb,0GAAA,eAAe,OAAA;AACf,+GAAA,oBAAoB,OAAA;AACpB,yGAAA,cAAc,OAAA;AACd,+GAAA,oBAAoB,OAAA;AACpB,kGAAA,OAAO,OAAA;AACP,yGAAA,cAAc,OAAA;AACd,2GAAA,gBAAgB,OAAA;AAEpB,2CASsB;AARlB,mHAAA,qBAAqB,OAAA;AACrB,yHAAA,2BAA2B,OAAA;AAC3B,kHAAA,oBAAoB,OAAA;AACpB,4HAAA,8BAA8B,OAAA;AAC9B,2HAAA,6BAA6B,OAAA;AAC7B,wHAAA,0BAA0B,OAAA;AAC1B,yHAAA,2BAA2B,OAAA;AAC3B,qHAAA,uBAAuB,OAAA;AAE3B,iCAAqC;AAA7B,qGAAA,YAAY,OAAA;AAqBpB,iCAAmE;AAA3D,8GAAA,qBAAqB,OAAA;AAAE,4GAAA,mBAAmB,OAAA","sourcesContent":["export {\n selectBuilder,\n buildSelectExpr,\n buildWhereClauseExpr,\n buildIndexExpr,\n buildSelectArrayExpr,\n AggDict,\n ResultExprDict,\n ReturnResultDict,\n} from './helpers';\nexport {\n SelectClauseException,\n MultipleQueryTypesException,\n WhereClauseException,\n QueryOperatorNotFoundException,\n IndexParamsUsingGSIExceptions,\n InWithinOperatorExceptions,\n QueryGroupByParamsException,\n IndexParamsOnExceptions,\n} from './exceptions';\nexport {QueryBuilder} from './query';\nexport {\n ILetExpr,\n SortType,\n ISelectType,\n LogicalWhereExpr,\n ComparisonWhereExpr,\n IField,\n IIndexOnParams,\n IIndexWithParams,\n IndexType,\n ISelectAggType,\n AggType,\n ComparisonEmptyOperatorType,\n ComparisonMultipleOperatorType,\n ComparisonSingleStringOperatorType,\n ComparisonSingleOperatorType,\n LogicalOperatorType,\n ResultExprType,\n ReturnResultType,\n} from './interface/query.types';\nexport {parseStringSelectExpr, escapeReservedWords} from './utils';\n"]}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
export declare type SortType = 'ASC' | 'DESC';
|
|
2
|
+
/**
|
|
3
|
+
* Result expressions ALL | DISTINCT
|
|
4
|
+
* */
|
|
5
|
+
export declare type ReturnResultType = '$all' | '$distinct';
|
|
6
|
+
/**
|
|
7
|
+
* Result expressions RAW | ELEMENT | VALUE
|
|
8
|
+
* */
|
|
9
|
+
export declare type ResultExprType = '$raw' | '$element' | '$value';
|
|
10
|
+
/**
|
|
11
|
+
* List of aggregation functions.
|
|
12
|
+
* */
|
|
13
|
+
export declare type AggType = '$arrayAgg' | '$avg' | '$mean' | '$count' | '$countn' | '$max' | '$median' | '$min' | '$stddev' | '$stddevPop' | '$stddevSamp' | '$sum' | '$variance' | '$variancePop' | '$varianceSamp' | '$varPop' | '$varSamp';
|
|
14
|
+
/**
|
|
15
|
+
* List of Boolean comparison operators.
|
|
16
|
+
* */
|
|
17
|
+
export declare type ComparisonEmptyOperatorType = '$isNull' | '$isNotNull' | '$isMissing' | '$isNotMissing' | '$isValued' | '$isNotValued';
|
|
18
|
+
/**
|
|
19
|
+
* List of Numeric comparison operators.
|
|
20
|
+
* */
|
|
21
|
+
export declare type ComparisonSingleOperatorType = '$eq' | '$neq' | '$gt' | '$gte' | '$lt' | '$lte';
|
|
22
|
+
/**
|
|
23
|
+
* List of String comparison operators.
|
|
24
|
+
* */
|
|
25
|
+
export declare type ComparisonSingleStringOperatorType = '$like' | '$notLike';
|
|
26
|
+
/**
|
|
27
|
+
* List of Range comparison operators.
|
|
28
|
+
* */
|
|
29
|
+
export declare type ComparisonMultipleOperatorType = '$btw' | '$notBtw';
|
|
30
|
+
/**
|
|
31
|
+
* List of Logical operators.
|
|
32
|
+
* */
|
|
33
|
+
export declare type LogicalOperatorType = '$and' | '$or' | '$not';
|
|
34
|
+
/**
|
|
35
|
+
* Collection Select Operator.
|
|
36
|
+
* */
|
|
37
|
+
export declare type CollectionSelectOperator = '$any' | '$every';
|
|
38
|
+
/**
|
|
39
|
+
* Collection IN and WITHIN Operators.
|
|
40
|
+
* */
|
|
41
|
+
export declare type CollectionInWithinOperator = '$in' | '$within';
|
|
42
|
+
/**
|
|
43
|
+
* List of Collection IN and WITHIN Operators.
|
|
44
|
+
* */
|
|
45
|
+
export declare type CollectionSatisfiesOperator = '$satisfies';
|
|
46
|
+
export interface CollectionInWithinOperatorValue {
|
|
47
|
+
search_expr: unknown;
|
|
48
|
+
target_expr: unknown;
|
|
49
|
+
$not?: boolean;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Structure of the collection in within operator
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```
|
|
56
|
+
* {$in:{search_expr: 'search', target_expr: 'address', $not: true}}
|
|
57
|
+
* ```
|
|
58
|
+
* */
|
|
59
|
+
export declare type CollectionInWithinOperatorType = {
|
|
60
|
+
[key in CollectionInWithinOperator]?: CollectionInWithinOperatorValue;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Structure of the collection expression
|
|
64
|
+
*
|
|
65
|
+
* */
|
|
66
|
+
export interface CollectionExpressionType {
|
|
67
|
+
$expr: CollectionInWithinOperatorType[];
|
|
68
|
+
$satisfied: FieldWhereExpr;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Structure of the collection in within operator
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```
|
|
75
|
+
* {$any: {$expr: [{$in:{search_expr: 'search', target_expr: 'address', $not: true} }], $satisfied:{address: '10'}}}
|
|
76
|
+
* ```
|
|
77
|
+
* */
|
|
78
|
+
export declare type CollectionSelectOperatorType = {
|
|
79
|
+
[key in CollectionSelectOperator]?: CollectionExpressionType;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Structure of the comparison operators.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```
|
|
86
|
+
* {operator: value} -> e.g { $like: '%ottoman%'}
|
|
87
|
+
* ```
|
|
88
|
+
*
|
|
89
|
+
* */
|
|
90
|
+
export declare type ComparisonWhereExpr = {
|
|
91
|
+
[key in ComparisonEmptyOperatorType | ComparisonSingleOperatorType | ComparisonMultipleOperatorType | ComparisonSingleStringOperatorType]?: string | number | boolean | (number | string)[];
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Structure of WHERE field expression
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```
|
|
98
|
+
* {field: {operator: value}} -> e.g { address: {$like: '%ottoman%'}} | {$or: [{ address: {$like: '%ottoman%'}}]}
|
|
99
|
+
* ```
|
|
100
|
+
*
|
|
101
|
+
* */
|
|
102
|
+
export declare type FieldWhereExpr = Record<string, string | number | boolean | ComparisonWhereExpr> | LogicalWhereExpr;
|
|
103
|
+
/**
|
|
104
|
+
* Structure of Logical WHERE expression
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```
|
|
108
|
+
* {field: {operator: value}} -> e.g {$or: [{ address: {$like: '%ottoman%'}}]}
|
|
109
|
+
* ```
|
|
110
|
+
*
|
|
111
|
+
* */
|
|
112
|
+
export declare type LogicalWhereExpr = {
|
|
113
|
+
[key in LogicalOperatorType]?: FieldWhereExpr[];
|
|
114
|
+
} | {
|
|
115
|
+
[key: string]: FieldWhereExpr;
|
|
116
|
+
} | {
|
|
117
|
+
[key: string]: unknown;
|
|
118
|
+
} | CollectionSelectOperatorType | CollectionInWithinOperatorType;
|
|
119
|
+
/**
|
|
120
|
+
* SELECT field structure
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```
|
|
124
|
+
* e.g { name: 'address', as: 'addr'}
|
|
125
|
+
* ```
|
|
126
|
+
*
|
|
127
|
+
* */
|
|
128
|
+
export interface IField {
|
|
129
|
+
name: string;
|
|
130
|
+
as?: string;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* SELECT aggregation expression
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```
|
|
137
|
+
* {$count: {$field: {name: 'address'}, as: 'addr'}} | {$count: {$field: 'address'}}
|
|
138
|
+
* ```
|
|
139
|
+
*
|
|
140
|
+
* */
|
|
141
|
+
export declare type ISelectAggType = {
|
|
142
|
+
[key in AggType]?: ISelectFieldType;
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* SELECT field expression
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* ```
|
|
149
|
+
* {$field: {name: 'address'}, as: 'addr'}
|
|
150
|
+
* ```
|
|
151
|
+
*
|
|
152
|
+
* */
|
|
153
|
+
export interface ISelectFieldType {
|
|
154
|
+
$field: IField | string;
|
|
155
|
+
as?: string;
|
|
156
|
+
ro?: ReturnResultType;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* SELECT result expression
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* ```
|
|
163
|
+
* {$raw: {$field: {name: 'address'}, as: 'addr'}}
|
|
164
|
+
* ```
|
|
165
|
+
*
|
|
166
|
+
* */
|
|
167
|
+
export declare type ISelectResultExprType = {
|
|
168
|
+
[key in ResultExprType]?: ISelectAggType | ISelectFieldType;
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* SELECT result expression
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* ```
|
|
175
|
+
* {$all: {$field: {name: 'address'}, as: 'addr'}}
|
|
176
|
+
* ```
|
|
177
|
+
*
|
|
178
|
+
* */
|
|
179
|
+
export declare type ISelectReturnResultType = {
|
|
180
|
+
[key in ReturnResultType]?: ISelectResultExprType | ISelectAggType | ISelectFieldType;
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* SELECT expression
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* ```
|
|
187
|
+
* {$all: {$field: {name: 'address'}, as: 'addr'}, $field: 'type', $field: {name: 'count'}}
|
|
188
|
+
* ```
|
|
189
|
+
*
|
|
190
|
+
* */
|
|
191
|
+
export declare type ISelectType = ISelectReturnResultType | ISelectResultExprType | ISelectAggType | ISelectFieldType;
|
|
192
|
+
/**
|
|
193
|
+
* LET expression
|
|
194
|
+
* */
|
|
195
|
+
export interface ILetExpr {
|
|
196
|
+
key: string;
|
|
197
|
+
value: unknown;
|
|
198
|
+
}
|
|
199
|
+
export interface IGroupBy {
|
|
200
|
+
expr: string;
|
|
201
|
+
as?: string;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* List of params to build a SELECT clause
|
|
205
|
+
* */
|
|
206
|
+
export interface IConditionExpr {
|
|
207
|
+
select?: ISelectType[] | string;
|
|
208
|
+
let?: ILetExpr[];
|
|
209
|
+
where?: LogicalWhereExpr;
|
|
210
|
+
orderBy?: Record<string, SortType>;
|
|
211
|
+
limit?: number;
|
|
212
|
+
offset?: number;
|
|
213
|
+
use?: string[];
|
|
214
|
+
groupBy?: IGroupBy[];
|
|
215
|
+
letting?: ILetExpr[];
|
|
216
|
+
having?: LogicalWhereExpr;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Types of supported index statements
|
|
220
|
+
* */
|
|
221
|
+
export declare type IndexType = 'CREATE' | 'BUILD' | 'DROP' | 'CREATE PRIMARY';
|
|
222
|
+
/**
|
|
223
|
+
* Index ON clause types
|
|
224
|
+
* */
|
|
225
|
+
export interface IIndexOnParams {
|
|
226
|
+
name: string;
|
|
227
|
+
sort?: SortType;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Index WITH clause
|
|
231
|
+
* */
|
|
232
|
+
export interface IIndexWithParams {
|
|
233
|
+
nodes?: string[];
|
|
234
|
+
defer_build?: boolean;
|
|
235
|
+
num_replica?: number;
|
|
236
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.types.js","sourceRoot":"","sources":["../../../src/query/interface/query.types.ts"],"names":[],"mappings":"","sourcesContent":["export type SortType = 'ASC' | 'DESC';\n/**\n * Result expressions ALL | DISTINCT\n * */\nexport type ReturnResultType = '$all' | '$distinct';\n/**\n * Result expressions RAW | ELEMENT | VALUE\n * */\nexport type ResultExprType = '$raw' | '$element' | '$value';\n/**\n * List of aggregation functions.\n * */\nexport type AggType =\n | '$arrayAgg'\n | '$avg'\n | '$mean'\n | '$count'\n | '$countn'\n | '$max'\n | '$median'\n | '$min'\n | '$stddev'\n | '$stddevPop'\n | '$stddevSamp'\n | '$sum'\n | '$variance'\n | '$variancePop'\n | '$varianceSamp'\n | '$varPop'\n | '$varSamp';\n\n/**\n * List of Boolean comparison operators.\n * */\nexport type ComparisonEmptyOperatorType =\n | '$isNull'\n | '$isNotNull'\n | '$isMissing'\n | '$isNotMissing'\n | '$isValued'\n | '$isNotValued';\n/**\n * List of Numeric comparison operators.\n * */\nexport type ComparisonSingleOperatorType = '$eq' | '$neq' | '$gt' | '$gte' | '$lt' | '$lte';\n/**\n * List of String comparison operators.\n * */\nexport type ComparisonSingleStringOperatorType = '$like' | '$notLike';\n/**\n * List of Range comparison operators.\n * */\nexport type ComparisonMultipleOperatorType = '$btw' | '$notBtw';\n\n/**\n * List of Logical operators.\n * */\nexport type LogicalOperatorType = '$and' | '$or' | '$not';\n\n/**\n * Collection Select Operator.\n * */\nexport type CollectionSelectOperator = '$any' | '$every';\n\n/**\n * Collection IN and WITHIN Operators.\n * */\nexport type CollectionInWithinOperator = '$in' | '$within';\n\n/**\n * List of Collection IN and WITHIN Operators.\n * */\nexport type CollectionSatisfiesOperator = '$satisfies';\n\nexport interface CollectionInWithinOperatorValue {\n search_expr: unknown;\n target_expr: unknown;\n $not?: boolean;\n}\n\n/**\n * Structure of the collection in within operator\n *\n * @example\n * ```\n * {$in:{search_expr: 'search', target_expr: 'address', $not: true}}\n * ```\n * */\nexport type CollectionInWithinOperatorType = {\n [key in CollectionInWithinOperator]?: CollectionInWithinOperatorValue;\n};\n\n/**\n * Structure of the collection expression\n *\n * */\nexport interface CollectionExpressionType {\n $expr: CollectionInWithinOperatorType[];\n $satisfied: FieldWhereExpr;\n}\n/**\n * Structure of the collection in within operator\n *\n * @example\n * ```\n * {$any: {$expr: [{$in:{search_expr: 'search', target_expr: 'address', $not: true} }], $satisfied:{address: '10'}}}\n * ```\n * */\nexport type CollectionSelectOperatorType = {\n [key in CollectionSelectOperator]?: CollectionExpressionType;\n};\n\n/**\n * Structure of the comparison operators.\n *\n * @example\n * ```\n * {operator: value} -> e.g { $like: '%ottoman%'}\n * ```\n *\n * */\nexport type ComparisonWhereExpr = {\n [key in\n | ComparisonEmptyOperatorType\n | ComparisonSingleOperatorType\n | ComparisonMultipleOperatorType\n | ComparisonSingleStringOperatorType]?: string | number | boolean | (number | string)[];\n};\n\n/**\n * Structure of WHERE field expression\n *\n * @example\n * ```\n * {field: {operator: value}} -> e.g { address: {$like: '%ottoman%'}} | {$or: [{ address: {$like: '%ottoman%'}}]}\n * ```\n *\n * */\nexport type FieldWhereExpr =\n | Record<string, string | number | boolean | ComparisonWhereExpr>\n | LogicalWhereExpr;\n\n/**\n * Structure of Logical WHERE expression\n *\n * @example\n * ```\n * {field: {operator: value}} -> e.g {$or: [{ address: {$like: '%ottoman%'}}]}\n * ```\n *\n * */\nexport type LogicalWhereExpr =\n | {\n [key in LogicalOperatorType]?: FieldWhereExpr[];\n }\n | {\n [key: string]: FieldWhereExpr;\n }\n | {\n [key: string]: unknown;\n }\n | CollectionSelectOperatorType\n | CollectionInWithinOperatorType;\n\n/**\n * SELECT field structure\n *\n * @example\n * ```\n * e.g { name: 'address', as: 'addr'}\n * ```\n *\n * */\nexport interface IField {\n name: string;\n as?: string;\n}\n/**\n * SELECT aggregation expression\n *\n * @example\n * ```\n * {$count: {$field: {name: 'address'}, as: 'addr'}} | {$count: {$field: 'address'}}\n * ```\n *\n * */\n\nexport type ISelectAggType = {\n [key in AggType]?: ISelectFieldType;\n};\n\n/**\n * SELECT field expression\n *\n * @example\n * ```\n * {$field: {name: 'address'}, as: 'addr'}\n * ```\n *\n * */\nexport interface ISelectFieldType {\n $field: IField | string;\n as?: string;\n ro?: ReturnResultType;\n}\n\n/**\n * SELECT result expression\n *\n * @example\n * ```\n * {$raw: {$field: {name: 'address'}, as: 'addr'}}\n * ```\n *\n * */\nexport type ISelectResultExprType = {[key in ResultExprType]?: ISelectAggType | ISelectFieldType};\n\n/**\n * SELECT result expression\n *\n * @example\n * ```\n * {$all: {$field: {name: 'address'}, as: 'addr'}}\n * ```\n *\n * */\nexport type ISelectReturnResultType = {\n [key in ReturnResultType]?: ISelectResultExprType | ISelectAggType | ISelectFieldType;\n};\n\n/**\n * SELECT expression\n *\n * @example\n * ```\n * {$all: {$field: {name: 'address'}, as: 'addr'}, $field: 'type', $field: {name: 'count'}}\n * ```\n *\n * */\nexport type ISelectType =\n | ISelectReturnResultType\n | ISelectResultExprType\n | ISelectAggType\n | ISelectFieldType;\n\n/**\n * LET expression\n * */\nexport interface ILetExpr {\n key: string;\n value: unknown;\n}\n\nexport interface IGroupBy {\n expr: string;\n as?: string;\n}\n\n/**\n * List of params to build a SELECT clause\n * */\nexport interface IConditionExpr {\n select?: ISelectType[] | string;\n let?: ILetExpr[];\n where?: LogicalWhereExpr;\n orderBy?: Record<string, SortType>;\n limit?: number;\n offset?: number;\n use?: string[];\n groupBy?: IGroupBy[];\n letting?: ILetExpr[];\n having?: LogicalWhereExpr;\n}\n\n/**\n * Types of supported index statements\n * */\nexport type IndexType = 'CREATE' | 'BUILD' | 'DROP' | 'CREATE PRIMARY';\n\n/**\n * Index ON clause types\n * */\nexport interface IIndexOnParams {\n name: string;\n sort?: SortType;\n}\n\n/**\n * Index WITH clause\n * */\nexport interface IIndexWithParams {\n nodes?: string[];\n defer_build?: boolean;\n num_replica?: number;\n}\n"]}
|