@infrab4a/connect-nestjs 1.1.0-beta.5 → 1.1.0-beta.7
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/index.cjs.js +12 -12
- package/index.esm.js +12 -14
- package/package.json +1 -1
- package/src/index.d.ts +1 -0
package/index.cjs.js
CHANGED
|
@@ -7,6 +7,10 @@ var connect = require('@infrab4a/connect');
|
|
|
7
7
|
var common = require('@nestjs/common');
|
|
8
8
|
var nestjsFirebase = require('nestjs-firebase');
|
|
9
9
|
|
|
10
|
+
const ES_CONFIG = 'ES_CONFIG';
|
|
11
|
+
|
|
12
|
+
const HASURA_OPTIONS = 'HASURA_OPTIONS';
|
|
13
|
+
|
|
10
14
|
/******************************************************************************
|
|
11
15
|
Copyright (c) Microsoft Corporation.
|
|
12
16
|
|
|
@@ -42,10 +46,6 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
42
46
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
43
47
|
};
|
|
44
48
|
|
|
45
|
-
const ES_CONFIG = 'ES_CONFIG';
|
|
46
|
-
|
|
47
|
-
const HASURA_OPTIONS = 'HASURA_OPTIONS';
|
|
48
|
-
|
|
49
49
|
exports.NativeElasticSearchAdapter = class NativeElasticSearchAdapter {
|
|
50
50
|
constructor(config) {
|
|
51
51
|
this.logger = connect.DebugHelper.from(this);
|
|
@@ -313,11 +313,9 @@ exports.NestFirestoreModule = NestFirestoreModule_1 = class NestFirestoreModule
|
|
|
313
313
|
return {
|
|
314
314
|
module: NestFirestoreModule_1,
|
|
315
315
|
imports: [
|
|
316
|
-
|
|
317
|
-
?
|
|
318
|
-
|
|
319
|
-
})
|
|
320
|
-
: nestjsFirebase.FirebaseModule,
|
|
316
|
+
nestjsFirebase.FirebaseModule.forRoot({
|
|
317
|
+
googleApplicationCredential: (_a = options === null || options === void 0 ? void 0 : options.firebase) === null || _a === void 0 ? void 0 : _a.googleApplicationCredential,
|
|
318
|
+
}),
|
|
321
319
|
],
|
|
322
320
|
exports: [nestjsFirebase.FirebaseModule],
|
|
323
321
|
};
|
|
@@ -561,11 +559,11 @@ exports.NestHasuraGraphQLModule = NestHasuraGraphQLModule_1 = class NestHasuraGr
|
|
|
561
559
|
return {
|
|
562
560
|
module: NestHasuraGraphQLModule_1,
|
|
563
561
|
providers: [{ provide: HASURA_OPTIONS, useValue: options }],
|
|
562
|
+
exports: [HASURA_OPTIONS],
|
|
564
563
|
};
|
|
565
564
|
}
|
|
566
565
|
};
|
|
567
566
|
exports.NestHasuraGraphQLModule = NestHasuraGraphQLModule_1 = __decorate([
|
|
568
|
-
common.Global(),
|
|
569
567
|
common.Module({
|
|
570
568
|
providers: [
|
|
571
569
|
{
|
|
@@ -703,12 +701,12 @@ exports.NestConnectModule = NestConnectModule_1 = class NestConnectModule {
|
|
|
703
701
|
return {
|
|
704
702
|
module: NestConnectModule_1,
|
|
705
703
|
imports: [
|
|
706
|
-
exports.NestFirestoreModule.initializeApp({ firebase: options.firebase }),
|
|
704
|
+
...(options.firebase ? [exports.NestFirestoreModule.initializeApp({ firebase: options.firebase })] : []),
|
|
707
705
|
...(connect.isNil(options === null || options === void 0 ? void 0 : options.hasura) ? [] : [exports.NestHasuraGraphQLModule.initializeApp(options.hasura)]),
|
|
708
706
|
...(connect.isNil(options === null || options === void 0 ? void 0 : options.elasticSearch) ? [] : [exports.NestElasticSeachModule.initializeApp(options.elasticSearch)]),
|
|
709
707
|
],
|
|
710
708
|
exports: [
|
|
711
|
-
exports.NestFirestoreModule,
|
|
709
|
+
...(options.firebase ? [exports.NestFirestoreModule] : []),
|
|
712
710
|
...(connect.isNil(options === null || options === void 0 ? void 0 : options.hasura) ? [] : [exports.NestHasuraGraphQLModule]),
|
|
713
711
|
...(connect.isNil(options === null || options === void 0 ? void 0 : options.elasticSearch) ? [] : [exports.NestElasticSeachModule]),
|
|
714
712
|
],
|
|
@@ -722,3 +720,5 @@ exports.NestConnectModule = NestConnectModule_1 = __decorate([
|
|
|
722
720
|
exports.ConnectCollectionService = ConnectCollectionService;
|
|
723
721
|
exports.ConnectDocumentService = ConnectDocumentService;
|
|
724
722
|
exports.ConnectFirestoreService = ConnectFirestoreService;
|
|
723
|
+
exports.ES_CONFIG = ES_CONFIG;
|
|
724
|
+
exports.HASURA_OPTIONS = HASURA_OPTIONS;
|
package/index.esm.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { Client } from '@elastic/elasticsearch';
|
|
2
2
|
import { DebugHelper, isEmpty, NotFoundError, ProductsIndex, UserBeautyProfileFirestoreRepository, Buy2WinFirestoreRepository, CategoryFirestoreRepository, CheckoutFirestoreRepository, CheckoutSubscriptionFirestoreRepository, CouponFirestoreRepository, CampaignHashtagFirestoreRepository, CampaignDashboardFirestoreRepository, SubscriptionEditionFirestoreRepository, HomeFirestoreRepository, LeadFirestoreRepository, LegacyOrderFirestoreRepository, ShopMenuFirestoreRepository, OrderFirestoreRepository, PaymentFirestoreRepository, ProductFirestoreRepository, ShopSettingsFirestoreRepository, SubscriptionPaymentFirestoreRepository, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionFirestoreRepository, UserFirestoreRepository, UserAddressFirestoreRepository, UserPaymentMethodFirestoreRepository, SubscriptionMaterializationFirestoreRepository, SubscriptionSummaryFirestoreRepository, ProductVariantFirestoreRepository, CategoryHasuraGraphQLRepository, ProductHasuraGraphQLRepository, CategoryFilterHasuraGraphQLRepository, ProductReviewsHasuraGraphQLRepository, VariantHasuraGraphQLRepository, FilterOptionHasuraGraphQLRepository, FilterHasuraGraphQLRepository, CategoryCollectionChildrenHasuraGraphQLRepository, WishlistHasuraGraphQLRepository, isNil } from '@infrab4a/connect';
|
|
3
|
-
import { Injectable, Inject, Module
|
|
3
|
+
import { Injectable, Inject, Module } from '@nestjs/common';
|
|
4
4
|
import { FirebaseConstants, FirebaseModule } from 'nestjs-firebase';
|
|
5
5
|
|
|
6
|
+
const ES_CONFIG = 'ES_CONFIG';
|
|
7
|
+
|
|
8
|
+
const HASURA_OPTIONS = 'HASURA_OPTIONS';
|
|
9
|
+
|
|
6
10
|
/******************************************************************************
|
|
7
11
|
Copyright (c) Microsoft Corporation.
|
|
8
12
|
|
|
@@ -38,10 +42,6 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
38
42
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
39
43
|
};
|
|
40
44
|
|
|
41
|
-
const ES_CONFIG = 'ES_CONFIG';
|
|
42
|
-
|
|
43
|
-
const HASURA_OPTIONS = 'HASURA_OPTIONS';
|
|
44
|
-
|
|
45
45
|
let NativeElasticSearchAdapter = class NativeElasticSearchAdapter {
|
|
46
46
|
constructor(config) {
|
|
47
47
|
this.logger = DebugHelper.from(this);
|
|
@@ -309,11 +309,9 @@ let NestFirestoreModule = NestFirestoreModule_1 = class NestFirestoreModule {
|
|
|
309
309
|
return {
|
|
310
310
|
module: NestFirestoreModule_1,
|
|
311
311
|
imports: [
|
|
312
|
-
(
|
|
313
|
-
?
|
|
314
|
-
|
|
315
|
-
})
|
|
316
|
-
: FirebaseModule,
|
|
312
|
+
FirebaseModule.forRoot({
|
|
313
|
+
googleApplicationCredential: (_a = options === null || options === void 0 ? void 0 : options.firebase) === null || _a === void 0 ? void 0 : _a.googleApplicationCredential,
|
|
314
|
+
}),
|
|
317
315
|
],
|
|
318
316
|
exports: [FirebaseModule],
|
|
319
317
|
};
|
|
@@ -557,11 +555,11 @@ let NestHasuraGraphQLModule = NestHasuraGraphQLModule_1 = class NestHasuraGraphQ
|
|
|
557
555
|
return {
|
|
558
556
|
module: NestHasuraGraphQLModule_1,
|
|
559
557
|
providers: [{ provide: HASURA_OPTIONS, useValue: options }],
|
|
558
|
+
exports: [HASURA_OPTIONS],
|
|
560
559
|
};
|
|
561
560
|
}
|
|
562
561
|
};
|
|
563
562
|
NestHasuraGraphQLModule = NestHasuraGraphQLModule_1 = __decorate([
|
|
564
|
-
Global(),
|
|
565
563
|
Module({
|
|
566
564
|
providers: [
|
|
567
565
|
{
|
|
@@ -699,12 +697,12 @@ let NestConnectModule = NestConnectModule_1 = class NestConnectModule {
|
|
|
699
697
|
return {
|
|
700
698
|
module: NestConnectModule_1,
|
|
701
699
|
imports: [
|
|
702
|
-
NestFirestoreModule.initializeApp({ firebase: options.firebase }),
|
|
700
|
+
...(options.firebase ? [NestFirestoreModule.initializeApp({ firebase: options.firebase })] : []),
|
|
703
701
|
...(isNil(options === null || options === void 0 ? void 0 : options.hasura) ? [] : [NestHasuraGraphQLModule.initializeApp(options.hasura)]),
|
|
704
702
|
...(isNil(options === null || options === void 0 ? void 0 : options.elasticSearch) ? [] : [NestElasticSeachModule.initializeApp(options.elasticSearch)]),
|
|
705
703
|
],
|
|
706
704
|
exports: [
|
|
707
|
-
NestFirestoreModule,
|
|
705
|
+
...(options.firebase ? [NestFirestoreModule] : []),
|
|
708
706
|
...(isNil(options === null || options === void 0 ? void 0 : options.hasura) ? [] : [NestHasuraGraphQLModule]),
|
|
709
707
|
...(isNil(options === null || options === void 0 ? void 0 : options.elasticSearch) ? [] : [NestElasticSeachModule]),
|
|
710
708
|
],
|
|
@@ -715,4 +713,4 @@ NestConnectModule = NestConnectModule_1 = __decorate([
|
|
|
715
713
|
Module({})
|
|
716
714
|
], NestConnectModule);
|
|
717
715
|
|
|
718
|
-
export { ConnectCollectionService, ConnectDocumentService, ConnectFirestoreService, NativeElasticSearchAdapter, NestConnectModule, NestElasticSeachModule, NestFirestoreModule, NestHasuraGraphQLModule };
|
|
716
|
+
export { ConnectCollectionService, ConnectDocumentService, ConnectFirestoreService, ES_CONFIG, HASURA_OPTIONS, NativeElasticSearchAdapter, NestConnectModule, NestElasticSeachModule, NestFirestoreModule, NestHasuraGraphQLModule };
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED