@infrab4a/connect-nestjs 1.1.1 → 1.1.2

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.
Files changed (30) hide show
  1. package/index.cjs.js +686 -686
  2. package/index.esm.js +686 -686
  3. package/package.json +2 -2
  4. package/src/consts/es-config.const.d.ts +1 -1
  5. package/src/consts/hasura-options.const.d.ts +1 -1
  6. package/src/consts/index.d.ts +3 -3
  7. package/src/consts/storage.const.d.ts +1 -1
  8. package/src/index.d.ts +7 -7
  9. package/src/infra/elasticsearch/adapters/index.d.ts +1 -1
  10. package/src/infra/elasticsearch/adapters/native-elasticsearch-adapter.d.ts +19 -19
  11. package/src/infra/elasticsearch/index.d.ts +1 -1
  12. package/src/infra/firebase/firestore/index.d.ts +2 -2
  13. package/src/infra/firebase/firestore/services/connect-collection-reference.d.ts +19 -19
  14. package/src/infra/firebase/firestore/services/connect-collection.service.d.ts +32 -32
  15. package/src/infra/firebase/firestore/services/connect-document-reference.d.ts +11 -11
  16. package/src/infra/firebase/firestore/services/connect-document.service.d.ts +17 -17
  17. package/src/infra/firebase/firestore/services/connect-firestore.d.ts +7 -7
  18. package/src/infra/firebase/firestore/services/connect-firestore.service.d.ts +11 -11
  19. package/src/infra/firebase/firestore/services/index.d.ts +6 -6
  20. package/src/infra/firebase/firestore/types/connect-query-snapshot.type.d.ts +4 -4
  21. package/src/infra/firebase/firestore/types/index.d.ts +1 -1
  22. package/src/infra/firebase/firestore/vo/connect-base-document-snapshot.vo.d.ts +12 -12
  23. package/src/infra/firebase/firestore/vo/index.d.ts +1 -1
  24. package/src/infra/firebase/index.d.ts +1 -1
  25. package/src/infra/index.d.ts +2 -2
  26. package/src/nest-connect.module.d.ts +12 -12
  27. package/src/nest-elastic-search.module.d.ts +5 -5
  28. package/src/nest-firestore.module.d.ts +10 -10
  29. package/src/nest-hasura-graphql.module.d.ts +12 -12
  30. package/src/nest-storage.module.d.ts +2 -2
package/index.cjs.js CHANGED
@@ -48,710 +48,710 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
48
48
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
49
49
  };
50
50
 
