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 @@
|
|
|
1
|
+
{"version":3,"file":"text.utils.js","sourceRoot":"","sources":["../../src/utils/text.utils.ts"],"names":[],"mappings":";;;;;;AAAA,2DAAqC;AACrC,+DAAyC;AACzC,2DAAqC;AAE9B,IAAM,QAAQ,GAAG,UAAC,IAAS;IAC9B,IAAI,IAAA,iBAAO,EAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;QACxB,OAAO,IAAI,CAAC;KACf;IAED,IAAI;QACA,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;YAC1B,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;SAC3B;QACD,OAAO,IAAI,CAAC;KACf;IAAC,OAAO,KAAK,EAAE;QACZ,sDAAsD;QACtD,OAAO,IAAI,CAAC;KACf;AACL,CAAC,CAAC;AAdW,QAAA,QAAQ,YAcnB;AAEF;;;;GAIG;AACH,SAAgB,OAAO,CAAC,GAAW;IAC/B,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,+DAA+D;AACtH,CAAC;AAFD,0BAEC;AAED;;;;GAIG;AACI,IAAM,YAAY,GAAG,UAAC,GAAW;IACpC,OAAO,IAAA,iBAAO,EAAC,IAAA,mBAAS,EAAC,GAAG,CAAC,CAAC,CAAC;AACnC,CAAC,CAAC;AAFW,QAAA,YAAY,gBAEvB;AAEF,kBAAe,gBAAQ,CAAC","sourcesContent":["import isEmpty from 'lodash/isEmpty';\nimport snakeCase from 'lodash/snakeCase';\nimport toUpper from 'lodash/toUpper';\n\nexport const JSONDATA = (data: any): Record<string, any> | string | null => {\n if (isEmpty(data) || !data) {\n return null;\n }\n\n try {\n if (typeof data !== 'object') {\n return JSON.parse(data);\n }\n return data;\n } catch (error) {\n // console.log('error trying to parse response data');\n return data;\n }\n};\n\n/**\n * CapitalizeFirstLetter\n * @param txt\n * @returns\n */\nexport function capText(txt: string): string {\n return txt.charAt(0).toUpperCase() + txt.slice(1); //or if you want lowercase the rest txt.slice(1).toLowerCase();\n}\n\n/**\n * To Snake case and in upper case\n * @param txt\n * @returns\n */\nexport const toSnakeUpper = (txt: string): string => {\n return toUpper(snakeCase(txt));\n};\n\nexport default JSONDATA;\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseSchema = void 0;
|
|
4
|
+
var parseValue = function (fieldType, value) {
|
|
5
|
+
switch (fieldType) {
|
|
6
|
+
case 'date':
|
|
7
|
+
return new Date(value);
|
|
8
|
+
default:
|
|
9
|
+
return value;
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Convert date strings to data objects
|
|
14
|
+
* @param data
|
|
15
|
+
*/
|
|
16
|
+
var parseSchema = function (schema, iItem) {
|
|
17
|
+
// Get all schema types and parse with data
|
|
18
|
+
var keys = Object.keys(iItem);
|
|
19
|
+
var finalObject = {};
|
|
20
|
+
keys.forEach(function (xField) {
|
|
21
|
+
// check if xField exists
|
|
22
|
+
var xFieldExistsInSchema = schema[xField];
|
|
23
|
+
if (xFieldExistsInSchema) {
|
|
24
|
+
finalObject[xField] = parseValue(xFieldExistsInSchema, iItem[xField]);
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
finalObject[xField] = iItem[xField];
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
return finalObject;
|
|
31
|
+
};
|
|
32
|
+
exports.parseSchema = parseSchema;
|
|
33
|
+
//# sourceMappingURL=utils.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.schema.js","sourceRoot":"","sources":["../../src/utils/utils.schema.ts"],"names":[],"mappings":";;;AAEA,IAAM,UAAU,GAAG,UAAC,SAAsB,EAAE,KAAU;IAClD,QAAQ,SAAS,EAAE;QACf,KAAK,MAAM;YACP,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;QAC3B;YACI,OAAO,KAAK,CAAC;KACpB;AACL,CAAC,CAAC;AAEF;;;GAGG;AACI,IAAM,WAAW,GAAG,UAAC,MAAW,EAAE,KAAU;IAC/C,2CAA2C;IAC3C,IAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAEhC,IAAM,WAAW,GAAG,EAAE,CAAC;IAEvB,IAAI,CAAC,OAAO,CAAC,UAAC,MAAM;QAChB,yBAAyB;QACzB,IAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;QAE5C,IAAI,oBAAoB,EAAE;YACtB,WAAW,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC,oBAAoB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;SACzE;aAAM;YACH,WAAW,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;SACvC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,WAAW,CAAC;AACvB,CAAC,CAAC;AAlBW,QAAA,WAAW,eAkBtB","sourcesContent":["export type SchemaTypes = 'string' | 'number' | 'date' | 'object';\n\nconst parseValue = (fieldType: SchemaTypes, value: any): any => {\n switch (fieldType) {\n case 'date':\n return new Date(value);\n default:\n return value;\n }\n};\n\n/**\n * Convert date strings to data objects\n * @param data\n */\nexport const parseSchema = (schema: any, iItem: any): any => {\n // Get all schema types and parse with data\n const keys = Object.keys(iItem);\n\n const finalObject = {};\n\n keys.forEach((xField) => {\n // check if xField exists\n const xFieldExistsInSchema = schema[xField];\n\n if (xFieldExistsInSchema) {\n finalObject[xField] = parseValue(xFieldExistsInSchema, iItem[xField]);\n } else {\n finalObject[xField] = iItem[xField];\n }\n });\n\n return finalObject;\n};\n"]}
|
package/dist/uuid.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const generateUUID: () => string;
|
package/dist/uuid.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateUUID = void 0;
|
|
4
|
+
var uuid_1 = require("uuid");
|
|
5
|
+
var generateUUID = function () {
|
|
6
|
+
return (0, uuid_1.v4)();
|
|
7
|
+
};
|
|
8
|
+
exports.generateUUID = generateUUID;
|
|
9
|
+
//# sourceMappingURL=uuid.js.map
|
package/dist/uuid.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uuid.js","sourceRoot":"","sources":["../src/uuid.ts"],"names":[],"mappings":";;;AAAA,6BAAkC;AAE3B,IAAM,YAAY,GAAG;IACxB,OAAO,IAAA,SAAM,GAAE,CAAC;AACpB,CAAC,CAAC;AAFW,QAAA,YAAY,gBAEvB","sourcesContent":["import {v4 as uuidv4} from 'uuid';\n\nexport const generateUUID = (): string => {\n return uuidv4();\n};\n"]}
|
package/docs/couch.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,32 +1,110 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
2
|
+
"name": "couchset",
|
|
3
|
+
"version": "0.0.5",
|
|
4
|
+
"description": "Couchbase ORM & Automatic GraphQL API(Resolver/Queries)",
|
|
5
|
+
"private": false,
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"docs/",
|
|
10
|
+
"dist/",
|
|
11
|
+
"register/",
|
|
12
|
+
"LICENSE"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"lint": "tslint \"src/**/*.ts\" --project tsconfig.json",
|
|
16
|
+
"build": "rimraf dist && ./node_modules/.bin/tsc --skipLibCheck",
|
|
17
|
+
"test": "mocha src/*test.ts --exit",
|
|
18
|
+
"prepublishOnly": "npm run build",
|
|
19
|
+
"eslint": "eslint ./src --fix --ext=ts"
|
|
20
|
+
},
|
|
21
|
+
"lint-staged": {
|
|
22
|
+
"*.{ts,tsx}": [
|
|
23
|
+
"npm run eslint"
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
"husky": {
|
|
27
|
+
"hooks": {
|
|
28
|
+
"pre-commit": "lint-staged"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=4.2.0"
|
|
33
|
+
},
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "git+https://github.com/couchset/couchset.git"
|
|
37
|
+
},
|
|
38
|
+
"keywords": [
|
|
39
|
+
"couchbase",
|
|
40
|
+
"couchset",
|
|
41
|
+
"database",
|
|
42
|
+
"nosql",
|
|
43
|
+
"sql",
|
|
44
|
+
"data",
|
|
45
|
+
"migrations",
|
|
46
|
+
"mongodb",
|
|
47
|
+
"orm",
|
|
48
|
+
"mongoose",
|
|
49
|
+
"redis"
|
|
50
|
+
],
|
|
51
|
+
"author": {
|
|
52
|
+
"name": "Ceddy Muhoza",
|
|
53
|
+
"email": "ceddymuhoza@gmail.com",
|
|
54
|
+
"url": "https://ceddy.org"
|
|
55
|
+
},
|
|
56
|
+
"license": "MIT",
|
|
57
|
+
"bugs": {
|
|
58
|
+
"url": "https://github.com/couchset/couchset/issues"
|
|
59
|
+
},
|
|
60
|
+
"homepage": "https://github.com/couchset/couchset#readme",
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@types/chai": "^4.2.14",
|
|
63
|
+
"@types/couchbase": "^2.4.4",
|
|
64
|
+
"@types/debug": "^4.1.7",
|
|
65
|
+
"@types/express": "^4.17.13",
|
|
66
|
+
"@types/lodash": "^4.14.168",
|
|
67
|
+
"@types/mocha": "^8.2.0",
|
|
68
|
+
"@types/node": "^10.0.3",
|
|
69
|
+
"@types/source-map-support": "^0.4.0",
|
|
70
|
+
"@types/uuid": "^8.3.0",
|
|
71
|
+
"@typescript-eslint/eslint-plugin": "^3.4.0",
|
|
72
|
+
"@typescript-eslint/parser": "^3.4.0",
|
|
73
|
+
"chai": "^4.2.0",
|
|
74
|
+
"eslint": "^6.8.0",
|
|
75
|
+
"eslint-config-prettier": "^6.11.0",
|
|
76
|
+
"eslint-loader": "^4.0.2",
|
|
77
|
+
"eslint-plugin-import": "^2.20.2",
|
|
78
|
+
"eslint-plugin-json": "^2.1.1",
|
|
79
|
+
"eslint-plugin-prettier": "^3.1.4",
|
|
80
|
+
"eslint-plugin-simple-import-sort": "^5.0.2",
|
|
81
|
+
"eslint-plugin-typescript": "^0.14.0",
|
|
82
|
+
"husky": "^4.2.5",
|
|
83
|
+
"lint-staged": "^10.1.7",
|
|
84
|
+
"mocha": "^8.2.1",
|
|
85
|
+
"prettier": "^2.0.5",
|
|
86
|
+
"reflect-metadata": "^0.1.13",
|
|
87
|
+
"rimraf": "^2.5.4",
|
|
88
|
+
"ts-node": "^9.1.1",
|
|
89
|
+
"tslint": "^5.11.0",
|
|
90
|
+
"tslint-config-standard": "^8.0.1",
|
|
91
|
+
"typescript": "^4.4.3"
|
|
92
|
+
},
|
|
93
|
+
"peerDependencies": {
|
|
94
|
+
"typescript": ">=2.0"
|
|
95
|
+
},
|
|
96
|
+
"dependencies": {
|
|
97
|
+
"couchbase": "^3.2.1",
|
|
98
|
+
"debug": "^4.3.1",
|
|
99
|
+
"dotenv": "^10.0.0",
|
|
100
|
+
"graphql": "^15.6.0",
|
|
101
|
+
"graphql-redis-subscriptions": "^2.4.0",
|
|
102
|
+
"graphql-tag": "^2.12.5",
|
|
103
|
+
"graphql-type-json": "^0.3.2",
|
|
104
|
+
"jsonwebtoken": "^8.5.1",
|
|
105
|
+
"lodash": "^4.17.20",
|
|
106
|
+
"ts-morph": "^12.0.0",
|
|
107
|
+
"type-graphql": "^1.1.1",
|
|
108
|
+
"uuid": "^8.3.2"
|
|
109
|
+
}
|
|
32
110
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../').register()
|