@duvdu-v1/duvdu 1.1.87 → 1.1.89
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/build/{common/src/models → models}/copyrights.model.d.ts +1 -1
- package/build/{common/src/models → models}/copyrights.model.js +4 -3
- package/build/{common/src/models → models}/portfolio-post.model.d.ts +1 -1
- package/build/{common/src/models → models}/portfolio-post.model.js +4 -3
- package/build/{common/src/models → models}/studio-booking.model.d.ts +1 -1
- package/build/{common/src/models → models}/studio-booking.model.js +3 -2
- package/package.json +55 -55
- package/build/auth/src/nats-wrapper.d.ts +0 -8
- package/build/auth/src/nats-wrapper.js +0 -28
- /package/build/{common/src/errors → errors}/bad-request-error.d.ts +0 -0
- /package/build/{common/src/errors → errors}/bad-request-error.js +0 -0
- /package/build/{common/src/errors → errors}/custom-error.d.ts +0 -0
- /package/build/{common/src/errors → errors}/custom-error.js +0 -0
- /package/build/{common/src/errors → errors}/data-base-connections.d.ts +0 -0
- /package/build/{common/src/errors → errors}/data-base-connections.js +0 -0
- /package/build/{common/src/errors → errors}/generic-error.d.ts +0 -0
- /package/build/{common/src/errors → errors}/generic-error.js +0 -0
- /package/build/{common/src/errors → errors}/not-allowed-error.d.ts +0 -0
- /package/build/{common/src/errors → errors}/not-allowed-error.js +0 -0
- /package/build/{common/src/errors → errors}/notfound-error.d.ts +0 -0
- /package/build/{common/src/errors → errors}/notfound-error.js +0 -0
- /package/build/{common/src/errors → errors}/unauthenticated-error.d.ts +0 -0
- /package/build/{common/src/errors → errors}/unauthenticated-error.js +0 -0
- /package/build/{common/src/errors → errors}/unauthorized-error.d.ts +0 -0
- /package/build/{common/src/errors → errors}/unauthorized-error.js +0 -0
- /package/build/{common/src/errors → errors}/validation-error.d.ts +0 -0
- /package/build/{common/src/errors → errors}/validation-error.js +0 -0
- /package/build/{common/src/events → events}/base-listener.d.ts +0 -0
- /package/build/{common/src/events → events}/base-listener.js +0 -0
- /package/build/{common/src/events → events}/base-publisher.d.ts +0 -0
- /package/build/{common/src/events → events}/base-publisher.js +0 -0
- /package/build/{common/src/events → events}/new-notification.event.d.ts +0 -0
- /package/build/{common/src/events → events}/new-notification.event.js +0 -0
- /package/build/{common/src/events → events}/subject.d.ts +0 -0
- /package/build/{common/src/events → events}/subject.js +0 -0
- /package/build/{common/src/index.d.ts → index.d.ts} +0 -0
- /package/build/{common/src/index.js → index.js} +0 -0
- /package/build/{common/src/middlewares → middlewares}/auth.middleware.d.ts +0 -0
- /package/build/{common/src/middlewares → middlewares}/auth.middleware.js +0 -0
- /package/build/{common/src/middlewares → middlewares}/check-required-files.middleware.d.ts +0 -0
- /package/build/{common/src/middlewares → middlewares}/check-required-files.middleware.js +0 -0
- /package/build/{common/src/middlewares → middlewares}/database-connection.d.ts +0 -0
- /package/build/{common/src/middlewares → middlewares}/database-connection.js +0 -0
- /package/build/{common/src/middlewares → middlewares}/global-error-handling.middleware.d.ts +0 -0
- /package/build/{common/src/middlewares → middlewares}/global-error-handling.middleware.js +0 -0
- /package/build/{common/src/middlewares → middlewares}/global-pagination.middleware.d.ts +0 -0
- /package/build/{common/src/middlewares → middlewares}/global-pagination.middleware.js +0 -0
- /package/build/{common/src/middlewares → middlewares}/global-upload.middleware.d.ts +0 -0
- /package/build/{common/src/middlewares → middlewares}/global-upload.middleware.js +0 -0
- /package/build/{common/src/middlewares → middlewares}/global-validator.middleware.d.ts +0 -0
- /package/build/{common/src/middlewares → middlewares}/global-validator.middleware.js +0 -0
- /package/build/{common/src/middlewares → middlewares}/isAuthorized.middleware.d.ts +0 -0
- /package/build/{common/src/middlewares → middlewares}/isAuthorized.middleware.js +0 -0
- /package/build/{common/src/middlewares → middlewares}/language-header.middleware.d.ts +0 -0
- /package/build/{common/src/middlewares → middlewares}/language-header.middleware.js +0 -0
- /package/build/{common/src/middlewares → middlewares}/optional-auth.middleware.d.ts +0 -0
- /package/build/{common/src/middlewares → middlewares}/optional-auth.middleware.js +0 -0
- /package/build/{common/src/middlewares → middlewares}/redis-connection.d.ts +0 -0
- /package/build/{common/src/middlewares → middlewares}/redis-connection.js +0 -0
- /package/build/{common/src/middlewares → middlewares}/upload-project-media.middleware.d.ts +0 -0
- /package/build/{common/src/middlewares → middlewares}/upload-project-media.middleware.js +0 -0
- /package/build/{common/src/models → models}/Bookmark.model.d.ts +0 -0
- /package/build/{common/src/models → models}/Bookmark.model.js +0 -0
- /package/build/{common/src/models → models}/Plan.model.d.ts +0 -0
- /package/build/{common/src/models → models}/Plan.model.js +0 -0
- /package/build/{common/src/models → models}/Role.model.d.ts +0 -0
- /package/build/{common/src/models → models}/Role.model.js +0 -0
- /package/build/{common/src/models → models}/Term.model.d.ts +0 -0
- /package/build/{common/src/models → models}/Term.model.js +0 -0
- /package/build/{common/src/models → models}/Ticket.model.d.ts +0 -0
- /package/build/{common/src/models → models}/Ticket.model.js +0 -0
- /package/build/{common/src/models → models}/User.model.d.ts +0 -0
- /package/build/{common/src/models → models}/User.model.js +0 -0
- /package/build/{common/src/models → models}/allProjects.model.d.ts +0 -0
- /package/build/{common/src/models → models}/allProjects.model.js +0 -0
- /package/build/{common/src/models → models}/category.model.d.ts +0 -0
- /package/build/{common/src/models → models}/category.model.js +0 -0
- /package/build/{common/src/models → models}/contracts.model.d.ts +0 -0
- /package/build/{common/src/models → models}/contracts.model.js +0 -0
- /package/build/{common/src/models → models}/follow.model.d.ts +0 -0
- /package/build/{common/src/models → models}/follow.model.js +0 -0
- /package/build/{common/src/models → models}/messages.model.d.ts +0 -0
- /package/build/{common/src/models → models}/messages.model.js +0 -0
- /package/build/{common/src/models → models}/notification.model.d.ts +0 -0
- /package/build/{common/src/models → models}/notification.model.js +0 -0
- /package/build/{common/src/models → models}/producer.model.d.ts +0 -0
- /package/build/{common/src/models → models}/producer.model.js +0 -0
- /package/build/{common/src/models → models}/report.model.d.ts +0 -0
- /package/build/{common/src/models → models}/report.model.js +0 -0
- /package/build/{common/src/models → models}/teamProject.model.d.ts +0 -0
- /package/build/{common/src/models → models}/teamProject.model.js +0 -0
- /package/build/{common/src/services → services}/category.service.d.ts +0 -0
- /package/build/{common/src/services → services}/category.service.js +0 -0
- /package/build/{common/src/types → types}/Bookmarks.d.ts +0 -0
- /package/build/{common/src/types → types}/Bookmarks.js +0 -0
- /package/build/{common/src/types → types}/Category.d.ts +0 -0
- /package/build/{common/src/types → types}/Category.js +0 -0
- /package/build/{common/src/types → types}/JwtPayload.d.ts +0 -0
- /package/build/{common/src/types → types}/JwtPayload.js +0 -0
- /package/build/{common/src/types → types}/Pagination.d.ts +0 -0
- /package/build/{common/src/types → types}/Pagination.js +0 -0
- /package/build/{common/src/types → types}/Permissions.d.ts +0 -0
- /package/build/{common/src/types → types}/Permissions.js +0 -0
- /package/build/{common/src/types → types}/Plan.d.ts +0 -0
- /package/build/{common/src/types → types}/Plan.js +0 -0
- /package/build/{common/src/types → types}/Projects.d.ts +0 -0
- /package/build/{common/src/types → types}/Projects.js +0 -0
- /package/build/{common/src/types → types}/Rate.d.ts +0 -0
- /package/build/{common/src/types → types}/Rate.js +0 -0
- /package/build/{common/src/types → types}/Role.d.ts +0 -0
- /package/build/{common/src/types → types}/Role.js +0 -0
- /package/build/{common/src/types → types}/Terms.d.ts +0 -0
- /package/build/{common/src/types → types}/Terms.js +0 -0
- /package/build/{common/src/types → types}/Ticket.d.ts +0 -0
- /package/build/{common/src/types → types}/Ticket.js +0 -0
- /package/build/{common/src/types → types}/UrlQuery.d.ts +0 -0
- /package/build/{common/src/types → types}/UrlQuery.js +0 -0
- /package/build/{common/src/types → types}/User.d.ts +0 -0
- /package/build/{common/src/types → types}/User.js +0 -0
- /package/build/{common/src/types → types}/booking-states.d.ts +0 -0
- /package/build/{common/src/types → types}/booking-states.js +0 -0
- /package/build/{common/src/types → types}/copyrights-order.d.ts +0 -0
- /package/build/{common/src/types → types}/copyrights-order.js +0 -0
- /package/build/{common/src/types → types}/cycles.d.ts +0 -0
- /package/build/{common/src/types → types}/cycles.js +0 -0
- /package/build/{common/src/types → types}/folders.d.ts +0 -0
- /package/build/{common/src/types → types}/folders.js +0 -0
- /package/build/{common/src/types → types}/model-names.d.ts +0 -0
- /package/build/{common/src/types → types}/model-names.js +0 -0
- /package/build/{common/src/types → types}/notification.type.d.ts +0 -0
- /package/build/{common/src/types → types}/notification.type.js +0 -0
- /package/build/{common/src/types → types}/pagination-response.d.ts +0 -0
- /package/build/{common/src/types → types}/pagination-response.js +0 -0
- /package/build/{common/src/types → types}/portfolio-post-order.d.ts +0 -0
- /package/build/{common/src/types → types}/portfolio-post-order.js +0 -0
- /package/build/{common/src/types → types}/socket-channel.d.ts +0 -0
- /package/build/{common/src/types → types}/socket-channel.js +0 -0
- /package/build/{common/src/types → types}/success-response.d.ts +0 -0
- /package/build/{common/src/types → types}/success-response.js +0 -0
- /package/build/{common/src/types → types}/systemRoles.d.ts +0 -0
- /package/build/{common/src/types → types}/systemRoles.js +0 -0
- /package/build/{common/src/utils → utils}/api-feature.d.ts +0 -0
- /package/build/{common/src/utils → utils}/api-feature.js +0 -0
- /package/build/{common/src/utils → utils}/bucket.d.ts +0 -0
- /package/build/{common/src/utils → utils}/bucket.js +0 -0
- /package/build/{common/src/utils → utils}/file.d.ts +0 -0
- /package/build/{common/src/utils → utils}/file.js +0 -0
- /package/build/{common/src/utils → utils}/generateToken.d.ts +0 -0
- /package/build/{common/src/utils → utils}/generateToken.js +0 -0
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CopyRights = void 0;
|
|
4
4
|
const mongoose_1 = require("mongoose");
|
|
5
|
+
const cycles_1 = require("../types/cycles");
|
|
5
6
|
const model_names_1 = require("../types/model-names");
|
|
6
7
|
exports.CopyRights = (0, mongoose_1.model)(model_names_1.MODELS.copyrights, new mongoose_1.Schema({
|
|
7
8
|
user: { type: mongoose_1.Schema.Types.ObjectId, ref: model_names_1.MODELS.user },
|
|
@@ -11,7 +12,7 @@ exports.CopyRights = (0, mongoose_1.model)(model_names_1.MODELS.copyrights, new
|
|
|
11
12
|
address: { type: String, default: null },
|
|
12
13
|
searchKeywords: [String],
|
|
13
14
|
showOnHome: { type: Boolean, default: true },
|
|
14
|
-
cycle: { type:
|
|
15
|
+
cycle: { type: String, default: cycles_1.CYCLES.copyRights },
|
|
15
16
|
isDeleted: { type: Boolean, default: false },
|
|
16
17
|
rate: {
|
|
17
18
|
ratersCounter: { type: Number, default: 0 },
|
|
@@ -20,12 +21,12 @@ exports.CopyRights = (0, mongoose_1.model)(model_names_1.MODELS.copyrights, new
|
|
|
20
21
|
tags: [{ ar: { type: String, default: null }, en: { type: String, default: null } }],
|
|
21
22
|
subCategory: {
|
|
22
23
|
ar: String,
|
|
23
|
-
en: String
|
|
24
|
+
en: String,
|
|
24
25
|
},
|
|
25
26
|
location: {
|
|
26
27
|
lat: { type: Number, default: null },
|
|
27
28
|
lng: { type: Number, default: null },
|
|
28
|
-
}
|
|
29
|
+
},
|
|
29
30
|
}, {
|
|
30
31
|
timestamps: true,
|
|
31
32
|
collection: model_names_1.MODELS.copyrights,
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PortfolioPosts = void 0;
|
|
4
4
|
const mongoose_1 = require("mongoose");
|
|
5
|
+
const cycles_1 = require("../types/cycles");
|
|
5
6
|
const model_names_1 = require("../types/model-names");
|
|
6
7
|
exports.PortfolioPosts = (0, mongoose_1.model)(model_names_1.MODELS.portfolioPost, new mongoose_1.Schema({
|
|
7
8
|
user: { type: mongoose_1.Schema.Types.ObjectId, ref: model_names_1.MODELS.user },
|
|
@@ -21,13 +22,13 @@ exports.PortfolioPosts = (0, mongoose_1.model)(model_names_1.MODELS.portfolioPos
|
|
|
21
22
|
tags: [{ ar: { type: String, default: null }, en: { type: String, default: null } }],
|
|
22
23
|
subCategory: {
|
|
23
24
|
ar: String,
|
|
24
|
-
en: String
|
|
25
|
+
en: String,
|
|
25
26
|
},
|
|
26
27
|
projectBudget: { type: Number, default: null },
|
|
27
28
|
category: { type: mongoose_1.Schema.Types.ObjectId, ref: model_names_1.MODELS.category, required: true },
|
|
28
29
|
projectScale: { scale: { type: Number, default: 0 }, time: { type: String, default: null } },
|
|
29
30
|
showOnHome: { type: Boolean, default: true },
|
|
30
|
-
cycle: { type:
|
|
31
|
+
cycle: { type: String, default: cycles_1.CYCLES.portfolioPost },
|
|
31
32
|
isDeleted: { type: Boolean, default: false },
|
|
32
33
|
rate: {
|
|
33
34
|
ratersCounter: { type: Number, default: 0 },
|
|
@@ -43,7 +44,7 @@ exports.PortfolioPosts = (0, mongoose_1.model)(model_names_1.MODELS.portfolioPos
|
|
|
43
44
|
if (ret.attachments)
|
|
44
45
|
ret.attachments = ret.attachments.map((el) => process.env.BUCKET_HOST + '/' + el);
|
|
45
46
|
},
|
|
46
|
-
}
|
|
47
|
+
},
|
|
47
48
|
})
|
|
48
49
|
.index({ createdAt: 1, updatedAt: -1 })
|
|
49
50
|
.index({ title: 'text', desc: 'text', tools: 'text', searchKeywords: 'text' }));
|
|
@@ -25,6 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.studioBooking = void 0;
|
|
27
27
|
const mongoose_1 = __importStar(require("mongoose"));
|
|
28
|
+
const cycles_1 = require("../types/cycles");
|
|
28
29
|
const model_names_1 = require("../types/model-names");
|
|
29
30
|
exports.studioBooking = (0, mongoose_1.model)(model_names_1.MODELS.studioBooking, new mongoose_1.Schema({
|
|
30
31
|
user: {
|
|
@@ -53,7 +54,7 @@ exports.studioBooking = (0, mongoose_1.model)(model_names_1.MODELS.studioBooking
|
|
|
53
54
|
ref: model_names_1.MODELS.category,
|
|
54
55
|
required: true,
|
|
55
56
|
},
|
|
56
|
-
cycle: { type:
|
|
57
|
+
cycle: { type: String, default: cycles_1.CYCLES.studioBooking },
|
|
57
58
|
isDeleted: { type: Boolean, default: false },
|
|
58
59
|
creatives: [
|
|
59
60
|
{
|
|
@@ -80,5 +81,5 @@ exports.studioBooking = (0, mongoose_1.model)(model_names_1.MODELS.studioBooking
|
|
|
80
81
|
if (ret.attachments)
|
|
81
82
|
ret.attachments = ret.attachments.map((el) => process.env.BUCKET_HOST + '/' + el);
|
|
82
83
|
},
|
|
83
|
-
}
|
|
84
|
+
},
|
|
84
85
|
}));
|
package/package.json
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@duvdu-v1/duvdu",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"main": "./build/index.js",
|
|
5
|
-
"types": "./build/index.d.ts",
|
|
6
|
-
"files": [
|
|
7
|
-
"build/**/*"
|
|
8
|
-
],
|
|
9
|
-
"scripts": {
|
|
10
|
-
"clean": "rimraf ./build",
|
|
11
|
-
"build": "npm run clean && tsc",
|
|
12
|
-
"fix:build": "mv ./build/common/src/* ./build && rm -rf ./build/auth ./build/common",
|
|
13
|
-
"pub": "git add . && git commit -m \"updates\" && npm version patch && npm run build && npm publish",
|
|
14
|
-
"lint": "eslint .",
|
|
15
|
-
"lint:fix": "eslint --fix .",
|
|
16
|
-
"format": "prettier --write ."
|
|
17
|
-
},
|
|
18
|
-
"keywords": [],
|
|
19
|
-
"author": "motemed khaled",
|
|
20
|
-
"license": "ISC",
|
|
21
|
-
"dependencies": {
|
|
22
|
-
"@duvdu-v1/duvdu": "^1.1.4",
|
|
23
|
-
"@types/express": "^4.17.21",
|
|
24
|
-
"@types/express-session": "^1.18.0",
|
|
25
|
-
"@types/jsonwebtoken": "^9.0.5",
|
|
26
|
-
"@types/multer": "^1.4.11",
|
|
27
|
-
"@types/node": "^20.11.0",
|
|
28
|
-
"@typescript-eslint/eslint-plugin": "^6.19.0",
|
|
29
|
-
"@typescript-eslint/parser": "^6.19.0",
|
|
30
|
-
"aws-sdk": "^2.1595.0",
|
|
31
|
-
"connect-redis": "^7.1.1",
|
|
32
|
-
"express": "^4.18.2",
|
|
33
|
-
"express-async-errors": "^3.1.1",
|
|
34
|
-
"express-session": "^1.18.0",
|
|
35
|
-
"express-validator": "^7.0.1",
|
|
36
|
-
"jsonwebtoken": "^9.0.2",
|
|
37
|
-
"mongoose": "^8.0.4",
|
|
38
|
-
"multer": "^1.4.5-lts.1",
|
|
39
|
-
"node-nats-streaming": "^0.3.2",
|
|
40
|
-
"redis": "^4.6.13",
|
|
41
|
-
"rimraf": "^5.0.5",
|
|
42
|
-
"typescript": "^5.3.3",
|
|
43
|
-
"uuid": "^9.0.1"
|
|
44
|
-
},
|
|
45
|
-
"devDependencies": {
|
|
46
|
-
"@types/uuid": "^9.0.8",
|
|
47
|
-
"del-cli": "^5.1.0",
|
|
48
|
-
"eslint": "^8.56.0",
|
|
49
|
-
"eslint-config-prettier": "^9.1.0",
|
|
50
|
-
"eslint-plugin-import": "^2.29.1",
|
|
51
|
-
"eslint-plugin-prettier": "^5.1.3",
|
|
52
|
-
"prettier": "^3.2.4"
|
|
53
|
-
},
|
|
54
|
-
"description": ""
|
|
55
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@duvdu-v1/duvdu",
|
|
3
|
+
"version": "1.1.89",
|
|
4
|
+
"main": "./build/index.js",
|
|
5
|
+
"types": "./build/index.d.ts",
|
|
6
|
+
"files": [
|
|
7
|
+
"build/**/*"
|
|
8
|
+
],
|
|
9
|
+
"scripts": {
|
|
10
|
+
"clean": "rimraf ./build",
|
|
11
|
+
"build": "npm run clean && tsc",
|
|
12
|
+
"fix:build": "mv ./build/common/src/* ./build && rm -rf ./build/auth ./build/common",
|
|
13
|
+
"pub": "git add . && git commit -m \"updates\" && npm version patch && npm run build && npm publish",
|
|
14
|
+
"lint": "eslint .",
|
|
15
|
+
"lint:fix": "eslint --fix .",
|
|
16
|
+
"format": "prettier --write ."
|
|
17
|
+
},
|
|
18
|
+
"keywords": [],
|
|
19
|
+
"author": "motemed khaled",
|
|
20
|
+
"license": "ISC",
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@duvdu-v1/duvdu": "^1.1.4",
|
|
23
|
+
"@types/express": "^4.17.21",
|
|
24
|
+
"@types/express-session": "^1.18.0",
|
|
25
|
+
"@types/jsonwebtoken": "^9.0.5",
|
|
26
|
+
"@types/multer": "^1.4.11",
|
|
27
|
+
"@types/node": "^20.11.0",
|
|
28
|
+
"@typescript-eslint/eslint-plugin": "^6.19.0",
|
|
29
|
+
"@typescript-eslint/parser": "^6.19.0",
|
|
30
|
+
"aws-sdk": "^2.1595.0",
|
|
31
|
+
"connect-redis": "^7.1.1",
|
|
32
|
+
"express": "^4.18.2",
|
|
33
|
+
"express-async-errors": "^3.1.1",
|
|
34
|
+
"express-session": "^1.18.0",
|
|
35
|
+
"express-validator": "^7.0.1",
|
|
36
|
+
"jsonwebtoken": "^9.0.2",
|
|
37
|
+
"mongoose": "^8.0.4",
|
|
38
|
+
"multer": "^1.4.5-lts.1",
|
|
39
|
+
"node-nats-streaming": "^0.3.2",
|
|
40
|
+
"redis": "^4.6.13",
|
|
41
|
+
"rimraf": "^5.0.5",
|
|
42
|
+
"typescript": "^5.3.3",
|
|
43
|
+
"uuid": "^9.0.1"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/uuid": "^9.0.8",
|
|
47
|
+
"del-cli": "^5.1.0",
|
|
48
|
+
"eslint": "^8.56.0",
|
|
49
|
+
"eslint-config-prettier": "^9.1.0",
|
|
50
|
+
"eslint-plugin-import": "^2.29.1",
|
|
51
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
52
|
+
"prettier": "^3.2.4"
|
|
53
|
+
},
|
|
54
|
+
"description": ""
|
|
55
|
+
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.natsWrapper = void 0;
|
|
7
|
-
const node_nats_streaming_1 = __importDefault(require("node-nats-streaming"));
|
|
8
|
-
class NatsWrapper {
|
|
9
|
-
get client() {
|
|
10
|
-
if (!this._client) {
|
|
11
|
-
throw new Error('can not access nats client before conection');
|
|
12
|
-
}
|
|
13
|
-
return this._client;
|
|
14
|
-
}
|
|
15
|
-
connect(clusterId, clientId, url) {
|
|
16
|
-
this._client = node_nats_streaming_1.default.connect(clusterId, clientId, { url });
|
|
17
|
-
return new Promise((resolve, reject) => {
|
|
18
|
-
this.client.on('connect', () => {
|
|
19
|
-
console.log('connected to nats');
|
|
20
|
-
resolve();
|
|
21
|
-
});
|
|
22
|
-
this.client.on('error', (err) => {
|
|
23
|
-
reject(err);
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
exports.natsWrapper = new NatsWrapper();
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|