n8n 1.113.0 → 1.113.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.
@@ -0,0 +1,4 @@
1
+ import type { SourceControlledFile } from '@n8n/api-types';
2
+ export declare function filterByType(files: SourceControlledFile[], resourceType: SourceControlledFile['type']): SourceControlledFile[];
3
+ export declare function getDeletedResources(files: SourceControlledFile[], resourceType: SourceControlledFile['type']): SourceControlledFile[];
4
+ export declare function getNonDeletedResources(files: SourceControlledFile[], resourceType: SourceControlledFile['type']): SourceControlledFile[];
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.filterByType = filterByType;
4
+ exports.getDeletedResources = getDeletedResources;
5
+ exports.getNonDeletedResources = getNonDeletedResources;
6
+ function filterByType(files, resourceType) {
7
+ return files.filter((file) => file.type === resourceType);
8
+ }
9
+ function filterByStatus(files, resourceType, status) {
10
+ return filterByType(files, resourceType).filter((file) => file.status === status);
11
+ }
12
+ function filterByStatusExcluding(files, resourceType, status) {
13
+ return filterByType(files, resourceType).filter((file) => file.status !== status);
14
+ }
15
+ function getDeletedResources(files, resourceType) {
16
+ return filterByStatus(files, resourceType, 'deleted');
17
+ }
18
+ function getNonDeletedResources(files, resourceType) {
19
+ return filterByStatusExcluding(files, resourceType, 'deleted');
20
+ }
21
+ //# sourceMappingURL=source-control-resource-helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-control-resource-helper.js","sourceRoot":"","sources":["../../../src/environments.ee/source-control/source-control-resource-helper.ts"],"names":[],"mappings":";;AAEA,oCAKC;AAkBD,kDAKC;AAED,wDAKC;AAnCD,SAAgB,YAAY,CAC3B,KAA6B,EAC7B,YAA0C;IAE1C,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC;AAC3D,CAAC;AAED,SAAS,cAAc,CACtB,KAA6B,EAC7B,YAA0C,EAC1C,MAAsC;IAEtC,OAAO,YAAY,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC;AACnF,CAAC;AAED,SAAS,uBAAuB,CAC/B,KAA6B,EAC7B,YAA0C,EAC1C,MAAsC;IAEtC,OAAO,YAAY,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC;AACnF,CAAC;AAED,SAAgB,mBAAmB,CAClC,KAA6B,EAC7B,YAA0C;IAE1C,OAAO,cAAc,CAAC,KAAK,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;AACvD,CAAC;AAED,SAAgB,sBAAsB,CACrC,KAA6B,EAC7B,YAA0C;IAE1C,OAAO,uBAAuB,CAAC,KAAK,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;AAChE,CAAC"}
@@ -0,0 +1,79 @@
1
+ import { Logger } from '@n8n/backend-common';
2
+ import { type Variables, type TagEntity, FolderRepository, TagRepository, type User } from '@n8n/db';
3
+ import { SourceControlGitService } from './source-control-git.service.ee';
4
+ import { SourceControlImportService } from './source-control-import.service.ee';
5
+ import { SourceControlPreferencesService } from './source-control-preferences.service.ee';
6
+ import type { StatusExportableCredential } from './types/exportable-credential';
7
+ import type { ExportableFolder } from './types/exportable-folders';
8
+ import type { SourceControlGetStatus } from './types/source-control-get-status';
9
+ import type { SourceControlWorkflowVersionId } from './types/source-control-workflow-version-id';
10
+ import { EventService } from '../../events/event.service';
11
+ export declare class SourceControlStatusService {
12
+ private readonly logger;
13
+ private readonly gitService;
14
+ private readonly sourceControlImportService;
15
+ private readonly sourceControlPreferencesService;
16
+ private readonly tagRepository;
17
+ private readonly folderRepository;
18
+ private readonly eventService;
19
+ constructor(logger: Logger, gitService: SourceControlGitService, sourceControlImportService: SourceControlImportService, sourceControlPreferencesService: SourceControlPreferencesService, tagRepository: TagRepository, folderRepository: FolderRepository, eventService: EventService);
20
+ private get gitFolder();
21
+ getStatus(user: User, options: SourceControlGetStatus): Promise<{
22
+ type: "workflow" | "credential" | "file" | "tags" | "variables" | "folders";
23
+ status: "unknown" | "new" | "modified" | "deleted" | "created" | "renamed" | "conflicted" | "ignored" | "staged";
24
+ id: string;
25
+ name: string;
26
+ updatedAt: string;
27
+ file: string;
28
+ location: "local" | "remote";
29
+ conflict: boolean;
30
+ pushed?: boolean | undefined;
31
+ owner?: {
32
+ type: "personal" | "team";
33
+ projectId: string;
34
+ projectName: string;
35
+ } | undefined;
36
+ }[] | {
37
+ wfRemoteVersionIds: SourceControlWorkflowVersionId[];
38
+ wfLocalVersionIds: SourceControlWorkflowVersionId[];
39
+ wfMissingInLocal: SourceControlWorkflowVersionId[];
40
+ wfMissingInRemote: SourceControlWorkflowVersionId[];
41
+ wfModifiedInEither: SourceControlWorkflowVersionId[];
42
+ credMissingInLocal: StatusExportableCredential[];
43
+ credMissingInRemote: StatusExportableCredential[];
44
+ credModifiedInEither: StatusExportableCredential[];
45
+ varMissingInLocal: Variables[];
46
+ varMissingInRemote: Variables[];
47
+ varModifiedInEither: Variables[];
48
+ tagsMissingInLocal: TagEntity[];
49
+ tagsMissingInRemote: TagEntity[];
50
+ tagsModifiedInEither: TagEntity[];
51
+ mappingsMissingInLocal: import("@n8n/db").WorkflowTagMapping[];
52
+ mappingsMissingInRemote: import("@n8n/db").WorkflowTagMapping[];
53
+ foldersMissingInLocal: ExportableFolder[];
54
+ foldersMissingInRemote: ExportableFolder[];
55
+ foldersModifiedInEither: ExportableFolder[];
56
+ sourceControlledFiles: {
57
+ type: "workflow" | "credential" | "file" | "tags" | "variables" | "folders";
58
+ status: "unknown" | "new" | "modified" | "deleted" | "created" | "renamed" | "conflicted" | "ignored" | "staged";
59
+ id: string;
60
+ name: string;
61
+ updatedAt: string;
62
+ file: string;
63
+ location: "local" | "remote";
64
+ conflict: boolean;
65
+ pushed?: boolean | undefined;
66
+ owner?: {
67
+ type: "personal" | "team";
68
+ projectId: string;
69
+ projectName: string;
70
+ } | undefined;
71
+ }[];
72
+ }>;
73
+ private resetWorkfolder;
74
+ private getStatusWorkflows;
75
+ private getStatusCredentials;
76
+ private getStatusVariables;
77
+ private getStatusTagsMappings;
78
+ private getStatusFoldersMapping;
79
+ }
@@ -0,0 +1,439 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.SourceControlStatusService = void 0;
13
+ const backend_common_1 = require("@n8n/backend-common");
14
+ const db_1 = require("@n8n/db");
15
+ const di_1 = require("@n8n/di");
16
+ const permissions_1 = require("@n8n/permissions");
17
+ const n8n_workflow_1 = require("n8n-workflow");
18
+ const source_control_git_service_ee_1 = require("./source-control-git.service.ee");
19
+ const source_control_helper_ee_1 = require("./source-control-helper.ee");
20
+ const source_control_import_service_ee_1 = require("./source-control-import.service.ee");
21
+ const source_control_preferences_service_ee_1 = require("./source-control-preferences.service.ee");
22
+ const source_control_context_1 = require("./types/source-control-context");
23
+ const forbidden_error_1 = require("../../errors/response-errors/forbidden.error");
24
+ const event_service_1 = require("../../events/event.service");
25
+ let SourceControlStatusService = class SourceControlStatusService {
26
+ constructor(logger, gitService, sourceControlImportService, sourceControlPreferencesService, tagRepository, folderRepository, eventService) {
27
+ this.logger = logger;
28
+ this.gitService = gitService;
29
+ this.sourceControlImportService = sourceControlImportService;
30
+ this.sourceControlPreferencesService = sourceControlPreferencesService;
31
+ this.tagRepository = tagRepository;
32
+ this.folderRepository = folderRepository;
33
+ this.eventService = eventService;
34
+ }
35
+ get gitFolder() {
36
+ return this.sourceControlPreferencesService.gitFolder;
37
+ }
38
+ async getStatus(user, options) {
39
+ const context = new source_control_context_1.SourceControlContext(user);
40
+ if (options.direction === 'pull' && !(0, permissions_1.hasGlobalScope)(user, 'sourceControl:pull')) {
41
+ throw new forbidden_error_1.ForbiddenError('You do not have permission to pull from source control');
42
+ }
43
+ const sourceControlledFiles = [];
44
+ await this.resetWorkfolder();
45
+ const { wfRemoteVersionIds, wfLocalVersionIds, wfMissingInLocal, wfMissingInRemote, wfModifiedInEither, } = await this.getStatusWorkflows(options, context, sourceControlledFiles);
46
+ const { credMissingInLocal, credMissingInRemote, credModifiedInEither } = await this.getStatusCredentials(options, context, sourceControlledFiles);
47
+ const { varMissingInLocal, varMissingInRemote, varModifiedInEither } = await this.getStatusVariables(options, sourceControlledFiles);
48
+ const { tagsMissingInLocal, tagsMissingInRemote, tagsModifiedInEither, mappingsMissingInLocal, mappingsMissingInRemote, } = await this.getStatusTagsMappings(options, context, sourceControlledFiles);
49
+ const { foldersMissingInLocal, foldersMissingInRemote, foldersModifiedInEither } = await this.getStatusFoldersMapping(options, context, sourceControlledFiles);
50
+ if (options.direction === 'push') {
51
+ this.eventService.emit('source-control-user-started-push-ui', (0, source_control_helper_ee_1.getTrackingInformationFromPrePushResult)(user.id, sourceControlledFiles));
52
+ }
53
+ else if (options.direction === 'pull') {
54
+ this.eventService.emit('source-control-user-started-pull-ui', (0, source_control_helper_ee_1.getTrackingInformationFromPullResult)(user.id, sourceControlledFiles));
55
+ }
56
+ if (options?.verbose) {
57
+ return {
58
+ wfRemoteVersionIds,
59
+ wfLocalVersionIds,
60
+ wfMissingInLocal,
61
+ wfMissingInRemote,
62
+ wfModifiedInEither,
63
+ credMissingInLocal,
64
+ credMissingInRemote,
65
+ credModifiedInEither,
66
+ varMissingInLocal,
67
+ varMissingInRemote,
68
+ varModifiedInEither,
69
+ tagsMissingInLocal,
70
+ tagsMissingInRemote,
71
+ tagsModifiedInEither,
72
+ mappingsMissingInLocal,
73
+ mappingsMissingInRemote,
74
+ foldersMissingInLocal,
75
+ foldersMissingInRemote,
76
+ foldersModifiedInEither,
77
+ sourceControlledFiles,
78
+ };
79
+ }
80
+ else {
81
+ return sourceControlledFiles;
82
+ }
83
+ }
84
+ async resetWorkfolder() {
85
+ if (!this.gitService.git) {
86
+ throw new Error('Git service not initialized');
87
+ }
88
+ try {
89
+ await this.gitService.resetBranch();
90
+ await this.gitService.pull();
91
+ }
92
+ catch (error) {
93
+ this.logger.error(`Failed to reset workfolder: ${error instanceof Error ? error.message : String(error)}`);
94
+ throw new n8n_workflow_1.UserError(`Unable to fetch updates from git - your folder might be out of sync. Try reconnecting from the Source Control settings page. Git error message: ${error instanceof Error ? error.message : String(error)}`);
95
+ }
96
+ }
97
+ async getStatusWorkflows(options, context, sourceControlledFiles) {
98
+ const wfRemoteVersionIds = await this.sourceControlImportService.getRemoteVersionIdsFromFiles(context);
99
+ const wfLocalVersionIds = await this.sourceControlImportService.getLocalVersionIdsFromDb(context);
100
+ let outOfScopeWF = [];
101
+ if (!context.hasAccessToAllProjects()) {
102
+ outOfScopeWF = await this.sourceControlImportService.getAllLocalVersionIdsFromDb();
103
+ outOfScopeWF = outOfScopeWF.filter((wf) => !wfLocalVersionIds.some((local) => local.id === wf.id));
104
+ }
105
+ const wfMissingInLocal = wfRemoteVersionIds
106
+ .filter((remote) => wfLocalVersionIds.findIndex((local) => local.id === remote.id) === -1)
107
+ .filter((remote) => !outOfScopeWF.some((outOfScope) => outOfScope.id === remote.id));
108
+ const wfMissingInRemote = wfLocalVersionIds.filter((local) => wfRemoteVersionIds.findIndex((remote) => remote.id === local.id) === -1);
109
+ const wfModifiedInEither = [];
110
+ wfLocalVersionIds.forEach((localWorkflow) => {
111
+ const remoteWorkflowWithSameId = wfRemoteVersionIds.find((removeWorkflow) => removeWorkflow.id === localWorkflow.id);
112
+ if (!remoteWorkflowWithSameId) {
113
+ return;
114
+ }
115
+ if ((0, source_control_helper_ee_1.isWorkflowModified)(localWorkflow, remoteWorkflowWithSameId)) {
116
+ let name = (options?.preferLocalVersion ? localWorkflow?.name : remoteWorkflowWithSameId?.name) ??
117
+ 'Workflow';
118
+ if (localWorkflow.name &&
119
+ remoteWorkflowWithSameId?.name &&
120
+ localWorkflow.name !== remoteWorkflowWithSameId.name) {
121
+ name = options?.preferLocalVersion
122
+ ? `${localWorkflow.name} (Remote: ${remoteWorkflowWithSameId.name})`
123
+ : (name = `${remoteWorkflowWithSameId.name} (Local: ${localWorkflow.name})`);
124
+ }
125
+ wfModifiedInEither.push({
126
+ ...localWorkflow,
127
+ name,
128
+ versionId: options.preferLocalVersion
129
+ ? localWorkflow.versionId
130
+ : remoteWorkflowWithSameId.versionId,
131
+ localId: localWorkflow.versionId,
132
+ remoteId: remoteWorkflowWithSameId.versionId,
133
+ });
134
+ }
135
+ });
136
+ wfMissingInLocal.forEach((item) => {
137
+ sourceControlledFiles.push({
138
+ id: item.id,
139
+ name: item.name ?? 'Workflow',
140
+ type: 'workflow',
141
+ status: options.direction === 'push' ? 'deleted' : 'created',
142
+ location: options.direction === 'push' ? 'local' : 'remote',
143
+ conflict: false,
144
+ file: item.filename,
145
+ updatedAt: item.updatedAt ?? new Date().toISOString(),
146
+ owner: item.owner,
147
+ });
148
+ });
149
+ wfMissingInRemote.forEach((item) => {
150
+ sourceControlledFiles.push({
151
+ id: item.id,
152
+ name: item.name ?? 'Workflow',
153
+ type: 'workflow',
154
+ status: options.direction === 'push' ? 'created' : 'deleted',
155
+ location: options.direction === 'push' ? 'local' : 'remote',
156
+ conflict: options.direction === 'push' ? false : true,
157
+ file: item.filename,
158
+ updatedAt: item.updatedAt ?? new Date().toISOString(),
159
+ owner: item.owner,
160
+ });
161
+ });
162
+ wfModifiedInEither.forEach((item) => {
163
+ sourceControlledFiles.push({
164
+ id: item.id,
165
+ name: item.name ?? 'Workflow',
166
+ type: 'workflow',
167
+ status: 'modified',
168
+ location: options.direction === 'push' ? 'local' : 'remote',
169
+ conflict: true,
170
+ file: item.filename,
171
+ updatedAt: item.updatedAt ?? new Date().toISOString(),
172
+ owner: item.owner,
173
+ });
174
+ });
175
+ return {
176
+ wfRemoteVersionIds,
177
+ wfLocalVersionIds,
178
+ wfMissingInLocal,
179
+ wfMissingInRemote,
180
+ wfModifiedInEither,
181
+ };
182
+ }
183
+ async getStatusCredentials(options, context, sourceControlledFiles) {
184
+ const credRemoteIds = await this.sourceControlImportService.getRemoteCredentialsFromFiles(context);
185
+ const credLocalIds = await this.sourceControlImportService.getLocalCredentialsFromDb(context);
186
+ const credMissingInLocal = credRemoteIds.filter((remote) => credLocalIds.findIndex((local) => local.id === remote.id) === -1);
187
+ const credMissingInRemote = credLocalIds.filter((local) => credRemoteIds.findIndex((remote) => remote.id === local.id) === -1);
188
+ const credModifiedInEither = [];
189
+ credLocalIds.forEach((local) => {
190
+ const mismatchingCreds = credRemoteIds.find((remote) => {
191
+ return remote.id === local.id && (remote.name !== local.name || remote.type !== local.type);
192
+ });
193
+ if (mismatchingCreds) {
194
+ credModifiedInEither.push({
195
+ ...local,
196
+ name: options?.preferLocalVersion ? local.name : mismatchingCreds.name,
197
+ });
198
+ }
199
+ });
200
+ credMissingInLocal.forEach((item) => {
201
+ sourceControlledFiles.push({
202
+ id: item.id,
203
+ name: item.name ?? 'Credential',
204
+ type: 'credential',
205
+ status: options.direction === 'push' ? 'deleted' : 'created',
206
+ location: options.direction === 'push' ? 'local' : 'remote',
207
+ conflict: false,
208
+ file: item.filename,
209
+ updatedAt: new Date().toISOString(),
210
+ owner: item.ownedBy,
211
+ });
212
+ });
213
+ credMissingInRemote.forEach((item) => {
214
+ sourceControlledFiles.push({
215
+ id: item.id,
216
+ name: item.name ?? 'Credential',
217
+ type: 'credential',
218
+ status: options.direction === 'push' ? 'created' : 'deleted',
219
+ location: options.direction === 'push' ? 'local' : 'remote',
220
+ conflict: options.direction === 'push' ? false : true,
221
+ file: item.filename,
222
+ updatedAt: new Date().toISOString(),
223
+ owner: item.ownedBy,
224
+ });
225
+ });
226
+ credModifiedInEither.forEach((item) => {
227
+ sourceControlledFiles.push({
228
+ id: item.id,
229
+ name: item.name ?? 'Credential',
230
+ type: 'credential',
231
+ status: 'modified',
232
+ location: options.direction === 'push' ? 'local' : 'remote',
233
+ conflict: true,
234
+ file: item.filename,
235
+ updatedAt: new Date().toISOString(),
236
+ owner: item.ownedBy,
237
+ });
238
+ });
239
+ return {
240
+ credMissingInLocal,
241
+ credMissingInRemote,
242
+ credModifiedInEither,
243
+ };
244
+ }
245
+ async getStatusVariables(options, sourceControlledFiles) {
246
+ const varRemoteIds = await this.sourceControlImportService.getRemoteVariablesFromFile();
247
+ const varLocalIds = await this.sourceControlImportService.getLocalVariablesFromDb();
248
+ const varMissingInLocal = varRemoteIds.filter((remote) => varLocalIds.findIndex((local) => local.id === remote.id) === -1);
249
+ const varMissingInRemote = varLocalIds.filter((local) => varRemoteIds.findIndex((remote) => remote.id === local.id) === -1);
250
+ const varModifiedInEither = [];
251
+ varLocalIds.forEach((local) => {
252
+ const mismatchingIds = varRemoteIds.find((remote) => (remote.id === local.id && remote.key !== local.key) ||
253
+ (remote.id !== local.id && remote.key === local.key));
254
+ if (mismatchingIds) {
255
+ varModifiedInEither.push(options.preferLocalVersion ? local : mismatchingIds);
256
+ }
257
+ });
258
+ varMissingInLocal.forEach((item) => {
259
+ sourceControlledFiles.push({
260
+ id: item.id,
261
+ name: item.key,
262
+ type: 'variables',
263
+ status: options.direction === 'push' ? 'deleted' : 'created',
264
+ location: options.direction === 'push' ? 'local' : 'remote',
265
+ conflict: false,
266
+ file: (0, source_control_helper_ee_1.getVariablesPath)(this.gitFolder),
267
+ updatedAt: new Date().toISOString(),
268
+ });
269
+ });
270
+ varMissingInRemote.forEach((item) => {
271
+ sourceControlledFiles.push({
272
+ id: item.id,
273
+ name: item.key,
274
+ type: 'variables',
275
+ status: options.direction === 'push' ? 'created' : 'deleted',
276
+ location: options.direction === 'push' ? 'local' : 'remote',
277
+ conflict: options.direction === 'push' ? false : true,
278
+ file: (0, source_control_helper_ee_1.getVariablesPath)(this.gitFolder),
279
+ updatedAt: new Date().toISOString(),
280
+ });
281
+ });
282
+ varModifiedInEither.forEach((item) => {
283
+ sourceControlledFiles.push({
284
+ id: item.id,
285
+ name: item.key,
286
+ type: 'variables',
287
+ status: 'modified',
288
+ location: options.direction === 'push' ? 'local' : 'remote',
289
+ conflict: true,
290
+ file: (0, source_control_helper_ee_1.getVariablesPath)(this.gitFolder),
291
+ updatedAt: new Date().toISOString(),
292
+ });
293
+ });
294
+ return {
295
+ varMissingInLocal,
296
+ varMissingInRemote,
297
+ varModifiedInEither,
298
+ };
299
+ }
300
+ async getStatusTagsMappings(options, context, sourceControlledFiles) {
301
+ const lastUpdatedTag = await this.tagRepository.find({
302
+ order: { updatedAt: 'DESC' },
303
+ take: 1,
304
+ select: ['updatedAt'],
305
+ });
306
+ const lastUpdatedDate = lastUpdatedTag[0]?.updatedAt ?? new Date();
307
+ const tagMappingsRemote = await this.sourceControlImportService.getRemoteTagsAndMappingsFromFile(context);
308
+ const tagMappingsLocal = await this.sourceControlImportService.getLocalTagsAndMappingsFromDb(context);
309
+ const tagsMissingInLocal = tagMappingsRemote.tags.filter((remote) => tagMappingsLocal.tags.findIndex((local) => local.id === remote.id) === -1);
310
+ const tagsMissingInRemote = tagMappingsLocal.tags.filter((local) => tagMappingsRemote.tags.findIndex((remote) => remote.id === local.id) === -1);
311
+ const tagsModifiedInEither = [];
312
+ tagMappingsLocal.tags.forEach((local) => {
313
+ const mismatchingIds = tagMappingsRemote.tags.find((remote) => remote.id === local.id && remote.name !== local.name);
314
+ if (!mismatchingIds) {
315
+ return;
316
+ }
317
+ tagsModifiedInEither.push(options.preferLocalVersion ? local : mismatchingIds);
318
+ });
319
+ const mappingsMissingInLocal = tagMappingsRemote.mappings.filter((remote) => tagMappingsLocal.mappings.findIndex((local) => local.tagId === remote.tagId && local.workflowId === remote.workflowId) === -1);
320
+ const mappingsMissingInRemote = tagMappingsLocal.mappings.filter((local) => tagMappingsRemote.mappings.findIndex((remote) => remote.tagId === local.tagId && remote.workflowId === remote.workflowId) === -1);
321
+ tagsMissingInLocal.forEach((item) => {
322
+ sourceControlledFiles.push({
323
+ id: item.id,
324
+ name: item.name,
325
+ type: 'tags',
326
+ status: options.direction === 'push' ? 'deleted' : 'created',
327
+ location: options.direction === 'push' ? 'local' : 'remote',
328
+ conflict: false,
329
+ file: (0, source_control_helper_ee_1.getTagsPath)(this.gitFolder),
330
+ updatedAt: lastUpdatedDate.toISOString(),
331
+ });
332
+ });
333
+ tagsMissingInRemote.forEach((item) => {
334
+ sourceControlledFiles.push({
335
+ id: item.id,
336
+ name: item.name,
337
+ type: 'tags',
338
+ status: options.direction === 'push' ? 'created' : 'deleted',
339
+ location: options.direction === 'push' ? 'local' : 'remote',
340
+ conflict: options.direction === 'push' ? false : true,
341
+ file: (0, source_control_helper_ee_1.getTagsPath)(this.gitFolder),
342
+ updatedAt: lastUpdatedDate.toISOString(),
343
+ });
344
+ });
345
+ tagsModifiedInEither.forEach((item) => {
346
+ sourceControlledFiles.push({
347
+ id: item.id,
348
+ name: item.name,
349
+ type: 'tags',
350
+ status: 'modified',
351
+ location: options.direction === 'push' ? 'local' : 'remote',
352
+ conflict: true,
353
+ file: (0, source_control_helper_ee_1.getTagsPath)(this.gitFolder),
354
+ updatedAt: lastUpdatedDate.toISOString(),
355
+ });
356
+ });
357
+ return {
358
+ tagsMissingInLocal,
359
+ tagsMissingInRemote,
360
+ tagsModifiedInEither,
361
+ mappingsMissingInLocal,
362
+ mappingsMissingInRemote,
363
+ };
364
+ }
365
+ async getStatusFoldersMapping(options, context, sourceControlledFiles) {
366
+ const lastUpdatedFolder = await this.folderRepository.find({
367
+ order: { updatedAt: 'DESC' },
368
+ take: 1,
369
+ select: ['updatedAt'],
370
+ });
371
+ const lastUpdatedDate = lastUpdatedFolder[0]?.updatedAt ?? new Date();
372
+ const foldersMappingsRemote = await this.sourceControlImportService.getRemoteFoldersAndMappingsFromFile(context);
373
+ const foldersMappingsLocal = await this.sourceControlImportService.getLocalFoldersAndMappingsFromDb(context);
374
+ const foldersMissingInLocal = foldersMappingsRemote.folders.filter((remote) => foldersMappingsLocal.folders.findIndex((local) => local.id === remote.id) === -1);
375
+ const foldersMissingInRemote = foldersMappingsLocal.folders.filter((local) => foldersMappingsRemote.folders.findIndex((remote) => remote.id === local.id) === -1);
376
+ const foldersModifiedInEither = [];
377
+ foldersMappingsLocal.folders.forEach((local) => {
378
+ const mismatchingIds = foldersMappingsRemote.folders.find((remote) => remote.id === local.id &&
379
+ (remote.name !== local.name || remote.parentFolderId !== local.parentFolderId));
380
+ if (!mismatchingIds) {
381
+ return;
382
+ }
383
+ foldersModifiedInEither.push(options.preferLocalVersion ? local : mismatchingIds);
384
+ });
385
+ foldersMissingInLocal.forEach((item) => {
386
+ sourceControlledFiles.push({
387
+ id: item.id,
388
+ name: item.name,
389
+ type: 'folders',
390
+ status: options.direction === 'push' ? 'deleted' : 'created',
391
+ location: options.direction === 'push' ? 'local' : 'remote',
392
+ conflict: false,
393
+ file: (0, source_control_helper_ee_1.getFoldersPath)(this.gitFolder),
394
+ updatedAt: lastUpdatedDate.toISOString(),
395
+ });
396
+ });
397
+ foldersMissingInRemote.forEach((item) => {
398
+ sourceControlledFiles.push({
399
+ id: item.id,
400
+ name: item.name,
401
+ type: 'folders',
402
+ status: options.direction === 'push' ? 'created' : 'deleted',
403
+ location: options.direction === 'push' ? 'local' : 'remote',
404
+ conflict: options.direction === 'push' ? false : true,
405
+ file: (0, source_control_helper_ee_1.getFoldersPath)(this.gitFolder),
406
+ updatedAt: lastUpdatedDate.toISOString(),
407
+ });
408
+ });
409
+ foldersModifiedInEither.forEach((item) => {
410
+ sourceControlledFiles.push({
411
+ id: item.id,
412
+ name: item.name,
413
+ type: 'folders',
414
+ status: 'modified',
415
+ location: options.direction === 'push' ? 'local' : 'remote',
416
+ conflict: true,
417
+ file: (0, source_control_helper_ee_1.getFoldersPath)(this.gitFolder),
418
+ updatedAt: lastUpdatedDate.toISOString(),
419
+ });
420
+ });
421
+ return {
422
+ foldersMissingInLocal,
423
+ foldersMissingInRemote,
424
+ foldersModifiedInEither,
425
+ };
426
+ }
427
+ };
428
+ exports.SourceControlStatusService = SourceControlStatusService;
429
+ exports.SourceControlStatusService = SourceControlStatusService = __decorate([
430
+ (0, di_1.Service)(),
431
+ __metadata("design:paramtypes", [backend_common_1.Logger,
432
+ source_control_git_service_ee_1.SourceControlGitService,
433
+ source_control_import_service_ee_1.SourceControlImportService,
434
+ source_control_preferences_service_ee_1.SourceControlPreferencesService,
435
+ db_1.TagRepository,
436
+ db_1.FolderRepository,
437
+ event_service_1.EventService])
438
+ ], SourceControlStatusService);
439
+ //# sourceMappingURL=source-control-status.service.ee.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-control-status.service.ee.js","sourceRoot":"","sources":["../../../src/environments.ee/source-control/source-control-status.service.ee.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,wDAA6C;AAC7C,gCAMiB;AACjB,gCAAkC;AAClC,kDAAkD;AAClD,+CAAyC;AAEzC,mFAA0E;AAC1E,yEAOoC;AACpC,yFAAgF;AAChF,mGAA0F;AAG1F,2EAAsE;AAItE,8EAA0E;AAC1E,0DAAsD;AAG/C,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IACtC,YACkB,MAAc,EACd,UAAmC,EACnC,0BAAsD,EACtD,+BAAgE,EAChE,aAA4B,EAC5B,gBAAkC,EAClC,YAA0B;QAN1B,WAAM,GAAN,MAAM,CAAQ;QACd,eAAU,GAAV,UAAU,CAAyB;QACnC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