@brightnkhoma/domain 1.0.1 → 1.0.3
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/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAC,UAAU,EAAC,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAC,KAAK,MAAM,EAAC,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAC,KAAK,IAAI,EAAC,KAAK,YAAY,EAAE,KAAK,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAC,KAAK,cAAc,EAAE,KAAK,WAAW,EAAC,MAAM,yBAAyB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAC,UAAU,EAAC,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAC,KAAK,MAAM,EAAC,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAC,KAAK,IAAI,EAAC,KAAK,YAAY,EAAE,KAAK,UAAU,EAAC,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAC,KAAK,cAAc,EAAE,KAAK,WAAW,EAAC,MAAM,yBAAyB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -52591,6 +52591,7 @@ var require_express2 = __commonJS({
|
|
|
52591
52591
|
var index_exports = {};
|
|
52592
52592
|
__export(index_exports, {
|
|
52593
52593
|
BaseRouter: () => BaseRouter,
|
|
52594
|
+
Domain: () => Domain,
|
|
52594
52595
|
MainDomain: () => MainDomain,
|
|
52595
52596
|
onError: () => onError
|
|
52596
52597
|
});
|
|
@@ -53499,7 +53500,7 @@ var UserDomain = class {
|
|
|
53499
53500
|
constructor(user, db) {
|
|
53500
53501
|
this.user = user;
|
|
53501
53502
|
this.userDb = createTable("users", db);
|
|
53502
|
-
this.userDomain = createDomain(this.userDb, "user", this.user
|
|
53503
|
+
this.userDomain = createDomain(this.userDb, "user", this.user?.id ?? "");
|
|
53503
53504
|
this.user = user;
|
|
53504
53505
|
}
|
|
53505
53506
|
async verifyUser() {
|
|
@@ -53542,9 +53543,9 @@ var MainDomain = class _MainDomain {
|
|
|
53542
53543
|
domain(collectionName) {
|
|
53543
53544
|
return getDomainClass(collectionName, this.db);
|
|
53544
53545
|
}
|
|
53545
|
-
static init(
|
|
53546
|
+
static init(serviceAccountPathOrObject) {
|
|
53546
53547
|
const db = (0, import_app.initializeApp)({
|
|
53547
|
-
credential: (0, import_app.cert)(
|
|
53548
|
+
credential: (0, import_app.cert)(serviceAccountPathOrObject)
|
|
53548
53549
|
});
|
|
53549
53550
|
return new _MainDomain(db);
|
|
53550
53551
|
}
|
|
@@ -53818,6 +53819,7 @@ var BaseRouter = class {
|
|
|
53818
53819
|
// Annotate the CommonJS export names for ESM import in node:
|
|
53819
53820
|
0 && (module.exports = {
|
|
53820
53821
|
BaseRouter,
|
|
53822
|
+
Domain,
|
|
53821
53823
|
MainDomain,
|
|
53822
53824
|
onError
|
|
53823
53825
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -53490,7 +53490,7 @@ var UserDomain = class {
|
|
|
53490
53490
|
constructor(user, db) {
|
|
53491
53491
|
this.user = user;
|
|
53492
53492
|
this.userDb = createTable("users", db);
|
|
53493
|
-
this.userDomain = createDomain(this.userDb, "user", this.user
|
|
53493
|
+
this.userDomain = createDomain(this.userDb, "user", this.user?.id ?? "");
|
|
53494
53494
|
this.user = user;
|
|
53495
53495
|
}
|
|
53496
53496
|
async verifyUser() {
|
|
@@ -53533,9 +53533,9 @@ var MainDomain = class _MainDomain {
|
|
|
53533
53533
|
domain(collectionName) {
|
|
53534
53534
|
return getDomainClass(collectionName, this.db);
|
|
53535
53535
|
}
|
|
53536
|
-
static init(
|
|
53536
|
+
static init(serviceAccountPathOrObject) {
|
|
53537
53537
|
const db = initializeApp({
|
|
53538
|
-
credential: cert(
|
|
53538
|
+
credential: cert(serviceAccountPathOrObject)
|
|
53539
53539
|
});
|
|
53540
53540
|
return new _MainDomain(db);
|
|
53541
53541
|
}
|
|
@@ -53808,6 +53808,7 @@ var BaseRouter = class {
|
|
|
53808
53808
|
};
|
|
53809
53809
|
export {
|
|
53810
53810
|
BaseRouter,
|
|
53811
|
+
Domain,
|
|
53811
53812
|
MainDomain,
|
|
53812
53813
|
onError
|
|
53813
53814
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { App } from "firebase-admin/app";
|
|
1
|
+
import { App, ServiceAccount } from "firebase-admin/app";
|
|
2
2
|
import { Entity } from "../types/entity";
|
|
3
|
+
import { Domain } from "../@exprimental/domain";
|
|
4
|
+
import { User } from "../types/user";
|
|
3
5
|
export declare class MainDomain {
|
|
4
6
|
db: App;
|
|
5
7
|
constructor(db: App);
|
|
6
|
-
domain<T extends Entity>(collectionName: string): new (user:
|
|
7
|
-
static init(
|
|
8
|
+
domain<T extends Entity>(collectionName: string): new (user: User) => Domain<T>;
|
|
9
|
+
static init(serviceAccountPathOrObject: string | ServiceAccount): MainDomain;
|
|
8
10
|
}
|
|
9
11
|
//# sourceMappingURL=mainDomain.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mainDomain.d.ts","sourceRoot":"","sources":["../../../src/lib/domain/mainDomain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAuB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"mainDomain.d.ts","sourceRoot":"","sources":["../../../src/lib/domain/mainDomain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAuB,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAkB,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAErC,qBAAa,UAAU;IACnB,EAAE,EAAG,GAAG,CAAC;IACT,YAAY,EAAE,EAAG,GAAG,EAEnB;IAED,MAAM,CAAC,CAAC,SAAS,MAAM,EAAE,cAAc,EAAG,MAAM,GAAE,KAAK,IAAI,EAAG,IAAI,KAAI,MAAM,CAAC,CAAC,CAAC,CAE9E;IAED,MAAM,CAAC,IAAI,CAAC,0BAA0B,EAAE,MAAM,GAAG,cAAc,cAM9D;CAEJ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightnkhoma/domain",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "A module that automates CRUD functionality and routing and helps you follow DDD(Domain Driven Design) with ease using firebase, express and typescript",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|