@infrab4a/connect-nestjs 1.1.0-beta.8 → 1.1.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/index.cjs.js +35 -3
- package/index.esm.js +36 -5
- package/package.json +2 -2
- package/src/consts/index.d.ts +1 -0
- package/src/consts/storage.const.d.ts +1 -0
- package/src/index.d.ts +1 -0
- package/src/nest-storage.module.d.ts +2 -0
package/index.cjs.js
CHANGED
|
@@ -11,6 +11,8 @@ const ES_CONFIG = 'ES_CONFIG';
|
|
|
11
11
|
|
|
12
12
|
const HASURA_OPTIONS = 'HASURA_OPTIONS';
|
|
13
13
|
|
|
14
|
+
const FIREBASE_STORAGE = 'FIREBASE_STORAGE';
|
|
15
|
+
|
|
14
16
|
/******************************************************************************
|
|
15
17
|
Copyright (c) Microsoft Corporation.
|
|
16
18
|
|
|
@@ -101,8 +103,8 @@ exports.NativeElasticSearchAdapter = class NativeElasticSearchAdapter {
|
|
|
101
103
|
document: data.toPlain(),
|
|
102
104
|
};
|
|
103
105
|
try {
|
|
104
|
-
await this.client.index(req);
|
|
105
|
-
logger.log({ req, res
|
|
106
|
+
const res = await this.client.index(req);
|
|
107
|
+
logger.log({ req, res });
|
|
106
108
|
}
|
|
107
109
|
catch (error) {
|
|
108
110
|
logger.error({ req, res: error });
|
|
@@ -306,6 +308,21 @@ exports.NestElasticSeachModule = NestElasticSeachModule_1 = __decorate([
|
|
|
306
308
|
})
|
|
307
309
|
], exports.NestElasticSeachModule);
|
|
308
310
|
|
|
311
|
+
exports.NestStorageModule = class NestStorageModule {
|
|
312
|
+
};
|
|
313
|
+
exports.NestStorageModule = __decorate([
|
|
314
|
+
common.Module({
|
|
315
|
+
providers: [
|
|
316
|
+
{
|
|
317
|
+
provide: FIREBASE_STORAGE,
|
|
318
|
+
useFactory: (firebaseAdmin) => firebaseAdmin.storage,
|
|
319
|
+
inject: [nestjsFirebase.FirebaseConstants.FIREBASE_TOKEN],
|
|
320
|
+
},
|
|
321
|
+
],
|
|
322
|
+
exports: [FIREBASE_STORAGE],
|
|
323
|
+
})
|
|
324
|
+
], exports.NestStorageModule);
|
|
325
|
+
|
|
309
326
|
var NestFirestoreModule_1;
|
|
310
327
|
exports.NestFirestoreModule = NestFirestoreModule_1 = class NestFirestoreModule {
|
|
311
328
|
static initializeApp(options) {
|
|
@@ -316,8 +333,9 @@ exports.NestFirestoreModule = NestFirestoreModule_1 = class NestFirestoreModule
|
|
|
316
333
|
nestjsFirebase.FirebaseModule.forRoot({
|
|
317
334
|
googleApplicationCredential: (_a = options === null || options === void 0 ? void 0 : options.firebase) === null || _a === void 0 ? void 0 : _a.googleApplicationCredential,
|
|
318
335
|
}),
|
|
336
|
+
exports.NestStorageModule,
|
|
319
337
|
],
|
|
320
|
-
exports: [nestjsFirebase.FirebaseModule],
|
|
338
|
+
exports: [nestjsFirebase.FirebaseModule, exports.NestStorageModule],
|
|
321
339
|
};
|
|
322
340
|
}
|
|
323
341
|
};
|
|
@@ -624,6 +642,17 @@ exports.NestHasuraGraphQLModule = NestHasuraGraphQLModule_1 = __decorate([
|
|
|
624
642
|
},
|
|
625
643
|
inject: ['HasuraConfig'],
|
|
626
644
|
},
|
|
645
|
+
{
|
|
646
|
+
provide: 'ProductStockNotificationRepository',
|
|
647
|
+
useExisting: connect.ProductStockNotificationHasuraGraphQLRepository,
|
|
648
|
+
},
|
|
649
|
+
{
|
|
650
|
+
provide: connect.ProductStockNotificationHasuraGraphQLRepository,
|
|
651
|
+
useFactory: (hasuraConfig) => {
|
|
652
|
+
return new connect.ProductStockNotificationHasuraGraphQLRepository(hasuraConfig);
|
|
653
|
+
},
|
|
654
|
+
inject: ['HasuraConfig'],
|
|
655
|
+
},
|
|
627
656
|
{
|
|
628
657
|
provide: 'CategoryFilterRepository',
|
|
629
658
|
useExisting: connect.CategoryFilterHasuraGraphQLRepository,
|
|
@@ -687,6 +716,8 @@ exports.NestHasuraGraphQLModule = NestHasuraGraphQLModule_1 = __decorate([
|
|
|
687
716
|
connect.ProductReviewsHasuraGraphQLRepository,
|
|
688
717
|
'VariantRepository',
|
|
689
718
|
connect.VariantHasuraGraphQLRepository,
|
|
719
|
+
'ProductStockNotificationRepository',
|
|
720
|
+
connect.ProductStockNotificationHasuraGraphQLRepository,
|
|
690
721
|
'CategoryFilterRepository',
|
|
691
722
|
connect.CategoryFilterHasuraGraphQLRepository,
|
|
692
723
|
'FilterOptionRepository',
|
|
@@ -727,4 +758,5 @@ exports.ConnectCollectionService = ConnectCollectionService;
|
|
|
727
758
|
exports.ConnectDocumentService = ConnectDocumentService;
|
|
728
759
|
exports.ConnectFirestoreService = ConnectFirestoreService;
|
|
729
760
|
exports.ES_CONFIG = ES_CONFIG;
|
|
761
|
+
exports.FIREBASE_STORAGE = FIREBASE_STORAGE;
|
|
730
762
|
exports.HASURA_OPTIONS = HASURA_OPTIONS;
|
package/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Client } from '@elastic/elasticsearch';
|
|
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';
|
|
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, ProductStockNotificationHasuraGraphQLRepository, FilterOptionHasuraGraphQLRepository, FilterHasuraGraphQLRepository, CategoryCollectionChildrenHasuraGraphQLRepository, WishlistHasuraGraphQLRepository, isNil } from '@infrab4a/connect';
|
|
3
3
|
import { Injectable, Inject, Module } from '@nestjs/common';
|
|
4
4
|
import { FirebaseConstants, FirebaseModule } from 'nestjs-firebase';
|
|
5
5
|
|
|
@@ -7,6 +7,8 @@ const ES_CONFIG = 'ES_CONFIG';
|
|
|
7
7
|
|
|
8
8
|
const HASURA_OPTIONS = 'HASURA_OPTIONS';
|
|
9
9
|
|
|
10
|
+
const FIREBASE_STORAGE = 'FIREBASE_STORAGE';
|
|
11
|
+
|
|
10
12
|
/******************************************************************************
|
|
11
13
|
Copyright (c) Microsoft Corporation.
|
|
12
14
|
|
|
@@ -97,8 +99,8 @@ let NativeElasticSearchAdapter = class NativeElasticSearchAdapter {
|
|
|
97
99
|
document: data.toPlain(),
|
|
98
100
|
};
|
|
99
101
|
try {
|
|
100
|
-
await this.client.index(req);
|
|
101
|
-
logger.log({ req, res
|
|
102
|
+
const res = await this.client.index(req);
|
|
103
|
+
logger.log({ req, res });
|
|
102
104
|
}
|
|
103
105
|
catch (error) {
|
|
104
106
|
logger.error({ req, res: error });
|
|
@@ -302,6 +304,21 @@ NestElasticSeachModule = NestElasticSeachModule_1 = __decorate([
|
|
|
302
304
|
})
|
|
303
305
|
], NestElasticSeachModule);
|
|
304
306
|
|
|
307
|
+
let NestStorageModule = class NestStorageModule {
|
|
308
|
+
};
|
|
309
|
+
NestStorageModule = __decorate([
|
|
310
|
+
Module({
|
|
311
|
+
providers: [
|
|
312
|
+
{
|
|
313
|
+
provide: FIREBASE_STORAGE,
|
|
314
|
+
useFactory: (firebaseAdmin) => firebaseAdmin.storage,
|
|
315
|
+
inject: [FirebaseConstants.FIREBASE_TOKEN],
|
|
316
|
+
},
|
|
317
|
+
],
|
|
318
|
+
exports: [FIREBASE_STORAGE],
|
|
319
|
+
})
|
|
320
|
+
], NestStorageModule);
|
|
321
|
+
|
|
305
322
|
var NestFirestoreModule_1;
|
|
306
323
|
let NestFirestoreModule = NestFirestoreModule_1 = class NestFirestoreModule {
|
|
307
324
|
static initializeApp(options) {
|
|
@@ -312,8 +329,9 @@ let NestFirestoreModule = NestFirestoreModule_1 = class NestFirestoreModule {
|
|
|
312
329
|
FirebaseModule.forRoot({
|
|
313
330
|
googleApplicationCredential: (_a = options === null || options === void 0 ? void 0 : options.firebase) === null || _a === void 0 ? void 0 : _a.googleApplicationCredential,
|
|
314
331
|
}),
|
|
332
|
+
NestStorageModule,
|
|
315
333
|
],
|
|
316
|
-
exports: [FirebaseModule],
|
|
334
|
+
exports: [FirebaseModule, NestStorageModule],
|
|
317
335
|
};
|
|
318
336
|
}
|
|
319
337
|
};
|
|
@@ -620,6 +638,17 @@ NestHasuraGraphQLModule = NestHasuraGraphQLModule_1 = __decorate([
|
|
|
620
638
|
},
|
|
621
639
|
inject: ['HasuraConfig'],
|
|
622
640
|
},
|
|
641
|
+
{
|
|
642
|
+
provide: 'ProductStockNotificationRepository',
|
|
643
|
+
useExisting: ProductStockNotificationHasuraGraphQLRepository,
|
|
644
|
+
},
|
|
645
|
+
{
|
|
646
|
+
provide: ProductStockNotificationHasuraGraphQLRepository,
|
|
647
|
+
useFactory: (hasuraConfig) => {
|
|
648
|
+
return new ProductStockNotificationHasuraGraphQLRepository(hasuraConfig);
|
|
649
|
+
},
|
|
650
|
+
inject: ['HasuraConfig'],
|
|
651
|
+
},
|
|
623
652
|
{
|
|
624
653
|
provide: 'CategoryFilterRepository',
|
|
625
654
|
useExisting: CategoryFilterHasuraGraphQLRepository,
|
|
@@ -683,6 +712,8 @@ NestHasuraGraphQLModule = NestHasuraGraphQLModule_1 = __decorate([
|
|
|
683
712
|
ProductReviewsHasuraGraphQLRepository,
|
|
684
713
|
'VariantRepository',
|
|
685
714
|
VariantHasuraGraphQLRepository,
|
|
715
|
+
'ProductStockNotificationRepository',
|
|
716
|
+
ProductStockNotificationHasuraGraphQLRepository,
|
|
686
717
|
'CategoryFilterRepository',
|
|
687
718
|
CategoryFilterHasuraGraphQLRepository,
|
|
688
719
|
'FilterOptionRepository',
|
|
@@ -719,4 +750,4 @@ NestConnectModule = NestConnectModule_1 = __decorate([
|
|
|
719
750
|
Module({})
|
|
720
751
|
], NestConnectModule);
|
|
721
752
|
|
|
722
|
-
export { ConnectCollectionService, ConnectDocumentService, ConnectFirestoreService, ES_CONFIG, HASURA_OPTIONS, NativeElasticSearchAdapter, NestConnectModule, NestElasticSeachModule, NestFirestoreModule, NestHasuraGraphQLModule };
|
|
753
|
+
export { ConnectCollectionService, ConnectDocumentService, ConnectFirestoreService, ES_CONFIG, FIREBASE_STORAGE, HASURA_OPTIONS, NativeElasticSearchAdapter, NestConnectModule, NestElasticSeachModule, NestFirestoreModule, NestHasuraGraphQLModule, NestStorageModule };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infrab4a/connect-nestjs",
|
|
3
|
-
"version": "1.1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org"
|
|
6
6
|
},
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"url": "https://github.com/B4AGroup/b4a-firebase-libs"
|
|
10
10
|
},
|
|
11
11
|
"peerDependencies": {
|
|
12
|
-
"@infrab4a/connect": "4.9.0",
|
|
12
|
+
"@infrab4a/connect": "^4.9.0",
|
|
13
13
|
"@nestjs/common": "^10.3.3",
|
|
14
14
|
"@nestjs/core": "^10.3.3",
|
|
15
15
|
"firebase-admin": "^12.0.0"
|
package/src/consts/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FIREBASE_STORAGE = "FIREBASE_STORAGE";
|
package/src/index.d.ts
CHANGED