@infrab4a/connect-nestjs 2.9.2 → 2.9.3
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/eslint.config.js +17 -0
- package/package.json +3 -13
- package/project.json +45 -0
- package/src/consts/es-config.const.ts +1 -0
- package/src/consts/hasura-options.const.ts +1 -0
- package/src/consts/index.ts +4 -0
- package/src/consts/storage.const.ts +1 -0
- package/src/consts/vertex-config.const.ts +1 -0
- package/src/index.ts +7 -0
- package/src/infra/elasticsearch/adapters/index.ts +1 -0
- package/src/infra/elasticsearch/adapters/native-elasticsearch-adapter.ts +137 -0
- package/src/infra/elasticsearch/index.ts +1 -0
- package/src/infra/firebase/firestore/index.ts +2 -0
- package/src/infra/firebase/firestore/services/connect-collection-reference.ts +27 -0
- package/src/infra/firebase/firestore/services/connect-collection.service.ts +137 -0
- package/src/infra/firebase/firestore/services/connect-document-reference.ts +12 -0
- package/src/infra/firebase/firestore/services/connect-document.service.ts +51 -0
- package/src/infra/firebase/firestore/services/connect-firestore.service.ts +24 -0
- package/src/infra/firebase/firestore/services/connect-firestore.ts +9 -0
- package/src/infra/firebase/firestore/services/index.ts +6 -0
- package/src/infra/firebase/firestore/types/connect-query-snapshot.type.ts +6 -0
- package/src/infra/firebase/firestore/types/index.ts +1 -0
- package/src/infra/firebase/firestore/vo/connect-base-document-snapshot.vo.ts +27 -0
- package/src/infra/firebase/firestore/vo/index.ts +1 -0
- package/src/infra/firebase/index.ts +1 -0
- package/src/infra/index.ts +4 -0
- package/src/infra/pagarme/adapters/index.ts +3 -0
- package/src/infra/pagarme/adapters/pagarme-bank-slip-api.adapter.ts +97 -0
- package/src/infra/pagarme/adapters/pagarme-card-api.adapter.ts +221 -0
- package/src/infra/pagarme/adapters/pagarme-pix-api.adapter.ts +70 -0
- package/src/infra/pagarme/index.ts +1 -0
- package/src/infra/vertex-ai/adapters/discovery-engine-adapter.ts +146 -0
- package/src/infra/vertex-ai/adapters/index.ts +1 -0
- package/src/infra/vertex-ai/helpers/index.ts +1 -0
- package/src/infra/vertex-ai/helpers/product-vertex-ai.helper.ts +52 -0
- package/src/infra/vertex-ai/index.ts +3 -0
- package/src/infra/vertex-ai/types/index.ts +2 -0
- package/src/infra/vertex-ai/types/vertex-config.ts +9 -0
- package/src/infra/vertex-ai/types/vertex-search-result.ts +17 -0
- package/src/nest-connect.module.ts +36 -0
- package/src/nest-elastic-search.module.ts +26 -0
- package/src/nest-firestore.module.ts +413 -0
- package/src/nest-hasura-graphql.module.ts +285 -0
- package/src/nest-storage.module.ts +16 -0
- package/src/nest-vertex-ai-search.module.ts +26 -0
- package/src/types/pagarme.d.ts +24 -0
- package/tsconfig.json +15 -0
- package/tsconfig.lib.json +7 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +17 -0
- package/index.cjs.d.ts +0 -1
- package/index.cjs.default.js +0 -1
- package/index.cjs.js +0 -1417
- package/index.cjs.mjs +0 -2
- package/index.esm.js +0 -1400
- package/src/consts/es-config.const.d.ts +0 -1
- package/src/consts/hasura-options.const.d.ts +0 -1
- package/src/consts/index.d.ts +0 -4
- package/src/consts/storage.const.d.ts +0 -1
- package/src/consts/vertex-config.const.d.ts +0 -1
- package/src/index.d.ts +0 -7
- package/src/infra/elasticsearch/adapters/index.d.ts +0 -1
- package/src/infra/elasticsearch/adapters/native-elasticsearch-adapter.d.ts +0 -19
- package/src/infra/elasticsearch/index.d.ts +0 -1
- package/src/infra/firebase/firestore/index.d.ts +0 -2
- package/src/infra/firebase/firestore/services/connect-collection-reference.d.ts +0 -19
- package/src/infra/firebase/firestore/services/connect-collection.service.d.ts +0 -32
- package/src/infra/firebase/firestore/services/connect-document-reference.d.ts +0 -11
- package/src/infra/firebase/firestore/services/connect-document.service.d.ts +0 -17
- package/src/infra/firebase/firestore/services/connect-firestore.d.ts +0 -7
- package/src/infra/firebase/firestore/services/connect-firestore.service.d.ts +0 -8
- package/src/infra/firebase/firestore/services/index.d.ts +0 -6
- package/src/infra/firebase/firestore/types/connect-query-snapshot.type.d.ts +0 -4
- package/src/infra/firebase/firestore/types/index.d.ts +0 -1
- package/src/infra/firebase/firestore/vo/connect-base-document-snapshot.vo.d.ts +0 -12
- package/src/infra/firebase/firestore/vo/index.d.ts +0 -1
- package/src/infra/firebase/index.d.ts +0 -1
- package/src/infra/index.d.ts +0 -4
- package/src/infra/pagarme/adapters/index.d.ts +0 -3
- package/src/infra/pagarme/adapters/pagarme-bank-slip-api.adapter.d.ts +0 -9
- package/src/infra/pagarme/adapters/pagarme-card-api.adapter.d.ts +0 -21
- package/src/infra/pagarme/adapters/pagarme-pix-api.adapter.d.ts +0 -8
- package/src/infra/pagarme/index.d.ts +0 -1
- package/src/infra/vertex-ai/adapters/discovery-engine-adapter.d.ts +0 -17
- package/src/infra/vertex-ai/adapters/index.d.ts +0 -1
- package/src/infra/vertex-ai/helpers/index.d.ts +0 -1
- package/src/infra/vertex-ai/helpers/product-vertex-ai.helper.d.ts +0 -7
- package/src/infra/vertex-ai/index.d.ts +0 -3
- package/src/infra/vertex-ai/types/index.d.ts +0 -2
- package/src/infra/vertex-ai/types/vertex-config.d.ts +0 -9
- package/src/infra/vertex-ai/types/vertex-search-result.d.ts +0 -18
- package/src/nest-connect.module.d.ts +0 -13
- package/src/nest-elastic-search.module.d.ts +0 -5
- package/src/nest-firestore.module.d.ts +0 -10
- package/src/nest-hasura-graphql.module.d.ts +0 -13
- package/src/nest-storage.module.d.ts +0 -2
- package/src/nest-vertex-ai-search.module.d.ts +0 -5
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CacheConfig,
|
|
3
|
+
CategoryCollectionChildrenHasuraGraphQLRepository,
|
|
4
|
+
CategoryFilterHasuraGraphQLRepository,
|
|
5
|
+
CategoryFilterRepository,
|
|
6
|
+
CategoryHasuraGraphQLRepository,
|
|
7
|
+
CategoryProductHasuraGraphQLRepository,
|
|
8
|
+
CategoryRepository,
|
|
9
|
+
FilterHasuraGraphQLRepository,
|
|
10
|
+
FilterOptionHasuraGraphQLRepository,
|
|
11
|
+
FilterOptionRepository,
|
|
12
|
+
FilterRepository,
|
|
13
|
+
HasuraConstructorParams,
|
|
14
|
+
HasuraGraphQLAuthOptions,
|
|
15
|
+
ProductCatalogHasuraGraphQLRepository,
|
|
16
|
+
ProductErrors,
|
|
17
|
+
ProductErrorsHasuraGraphQLRepository,
|
|
18
|
+
ProductErrorsRepository,
|
|
19
|
+
ProductGroupHasuraGraphQLRepository,
|
|
20
|
+
ProductHasuraGraphQLRepository,
|
|
21
|
+
ProductPriceLogHasuraGraphQLRepository,
|
|
22
|
+
ProductRepository,
|
|
23
|
+
ProductReviewHasuraGraphQLRepository,
|
|
24
|
+
ProductReviewRepository,
|
|
25
|
+
ProductStockEntryHasuraGraphQLRepository,
|
|
26
|
+
ProductStockEntryRepository,
|
|
27
|
+
ProductStockNotificationHasuraGraphQLRepository,
|
|
28
|
+
ProductStockNotificationRepository,
|
|
29
|
+
resolveCacheConfig,
|
|
30
|
+
VariantHasuraGraphQLRepository,
|
|
31
|
+
VariantRepository,
|
|
32
|
+
WishlistHasuraGraphQLRepository,
|
|
33
|
+
} from '@infrab4a/connect'
|
|
34
|
+
import { DynamicModule, Module } from '@nestjs/common'
|
|
35
|
+
|
|
36
|
+
import { HASURA_OPTIONS } from './consts'
|
|
37
|
+
|
|
38
|
+
export type HasuraGraphQLOptions = { endpoint: string; credentials: HasuraGraphQLAuthOptions; cache?: CacheConfig }
|
|
39
|
+
|
|
40
|
+
@Module({
|
|
41
|
+
providers: [
|
|
42
|
+
{
|
|
43
|
+
provide: 'HasuraConfig',
|
|
44
|
+
useFactory: (options: HasuraGraphQLOptions) => ({
|
|
45
|
+
endpoint: options.endpoint,
|
|
46
|
+
authOptions: options.credentials,
|
|
47
|
+
cache: resolveCacheConfig(options.cache),
|
|
48
|
+
}),
|
|
49
|
+
inject: [HASURA_OPTIONS],
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
provide: 'CategoryRepository',
|
|
53
|
+
useExisting: CategoryHasuraGraphQLRepository,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
provide: CategoryHasuraGraphQLRepository,
|
|
57
|
+
useFactory: (
|
|
58
|
+
options: any,
|
|
59
|
+
productRepository: ProductHasuraGraphQLRepository,
|
|
60
|
+
categoryFilterRepository: CategoryFilterHasuraGraphQLRepository,
|
|
61
|
+
): CategoryRepository => {
|
|
62
|
+
return new CategoryHasuraGraphQLRepository(options, productRepository, categoryFilterRepository)
|
|
63
|
+
},
|
|
64
|
+
inject: ['HasuraConfig', ProductHasuraGraphQLRepository, CategoryFilterHasuraGraphQLRepository],
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
provide: 'ProductRepository',
|
|
68
|
+
useExisting: ProductHasuraGraphQLRepository,
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
provide: ProductHasuraGraphQLRepository,
|
|
72
|
+
useFactory: (hasuraConfig: any): ProductRepository => {
|
|
73
|
+
return new ProductHasuraGraphQLRepository(hasuraConfig)
|
|
74
|
+
},
|
|
75
|
+
inject: ['HasuraConfig'],
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
provide: 'ProductReviewRepository',
|
|
79
|
+
useExisting: ProductReviewHasuraGraphQLRepository,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
provide: ProductReviewHasuraGraphQLRepository,
|
|
83
|
+
useFactory: (hasuraConfig: any): ProductReviewRepository => {
|
|
84
|
+
return new ProductReviewHasuraGraphQLRepository(hasuraConfig)
|
|
85
|
+
},
|
|
86
|
+
inject: ['HasuraConfig'],
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
provide: 'VariantRepository',
|
|
90
|
+
useExisting: VariantHasuraGraphQLRepository,
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
provide: VariantHasuraGraphQLRepository,
|
|
94
|
+
useFactory: (hasuraConfig: any): VariantRepository => {
|
|
95
|
+
return new VariantHasuraGraphQLRepository(hasuraConfig)
|
|
96
|
+
},
|
|
97
|
+
inject: ['HasuraConfig'],
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
provide: 'ProductStockNotificationRepository',
|
|
101
|
+
useExisting: ProductStockNotificationHasuraGraphQLRepository,
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
provide: ProductStockNotificationHasuraGraphQLRepository,
|
|
105
|
+
useFactory: (hasuraConfig: any): ProductStockNotificationRepository => {
|
|
106
|
+
return new ProductStockNotificationHasuraGraphQLRepository(hasuraConfig)
|
|
107
|
+
},
|
|
108
|
+
inject: ['HasuraConfig'],
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
provide: 'CategoryFilterRepository',
|
|
112
|
+
useExisting: CategoryFilterHasuraGraphQLRepository,
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
provide: CategoryFilterHasuraGraphQLRepository,
|
|
116
|
+
useFactory: (options: any): CategoryFilterRepository => {
|
|
117
|
+
return new CategoryFilterHasuraGraphQLRepository(options)
|
|
118
|
+
},
|
|
119
|
+
inject: ['HasuraConfig'],
|
|
120
|
+
},
|
|
121
|
+
|
|
122
|
+
{
|
|
123
|
+
provide: 'FilterOptionRepository',
|
|
124
|
+
useExisting: FilterOptionHasuraGraphQLRepository,
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
provide: FilterOptionHasuraGraphQLRepository,
|
|
128
|
+
useFactory: (options: any): FilterOptionRepository => {
|
|
129
|
+
return new FilterOptionHasuraGraphQLRepository(options)
|
|
130
|
+
},
|
|
131
|
+
inject: ['HasuraConfig'],
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
provide: 'FilterRepository',
|
|
135
|
+
useExisting: FilterHasuraGraphQLRepository,
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
provide: FilterHasuraGraphQLRepository,
|
|
139
|
+
useFactory: (
|
|
140
|
+
options: any,
|
|
141
|
+
filterOptionRepository: FilterOptionHasuraGraphQLRepository,
|
|
142
|
+
categoryFilterRepository: CategoryFilterHasuraGraphQLRepository,
|
|
143
|
+
): FilterRepository => {
|
|
144
|
+
return new FilterHasuraGraphQLRepository(options, filterOptionRepository, categoryFilterRepository)
|
|
145
|
+
},
|
|
146
|
+
inject: ['HasuraConfig', FilterOptionHasuraGraphQLRepository, CategoryFilterHasuraGraphQLRepository],
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
provide: CategoryCollectionChildrenHasuraGraphQLRepository,
|
|
150
|
+
useFactory: (options: any): CategoryCollectionChildrenHasuraGraphQLRepository =>
|
|
151
|
+
new CategoryCollectionChildrenHasuraGraphQLRepository(options),
|
|
152
|
+
inject: ['HasuraConfig'],
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
provide: 'CategoryCollectionChildrenRepository',
|
|
156
|
+
useExisting: CategoryCollectionChildrenHasuraGraphQLRepository,
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
provide: CategoryProductHasuraGraphQLRepository,
|
|
160
|
+
useFactory: (options: any): CategoryProductHasuraGraphQLRepository => {
|
|
161
|
+
return new CategoryProductHasuraGraphQLRepository(options)
|
|
162
|
+
},
|
|
163
|
+
inject: ['HasuraConfig'],
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
provide: 'CategoryProductRepository',
|
|
167
|
+
useExisting: CategoryProductHasuraGraphQLRepository,
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
provide: WishlistHasuraGraphQLRepository,
|
|
171
|
+
useFactory: (
|
|
172
|
+
options: any,
|
|
173
|
+
categoryProductRepository: CategoryProductHasuraGraphQLRepository,
|
|
174
|
+
): WishlistHasuraGraphQLRepository => {
|
|
175
|
+
return new WishlistHasuraGraphQLRepository(options, categoryProductRepository)
|
|
176
|
+
},
|
|
177
|
+
inject: ['HasuraConfig', CategoryProductHasuraGraphQLRepository],
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
provide: 'WishlistRepository',
|
|
181
|
+
useExisting: WishlistHasuraGraphQLRepository,
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
provide: ProductErrorsHasuraGraphQLRepository,
|
|
185
|
+
useFactory: (
|
|
186
|
+
options: HasuraConstructorParams<ProductErrors>,
|
|
187
|
+
productRepository: ProductHasuraGraphQLRepository,
|
|
188
|
+
): ProductErrorsRepository => {
|
|
189
|
+
return new ProductErrorsHasuraGraphQLRepository(options, productRepository)
|
|
190
|
+
},
|
|
191
|
+
inject: ['HasuraConfig', ProductHasuraGraphQLRepository],
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
provide: 'ProductErrorsRepository',
|
|
195
|
+
useExisting: ProductErrorsHasuraGraphQLRepository,
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
provide: ProductCatalogHasuraGraphQLRepository,
|
|
199
|
+
useFactory: (options: any): ProductCatalogHasuraGraphQLRepository => {
|
|
200
|
+
return new ProductCatalogHasuraGraphQLRepository(options)
|
|
201
|
+
},
|
|
202
|
+
inject: ['HasuraConfig'],
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
provide: 'ProductCatalogRepository',
|
|
206
|
+
useExisting: ProductCatalogHasuraGraphQLRepository,
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
provide: ProductStockEntryHasuraGraphQLRepository,
|
|
210
|
+
useFactory: (options: any): ProductStockEntryRepository => {
|
|
211
|
+
return new ProductStockEntryHasuraGraphQLRepository(options)
|
|
212
|
+
},
|
|
213
|
+
inject: ['HasuraConfig'],
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
provide: 'ProductStockEntryRepository',
|
|
217
|
+
useExisting: ProductStockEntryHasuraGraphQLRepository,
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
provide: ProductGroupHasuraGraphQLRepository,
|
|
221
|
+
useFactory: (options: any): ProductGroupHasuraGraphQLRepository => {
|
|
222
|
+
return new ProductGroupHasuraGraphQLRepository(options)
|
|
223
|
+
},
|
|
224
|
+
inject: ['HasuraConfig'],
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
provide: 'ProductGroupRepository',
|
|
228
|
+
useExisting: ProductGroupHasuraGraphQLRepository,
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
provide: ProductPriceLogHasuraGraphQLRepository,
|
|
232
|
+
useFactory: (options: any): ProductPriceLogHasuraGraphQLRepository => {
|
|
233
|
+
return new ProductPriceLogHasuraGraphQLRepository(options)
|
|
234
|
+
},
|
|
235
|
+
inject: ['HasuraConfig'],
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
provide: 'ProductPriceLogRepository',
|
|
239
|
+
useExisting: ProductPriceLogHasuraGraphQLRepository,
|
|
240
|
+
},
|
|
241
|
+
],
|
|
242
|
+
exports: [
|
|
243
|
+
'CategoryRepository',
|
|
244
|
+
CategoryHasuraGraphQLRepository,
|
|
245
|
+
'ProductRepository',
|
|
246
|
+
ProductHasuraGraphQLRepository,
|
|
247
|
+
'ProductReviewRepository',
|
|
248
|
+
ProductReviewHasuraGraphQLRepository,
|
|
249
|
+
'VariantRepository',
|
|
250
|
+
VariantHasuraGraphQLRepository,
|
|
251
|
+
'ProductStockNotificationRepository',
|
|
252
|
+
ProductStockNotificationHasuraGraphQLRepository,
|
|
253
|
+
'CategoryFilterRepository',
|
|
254
|
+
CategoryFilterHasuraGraphQLRepository,
|
|
255
|
+
'FilterOptionRepository',
|
|
256
|
+
FilterOptionHasuraGraphQLRepository,
|
|
257
|
+
'FilterRepository',
|
|
258
|
+
FilterHasuraGraphQLRepository,
|
|
259
|
+
'CategoryCollectionChildrenRepository',
|
|
260
|
+
CategoryCollectionChildrenHasuraGraphQLRepository,
|
|
261
|
+
'WishlistRepository',
|
|
262
|
+
WishlistHasuraGraphQLRepository,
|
|
263
|
+
'CategoryProductRepository',
|
|
264
|
+
CategoryProductHasuraGraphQLRepository,
|
|
265
|
+
'ProductErrorsRepository',
|
|
266
|
+
ProductErrorsHasuraGraphQLRepository,
|
|
267
|
+
'ProductCatalogRepository',
|
|
268
|
+
ProductCatalogHasuraGraphQLRepository,
|
|
269
|
+
'ProductStockEntryRepository',
|
|
270
|
+
ProductStockEntryHasuraGraphQLRepository,
|
|
271
|
+
'ProductGroupRepository',
|
|
272
|
+
ProductGroupHasuraGraphQLRepository,
|
|
273
|
+
'ProductPriceLogRepository',
|
|
274
|
+
ProductPriceLogHasuraGraphQLRepository,
|
|
275
|
+
],
|
|
276
|
+
})
|
|
277
|
+
export class NestHasuraGraphQLModule {
|
|
278
|
+
public static initializeApp(options: { endpoint: string; credentials: HasuraGraphQLAuthOptions }): DynamicModule {
|
|
279
|
+
return {
|
|
280
|
+
module: NestHasuraGraphQLModule,
|
|
281
|
+
providers: [{ provide: HASURA_OPTIONS, useValue: options }],
|
|
282
|
+
exports: [HASURA_OPTIONS],
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Module } from '@nestjs/common'
|
|
2
|
+
import { FirebaseAdmin, FirebaseConstants } from 'nestjs-firebase'
|
|
3
|
+
|
|
4
|
+
import { FIREBASE_STORAGE } from './consts'
|
|
5
|
+
|
|
6
|
+
@Module({
|
|
7
|
+
providers: [
|
|
8
|
+
{
|
|
9
|
+
provide: FIREBASE_STORAGE,
|
|
10
|
+
useFactory: (firebaseAdmin: FirebaseAdmin) => firebaseAdmin.storage,
|
|
11
|
+
inject: [FirebaseConstants.FIREBASE_TOKEN],
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
exports: [FIREBASE_STORAGE],
|
|
15
|
+
})
|
|
16
|
+
export class NestStorageModule {}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ProductsVertexSearch } from '@infrab4a/connect'
|
|
2
|
+
import { DynamicModule, Module } from '@nestjs/common'
|
|
3
|
+
|
|
4
|
+
import { VERTEX_CONFIG } from './consts'
|
|
5
|
+
import { DiscoveryEngineVertexAdapter, VertexConfig } from './infra'
|
|
6
|
+
|
|
7
|
+
@Module({
|
|
8
|
+
providers: [
|
|
9
|
+
DiscoveryEngineVertexAdapter,
|
|
10
|
+
{
|
|
11
|
+
provide: ProductsVertexSearch,
|
|
12
|
+
useFactory: (adapter: DiscoveryEngineVertexAdapter): ProductsVertexSearch => new ProductsVertexSearch(adapter),
|
|
13
|
+
inject: [DiscoveryEngineVertexAdapter],
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
exports: [ProductsVertexSearch],
|
|
17
|
+
})
|
|
18
|
+
export class NestVertexSeachModule {
|
|
19
|
+
public static initializeApp(options: VertexConfig): DynamicModule {
|
|
20
|
+
return {
|
|
21
|
+
module: NestVertexSeachModule,
|
|
22
|
+
providers: [{ provide: VERTEX_CONFIG, useValue: options }],
|
|
23
|
+
exports: [VERTEX_CONFIG],
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare module 'pagarme' {
|
|
2
|
+
interface PagarmeClient {
|
|
3
|
+
transactions: {
|
|
4
|
+
create(payload: any): Promise<any>
|
|
5
|
+
find(query: { id: number }): Promise<any>
|
|
6
|
+
}
|
|
7
|
+
cards: {
|
|
8
|
+
find(query: any): Promise<any>
|
|
9
|
+
create(payload: any): Promise<any>
|
|
10
|
+
}
|
|
11
|
+
security: {
|
|
12
|
+
encrypt(payload: any): Promise<any>
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface PagarmeModule {
|
|
17
|
+
client: {
|
|
18
|
+
connect(options: { api_key: string }): Promise<PagarmeClient>
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const pagarme: PagarmeModule
|
|
23
|
+
export = pagarme
|
|
24
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"declarationMap": true,
|
|
5
|
+
"inlineSources": true,
|
|
6
|
+
"noEmit": true
|
|
7
|
+
},
|
|
8
|
+
"exclude": [
|
|
9
|
+
"**/*.spec.ts"
|
|
10
|
+
],
|
|
11
|
+
"references": [
|
|
12
|
+
{ "path": "../connect" }
|
|
13
|
+
],
|
|
14
|
+
"include": ["./src", "./src/types/**/*"]
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
+
{
|
|
3
|
+
"extends": "../../tsconfig.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"outDir": "../../dist/spec",
|
|
6
|
+
"types": [
|
|
7
|
+
"jasmine"
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"src/test.ts"
|
|
12
|
+
],
|
|
13
|
+
"include": [
|
|
14
|
+
"**/*.spec.ts",
|
|
15
|
+
"**/*.d.ts"
|
|
16
|
+
]
|
|
17
|
+
}
|
package/index.cjs.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./src\\index";
|
package/index.cjs.default.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
exports._default = require('./index.cjs.js').default;
|