@puca/puca-core 14.8.2 → 14.10.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/.claude/skills/puca-core/SKILL.md +75 -0
- package/.cursor/skills/mcp-view-write-prefix-routing/SKILL.md +88 -0
- package/dist/core/services/auth.service.d.ts +27 -2
- package/dist/core/services/auth.service.js +188 -1
- package/dist/core/services/auth.service.js.map +1 -1
- package/dist/core/services/comunication/comunication-http.service.d.ts +20 -0
- package/dist/core/services/comunication/comunication-http.service.js +170 -0
- package/dist/core/services/comunication/comunication-http.service.js.map +1 -1
- package/dist/core/services/comunication/comunication.service.d.ts +5 -1
- package/dist/core/services/comunication/comunication.service.js +44 -0
- package/dist/core/services/comunication/comunication.service.js.map +1 -1
- package/dist/core/services/crud-front-base.service.d.ts +3 -1
- package/dist/core/services/crud-front-base.service.js +51 -4
- package/dist/core/services/crud-front-base.service.js.map +1 -1
- package/dist/core/services/domain-life-cycle.service.d.ts +1 -3
- package/dist/core/services/domain-life-cycle.service.js +1 -4
- package/dist/core/services/domain-life-cycle.service.js.map +1 -1
- package/dist/core/services/incremental-search-v2.service.d.ts +59 -0
- package/dist/core/services/incremental-search-v2.service.js +214 -0
- package/dist/core/services/incremental-search-v2.service.js.map +1 -0
- package/dist/core/services/incremental-search.service.d.ts +2 -0
- package/dist/core/services/incremental-search.service.js +33 -15
- package/dist/core/services/incremental-search.service.js.map +1 -1
- package/dist/core/services/index.d.ts +3 -1
- package/dist/core/services/index.js +7 -5
- package/dist/core/services/index.js.map +1 -1
- package/dist/core/services/install.service.d.ts +3 -1
- package/dist/core/services/install.service.js +14 -1
- package/dist/core/services/install.service.js.map +1 -1
- package/dist/core/services/llm/llm.service.d.ts +7 -0
- package/dist/core/services/llm/llm.service.js +14 -0
- package/dist/core/services/llm/llm.service.js.map +1 -1
- package/dist/models/crud-controller-especification-environment.d.ts +2 -0
- package/dist/models/crud-controller-especification.d.ts +2 -0
- package/dist/models/crud-controller-especification.js.map +1 -1
- package/dist/models/puca-auth.d.ts +1 -1
- package/dist/orm/services/field-dictionary-cache.service.d.ts +1 -0
- package/dist/orm/services/field-dictionary-cache.service.js +3 -0
- package/dist/orm/services/field-dictionary-cache.service.js.map +1 -1
- package/dist/orm/services/sql/sql-security-layer.service.d.ts +2 -0
- package/dist/orm/services/sql/sql-security-layer.service.js +32 -34
- package/dist/orm/services/sql/sql-security-layer.service.js.map +1 -1
- package/dist/plugins/nestjs/puca-basic-auth.guard.d.ts +5 -0
- package/dist/plugins/nestjs/puca-basic-auth.guard.js +43 -0
- package/dist/plugins/nestjs/puca-basic-auth.guard.js.map +1 -0
- package/dist/plugins/nestjs/puca-basic-or-jwt-auth.guard.d.ts +5 -0
- package/dist/plugins/nestjs/puca-basic-or-jwt-auth.guard.js +50 -0
- package/dist/plugins/nestjs/puca-basic-or-jwt-auth.guard.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/fuql-grammar.js +0 -0
- package/fuql-snapshot/COMAC_MATERIAL_DE_CONSTRUCAO_L_ONDE__Cliente____Chave__nica_____43767__E__Nota_Fiscal____Data______02_06_2025_.json +0 -0
- package/fuql-snapshot/ONDE_N_O_f4___v5_E_f5___v6.json +0 -0
- package/fuql-snapshot/ONDE_Responsavel_CONTEM_raphael.json +0 -0
- package/fuql-snapshot/ONDE_Responsavel__CONTEM_raphael.json +0 -0
- package/fuql-snapshot/ONDE__123_____123_.json +0 -0
- package/fuql-snapshot/ONDE__Etapa____Nome____teste.json +0 -0
- package/fuql-snapshot/ONDE__N_O_f4___v5_E_f5___v6_.json +0 -0
- package/fuql-snapshot/ONDE___idade___18__E__nome____Raphael__OU_nome____Carvalho__.json +0 -0
- package/fuql-snapshot/ONDE__nome_____sobrenome_.json +0 -0
- package/fuql-snapshot/ONDE_data___01_01_2023.json +0 -0
- package/fuql-snapshot/ONDE_nome___1_000_00.json +0 -0
- package/fuql-snapshot/ONDE_nome___Raphael_Carvalho_de_Aguiar.json +0 -0
- package/fuql-snapshot/ONDE_nome____.json +0 -0
- package/fuql-snapshot/ONDE_nome_____Raphael__E_N_O_sobrenome____Carvalho_.json +0 -0
- package/fuql-snapshot/ONDE_responsavel___puca_user.json +0 -0
- package/fuql-snapshot/a223.json +0 -0
- package/fuql-snapshot/bom_dia_ONDE_nome____Raphael_Carvalho_de_Aguiar_.json +0 -0
- package/package.json +1 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ConfigService } from '../../essential/config.service';
|
|
2
|
+
import { JobExecutorFactory } from './job-executor/job-executor.service';
|
|
3
|
+
export interface IncrementalSearchV2Record {
|
|
4
|
+
puca_pid: string;
|
|
5
|
+
puca_key: string;
|
|
6
|
+
label: string;
|
|
7
|
+
link: string;
|
|
8
|
+
_table_label: string;
|
|
9
|
+
_table_name: string;
|
|
10
|
+
}
|
|
11
|
+
export interface IncrementalSearchV2SearchArgs {
|
|
12
|
+
query: string;
|
|
13
|
+
page: number;
|
|
14
|
+
perPage: number;
|
|
15
|
+
facets: string[];
|
|
16
|
+
filters: string;
|
|
17
|
+
}
|
|
18
|
+
export interface IncrementalSearchV2Service {
|
|
19
|
+
destroy(): Promise<void>;
|
|
20
|
+
prepare(): Promise<void>;
|
|
21
|
+
delete(tableLabel: string, pucaPid: string): Promise<void>;
|
|
22
|
+
deleteByTableName(tableName: string, pucaPid: string): Promise<void>;
|
|
23
|
+
search(args: IncrementalSearchV2SearchArgs): Promise<{
|
|
24
|
+
result: IncrementalSearchV2Record[];
|
|
25
|
+
facetsResult: {
|
|
26
|
+
count: number;
|
|
27
|
+
value: string;
|
|
28
|
+
}[];
|
|
29
|
+
}>;
|
|
30
|
+
update(data: IncrementalSearchV2Record): Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
export declare class TypeSenseV2Service implements IncrementalSearchV2Service {
|
|
33
|
+
private readonly domain;
|
|
34
|
+
private readonly configService;
|
|
35
|
+
private readonly jobExecutorFactory;
|
|
36
|
+
private readonly COLLECTION_NAME;
|
|
37
|
+
private readonly DEFAULT_FIELDS;
|
|
38
|
+
private readonly logger;
|
|
39
|
+
private client;
|
|
40
|
+
private jobExecutorWrite;
|
|
41
|
+
private getDocumentId;
|
|
42
|
+
constructor(domain: string, configService: ConfigService, jobExecutorFactory: JobExecutorFactory);
|
|
43
|
+
destroy(): Promise<void>;
|
|
44
|
+
prepare(): Promise<void>;
|
|
45
|
+
search({ query, page, perPage, facets, filters }: IncrementalSearchV2SearchArgs): Promise<{
|
|
46
|
+
result: IncrementalSearchV2Record[];
|
|
47
|
+
facetsResult: {
|
|
48
|
+
count: number;
|
|
49
|
+
value: string;
|
|
50
|
+
}[];
|
|
51
|
+
}>;
|
|
52
|
+
delete(tableLabel: string, pucaPid: string): Promise<void>;
|
|
53
|
+
deleteByTableName(tableName: string, pucaPid: string): Promise<void>;
|
|
54
|
+
update(data: IncrementalSearchV2Record): Promise<void>;
|
|
55
|
+
private deleteDocument;
|
|
56
|
+
private deleteDocumentsByTableName;
|
|
57
|
+
private upsertDocument;
|
|
58
|
+
private createCollectionDefaultFields;
|
|
59
|
+
}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TypeSenseV2Service = void 0;
|
|
4
|
+
const typesense_1 = require("typesense");
|
|
5
|
+
const essential_1 = require("../../essential");
|
|
6
|
+
const logger_1 = require("./logger");
|
|
7
|
+
const valueMap = (value) => {
|
|
8
|
+
return `${value}`;
|
|
9
|
+
};
|
|
10
|
+
class TypeSenseV2Service {
|
|
11
|
+
getDocumentId(data) {
|
|
12
|
+
return `${valueMap(data._table_label)}::${valueMap(data.puca_pid)}`;
|
|
13
|
+
}
|
|
14
|
+
constructor(domain, configService, jobExecutorFactory) {
|
|
15
|
+
this.domain = domain;
|
|
16
|
+
this.configService = configService;
|
|
17
|
+
this.jobExecutorFactory = jobExecutorFactory;
|
|
18
|
+
this.COLLECTION_NAME = `${this.domain}-incremental-search-v2`;
|
|
19
|
+
this.DEFAULT_FIELDS = [
|
|
20
|
+
{
|
|
21
|
+
name: 'puca_pid',
|
|
22
|
+
type: 'string',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'puca_key',
|
|
26
|
+
type: 'string',
|
|
27
|
+
optional: true
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'label',
|
|
31
|
+
type: 'string',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'link',
|
|
35
|
+
type: 'string',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
facet: true,
|
|
39
|
+
name: '_table_label',
|
|
40
|
+
type: 'string',
|
|
41
|
+
index: true
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: '_table_name',
|
|
45
|
+
type: 'string',
|
|
46
|
+
index: true
|
|
47
|
+
}
|
|
48
|
+
];
|
|
49
|
+
this.logger = new logger_1.Logger(this.domain, 'TypeSenseV2Service');
|
|
50
|
+
}
|
|
51
|
+
async destroy() {
|
|
52
|
+
if (this.client) {
|
|
53
|
+
this.client = null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
async prepare() {
|
|
57
|
+
const { typeSense } = await this.configService.getSecret();
|
|
58
|
+
this.jobExecutorWrite = this.jobExecutorFactory.get(`TypeSenseV2Service-write`);
|
|
59
|
+
if (!typeSense) {
|
|
60
|
+
this.logger.warn('prepare', 'TypeSense not available');
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const moduleName = (await essential_1.moduleConfigService.getModuleConfig()).name;
|
|
64
|
+
if (moduleName !== 'puca-base-api') {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
this.client = new typesense_1.default.Client({
|
|
68
|
+
nodes: [{
|
|
69
|
+
host: typeSense.host,
|
|
70
|
+
port: typeSense.port,
|
|
71
|
+
protocol: typeSense.protocol,
|
|
72
|
+
}],
|
|
73
|
+
apiKey: typeSense.apiKey,
|
|
74
|
+
connectionTimeoutSeconds: 2
|
|
75
|
+
});
|
|
76
|
+
try {
|
|
77
|
+
await this.client.collections(this.COLLECTION_NAME).retrieve();
|
|
78
|
+
}
|
|
79
|
+
catch (e) {
|
|
80
|
+
await this.createCollectionDefaultFields();
|
|
81
|
+
}
|
|
82
|
+
this.jobExecutorWrite.process(1, async (job) => {
|
|
83
|
+
if (job.data.type === 'update') {
|
|
84
|
+
await this.upsertDocument(job.data.data);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (job.data.type === 'delete') {
|
|
88
|
+
await this.deleteDocument(job.data.data.tableLabel, job.data.data.pucaPid);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
if (job.data.type === 'deleteByTableName') {
|
|
92
|
+
await this.deleteDocumentsByTableName(job.data.data.tableName, job.data.data.pucaPid);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
this.logger.error('prepare', 'Unknown job type', job.data.type);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
async search({ query, page, perPage, facets, filters }) {
|
|
99
|
+
var _a, _b;
|
|
100
|
+
if (!this.client) {
|
|
101
|
+
this.logger.warn('search', 'TypeSense not available');
|
|
102
|
+
return {
|
|
103
|
+
result: [],
|
|
104
|
+
facetsResult: []
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
try {
|
|
108
|
+
const response = await this.client.collections(this.COLLECTION_NAME).documents().search({
|
|
109
|
+
q: query,
|
|
110
|
+
query_by: 'puca_key,label,link,_table_label,_table_name',
|
|
111
|
+
num_typos: 2,
|
|
112
|
+
per_page: perPage,
|
|
113
|
+
page,
|
|
114
|
+
facet_by: facets.join(','),
|
|
115
|
+
max_facet_values: 10,
|
|
116
|
+
filter_by: filters
|
|
117
|
+
});
|
|
118
|
+
const facetsResult = (((_b = (_a = response.facet_counts) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.counts) || []).map(f => ({
|
|
119
|
+
count: f.count,
|
|
120
|
+
value: f.value,
|
|
121
|
+
}));
|
|
122
|
+
const result = response.hits.map(({ document }) => ({
|
|
123
|
+
puca_pid: document.puca_pid || document.id,
|
|
124
|
+
puca_key: document.puca_key,
|
|
125
|
+
label: document.label,
|
|
126
|
+
link: document.link,
|
|
127
|
+
_table_label: document._table_label,
|
|
128
|
+
_table_name: document._table_name
|
|
129
|
+
}));
|
|
130
|
+
return {
|
|
131
|
+
result,
|
|
132
|
+
facetsResult
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
catch (e) {
|
|
136
|
+
this.logger.error('search', e);
|
|
137
|
+
return {
|
|
138
|
+
result: [],
|
|
139
|
+
facetsResult: []
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
async delete(tableLabel, pucaPid) {
|
|
144
|
+
await this.jobExecutorWrite.add({
|
|
145
|
+
type: 'delete',
|
|
146
|
+
data: { pucaPid, tableLabel }
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
async deleteByTableName(tableName, pucaPid) {
|
|
150
|
+
await this.jobExecutorWrite.add({
|
|
151
|
+
type: 'deleteByTableName',
|
|
152
|
+
data: { pucaPid, tableName }
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
async update(data) {
|
|
156
|
+
await this.jobExecutorWrite.add({
|
|
157
|
+
type: 'update',
|
|
158
|
+
data
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
async deleteDocument(tableLabel, pucaPid) {
|
|
162
|
+
if (!this.client) {
|
|
163
|
+
this.logger.warn('deleteDocument', 'TypeSense not available');
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
const documentId = this.getDocumentId({
|
|
167
|
+
puca_pid: pucaPid,
|
|
168
|
+
_table_label: tableLabel
|
|
169
|
+
});
|
|
170
|
+
try {
|
|
171
|
+
await this.client.collections(this.COLLECTION_NAME).documents(documentId).delete();
|
|
172
|
+
}
|
|
173
|
+
catch (e) {
|
|
174
|
+
this.logger.error('deleteDocument', e);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
async deleteDocumentsByTableName(tableName, pucaPid) {
|
|
178
|
+
if (!this.client) {
|
|
179
|
+
this.logger.warn('deleteDocumentsByTableName', 'TypeSense not available');
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
try {
|
|
183
|
+
await this.client.collections(this.COLLECTION_NAME).documents().delete({
|
|
184
|
+
filter_by: `_table_name:=${valueMap(tableName)} && puca_pid:=${valueMap(pucaPid)}`,
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
catch (e) {
|
|
188
|
+
this.logger.error('deleteDocumentsByTableName', e);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
async upsertDocument(data) {
|
|
192
|
+
if (!this.client) {
|
|
193
|
+
this.logger.warn('upsertDocument', 'TypeSense not available');
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
await this.client.collections(this.COLLECTION_NAME).documents().upsert({
|
|
197
|
+
id: this.getDocumentId(data),
|
|
198
|
+
puca_pid: data.puca_pid,
|
|
199
|
+
puca_key: valueMap(data.puca_key),
|
|
200
|
+
label: valueMap(data.label),
|
|
201
|
+
link: valueMap(data.link),
|
|
202
|
+
_table_label: valueMap(data._table_label || ''),
|
|
203
|
+
_table_name: valueMap(data._table_name || '')
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
async createCollectionDefaultFields() {
|
|
207
|
+
await this.client.collections().create({
|
|
208
|
+
name: this.COLLECTION_NAME,
|
|
209
|
+
fields: this.DEFAULT_FIELDS
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
exports.TypeSenseV2Service = TypeSenseV2Service;
|
|
214
|
+
//# sourceMappingURL=incremental-search-v2.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"incremental-search-v2.service.js","sourceRoot":"","sources":["../../../src/core/services/incremental-search-v2.service.ts"],"names":[],"mappings":";;;AAAA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V,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,4BAA4B,EAAE,CAAC,CAAC,CAAA;SACnD;IACH,CAAC;IAEO,KAAK,CAAC,cAAc,CAAC,IAA+B;QAC1D,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YAChB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAAE,yBAAyB,CAAC,CAAA;YAE7D,OAAM;SACP;QAED,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC;YACrE,EAAE,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;YAC5B,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC;YACjC,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;YAC3B,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;YACzB,YAAY,EAAE,QAAQ,CAAC,IAAI,CAAC,YAAY,IAAI,EAAE,CAAC;YAC/C,WAAW,EAAE,QAAQ,CAAC,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC;SAC9C,CAAC,CAAA;IACJ,CAAC;IAEO,KAAK,CAAC,6BAA6B;QACzC,MAAM,IAAI,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC;YACrC,IAAI,EAAE,IAAI,CAAC,eAAe;YAC1B,MAAM,EAAE,IAAI,CAAC,cAAc;SAC5B,CAAC,CAAA;IACJ,CAAC;CACF;AAzPD,gDAyPC"}
|
|
@@ -11,6 +11,7 @@ export interface IncrementalSearchSearchArgs {
|
|
|
11
11
|
export interface IncrementalSearchService {
|
|
12
12
|
destroy(): Promise<void>;
|
|
13
13
|
prepare(): Promise<void>;
|
|
14
|
+
clearByTable(tableName: string): Promise<void>;
|
|
14
15
|
search<T extends {
|
|
15
16
|
puca_pid: string;
|
|
16
17
|
}>(args: IncrementalSearchSearchArgs): Promise<{
|
|
@@ -37,6 +38,7 @@ export declare class TypeSenseService implements IncrementalSearchService {
|
|
|
37
38
|
constructor(domain: string, configService: ConfigService, jobExecutorFactory: JobExecutorFactory);
|
|
38
39
|
destroy(): Promise<void>;
|
|
39
40
|
prepare(): Promise<void>;
|
|
41
|
+
clearByTable(tableName: string): Promise<void>;
|
|
40
42
|
search<T extends {
|
|
41
43
|
puca_pid: string;
|
|
42
44
|
}>({ fields, query, page, perPage, facets, filters }: IncrementalSearchSearchArgs): Promise<{
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TypeSenseService = void 0;
|
|
4
4
|
const _ = require("lodash");
|
|
5
5
|
const typesense_1 = require("typesense");
|
|
6
|
+
const essential_1 = require("../../essential");
|
|
6
7
|
const logger_1 = require("./logger");
|
|
7
8
|
const valueMap = (value) => {
|
|
8
9
|
return `${value}`;
|
|
@@ -59,22 +60,39 @@ class TypeSenseService {
|
|
|
59
60
|
catch (e) {
|
|
60
61
|
await this.createCollectionDefaultFields();
|
|
61
62
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
if (key === 'puca_pid') {
|
|
69
|
-
return r;
|
|
63
|
+
const moduleName = (await essential_1.moduleConfigService.getModuleConfig()).name;
|
|
64
|
+
if (moduleName === 'puca-base-api') {
|
|
65
|
+
this.jobExecutorUpinsert.process(typeSense.updateConcurrency || 1, async (job) => {
|
|
66
|
+
if (!this.client) {
|
|
67
|
+
this.logger.warn('prepare', 'TypeSense not configured');
|
|
68
|
+
return;
|
|
70
69
|
}
|
|
71
|
-
r[key]
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
70
|
+
await this.client.collections(this.COLLECTION_NAME).documents().upsert(Object.entries(job.data.data).reduce((r, [key, value]) => {
|
|
71
|
+
if (key === 'puca_pid') {
|
|
72
|
+
return r;
|
|
73
|
+
}
|
|
74
|
+
r[key] = valueMap(value);
|
|
75
|
+
return r;
|
|
76
|
+
}, {
|
|
77
|
+
id: job.data.data.puca_pid,
|
|
78
|
+
_table_name: job.data.tableName,
|
|
79
|
+
}));
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
async clearByTable(tableName) {
|
|
84
|
+
if (!this.client) {
|
|
85
|
+
this.logger.warn('clearByTable', 'TypeSense not configured');
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
try {
|
|
89
|
+
await this.client.collections(this.COLLECTION_NAME).documents().delete({
|
|
90
|
+
filter_by: `_table_name:=${tableName}`
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
catch (e) {
|
|
94
|
+
this.logger.error('clearByTable', e);
|
|
95
|
+
}
|
|
78
96
|
}
|
|
79
97
|
async search({ fields, query, page, perPage, facets, filters }) {
|
|
80
98
|
if (!this.client) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"incremental-search.service.js","sourceRoot":"","sources":["../../../src/core/services/incremental-search.service.ts"],"names":[],"mappings":";;;AAAA,4BAA2B;AAC3B,yCAA6C;
|
|
1
|
+
{"version":3,"file":"incremental-search.service.js","sourceRoot":"","sources":["../../../src/core/services/incremental-search.service.ts"],"names":[],"mappings":";;;AAAA,4BAA2B;AAC3B,yCAA6C;AAG7C,+CAAsD;AAEtD,qCAAkC;AAGlC,MAAM,QAAQ,GAAG,CAAC,KAAU,EAAE,EAAE;IAE9B,OAAO,GAAG,KAAK,EAAE,CAAA;AACnB,CAAC,CAAA;AA+BD,MAAa,gBAAgB;IAuB3B,YACmB,MAAc,EACd,aAA4B,EAC5B,kBAAsC;QAFtC,WAAM,GAAN,MAAM,CAAQ;QACd,kBAAa,GAAb,aAAa,CAAe;QAC5B,uBAAkB,GAAlB,kBAAkB,CAAoB;QAzBxC,oBAAe,GA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;oBACV,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,IAAI;iBACf;aACF;SACF,CAAC,CAAA;IACJ,CAAC;CAEF;AAzMD,4CAyMC"}
|
|
@@ -24,6 +24,7 @@ import { EmailService } from './email.service';
|
|
|
24
24
|
import { SelectManyDataService } from './select-many-data.service';
|
|
25
25
|
import { UserService } from './user.service';
|
|
26
26
|
import { IncrementalSearchService } from './incremental-search.service';
|
|
27
|
+
import { IncrementalSearchV2Service } from './incremental-search-v2.service';
|
|
27
28
|
import { LinkBuilder } from './link-builder';
|
|
28
29
|
import { PluginService } from './plugin.service';
|
|
29
30
|
import { SystemParametersEnvs } from './system-parameters-envs.service';
|
|
@@ -40,7 +41,6 @@ export declare const systemParametersEnvs: MultiTenantAdapter<SystemParametersEn
|
|
|
40
41
|
export declare const tokenBudgetService: MultiTenantAdapter<TokenBudgetService>;
|
|
41
42
|
export declare const jobService: MultiTenantAdapter<JobService>;
|
|
42
43
|
export declare const storageServiceManager: MultiTenantAdapter<StorageServiceManager>;
|
|
43
|
-
export declare const authService: MultiTenantAdapter<AuthService>;
|
|
44
44
|
export declare const userConfigService: MultiTenantAdapter<UserConfigService>;
|
|
45
45
|
export declare const comunicationHttpService: MultiTenantAdapter<ComunicationServiceHttp>;
|
|
46
46
|
export declare const comunicationService: MultiTenantAdapter<ComunicationService>;
|
|
@@ -51,6 +51,7 @@ export declare const bootstrapService: MultiTenantAdapter<BootstrapService>;
|
|
|
51
51
|
export declare const moduleEspecificationService: MultiTenantAdapter<ModuleEspecificationService>;
|
|
52
52
|
export declare const tablePermissionService: MultiTenantAdapter<TablePermissionService>;
|
|
53
53
|
export declare const incrementalSearchService: MultiTenantAdapter<IncrementalSearchService>;
|
|
54
|
+
export declare const incrementalSearchV2Service: MultiTenantAdapter<IncrementalSearchV2Service>;
|
|
54
55
|
export declare const installService: MultiTenantAdapter<InstallService>;
|
|
55
56
|
export declare const webSocketService: MultiTenantAdapter<WebSocketService>;
|
|
56
57
|
export declare const oneSignalService: MultiTenantAdapter<OneSignalService>;
|
|
@@ -62,6 +63,7 @@ export declare const linkBuilder: MultiTenantAdapter<LinkBuilder>;
|
|
|
62
63
|
export declare const reportService: MultiTenantAdapter<ReportService>;
|
|
63
64
|
export declare const selectManyDataService: MultiTenantAdapter<SelectManyDataService>;
|
|
64
65
|
export declare const userService: MultiTenantAdapter<UserService>;
|
|
66
|
+
export declare const authService: MultiTenantAdapter<AuthService>;
|
|
65
67
|
export declare const pluginService: MultiTenantAdapter<PluginService>;
|
|
66
68
|
export declare const mcpServerInstanceGerenciator: MultiTenantAdapter<McpServerInstanceGerenciator>;
|
|
67
69
|
export declare const mcpClientService: MultiTenantAdapter<McpClientService>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.serverLifeCycleService = exports.domainLifeCycleService = exports.tagService = exports.kpiService = exports.mcpClientService = exports.mcpServerInstanceGerenciator = exports.pluginService = exports.userService = exports.selectManyDataService = exports.reportService = exports.linkBuilder = exports.followersService = exports.taskService = exports.notificationService = exports.emailService = exports.oneSignalService = exports.webSocketService = exports.installService = exports.incrementalSearchService = exports.tablePermissionService = exports.moduleEspecificationService = exports.bootstrapService = exports.migrationService = exports.sourceService = exports.llmService = exports.comunicationService = exports.comunicationHttpService = exports.userConfigService = exports.
|
|
3
|
+
exports.serverLifeCycleService = exports.domainLifeCycleService = exports.tagService = exports.kpiService = exports.mcpClientService = exports.mcpServerInstanceGerenciator = exports.pluginService = exports.authService = exports.userService = exports.selectManyDataService = exports.reportService = exports.linkBuilder = exports.followersService = exports.taskService = exports.notificationService = exports.emailService = exports.oneSignalService = exports.webSocketService = exports.installService = exports.incrementalSearchV2Service = exports.incrementalSearchService = exports.tablePermissionService = exports.moduleEspecificationService = exports.bootstrapService = exports.migrationService = exports.sourceService = exports.llmService = exports.comunicationService = exports.comunicationHttpService = exports.userConfigService = exports.storageServiceManager = exports.jobService = exports.tokenBudgetService = exports.systemParametersEnvs = exports.evalServiceFactory = exports.jobExecutorFactory = void 0;
|
|
4
4
|
const plugins_1 = require("../../plugins");
|
|
5
5
|
const puca_hub_service_1 = require("../../plugins/multi-tenant/puca-hub.service");
|
|
6
6
|
const domain_life_cycle_service_1 = require("./domain-life-cycle.service");
|
|
@@ -34,6 +34,7 @@ const email_service_1 = require("./email.service");
|
|
|
34
34
|
const select_many_data_service_1 = require("./select-many-data.service");
|
|
35
35
|
const user_service_1 = require("./user.service");
|
|
36
36
|
const incremental_search_service_1 = require("./incremental-search.service");
|
|
37
|
+
const incremental_search_v2_service_1 = require("./incremental-search-v2.service");
|
|
37
38
|
const link_builder_1 = require("./link-builder");
|
|
38
39
|
const plugin_service_1 = require("./plugin.service");
|
|
39
40
|
const system_parameters_envs_service_1 = require("./system-parameters-envs.service");
|
|
@@ -45,13 +46,12 @@ const mcp_client_service_1 = require("./mcp/mcp.client.service");
|
|
|
45
46
|
const token_budget_service_1 = require("./llm/token-budget.service");
|
|
46
47
|
const kpi_service_1 = require("./kpi.service");
|
|
47
48
|
const tag_service_1 = require("./tag.service");
|
|
48
|
-
exports.jobExecutorFactory = new multi_tentant_adapter_1.MultiTenantAdapter(domain => new job_executor_service_1.JobExecutorFactory(domain, essential_1.configService.get(domain), essential_1.envConfigService.get(domain), plugins_1.uuidService));
|
|
49
|
+
exports.jobExecutorFactory = new multi_tentant_adapter_1.MultiTenantAdapter(domain => new job_executor_service_1.JobExecutorFactory(domain, essential_1.configService.get(domain), essential_1.envConfigService.get(domain), plugins_1.uuidService), async (domain, service) => await service.prepare());
|
|
49
50
|
exports.evalServiceFactory = new multi_tentant_adapter_1.MultiTenantAdapter(domain => new eval_service_1.EvalServiceFactory(domain, services_1.repositoryFactory.get(domain), plugins_1.uuidService, services_1.transactionFactory.get(domain)), null, async (domain, service) => await service.destroy());
|
|
50
51
|
exports.systemParametersEnvs = new multi_tentant_adapter_1.MultiTenantAdapter(domain => new system_parameters_envs_service_1.SystemParametersEnvs(domain, services_1.repositoryFactory.get(domain), essential_1.configService.get(domain)), null, async (domain, service) => await service.destroy());
|
|
51
52
|
exports.tokenBudgetService = new multi_tentant_adapter_1.MultiTenantAdapter(domain => new token_budget_service_1.TokenBudgetService(domain, services_1.secondaryDataBase.get(domain), services_1.repositoryFactory.get(domain), essential_1.envConfigService.get(domain), exports.jobExecutorFactory.get(domain), essential_1.monitorService.get(domain)));
|
|
52
53
|
exports.jobService = new multi_tentant_adapter_1.MultiTenantAdapter(domain => new job_service_1.JobService(new job_client_1.JobClientManager(domain, essential_1.configService.get(domain)), essential_1.configService.get(domain), essential_1.moduleConfigService), null, async (domain, service) => await service.destroy());
|
|
53
54
|
exports.storageServiceManager = new multi_tentant_adapter_1.MultiTenantAdapter(domain => new storage_service_1.StorageServiceManager(domain, services_1.secondaryDataBase.get(domain), essential_1.configService.get(domain)));
|
|
54
|
-
exports.authService = new multi_tentant_adapter_1.MultiTenantAdapter(domain => new auth_service_1.AuthService(domain, essential_1.configService.get(domain), services_1.repositoryFactory.get(domain), essential_1.moduleConfigService, plugins_1.uuidService), async (domain, service) => await service.init());
|
|
55
55
|
exports.userConfigService = new multi_tentant_adapter_1.MultiTenantAdapter(domain => new user_config_service_1.UserConfigService(essential_1.moduleConfigService, services_1.repositoryFactory.get(domain), essential_1.configService.get(domain), exports.evalServiceFactory.get(domain)));
|
|
56
56
|
exports.comunicationHttpService = new multi_tentant_adapter_1.MultiTenantAdapter(domain => new comunication_http_service_1.ComunicationServiceHttp(domain, essential_1.configService.get(domain)));
|
|
57
57
|
exports.comunicationService = new multi_tentant_adapter_1.MultiTenantAdapter(domain => new comunication_service_1.ComunicationService(domain, exports.comunicationHttpService.get(domain), essential_1.moduleConfigService, essential_1.configService.get(domain), plugins_1.uuidService));
|
|
@@ -67,7 +67,8 @@ exports.tablePermissionService = new multi_tentant_adapter_1.MultiTenantAdapter(
|
|
|
67
67
|
return i;
|
|
68
68
|
}, exports.moduleEspecificationService.get(domain)));
|
|
69
69
|
exports.incrementalSearchService = new multi_tentant_adapter_1.MultiTenantAdapter(domain => new incremental_search_service_1.TypeSenseService(domain, essential_1.configService.get(domain), exports.jobExecutorFactory.get(domain)), null, async (domain, service) => await service.destroy());
|
|
70
|
-
exports.
|
|
70
|
+
exports.incrementalSearchV2Service = new multi_tentant_adapter_1.MultiTenantAdapter(domain => new incremental_search_v2_service_1.TypeSenseV2Service(domain, essential_1.configService.get(domain), exports.jobExecutorFactory.get(domain)), async (domain, service) => await service.prepare(), async (domain, service) => await service.destroy());
|
|
71
|
+
exports.installService = new multi_tentant_adapter_1.MultiTenantAdapter(domain => new install_service_1.InstallService(domain, exports.migrationService.get(domain), services_1.repositoryFactory.get(domain), plugins_1.sharedFileSystemService, exports.moduleEspecificationService.get(domain), exports.jobService.get(domain), exports.tablePermissionService.get(domain), services_1.transactionFactory.get(domain), services_1.secondaryDataBase.get(domain), cases_1.selectService.get(domain), cases_1.ddlService.get(domain), services_1.databaseManagerService.get(domain), exports.incrementalSearchService.get(domain), crud_front_base_service_1.interfaceCrudFrontBaseServiceInstances.get(domain).crudControllerEspecificationEnvironmentToCrudControllerEspecificationListAllInstances));
|
|
71
72
|
exports.webSocketService = new multi_tentant_adapter_1.MultiTenantAdapter(() => new web_socket_service_1.WebSocketService(), async (domain, service) => await service.initDomain(domain));
|
|
72
73
|
exports.oneSignalService = new multi_tentant_adapter_1.MultiTenantAdapter(domain => new onesignal_service_1.OneSignalService(essential_1.configService.get(domain)));
|
|
73
74
|
exports.emailService = new multi_tentant_adapter_1.MultiTenantAdapter(domain => new email_service_1.ElasticMailService(domain, essential_1.configService.get(domain)));
|
|
@@ -78,11 +79,12 @@ exports.linkBuilder = new multi_tentant_adapter_1.MultiTenantAdapter(domain => n
|
|
|
78
79
|
exports.reportService = new multi_tentant_adapter_1.MultiTenantAdapter(domain => new report_service_1.ReportService(domain, plugins_1.uuidService, exports.notificationService.get(domain), services_1.repositoryFactory.get(domain), exports.storageServiceManager.get(domain), essential_1.configService.get(domain), exports.jobExecutorFactory.get(domain), exports.userConfigService.get(domain), exports.linkBuilder.get(domain)));
|
|
79
80
|
exports.selectManyDataService = new multi_tentant_adapter_1.MultiTenantAdapter(domain => new select_many_data_service_1.SelectManyDataService(services_1.repositoryFactory.get(domain)));
|
|
80
81
|
exports.userService = new multi_tentant_adapter_1.MultiTenantAdapter(domain => new user_service_1.UserService(domain, services_1.repositoryFactory.get(domain), services_1.requestCacheServiceFactory.get(domain)), async (domain, service) => await service.init());
|
|
82
|
+
exports.authService = new multi_tentant_adapter_1.MultiTenantAdapter(domain => new auth_service_1.AuthService(domain, essential_1.configService.get(domain), services_1.repositoryFactory.get(domain), essential_1.moduleConfigService, plugins_1.uuidService, essential_1.envConfigService.get(domain), exports.userService.get(domain), services_1.cacheServiceV2.get(domain)), async (domain, service) => await service.init());
|
|
81
83
|
exports.pluginService = new multi_tentant_adapter_1.MultiTenantAdapter(domain => new plugin_service_1.PluginService(domain, essential_1.configService.get(domain), exports.comunicationService.get(domain), exports.linkBuilder.get(domain), services_1.cacheServiceFactory.get(domain), services_1.repositoryFactory.get(domain)));
|
|
82
84
|
exports.mcpServerInstanceGerenciator = new multi_tentant_adapter_1.MultiTenantAdapter(domain => new mcp_server_service_1.McpServerInstanceGerenciator(services_1.secondaryDataBase.get(domain)));
|
|
83
85
|
exports.mcpClientService = new multi_tentant_adapter_1.MultiTenantAdapter(domain => new mcp_client_service_1.McpClientService(exports.linkBuilder.get(domain)));
|
|
84
86
|
exports.kpiService = new multi_tentant_adapter_1.MultiTenantAdapter(domain => new kpi_service_1.KpiService(domain, services_1.repositoryFactory.get(domain)));
|
|
85
87
|
exports.tagService = new multi_tentant_adapter_1.MultiTenantAdapter(domain => new tag_service_1.TagService(services_1.repositoryFactory.get(domain)));
|
|
86
|
-
exports.domainLifeCycleService = new multi_tentant_adapter_1.MultiTenantAdapter(domain => new domain_life_cycle_service_1.DomainLifeCycleService(domain, services_1.databaseManagerService.get(domain), exports.bootstrapService.get(domain), exports.installService.get(domain), services_1.sqlService.get(domain), exports.reportService.get(domain), exports.
|
|
88
|
+
exports.domainLifeCycleService = new multi_tentant_adapter_1.MultiTenantAdapter(domain => new domain_life_cycle_service_1.DomainLifeCycleService(domain, services_1.databaseManagerService.get(domain), exports.bootstrapService.get(domain), exports.installService.get(domain), services_1.sqlService.get(domain), exports.reportService.get(domain), exports.evalServiceFactory.get(domain), exports.incrementalSearchService.get(domain), exports.emailService.get(domain), exports.authService.get(domain), exports.pluginService.get(domain), services_1.repositoryFactory.get(domain), exports.systemParametersEnvs.get(domain), essential_1.mqService.get(domain), essential_1.monitorService.get(domain), exports.tokenBudgetService.get(domain), services_1.secondaryDataBase.get(domain)), async (domain, service) => await service.start(), async (domain, service) => await service.shutdown());
|
|
87
89
|
exports.serverLifeCycleService = new server_life_cycle_service_1.ServerLifeCycleService(puca_hub_service_1.pucaHubService, exports.domainLifeCycleService);
|
|
88
90
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/services/index.ts"],"names":[],"mappings":";;;AAAA,2CAAqE;AACrE,kFAA6E;AAC7E,2EAAqE;AACrE,2EAAqE;AACrE,+CAAkH;AAClH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/services/index.ts"],"names":[],"mappings":";;;AAAA,2CAAqE;AACrE,kFAA6E;AAC7E,2EAAqE;AACrE,2EAAqE;AACrE,+CAAkH;AAClH,iDAW4B;AAC5B,4FAAsF;AACtF,qEAAiE;AACjE,8EAA0E;AAC1E,qEAAiE;AACjE,uDAAmD;AACnD,+DAA0D;AAC1D,6DAAwD;AACxD,iDAA6C;AAC7C,+DAAkE;AAClE,0FAAmF;AACnF,4DAAwD;AACxD,wFAAmF;AACnF,qDAAiD;AACjD,iEAA6D;AAC7D,2DAAuD;AACvD,iDAAoD;AACpD,mDAA+C;AAC/C,iDAAmD;AACnD,8EAAyE;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AAkB,CAAC,GAAG,CAAC,MAAM,CAAC,EAC9B,4BAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,CAC9B,EACD,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC,MAAM,OAAO,CAAC,KAAK,EAAE,EAChD,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,CAAC,MAAM,OAAO,CAAC,QAAQ,EAAE,CACpD,CAAA;AAEY,QAAA,sBAAsB,GAAG,IAAI,kDAAsB,CAC9D,iCAAc,EACd,8BAAsB,CACvB,CAAA"}
|
|
@@ -13,6 +13,7 @@ import { DDLService } from '../../orm/cases/bo/ddl.service';
|
|
|
13
13
|
import { DatabaseManagerService } from '../../orm/services/managers/database-manager.service';
|
|
14
14
|
import { SharedFileSystemService } from '../../plugins/file-system/shared-file-system.service';
|
|
15
15
|
import { SecondaryDatabase } from '../../orm/services/secondary-database/secondary-database.service';
|
|
16
|
+
import { IncrementalSearchService } from './incremental-search.service';
|
|
16
17
|
export interface JobCommand {
|
|
17
18
|
method: 'update' | 'delete';
|
|
18
19
|
job: Job;
|
|
@@ -30,10 +31,11 @@ export declare class InstallService {
|
|
|
30
31
|
private readonly selectService;
|
|
31
32
|
private readonly ddlService;
|
|
32
33
|
private readonly databaseManagerService;
|
|
34
|
+
private readonly incrementalSearchService;
|
|
33
35
|
private readonly crudControllerEspecificationEnvironmentToCrudControllerEspecificationListAllInstances;
|
|
34
36
|
private readonly logger;
|
|
35
37
|
private createTimeoutPromise;
|
|
36
|
-
constructor(domain: string, migrationService: MigrationService, repositoryFactory: RepositoryFactory, sharedFileSystemService: SharedFileSystemService, moduleEspecificationService: ModuleEspecificationService, jobService: JobService, tablePermissionService: TablePermissionService, transactionFactory: TransactionFactory, secondaryDataBase: SecondaryDatabase, selectService: SelectService, ddlService: DDLService, databaseManagerService: DatabaseManagerService, crudControllerEspecificationEnvironmentToCrudControllerEspecificationListAllInstances: () => Promise<CrudControllerEspecification[]>);
|
|
38
|
+
constructor(domain: string, migrationService: MigrationService, repositoryFactory: RepositoryFactory, sharedFileSystemService: SharedFileSystemService, moduleEspecificationService: ModuleEspecificationService, jobService: JobService, tablePermissionService: TablePermissionService, transactionFactory: TransactionFactory, secondaryDataBase: SecondaryDatabase, selectService: SelectService, ddlService: DDLService, databaseManagerService: DatabaseManagerService, incrementalSearchService: IncrementalSearchService, crudControllerEspecificationEnvironmentToCrudControllerEspecificationListAllInstances: () => Promise<CrudControllerEspecification[]>);
|
|
37
39
|
private persistCrudEspecificationIntoDictionary;
|
|
38
40
|
installUserConfigDefinitions(args: {
|
|
39
41
|
tableName: string;
|
|
@@ -15,7 +15,7 @@ class InstallService {
|
|
|
15
15
|
}, 20000);
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
|
-
constructor(domain, migrationService, repositoryFactory, sharedFileSystemService, moduleEspecificationService, jobService, tablePermissionService, transactionFactory, secondaryDataBase, selectService, ddlService, databaseManagerService, crudControllerEspecificationEnvironmentToCrudControllerEspecificationListAllInstances) {
|
|
18
|
+
constructor(domain, migrationService, repositoryFactory, sharedFileSystemService, moduleEspecificationService, jobService, tablePermissionService, transactionFactory, secondaryDataBase, selectService, ddlService, databaseManagerService, incrementalSearchService, crudControllerEspecificationEnvironmentToCrudControllerEspecificationListAllInstances) {
|
|
19
19
|
this.domain = domain;
|
|
20
20
|
this.migrationService = migrationService;
|
|
21
21
|
this.repositoryFactory = repositoryFactory;
|
|
@@ -28,6 +28,7 @@ class InstallService {
|
|
|
28
28
|
this.selectService = selectService;
|
|
29
29
|
this.ddlService = ddlService;
|
|
30
30
|
this.databaseManagerService = databaseManagerService;
|
|
31
|
+
this.incrementalSearchService = incrementalSearchService;
|
|
31
32
|
this.crudControllerEspecificationEnvironmentToCrudControllerEspecificationListAllInstances = crudControllerEspecificationEnvironmentToCrudControllerEspecificationListAllInstances;
|
|
32
33
|
this.logger = new logger_1.Logger(domain, 'InstallService');
|
|
33
34
|
}
|
|
@@ -204,6 +205,18 @@ class InstallService {
|
|
|
204
205
|
});
|
|
205
206
|
for (const crudEspecification of crudEspecificationList) {
|
|
206
207
|
const incrementalSearchConfig = incrementalSearchConfigList.find(isc => isc.table_name === crudEspecification.table.tableName);
|
|
208
|
+
const incrementalSearchDisabled = _.get(crudEspecification, 'incrementalSearchConfig.disabled') === true;
|
|
209
|
+
if (incrementalSearchDisabled) {
|
|
210
|
+
if (!(incrementalSearchConfig === null || incrementalSearchConfig === void 0 ? void 0 : incrementalSearchConfig.puca_pid)) {
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
await this.incrementalSearchService.clearByTable(crudEspecification.table.tableName);
|
|
214
|
+
await repository.delete({
|
|
215
|
+
puca_pid: incrementalSearchConfig.puca_pid,
|
|
216
|
+
user
|
|
217
|
+
});
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
207
220
|
if (incrementalSearchConfig && !_.get(crudEspecification, 'incrementalSearchConfig.fields')) {
|
|
208
221
|
await repository.delete({
|
|
209
222
|
puca_pid: incrementalSearchConfig.puca_pid,
|