blixify-server 0.1.2
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/README.md +1 -0
- package/dist/apis/fbWrapper.d.ts +15 -0
- package/dist/apis/fbWrapper.d.ts.map +1 -0
- package/dist/apis/fbWrapper.js +1 -0
- package/dist/apis/index.d.ts +3 -0
- package/dist/apis/index.d.ts.map +1 -0
- package/dist/apis/index.js +1 -0
- package/dist/apis/mongoWrapper.d.ts +16 -0
- package/dist/apis/mongoWrapper.d.ts.map +1 -0
- package/dist/apis/mongoWrapper.js +1 -0
- package/dist/model/QueryModel.d.ts +40 -0
- package/dist/model/QueryModel.d.ts.map +1 -0
- package/dist/model/QueryModel.js +1 -0
- package/dist/model/SecurityConfig.d.ts +27 -0
- package/dist/model/SecurityConfig.d.ts.map +1 -0
- package/dist/model/SecurityConfig.js +1 -0
- package/package.json +55 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Blixify Server
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import SecurityConfig from "../model/SecurityConfig";
|
|
2
|
+
/**
|
|
3
|
+
* @Wrapper
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
export declare class FirebaseWrapper {
|
|
7
|
+
fbAdmin: any;
|
|
8
|
+
collection: string;
|
|
9
|
+
isProd: boolean;
|
|
10
|
+
config: SecurityConfig;
|
|
11
|
+
modelChecker: (obj: any) => boolean;
|
|
12
|
+
constructor(fbAdmin: any, collection: string, isProd: boolean, config: SecurityConfig, modelChecker: (obj: any, ignore?: boolean) => boolean);
|
|
13
|
+
init: () => any;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=fbWrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fbWrapper.d.ts","sourceRoot":"","sources":["../../src/apis/fbWrapper.ts"],"names":[],"mappings":"AAOA,OAAO,cAAc,MAAM,yBAAyB,CAAC;AAIrD;;;GAGG;AACH,qBAAa,eAAe;IAC1B,OAAO,EAAE,GAAG,CAAM;IAClB,UAAU,SAAM;IAChB,MAAM,UAAS;IACf,MAAM,EAAE,cAAc,CAQpB;IAEF,YAAY,QAAS,GAAG,aAEtB;gBAGA,OAAO,EAAE,GAAG,EACZ,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,cAAc,EACtB,YAAY,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,OAAO,KAAK,OAAO;IASvD,IAAI,YAsUF;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var __awaiter=this&&this.__awaiter||function(e,a,d,n){return new(d=d||Promise)(function(i,t){function s(e){try{r(n.next(e))}catch(e){t(e)}}function o(e){try{r(n.throw(e))}catch(e){t(e)}}function r(e){var t;e.done?i(e.value):((t=e.value)instanceof d?t:new d(function(e){e(t)})).then(s,o)}r((n=n.apply(e,a||[])).next())})},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.FirebaseWrapper=void 0;const moment_1=__importDefault(require("moment")),QueryModel_1=require("../model/QueryModel"),express=require("express");class FirebaseWrapper{constructor(e,t,i,s,o){this.fbAdmin="",this.collection="",this.isProd=!1,this.config={baseConfig:[],opsConfig:{read:[],create:[],update:[],delete:[]}},this.modelChecker=e=>!1,this.init=()=>{var e=express.Router();return e.post("/create",(i,s)=>__awaiter(this,void 0,void 0,function*(){try{var e,t;this.modelChecker(i.body.data)?(e=(0,QueryModel_1.checkBaseConfig)(this.config,i),t=(0,QueryModel_1.checkOpsConfig)(this.config,"create",i,i.body.data),e&&t?(i.body.data.baseUpdatedAt=(0,moment_1.default)().toDate(),yield this.fbAdmin.firestore().collection(this.collection).doc(i.body.data.id).set(i.body.data),s.send({success:!0})):s.status(400).json({err:"Invalid Security Configuration"})):s.status(400).json({err:"Invalid Model Structure"})}catch(e){s.status(400).json({err:e})}})),e.post("/get",(r,a)=>__awaiter(this,void 0,void 0,function*(){try{var e,t,i,s,o=r.body.id;o?(e=yield this.fbAdmin.firestore().collection(this.collection).doc(o).get()).exists&&(t=e.data(),i=(0,QueryModel_1.checkBaseConfig)(this.config,r),s=(0,QueryModel_1.checkOpsConfig)(this.config,"read",r,t),i)&&s?a.send({data:t}):a.status(400).json({err:"Invalid Security Configuration"}):a.status(400).json({err:"Invalid Fields"})}catch(e){a.status(400).json({err:e})}})),e.post("/update",(n,c)=>__awaiter(this,void 0,void 0,function*(){try{var e,t,i,s,o,r,a=this.modelChecker(n.body.data)&&n.body.id,d=e=>(delete e.id,e.baseUpdatedAt=(0,moment_1.default)().toDate(),e);a?(e=(0,QueryModel_1.checkBaseConfig)(this.config,n),t=(0,QueryModel_1.checkOpsConfig)(this.config,"update",n,n.body.data),e&&t?n.body.sensitive?(i=yield this.fbAdmin.firestore().collection(this.collection).doc(a).get()).exists?(s=i.data(),(0,moment_1.default)(n.body.data.baseUpdatedAt).isAfter((0,moment_1.default)(1e3*s.baseUpdatedAt.seconds))?(o=d(n.body.data),yield this.fbAdmin.firestore().collection(this.collection).doc(a).update(Object.assign({},o)),c.send({success:!0})):c.status(400).json({err:"Refresh Sensitive Model"})):c.status(400).json({err:"Invalid Security Configuration"}):(r=d(n.body.data),yield this.fbAdmin.firestore().collection(this.collection).doc(a).update(Object.assign({},r)),c.send({success:!0})):c.status(400).json({err:"Invalid Security Configuration"})):c.status(400).json({err:"Invalid Model Structure"})}catch(e){c.status(400).json({err:e})}})),e.post("/delete",(r,a)=>__awaiter(this,void 0,void 0,function*(){try{var e,t,i,s,o=r.body.id;o?(e=yield this.fbAdmin.firestore().collection(this.collection).doc(o).get()).exists&&(t=e.data(),i=(0,QueryModel_1.checkBaseConfig)(this.config,r),s=(0,QueryModel_1.checkOpsConfig)(this.config,"delete",r,t),i)&&s?(yield this.fbAdmin.firestore().collection(this.collection).doc(o).delete(),a.send({success:!0})):a.status(400).json({err:"Invalid Security Configuration"}):a.status(400).json({err:"Invalid Fields"})}catch(e){a.status(400).json({err:e})}})),e.post("/list",(n,c)=>__awaiter(this,void 0,void 0,function*(){try{var e=(0,QueryModel_1.checkBaseConfig)(this.config,n);if(e){let o=this.fbAdmin.firestore().collection(this.collection),r="";var t=n.body.query;if(t&&0<t.length&&t.map(e=>{var t,i=null!=(t=e.queryId)?t:"",s=e.value;switch(e.type){case"search":e.searchIds&&0<e.searchIds.length&&(r=e.searchIds[0],o=o.orderBy(e.searchIds[0]).startAt(s).endAt(s+""));break;case"=":o=o.where(i,"==",s);break;case">":o=o.where(i,">",s);break;case"<":o=o.where(i,"<",s);break;case"><":Array.isArray(s)&&2<=s.length&&(o=o.where(i,">=",s[0]).where(i,"<=",s[1]));break;case"in":o=o.where(i,"in",s)}}),n.body.limit){if(o=o.limit(n.body.limit),n.body.sort){var i=n.body.sort;if(r&&i.sortId!==r)return void c.status(400).json({err:"Invalid Search Sort Configuration"});r||(o=o.orderBy(i.sortId,"asc"===i.type?"asc":"desc"))}var s,a=yield(o=n.body.cursor?o.startAfter(n.body.cursor):o).get();let t=!0;const d=[];if(a&&a.forEach(e=>{e=e.data();d.push(e),(0,QueryModel_1.checkOpsConfig)(this.config,"read",n,e)||(t=!1)}),e&&t){let t="";if(d.length===n.body.limit){let e="id";n.body.sort&&(s=n.body.sort,e=s.sortId),t=d[n.body.limit-1][e]}c.send({data:d,count:t})}else c.status(400).json({err:"Invalid Security Configuration"})}else c.status(400).json({err:"Invalid Limit Configuration"})}else c.status(400).json({err:"Invalid Security Configuration"})}catch(e){c.status(400).json({err:e})}})),e},this.fbAdmin=e,this.collection=t,this.isProd=i,this.config=s,this.modelChecker=o}}exports.FirebaseWrapper=FirebaseWrapper;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/apis/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MongoWrapper=exports.FirebaseWrapper=void 0;var fbWrapper_1=require("./fbWrapper"),mongoWrapper_1=(Object.defineProperty(exports,"FirebaseWrapper",{enumerable:!0,get:function(){return fbWrapper_1.FirebaseWrapper}}),require("./mongoWrapper"));Object.defineProperty(exports,"MongoWrapper",{enumerable:!0,get:function(){return mongoWrapper_1.MongoWrapper}});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import SecurityConfig from "../model/SecurityConfig";
|
|
2
|
+
/**
|
|
3
|
+
* @Wrapper
|
|
4
|
+
* collection - MongoDB Collection
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
export declare class MongoWrapper {
|
|
8
|
+
mongoDB: any;
|
|
9
|
+
collection: string;
|
|
10
|
+
isProd: boolean;
|
|
11
|
+
config: SecurityConfig;
|
|
12
|
+
modelChecker: (obj: any) => boolean;
|
|
13
|
+
constructor(mongoDB: any, collection: string, isProd: boolean, config: SecurityConfig, modelChecker: (obj: any, ignore?: boolean) => boolean);
|
|
14
|
+
init: () => any;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=mongoWrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mongoWrapper.d.ts","sourceRoot":"","sources":["../../src/apis/mongoWrapper.ts"],"names":[],"mappings":"AAOA,OAAO,cAAc,MAAM,yBAAyB,CAAC;AAGrD;;;;GAIG;AACH,qBAAa,YAAY;IACvB,OAAO,EAAE,GAAG,CAAM;IAClB,UAAU,SAAM;IAChB,MAAM,UAAS;IACf,MAAM,EAAE,cAAc,CAQpB;IAEF,YAAY,QAAS,GAAG,aAEtB;gBAGA,OAAO,EAAE,GAAG,EACZ,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,cAAc,EACtB,YAAY,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,OAAO,KAAK,OAAO;IASvD,IAAI,YA8SF;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var __awaiter=this&&this.__awaiter||function(e,n,d,a){return new(d=d||Promise)(function(o,t){function i(e){try{r(a.next(e))}catch(e){t(e)}}function s(e){try{r(a.throw(e))}catch(e){t(e)}}function r(e){var t;e.done?o(e.value):((t=e.value)instanceof d?t:new d(function(e){e(t)})).then(i,s)}r((a=a.apply(e,n||[])).next())})},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.MongoWrapper=void 0;const moment_1=__importDefault(require("moment")),QueryModel_1=require("../model/QueryModel"),express=require("express");class MongoWrapper{constructor(e,t,o,i,s){this.mongoDB="",this.collection="",this.isProd=!1,this.config={baseConfig:[],opsConfig:{read:[],create:[],update:[],delete:[]}},this.modelChecker=e=>!1,this.init=()=>{var e=express.Router();return e.post("/create",(o,i)=>__awaiter(this,void 0,void 0,function*(){try{var e,t;this.modelChecker(o.body.data)?(e=(0,QueryModel_1.checkBaseConfig)(this.config,o),t=(0,QueryModel_1.checkOpsConfig)(this.config,"create",o,o.body.data),e&&t?(o.body.data.baseUpdatedAt=(0,moment_1.default)().toDate(),yield this.mongoDB.db(this.isProd?"prod":"dev").collection(this.collection).insertOne(o.body.data),i.send({success:!0})):i.status(400).json({err:"Invalid Security Configuration"})):i.status(400).json({err:"Invalid Model Structure"})}catch(e){i.status(400).json({err:e})}})),e.post("/get",(s,r)=>__awaiter(this,void 0,void 0,function*(){try{var e,t,o,i=s.body.id;i?(e=yield this.mongoDB.db(this.isProd?"prod":"dev").collection(this.collection).findOne({_id:i}),t=(0,QueryModel_1.checkBaseConfig)(this.config,s),o=(0,QueryModel_1.checkOpsConfig)(this.config,"read",s,e),t&&o?r.send({data:e}):r.status(400).json({err:"Invalid Security Configuration"})):r.status(400).json({err:"Invalid Fields"})}catch(e){r.status(400).json({err:e})}})),e.post("/update",(a,c)=>__awaiter(this,void 0,void 0,function*(){try{var e,t,o,i,s,r,n=this.modelChecker(a.body.data)&&a.body.id,d=e=>(delete e._id,e.baseUpdatedAt=(0,moment_1.default)().toDate(),e);n?(e=(0,QueryModel_1.checkBaseConfig)(this.config,a),t=(0,QueryModel_1.checkOpsConfig)(this.config,"update",a,a.body.data),e&&t?(o=this.mongoDB.db(this.isProd?"prod":"dev").collection(this.collection),a.body.sensitive?(i=yield o.findOne({_id:n}),(0,moment_1.default)(a.body.data.baseUpdatedAt).isAfter((0,moment_1.default)(i.baseUpdatedAt))?(s=d(a.body.data),yield o.updateOne({_id:n},{$set:Object.assign({},s)}),c.send({success:!0})):c.status(400).json({err:"Refresh Sensitive Model"})):(r=d(a.body.data),yield o.updateOne({_id:n},{$set:Object.assign({},r)}),c.send({success:!0}))):c.status(400).json({err:"Invalid Security Configuration"})):c.status(400).json({err:"Invalid Model Structure"})}catch(e){c.status(400).json({err:e})}})),e.post("/delete",(r,n)=>__awaiter(this,void 0,void 0,function*(){try{var e,t,o,i,s=r.body.id;s?(t=yield(e=this.mongoDB.db(this.isProd?"prod":"dev").collection(this.collection)).findOne({_id:s}),o=(0,QueryModel_1.checkBaseConfig)(this.config,r),i=(0,QueryModel_1.checkOpsConfig)(this.config,"delete",r,t),o&&i?(yield e.findOneAndDelete({_id:s}),n.send({success:!0})):n.status(400).json({err:"Invalid Security Configuration"})):n.status(400).json({err:"Invalid Fields"})}catch(e){n.status(400).json({err:e})}})),e.post("/list",(c,l)=>__awaiter(this,void 0,void 0,function*(){try{var o=(0,QueryModel_1.checkBaseConfig)(this.config,c);if(o){var i=c.body.query;const a={};i&&0<i.length&&i.map(e=>{var t,o=null!=(t=e.queryId)?t:"";const i=e.value;switch(e.type){case"search":e.searchIds&&0<e.searchIds.length&&(a.$or=[],e.searchIds.map(e=>{a.$or.push({[e]:{$regex:i,$options:"i"}})}));break;case"=":a[o]=i;break;case">":a[o]={$gt:i};break;case"<":a[o]={$lt:i};break;case"><":Array.isArray(i)&&2<=i.length&&(a[o]={$gte:i[0],$lte:i[1]});break;case"in":a[o]={$in:i}}});let e=this.mongoDB.db(this.isProd?"prod":"dev").collection(this.collection).find(a);var s,r,n=yield e.count({}),d=(c.body.cursor&&(e=e.skip(c.body.cursor)),c.body.limit&&(e=e.limit(c.body.limit)),c.body.sort&&(r={[(s=c.body.sort).sortId]:"asc"===s.type?1:-1},e=e.sort(r)),yield e.toArray());let t=!0;0<d.length&&d.map(e=>{(0,QueryModel_1.checkOpsConfig)(this.config,"read",c,e)||(t=!1)}),o&&t?l.send({data:d,count:n}):l.status(400).json({err:"Invalid Security Configuration"})}else l.status(400).json({err:"Invalid Security Configuration"})}catch(e){l.status(400).json({err:e})}})),e},this.mongoDB=e,this.collection=t,this.isProd=o,this.config=i,this.modelChecker=s}}exports.MongoWrapper=MongoWrapper;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import SecurityConfig from "./SecurityConfig";
|
|
2
|
+
/**
|
|
3
|
+
* @SupportedQuery
|
|
4
|
+
* - search Search
|
|
5
|
+
* - = Equal
|
|
6
|
+
* - > Greater than
|
|
7
|
+
* - < Lower than
|
|
8
|
+
* - >< Range (Equal To)
|
|
9
|
+
* - in In
|
|
10
|
+
*
|
|
11
|
+
* @firebase - The moment search is used, sort is automatically disabled
|
|
12
|
+
*/
|
|
13
|
+
export interface Query {
|
|
14
|
+
type: "search" | "=" | ">" | "<" | "><" | "in";
|
|
15
|
+
value: any;
|
|
16
|
+
queryId?: string;
|
|
17
|
+
searchIds?: string[];
|
|
18
|
+
}
|
|
19
|
+
export interface Sort {
|
|
20
|
+
sortId: string;
|
|
21
|
+
type: "asc" | "desc";
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* Doc is not supported for Base Config
|
|
26
|
+
* @param config
|
|
27
|
+
* @param req
|
|
28
|
+
* @returns
|
|
29
|
+
*/
|
|
30
|
+
export declare const checkBaseConfig: (config: SecurityConfig, req: any) => boolean;
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @param config
|
|
34
|
+
* @param type
|
|
35
|
+
* @param req
|
|
36
|
+
* @param doc
|
|
37
|
+
* @returns
|
|
38
|
+
*/
|
|
39
|
+
export declare const checkOpsConfig: (config: SecurityConfig, type: "read" | "create" | "update" | "delete", req: any, doc: any) => boolean;
|
|
40
|
+
//# sourceMappingURL=QueryModel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueryModel.d.ts","sourceRoot":"","sources":["../../src/model/QueryModel.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAE9C;;;;;;;;;;GAUG;AACH,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,QAAQ,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC;IAC/C,KAAK,EAAE,GAAG,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,IAAI;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,KAAK,GAAG,MAAM,CAAC;CACtB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,WAAY,cAAc,OAAO,GAAG,YA2B/D,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,WACjB,cAAc,QAChB,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,OACxC,GAAG,OACH,GAAG,YA+CT,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.checkOpsConfig=exports.checkBaseConfig=void 0;const checkBaseConfig=(e,o)=>{let s=!0;return 0<e.baseConfig.length&&e.baseConfig.map(e=>{switch(e.type){case"api":o.body.bm_apiToken||(s=!1);break;case"auth":o.body.bm_userId||(s=!1);break;case"doc":break;case"role":o.body.bm_userRole!==e.value&&(s=!1)}}),s},checkOpsConfig=(exports.checkBaseConfig=checkBaseConfig,(e,o,s,a)=>{let c=!1,r;return 0<(r="read"===o?e.opsConfig.read:"create"===o?e.opsConfig.create:"update"===o?e.opsConfig.update:e.opsConfig.delete).length?r.map(e=>{switch(e.type){case"api":s.body.bm_apiToken&&(c=!0);break;case"auth":s.body.bm_userId&&(c=!0);break;case"doc":JSON.stringify(s.body.bm_userId)===JSON.stringify(a[e.value])&&(c=!0);break;case"role":s.body.bm_userRole===e.value&&(c=!0)}}):c=!0,c});exports.checkOpsConfig=checkOpsConfig;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @type Selection
|
|
3
|
+
* auth - bm_userId is not empty
|
|
4
|
+
* role - bm_userRole equal to value
|
|
5
|
+
* api - bm_apiToken is true
|
|
6
|
+
* doc - class.value equals to userId
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
interface Config {
|
|
10
|
+
type: "auth" | "role" | "api" | "doc";
|
|
11
|
+
value: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @baseConfig - AND Condition
|
|
15
|
+
* @opsConfig - OR Condition
|
|
16
|
+
*/
|
|
17
|
+
export default interface SecurityConfig {
|
|
18
|
+
baseConfig: Config[];
|
|
19
|
+
opsConfig: {
|
|
20
|
+
read: Config[];
|
|
21
|
+
create: Config[];
|
|
22
|
+
update: Config[];
|
|
23
|
+
delete: Config[];
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=SecurityConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SecurityConfig.d.ts","sourceRoot":"","sources":["../../src/model/SecurityConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,UAAU,MAAM;IACd,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,CAAC;IACtC,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,WAAW,cAAc;IACrC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,SAAS,EAAE;QACT,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,MAAM,EAAE,MAAM,EAAE,CAAC;KAClB,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "blixify-server",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"main": "dist/apis/index.js",
|
|
6
|
+
"private": false,
|
|
7
|
+
"directories": {
|
|
8
|
+
"dist": "dist"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"clean": "rm -rf ./dist",
|
|
15
|
+
"prebuild": "yarn clean",
|
|
16
|
+
"predeploy": "yarn clean",
|
|
17
|
+
"postbuild": "./minify-js.sh",
|
|
18
|
+
"postdeploy": "./minify-js.sh",
|
|
19
|
+
"build": "yarn run lint && tsc --build \"./tsconfig.json\"",
|
|
20
|
+
"deploy": "yarn run lint && tsc --build \"./buildtsconfig.json\"",
|
|
21
|
+
"lint": "eslint . --max-warnings=0",
|
|
22
|
+
"start:mongo": "cd dist && node mongoServer.js",
|
|
23
|
+
"start:fb": "cd dist && node firebaseServer.js",
|
|
24
|
+
"install:husky": "yarn husky install"
|
|
25
|
+
},
|
|
26
|
+
"config": {
|
|
27
|
+
"commit-message-validator": {
|
|
28
|
+
"_comment": "Git format eg #123 - This is your commit message",
|
|
29
|
+
"pattern": "^#[0-9]+ - [a-zA-Z0-9# ]+",
|
|
30
|
+
"errorMessage": "Commit message format is in-correct"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"moment": "^2.29.4"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"express": "^4.18.1",
|
|
38
|
+
"@types/express": "^4.17.14",
|
|
39
|
+
"@types/node": "^17.0.35",
|
|
40
|
+
"@typescript-eslint/eslint-plugin": "^5.25.0",
|
|
41
|
+
"@typescript-eslint/parser": "^5.25.0",
|
|
42
|
+
"body-parser": "^1.20.0",
|
|
43
|
+
"branch-naming-check": "^1.0.2",
|
|
44
|
+
"commit-message-validator": "^1.0.2",
|
|
45
|
+
"cors": "^2.8.5",
|
|
46
|
+
"dotenv": "^16.0.1",
|
|
47
|
+
"eslint": "^8.16.0",
|
|
48
|
+
"express-rate-limit": "^6.6.0",
|
|
49
|
+
"firebase-admin": "^11.2.1",
|
|
50
|
+
"helmet": "^6.0.0",
|
|
51
|
+
"husky": "^8.0.2",
|
|
52
|
+
"mongodb": "^4.11.0",
|
|
53
|
+
"typescript": "^4.6.4"
|
|
54
|
+
}
|
|
55
|
+
}
|