@mondart/nestjs-common-module-meilisearch 1.0.0
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/commands/add-or-update-object.command.d.ts +10 -0
- package/dist/commands/add-or-update-object.command.d.ts.map +1 -0
- package/dist/commands/add-or-update-object.command.js +11 -0
- package/dist/commands/add-or-update-object.command.js.map +1 -0
- package/dist/commands/delete-object.command.d.ts +6 -0
- package/dist/commands/delete-object.command.d.ts.map +1 -0
- package/dist/commands/delete-object.command.js +11 -0
- package/dist/commands/delete-object.command.js.map +1 -0
- package/dist/commands/save-partially.command.d.ts +10 -0
- package/dist/commands/save-partially.command.d.ts.map +1 -0
- package/dist/commands/save-partially.command.js +11 -0
- package/dist/commands/save-partially.command.js.map +1 -0
- package/dist/constants/meili.const.d.ts +3 -0
- package/dist/constants/meili.const.d.ts.map +1 -0
- package/dist/constants/meili.const.js +6 -0
- package/dist/constants/meili.const.js.map +1 -0
- package/dist/dto/add-or-update-object-request.dto.d.ts +6 -0
- package/dist/dto/add-or-update-object-request.dto.d.ts.map +1 -0
- package/dist/dto/add-or-update-object-request.dto.js +32 -0
- package/dist/dto/add-or-update-object-request.dto.js.map +1 -0
- package/dist/dto/browse-request.dto.d.ts +5 -0
- package/dist/dto/browse-request.dto.d.ts.map +1 -0
- package/dist/dto/browse-request.dto.js +27 -0
- package/dist/dto/browse-request.dto.js.map +1 -0
- package/dist/dto/delete-object-request.dto.d.ts +5 -0
- package/dist/dto/delete-object-request.dto.d.ts.map +1 -0
- package/dist/dto/delete-object-request.dto.js +27 -0
- package/dist/dto/delete-object-request.dto.js.map +1 -0
- package/dist/dto/save-partially-request.dto.d.ts +6 -0
- package/dist/dto/save-partially-request.dto.d.ts.map +1 -0
- package/dist/dto/save-partially-request.dto.js +32 -0
- package/dist/dto/save-partially-request.dto.js.map +1 -0
- package/dist/dto/search-request.dto.d.ts +5 -0
- package/dist/dto/search-request.dto.d.ts.map +1 -0
- package/dist/dto/search-request.dto.js +27 -0
- package/dist/dto/search-request.dto.js.map +1 -0
- package/dist/handlers/add-or-update-object.handler.d.ts +12 -0
- package/dist/handlers/add-or-update-object.handler.d.ts.map +1 -0
- package/dist/handlers/add-or-update-object.handler.js +40 -0
- package/dist/handlers/add-or-update-object.handler.js.map +1 -0
- package/dist/handlers/browse.handler.d.ts +11 -0
- package/dist/handlers/browse.handler.d.ts.map +1 -0
- package/dist/handlers/browse.handler.js +40 -0
- package/dist/handlers/browse.handler.js.map +1 -0
- package/dist/handlers/delete-object.handler.d.ts +14 -0
- package/dist/handlers/delete-object.handler.d.ts.map +1 -0
- package/dist/handlers/delete-object.handler.js +40 -0
- package/dist/handlers/delete-object.handler.js.map +1 -0
- package/dist/handlers/save-partially.handler.d.ts +12 -0
- package/dist/handlers/save-partially.handler.d.ts.map +1 -0
- package/dist/handlers/save-partially.handler.js +40 -0
- package/dist/handlers/save-partially.handler.js.map +1 -0
- package/dist/handlers/search.handler.d.ts +11 -0
- package/dist/handlers/search.handler.d.ts.map +1 -0
- package/dist/handlers/search.handler.js +40 -0
- package/dist/handlers/search.handler.js.map +1 -0
- package/dist/helpers/meili-processor.helper.d.ts +23 -0
- package/dist/helpers/meili-processor.helper.d.ts.map +1 -0
- package/dist/helpers/meili-processor.helper.js +66 -0
- package/dist/helpers/meili-processor.helper.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/listeners/meili-processor-event.listener.d.ts +17 -0
- package/dist/listeners/meili-processor-event.listener.d.ts.map +1 -0
- package/dist/listeners/meili-processor-event.listener.js +72 -0
- package/dist/listeners/meili-processor-event.listener.js.map +1 -0
- package/dist/meilisearch.module.d.ts +1 -0
- package/dist/meilisearch.module.d.ts.map +1 -0
- package/dist/meilisearch.module.js +2 -0
- package/dist/meilisearch.module.js.map +1 -0
- package/dist/queries/browse.query.d.ts +6 -0
- package/dist/queries/browse.query.d.ts.map +1 -0
- package/dist/queries/browse.query.js +11 -0
- package/dist/queries/browse.query.js.map +1 -0
- package/dist/queries/search.query.d.ts +6 -0
- package/dist/queries/search.query.d.ts.map +1 -0
- package/dist/queries/search.query.js +11 -0
- package/dist/queries/search.query.js.map +1 -0
- package/dist/services/meili-client.service.d.ts +11 -0
- package/dist/services/meili-client.service.d.ts.map +1 -0
- package/dist/services/meili-client.service.js +49 -0
- package/dist/services/meili-client.service.js.map +1 -0
- package/package.json +35 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-or-update-object.command.d.ts","sourceRoot":"","sources":["../../src/commands/add-or-update-object.command.ts"],"names":[],"mappings":"AAAA,qBAAa,wBAAwB;IAE1B,KAAK,EAAE,MAAM;IACb,IAAI,EAAE,GAAG,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE;gBAD1B,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,GAAG,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE;CAEpC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AddOrUpdateObjectCommand = void 0;
|
|
4
|
+
class AddOrUpdateObjectCommand {
|
|
5
|
+
constructor(index, data) {
|
|
6
|
+
this.index = index;
|
|
7
|
+
this.data = data;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.AddOrUpdateObjectCommand = AddOrUpdateObjectCommand;
|
|
11
|
+
//# sourceMappingURL=add-or-update-object.command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-or-update-object.command.js","sourceRoot":"","sources":["../../src/commands/add-or-update-object.command.ts"],"names":[],"mappings":";;;AAAA,MAAa,wBAAwB;IACnC,YACS,KAAa,EACb,IAA0B;QAD1B,UAAK,GAAL,KAAK,CAAQ;QACb,SAAI,GAAJ,IAAI,CAAsB;IAChC,CAAC;CACL;AALD,4DAKC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-object.command.d.ts","sourceRoot":"","sources":["../../src/commands/delete-object.command.ts"],"names":[],"mappings":"AAAA,qBAAa,mBAAmB;IAErB,KAAK,EAAE,MAAM;IACb,EAAE,EAAE,MAAM;gBADV,KAAK,EAAE,MAAM,EACb,EAAE,EAAE,MAAM;CAEpB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteObjectCommand = void 0;
|
|
4
|
+
class DeleteObjectCommand {
|
|
5
|
+
constructor(index, id) {
|
|
6
|
+
this.index = index;
|
|
7
|
+
this.id = id;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.DeleteObjectCommand = DeleteObjectCommand;
|
|
11
|
+
//# sourceMappingURL=delete-object.command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-object.command.js","sourceRoot":"","sources":["../../src/commands/delete-object.command.ts"],"names":[],"mappings":";;;AAAA,MAAa,mBAAmB;IAC9B,YACS,KAAa,EACb,EAAU;QADV,UAAK,GAAL,KAAK,CAAQ;QACb,OAAE,GAAF,EAAE,CAAQ;IAChB,CAAC;CACL;AALD,kDAKC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"save-partially.command.d.ts","sourceRoot":"","sources":["../../src/commands/save-partially.command.ts"],"names":[],"mappings":"AAAA,qBAAa,oBAAoB;IAEtB,KAAK,EAAE,MAAM;IACb,IAAI,EAAE,GAAG,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE;gBAD1B,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,GAAG,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE;CAEpC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SavePartiallyCommand = void 0;
|
|
4
|
+
class SavePartiallyCommand {
|
|
5
|
+
constructor(index, data) {
|
|
6
|
+
this.index = index;
|
|
7
|
+
this.data = data;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.SavePartiallyCommand = SavePartiallyCommand;
|
|
11
|
+
//# sourceMappingURL=save-partially.command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"save-partially.command.js","sourceRoot":"","sources":["../../src/commands/save-partially.command.ts"],"names":[],"mappings":";;;AAAA,MAAa,oBAAoB;IAC/B,YACS,KAAa,EACb,IAA0B;QAD1B,UAAK,GAAL,KAAK,CAAQ;QACb,SAAI,GAAJ,IAAI,CAAsB;IAChC,CAAC;CACL;AALD,oDAKC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meili.const.d.ts","sourceRoot":"","sources":["../../src/constants/meili.const.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,EAAE,MAAM,EAAuB,CAAC;AACrE,eAAO,MAAM,0BAA0B,EAAE,MAAM,EAAuB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.commonFilterableAttributes = exports.commonSortableAttributes = void 0;
|
|
4
|
+
exports.commonSortableAttributes = ['objectID', 'id'];
|
|
5
|
+
exports.commonFilterableAttributes = ['objectID', 'id'];
|
|
6
|
+
//# sourceMappingURL=meili.const.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meili.const.js","sourceRoot":"","sources":["../../src/constants/meili.const.ts"],"names":[],"mappings":";;;AAAa,QAAA,wBAAwB,GAAa,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;AACxD,QAAA,0BAA0B,GAAa,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-or-update-object-request.dto.d.ts","sourceRoot":"","sources":["../../src/dto/add-or-update-object-request.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,2BAA2B;IAGtC,EAAE,EAAE,MAAM,CAAC;IAIX,SAAS,EAAE,MAAM,CAAC;IAIlB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AddOrUpdateObjectRequestDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class AddOrUpdateObjectRequestDto {
|
|
15
|
+
}
|
|
16
|
+
exports.AddOrUpdateObjectRequestDto = AddOrUpdateObjectRequestDto;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsString)(),
|
|
19
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], AddOrUpdateObjectRequestDto.prototype, "id", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsString)(),
|
|
24
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], AddOrUpdateObjectRequestDto.prototype, "indexName", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
29
|
+
(0, class_validator_1.IsObject)(),
|
|
30
|
+
__metadata("design:type", Object)
|
|
31
|
+
], AddOrUpdateObjectRequestDto.prototype, "body", void 0);
|
|
32
|
+
//# sourceMappingURL=add-or-update-object-request.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-or-update-object-request.dto.js","sourceRoot":"","sources":["../../src/dto/add-or-update-object-request.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAiE;AAEjE,MAAa,2BAA2B;CAYvC;AAZD,kEAYC;AATC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;uDACF;AAIX;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;8DACK;AAIlB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;yDACmB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browse-request.dto.d.ts","sourceRoot":"","sources":["../../src/dto/browse-request.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,gBAAgB;IAG3B,SAAS,EAAE,MAAM,CAAC;IAIlB,YAAY,CAAC,EAAE,GAAG,CAAC;CACpB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.BrowseRequestDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class BrowseRequestDto {
|
|
15
|
+
}
|
|
16
|
+
exports.BrowseRequestDto = BrowseRequestDto;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
19
|
+
(0, class_validator_1.IsString)(),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], BrowseRequestDto.prototype, "indexName", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsObject)(),
|
|
24
|
+
(0, class_validator_1.IsOptional)(),
|
|
25
|
+
__metadata("design:type", Object)
|
|
26
|
+
], BrowseRequestDto.prototype, "browseParams", void 0);
|
|
27
|
+
//# sourceMappingURL=browse-request.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browse-request.dto.js","sourceRoot":"","sources":["../../src/dto/browse-request.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA6E;AAE7E,MAAa,gBAAgB;CAQ5B;AARD,4CAQC;AALC;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;mDACO;AAIlB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;sDACM"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-object-request.dto.d.ts","sourceRoot":"","sources":["../../src/dto/delete-object-request.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,sBAAsB;IAGjC,EAAE,EAAE,MAAM,CAAC;IAIX,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.DeleteObjectRequestDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class DeleteObjectRequestDto {
|
|
15
|
+
}
|
|
16
|
+
exports.DeleteObjectRequestDto = DeleteObjectRequestDto;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsString)(),
|
|
19
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], DeleteObjectRequestDto.prototype, "id", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsString)(),
|
|
24
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], DeleteObjectRequestDto.prototype, "indexName", void 0);
|
|
27
|
+
//# sourceMappingURL=delete-object-request.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-object-request.dto.js","sourceRoot":"","sources":["../../src/dto/delete-object-request.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAuD;AAEvD,MAAa,sBAAsB;CAQlC;AARD,wDAQC;AALC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;kDACF;AAIX;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;yDACK"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"save-partially-request.dto.d.ts","sourceRoot":"","sources":["../../src/dto/save-partially-request.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,uBAAuB;IAGlC,SAAS,EAAE,MAAM,CAAC;IAIlB,EAAE,EAAE,MAAM,CAAC;IAIX,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACxC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SavePartiallyRequestDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class SavePartiallyRequestDto {
|
|
15
|
+
}
|
|
16
|
+
exports.SavePartiallyRequestDto = SavePartiallyRequestDto;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsString)(),
|
|
19
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], SavePartiallyRequestDto.prototype, "indexName", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsString)(),
|
|
24
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], SavePartiallyRequestDto.prototype, "id", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, class_validator_1.IsObject)(),
|
|
29
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
30
|
+
__metadata("design:type", Object)
|
|
31
|
+
], SavePartiallyRequestDto.prototype, "pagesToUpdate", void 0);
|
|
32
|
+
//# sourceMappingURL=save-partially-request.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"save-partially-request.dto.js","sourceRoot":"","sources":["../../src/dto/save-partially-request.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAiE;AAEjE,MAAa,uBAAuB;CAYnC;AAZD,0DAYC;AATC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;0DACK;AAIlB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;mDACF;AAIX;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;8DAC0B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-request.dto.d.ts","sourceRoot":"","sources":["../../src/dto/search-request.dto.ts"],"names":[],"mappings":"AAEA,qBAAa,gBAAgB;IAG3B,QAAQ,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;IAIrB,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SearchRequestDto = void 0;
|
|
13
|
+
const class_validator_1 = require("class-validator");
|
|
14
|
+
class SearchRequestDto {
|
|
15
|
+
}
|
|
16
|
+
exports.SearchRequestDto = SearchRequestDto;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, class_validator_1.IsArray)(),
|
|
19
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
20
|
+
__metadata("design:type", Array)
|
|
21
|
+
], SearchRequestDto.prototype, "requests", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, class_validator_1.IsObject)(),
|
|
24
|
+
(0, class_validator_1.IsOptional)(),
|
|
25
|
+
__metadata("design:type", Object)
|
|
26
|
+
], SearchRequestDto.prototype, "strategy", void 0);
|
|
27
|
+
//# sourceMappingURL=search-request.dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-request.dto.js","sourceRoot":"","sources":["../../src/dto/search-request.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA4E;AAE5E,MAAa,gBAAgB;CAQ5B;AARD,4CAQC;AALC;IAFC,IAAA,yBAAO,GAAE;IACT,IAAA,4BAAU,GAAE;8BACH,KAAK;kDAAM;AAIrB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;kDACE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ICommandHandler } from '@nestjs/cqrs';
|
|
2
|
+
import { AddOrUpdateObjectCommand } from '../commands/add-or-update-object.command';
|
|
3
|
+
import { EnqueuedTask } from 'meilisearch';
|
|
4
|
+
import { MeiliClientService } from '../services/meili-client.service';
|
|
5
|
+
import { ConfigService } from '@nestjs/config';
|
|
6
|
+
export declare class AddOrUpdateObjectHandler implements ICommandHandler<AddOrUpdateObjectCommand> {
|
|
7
|
+
private readonly meiliClientService;
|
|
8
|
+
private readonly configService;
|
|
9
|
+
constructor(meiliClientService: MeiliClientService, configService: ConfigService);
|
|
10
|
+
execute(command: AddOrUpdateObjectCommand): Promise<EnqueuedTask>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=add-or-update-object.handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-or-update-object.handler.d.ts","sourceRoot":"","sources":["../../src/handlers/add-or-update-object.handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACpF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,qBACa,wBAAyB,YAAW,eAAe,CAAC,wBAAwB,CAAC;IAGtF,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IAEnC,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAFb,kBAAkB,EAAE,kBAAkB,EAEtC,aAAa,EAAE,aAAa;IAGzC,OAAO,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,YAAY,CAAC;CAQxE"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.AddOrUpdateObjectHandler = void 0;
|
|
16
|
+
const cqrs_1 = require("@nestjs/cqrs");
|
|
17
|
+
const add_or_update_object_command_1 = require("../commands/add-or-update-object.command");
|
|
18
|
+
const common_1 = require("@nestjs/common");
|
|
19
|
+
const meili_client_service_1 = require("../services/meili-client.service");
|
|
20
|
+
const config_1 = require("@nestjs/config");
|
|
21
|
+
let AddOrUpdateObjectHandler = class AddOrUpdateObjectHandler {
|
|
22
|
+
constructor(meiliClientService, configService) {
|
|
23
|
+
this.meiliClientService = meiliClientService;
|
|
24
|
+
this.configService = configService;
|
|
25
|
+
}
|
|
26
|
+
async execute(command) {
|
|
27
|
+
const indexPrefix = this.configService.get('meili.prefix') || '';
|
|
28
|
+
const meiliIndex = this.meiliClientService.client.index([indexPrefix, command.index].join(''));
|
|
29
|
+
return meiliIndex.addDocuments([command.data.body]);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
exports.AddOrUpdateObjectHandler = AddOrUpdateObjectHandler;
|
|
33
|
+
exports.AddOrUpdateObjectHandler = AddOrUpdateObjectHandler = __decorate([
|
|
34
|
+
(0, cqrs_1.CommandHandler)(add_or_update_object_command_1.AddOrUpdateObjectCommand),
|
|
35
|
+
__param(0, (0, common_1.Inject)(meili_client_service_1.MeiliClientService)),
|
|
36
|
+
__param(1, (0, common_1.Inject)(config_1.ConfigService)),
|
|
37
|
+
__metadata("design:paramtypes", [meili_client_service_1.MeiliClientService,
|
|
38
|
+
config_1.ConfigService])
|
|
39
|
+
], AddOrUpdateObjectHandler);
|
|
40
|
+
//# sourceMappingURL=add-or-update-object.handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-or-update-object.handler.js","sourceRoot":"","sources":["../../src/handlers/add-or-update-object.handler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uCAA+D;AAC/D,2FAAoF;AAEpF,2CAAwC;AACxC,2EAAsE;AACtE,2CAA+C;AAGxC,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;IACnC,YAEmB,kBAAsC,EAEtC,aAA4B;QAF5B,uBAAkB,GAAlB,kBAAkB,CAAoB;QAEtC,kBAAa,GAAb,aAAa,CAAe;IAC5C,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,OAAiC;QAC7C,MAAM,WAAW,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,cAAc,CAAC,IAAI,EAAE,CAAC;QACzE,MAAM,UAAU,GAAG,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,KAAK,CACrD,CAAC,WAAW,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CACtC,CAAC;QAEF,OAAO,UAAU,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACtD,CAAC;CACF,CAAA;AAhBY,4DAAwB;mCAAxB,wBAAwB;IADpC,IAAA,qBAAc,EAAC,uDAAwB,CAAC;IAGpC,WAAA,IAAA,eAAM,EAAC,yCAAkB,CAAC,CAAA;IAE1B,WAAA,IAAA,eAAM,EAAC,sBAAa,CAAC,CAAA;qCADe,yCAAkB;QAEvB,sBAAa;GALpC,wBAAwB,CAgBpC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BrowseQuery } from '../queries/browse.query';
|
|
2
|
+
import { IQueryHandler } from '@nestjs/cqrs';
|
|
3
|
+
import { MeiliClientService } from '../services/meili-client.service';
|
|
4
|
+
import { ConfigService } from '@nestjs/config';
|
|
5
|
+
export declare class BrowseHandler implements IQueryHandler<BrowseQuery> {
|
|
6
|
+
private readonly meiliClientService;
|
|
7
|
+
private readonly configService;
|
|
8
|
+
constructor(meiliClientService: MeiliClientService, configService: ConfigService);
|
|
9
|
+
execute(query: BrowseQuery): Promise<import("meilisearch").ResourceResults<import("meilisearch").RecordAny[]>>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=browse.handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browse.handler.d.ts","sourceRoot":"","sources":["../../src/handlers/browse.handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAgB,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,qBACa,aAAc,YAAW,aAAa,CAAC,WAAW,CAAC;IAG5D,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IAEnC,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAFb,kBAAkB,EAAE,kBAAkB,EAEtC,aAAa,EAAE,aAAa;IAGzC,OAAO,CAAC,KAAK,EAAE,WAAW;CAOjC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.BrowseHandler = void 0;
|
|
16
|
+
const browse_query_1 = require("../queries/browse.query");
|
|
17
|
+
const cqrs_1 = require("@nestjs/cqrs");
|
|
18
|
+
const common_1 = require("@nestjs/common");
|
|
19
|
+
const meili_client_service_1 = require("../services/meili-client.service");
|
|
20
|
+
const config_1 = require("@nestjs/config");
|
|
21
|
+
let BrowseHandler = class BrowseHandler {
|
|
22
|
+
constructor(meiliClientService, configService) {
|
|
23
|
+
this.meiliClientService = meiliClientService;
|
|
24
|
+
this.configService = configService;
|
|
25
|
+
}
|
|
26
|
+
async execute(query) {
|
|
27
|
+
const indexPrefix = this.configService.get('meili.prefix') || '';
|
|
28
|
+
const meiliIndex = this.meiliClientService.client.index([indexPrefix, query.index].join(''));
|
|
29
|
+
return await meiliIndex.getDocuments(query.parameters);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
exports.BrowseHandler = BrowseHandler;
|
|
33
|
+
exports.BrowseHandler = BrowseHandler = __decorate([
|
|
34
|
+
(0, cqrs_1.QueryHandler)(browse_query_1.BrowseQuery),
|
|
35
|
+
__param(0, (0, common_1.Inject)(meili_client_service_1.MeiliClientService)),
|
|
36
|
+
__param(1, (0, common_1.Inject)(config_1.ConfigService)),
|
|
37
|
+
__metadata("design:paramtypes", [meili_client_service_1.MeiliClientService,
|
|
38
|
+
config_1.ConfigService])
|
|
39
|
+
], BrowseHandler);
|
|
40
|
+
//# sourceMappingURL=browse.handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browse.handler.js","sourceRoot":"","sources":["../../src/handlers/browse.handler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,0DAAsD;AACtD,uCAA2D;AAC3D,2CAAwC;AACxC,2EAAsE;AACtE,2CAA+C;AAGxC,IAAM,aAAa,GAAnB,MAAM,aAAa;IACxB,YAEmB,kBAAsC,EAEtC,aAA4B;QAF5B,uBAAkB,GAAlB,kBAAkB,CAAoB;QAEtC,kBAAa,GAAb,aAAa,CAAe;IAC5C,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,KAAkB;QAC9B,MAAM,WAAW,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,cAAc,CAAC,IAAI,EAAE,CAAC;QACzE,MAAM,UAAU,GAAG,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,KAAK,CACrD,CAAC,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CACpC,CAAC;QACF,OAAO,MAAM,UAAU,CAAC,YAAY,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACzD,CAAC;CACF,CAAA;AAfY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAY,EAAC,0BAAW,CAAC;IAGrB,WAAA,IAAA,eAAM,EAAC,yCAAkB,CAAC,CAAA;IAE1B,WAAA,IAAA,eAAM,EAAC,sBAAa,CAAC,CAAA;qCADe,yCAAkB;QAEvB,sBAAa;GALpC,aAAa,CAezB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ICommandHandler } from '@nestjs/cqrs';
|
|
2
|
+
import { DeleteObjectCommand } from '../commands/delete-object.command';
|
|
3
|
+
import { EnqueuedTask, Task, WaitOptions } from 'meilisearch';
|
|
4
|
+
import { MeiliClientService } from '../services/meili-client.service';
|
|
5
|
+
import { ConfigService } from '@nestjs/config';
|
|
6
|
+
export declare class DeleteObjectHandler implements ICommandHandler<DeleteObjectCommand> {
|
|
7
|
+
readonly meiliClientService: MeiliClientService;
|
|
8
|
+
private readonly configService;
|
|
9
|
+
constructor(meiliClientService: MeiliClientService, configService: ConfigService);
|
|
10
|
+
execute(command: DeleteObjectCommand): Promise<Promise<EnqueuedTask> & {
|
|
11
|
+
waitTask: (waitOptions?: WaitOptions) => Promise<Task>;
|
|
12
|
+
}>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=delete-object.handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-object.handler.d.ts","sourceRoot":"","sources":["../../src/handlers/delete-object.handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,qBACa,mBAAoB,YAAW,eAAe,CAAC,mBAAmB,CAAC;aAG5D,kBAAkB,EAAE,kBAAkB;IAEtD,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAFd,kBAAkB,EAAE,kBAAkB,EAErC,aAAa,EAAE,aAAa;IAGzC,OAAO,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAClD,OAAO,CAAC,YAAY,CAAC,GAAG;QACtB,QAAQ,EAAE,CAAC,WAAW,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;KACxD,CACF;CAQF"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.DeleteObjectHandler = void 0;
|
|
16
|
+
const cqrs_1 = require("@nestjs/cqrs");
|
|
17
|
+
const delete_object_command_1 = require("../commands/delete-object.command");
|
|
18
|
+
const common_1 = require("@nestjs/common");
|
|
19
|
+
const meili_client_service_1 = require("../services/meili-client.service");
|
|
20
|
+
const config_1 = require("@nestjs/config");
|
|
21
|
+
let DeleteObjectHandler = class DeleteObjectHandler {
|
|
22
|
+
constructor(meiliClientService, configService) {
|
|
23
|
+
this.meiliClientService = meiliClientService;
|
|
24
|
+
this.configService = configService;
|
|
25
|
+
}
|
|
26
|
+
async execute(command) {
|
|
27
|
+
const indexPrefix = this.configService.get('meili.prefix') || '';
|
|
28
|
+
const meiliIndex = this.meiliClientService.client.index([indexPrefix, command.index].join(''));
|
|
29
|
+
return meiliIndex.deleteDocument(command.id);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
exports.DeleteObjectHandler = DeleteObjectHandler;
|
|
33
|
+
exports.DeleteObjectHandler = DeleteObjectHandler = __decorate([
|
|
34
|
+
(0, cqrs_1.CommandHandler)(delete_object_command_1.DeleteObjectCommand),
|
|
35
|
+
__param(0, (0, common_1.Inject)(meili_client_service_1.MeiliClientService)),
|
|
36
|
+
__param(1, (0, common_1.Inject)(config_1.ConfigService)),
|
|
37
|
+
__metadata("design:paramtypes", [meili_client_service_1.MeiliClientService,
|
|
38
|
+
config_1.ConfigService])
|
|
39
|
+
], DeleteObjectHandler);
|
|
40
|
+
//# sourceMappingURL=delete-object.handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-object.handler.js","sourceRoot":"","sources":["../../src/handlers/delete-object.handler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uCAA+D;AAC/D,6EAAwE;AAExE,2CAAwC;AACxC,2EAAsE;AACtE,2CAA+C;AAGxC,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YAEkB,kBAAsC,EAErC,aAA4B;QAF7B,uBAAkB,GAAlB,kBAAkB,CAAoB;QAErC,kBAAa,GAAb,aAAa,CAAe;IAC5C,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,OAA4B;QAKxC,MAAM,WAAW,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,cAAc,CAAC,IAAI,EAAE,CAAC;QACzE,MAAM,UAAU,GAAG,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,KAAK,CACrD,CAAC,WAAW,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CACtC,CAAC;QAEF,OAAO,UAAU,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC/C,CAAC;CACF,CAAA;AApBY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,qBAAc,EAAC,2CAAmB,CAAC;IAG/B,WAAA,IAAA,eAAM,EAAC,yCAAkB,CAAC,CAAA;IAE1B,WAAA,IAAA,eAAM,EAAC,sBAAa,CAAC,CAAA;qCADc,yCAAkB;QAEtB,sBAAa;GALpC,mBAAmB,CAoB/B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ICommandHandler } from '@nestjs/cqrs';
|
|
2
|
+
import { SavePartiallyCommand } from '../commands/save-partially.command';
|
|
3
|
+
import { EnqueuedTask } from 'meilisearch';
|
|
4
|
+
import { MeiliClientService } from '../services/meili-client.service';
|
|
5
|
+
import { ConfigService } from '@nestjs/config';
|
|
6
|
+
export declare class SavePartiallyHandler implements ICommandHandler<SavePartiallyCommand> {
|
|
7
|
+
readonly meiliClientService: MeiliClientService;
|
|
8
|
+
private readonly configService;
|
|
9
|
+
constructor(meiliClientService: MeiliClientService, configService: ConfigService);
|
|
10
|
+
execute(command: SavePartiallyCommand): Promise<EnqueuedTask>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=save-partially.handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"save-partially.handler.d.ts","sourceRoot":"","sources":["../../src/handlers/save-partially.handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,qBACa,oBAAqB,YAAW,eAAe,CAAC,oBAAoB,CAAC;aAG9D,kBAAkB,EAAE,kBAAkB;IAEtD,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAFd,kBAAkB,EAAE,kBAAkB,EAErC,aAAa,EAAE,aAAa;IAGzC,OAAO,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,YAAY,CAAC;CAOpE"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.SavePartiallyHandler = void 0;
|
|
16
|
+
const cqrs_1 = require("@nestjs/cqrs");
|
|
17
|
+
const save_partially_command_1 = require("../commands/save-partially.command");
|
|
18
|
+
const common_1 = require("@nestjs/common");
|
|
19
|
+
const meili_client_service_1 = require("../services/meili-client.service");
|
|
20
|
+
const config_1 = require("@nestjs/config");
|
|
21
|
+
let SavePartiallyHandler = class SavePartiallyHandler {
|
|
22
|
+
constructor(meiliClientService, configService) {
|
|
23
|
+
this.meiliClientService = meiliClientService;
|
|
24
|
+
this.configService = configService;
|
|
25
|
+
}
|
|
26
|
+
async execute(command) {
|
|
27
|
+
const indexPrefix = this.configService.get('meili.prefix') || '';
|
|
28
|
+
const meiliIndex = this.meiliClientService.client.index([indexPrefix, command.index].join(''));
|
|
29
|
+
return meiliIndex.updateDocuments([command.data]);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
exports.SavePartiallyHandler = SavePartiallyHandler;
|
|
33
|
+
exports.SavePartiallyHandler = SavePartiallyHandler = __decorate([
|
|
34
|
+
(0, cqrs_1.CommandHandler)(save_partially_command_1.SavePartiallyCommand),
|
|
35
|
+
__param(0, (0, common_1.Inject)(meili_client_service_1.MeiliClientService)),
|
|
36
|
+
__param(1, (0, common_1.Inject)(config_1.ConfigService)),
|
|
37
|
+
__metadata("design:paramtypes", [meili_client_service_1.MeiliClientService,
|
|
38
|
+
config_1.ConfigService])
|
|
39
|
+
], SavePartiallyHandler);
|
|
40
|
+
//# sourceMappingURL=save-partially.handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"save-partially.handler.js","sourceRoot":"","sources":["../../src/handlers/save-partially.handler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uCAA+D;AAC/D,+EAA0E;AAE1E,2CAAwC;AACxC,2EAAsE;AACtE,2CAA+C;AAGxC,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAC/B,YAEkB,kBAAsC,EAErC,aAA4B;QAF7B,uBAAkB,GAAlB,kBAAkB,CAAoB;QAErC,kBAAa,GAAb,aAAa,CAAe;IAC5C,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,OAA6B;QACzC,MAAM,WAAW,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,cAAc,CAAC,IAAI,EAAE,CAAC;QACzE,MAAM,UAAU,GAAG,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,KAAK,CACrD,CAAC,WAAW,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CACtC,CAAC;QACF,OAAO,UAAU,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACpD,CAAC;CACF,CAAA;AAfY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,qBAAc,EAAC,6CAAoB,CAAC;IAGhC,WAAA,IAAA,eAAM,EAAC,yCAAkB,CAAC,CAAA;IAE1B,WAAA,IAAA,eAAM,EAAC,sBAAa,CAAC,CAAA;qCADc,yCAAkB;QAEtB,sBAAa;GALpC,oBAAoB,CAehC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IQueryHandler } from '@nestjs/cqrs';
|
|
2
|
+
import { SearchQuery } from '../queries/search.query';
|
|
3
|
+
import { MeiliClientService } from '../services/meili-client.service';
|
|
4
|
+
import { ConfigService } from '@nestjs/config';
|
|
5
|
+
export declare class SearchHandler implements IQueryHandler<SearchQuery> {
|
|
6
|
+
readonly meiliClientService: MeiliClientService;
|
|
7
|
+
private readonly configService;
|
|
8
|
+
constructor(meiliClientService: MeiliClientService, configService: ConfigService);
|
|
9
|
+
execute(query: SearchQuery): Promise<import("meilisearch").SearchResponse<import("meilisearch").RecordAny, import("meilisearch").SearchParams>>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=search.handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.handler.d.ts","sourceRoot":"","sources":["../../src/handlers/search.handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAgB,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,qBACa,aAAc,YAAW,aAAa,CAAC,WAAW,CAAC;aAG5C,kBAAkB,EAAE,kBAAkB;IAEtD,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAFd,kBAAkB,EAAE,kBAAkB,EAErC,aAAa,EAAE,aAAa;IAGzC,OAAO,CAAC,KAAK,EAAE,WAAW;CAQjC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.SearchHandler = void 0;
|
|
16
|
+
const cqrs_1 = require("@nestjs/cqrs");
|
|
17
|
+
const search_query_1 = require("../queries/search.query");
|
|
18
|
+
const common_1 = require("@nestjs/common");
|
|
19
|
+
const meili_client_service_1 = require("../services/meili-client.service");
|
|
20
|
+
const config_1 = require("@nestjs/config");
|
|
21
|
+
let SearchHandler = class SearchHandler {
|
|
22
|
+
constructor(meiliClientService, configService) {
|
|
23
|
+
this.meiliClientService = meiliClientService;
|
|
24
|
+
this.configService = configService;
|
|
25
|
+
}
|
|
26
|
+
async execute(query) {
|
|
27
|
+
const indexPrefix = this.configService.get('meili.prefix') || '';
|
|
28
|
+
const meiliIndex = this.meiliClientService.client.index([indexPrefix, query.index].join(''));
|
|
29
|
+
return await meiliIndex.search(query.data);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
exports.SearchHandler = SearchHandler;
|
|
33
|
+
exports.SearchHandler = SearchHandler = __decorate([
|
|
34
|
+
(0, cqrs_1.QueryHandler)(search_query_1.SearchQuery),
|
|
35
|
+
__param(0, (0, common_1.Inject)(meili_client_service_1.MeiliClientService)),
|
|
36
|
+
__param(1, (0, common_1.Inject)(config_1.ConfigService)),
|
|
37
|
+
__metadata("design:paramtypes", [meili_client_service_1.MeiliClientService,
|
|
38
|
+
config_1.ConfigService])
|
|
39
|
+
], SearchHandler);
|
|
40
|
+
//# sourceMappingURL=search.handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.handler.js","sourceRoot":"","sources":["../../src/handlers/search.handler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uCAA2D;AAC3D,0DAAsD;AACtD,2CAAwC;AACxC,2EAAsE;AACtE,2CAA+C;AAGxC,IAAM,aAAa,GAAnB,MAAM,aAAa;IACxB,YAEkB,kBAAsC,EAErC,aAA4B;QAF7B,uBAAkB,GAAlB,kBAAkB,CAAoB;QAErC,kBAAa,GAAb,aAAa,CAAe;IAC5C,CAAC;IAEJ,KAAK,CAAC,OAAO,CAAC,KAAkB;QAC9B,MAAM,WAAW,GAAG,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,cAAc,CAAC,IAAI,EAAE,CAAC;QAEzE,MAAM,UAAU,GAAG,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,KAAK,CACrD,CAAC,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CACpC,CAAC;QACF,OAAO,MAAM,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;CACF,CAAA;AAhBY,sCAAa;wBAAb,aAAa;IADzB,IAAA,mBAAY,EAAC,0BAAW,CAAC;IAGrB,WAAA,IAAA,eAAM,EAAC,yCAAkB,CAAC,CAAA;IAE1B,WAAA,IAAA,eAAM,EAAC,sBAAa,CAAC,CAAA;qCADc,yCAAkB;QAEtB,sBAAa;GALpC,aAAa,CAgBzB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Queue } from 'bullmq';
|
|
2
|
+
export declare class MeiliProcessorHelper {
|
|
3
|
+
private readonly meiliQueue;
|
|
4
|
+
constructor(meiliQueue: Queue);
|
|
5
|
+
private readonly jonDurationMap;
|
|
6
|
+
private readonly jobDurations;
|
|
7
|
+
private readonly maxSamples;
|
|
8
|
+
getQueueStats(): Promise<{
|
|
9
|
+
waiting: number;
|
|
10
|
+
active: number;
|
|
11
|
+
completed: number;
|
|
12
|
+
total: number;
|
|
13
|
+
averageJobDurationMs: number;
|
|
14
|
+
estimatedTimeMs: number;
|
|
15
|
+
estimatedTimeHuman: string;
|
|
16
|
+
}>;
|
|
17
|
+
startDurationTimer(jobId: string): void;
|
|
18
|
+
endDurationTimer(jobId: string): number;
|
|
19
|
+
recordDuration(ms: number): void;
|
|
20
|
+
private getAverageDuration;
|
|
21
|
+
private formatDuration;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=meili-processor.helper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meili-processor.helper.d.ts","sourceRoot":"","sources":["../../src/helpers/meili-processor.helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE/B,qBAAa,oBAAoB;IACnB,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAAV,UAAU,EAAE,KAAK;IAE9C,OAAO,CAAC,QAAQ,CAAC,cAAc,CAG3B;IACJ,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAgB;IAC7C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAM;IAG3B,aAAa;;;;;;;;;IAqBnB,kBAAkB,CAAC,KAAK,EAAE,MAAM;IAIhC,gBAAgB,CAAC,KAAK,EAAE,MAAM;IAU9B,cAAc,CAAC,EAAE,EAAE,MAAM;IAQzB,OAAO,CAAC,kBAAkB;IAO1B,OAAO,CAAC,cAAc;CAUvB"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MeiliProcessorHelper = void 0;
|
|
4
|
+
class MeiliProcessorHelper {
|
|
5
|
+
constructor(meiliQueue) {
|
|
6
|
+
this.meiliQueue = meiliQueue;
|
|
7
|
+
this.jonDurationMap = new Map();
|
|
8
|
+
this.jobDurations = [];
|
|
9
|
+
this.maxSamples = 50;
|
|
10
|
+
}
|
|
11
|
+
async getQueueStats() {
|
|
12
|
+
const waiting = await this.meiliQueue.getWaitingCount();
|
|
13
|
+
const active = await this.meiliQueue.getActiveCount();
|
|
14
|
+
const completed = await this.meiliQueue.getCompletedCount();
|
|
15
|
+
const avgDuration = this.getAverageDuration();
|
|
16
|
+
const estimatedMsRemaining = waiting * avgDuration;
|
|
17
|
+
const total = waiting + active + completed;
|
|
18
|
+
return {
|
|
19
|
+
waiting,
|
|
20
|
+
active,
|
|
21
|
+
completed,
|
|
22
|
+
total,
|
|
23
|
+
averageJobDurationMs: Math.round(avgDuration),
|
|
24
|
+
estimatedTimeMs: Math.round(estimatedMsRemaining),
|
|
25
|
+
estimatedTimeHuman: this.formatDuration(estimatedMsRemaining),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
startDurationTimer(jobId) {
|
|
29
|
+
this.jonDurationMap.set(jobId, Date.now());
|
|
30
|
+
}
|
|
31
|
+
endDurationTimer(jobId) {
|
|
32
|
+
const start = this.jonDurationMap.get(jobId);
|
|
33
|
+
if (start) {
|
|
34
|
+
const duration = Date.now() - start;
|
|
35
|
+
this.jonDurationMap.delete(jobId);
|
|
36
|
+
return duration;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
recordDuration(ms) {
|
|
40
|
+
this.jobDurations.push(ms);
|
|
41
|
+
if (this.jobDurations.length > this.maxSamples) {
|
|
42
|
+
this.jobDurations.shift();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
getAverageDuration() {
|
|
46
|
+
if (this.jobDurations.length === 0)
|
|
47
|
+
return 300;
|
|
48
|
+
const sum = this.jobDurations.reduce((a, b) => a + b, 0);
|
|
49
|
+
return sum / this.jobDurations.length;
|
|
50
|
+
}
|
|
51
|
+
formatDuration(ms) {
|
|
52
|
+
const sec = Math.round(ms / 1000);
|
|
53
|
+
if (sec < 60)
|
|
54
|
+
return `${sec}s`;
|
|
55
|
+
const min = Math.round(sec / 60);
|
|
56
|
+
if (min < 60)
|
|
57
|
+
return `${min}m ${sec % 60}s`;
|
|
58
|
+
const hr = Math.round(min / 60);
|
|
59
|
+
if (hr < 24)
|
|
60
|
+
return `${hr}h ${min % 60}m`;
|
|
61
|
+
const days = Math.floor(hr / 24);
|
|
62
|
+
return `${days}d ${hr % 24}h`;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.MeiliProcessorHelper = MeiliProcessorHelper;
|
|
66
|
+
//# sourceMappingURL=meili-processor.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meili-processor.helper.js","sourceRoot":"","sources":["../../src/helpers/meili-processor.helper.ts"],"names":[],"mappings":";;;AAEA,MAAa,oBAAoB;IAC/B,YAA6B,UAAiB;QAAjB,eAAU,GAAV,UAAU,CAAO;QAE7B,mBAAc,GAAwB,IAAI,GAAG,EAG3D,CAAC;QACa,iBAAY,GAAa,EAAE,CAAC;QAC5B,eAAU,GAAG,EAAE,CAAC;IAPgB,CAAC;IAUlD,KAAK,CAAC,aAAa;QACjB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,eAAe,EAAE,CAAC;QACxD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC;QACtD,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAC;QAE5D,MAAM,WAAW,GAAG,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC9C,MAAM,oBAAoB,GAAG,OAAO,GAAG,WAAW,CAAC;QAEnD,MAAM,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;QAE3C,OAAO;YACL,OAAO;YACP,MAAM;YACN,SAAS;YACT,KAAK;YACL,oBAAoB,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC;YAC7C,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC;YACjD,kBAAkB,EAAE,IAAI,CAAC,cAAc,CAAC,oBAAoB,CAAC;SAC9D,CAAC;IACJ,CAAC;IAED,kBAAkB,CAAC,KAAa;QAC9B,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED,gBAAgB,CAAC,KAAa;QAC5B,MAAM,KAAK,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAC7C,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC;YACpC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAClC,OAAO,QAAQ,CAAC;QAClB,CAAC;IACH,CAAC;IAGD,cAAc,CAAC,EAAU;QACvB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC3B,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;YAC/C,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;QAC5B,CAAC;IACH,CAAC;IAGO,kBAAkB;QACxB,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,GAAG,CAAC;QAC/C,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QACzD,OAAO,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC;IACxC,CAAC;IAGO,cAAc,CAAC,EAAU;QAC/B,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC;QAClC,IAAI,GAAG,GAAG,EAAE;YAAE,OAAO,GAAG,GAAG,GAAG,CAAC;QAC/B,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC;QACjC,IAAI,GAAG,GAAG,EAAE;YAAE,OAAO,GAAG,GAAG,KAAK,GAAG,GAAG,EAAE,GAAG,CAAC;QAC5C,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC;QAChC,IAAI,EAAE,GAAG,EAAE;YAAE,OAAO,GAAG,EAAE,KAAK,GAAG,GAAG,EAAE,GAAG,CAAC;QAC1C,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;QACjC,OAAO,GAAG,IAAI,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC;IAChC,CAAC;CACF;AAvED,oDAuEC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { WorkerHost } from '@nestjs/bullmq';
|
|
2
|
+
import { Job } from 'bullmq';
|
|
3
|
+
import { OnApplicationBootstrap, OnApplicationShutdown } from '@nestjs/common';
|
|
4
|
+
import { MeiliProcessorHelper } from '../helpers/meili-processor.helper';
|
|
5
|
+
export declare class MeiliProcessorEventListener extends WorkerHost implements OnApplicationBootstrap, OnApplicationShutdown {
|
|
6
|
+
private readonly queueName;
|
|
7
|
+
private readonly meiliProcessorHelper;
|
|
8
|
+
private readonly logger;
|
|
9
|
+
constructor(queueName: string, meiliProcessorHelper: MeiliProcessorHelper);
|
|
10
|
+
process(job: Job): Promise<any>;
|
|
11
|
+
onActive(job: Job): Promise<void>;
|
|
12
|
+
onCompleted(job: Job): Promise<void>;
|
|
13
|
+
onFailed(job: Job): Promise<void>;
|
|
14
|
+
onApplicationBootstrap(): Promise<void>;
|
|
15
|
+
onApplicationShutdown(signal?: string): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=meili-processor-event.listener.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meili-processor-event.listener.d.ts","sourceRoot":"","sources":["../../src/listeners/meili-processor-event.listener.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAC7B,OAAO,EAEL,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzE,qBAAa,2BACX,SAAQ,UACR,YAAW,sBAAsB,EAAE,qBAAqB;IAKtD,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IAJvC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAGb,SAAS,EAAE,MAAM,EACjB,oBAAoB,EAAE,oBAAoB;IAQ7D,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAKzB,QAAQ,CAAC,GAAG,EAAE,GAAG;IAOjB,WAAW,CAAC,GAAG,EAAE,GAAG;IAapB,QAAQ,CAAC,GAAG,EAAE,GAAG;IAMjB,sBAAsB;IAQtB,qBAAqB,CAAC,MAAM,CAAC,EAAE,MAAM;CAG5C"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.MeiliProcessorEventListener = void 0;
|
|
13
|
+
const bullmq_1 = require("@nestjs/bullmq");
|
|
14
|
+
const bullmq_2 = require("bullmq");
|
|
15
|
+
const common_1 = require("@nestjs/common");
|
|
16
|
+
const nestjs_common_module_core_1 = require("@mondart/nestjs-common-module-core");
|
|
17
|
+
class MeiliProcessorEventListener extends bullmq_1.WorkerHost {
|
|
18
|
+
constructor(queueName, meiliProcessorHelper) {
|
|
19
|
+
super();
|
|
20
|
+
this.queueName = queueName;
|
|
21
|
+
this.meiliProcessorHelper = meiliProcessorHelper;
|
|
22
|
+
this.logger = new common_1.Logger(queueName);
|
|
23
|
+
}
|
|
24
|
+
process(job) {
|
|
25
|
+
return Promise.resolve(undefined);
|
|
26
|
+
}
|
|
27
|
+
async onActive(job) {
|
|
28
|
+
this.meiliProcessorHelper.startDurationTimer(job.id);
|
|
29
|
+
nestjs_common_module_core_1.RamUsageHelper.logRamUsage(this.logger, `Start Processing job ${job.id}`);
|
|
30
|
+
}
|
|
31
|
+
async onCompleted(job) {
|
|
32
|
+
const executionTime = this.meiliProcessorHelper.endDurationTimer(job.id);
|
|
33
|
+
this.meiliProcessorHelper.recordDuration(executionTime);
|
|
34
|
+
this.logger.debug(`Job ${job.id} completed in ${executionTime}ms`);
|
|
35
|
+
nestjs_common_module_core_1.RamUsageHelper.logRamUsage(this.logger, `Finish Processing job ${job.id}`);
|
|
36
|
+
const stats = await this.meiliProcessorHelper.getQueueStats();
|
|
37
|
+
this.logger.log(`📊 Queue Stats → Waiting: ${stats.waiting}, Active: ${stats.active}, Avg Job: ${stats.averageJobDurationMs}ms, ETA: ${stats.estimatedTimeHuman}`);
|
|
38
|
+
}
|
|
39
|
+
async onFailed(job) {
|
|
40
|
+
this.meiliProcessorHelper.endDurationTimer(job.id);
|
|
41
|
+
this.logger.error(`Job ${job.id} failed with reason: ${job.failedReason}`);
|
|
42
|
+
}
|
|
43
|
+
async onApplicationBootstrap() {
|
|
44
|
+
await this.worker.waitUntilReady();
|
|
45
|
+
this.worker.run().catch((error) => {
|
|
46
|
+
this.worker.emit('error', error);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
async onApplicationShutdown(signal) {
|
|
50
|
+
await this.worker.close();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.MeiliProcessorEventListener = MeiliProcessorEventListener;
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, bullmq_1.OnWorkerEvent)('active'),
|
|
56
|
+
__metadata("design:type", Function),
|
|
57
|
+
__metadata("design:paramtypes", [bullmq_2.Job]),
|
|
58
|
+
__metadata("design:returntype", Promise)
|
|
59
|
+
], MeiliProcessorEventListener.prototype, "onActive", null);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, bullmq_1.OnWorkerEvent)('completed'),
|
|
62
|
+
__metadata("design:type", Function),
|
|
63
|
+
__metadata("design:paramtypes", [bullmq_2.Job]),
|
|
64
|
+
__metadata("design:returntype", Promise)
|
|
65
|
+
], MeiliProcessorEventListener.prototype, "onCompleted", null);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, bullmq_1.OnWorkerEvent)('failed'),
|
|
68
|
+
__metadata("design:type", Function),
|
|
69
|
+
__metadata("design:paramtypes", [bullmq_2.Job]),
|
|
70
|
+
__metadata("design:returntype", Promise)
|
|
71
|
+
], MeiliProcessorEventListener.prototype, "onFailed", null);
|
|
72
|
+
//# sourceMappingURL=meili-processor-event.listener.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meili-processor-event.listener.js","sourceRoot":"","sources":["../../src/listeners/meili-processor-event.listener.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA2D;AAC3D,mCAA6B;AAC7B,2CAIwB;AACxB,kFAAoE;AAGpE,MAAa,2BACX,SAAQ,mBAAU;IAKlB,YACmB,SAAiB,EACjB,oBAA0C;QAE3D,KAAK,EAAE,CAAC;QAHS,cAAS,GAAT,SAAS,CAAQ;QACjB,yBAAoB,GAApB,oBAAoB,CAAsB;QAI3D,IAAI,CAAC,MAAM,GAAG,IAAI,eAAM,CAAC,SAAS,CAAC,CAAC;IACtC,CAAC;IAGD,OAAO,CAAC,GAAQ;QACd,OAAO,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACpC,CAAC;IAGK,AAAN,KAAK,CAAC,QAAQ,CAAC,GAAQ;QACrB,IAAI,CAAC,oBAAoB,CAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAErD,0CAAc,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,wBAAwB,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;IAC5E,CAAC;IAGK,AAAN,KAAK,CAAC,WAAW,CAAC,GAAQ;QACxB,MAAM,aAAa,GAAG,IAAI,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACzE,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;QAExD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,EAAE,iBAAiB,aAAa,IAAI,CAAC,CAAC;QACnE,0CAAc,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,yBAAyB,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;QAC3E,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,aAAa,EAAE,CAAC;QAC9D,IAAI,CAAC,MAAM,CAAC,GAAG,CACb,6BAA6B,KAAK,CAAC,OAAO,aAAa,KAAK,CAAC,MAAM,cAAc,KAAK,CAAC,oBAAoB,YAAY,KAAK,CAAC,kBAAkB,EAAE,CAClJ,CAAC;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,QAAQ,CAAC,GAAQ;QACrB,IAAI,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAEnD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,EAAE,wBAAwB,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED,KAAK,CAAC,sBAAsB;QAC1B,MAAM,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC;QACnC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YAChC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;IACL,CAAC;IAGD,KAAK,CAAC,qBAAqB,CAAC,MAAe;QACzC,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IAC5B,CAAC;CACF;AA1DD,kEA0DC;AArCO;IADL,IAAA,sBAAa,EAAC,QAAQ,CAAC;;qCACJ,YAAG;;2DAItB;AAGK;IADL,IAAA,sBAAa,EAAC,WAAW,CAAC;;qCACJ,YAAG;;8DAUzB;AAGK;IADL,IAAA,sBAAa,EAAC,QAAQ,CAAC;;qCACJ,YAAG;;2DAItB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=meilisearch.module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meilisearch.module.d.ts","sourceRoot":"","sources":["../src/meilisearch.module.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meilisearch.module.js","sourceRoot":"","sources":["../src/meilisearch.module.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browse.query.d.ts","sourceRoot":"","sources":["../../src/queries/browse.query.ts"],"names":[],"mappings":"AAAA,qBAAa,WAAW;IAEb,KAAK,EAAE,MAAM;IACb,UAAU,EAAE,GAAG;gBADf,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,GAAG;CAEzB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BrowseQuery = void 0;
|
|
4
|
+
class BrowseQuery {
|
|
5
|
+
constructor(index, parameters) {
|
|
6
|
+
this.index = index;
|
|
7
|
+
this.parameters = parameters;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.BrowseQuery = BrowseQuery;
|
|
11
|
+
//# sourceMappingURL=browse.query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browse.query.js","sourceRoot":"","sources":["../../src/queries/browse.query.ts"],"names":[],"mappings":";;;AAAA,MAAa,WAAW;IACtB,YACS,KAAa,EACb,UAAe;QADf,UAAK,GAAL,KAAK,CAAQ;QACb,eAAU,GAAV,UAAU,CAAK;IACrB,CAAC;CACL;AALD,kCAKC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.query.d.ts","sourceRoot":"","sources":["../../src/queries/search.query.ts"],"names":[],"mappings":"AAAA,qBAAa,WAAW;IAEb,KAAK,EAAE,MAAM;IACb,IAAI,EAAE,GAAG;gBADT,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,GAAG;CAEnB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SearchQuery = void 0;
|
|
4
|
+
class SearchQuery {
|
|
5
|
+
constructor(index, data) {
|
|
6
|
+
this.index = index;
|
|
7
|
+
this.data = data;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.SearchQuery = SearchQuery;
|
|
11
|
+
//# sourceMappingURL=search.query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.query.js","sourceRoot":"","sources":["../../src/queries/search.query.ts"],"names":[],"mappings":";;;AAAA,MAAa,WAAW;IACtB,YACS,KAAa,EACb,IAAS;QADT,UAAK,GAAL,KAAK,CAAQ;QACb,SAAI,GAAJ,IAAI,CAAK;IACf,CAAC;CACL;AALD,kCAKC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ConfigService } from '@nestjs/config';
|
|
2
|
+
import { MeiliSearch } from 'meilisearch';
|
|
3
|
+
export declare class MeiliClientService {
|
|
4
|
+
private configService;
|
|
5
|
+
private readonly logger;
|
|
6
|
+
private _meiliClient;
|
|
7
|
+
constructor(configService: ConfigService);
|
|
8
|
+
get client(): MeiliSearch;
|
|
9
|
+
connect(): void;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=meili-client.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meili-client.service.d.ts","sourceRoot":"","sources":["../../src/services/meili-client.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,qBAAa,kBAAkB;IAGM,OAAO,CAAC,aAAa;IAFxD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuC;IAC9D,OAAO,CAAC,YAAY,CAAc;gBACS,aAAa,EAAE,aAAa;IAEvE,IAAI,MAAM,gBAET;IAED,OAAO;CAmBR"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var MeiliClientService_1;
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.MeiliClientService = void 0;
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const config_1 = require("@nestjs/config");
|
|
19
|
+
const meilisearch_1 = require("meilisearch");
|
|
20
|
+
let MeiliClientService = MeiliClientService_1 = class MeiliClientService {
|
|
21
|
+
constructor(configService) {
|
|
22
|
+
this.configService = configService;
|
|
23
|
+
this.logger = new common_1.Logger(MeiliClientService_1.name);
|
|
24
|
+
}
|
|
25
|
+
get client() {
|
|
26
|
+
return this._meiliClient;
|
|
27
|
+
}
|
|
28
|
+
connect() {
|
|
29
|
+
const config = {
|
|
30
|
+
host: this.configService.get('meili.host'),
|
|
31
|
+
apiKey: this.configService.get('meili.apiKey'),
|
|
32
|
+
};
|
|
33
|
+
if (!config?.host || !config?.apiKey) {
|
|
34
|
+
throw new Error('MeiliSearch configuration is missing');
|
|
35
|
+
}
|
|
36
|
+
if (!this._meiliClient) {
|
|
37
|
+
this._meiliClient = new meilisearch_1.MeiliSearch(config);
|
|
38
|
+
}
|
|
39
|
+
this._meiliClient.getStats().then((onFulfilled) => {
|
|
40
|
+
this.logger.log(`MeiliSearch connected. Stats: ${JSON.stringify(onFulfilled)}`);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
exports.MeiliClientService = MeiliClientService;
|
|
45
|
+
exports.MeiliClientService = MeiliClientService = MeiliClientService_1 = __decorate([
|
|
46
|
+
__param(0, (0, common_1.Inject)(config_1.ConfigService)),
|
|
47
|
+
__metadata("design:paramtypes", [config_1.ConfigService])
|
|
48
|
+
], MeiliClientService);
|
|
49
|
+
//# sourceMappingURL=meili-client.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meili-client.service.js","sourceRoot":"","sources":["../../src/services/meili-client.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAgD;AAChD,2CAA+C;AAC/C,6CAA0C;AAE1C,IAAa,kBAAkB,0BAA/B,MAAa,kBAAkB;IAG7B,YAAmC,aAAoC;QAA5B,kBAAa,GAAb,aAAa,CAAe;QAFtD,WAAM,GAAG,IAAI,eAAM,CAAC,oBAAkB,CAAC,IAAI,CAAC,CAAC;IAEY,CAAC;IAE3E,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,OAAO;QACL,MAAM,MAAM,GAAG;YACb,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,YAAY,CAAC;YAClD,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,cAAc,CAAC;SACvD,CAAC;QACF,IAAI,CAAC,MAAM,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;YACrC,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;QAC1D,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YACvB,IAAI,CAAC,YAAY,GAAG,IAAI,yBAAW,CAAC,MAAM,CAAC,CAAC;QAC9C,CAAC;QAED,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE;YAChD,IAAI,CAAC,MAAM,CAAC,GAAG,CACb,iCAAiC,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,CAC/D,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AA5BY,gDAAkB;6BAAlB,kBAAkB;IAGhB,WAAA,IAAA,eAAM,EAAC,sBAAa,CAAC,CAAA;qCAAwB,sBAAa;GAH5D,kBAAkB,CA4B9B"}
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mondart/nestjs-common-module-meilisearch",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Minio module for NestJS applications, providing an easy-to-use interface for interacting with Minio object storage.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Mondart"
|
|
7
|
+
},
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"type": "commonjs",
|
|
10
|
+
"main": "dist/index.js",
|
|
11
|
+
"types": "dist/index.d.ts",
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"README.md"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsc -p tsconfig.json"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@mondart/nestjs-common-module-core": "^3.1.0",
|
|
21
|
+
"@nestjs/bullmq": "^11.0.4",
|
|
22
|
+
"bullmq": "^5.70.0",
|
|
23
|
+
"meilisearch": "^0.55.0",
|
|
24
|
+
"nestjs-meilisearch": "^3.0.0"
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"@nestjs/common": "^11.1.10",
|
|
28
|
+
"@nestjs/core": "^11.1.10",
|
|
29
|
+
"reflect-metadata": "^0.2.0",
|
|
30
|
+
"rxjs": "^7.8.2"
|
|
31
|
+
},
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
}
|
|
35
|
+
}
|