emberflow 1.0.8
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 +40 -0
- package/lib/db-structure.d.ts +7 -0
- package/lib/db-structure.js +67 -0
- package/lib/db-structure.js.map +1 -0
- package/lib/index-utils.d.ts +20 -0
- package/lib/index-utils.js +324 -0
- package/lib/index-utils.js.map +1 -0
- package/lib/index.d.ts +23 -0
- package/lib/index.js +197 -0
- package/lib/index.js.map +1 -0
- package/lib/init-db-structure.d.ts +17 -0
- package/lib/init-db-structure.js +111 -0
- package/lib/init-db-structure.js.map +1 -0
- package/lib/logics/index.d.ts +2 -0
- package/lib/logics/index.js +77 -0
- package/lib/logics/index.js.map +1 -0
- package/lib/logics/view-logics.d.ts +3 -0
- package/lib/logics/view-logics.js +167 -0
- package/lib/logics/view-logics.js.map +1 -0
- package/lib/sample-custom/business-logics.d.ts +3 -0
- package/lib/sample-custom/business-logics.js +67 -0
- package/lib/sample-custom/business-logics.js.map +1 -0
- package/lib/sample-custom/db-structure.d.ts +29 -0
- package/lib/sample-custom/db-structure.js +36 -0
- package/lib/sample-custom/db-structure.js.map +1 -0
- package/lib/sample-custom/security.d.ts +2 -0
- package/lib/sample-custom/security.js +63 -0
- package/lib/sample-custom/security.js.map +1 -0
- package/lib/sample-custom/validators.d.ts +9 -0
- package/lib/sample-custom/validators.js +42 -0
- package/lib/sample-custom/validators.js.map +1 -0
- package/lib/tests/index-utils.test.d.ts +1 -0
- package/lib/tests/index-utils.test.js +600 -0
- package/lib/tests/index-utils.test.js.map +1 -0
- package/lib/tests/index.test.d.ts +1 -0
- package/lib/tests/index.test.js +496 -0
- package/lib/tests/index.test.js.map +1 -0
- package/lib/tests/init-db-structure.test.d.ts +1 -0
- package/lib/tests/init-db-structure.test.js +114 -0
- package/lib/tests/init-db-structure.test.js.map +1 -0
- package/lib/tests/logics/index.test.d.ts +1 -0
- package/lib/tests/logics/index.test.js +127 -0
- package/lib/tests/logics/index.test.js.map +1 -0
- package/lib/tests/logics/view-logics.test.d.ts +1 -0
- package/lib/tests/logics/view-logics.test.js +211 -0
- package/lib/tests/logics/view-logics.test.js.map +1 -0
- package/lib/tests/utils/misc.test.d.ts +1 -0
- package/lib/tests/utils/misc.test.js +31 -0
- package/lib/tests/utils/misc.test.js.map +1 -0
- package/lib/tests/utils/paths.test.d.ts +1 -0
- package/lib/tests/utils/paths.test.js +258 -0
- package/lib/tests/utils/paths.test.js.map +1 -0
- package/lib/tests/utils/query.test.d.ts +1 -0
- package/lib/tests/utils/query.test.js +72 -0
- package/lib/tests/utils/query.test.js.map +1 -0
- package/lib/tests/utils/sample.test.d.ts +1 -0
- package/lib/tests/utils/sample.test.js +52 -0
- package/lib/tests/utils/sample.test.js.map +1 -0
- package/lib/types.d.ts +78 -0
- package/lib/types.js +3 -0
- package/lib/types.js.map +1 -0
- package/lib/utils/db-structure.d.ts +2 -0
- package/lib/utils/db-structure.js +9 -0
- package/lib/utils/db-structure.js.map +1 -0
- package/lib/utils/misc.d.ts +1 -0
- package/lib/utils/misc.js +53 -0
- package/lib/utils/misc.js.map +1 -0
- package/lib/utils/paths.d.ts +16 -0
- package/lib/utils/paths.js +136 -0
- package/lib/utils/paths.js.map +1 -0
- package/lib/utils/query.d.ts +2 -0
- package/lib/utils/query.js +41 -0
- package/lib/utils/query.js.map +1 -0
- package/lib/utils/sample.d.ts +5 -0
- package/lib/utils/sample.js +37 -0
- package/lib/utils/sample.js.map +1 -0
- package/lib/utils.d.ts +12 -0
- package/lib/utils.js +67 -0
- package/lib/utils.js.map +1 -0
- package/package.json +37 -0
- package/src/sample-custom/business-logics.ts +51 -0
- package/src/sample-custom/db-structure.ts +33 -0
- package/src/sample-custom/security.ts +77 -0
- package/src/sample-custom/validators.ts +46 -0
|
@@ -0,0 +1,67 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.logics = void 0;
|
|
27
|
+
const admin = __importStar(require("firebase-admin"));
|
|
28
|
+
const echoLogic = async (action) => {
|
|
29
|
+
const { document, timeCreated, path, modifiedFields } = action;
|
|
30
|
+
console.log(`Executing EchoLogic on document at ${path}...`);
|
|
31
|
+
const updatedDoc = {};
|
|
32
|
+
// Copy modified fields of document's @form to the document
|
|
33
|
+
if (document["@form"] && modifiedFields) {
|
|
34
|
+
for (const field of modifiedFields) {
|
|
35
|
+
if (document["@form"][field]) {
|
|
36
|
+
updatedDoc[field] = document["@form"][field];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
// Return the result of the logic function
|
|
41
|
+
return {
|
|
42
|
+
name: "EchoLogic",
|
|
43
|
+
status: "finished",
|
|
44
|
+
execTime: Date.now() - timeCreated.toMillis(),
|
|
45
|
+
timeFinished: admin.firestore.Timestamp.now(),
|
|
46
|
+
documents: [
|
|
47
|
+
{
|
|
48
|
+
action: "merge",
|
|
49
|
+
dstPath: path,
|
|
50
|
+
doc: updatedDoc,
|
|
51
|
+
instructions: {},
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
const logics = [
|
|
57
|
+
{
|
|
58
|
+
name: "EchoLogic",
|
|
59
|
+
actionTypes: ["create", "update"],
|
|
60
|
+
modifiedFields: "all",
|
|
61
|
+
entities: "all",
|
|
62
|
+
logicFn: echoLogic,
|
|
63
|
+
},
|
|
64
|
+
// more logics here
|
|
65
|
+
];
|
|
66
|
+
exports.logics = logics;
|
|
67
|
+
//# sourceMappingURL=business-logics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"business-logics.js","sourceRoot":"","sources":["../../src/sample-custom/business-logics.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAAwC;AAMxC,MAAM,SAAS,GAAY,KAAK,EAAE,MAAM,EAAE,EAAE;IAC1C,MAAM,EAAC,QAAQ,EAAE,WAAW,EAAE,IAAI,EAAE,cAAc,EAAC,GAAG,MAAM,CAAC;IAC7D,OAAO,CAAC,GAAG,CAAC,sCAAsC,IAAI,KAAK,CAAC,CAAC;IAE7D,MAAM,UAAU,GAAiB,EAAE,CAAC;IAEpC,2DAA2D;IAC3D,IAAI,QAAQ,CAAC,OAAO,CAAC,IAAI,cAAc,EAAE;QACvC,KAAK,MAAM,KAAK,IAAI,cAAc,EAAE;YAClC,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,EAAE;gBAC5B,UAAU,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC;aAC9C;SACF;KACF;IAED,0CAA0C;IAC1C,OAAO;QACL,IAAI,EAAE,WAAW;QACjB,MAAM,EAAE,UAAU;QAClB,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,WAAW,CAAC,QAAQ,EAAE;QAC7C,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,GAAG,EAAE;QAC7C,SAAS,EAAE;YACT;gBACE,MAAM,EAAE,OAAO;gBACf,OAAO,EAAE,IAAI;gBACb,GAAG,EAAE,UAAU;gBACf,YAAY,EAAE,EAAE;aACjB;SACF;KACF,CAAC;AACJ,CAAC,CAAC;AAGF,MAAM,MAAM,GAAkB;IAC5B;QACE,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;QACjC,cAAc,EAAE,KAAK;QACrB,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,SAAS;KACnB;IACD,mBAAmB;CACpB,CAAC;AAEM,wBAAM"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare enum Entity {
|
|
2
|
+
User = "user",
|
|
3
|
+
Feed = "feed",
|
|
4
|
+
Friend = "friend",
|
|
5
|
+
Game = "game"
|
|
6
|
+
}
|
|
7
|
+
export declare const dbStructure: {
|
|
8
|
+
users: {
|
|
9
|
+
user: {
|
|
10
|
+
feeds: {
|
|
11
|
+
feed: {
|
|
12
|
+
createdBy: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
friends: {
|
|
16
|
+
friend: {
|
|
17
|
+
[x: string]: {
|
|
18
|
+
game?: undefined;
|
|
19
|
+
} | {
|
|
20
|
+
game: {};
|
|
21
|
+
};
|
|
22
|
+
games: {
|
|
23
|
+
game: {};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dbStructure = exports.Entity = void 0;
|
|
4
|
+
// You should import from the path to the ember-flow package in your project
|
|
5
|
+
const db_structure_1 = require("../utils/db-structure");
|
|
6
|
+
var Entity;
|
|
7
|
+
(function (Entity) {
|
|
8
|
+
Entity["User"] = "user";
|
|
9
|
+
// Add your custom entities below
|
|
10
|
+
Entity["Feed"] = "feed";
|
|
11
|
+
Entity["Friend"] = "friend";
|
|
12
|
+
Entity["Game"] = "game";
|
|
13
|
+
})(Entity = exports.Entity || (exports.Entity = {}));
|
|
14
|
+
// Map your custom entities to dbStructure below.
|
|
15
|
+
// Do not remove users and [Entity.User]
|
|
16
|
+
// by default, view matches the id attribute of the view so make the sure that a view has an id
|
|
17
|
+
exports.dbStructure = {
|
|
18
|
+
users: {
|
|
19
|
+
[Entity.User]: {
|
|
20
|
+
feeds: {
|
|
21
|
+
[Entity.Feed]: {
|
|
22
|
+
createdBy: (0, db_structure_1.view)(Entity.User, ["name", "email"]),
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
friends: {
|
|
26
|
+
[Entity.Friend]: {
|
|
27
|
+
[(0, db_structure_1.view)(Entity.User, ["name", "email"])]: {},
|
|
28
|
+
games: {
|
|
29
|
+
game: {},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=db-structure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db-structure.js","sourceRoot":"","sources":["../../src/sample-custom/db-structure.ts"],"names":[],"mappings":";;;AAAA,4EAA4E;AAC5E,wDAA2C;AAE3C,IAAY,MAMX;AAND,WAAY,MAAM;IACd,uBAAa,CAAA;IACb,iCAAiC;IACjC,uBAAa,CAAA;IACb,2BAAiB,CAAA;IACjB,uBAAa,CAAA;AACjB,CAAC,EANW,MAAM,GAAN,cAAM,KAAN,cAAM,QAMjB;AAED,iDAAiD;AACjD,wCAAwC;AACxC,+FAA+F;AAClF,QAAA,WAAW,GAAG;IACzB,KAAK,EAAE;QACL,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;YACb,KAAK,EAAE;gBACL,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;oBACb,SAAS,EAAE,IAAA,mBAAI,EAAC,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;iBAChD;aACF;YACD,OAAO,EAAE;gBACP,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE;oBACf,CAAC,IAAA,mBAAI,EAAC,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;oBAC1C,KAAK,EAAE;wBACL,IAAI,EAAE,EAAE;qBACT;iBACF;aACF;SACF;KACF;CACF,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.securityConfig = void 0;
|
|
4
|
+
const db_structure_1 = require("./db-structure");
|
|
5
|
+
// A security function that allows all actions
|
|
6
|
+
const allAllowed = async (entity, doc, actionType, modifiedFields) => {
|
|
7
|
+
console.log(`Security check for entity ${entity}, action type ${actionType},
|
|
8
|
+
and modified fields:`, modifiedFields);
|
|
9
|
+
return {
|
|
10
|
+
status: "allowed",
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
const userSecurityFn = async (entity, doc, actionType, modifiedFields) => {
|
|
14
|
+
switch (actionType) {
|
|
15
|
+
case "create": {
|
|
16
|
+
// Example: allow the user to create a new account only
|
|
17
|
+
// if they are registering from a whitelisted domain
|
|
18
|
+
const email = doc["@form"].email;
|
|
19
|
+
const domain = email.split("@")[1];
|
|
20
|
+
const allowedDomains = ["example.com", "example.org"];
|
|
21
|
+
let result;
|
|
22
|
+
if (!allowedDomains.includes(domain)) {
|
|
23
|
+
result = {
|
|
24
|
+
status: "rejected",
|
|
25
|
+
message: `Registration is only allowed from these domains:
|
|
26
|
+
${allowedDomains.join(", ")}`,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
result = {
|
|
31
|
+
status: "allowed",
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
return result;
|
|
35
|
+
}
|
|
36
|
+
case "update": {
|
|
37
|
+
// Example: do not allow the user to update their system role
|
|
38
|
+
if (modifiedFields === null || modifiedFields === void 0 ? void 0 : modifiedFields.includes("systemRole")) {
|
|
39
|
+
return {
|
|
40
|
+
status: "rejected",
|
|
41
|
+
message: "User is not allowed to change his system role",
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
case "delete":
|
|
47
|
+
// Example: reject all delete requests
|
|
48
|
+
return {
|
|
49
|
+
status: "rejected",
|
|
50
|
+
message: "You are not allowed to delete this document",
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
status: "allowed",
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
exports.securityConfig = {
|
|
58
|
+
// Implement your security functions for each entity here
|
|
59
|
+
[db_structure_1.Entity.User]: userSecurityFn,
|
|
60
|
+
[db_structure_1.Entity.Feed]: allAllowed,
|
|
61
|
+
[db_structure_1.Entity.Friend]: allAllowed,
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=security.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"security.js","sourceRoot":"","sources":["../../src/sample-custom/security.ts"],"names":[],"mappings":";;;AAAA,iDAAsC;AAQtC,8CAA8C;AAC9C,MAAM,UAAU,GAAe,KAAK,EAClC,MAAM,EACN,GAAG,EACH,UAAU,EACV,cAAc,EACd,EAAE;IACF,OAAO,CAAC,GAAG,CAAC,6BAA6B,MAAM,iBAAiB,UAAU;wBACpD,EAAE,cAAc,CAAC,CAAC;IACxC,OAAO;QACL,MAAM,EAAE,SAAS;KAClB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,cAAc,GAChB,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,cAAc,EAClB,EAAE;IAC5B,QAAQ,UAAU,EAAE;QACpB,KAAK,QAAQ,CAAC,CAAC;YACb,uDAAuD;YACvD,oDAAoD;YACpD,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC;YACjC,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YACnC,MAAM,cAAc,GAAG,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;YACtD,IAAI,MAAsB,CAAC;YAC3B,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;gBACpC,MAAM,GAAG;oBACP,MAAM,EAAE,UAAU;oBAClB,OAAO,EAAE;eACN,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;iBAC/B,CAAC;aACH;iBAAM;gBACL,MAAM,GAAG;oBACP,MAAM,EAAE,SAAS;iBAClB,CAAC;aACH;YACD,OAAO,MAAM,CAAC;SACf;QAED,KAAK,QAAQ,CAAC,CAAC;YACb,6DAA6D;YAC7D,IAAI,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,QAAQ,CAAC,YAAY,CAAC,EAAE;gBAC1C,OAAO;oBACL,MAAM,EAAE,UAAU;oBAClB,OAAO,EAAE,+CAA+C;iBACzD,CAAC;aACH;YACD,MAAM;SACP;QACD,KAAK,QAAQ;YACX,sCAAsC;YACtC,OAAO;gBACL,MAAM,EAAE,UAAU;gBAClB,OAAO,EAAE,6CAA6C;aACvD,CAAC;KACH;IAED,OAAO;QACL,MAAM,EAAE,SAAS;KAClB,CAAC;AACJ,CAAC,CAAC;AAEO,QAAA,cAAc,GAAmB;IAC5C,yDAAyD;IACzD,CAAC,qBAAM,CAAC,IAAI,CAAC,EAAE,cAAc;IAC7B,CAAC,qBAAM,CAAC,IAAI,CAAC,EAAE,UAAU;IACzB,CAAC,qBAAM,CAAC,MAAM,CAAC,EAAE,UAAU;CAC5B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ValidatorConfig } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* The validator configuration object, mapping entity names to their respective
|
|
4
|
+
* validator functions.
|
|
5
|
+
*
|
|
6
|
+
* @type {ValidatorConfig}
|
|
7
|
+
*/
|
|
8
|
+
declare const validatorConfig: ValidatorConfig;
|
|
9
|
+
export { validatorConfig };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validatorConfig = void 0;
|
|
4
|
+
const db_structure_1 = require("./db-structure");
|
|
5
|
+
/**
|
|
6
|
+
* Validates the user document.
|
|
7
|
+
*
|
|
8
|
+
* @param {DocumentData} document - The document data to validate.
|
|
9
|
+
* @param {string} docPath - The path to the document.
|
|
10
|
+
* @return {Promise<ValidationResult>} An object containing validation errors, if any.
|
|
11
|
+
*/
|
|
12
|
+
async function userValidator(document, docPath) {
|
|
13
|
+
const data = document;
|
|
14
|
+
const result = {};
|
|
15
|
+
if (!data || !data.name) {
|
|
16
|
+
result["name"] = ["Name is required"];
|
|
17
|
+
}
|
|
18
|
+
return Promise.resolve(result);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A blank validator that always returns an empty ValidationResult object.
|
|
22
|
+
*
|
|
23
|
+
* @param {DocumentData} document - The document data to validate.
|
|
24
|
+
* @param {string} docPath - The path to the document.
|
|
25
|
+
* @return {Promise<ValidationResult>} An empty ValidationResult object.
|
|
26
|
+
*/
|
|
27
|
+
async function blankValidator(document, docPath) {
|
|
28
|
+
return Promise.resolve({});
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The validator configuration object, mapping entity names to their respective
|
|
32
|
+
* validator functions.
|
|
33
|
+
*
|
|
34
|
+
* @type {ValidatorConfig}
|
|
35
|
+
*/
|
|
36
|
+
const validatorConfig = {
|
|
37
|
+
[db_structure_1.Entity.User]: userValidator,
|
|
38
|
+
[db_structure_1.Entity.Feed]: blankValidator,
|
|
39
|
+
[db_structure_1.Entity.Friend]: blankValidator,
|
|
40
|
+
};
|
|
41
|
+
exports.validatorConfig = validatorConfig;
|
|
42
|
+
//# sourceMappingURL=validators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../../src/sample-custom/validators.ts"],"names":[],"mappings":";;;AAAA,iDAAsC;AAMtC;;;;;;GAMG;AACH,KAAK,UAAU,aAAa,CAAC,QAAsB,EAAE,OAAe;IAClE,MAAM,IAAI,GAAG,QAAQ,CAAC;IACtB,MAAM,MAAM,GAAqB,EAAE,CAAC;IACpC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;QACvB,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;KACvC;IACD,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC;AAED;;;;;;GAMG;AACH,KAAK,UAAU,cAAc,CAAC,QAAsB,EAAE,OAAe;IACnE,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;AAC7B,CAAC;AAED;;;;;GAKG;AACH,MAAM,eAAe,GAAoB;IACvC,CAAC,qBAAM,CAAC,IAAI,CAAC,EAAE,aAAa;IAC5B,CAAC,qBAAM,CAAC,IAAI,CAAC,EAAE,cAAc;IAC7B,CAAC,qBAAM,CAAC,MAAM,CAAC,EAAE,cAAc;CAChC,CAAC;AAEM,0CAAe"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|