51
- exports.NativeElasticSearchAdapter = class NativeElasticSearchAdapter {
52
- constructor(config) {
53
- this.logger = connect.DebugHelper.from(this);
54
- try {
55
- this.client = !connect.isEmpty(config.cloud.id) && !connect.isEmpty(config.auth.apiKey) && new elasticsearch.Client(config);
56
- }
57
- catch (error) {
58
- this.logger.error({ req: config, res: error });
59
- throw error;
60
- }
61
- }
62
- async get(index, id) {
63
- const logger = this.logger.with('get');
64
- const req = { index, id };
65
- try {
66
- const data = await this.client.get({ index, id });
67
- logger.log({ req, res: data });
68
- return data._source;
69
- }
70
- catch (error) {
71
- const message = error instanceof Error ? error.message : `${index}/${id} not found`;
72
- logger.log({ req, res: error });
73
- throw new connect.NotFoundError(message);
74
- }
75
- }
76
- async query(index, query) {
77
- const logger = this.logger.with('query');
78
- const params = {
79
- index,
80
- query,
81
- };
82
- try {
83
- const result = await this.client.search(params);
84
- const res = {
85
- total: result.hits.total,
86
- hits: result.hits.hits,
87
- };
88
- logger.log({ req: params, res });
89
- return res;
90
- }
91
- catch (error) {
92
- logger.error({ req: params, res: error });
93
- throw error;
94
- }
95
- }
96
- async save(index, data) {
97
- const logger = this.logger.with('save');
98
- const req = {
99
- index,
100
- id: data.identifiersFields.length > 1
101
- ? JSON.stringify(data.identifier)
102
- : Object.values(data.identifier).shift().toString(),
103
- document: data.toPlain(),
104
- };
105
- try {
106
- const res = await this.client.index(req);
107
- logger.log({ req, res });
108
- }
109
- catch (error) {
110
- logger.error({ req, res: error });
111
- throw error;
112
- }
113
- }
114
- async update(index, id, data) {
115
- const logger = this.logger.with('update');
116
- const req = {
117
- index,
118
- id,
119
- doc: data,
120
- };
121
- try {
122
- await this.client.update(req);
123
- logger.log({ req, res: undefined });
124
- }
125
- catch (error) {
126
- logger.error({ req, res: error });
127
- throw error;
128
- }
129
- }
130
- async delete(index, id) {
131
- const logger = this.logger.with('delete');
132
- const req = {
133
- index,
134
- id,
135
- };
136
- try {
137
- await this.client.delete(req);
138
- logger.log({ req, res: undefined });
139
- }
140
- catch (error) {
141
- logger.error({ req, res: error });
142
- throw error;
143
- }
144
- }
145
- };
146
- exports.NativeElasticSearchAdapter = __decorate([
147
- common.Injectable(),
148
- __param(0, common.Inject(ES_CONFIG)),
149
- __metadata("design:paramtypes", [Object])
51
+ exports.NativeElasticSearchAdapter = class NativeElasticSearchAdapter {
52
+ constructor(config) {
53
+ this.logger = connect.DebugHelper.from(this);
54
+ try {
55
+ this.client = !connect.isEmpty(config.cloud.id) && !connect.isEmpty(config.auth.apiKey) && new elasticsearch.Client(config);
56
+ }
57
+ catch (error) {
58
+ this.logger.error({ req: config, res: error });
59
+ throw error;
60
+ }
61
+ }
62
+ async get(index, id) {
63
+ const logger = this.logger.with('get');
64
+ const req = { index, id };
65
+ try {
66
+ const data = await this.client.get({ index, id });
67
+ logger.log({ req, res: data });
68
+ return data._source;
69
+ }
70
+ catch (error) {
71
+ const message = error instanceof Error ? error.message : `${index}/${id} not found`;
72
+ logger.log({ req, res: error });
73
+ throw new connect.NotFoundError(message);
74
+ }
75
+ }
76
+ async query(index, query) {
77
+ const logger = this.logger.with('query');
78
+ const params = {
79
+ index,
80
+ query,
81
+ };
82
+ try {
83
+ const result = await this.client.search(params);
84
+ const res = {
85
+ total: result.hits.total,
86
+ hits: result.hits.hits,
87
+ };
88
+ logger.log({ req: params, res });
89
+ return res;
90
+ }
91
+ catch (error) {
92
+ logger.error({ req: params, res: error });
93
+ throw error;
94
+ }
95
+ }
96
+ async save(index, data) {
97
+ const logger = this.logger.with('save');
98
+ const req = {
99
+ index,
100
+ id: data.identifiersFields.length > 1
101
+ ? JSON.stringify(data.identifier)
102
+ : Object.values(data.identifier).shift().toString(),
103
+ document: data.toPlain(),
104
+ };
105
+ try {
106
+ const res = await this.client.index(req);
107
+ logger.log({ req, res });
108
+ }
109
+ catch (error) {
110
+ logger.error({ req, res: error });
111
+ throw error;
112
+ }
113
+ }
114
+ async update(index, id, data) {
115
+ const logger = this.logger.with('update');
116
+ const req = {
117
+ index,
118
+ id,
119
+ doc: data,
120
+ };
121
+ try {
122
+ await this.client.update(req);
123
+ logger.log({ req, res: undefined });
124
+ }
125
+ catch (error) {
126
+ logger.error({ req, res: error });
127
+ throw error;
128
+ }
129
+ }
130
+ async delete(index, id) {
131
+ const logger = this.logger.with('delete');
132
+ const req = {
133
+ index,
134
+ id,
135
+ };
136
+ try {
137
+ await this.client.delete(req);
138
+ logger.log({ req, res: undefined });
139
+ }
140
+ catch (error) {
141
+ logger.error({ req, res: error });
142
+ throw error;
143
+ }
144
+ }
145
+ };
146
+ exports.NativeElasticSearchAdapter = __decorate([
147
+ common.Injectable(),
148
+ __param(0, common.Inject(ES_CONFIG)),
149
+ __metadata("design:paramtypes", [Object])
150
150
  ], exports.NativeElasticSearchAdapter);
151
151
 
152
- class ConnectBaseDocumentSnapshot {
153
- constructor(connectDocumentSnapshot) {
154
- this.connectDocumentSnapshot = connectDocumentSnapshot;
155
- this.id = connectDocumentSnapshot.id;
156
- }
157
- isNotEmpty() {
158
- return this.connectDocumentSnapshot.exists;
159
- }
160
- data(options) {
161
- return this.connectDocumentSnapshot.data();
162
- }
163
- get(fieldPath) {
164
- return this.connectDocumentSnapshot.get(fieldPath);
165
- }
152
+ class ConnectBaseDocumentSnapshot {
153
+ constructor(connectDocumentSnapshot) {
154
+ this.connectDocumentSnapshot = connectDocumentSnapshot;
155
+ this.id = connectDocumentSnapshot.id;
156
+ }
157
+ isNotEmpty() {
158
+ return this.connectDocumentSnapshot.exists;
159
+ }
160
+ data(options) {
161
+ return this.connectDocumentSnapshot.data();
162
+ }
163
+ get(fieldPath) {
164
+ return this.connectDocumentSnapshot.get(fieldPath);
165
+ }
166
166
  }
167
167
 
168
- class ConnectDocumentService {
169
- constructor(path, firestore) {
170
- this.path = path;
171
- this.firestore = firestore;
172
- this.reference = this.firestore.doc(this.path).withConverter({
173
- toFirestore: (data) => data,
174
- fromFirestore: (snapshot) => {
175
- return Object.assign({ id: snapshot.id }, snapshot.data());
176
- },
177
- });
178
- }
179
- async get() {
180
- return new ConnectBaseDocumentSnapshot(await this.reference.get());
181
- }
182
- getId() {
183
- return this.reference.id;
184
- }
185
- async save(data) {
186
- if (this.reference)
187
- this.reference.update(data);
188
- else
189
- await this.reference.create(data);
190
- return this;
191
- }
192
- async delete() {
193
- await this.reference.delete();
194
- }
195
- withConverter(params) {
196
- this.reference = this.reference.withConverter({
197
- toFirestore: (data) => params.toFirestore(data),
198
- fromFirestore: (snapshot, options) => params.fromFirestore(new ConnectBaseDocumentSnapshot(snapshot), options),
199
- });
200
- return this;
201
- }
168
+ class ConnectDocumentService {
169
+ constructor(path, firestore) {
170
+ this.path = path;
171
+ this.firestore = firestore;
172
+ this.reference = this.firestore.doc(this.path).withConverter({
173
+ toFirestore: (data) => data,
174
+ fromFirestore: (snapshot) => {
175
+ return Object.assign({ id: snapshot.id }, snapshot.data());
176
+ },
177
+ });
178
+ }
179
+ async get() {
180
+ return new ConnectBaseDocumentSnapshot(await this.reference.get());
181
+ }
182
+ getId() {
183
+ return this.reference.id;
184
+ }
185
+ async save(data) {
186
+ if (this.reference)
187
+ this.reference.update(data);
188
+ else
189
+ await this.reference.set(data);
190
+ return this;
191
+ }
192
+ async delete() {
193
+ await this.reference.delete();
194
+ }
195
+ withConverter(params) {
196
+ this.reference = this.reference.withConverter({
197
+ toFirestore: (data) => params.toFirestore(data),
198
+ fromFirestore: (snapshot, options) => params.fromFirestore(new ConnectBaseDocumentSnapshot(snapshot), options),
199
+ });
200
+ return this;
201
+ }
202
202
  }
203
203
 
204
- class ConnectCollectionService {
205
- constructor(path, firestore) {
206
- this.firestore = firestore;
207
- this.reference = firestore.collection(path).withConverter({
208
- toFirestore: (data) => data,
209
- fromFirestore: (snapshot) => {
210
- return Object.assign({ id: snapshot.id }, snapshot.data());
211
- },
212
- });
213
- }
214
- async add(data, id) {
215
- const newDoc = await this.save(data, id);
216
- return new ConnectDocumentService(newDoc.path, this.firestore).withConverter(this.converter);
217
- }
218
- async getDocs() {
219
- let query = this.query ? this.query : this.reference;
220
- query = this.orderBy ? query.orderBy(this.orderBy.fieldPath, this.orderBy.directionStr) : query;
221
- query = this.statingAt ? query.startAt(this.statingAt) : query;
222
- query = this.startingAfter ? query.startAfter(this.startingAfter) : query;
223
- query = this.offsetBy ? query.offset(this.offsetBy) : query;
224
- query = this.limitBy ? query.limit(this.limitBy) : query;
225
- return query.get().then((docs) => ({
226
- empty: docs.empty,
227
- size: docs.size,
228
- docs: docs.docs.map((doc) => new ConnectBaseDocumentSnapshot(doc)),
229
- }));
230
- }
231
- getDoc(id) {
232
- return new ConnectDocumentService(`${this.reference.path}/${id}`, this.firestore).withConverter(this.converter);
233
- }
234
- where(fieldPath, opStr, value) {
235
- this.query = this.query ? this.query.where(fieldPath, opStr, value) : this.reference.where(fieldPath, opStr, value);
236
- return this;
237
- }
238
- order(attribute, order) {
239
- this.orderBy = { fieldPath: attribute, directionStr: order };
240
- return this;
241
- }
242
- limit(quantity) {
243
- this.limitBy = quantity;
244
- return this;
245
- }
246
- offset(offsetBy) {
247
- this.offsetBy = offsetBy;
248
- return this;
249
- }
250
- fromStartAt(startingAt) {
251
- this.statingAt = startingAt;
252
- return this;
253
- }
254
- fromStartAfter(startingAt) {
255
- this.startingAfter = startingAt;
256
- return this;
257
- }
258
- withConverter(params) {
259
- this.converter = params;
260
- this.reference = this.reference.withConverter({
261
- toFirestore: (data) => params.toFirestore(data),
262
- fromFirestore: (snapshot, options) => params.fromFirestore(new ConnectBaseDocumentSnapshot(snapshot), options),
263
- });
264
- return this;
265
- }
266
- async save(data, id) {
267
- if (connect.isEmpty(id))
268
- return this.reference.add(data);
269
- const docRef = this.reference.doc(id);
270
- await docRef.update(data);
271
- return docRef;
272
- }
204
+ class ConnectCollectionService {
205
+ constructor(path, firestore) {
206
+ this.firestore = firestore;
207
+ this.reference = firestore.collection(path).withConverter({
208
+ toFirestore: (data) => data,
209
+ fromFirestore: (snapshot) => {
210
+ return Object.assign({ id: snapshot.id }, snapshot.data());
211
+ },
212
+ });
213
+ }
214
+ async add(data, id) {
215
+ const newDoc = await this.save(data, id);
216
+ return new ConnectDocumentService(newDoc.path, this.firestore).withConverter(this.converter);
217
+ }
218
+ async getDocs() {
219
+ let query = this.query ? this.query : this.reference;
220
+ query = this.orderBy ? query.orderBy(this.orderBy.fieldPath, this.orderBy.directionStr) : query;
221
+ query = this.statingAt ? query.startAt(this.statingAt) : query;
222
+ query = this.startingAfter ? query.startAfter(this.startingAfter) : query;
223
+ query = this.offsetBy ? query.offset(this.offsetBy) : query;
224
+ query = this.limitBy ? query.limit(this.limitBy) : query;
225
+ return query.get().then((docs) => ({
226
+ empty: docs.empty,
227
+ size: docs.size,
228
+ docs: docs.docs.map((doc) => new ConnectBaseDocumentSnapshot(doc)),
229
+ }));
230
+ }
231
+ getDoc(id) {
232
+ return new ConnectDocumentService(`${this.reference.path}/${id}`, this.firestore).withConverter(this.converter);
233
+ }
234
+ where(fieldPath, opStr, value) {
235
+ this.query = this.query ? this.query.where(fieldPath, opStr, value) : this.reference.where(fieldPath, opStr, value);
236
+ return this;
237
+ }
238
+ order(attribute, order) {
239
+ this.orderBy = { fieldPath: attribute, directionStr: order };
240
+ return this;
241
+ }
242
+ limit(quantity) {
243
+ this.limitBy = quantity;
244
+ return this;
245
+ }
246
+ offset(offsetBy) {
247
+ this.offsetBy = offsetBy;
248
+ return this;
249
+ }
250
+ fromStartAt(startingAt) {
251
+ this.statingAt = startingAt;
252
+ return this;
253
+ }
254
+ fromStartAfter(startingAt) {
255
+ this.startingAfter = startingAt;
256
+ return this;
257
+ }
258
+ withConverter(params) {
259
+ this.converter = params;
260
+ this.reference = this.reference.withConverter({
261
+ toFirestore: (data) => params.toFirestore(data),
262
+ fromFirestore: (snapshot, options) => params.fromFirestore(new ConnectBaseDocumentSnapshot(snapshot), options),
263
+ });
264
+ return this;
265
+ }
266
+ async save(data, id) {
267
+ if (connect.isEmpty(id))
268
+ return this.reference.add(data);
269
+ const docRef = this.reference.doc(id);
270
+ await docRef.set(data);
271
+ return docRef;
272
+ }
273
273
  }
274
274
 
275
- class ConnectFirestoreService {
276
- constructor(firestore) {
277
- this.firestore = firestore;
278
- }
279
- getCollection(path) {
280
- return new ConnectCollectionService(path, this.firestore);
281
- }
282
- getDocument(path) {
283
- return new ConnectDocumentService(path, this.firestore);
284
- }
275
+ class ConnectFirestoreService {
276
+ constructor(firestore) {
277
+ this.firestore = firestore;
278
+ }
279
+ getCollection(path) {
280
+ return new ConnectCollectionService(path, this.firestore);
281
+ }
282
+ getDocument(path) {
283
+ return new ConnectDocumentService(path, this.firestore);
284
+ }
285
285
  }
286
286
 
287
- var NestElasticSeachModule_1;
288
- exports.NestElasticSeachModule = NestElasticSeachModule_1 = class NestElasticSeachModule {
289
- static initializeApp(options) {
290
- return {
291
- module: NestElasticSeachModule_1,
292
- providers: [{ provide: ES_CONFIG, useValue: options }],
293
- exports: [ES_CONFIG],
294
- };
295
- }
296
- };
297
- exports.NestElasticSeachModule = NestElasticSeachModule_1 = __decorate([
298
- common.Module({
299
- providers: [
300
- exports.NativeElasticSearchAdapter,
301
- {
302
- provide: connect.ProductsIndex,
303
- useFactory: (adapter) => new connect.ProductsIndex(adapter),
304
- inject: [exports.NativeElasticSearchAdapter],
305
- },
306
- ],
307
- exports: [connect.ProductsIndex],
308
- })
287
+ var NestElasticSeachModule_1;
288
+ exports.NestElasticSeachModule = NestElasticSeachModule_1 = class NestElasticSeachModule {
289
+ static initializeApp(options) {
290
+ return {
291
+ module: NestElasticSeachModule_1,
292
+ providers: [{ provide: ES_CONFIG, useValue: options }],
293
+ exports: [ES_CONFIG],
294
+ };
295
+ }
296
+ };
297
+ exports.NestElasticSeachModule = NestElasticSeachModule_1 = __decorate([
298
+ common.Module({
299
+ providers: [
300
+ exports.NativeElasticSearchAdapter,
301
+ {
302
+ provide: connect.ProductsIndex,
303
+ useFactory: (adapter) => new connect.ProductsIndex(adapter),
304
+ inject: [exports.NativeElasticSearchAdapter],
305
+ },
306
+ ],
307
+ exports: [connect.ProductsIndex],
308
+ })
309
309
  ], exports.NestElasticSeachModule);
310
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
- })
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
324
  ], exports.NestStorageModule);
325
325
 
326
- var NestFirestoreModule_1;
327
- exports.NestFirestoreModule = NestFirestoreModule_1 = class NestFirestoreModule {
328
- static initializeApp(options) {
329
- var _a;
330
- return {
331
- module: NestFirestoreModule_1,
332
- imports: [
333
- nestjsFirebase.FirebaseModule.forRoot({
334
- googleApplicationCredential: (_a = options === null || options === void 0 ? void 0 : options.firebase) === null || _a === void 0 ? void 0 : _a.googleApplicationCredential,
335
- }),
336
- exports.NestStorageModule,
337
- ],
338
- exports: [nestjsFirebase.FirebaseModule, exports.NestStorageModule],
339
- };
340
- }
341
- };
342
- exports.NestFirestoreModule = NestFirestoreModule_1 = __decorate([
343
- common.Module({
344
- providers: [
345
- {
346
- provide: ConnectFirestoreService,
347
- useFactory: (firebaseAdmin) => new ConnectFirestoreService(firebaseAdmin.firestore),
348
- inject: [nestjsFirebase.FirebaseConstants.FIREBASE_TOKEN],
349
- },
350
- {
351
- provide: 'FirestoreOptions',
352
- useFactory: (connectFirestoreService) => ({
353
- firestore: connectFirestoreService,
354
- }),
355
- inject: [ConnectFirestoreService],
356
- },
357
- {
358
- provide: 'BeautyProfileRepository',
359
- useFactory: (config, userRepository) => {
360
- return new connect.UserBeautyProfileFirestoreRepository(config, userRepository);
361
- },
362
- inject: ['FirestoreOptions', 'UserRepository'],
363
- },
364
- {
365
- provide: 'Buy2WinRepository',
366
- useFactory: (options) => {
367
- return new connect.Buy2WinFirestoreRepository(options);
368
- },
369
- inject: ['FirestoreOptions'],
370
- },
371
- {
372
- provide: connect.CategoryFirestoreRepository,
373
- useFactory: (options) => {
374
- return new connect.CategoryFirestoreRepository(options);
375
- },
376
- inject: ['FirestoreOptions'],
377
- },
378
- {
379
- provide: 'CheckoutRepository',
380
- useFactory: (options) => {
381
- return new connect.CheckoutFirestoreRepository(options);
382
- },
383
- inject: ['FirestoreOptions'],
384
- },
385
- {
386
- provide: 'CheckoutSubscriptionRepository',
387
- useFactory: (options) => {
388
- return new connect.CheckoutSubscriptionFirestoreRepository(options);
389
- },
390
- inject: ['FirestoreOptions'],
391
- },
392
- {
393
- provide: 'CouponRepository',
394
- useFactory: (options) => {
395
- return new connect.CouponFirestoreRepository(options);
396
- },
397
- inject: ['FirestoreOptions'],
398
- },
399
- {
400
- provide: 'CampaignHashtagRepository',
401
- useFactory: (options) => {
402
- return new connect.CampaignHashtagFirestoreRepository(options);
403
- },
404
- inject: ['FirestoreOptions'],
405
- },
406
- {
407
- provide: 'CampaignDashboardRepository',
408
- useFactory: (options) => {
409
- return new connect.CampaignDashboardFirestoreRepository(options);
410
- },
411
- inject: ['FirestoreOptions'],
412
- },
413
- {
414
- provide: 'EditionRepository',
415
- useFactory: (options, subscriptionRepository) => {
416
- return new connect.SubscriptionEditionFirestoreRepository(options, subscriptionRepository);
417
- },
418
- inject: ['FirestoreOptions', 'SubscriptionRepository'],
419
- },
420
- {
421
- provide: 'HomeRepository',
422
- useFactory: (options) => {
423
- return new connect.HomeFirestoreRepository(options);
424
- },
425
- inject: ['FirestoreOptions'],
426
- },
427
- {
428
- provide: 'LeadRepository',
429
- useFactory: (options) => {
430
- return new connect.LeadFirestoreRepository(options);
431
- },
432
- inject: ['FirestoreOptions'],
433
- },
434
- {
435
- provide: 'LegacyOrderRepository',
436
- useFactory: (options) => {
437
- return new connect.LegacyOrderFirestoreRepository(options);
438
- },
439
- inject: ['FirestoreOptions'],
440
- },
441
- {
442
- provide: 'ShopMenuRepository',
443
- useFactory: (options) => {
444
- return new connect.ShopMenuFirestoreRepository(options);
445
- },
446
- inject: ['FirestoreOptions'],
447
- },
448
- {
449
- provide: 'OrderRepository',
450
- useFactory: (options) => {
451
- return new connect.OrderFirestoreRepository(options);
452
- },
453
- inject: ['FirestoreOptions'],
454
- },
455
- {
456
- provide: 'PaymentRepository',
457
- useFactory: (options) => {
458
- return new connect.PaymentFirestoreRepository(options);
459
- },
460
- inject: ['FirestoreOptions'],
461
- },
462
- {
463
- provide: connect.ProductFirestoreRepository,
464
- useFactory: (options) => {
465
- return new connect.ProductFirestoreRepository(options);
466
- },
467
- inject: ['FirestoreOptions'],
468
- },
469
- {
470
- provide: 'ShopSettingsRepository',
471
- useFactory: (options) => {
472
- return new connect.ShopSettingsFirestoreRepository(options);
473
- },
474
- inject: ['FirestoreOptions'],
475
- },
476
- {
477
- provide: 'SubscriptionPaymentRepository',
478
- useFactory: (options, subscriptionRepository) => {
479
- return new connect.SubscriptionPaymentFirestoreRepository(options, subscriptionRepository);
480
- },
481
- inject: ['FirestoreOptions', 'SubscriptionRepository'],
482
- },
483
- {
484
- provide: 'SubscriptionPlanRepository',
485
- useFactory: (options) => {
486
- return new connect.SubscriptionPlanFirestoreRepository(options);
487
- },
488
- inject: ['FirestoreOptions'],
489
- },
490
- {
491
- provide: 'SubscriptionProductRepository',
492
- useFactory: (options) => {
493
- return new connect.SubscriptionProductFirestoreRepository(options);
494
- },
495
- inject: ['FirestoreOptions'],
496
- },
497
- {
498
- provide: 'SubscriptionRepository',
499
- useFactory: (options) => {
500
- return new connect.SubscriptionFirestoreRepository(options);
501
- },
502
- inject: ['FirestoreOptions'],
503
- },
504
- {
505
- provide: 'UserRepository',
506
- useFactory: (options) => {
507
- return new connect.UserFirestoreRepository(options);
508
- },
509
- inject: ['FirestoreOptions'],
510
- },
511
- {
512
- provide: 'UserAddressRepository',
513
- useFactory: (options, userRepository) => {
514
- return new connect.UserAddressFirestoreRepository(options, userRepository);
515
- },
516
- inject: ['FirestoreOptions', 'UserRepository'],
517
- },
518
- {
519
- provide: 'UserPaymentMethodRepository',
520
- useFactory: (options, userRepository) => {
521
- return new connect.UserPaymentMethodFirestoreRepository(options, userRepository);
522
- },
523
- inject: ['FirestoreOptions', 'UserRepository'],
524
- },
525
- {
526
- provide: 'SubscriptionMaterializationRepository',
527
- useFactory: (options) => {
528
- return new connect.SubscriptionMaterializationFirestoreRepository(options);
529
- },
530
- inject: ['FirestoreOptions'],
531
- },
532
- {
533
- provide: 'SubscriptionSummaryRepository',
534
- useFactory: (options) => {
535
- return new connect.SubscriptionSummaryFirestoreRepository(options);
536
- },
537
- inject: ['FirestoreOptions'],
538
- },
539
- {
540
- provide: connect.ProductVariantFirestoreRepository,
541
- useFactory: (options, productRepository) => {
542
- return new connect.ProductVariantFirestoreRepository(options, productRepository);
543
- },
544
- inject: ['FirestoreOptions', connect.ProductFirestoreRepository],
545
- },
546
- ],
547
- exports: [
548
- 'BeautyProfileRepository',
549
- 'Buy2WinRepository',
550
- connect.CategoryFirestoreRepository,
551
- 'CheckoutRepository',
552
- 'CheckoutSubscriptionRepository',
553
- 'CouponRepository',
554
- 'CampaignHashtagRepository',
555
- 'CampaignDashboardRepository',
556
- 'EditionRepository',
557
- 'HomeRepository',
558
- 'LeadRepository',
559
- 'LegacyOrderRepository',
560
- 'ShopMenuRepository',
561
- 'OrderRepository',
562
- 'PaymentRepository',
563
- connect.ProductFirestoreRepository,
564
- 'ShopSettingsRepository',
565
- 'SubscriptionPaymentRepository',
566
- 'SubscriptionPlanRepository',
567
- 'SubscriptionProductRepository',
568
- 'SubscriptionRepository',
569
- 'UserRepository',
570
- 'UserAddressRepository',
571
- 'UserPaymentMethodRepository',
572
- 'SubscriptionMaterializationRepository',
573
- 'SubscriptionSummaryRepository',
574
- connect.ProductVariantFirestoreRepository,
575
- ConnectFirestoreService,
576
- ],
577
- })
326
+ var NestFirestoreModule_1;
327
+ exports.NestFirestoreModule = NestFirestoreModule_1 = class NestFirestoreModule {
328
+ static initializeApp(options) {
329
+ var _a;
330
+ return {
331
+ module: NestFirestoreModule_1,
332
+ imports: [
333
+ nestjsFirebase.FirebaseModule.forRoot({
334
+ googleApplicationCredential: (_a = options === null || options === void 0 ? void 0 : options.firebase) === null || _a === void 0 ? void 0 : _a.googleApplicationCredential,
335
+ }),
336
+ exports.NestStorageModule,
337
+ ],
338
+ exports: [nestjsFirebase.FirebaseModule, exports.NestStorageModule],
339
+ };
340
+ }
341
+ };
342
+ exports.NestFirestoreModule = NestFirestoreModule_1 = __decorate([
343
+ common.Module({
344
+ providers: [
345
+ {
346
+ provide: ConnectFirestoreService,
347
+ useFactory: (firebaseAdmin) => new ConnectFirestoreService(firebaseAdmin.firestore),
348
+ inject: [nestjsFirebase.FirebaseConstants.FIREBASE_TOKEN],
349
+ },
350
+ {
351
+ provide: 'FirestoreOptions',
352
+ useFactory: (connectFirestoreService) => ({
353
+ firestore: connectFirestoreService,
354
+ }),
355
+ inject: [ConnectFirestoreService],
356
+ },
357
+ {
358
+ provide: 'BeautyProfileRepository',
359
+ useFactory: (config, userRepository) => {
360
+ return new connect.UserBeautyProfileFirestoreRepository(config, userRepository);
361
+ },
362
+ inject: ['FirestoreOptions', 'UserRepository'],
363
+ },
364
+ {
365
+ provide: 'Buy2WinRepository',
366
+ useFactory: (options) => {
367
+ return new connect.Buy2WinFirestoreRepository(options);
368
+ },
369
+ inject: ['FirestoreOptions'],
370
+ },
371
+ {
372
+ provide: connect.CategoryFirestoreRepository,
373
+ useFactory: (options) => {
374
+ return new connect.CategoryFirestoreRepository(options);
375
+ },
376
+ inject: ['FirestoreOptions'],
377
+ },
378
+ {
379
+ provide: 'CheckoutRepository',
380
+ useFactory: (options) => {
381
+ return new connect.CheckoutFirestoreRepository(options);
382
+ },
383
+ inject: ['FirestoreOptions'],
384
+ },
385
+ {
386
+ provide: 'CheckoutSubscriptionRepository',
387
+ useFactory: (options) => {
388
+ return new connect.CheckoutSubscriptionFirestoreRepository(options);
389
+ },
390
+ inject: ['FirestoreOptions'],
391
+ },
392
+ {
393
+ provide: 'CouponRepository',
394
+ useFactory: (options) => {
395
+ return new connect.CouponFirestoreRepository(options);
396
+ },
397
+ inject: ['FirestoreOptions'],
398
+ },
399
+ {
400
+ provide: 'CampaignHashtagRepository',
401
+ useFactory: (options) => {
402
+ return new connect.CampaignHashtagFirestoreRepository(options);
403
+ },
404
+ inject: ['FirestoreOptions'],
405
+ },
406
+ {
407
+ provide: 'CampaignDashboardRepository',
408
+ useFactory: (options) => {
409
+ return new connect.CampaignDashboardFirestoreRepository(options);
410
+ },
411
+ inject: ['FirestoreOptions'],
412
+ },
413
+ {
414
+ provide: 'EditionRepository',
415
+ useFactory: (options, subscriptionRepository) => {
416
+ return new connect.SubscriptionEditionFirestoreRepository(options, subscriptionRepository);
417
+ },
418
+ inject: ['FirestoreOptions', 'SubscriptionRepository'],
419
+ },
420
+ {
421
+ provide: 'HomeRepository',
422
+ useFactory: (options) => {
423
+ return new connect.HomeFirestoreRepository(options);
424
+ },
425
+ inject: ['FirestoreOptions'],
426
+ },
427
+ {
428
+ provide: 'LeadRepository',
429
+ useFactory: (options) => {
430
+ return new connect.LeadFirestoreRepository(options);
431
+ },
432
+ inject: ['FirestoreOptions'],
433
+ },
434
+ {
435
+ provide: 'LegacyOrderRepository',
436
+ useFactory: (options) => {
437
+ return new connect.LegacyOrderFirestoreRepository(options);
438
+ },
439
+ inject: ['FirestoreOptions'],
440
+ },
441
+ {
442
+ provide: 'ShopMenuRepository',
443
+ useFactory: (options) => {
444
+ return new connect.ShopMenuFirestoreRepository(options);
445
+ },
446
+ inject: ['FirestoreOptions'],
447
+ },
448
+ {
449
+ provide: 'OrderRepository',
450
+ useFactory: (options) => {
451
+ return new connect.OrderFirestoreRepository(options);
452
+ },
453
+ inject: ['FirestoreOptions'],
454
+ },
455
+ {
456
+ provide: 'PaymentRepository',
457
+ useFactory: (options) => {
458
+ return new connect.PaymentFirestoreRepository(options);
459
+ },
460
+ inject: ['FirestoreOptions'],
461
+ },
462
+ {
463
+ provide: connect.ProductFirestoreRepository,
464
+ useFactory: (options) => {
465
+ return new connect.ProductFirestoreRepository(options);
466
+ },
467
+ inject: ['FirestoreOptions'],
468
+ },
469
+ {
470
+ provide: 'ShopSettingsRepository',
471
+ useFactory: (options) => {
472
+ return new connect.ShopSettingsFirestoreRepository(options);
473
+ },
474
+ inject: ['FirestoreOptions'],
475
+ },
476
+ {
477
+ provide: 'SubscriptionPaymentRepository',
478
+ useFactory: (options, subscriptionRepository) => {
479
+ return new connect.SubscriptionPaymentFirestoreRepository(options, subscriptionRepository);
480
+ },
481
+ inject: ['FirestoreOptions', 'SubscriptionRepository'],
482
+ },
483
+ {
484
+ provide: 'SubscriptionPlanRepository',
485
+ useFactory: (options) => {
486
+ return new connect.SubscriptionPlanFirestoreRepository(options);
487
+ },
488
+ inject: ['FirestoreOptions'],
489
+ },
490
+ {
491
+ provide: 'SubscriptionProductRepository',
492
+ useFactory: (options) => {
493
+ return new connect.SubscriptionProductFirestoreRepository(options);
494
+ },
495
+ inject: ['FirestoreOptions'],
496
+ },
497
+ {
498
+ provide: 'SubscriptionRepository',
499
+ useFactory: (options) => {
500
+ return new connect.SubscriptionFirestoreRepository(options);
501
+ },
502
+ inject: ['FirestoreOptions'],
503
+ },
504
+ {
505
+ provide: 'UserRepository',
506
+ useFactory: (options) => {
507
+ return new connect.UserFirestoreRepository(options);
508
+ },
509
+ inject: ['FirestoreOptions'],
510
+ },
511
+ {
512
+ provide: 'UserAddressRepository',
513
+ useFactory: (options, userRepository) => {
514
+ return new connect.UserAddressFirestoreRepository(options, userRepository);
515
+ },
516
+ inject: ['FirestoreOptions', 'UserRepository'],
517
+ },
518
+ {
519
+ provide: 'UserPaymentMethodRepository',
520
+ useFactory: (options, userRepository) => {
521
+ return new connect.UserPaymentMethodFirestoreRepository(options, userRepository);
522
+ },
523
+ inject: ['FirestoreOptions', 'UserRepository'],
524
+ },
525
+ {
526
+ provide: 'SubscriptionMaterializationRepository',
527
+ useFactory: (options) => {
528
+ return new connect.SubscriptionMaterializationFirestoreRepository(options);
529
+ },
530
+ inject: ['FirestoreOptions'],
531
+ },
532
+ {
533
+ provide: 'SubscriptionSummaryRepository',
534
+ useFactory: (options) => {
535
+ return new connect.SubscriptionSummaryFirestoreRepository(options);
536
+ },
537
+ inject: ['FirestoreOptions'],
538
+ },
539
+ {
540
+ provide: connect.ProductVariantFirestoreRepository,
541
+ useFactory: (options, productRepository) => {
542
+ return new connect.ProductVariantFirestoreRepository(options, productRepository);
543
+ },
544
+ inject: ['FirestoreOptions', connect.ProductFirestoreRepository],
545
+ },
546
+ ],
547
+ exports: [
548
+ 'BeautyProfileRepository',
549
+ 'Buy2WinRepository',
550
+ connect.CategoryFirestoreRepository,
551
+ 'CheckoutRepository',
552
+ 'CheckoutSubscriptionRepository',
553
+ 'CouponRepository',
554
+ 'CampaignHashtagRepository',
555
+ 'CampaignDashboardRepository',
556
+ 'EditionRepository',
557
+ 'HomeRepository',
558
+ 'LeadRepository',
559
+ 'LegacyOrderRepository',
560
+ 'ShopMenuRepository',
561
+ 'OrderRepository',
562
+ 'PaymentRepository',
563
+ connect.ProductFirestoreRepository,
564
+ 'ShopSettingsRepository',
565
+ 'SubscriptionPaymentRepository',
566
+ 'SubscriptionPlanRepository',
567
+ 'SubscriptionProductRepository',
568
+ 'SubscriptionRepository',
569
+ 'UserRepository',
570
+ 'UserAddressRepository',
571
+ 'UserPaymentMethodRepository',
572
+ 'SubscriptionMaterializationRepository',
573
+ 'SubscriptionSummaryRepository',
574
+ connect.ProductVariantFirestoreRepository,
575
+ ConnectFirestoreService,
576
+ ],
577
+ })
578
578
  ], exports.NestFirestoreModule);
579
579
 
580
- var NestHasuraGraphQLModule_1;
581
- exports.NestHasuraGraphQLModule = NestHasuraGraphQLModule_1 = class NestHasuraGraphQLModule {
582
- static initializeApp(options) {
583
- return {
584
- module: NestHasuraGraphQLModule_1,
585
- providers: [{ provide: HASURA_OPTIONS, useValue: options }],
586
- exports: [HASURA_OPTIONS],
587
- };
588
- }
589
- };
590
- exports.NestHasuraGraphQLModule = NestHasuraGraphQLModule_1 = __decorate([
591
- common.Module({
592
- providers: [
593
- {
594
- provide: 'HasuraConfig',
595
- useFactory: (options) => ({
596
- endpoint: options.endpoint,
597
- authOptions: options.credentials,
598
- }),
599
- inject: [HASURA_OPTIONS],
600
- },
601
- {
602
- provide: 'CategoryRepository',
603
- useExisting: connect.CategoryHasuraGraphQLRepository,
604
- },
605
- {
606
- provide: connect.CategoryHasuraGraphQLRepository,
607
- useFactory: (options, productRepository, categoryFilterRepository) => {
608
- return new connect.CategoryHasuraGraphQLRepository(options, productRepository, categoryFilterRepository);
609
- },
610
- inject: ['HasuraConfig', connect.ProductHasuraGraphQLRepository, connect.CategoryFilterHasuraGraphQLRepository],
611
- },
612
- {
613
- provide: 'ProductRepository',
614
- useExisting: connect.ProductHasuraGraphQLRepository,
615
- },
616
- {
617
- provide: connect.ProductHasuraGraphQLRepository,
618
- useFactory: (hasuraConfig) => {
619
- return new connect.ProductHasuraGraphQLRepository(hasuraConfig);
620
- },
621
- inject: ['HasuraConfig'],
622
- },
623
- {
624
- provide: 'ProductReviewsRepository',
625
- useExisting: connect.ProductReviewsHasuraGraphQLRepository,
626
- },
627
- {
628
- provide: connect.ProductReviewsHasuraGraphQLRepository,
629
- useFactory: (hasuraConfig) => {
630
- return new connect.ProductReviewsHasuraGraphQLRepository(hasuraConfig);
631
- },
632
- inject: ['HasuraConfig'],
633
- },
634
- {
635
- provide: 'VariantRepository',
636
- useExisting: connect.VariantHasuraGraphQLRepository,
637
- },
638
- {
639
- provide: connect.VariantHasuraGraphQLRepository,
640
- useFactory: (hasuraConfig) => {
641
- return new connect.VariantHasuraGraphQLRepository(hasuraConfig);
642
- },
643
- inject: ['HasuraConfig'],
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
- },
656
- {
657
- provide: 'CategoryFilterRepository',
658
- useExisting: connect.CategoryFilterHasuraGraphQLRepository,
659
- },
660
- {
661
- provide: connect.CategoryFilterHasuraGraphQLRepository,
662
- useFactory: (options) => {
663
- return new connect.CategoryFilterHasuraGraphQLRepository(options);
664
- },
665
- inject: ['HasuraConfig'],
666
- },
667
- {
668
- provide: 'FilterOptionRepository',
669
- useExisting: connect.FilterOptionHasuraGraphQLRepository,
670
- },
671
- {
672
- provide: connect.FilterOptionHasuraGraphQLRepository,
673
- useFactory: (options) => {
674
- return new connect.FilterOptionHasuraGraphQLRepository(options);
675
- },
676
- inject: ['HasuraConfig'],
677
- },
678
- {
679
- provide: 'FilterRepository',
680
- useExisting: connect.FilterHasuraGraphQLRepository,
681
- },
682
- {
683
- provide: connect.FilterHasuraGraphQLRepository,
684
- useFactory: (options, filterOptionRepository, categoryFilterRepository) => {
685
- return new connect.FilterHasuraGraphQLRepository(options, filterOptionRepository, categoryFilterRepository);
686
- },
687
- inject: ['HasuraConfig', connect.FilterOptionHasuraGraphQLRepository, connect.CategoryFilterHasuraGraphQLRepository],
688
- },
689
- {
690
- provide: connect.CategoryCollectionChildrenHasuraGraphQLRepository,
691
- useFactory: (options) => new connect.CategoryCollectionChildrenHasuraGraphQLRepository(options),
692
- inject: ['HasuraConfig'],
693
- },
694
- {
695
- provide: 'CategoryCollectionChildrenRepository',
696
- useExisting: connect.CategoryCollectionChildrenHasuraGraphQLRepository,
697
- },
698
- {
699
- provide: connect.WishlistHasuraGraphQLRepository,
700
- useFactory: (options, categoryFilterRepository) => {
701
- return new connect.WishlistHasuraGraphQLRepository(options, categoryFilterRepository);
702
- },
703
- inject: ['HasuraConfig', connect.CategoryFilterHasuraGraphQLRepository],
704
- },
705
- {
706
- provide: 'WishlistRepository',
707
- useExisting: connect.WishlistHasuraGraphQLRepository,
708
- },
709
- ],
710
- exports: [
711
- 'CategoryRepository',
712
- connect.CategoryHasuraGraphQLRepository,
713
- 'ProductRepository',
714
- connect.ProductHasuraGraphQLRepository,
715
- 'ProductReviewsRepository',
716
- connect.ProductReviewsHasuraGraphQLRepository,
717
- 'VariantRepository',
718
- connect.VariantHasuraGraphQLRepository,
719
- 'ProductStockNotificationRepository',
720
- connect.ProductStockNotificationHasuraGraphQLRepository,
721
- 'CategoryFilterRepository',
722
- connect.CategoryFilterHasuraGraphQLRepository,
723
- 'FilterOptionRepository',
724
- connect.FilterOptionHasuraGraphQLRepository,
725
- 'FilterRepository',
726
- connect.FilterHasuraGraphQLRepository,
727
- 'CategoryCollectionChildrenRepository',
728
- connect.CategoryCollectionChildrenHasuraGraphQLRepository,
729
- 'WishlistRepository',
730
- connect.WishlistHasuraGraphQLRepository,
731
- ],
732
- })
580
+ var NestHasuraGraphQLModule_1;
581
+ exports.NestHasuraGraphQLModule = NestHasuraGraphQLModule_1 = class NestHasuraGraphQLModule {
582
+ static initializeApp(options) {
583
+ return {
584
+ module: NestHasuraGraphQLModule_1,
585
+ providers: [{ provide: HASURA_OPTIONS, useValue: options }],
586
+ exports: [HASURA_OPTIONS],
587
+ };
588
+ }
589
+ };
590
+ exports.NestHasuraGraphQLModule = NestHasuraGraphQLModule_1 = __decorate([
591
+ common.Module({
592
+ providers: [
593
+ {
594
+ provide: 'HasuraConfig',
595
+ useFactory: (options) => ({
596
+ endpoint: options.endpoint,
597
+ authOptions: options.credentials,
598
+ }),
599
+ inject: [HASURA_OPTIONS],
600
+ },
601
+ {
602
+ provide: 'CategoryRepository',
603
+ useExisting: connect.CategoryHasuraGraphQLRepository,
604
+ },
605
+ {
606
+ provide: connect.CategoryHasuraGraphQLRepository,
607
+ useFactory: (options, productRepository, categoryFilterRepository) => {
608
+ return new connect.CategoryHasuraGraphQLRepository(options, productRepository, categoryFilterRepository);
609
+ },
610
+ inject: ['HasuraConfig', connect.ProductHasuraGraphQLRepository, connect.CategoryFilterHasuraGraphQLRepository],
611
+ },
612
+ {
613
+ provide: 'ProductRepository',
614
+ useExisting: connect.ProductHasuraGraphQLRepository,
615
+ },
616
+ {
617
+ provide: connect.ProductHasuraGraphQLRepository,
618
+ useFactory: (hasuraConfig) => {
619
+ return new connect.ProductHasuraGraphQLRepository(hasuraConfig);
620
+ },
621
+ inject: ['HasuraConfig'],
622
+ },
623
+ {
624
+ provide: 'ProductReviewsRepository',
625
+ useExisting: connect.ProductReviewsHasuraGraphQLRepository,
626
+ },
627
+ {
628
+ provide: connect.ProductReviewsHasuraGraphQLRepository,
629
+ useFactory: (hasuraConfig) => {
630
+ return new connect.ProductReviewsHasuraGraphQLRepository(hasuraConfig);
631
+ },
632
+ inject: ['HasuraConfig'],
633
+ },
634
+ {
635
+ provide: 'VariantRepository',
636
+ useExisting: connect.VariantHasuraGraphQLRepository,
637
+ },
638
+ {
639
+ provide: connect.VariantHasuraGraphQLRepository,
640
+ useFactory: (hasuraConfig) => {
641
+ return new connect.VariantHasuraGraphQLRepository(hasuraConfig);
642
+ },
643
+ inject: ['HasuraConfig'],
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
+ },
656
+ {
657
+ provide: 'CategoryFilterRepository',
658
+ useExisting: connect.CategoryFilterHasuraGraphQLRepository,
659
+ },
660
+ {
661
+ provide: connect.CategoryFilterHasuraGraphQLRepository,
662
+ useFactory: (options) => {
663
+ return new connect.CategoryFilterHasuraGraphQLRepository(options);
664
+ },
665
+ inject: ['HasuraConfig'],
666
+ },
667
+ {
668
+ provide: 'FilterOptionRepository',
669
+ useExisting: connect.FilterOptionHasuraGraphQLRepository,
670
+ },
671
+ {
672
+ provide: connect.FilterOptionHasuraGraphQLRepository,
673
+ useFactory: (options) => {
674
+ return new connect.FilterOptionHasuraGraphQLRepository(options);
675
+ },
676
+ inject: ['HasuraConfig'],
677
+ },
678
+ {
679
+ provide: 'FilterRepository',
680
+ useExisting: connect.FilterHasuraGraphQLRepository,
681
+ },
682
+ {
683
+ provide: connect.FilterHasuraGraphQLRepository,
684
+ useFactory: (options, filterOptionRepository, categoryFilterRepository) => {
685
+ return new connect.FilterHasuraGraphQLRepository(options, filterOptionRepository, categoryFilterRepository);
686
+ },
687
+ inject: ['HasuraConfig', connect.FilterOptionHasuraGraphQLRepository, connect.CategoryFilterHasuraGraphQLRepository],
688
+ },
689
+ {
690
+ provide: connect.CategoryCollectionChildrenHasuraGraphQLRepository,
691
+ useFactory: (options) => new connect.CategoryCollectionChildrenHasuraGraphQLRepository(options),
692
+ inject: ['HasuraConfig'],
693
+ },
694
+ {
695
+ provide: 'CategoryCollectionChildrenRepository',
696
+ useExisting: connect.CategoryCollectionChildrenHasuraGraphQLRepository,
697
+ },
698
+ {
699
+ provide: connect.WishlistHasuraGraphQLRepository,
700
+ useFactory: (options, categoryFilterRepository) => {
701
+ return new connect.WishlistHasuraGraphQLRepository(options, categoryFilterRepository);
702
+ },
703
+ inject: ['HasuraConfig', connect.CategoryFilterHasuraGraphQLRepository],
704
+ },
705
+ {
706
+ provide: 'WishlistRepository',
707
+ useExisting: connect.WishlistHasuraGraphQLRepository,
708
+ },
709
+ ],
710
+ exports: [
711
+ 'CategoryRepository',
712
+ connect.CategoryHasuraGraphQLRepository,
713
+ 'ProductRepository',
714
+ connect.ProductHasuraGraphQLRepository,
715
+ 'ProductReviewsRepository',
716
+ connect.ProductReviewsHasuraGraphQLRepository,
717
+ 'VariantRepository',
718
+ connect.VariantHasuraGraphQLRepository,
719
+ 'ProductStockNotificationRepository',
720
+ connect.ProductStockNotificationHasuraGraphQLRepository,
721
+ 'CategoryFilterRepository',
722
+ connect.CategoryFilterHasuraGraphQLRepository,
723
+ 'FilterOptionRepository',
724
+ connect.FilterOptionHasuraGraphQLRepository,
725
+ 'FilterRepository',
726
+ connect.FilterHasuraGraphQLRepository,
727
+ 'CategoryCollectionChildrenRepository',
728
+ connect.CategoryCollectionChildrenHasuraGraphQLRepository,
729
+ 'WishlistRepository',
730
+ connect.WishlistHasuraGraphQLRepository,
731
+ ],
732
+ })
733
733
  ], exports.NestHasuraGraphQLModule);
734
734
 
735
- var NestConnectModule_1;
736
- exports.NestConnectModule = NestConnectModule_1 = class NestConnectModule {
737
- static initializeApp(options) {
738
- return {
739
- module: NestConnectModule_1,
740
- imports: [
741
- ...(options.firebase ? [exports.NestFirestoreModule.initializeApp({ firebase: options.firebase })] : []),
742
- ...(connect.isNil(options === null || options === void 0 ? void 0 : options.hasura) ? [] : [exports.NestHasuraGraphQLModule.initializeApp(options.hasura)]),
743
- ...(connect.isNil(options === null || options === void 0 ? void 0 : options.elasticSearch) ? [] : [exports.NestElasticSeachModule.initializeApp(options.elasticSearch)]),
744
- ],
745
- exports: [
746
- ...(options.firebase ? [exports.NestFirestoreModule] : []),
747
- ...(connect.isNil(options === null || options === void 0 ? void 0 : options.hasura) ? [] : [exports.NestHasuraGraphQLModule]),
748
- ...(connect.isNil(options === null || options === void 0 ? void 0 : options.elasticSearch) ? [] : [exports.NestElasticSeachModule]),
749
- ],
750
- };
751
- }
752
- };
753
- exports.NestConnectModule = NestConnectModule_1 = __decorate([
754
- common.Module({})
735
+ var NestConnectModule_1;
736
+ exports.NestConnectModule = NestConnectModule_1 = class NestConnectModule {
737
+ static initializeApp(options) {
738
+ return {
739
+ module: NestConnectModule_1,
740
+ imports: [
741
+ ...(options.firebase ? [exports.NestFirestoreModule.initializeApp({ firebase: options.firebase })] : []),
742
+ ...(connect.isNil(options === null || options === void 0 ? void 0 : options.hasura) ? [] : [exports.NestHasuraGraphQLModule.initializeApp(options.hasura)]),
743
+ ...(connect.isNil(options === null || options === void 0 ? void 0 : options.elasticSearch) ? [] : [exports.NestElasticSeachModule.initializeApp(options.elasticSearch)]),
744
+ ],
745
+ exports: [
746
+ ...(options.firebase ? [exports.NestFirestoreModule] : []),
747
+ ...(connect.isNil(options === null || options === void 0 ? void 0 : options.hasura) ? [] : [exports.NestHasuraGraphQLModule]),
748
+ ...(connect.isNil(options === null || options === void 0 ? void 0 : options.elasticSearch) ? [] : [exports.NestElasticSeachModule]),
749
+ ],
750
+ };
751
+ }
752
+ };
753
+ exports.NestConnectModule = NestConnectModule_1 = __decorate([
754
+ common.Module({})
755
755
  ], exports.NestConnectModule);
756
756
 
757
757
  exports.ConnectCollectionService = ConnectCollectionService;