@infrab4a/connect-nestjs 1.1.0-beta.2 → 1.1.0-beta.4

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 CHANGED
@@ -98,7 +98,7 @@ exports.NativeElasticSearchAdapter = class NativeElasticSearchAdapter {
98
98
  id: data.identifiersFields.length > 1
99
99
  ? JSON.stringify(data.identifier)
100
100
  : Object.values(data.identifier).shift().toString(),
101
- document: data,
101
+ document: data.toPlain(),
102
102
  };
103
103
  try {
104
104
  await this.client.index(req);
@@ -283,7 +283,7 @@ class ConnectFirestoreService {
283
283
  }
284
284
 
285
285
  var NestElasticSeachModule_1;
286
- let NestElasticSeachModule = NestElasticSeachModule_1 = class NestElasticSeachModule {
286
+ exports.NestElasticSeachModule = NestElasticSeachModule_1 = class NestElasticSeachModule {
287
287
  static initializeApp(options) {
288
288
  return {
289
289
  module: NestElasticSeachModule_1,
@@ -292,7 +292,7 @@ let NestElasticSeachModule = NestElasticSeachModule_1 = class NestElasticSeachMo
292
292
  };
293
293
  }
294
294
  };
295
- NestElasticSeachModule = NestElasticSeachModule_1 = __decorate([
295
+ exports.NestElasticSeachModule = NestElasticSeachModule_1 = __decorate([
296
296
  common.Module({
297
297
  providers: [
298
298
  exports.NativeElasticSearchAdapter,
@@ -304,7 +304,7 @@ NestElasticSeachModule = NestElasticSeachModule_1 = __decorate([
304
304
  ],
305
305
  exports: [connect.ProductsIndex],
306
306
  })
307
- ], NestElasticSeachModule);
307
+ ], exports.NestElasticSeachModule);
308
308
 
309
309
  var NestFirestoreModule_1;
310
310
  exports.NestFirestoreModule = NestFirestoreModule_1 = class NestFirestoreModule {
@@ -312,9 +312,11 @@ exports.NestFirestoreModule = NestFirestoreModule_1 = class NestFirestoreModule
312
312
  return {
313
313
  module: NestFirestoreModule_1,
314
314
  imports: [
315
- nestjsFirebase.FirebaseModule.forRoot({
316
- googleApplicationCredential: options.firebase.googleApplicationCredential,
317
- }),
315
+ options.firebase.googleApplicationCredential
316
+ ? nestjsFirebase.FirebaseModule.forRoot({
317
+ googleApplicationCredential: options.firebase.googleApplicationCredential,
318
+ })
319
+ : nestjsFirebase.FirebaseModule,
318
320
  ],
319
321
  exports: [nestjsFirebase.FirebaseModule],
320
322
  };
@@ -700,14 +702,14 @@ exports.NestConnectModule = NestConnectModule_1 = class NestConnectModule {
700
702
  return {
701
703
  module: NestConnectModule_1,
702
704
  imports: [
703
- ...(options.firebase ? [exports.NestFirestoreModule] : []),
705
+ exports.NestFirestoreModule.initializeApp({ firebase: options.firebase }),
704
706
  ...(connect.isNil(options === null || options === void 0 ? void 0 : options.hasura) ? [] : [exports.NestHasuraGraphQLModule.initializeApp(options.hasura)]),
705
- ...(connect.isNil(options === null || options === void 0 ? void 0 : options.elasticSearch) ? [] : [NestElasticSeachModule.initializeApp(options.elasticSearch)]),
707
+ ...(connect.isNil(options === null || options === void 0 ? void 0 : options.elasticSearch) ? [] : [exports.NestElasticSeachModule.initializeApp(options.elasticSearch)]),
706
708
  ],
707
709
  exports: [
708
- ...(options.firebase ? [exports.NestFirestoreModule] : []),
710
+ exports.NestFirestoreModule,
709
711
  ...(connect.isNil(options === null || options === void 0 ? void 0 : options.hasura) ? [] : [exports.NestHasuraGraphQLModule]),
710
- ...(connect.isNil(options === null || options === void 0 ? void 0 : options.elasticSearch) ? [] : [NestElasticSeachModule]),
712
+ ...(connect.isNil(options === null || options === void 0 ? void 0 : options.elasticSearch) ? [] : [exports.NestElasticSeachModule]),
711
713
  ],
712
714
  };
713
715
  }
package/index.esm.js CHANGED
@@ -94,7 +94,7 @@ let NativeElasticSearchAdapter = class NativeElasticSearchAdapter {
94
94
  id: data.identifiersFields.length > 1
95
95
  ? JSON.stringify(data.identifier)
96
96
  : Object.values(data.identifier).shift().toString(),
97
- document: data,
97
+ document: data.toPlain(),
98
98
  };
99
99
  try {
100
100
  await this.client.index(req);
@@ -308,9 +308,11 @@ let NestFirestoreModule = NestFirestoreModule_1 = class NestFirestoreModule {
308
308
  return {
309
309
  module: NestFirestoreModule_1,
310
310
  imports: [
311
- FirebaseModule.forRoot({
312
- googleApplicationCredential: options.firebase.googleApplicationCredential,
313
- }),
311
+ options.firebase.googleApplicationCredential
312
+ ? FirebaseModule.forRoot({
313
+ googleApplicationCredential: options.firebase.googleApplicationCredential,
314
+ })
315
+ : FirebaseModule,
314
316
  ],
315
317
  exports: [FirebaseModule],
316
318
  };
@@ -696,12 +698,12 @@ let NestConnectModule = NestConnectModule_1 = class NestConnectModule {
696
698
  return {
697
699
  module: NestConnectModule_1,
698
700
  imports: [
699
- ...(options.firebase ? [NestFirestoreModule] : []),
701
+ NestFirestoreModule.initializeApp({ firebase: options.firebase }),
700
702
  ...(isNil(options === null || options === void 0 ? void 0 : options.hasura) ? [] : [NestHasuraGraphQLModule.initializeApp(options.hasura)]),
701
703
  ...(isNil(options === null || options === void 0 ? void 0 : options.elasticSearch) ? [] : [NestElasticSeachModule.initializeApp(options.elasticSearch)]),
702
704
  ],
703
705
  exports: [
704
- ...(options.firebase ? [NestFirestoreModule] : []),
706
+ NestFirestoreModule,
705
707
  ...(isNil(options === null || options === void 0 ? void 0 : options.hasura) ? [] : [NestHasuraGraphQLModule]),
706
708
  ...(isNil(options === null || options === void 0 ? void 0 : options.elasticSearch) ? [] : [NestElasticSeachModule]),
707
709
  ],
@@ -712,4 +714,4 @@ NestConnectModule = NestConnectModule_1 = __decorate([
712
714
  Module({})
713
715
  ], NestConnectModule);
714
716
 
715
- export { ConnectCollectionService, ConnectDocumentService, ConnectFirestoreService, NativeElasticSearchAdapter, NestConnectModule, NestFirestoreModule, NestHasuraGraphQLModule };
717
+ export { ConnectCollectionService, ConnectDocumentService, ConnectFirestoreService, NativeElasticSearchAdapter, NestConnectModule, NestElasticSeachModule, NestFirestoreModule, NestHasuraGraphQLModule };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infrab4a/connect-nestjs",
3
- "version": "1.1.0-beta.2",
3
+ "version": "1.1.0-beta.4",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org"
6
6
  },
package/src/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './infra';
2
2
  export * from './nest-connect.module';
3
+ export * from './nest-elastic-search.module';
3
4
  export * from './nest-firestore.module';
4
5
  export * from './nest-hasura-graphql.module';
@@ -13,7 +13,7 @@ export declare class NativeElasticSearchAdapter<T extends BaseModel<T> = any> im
13
13
  constructor(config: ESClientOptions);
14
14
  get(index: string, id: string): Promise<T>;
15
15
  query(index: string, query: any): Promise<ElasticSearchResult<T>>;
16
- save(index: string, data: Partial<T>): Promise<void>;
16
+ save(index: string, data: T): Promise<void>;
17
17
  update(index: string, id: string, data: Partial<T>): Promise<void>;
18
18
  delete(index: string, id: string): Promise<void>;
19
19
  }