@n8n/db 1.43.2 → 1.44.1
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/dist/build.tsbuildinfo +1 -1
- package/dist/connection/db-connection-metrics.d.ts +2 -0
- package/dist/connection/db-connection-metrics.js.map +1 -1
- package/dist/connection/db-connection-monitor.d.ts +2 -0
- package/dist/connection/db-connection-monitor.js +23 -0
- package/dist/connection/db-connection-monitor.js.map +1 -1
- package/dist/entities/activity-event.js +2 -1
- package/dist/entities/activity-event.js.map +1 -1
- package/dist/entities/agent-eval-result.ee.d.ts +1 -0
- package/dist/entities/agent-eval-result.ee.js +4 -0
- package/dist/entities/agent-eval-result.ee.js.map +1 -1
- package/dist/entities/execution-entity.d.ts +1 -0
- package/dist/entities/execution-entity.js.map +1 -1
- package/dist/entities/idempotency-key.d.ts +15 -0
- package/dist/entities/idempotency-key.js +55 -0
- package/dist/entities/idempotency-key.js.map +1 -0
- package/dist/entities/index.d.ts +3 -1
- package/dist/entities/index.js +7 -2
- package/dist/entities/index.js.map +1 -1
- package/dist/entities/scheduled-job.d.ts +1 -0
- package/dist/entities/scheduled-job.js +4 -0
- package/dist/entities/scheduled-job.js.map +1 -1
- package/dist/entities/scheduled-task.d.ts +1 -0
- package/dist/entities/scheduled-task.js +4 -0
- package/dist/entities/scheduled-task.js.map +1 -1
- package/dist/entities/types-db.d.ts +1 -0
- package/dist/entities/types-db.js.map +1 -1
- package/dist/migrations/common/1791276719782-AddMetadataToTrustedSource.d.ts +5 -0
- package/dist/migrations/common/1791276719782-AddMetadataToTrustedSource.js +20 -0
- package/dist/migrations/common/1791276719782-AddMetadataToTrustedSource.js.map +1 -0
- package/dist/migrations/common/1791276719783-AllowWhatsAppAgentChatSubscriptions.d.ts +5 -0
- package/dist/migrations/common/1791276719783-AllowWhatsAppAgentChatSubscriptions.js +20 -0
- package/dist/migrations/common/1791276719783-AllowWhatsAppAgentChatSubscriptions.js.map +1 -0
- package/dist/migrations/common/1791366497000-CreateMigrationWorkflowOwnerTable.d.ts +5 -0
- package/dist/migrations/common/1791366497000-CreateMigrationWorkflowOwnerTable.js +37 -0
- package/dist/migrations/common/1791366497000-CreateMigrationWorkflowOwnerTable.js.map +1 -0
- package/dist/migrations/common/1791374893870-AddWorkflowSuggestionReviewState.d.ts +5 -0
- package/dist/migrations/common/1791374893870-AddWorkflowSuggestionReviewState.js +44 -0
- package/dist/migrations/common/1791374893870-AddWorkflowSuggestionReviewState.js.map +1 -0
- package/dist/migrations/common/1791377741439-AllowGitLabPromotionProvider.d.ts +6 -0
- package/dist/migrations/common/1791377741439-AllowGitLabPromotionProvider.js +27 -0
- package/dist/migrations/common/1791377741439-AllowGitLabPromotionProvider.js.map +1 -0
- package/dist/migrations/common/1791378361769-CreateSelfHealingResultTable.d.ts +5 -0
- package/dist/migrations/common/1791378361769-CreateSelfHealingResultTable.js +49 -0
- package/dist/migrations/common/1791378361769-CreateSelfHealingResultTable.js.map +1 -0
- package/dist/migrations/common/1791448888000-AddVerdictToAgentEvalResult.d.ts +5 -0
- package/dist/migrations/common/1791448888000-AddVerdictToAgentEvalResult.js +19 -0
- package/dist/migrations/common/1791448888000-AddVerdictToAgentEvalResult.js.map +1 -0
- package/dist/migrations/common/1791463714234-AddActivityEventResourceIndex.d.ts +5 -0
- package/dist/migrations/common/1791463714234-AddActivityEventResourceIndex.js +16 -0
- package/dist/migrations/common/1791463714234-AddActivityEventResourceIndex.js.map +1 -0
- package/dist/migrations/common/1791540050944-CreateIdempotencyKeyTable.d.ts +5 -0
- package/dist/migrations/common/1791540050944-CreateIdempotencyKeyTable.js +32 -0
- package/dist/migrations/common/1791540050944-CreateIdempotencyKeyTable.js.map +1 -0
- package/dist/migrations/common/1791542683581-AddTimeoutSecondsToScheduler.d.ts +6 -0
- package/dist/migrations/common/1791542683581-AddTimeoutSecondsToScheduler.js +42 -0
- package/dist/migrations/common/1791542683581-AddTimeoutSecondsToScheduler.js.map +1 -0
- package/dist/migrations/postgresdb/index.js +21 -1
- package/dist/migrations/postgresdb/index.js.map +1 -1
- package/dist/migrations/sqlite/1791276719782-AddMetadataToTrustedSource.d.ts +4 -0
- package/dist/migrations/sqlite/1791276719782-AddMetadataToTrustedSource.js +12 -0
- package/dist/migrations/sqlite/1791276719782-AddMetadataToTrustedSource.js.map +1 -0
- package/dist/migrations/sqlite/1791374893870-AddWorkflowSuggestionReviewState.d.ts +4 -0
- package/dist/migrations/sqlite/1791374893870-AddWorkflowSuggestionReviewState.js +12 -0
- package/dist/migrations/sqlite/1791374893870-AddWorkflowSuggestionReviewState.js.map +1 -0
- package/dist/migrations/sqlite/1791377741439-AllowGitLabPromotionProvider.d.ts +4 -0
- package/dist/migrations/sqlite/1791377741439-AllowGitLabPromotionProvider.js +12 -0
- package/dist/migrations/sqlite/1791377741439-AllowGitLabPromotionProvider.js.map +1 -0
- package/dist/migrations/sqlite/1791542683581-AddTimeoutSecondsToScheduler.d.ts +4 -0
- package/dist/migrations/sqlite/1791542683581-AddTimeoutSecondsToScheduler.js +12 -0
- package/dist/migrations/sqlite/1791542683581-AddTimeoutSecondsToScheduler.js.map +1 -0
- package/dist/migrations/sqlite/index.js +21 -1
- package/dist/migrations/sqlite/index.js.map +1 -1
- package/dist/repositories/activity-event.repository.d.ts +5 -0
- package/dist/repositories/activity-event.repository.js +39 -0
- package/dist/repositories/activity-event.repository.js.map +1 -1
- package/dist/repositories/agent-eval-dataset.repository.ee.d.ts +1 -0
- package/dist/repositories/agent-eval-dataset.repository.ee.js +9 -0
- package/dist/repositories/agent-eval-dataset.repository.ee.js.map +1 -1
- package/dist/repositories/agent-eval-result.repository.ee.d.ts +5 -0
- package/dist/repositories/agent-eval-result.repository.ee.js +27 -1
- package/dist/repositories/agent-eval-result.repository.ee.js.map +1 -1
- package/dist/repositories/agent-eval-run.repository.ee.d.ts +1 -0
- package/dist/repositories/agent-eval-run.repository.ee.js +3 -0
- package/dist/repositories/agent-eval-run.repository.ee.js.map +1 -1
- package/dist/repositories/ai-preference.repository.d.ts +2 -1
- package/dist/repositories/ai-preference.repository.js +6 -2
- package/dist/repositories/ai-preference.repository.js.map +1 -1
- package/dist/repositories/credentials.repository.d.ts +1 -0
- package/dist/repositories/credentials.repository.js +10 -1
- package/dist/repositories/credentials.repository.js.map +1 -1
- package/dist/repositories/execution.repository.d.ts +3 -2
- package/dist/repositories/execution.repository.js +3 -1
- package/dist/repositories/execution.repository.js.map +1 -1
- package/dist/repositories/idempotency-key.repository.d.ts +8 -0
- package/dist/repositories/idempotency-key.repository.js +44 -0
- package/dist/repositories/idempotency-key.repository.js.map +1 -0
- package/dist/repositories/index.d.ts +3 -2
- package/dist/repositories/index.js +4 -2
- package/dist/repositories/index.js.map +1 -1
- package/dist/repositories/project-relation.repository.d.ts +1 -0
- package/dist/repositories/project-relation.repository.js +18 -0
- package/dist/repositories/project-relation.repository.js.map +1 -1
- package/dist/repositories/project.repository.d.ts +6 -1
- package/dist/repositories/project.repository.js +22 -0
- package/dist/repositories/project.repository.js.map +1 -1
- package/dist/repositories/role.repository.d.ts +6 -4
- package/dist/repositories/role.repository.js +8 -6
- package/dist/repositories/role.repository.js.map +1 -1
- package/dist/repositories/scheduled-job.repository.d.ts +3 -3
- package/dist/repositories/scheduled-job.repository.js.map +1 -1
- package/dist/repositories/scheduled-task.repository.d.ts +3 -0
- package/dist/repositories/scheduled-task.repository.js +11 -0
- package/dist/repositories/scheduled-task.repository.js.map +1 -1
- package/dist/repositories/settings.repository.d.ts +1 -0
- package/dist/repositories/settings.repository.js +11 -0
- package/dist/repositories/settings.repository.js.map +1 -1
- package/dist/repositories/shared-workflow.repository.d.ts +9 -2
- package/dist/repositories/shared-workflow.repository.js +11 -3
- package/dist/repositories/shared-workflow.repository.js.map +1 -1
- package/dist/repositories/user.repository.d.ts +8 -5
- package/dist/repositories/user.repository.js +12 -7
- package/dist/repositories/user.repository.js.map +1 -1
- package/dist/repositories/workflow-history.repository.d.ts +10 -3
- package/dist/repositories/workflow-history.repository.js +43 -8
- package/dist/repositories/workflow-history.repository.js.map +1 -1
- package/dist/repositories/workflow-publish-history.repository.d.ts +17 -5
- package/dist/repositories/workflow-publish-history.repository.js +74 -10
- package/dist/repositories/workflow-publish-history.repository.js.map +1 -1
- package/dist/repositories/workflow-tag-mapping.repository.d.ts +6 -4
- package/dist/repositories/workflow-tag-mapping.repository.js +8 -6
- package/dist/repositories/workflow-tag-mapping.repository.js.map +1 -1
- package/dist/repositories/workflow.repository.d.ts +33 -5
- package/dist/repositories/workflow.repository.js +176 -53
- package/dist/repositories/workflow.repository.js.map +1 -1
- package/dist/services/auth.roles.service.js.map +1 -1
- package/dist/services/db-lock.service.js.map +1 -1
- package/package.json +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-history.repository.js","sourceRoot":"","sources":["../../src/repositories/workflow-history.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gCAAkC;AAClC,
|
|
1
|
+
{"version":3,"file":"workflow-history.repository.js","sourceRoot":"","sources":["../../src/repositories/workflow-history.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gCAAkC;AAClC,0CAAgE;AAChE,+CAAkF;AAElF,0CAKqB;AACrB,uDAAmD;AACnD,kDAA8C;AAC9C,yGAAgG;AAChG,uFAA+E;AAE/E,yDAA4D;AAGrD,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,gCAA+B;IAC7E,YAAY,UAAsB,EAAE,iBAAoC;QACvE,KAAK,CAAC,0BAAe,EAAE,UAAU,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;IAC/D,CAAC;IAED,KAAK,CAAC,aAAa,CAClB,OAGuF,EACvF,GAAqB;QAErB,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,0BAAe,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAOD,KAAK,CAAC,8BAA8B,CACnC,WAAqB,EACrB,WAAmB;QAEnB,MAAM,MAAM,G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AE,KAAK,CAAC;aACjC,iBAAiB,EAAiD,CAAC;QAGrE,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAChC,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,CACjF,CAAC;QACF,MAAM,OAAO,GAAG,IAAA,6BAAc,EAC7B,SAAS,EACT,KAAK,EACL;YACC,IAAI,CAAC,kCAAkC,CAAC,iBAAiB,CAAC;YAC1D,yBAAU,CAAC,kBAAkB;YAC7B,GAAG,SAAS;SACZ,EACD,QAAQ,CACR,CAAC;QAGF,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC;YACtC,SAAS,EAAE,IAAA,YAAE,EAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YACtD,IAAI,EAAE,IAAA,gBAAM,GAAE;YACd,WAAW,EAAE,IAAA,gBAAM,GAAE;SACrB,CAAC,CAAC;QACH,OAAO,EAAE,IAAI,EAAE,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,IAAI,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;IAChF,CAAC;CACD,CAAA;;oCA9NY,yBAAyB;IADrC,IAAA,YAAO,GAAE;qCAEe,oBAAU,EAAqB,+BAAiB;GAD5D,yBAAyB,CA8NrC"}
|
|
@@ -1,11 +1,23 @@
|
|
|
1
|
-
import { DataSource
|
|
1
|
+
import { DataSource } from '@n8n/typeorm';
|
|
2
2
|
import type { EntityManager } from '@n8n/typeorm';
|
|
3
|
+
import { BaseRepository } from './base-repository';
|
|
3
4
|
import { WorkflowPublishHistory } from '../entities';
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
import { type OperationContext, TransactionRunner } from '../services/transaction';
|
|
6
|
+
export type PublishHistoryScope = 'all' | 'latestActivation' | 'none';
|
|
7
|
+
export declare class WorkflowPublishHistoryRepository extends BaseRepository<WorkflowPublishHistory> {
|
|
8
|
+
constructor(dataSource: DataSource, transactionRunner: TransactionRunner);
|
|
9
|
+
getLatestPublishHistoryEventId(workflowId: string, ctx?: OperationContext): Promise<number | null>;
|
|
6
10
|
addRecord({ workflowId, versionId, event, userId, }: Pick<WorkflowPublishHistory, 'event' | 'workflowId' | 'versionId' | 'userId'>, trx?: EntityManager): Promise<void>;
|
|
7
|
-
findByVersion(workflowId: string, versionId: string, trx?: EntityManager): Promise<WorkflowPublishHistory[]>;
|
|
8
|
-
|
|
11
|
+
findByVersion(workflowId: string, versionId: string, scope?: Exclude<PublishHistoryScope, 'none'>, trx?: EntityManager): Promise<WorkflowPublishHistory[]>;
|
|
12
|
+
findRecentAttributedByWorkflowIds(workflowIds: string[], perWorkflow: number): Promise<Map<string, Array<{
|
|
13
|
+
userId: string;
|
|
14
|
+
at: Date;
|
|
15
|
+
}>>>;
|
|
16
|
+
findLatestActivations(workflowId: string, versionIds: string[]): Promise<WorkflowPublishHistory[]>;
|
|
17
|
+
findTimelinePage(workflowId: string, { offset, limit }: {
|
|
18
|
+
offset: number;
|
|
19
|
+
limit: number;
|
|
20
|
+
}): Promise<WorkflowPublishHistory[]>;
|
|
9
21
|
findActivatedByUserId(workflowId: string): Promise<string | undefined>;
|
|
10
22
|
findPublisherUserId(workflowId: string, versionId?: string | null): Promise<string | undefined>;
|
|
11
23
|
}
|
|
@@ -12,10 +12,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.WorkflowPublishHistoryRepository = void 0;
|
|
13
13
|
const di_1 = require("@n8n/di");
|
|
14
14
|
const typeorm_1 = require("@n8n/typeorm");
|
|
15
|
+
const base_repository_1 = require("./base-repository");
|
|
15
16
|
const entities_1 = require("../entities");
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
const transaction_1 = require("../services/transaction");
|
|
18
|
+
const chunk_ids_1 = require("../utils/chunk-ids");
|
|
19
|
+
let WorkflowPublishHistoryRepository = class WorkflowPublishHistoryRepository extends base_repository_1.BaseRepository {
|
|
20
|
+
constructor(dataSource, transactionRunner) {
|
|
21
|
+
super(entities_1.WorkflowPublishHistory, dataSource.manager, transactionRunner);
|
|
22
|
+
}
|
|
23
|
+
async getLatestPublishHistoryEventId(workflowId, ctx = {}) {
|
|
24
|
+
const publication = await this.managerFor(ctx).findOne(entities_1.WorkflowPublishHistory, {
|
|
25
|
+
where: { workflowId },
|
|
26
|
+
order: { id: 'DESC' },
|
|
27
|
+
});
|
|
28
|
+
return publication?.id ?? null;
|
|
19
29
|
}
|
|
20
30
|
async addRecord({ workflowId, versionId, event, userId, }, trx) {
|
|
21
31
|
const repository = trx ? trx.getRepository(entities_1.WorkflowPublishHistory) : this;
|
|
@@ -26,16 +36,70 @@ let WorkflowPublishHistoryRepository = class WorkflowPublishHistoryRepository ex
|
|
|
26
36
|
userId,
|
|
27
37
|
});
|
|
28
38
|
}
|
|
29
|
-
async findByVersion(workflowId, versionId, trx) {
|
|
39
|
+
async findByVersion(workflowId, versionId, scope = 'all', trx) {
|
|
30
40
|
const repository = trx ? trx.getRepository(entities_1.WorkflowPublishHistory) : this;
|
|
41
|
+
if (scope === 'latestActivation') {
|
|
42
|
+
return await repository.find({
|
|
43
|
+
where: { workflowId, versionId, event: 'activated' },
|
|
44
|
+
order: { id: 'DESC' },
|
|
45
|
+
take: 1,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
31
48
|
return await repository.find({ where: { workflowId, versionId }, order: { id: 'ASC' } });
|
|
32
49
|
}
|
|
33
|
-
async
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
50
|
+
async findRecentAttributedByWorkflowIds(workflowIds, perWorkflow) {
|
|
51
|
+
const recent = new Map();
|
|
52
|
+
if (workflowIds.length === 0 || perWorkflow <= 0)
|
|
53
|
+
return recent;
|
|
54
|
+
for (const chunk of (0, chunk_ids_1.chunkIds)([...new Set(workflowIds)])) {
|
|
55
|
+
const rows = await this.find({
|
|
56
|
+
select: ['id', 'workflowId', 'userId', 'createdAt'],
|
|
57
|
+
where: { workflowId: (0, typeorm_1.In)(chunk), userId: (0, typeorm_1.Not)((0, typeorm_1.IsNull)()) },
|
|
58
|
+
order: { createdAt: 'DESC', id: 'DESC' },
|
|
59
|
+
});
|
|
60
|
+
for (const row of rows) {
|
|
61
|
+
if (row.userId === null)
|
|
62
|
+
continue;
|
|
63
|
+
const entries = recent.get(row.workflowId) ?? [];
|
|
64
|
+
if (entries.length >= perWorkflow)
|
|
65
|
+
continue;
|
|
66
|
+
entries.push({ userId: row.userId, at: row.createdAt });
|
|
67
|
+
recent.set(row.workflowId, entries);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return recent;
|
|
71
|
+
}
|
|
72
|
+
async findLatestActivations(workflowId, versionIds) {
|
|
73
|
+
if (versionIds.length === 0)
|
|
74
|
+
return [];
|
|
75
|
+
const activations = [];
|
|
76
|
+
for (const batch of (0, chunk_ids_1.chunkIds)([...new Set(versionIds)])) {
|
|
77
|
+
const latestIds = this.createQueryBuilder('latest')
|
|
78
|
+
.select('MAX(latest.id)')
|
|
79
|
+
.where('latest.workflowId = :workflowId', { workflowId })
|
|
80
|
+
.andWhere('latest.versionId IN (:...versionIds)', { versionIds: batch })
|
|
81
|
+
.andWhere('latest.event = :event', { event: 'activated' })
|
|
82
|
+
.groupBy('latest.versionId');
|
|
83
|
+
const batchActivations = await this.createQueryBuilder('wph')
|
|
84
|
+
.where(`wph.id IN (${latestIds.getQuery()})`)
|
|
85
|
+
.setParameters(latestIds.getParameters())
|
|
86
|
+
.getMany();
|
|
87
|
+
activations.push(...batchActivations);
|
|
88
|
+
}
|
|
89
|
+
return activations;
|
|
90
|
+
}
|
|
91
|
+
async findTimelinePage(workflowId, { offset, limit }) {
|
|
92
|
+
if (limit <= 0)
|
|
93
|
+
return [];
|
|
94
|
+
return await this.createQueryBuilder('wph')
|
|
95
|
+
.leftJoinAndSelect('wph.user', 'user')
|
|
96
|
+
.leftJoin('wph.workflowHistory', 'wh')
|
|
97
|
+
.addSelect('wh.name')
|
|
38
98
|
.where('wph.workflowId = :workflowId', { workflowId })
|
|
99
|
+
.orderBy('wph.createdAt', 'DESC')
|
|
100
|
+
.addOrderBy('wph.id', 'DESC')
|
|
101
|
+
.offset(offset)
|
|
102
|
+
.limit(limit)
|
|
39
103
|
.getMany();
|
|
40
104
|
}
|
|
41
105
|
async findActivatedByUserId(workflowId) {
|
|
@@ -62,6 +126,6 @@ let WorkflowPublishHistoryRepository = class WorkflowPublishHistoryRepository ex
|
|
|
62
126
|
exports.WorkflowPublishHistoryRepository = WorkflowPublishHistoryRepository;
|
|
63
127
|
exports.WorkflowPublishHistoryRepository = WorkflowPublishHistoryRepository = __decorate([
|
|
64
128
|
(0, di_1.Service)(),
|
|
65
|
-
__metadata("design:paramtypes", [typeorm_1.DataSource])
|
|
129
|
+
__metadata("design:paramtypes", [typeorm_1.DataSource, transaction_1.TransactionRunner])
|
|
66
130
|
], WorkflowPublishHistoryRepository);
|
|
67
131
|
//# sourceMappingURL=workflow-publish-history.repository.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-publish-history.repository.js","sourceRoot":"","sources":["../../src/repositories/workflow-publish-history.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gCAAkC;AAClC,
|
|
1
|
+
{"version":3,"file":"workflow-publish-history.repository.js","sourceRoot":"","sources":["../../src/repositories/workflow-publish-history.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gCAAkC;AAClC,0CAA2D;AAG3D,uDAAmD;AACnD,0CAAqD;AACrD,yDAAmF;AACnF,kDAA8C;AAKvC,IAAM,gCAAgC,GAAtC,MAAM,gCAAiC,SAAQ,gCAAsC;IAC3F,YAAY,UAAsB,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AgC,CAgK5C"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { DataSource
|
|
1
|
+
import { DataSource } from '@n8n/typeorm';
|
|
2
|
+
import { BaseRepository } from './base-repository';
|
|
2
3
|
import { WorkflowTagMapping } from '../entities';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
import { type OperationContext, TransactionRunner } from '../services/transaction';
|
|
5
|
+
export declare class WorkflowTagMappingRepository extends BaseRepository<WorkflowTagMapping> {
|
|
6
|
+
constructor(dataSource: DataSource, transactionRunner: TransactionRunner);
|
|
7
|
+
overwriteTaggings(workflowId: string, tagIds: string[], ctx?: OperationContext): Promise<import("@n8n/typeorm").InsertResult>;
|
|
6
8
|
}
|
|
@@ -12,13 +12,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.WorkflowTagMappingRepository = void 0;
|
|
13
13
|
const di_1 = require("@n8n/di");
|
|
14
14
|
const typeorm_1 = require("@n8n/typeorm");
|
|
15
|
+
const base_repository_1 = require("./base-repository");
|
|
15
16
|
const entities_1 = require("../entities");
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
const transaction_1 = require("../services/transaction");
|
|
18
|
+
let WorkflowTagMappingRepository = class WorkflowTagMappingRepository extends base_repository_1.BaseRepository {
|
|
19
|
+
constructor(dataSource, transactionRunner) {
|
|
20
|
+
super(entities_1.WorkflowTagMapping, dataSource.manager, transactionRunner);
|
|
19
21
|
}
|
|
20
|
-
async overwriteTaggings(workflowId, tagIds) {
|
|
21
|
-
return await this.
|
|
22
|
+
async overwriteTaggings(workflowId, tagIds, ctx = {}) {
|
|
23
|
+
return await this.runInTransaction(ctx, async (tx) => {
|
|
22
24
|
await tx.delete(entities_1.WorkflowTagMapping, { workflowId });
|
|
23
25
|
const taggings = tagIds.map((tagId) => this.create({ workflowId, tagId }));
|
|
24
26
|
return await tx.insert(entities_1.WorkflowTagMapping, taggings);
|
|
@@ -28,6 +30,6 @@ let WorkflowTagMappingRepository = class WorkflowTagMappingRepository extends ty
|
|
|
28
30
|
exports.WorkflowTagMappingRepository = WorkflowTagMappingRepository;
|
|
29
31
|
exports.WorkflowTagMappingRepository = WorkflowTagMappingRepository = __decorate([
|
|
30
32
|
(0, di_1.Service)(),
|
|
31
|
-
__metadata("design:paramtypes", [typeorm_1.DataSource])
|
|
33
|
+
__metadata("design:paramtypes", [typeorm_1.DataSource, transaction_1.TransactionRunner])
|
|
32
34
|
], WorkflowTagMappingRepository);
|
|
33
35
|
//# sourceMappingURL=workflow-tag-mapping.repository.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-tag-mapping.repository.js","sourceRoot":"","sources":["../../src/repositories/workflow-tag-mapping.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gCAAkC;AAClC,
|
|
1
|
+
{"version":3,"file":"workflow-tag-mapping.repository.js","sourceRoot":"","sources":["../../src/repositories/workflow-tag-mapping.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gCAAkC;AAClC,0CAA0C;AAE1C,uDAAmD;AACnD,0CAAiD;AACjD,yDAAmF;AAG5E,IAAM,4BAA4B,GAAlC,MAAM,4BAA6B,SAAQ,gCAAkC;IACnF,YAAY,UAAsB,EAAE,iBAAoC;QACvE,KAAK,CAAC,6BAAkB,EAAE,UAAU,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;IAClE,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,UAAkB,EAAE,MAAgB,EAAE,GAAG,GAAqB,EAAE;QACvF,OAAO,MAAM,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE;YACpD,MAAM,EAAE,CAAC,MAAM,CAAC,6BAAkB,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;YAEpD,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;YAE3E,OAAO,MAAM,EAAE,CAAC,MAAM,CAAC,6BAAkB,EAAE,QAAQ,CAAC,CAAC;QACtD,CAAC,CAAC,CAAC;IACJ,CAAC;CACD,CAAA;;uCAdY,4BAA4B;IADxC,IAAA,YAAO,GAAE;qCAEe,oBAAU,EAAqB,+BAAiB;GAD5D,4BAA4B,CAcxC"}
|
|
@@ -11,7 +11,13 @@ import { WorkflowHistoryRepository } from './workflow-history.repository';
|
|
|
11
11
|
import { WorkflowEntity, User } from '../entities';
|
|
12
12
|
import type { ListQueryDb, FolderWithWorkflowAndSubFolderCount, ListQuery } from '../entities/types-db';
|
|
13
13
|
import { type OperationContext, TransactionRunner } from '../services/transaction';
|
|
14
|
-
type
|
|
14
|
+
export type WorkflowIdsQuery = {
|
|
15
|
+
query: string;
|
|
16
|
+
parameters: Record<string, unknown>;
|
|
17
|
+
};
|
|
18
|
+
type WorkflowListQueryOptions = ListQuery.Options & {
|
|
19
|
+
workflowIdsIn?: WorkflowIdsQuery | null;
|
|
20
|
+
};
|
|
15
21
|
type ResourceType = 'folder' | 'workflow';
|
|
16
22
|
type UpsertableWorkflowContent = QueryDeepPartialEntity<WorkflowEntity> & Pick<WorkflowEntity, 'nodes'> & {
|
|
17
23
|
id?: string;
|
|
@@ -43,7 +49,7 @@ export declare class WorkflowRepository extends BaseRepository<WorkflowEntity> {
|
|
|
43
49
|
findMcpAvailabilityByIds(workflowIds: string[]): Promise<Map<string, boolean>>;
|
|
44
50
|
get(where: FindOptionsWhere<WorkflowEntity>, options?: {
|
|
45
51
|
relations: string[] | FindOptionsRelations<WorkflowEntity>;
|
|
46
|
-
}): Promise<WorkflowEntity | null>;
|
|
52
|
+
}, ctx?: OperationContext): Promise<WorkflowEntity | null>;
|
|
47
53
|
findArchivedState(workflowId: string, ctx?: OperationContext): Promise<{
|
|
48
54
|
isArchived: boolean;
|
|
49
55
|
} | null>;
|
|
@@ -69,8 +75,17 @@ export declare class WorkflowRepository extends BaseRepository<WorkflowEntity> {
|
|
|
69
75
|
findActiveByCredentialResolverId(resolverId: string): Promise<string[]>;
|
|
70
76
|
private addCredentialResolverFilter;
|
|
71
77
|
clearCredentialResolverId(resolverId: string, trx?: EntityManager): Promise<void>;
|
|
78
|
+
removeFromCallerAllowlists(workflowIds: string[], ctx: OperationContext): Promise<void>;
|
|
79
|
+
removeMissingFromCallerAllowlists(ctx: OperationContext): Promise<void>;
|
|
80
|
+
private purgeCallerAllowlists;
|
|
81
|
+
private callerIdEntries;
|
|
82
|
+
private callerIdsWithout;
|
|
83
|
+
private findCallerAllowlistCandidates;
|
|
84
|
+
private lockCallerAllowlists;
|
|
85
|
+
private writeCallerIds;
|
|
72
86
|
findById(workflowId: string): Promise<WorkflowEntity | null>;
|
|
73
87
|
findByIdInContext(workflowId: string, ctx: OperationContext): Promise<WorkflowEntity | null>;
|
|
88
|
+
findForContentUpdate(workflowId: string, ctx: OperationContext): Promise<WorkflowEntity | null>;
|
|
74
89
|
findByIds(workflowIds: string[], { fields }?: {
|
|
75
90
|
fields?: string[];
|
|
76
91
|
}): Promise<WorkflowEntity[]>;
|
|
@@ -108,7 +123,7 @@ export declare class WorkflowRepository extends BaseRepository<WorkflowEntity> {
|
|
|
108
123
|
isPersonalProject?: boolean;
|
|
109
124
|
personalProjectOwnerId?: string;
|
|
110
125
|
onlySharedWithMe?: boolean;
|
|
111
|
-
}, options?: WorkflowListQueryOptions
|
|
126
|
+
}, options?: WorkflowListQueryOptions): Promise<readonly [WorkflowFolderUnionFull[], number]>;
|
|
112
127
|
private getWorkflowsAndFoldersUnionWithSharingSubquery;
|
|
113
128
|
private getWorkflowsAndFoldersCountWithSharingSubquery;
|
|
114
129
|
private buildBaseUnionQueryWithSharingSubquery;
|
|
@@ -126,10 +141,22 @@ export declare class WorkflowRepository extends BaseRepository<WorkflowEntity> {
|
|
|
126
141
|
isPersonalProject?: boolean;
|
|
127
142
|
personalProjectOwnerId?: string;
|
|
128
143
|
onlySharedWithMe?: boolean;
|
|
129
|
-
}, options?: WorkflowListQueryOptions
|
|
144
|
+
}, options?: WorkflowListQueryOptions): Promise<WorkflowListResult>;
|
|
130
145
|
private getManyQueryWithSharingSubquery;
|
|
146
|
+
findCallableSubworkflows(user: User, sharingOptions: {
|
|
147
|
+
scopes: Scope[];
|
|
148
|
+
projectRoles: string[];
|
|
149
|
+
workflowRoles: string[];
|
|
150
|
+
}, parentWorkflowId: string, options: {
|
|
151
|
+
query?: string;
|
|
152
|
+
triggerNodeTypes: string[];
|
|
153
|
+
skip: number;
|
|
154
|
+
take: number;
|
|
155
|
+
}): Promise<{
|
|
156
|
+
workflows: WorkflowEntity[];
|
|
157
|
+
count: number;
|
|
158
|
+
}>;
|
|
131
159
|
private buildCallablePolicySubquery;
|
|
132
|
-
private buildCallablePolicyConditions;
|
|
133
160
|
private settingsTextValue;
|
|
134
161
|
private buildSharedWorkflowIdsSubquery;
|
|
135
162
|
getManyQuery(workflowIds: string[], options?: WorkflowListQueryOptions): SelectQueryBuilder<WorkflowEntity>;
|
|
@@ -149,6 +176,7 @@ export declare class WorkflowRepository extends BaseRepository<WorkflowEntity> {
|
|
|
149
176
|
private applyProjectFilter;
|
|
150
177
|
private applyNodeTypesFilter;
|
|
151
178
|
private buildWorkflowIdsByNodeTypesSubQuery;
|
|
179
|
+
private applyWorkflowIdsInFilter;
|
|
152
180
|
private applyOwnedByRelation;
|
|
153
181
|
private applySelect;
|
|
154
182
|
private applyRelations;
|